!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).layeredToolkit=t()}(this,(function(){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&s[s.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,s,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){s={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return a}function o(e,t,n){if(n||2===arguments.length)for(var r,s=0,i=t.length;s1||o(e,t)}))},t&&(r[e]=t(r[e])))}function o(e,t){try{!function(e){e.value instanceof c?Promise.resolve(e.value.v).then(l,u):d(i[0][2],e)}(s[e](t))}catch(e){d(i[0][3],e)}}function l(e){o("next",e)}function u(e){o("throw",e)}function d(e,t){e(t),i.shift(),i.length&&o(i[0][0],i[0][1])}}function u(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=i(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,s){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,s,(t=e[n](t)).done,t.value)}))}}}function d(e){return"function"==typeof e}function h(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}"function"==typeof SuppressedError&&SuppressedError;var p=h((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function f(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var m=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,s;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var l=i(c),u=l.next();!u.done;u=l.next()){u.value.remove(this)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else c.remove(this);var h=this.initialTeardown;if(d(h))try{h()}catch(e){s=e instanceof p?e.errors:[e]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var m=i(f),b=m.next();!b.done;b=m.next()){var g=b.value;try{y(g)}catch(e){s=null!=s?s:[],e instanceof p?s=o(o([],a(s)),a(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{b&&!b.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}}if(s)throw new p(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)y(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&f(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&f(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),b=m.EMPTY;function g(e){return e instanceof m||e&&"closed"in e&&d(e.remove)&&d(e.add)&&d(e.unsubscribe)}function y(e){d(e)?e():e.unsubscribe()}var v={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},w={setTimeout:function(e,t){for(var n=[],r=2;r0},enumerable:!1,configurable:!0}),n.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},n.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,s=n.isStopped,i=n.observers;return r||s?b:(this.currentObservers=null,i.push(e),new m((function(){t.currentObservers=null,f(i,e)})))},n.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,s=t.isStopped;n?e.error(r):s&&e.complete()},n.prototype.asObservable=function(){var e=new O;return e.source=this,e},n.create=function(e,t){return new D(e,t)},n}(O),D=function(e){function n(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t(n,e),n.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},n.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},n.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},n.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:b},n}(U),z=function(e){function n(t){var n=e.call(this)||this;return n._value=t,n}return t(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(U),H={now:function(){return(H.delegate||Date).now()},delegate:void 0},G=function(e){function n(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=H);var s=e.call(this)||this;return s._bufferSize=t,s._windowTime=n,s._timestampProvider=r,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=n===1/0,s._bufferSize=Math.max(1,t),s._windowTime=Math.max(1,n),s}return t(n,e),n.prototype.next=function(t){var n=this,r=n.isStopped,s=n._buffer,i=n._infiniteTimeWindow,a=n._timestampProvider,o=n._windowTime;r||(s.push(t),!i&&s.push(a.now()+o)),this._trimBuffer(),e.prototype.next.call(this,t)},n.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),s=0;s0&&(t=new S({next:function(e){return m.next(e)},error:function(e){u=!0,d(),r=Le(h,s,e),m.error(e)},complete:function(){l=!0,d(),r=Le(h,a),m.complete()}}),ce(e).subscribe(t))}))(e)}}function Le(e,t){for(var n=[],r=2;r0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var s=e.getVersionPrecision(t),i=e.getVersionPrecision(n),a=Math.max(s,i),o=0,c=e.map([t,n],(function(t){var n=a-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(o=a-Math.min(s,i)),a-=1;a>=o;){if(c[0][a]>c[1][a])return 1;if(c[0][a]===c[1][a]){if(a===o)return 0;a-=1}else if(c[0][a]1?s-1:0),a=1;a0){var a=Object.keys(n),c=o.default.find(a,(function(e){return t.isOS(e)}));if(c){var l=this.satisfies(n[c]);if(void 0!==l)return l}var u=o.default.find(a,(function(e){return t.isPlatform(e)}));if(u){var d=this.satisfies(n[u]);if(void 0!==d)return d}}if(i>0){var h=Object.keys(s),p=o.default.find(h,(function(e){return t.isBrowser(e,!0)}));if(void 0!==p)return this.compareVersion(s[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),s=o.default.getBrowserTypeByAlias(r);return t&&s&&(r=s.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,s=this.getBrowserVersion();if("string"==typeof s)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(o.default.compareVersions(s,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=l,e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,s=(r=n(17))&&r.__esModule?r:{default:r},i=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=s.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=s.default.getFirstMatch(i,e)||s.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=s.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=s.default.getFirstMatch(i,e)||s.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=s.default.getFirstMatch(i,e)||s.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=s.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=s.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=s.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=s.default.getFirstMatch(i,e)||s.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=s.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=s.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=s.default.getFirstMatch(i,e)||s.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=s.default.getFirstMatch(i,e)||s.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=s.default.getFirstMatch(i,e)||s.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=s.default.getFirstMatch(i,e)||s.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=s.default.getFirstMatch(i,e)||s.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=s.default.getFirstMatch(i,e)||s.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=s.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=s.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=s.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=s.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=s.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=s.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=s.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=s.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=s.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=s.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=s.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=s.default.getFirstMatch(i,e)||s.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=s.default.getFirstMatch(i,e)||s.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=s.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=s.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=s.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=s.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=s.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=s.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=s.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=s.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=s.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=s.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:s.default.getFirstMatch(t,e),version:s.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,s=(r=n(17))&&r.__esModule?r:{default:r},i=n(18),a=[{test:[/Roku\/DVP/],describe:function(e){var t=s.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:i.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=s.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=s.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=s.default.getWindowsVersionName(t);return{name:i.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:i.OS_MAP.iOS},n=s.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=s.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=s.default.getMacOSVersionName(t),r={name:i.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=s.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=s.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=s.default.getAndroidVersionName(t),r={name:i.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=s.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:i.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=s.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||s.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||s.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:i.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=s.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=s.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:i.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:i.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=s.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,s=(r=n(17))&&r.__esModule?r:{default:r},i=n(18),a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=s.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=s.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,s=(r=n(17))&&r.__esModule?r:{default:r},i=n(18),a=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:i.ENGINE_MAP.Blink};var t=s.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:i.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:i.ENGINE_MAP.Trident},n=s.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:i.ENGINE_MAP.Presto},n=s.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:i.ENGINE_MAP.Gecko},n=s.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:i.ENGINE_MAP.WebKit},n=s.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=a,e.exports=t.default}})}(We);var Ze=$e(We.exports);function Qe(){}function Ke(e){return e()}function Ye(e,...t){if(null==e)return Qe;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}const Je=[];function Xe(e,t=Qe){let n;const r=new Set;function s(t){if(function(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}(e,t)&&(e=t,n)){const t=!Je.length;for(const t of r)t[1](),Je.push(t,e);if(t){for(let e=0;e{r.delete(o),0===r.size&&n&&(n(),n=null)}}}}function et(e,t,n){const r=!Array.isArray(e),s=r?[e]:e,i=t.length<2;return a=e=>{let n=!1;const a=[];let o=0,c=Qe;const l=()=>{if(o)return;c();const n=t(r?a[0]:a,e);i?e(n):c="function"==typeof n?n:Qe},u=s.map(((e,t)=>Ye(e,(e=>{a[t]=e,o&=~(1<{o|=1<1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Bt,(function(e,n,r,s,i,a){if(n)t.minimumIntegerDigits=r.length;else{if(s&&i)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(Tt.test(i.stem))t.minimumIntegerDigits=i.stem.length;else if(St.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(St,(function(e,n,r,s,i,a){return"*"===r?t.minimumFractionDigits=n.length:s&&"#"===s[0]?t.maximumFractionDigits=s.length:i&&a?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+a.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var a=i.options[0];"w"===a?t=n(n({},t),{trailingZeroDisplay:"stripIfInteger"}):a&&(t=n(n({},t),Mt(a)))}else if(It.test(i.stem))t=n(n({},t),Mt(i.stem));else{var o=Ot(i.stem);o&&(t=n(n({},t),o));var c=Nt(i.stem);c&&(t=n(n({},t),c))}}return t}var jt,Lt={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function Ut(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(Lt[n||""]||Lt[r||""]||Lt["".concat(r,"-001")]||Lt["001"])[0]}var Dt=new RegExp("^".concat(At.source,"*")),zt=new RegExp("".concat(At.source,"*$"));function Ht(e,t){return{start:e,end:t}}var Gt=!!String.prototype.startsWith,qt=!!String.fromCodePoint,$t=!!Object.fromEntries,Vt=!!String.prototype.codePointAt,Wt=!!String.prototype.trimStart,Zt=!!String.prototype.trimEnd,Qt=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Kt=!0;try{Kt="a"===(null===(jt=sn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===jt?void 0:jt[0])}catch(SIe){Kt=!1}var Yt,Jt=Gt?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},Xt=qt?String.fromCodePoint:function(){for(var e=[],t=0;ti;){if((n=e[i++])>1114111)throw RangeError(n+" is not a valid code point");r+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return r},en=$t?Object.fromEntries:function(e){for(var t={},n=0,r=e;n=n)){var r,s=e.charCodeAt(t);return s<55296||s>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?s:r-56320+(s-55296<<10)+65536}},nn=Wt?function(e){return e.trimStart()}:function(e){return e.replace(Dt,"")},rn=Zt?function(e){return e.trimEnd()}:function(e){return e.replace(zt,"")};function sn(e,t){return new RegExp(e,t)}if(Kt){var an=sn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Yt=function(e,t){var n;return an.lastIndex=t,null!==(n=an.exec(e)[1])&&void 0!==n?n:""}}else Yt=function(e,t){for(var n=[];;){var r=tn(e,t);if(void 0===r||un(r)||dn(r))break;n.push(r),t+=r>=65536?2:1}return Xt.apply(void 0,n)};var on=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var s=this.char();if(123===s){if((i=this.parseArgument(e,n)).err)return i;r.push(i.val)}else{if(125===s&&e>0)break;if(35!==s||"plural"!==t&&"selectordinal"!==t){if(60===s&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(lt.UNMATCHED_CLOSING_TAG,Ht(this.clonePosition(),this.clonePosition()))}if(60===s&&!this.ignoreTag&&cn(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;r.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;r.push(i.val)}}else{var a=this.clonePosition();this.bump(),r.push({type:ut.pound,location:Ht(a,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:ut.literal,value:"<".concat(r,"/>"),location:Ht(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var s=this.parseMessage(e+1,t,!0);if(s.err)return s;var i=s.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:ut.tag,value:r,children:i,location:Ht(n,this.clonePosition())},err:null}:this.error(lt.INVALID_TAG,Ht(a,this.clonePosition())))}return this.error(lt.UNCLOSED_TAG,Ht(n,this.clonePosition()))}return this.error(lt.INVALID_TAG,Ht(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&ln(this.char());)this.bump();return this.message.slice(e,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var s=this.tryParseQuote(t);if(s)r+=s;else{var i=this.tryParseUnquoted(e,t);if(i)r+=i;else{var a=this.tryParseLeftAngleBracket();if(!a)break;r+=a}}}var o=Ht(n,this.clonePosition());return{val:{type:ut.literal,value:r,location:o},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(cn(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return Xt.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),Xt(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(lt.EXPECT_ARGUMENT_CLOSING_BRACE,Ht(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(lt.EMPTY_ARGUMENT,Ht(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(lt.MALFORMED_ARGUMENT,Ht(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(lt.EXPECT_ARGUMENT_CLOSING_BRACE,Ht(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:ut.argument,value:r,location:Ht(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(lt.EXPECT_ARGUMENT_CLOSING_BRACE,Ht(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(lt.MALFORMED_ARGUMENT,Ht(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=Yt(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:Ht(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,r,s){var i,a=this.clonePosition(),o=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(o){case"":return this.error(lt.EXPECT_ARGUMENT_TYPE,Ht(a,c));case"number":case"date":case"time":this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition();if((y=this.parseSimpleArgStyleIfPossible()).err)return y;if(0===(f=rn(y.val)).length)return this.error(lt.EXPECT_ARGUMENT_STYLE,Ht(this.clonePosition(),this.clonePosition()));l={style:f,styleLocation:Ht(u,this.clonePosition())}}if((v=this.tryParseArgumentClose(s)).err)return v;var d=Ht(s,this.clonePosition());if(l&&Jt(null==l?void 0:l.style,"::",0)){var h=nn(l.style.slice(2));if("number"===o)return(y=this.parseNumberSkeletonFromString(h,l.styleLocation)).err?y:{val:{type:ut.number,value:r,location:d,style:y.val},err:null};if(0===h.length)return this.error(lt.EXPECT_DATE_TIME_SKELETON,d);var p=h;this.locale&&(p=function(e,t){for(var n="",r=0;r>1),c=Ut(t);for("H"!=c&&"k"!=c||(o=0);o-- >0;)n+="a";for(;a-- >0;)n=c+n}else n+="J"===s?"H":s}return n}(h,this.locale));var f={type:dt.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?Pt(p):{}};return{val:{type:"date"===o?ut.date:ut.time,value:r,location:d,style:f},err:null}}return{val:{type:"number"===o?ut.number:"date"===o?ut.date:ut.time,value:r,location:d,style:null!==(i=null==l?void 0:l.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":var m=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(lt.EXPECT_SELECT_ARGUMENT_OPTIONS,Ht(m,n({},m)));this.bumpSpace();var b=this.parseIdentifierIfPossible(),g=0;if("select"!==o&&"offset"===b.value){if(!this.bumpIf(":"))return this.error(lt.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Ht(this.clonePosition(),this.clonePosition()));var y;if(this.bumpSpace(),(y=this.tryParseDecimalInteger(lt.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,lt.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return y;this.bumpSpace(),b=this.parseIdentifierIfPossible(),g=y.val}var v,w=this.tryParsePluralOrSelectOptions(e,o,t,b);if(w.err)return w;if((v=this.tryParseArgumentClose(s)).err)return v;var x=Ht(s,this.clonePosition());return"select"===o?{val:{type:ut.select,value:r,options:en(w.val),location:x},err:null}:{val:{type:ut.plural,value:r,options:en(w.val),offset:g,pluralType:"plural"===o?"cardinal":"ordinal",location:x},err:null};default:return this.error(lt.INVALID_ARGUMENT_TYPE,Ht(a,c))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(lt.EXPECT_ARGUMENT_CLOSING_BRACE,Ht(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(lt.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Ht(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=e.split(_t).filter((function(e){return e.length>0})),n=[],r=0,s=t;r=48&&a<=57))break;s=!0,i=10*i+(a-48),this.bump()}var o=Ht(r,this.clonePosition());return s?Qt(i*=n)?{val:i,err:null}:this.error(t,o):this.error(e,o)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=tn(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(Jt(this.message,e,this.offset())){for(var t=0;t=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&un(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function cn(e){return e>=97&&e<=122||e>=65&&e<=90}function ln(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function un(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function dn(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function hn(e){e.forEach((function(e){if(delete e.location,yt(e)||vt(e))for(var t in e.options)delete e.options[t].location,hn(e.options[t].value);else mt(e)&&kt(e.style)||(bt(e)||gt(e))&&Et(e.style)?delete e.style.location:xt(e)&&hn(e.children)}))}function pn(e,t){void 0===t&&(t={}),t=n({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new on(e,t).parse();if(r.err){var s=SyntaxError(lt[r.err.kind]);throw s.location=r.err.location,s.originalMessage=r.err.message,s}return(null==t?void 0:t.captureLocation)||hn(r.val),r.val}function fn(e,t){var n=t&&t.cache?t.cache:kn,r=t&&t.serializer?t.serializer:vn;return(t&&t.strategy?t.strategy:yn)(e,{cache:n,serializer:r})}function mn(e,t,n,r){var s,i=null==(s=r)||"number"==typeof s||"boolean"==typeof s?r:n(r),a=t.get(i);return void 0===a&&(a=e.call(this,r),t.set(i,a)),a}function bn(e,t,n){var r=Array.prototype.slice.call(arguments,3),s=n(r),i=t.get(s);return void 0===i&&(i=e.apply(this,r),t.set(s,i)),i}function gn(e,t,n,r,s){return n.bind(t,e,r,s)}function yn(e,t){return gn(e,this,1===e.length?mn:bn,t.cache.create(),t.serializer)}var vn=function(){return JSON.stringify(arguments)};function wn(){this.cache=Object.create(null)}wn.prototype.get=function(e){return this.cache[e]},wn.prototype.set=function(e,t){this.cache[e]=t};var xn,kn={create:function(){return new wn}},En={variadic:function(e,t){return gn(e,this,bn,t.cache.create(),t.serializer)},monadic:function(e,t){return gn(e,this,mn,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(xn||(xn={}));var An,Cn=function(e){function n(t,n,r){var s=e.call(this,t)||this;return s.code=n,s.originalMessage=r,s}return t(n,e),n.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},n}(Error),Pn=function(e){function n(t,n,r,s){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),xn.INVALID_VALUE,s)||this}return t(n,e),n}(Cn),_n=function(e){function n(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),xn.INVALID_VALUE,r)||this}return t(n,e),n}(Cn),Sn=function(e){function n(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),xn.MISSING_VALUE,n)||this}return t(n,e),n}(Cn);function In(e){return"function"==typeof e}function Bn(e,t,n,r,s,i,a){if(1===e.length&&pt(e[0]))return[{type:An.literal,value:e[0].value}];for(var o=[],c=0,l=e;c0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])},e.__parse=pn,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const Nn={},Rn=(e,t,n)=>n?(t in Nn||(Nn[t]={}),e in Nn[t]||(Nn[t][e]=n),n):n,Fn=(e,t)=>{if(null==t)return;if(t in Nn&&e in Nn[t])return Nn[t][e];const n=pr(t);for(let r=0;r0){const t=n.slice(e,n.length).join(".");if(t in r){r=r[t];break}}r=r[n[e]]}else r=void 0;return r}(n,t);return r}function zn(e,...t){delete Nn[e],Ln.update((n=>(n[e]=ht.all([n[e]||{},...t]),n)))}et([Ln],(([e])=>Object.keys(e))),Ln.subscribe((e=>jn=e));const Hn={};function Gn(e){return Hn[e]}function qn(e){return null!=e&&pr(e).some((e=>{var t;return null==(t=Gn(e))?void 0:t.size}))}function $n(e,t){const n=Promise.all(t.map((t=>(function(e,t){Hn[e].delete(t),0===Hn[e].size&&delete Hn[e]}(e,t),t().then((e=>e.default||e))))));return n.then((t=>zn(e,...t)))}const Vn={};function Wn(e){if(!qn(e))return e in Vn?Vn[e]:Promise.resolve();const t=function(e){return pr(e).map((e=>{const t=Gn(e);return[e,t?[...t]:[]]})).filter((([,e])=>e.length>0))}(e);return Vn[e]=Promise.all(t.map((([e,t])=>$n(e,t)))).then((()=>{if(qn(e))return Wn(e);delete Vn[e]})),Vn[e]}var Zn=Object.getOwnPropertySymbols,Qn=Object.prototype.hasOwnProperty,Kn=Object.prototype.propertyIsEnumerable,Yn=(e,t)=>{var n={};for(var r in e)Qn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Zn)for(var r of Zn(e))t.indexOf(r)<0&&Kn.call(e,r)&&(n[r]=e[r]);return n};function Jn({locale:e,id:t}){console.warn(`[svelte-i18n] The message "${t}" was not found in "${pr(e).join('", "')}".${qn(fr())?"\n\nNote: there are at least one loader still registered to this locale that wasn't executed.":""}`)}const Xn={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function er(){return Xn}function tr(e){const t=e,{formats:n}=t,r=Yn(t,["formats"]);let s=e.fallbackLocale;if(e.initialLocale)try{On.resolveLocale(e.initialLocale)&&(s=e.initialLocale)}catch(t){console.warn(`[svelte-i18n] The initial locale "${e.initialLocale}" is not a valid locale.`)}return r.warnOnMissingMessages&&(delete r.warnOnMissingMessages,null==r.handleMissingMessage?r.handleMissingMessage=Jn:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(Xn,r,{initialLocale:s}),n&&("number"in n&&Object.assign(Xn.formats.number,n.number),"date"in n&&Object.assign(Xn.formats.date,n.date),"time"in n&&Object.assign(Xn.formats.time,n.time)),mr.set(s)}const nr=Xe(!1);var rr=Object.defineProperty,sr=Object.defineProperties,ir=Object.getOwnPropertyDescriptors,ar=Object.getOwnPropertySymbols,or=Object.prototype.hasOwnProperty,cr=Object.prototype.propertyIsEnumerable,lr=(e,t,n)=>t in e?rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let ur;const dr=Xe(null);function hr(e){return e.split("-").map(((e,t,n)=>n.slice(0,t+1).join("-"))).reverse()}function pr(e,t=er().fallbackLocale){const n=hr(e);return t?[...new Set([...n,...hr(t)])]:n}function fr(){return null!=ur?ur:void 0}dr.subscribe((e=>{ur=null!=e?e:void 0,"undefined"!=typeof window&&null!=e&&document.documentElement.setAttribute("lang",e)}));const mr=((e,t)=>sr(e,ir(t)))(((e,t)=>{for(var n in t||(t={}))or.call(t,n)&&lr(e,n,t[n]);if(ar)for(var n of ar(t))cr.call(t,n)&&lr(e,n,t[n]);return e})({},dr),{set:e=>{if(e&&function(e){if(null==e)return;const t=pr(e);for(let e=0;enr.set(!0)),t):nr.set(!0),Wn(e).then((()=>{dr.set(e)})).finally((()=>{clearTimeout(n),nr.set(!1)}))}return dr.set(e)}}),br=()=>"undefined"==typeof window?null:window.navigator.language||window.navigator.languages[0],gr=e=>{const t=Object.create(null);return n=>{const r=JSON.stringify(n);return r in t?t[r]:t[r]=e(n)}};var yr=Object.defineProperty,vr=Object.getOwnPropertySymbols,wr=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,kr=(e,t,n)=>t in e?yr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Er=(e,t)=>{for(var n in t||(t={}))wr.call(t,n)&&kr(e,n,t[n]);if(vr)for(var n of vr(t))xr.call(t,n)&&kr(e,n,t[n]);return e},Ar=(e,t)=>{var n={};for(var r in e)wr.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&vr)for(var r of vr(e))t.indexOf(r)<0&&xr.call(e,r)&&(n[r]=e[r]);return n};const Cr=(e,t)=>{const{formats:n}=er();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Pr=gr((e=>{var t=e,{locale:n,format:r}=t,s=Ar(t,["locale","format"]);if(null==n)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return r&&(s=Cr("number",r)),new Intl.NumberFormat(n,s)})),_r=gr((e=>{var t=e,{locale:n,format:r}=t,s=Ar(t,["locale","format"]);if(null==n)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return r?s=Cr("date",r):0===Object.keys(s).length&&(s=Cr("date","short")),new Intl.DateTimeFormat(n,s)})),Sr=gr((e=>{var t=e,{locale:n,format:r}=t,s=Ar(t,["locale","format"]);if(null==n)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return r?s=Cr("time",r):0===Object.keys(s).length&&(s=Cr("time","short")),new Intl.DateTimeFormat(n,s)})),Ir=gr(((e,t=fr())=>new On(e,t,er().formats,{ignoreTag:er().ignoreTag}))),Br=(e,t={})=>{var n,r,s,i;let a=t;"object"==typeof e&&(a=e,e=a.id);const{values:o,locale:c=fr(),default:l}=a;if(null==c)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let u=Fn(e,c);if(u){if("string"!=typeof u)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof u}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),u}else u=null!=(i=null!=(s=null==(r=(n=er()).handleMissingMessage)?void 0:r.call(n,{locale:c,id:e,defaultValue:l}))?s:l)?i:e;if(!o)return u;let d=u;try{d=Ir(u,c).format(o)}catch(t){t instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return d},Tr=(e,t)=>((e={})=>{var t=e,{locale:n=fr()}=t,r=Ar(t,["locale"]);return Sr(Er({locale:n},r))})(t).format(e),Mr=(e,t)=>((e={})=>{var t=e,{locale:n=fr()}=t,r=Ar(t,["locale"]);return _r(Er({locale:n},r))})(t).format(e),Or=(e,t)=>((e={})=>{var t=e,{locale:n=fr()}=t,r=Ar(t,["locale"]);return Pr(Er({locale:n},r))})(t).format(e),Nr=(e,t=fr())=>Fn(e,t),Rr=et([mr,Ln],(()=>Br));et([mr],(()=>Tr)),et([mr],(()=>Mr)),et([mr],(()=>Or)),et([mr,Ln],(()=>Nr));let Fr=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"");var jr={exports:{}};!function(e){!function(t,n){e.exports=n()}(self,(()=>{return e={7629:(e,t,n)=>{const r=n(375),s=n(8571),i=n(9474),a=n(1687),o=n(8652),c=n(8160),l=n(3292),u=n(6354),d=n(8901),h=n(9708),p=n(6914),f=n(2294),m=n(6133),b=n(1152),g=n(8863),y=n(2036),v={Base:class{constructor(e){this.type=e,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new f.Ids,this._preferences=null,this._refs=new m.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return r("function"==typeof h.describe,"Manifest functionality disabled"),h.describe(this)}allow(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return r(void 0!==e,"Missing example"),c.assertOptions(t,["override"]),this._inner("examples",e,{single:!0,override:t.override})}external(e,t){return"object"==typeof e&&(r(!t,"Cannot combine options with description"),t=e.description,e=e.method),r("function"==typeof e,"Method must be a function"),r(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this._inner("externals",{method:e,description:t},{single:!0})}failover(e,t){return this._default("failover",e,t)}forbidden(){return this.presence("forbidden")}id(e){return e?(r("string"==typeof e,"id must be a non-empty string"),r(/^[^\.]+$/.test(e),"id cannot contain period character"),this.$_setFlag("id",e)):this.$_setFlag("id",void 0)}invalid(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0])||arguments[0];return r("boolean"==typeof e,"Invalid mode:",e),this.$_setFlag("only",e)}optional(){return this.presence("optional")}prefs(e){r(e,"Missing preferences"),r(void 0===e.context,"Cannot override context"),r(void 0===e.externals,"Cannot override externals"),r(void 0===e.warnings,"Cannot override warnings"),r(void 0===e.debug,"Cannot override debug"),c.checkPreferences(e);const t=this.clone();return t._preferences=c.preferences(t._preferences,e),t}presence(e){return r(["optional","required","forbidden"].includes(e),"Unknown presence mode",e),this.$_setFlag("presence",e)}raw(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$_setFlag("result",e?"raw":void 0)}result(e){return r(["raw","strip"].includes(e),"Unknown result mode",e),this.$_setFlag("result",e)}required(){return this.presence("required")}strict(e){const t=this.clone(),n=void 0!==e&&!e;return t._preferences=c.preferences(t._preferences,{convert:n}),t}strip(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$_setFlag("result",e?"strip":void 0)}tag(){for(var e=arguments.length,t=new Array(e),n=0;ne.keep||e.name!==n)),t._singleRules.delete(n));for(const n of e._rules)e._definition.rules[n.method].multi||t._singleRules.set(n.name,n),t._rules.push(n);if(t._flags.empty&&e._flags.empty){t._flags.empty=t._flags.empty.concat(e._flags.empty);const n=Object.assign({},e._flags);delete n.empty,a(t._flags,n)}else if(e._flags.empty){t._flags.empty=e._flags.empty;const n=Object.assign({},e._flags);delete n.empty,a(t._flags,n)}else a(t._flags,e._flags);for(const n in e.$_terms){const r=e.$_terms[n];r?t.$_terms[n]?t.$_terms[n]=t.$_terms[n].concat(r):t.$_terms[n]=r.slice():t.$_terms[n]||(t.$_terms[n]=r)}return this.$_root._tracer&&this.$_root._tracer._combine(t,[this,e]),t.$_mutateRebuild()}extend(e){return r(!e.base,"Cannot extend type with another base"),d.type(this,e)}extract(e){return e=Array.isArray(e)?e:e.split("."),this._ids.reach(e)}fork(e,t){r(!this._inRuleset(),"Cannot fork inside a ruleset");let n=this;for(let r of[].concat(e))r=Array.isArray(r)?r:r.split("."),n=n._ids.fork(r,t,n);return n.$_temp.ruleset=!1,n}rule(e){const t=this._definition;c.assertOptions(e,Object.keys(t.modifiers)),r(!1!==this.$_temp.ruleset,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const n=null===this.$_temp.ruleset?this._rules.length-1:this.$_temp.ruleset;r(n>=0&&nt.tailor(e),ref:!1}),t.$_temp.ruleset=!1,t.$_mutateRebuild()}tracer(){return b.location?b.location(this):this}validate(e,t){return g.entry(e,this,t)}validateAsync(e,t){return g.entryAsync(e,this,t)}$_addRule(e){"string"==typeof e&&(e={name:e}),r(e&&"object"==typeof e,"Invalid options"),r(e.name&&"string"==typeof e.name,"Invalid rule name");for(const t in e)r("_"!==t[0],"Cannot set private rule properties");const t=Object.assign({},e);t._resolve=[],t.method=t.method||t.name;const n=this._definition.rules[t.method],s=t.args;r(n,"Unknown rule",t.method);const i=this.clone();if(s){r(1===Object.keys(s).length||Object.keys(s).length===this._definition.rules[t.name].args.length,"Invalid rule definition for",this.type,t.name);for(const e in s){let a=s[e];if(n.argsByName){const o=n.argsByName.get(e);if(o.ref&&c.isResolvable(a))t._resolve.push(e),i.$_mutateRegister(a);else if(o.normalize&&(a=o.normalize(a),s[e]=a),o.assert){const t=c.validateArg(a,e,o);r(!t,t,"or reference")}}void 0!==a?s[e]=a:delete s[e]}}return n.multi||(i._ruleRemove(t.name,{clone:!1}),i._singleRules.set(t.name,t)),!1===i.$_temp.ruleset&&(i.$_temp.ruleset=null),n.priority?i._rules.unshift(t):i._rules.push(t),i}$_compile(e,t){return l.schema(this.$_root,e,t)}$_createError(e,t,n,r,s){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const a=!1!==i.flags?this._flags:{},o=i.messages?p.merge(this._definition.messages,i.messages):this._definition.messages;return new u.Report(e,t,n,a,o,r,s)}$_getFlag(e){return this._flags[e]}$_getRule(e){return this._singleRules.get(e)}$_mapLabels(e){return e=Array.isArray(e)?e:e.split("."),this._ids.labels(e)}$_match(e,t,n,r){(n=Object.assign({},n)).abortEarly=!0,n._externals=!1,t.snapshot();const s=!g.validate(e,this,t,n,r).errors;return t.restore(),s}$_modify(e){return c.assertOptions(e,["each","once","ref","schema"]),f.schema(this,e)||this}$_mutateRebuild(){return r(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(e,t)=>{let{source:n,name:r,path:s,key:i}=t;const a=this._definition[n][r]&&this._definition[n][r].register;!1!==a&&this.$_mutateRegister(e,{family:a,key:i})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(e){let{family:t,key:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._refs.register(e,t),this._ids.register(e,{key:n})}$_property(e){return this._definition.properties[e]}$_reach(e){return this._ids.reach(e)}$_rootReferences(){return this._refs.roots()}$_setFlag(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r("_"===e[0]||!this._inRuleset(),"Cannot set flag inside a ruleset");const s=this._definition.flags[e]||{};if(i(t,s.default)&&(t=void 0),i(t,this._flags[e]))return this;const a=!1!==n.clone?this.clone():this;return void 0!==t?(a._flags[e]=t,a.$_mutateRegister(t)):delete a._flags[e],"_"!==e[0]&&(a.$_temp.ruleset=!1),a}$_parent(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:{};return c.assertOptions(n,"literal"),r(void 0!==t,"Missing",e,"value"),r("function"==typeof t||!n.literal,"Only function value supports literal option"),"function"==typeof t&&n.literal&&(t={[c.symbols.literal]:!0,literal:t}),this.$_setFlag(e,t)}_generate(e,t,n){if(!this.$_terms.whens)return{schema:this};const r=[],s=[];for(let i=0;il)break}const i=s.join(", ");if(t.mainstay.tracer.debug(t,"rule","when",i),!i)return{schema:this};if(!t.mainstay.tracer.active&&this.$_temp.whens[i])return{schema:this.$_temp.whens[i],id:i};let a=this;this._definition.generate&&(a=this._definition.generate(this,e,t,n));for(const e of r)a=a.concat(e);return this.$_root._tracer&&this.$_root._tracer._combine(a,[this,...r]),this.$_temp.whens[i]=a,{schema:a,id:i}}_inner(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r(!this._inRuleset(),`Cannot set ${e} inside a ruleset`);const s=this.clone();return s.$_terms[e]&&!n.override||(s.$_terms[e]=[]),n.single?s.$_terms[e].push(t):s.$_terms[e].push(...t),s.$_temp.ruleset=!1,s}_inRuleset(){return null!==this.$_temp.ruleset&&!1!==this.$_temp.ruleset}_ruleRemove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._singleRules.has(e))return this;const n=!1!==t.clone?this.clone():this;n._singleRules.delete(e);const r=[];for(let t=0;t{const r=n(375),s=n(8571),i=n(8160),a={max:1e3,supported:new Set(["undefined","boolean","number","string"])};t.provider={provision:e=>new a.Cache(e)},a.Cache=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.assertOptions(e,["max"]),r(void 0===e.max||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||a.max,this._map=new Map,this._list=new a.List}get length(){return this._map.size}set(e,t){if(null!==e&&!a.supported.has(typeof e))return;let n=this._map.get(e);if(n)return n.value=t,void this._list.first(n);n=this._list.unshift({key:e,value:t}),this._map.set(e,n),this._compact()}get(e){const t=this._map.get(e);if(t)return this._list.first(t),s(t.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},a.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:t,prev:n}=e;return t.prev=n,n&&(n.next=t),e===this.tail&&(this.tail=t),e.prev=null,e.next=null,e}}},8160:(e,t,n)=>{const r=n(375),s=n(7916),i=n(5934);let a,o;const c={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};t.version=i.version,t.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},t.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},t.assertOptions=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Options";r(e&&"object"==typeof e&&!Array.isArray(e),"Options must be of type object");const s=Object.keys(e).filter((e=>!t.includes(e)));r(0===s.length,`${n} contain unknown keys: ${s}`)},t.checkPreferences=function(e){o=o||n(3378);const t=o.preferences.validate(e);if(t.error)throw new s([t.error.details[0].message])},t.compare=function(e,t,n){switch(n){case"=":return e===t;case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t}},t.default=function(e,t){return void 0===e?t:e},t.isIsoDate=function(e){return c.isoDate.test(e)},t.isNumber=function(e){return"number"==typeof e&&!isNaN(e)},t.isResolvable=function(e){return!!e&&(e[t.symbols.ref]||e[t.symbols.template])},t.isSchema=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=e&&e[t.symbols.any];return!!s&&(r(n.legacy||s.version===t.version,"Cannot mix different versions of joi schemas"),!0)},t.isValues=function(e){return e[t.symbols.values]},t.limit=function(e){return Number.isSafeInteger(e)&&e>=0},t.preferences=function(e,r){a=a||n(6914),e=e||{},r=r||{};const s=Object.assign({},e,r);return r.errors&&e.errors&&(s.errors=Object.assign({},e.errors,r.errors),s.errors.wrap=Object.assign({},e.errors.wrap,r.errors.wrap)),r.messages&&(s.messages=a.compile(r.messages,e.messages)),delete s[t.symbols.prefs],s},t.tryWithPath=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{return e()}catch(e){throw void 0!==e.path?e.path=t+"."+e.path:e.path=t,n.append&&(e.message=`${e.message} (${e.path})`),e}},t.validateArg=function(e,n,r){let{assert:s,message:i}=r;if(t.isSchema(s)){const t=s.validate(e);if(!t.error)return;return t.error.message}if(!s(e))return n?`${n} ${i}`:i},t.verifyFlat=function(e,t){for(const n of e)r(!Array.isArray(n),"Method no longer accepts array arguments:",t)}},3292:(e,t,n)=>{const r=n(375),s=n(8160),i=n(6133),a={};t.schema=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s.assertOptions(n,["appendPath","override"]);try{return a.schema(e,t,n)}catch(e){throw n.appendPath&&void 0!==e.path&&(e.message=`${e.message} (${e.path})`),e}},a.schema=function(e,t,n){r(void 0!==t,"Invalid undefined schema"),Array.isArray(t)&&(r(t.length,"Invalid empty array schema"),1===t.length&&(t=t[0]));const i=function(t){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:{};s.assertOptions(i,["legacy"]);const o=n&&n[s.symbols.any];if(o)return r(i.legacy||o.version===s.version,"Cannot mix different versions of joi schemas:",o.version,s.version),n;if("object"!=typeof n||!i.legacy)return t.schema(e,n,{appendPath:!0});const c=a.walk(n);return c?c.compile(c.root,n):t.schema(e,n,{appendPath:!0})},a.walk=function(e){if("object"!=typeof e)return null;if(Array.isArray(e)){for(const t of e){const e=a.walk(t);if(e)return e}return null}const t=e[s.symbols.any];if(t)return{root:e[t.root],compile:t.compile};r(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const t in e){const n=a.walk(e[t]);if(n)return n}return null},a.simple=function(e){return null===e||["boolean","string","number"].includes(typeof e)},t.when=function(e,n,o){if(void 0===o&&(r(n&&"object"==typeof n,"Missing options"),o=n,n=i.create(".")),Array.isArray(o)&&(o={switch:o}),s.assertOptions(o,["is","not","then","otherwise","switch","break"]),s.isSchema(n))return r(void 0===o.is,'"is" can not be used with a schema condition'),r(void 0===o.not,'"not" can not be used with a schema condition'),r(void 0===o.switch,'"switch" can not be used with a schema condition'),a.condition(e,{is:n,then:o.then,otherwise:o.otherwise,break:o.break});if(r(i.isRef(n)||"string"==typeof n,"Invalid condition:",n),r(void 0===o.not||void 0===o.is,'Cannot combine "is" with "not"'),void 0===o.switch){let c=o;void 0!==o.not&&(c={is:o.not,then:o.otherwise,otherwise:o.then,break:o.break});let l=void 0!==c.is?e.$_compile(c.is):e.$_root.invalid(null,!1,0,"").required();return r(void 0!==c.then||void 0!==c.otherwise,'options must have at least one of "then", "otherwise", or "switch"'),r(void 0===c.break||void 0===c.then||void 0===c.otherwise,"Cannot specify then, otherwise, and break all together"),void 0===o.is||i.isRef(o.is)||s.isSchema(o.is)||(l=l.required()),a.condition(e,{ref:t.ref(n),is:l,then:c.then,otherwise:c.otherwise,break:c.break})}r(Array.isArray(o.switch),'"switch" must be an array'),r(void 0===o.is,'Cannot combine "switch" with "is"'),r(void 0===o.not,'Cannot combine "switch" with "not"'),r(void 0===o.then,'Cannot combine "switch" with "then"');const c={ref:t.ref(n),switch:[],break:o.break};for(let t=0;t{const r=n(5688),s=n(8160),i=n(3328);t.Report=class{constructor(e,n,r,s,i,a,o){if(this.code=e,this.flags=s,this.messages=i,this.path=a.path,this.prefs=o,this.state=a,this.value=n,this.message=null,this.template=null,this.local=r||{},this.local.label=t.label(this.flags,this.state,this.prefs,this.messages),void 0===this.value||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const e=this.path[this.path.length-1];"object"!=typeof e&&(this.local.key=e)}}_setTemplate(e){if(this.template=e,!this.flags.label&&0===this.path.length){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const e=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return void 0===t?`Error code "${e}" is not defined, your custom type is missing the correct messages definition`:(this.message=t.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(e,n){return t.template(this.value,e,n||this.code,this.state,this.prefs)}},t.path=function(e){let t="";for(const n of e)"object"!=typeof n&&("string"==typeof n?(t&&(t+="."),t+=n):t+=`[${n}]`);return t},t.template=function(e,t,n,r,a){if(!t)return;if(i.isTemplate(t))return"root"!==n?t:null;let o=a.errors.language;if(s.isResolvable(o)&&(o=o.resolve(e,r,a)),o&&t[o]){if(void 0!==t[o][n])return t[o][n];if(void 0!==t[o]["*"])return t[o]["*"]}return t[n]?t[n]:t["*"]},t.label=function(e,n,r,s){if(e.label)return e.label;if(!r.errors.label)return"";let i=n.path;return"key"===r.errors.label&&n.path.length>1&&(i=n.path.slice(-1)),t.path(i)||t.template(null,r.messages,"root",n,r)||s&&t.template(null,s,"root",n,r)||"value"},t.process=function(e,n,r){if(!e)return null;const{override:s,message:i,details:a}=t.details(e);if(s)return s;if(r.errors.stack)return new t.ValidationError(i,a,n);const o=Error.stackTraceLimit;Error.stackTraceLimit=0;const c=new t.ValidationError(i,a,n);return Error.stackTraceLimit=o,c},t.details=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];const r=[];for(const s of e){if(s instanceof Error){if(!1!==t.override)return{override:s};const e=s.toString();n.push(e),r.push({message:e,type:"override",context:{error:s}});continue}const e=s.toString();n.push(e),r.push({message:e,path:s.path.filter((e=>"object"!=typeof e)),type:s.code,context:s.local})}return n.length>1&&(n=[...new Set(n)]),{message:n.join(". "),details:r}},t.ValidationError=class extends Error{constructor(e,t,n){super(e),this._original=n,this.details=t}static isError(e){return e instanceof t.ValidationError}},t.ValidationError.prototype.isJoi=!0,t.ValidationError.prototype.name="ValidationError",t.ValidationError.prototype.annotate=r.error},8901:(e,t,n)=>{const r=n(375),s=n(8571),i=n(8160),a=n(6914),o={};t.type=function(e,t){const n=Object.getPrototypeOf(e),c=s(n),l=e._assign(Object.create(c)),u=Object.assign({},t);delete u.base,c._definition=u;const d=n._definition||{};u.messages=a.merge(d.messages,u.messages),u.properties=Object.assign({},d.properties,u.properties),l.type=u.type,u.flags=Object.assign({},d.flags,u.flags);const h=Object.assign({},d.terms);if(u.terms)for(const e in u.terms){const t=u.terms[e];r(void 0===l.$_terms[e],"Invalid term override for",u.type,e),l.$_terms[e]=t.init,h[e]=t}u.terms=h,u.args||(u.args=d.args),u.prepare=o.prepare(u.prepare,d.prepare),u.coerce&&("function"==typeof u.coerce&&(u.coerce={method:u.coerce}),u.coerce.from&&!Array.isArray(u.coerce.from)&&(u.coerce={method:u.coerce.method,from:[].concat(u.coerce.from)})),u.coerce=o.coerce(u.coerce,d.coerce),u.validate=o.validate(u.validate,d.validate);const p=Object.assign({},d.rules);if(u.rules)for(const e in u.rules){const t=u.rules[e];r("object"==typeof t,"Invalid rule definition for",u.type,e);let n=t.method;if(void 0===n&&(n=function(){return this.$_addRule(e)}),n&&(r(!c[e],"Rule conflict in",u.type,e),c[e]=n),r(!p[e],"Rule conflict in",u.type,e),p[e]=t,t.alias){const e=[].concat(t.alias);for(const n of e)c[n]=t.method}t.args&&(t.argsByName=new Map,t.args=t.args.map((e=>("string"==typeof e&&(e={name:e}),r(!t.argsByName.has(e.name),"Duplicated argument name",e.name),i.isSchema(e.assert)&&(e.assert=e.assert.strict().label(e.name)),t.argsByName.set(e.name,e),e))))}u.rules=p;const f=Object.assign({},d.modifiers);if(u.modifiers)for(const e in u.modifiers){r(!c[e],"Rule conflict in",u.type,e);const t=u.modifiers[e];r("function"==typeof t,"Invalid modifier definition for",u.type,e);const n=function(t){return this.rule({[e]:t})};c[e]=n,f[e]=t}if(u.modifiers=f,u.overrides){c._super=n,l.$_super={};for(const e in u.overrides)r(n[e],"Cannot override missing",e),u.overrides[e][i.symbols.parent]=n[e],l.$_super[e]=n[e].bind(l);Object.assign(c,u.overrides)}u.cast=Object.assign({},d.cast,u.cast);const m=Object.assign({},d.manifest,u.manifest);return m.build=o.build(u.manifest&&u.manifest.build,d.manifest&&d.manifest.build),u.manifest=m,u.rebuild=o.rebuild(u.rebuild,d.rebuild),l},o.build=function(e,t){return e&&t?function(n,r){return t(e(n,r),r)}:e||t},o.coerce=function(e,t){return e&&t?{from:e.from&&t.from?[...new Set([...e.from,...t.from])]:null,method(n,r){let s;if((!t.from||t.from.includes(typeof n))&&(s=t.method(n,r),s)){if(s.errors||void 0===s.value)return s;n=s.value}if(!e.from||e.from.includes(typeof n)){const t=e.method(n,r);if(t)return t}return s}}:e||t},o.prepare=function(e,t){return e&&t?function(n,r){const s=e(n,r);if(s){if(s.errors||void 0===s.value)return s;n=s.value}return t(n,r)||s}:e||t},o.rebuild=function(e,t){return e&&t?function(n){t(n),e(n)}:e||t},o.validate=function(e,t){return e&&t?function(n,r){const s=t(n,r);if(s){if(s.errors&&(!Array.isArray(s.errors)||s.errors.length))return s;n=s.value}return e(n,r)||s}:e||t}},5107:(e,t,n)=>{const r=n(375),s=n(8571),i=n(8652),a=n(8160),o=n(3292),c=n(6354),l=n(8901),u=n(9708),d=n(6133),h=n(3328),p=n(1152);let f;const m={types:{alternatives:n(4946),any:n(8068),array:n(546),boolean:n(4937),date:n(7500),function:n(390),link:n(8785),number:n(3832),object:n(8966),string:n(7417),symbol:n(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const e={_types:new Set(Object.keys(m.types))};for(const t of e._types)e[t]=function(){for(var e=arguments.length,n=new Array(e),s=0;s2?n-2:0),s=2;s2?n-2:0),s=2;s{const r=n(375),s=n(8571),i=n(3328);t.compile=function(e,t){if("string"==typeof e)return r(!t,"Cannot set single message string"),new i(e);if(i.isTemplate(e))return r(!t,"Cannot set single message template"),e;r("object"==typeof e&&!Array.isArray(e),"Invalid message options"),t=t?s(t):{};for(let n in e){const s=e[n];if("root"===n||i.isTemplate(s)){t[n]=s;continue}if("string"==typeof s){t[n]=new i(s);continue}r("object"==typeof s&&!Array.isArray(s),"Invalid message for",n);const a=n;for(n in t[a]=t[a]||{},s){const e=s[n];"root"===n||i.isTemplate(e)?t[a][n]=e:(r("string"==typeof e,"Invalid message for",n,"in",a),t[a][n]=new i(e))}}return t},t.decompile=function(e){const t={};for(let n in e){const r=e[n];if("root"===n){t.root=r;continue}if(i.isTemplate(r)){t[n]=r.describe({compact:!0});continue}const s=n;for(n in t[s]={},r){const e=r[n];"root"!==n?t[s][n]=e.describe({compact:!0}):t[s].root=e}}return t},t.merge=function(e,n){if(!e)return t.compile(n);if(!n)return e;if("string"==typeof n)return new i(n);if(i.isTemplate(n))return n;const a=s(e);for(let e in n){const t=n[e];if("root"===e||i.isTemplate(t)){a[e]=t;continue}if("string"==typeof t){a[e]=new i(t);continue}r("object"==typeof t&&!Array.isArray(t),"Invalid message for",e);const s=e;for(e in a[s]=a[s]||{},t){const n=t[e];"root"===e||i.isTemplate(n)?a[s][e]=n:(r("string"==typeof n,"Invalid message for",e,"in",s),a[s][e]=new i(n))}}return a}},2294:(e,t,n)=>{const r=n(375),s=n(8160),i=n(6133),a={};t.Ids=a.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new a.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[t,n]of e._byId.entries())r(!this._byKey.has(t),"Schema id conflicts with existing key:",t),this._byId.set(t,n);for(const[t,n]of e._byKey.entries())r(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,n)}fork(e,t,n){const i=this._collect(e);i.push({schema:n});const o=i.shift();let c={id:o.id,schema:t(o.schema)};r(s.isSchema(c.schema),"adjuster function failed to return a joi schema type");for(const e of i)c={id:e.id,schema:a.fork(e.schema,c.id,c.schema)};return c.schema}labels(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=e[0],r=this._get(n);if(!r)return[...t,...e].join(".");const s=e.slice(1);return t=[...t,r.schema._flags.label||n],s.length?r.schema._ids.labels(s,t):t.join(".")}reach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=e[0],s=this._get(n);r(s,"Schema does not contain path",[...t,...e].join("."));const i=e.slice(1);return i.length?s.schema._ids.reach(i,[...t,n]):s.schema}register(e){let{key:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||!s.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const n=e._flags.id;if(n){const t=this._byId.get(n);r(!t||t.schema===e,"Cannot add different schemas with the same id:",n),r(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:e,id:n})}t&&(r(!this._byKey.has(t),"Schema already contains key:",t),r(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,{schema:e,id:t}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const s=e[0],i=this._get(s);r(i,"Schema does not contain path",[...t,...e].join(".")),n=[i,...n];const a=e.slice(1);return a.length?i.schema._ids._collect(a,[...t,s],n):n}_get(e){return this._byId.get(e)||this._byKey.get(e)}},a.fork=function(e,n,r){const s=t.schema(e,{each:(e,t)=>{let{key:s}=t;if(n===(e._flags.id||s))return r},ref:!1});return s?s.$_mutateRebuild():e},t.schema=function(e,t){let n;for(const r in e._flags){if("_"===r[0])continue;const s=a.scan(e._flags[r],{source:"flags",name:r},t);void 0!==s&&(n=n||e.clone(),n._flags[r]=s)}for(let r=0;r{const r=n(375),s=n(8571),i=n(9621),a=n(8160);let o;const c={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};t.create=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("string"==typeof e,"Invalid reference key:",e),a.assertOptions(t,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),r(!t.prefix||"object"==typeof t.prefix,"options.prefix must be of type object");const n=Object.assign({},c.defaults,t);delete n.prefix;const s=n.separator,i=c.context(e,s,t.prefix);if(n.type=i.type,e=i.key,"value"===n.type)if(i.root&&(r(!s||e[0]!==s,"Cannot specify relative path with root prefix"),n.ancestor="root",e||(e=null)),s&&s===e)e=null,n.ancestor=0;else if(void 0!==n.ancestor)r(!s||!e||e[0]!==s,"Cannot combine prefix with ancestor option");else{const[t,r]=c.ancestor(e,s);r&&""===(e=e.slice(r))&&(e=null),n.ancestor=t}return n.path=s?null===e?[]:e.split(s):[e],new c.Ref(n)},t.in=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.create(e,{...n,in:!0})},t.isRef=function(e){return!!e&&!!e[a.symbols.ref]},c.Ref=class{constructor(e){r("object"==typeof e,"Invalid reference construction"),a.assertOptions(e,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),r([!1,void 0].includes(e.separator)||"string"==typeof e.separator&&1===e.separator.length,"Invalid separator"),r(!e.adjust||"function"==typeof e.adjust,"options.adjust must be a function"),r(!e.map||Array.isArray(e.map),"options.map must be an array"),r(!e.map||!e.adjust,"Cannot set both map and adjust options"),Object.assign(this,c.defaults,e),r("value"===this.type||void 0===this.ancestor,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(e,t,n,s){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return r(!this.in||i.in,"Invalid in() reference usage"),"global"===this.type?this._resolve(n.context,t,i):"local"===this.type?this._resolve(s,t,i):this.ancestor?"root"===this.ancestor?this._resolve(t.ancestors[t.ancestors.length-1],t,i):(r(this.ancestor<=t.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(t.ancestors[this.ancestor-1],t,i)):this._resolve(e,t,i)}_resolve(e,t,n){let r;if("value"===this.type&&t.mainstay.shadow&&!1!==n.shadow&&(r=t.mainstay.shadow.get(this.absolute(t))),void 0===r&&(r=i(e,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(r=this.adjust(r)),this.map){const e=this.map.get(r);void 0!==e&&(r=e)}return t.mainstay&&t.mainstay.tracer.resolve(t,this,r),r}toString(){return this.display}absolute(e){return[...e.path.slice(0,-this.ancestor),...this.path]}clone(){return new c.Ref(this)}describe(){const e={path:this.path};"value"!==this.type&&(e.type=this.type),"."!==this.separator&&(e.separator=this.separator),"value"===this.type&&1!==this.ancestor&&(e.ancestor=this.ancestor),this.map&&(e.map=[...this.map]);for(const t of["adjust","iterables","render"])null!==this[t]&&void 0!==this[t]&&(e[t]=this[t]);return!1!==this.in&&(e.in=!0),{ref:e}}updateDisplay(){const e=null!==this.key?this.key:"";if("value"!==this.type)return void(this.display=`ref:${this.type}:${e}`);if(!this.separator)return void(this.display=`ref:${e}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${e}`);if("root"===this.ancestor)return void(this.display=`ref:root:${e}`);if(1===this.ancestor)return void(this.display=`ref:${e||".."}`);const t=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${t}${e||""}`}},c.Ref.prototype[a.symbols.ref]=!0,t.build=function(e){return"value"===(e=Object.assign({},c.defaults,e)).type&&void 0===e.ancestor&&(e.ancestor=1),new c.Ref(e)},c.context=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e=e.trim(),n){const r=void 0===n.global?"$":n.global;if(r!==t&&e.startsWith(r))return{key:e.slice(r.length),type:"global"};const s=void 0===n.local?"#":n.local;if(s!==t&&e.startsWith(s))return{key:e.slice(s.length),type:"local"};const i=void 0===n.root?"/":n.root;if(i!==t&&e.startsWith(i))return{key:e.slice(i.length),type:"value",root:!0}}return{key:e,type:"value"}},c.ancestor=function(e,t){if(!t)return[1,0];if(e[0]!==t)return[1,0];if(e[1]!==t)return[0,1];let n=2;for(;e[n]===t;)++n;return[n-1,n]},t.toSibling=0,t.toParent=1,t.Manager=class{constructor(){this.refs=[]}register(e,r){if(e)if(r=void 0===r?t.toParent:r,Array.isArray(e))for(const t of e)this.register(t,r);else if(a.isSchema(e))for(const t of e._refs.refs)t.ancestor-r>=0&&this.refs.push({ancestor:t.ancestor-r,root:t.root});else t.isRef(e)&&"value"===e.type&&e.ancestor-r>=0&&this.refs.push({ancestor:e.ancestor-r,root:e.root}),o=o||n(3328),o.isTemplate(e)&&this.register(e.refs(),r)}get length(){return this.refs.length}clone(){const e=new t.Manager;return e.refs=s(this.refs),e}reset(){this.refs=[]}roots(){return this.refs.filter((e=>!e.ancestor)).map((e=>e.root))}}},3378:(e,t,n)=>{const r=n(5107),s={};s.wrap=r.string().min(1).max(2).allow(!1),t.preferences=r.object({allowUnknown:r.boolean(),abortEarly:r.boolean(),artifacts:r.boolean(),cache:r.boolean(),context:r.object(),convert:r.boolean(),dateFormat:r.valid("date","iso","string","time","utc"),debug:r.boolean(),errors:{escapeHtml:r.boolean(),label:r.valid("path","key",!1),language:[r.string(),r.object().ref()],render:r.boolean(),stack:r.boolean(),wrap:{label:s.wrap,array:s.wrap,string:s.wrap}},externals:r.boolean(),messages:r.object(),noDefaults:r.boolean(),nonEnumerables:r.boolean(),presence:r.valid("required","optional","forbidden"),skipFunctions:r.boolean(),stripUnknown:r.object({arrays:r.boolean(),objects:r.boolean()}).or("arrays","objects").allow(!0,!1),warnings:r.boolean()}).strict(),s.nameRx=/^[a-zA-Z0-9]\w*$/,s.rule=r.object({alias:r.array().items(r.string().pattern(s.nameRx)).single(),args:r.array().items(r.string(),r.object({name:r.string().pattern(s.nameRx).required(),ref:r.boolean(),assert:r.alternatives([r.function(),r.object().schema()]).conditional("ref",{is:!0,then:r.required()}),normalize:r.function(),message:r.string().when("assert",{is:r.function(),then:r.required()})})),convert:r.boolean(),manifest:r.boolean(),method:r.function().allow(!1),multi:r.boolean(),validate:r.function()}),t.extension=r.object({type:r.alternatives([r.string(),r.object().regex()]).required(),args:r.function(),cast:r.object().pattern(s.nameRx,r.object({from:r.function().maxArity(1).required(),to:r.function().minArity(1).maxArity(2).required()})),base:r.object().schema().when("type",{is:r.object().regex(),then:r.forbidden()}),coerce:[r.function().maxArity(3),r.object({method:r.function().maxArity(3).required(),from:r.array().items(r.string()).single()})],flags:r.object().pattern(s.nameRx,r.object({setter:r.string(),default:r.any()})),manifest:{build:r.function().arity(2)},messages:[r.object(),r.string()],modifiers:r.object().pattern(s.nameRx,r.function().minArity(1).maxArity(2)),overrides:r.object().pattern(s.nameRx,r.function()),prepare:r.function().maxArity(3),rebuild:r.function().arity(1),rules:r.object().pattern(s.nameRx,s.rule),terms:r.object().pattern(s.nameRx,r.object({init:r.array().allow(null).required(),manifest:r.object().pattern(/.+/,[r.valid("schema","single"),r.object({mapped:r.object({from:r.string().required(),to:r.string().required()}).required()})])})),validate:r.function().maxArity(3)}).strict(),t.extensions=r.array().items(r.object(),r.function().arity(1)).strict(),s.desc={buffer:r.object({buffer:r.string()}),func:r.object({function:r.function().required(),options:{literal:!0}}),override:r.object({override:!0}),ref:r.object({ref:r.object({type:r.valid("value","global","local"),path:r.array().required(),separator:r.string().length(1).allow(!1),ancestor:r.number().min(0).integer().allow("root"),map:r.array().items(r.array().length(2)).min(1),adjust:r.function(),iterables:r.boolean(),in:r.boolean(),render:r.boolean()}).required()}),regex:r.object({regex:r.string().min(3)}),special:r.object({special:r.valid("deep").required()}),template:r.object({template:r.string().required(),options:r.object()}),value:r.object({value:r.alternatives([r.object(),r.array()]).required()})},s.desc.entity=r.alternatives([r.array().items(r.link("...")),r.boolean(),r.function(),r.number(),r.string(),s.desc.buffer,s.desc.func,s.desc.ref,s.desc.regex,s.desc.special,s.desc.template,s.desc.value,r.link("/")]),s.desc.values=r.array().items(null,r.boolean(),r.function(),r.number().allow(1/0,-1/0),r.string().allow(""),r.symbol(),s.desc.buffer,s.desc.func,s.desc.override,s.desc.ref,s.desc.regex,s.desc.template,s.desc.value),s.desc.messages=r.object().pattern(/.+/,[r.string(),s.desc.template,r.object().pattern(/.+/,[r.string(),s.desc.template])]),t.description=r.object({type:r.string().required(),flags:r.object({cast:r.string(),default:r.any(),description:r.string(),empty:r.link("/"),failover:s.desc.entity,id:r.string(),label:r.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:r.boolean(),unit:r.string()}).unknown(),preferences:{allowUnknown:r.boolean(),abortEarly:r.boolean(),artifacts:r.boolean(),cache:r.boolean(),convert:r.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:r.boolean(),label:["path","key"],language:[r.string(),s.desc.ref],wrap:{label:s.wrap,array:s.wrap}},externals:r.boolean(),messages:s.desc.messages,noDefaults:r.boolean(),nonEnumerables:r.boolean(),presence:["required","optional","forbidden"],skipFunctions:r.boolean(),stripUnknown:r.object({arrays:r.boolean(),objects:r.boolean()}).or("arrays","objects").allow(!0,!1),warnings:r.boolean()},allow:s.desc.values,invalid:s.desc.values,rules:r.array().min(1).items({name:r.string().required(),args:r.object().min(1),keep:r.boolean(),message:[r.string(),s.desc.messages],warn:r.boolean()}),keys:r.object().pattern(/.*/,r.link("/")),link:s.desc.ref}).pattern(/^[a-z]\w*$/,r.any())},493:(e,t,n)=>{const r=n(8571),s=n(9621),i=n(8160),a={value:Symbol("value")};e.exports=a.State=class{constructor(e,t,n){this.path=e,this.ancestors=t,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=new a.State(e,t,this);return n&&r.schemas&&(r.schemas=[a.schemas(n),...r.schemas]),r}nest(e,t){const n=new a.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[a.schemas(e),...n.schemas],n.debug=t,n}shadow(e,t){this.mainstay.shadow=this.mainstay.shadow||new a.Shadow,this.mainstay.shadow.set(this.path,e,t)}snapshot(){this.mainstay.shadow&&(this._snapshot=r(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}},a.schemas=function(e){return i.isSchema(e)?{schema:e}:e},a.Shadow=class{constructor(){this._values=null}set(e,t,n){if(!e.length)return;if("strip"===n&&"number"==typeof e[e.length-1])return;this._values=this._values||new Map;let r=this._values;for(let t=0;t{const r=n(375),s=n(8571),i=n(5277),a=n(1447),o=n(8160),c=n(6354),l=n(6133),u={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};e.exports=u.Template=class{constructor(e,t){r("string"==typeof e,"Template source must be a string"),r(!e.includes("\0")&&!e.includes(""),"Template source cannot contain reserved control characters"),this.source=e,this.rendered=e,this._template=null,this._settings=s(t),this._parse()}_parse(){if(!this.source.includes("{"))return;const e=u.encode(this.source),t=u.split(e);let n=!1;const r=[],s=t.shift();s&&r.push(s);for(const e of t){const t="{"!==e[0],s=t?"}":"}}",i=e.indexOf(s);if(-1===i||"{"===e[1]){r.push(`{${u.decode(e)}`);continue}let a=e.slice(t?0:1,i);const o=":"===a[0];o&&(a=a.slice(1));const c=this._ref(u.decode(a),{raw:t,wrapped:o});r.push(c),"string"!=typeof c&&(n=!0);const l=e.slice(i+s.length);l&&r.push(u.decode(l))}n?this._template=r:this.rendered=r.join("")}static date(e,t){return u.dateFormat[t.dateFormat].call(e)}describe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this._settings&&e.compact)return this.source;const t={template:this.source};return this._settings&&(t.options=this._settings),t}static build(e){return new u.Template(e.template,e.options)}isDynamic(){return!!this._template}static isTemplate(e){return!!e&&!!e[o.symbols.template]}refs(){if(!this._template)return;const e=[];for(const t of this._template)"string"!=typeof t&&e.push(...t.refs);return e}resolve(e,t,n,r){return this._template&&1===this._template.length?this._part(this._template[0],e,t,n,r,{}):this.render(e,t,n,r)}_part(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r4&&void 0!==arguments[4]?arguments[4]:{};if(!this.isDynamic())return this.rendered;const a=[];for(const o of this._template)if("string"==typeof o)a.push(o);else{const c=this._part(o,e,t,n,r,s),l=u.stringify(c,e,t,n,r,s);if(void 0!==l){const e=o.raw||!1===(s.errors&&s.errors.escapeHtml)?l:i(l);a.push(u.wrap(e,o.wrapped&&n.errors.wrap.label))}}return a.join("")}_ref(e,t){let{raw:n,wrapped:r}=t;const s=[],i=e=>{const t=l.create(e,this._settings);return s.push(t),e=>t.resolve(...e)};try{var o=new a.Parser(e,{reference:i,functions:u.functions,constants:u.constants})}catch(t){throw t.message=`Invalid template variable "${e}" fails due to: ${t.message}`,t}if(o.single){if("reference"===o.single.type){const e=s[0];return{ref:e,raw:n,refs:s,wrapped:r||"local"===e.type&&"label"===e.key}}return u.stringify(o.single.value)}return{formula:o,raw:n,refs:s}}toString(){return this.source}},u.Template.prototype[o.symbols.template]=!0,u.Template.prototype.isImmutable=!0,u.encode=function(e){return e.replace(/\\(\{+)/g,((e,t)=>u.opens.slice(0,t.length))).replace(/\\(\}+)/g,((e,t)=>u.closes.slice(0,t.length)))},u.decode=function(e){return e.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},u.split=function(e){const t=[];let n="";for(let r=0;r5&&void 0!==arguments[5]?arguments[5]:{};const a=typeof e,o=r&&r.errors&&r.errors.wrap||{};let c=!1;if(l.isRef(e)&&e.render&&(c=e.in,e=e.resolve(t,n,r,s,{in:e.in,...i})),null===e)return"null";if("string"===a)return u.wrap(e,i.arrayItems&&o.string);if("number"===a||"function"===a||"symbol"===a)return e.toString();if("object"!==a)return JSON.stringify(e);if(e instanceof Date)return u.Template.date(e,r);if(e instanceof Map){const t=[];for(const[n,r]of e.entries())t.push(`${n.toString()} -> ${r.toString()}`);e=t}if(!Array.isArray(e))return e.toString();const d=[];for(const a of e)d.push(u.stringify(a,t,n,r,s,{arrayItems:!0,...i}));return u.wrap(d.join(", "),!c&&o.array)},u.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},u.functions={if:(e,t,n)=>e?t:n,length:e=>"string"==typeof e?e.length:e&&"object"==typeof e?Array.isArray(e)?e.length:Object.keys(e).length:null,msg(e){const[t,n,r,s,i]=this,a=i.messages;if(!a)return"";const o=c.template(t,a[0],e,n,r)||c.template(t,a[1],e,n,r);return o?o.render(t,n,r,s,i):""},number:e=>"number"==typeof e?e:"string"==typeof e?parseFloat(e):"boolean"==typeof e?e?1:0:e instanceof Date?e.getTime():null}},4946:(e,t,n)=>{const r=n(375),s=n(1687),i=n(8068),a=n(8160),o=n(3292),c=n(6354),l=n(6133),u={};e.exports=i.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:l.toSibling}},args(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;rc.details(e,{override:!1})))})};if("one"===n._flags.match)return 1===t.length?{value:t[0]}:{errors:r("alternatives.one")};if(t.length!==n.$_terms.matches.length)return{errors:r("alternatives.all",{details:o.map((e=>c.details(e,{override:!1})))})};const l=e=>e.$_terms.matches.some((e=>"object"===e.schema.type||"alternatives"===e.schema.type&&l(e.schema)));return l(n)?{value:t.reduce(((e,t)=>s(e,t,{mergeArrays:!1})))}:{value:t[t.length-1]}}const o=[];for(let t=0;t"is"!==n.path[0]?t.label(e):void 0,ref:!1})}},rebuild(e){e.$_modify({each:t=>{a.isSchema(t)&&"array"===t.type&&e.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(e,t){if(t.matches)for(const n of t.matches){const{schema:t,ref:r,is:s,not:i,then:a,otherwise:o}=n;e=t?e.try(t):r?e.conditional(r,{is:s,then:a,not:i,otherwise:o,switch:n.switch}):e.conditional(s,{then:a,otherwise:o})}return e}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),u.errors=function(e,t){let{error:n,state:r}=t;if(!e.length)return{errors:n("alternatives.any")};if(1===e.length)return{errors:e[0].reports};const s=new Set,i=[];for(const{reports:t,schema:a}of e){if(t.length>1)return u.unmatched(e,n);const o=t[0];if(o instanceof c.Report==0)return u.unmatched(e,n);if(o.state.path.length!==r.path.length){i.push({type:a.type,report:o});continue}if("any.only"===o.code){for(const e of o.local.valids)s.add(e);continue}const[l,d]=o.code.split(".");"base"===d?s.add(l):i.push({type:a.type,report:o})}return i.length?1===i.length?{errors:i[0].report}:u.unmatched(e,n):{errors:n("alternatives.types",{types:[...s]})}},u.unmatched=function(e,t){const n=[];for(const t of e)n.push(...t.reports);return{errors:t("alternatives.match",c.details(n,{override:!1}))}}},8068:(e,t,n)=>{const r=n(375),s=n(7629),i=n(8160),a=n(6914);e.exports=s.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,t){return r("function"==typeof e,"Method must be a function"),r(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:t}})},validate(e,t,n){let{method:r}=n;try{return r(e,t)}catch(e){return t.error("any.custom",{error:e})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){r(i.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const t=this.clone();return t.$_terms.shared=t.$_terms.shared||[],t.$_terms.shared.push(e),t.$_mutateRegister(e),t}},warning:{method(e,t){return r(e&&"string"==typeof e,"Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:t},warn:!0})},validate(e,t,n){let{code:r,local:s}=n;return t.error(r,s)},args:["code","local"],multi:!0}},modifiers:{keep(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.keep=t},message(e,t){e.message=a.compile(t)},warn(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.warn=t}},manifest:{build(e,t){for(const n in t){const r=t[n];if(["examples","externals","metas","notes","tags"].includes(n))for(const t of r)e=e[n.slice(0,-1)](t);else if("alterations"!==n)if("whens"!==n){if("shared"===n)for(const t of r)e=e.shared(t)}else for(const t of r){const{ref:n,is:r,not:s,then:i,otherwise:a,concat:o}=t;e=o?e.concat(o):n?e.when(n,{is:r,not:s,then:i,otherwise:a,switch:t.switch,break:t.break}):e.when(r,{then:i,otherwise:a,break:t.break})}else{const t={};for(const{target:e,adjuster:n}of r)t[e]=n;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(e,t,n)=>{const r=n(375),s=n(9474),i=n(9621),a=n(8068),o=n(8160),c=n(3292),l={};e.exports=a.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(e,t){let{schema:n,state:r,prefs:s}=t;if(!Array.isArray(e))return;const i=n.$_getRule("sort");return i?l.sort(n,e,i.args.options,r,s):void 0}},validate(e,t){let{schema:n,error:r}=t;if(!Array.isArray(e)){if(n._flags.single){const t=[e];return t[o.symbols.arraySingle]=!0,{value:t}}return{errors:r("array.base")}}if(n.$_getRule("items")||n.$_terms.externals)return{value:e.slice()}},rules:{has:{method(e){e=this.$_compile(e,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:e}});return t.$_mutateRegister(e),t},validate(e,t,n){let{state:r,prefs:s,error:i}=t,{schema:a}=n;const o=[e,...r.ancestors];for(let t=0;tthis.$_compile(t[e])),e,{append:!0});r.$_terms.items.push(n)}return r.$_mutateRebuild()},validate(e,t){let{schema:n,error:r,state:s,prefs:i,errorsArray:a}=t;const c=n.$_terms._requireds.slice(),u=n.$_terms.ordered.slice(),d=[...n.$_terms._inclusions,...c],h=!e[o.symbols.arraySingle];delete e[o.symbols.arraySingle];const p=a();let f=e.length;for(let t=0;t="})}},ordered:{method(){for(var e=arguments.length,t=new Array(e),n=0;nthis.$_compile(t[e])),e,{append:!0});l.validateSingle(n,r),r.$_mutateRegister(n),r.$_terms.ordered.push(n)}return r.$_mutateRebuild()}},single:{method(e){const t=void 0===e||!!e;return r(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o.assertOptions(e,["by","order"]);const t={order:e.order||"ascending"};return e.by&&(t.by=c.ref(e.by,{ancestor:0}),r(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(e,t,n){let{error:r,state:s,prefs:i,schema:a}=t,{options:o}=n;const{value:c,errors:u}=l.sort(a,e,o,s,i);if(u)return u;for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:{};r(!e||"function"==typeof e||"string"==typeof e,"comparator must be a function or a string"),o.assertOptions(t,["ignoreUndefined","separator"]);const n={name:"unique",args:{options:t,comparator:e}};if(e)if("string"==typeof e){const r=o.default(t.separator,".");n.path=r?e.split(r):[e]}else n.comparator=e;return this.$_addRule(n)},validate(e,t,n,a){let{state:o,error:c,schema:l}=t,{comparator:u,options:d}=n,{comparator:h,path:p}=a;const f={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},m=h||s,b=d.ignoreUndefined;for(let t=0;tnew Set(e)}},rebuild(e){e.$_terms._inclusions=[],e.$_terms._exclusions=[],e.$_terms._requireds=[];for(const t of e.$_terms.items)l.validateSingle(t,e),"required"===t._flags.presence?e.$_terms._requireds.push(t):"forbidden"===t._flags.presence?e.$_terms._exclusions.push(t):e.$_terms._inclusions.push(t);for(const t of e.$_terms.ordered)l.validateSingle(t,e)},manifest:{build:(e,t)=>(t.items&&(e=e.items(...t.items)),t.ordered&&(e=e.ordered(...t.ordered)),e)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),l.fillMissedErrors=function(e,t,n,r,s,i){const a=[];let o=0;for(const e of n){const t=e._flags.label;t?a.push(t):++o}a.length?o?t.push(e.$_createError("array.includesRequiredBoth",r,{knownMisses:a,unknownMisses:o},s,i)):t.push(e.$_createError("array.includesRequiredKnowns",r,{knownMisses:a},s,i)):t.push(e.$_createError("array.includesRequiredUnknowns",r,{unknownMisses:o},s,i))},l.fillOrderedErrors=function(e,t,n,r,s,i){const a=[];for(const e of n)"required"===e._flags.presence&&a.push(e);a.length&&l.fillMissedErrors(e,t,a,r,s,i)},l.fillDefault=function(e,t,n,r){const s=[];let i=!0;for(let a=e.length-1;a>=0;--a){const o=e[a],c=[t,...n.ancestors],l=o.$_validate(void 0,n.localize(n.path,c,o),r).value;if(i){if(void 0===l)continue;i=!1}s.unshift(l)}s.length&&t.push(...s)},l.fastSplice=function(e,t){let n=t;for(;n{let d=l.compare(c,u,a,o);if(null!==d)return d;if(n.by&&(c=n.by.resolve(c,r,s),u=n.by.resolve(u,r,s)),d=l.compare(c,u,a,o),null!==d)return d;const h=typeof c;if(h!==typeof u)throw e.$_createError("array.sort.mismatching",t,null,r,s);if("number"!==h&&"string"!==h)throw e.$_createError("array.sort.unsupported",t,{type:h},r,s);return"number"===h?(c-u)*i:c{const r=n(375),s=n(8068),i=n(8160),a=n(2036),o={isBool:function(e){return"boolean"==typeof e}};e.exports=s.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(e,t){let{schema:n}=t;if("boolean"!=typeof e){if("string"==typeof e){const t=n._flags.sensitive?e:e.toLowerCase();e="true"===t||"false"!==t&&e}return"boolean"!=typeof e&&(e=n.$_terms.truthy&&n.$_terms.truthy.has(e,null,null,!n._flags.sensitive)||(!n.$_terms.falsy||!n.$_terms.falsy.has(e,null,null,!n._flags.sensitive))&&e),{value:e}}},validate(e,t){let{error:n}=t;if("boolean"!=typeof e)return{value:e,errors:n("boolean.base")}},rules:{truthy:{method(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0])||arguments[0];return this.$_setFlag("sensitive",e)}}},cast:{number:{from:o.isBool,to:(e,t)=>e?1:0},string:{from:o.isBool,to:(e,t)=>e?"true":"false"}},manifest:{build:(e,t)=>(t.truthy&&(e=e.truthy(...t.truthy)),t.falsy&&(e=e.falsy(...t.falsy)),e)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(e,t,n)=>{const r=n(375),s=n(8068),i=n(8160),a=n(3328),o={isDate:function(e){return e instanceof Date}};e.exports=s.extend({type:"date",coerce:{from:["number","string"],method(e,t){let{schema:n}=t;return{value:o.parse(e,n._flags.format)||e}}},validate(e,t){let{schema:n,error:r,prefs:s}=t;if(e instanceof Date&&!isNaN(e.getTime()))return;const i=n._flags.format;return s.convert&&i&&"string"==typeof e?{value:e,errors:r("date.format",{format:i})}:{value:e,errors:r("date.base")}},rules:{compare:{method:!1,validate(e,t,n,r){let{date:s}=n,{name:a,operator:o,args:c}=r;const l="now"===s?Date.now():s.getTime();return i.compare(e.getTime(),l,o)?e:t.error("date."+a,{limit:c.date,value:e})},args:[{name:"date",ref:!0,normalize:e=>"now"===e?e:o.parse(e),assert:e=>null!==e,message:"must have a valid date format"}]},format:{method(e){return r(["iso","javascript","unix"].includes(e),"Unknown date format",e),this.$_setFlag("format",e)}},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{date:e},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{date:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{date:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{date:e},operator:">="})}},timestamp:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"javascript";return r(["javascript","unix"].includes(e),'"type" must be one of "javascript, unix"'),this.format(e)}}},cast:{number:{from:o.isDate,to:(e,t)=>e.getTime()},string:{from:o.isDate,to(e,t){let{prefs:n}=t;return a.date(e,n)}}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),o.parse=function(e,t){if(e instanceof Date)return e;if("string"!=typeof e&&(isNaN(e)||!isFinite(e)))return null;if(/^\s*$/.test(e))return null;if("iso"===t)return i.isIsoDate(e)?o.date(e.toString()):null;const n=e;if("string"==typeof e&&/^[+-]?\d+(\.\d+)?$/.test(e)&&(e=parseFloat(e)),t){if("javascript"===t)return o.date(1*e);if("unix"===t)return o.date(1e3*e);if("string"==typeof n)return null}return o.date(e)},o.date=function(e){const t=new Date(e);return isNaN(t.getTime())?null:t}},390:(e,t,n)=>{const r=n(375),s=n(7824);e.exports=s.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(e){return r(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:e}})},validate(e,t,n){let{n:r}=n;return e.length===r?e:t.error("function.arity",{n:r})}},class:{method(){return this.$_addRule("class")},validate:(e,t)=>/^\s*class\s/.test(e.toString())?e:t.error("function.class",{value:e})},minArity:{method(e){return r(Number.isSafeInteger(e)&&e>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:e}})},validate(e,t,n){let{n:r}=n;return e.length>=r?e:t.error("function.minArity",{n:r})}},maxArity:{method(e){return r(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:e}})},validate(e,t,n){let{n:r}=n;return e.length<=r?e:t.error("function.maxArity",{n:r})}}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(e,t,n)=>{const r=n(978),s=n(375),i=n(8571),a=n(3652),o=n(8068),c=n(8160),l=n(3292),u=n(6354),d=n(6133),h=n(3328),p={renameDefaults:{alias:!1,multiple:!1,override:!1}};e.exports=o.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(e,t)=>e.keys(t),validate(e,t){let{schema:n,error:r,state:s,prefs:i}=t;if(!e||typeof e!==n.$_property("typeof")||Array.isArray(e))return{value:e,errors:r("object.base",{type:n.$_property("typeof")})};if(!(n.$_terms.renames||n.$_terms.dependencies||n.$_terms.keys||n.$_terms.patterns||n.$_terms.externals))return;e=p.clone(e,i);const a=[];if(n.$_terms.renames&&!p.rename(n,e,s,i,a))return{value:e,errors:a};if(!n.$_terms.keys&&!n.$_terms.patterns&&!n.$_terms.dependencies)return{value:e,errors:a};const o=new Set(Object.keys(e));if(n.$_terms.keys){const t=[e,...s.ancestors];for(const r of n.$_terms.keys){const n=r.key,c=e[n];o.delete(n);const l=s.localize([...s.path,n],t,r),u=r.schema.$_validate(c,l,i);if(u.errors){if(i.abortEarly)return{value:e,errors:u.errors};void 0!==u.value&&(e[n]=u.value),a.push(...u.errors)}else"strip"===r.schema._flags.result||void 0===u.value&&void 0!==c?delete e[n]:void 0!==u.value&&(e[n]=u.value)}}if(o.size||n._flags._hasPatternMatch){const t=p.unknown(n,e,o,a,s,i);if(t)return t}if(n.$_terms.dependencies)for(const t of n.$_terms.dependencies){if(null!==t.key&&!1===p.isPresent(t.options)(t.key.resolve(e,s,i,null,{shadow:!1})))continue;const r=p.dependencies[t.rel](n,t,e,s,i);if(r){const t=n.$_createError(r.code,e,r.context,s,i);if(i.abortEarly)return{value:e,errors:t};a.push(t)}}return{value:e,errors:a}},rules:{and:{method(){for(var e=arguments.length,t=new Array(e),n=0;n!e.hasOwnProperty(t.key))):new p.Keys;for(const n in e)c.tryWithPath((()=>t.$_terms.keys.push({key:n,schema:this.$_compile(e[n])})),n)}else t.$_terms.keys=new p.Keys;else t.$_terms.keys=null;return t.$_mutateRebuild()}},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate(e,t,n,r){let{limit:s}=n,{name:i,operator:a,args:o}=r;return c.compare(Object.keys(e).length,s,a)?e:t.error("object."+i,{limit:o.limit,value:e})},args:[{name:"limit",ref:!0,assert:c.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},nand:{method(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};const r=e instanceof RegExp;r||(e=this.$_compile(e,{appendPath:!0})),s(void 0!==t,"Invalid rule"),c.assertOptions(n,["fallthrough","matches"]),r&&s(!e.flags.includes("g")&&!e.flags.includes("y"),"pattern should not use global or sticky mode"),t=this.$_compile(t,{appendPath:!0});const i=this.clone();i.$_terms.patterns=i.$_terms.patterns||[];const a={[r?"regex":"schema"]:e,rule:t};return n.matches&&(a.matches=this.$_compile(n.matches),"array"!==a.matches.type&&(a.matches=a.matches.$_root.array().items(a.matches)),i.$_mutateRegister(a.matches),i.$_setFlag("_hasPatternMatch",!0,{clone:!1})),n.fallthrough&&(a.fallthrough=!0),i.$_terms.patterns.push(a),i.$_mutateRegister(t),i}},ref:{method(){return this.$_addRule("ref")},validate:(e,t)=>d.isRef(e)?e:t.error("object.refType",{value:e})},regex:{method(){return this.$_addRule("regex")},validate:(e,t)=>e instanceof RegExp?e:t.error("object.regex",{value:e})},rename:{method(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s("string"==typeof e||e instanceof RegExp,"Rename missing the from argument"),s("string"==typeof t||t instanceof h,"Invalid rename to argument"),s(t!==e,"Cannot rename key to same name:",e),c.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);const i=this.clone();i.$_terms.renames=i.$_terms.renames||[];for(const t of i.$_terms.renames)s(t.from!==e,"Cannot rename the same key multiple times");return t instanceof h&&i.$_mutateRegister(t),i.$_terms.renames.push({from:e,to:t,options:r(p.renameDefaults,n)}),i}},schema:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return this.$_addRule({name:"schema",args:{type:e}})},validate(e,t,n){let{type:r}=n;return!c.isSchema(e)||"any"!==r&&e.type!==r?t.error("object.schema",{type:r}):e}},unknown:{method(e){return this.$_setFlag("unknown",!1!==e)}},with:{method(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p.dependency(this,"with",e,t,n)}},without:{method(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p.dependency(this,"without",e,t,n)}},xor:{method(){for(var e=arguments.length,t=new Array(e),n=0;nt.add(n,{after:n.schema.$_rootReferences(),group:n.key})),n.key);e.$_terms.keys=new p.Keys(...t.nodes)}},manifest:{build(e,t){if(t.keys&&(e=e.keys(t.keys)),t.dependencies)for(const{rel:n,key:r=null,peers:s,options:i}of t.dependencies)e=p.dependency(e,n,r,s,i);if(t.patterns)for(const{regex:n,schema:r,rule:s,fallthrough:i,matches:a}of t.patterns)e=e.pattern(n||r,s,{fallthrough:i,matches:a});if(t.renames)for(const{from:n,to:r,options:s}of t.renames)e=e.rename(n,r,s);return e}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),p.clone=function(e,t){if("object"==typeof e){if(t.nonEnumerables)return i(e,{shallow:!0});const n=Object.create(Object.getPrototypeOf(e));return Object.assign(n,e),n}const n=function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&"object"==typeof r[r.length-1]?r.pop():{}),c.assertOptions(i,["separator","isPresent"]),r=[].concat(r);const a=c.default(i.separator,"."),o=[];for(const e of r)s("string"==typeof e,t,"peers must be strings"),o.push(l.ref(e,{separator:a,ancestor:0,prefix:!1}));null!==n&&(n=l.ref(n,{separator:a,ancestor:0,prefix:!1}));const u=e.clone();return u.$_terms.dependencies=u.$_terms.dependencies||[],u.$_terms.dependencies.push(new p.Dependency(t,n,o,r,i)),u},p.dependencies={and(e,t,n,r,s){const i=[],a=[],o=t.peers.length,c=p.isPresent(t.options);for(const e of t.peers)!1===c(e.resolve(n,r,s,null,{shadow:!1}))?i.push(e.key):a.push(e.key);if(i.length!==o&&a.length!==o)return{code:"object.and",context:{present:a,presentWithLabels:p.keysToLabels(e,a),missing:i,missingWithLabels:p.keysToLabels(e,i)}}},nand(e,t,n,r,s){const i=[],a=p.isPresent(t.options);for(const e of t.peers)a(e.resolve(n,r,s,null,{shadow:!1}))&&i.push(e.key);if(i.length!==t.peers.length)return;const o=t.paths[0],c=t.paths.slice(1);return{code:"object.nand",context:{main:o,mainWithLabel:p.keysToLabels(e,o),peers:c,peersWithLabels:p.keysToLabels(e,c)}}},or(e,t,n,r,s){const i=p.isPresent(t.options);for(const e of t.peers)if(i(e.resolve(n,r,s,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)}}},oxor(e,t,n,r,s){const i=[],a=p.isPresent(t.options);for(const e of t.peers)a(e.resolve(n,r,s,null,{shadow:!1}))&&i.push(e.key);if(!i.length||1===i.length)return;const o={peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)};return o.present=i,o.presentWithLabels=p.keysToLabels(e,i),{code:"object.oxor",context:o}},with(e,t,n,r,s){const i=p.isPresent(t.options);for(const a of t.peers)if(!1===i(a.resolve(n,r,s,null,{shadow:!1})))return{code:"object.with",context:{main:t.key.key,mainWithLabel:p.keysToLabels(e,t.key.key),peer:a.key,peerWithLabel:p.keysToLabels(e,a.key)}}},without(e,t,n,r,s){const i=p.isPresent(t.options);for(const a of t.peers)if(i(a.resolve(n,r,s,null,{shadow:!1})))return{code:"object.without",context:{main:t.key.key,mainWithLabel:p.keysToLabels(e,t.key.key),peer:a.key,peerWithLabel:p.keysToLabels(e,a.key)}}},xor(e,t,n,r,s){const i=[],a=p.isPresent(t.options);for(const e of t.peers)a(e.resolve(n,r,s,null,{shadow:!1}))&&i.push(e.key);if(1===i.length)return;const o={peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)};return 0===i.length?{code:"object.missing",context:o}:(o.present=i,o.presentWithLabels=p.keysToLabels(e,i),{code:"object.xor",context:o})}},p.keysToLabels=function(e,t){return Array.isArray(t)?t.map((t=>e.$_mapLabels(t))):e.$_mapLabels(t)},p.isPresent=function(e){return"function"==typeof e.isPresent?e.isPresent:e=>void 0!==e},p.rename=function(e,t,n,r,s){const i={};for(const a of e.$_terms.renames){const o=[],c="string"!=typeof a.from;if(c)for(const e in t){if(void 0===t[e]&&a.options.ignoreUndefined)continue;if(e===a.to)continue;const n=a.from.exec(e);n&&o.push({from:e,to:a.to,match:n})}else!Object.prototype.hasOwnProperty.call(t,a.from)||void 0===t[a.from]&&a.options.ignoreUndefined||o.push(a);for(const l of o){const o=l.from;let u=l.to;if(u instanceof h&&(u=u.render(t,n,r,l.match)),o!==u){if(!a.options.multiple&&i[u]&&(s.push(e.$_createError("object.rename.multiple",t,{from:o,to:u,pattern:c},n,r)),r.abortEarly))return!1;if(Object.prototype.hasOwnProperty.call(t,u)&&!a.options.override&&!i[u]&&(s.push(e.$_createError("object.rename.override",t,{from:o,to:u,pattern:c},n,r)),r.abortEarly))return!1;void 0===t[o]?delete t[u]:t[u]=t[o],i[u]=!0,a.options.alias||delete t[o]}}}return!0},p.unknown=function(e,t,n,r,s,i){if(e.$_terms.patterns){let a=!1;const o=e.$_terms.patterns.map((e=>{if(e.matches)return a=!0,[]})),c=[t,...s.ancestors];for(const a of n){const l=t[a],u=[...s.path,a];for(let d=0;d{const r=n(375),s=n(8068),i=n(8160),a=n(3292),o=n(6354),c={};e.exports=s.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(e,t)=>e.ref(t),validate(e,t){let{schema:n,state:s,prefs:i}=t;r(n.$_terms.link,"Uninitialized link schema");const a=c.generate(n,e,s,i),o=n.$_terms.link[0].ref;return a.$_validate(e,s.nest(a,`link:${o.display}:${a.type}`),i)},generate:(e,t,n,r)=>c.generate(e,t,n,r),rules:{ref:{method(e){r(!this.$_terms.link,"Cannot reinitialize schema"),e=a.ref(e),r("value"===e.type||"local"===e.type,"Invalid reference type:",e.type),r("local"===e.type||"root"===e.ancestor||e.ancestor>0,"Link cannot reference itself");const t=this.clone();return t.$_terms.link=[{ref:e}],t}},relative:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$_setFlag("relative",e)}}},overrides:{concat(e){r(this.$_terms.link,"Uninitialized link schema"),r(i.isSchema(e),"Invalid schema object"),r("link"!==e.type,"Cannot merge type link with another link");const t=this.clone();return t.$_terms.whens||(t.$_terms.whens=[]),t.$_terms.whens.push({concat:e}),t.$_mutateRebuild()}},manifest:{build:(e,t)=>(r(t.link,"Invalid link description missing link"),e.ref(t.link))}}),c.generate=function(e,t,n,r){let s=n.mainstay.links.get(e);if(s)return s._generate(t,n,r).schema;const i=e.$_terms.link[0].ref,{perspective:a,path:o}=c.perspective(i,n);c.assert(a,"which is outside of schema boundaries",i,e,n,r);try{s=o.length?a.$_reach(o):a}catch(t){c.assert(!1,"to non-existing schema",i,e,n,r)}return c.assert("link"!==s.type,"which is another link",i,e,n,r),e._flags.relative||n.mainstay.links.set(e,s),s._generate(t,n,r).schema},c.perspective=function(e,t){if("local"===e.type){for(const{schema:n,key:r}of t.schemas){if((n._flags.id||r)===e.path[0])return{perspective:n,path:e.path.slice(1)};if(n.$_terms.shared)for(const t of n.$_terms.shared)if(t._flags.id===e.path[0])return{perspective:t,path:e.path.slice(1)}}return{perspective:null,path:null}}return"root"===e.ancestor?{perspective:t.schemas[t.schemas.length-1].schema,path:e.path}:{perspective:t.schemas[e.ancestor]&&t.schemas[e.ancestor].schema,path:e.path}},c.assert=function(e,t,n,s,i,a){e||r(!1,`"${o.label(s._flags,i,a)}" contains link reference "${n.display}" ${t}`)}},3832:(e,t,n)=>{const r=n(375),s=n(8068),i=n(8160),a={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/};e.exports=s.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,t){let{schema:n,error:r}=t;if(!e.match(a.numberRx))return;e=e.trim();const s={value:parseFloat(e)};if(0===s.value&&(s.value=0),!n._flags.unsafe)if(e.match(/e/i)){if(a.extractSignificantDigits(e)!==a.extractSignificantDigits(String(s.value)))return s.errors=r("number.unsafe"),s}else{const t=s.value.toString();if(t.match(/e/i))return s;if(t!==a.normalizeDecimal(e))return s.errors=r("number.unsafe"),s}return s}},validate(e,t){let{schema:n,error:r,prefs:s}=t;if(e===1/0||e===-1/0)return{value:e,errors:r("number.infinity")};if(!i.isNumber(e))return{value:e,errors:r("number.base")};const a={value:e};if(s.convert){const e=n.$_getRule("precision");if(e){const t=Math.pow(10,e.args.limit);a.value=Math.round(a.value*t)/t}}return 0===a.value&&(a.value=0),!n._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,t)=>Math.trunc(e)-e==0?e:t.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){return this.$_addRule({name:"multiple",args:{base:e}})},validate(e,t,n,r){let{base:s}=n;return e*(1/s)%1==0?e:t.error("number.multiple",{multiple:r.args.base,value:e})},args:[{name:"base",ref:!0,assert:e=>"number"==typeof e&&isFinite(e)&&e>0,message:"must be a positive number"}],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,t)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:t.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return r(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,t,n){let{limit:r}=n;const s=e.toString().match(a.precisionRx);return Math.max((s[1]?s[1].length:0)-(s[2]?parseInt(s[2],10):0),0)<=r?e:t.error("number.precision",{limit:r,value:e})},convert:!0},sign:{method(e){return r(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate(e,t,n){let{sign:r}=n;return"negative"===r&&e<0||"positive"===r&&e>0?e:t.error(`number.${r}`)}},unsafe:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>"number"==typeof e,to:(e,t)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),a.extractSignificantDigits=function(e){return e.replace(a.exponentialPartRegex,"").replace(a.dotRegex,"").replace(a.trailingZerosRegex,"").replace(a.leadingSignAndZerosRegex,"")},a.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),"-0"===e?"0":e}},8966:(e,t,n)=>{const r=n(7824);e.exports=r.extend({type:"object",cast:{map:{from:e=>e&&"object"==typeof e,to:(e,t)=>new Map(Object.entries(e))}}})},7417:(e,t,n)=>{const r=n(375),s=n(5380),i=n(1745),a=n(9959),o=n(6064),c=n(9926),l=n(5752),u=n(8068),d=n(8160),h={tlds:c instanceof Set&&{tlds:{allow:c,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:/^[a-f0-9]+$/i,ipRegex:a.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};e.exports=u.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(e,t){let{schema:n,state:r,prefs:s}=t;const i=n.$_getRule("normalize");i&&(e=e.normalize(i.args.form));const a=n.$_getRule("case");a&&(e="upper"===a.args.direction?e.toLocaleUpperCase():e.toLocaleLowerCase());const o=n.$_getRule("trim");if(o&&o.args.enabled&&(e=e.trim()),n.$_terms.replacements)for(const t of n.$_terms.replacements)e=e.replace(t.pattern,t.replacement);const c=n.$_getRule("hex");if(c&&c.args.options.byteAligned&&e.length%2!=0&&(e=`0${e}`),n.$_getRule("isoDate")){const t=h.isoDate(e);t&&(e=t)}if(n._flags.truncate){const t=n.$_getRule("max");if(t){let i=t.args.limit;if(d.isResolvable(i)&&(i=i.resolve(e,r,s),!d.limit(i)))return{value:e,errors:n.$_createError("any.ref",i,{ref:t.args.limit,arg:"limit",reason:"must be a positive integer"},r,s)};e=e.slice(0,i)}}return{value:e}}},validate(e,t){let{schema:n,error:r}=t;if("string"!=typeof e)return{value:e,errors:r("string.base")};if(""===e){const t=n.$_getRule("min");if(t&&0===t.args.limit)return;return{value:e,errors:r("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(e,t)=>/^[a-zA-Z0-9]+$/.test(e)?e:t.error("string.alphanum")},base64:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d.assertOptions(e,["paddingRequired","urlSafe"]),e={urlSafe:!1,paddingRequired:!0,...e},r("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),r("boolean"==typeof e.urlSafe,"urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:e}})},validate(e,t,n){let{options:r}=n;return h.base64Regex[r.paddingRequired][r.urlSafe].test(e)?e:t.error("string.base64")}},case:{method(e){return r(["lower","upper"].includes(e),"Invalid case:",e),this.$_addRule({name:"case",args:{direction:e}})},validate(e,t,n){let{direction:r}=n;return"lower"===r&&e===e.toLocaleLowerCase()||"upper"===r&&e===e.toLocaleUpperCase()?e:t.error(`string.${r}case`)},convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,t){let n=e.length,r=0,s=1;for(;n--;){const t=e.charAt(n)*s;r+=t-9*(t>9),s^=3}return r>0&&r%10==0?e:t.error("string.creditCard")}},dataUri:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d.assertOptions(e,["paddingRequired"]),e={paddingRequired:!0,...e},r("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:e}})},validate(e,t,n){let{options:r}=n;const s=e.match(h.dataUriRegex);if(s){if(!s[2])return e;if("base64"!==s[2])return e;if(h.base64Regex[r.paddingRequired].false.test(s[3]))return e}return t.error("string.dataUri")}},domain:{method(e){e&&d.assertOptions(e,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const t=h.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:t})},validate(e,t,n,r){let{address:i}=r;return s.isValid(e,i)?e:t.error("string.domain")}},email:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.assertOptions(e,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),r(void 0===e.multiple||"boolean"==typeof e.multiple,"multiple option must be an boolean");const t=h.addressOptions(e),n=new RegExp(`\\s*[${e.separator?o(e.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:e},regex:n,address:t})},validate(e,t,n,r){let{options:s}=n,{regex:a,address:o}=r;const c=s.multiple?e.split(a):[e],l=[];for(const e of c)i.isValid(e,o)||l.push(e);return l.length?t.error("string.email",{value:e,invalids:l}):e}},guid:{alias:"uuid",method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.assertOptions(e,["version","separator"]);let t="";if(e.version){const n=[].concat(e.version);r(n.length>=1,"version must have at least 1 valid version specified");const s=new Set;for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:{};return d.assertOptions(e,["byteAligned"]),e={byteAligned:!1,...e},r("boolean"==typeof e.byteAligned,"byteAligned must be boolean"),this.$_addRule({name:"hex",args:{options:e}})},validate(e,t,n){let{options:r}=n;return h.hexRegex.test(e)?r.byteAligned&&e.length%2!=0?t.error("string.hexAlign"):e:t.error("string.hex")}},hostname:{method(){return this.$_addRule("hostname")},validate:(e,t)=>s.isValid(e,{minDomainSegments:1})||h.ipRegex.test(e)?e:t.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.assertOptions(e,["cidr","version"]);const{cidr:t,versions:n,regex:r}=a.regex(e),s=e.version?n:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:t,version:s}},regex:r})},validate(e,t,n,r){let{options:s}=n,{regex:i}=r;return i.test(e)?e:s.version?t.error("string.ipVersion",{value:e,cidr:s.cidr,version:s.version}):t.error("string.ip",{value:e,cidr:s.cidr})}},isoDate:{method(){return this.$_addRule("isoDate")},validate(e,t){let{error:n}=t;return h.isoDate(e)?e:n("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(e,t)=>h.isoDurationRegex.test(e)?e:t.error("string.isoDuration")},length:{method(e,t){return h.length(this,"length",e,"=",t)},validate(e,t,n,r){let{limit:s,encoding:i}=n,{name:a,operator:o,args:c}=r;const l=!i&&e.length;return d.compare(l,s,o)?e:t.error("string."+a,{limit:c.limit,value:e,encoding:i})},args:[{name:"limit",ref:!0,assert:d.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,t){return h.length(this,"max",e,"<=",t)},args:["limit","encoding"]},min:{method(e,t){return h.length(this,"min",e,">=",t)},args:["limit","encoding"]},normalize:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"NFC";return r(h.normalizationForms.includes(e),"normalization form must be one of "+h.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:e}})},validate(e,t,n){let{error:r}=t,{form:s}=n;return e===e.normalize(s)?e:r("string.normalize",{value:e,form:s})},convert:!0},pattern:{alias:"regex",method(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(e instanceof RegExp,"regex must be a RegExp"),r(!e.flags.includes("g")&&!e.flags.includes("y"),"regex should not use global or sticky mode"),"string"==typeof t&&(t={name:t}),d.assertOptions(t,["invert","name"]);const n=["string.pattern",t.invert?".invert":"",t.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:e,options:t},errorCode:n})},validate(e,t,n,r){let{regex:s,options:i}=n,{errorCode:a}=r;return s.test(e)^i.invert?e:t.error(a,{name:i.name,regex:s,value:e})},args:["regex","options"],multi:!0},replace:{method(e,t){"string"==typeof e&&(e=new RegExp(o(e),"g")),r(e instanceof RegExp,"pattern must be a RegExp"),r("string"==typeof t,"replacement must be a String");const n=this.clone();return n.$_terms.replacements||(n.$_terms.replacements=[]),n.$_terms.replacements.push({pattern:e,replacement:t}),n}},token:{method(){return this.$_addRule("token")},validate:(e,t)=>/^\w+$/.test(e)?e:t.error("string.token")},trim:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r("boolean"==typeof e,"enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:e}})},validate(e,t,n){let{enabled:r}=n;return r&&e!==e.trim()?t.error("string.trim"):e},convert:!0},truncate:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),e.domain&&d.assertOptions(e.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:t,scheme:n}=l.regex(e),r=e.domain?h.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:t,domain:r,scheme:n})},validate(e,t,n,r){let{options:i}=n,{regex:a,domain:o,scheme:c}=r;if(["http:/","https:/"].includes(e))return t.error("string.uri");const l=a.exec(e);if(l){const n=l[1]||l[2];return!o||i.allowRelative&&!n||s.isValid(n,o)?e:t.error("string.domain",{value:n})}return i.relativeOnly?t.error("string.uriRelativeOnly"):i.scheme?t.error("string.uriCustomScheme",{scheme:c,value:e}):t.error("string.uri")}}},manifest:{build(e,t){if(t.replacements)for(const{pattern:n,replacement:r}of t.replacements)e=e.replace(n,r);return e}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),h.addressOptions=function(e){if(!e)return e;if(r(void 0===e.minDomainSegments||Number.isSafeInteger(e.minDomainSegments)&&e.minDomainSegments>0,"minDomainSegments must be a positive integer"),r(void 0===e.maxDomainSegments||Number.isSafeInteger(e.maxDomainSegments)&&e.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),!1===e.tlds)return e;if(!0===e.tlds||void 0===e.tlds)return r(h.tlds,"Built-in TLD list disabled"),Object.assign({},e,h.tlds);r("object"==typeof e.tlds,"tlds must be true, false, or an object");const t=e.tlds.deny;if(t)return Array.isArray(t)&&(e=Object.assign({},e,{tlds:{deny:new Set(t)}})),r(e.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),r(!e.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),h.validateTlds(e.tlds.deny,"tlds.deny"),e;const n=e.tlds.allow;return n?!0===n?(r(h.tlds,"Built-in TLD list disabled"),Object.assign({},e,h.tlds)):(Array.isArray(n)&&(e=Object.assign({},e,{tlds:{allow:new Set(n)}})),r(e.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),h.validateTlds(e.tlds.allow,"tlds.allow"),e):e},h.validateTlds=function(e,t){for(const n of e)r(s.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${t} must contain valid top level domain names`)},h.isoDate=function(e){if(!d.isIsoDate(e))return null;/.*T.*[+-]\d\d$/.test(e)&&(e+="00");const t=new Date(e);return isNaN(t.getTime())?null:t.toISOString()},h.length=function(e,t,n,s,i){return r(!i||!1,"Invalid encoding:",i),e.$_addRule({name:t,method:"length",args:{limit:n,encoding:i},operator:s})}},8826:(e,t,n)=>{const r=n(375),s=n(8068),i={};i.Map=class extends Map{slice(){return new i.Map(this)}},e.exports=s.extend({type:"symbol",terms:{map:{init:new i.Map}},coerce:{method(e,t){let{schema:n,error:r}=t;const s=n.$_terms.map.get(e);return s&&(e=s),n._flags.only&&"symbol"!=typeof e?{value:e,errors:r("symbol.map",{map:n.$_terms.map})}:{value:e}}},validate(e,t){let{error:n}=t;if("symbol"!=typeof e)return{value:e,errors:n("symbol.base")}},rules:{map:{method(e){e&&!e[Symbol.iterator]&&"object"==typeof e&&(e=Object.entries(e)),r(e&&e[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),n=[];for(const s of e){r(s&&s[Symbol.iterator],"Entry must be an iterable");const[e,i]=s;r("object"!=typeof e&&"function"!=typeof e&&"symbol"!=typeof e,"Key must not be of type object, function, or Symbol"),r("symbol"==typeof i,"Value must be a Symbol"),t.$_terms.map.set(e,i),n.push(i)}return t.valid(...n)}}},manifest:{build:(e,t)=>(t.map&&(e=e.map(t.map)),e)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(e,t,n)=>{const r=n(375),s=n(8571),i=n(738),a=n(9621),o=n(8160),c=n(6354),l=n(493),u={result:Symbol("result")};t.entry=function(e,t,n){let s=o.defaults;n&&(r(void 0===n.warnings,"Cannot override warnings preference in synchronous validation"),r(void 0===n.artifacts,"Cannot override artifacts preference in synchronous validation"),s=o.preferences(o.defaults,n));const i=u.entry(e,t,s);r(!i.mainstay.externals.length,"Schema with external rules must use validateAsync()");const a={value:i.value};return i.error&&(a.error=i.error),i.mainstay.warnings.length&&(a.warning=c.details(i.mainstay.warnings)),i.mainstay.debug&&(a.debug=i.mainstay.debug),i.mainstay.artifacts&&(a.artifacts=i.mainstay.artifacts),a},t.entryAsync=async function(e,t,n){let r=o.defaults;n&&(r=o.preferences(o.defaults,n));const s=u.entry(e,t,r),i=s.mainstay;if(s.error)throw i.debug&&(s.error.debug=i.debug),s.error;if(i.externals.length){let t=s.value;const l=[];for(const s of i.externals){const d=s.state.path,h="link"===s.schema.type?i.links.get(s.schema):null;let p,f,m=t;const b=d.length?[t]:[],g=d.length?a(e,d):e;if(d.length){p=d[d.length-1];let e=t;for(const t of d.slice(0,-1))e=e[t],b.unshift(e);f=b[0],m=f[p]}try{const e=(e,t)=>(h||s.schema).$_createError(e,m,t,s.state,r),a=await s.method(m,{schema:s.schema,linked:h,state:s.state,prefs:n,original:g,error:e,errorsArray:u.errorsArray,warn:(e,t)=>i.warnings.push((h||s.schema).$_createError(e,m,t,s.state,r)),message:(e,t)=>(h||s.schema).$_createError("external",m,t,s.state,r,{messages:e})});if(void 0===a||a===m)continue;if(a instanceof c.Report){if(i.tracer.log(s.schema,s.state,"rule","external","error"),l.push(a),r.abortEarly)break;continue}if(Array.isArray(a)&&a[o.symbols.errors]){if(i.tracer.log(s.schema,s.state,"rule","external","error"),l.push(...a),r.abortEarly)break;continue}f?(i.tracer.value(s.state,"rule",m,a,"external"),f[p]=a):(i.tracer.value(s.state,"rule",t,a,"external"),t=a)}catch(e){throw r.errors.label&&(e.message+=` (${s.label})`),e}}if(s.value=t,l.length)throw s.error=c.process(l,e,r),i.debug&&(s.error.debug=i.debug),s.error}if(!r.warnings&&!r.debug&&!r.artifacts)return s.value;const l={value:s.value};return i.warnings.length&&(l.warning=c.details(i.warnings)),i.debug&&(l.debug=i.debug),i.artifacts&&(l.artifacts=i.artifacts),l},u.Mainstay=class{constructor(e,t,n){this.externals=[],this.warnings=[],this.tracer=e,this.debug=t,this.links=n,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const e=this._snapshots.pop();this.externals=e.externals,this.warnings=e.warnings}},u.entry=function(e,n,r){const{tracer:s,cleanup:i}=u.tracer(n,r),a=r.debug?[]:null,o=n._ids._schemaChain?new Map:null,d=new u.Mainstay(s,a,o),h=n._ids._schemaChain?[{schema:n}]:null,p=new l([],[],{mainstay:d,schemas:h}),f=t.validate(e,n,p,r);i&&n.$_root.untrace();const m=c.process(f.errors,e,r);return{value:f.value,error:m,mainstay:d}},u.tracer=function(e,t){return e.$_root._tracer?{tracer:e.$_root._tracer._register(e)}:t.debug?(r(e.$_root.trace,"Debug mode not supported"),{tracer:e.$_root.trace()._register(e),cleanup:!0}):{tracer:u.ignore}},t.validate=function(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(t.$_terms.whens&&(t=t._generate(e,n,r).schema),t._preferences&&(r=u.prefs(t,r)),t._cache&&r.cache){const r=t._cache.get(e);if(n.mainstay.tracer.debug(n,"validate","cached",!!r),r)return r}const i=(s,i,a)=>t.$_createError(s,e,i,a||n,r),a={original:e,prefs:r,schema:t,state:n,error:i,errorsArray:u.errorsArray,warn:(e,t,r)=>n.mainstay.warnings.push(i(e,t,r)),message:(s,i)=>t.$_createError("custom",e,i,n,r,{messages:s})};n.mainstay.tracer.entry(t,n);const c=t._definition;if(c.prepare&&void 0!==e&&r.convert){const t=c.prepare(e,a);if(t){if(n.mainstay.tracer.value(n,"prepare",e,t.value),t.errors)return u.finalize(t.value,[].concat(t.errors),a);e=t.value}}if(c.coerce&&void 0!==e&&r.convert&&(!c.coerce.from||c.coerce.from.includes(typeof e))){const t=c.coerce.method(e,a);if(t){if(n.mainstay.tracer.value(n,"coerced",e,t.value),t.errors)return u.finalize(t.value,[].concat(t.errors),a);e=t.value}}const l=t._flags.empty;l&&l.$_match(u.trim(e,t),n.nest(l),o.defaults)&&(n.mainstay.tracer.value(n,"empty",e,void 0),e=void 0);const d=s.presence||t._flags.presence||(t._flags._endedSwitch?null:r.presence);if(void 0===e){if("forbidden"===d)return u.finalize(e,null,a);if("required"===d)return u.finalize(e,[t.$_createError("any.required",e,null,n,r)],a);if("optional"===d){if(t._flags.default!==o.symbols.deepDefault)return u.finalize(e,null,a);n.mainstay.tracer.value(n,"default",e,{}),e={}}}else if("forbidden"===d)return u.finalize(e,[t.$_createError("any.unknown",e,null,n,r)],a);const h=[];if(t._valids){const s=t._valids.get(e,n,r,t._flags.insensitive);if(s)return r.convert&&(n.mainstay.tracer.value(n,"valids",e,s.value),e=s.value),n.mainstay.tracer.filter(t,n,"valid",s),u.finalize(e,null,a);if(t._flags.only){const s=t.$_createError("any.only",e,{valids:t._valids.values({display:!0})},n,r);if(r.abortEarly)return u.finalize(e,[s],a);h.push(s)}}if(t._invalids){const s=t._invalids.get(e,n,r,t._flags.insensitive);if(s){n.mainstay.tracer.filter(t,n,"invalid",s);const i=t.$_createError("any.invalid",e,{invalids:t._invalids.values({display:!0})},n,r);if(r.abortEarly)return u.finalize(e,[i],a);h.push(i)}}if(c.validate){const t=c.validate(e,a);if(t&&(n.mainstay.tracer.value(n,"base",e,t.value),e=t.value,t.errors)){if(!Array.isArray(t.errors))return h.push(t.errors),u.finalize(e,h,a);if(t.errors.length)return h.push(...t.errors),u.finalize(e,h,a)}}return t._rules.length?u.rules(e,h,a):u.finalize(e,h,a)},u.rules=function(e,t,n){const{schema:r,state:s,prefs:i}=n;for(const a of r._rules){const c=r._definition.rules[a.method];if(c.convert&&i.convert){s.mainstay.tracer.log(r,s,"rule",a.name,"full");continue}let l,d=a.args;if(a._resolve.length){d=Object.assign({},d);for(const t of a._resolve){const n=c.argsByName.get(t),a=d[t].resolve(e,s,i),u=n.normalize?n.normalize(a):a,h=o.validateArg(u,null,n);if(h){l=r.$_createError("any.ref",a,{arg:t,ref:d[t],reason:h},s,i);break}d[t]=u}}l=l||c.validate(e,n,d,a);const h=u.rule(l,a);if(h.errors){if(s.mainstay.tracer.log(r,s,"rule",a.name,"error"),a.warn){s.mainstay.warnings.push(...h.errors);continue}if(i.abortEarly)return u.finalize(e,h.errors,n);t.push(...h.errors)}else s.mainstay.tracer.log(r,s,"rule",a.name,"pass"),s.mainstay.tracer.value(s,"rule",e,h.value,a.name),e=h.value}return u.finalize(e,t,n)},u.rule=function(e,t){return e instanceof c.Report?(u.error(e,t),{errors:[e],value:null}):Array.isArray(e)&&e[o.symbols.errors]?(e.forEach((e=>u.error(e,t))),{errors:e,value:null}):{errors:null,value:e}},u.error=function(e,t){return t.message&&e._setTemplate(t.message),e},u.finalize=function(e,t,n){t=t||[];const{schema:s,state:i,prefs:a}=n;if(t.length){const r=u.default("failover",void 0,t,n);void 0!==r&&(i.mainstay.tracer.value(i,"failover",e,r),e=r,t=[])}if(t.length&&s._flags.error)if("function"==typeof s._flags.error){t=s._flags.error(t),Array.isArray(t)||(t=[t]);for(const e of t)r(e instanceof Error||e instanceof c.Report,"error() must return an Error object")}else t=[s._flags.error];if(void 0===e){const r=u.default("default",e,t,n);i.mainstay.tracer.value(i,"default",e,r),e=r}if(s._flags.cast&&void 0!==e){const t=s._definition.cast[s._flags.cast];if(t.from(e)){const r=t.to(e,n);i.mainstay.tracer.value(i,"cast",e,r,s._flags.cast),e=r}}if(s.$_terms.externals&&a.externals&&!1!==a._externals)for(const{method:e}of s.$_terms.externals)i.mainstay.externals.push({method:e,schema:s,state:i,label:c.label(s._flags,i,a)});const o={value:e,errors:t.length?t:null};return s._flags.result&&(o.value="strip"===s._flags.result?void 0:n.original,i.mainstay.tracer.value(i,s._flags.result,e,o.value),i.shadow(e,s._flags.result)),s._cache&&!1!==a.cache&&!s._refs.length&&s._cache.set(n.original,o),void 0===e||o.errors||void 0===s._flags.artifact||(i.mainstay.artifacts=i.mainstay.artifacts||new Map,i.mainstay.artifacts.has(s._flags.artifact)||i.mainstay.artifacts.set(s._flags.artifact,[]),i.mainstay.artifacts.get(s._flags.artifact).push(i.path)),o},u.prefs=function(e,t){const n=t===o.defaults;return n&&e._preferences[o.symbols.prefs]?e._preferences[o.symbols.prefs]:(t=o.preferences(t,e._preferences),n&&(e._preferences[o.symbols.prefs]=t),t)},u.default=function(e,t,n,r){const{schema:i,state:a,prefs:c}=r,l=i._flags[e];if(c.noDefaults||void 0===l)return t;if(a.mainstay.tracer.log(i,a,"rule",e,"full"),!l)return l;if("function"==typeof l){const o=l.length?[s(a.ancestors[0]),r]:[];try{return l(...o)}catch(t){return void n.push(i.$_createError(`any.${e}`,null,{error:t},a,c))}}return"object"!=typeof l?l:l[o.symbols.literal]?l.literal:o.isResolvable(l)?l.resolve(t,a,c):s(l)},u.trim=function(e,t){if("string"!=typeof e)return e;const n=t.$_getRule("trim");return n&&n.args.enabled?e.trim():e},u.ignore={active:!1,debug:i,entry:i,filter:i,log:i,resolve:i,value:i},u.errorsArray=function(){const e=[];return e[o.symbols.errors]=!0,e}},2036:(e,t,n)=>{const r=n(375),s=n(9474),i=n(8160),a={};e.exports=a.Values=class{constructor(e,t){this._values=new Set(e),this._refs=new Set(t),this._lowercase=a.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,t){i.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),t&&t.register(e)):this.has(e,null,null,!1)||(this._values.add(e),"string"==typeof e&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,t,n){if(e=e||new a.Values,t){if(t._override)return t.clone();for(const n of[...t._values,...t._refs])e.add(n)}if(n)for(const t of[...n._values,...n._refs])e.remove(t);return e.length?e:null}remove(e){i.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),"string"==typeof e&&this._lowercase.delete(e.toLowerCase()))}has(e,t,n,r){return!!this.get(e,t,n,r)}get(e,t,n,r){if(!this.length)return!1;if(this._values.has(e))return{value:e};if("string"==typeof e&&e&&r){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&"object"!=typeof e)return!1;if("object"==typeof e)for(const t of this._values)if(s(t,e))return{value:t};if(t)for(const i of this._refs){const a=i.resolve(e,t,n,null,{in:!0});if(void 0===a)continue;const o=i.in&&"object"==typeof a?Array.isArray(a)?a:Object.keys(a):[a];for(const t of o)if(typeof t==typeof e)if(r&&e&&"string"==typeof e){if(t.toLowerCase()===e.toLowerCase())return{value:t,ref:i}}else if(s(t,e))return{value:t,ref:i}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const e=[];for(const t of[...this._values,...this._refs])void 0!==t&&e.push(t);return e}return Array.from([...this._values,...this._refs])}clone(){const e=new a.Values(this._values,this._refs);return e._override=this._override,e}concat(e){r(!e._override,"Cannot concat override set of values");const t=new a.Values([...this._values,...e._values],[...this._refs,...e._refs]);return t._override=this._override,t}describe(){const e=[];this._override&&e.push({override:!0});for(const t of this._values.values())e.push(t&&"object"==typeof t?{value:t}:t);for(const t of this._refs.values())e.push(t.describe());return e}},a.Values.prototype[i.symbols.values]=!0,a.Values.prototype.slice=a.Values.prototype.clone,a.lowercases=function(e){const t=new Map;if(e)for(const n of e)"string"==typeof n&&t.set(n.toLowerCase(),n);return t}},978:(e,t,n)=>{const r=n(375),s=n(8571),i=n(1687),a=n(9621),o={};e.exports=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(r(e&&"object"==typeof e,"Invalid defaults value: must be an object"),r(!t||!0===t||"object"==typeof t,"Invalid source value: must be true, falsy or an object"),r("object"==typeof n,"Invalid options: must be an object"),!t)return null;if(n.shallow)return o.applyToDefaultsWithShallow(e,t,n);const a=s(e);if(!0===t)return a;const c=void 0!==n.nullOverride&&n.nullOverride;return i(a,t,{nullOverride:c,mergeArrays:!1})},o.applyToDefaultsWithShallow=function(e,t,n){const c=n.shallow;r(Array.isArray(c),"Invalid keys");const l=new Map,u=!0===t?null:new Set;for(let n of c){n=Array.isArray(n)?n:n.split(".");const r=a(e,n);r&&"object"==typeof r?l.set(r,u&&a(t,n)||r):u&&u.add(n)}const d=s(e,{},l);if(!u)return d;for(const e of u)o.reachCopy(d,t,e);const h=void 0!==n.nullOverride&&n.nullOverride;return i(d,t,{nullOverride:h,mergeArrays:!1})},o.reachCopy=function(e,t,n){for(const e of n){if(!(e in t))return;const n=t[e];if("object"!=typeof n||null===n)return;t=n}const r=t;let s=e;for(let e=0;e{const r=n(7916);e.exports=function(e){if(!e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s{const r=n(9621),s=n(4277),i=n(7043),a={needsProtoHack:new Set([s.set,s.map,s.weakSet,s.weakMap])};e.exports=a.clone=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("object"!=typeof e||null===e)return e;let r=a.clone,o=n;if(t.shallow){if(!0!==t.shallow)return a.cloneWithShallow(e,t);r=e=>e}else if(o){const t=o.get(e);if(t)return t}else o=new Map;const c=s.getInternalProto(e);if(c===s.buffer)return!1;if(c===s.date)return new Date(e.getTime());if(c===s.regex)return new RegExp(e);const l=a.base(e,c,t);if(l===e)return e;if(o&&o.set(e,l),c===s.set)for(const n of e)l.add(r(n,t,o));else if(c===s.map)for(const[n,s]of e)l.set(n,r(s,t,o));const u=i.keys(e,t);for(const n of u){if("__proto__"===n)continue;if(c===s.array&&"length"===n){l.length=e.length;continue}const i=Object.getOwnPropertyDescriptor(e,n);i?i.get||i.set?Object.defineProperty(l,n,i):i.enumerable?l[n]=r(e[n],t,o):Object.defineProperty(l,n,{enumerable:!1,writable:!0,configurable:!0,value:r(e[n],t,o)}):Object.defineProperty(l,n,{enumerable:!0,writable:!0,configurable:!0,value:r(e[n],t,o)})}return l},a.cloneWithShallow=function(e,t){const n=t.shallow;(t=Object.assign({},t)).shallow=!1;const s=new Map;for(const t of n){const n=r(e,t);"object"!=typeof n&&"function"!=typeof n||s.set(n,n)}return a.clone(e,t,s)},a.base=function(e,t,n){if(!1===n.prototype)return a.needsProtoHack.has(t)?new t.constructor:t===s.array?[]:{};const r=Object.getPrototypeOf(e);if(r&&r.isImmutable)return e;if(t===s.array){const e=[];return r!==t&&Object.setPrototypeOf(e,r),e}if(a.needsProtoHack.has(t)){const e=new r.constructor;return r!==t&&Object.setPrototypeOf(e,r),e}return Object.create(r)}},9474:(e,t,n)=>{const r=n(4277),s={mismatched:null};e.exports=function(e,t,n){return n=Object.assign({prototype:!0},n),!!s.isDeepEqual(e,t,n,[])},s.isDeepEqual=function(e,t,n,i){if(e===t)return 0!==e||1/e==1/t;const a=typeof e;if(a!==typeof t)return!1;if(null===e||null===t)return!1;if("function"===a){if(!n.deepFunction||e.toString()!==t.toString())return!1}else if("object"!==a)return e!=e&&t!=t;const o=s.getSharedType(e,t,!!n.prototype);switch(o){case r.buffer:return!1;case r.promise:return e===t;case r.regex:return e.toString()===t.toString();case s.mismatched:return!1}for(let n=i.length-1;n>=0;--n)if(i[n].isSame(e,t))return!0;i.push(new s.SeenEntry(e,t));try{return!!s.isDeepEqualObj(o,e,t,n,i)}finally{i.pop()}},s.getSharedType=function(e,t,n){if(n)return Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?s.mismatched:r.getInternalProto(e);const i=r.getInternalProto(e);return i!==r.getInternalProto(t)?s.mismatched:i},s.valueOf=function(e){const t=e.valueOf;if(void 0===t)return e;try{return t.call(e)}catch(e){return e}},s.hasOwnEnumerableProperty=function(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)},s.isSetSimpleEqual=function(e,t){for(const n of Set.prototype.values.call(e))if(!Set.prototype.has.call(t,n))return!1;return!0},s.isDeepEqualObj=function(e,t,n,i,a){const{isDeepEqual:o,valueOf:c,hasOwnEnumerableProperty:l}=s,{keys:u,getOwnPropertySymbols:d}=Object;if(e===r.array){if(!i.part){if(t.length!==n.length)return!1;for(let e=0;e{const r=n(8761);e.exports=class extends Error{constructor(e){super(e.filter((e=>""!==e)).map((e=>"string"==typeof e?e:e instanceof Error?e.message:r(e))).join(" ")||"Unknown error"),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t.assert)}}},5277:e=>{const t={};e.exports=function(e){if(!e)return"";let n="";for(let r=0;r=256?"&#"+e+";":`&#x${e.toString(16).padStart(2,"0")};`)},t.isSafe=function(e){return t.safeCharCodes.has(e)},t.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),t.safeCharCodes=function(){const e=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||32===t||46===t||44===t||45===t||58===t||95===t)&&e.add(t);return e}()},6064:e=>{e.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:e=>{e.exports=function(){}},1687:(e,t,n)=>{const r=n(375),s=n(8571),i=n(7043),a={};e.exports=a.merge=function(e,t,n){if(r(e&&"object"==typeof e,"Invalid target value: must be an object"),r(null==t||"object"==typeof t,"Invalid source value: must be null, undefined, or an object"),!t)return e;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(t)){r(Array.isArray(e),"Cannot merge array onto an object"),n.mergeArrays||(e.length=0);for(let r=0;r{const r=n(375),s={};e.exports=function(e,t,n){if(!1===t||null==t)return e;"string"==typeof(n=n||{})&&(n={separator:n});const i=Array.isArray(t);r(!i||!n.separator,"Separator option is not valid for array-based chain");const a=i?t:t.split(n.separator||".");let o=e;for(let e=0;e{e.exports=function(){try{return JSON.stringify(...arguments)}catch(e){return"[Cannot display object: "+e.message+"]"}}},4277:(e,t)=>{const n={};t=e.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},n.typeMap=new Map([["[object Error]",t.error],["[object Map]",t.map],["[object Promise]",t.promise],["[object Set]",t.set],["[object WeakMap]",t.weakMap],["[object WeakSet]",t.weakSet]]),t.getInternalProto=function(e){if(Array.isArray(e))return t.array;if(e instanceof Date)return t.date;if(e instanceof RegExp)return t.regex;if(e instanceof Error)return t.error;const r=Object.prototype.toString.call(e);return n.typeMap.get(r)||t.generic}},7043:(e,t)=>{t.keys=function(e){return!1!==(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).symbols?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}},3652:(e,t,n)=>{const r=n(375),s={};t.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(e,t){const n=[].concat((t=t||{}).before||[]),s=[].concat(t.after||[]),i=t.group||"?",a=t.sort||0;r(!n.includes(i),`Item cannot come before itself: ${i}`),r(!n.includes("?"),"Item cannot come before unassociated items"),r(!s.includes(i),`Item cannot come after itself: ${i}`),r(!s.includes("?"),"Item cannot come after unassociated items"),Array.isArray(e)||(e=[e]);for(const t of e){const e={seq:this._items.length,sort:a,before:n,after:s,group:i,node:t};this._items.push(e)}if(!t.manual){const e=this._sort();r(e,"item","?"!==i?`added into group ${i}`:"","created a dependencies error")}return this.nodes}merge(e){Array.isArray(e)||(e=[e]);for(const t of e)if(t)for(const e of t._items)this._items.push(Object.assign({},e));this._items.sort(s.mergeSort);for(let e=0;ee.sort===t.sort?0:e.sort{const r=n(443),s=n(2178),i={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:r.URL||URL};t.analyze=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return s.code("DOMAIN_NON_EMPTY_STRING");if("string"!=typeof e)throw new Error("Invalid input: domain must be a string");if(e.length>256)return s.code("DOMAIN_TOO_LONG");if(i.nonAsciiRx.test(e)){if(!1===t.allowUnicode)return s.code("DOMAIN_INVALID_UNICODE_CHARS");e=e.normalize("NFC")}if(i.domainControlRx.test(e))return s.code("DOMAIN_INVALID_CHARS");e=i.punycode(e),t.allowFullyQualified&&"."===e[e.length-1]&&(e=e.slice(0,-1));const n=t.minDomainSegments||i.minDomainSegments,r=e.split(".");if(r.lengtht.maxDomainSegments)return s.code("DOMAIN_SEGMENTS_COUNT_MAX");const a=t.tlds;if(a){const e=r[r.length-1].toLowerCase();if(a.deny&&a.deny.has(e)||a.allow&&!a.allow.has(e))return s.code("DOMAIN_FORBIDDEN_TLDS")}for(let e=0;e63)return s.code("DOMAIN_LONG_SEGMENT");if(e{const r=n(9848),s=n(5380),i=n(2178),a={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(r.TextEncoder||TextEncoder)};t.analyze=function(e,t){return a.email(e,t)},t.isValid=function(e,t){return!a.email(e,t)},a.email=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw new Error("Invalid input: email must be a string");if(!e)return i.code("EMPTY_STRING");const n=!a.nonAsciiRx.test(e);if(!n){if(!1===t.allowUnicode)return i.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const r=e.split("@");if(2!==r.length)return r.length>2?i.code("MULTIPLE_AT_CHAR"):i.code("MISSING_AT_CHAR");const[o,c]=r;if(!o)return i.code("EMPTY_LOCAL");if(!t.ignoreLength){if(e.length>254)return i.code("ADDRESS_TOO_LONG");if(a.encoder.encode(o).length>64)return i.code("LOCAL_TOO_LONG")}return a.local(o,n)||s.analyze(c,t)},a.local=function(e,t){const n=e.split(".");for(const e of n){if(!e.length)return i.code("EMPTY_LOCAL_SEGMENT");if(t){if(!a.atextRx.test(e))return i.code("INVALID_LOCAL_CHARS")}else for(const t of e){if(a.atextRx.test(t))continue;const e=a.binary(t);if(!a.atomRx.test(e))return i.code("INVALID_LOCAL_CHARS")}}},a.binary=function(e){return Array.from(a.encoder.encode(e)).map((e=>String.fromCharCode(e))).join("")},a.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,a.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(e,t)=>{t.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},t.code=function(e){return{code:e,error:t.codes[e]}}},9959:(e,t,n)=>{const r=n(375),s=n(5752);t.regex=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(void 0===e.cidr||"string"==typeof e.cidr,"options.cidr must be a string");const t=e.cidr?e.cidr.toLowerCase():"optional";r(["required","optional","forbidden"].includes(t),"options.cidr must be one of required, optional, forbidden"),r(void 0===e.version||"string"==typeof e.version||Array.isArray(e.version),"options.version must be a string or an array of string");let n=e.version||["ipv4","ipv6","ipvfuture"];Array.isArray(n)||(n=[n]),r(n.length>=1,"options.version must have at least 1 version specified");for(let e=0;e{if("forbidden"===t)return s.ip[e];const n=`\\/${"ipv4"===e?s.ip.v4Cidr:s.ip.v6Cidr}`;return"required"===t?`${s.ip[e]}${n}`:`${s.ip[e]}(?:${n})?`})).join("|")})`,a=new RegExp(`^${i}$`);return{cidr:t,versions:n,regex:a,raw:i}}},5752:(e,t,n)=>{const r=n(375),s=n(6064),i={generate:function(){const e={},t="\\dA-Fa-f",n="["+t+"]",r="\\w-\\.~",s="!\\$&'\\(\\)\\*\\+,;=",i="%"+t,a=r+i+s+":@",o="["+a+"]",c="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";e.ipv4address="(?:"+c+"\\.){3}"+c;const l=n+"{1,4}",u="(?:"+l+":"+l+"|"+e.ipv4address+")",d="(?:"+l+":){6}"+u,h="::(?:"+l+":){5}"+u,p="(?:"+l+")?::(?:"+l+":){4}"+u,f="(?:(?:"+l+":){0,1}"+l+")?::(?:"+l+":){3}"+u,m="(?:(?:"+l+":){0,2}"+l+")?::(?:"+l+":){2}"+u,b="(?:(?:"+l+":){0,3}"+l+")?::"+l+":"+u,g="(?:(?:"+l+":){0,4}"+l+")?::"+u,y="(?:(?:"+l+":){0,5}"+l+")?::"+l,v="(?:(?:"+l+":){0,6}"+l+")?::";e.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",e.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",e.ipv6address="(?:"+d+"|"+h+"|"+p+"|"+f+"|"+m+"|"+b+"|"+g+"|"+y+"|"+v+")",e.ipvFuture="v"+n+"+\\.["+r+s+":]+",e.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",e.schemeRegex=new RegExp(e.scheme);const w="["+r+i+s+":]*",x="["+r+i+s+"]{1,255}",k="(?:\\[(?:"+e.ipv6address+"|"+e.ipvFuture+")\\]|"+e.ipv4address+"|"+x+")",E="(?:"+w+"@)?"+k+"(?::\\d*)?",A="(?:"+w+"@)?("+k+")(?::\\d*)?",C=o+"*",P=o+"+",_="(?:\\/"+C+")*",S="\\/(?:"+P+_+")?",I=P+_,B="["+r+i+s+"@]+"+_,T="(?:\\/\\/\\/"+C+_+")";return e.hierPart="(?:(?:\\/\\/"+E+_+")|"+S+"|"+I+"|"+T+")",e.hierPartCapture="(?:(?:\\/\\/"+A+_+")|"+S+"|"+I+")",e.relativeRef="(?:(?:\\/\\/"+E+_+")|"+S+"|"+B+"|)",e.relativeRefCapture="(?:(?:\\/\\/"+A+_+")|"+S+"|"+B+"|)",e.query="["+a+"\\/\\?]*(?=#|$)",e.queryWithSquareBrackets="["+a+"\\[\\]\\/\\?]*(?=#|$)",e.fragment="["+a+"\\/\\?]*",e}};i.rfc3986=i.generate(),t.ip={v4Cidr:i.rfc3986.ipv4Cidr,v6Cidr:i.rfc3986.ipv6Cidr,ipv4:i.rfc3986.ipv4address,ipv6:i.rfc3986.ipv6address,ipvfuture:i.rfc3986.ipvFuture},i.createRegex=function(e){const t=i.rfc3986,n="(?:\\?"+(e.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",a=e.domain?t.relativeRefCapture:t.relativeRef;if(e.relativeOnly)return i.wrap(a+n);let o="";if(e.scheme){r(e.scheme instanceof RegExp||"string"==typeof e.scheme||Array.isArray(e.scheme),"scheme must be a RegExp, String, or Array");const n=[].concat(e.scheme);r(n.length>=1,"scheme must have at least 1 scheme specified");const i=[];for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:{};return e.scheme||e.allowRelative||e.relativeOnly||e.allowQuerySquareBrackets||e.domain?i.createRegex(e):i.uriRegex}},1447:(e,t)=>{const n={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};t.Parser=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t[n.settings]&&t.constants)for(const e in t.constants){const n=t.constants[e];if(null!==n&&!["boolean","number","string"].includes(typeof n))throw new Error(`Formula constant ${e} contains invalid ${typeof n} value type`)}this.settings=t[n.settings]?t:Object.assign({[n.settings]:!0,constants:{},functions:{}},t),this.single=null,this._parts=null,this._parse(e)}_parse(e){let r=[],s="",i=0,a=!1;const o=e=>{if(i)throw new Error("Formula missing closing parenthesis");const o=r.length?r[r.length-1]:null;if(a||s||e){if(o&&"reference"===o.type&&")"===e)return o.type="function",o.value=this._subFormula(s,o.value),void(s="");if(")"===e){const e=new t.Parser(s,this.settings);r.push({type:"segment",value:e})}else if(a){if("]"===a)return r.push({type:"reference",value:s}),void(s="");r.push({type:"literal",value:s})}else if(n.operatorCharacters.includes(s))o&&"operator"===o.type&&n.operators.includes(o.value+s)?o.value+=s:r.push({type:"operator",value:s});else if(s.match(n.numberRx))r.push({type:"constant",value:parseFloat(s)});else if(void 0!==this.settings.constants[s])r.push({type:"constant",value:this.settings.constants[s]});else{if(!s.match(n.tokenRx))throw new Error(`Formula contains invalid token: ${s}`);r.push({type:"reference",value:s})}s=""}};for(const t of e)a?t===a?(o(),a=!1):s+=t:i?"("===t?(s+=t,++i):")"===t?(--i,i?s+=t:o(t)):s+=t:t in n.literals?a=n.literals[t]:"("===t?(o(),++i):n.operatorCharacters.includes(t)?(o(),s=t,o()):" "!==t?s+=t:o();o(),r=r.map(((e,t)=>"operator"!==e.type||"-"!==e.value||t&&"operator"!==r[t-1].type?e:{type:"operator",value:"n"}));let c=!1;for(const e of r){if("operator"===e.type){if(n.operatorsPrefix.includes(e.value))continue;if(!c)throw new Error("Formula contains an operator in invalid position");if(!n.operators.includes(e.value))throw new Error(`Formula contains an unknown operator ${e.value}`)}else if(c)throw new Error("Formula missing expected operator");c=!c}if(!c)throw new Error("Formula contains invalid trailing operator");1===r.length&&["reference","literal","constant"].includes(r[0].type)&&(this.single={type:"reference"===r[0].type?"reference":"value",value:r[0].value}),this._parts=r.map((e=>{if("operator"===e.type)return n.operatorsPrefix.includes(e.value)?e:e.value;if("reference"!==e.type)return e.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(e.value))throw new Error(`Formula contains invalid reference ${e.value}`);return this.settings.reference?this.settings.reference(e.value):n.reference(e.value)}))}_subFormula(e,r){const s=this.settings.functions[r];if("function"!=typeof s)throw new Error(`Formula contains unknown function ${r}`);let i=[];if(e){let t="",s=0,a=!1;const o=()=>{if(!t)throw new Error(`Formula contains function ${r} with invalid arguments ${e}`);i.push(t),t=""};for(let r=0;rnew t.Parser(e,this.settings))),function(e){const t=[];for(const n of i)t.push(n.evaluate(e));return s.call(e,...t)}}evaluate(e){const t=this._parts.slice();for(let r=t.length-2;r>=0;--r){const s=t[r];if(s&&"operator"===s.type){const i=t[r+1];t.splice(r+1,1);const a=n.evaluate(i,e);t[r]=n.single(s.value,a)}}return n.operatorsOrder.forEach((r=>{for(let s=1;s":return t>r;case">=":return t>=r;case"==":return t===r;case"!=":return t!==r;case"&&":return t&&r;case"||":return t||r}return null},n.exists=function(e){return null!=e}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:e=>{e.exports={version:"17.9.1"}}},t={},function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}(5107);var e,t}))}(jr);var Lr=$e(jr.exports);let Ur=class extends Error{constructor(e){super(e.message),this.message=e.message,this.code=e.code,this.data=e.data}};const Dr=(e,t)=>{let n;e.request?n=e.request.bind(e):e.sendAsync&&(n=zr(e));return e.request=async({method:e,params:r})=>{const s=e;if(t&&null===t[s])throw new Ur({code:4200,message:`The Provider does not support the requested method: ${e}`});if(t&&t[s])return t[s]({baseRequest:n,params:r});if(n)return n({method:e,params:r});throw new Ur({code:4200,message:`The Provider does not support the requested method: ${e}`})},e},zr=e=>({method:t,params:n})=>new Promise(((r,s)=>{e.sendAsync({id:0,jsonrpc:"2.0",method:t,params:n},((e,{result:t})=>{e?s(JSON.parse(e)):r(null==t?null:t)}))}));function Hr(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function Gr(e){return Hr(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}let qr=class e extends Error{constructor(t,n={}){super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"viem@2.12.0"});const r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof e&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://viem.sh${s}${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join("\n"),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(e){return $r(this,e)}};function $r(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?$r(e.cause,t):t?null:e}let Vr=class extends qr{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}},Wr=class extends qr{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}};function Zr(e,{dir:t,size:n=32}={}){return"string"==typeof e?Qr(e,{dir:t,size:n}):Kr(e,{dir:t,size:n})}function Qr(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new Wr({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}function Kr(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new Wr({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;st)throw new Xr({givenSize:Gr(e),maxSize:t})}function ns(e,t){const n="string"==typeof t?{to:t}:t,r=n.to;return"number"===r?is(e,n):"bigint"===r?rs(e,n):"string"===r?as(e,n):"boolean"===r?ss(e,n):vs(e,n)}function rs(e,t={}){const{signed:n}=t;t.size&&ts(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2;return r<=(1n<<8n*BigInt(s)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*s,"f")}`)-1n}function ss(e,t={}){let n=e;if(t.size&&(ts(n,{size:t.size}),n=es(n)),"0x00"===es(n))return!1;if("0x01"===es(n))return!0;throw new Jr(n)}function is(e,t={}){return Number(rs(e,t))}function as(e,t={}){let n=vs(e);return t.size&&(ts(n,{size:t.size}),n=es(n,{dir:"right"})),(new TextDecoder).decode(n)}const os=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function cs(e,t={}){return"number"==typeof e||"bigint"==typeof e?ds(e,t):"string"==typeof e?ps(e,t):"boolean"==typeof e?ls(e,t):us(e,t)}function ls(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(ts(n,{size:t.size}),Zr(n,{size:t.size})):n}function us(e,t={}){let n="";for(let t=0;ti||s=gs.zero&&e<=gs.nine?e-gs.zero:e>=gs.A&&e<=gs.F?e-(gs.A-10):e>=gs.a&&e<=gs.f?e-(gs.a-10):void 0}function vs(e,t={}){let n=e;t.size&&(ts(n,{size:t.size}),n=Zr(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,i=new Uint8Array(s);for(let e=0,t=0;e0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function As(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Cs(e,t){Es(e);const n=t.outputLen;if(e.length>_s&Ps)}:{h:0|Number(e>>_s&Ps),l:0|Number(e&Ps)}}function Is(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;se instanceof Uint8Array,Ts=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Ms=(e,t)=>e<<32-t|e>>>t;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function Os(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!Bs(e))throw new Error("expected Uint8Array, got "+typeof e);return e}let Ns=class{clone(){return this._cloneInto()}};function Rs(e){const t=t=>e().update(Os(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const[Fs,js,Ls]=[[],[],[]],Us=BigInt(0),Ds=BigInt(1),zs=BigInt(2),Hs=BigInt(7),Gs=BigInt(256),qs=BigInt(113);for(let e=0,t=Ds,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Fs.push(2*(5*r+n)),js.push((e+1)*(e+2)/2%64);let s=Us;for(let e=0;e<7;e++)t=(t<>Hs)*qs)%Gs,t&zs&&(s^=Ds<<(Ds<n>32?((e,t,n)=>t<>>64-n)(e,t,n):((e,t,n)=>e<>>32-n)(e,t,n),Zs=(e,t,n)=>n>32?((e,t,n)=>e<>>64-n) /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */(e,t,n):((e,t,n)=>t<>>32-n)(e,t,n);let Qs=class e extends Ns{constructor(e,t,n,r=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ks(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}keccak(){!function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,s=(t+2)%10,i=n[s],a=n[s+1],o=Ws(i,a,1)^n[r],c=Zs(i,a,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=c}let t=e[2],s=e[3];for(let n=0;n<24;n++){const r=js[n],i=Ws(t,s,r),a=Zs(t,s,r),o=Fs[n];t=e[o],s=e[o+1],e[o]=i,e[o+1]=a}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=$s[r],e[1]^=Vs[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){As(this);const{blockLen:t,state:n}=this,r=(e=Os(e)).length;for(let s=0;s=n&&this.keccak();const i=Math.min(n-this.posOut,s-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ks(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Cs(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:a}=this;return t||(t=new e(n,r,s,a,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=s,t.enableXOF=a,t.destroyed=this.destroyed,t}};const Ks=((e,t,n)=>Rs((()=>new Qs(t,e,n))))(1,136,32);function Ys(e,t){return Ks(Hr(e,{strict:!1})?ms(e):e)}let Js=class extends qr{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}},Xs=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}set(e,t){return super.set(e,t),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}};const ei=new Xs(8192);function ti(e,t){if(ei.has(`${e}.${t}`))return ei.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=Ys(xs(n)),s=n.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&s[e]&&(s[e]=s[e].toUpperCase()),(15&r[e>>1])>=8&&s[e+1]&&(s[e+1]=s[e+1].toUpperCase());const i=`0x${s.join("")}`;return ei.set(`${e}.${t}`,i),i}const ni=/^0x[a-fA-F0-9]{40}$/,ri=new Xs(8192);function si(e,t){const{strict:n=!0}=t??{};if(ri.has(e))return ri.get(e);const r=!(!ni.test(e)||e.toLowerCase()!==e&&n&&ti(e)!==e);return ri.set(e,r),r}function ii(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}function ai(e,t,n,{strict:r}={}){return Hr(e,{strict:!1})?li(e,t,n,{strict:r}):ci(e,t,n,{strict:r})}function oi(e,t,n){if(Gr(e)!==n-t)throw new Vr({offset:n,position:"end",size:Gr(e)})}function ci(e,t,n,{strict:r}={}){const s=e.slice(t,n);return r&&oi(s,t,n),s}function li(e,t,n,{strict:r}={}){const s=`0x${e.replace("0x","").slice(2*t,2*n)}`;return r&&oi(s,t,n),s}let ui=class extends qr{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}},di=class extends qr{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}},hi=class extends qr{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}};const pi={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new hi({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new di({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new ui({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new ui({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function fi(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(pi);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}const mi={gwei:9,wei:18},bi={ether:-9,wei:9};function gi(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${i?`.${i}`:""}`}function yi(e,t="wei"){return gi(e,mi[t])}function vi(e,t="wei"){return gi(e,bi[t])}function wi(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),n=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`)).join("\n")}let xi=class extends qr{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}},ki=class extends qr{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",wi(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}},Ei=class extends qr{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}},Ai=class extends qr{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${vi(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}};Object.defineProperty(Ai,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});let Ci=class extends qr{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${vi(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${vi(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}};function Pi(e,t){return({exclude:n,format:r})=>({exclude:n,format:e=>{const s=t(e);if(n)for(const e of n)delete s[e];return{...s,...r(e)}},type:e})}Object.defineProperty(Ci,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});const _i={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function Si(e){const t={};return void 0!==e.accessList&&(t.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?t.blobs=e.blobs.map((e=>us(e))):t.blobs=e.blobs),void 0!==e.data&&(t.data=e.data),void 0!==e.from&&(t.from=e.from),void 0!==e.gas&&(t.gas=ds(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=ds(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=ds(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=ds(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=ds(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=ds(e.nonce)),void 0!==e.to&&(t.to=e.to),void 0!==e.type&&(t.type=_i[e.type]),void 0!==e.value&&(t.value=ds(e.value)),t}const Ii=Pi("transactionRequest",Si),Bi={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function Ti(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?is(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?is(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Bi[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof t.v){if(0n===t.v||27n===t.v)return 0;if(1n===t.v||28n===t.v)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),"eip2930"===t.type&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip1559"===t.type&&delete t.maxFeePerBlobGas,t}const Mi=Pi("transaction",Ti);function Oi(e){const t=e.transactions?.map((e=>"string"==typeof e?e:Ti(e)));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Ni=Pi("block",Oi);function Ri(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>vs(e))):e.blobs,s=[];for(const e of r)s.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?s:s.map((e=>us(e)))}function Fi(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>vs(e))):e.blobs,s="string"==typeof e.commitments[0]?e.commitments.map((e=>vs(e))):e.commitments,i=[];for(let e=0;eus(e)))}let ji=class extends Ns{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Ts(this.buffer)}update(e){As(this);const{view:t,buffer:n,blockLen:r}=this,s=(e=Os(e)).length;for(let i=0;ir-i&&(this.process(n,0),i=0);for(let e=i;e>s&i),o=Number(n&i),c=r?4:0,l=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),s),this.process(n,0);const a=Ts(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;ee&t^~e&n,Ui=(e,t,n)=>e&t^e&n^t&n,Di=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),zi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Hi=new Uint32Array(64);let Gi=class extends ji{constructor(){super(64,32,8,!1),this.A=0|zi[0],this.B=0|zi[1],this.C=0|zi[2],this.D=0|zi[3],this.E=0|zi[4],this.F=0|zi[5],this.G=0|zi[6],this.H=0|zi[7]}get(){const{A:e,B:t,C:n,D:r,E:s,F:i,G:a,H:o}=this;return[e,t,n,r,s,i,a,o]}set(e,t,n,r,s,i,a,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|s,this.F=0|i,this.G=0|a,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)Hi[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Hi[e-15],n=Hi[e-2],r=Ms(t,7)^Ms(t,18)^t>>>3,s=Ms(n,17)^Ms(n,19)^n>>>10;Hi[e]=s+Hi[e-7]+r+Hi[e-16]|0}let{A:n,B:r,C:s,D:i,E:a,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(Ms(a,6)^Ms(a,11)^Ms(a,25))+Li(a,o,c)+Di[e]+Hi[e]|0,u=(Ms(n,2)^Ms(n,13)^Ms(n,22))+Ui(n,r,s)|0;l=c,c=o,o=a,a=i+t|0,i=s,s=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,s=s+this.C|0,i=i+this.D|0,a=a+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,s,i,a,o,c,l)}roundClean(){Hi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const qi=Rs((()=>new Gi));function $i(e,t){const n=t||"hex",r=qi(Hr(e,{strict:!1})?ms(e):e);return"bytes"===n?r:cs(r)}function Vi(e){const{commitment:t,version:n=1}=e,r=e.to??("string"==typeof t?"hex":"bytes"),s=$i(t,"bytes");return s.set([n],0),"bytes"===r?s:us(s)}function Wi(e){const{commitments:t,version:n}=e,r=e.to??("string"==typeof t[0]?"hex":"bytes"),s=[];for(const e of t)s.push(Vi({commitment:e,to:r,version:n}));return s}const Zi=32,Qi=4096,Ki=Zi*Qi,Yi=6*Ki-1-1*Qi*6,Ji=1;let Xi=class extends qr{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}},ea=class extends qr{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}},ta=class extends qr{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}},na=class extends qr{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${Ji}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}};function ra(e){const t=e.to??("string"==typeof e.data?"hex":"bytes"),n="string"==typeof e.data?vs(e.data):e.data,r=Gr(n);if(!r)throw new ea;if(r>Yi)throw new Xi({maxSize:Yi,size:r});const s=[];let i=!0,a=0;for(;i;){const e=fi(new Uint8Array(Ki));let t=0;for(;te.bytes)):s.map((e=>us(e.bytes)))}function sa(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??ra({data:t,to:r}),i=e.commitments??Ri({blobs:s,kzg:n,to:r}),a=e.proofs??Fi({blobs:s,commitments:i,kzg:n,to:r}),o=[];for(let e=0;ee+t.length),0),n=da(t);return{length:t<=55?1+t:1+n+t,encode(r){t<=55?r.pushByte(192+t):(r.pushByte(247+n),1===n?r.pushUint8(t):2===n?r.pushUint16(t):3===n?r.pushUint24(t):r.pushUint32(t));for(const{encode:t}of e)t(r)}}}(e.map((e=>ua(e)))):function(e){const t="string"==typeof e?vs(e):e,n=da(t.length),r=1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length;return{length:r,encode(e){1===t.length&&t[0]<128?e.pushBytes(t):t.length<=55?(e.pushByte(128+t.length),e.pushBytes(t)):(e.pushByte(183+n),1===n?e.pushUint8(t.length):2===n?e.pushUint16(t.length):3===n?e.pushUint24(t.length):e.pushUint32(t.length),e.pushBytes(t))}}}(e)}function da(e){if(e<256)return 1;if(e<65536)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new qr("Length is too large.")}const ha={"0x0":"reverted","0x1":"success"};function pa(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map((e=>aa(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?is(e.transactionIndex):null,status:e.status?ha[e.status]:null,type:e.type?Bi[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const fa=Pi("transactionReceipt",pa);function ma(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new oa({chainId:t});if(s&&!si(s))throw new Js({address:s});if(r&&r>2n**256n-1n)throw new Ai({maxFeePerGas:r});if(n&&r&&n>r)throw new Ci({maxFeePerGas:r,maxPriorityFeePerGas:n})}function ba(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i}=e;if(t<=0)throw new oa({chainId:t});if(i&&!si(i))throw new Js({address:i});if(n||s)throw new qr("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new Ai({maxFeePerGas:r})}function ga(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i,accessList:a}=e;if(i&&!si(i))throw new Js({address:i});if(void 0!==t&&t<=0)throw new oa({chainId:t});if(n||s)throw new qr("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new Ai({maxFeePerGas:r});if(a)throw new qr("`accessList` is not a valid Legacy Transaction attribute.")}function ya(e){if(!e||0===e.length)return[];const t=[];for(let n=0;nus(e))),n=e.kzg,r=Ri({blobs:t,kzg:n});if(void 0===h&&(h=Wi({commitments:r})),void 0===p){p=sa({blobs:t,commitments:r,proofs:Fi({blobs:t,commitments:r,kzg:n})})}}const f=ya(u),m=[cs(n),s?cs(s):"0x",l?cs(l):"0x",c?cs(c):"0x",r?cs(r):"0x",i??"0x",a?cs(a):"0x",d??"0x",f,o?cs(o):"0x",h??[],...wa(e,t)],b=[],g=[],y=[];if(p)for(let e=0;e{if(t.v>=35n){return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n)}if(n>0)return BigInt(2*n)+BigInt(35n+t.v-27n);const e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new xi({v:t.v});return e})();l=[...l,cs(e),t.r,t.s]}else n>0&&(l=[...l,cs(n),"0x","0x"]);return la(l)}(e,t)}function wa(e,t){const{r:n,s:r,v:s,yParity:i}=t??e;if(void 0===n)return[];if(void 0===r)return[];if(void 0===s&&void 0===i)return[];return["number"==typeof i?i?cs(1):"0x":0n===s?"0x":1n===s?cs(1):27n===s?"0x":cs(1),es(n),es(r)]}function xa(e,t){let[n,r="0"]=e.split(".");const s=n.startsWith("-");if(s&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),0===t)1===Math.round(Number(`.${r}`))&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){const[e,s,i]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],a=Math.round(Number(`${s}.${i}`));r=a>9?`${BigInt(e)+BigInt(1)}0`.padStart(e.length+1,"0"):`${e}${a}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${s?"-":""}${n}${r}`)}function ka(e,t="wei"){return xa(e,mi[t])}var Ea=Object.freeze({__proto__:null,BaseError:qr,FeeCapTooHighError:Ai,IntegerOutOfRangeError:Yr,InvalidAddressError:Js,InvalidChainIdError:oa,InvalidHexBooleanError:Jr,InvalidLegacyVError:xi,InvalidSerializableTransactionError:ki,InvalidStorageKeySizeError:Ei,SizeExceedsPaddingSizeError:Wr,SizeOverflowError:Xr,SliceOffsetOutOfBoundsError:Vr,TipAboveFeeCapError:Ci,assertTransactionEIP1559:ma,assertTransactionEIP2930:ba,assertTransactionLegacy:ga,blobsToCommitments:Ri,blobsToProofs:Fi,boolToBytes:bs,boolToHex:ls,bytesToHex:us,checksumAddress:ti,commitmentToVersionedHash:Vi,commitmentsToVersionedHashes:Wi,concatHex:ii,defineBlock:Ni,defineChain:ca,defineTransaction:Mi,defineTransactionReceipt:fa,defineTransactionRequest:Ii,etherUnits:mi,extractChain:function({chains:e,id:t}){return e.find((e=>e.id===t))},formatBlock:Oi,formatEther:yi,formatGwei:vi,formatLog:aa,formatTransaction:Ti,formatTransactionReceipt:pa,formatTransactionRequest:Si,formatUnits:gi,fromHex:ns,getTransactionType:ia,gweiUnits:bi,hexToBigInt:rs,hexToBool:ss,hexToBytes:vs,hexToNumber:is,hexToString:as,isAddress:si,isHex:Hr,keccak256:Ys,maxUint16:65535n,numberToBytes:ws,numberToHex:ds,pad:Zr,padBytes:Kr,padHex:Qr,parseEther:ka,parseUnits:xa,rpcTransactionType:_i,serializeAccessList:ya,serializeTransaction:va,sha256:$i,size:Gr,slice:ai,sliceBytes:ci,sliceHex:li,stringToBytes:xs,stringToHex:ps,toBlobSidecars:sa,toBlobs:ra,toBytes:ms,toHex:cs,toRlp:la,transactionType:Bi,trim:es});const Aa=e=>Aa(),Ca=e=>yi(rs(e)),Pa=e=>{if(!e)return e;return yi(ns(e,"bigint"))},_a=e=>{if("string"!=typeof e&&"number"!=typeof e)throw new Error("eth must be a string or number value");return ka("number"==typeof e?e.toString():e)},Sa=e=>ds(e),Ia=(e,t)=>`Please install or enable to ${e} to continue`,Ba=async e=>{const t=await Promise.resolve().then((function(){return joe})),{id:n,label:r,token:s,publicRpcUrl:i,blockExplorerUrl:a,rpcUrl:o}=e;switch(n){case"0x89":{const{polygon:e}=t;return e}case"0xa":{const{optimism:e}=t;return e}case"0xa4b1":{const{arbitrum:e}=t;return e}case"0x144":{const{zkSync:e}=t;return e}case"0x38":{const{bsc:e}=t;return e}case"0x1":{const{mainnet:e}=t;return e}case"0xaa36a7":{const{sepolia:e}=t;return e}case"0xfa":{const{fantom:e}=t;return e}case"0xa86a":{const{avalanche:e}=t;return e}case"0xa4ec":{const{celo:e}=t;return e}case"0x2105":{const{base:e}=t;return e}case"0x14a33":{const{baseGoerli:e}=t;return e}case"0x64":{const{gnosis:e}=t;return e}case"0x63564C40":{const{harmonyOne:e}=t;return e}case"0x27bc86aa":{const{degen:e}=t;return e}default:{const{extractChain:e,defineChain:c}=await Promise.resolve().then((function(){return Ea})),l=e({chains:Object.values(t),id:ns(n,"number")});return l||c({id:ns(n,"number"),name:null!=r?r:"",nativeCurrency:{decimals:18,name:null!=s?s:"",symbol:null!=s?s:""},rpcUrls:{default:{http:[null!=o?o:"",null!=i?i:""]}},blockExplorers:{default:{name:"Explorer",url:null!=a?a:""}}})}}};var Ta;function Ma(e,t){const n=e.validate(t);return n.error?n:null}!function(e){e[e.ACCOUNT_ACCESS_REJECTED=4001]="ACCOUNT_ACCESS_REJECTED",e[e.ACCOUNT_ACCESS_ALREADY_REQUESTED=-32002]="ACCOUNT_ACCESS_ALREADY_REQUESTED",e[e.UNAUTHORIZED=4100]="UNAUTHORIZED",e[e.INVALID_PARAMS=-32602]="INVALID_PARAMS",e[e.UNSUPPORTED_METHOD=4200]="UNSUPPORTED_METHOD",e[e.DISCONNECTED=4900]="DISCONNECTED",e[e.CHAIN_DISCONNECTED=4901]="CHAIN_DISCONNECTED",e[e.CHAIN_NOT_ADDED=4902]="CHAIN_NOT_ADDED",e[e.DOES_NOT_EXIST=-32601]="DOES_NOT_EXIST",e[e.UNRECOGNIZED_CHAIN_ID=-32603]="UNRECOGNIZED_CHAIN_ID"}(Ta||(Ta={}));const Oa=Lr.alternatives().try(Lr.string().pattern(/^0x[0-9a-fA-F]+$/),Lr.number().positive()),Na=Lr.string().valid("evm"),Ra=Lr.object({address:Lr.string().required(),icon:Lr.string().optional()}),Fa=Lr.object({namespace:Na,id:Oa.required(),rpcUrl:Lr.string(),label:Lr.string(),token:Lr.string(),secondaryTokens:Lr.array().max(5).items(Ra).optional(),icon:Lr.string(),color:Lr.string(),publicRpcUrl:Lr.string(),protectedRpcUrl:Lr.string(),blockExplorerUrl:Lr.string()});var ja=Object.freeze({__proto__:null,InterVar:'\n@font-face {\n font-family: \'Inter\';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url("https://rsms.me/inter/font-files/InterVariable.woff2") format("woff2-variations");\n}\n',ProviderRpcError:Ur,get ProviderRpcErrorCode(){return Ta},bigIntToHex:Sa,chainIdToViemImport:Ba,chainIdValidation:Oa,chainNamespaceValidation:Na,chainValidation:Fa,createDownloadMessage:Ia,createEIP1193Provider:Dr,ethToWeiBigInt:_a,fromHex:ns,isAddress:Aa,isHex:Hr,parseEther:ka,toHex:cs,validate:Ma,weiHexToEth:Ca,weiToEth:Pa}),La={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=1,s=2,i=1/0,a=9007199254740991,o="[object Arguments]",c="[object Array]",l="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Function]",p="[object GeneratorFunction]",f="[object Map]",m="[object Number]",b="[object Object]",g="[object Promise]",y="[object RegExp]",v="[object Set]",w="[object String]",x="[object Symbol]",k="[object WeakMap]",E="[object ArrayBuffer]",A="[object DataView]",C=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,P=/^\w*$/,_=/^\./,S=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,I=/\\(\\)?/g,B=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,M={};M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M[o]=M[c]=M[E]=M[l]=M[A]=M[u]=M[d]=M[h]=M[f]=M[m]=M[b]=M[y]=M[v]=M[w]=M[k]=!1;var O="object"==typeof qe&&qe&&qe.Object===Object&&qe,N="object"==typeof self&&self&&self.Object===Object&&self,R=O||N||Function("return this")(),F=t&&!t.nodeType&&t,j=F&&e&&!e.nodeType&&e,L=j&&j.exports===F&&O.process,U=function(){try{return L&&L.binding("util")}catch(e){}}(),D=U&&U.isTypedArray;function z(e,t,n,r){for(var s=-1,i=e?e.length:0;++s-1},Ee.prototype.set=function(e,t){var n=this.__data__,r=Se(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Ae.prototype.clear=function(){this.__data__={hash:new ke,map:new(le||Ee),string:new ke}},Ae.prototype.delete=function(e){return ze(this,e).delete(e)},Ae.prototype.get=function(e){return ze(this,e).get(e)},Ae.prototype.has=function(e){return ze(this,e).has(e)},Ae.prototype.set=function(e,t){return ze(this,e).set(e,t),this},Ce.prototype.add=Ce.prototype.push=function(e){return this.__data__.set(e,n),this},Ce.prototype.has=function(e){return this.__data__.has(e)},Pe.prototype.clear=function(){this.__data__=new Ee},Pe.prototype.delete=function(e){return this.__data__.delete(e)},Pe.prototype.get=function(e){return this.__data__.get(e)},Pe.prototype.has=function(e){return this.__data__.has(e)},Pe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ee){var r=n.__data__;if(!le||r.length<199)return r.push([e,t]),this;n=this.__data__=new Ae(r)}return n.set(e,t),this};var Be,Te=(Be=function(e,t){return e&&Me(e,t,ht)},function(e,t){if(null==e)return e;if(!it(e))return Be(e,t);for(var n=e.length,r=-1,s=Object(e);++rl))return!1;var d=o.get(e);if(d&&o.get(t))return d==t;var h=-1,p=!0,f=a&r?new Ce:void 0;for(o.set(e,t),o.set(t,e);++h-1&&e%1==0&&e-1&&e%1==0&&e<=a}function ct(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function lt(e){return!!e&&"object"==typeof e}function ut(e){return"symbol"==typeof e||lt(e)&&te.call(e)==x}var dt=D?function(e){return function(t){return e(t)}}(D):function(e){return lt(e)&&ot(e.length)&&!!M[te.call(e)]};function ht(e){return it(e)?_e(e):Le(e)}function pt(e){return e}e.exports=et}(La,La.exports);var Ua=$e(La.exports);const Da=/^tuple(?(\[(\d*)\])*)$/;function za(e){let t=e.type;if(Da.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;re[t.name]?.(r)??e[n]?.(r)??t(e,r)}function qa(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new go(e.type);return`${e.name}(${$a(e.inputs,{includeName:t})})`}function $a(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${$a(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}function Va(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function Wa(e){return Va(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}let Za=class e extends Error{constructor(t,n={}){super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"viem@2.12.0"});const r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof e&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://viem.sh${s}${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join("\n"),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(e){return Qa(this,e)}};function Qa(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?Qa(e.cause,t):t?null:e}let Ka=class extends Za{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}},Ya=class extends Za{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}},Ja=class extends Za{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${$a(t,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=n}},Xa=class extends Za{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}},eo=class extends Za{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}},to=class extends Za{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${Wa(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}},no=class extends Za{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}},ro=class extends Za{constructor(e,{docsPath:t}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}},so=class extends Za{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}},io=class extends Za{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}},ao=class extends Za{constructor(e,{docsPath:t}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}},oo=class extends Za{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}},co=class extends Za{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}},lo=class extends Za{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${qa(e.abiItem)}\`, and`,`\`${t.type}\` in \`${qa(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}},uo=class extends Za{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}},ho=class extends Za{constructor({abiItem:e,data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for non-indexed event parameters.`].join("\n"),{metaMessages:[`Params: (${$a(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=n,this.size=r}},po=class extends Za{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${qa(e,{includeName:!0})}".`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}},fo=class extends Za{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}},mo=class extends Za{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}},bo=class extends Za{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}},go=class extends Za{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}},yo=class extends Za{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}},vo=class extends Za{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}},wo=class extends Za{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}},xo=class extends Za{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${t} ${n} long, but is ${e} ${n} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}};function ko(e,{dir:t,size:n=32}={}){return"string"==typeof e?Eo(e,{dir:t,size:n}):Ao(e,{dir:t,size:n})}function Eo(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new wo({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}function Ao(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new wo({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;st)throw new _o({givenSize:Wa(e),maxSize:t})}function Bo(e,t={}){const{signed:n}=t;t.size&&Io(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2;return r<=(1n<<8n*BigInt(s)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*s,"f")}`)-1n}function To(e,t={}){return Number(Bo(e,t))}const Mo=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Oo(e,t={}){return"number"==typeof e||"bigint"==typeof e?Fo(e,t):"string"==typeof e?Lo(e,t):"boolean"==typeof e?No(e,t):Ro(e,t)}function No(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(Io(n,{size:t.size}),ko(n,{size:t.size})):n}function Ro(e,t={}){let n="";for(let t=0;ti||s=Ho.zero&&e<=Ho.nine?e-Ho.zero:e>=Ho.A&&e<=Ho.F?e-(Ho.A-10):e>=Ho.a&&e<=Ho.f?e-(Ho.a-10):void 0}function qo(e,t={}){let n=e;t.size&&(Io(n,{size:t.size}),n=ko(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,i=new Uint8Array(s);for(let e=0,t=0;e0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Qo(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Ko(e,t){Zo(e);const n=t.outputLen;if(e.length>Jo&Yo)}:{h:0|Number(e>>Jo&Yo),l:0|Number(e&Yo)}}function ec(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;se instanceof Uint8Array,rc=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),sc=(e,t)=>e<<32-t|e>>>t;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function ic(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!nc(e))throw new Error("expected Uint8Array, got "+typeof e);return e}let ac=class{clone(){return this._cloneInto()}};function oc(e){const t=t=>e().update(ic(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function cc(e=32){if(tc&&"function"==typeof tc.getRandomValues)return tc.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const[lc,uc,dc]=[[],[],[]],hc=BigInt(0),pc=BigInt(1),fc=BigInt(2),mc=BigInt(7),bc=BigInt(256),gc=BigInt(113);for(let e=0,t=pc,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],lc.push(2*(5*r+n)),uc.push((e+1)*(e+2)/2%64);let s=hc;for(let e=0;e<7;e++)t=(t<>mc)*gc)%bc,t&fc&&(s^=pc<<(pc<n>32?((e,t,n)=>t<>>64-n)(e,t,n):((e,t,n)=>e<>>32-n)(e,t,n),xc=(e,t,n)=>n>32?((e,t,n)=>e<>>64-n)(e,t,n):((e,t,n)=>t<>>32-n)(e,t,n);let kc=class e extends ac{constructor(e,t,n,r=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Wo(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}keccak(){!function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,s=(t+2)%10,i=n[s],a=n[s+1],o=wc(i,a,1)^n[r],c=xc(i,a,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=c}let t=e[2],s=e[3];for(let n=0;n<24;n++){const r=uc[n],i=wc(t,s,r),a=xc(t,s,r),o=lc[n];t=e[o],s=e[o+1],e[o]=i,e[o+1]=a}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=yc[r],e[1]^=vc[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Qo(this);const{blockLen:t,state:n}=this,r=(e=ic(e)).length;for(let s=0;s=n&&this.keccak();const i=Math.min(n-this.posOut,s-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Wo(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Ko(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:a}=this;return t||(t=new e(n,r,s,a,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=s,t.enableXOF=a,t.destroyed=this.destroyed,t}};const Ec=((e,t,n)=>oc((()=>new kc(t,e,n))))(1,136,32);function Ac(e,t){const n=t||"hex",r=Ec(Va(e,{strict:!1})?Do(e):e);return"bytes"===n?r:Oo(r)}const Cc=e=>Ac(Do(e));const Pc=e=>{var t;return function(e){let t=!0,n="",r=0,s="",i=!1;for(let a=0;athis.maxSize&&this.delete(this.keys().next().value),this}};const Tc=new Bc(8192);function Mc(e,t){if(Tc.has(`${e}.${t}`))return Tc.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=Ac(Vo(n),"bytes"),s=n.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&s[e]&&(s[e]=s[e].toUpperCase()),(15&r[e>>1])>=8&&s[e+1]&&(s[e+1]=s[e+1].toUpperCase());const i=`0x${s.join("")}`;return Tc.set(`${e}.${t}`,i),i}const Oc=/^0x[a-fA-F0-9]{40}$/,Nc=new Bc(8192);function Rc(e,t){const{strict:n=!0}=t??{};if(Nc.has(e))return Nc.get(e);const r=!(!Oc.test(e)||e.toLowerCase()!==e&&n&&Mc(e)!==e);return Nc.set(e,r),r}function Fc(e){return"string"==typeof e[0]?Lc(e):jc(e)}function jc(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}function Lc(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}function Uc(e,t,n,{strict:r}={}){return Va(e,{strict:!1})?Gc(e,t,n,{strict:r}):Hc(e,t,n,{strict:r})}function Dc(e,t){if("number"==typeof t&&t>0&&t>Wa(e)-1)throw new vo({offset:t,position:"start",size:Wa(e)})}function zc(e,t,n){if("number"==typeof t&&"number"==typeof n&&Wa(e)!==n-t)throw new vo({offset:n,position:"end",size:Wa(e)})}function Hc(e,t,n,{strict:r}={}){Dc(e,t);const s=e.slice(t,n);return r&&zc(s,t,n),s}function Gc(e,t,n,{strict:r}={}){Dc(e,t);const s=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;return r&&zc(s,t,n),s}function qc(e,t){if(e.length!==t.length)throw new no({expectedLength:e.length,givenLength:t.length});const n=function({params:e,values:t}){const n=[];for(let r=0;r0?Fc([t,e]):t}}if(s)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:Fc(i.map((({encoded:e})=>e)))}}(t,{length:r,param:{...e,type:s}})}if("tuple"===e.type)return function(e,{param:t}){let n=!1;const r=[];for(let s=0;se)))}}(t,{param:e});if("address"===e.type)return function(e){if(!Rc(e))throw new Ic({address:e});return{dynamic:!1,encoded:Eo(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){if("boolean"!=typeof e)throw new Za(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Eo(No(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){return function(e,{signed:t}){return{dynamic:!1,encoded:Fo(e,{size:32,signed:t})}}(t,{signed:e.type.startsWith("int")})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),r=Wa(e);if(!n){let t=e;return r%32!=0&&(t=Eo(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:Fc([Eo(Fo(r,{size:32})),t])}}if(r!==Number.parseInt(n))throw new to({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:Eo(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=Lo(e),n=Math.ceil(Wa(t)/32),r=[];for(let e=0;eUc(_c(e),0,4);function Qc(e){const{abi:t,args:n=[],name:r}=e,s=Va(r,{strict:!1}),i=t.filter((e=>s?"function"===e.type?Zc(e)===r:"event"===e.type&&Sc(e)===r:"name"in e&&e.name===r));if(0===i.length)return;if(1===i.length)return i[0];let a;for(const e of i){if(!("inputs"in e))continue;if(!n||0===n.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==n.length)continue;const t=n.every(((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&Kc(t,r)}));if(t){if(a&&"inputs"in a&&a.inputs){const t=Yc(e.inputs,a.inputs,n);if(t)throw new lo({abiItem:e,type:t[0]},{abiItem:a,type:t[1]})}a=e}}return a||i[0]}function Kc(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Rc(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every(((t,n)=>Kc(Object.values(e)[n],t))):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every((e=>Kc(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function Yc(e,t,n){for(const r in e){const s=e[r],i=t[r];if("tuple"===s.type&&"tuple"===i.type&&"components"in s&&"components"in i)return Yc(s.components,i.components,n[r]);const a=[s.type,i.type];if(!(!a.includes("address")||!a.includes("bytes20"))||(a.includes("address")&&a.includes("string")||!(!a.includes("address")||!a.includes("bytes")))&&Rc(n[r],{strict:!1}))return a}}const Jc="/docs/contract/encodeEventTopics";function Xc(e){const{abi:t,eventName:n,args:r}=e;let s=t[0];if(n){const e=Qc({abi:t,name:n});if(!e)throw new ao(n,{docsPath:Jc});s=e}if("event"!==s.type)throw new ao(void 0,{docsPath:Jc});const i=qa(s),a=Sc(i);let o=[];if(r&&"inputs"in s){const e=s.inputs?.filter((e=>"indexed"in e&&e.indexed)),t=Array.isArray(r)?r:Object.values(r).length>0?e?.map((e=>r[e.name]))??[]:[];t.length>0&&(o=e?.map(((e,n)=>Array.isArray(t[n])?t[n].map(((r,s)=>el({param:e,value:t[n][s]}))):t[n]?el({param:e,value:t[n]}):null))??[])}return[a,...o]}function el({param:e,value:t}){if("string"===e.type||"bytes"===e.type)return Ac(Do(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new yo(e.type);return qc([e],[t])}function tl(e,{method:t}){const n={};return"fallback"===e.transport.type&&e.transport.onResponse?.((({method:e,response:r,status:s,transport:i})=>{"success"===s&&t===e&&(n[r]=i.request)})),t=>n[t]||e.request}async function nl(e,t){const{address:n,abi:r,args:s,eventName:i,fromBlock:a,strict:o,toBlock:c}=t,l=tl(e,{method:"eth_newFilter"}),u=i?Xc({abi:r,args:s,eventName:i}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:"bigint"==typeof a?Fo(a):a,toBlock:"bigint"==typeof c?Fo(c):c,topics:u}]});return{abi:r,args:s,eventName:i,id:d,request:l(d),strict:Boolean(o),type:"event"}}function rl(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}const sl="/docs/contract/encodeFunctionData";function il(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const e=Qc({abi:t,args:n,name:r});if(!e)throw new oo(r,{docsPath:sl});s=e}if("function"!==s.type)throw new oo(void 0,{docsPath:sl});return{abi:[s],functionName:Zc(qa(s))}}function al(e){const{args:t}=e,{abi:n,functionName:r}=1===e.abi.length&&e.functionName?.startsWith("0x")?e:il(e),s=n[0];return Lc([r,("inputs"in s&&s.inputs?qc(s.inputs,t??[]):void 0)??"0x"])}const ol={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},cl={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},ll={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let ul=class extends Za{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}},dl=class extends Za{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}},hl=class extends Za{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}};const pl={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new hl({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new dl({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new ul({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new ul({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function fl(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(pl);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function ml(e,t={}){void 0!==t.size&&Io(e,{size:t.size});return Bo(Ro(e,t),t)}function bl(e,t={}){let n=e;if(void 0!==t.size&&(Io(n,{size:t.size}),n=So(n)),n.length>1||n[0]>1)throw new Po(n);return Boolean(n[0])}function gl(e,t={}){void 0!==t.size&&Io(e,{size:t.size});return To(Ro(e,t),t)}function yl(e,t={}){let n=e;return void 0!==t.size&&(Io(n,{size:t.size}),n=So(n,{dir:"right"})),(new TextDecoder).decode(n)}function vl(e,t){const n="string"==typeof t?qo(t):t,r=fl(n);if(0===Wa(n)&&e.length>0)throw new Xa;if(Wa(t)&&Wa(t)<32)throw new Ja({data:"string"==typeof t?t:Ro(t),params:e,size:Wa(t)});let s=0;const i=[];for(let t=0;t!e)),s=r?[]:{};let i=0;if(El(t)){const a=n+gl(e.readBytes(kl));for(let n=0;n48?ml(s,{signed:n}):gl(s,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,{staticPosition:t}){const n=gl(e.readBytes(32)),r=t+n;e.setPosition(r);const s=gl(e.readBytes(32));if(0===s)return e.setPosition(t+32),["",32];const i=e.readBytes(s,32),a=yl(So(i));return e.setPosition(t+32),[a,32]}(e,{staticPosition:n});throw new mo(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const xl=32,kl=32;function El(e){const{type:t}=e;if("string"===t)return!0;if("bytes"===t)return!0;if(t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(El);const n=Wc(e.type);return!(!n||!El({...e,type:n[1]}))}function Al(e){const{abi:t,data:n}=e,r=Uc(n,0,4);if("0x"===r)throw new Xa;const s=[...t||[],cl,ll].find((e=>"error"===e.type&&r===Zc(qa(e))));if(!s)throw new ro(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?vl(s.inputs,Uc(n,4)):void 0,errorName:s.name}}const Cl=(e,t,n)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),n);function Pl({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map(((e,n)=>`${r&&e.name?`${e.name}: `:""}${"object"==typeof t[n]?Cl(t[n]):t[n]}`)).join(", ")})`}const _l={gwei:9,wei:18},Sl={ether:-9,wei:9};function Il(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${i?`.${i}`:""}`}function Bl(e,t="wei"){return Il(e,_l[t])}function Tl(e,t="wei"){return Il(e,Sl[t])}let Ml=class extends Za{constructor({address:e}){super(`State for account "${e}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}},Ol=class extends Za{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}};function Nl(e){return e.reduce(((e,{slot:t,value:n})=>`${e} ${t}: ${n}\n`),"")}function Rl(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),n=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`)).join("\n")}let Fl=class extends Za{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}},jl=class extends Za{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Rl(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}},Ll=class extends Za{constructor({blockHash:e,blockNumber:t,blockTag:n,hash:r,index:s}){let i="Transaction";n&&void 0!==s&&(i=`Transaction at block time "${n}" at index "${s}"`),e&&void 0!==s&&(i=`Transaction at block hash "${e}" at index "${s}"`),t&&void 0!==s&&(i=`Transaction at block number "${t}" at index "${s}"`),r&&(i=`Transaction with hash "${r}"`),super(`${i} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}},Ul=class extends Za{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}},Dl=class extends Za{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}},zl=class extends Za{constructor(e,{account:t,docsPath:n,chain:r,data:s,gas:i,gasPrice:a,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d,stateOverride:h}){const p=t?rl(t):void 0;let f=Rl({from:p?.address,to:u,value:void 0!==d&&`${Bl(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:void 0!==a&&`${Tl(a)} gwei`,maxFeePerGas:void 0!==o&&`${Tl(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${Tl(c)} gwei`,nonce:l});h&&(f+=`\n${function(e){return e.reduce(((e,{address:t,...n})=>{let r=`${e} ${t}:\n`;return n.nonce&&(r+=` nonce: ${n.nonce}\n`),n.balance&&(r+=` balance: ${n.balance}\n`),n.code&&(r+=` code: ${n.code}\n`),n.state&&(r+=" state:\n",r+=Nl(n.state)),n.stateDiff&&(r+=" stateDiff:\n",r+=Nl(n.stateDiff)),r})," State Override:\n").slice(0,-1)}(h)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",f].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}},Hl=class extends Za{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:s,functionName:i,sender:a}){const o=Qc({abi:t,args:n,name:i}),c=o?Pl({abiItem:o,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=Rl({address:r&&r,function:o?qa(o,{includeName:!0}):void 0,args:c&&"()"!==c&&`${[...Array(i?.length??0).keys()].map((()=>" ")).join("")}${c}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",l].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=t,this.args=n,this.cause=e,this.contractAddress=r,this.functionName=i,this.sender=a}},Gl=class extends Za{constructor({abi:e,data:t,functionName:n,message:r}){let s,i,a,o,c;if(t&&"0x"!==t)try{i=Al({abi:e,data:t});const{abiItem:n,errorName:r,args:s}=i;if("Error"===r)o=s[0];else if("Panic"===r){const[e]=s;o=ol[e]}else{const e=n?qa(n,{includeName:!0}):void 0,t=n&&s?Pl({abiItem:n,args:s,includeFunctionName:!1,includeName:!1}):void 0;a=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(r?.length??0).keys()].map((()=>" ")).join("")}${t}`:""]}}catch(e){s=e}else r&&(o=r);s instanceof ro&&(c=s.signature,a=[`Unable to decode signature "${c}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${c}.`]),super(o&&"execution reverted"!==o||c?[`The contract function "${n}" reverted with the following ${c?"signature":"reason"}:`,o||c].join("\n"):`The contract function "${n}" reverted.`,{cause:s,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.reason=o,this.signature=c}},ql=class extends Za{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}},$l=class extends Za{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}},Vl=class extends Za{constructor({body:e,details:t,headers:n,status:r,url:s}){super("HTTP request failed.",{details:t,metaMessages:[r&&`Status: ${r}`,`URL: ${s}`,e&&`Request body: ${Cl(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=r,this.url=s}},Wl=class extends Za{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${Cl(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}},Zl=class extends Za{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${t}`,`Request body: ${Cl(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}};let Ql=class extends Za{constructor(e,{code:t,docsPath:n,metaMessages:r,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:r||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof Wl?e.code:t??-1}},Kl=class extends Ql{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}},Yl=class e extends Ql{constructor(t){super(t,{code:e.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}};Object.defineProperty(Yl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});let Jl=class e extends Ql{constructor(t){super(t,{code:e.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}};Object.defineProperty(Jl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});let Xl=class e extends Ql{constructor(t){super(t,{code:e.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}};Object.defineProperty(Xl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});let eu=class e extends Ql{constructor(t){super(t,{code:e.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}};Object.defineProperty(eu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});let tu=class e extends Ql{constructor(t){super(t,{code:e.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}};Object.defineProperty(tu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});let nu=class e extends Ql{constructor(t){super(t,{code:e.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}};Object.defineProperty(nu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});let ru=class e extends Ql{constructor(t){super(t,{code:e.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};Object.defineProperty(ru,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});let su=class e extends Ql{constructor(t){super(t,{code:e.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}};Object.defineProperty(su,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});let iu=class e extends Ql{constructor(t){super(t,{code:e.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}};Object.defineProperty(iu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});let au=class e extends Ql{constructor(t){super(t,{code:e.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}};Object.defineProperty(au,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});let ou=class e extends Ql{constructor(t){super(t,{code:e.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}};Object.defineProperty(ou,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});let cu=class e extends Ql{constructor(t){super(t,{code:e.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}};Object.defineProperty(cu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});let lu=class e extends Kl{constructor(t){super(t,{code:e.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}};Object.defineProperty(lu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});let uu=class e extends Kl{constructor(t){super(t,{code:e.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}};Object.defineProperty(uu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});let du=class e extends Kl{constructor(t){super(t,{code:e.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}};Object.defineProperty(du,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});let hu=class e extends Kl{constructor(t){super(t,{code:e.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}};Object.defineProperty(hu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});let pu=class e extends Kl{constructor(t){super(t,{code:e.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}};Object.defineProperty(pu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});let fu=class e extends Kl{constructor(t){super(t,{code:e.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}};Object.defineProperty(fu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});let mu=class extends Ql{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}};const bu=3;function gu(e,{abi:t,address:n,args:r,docsPath:s,functionName:i,sender:a}){const{code:o,data:c,message:l,shortMessage:u}=e instanceof $l?e:e instanceof Za?e.walk((e=>"data"in e))||e.walk():{},d=e instanceof Xa?new ql({functionName:i}):[bu,tu.code].includes(o)&&(c||l||u)?new Gl({abi:t,data:"object"==typeof c?c.data:c,functionName:i,message:u??l}):e;return new Hl(d,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:i,sender:a})}let yu=class extends Za{constructor(e,{account:t,docsPath:n,chain:r,data:s,gas:i,gasPrice:a,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const h=Rl({from:t?.address,to:u,value:void 0!==d&&`${Bl(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:void 0!==a&&`${Tl(a)} gwei`,maxFeePerGas:void 0!==o&&`${Tl(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${Tl(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}},vu=class extends Za{constructor({cause:e,message:t}={}){const n=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}};Object.defineProperty(vu,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(vu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});let wu=class extends Za{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${Tl(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}};Object.defineProperty(wu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});let xu=class extends Za{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${Tl(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}};Object.defineProperty(xu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});let ku=class extends Za{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}};Object.defineProperty(ku,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});let Eu=class extends Za{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}};Object.defineProperty(Eu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});let Au=class extends Za{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}};Object.defineProperty(Au,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});let Cu=class extends Za{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}};Object.defineProperty(Cu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});let Pu=class extends Za{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}};Object.defineProperty(Pu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});let _u=class extends Za{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}};Object.defineProperty(_u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});let Su=class extends Za{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}};Object.defineProperty(Su,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});let Iu=class extends Za{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${Tl(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Tl(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}};Object.defineProperty(Iu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});let Bu=class extends Za{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}};function Tu(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof Za?e.walk((e=>e.code===vu.code)):e;return r instanceof Za?new vu({cause:e,message:r.details}):vu.nodeMessage.test(n)?new vu({cause:e,message:e.details}):wu.nodeMessage.test(n)?new wu({cause:e,maxFeePerGas:t?.maxFeePerGas}):xu.nodeMessage.test(n)?new xu({cause:e,maxFeePerGas:t?.maxFeePerGas}):ku.nodeMessage.test(n)?new ku({cause:e,nonce:t?.nonce}):Eu.nodeMessage.test(n)?new Eu({cause:e,nonce:t?.nonce}):Au.nodeMessage.test(n)?new Au({cause:e,nonce:t?.nonce}):Cu.nodeMessage.test(n)?new Cu({cause:e}):Pu.nodeMessage.test(n)?new Pu({cause:e,gas:t?.gas}):_u.nodeMessage.test(n)?new _u({cause:e,gas:t?.gas}):Su.nodeMessage.test(n)?new Su({cause:e}):Iu.nodeMessage.test(n)?new Iu({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new Bu({cause:e})}function Mu(e,{format:t}){if(!t)return{};const n={};return function t(r){const s=Object.keys(r);for(const i of s)i in e&&(n[i]=e[i]),r[i]&&"object"==typeof r[i]&&!Array.isArray(r[i])&&t(r[i])}(t(e||{})),n}const Ou={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function Nu(e){const t={};return void 0!==e.accessList&&(t.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?t.blobs=e.blobs.map((e=>Ro(e))):t.blobs=e.blobs),void 0!==e.data&&(t.data=e.data),void 0!==e.from&&(t.from=e.from),void 0!==e.gas&&(t.gas=Fo(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=Fo(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=Fo(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=Fo(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=Fo(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=Fo(e.nonce)),void 0!==e.to&&(t.to=e.to),void 0!==e.type&&(t.type=Ou[e.type]),void 0!==e.value&&(t.value=Fo(e.value)),t}function Ru(e){if(e&&0!==e.length)return e.reduce(((e,{slot:t,value:n})=>{if(66!==t.length)throw new xo({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new xo({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e}),{})}function Fu(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:i}=e,a={};if(void 0!==i&&(a.code=i),void 0!==t&&(a.balance=Fo(t)),void 0!==n&&(a.nonce=Fo(n)),void 0!==r&&(a.state=Ru(r)),void 0!==s){if(a.state)throw new Ol;a.stateDiff=Ru(s)}return a}function ju(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!Rc(n,{strict:!1}))throw new Ic({address:n});if(t[n])throw new Ml({address:n});t[n]=Fu(r)}return t}function Lu(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:i}=e,a=t?rl(t):void 0;if(a&&!Rc(a.address))throw new Ic({address:a.address});if(i&&!Rc(i))throw new Ic({address:i});if(void 0!==n&&(void 0!==r||void 0!==s))throw new Fl;if(r&&r>2n**256n-1n)throw new wu({maxFeePerGas:r});if(s&&r&&s>r)throw new Iu({maxFeePerGas:r,maxPriorityFeePerGas:s})}let Uu=class extends Za{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}},Du=class extends Za{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}},zu=class extends Za{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Tl(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}},Hu=class extends Za{constructor({blockHash:e,blockNumber:t}){let n="Block";e&&(n=`Block at hash "${e}"`),t&&(n=`Block at number "${t}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}};const Gu={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function qu(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?To(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?To(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Gu[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof t.v){if(0n===t.v||27n===t.v)return 0;if(1n===t.v||28n===t.v)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),"eip2930"===t.type&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip1559"===t.type&&delete t.maxFeePerBlobGas,t}function $u(e){const t=e.transactions?.map((e=>"string"==typeof e?e:qu(e)));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function Vu(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:s}={}){const i=r??"latest",a=s??!1,o=void 0!==n?Fo(n):void 0;let c=null;if(c=t?await e.request({method:"eth_getBlockByHash",params:[t,a]}):await e.request({method:"eth_getBlockByNumber",params:[o||i,a]}),!c)throw new Hu({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||$u)(c)}async function Wu(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Zu(e,t){const{block:n,chain:r=e.chain,request:s}=t||{};if("function"==typeof r?.fees?.defaultPriorityFee){const t=n||await Ga(e,Vu,"getBlock")({});return r.fees.defaultPriorityFee({block:t,client:e,request:s})}if(void 0!==r?.fees?.defaultPriorityFee)return r?.fees?.defaultPriorityFee;try{return Bo(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,r]=await Promise.all([n?Promise.resolve(n):Ga(e,Vu,"getBlock")({}),Ga(e,Wu,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new Du;const s=r-t.baseFeePerGas;return s<0n?0n:s}}async function Qu(e,t){const{block:n,chain:r=e.chain,request:s,type:i="eip1559"}=t||{},a=await(async()=>"function"==typeof r?.fees?.baseFeeMultiplier?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):r?.fees?.baseFeeMultiplier??1.2)();if(a<1)throw new Uu;const o=10**(a.toString().split(".")[1]?.length??0),c=e=>e*BigInt(Math.ceil(a*o))/BigInt(o),l=n||await Ga(e,Vu,"getBlock")({});if("function"==typeof r?.fees?.estimateFeesPerGas){const t=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:s,type:i});if(null!==t)return t}if("eip1559"===i){if("bigint"!=typeof l.baseFeePerGas)throw new Du;const t="bigint"==typeof s?.maxPriorityFeePerGas?s.maxPriorityFeePerGas:await Zu(e,{block:l,chain:r,request:s}),n=c(l.baseFeePerGas);return{maxFeePerGas:s?.maxFeePerGas??n+t,maxPriorityFeePerGas:t}}return{gasPrice:s?.gasPrice??c(await Ga(e,Wu,"getGasPrice")({}))}}async function Ku(e,{address:t,blockTag:n="latest",blockNumber:r}){return To(await e.request({method:"eth_getTransactionCount",params:[t,r?Fo(r):n]}))}function Yu(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>qo(e))):e.blobs,s=[];for(const e of r)s.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?s:s.map((e=>Ro(e)))}function Ju(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>qo(e))):e.blobs,s="string"==typeof e.commitments[0]?e.commitments.map((e=>qo(e))):e.commitments,i=[];for(let e=0;eRo(e)))}let Xu=class extends ac{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=rc(this.buffer)}update(e){Qo(this);const{view:t,buffer:n,blockLen:r}=this,s=(e=ic(e)).length;for(let i=0;ir-i&&(this.process(n,0),i=0);for(let e=i;e>s&i),o=Number(n&i),c=r?4:0,l=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),s),this.process(n,0);const a=rc(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;ee&t^~e&n,td=(e,t,n)=>e&t^e&n^t&n,nd=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),rd=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),sd=new Uint32Array(64);let id=class extends Xu{constructor(){super(64,32,8,!1),this.A=0|rd[0],this.B=0|rd[1],this.C=0|rd[2],this.D=0|rd[3],this.E=0|rd[4],this.F=0|rd[5],this.G=0|rd[6],this.H=0|rd[7]}get(){const{A:e,B:t,C:n,D:r,E:s,F:i,G:a,H:o}=this;return[e,t,n,r,s,i,a,o]}set(e,t,n,r,s,i,a,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|s,this.F=0|i,this.G=0|a,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)sd[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=sd[e-15],n=sd[e-2],r=sc(t,7)^sc(t,18)^t>>>3,s=sc(n,17)^sc(n,19)^n>>>10;sd[e]=s+sd[e-7]+r+sd[e-16]|0}let{A:n,B:r,C:s,D:i,E:a,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(sc(a,6)^sc(a,11)^sc(a,25))+ed(a,o,c)+nd[e]+sd[e]|0,u=(sc(n,2)^sc(n,13)^sc(n,22))+td(n,r,s)|0;l=c,c=o,o=a,a=i+t|0,i=s,s=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,s=s+this.C|0,i=i+this.D|0,a=a+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,s,i,a,o,c,l)}roundClean(){sd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const ad=oc((()=>new id));function od(e,t){return ad(Va(e,{strict:!1})?Do(e):e)}function cd(e){const{commitment:t,version:n=1}=e,r=e.to??("string"==typeof t?"hex":"bytes"),s=od(t);return s.set([n],0),"bytes"===r?s:Ro(s)}function ld(e){const{commitments:t,version:n}=e,r=e.to??("string"==typeof t[0]?"hex":"bytes"),s=[];for(const e of t)s.push(cd({commitment:e,to:r,version:n}));return s}const ud=32,dd=4096,hd=ud*dd,pd=6*hd-1-1*dd*6;let fd=class extends Za{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}},md=class extends Za{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}};function bd(e){const t=e.to??("string"==typeof e.data?"hex":"bytes"),n="string"==typeof e.data?qo(e.data):e.data,r=Wa(n);if(!r)throw new md;if(r>pd)throw new fd({maxSize:pd,size:r});const s=[];let i=!0,a=0;for(;i;){const e=fl(new Uint8Array(hd));let t=0;for(;te.bytes)):s.map((e=>Ro(e.bytes)))}function gd(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??bd({data:t,to:r}),i=e.commitments??Yu({blobs:s,kzg:n,to:r}),a=e.proofs??Ju({blobs:s,commitments:i,kzg:n,to:r}),o=[];for(let e=0;e{const t=Tu(e,n);return t instanceof Bu?e:t})();return new yu(r,{docsPath:t,...n})}(n,{...t,account:r,chain:e.chain})}}const Ed="/docs/contract/decodeEventLog";function Ad(e){const{abi:t,data:n,strict:r,topics:s}=e,i=r??!0,[a,...o]=s;if(!a)throw new so({docsPath:Ed});const c=t.find((e=>"event"===e.type&&a===Sc(qa(e))));if(!c||!("name"in c)||"event"!==c.type)throw new io(a,{docsPath:Ed});const{name:l,inputs:u}=c,d=u?.some((e=>!("name"in e&&e.name)));let h=d?[]:{};const p=u.filter((e=>"indexed"in e&&e.indexed));for(let e=0;e!("indexed"in e&&e.indexed)));if(f.length>0)if(n&&"0x"!==n)try{const e=vl(f,n);if(e)if(d)h=[...h,...e];else for(let t=0;t0?h:void 0}}function Cd({param:e,value:t}){if("string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))return t;return(vl([e],t)||[])[0]}function Pd({abi:e,eventName:t,logs:n,strict:r=!0}){return n.map((n=>{try{const s=Ad({...n,abi:e,strict:r});return t&&!t.includes(s.eventName)?null:{...s,...n}}catch(e){let t,s;if(e instanceof io)return null;if(e instanceof ho||e instanceof po){if(r)return null;t=e.abiItem.name,s=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return{...n,args:s?[]:{},eventName:t}}})).filter(Boolean)}function _d(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}async function Sd(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:i,events:a,args:o,strict:c}={}){const l=c??!1,u=a??(i?[i]:void 0);let d,h=[];u&&(h=[u.flatMap((e=>Xc({abi:[e],eventName:e.name,args:o})))],i&&(h=h[0])),d=n?await e.request({method:"eth_getLogs",params:[{address:t,topics:h,blockHash:n}]}):await e.request({method:"eth_getLogs",params:[{address:t,topics:h,fromBlock:"bigint"==typeof r?Fo(r):r,toBlock:"bigint"==typeof s?Fo(s):s}]});const p=d.map((e=>_d(e)));return u?Pd({abi:u,logs:p,strict:l}):p}async function Id(e,t){const{abi:n,address:r,args:s,blockHash:i,eventName:a,fromBlock:o,toBlock:c,strict:l}=t,u=a?Qc({abi:n,name:a}):void 0,d=u?void 0:n.filter((e=>"event"===e.type));return Ga(e,Sd,"getLogs")({address:r,args:s,blockHash:i,event:u,events:d,fromBlock:o,toBlock:c,strict:l})}const Bd="/docs/contract/decodeFunctionResult";function Td(e){const{abi:t,args:n,functionName:r,data:s}=e;let i=t[0];if(r){const e=Qc({abi:t,args:n,name:r});if(!e)throw new oo(r,{docsPath:Bd});i=e}if("function"!==i.type)throw new oo(void 0,{docsPath:Bd});if(!i.outputs)throw new co(i.name,{docsPath:Bd});const a=vl(i.outputs,s);return a&&a.length>1?a:a&&1===a.length?a[0]:void 0}const Md=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],Od=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],Nd=[...Od,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Rd=[...Od,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],Fd=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],jd=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],Ld=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],Ud="0x82ad56cb";let Dd=class extends Za{constructor({blockNumber:e,chain:t,contract:n}){super(`Chain "${t.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}},zd=class extends Za{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}};function Hd({blockNumber:e,chain:t,contract:n}){const r=t?.contracts?.[n];if(!r)throw new Dd({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new Dd({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const Gd=new Map;function qd({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const i=async()=>{const t=o();a();const n=t.map((({args:e})=>e));0!==n.length&&e(n).then((e=>{s&&Array.isArray(e)&&e.sort(s);for(let n=0;n{for(let n=0;nGd.delete(t),o=()=>Gd.get(t)||[],c=e=>Gd.set(t,[...o(),e]);return{flush:a,async schedule(e){const t={},s=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),a=n?.([...o().map((({args:e})=>e)),e]);a&&i();return o().length>0?(c({args:e,pendingPromise:t}),s):(c({args:e,pendingPromise:t}),setTimeout(i,r),s)}}}async function $d(e,t){const{account:n=e.account,batch:r=Boolean(e.batch?.multicall),blockNumber:s,blockTag:i="latest",accessList:a,blobs:o,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:f,to:m,value:b,stateOverride:g,...y}=t,v=n?rl(n):void 0;try{Lu(t);const n=(s?Fo(s):void 0)||i,w=ju(g),x=e.chain?.formatters?.transactionRequest?.format,k=(x||Nu)({...Mu(y,{format:x}),from:v?.address,accessList:a,blobs:o,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:f,to:m,value:b});if(r&&function({request:e}){const{data:t,to:n,...r}=e;return!!t&&(!t.startsWith(Ud)&&(!!n&&!(Object.values(r).filter((e=>void 0!==e)).length>0)))}({request:k})&&!w)try{return await async function(e,t){const{batchSize:n=1024,wait:r=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockNumber:s,blockTag:i="latest",data:a,multicallAddress:o,to:c}=t;let l=o;if(!l){if(!e.chain)throw new zd;l=Hd({blockNumber:s,chain:e.chain,contract:"multicall3"})}const u=s?Fo(s):void 0,d=u||i,{schedule:h}=qd({id:`${e.uid}.${d}`,wait:r,shouldSplitBatch(e){const t=e.reduce(((e,{data:t})=>e+(t.length-2)),0);return t>2*n},fn:async t=>{const n=t.map((e=>({allowFailure:!0,callData:e.data,target:e.to}))),r=al({abi:Md,args:[n],functionName:"aggregate3"}),s=await e.request({method:"eth_call",params:[{data:r,to:l},d]});return Td({abi:Md,args:[n],functionName:"aggregate3",data:s||"0x"})}}),[{returnData:p,success:f}]=await h({data:a,to:c});if(!f)throw new $l({data:p});return"0x"===p?{data:void 0}:{data:p}}(e,{...k,blockNumber:s,blockTag:i})}catch(e){if(!(e instanceof zd||e instanceof Dd))throw e}const E=await e.request({method:"eth_call",params:w?[k,n,w]:[k,n]});return"0x"===E?{data:void 0}:{data:E}}catch(n){const r=function(e){if(!(e instanceof Za))return;const t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(n),{offchainLookup:s,offchainLookupSignature:i}=await Promise.resolve().then((function(){return Qh}));if(!1!==e.ccipRead&&r?.slice(0,10)===i&&m)return{data:await s(e,{data:r,to:m})};throw function(e,{docsPath:t,...n}){const r=(()=>{const t=Tu(e,n);return t instanceof Bu?e:t})();return new zl(r,{docsPath:t,...n})}(n,{...t,account:v,chain:e.chain})}}async function Vd(e,t){const{abi:n,address:r,args:s,functionName:i,...a}=t,o=al({abi:n,args:s,functionName:i});try{const{data:t}=await Ga(e,$d,"call")({...a,data:o,to:r});return Td({abi:n,args:s,functionName:i,data:t||"0x"})}catch(e){throw gu(e,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:i})}}const Wd=new Map,Zd=new Map;let Qd=0;function Kd(e,t,n){const r=++Qd,s=()=>Wd.get(e)||[],i=()=>{const t=Zd.get(e);1===s().length&&t&&t(),(()=>{const t=s();Wd.set(e,t.filter((e=>e.id!==r)))})()},a=s();if(Wd.set(e,[...a,{id:r,fns:t}]),a&&a.length>0)return i;const o={};for(const e in t)o[e]=(...t)=>{const n=s();if(0!==n.length)for(const r of n)r.fns[e]?.(...t)};const c=n(o);return"function"==typeof c&&Zd.set(e,c),i}async function Yd(e){return new Promise((t=>setTimeout(t,e)))}function Jd(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let s=!0;const i=()=>s=!1;return(async()=>{let a;t&&(a=await e({unpoll:i}));const o=await(n?.(a))??r;await Yd(o);const c=async()=>{s&&(await e({unpoll:i}),await Yd(r),c())};c()})(),i}const Xd=new Map,eh=new Map;async function th(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=function(e){const t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:n=>t.set(e,n)}),n=t(e,Xd),r=t(e,eh);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}(t),s=r.response.get();if(s&&n>0){if((new Date).getTime()-s.created.getTime()`blockNumber.${e}`;async function rh(e,{cacheTime:t=e.cacheTime}={}){const n=await th((()=>e.request({method:"eth_blockNumber"})),{cacheKey:nh(e.uid),cacheTime:t});return BigInt(n)}async function sh(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if("string"==typeof r[0])return r;const s=r.map((e=>_d(e)));return"abi"in t&&t.abi?Pd({abi:t.abi,logs:s,strict:n}):s}async function ih(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}const ah=256;let oh,ch=ah;function lh(e=11){if(!oh||ch+e>2*ah){oh="",ch=0;for(let e=0;e{const r=n(t);for(const e in p)delete r[e];const s={...t,...r};return Object.assign(s,{extend:e(s)})}}(p)})}function dh(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise(((s,i)=>{const a=async({count:o=0}={})=>{try{const t=await e();s(t)}catch(e){if(o{const n="function"==typeof t?t({count:o,error:e}):t;n&&await Yd(n),a({count:o+1})})({error:e});i(e)}};a()}))}function hh(e,t={}){return async(n,r={})=>{const{retryDelay:s=150,retryCount:i=3}={...t,...r};return dh((async()=>{try{return await e(n)}catch(e){const t=e;switch(t.code){case Yl.code:throw new Yl(t);case Jl.code:throw new Jl(t);case Xl.code:throw new Xl(t);case eu.code:throw new eu(t);case tu.code:throw new tu(t);case nu.code:throw new nu(t);case ru.code:throw new ru(t);case su.code:throw new su(t);case iu.code:throw new iu(t);case au.code:throw new au(t);case ou.code:throw new ou(t);case cu.code:throw new cu(t);case lu.code:throw new lu(t);case uu.code:throw new uu(t);case du.code:throw new du(t);case hu.code:throw new hu(t);case pu.code:throw new pu(t);case fu.code:throw new fu(t);case 5e3:throw new lu(t);default:if(e instanceof Za)throw e;throw new mu(t)}}}),{delay:({count:e,error:t})=>{if(t&&t instanceof Vl){const e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e)}return(1<function(e){if("code"in e&&"number"==typeof e.code)return-1===e.code||(e.code===ou.code||e.code===tu.code);if(e instanceof Vl&&e.status)return 403===e.status||(408===e.status||(413===e.status||(429===e.status||(500===e.status||(502===e.status||(503===e.status||504===e.status))))));return!0}(e)})}}function ph({key:e,name:t,request:n,retryCount:r=3,retryDelay:s=150,timeout:i,type:a},o){return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:s,timeout:i,type:a},request:hh(n,{retryCount:r,retryDelay:s}),value:o}}let fh=class extends Za{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}};function mh(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise(((s,i)=>{(async()=>{let a;try{const o=new AbortController;n>0&&(a=setTimeout((()=>{r?o.abort():i(t)}),n)),s(await e({signal:o?.signal||null}))}catch(e){"AbortError"===e.name&&i(t),i(e)}finally{clearTimeout(a)}})()}))}function bh(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const gh=bh();function yh(e,t){if(!(e instanceof Za))return!1;const n=e.walk((e=>e instanceof Gl));return n instanceof Gl&&("ResolverNotFound"===n.data?.errorName||("ResolverWildcardNotSupported"===n.data?.errorName||("ResolverNotContract"===n.data?.errorName||("ResolverError"===n.data?.errorName||("HttpError"===n.data?.errorName||(!!n.reason?.includes("Wildcard on non-extended resolvers is not supported")||"reverse"===t&&n.reason===ol[50]))))))}function vh(e){if(66!==e.length)return null;if(0!==e.indexOf("["))return null;if(65!==e.indexOf("]"))return null;const t=`0x${e.slice(1,65)}`;return Va(t)?t:null}function wh(e){let t=new Uint8Array(32).fill(0);if(!e)return Ro(t);const n=e.split(".");for(let e=n.length-1;e>=0;e-=1){const r=vh(n[e]),s=r?Do(r):Ac(Vo(n[e]),"bytes");t=Ac(Fc([t,s]),"bytes")}return Ro(t)}function xh(e){return`[${e.slice(2)}]`}function kh(e){const t=new Uint8Array(32).fill(0);return e?vh(e)||Ac(Vo(e)):Ro(t)}function Eh(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const n=new Uint8Array(Vo(t).byteLength+2);let r=0;const s=t.split(".");for(let e=0;e255&&(t=Vo(xh(kh(s[e])))),n[r]=t.length,n.set(t,r+1),r+=t.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}let Ah=class extends Za{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}},Ch=class extends Za{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}},Ph=class extends Za{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}},_h=class extends Za{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}};const Sh=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,Ih=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,Bh=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Th=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function Mh(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Oh({uri:e,gatewayUrls:t}){const n=Bh.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=Mh(t?.ipfs,"https://ipfs.io"),s=Mh(t?.arweave,"https://arweave.net"),i=e.match(Sh),{protocol:a,subpath:o,target:c,subtarget:l=""}=i?.groups||{},u="ipns:/"===a||"ipns/"===o,d="ipfs:/"===a||"ipfs/"===o||Ih.test(e);if(e.startsWith("http")&&!u&&!d){let n=e;return t?.arweave&&(n=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:n,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${r}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===a&&c)return{uri:`${s}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let h=e.replace(Th,"");if(h.startsWith("{const n=new Image;n.onload=()=>{t(!0)},n.onerror=()=>{t(!1)},n.src=e}))}}(n);if(s)return n;throw new Ph({uri:t})}async function Fh(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?async function(e,{gatewayUrls:t,record:n}){const r=function(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[i,a]=n.split(":"),[o,c]=r.split(":");if(!i||"eip155"!==i.toLowerCase())throw new Ch({reason:"Only EIP-155 supported"});if(!a)throw new Ch({reason:"Chain ID not found"});if(!c)throw new Ch({reason:"Contract address not found"});if(!s)throw new Ch({reason:"Token ID not found"});if(!o)throw new Ch({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a),namespace:o.toLowerCase(),contractAddress:c,tokenID:s}}(n),s=await async function(e,{nft:t}){if("erc721"===t.namespace)return Vd(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return Vd(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new _h({namespace:t.namespace})}(e,{nft:r}),{uri:i,isOnChain:a,isEncoded:o}=Oh({uri:s,gatewayUrls:t});if(a&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){const e=o?atob(i.replace("data:application/json;base64,","")):i;return Rh({uri:Nh(JSON.parse(e)),gatewayUrls:t})}let c=r.tokenID;"erc1155"===r.namespace&&(c=c.replace("0x","").padStart(64,"0"));return async function({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then((e=>e.json()));return await Rh({gatewayUrls:e,uri:Nh(n)})}catch{throw new Ph({uri:t})}}({gatewayUrls:t,uri:i.replace(/(?:0x)?{id}/,c)})}(e,{gatewayUrls:t,record:n}):Rh({uri:n,gatewayUrls:t})}async function jh(e,{blockNumber:t,blockTag:n,name:r,key:s,gatewayUrls:i,strict:a,universalResolverAddress:o}){let c=o;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=Hd({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const a={address:c,abi:Nd,functionName:"resolve",args:[Oo(Eh(r)),al({abi:Fd,functionName:"text",args:[wh(r),s]})],blockNumber:t,blockTag:n},o=Ga(e,Vd,"readContract"),l=i?await o({...a,args:[...a.args,i]}):await o(a);if("0x"===l[0])return null;const u=Td({abi:Fd,functionName:"text",data:l[0]});return""===u?null:u}catch(e){if(a)throw e;if(yh(e,"resolve"))return null;throw e}}async function Lh(e,{address:t,args:n,event:r,events:s,fromBlock:i,strict:a,toBlock:o}={}){const c=s??(r?[r]:void 0),l=tl(e,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap((e=>Xc({abi:[e],eventName:e.name,args:n})))],r&&(u=u[0]));const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof i?Fo(i):i,toBlock:"bigint"==typeof o?Fo(o):o,...u.length?{topics:u}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:i,id:d,request:l(d),strict:Boolean(a),toBlock:o,type:"event"}}async function Uh(e){const t=tl(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function Dh(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const i=n?Fo(n):void 0;return function(e){return{baseFeePerGas:e.baseFeePerGas.map((e=>BigInt(e))),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:e.reward?.map((e=>e.map((e=>BigInt(e)))))}}(await e.request({method:"eth_feeHistory",params:[Fo(t),i||r,s]}))}let zh=class extends Za{constructor({callbackSelector:e,cause:t,data:n,extraData:r,sender:s,urls:i}){super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],t.metaMessages?.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map((e=>` ${e}`))],` Sender: ${s}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${r}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}},Hh=class extends Za{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${t}`,`Response: ${Cl(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}},Gh=class extends Za{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}};function qh(e,t){if(!Rc(e,{strict:!1}))throw new Ic({address:e});if(!Rc(t,{strict:!1}))throw new Ic({address:t});return e.toLowerCase()===t.toLowerCase()}const $h="0x556f1830",Vh={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function Wh(e,{blockNumber:t,blockTag:n,data:r,to:s}){const{args:i}=Al({data:r,abi:[Vh]}),[a,o,c,l,u]=i,{ccipRead:d}=e,h=d&&"function"==typeof d?.request?d.request:Zh;try{if(!qh(s,a))throw new Gh({sender:a,to:s});const r=await h({data:c,sender:a,urls:o}),{data:i}=await $d(e,{blockNumber:t,blockTag:n,data:Fc([l,qc([{type:"bytes"},{type:"bytes"}],[r,u])]),to:s});return i}catch(e){throw new zh({callbackSelector:l,cause:e,data:r,extraData:u,sender:a,urls:o})}}async function Zh({data:e,sender:t,urls:n}){let r=new Error("An unknown error occurred.");for(let s=0;s`${t} ${e}`)).join(",")})`;return n}({primaryType:e,types:t}));return Ac(n)}function rp({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),s=r?.[0];if(n.has(s)||void 0===t[s])return n;n.add(s);for(const e of t[s])rp({primaryType:e.type,types:t},n);return n}function sp({types:e,name:t,type:n,value:r}){if(void 0!==e[n])return[{type:"bytes32"},Ac(tp({data:r,primaryType:n,types:e}))];if("bytes"===n){return[{type:"bytes32"},Ac(r=`0x${(r.length%2?"0":"")+r.slice(2)}`)]}if("string"===n)return[{type:"bytes32"},Ac(Oo(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),i=r.map((n=>sp({name:t,type:s,types:e,value:n})));return[{type:"bytes32"},Ac(qc(i.map((([e])=>e)),i.map((([,e])=>e))))]}return[{type:n},r]}function ip(e){const{domain:t,message:n,primaryType:r,types:s}=e,i=(e,t)=>{for(const n of e){const{name:e,type:r}=n,a=t[e],o=r.match(Yh);if(o&&("number"==typeof a||"bigint"==typeof a)){const[e,t,n]=o;Fo(a,{signed:"int"===t,size:Number.parseInt(n)/8})}if("address"===r&&"string"==typeof a&&!Rc(a))throw new Ic({address:a});const c=r.match(Kh);if(c){const[e,t]=c;if(t&&Wa(a)!==Number.parseInt(t))throw new uo({expectedSize:Number.parseInt(t),givenSize:Wa(a)})}const l=s[r];l&&i(l,a)}};if(s.EIP712Domain&&t&&i(s.EIP712Domain,t),"EIP712Domain"!==r){const e=s[r];i(e,n)}}function ap({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},"number"==typeof e?.chainId&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}const op="/docs/contract/encodeDeployData";function cp(e){const{abi:t,args:n,bytecode:r}=e;if(!n||0===n.length)return r;const s=t.find((e=>"type"in e&&"constructor"===e.type));if(!s)throw new Ka({docsPath:op});if(!("inputs"in s))throw new Ya({docsPath:op});if(!s.inputs||0===s.inputs.length)throw new Ya({docsPath:op});return Lc([r,qc(s.inputs,n)])}const lp={"0x0":"reverted","0x1":"success"};function up(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map((e=>_d(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?To(e.transactionIndex):null,status:e.status?lp[e.status]:null,type:e.type?Gu[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const dp="Ethereum Signed Message:\n";function hp(e,t){const n="string"==typeof e?Vo(e):e.raw instanceof Uint8Array?e.raw:Do(e.raw);return Ac(Fc([Vo(`${dp}${n.length}`),n]),t)}async function pp(e,{address:t,blockNumber:n,blockTag:r,storageKeys:s}){const i=r??"latest",a=void 0!==n?Fo(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?To(e.nonce):void 0,storageProof:e.storageProof?(t=e.storageProof,t.map((e=>({...e,value:BigInt(e.value)})))):void 0};var t}(await e.request({method:"eth_getProof",params:[t,s,a||i]}))}async function fp(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:i}){const a=r||"latest",o=void 0!==n?Fo(n):void 0;let c=null;if(s?c=await e.request({method:"eth_getTransactionByHash",params:[s]}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,Fo(i)]}):(o||a)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||a,Fo(i)]})),!c)throw new Ll({blockHash:t,blockNumber:n,blockTag:a,hash:s,index:i});return(e.chain?.formatters?.transaction?.format||qu)(c)}async function mp(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(!n)throw new Ul({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||up)(n)}const bp="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",gp=BigInt(0),yp=BigInt(1),vp=BigInt(2),wp=e=>e instanceof Uint8Array,xp=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0"))); /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function kp(e){if(!wp(e))throw new Error("Uint8Array expected");let t="";for(let n=0;ne+t.length),0));let n=0;return e.forEach((e=>{if(!wp(e))throw new Error("Uint8Array expected");t.set(e,n),n+=e.length})),t}function Mp(e,t){if(e.length!==t.length)return!1;for(let n=0;n(vp<new Uint8Array(e),Rp=e=>Uint8Array.from(e);function Fp(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=Np(e),s=Np(e),i=0;const a=()=>{r.fill(1),s.fill(0),i=0},o=(...e)=>n(s,r,...e),c=(e=Np())=>{s=o(Rp([0]),e),r=o(),0!==e.length&&(s=o(Rp([1]),e),r=o())},l=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e{let n;for(a(),c(e);!(n=t(l()));)c();return a(),n}}const jp={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function Lp(e,t,n={}){const r=(t,n,r)=>{const s=jp[n];if("function"!=typeof s)throw new Error(`Invalid validator "${n}", expected function`);const i=e[t];if(!(r&&void 0===i||s(i,e)))throw new Error(`Invalid param ${String(t)}=${i} (${typeof i}), expected ${n}`)};for(const[e,n]of Object.entries(t))r(e,n,!1);for(const[e,t]of Object.entries(n))r(e,t,!0);return e}var Up=Object.freeze({__proto__:null,bitGet:function(e,t){return e>>BigInt(t)&yp},bitLen:function(e){let t;for(t=0;e>gp;e>>=yp,t+=1);return t},bitMask:Op,bitSet:(e,t,n)=>e|(n?yp:gp)<=Dp?n:t+n}function Zp(e,t,n){if(n<=Dp||t 0");if(n===zp)return Dp;let r=zp;for(;t>Dp;)t&zp&&(r=r*e%n),e=e*e%n,t>>=zp;return r}function Qp(e,t,n){let r=e;for(;t-- >Dp;)r*=r,r%=n;return r}function Kp(e,t){if(e===Dp||t<=Dp)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Wp(e,t),r=t,s=Dp,i=zp;for(;n!==Dp;){const e=r%n,t=s-i*(r/n);r=n,n=e,s=i,i=t}if(r!==zp)throw new Error("invert: does not exist");return Wp(s,t)}function Yp(e){if(e%qp===Gp){const t=(e+zp)/qp;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%Vp===$p){const t=(e-$p)/Vp;return function(e,n){const r=e.mul(n,Hp),s=e.pow(r,t),i=e.mul(n,s),a=e.mul(e.mul(i,Hp),s),o=e.mul(i,e.sub(a,e.ONE));if(!e.eql(e.sqr(o),n))throw new Error("Cannot find square root");return o}}return function(e){const t=(e-zp)/Hp;let n,r,s;for(n=e-zp,r=0;n%Hp===Dp;n/=Hp,r++);for(s=Hp;s(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});Lp(e,t)}(e.Fp),Lp(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Xp(e.n,e.nBitLength),...e,p:e.Fp.ORDER})} /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const{bytesToNumberBE:af,hexToBytes:of}=Up,cf={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=cf;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(128&r[0])throw new t("Invalid signature integer: negative");if(0===r[0]&&!(128&r[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:af(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=cf,n="string"==typeof e?of(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||48!=n[0])throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:i}=cf._parseInt(n.subarray(2)),{d:a,l:o}=cf._parseInt(i);if(o.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,n=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},r=t(n(e.s)),s=t(n(e.r)),i=r.length/2,a=s.length/2,o=n(i),c=n(a);return`30${n(a+i+4)}02${c}${s}02${o}${r}`}},lf=BigInt(0),uf=BigInt(1);BigInt(2);const df=BigInt(3);function hf(e){const t=function(e){const t=sf(e);Lp(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:n}=t,r=t.toBytes||((e,t,r)=>{const s=t.toAffine();return Tp(Uint8Array.from([4]),n.toBytes(s.x),n.toBytes(s.y))}),s=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function i(e){const{a:r,b:s}=t,i=n.sqr(e),a=n.mul(i,e);return n.add(n.add(a,n.mul(e,r)),s)}if(!n.eql(n.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function a(e){return"bigint"==typeof e&&lfn.eql(e,n.ZERO);return s(t)&&s(r)?d.ZERO:new d(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(d.fromAffine)}static fromHex(e){const t=d.fromAffine(s(Bp("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(c(e))}_setWindowSize(e){this._WINDOW_SIZE=e,l.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:r}=this.toAffine();if(!n.isValid(e)||!n.isValid(r))throw new Error("bad point: x or y not FE");const s=n.sqr(r),a=i(e);if(!n.eql(s,a))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){u(e);const{px:t,py:r,pz:s}=this,{px:i,py:a,pz:o}=e,c=n.eql(n.mul(t,o),n.mul(i,s)),l=n.eql(n.mul(r,o),n.mul(a,s));return c&&l}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){const{a:e,b:r}=t,s=n.mul(r,df),{px:i,py:a,pz:o}=this;let c=n.ZERO,l=n.ZERO,u=n.ZERO,h=n.mul(i,i),p=n.mul(a,a),f=n.mul(o,o),m=n.mul(i,a);return m=n.add(m,m),u=n.mul(i,o),u=n.add(u,u),c=n.mul(e,u),l=n.mul(s,f),l=n.add(c,l),c=n.sub(p,l),l=n.add(p,l),l=n.mul(c,l),c=n.mul(m,c),u=n.mul(s,u),f=n.mul(e,f),m=n.sub(h,f),m=n.mul(e,m),m=n.add(m,u),u=n.add(h,h),h=n.add(u,h),h=n.add(h,f),h=n.mul(h,m),l=n.add(l,h),f=n.mul(a,o),f=n.add(f,f),h=n.mul(f,m),c=n.sub(c,h),u=n.mul(f,p),u=n.add(u,u),u=n.add(u,u),new d(c,l,u)}add(e){u(e);const{px:r,py:s,pz:i}=this,{px:a,py:o,pz:c}=e;let l=n.ZERO,h=n.ZERO,p=n.ZERO;const f=t.a,m=n.mul(t.b,df);let b=n.mul(r,a),g=n.mul(s,o),y=n.mul(i,c),v=n.add(r,s),w=n.add(a,o);v=n.mul(v,w),w=n.add(b,g),v=n.sub(v,w),w=n.add(r,i);let x=n.add(a,c);return w=n.mul(w,x),x=n.add(b,y),w=n.sub(w,x),x=n.add(s,i),l=n.add(o,c),x=n.mul(x,l),l=n.add(g,y),x=n.sub(x,l),p=n.mul(f,w),l=n.mul(m,y),p=n.add(l,p),l=n.sub(g,p),p=n.add(g,p),h=n.mul(l,p),g=n.add(b,b),g=n.add(g,b),y=n.mul(f,y),w=n.mul(m,w),g=n.add(g,y),y=n.sub(b,y),y=n.mul(f,y),w=n.add(w,y),b=n.mul(g,w),h=n.add(h,b),b=n.mul(x,w),l=n.mul(v,l),l=n.sub(l,b),b=n.mul(v,g),p=n.mul(x,p),p=n.add(p,b),new d(l,h,p)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return p.wNAFCached(this,l,e,(e=>{const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(d.fromAffine)}))}multiplyUnsafe(e){const r=d.ZERO;if(e===lf)return r;if(o(e),e===uf)return this;const{endo:s}=t;if(!s)return p.unsafeLadder(this,e);let{k1neg:i,k1:a,k2neg:c,k2:l}=s.splitScalar(e),u=r,h=r,f=this;for(;a>lf||l>lf;)a&uf&&(u=u.add(f)),l&uf&&(h=h.add(f)),f=f.double(),a>>=uf,l>>=uf;return i&&(u=u.negate()),c&&(h=h.negate()),h=new d(n.mul(h.px,s.beta),h.py,h.pz),u.add(h)}multiply(e){o(e);let r,s,i=e;const{endo:a}=t;if(a){const{k1neg:e,k1:t,k2neg:o,k2:c}=a.splitScalar(i);let{p:l,f:u}=this.wNAF(t),{p:h,f:f}=this.wNAF(c);l=p.constTimeNegate(e,l),h=p.constTimeNegate(o,h),h=new d(n.mul(h.px,a.beta),h.py,h.pz),r=l.add(h),s=u.add(f)}else{const{p:e,f:t}=this.wNAF(i);r=e,s=t}return d.normalizeZ([r,s])[0]}multiplyAndAddUnsafe(e,t,n){const r=d.BASE,s=(e,t)=>t!==lf&&t!==uf&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),i=s(this,t).add(s(e,n));return i.is0()?void 0:i}toAffine(e){const{px:t,py:r,pz:s}=this,i=this.is0();null==e&&(e=i?n.ONE:n.inv(s));const a=n.mul(t,e),o=n.mul(r,e),c=n.mul(s,e);if(i)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw new Error("invZ was invalid");return{x:a,y:o}}isTorsionFree(){const{h:e,isTorsionFree:n}=t;if(e===uf)return!0;if(n)return n(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:n}=t;return e===uf?this:n?n(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),r(d,this,e)}toHex(e=!0){return kp(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);const h=t.nBitLength,p=function(e,t){const n=(e,t)=>{const n=t.negate();return e?n:t},r=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,s=t;for(;n>nf;)n&rf&&(r=r.add(s)),s=s.double(),n>>=rf;return r},precomputeWindow(e,t){const{windows:n,windowSize:s}=r(t),i=[];let a=e,o=a;for(let e=0;e>=h,r>o&&(r-=d,i+=rf);const a=t,p=t+Math.abs(r)-1,f=e%2!=0,m=r<0;0===r?l=l.add(n(f,s[a])):c=c.add(n(m,s[p]))}return{p:c,f:l}},wNAFCached(e,t,n,r){const s=e._WINDOW_SIZE||1;let i=t.get(e);return i||(i=this.precomputeWindow(e,s),1!==s&&t.set(e,r(i))),this.wNAF(s,i,n)}}}(d,t.endo?Math.ceil(h/2):h);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:i,isWithinCurveOrder:a}}function pf(e){const t=function(e){const t=sf(e);return Lp(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:n,n:r}=t,s=n.BYTES+1,i=2*n.BYTES+1;function a(e){return Wp(e,r)}function o(e){return Kp(e,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:l,weierstrassEquation:u,isWithinCurveOrder:d}=hf({...t,toBytes(e,t,r){const s=t.toAffine(),i=n.toBytes(s.x),a=Tp;return r?a(Uint8Array.from([t.hasEvenY()?2:3]),i):a(Uint8Array.from([4]),i,n.toBytes(s.y))},fromBytes(e){const t=e.length,r=e[0],a=e.subarray(1);if(t!==s||2!==r&&3!==r){if(t===i&&4===r){return{x:n.fromBytes(a.subarray(0,n.BYTES)),y:n.fromBytes(a.subarray(n.BYTES,2*n.BYTES))}}throw new Error(`Point of length ${t} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}{const e=Pp(a);if(!(lf<(o=e)&&okp(Sp(e,t.nByteLength));function p(e){return e>r>>uf}const f=(e,t,n)=>Pp(e.slice(t,n));class m{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){const n=t.nByteLength;return e=Bp("compactSignature",e,2*n),new m(f(e,0,n),f(e,n,2*n))}static fromDER(e){const{r:t,s:n}=cf.toSig(Bp("DER",e));return new m(t,n)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new m(this.r,this.s,e)}recoverPublicKey(e){const{r:r,s:s,recovery:i}=this,l=v(Bp("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const u=2===i||3===i?r+t.n:r;if(u>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=1&i?"03":"02",p=c.fromHex(d+h(u)),f=o(u),m=a(-l*f),b=a(s*f),g=c.BASE.multiplyAndAddUnsafe(p,m,b);if(!g)throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Cp(this.toDERHex())}toDERHex(){return cf.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Cp(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const b={isValidPrivateKey(e){try{return l(e),!0}catch(e){return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const e=tf(t.n);return function(e,t,n=!1){const r=e.length,s=ef(t),i=tf(t);if(r<16||r1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);const a=Wp(n?Pp(e):_p(e),t-zp)+zp;return n?Ip(a,s):Sp(a,s)}(t.randomBytes(e),t.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function g(e){const t=e instanceof Uint8Array,n="string"==typeof e,r=(t||n)&&e.length;return t?r===s||r===i:n?r===2*s||r===2*i:e instanceof c}const y=t.bits2int||function(e){const n=Pp(e),r=8*e.length-t.nBitLength;return r>0?n>>BigInt(r):n},v=t.bits2int_modN||function(e){return a(y(e))},w=Op(t.nBitLength);function x(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(lf<=e&&ee in s)))throw new Error("sign() legacy options not supported");const{hash:i,randomBytes:u}=t;let{lowS:h,prehash:f,extraEntropy:b}=s;null==h&&(h=!0),e=Bp("msgHash",e),f&&(e=Bp("prehashed msgHash",i(e)));const g=v(e),w=l(r),k=[x(w),x(g)];if(null!=b){const e=!0===b?u(n.BYTES):b;k.push(Bp("extraEntropy",e))}const A=Tp(...k),C=g;return{seed:A,k2sig:function(e){const t=y(e);if(!d(t))return;const n=o(t),r=c.BASE.multiply(t).toAffine(),s=a(r.x);if(s===lf)return;const i=a(n*a(C+s*w));if(i===lf)return;let l=(r.x===s?0:2)|Number(r.y&uf),u=i;return h&&p(i)&&(u=function(e){return p(e)?a(-e):e}(i),l^=1),new m(s,u,l)}}}const E={lowS:t.lowS,prehash:!1},A={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,n=!0){if(g(e))throw new Error("first arg must be private key");if(!g(t))throw new Error("second arg must be public key");return c.fromHex(t).multiply(l(e)).toRawBytes(n)},sign:function(e,n,r=E){const{seed:s,k2sig:i}=k(e,n,r),a=t;return Fp(a.hash.outputLen,a.nByteLength,a.hmac)(s,i)},verify:function(e,n,r,s=A){const i=e;if(n=Bp("msgHash",n),r=Bp("publicKey",r),"strict"in s)throw new Error("options.strict was renamed to lowS");const{lowS:l,prehash:u}=s;let d,h;try{if("string"==typeof i||i instanceof Uint8Array)try{d=m.fromDER(i)}catch(e){if(!(e instanceof cf.Err))throw e;d=m.fromCompact(i)}else{if("object"!=typeof i||"bigint"!=typeof i.r||"bigint"!=typeof i.s)throw new Error("PARSE");{const{r:e,s:t}=i;d=new m(e,t)}}h=c.fromHex(r)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(l&&d.hasHighS())return!1;u&&(n=t.hash(n));const{r:p,s:f}=d,b=v(n),g=o(f),y=a(b*g),w=a(p*g),x=c.BASE.multiplyAndAddUnsafe(h,y,w)?.toAffine();return!!x&&a(x.x)===p},ProjectivePoint:c,Signature:m,utils:b}}BigInt(4);let ff=class extends ac{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Wo(e.outputLen),Wo(e.blockLen)}(e);const n=ic(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,s=new Uint8Array(r);s.set(n.length>r?e.create().update(n).digest():n);for(let e=0;enew ff(e,t).update(n).digest(); /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ function bf(e){return{hash:e,hmac:(t,...n)=>mf(e,t,function(...e){const t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0));let n=0;return e.forEach((e=>{if(!nc(e))throw new Error("Uint8Array expected");t.set(e,n),n+=e.length})),t}(...n)),randomBytes:cc}}mf.create=(e,t)=>new ff(e,t); /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ const gf=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),yf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),vf=BigInt(1),wf=BigInt(2),xf=(e,t)=>(e+t/wf)/t;const kf=function(e,t,n=!1,r={}){if(e<=Dp)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:i}=Xp(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=Yp(e),o=Object.freeze({ORDER:e,BITS:s,BYTES:i,MASK:Op(s),ZERO:Dp,ONE:zp,create:t=>Wp(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return Dp<=t&&te===Dp,isOdd:e=>(e&zp)===zp,neg:t=>Wp(-t,e),eql:(e,t)=>e===t,sqr:t=>Wp(t*t,e),add:(t,n)=>Wp(t+n,e),sub:(t,n)=>Wp(t-n,e),mul:(t,n)=>Wp(t*n,e),pow:(e,t)=>function(e,t,n){if(n 0");if(n===Dp)return e.ONE;if(n===zp)return t;let r=e.ONE,s=t;for(;n>Dp;)n&zp&&(r=e.mul(r,s)),s=e.sqr(s),n>>=zp;return r}(o,e,t),div:(t,n)=>Wp(t*Kp(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Kp(t,e),sqrt:r.sqrt||(e=>a(o,e)),invertBatch:e=>function(e,t){const n=new Array(t.length),r=t.reduce(((t,r,s)=>e.is0(r)?t:(n[s]=t,e.mul(t,r))),e.ONE),s=e.inv(r);return t.reduceRight(((t,r,s)=>e.is0(r)?t:(n[s]=e.mul(t,n[s]),e.mul(t,r))),s),n}(o,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?Ip(e,i):Sp(e,i),fromBytes:e=>{if(e.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${e.length}`);return n?_p(e):Pp(e)}});return Object.freeze(o)}(gf,void 0,void 0,{sqrt:function(e){const t=gf,n=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),a=BigInt(23),o=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=Qp(u,n,t)*u%t,h=Qp(d,n,t)*u%t,p=Qp(h,wf,t)*l%t,f=Qp(p,s,t)*p%t,m=Qp(f,i,t)*f%t,b=Qp(m,o,t)*m%t,g=Qp(b,c,t)*b%t,y=Qp(g,o,t)*m%t,v=Qp(y,n,t)*u%t,w=Qp(v,a,t)*f%t,x=Qp(w,r,t)*l%t,k=Qp(x,wf,t);if(!kf.eql(kf.sqr(k),e))throw new Error("Cannot find square root");return k}}),Ef=function(e,t){const n=t=>pf({...e,...bf(t)});return Object.freeze({...n(t),create:n})}({a:BigInt(0),b:BigInt(7),Fp:kf,n:yf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=yf,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-vf*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,a=BigInt("0x100000000000000000000000000000000"),o=xf(i*e,t),c=xf(-r*e,t);let l=Wp(e-o*n-c*s,t),u=Wp(-o*r-c*i,t);const d=l>a,h=u>a;if(d&&(l=t-l),h&&(u=t-u),l>a||u>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:h,k2:u}}}},ad);function Af({r:e,s:t,v:n,yParity:r}){const s=(()=>{if(0===r||1===r)return r;if(n&&(27n===n||28n===n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})();return`0x${new Ef.Signature(Bo(e),Bo(t)).toCompactHex()}${0===s?"1b":"1c"}`}async function Cf(e,{address:t,hash:n,signature:r,...s}){const i=Va(r)?r:"object"==typeof r&&"r"in r&&"s"in r?Af(r):Ro(r);try{const{data:r}=await Ga(e,$d,"call")({data:cp({abi:Ld,args:[t,n,i],bytecode:bp}),...s});return o="0x1",Mp(Va(a=r??"0x0")?Do(a):a,Va(o)?Do(o):o)}catch(e){if(e instanceof zl)return!1;throw e}var a,o}function Pf(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:s,poll:i,pollingInterval:a=e.pollingInterval}){let o;return(void 0!==i?i:"webSocket"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type))?Kd(Cl(["watchBlockNumber",e.uid,t,n,a]),{onBlockNumber:r,onError:s},(r=>Jd((async()=>{try{const t=await Ga(e,rh,"getBlockNumber")({cacheTime:0});if(o){if(t===o)return;if(t-o>1&&n)for(let e=o+1n;eo)&&(r.onBlockNumber(t,o),o=t)}catch(e){r.onError?.(e)}}),{emitOnBegin:t,interval:a}))):Kd(Cl(["watchBlockNumber",e.uid,t,n]),{onBlockNumber:r,onError:s},(t=>{let n=!0,r=()=>n=!1;return(async()=>{try{const s=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find((e=>"webSocket"===e.config.type));return t?t.value:e.transport}return e.transport})(),{unsubscribe:i}=await s.subscribe({params:["newHeads"],onData(e){if(!n)return;const r=Bo(e.result?.number);t.onBlockNumber(r,o),o=r},onError(e){t.onError?.(e)}});r=i,n||r()}catch(e){s?.(e)}})(),()=>r()}))}BigInt(0),Ef.ProjectivePoint;const _f=/^(?:(?[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?[a-zA-Z0-9+-.]*) (?:wants you to sign in with your Ethereum account:\n)(?
0x[a-fA-F0-9]{40})\n\n(?:(?.*)\n\n)?/,Sf=/(?:URI: (?.+))\n(?:Version: (?.+))\n(?:Chain ID: (?\d+))\n(?:Nonce: (?[a-zA-Z0-9]+))\n(?:Issued At: (?.+))(?:\nExpiration Time: (?.+))?(?:\nNot Before: (?.+))?(?:\nRequest ID: (?.+))?/;async function If(e,t){const{address:n,domain:r,message:s,nonce:i,scheme:a,signature:o,time:c=new Date,...l}=t,u=function(e){const{scheme:t,statement:n,...r}=e.match(_f)?.groups??{},{chainId:s,expirationTime:i,issuedAt:a,notBefore:o,requestId:c,...l}=e.match(Sf)?.groups??{},u=e.split("Resources:")[1]?.split("\n- ").slice(1);return{...r,...l,...s?{chainId:Number(s)}:{},...i?{expirationTime:new Date(i)}:{},...a?{issuedAt:new Date(a)}:{},...o?{notBefore:new Date(o)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}(s);if(!u.address)return!1;const d=function(e){const{address:t,domain:n,message:r,nonce:s,scheme:i,time:a=new Date}=e;if(n&&r.domain!==n)return!1;if(s&&r.nonce!==s)return!1;if(i&&r.scheme!==i)return!1;if(r.expirationTime&&a>=r.expirationTime)return!1;if(r.notBefore&&a$d(e,t),createBlockFilter:()=>async function(e){const t=tl(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>nl(e,t),createEventFilter:t=>Lh(e,t),createPendingTransactionFilter:()=>Uh(e),estimateContractGas:t=>async function(e,t){const{abi:n,address:r,args:s,functionName:i,...a}=t,o=al({abi:n,args:s,functionName:i});try{return await Ga(e,kd,"estimateGas")({data:o,to:r,...a})}catch(e){const t=a.account?rl(a.account):void 0;throw gu(e,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:i,sender:t?.address})}}(e,t),estimateGas:t=>kd(e,t),getBalance:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n?Fo(n):void 0,i=await e.request({method:"eth_getBalance",params:[t,s||r]});return BigInt(i)}(e,t),getBlobBaseFee:()=>async function(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}(e),getBlock:t=>Vu(e,t),getBlockNumber:t=>rh(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=void 0!==n?Fo(n):void 0;let i;return i=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]}),To(i)}(e,t),getBytecode:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=void 0!==n?Fo(n):void 0,i=await e.request({method:"eth_getCode",params:[t,s||r]});if("0x"!==i)return i}(e,t),getChainId:()=>vd(e),getContractEvents:t=>Id(e,t),getEnsAddress:t=>async function(e,{blockNumber:t,blockTag:n,coinType:r,name:s,gatewayUrls:i,strict:a,universalResolverAddress:o}){let c=o;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=Hd({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const a=al({abi:jd,functionName:"addr",...null!=r?{args:[wh(s),BigInt(r)]}:{args:[wh(s)]}}),o={address:c,abi:Nd,functionName:"resolve",args:[Oo(Eh(s)),a],blockNumber:t,blockTag:n},l=Ga(e,Vd,"readContract"),u=i?await l({...o,args:[...o.args,i]}):await l(o);if("0x"===u[0])return null;const d=Td({abi:jd,args:null!=r?[wh(s),BigInt(r)]:void 0,functionName:"addr",data:u[0]});return"0x"===d||"0x00"===So(d)?null:d}catch(e){if(a)throw e;if(yh(e,"resolve"))return null;throw e}}(e,t),getEnsAvatar:t=>async function(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:i,strict:a,universalResolverAddress:o}){const c=await Ga(e,jh,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:o,gatewayUrls:i,strict:a});if(!c)return null;try{return await Fh(e,{record:c,gatewayUrls:r})}catch{return null}}(e,t),getEnsName:t=>async function(e,{address:t,blockNumber:n,blockTag:r,gatewayUrls:s,strict:i,universalResolverAddress:a}){let o=a;if(!o){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=Hd({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const i={address:o,abi:Rd,functionName:"reverse",args:[Oo(Eh(c))],blockNumber:n,blockTag:r},a=Ga(e,Vd,"readContract"),[l,u]=s?await a({...i,args:[...i.args,s]}):await a(i);return t.toLowerCase()!==u.toLowerCase()?null:l}catch(e){if(i)throw e;if(yh(e,"reverse"))return null;throw e}}(e,t),getEnsResolver:t=>async function(e,{blockNumber:t,blockTag:n,name:r,universalResolverAddress:s}){let i=s;if(!i){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=Hd({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[a]=await Ga(e,Vd,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Oo(Eh(r))],blockNumber:t,blockTag:n});return a}(e,t),getEnsText:t=>jh(e,t),getFeeHistory:t=>Dh(e,t),estimateFeesPerGas:t=>async function(e,t){return Qu(e,t)}(e,t),getFilterChanges:e=>sh(0,e),getFilterLogs:e=>async function(e,{filter:t}){const n=t.strict??!1,r=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map((e=>_d(e)));return t.abi?Pd({abi:t.abi,logs:r,strict:n}):r}(0,e),getGasPrice:()=>Wu(e),getLogs:t=>Sd(e,t),getProof:t=>pp(e,t),estimateMaxPriorityFeePerGas:t=>async function(e,t){return Zu(e,t)}(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest",slot:s}){const i=void 0!==n?Fo(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,i||r]})}(e,t),getTransaction:t=>fp(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([Ga(e,rh,"getBlockNumber")({}),t?Ga(e,fp,"getBlockNumber")({hash:t}):void 0]),i=n?.blockNumber||s?.blockNumber;return i?r-i+1n:0n}(e,t),getTransactionCount:t=>Ku(e,t),getTransactionReceipt:t=>mp(e,t),multicall:t=>async function(e,t){const{allowFailure:n=!0,batchSize:r,blockNumber:s,blockTag:i,multicallAddress:a,stateOverride:o}=t,c=t.contracts,l=r??("object"==typeof e.batch?.multicall&&e.batch.multicall.batchSize||1024);let u=a;if(!u){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");u=Hd({blockNumber:s,chain:e.chain,contract:"multicall3"})}const d=[[]];let h=0,p=0;for(let e=0;e0&&p>l&&d[h].length>0&&(h++,p=(e.length-2)/2,d[h]=[]),d[h]=[...d[h],{allowFailure:!0,callData:e,target:r}]}catch(e){const a=gu(e,{abi:t,address:r,args:s,docsPath:"/docs/contract/multicall",functionName:i});if(!n)throw a;d[h]=[...d[h],{allowFailure:!0,callData:"0x",target:r}]}}const f=await Promise.allSettled(d.map((t=>Ga(e,Vd,"readContract")({abi:Md,address:u,args:[t],blockNumber:s,blockTag:i,functionName:"aggregate3",stateOverride:o})))),m=[];for(let e=0;exd(e,t),readContract:t=>Vd(e,t),sendRawTransaction:t=>async function(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}(e,t),simulateContract:t=>async function(e,t){const{abi:n,address:r,args:s,dataSuffix:i,functionName:a,...o}=t,c=o.account?rl(o.account):e.account,l=al({abi:n,args:s,functionName:a});try{const{data:u}=await Ga(e,$d,"call")({batch:!1,data:`${l}${i?i.replace("0x",""):""}`,to:r,...o,account:c});return{result:Td({abi:n,args:s,functionName:a,data:u||"0x"}),request:{abi:n.filter((e=>"name"in e&&e.name===t.functionName)),address:r,args:s,dataSuffix:i,functionName:a,...o,account:c}}}catch(e){throw gu(e,{abi:n,address:r,args:s,docsPath:"/docs/contract/simulateContract",functionName:a,sender:c?.address})}}(e,t),verifyMessage:t=>async function(e,{address:t,message:n,signature:r,...s}){return Cf(e,{address:t,hash:hp(n),signature:r,...s})}(e,t),verifySiweMessage:t=>If(e,t),verifyTypedData:t=>async function(e,t){const{address:n,signature:r,message:s,primaryType:i,types:a,domain:o,...c}=t;return Cf(e,{address:n,hash:Jh({message:s,primaryType:i,types:a,domain:o}),signature:r,...c})}(e,t),uninstallFilter:e=>ih(0,e),waitForTransactionReceipt:t=>async function(e,{confirmations:t=1,hash:n,onReplaced:r,pollingInterval:s=e.pollingInterval,retryCount:i=6,retryDelay:a=({count:e})=>200*(1<{o&&setTimeout((()=>m(new Dl({hash:n}))),o);const b=Kd(c,{onReplaced:r,resolve:f,reject:m},(r=>{const o=Ga(e,Pf,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:s,async onBlockNumber(s){const c=e=>{o(),e(),b()};let f=s;if(!p){h>i&&c((()=>r.reject(new Dl({hash:n}))));try{if(d){if(t>1&&(!d.blockNumber||f-d.blockNumber+1nr.resolve(d)))}if(l||(p=!0,await dh((async()=>{l=await Ga(e,fp,"getTransaction")({hash:n}),l.blockNumber&&(f=l.blockNumber)}),{delay:a,retryCount:i}),p=!1),d=await Ga(e,mp,"getTransactionReceipt")({hash:n}),t>1&&(!d.blockNumber||f-d.blockNumber+1nr.resolve(d)))}catch(n){if(n instanceof Ll||n instanceof Ul){if(!l)return void(p=!1);try{u=l,p=!0;const n=await dh((()=>Ga(e,Vu,"getBlock")({blockNumber:f,includeTransactions:!0})),{delay:a,retryCount:i,shouldRetry:({error:e})=>e instanceof Hu});p=!1;const s=n.transactions.find((({from:e,nonce:t})=>e===u.from&&t===u.nonce));if(!s)return;if(d=await Ga(e,mp,"getTransactionReceipt")({hash:s.hash}),t>1&&(!d.blockNumber||f-d.blockNumber+1n{r.onReplaced?.({reason:o,replacedTransaction:u,transaction:s,transactionReceipt:d}),r.resolve(d)}))}catch(e){c((()=>r.reject(e)))}}else c((()=>r.reject(n)))}finally{h++}}}})}))}))}(e,t),watchBlocks:t=>function(e,{blockTag:t="latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:i,includeTransactions:a,poll:o,pollingInterval:c=e.pollingInterval}){const l=void 0!==o?o:"webSocket"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type),u=a??!1;let d;return l?Kd(Cl(["watchBlocks",e.uid,t,n,r,u,c]),{onBlock:s,onError:i},(s=>Jd((async()=>{try{const r=await Ga(e,Vu,"getBlock")({blockTag:t,includeTransactions:u});if(r.number&&d?.number){if(r.number===d.number)return;if(r.number-d.number>1&&n)for(let t=d?.number+1n;td.number)&&(s.onBlock(r,d),d=r)}catch(e){s.onError?.(e)}}),{emitOnBegin:r,interval:c}))):(()=>{let t=!0,n=()=>t=!1;return(async()=>{try{const r=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find((e=>"webSocket"===e.config.type));return t?t.value:e.transport}return e.transport})(),{unsubscribe:a}=await r.subscribe({params:["newHeads"],onData(n){if(!t)return;const r=(e.chain?.formatters?.block?.format||$u)(n.result);s(r,d),d=r},onError(e){i?.(e)}});n=a,t||n()}catch(e){i?.(e)}})(),()=>n()})()}(e,t),watchBlockNumber:t=>Pf(e,t),watchContractEvent:t=>function(e,t){const{abi:n,address:r,args:s,batch:i=!0,eventName:a,fromBlock:o,onError:c,onLogs:l,poll:u,pollingInterval:d=e.pollingInterval,strict:h}=t;return(void 0!==u?u:"bigint"==typeof o||"webSocket"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type))?(()=>{const t=h??!1;return Kd(Cl(["watchContractEvent",r,s,i,e.uid,a,d,t,o]),{onLogs:l,onError:c},(c=>{let l,u;void 0!==o&&(l=o-1n);let h=!1;const p=Jd((async()=>{if(h)try{let o;if(u)o=await Ga(e,sh,"getFilterChanges")({filter:u});else{const i=await Ga(e,rh,"getBlockNumber")({});o=l&&l!==i?await Ga(e,Id,"getContractEvents")({abi:n,address:r,args:s,eventName:a,fromBlock:l+1n,toBlock:i,strict:t}):[],l=i}if(0===o.length)return;if(i)c.onLogs(o);else for(const e of o)c.onLogs([e])}catch(e){u&&e instanceof nu&&(h=!1),c.onError?.(e)}else{try{u=await Ga(e,nl,"createContractEventFilter")({abi:n,address:r,args:s,eventName:a,strict:t,fromBlock:o})}catch{}h=!0}}),{emitOnBegin:!0,interval:d});return async()=>{u&&await Ga(e,ih,"uninstallFilter")({filter:u}),p()}}))})():(()=>{const t=h??!1,o=Cl(["watchContractEvent",r,s,i,e.uid,a,d,t]);let u=!0,p=()=>u=!1;return Kd(o,{onLogs:l,onError:c},(t=>((async()=>{try{const i=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find((e=>"webSocket"===e.config.type));return t?t.value:e.transport}return e.transport})(),o=a?Xc({abi:n,eventName:a,args:s}):[],{unsubscribe:c}=await i.subscribe({params:["logs",{address:r,topics:o}],onData(e){if(!u)return;const r=e.result;try{const{eventName:e,args:s}=Ad({abi:n,data:r.data,topics:r.topics,strict:h}),i=_d(r,{args:s,eventName:e});t.onLogs([i])}catch(e){let n,s;if(e instanceof ho||e instanceof po){if(h)return;n=e.abiItem.name,s=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const i=_d(r,{args:s?[]:{},eventName:n});t.onLogs([i])}},onError(e){t.onError?.(e)}});p=c,u||p()}catch(e){c?.(e)}})(),()=>p())))})()}(e,t),watchEvent:t=>function(e,{address:t,args:n,batch:r=!0,event:s,events:i,fromBlock:a,onError:o,onLogs:c,poll:l,pollingInterval:u=e.pollingInterval,strict:d}){const h=void 0!==l?l:"bigint"==typeof a||"webSocket"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type),p=d??!1;return h?Kd(Cl(["watchEvent",t,n,r,e.uid,s,u,a]),{onLogs:c,onError:o},(o=>{let c,l;void 0!==a&&(c=a-1n);let d=!1;const h=Jd((async()=>{if(d)try{let a;if(l)a=await Ga(e,sh,"getFilterChanges")({filter:l});else{const r=await Ga(e,rh,"getBlockNumber")({});a=c&&c!==r?await Ga(e,Sd,"getLogs")({address:t,args:n,event:s,events:i,fromBlock:c+1n,toBlock:r}):[],c=r}if(0===a.length)return;if(r)o.onLogs(a);else for(const e of a)o.onLogs([e])}catch(e){l&&e instanceof nu&&(d=!1),o.onError?.(e)}else{try{l=await Ga(e,Lh,"createEventFilter")({address:t,args:n,event:s,events:i,strict:p,fromBlock:a})}catch{}d=!0}}),{emitOnBegin:!0,interval:u});return async()=>{l&&await Ga(e,ih,"uninstallFilter")({filter:l}),h()}})):(()=>{let r=!0,a=()=>r=!1;return(async()=>{try{const l=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find((e=>"webSocket"===e.config.type));return t?t.value:e.transport}return e.transport})(),u=i??(s?[s]:void 0);let h=[];u&&(h=[u.flatMap((e=>Xc({abi:[e],eventName:e.name,args:n})))],s&&(h=h[0]));const{unsubscribe:f}=await l.subscribe({params:["logs",{address:t,topics:h}],onData(e){if(!r)return;const t=e.result;try{const{eventName:e,args:n}=Ad({abi:u??[],data:t.data,topics:t.topics,strict:p}),r=_d(t,{args:n,eventName:e});c([r])}catch(e){let n,r;if(e instanceof ho||e instanceof po){if(d)return;n=e.abiItem.name,r=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const s=_d(t,{args:r?[]:{},eventName:n});c([s])}},onError(e){o?.(e)}});a=f,r||a()}catch(e){o?.(e)}})(),()=>a()})()}(e,t),watchPendingTransactions:t=>function(e,{batch:t=!0,onError:n,onTransactions:r,poll:s,pollingInterval:i=e.pollingInterval}){return(void 0!==s?s:"webSocket"!==e.transport.type)?Kd(Cl(["watchPendingTransactions",e.uid,t,i]),{onTransactions:r,onError:n},(n=>{let r;const s=Jd((async()=>{try{if(!r)try{return void(r=await Ga(e,Uh,"createPendingTransactionFilter")({}))}catch(e){throw s(),e}const i=await Ga(e,sh,"getFilterChanges")({filter:r});if(0===i.length)return;if(t)n.onTransactions(i);else for(const e of i)n.onTransactions([e])}catch(e){n.onError?.(e)}}),{emitOnBegin:!0,interval:i});return async()=>{r&&await Ga(e,ih,"uninstallFilter")({filter:r}),s()}})):(()=>{let t=!0,s=()=>t=!1;return(async()=>{try{const{unsubscribe:i}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!t)return;const n=e.result;r([n])},onError(e){n?.(e)}});s=i,t||s()}catch(e){n?.(e)}})(),()=>s()})()}(e,t)}}var Tf=Object.freeze({__proto__:null,AbiConstructorNotFoundError:Ka,AbiConstructorParamsNotFoundError:Ya,AbiDecodingDataSizeTooSmallError:Ja,AbiDecodingZeroDataError:Xa,AbiEncodingArrayLengthMismatchError:eo,AbiEncodingBytesSizeMismatchError:to,AbiEncodingLengthMismatchError:no,AbiErrorSignatureNotFoundError:ro,AbiEventNotFoundError:ao,AbiEventSignatureEmptyTopicsError:so,AbiEventSignatureNotFoundError:io,AbiFunctionNotFoundError:oo,AbiFunctionOutputsNotFoundError:co,AccountStateConflictError:Ml,BaseError:Za,BaseFeeScalarError:Uu,BlockNotFoundError:Hu,BytesSizeMismatchError:uo,CallExecutionError:zl,ChainDisconnectedError:pu,ChainDoesNotSupportContract:Dd,ClientChainNotConfiguredError:zd,ContractFunctionExecutionError:Hl,ContractFunctionRevertedError:Gl,ContractFunctionZeroDataError:ql,DecodeLogDataMismatch:ho,DecodeLogTopicsMismatch:po,Eip1559FeesNotSupportedError:Du,EnsAvatarInvalidNftUriError:Ch,EnsAvatarUnsupportedNamespaceError:_h,EnsAvatarUriResolutionError:Ph,EstimateGasExecutionError:yu,ExecutionRevertedError:vu,FeeCapTooHighError:wu,FeeCapTooLowError:xu,FeeConflictError:Fl,FilterTypeNotSupportedError:yo,HttpRequestError:Vl,InsufficientFundsError:Cu,IntegerOutOfRangeError:Co,InternalRpcError:tu,IntrinsicGasTooHighError:Pu,IntrinsicGasTooLowError:_u,InvalidAbiDecodingTypeError:mo,InvalidAbiEncodingTypeError:fo,InvalidAddressError:Ic,InvalidArrayError:bo,InvalidBytesBooleanError:Po,InvalidDefinitionTypeError:go,InvalidInputRpcError:nu,InvalidParamsRpcError:eu,InvalidRequestRpcError:Jl,InvalidSerializableTransactionError:jl,JsonRpcVersionUnsupportedError:cu,LimitExceededRpcError:ou,MaxFeePerGasTooLowError:zu,MethodNotFoundRpcError:Xl,MethodNotSupportedRpcError:au,NonceMaxValueError:Au,NonceTooHighError:ku,NonceTooLowError:Eu,ParseRpcError:Yl,ProviderDisconnectedError:hu,ProviderRpcError:Kl,RawContractError:$l,ResourceNotFoundRpcError:ru,ResourceUnavailableRpcError:su,RpcError:Ql,RpcRequestError:Wl,SizeExceedsPaddingSizeError:wo,SizeOverflowError:_o,SliceOffsetOutOfBoundsError:vo,StateAssignmentConflictError:Ol,SwitchChainError:fu,TimeoutError:Zl,TipAboveFeeCapError:Iu,TransactionNotFoundError:Ll,TransactionReceiptNotFoundError:Ul,TransactionRejectedRpcError:iu,TransactionTypeNotSupportedError:Su,UnauthorizedProviderError:uu,UnknownNodeError:Bu,UnknownRpcError:mu,UnsupportedProviderMethodError:du,UrlRequiredError:fh,UserRejectedRequestError:lu,WaitForTransactionReceiptTimeoutError:Dl,assertRequest:Lu,blobsToCommitments:Yu,blobsToProofs:Ju,boolToBytes:zo,boolToHex:No,bytesToBigInt:ml,bytesToBool:bl,bytesToHex:Ro,bytesToNumber:gl,bytesToString:yl,ccipFetch:Zh,ccipRequest:Zh,checksumAddress:Mc,commitmentToVersionedHash:cd,commitmentsToVersionedHashes:ld,concat:Fc,concatBytes:jc,concatHex:Lc,createClient:uh,createPublicClient:function(e){const{key:t="public",name:n="Public Client"}=e;return uh({...e,key:t,name:n,type:"publicClient"}).extend(Bf)},createTransport:ph,decodeAbiParameters:vl,decodeErrorResult:Al,decodeEventLog:Ad,decodeFunctionResult:Td,encodeAbiParameters:qc,encodeDeployData:cp,encodeEventTopics:Xc,encodeFunctionData:al,etherUnits:_l,formatBlock:$u,formatEther:Bl,formatGwei:Tl,formatLog:_d,formatTransaction:qu,formatTransactionReceipt:up,formatTransactionRequest:Nu,formatUnits:Il,getAbiItem:Qc,getChainContractAddress:Hd,getContractError:gu,getEventSelector:Sc,getEventSignature:Pc,getFunctionSelector:Zc,getFunctionSignature:Pc,getTransactionType:yd,getTypesForEIP712Domain:ap,gweiUnits:Sl,hashDomain:Xh,hashMessage:hp,hashTypedData:Jh,hexToBigInt:Bo,hexToBytes:qo,hexToNumber:To,http:function(e,t={}){const{batch:n,fetchOptions:r,key:s="http",name:i="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:o,retryDelay:c}=t;return({chain:l,retryCount:u,timeout:d})=>{const{batchSize:h=1e3,wait:p=0}="object"==typeof n?n:{},f=t.retryCount??u,m=d??t.timeout??1e4,b=e||l?.rpcUrls.default.http[0];if(!b)throw new fh;const g=function(e,t={}){return{async request(n){const{body:r,onRequest:s=t.onRequest,onResponse:i=t.onResponse,timeout:a=t.timeout??1e4}=n,o={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:c,method:l,signal:u}=o;try{const t=await mh((async({signal:t})=>{const n={...o,body:Array.isArray(r)?Cl(r.map((e=>({jsonrpc:"2.0",id:e.id??gh.take(),...e})))):Cl({jsonrpc:"2.0",id:r.id??gh.take(),...r}),headers:{...c,"Content-Type":"application/json"},method:l||"POST",signal:u||(a>0?t:null)},i=new Request(e,n);return s&&await s(i),await fetch(e,n)}),{errorInstance:new Zl({body:r,url:e}),timeout:a,signal:!0});let n;if(i&&await i(t),t.headers.get("Content-Type")?.startsWith("application/json")?n=await t.json():(n=await t.text(),n=JSON.parse(n||"{}")),!t.ok)throw new Vl({body:r,details:Cl(n.error)||t.statusText,headers:t.headers,status:t.status,url:e});return n}catch(t){if(t instanceof Vl)throw t;if(t instanceof Zl)throw t;throw new Vl({body:r,details:t.message,url:e})}}}}(b,{fetchOptions:r,onRequest:a,onResponse:o,timeout:m});return ph({key:s,name:i,async request({method:e,params:t}){const r={method:e,params:t},{schedule:s}=qd({id:b,wait:p,shouldSplitBatch:e=>e.length>h,fn:e=>g.request({body:e}),sort:(e,t)=>e.id-t.id}),[{error:i,result:a}]=await(async e=>n?s(e):[await g.request({body:e})])(r);if(i)throw new Wl({body:r,error:i,url:b});return a},retryCount:f,retryDelay:c,timeout:m,type:"http"},{fetchOptions:r,url:b})}},isAddress:Rc,isAddressEqual:qh,isHex:Va,keccak256:Ac,labelhash:kh,multicall3Abi:Md,namehash:wh,numberToBytes:$o,numberToHex:Fo,offchainLookup:Wh,offchainLookupAbiItem:Vh,offchainLookupSignature:$h,pad:ko,padBytes:Ao,padHex:Eo,parseEventLogs:Pd,prepareEncodeFunctionData:il,presignMessagePrefix:dp,publicActions:Bf,rpcTransactionType:Ou,serializeSignature:Af,sha256:od,signatureToHex:Af,size:Wa,slice:Uc,sliceBytes:Hc,sliceHex:Gc,stringToBytes:Vo,stringToHex:Lo,stringify:Cl,toBlobSidecars:gd,toBlobs:bd,toBytes:Do,toEventHash:_c,toEventSelector:Sc,toEventSignature:Pc,toFunctionHash:_c,toFunctionSelector:Zc,toFunctionSignature:Pc,toHex:Oo,transactionType:Gu,trim:So,validateTypedData:ip,withRetry:dh,withTimeout:mh}),Mf={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",i="[object AsyncFunction]",a="[object Function]",o="[object GeneratorFunction]",c="[object Null]",l="[object Object]",u="[object Proxy]",d="[object Undefined]",h=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,f={};f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f[s]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object Boolean]"]=f["[object DataView]"]=f["[object Date]"]=f["[object Error]"]=f[a]=f["[object Map]"]=f["[object Number]"]=f[l]=f["[object RegExp]"]=f["[object Set]"]=f["[object String]"]=f["[object WeakMap]"]=!1;var m="object"==typeof qe&&qe&&qe.Object===Object&&qe,b="object"==typeof self&&self&&self.Object===Object&&self,g=m||b||Function("return this")(),y=t&&!t.nodeType&&t,v=y&&e&&!e.nodeType&&e,w=v&&v.exports===y,x=w&&m.process,k=function(){try{var e=v&&v.require&&v.require("util").types;return e||x&&x.binding&&x.binding("util")}catch(e){}}(),E=k&&k.isTypedArray;var A=Array.prototype,C=Function.prototype,P=Object.prototype,_=g["__core-js_shared__"],S=C.toString,I=P.hasOwnProperty,B=function(){var e=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),T=P.toString,M=S.call(Object),O=RegExp("^"+S.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),N=w?g.Buffer:void 0,R=g.Symbol,F=g.Uint8Array;N&&N.allocUnsafe;var j,L,U=(j=Object.getPrototypeOf,L=Object,function(e){return j(L(e))}),D=Object.create,z=P.propertyIsEnumerable,H=A.splice,G=R?R.toStringTag:void 0,q=function(){try{var e=me(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),$=N?N.isBuffer:void 0,V=Math.max,W=Date.now,Z=me(g,"Map"),Q=me(Object,"create"),K=function(){function e(){}return function(t){if(!_e(t))return{};if(D)return D(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},J.prototype.set=function(e,t){var n=this.__data__,r=se(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},X.prototype.clear=function(){this.size=0,this.__data__={hash:new Y,map:new(Z||J),string:new Y}},X.prototype.delete=function(e){var t=fe(this,e).delete(e);return this.size-=t?1:0,t},X.prototype.get=function(e){return fe(this,e).get(e)},X.prototype.has=function(e){return fe(this,e).has(e)},X.prototype.set=function(e,t){var n=fe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ee.prototype.clear=function(){this.__data__=new J,this.size=0},ee.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ee.prototype.get=function(e){return this.__data__.get(e)},ee.prototype.has=function(e){return this.__data__.has(e)},ee.prototype.set=function(e,t){var n=this.__data__;if(n instanceof J){var r=n.__data__;if(!Z||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new X(r)}return n.set(e,t),this.size=n.size,this};var ae=function(e,t,n){for(var r=-1,s=Object(e),i=n(e),a=i.length;a--;){var o=i[++r];if(!1===t(s[o],o,s))break}return e};function oe(e){return null==e?void 0===e?d:c:G&&G in Object(e)?function(e){var t=I.call(e,G),n=e[G];try{e[G]=void 0;var r=!0}catch(e){}var s=T.call(e);r&&(t?e[G]=n:delete e[G]);return s}(e):function(e){return T.call(e)}(e)}function ce(e){return Se(e)&&oe(e)==s}function le(e){return!(!_e(e)||function(e){return!!B&&B in e}(e))&&(Ce(e)?O:h).test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ue(e){if(!_e(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ge(e),n=[];for(var r in e)("constructor"!=r||!t&&I.call(e,r))&&n.push(r);return n}function de(e,t,n,r,s){e!==t&&ae(t,(function(i,a){if(s||(s=new ee),_e(i))!function(e,t,n,r,s,i,a){var o=ye(e,n),c=ye(t,n),u=a.get(c);if(u)return void ne(e,n,u);var d=i?i(o,c,n+"",e,t,a):void 0,h=void 0===d;if(h){var p=ke(c),f=!p&&Ae(c),m=!p&&!f&&Ie(c);d=c,p||f||m?ke(o)?d=o:Se(b=o)&&Ee(b)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(pe);function we(e,t){return e===t||e!=e&&t!=t}var xe=ce(function(){return arguments}())?ce:function(e){return Se(e)&&I.call(e,"callee")&&!z.call(e,"callee")},ke=Array.isArray;function Ee(e){return null!=e&&Pe(e.length)&&!Ce(e)}var Ae=$||function(){return!1};function Ce(e){if(!_e(e))return!1;var t=oe(e);return t==a||t==o||t==i||t==u}function Pe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function _e(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Se(e){return null!=e&&"object"==typeof e}var Ie=E?function(e){return function(t){return e(t)}}(E):function(e){return Se(e)&&Pe(e.length)&&!!f[oe(e)]};function Be(e){return Ee(e)?te(e):ue(e)}var Te,Me=(Te=function(e,t,n){de(e,t,n)},he((function(e,t){var n=-1,r=t.length,s=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(s=Te.length>3&&"function"==typeof s?(r--,s):void 0,i&&function(e,t,n){if(!_e(n))return!1;var r=typeof t;return!!("number"==r?Ee(n)&&be(t,n.length):"string"==r&&t in n)&&we(n[t],e)}(t[0],t[1],i)&&(s=r<3?void 0:s,r=1),e=Object(e);++nnull!=e;function Zf(e){return e.includes("11?`${e.slice(0,4)}…${e.slice(-6)}`:e}const Yf=e=>"number"==typeof e?`0x${e.toString(16)}`:e;function Jf(e){return`0x${(1e9*e).toString(16)}`}const Xf={"0x1":"Ethereum","0xaa36a7":"Sepolia","0x38":"Binance","0x89":"Polygon","0xfa":"Fantom","0xa":"OP Mainnet","0x45":"OP Kovan","0xa86a":"Avalanche","0xa4ec":"Celo","0x2105":"Base","0x14a33":"Base Goerli","0x64":"Gnosis","0x63564C40":"Harmony One","0xa4b1":"Arbitrum One","0xa4ba":"Arbitrum Nova","0x27bc86aa":"Degen"};function em(e){switch(e){case"0x1":case"0x89":case"0xa":case"0xa4b1":case"0x144":return"0x1";case"0x5":case"0xaa36a7":return e;default:return null}}const tm=async e=>{switch(e){case"0x89":case"0xa":case"0xa4b1":case"0x144":case"0x1":{const{mainnet:e}=await Promise.resolve().then((function(){return kue}));return e}case"0xaa36a7":{const{sepolia:e}=await Promise.resolve().then((function(){return kue}));return e}default:return null}},nm={main:"0x1",sepolia:"0xaa36a7",xdai:"0x64","bsc-main":"0x38","matic-main":"0x89","fantom-main":"0xfa","matic-mumbai":"0x80001",degen:"0x27bc86aa"},rm={"0x1":{icon:Uf,color:"#627EEA"},"0xaa36a7":{icon:Uf,color:"#627EEA"},"0x38":{icon:'\n \n \n \n',color:"#F3BA2F"},"0x89":{icon:Df,color:"#8247E5"},"0xfa":{icon:'\n \n \n \n',color:"#1969FF"},"0xa":{icon:zf,color:"#FF0420"},"0x45":{icon:zf,color:"#FF0420"},"0xa86a":{icon:'\n \n \n \n',color:"#E84142"},"0xa4ec":{icon:'\n\n\x3c!-- Generator: Adobe Illustrator 26.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n\n\n\n\n',color:"#FBCC5C"},"0x64":{icon:'\n \n \n \n \n \n \n \n',color:"#04795B"},"0x63564C40":{icon:'\n \n \n \n \n \n \n \n \n \n',color:"#ffffff"},"0xa4b1":{icon:Hf,color:"#33394B"},"0xa4ba":{icon:Hf,color:"#33394B"},"0x2105":{icon:Gf,color:"#0259F9"},"0x14a33":{icon:Gf,color:"#0259F9"},"0x80001":{icon:Df,color:"#8247E5"},"0x27bc86aa":{icon:'\n\n\n \n \n \n \n \n \n \n\n',color:"#a36dfe"}},sm={icon:qf,color:"#33394B"};function im(e){return e?rm[e.toLowerCase()]:void 0}function am(e,t){return!!t.find((({id:t,namespace:n})=>t===e.id&&n===e.namespace))}const om={pending:{backgroundColor:"var(--onboard-primary-700, var(--primary-700))",borderColor:"#6370E5",eventIcon:'\n\n \n\n'},success:{backgroundColor:"#052E17",borderColor:"var(--onboard-success-300, var(--success-300))",eventIcon:'\n\n \n\n'},error:{backgroundColor:"#FDB1B11A",borderColor:"var(--onboard-danger-300, var(--danger-300))",eventIcon:'\n\n\n'},hint:{backgroundColor:"var(--onboard-gray-500, var(--gray-500))",borderColor:"var(--onboard-gray-500, var(--gray-500))",iconColor:"var(--onboard-gray-100, var(--gray-100))",eventIcon:$f}},cm=e=>new Promise((t=>setTimeout(t,e)));function lm(e){try{return localStorage.getItem(e)}catch(e){return null}}function um(e,t){try{localStorage.setItem(e,t)}catch(e){return}}function dm(e){try{localStorage.removeItem(e)}catch(e){return}}let hm={svelteInstance:null,apiKey:void 0,device:function(){if("undefined"!=typeof window){const e=Ze.getParser(window.navigator.userAgent),t=e.getOS(),n=e.getBrowser(),{type:r}=e.getPlatform();return{type:r,os:t,browser:n}}return{type:null,os:null,browser:null}}(),initialWalletInit:[],gas:void 0,containerElements:{accountCenter:void 0,connectModal:void 0},transactionPreview:void 0,unstoppableResolution:void 0,wagmi:void 0};function pm(e){hm=Object.assign(Object.assign({},hm),e)}const fm={wallets:[],walletModules:[],chains:[],accountCenter:{enabled:!0,position:"bottomRight",expanded:!1,minimal:!0},notify:{enabled:!0,transactionHandler:()=>{},position:"topRight",replacement:{gasPriceProbability:{speedup:80,cancel:95}}},notifications:[],locale:"",connect:{showSidebar:!0,disableClose:!1},appMetadata:null,wagmiConfig:null},mm={TERMS_AGREEMENT:"onboard.js:agreement",LAST_CONNECTED_WALLET:"onboard.js:last_connected_wallet"},bm=768,gm="https://docs.blocknative.com/blocknative-mev-protection/transaction-boost",ym="add_chains",vm="update_chains",wm="reset_store",xm="add_wallet",km="update_wallet",Em="remove_wallet",Am="update_account",Cm="update_account_center",Pm="update_connect_modal",_m="set_wallet_modules",Sm="set_locale",Im="update_notify",Bm="add_notification",Tm="remove_notification",Mm="update_balance",Om="update_app_metadata",Nm="update_wagmi_config";const Rm=new z(fm),Fm=new U;function jm(e){const t=Rm.getValue();Fm.next(function(e,t){const{type:n,payload:r}=t;switch(n){case ym:return Object.assign(Object.assign({},e),{chains:[...e.chains,...r]});case vm:{const t=r,n=e.chains,s=n.findIndex((e=>e.id===t.id));return n[s]=t,Object.assign(Object.assign({},e),{chains:n})}case xm:{const t=r,n=e.wallets.find((({label:e})=>e===t.label));return Object.assign(Object.assign({},e),{wallets:[n||r,...e.wallets.filter((({label:e})=>e!==t.label))]})}case km:{const t=r,{id:n}=t,s=Ff(t,["id"]),i=e.wallets.map((e=>e.label===n?Object.assign(Object.assign({},e),s):e));return Object.assign(Object.assign({},e),{wallets:i})}case Em:{const t=r;return Object.assign(Object.assign({},e),{wallets:e.wallets.filter((({label:e})=>e!==t.id))})}case Am:{const t=r,{id:n,address:s}=t,i=Ff(t,["id","address"]),a=e.wallets.map((e=>(e.label===n&&(e.accounts=e.accounts.map((e=>e.address===s?Object.assign(Object.assign({},e),i):e))),e)));return Object.assign(Object.assign({},e),{wallets:a})}case Mm:{const t=r;return Object.assign(Object.assign({},e),{wallets:t})}case Pm:{const t=r;return Object.assign(Object.assign({},e),{connect:Object.assign(Object.assign({},e.connect),t)})}case Cm:{const t=r;return Object.assign(Object.assign({},e),{accountCenter:Object.assign(Object.assign({},e.accountCenter),t)})}case Im:{const t=r;return Object.assign(Object.assign({},e),{notify:Object.assign(Object.assign({},e.notify),t)})}case Bm:{const t=r,n=[...e.notifications],s=n.findIndex((({id:e})=>e===t.id));return-1!==s?n[s]=t:n.unshift(t),Object.assign(Object.assign({},e),{notifications:n})}case Tm:{const t=r;return Object.assign(Object.assign({},e),{notifications:e.notifications.filter((e=>e.id!==t))})}case _m:return Object.assign(Object.assign({},e),{walletModules:r});case Sm:return mr.set(r),Object.assign(Object.assign({},e),{locale:r});case Om:{const t=r;return Object.assign(Object.assign({},e),{appMetadata:Object.assign(Object.assign(Object.assign({},e.appMetadata),t),{name:t.name||""})})}case Nm:{const t=r;return Object.assign(Object.assign({},e),{wagmiConfig:t})}case wm:return fm;default:throw new Error(`Unknown type: ${n} in appStore reducer`)}}(t,e))}Fm.subscribe(Rm);const Lm={select:function(e){if(!e)return Fm.asObservable();if(!Object.keys(Rm.getValue()).includes(String(e)))throw new Error(`key: ${e} does not exist on this store`);return Fm.asObservable().pipe(function(e){return Ne((function(t,n){return t[e]===n[e]}))}(e),Fe(e),Te(Wf))},get:function(){return Rm.getValue()}};function Um(){}const Dm=e=>e;function zm(e){return e()}function Hm(){return Object.create(null)}function Gm(e){e.forEach(zm)}function qm(e){return"function"==typeof e}function $m(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let Vm;function Wm(e,t){return Vm||(Vm=document.createElement("a")),Vm.href=t,e===Vm.href}function Zm(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return Um;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function Qm(e,t,n,r){if(e){const s=Km(e,t,n,r);return e[0](s)}}function Km(e,t,n,r){return e[1]&&r?function(e,t){for(const n in t)e[n]=t[n];return e}(n.ctx.slice(),e[1](r(t))):n.ctx}function Ym(e,t,n,r){if(e[2]&&r){const s=e[2](r(n));if(void 0===t.dirty)return s;if("object"==typeof s){const e=[],n=Math.max(t.dirty.length,s.length);for(let r=0;r32){const t=[],n=e.ctx.length/32;for(let e=0;ewindow.performance.now():()=>Date.now(),sb=nb?e=>requestAnimationFrame(e):Um;const ib=new Set;function ab(e){ib.forEach((t=>{t.c(e)||(ib.delete(t),t.f())})),0!==ib.size&&sb(ab)}function ob(e){let t;return 0===ib.size&&sb(ab),{promise:new Promise((n=>{ib.add(t={c:e,f:n})})),abort(){ib.delete(t)}}}function cb(e,t){e.appendChild(t)}function lb(e,t,n){const r=ub(e);if(!r.getElementById(t)){const e=bb("style");e.id=t,e.textContent=n,hb(r,e)}}function ub(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function db(e){const t=bb("style");return hb(ub(e),t),t.sheet}function hb(e,t){return cb(e.head||e,t),t.sheet}function pb(e,t,n){e.insertBefore(t,n||null)}function fb(e){e.parentNode&&e.parentNode.removeChild(e)}function mb(e,t){for(let n=0;ne.removeEventListener(t,n,r)}function xb(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function kb(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Eb(e,t){t=""+t,e.data!==t&&(e.data=t)}function Ab(e,t,n,r){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function Cb(e,t,n){for(let n=0;n>>0}(u)}_${o}`,h=ub(e),{stylesheet:p,rules:f}=Ib.get(h)||function(e,t){const n={stylesheet:db(t),rules:{}};return Ib.set(e,n),n}(h,e);f[d]||(f[d]=!0,p.insertRule(`@keyframes ${d} ${u}`,p.cssRules.length));const m=e.style.animation||"";return e.style.animation=`${m?`${m}, `:""}${d} ${r}ms linear ${s}ms 1 both`,Tb+=1,d}function Ob(e,t){const n=(e.style.animation||"").split(", "),r=n.filter(t?e=>e.indexOf(t)<0:e=>-1===e.indexOf("__svelte")),s=n.length-r.length;s&&(e.style.animation=r.join(", "),Tb-=s,Tb||sb((()=>{Tb||(Ib.forEach((e=>{const{ownerNode:t}=e.stylesheet;t&&fb(t)})),Ib.clear())})))}function Nb(e,t){const n=e.getBoundingClientRect();if(t.left!==n.left||t.top!==n.top){const r=getComputedStyle(e),s="none"===r.transform?"":r.transform;e.style.transform=`${s} translate(${t.left-n.left}px, ${t.top-n.top}px)`}}function Rb(e){Bb=e}function Fb(){if(!Bb)throw new Error("Function called outside component initialization");return Bb}function jb(e){Fb().$$.on_destroy.push(e)}function Lb(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e.call(this,t)))}const Ub=[],Db=[];let zb=[];const Hb=[],Gb=Promise.resolve();let qb=!1;function $b(e){zb.push(e)}function Vb(e){Hb.push(e)}const Wb=new Set;let Zb,Qb=0;function Kb(){if(0!==Qb)return;const e=Bb;do{try{for(;Qb{Zb=null}))),Zb}function Xb(e,t,n){e.dispatchEvent(function(e,t,{bubbles:n=!1,cancelable:r=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(e,n,r,t),s}(`${t?"intro":"outro"}${n}`))}const eg=new Set;let tg;function ng(){tg={r:0,c:[],p:tg}}function rg(){tg.r||Gm(tg.c),tg=tg.p}function sg(e,t){e&&e.i&&(eg.delete(e),e.i(t))}function ig(e,t,n,r){if(e&&e.o){if(eg.has(e))return;eg.add(e),tg.c.push((()=>{eg.delete(e),r&&(n&&e.d(1),r())})),e.o(t)}else r&&r()}const ag={duration:0};function og(e,t,n){const r={direction:"in"};let s,i,a=t(e,n,r),o=!1,c=0;function l(){s&&Ob(e,s)}function u(){const{delay:t=0,duration:n=300,easing:r=Dm,tick:u=Um,css:d}=a||ag;d&&(s=Mb(e,0,1,n,t,r,d,c++)),u(0,1);const h=rb()+t,p=h+n;i&&i.abort(),o=!0,$b((()=>Xb(e,!0,"start"))),i=ob((t=>{if(o){if(t>=p)return u(1,0),Xb(e,!0,"end"),l(),o=!1;if(t>=h){const e=r((t-h)/n);u(e,1-e)}}return o}))}let d=!1;return{start(){d||(d=!0,Ob(e),qm(a)?(a=a(r),Jb().then(u)):u())},invalidate(){d=!1},end(){o&&(l(),o=!1)}}}function cg(e,t,n){const r={direction:"out"};let s,i=t(e,n,r),a=!0;const o=tg;function c(){const{delay:t=0,duration:n=300,easing:r=Dm,tick:c=Um,css:l}=i||ag;l&&(s=Mb(e,1,0,n,t,r,l));const u=rb()+t,d=u+n;$b((()=>Xb(e,!1,"start"))),ob((t=>{if(a){if(t>=d)return c(0,1),Xb(e,!1,"end"),--o.r||Gm(o.c),!1;if(t>=u){const e=r((t-u)/n);c(1-e,e)}}return a}))}return o.r+=1,qm(i)?Jb().then((()=>{i=i(r),c()})):c(),{end(t){t&&i.tick&&i.tick(1,0),a&&(s&&Ob(e,s),a=!1)}}}function lg(e,t,n,r){const s={direction:"both"};let i=t(e,n,s),a=r?0:1,o=null,c=null,l=null;function u(){l&&Ob(e,l)}function d(e,t){const n=e.b-a;return t*=Math.abs(n),{a:a,b:e.b,d:n,duration:t,start:e.start,end:e.start+t,group:e.group}}function h(t){const{delay:n=0,duration:r=300,easing:s=Dm,tick:h=Um,css:p}=i||ag,f={start:rb()+n,b:t};t||(f.group=tg,tg.r+=1),o||c?c=f:(p&&(u(),l=Mb(e,a,t,r,n,s,p)),t&&h(0,1),o=d(f,r),$b((()=>Xb(e,t,"start"))),ob((t=>{if(c&&t>c.start&&(o=d(c,r),c=null,Xb(e,o.b,"start"),p&&(u(),l=Mb(e,a,o.b,o.duration,0,s,i.css))),o)if(t>=o.end)h(a=o.b,1-a),Xb(e,o.b,"end"),c||(o.b?u():--o.group.r||Gm(o.group.c)),o=null;else if(t>=o.start){const e=t-o.start;a=o.a+o.d*s(e/o.duration),h(a,1-a)}return!(!o&&!c)})))}return{run(e){qm(i)?Jb().then((()=>{i=i(s),h(e)})):h(e)},end(){u(),o=c=null}}}function ug(e,t){const n=t.token={};function r(e,r,s,i){if(t.token!==n)return;t.resolved=i;let a=t.ctx;void 0!==s&&(a=a.slice(),a[s]=i);const o=e&&(t.current=e)(a);let c=!1;t.block&&(t.blocks?t.blocks.forEach(((e,n)=>{n!==r&&e&&(ng(),ig(e,1,1,(()=>{t.blocks[n]===e&&(t.blocks[n]=null)})),rg())})):t.block.d(1),o.c(),sg(o,1),o.m(t.mount(),t.anchor),c=!0),t.block=o,t.blocks&&(t.blocks[r]=o),c&&Kb()}if(!(s=e)||"object"!=typeof s&&"function"!=typeof s||"function"!=typeof s.then){if(t.current!==t.then)return r(t.then,1,t.value,e),!0;t.resolved=e}else{const n=Fb();if(e.then((e=>{Rb(n),r(t.then,1,t.value,e),Rb(null)}),(e=>{if(Rb(n),r(t.catch,2,t.error,e),Rb(null),!t.hasCatch)throw e})),t.current!==t.pending)return r(t.pending,0),!0}var s}function dg(e,t,n){const r=t.slice(),{resolved:s}=e;e.current===e.then&&(r[e.value]=s),e.current===e.catch&&(r[e.error]=s),e.block.p(r,n)}function hg(e,t){e.d(1),t.delete(e.key)}function pg(e,t){ig(e,1,1,(()=>{t.delete(e.key)}))}function fg(e,t){e.f(),pg(e,t)}function mg(e,t,n,r,s,i,a,o,c,l,u,d){let h=e.length,p=i.length,f=h;const m={};for(;f--;)m[e[f].key]=f;const b=[],g=new Map,y=new Map,v=[];for(f=p;f--;){const e=d(s,i,f),r=n(e);let o=a.get(r);o?v.push((()=>o.p(e,t))):(o=l(r,e),o.c()),g.set(r,b[f]=o),r in m&&y.set(r,Math.abs(f-m[r]))}const w=new Set,x=new Set;function k(e){sg(e,1),e.m(o,u),a.set(e.key,e),u=e.first,p--}for(;h&&p;){const t=b[p-1],n=e[h-1],r=t.key,s=n.key;t===n?(u=t.first,h--,p--):g.has(s)?!a.has(r)||w.has(r)?k(t):x.has(s)?h--:y.get(r)>y.get(s)?(x.add(r),k(t)):(w.add(s),h--):(c(n,a),h--)}for(;h--;){const t=e[h];g.has(t.key)||c(t,a)}for(;p;)k(b[p-1]);return Gm(v),b}function bg(e,t,n){const r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function gg(e){e&&e.c()}function yg(e,t,n,r){const{fragment:s,after_update:i}=e.$$;s&&s.m(t,n),r||$b((()=>{const t=e.$$.on_mount.map(zm).filter(qm);e.$$.on_destroy?e.$$.on_destroy.push(...t):Gm(t),e.$$.on_mount=[]})),i.forEach($b)}function vg(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];zb.forEach((r=>-1===e.indexOf(r)?t.push(r):n.push(r))),n.forEach((e=>e())),zb=t}(n.after_update),Gm(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function wg(e,t){-1===e.$$.dirty[0]&&(Ub.push(e),qb||(qb=!0,Gb.then(Kb)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const i=r.length?r[0]:n;return l.ctx&&s(l.ctx[t],l.ctx[t]=i)&&(!l.skip_bound&&l.bound[t]&&l.bound[t](i),u&&wg(e,t)),n})):[],l.update(),u=!0,Gm(l.before_update),l.fragment=!!r&&r(l.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);l.fragment&&l.fragment.l(e),e.forEach(fb)}else l.fragment&&l.fragment.c();t.intro&&sg(e.$$.fragment),yg(e,t.target,t.anchor,t.customElement),Kb()}Rb(c)}class kg{$destroy(){vg(this,1),this.$destroy=Um}$on(e,t){if(!qm(t))return Um;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Eg=new U,Ag=new U,Cg=new z({inProgress:!1,actionRequired:""}),Pg=new z(null),_g=Lm.select("wallets").pipe(Ue(1));Eg.pipe(Ge(_g),Fe("1")).subscribe((e=>{e.forEach((({label:e})=>{Ag.next(e)})),jm({type:wm})}));const Sg=new z([]);function Ig(e){const t=Sg.getValue();Sg.next(t.filter((t=>t.hash!==e)))}const Bg=(Tg=()=>{const e=new U;return jb((()=>{e.next()})),e.asObservable().pipe(Me(1))},new O((function(e){ce(Tg()).subscribe(e)})));var Tg;const Mg={default:{"--w3o-background-color":"unset","--w3o-foreground-color":"unset","--w3o-text-color":"unset","--w3o-border-color":"unset","--w3o-action-color":"unset","--w3o-border-radius":"unset","--w3o-font-family":"inherit"},light:{"--w3o-background-color":"#ffffff","--w3o-foreground-color":"#EFF1FC","--w3o-text-color":"#1a1d26","--w3o-border-color":"#d0d4f7","--w3o-action-color":"#6370E5","--w3o-border-radius":"16px","--w3o-font-family":"inherit"},dark:{"--w3o-background-color":"#1A1D26","--w3o-foreground-color":"#242835","--w3o-text-color":"#EFF1FC","--w3o-border-color":"#33394B","--w3o-action-color":"#929bed","--w3o-border-radius":"16px","--w3o-font-family":"inherit"}},Og=e=>"string"==typeof e&&"system"===e?Fg():Ng(e),Ng=e=>"string"==typeof e&&e in Mg?Mg[e]:"object"==typeof e?e:void 0,Rg=e=>{Object.keys(e).forEach((t=>{document.documentElement.style.setProperty(t,e[t]||null)}))},Fg=()=>{const e=window.matchMedia("(prefers-color-scheme: dark)");e.matches?Rg(Mg.dark):Rg(Mg.light),_e(e,"change").pipe(He(Eg)).subscribe((e=>{e.matches?Rg(Mg.dark):Rg(Mg.light)}))},jg=Lr.object().unknown(),Lg=Lr.object({namespace:Na.required(),id:Oa.required()}),Ug=Lr.any().allow(Lr.object({name:Lr.string().required(),avatar:Lr.string(),contentHash:Lr.any().allow(Lr.string(),null),getText:Lr.function().arity(1).required()}),null),Dg=Lr.any().allow(Lr.object({name:Lr.string().required()}),null),zg=Lr.any().allow(Lr.object({eth:Lr.number()}).unknown(),null),Hg=Lr.any().allow(Lr.object({balance:Lr.string().required(),icon:Lr.string()}),null),Gg=Lr.object({address:Lr.string().required(),ens:Ug,uns:Dg,balance:zg,secondaryTokens:Hg}),qg=Lr.array().items(Fa).unique(((e,t)=>e.id===t.id)).error((e=>"array.unique"===e[0].code?new Error(`There is a duplicate Chain ID in your Onboard Chains array: ${e}`):new Error(`${e}`))),$g=Lr.array().items(Gg),Vg=Lr.object({label:Lr.string(),icon:Lr.string(),provider:jg,instance:jg,accounts:$g,chains:Lr.array().items(Lg),wagmiConnector:jg}).required().error(new Error("wallet must be defined")),Wg=Lr.array().items(Vg),Zg=Lr.object({name:Lr.string().required(),url:Lr.string().uri().required()}),Qg=Lr.object({version:Lr.string().required(),termsUrl:Lr.string().uri(),privacyUrl:Lr.string().uri()}),Kg=Lr.object({name:Lr.string().required(),description:Lr.string().required(),icon:Lr.string(),logo:Lr.string(),gettingStartedGuide:Lr.string(),email:Lr.string(),appUrl:Lr.string(),explore:Lr.string(),recommendedInjectedWallets:Lr.array().items(Zg),agreement:Qg}),Yg=Lr.object({name:Lr.string(),description:Lr.string(),icon:Lr.string(),logo:Lr.string(),gettingStartedGuide:Lr.string(),email:Lr.string(),appUrl:Lr.string(),explore:Lr.string(),recommendedInjectedWallets:Lr.array().items(Zg),agreement:Qg});Lr.object({label:Lr.string().required(),getInfo:Lr.function().arity(1).required(),getInterface:Lr.function().arity(1).required()});const Jg=Lr.array().items(Lr.function()).required(),Xg=Lr.string(),ey=Lr.string().valid("topRight","bottomRight","bottomLeft","topLeft"),ty=[70,80,90,95,99],ny=Lr.object({transactionHandler:Lr.function(),enabled:Lr.boolean(),position:ey,replacement:Lr.object({gasPriceProbability:Lr.object({speedup:Lr.number().valid(...ty),cancel:Lr.number().valid(...ty)})})}),ry=Lr.object({desktop:ny,mobile:ny}),sy=Lr.object({enabled:Lr.boolean(),position:ey,minimal:Lr.boolean(),containerElement:Lr.string(),hideTransactionProtectionBtn:Lr.boolean(),transactionProtectionInfoLink:Lr.string()}),iy=Lr.object({enabled:Lr.boolean(),position:ey,expanded:Lr.boolean(),minimal:Lr.boolean(),hideTransactionProtectionBtn:Lr.boolean(),transactionProtectionInfoLink:Lr.string(),containerElement:Lr.string()}),ay=Lr.object({showSidebar:Lr.boolean(),disableClose:Lr.boolean(),autoConnectLastWallet:Lr.boolean(),autoConnectAllPreviousWallet:Lr.boolean(),iDontHaveAWalletLink:Lr.string(),wheresMyWalletLink:Lr.string(),removeWhereIsMyWalletWarning:Lr.boolean(),removeIDontHaveAWalletInfoLink:Lr.boolean(),disableUDResolution:Lr.boolean()}),oy=Lr.object({accountCenter:Lr.string(),connectModal:Lr.string()}),cy=Lr.object({"--w3o-background-color":Lr.string(),"--w3o-font-family":Lr.string(),"--w3o-foreground-color":Lr.string(),"--w3o-text-color":Lr.string(),"--w3o-border-color":Lr.string(),"--w3o-action-color":Lr.string(),"--w3o-border-radius":Lr.string()}),ly=Lr.string().valid("default","dark","light","system"),uy=Lr.alternatives().try(cy,ly),dy=Lr.object({wallets:Jg,chains:qg.required(),appMetadata:Kg,i18n:Lr.object().unknown(),apiKey:Lr.string(),accountCenter:Lr.object({desktop:sy,mobile:sy,hideTransactionProtectionBtn:Lr.boolean(),transactionProtectionInfoLink:Lr.string()}),notify:[ry,ny],gas:Lr.object({get:Lr.function().required(),stream:Lr.function().required()}),wagmi:Lr.function(),connect:ay,containerElements:oy,transactionPreview:Lr.object({patchProvider:Lr.function().required(),init:Lr.function().required(),previewTransaction:Lr.function()}),theme:uy,disableFontDownload:Lr.boolean(),unstoppableResolution:Lr.function()}),hy=Lr.object({autoSelect:Lr.alternatives().try(Lr.object({label:Lr.string().required(),disableModals:Lr.boolean()}),Lr.string())}),py=Lr.object({label:Lr.string().required()}).required(),fy=Lr.object({address:Lr.string().required(),icon:Lr.string().optional()}),my=Lr.object({chainId:Oa.required(),chainNamespace:Na,wallet:Lr.string(),rpcUrl:Lr.string(),label:Lr.string(),token:Lr.string(),protectedRpcUrl:Lr.string(),secondaryTokens:Lr.array().max(5).items(fy).optional()}),by=Lr.object({key:Lr.string().required(),type:Lr.string().allow("pending","error","success","hint"),eventCode:Lr.string(),message:Lr.string().required(),id:Lr.string().required(),autoDismiss:Lr.number(),onClick:Lr.function(),link:Lr.string()}),gy=Lr.object({sendTransaction:Lr.function(),estimateGas:Lr.function(),gasPrice:Lr.function(),balance:Lr.alternatives(Lr.string(),Lr.number()),txDetails:Lr.object({value:Lr.alternatives(Lr.string(),Lr.number()),to:Lr.string(),from:Lr.string()}),txApproveReminderTimeout:Lr.number()}),yy=Lr.object({key:Lr.string(),type:Lr.string().allow("pending","error","success","hint"),eventCode:Lr.string(),message:Lr.string(),id:Lr.string(),autoDismiss:Lr.number(),onClick:Lr.function(),link:Lr.string()}),vy=Lr.object({id:Lr.string().required(),key:Lr.string().required(),type:Lr.string().allow("pending","error","success","hint").required(),eventCode:Lr.string().required(),message:Lr.string().required(),autoDismiss:Lr.number().required(),network:Lr.string().required(),startTime:Lr.number(),onClick:Lr.function(),link:Lr.string()}),wy=Lr.any().allow(by,Lr.boolean().allow(!1));function xy(e){return Ma(Vg,e)}function ky(e,t){return Ma(Lr.string().required().label(t||"value"),e)}function Ey(e){return Ma(my,e)}function Ay(e){return Ma(Xg,e)}function Cy(e){return Ma(ny,e)}function Py(e){return Ma(vy,e)}function _y(e){return Ma(yy,e)}function Sy(e){return Ma(uy,e)}function Iy(e){const{label:t,token:n,rpcUrl:r,id:s,namespace:i}=e,a=Ey({label:t,token:n,rpcUrl:r,chainId:s,chainNamespace:i});if(a)throw a;jm({type:vm,payload:e})}function By(e){const t=xy(e);if(t)throw console.error(t),t;jm({type:xm,payload:e})}function Ty(e,t){const n=xy(t);if(n)throw console.error(n),n;jm({type:km,payload:Object.assign({id:e},t)})}function My(e,t){const n=xy(e)||t&&ky(t,"address");if(n)throw n;if(t){const n=e.accounts.find((e=>e.address===t));n&&(e.accounts=[n,...e.accounts.filter((({address:e})=>e!==n.address))])}!function(e){const{wagmi:t}=hm;if(!t)return;try{const{label:n}=e,{wagmiConnect:r,getWagmiConnector:s}=t,i=Lm.get().wagmiConfig,a=s(n);r(i,{connector:a}).then((()=>{Ty(n,{wagmiConnector:a})}))}catch(e){console.error(`Error updating Wagmi connector on primary wallet switch ${e}`)}}(e),By(e)}function Oy(e,t,n){jm({type:Am,payload:Object.assign({id:e,address:t},n)})}function Ny(e){const t=Ma(iy,e);if(t)throw t;jm({type:Cm,payload:e})}function Ry(e){const t=Ma(ay,e);if(t)throw t;jm({type:Pm,payload:e})}function Fy(e){const t=Cy(e);if(t)throw t;jm({type:Im,payload:e})}function jy(e){const t=Py(e);if(t)throw t;jm({type:Bm,payload:e})}function Ly(e){const t=Ma(by,e);if(t)throw t;jm({type:Bm,payload:e})}function Uy(e){if("string"!=typeof e)throw new Error("Notification id must be of type string");jm({type:Tm,payload:e})}function Dy(e){const t=Ma(Jg,e);if(t)throw t;const n=function(e){const{device:t}=hm;return t?e.reduce(((e,n)=>{const r=n({device:t});return r&&e.push(...Array.isArray(r)?r:[r]),e}),[]):[]}(e),r=(s=n).filter(((e,t)=>e&&s.findIndex((t=>t&&t.label===e.label))===t));var s;jm({type:_m,payload:r})}function zy(e){const t=Ma(Wg,e);if(t)throw t;jm({type:Mm,payload:e})}function Hy(e){const t=Sy(e);if(t)throw t;const n=Og(e);n&&Rg(n)}function Gy(e){const t=Ma(Yg,e);if(t)throw t;jm({type:Om,payload:e})}function qy(e){jm({type:Nm,payload:e})}async function $y(e){if(e){const t=Ma(hy,e);if(t)throw t}const{chains:t}=Lm.get();if(!t.length)throw new Error("At least one chain must be set before attempting to connect a wallet");let{autoSelect:n}=e||{};n||(n={label:"",disableModals:!1}),n&&("string"==typeof n||n.label)&&await cm(50),Lm.get().walletModules.length||Dy(hm.initialWalletInit),Cg.next({autoSelect:"string"==typeof n?{label:n,disableModals:!1}:n,inProgress:!0});return ge(Cg.pipe(Te((({inProgress:e,actionRequired:t})=>!1===e&&!t)),Ge(_g),Fe(1)))}var Vy={connect:{selectingWallet:{header:"Available Wallets",sidebar:{heading:"",subheading:"Connect your wallet",paragraph:"Connecting your wallet is like “logging in” to Web3. Select your wallet from the options to get started.",IDontHaveAWallet:"I don't have a wallet"},recommendedWalletsPart1:"{app} only supports",recommendedWalletsPart2:"on this platform. Please use or install one of the supported wallets to continue",installWallet:"You do not have any wallets installed that {app} supports, please use a supported wallet",agreement:{agree:"I agree to the",terms:"Terms & Conditions",and:"and",privacy:"Privacy Policy"},whyDontISeeMyWallet:"Why don't I see my wallet?",learnMore:"Click here to learn more"},connectingWallet:{header:"{connectionRejected, select, false {Connecting to {wallet}...} other {Connection Rejected}}",sidebar:{subheading:"Approve Connection",paragraph:"Please approve the connection in your wallet and authorize access to continue."},mainText:"Connecting...",paragraph:"Make sure to select all accounts that you want to grant access to.",previousConnection:"{wallet} already has a pending connection request, please open the {wallet} app to login and connect.",rejectedText:"Connection Rejected!",rejectedCTA:"Click here to try again",primaryButton:"Back to wallets"},connectedWallet:{header:"Connection Successful",sidebar:{subheading:"Connection Successful!",paragraph:"Your wallet is now connected to {app}"},mainText:"Connected"}},modals:{actionRequired:{heading:"Action required in {wallet}",paragraph:"Please switch the active account in your wallet.",linkText:"Learn more.",buttonText:"Okay"},switchChain:{heading:"Switch Chain",paragraph1:"{app} requires that you switch your wallet to the {nextNetworkName} network to continue.",paragraph2:"*Some wallets may not support changing networks. If you can not change networks in your wallet you may consider switching to a different wallet."},confirmDisconnectAll:{heading:"Disconnect all Wallets",description:"Are you sure that you would like to disconnect all your wallets?",confirm:"Confirm",cancel:"Cancel"},confirmTransactionProtection:{heading:"Enable Transaction Protection",description:"Protect RPC endpoints hide your transaction from front-running and sandwich bots.",link:"Learn more",enable:"Enable",dismiss:"Dismiss"}},accountCenter:{connectAnotherWallet:"Connect another Wallet",disconnectAllWallets:"Disconnect all Wallets",currentNetwork:"Current Network",enableTransactionProtection:"Enable Transaction Protection",appInfo:"App Info",learnMore:"Learn More",gettingStartedGuide:"Getting Started Guide",smartContracts:"Smart Contract(s)",explore:"Explore",poweredBy:"powered by",addAccount:"Add Account",setPrimaryAccount:"Set Primary Account",disconnectWallet:"Disconnect Wallet",copyAddress:"Copy Wallet address"},notify:{transaction:{txRequest:"Your transaction is waiting for you to confirm",nsfFail:"You have insufficient funds for this transaction",txUnderpriced:"The gas price for your transaction is too low, try a higher gas price",txRepeat:"This could be a repeat transaction",txAwaitingApproval:"You have a previous transaction waiting for you to confirm",txConfirmReminder:"Please confirm your transaction to continue",txSendFail:"You rejected the transaction",txSent:"Your transaction has been sent to the network",txStallPending:"Your transaction has stalled before it was sent, please try again",txStuck:"Your transaction is stuck due to a nonce gap",txPool:"Your transaction has started",txStallConfirmed:"Your transaction has stalled and hasn't been confirmed",txSpeedUp:"Your transaction has been sped up",txCancel:"Your transaction is being canceled",txFailed:"Your transaction has failed",txConfirmed:"Your transaction has succeeded",txError:"Oops something went wrong, please try again",txReplaceError:"There was an error replacing your transaction, please try again"},watched:{txPool:"Your account is {verb} {formattedValue} {asset} {preposition} {counterpartyShortened}",txSpeedUp:"Transaction for {formattedValue} {asset} {preposition} {counterpartyShortened} has been sped up",txCancel:"Transaction for {formattedValue} {asset} {preposition} {counterpartyShortened} has been canceled",txConfirmed:"Your account successfully {verb} {formattedValue} {asset} {preposition} {counterpartyShortened}",txFailed:"Your account failed to {verb} {formattedValue} {asset} {preposition} {counterpartyShortened}",txStuck:"Your transaction is stuck due to a nonce gap"},time:{minutes:"min",seconds:"sec"}}};const Wy={};function Zy(e){return e.request({method:"eth_requestAccounts"})}function Qy(e){return e.request({method:"eth_chainId"})}function Ky(e){const{provider:t,disconnected$:n}=e;return Ie((e=>{t.on("accountsChanged",e)}),(e=>{t.removeListener("accountsChanged",e)})).pipe(He(n))}function Yy(e,t){const n=Ag.pipe(Te((e=>e===t)),Me(1)),r=Ky({provider:e,disconnected$:n}).pipe(je());r.subscribe((async([e])=>{var n;try{await async function(e){const t=Lm.get().wallets.find((t=>t.label===e));if(!t)return;const n=await async function(e){try{const t=await e.request({method:"wallet_getPermissions"});return Array.isArray(t)?t:[]}catch(e){return[]}}(t.provider),r=n.find((({parentCapability:e})=>"eth_accounts"===e));if(r){const{value:e}=r.caveats.find((({type:e})=>"restrictReturnedAccounts"===e))||{value:null};if(e){const n=t.accounts.filter((({address:t})=>e.includes(t)));Ty(t.label,Object.assign(Object.assign({},t),{accounts:n}))}}}(t)}catch(e){console.warn("Web3Onboard: Error whilst trying to sync connected accounts:",e)}if(!e)return void hv({label:t});const{wallets:r}=Lm.get(),s=r.find((e=>e.label===t)),i=s?s.accounts:[],[[a],o]=Ua(i,(t=>t.address===e));if(Ty(t,{accounts:[a||{address:e,ens:null,uns:null,balance:null},...o]}),Lm.get().notify.enabled&&!a){const r=await dv();if(r){const s=Lm.get().wallets.find((e=>e.label===t));try{s&&r.subscribe({id:e,chainId:null===(n=s.chains[0])||void 0===n?void 0:n.id,type:"account"})}catch(e){}}}})),r.pipe(ze((async([e])=>{if(!e)return;const{wallets:n,chains:r}=Lm.get(),s=n.find((e=>e.label===t));if(!s)return;const{chains:i,accounts:a}=s,[o]=i,c=r.find((({namespace:e,id:t})=>"evm"===e&&t===o.id));if(!c)return;const l=ev(e,c),u=iv(e,c),d=a.find((t=>t.address===e)),h=r.find((({id:e})=>e===em(o.id))),p=d&&d.ens?Promise.resolve(d.ens):h?Jy(e,h):Promise.resolve(null),f=d&&d.uns?Promise.resolve(d.uns):h?Xy(e,h):Promise.resolve(null);return Promise.all([Promise.resolve(e),l,p,f,u])}))).subscribe((e=>{if(!e)return;const[n,r,s,i,a]=e;Oy(t,n,{balance:r,ens:s,uns:i,secondaryTokens:a})}));const s=function(e){const{provider:t,disconnected$:n}=e;return Ie((e=>{t.on("chainChanged",e)}),(e=>{t.removeListener("chainChanged",e)})).pipe(He(n))}({provider:e,disconnected$:n}).pipe(je());s.subscribe((async e=>{const{wallets:n}=Lm.get(),r=n.find((e=>e.label===t));if(!r)return;const{chains:s,accounts:i}=r,[a]=s;if(Va(e)||(e=Oo(e)),e===a.id)return;if(Lm.get().notify.enabled){const n=await dv();if(n){const r=Lm.get().wallets.find((e=>e.label===t));if(!r)return;r.accounts.forEach((({address:e})=>{n.unsubscribe({id:e,chainId:r.chains[0].id,timeout:6e4})})),r.accounts.forEach((({address:t})=>{try{n.subscribe({id:t,chainId:e,type:"account"})}catch(e){}}))}}const o=i.map((({address:e})=>({address:e,ens:null,uns:null,balance:null})));Ty(t,{chains:[{namespace:"evm",id:e}],accounts:o})})),s.pipe(ze((async e=>{const{wallets:n,chains:r}=Lm.get(),s=n.find((e=>e.label===t)),i=(null==s?void 0:s.accounts)||[];Va(e)||(e=Oo(e));const a=r.find((({namespace:t,id:n})=>"evm"===t&&n===e));return a?Promise.all(i.map((async({address:t})=>{const n=ev(t,a),s=iv(t,a),i=r.find((({id:t})=>t===em(e))),o=i?Jy(t,i):Promise.resolve(null),c=i?Xy(t,i):Promise.resolve(null),[l,u,d,h]=await Promise.all([n,o,c,s]);return{address:t,balance:l,ens:u,uns:d,secondaryTokens:h}}))):Promise.resolve(null)}))).subscribe((e=>{e&&Ty(t,{accounts:e})})),n.subscribe((()=>{e.disconnect&&e.disconnect()}))}async function Jy(e,t){if(!t)return null;const n=await async function(e){if(!e)return null;if(!Wy[e.rpcUrl]){const t=await tm(e.id);if(!t)return null;const{createPublicClient:n,http:r}=await Promise.resolve().then((function(){return Tf})),s=n({chain:t,transport:r()});Wy[e.rpcUrl]=s}return Wy[e.rpcUrl]}(t);if(!n)return null;try{const t=await n.getEnsName({address:e});let r=null;if(t){const{labelhash:e,normalize:s}=await Promise.resolve().then((function(){return Spe})).then((function(e){return e.i})),i=s(t),a=await n.getEnsResolver({name:i}),o=await n.getEnsAvatar({name:i}),c=e(i),l=async e=>await n.getEnsText({name:t,key:e});r={name:t,avatar:o,contentHash:c,ensResolver:a,getText:l}}return r}catch(e){return console.error(e),null}}async function Xy(e,t){const{unstoppableResolution:n}=hm;if(!n||!Aa()||!t)return null;try{return await n(e)}catch(e){return console.error(e),null}}async function ev(e,t){if(!t)return null;const{wallets:n}=Lm.get();try{const r=n.find((e=>!!e.provider));if(!r)return null;const s=r.provider,i=await s.request({method:"eth_getBalance",params:[e,"latest"]});return i?{[t.token||"eth"]:Ca(i)}:null}catch(e){return console.error(e),null}}function tv(e,t){return e.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}function nv(e,t){return e.request({method:"wallet_addEthereumChain",params:[{chainId:t.id,chainName:t.label,nativeCurrency:{name:t.label,symbol:t.token,decimals:18},rpcUrls:[t.publicRpcUrl||t.rpcUrl],blockExplorerUrls:t.blockExplorerUrl?[t.blockExplorerUrl]:void 0}]})}const rv=async(e,t)=>{try{const{id:n}=t;return await nv(e,t),await tv(e,n),n}catch(e){return}};async function sv(e){const{wallets:t,chains:n}=Lm.get(),r=await Promise.all(t.map((async t=>{const r=n.find((({id:e})=>e===t.chains[0].id));if(!r)return;const s=await Promise.all(t.accounts.map((async t=>{const n=await iv(t.address,r);if(!e||e.some((e=>e.toLowerCase()===t.address.toLowerCase()))){const e=await ev(t.address,r);return Object.assign(Object.assign({},t),{balance:e,secondaryTokens:n})}return Object.assign(Object.assign({},t),{secondaryTokens:n})})));return Object.assign(Object.assign({},t),{accounts:s})})));zy(r)}const iv=async(e,t)=>{if(!t)return[];const n=t.rpcUrl;if(!t.secondaryTokens||!t.secondaryTokens.length||!n)return[];const r=await Promise.all(t.secondaryTokens.map((async r=>{try{const{createPublicClient:s,http:i}=await Promise.resolve().then((function(){return Tf})),a=s({chain:await Ba(t),transport:i(t.providerConnectionInfo&&t.providerConnectionInfo.url?t.providerConnectionInfo.url:n)}),o={abi:[{inputs:[{name:"owner",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],stateMutability:"view",type:"function"}],address:r.address},c=a.readContract(Object.assign(Object.assign({},o),{functionName:"balanceOf",args:[e]}))||"",l=a.readContract(Object.assign(Object.assign({},o),{functionName:"symbol",args:[]}))||"",[u,d]=await Promise.all([c,l]);return{name:d,balance:Pa(u.toString()),icon:r.icon}}catch(e){console.error(`There was an error fetching balance and/or symbol \n for token contract: ${r.address} - ${e}`)}})));return r};function av(e){const t=Lm.get().notify.transactionHandler(e),n=Ma(wy,t);if(n)throw n;if("txConfirmed"===e.eventCode){sv([e.watchedAddress,e.counterparty].filter(Boolean))}const r=function(e,t){const{id:n,hash:r,startTime:s,eventCode:i,direction:a,counterparty:o,value:c,asset:l,network:u}=e,d=ov(i),h=`${n||r}-${"object"==typeof t&&t.eventCode||i}`,p=o&&o.substring(0,4)+"..."+o.substring(o.length-4),f=Pa(c),m=o&&c?{messageId:`notify.watched['${i}']`,values:{verb:"txConfirmed"===i?"incoming"===a?"received":"sent":"incoming"===a?"receiving":"sending",formattedValue:f,preposition:"incoming"===a?"from":"to",counterpartyShortened:p,asset:l}}:{messageId:`notify.transaction['${i}']`,values:{formattedValue:f,asset:l}},b=function(e){let t;return Ye(e,(e=>t=e))(),t}(Rr),g=Vy.notify,y=g[o?"watched":"transaction"][i],v=b(m.messageId,{values:m.values,default:y});let w={id:n||r,type:d,key:h,network:u,startTime:s||Date.now(),eventCode:i,message:v,autoDismiss:cv("object"==typeof t&&t.type||d)};"object"==typeof t&&(w=Object.assign(Object.assign({},w),t));return w}(e,t);jy(r),function(e){const t=Sg.getValue(),n=t.findIndex((({hash:t})=>t===e.hash));if(-1!==n){const r=t.map(((t,r)=>r===n?e:t));Sg.next(r)}else Sg.next([...t,e])}(e)}function ov(e){switch(e){case"txSent":case"txPool":return"pending";case"txSpeedUp":case"txCancel":case"txRequest":case"txRepeat":case"txAwaitingApproval":case"txConfirmReminder":case"txStuck":default:return"hint";case"txError":case"txSendFail":case"txFailed":case"txDropped":case"nsfFail":case"txUnderpriced":return"error";case"txConfirmed":return"success"}}function cv(e){switch(e){case"success":case"hint":return 4e3;default:return 0}}let lv,uv;async function dv(){var e;const{apiKey:t}=hm;if(!t)return null;if(!lv){const{default:t}=await Promise.resolve().then((function(){return ove}));lv=t.multichain({apiKey:null!==(e=hm.apiKey)&&void 0!==e?e:""}),lv.transactions$.subscribe(av)}return lv}async function hv(e){const t=Ma(py,e);if(t)throw t;const{label:n}=e;if(Lm.get().notify.enabled){const e=await dv();if(e){const t=Lm.get().wallets.find((e=>e.label===n));t&&t.accounts.forEach((({address:n})=>{e.unsubscribe({id:n,chainId:t.chains[0].id,timeout:6e4})}))}}const{wagmi:r}=hm;if(r){const e=await r.wagmiDisconnectWallet(n);e&&qy(e)}Ag.next(n),function(e){const t=ky(e,"wallet id");if(t)throw t;jm({type:Em,payload:{id:e}})}(n);const s=lm(mm.LAST_CONNECTED_WALLET);if(s)try{const e=JSON.parse(s);Array.isArray(e)&&e.indexOf(n)>=0&&um(mm.LAST_CONNECTED_WALLET,JSON.stringify(e.filter((e=>e!==n)))),"string"==typeof e&&e===n&&dm(mm.LAST_CONNECTED_WALLET)}catch(e){console.error(`There was an error disconnecting the last connected wallet from localStorage - Error: ${e}`)}return Lm.get().wallets}async function pv(e){const t=Ey(e);if(t)throw t;const{wallets:n,chains:r}=Lm.get(),{chainId:s,chainNamespace:i="evm",wallet:a,rpcUrl:o,label:c,token:l}=e,u=Yf(s),d=r.find((({namespace:e,id:t})=>e===i&&t.toLowerCase()===u.toLowerCase()));if(!d)throw new Error(`Chain with chainId: ${s} and chainNamespace: ${i} has not been set and must be added when Onboard is initialized.`);const h=a?n.find((({label:e})=>e===a)):n[0];if(!h)throw new Error(a?`Wallet with label ${a} is not connected`:"A wallet must be connected before a chain can be set");const[p]=h.chains;if(p.namespace===i&&p.id===u)return!0;try{return await tv(h.provider,u),!0}catch(t){const{code:e}=t,n=Pg.pipe(Te((e=>null===e)),ye((()=>!1)));if(e===Ta.CHAIN_NOT_ADDED||e===Ta.UNRECOGNIZED_CHAIN_ID)return(o||c||l)&&(o&&(d.rpcUrl=o),c&&(d.label=c),l&&(d.token=l),Iy(d)),fv(h,d,n,u);if(e===Ta.UNSUPPORTED_METHOD)return Pg.next({chain:d}),ge(n)}return!1}const fv=async(e,t,n,r)=>{try{return await nv(e.provider,t),await tv(e.provider,r),!0}catch(e){const{code:r}=e;return r!==Ta.ACCOUNT_ACCESS_REJECTED&&(Pg.next({chain:t}),ge(n))}};function mv(e){lb(e,"svelte-1ubf722",".close-button.svelte-1ubf722.svelte-1ubf722{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;height:2rem;width:2rem;border-radius:2rem;cursor:pointer;color:var(--onboard-close-button-color, inherit)}.close-button.svelte-1ubf722.svelte-1ubf722:hover::before{opacity:0.2}.close-button.svelte-1ubf722:hover .svg-box.svelte-1ubf722{opacity:1}.close-button.svelte-1ubf722.svelte-1ubf722::before{content:'';position:absolute;height:inherit;width:inherit;opacity:0.1;background:currentColor;transition:300ms ease-in-out opacity}.svg-box.svelte-1ubf722.svelte-1ubf722{position:absolute;height:1.5rem;width:1.5rem;opacity:0.6;transition:300ms ease-in-out opacity}")}function bv(e){let t,n;return{c(){t=bb("div"),n=bb("div"),kb(n,"class","svg-box svelte-1ubf722"),kb(t,"class","close-button svelte-1ubf722")},m(e,r){pb(e,t,r),cb(t,n),n.innerHTML='\n \n \n \n'},p:Um,i:Um,o:Um,d(e){e&&fb(t)}}}class gv extends kg{constructor(e){super(),xg(this,e,null,bv,$m,{},mv)}}function yv(e){const t=e-1;return t*t*t+1}function vv(e){return Math.pow(e-1,3)*(1-e)+1}function wv(e,{delay:t=0,duration:n=400,easing:r=Dm}={}){const s=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:r,css:e=>"opacity: "+e*s}}function xv(e,{delay:t=0,duration:n=400,easing:r=yv,x:s=0,y:i=0,opacity:a=0}={}){const o=getComputedStyle(e),c=+o.opacity,l="none"===o.transform?"":o.transform,u=c*(1-a),[d,h]=tb(s),[p,f]=tb(i);return{delay:t,duration:n,easing:r,css:(e,t)=>`\n\t\t\ttransform: ${l} translate(${(1-e)*d}${h}, ${(1-e)*p}${f});\n\t\t\topacity: ${c-u*t}`}}function kv(e,{delay:t=0,duration:n=400,easing:r=yv,axis:s="y"}={}){const i=getComputedStyle(e),a=+i.opacity,o="y"===s?"height":"width",c=parseFloat(i[o]),l="y"===s?["top","bottom"]:["left","right"],u=l.map((e=>`${e[0].toUpperCase()}${e.slice(1)}`)),d=parseFloat(i[`padding${u[0]}`]),h=parseFloat(i[`padding${u[1]}`]),p=parseFloat(i[`margin${u[0]}`]),f=parseFloat(i[`margin${u[1]}`]),m=parseFloat(i[`border${u[0]}Width`]),b=parseFloat(i[`border${u[1]}Width`]);return{delay:t,duration:n,easing:r,css:e=>`overflow: hidden;opacity: ${Math.min(20*e,1)*a};${o}: ${e*c}px;padding-${l[0]}: ${e*d}px;padding-${l[1]}: ${e*h}px;margin-${l[0]}: ${e*p}px;margin-${l[1]}: ${e*f}px;border-${l[0]}-width: ${e*m}px;border-${l[1]}-width: ${e*b}px;`}}function Ev(e){lb(e,"svelte-7ee2g7","section.svelte-7ee2g7{top:0;left:0;pointer-events:none;z-index:var(--onboard-modal-z-index, var(--modal-z-index))}.background.svelte-7ee2g7{background:var(--onboard-modal-backdrop, var(--modal-backdrop));pointer-events:all}.full-screen-background.svelte-7ee2g7{width:100vw;height:100vh;height:100dvh}.max-height.svelte-7ee2g7{max-height:calc(100vh - 2rem)}.modal-position.svelte-7ee2g7{top:var(--onboard-modal-top, var(--modal-top));bottom:var(--onboard-modal-bottom, var(--modal-bottom));left:var(--onboard-modal-left, var(--modal-left));right:var(--onboard-modal-right, var(--modal-right))}.modal-overflow.svelte-7ee2g7{overflow:hidden}.modal-styling.svelte-7ee2g7{--border-radius:var(\n --onboard-modal-border-radius,\n var(--w3o-border-radius, 1rem)\n );border-radius:var(--border-radius) var(--border-radius) 0 0;box-shadow:var(--onboard-modal-box-shadow, var(--box-shadow-0));max-width:100vw}.modal.svelte-7ee2g7{overflow-y:auto;background:var(--onboard-modal-background, white);color:var(--onboard-modal-color, initial)}.width-100.svelte-7ee2g7{width:100%}.modal-container-mobile.svelte-7ee2g7{bottom:0}@media all and (min-width: 768px){.modal-styling.svelte-7ee2g7{border-radius:var(--border-radius)}.modal-container-mobile.svelte-7ee2g7{bottom:unset;margin:1rem}.width-100.svelte-7ee2g7{width:unset}}")}function Av(e){let t,n,r,s,i,a,o,c,l,u;const d=e[3].default,h=Qm(d,e,e[2],null);return{c(){t=bb("section"),n=bb("div"),r=bb("div"),s=bb("div"),i=bb("div"),a=bb("div"),h&&h.c(),kb(a,"class","modal relative svelte-7ee2g7"),kb(i,"class","modal-overflow modal-styling relative flex justify-center svelte-7ee2g7"),kb(i,"style",""+(e[1]?"max-width: 100%;":"")),kb(s,"class","flex relative max-height svelte-7ee2g7"),Pb(s,"width-100",e[1]),kb(r,"class","modal-container-mobile modal-position flex svelte-7ee2g7"),Pb(r,"absolute",!e[1]),Pb(r,"width-100",e[1]),kb(n,"class","background flex items-center justify-center relative svelte-7ee2g7"),Pb(n,"full-screen-background",!e[1]),kb(t,"class","svelte-7ee2g7"),Pb(t,"fixed",!e[1])},m(o,d){pb(o,t,d),cb(t,n),cb(n,r),cb(r,s),cb(s,i),cb(i,a),h&&h.m(a,null),c=!0,l||(u=[wb(s,"click",xb(e[4])),wb(n,"click",(function(){qm(e[0])&&e[0].apply(this,arguments)}))],l=!0)},p(t,[n]){e=t,h&&h.p&&(!c||4&n)&&Jm(h,d,e,e[2],c?Ym(d,e[2],n,null):Xm(e[2]),null)},i(e){c||(sg(h,e),$b((()=>{c&&(o||(o=lg(t,wv,{},!0)),o.run(1))})),c=!0)},o(e){ig(h,e),o||(o=lg(t,wv,{},!1)),o.run(0),c=!1},d(e){e&&fb(t),h&&h.d(e),e&&o&&o.end(),l=!1,Gm(u)}}}function Cv(e,t,n){let{$$slots:r={},$$scope:s}=t;const i=!!hm.containerElements.connectModal,a=document.documentElement;var o;o=()=>{i||(a.style.position="sticky",a.style.overflow="hidden")},Fb().$$.on_mount.push(o),jb((()=>{i||(a.style.position="",a.style.removeProperty("overflow"))}));let{close:c}=t;return e.$$set=e=>{"close"in e&&n(0,c=e.close),"$$scope"in e&&n(2,s=e.$$scope)},[c,i,s,r,function(t){Lb.call(this,e,t)}]}class Pv extends kg{constructor(e){super(),xg(this,e,Cv,Av,$m,{close:0},Ev)}}function _v(e){lb(e,"svelte-tz7ru1",".container.svelte-tz7ru1{padding:var(--onboard-spacing-4, var(--spacing-4));font-size:var(--onboard-font-size-6, var(--font-size-6));line-height:24px}input.svelte-tz7ru1{height:1rem;width:1rem;margin-right:0.5rem}")}function Sv(e){let t,n,r,s,i,a,o,c,l,u,d,h,p=e[1]("connect.selectingWallet.agreement.agree")+"",f=e[3]&&function(e){let t,n,r,s=e[1]("connect.selectingWallet.agreement.terms")+"",i=e[4]?" "+e[1]("connect.selectingWallet.agreement.and")+" ":".";return{c(){t=bb("a"),n=gb(s),r=gb(i),kb(t,"href",e[3]),kb(t,"target","_blank")},m(e,s){pb(e,t,s),cb(t,n),pb(e,r,s)},p(e,t){2&t&&s!==(s=e[1]("connect.selectingWallet.agreement.terms")+"")&&Eb(n,s),2&t&&i!==(i=e[4]?" "+e[1]("connect.selectingWallet.agreement.and")+" ":".")&&Eb(r,i)},d(e){e&&fb(t),e&&fb(r)}}}(e),m=e[4]&&function(e){let t,n,r,s=e[1]("connect.selectingWallet.agreement.privacy")+"";return{c(){t=bb("a"),n=gb(s),r=gb("."),kb(t,"href",e[4]),kb(t,"target","_blank")},m(e,s){pb(e,t,s),cb(t,n),pb(e,r,s)},p(e,t){2&t&&s!==(s=e[1]("connect.selectingWallet.agreement.privacy")+"")&&Eb(n,s)},d(e){e&&fb(t),e&&fb(r)}}}(e);return{c(){t=bb("div"),n=bb("label"),r=bb("input"),s=yb(),i=bb("span"),a=gb(p),o=yb(),c=gb(" "),l=yb(),f&&f.c(),u=yb(),m&&m.c(),kb(r,"class"," svelte-tz7ru1"),kb(r,"type","checkbox"),kb(n,"class","flex"),kb(t,"class","container flex items-center svelte-tz7ru1")},m(p,b){pb(p,t,b),cb(t,n),cb(n,r),r.checked=e[0],cb(n,s),cb(n,i),cb(i,a),cb(i,o),cb(i,c),cb(i,l),f&&f.m(i,null),cb(i,u),m&&m.m(i,null),d||(h=wb(r,"change",e[6]),d=!0)},p(e,t){1&t&&(r.checked=e[0]),2&t&&p!==(p=e[1]("connect.selectingWallet.agreement.agree")+"")&&Eb(a,p),e[3]&&f.p(e,t),e[4]&&m.p(e,t)},d(e){e&&fb(t),f&&f.d(),m&&m.d(),d=!1,h()}}}function Iv(e){let t,n=e[5]&&Sv(e);return{c(){n&&n.c(),t=vb()},m(e,r){n&&n.m(e,r),pb(e,t,r)},p(e,[t]){e[5]&&n.p(e,t)},i:Um,o:Um,d(e){n&&n.d(e),e&&fb(t)}}}function Bv(e,t,n){let r,s;Zm(e,Rr,(e=>n(1,s=e)));let{agreed:i}=t;const{terms:a,privacy:o,version:c}=JSON.parse(lm(mm.TERMS_AGREEMENT)||"{}"),l=Lm.select("appMetadata").pipe(De(Lm.get().appMetadata),Ue(1));Zm(e,l,(e=>n(7,r=e)));const{termsUrl:u,privacyUrl:d,version:h}=r&&r.agreement||{termsUrl:"",privacyUrl:"",version:""},p=!!(u&&!a||d&&!o||h&&h!==c);return i=!p,e.$$set=e=>{"agreed"in e&&n(0,i=e.agreed)},e.$$.update=()=>{1&e.$$.dirty&&(i?um(mm.TERMS_AGREEMENT,JSON.stringify({version:h,terms:!!u,privacy:!!d})):!1===i&&dm(mm.TERMS_AGREEMENT))},[i,s,l,u,d,p,function(){i=this.checked,n(0,i)}]}class Tv extends kg{constructor(e){super(),xg(this,e,Bv,Iv,$m,{agreed:0},_v)}}function Mv(e){lb(e,"svelte-2btye1",".icon.svelte-2btye1{color:var(--onboard-white, var(--white));border-radius:50px;bottom:-0.25rem;right:-0.25rem}.yellow.svelte-2btye1{background:var(--onboard-warning-500, var(--warning-500))}")}function Ov(e){let t,n,r;return{c(){t=bb("div"),kb(t,"class",n=eb(`${e[2]} icon flex absolute`)+" svelte-2btye1"),kb(t,"style",r=`width: ${e[0]}px; height: ${e[0]}px; padding: ${e[0]/6}px;`),Pb(t,"yellow","yellow"===e[1])},m(e,n){pb(e,t,n),t.innerHTML='\n \n \n \n'},p(e,[s]){4&s&&n!==(n=eb(`${e[2]} icon flex absolute`)+" svelte-2btye1")&&kb(t,"class",n),1&s&&r!==(r=`width: ${e[0]}px; height: ${e[0]}px; padding: ${e[0]/6}px;`)&&kb(t,"style",r),6&s&&Pb(t,"yellow","yellow"===e[1])},i:Um,o:Um,d(e){e&&fb(t)}}}function Nv(e,t,n){let{size:r}=t,{color:s="yellow"}=t,{class:i="test"}=t;return e.$$set=e=>{"size"in e&&n(0,r=e.size),"color"in e&&n(1,s=e.color),"class"in e&&n(2,i=e.class)},[r,s,i]}class Rv extends kg{constructor(e){super(),xg(this,e,Nv,Ov,$m,{size:0,color:1,class:2},Mv)}}function Fv(e){lb(e,"svelte-1bikw7k",".icon.svelte-1bikw7k{color:var(--onboard-white, var(--white));border-radius:50px}.green.svelte-1bikw7k{background:var(--onboard-success-600, var(--success-600))}.blue.svelte-1bikw7k{background:var(--onboard-primary-1, var(--primary-1))}")}function jv(e){let t,n;return{c(){t=bb("div"),kb(t,"class","icon flex svelte-1bikw7k"),kb(t,"style",n=`width: ${e[0]}px; height: ${e[0]}px; padding: ${e[0]/5}px;`),Pb(t,"green","green"===e[1]),Pb(t,"blue","blue"===e[1])},m(e,n){pb(e,t,n),t.innerHTML=Vf},p(e,[r]){1&r&&n!==(n=`width: ${e[0]}px; height: ${e[0]}px; padding: ${e[0]/5}px;`)&&kb(t,"style",n),2&r&&Pb(t,"green","green"===e[1]),2&r&&Pb(t,"blue","blue"===e[1])},i:Um,o:Um,d(e){e&&fb(t)}}}function Lv(e,t,n){let{size:r}=t,{color:s="green"}=t;return e.$$set=e=>{"size"in e&&n(0,r=e.size),"color"in e&&n(1,s=e.color)},[r,s]}class Uv extends kg{constructor(e){super(),xg(this,e,Lv,jv,$m,{size:0,color:1},Fv)}}function Dv(e){lb(e,"svelte-1le5672",".loading-container.svelte-1le5672.svelte-1le5672{font-family:inherit;font-size:inherit;color:inherit}span.svelte-1le5672.svelte-1le5672{font-family:inherit;font-size:0.889em;margin-top:1rem}.loading.svelte-1le5672.svelte-1le5672{display:inline-block}.loading.svelte-1le5672 div.svelte-1le5672{font-size:inherit;display:block;position:absolute;border:3px solid;border-radius:50%;animation:svelte-1le5672-bn-loading 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;border-color:currentColor transparent transparent transparent}.loading.svelte-1le5672 .loading-first.svelte-1le5672{animation-delay:-0.45s}.loading.svelte-1le5672 .loading-second.svelte-1le5672{animation-delay:-0.3s}.loading.svelte-1le5672 .loading-third.svelte-1le5672{animation-delay:-0.15s}@keyframes svelte-1le5672-bn-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}")}function zv(e){let t,n;return{c(){t=bb("span"),n=gb(e[0]),kb(t,"class","svelte-1le5672")},m(e,r){pb(e,t,r),cb(t,n)},p(e,t){1&t&&Eb(n,e[0])},d(e){e&&fb(t)}}}function Hv(e){let t,n,r,s,i,a,o,c,l,u,d,h,p=e[0]&&zv(e);return{c(){t=bb("div"),n=bb("div"),r=bb("div"),i=yb(),a=bb("div"),c=yb(),l=bb("div"),h=yb(),p&&p.c(),kb(r,"class","loading-first svelte-1le5672"),kb(r,"style",s=`height: ${e[1]}; width: ${e[1]};`),kb(a,"class","loading-second svelte-1le5672"),kb(a,"style",o=`height: ${e[1]}; width: ${e[1]};`),kb(l,"class","loading-third svelte-1le5672"),kb(l,"style",u=`height: ${e[1]}; width: ${e[1]};`),kb(n,"class","loading relative svelte-1le5672"),kb(n,"style",d=`height: ${e[1]}; width: ${e[1]};`),kb(t,"class","loading-container flex flex-column justify-center items-center absolute svelte-1le5672")},m(e,s){pb(e,t,s),cb(t,n),cb(n,r),cb(n,i),cb(n,a),cb(n,c),cb(n,l),cb(t,h),p&&p.m(t,null)},p(e,[i]){2&i&&s!==(s=`height: ${e[1]}; width: ${e[1]};`)&&kb(r,"style",s),2&i&&o!==(o=`height: ${e[1]}; width: ${e[1]};`)&&kb(a,"style",o),2&i&&u!==(u=`height: ${e[1]}; width: ${e[1]};`)&&kb(l,"style",u),2&i&&d!==(d=`height: ${e[1]}; width: ${e[1]};`)&&kb(n,"style",d),e[0]?p?p.p(e,i):(p=zv(e),p.c(),p.m(t,null)):p&&(p.d(1),p=null)},i:Um,o:Um,d(e){e&&fb(t),p&&p.d()}}}function Gv(e,t,n){let{description:r=""}=t,{size:s="2rem"}=t;return e.$$set=e=>{"description"in e&&n(0,r=e.description),"size"in e&&n(1,s=e.size)},[r,s]}class qv extends kg{constructor(e){super(),xg(this,e,Gv,Hv,$m,{description:0,size:1},Dv)}}function $v(e){lb(e,"svelte-i129jl",".icon.svelte-i129jl{height:100%}.border-custom.svelte-i129jl{border:1px solid var(--border-color)}.border-yellow.svelte-i129jl{border:1px solid var(--onboard-warning-500, var(--warning-500))}.border-gray.svelte-i129jl{border:1px solid var(--onboard-gray-400, var(--gray-400))}.border-green.svelte-i129jl{border:1px solid var(--onboard-success-500, var(--success-500))}.border-dark-green.svelte-i129jl{border:1px solid var(--onboard-success-700, var(--success-700))}.border-blue.svelte-i129jl{border:1px solid\n var(\n --onboard-wallet-app-icon-border-color,\n var(--onboard-primary-300, var(--primary-300))\n )}.border-dark-blue.svelte-i129jl{border:1px solid\n var(\n --onboard-wallet-app-icon-border-color,\n var(--onboard-primary-600, var(--primary-600))\n )}.border-transparent.svelte-i129jl{border:1px solid transparent}.border-black.svelte-i129jl{border:1px solid var(--onboard-gray-600, var(--gray-600))}.background-gray.svelte-i129jl{background:var(\n --onboard-wallet-app-icon-background-gray,\n var(--onboard-gray-500, var(--gray-500))\n )}.background-light-gray.svelte-i129jl{background:var(\n --onboard-wallet-app-icon-background-light-gray,\n var(--onboard-gray-100, var(--gray-100))\n )}.background-light-blue.svelte-i129jl{background:var(\n --onboard-wallet-app-icon-background-light-blue,\n var(--onboard-primary-100, var(--primary-100))\n )}.background-green.svelte-i129jl{background:var(\n --onboard-wallet-app-icon-background-green,\n var(--onboard-success-100, var(--success-100))\n )}.background-white.svelte-i129jl{background:var(\n --onboard-wallet-app-icon-background-white,\n var(--onboard-white, var(--white))\n )}.background-transparent.svelte-i129jl{background:var(\n --onboard-wallet-app-icon-background-transparent,\n transparent\n )}@keyframes svelte-i129jl-pulse{from{opacity:0}to{opacity:1}}.placeholder-icon.svelte-i129jl{width:100%;height:100%;background:var(--onboard-gray-100, var(--gray-100));border-radius:32px;animation:svelte-i129jl-pulse infinite 750ms alternate ease-in-out}.spinner-container.svelte-i129jl{color:var(--onboard-primary-300, var(--primary-300))}img.svelte-i129jl{max-width:100%;height:auto}.pending-status-icon{z-index:1;fill:white;box-shadow:0px 2px 12px 0px rgba(0, 0, 0, 0.1)}.status-icon-container.svelte-i129jl{right:-0.25rem;bottom:-0.25rem;position:absolute}")}const Vv=e=>({}),Wv=e=>({});function Zv(e){let t,n,r,s={ctx:e,current:null,token:null,hasCatch:!1,pending:tw,then:Yv,catch:Kv,value:13,blocks:[,,,]};return ug(n=e[1],s),{c(){t=vb(),s.block.c()},m(e,n){pb(e,t,n),s.block.m(e,s.anchor=n),s.mount=()=>t.parentNode,s.anchor=t,r=!0},p(t,r){e=t,s.ctx=e,2&r&&n!==(n=e[1])&&ug(n,s)||dg(s,e,r)},i(e){r||(sg(s.block),r=!0)},o(e){for(let e=0;e<3;e+=1){ig(s.blocks[e])}r=!1},d(e){e&&fb(t),s.block.d(e),s.token=null,s=null}}}function Qv(e){let t,n,r;return n=new qv({props:{size:"2rem"}}),{c(){t=bb("div"),gg(n.$$.fragment),kb(t,"class","spinner-container svelte-i129jl")},m(e,s){pb(e,t,s),yg(n,t,null),r=!0},p:Um,i(e){r||(sg(n.$$.fragment,e),r=!0)},o(e){ig(n.$$.fragment,e),r=!1},d(e){e&&fb(t),vg(n)}}}function Kv(e){return{c:Um,m:Um,p:Um,i:Um,o:Um,d:Um}}function Yv(e){let t,n,r,s,i,a;function o(e,t){return 2&t&&(n=null),null==n&&(n=!!Zf(e[13])),n?Xv:Jv}let c=o(e,-1),l=c(e),u=e[2]&&e[9]<=bm&&ew();return{c(){t=bb("div"),l.c(),s=yb(),u&&u.c(),i=vb(),kb(t,"class","icon flex justify-center items-center svelte-i129jl")},m(e,n){pb(e,t,n),l.m(t,null),pb(e,s,n),u&&u.m(e,n),pb(e,i,n),a=!0},p(e,n){c===(c=o(e,n))&&l?l.p(e,n):(l.d(1),l=c(e),l&&(l.c(),l.m(t,null))),e[2]&&e[9]<=bm?u?516&n&&sg(u,1):(u=ew(),u.c(),sg(u,1),u.m(i.parentNode,i)):u&&(ng(),ig(u,1,1,(()=>{u=null})),rg())},i(e){a||(e&&(r||$b((()=>{r=og(t,wv,{}),r.start()}))),sg(u),a=!0)},o(e){ig(u),a=!1},d(e){e&&fb(t),l.d(),e&&fb(s),u&&u.d(e),e&&fb(i)}}}function Jv(e){let t,n;return{c(){t=bb("img"),Wm(t.src,n=e[13])||kb(t,"src",n),kb(t,"alt","logo"),kb(t,"class","svelte-i129jl")},m(e,n){pb(e,t,n)},p(e,r){2&r&&!Wm(t.src,n=e[13])&&kb(t,"src",n)},d(e){e&&fb(t)}}}function Xv(e){let t,n,r=e[13]+"";return{c(){t=new _b(!1),n=vb(),t.a=n},m(e,s){t.m(r,e,s),pb(e,n,s)},p(e,n){2&n&&r!==(r=e[13]+"")&&t.p(r)},d(e){e&&fb(n),e&&t.d()}}}function ew(e){let t,n,r;return n=new Rv({props:{class:"pending-status-icon",size:20}}),{c(){t=bb("div"),gg(n.$$.fragment),kb(t,"class","status-icon-container svelte-i129jl")},m(e,s){pb(e,t,s),yg(n,t,null),r=!0},i(e){r||(sg(n.$$.fragment,e),r=!0)},o(e){ig(n.$$.fragment,e),r=!1},d(e){e&&fb(t),vg(n)}}}function tw(e){let t;return{c(){t=bb("div"),kb(t,"class","placeholder-icon svelte-i129jl")},m(e,n){pb(e,t,n)},p:Um,i:Um,o:Um,d(e){e&&fb(t)}}}function nw(e){let t,n,r,s,i,a,o,c;$b(e[12]);const l=[Qv,Zv],u=[];function d(e,t){return e[2]&&e[9]>=bm?0:1}n=d(e),r=u[n]=l[n](e);const h=e[11].status,p=Qm(h,e,e[10],Wv);return{c(){t=bb("div"),r.c(),s=yb(),p&&p.c(),kb(t,"class","relative svelte-i129jl"),kb(t,"style",i=`${"custom"===e[6]?`background-color: ${e[7]}`:""}; padding: ${e[3]-1}px; width: ${e[0]}px; height: ${e[0]}px; border-radius: ${e[8]}px; color: ${e[4]};`),Pb(t,"border-custom","custom"===e[5]),Pb(t,"border-yellow","yellow"===e[5]),Pb(t,"border-gray","gray"===e[5]),Pb(t,"border-green","green"===e[5]),Pb(t,"border-dark-green","darkGreen"===e[5]),Pb(t,"border-blue","blue"===e[5]),Pb(t,"border-dark-blue","darkBlue"===e[5]),Pb(t,"border-transparent","transparent"===e[5]),Pb(t,"border-black","black"===e[5]),Pb(t,"background-gray","gray"===e[6]),Pb(t,"background-light-gray","lightGray"===e[6]),Pb(t,"background-light-blue","lightBlue"===e[6]),Pb(t,"background-green","green"===e[6]),Pb(t,"background-white","white"===e[6]),Pb(t,"background-transparent","transparent"===e[6])},m(r,i){pb(r,t,i),u[n].m(t,null),cb(t,s),p&&p.m(t,null),a=!0,o||(c=wb(window,"resize",e[12]),o=!0)},p(e,[o]){let c=n;n=d(e),n===c?u[n].p(e,o):(ng(),ig(u[c],1,1,(()=>{u[c]=null})),rg(),r=u[n],r?r.p(e,o):(r=u[n]=l[n](e),r.c()),sg(r,1),r.m(t,s)),p&&p.p&&(!a||1024&o)&&Jm(p,h,e,e[10],a?Ym(h,e[10],o,Vv):Xm(e[10]),Wv),(!a||473&o&&i!==(i=`${"custom"===e[6]?`background-color: ${e[7]}`:""}; padding: ${e[3]-1}px; width: ${e[0]}px; height: ${e[0]}px; border-radius: ${e[8]}px; color: ${e[4]};`))&&kb(t,"style",i),(!a||32&o)&&Pb(t,"border-custom","custom"===e[5]),(!a||32&o)&&Pb(t,"border-yellow","yellow"===e[5]),(!a||32&o)&&Pb(t,"border-gray","gray"===e[5]),(!a||32&o)&&Pb(t,"border-green","green"===e[5]),(!a||32&o)&&Pb(t,"border-dark-green","darkGreen"===e[5]),(!a||32&o)&&Pb(t,"border-blue","blue"===e[5]),(!a||32&o)&&Pb(t,"border-dark-blue","darkBlue"===e[5]),(!a||32&o)&&Pb(t,"border-transparent","transparent"===e[5]),(!a||32&o)&&Pb(t,"border-black","black"===e[5]),(!a||64&o)&&Pb(t,"background-gray","gray"===e[6]),(!a||64&o)&&Pb(t,"background-light-gray","lightGray"===e[6]),(!a||64&o)&&Pb(t,"background-light-blue","lightBlue"===e[6]),(!a||64&o)&&Pb(t,"background-green","green"===e[6]),(!a||64&o)&&Pb(t,"background-white","white"===e[6]),(!a||64&o)&&Pb(t,"background-transparent","transparent"===e[6])},i(e){a||(sg(r),sg(p,e),a=!0)},o(e){ig(r),ig(p,e),a=!1},d(e){e&&fb(t),u[n].d(),p&&p.d(e),o=!1,c()}}}function rw(e,t,n){let r,{$$slots:s={},$$scope:i}=t,{size:a}=t,{icon:o}=t,{loading:c=!1}=t,{padding:l=a/6}=t,{color:u="black"}=t,{border:d="transparent"}=t,{background:h="transparent"}=t,{customBackgroundColor:p=""}=t,{radius:f=12}=t;return e.$$set=e=>{"size"in e&&n(0,a=e.size),"icon"in e&&n(1,o=e.icon),"loading"in e&&n(2,c=e.loading),"padding"in e&&n(3,l=e.padding),"color"in e&&n(4,u=e.color),"border"in e&&n(5,d=e.border),"background"in e&&n(6,h=e.background),"customBackgroundColor"in e&&n(7,p=e.customBackgroundColor),"radius"in e&&n(8,f=e.radius),"$$scope"in e&&n(10,i=e.$$scope)},[a,o,c,l,u,d,h,p,f,r,i,s,function(){n(9,r=window.innerWidth)}]}class sw extends kg{constructor(e){super(),xg(this,e,rw,nw,$m,{size:0,icon:1,loading:2,padding:3,color:4,border:5,background:6,customBackgroundColor:7,radius:8},$v)}}function iw(e){lb(e,"svelte-q2gson",".container.svelte-q2gson{gap:1rem;padding:0.75rem;color:var(--onboard-warning-700, var(--warning-700));font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:16px;border:1px solid var(--onboard-warning-400, var(--warning-400));background:var(--onboard-warning-100, var(--warning-100));border-radius:12px}.icon.svelte-q2gson{color:var(--onboard-warning-700, var(--warning-700));width:1rem;height:1rem;flex:0 0 auto}")}function aw(e){let t,n,r,s,i,a;const o=e[1].default,c=Qm(o,e,e[0],null);return{c(){t=bb("div"),n=bb("div"),c&&c.c(),r=yb(),s=bb("div"),kb(s,"class","icon svelte-q2gson"),kb(t,"class","container flex justify-between svelte-q2gson")},m(e,i){pb(e,t,i),cb(t,n),c&&c.m(n,null),cb(t,r),cb(t,s),s.innerHTML=$f,a=!0},p(e,[t]){c&&c.p&&(!a||1&t)&&Jm(c,o,e,e[0],a?Ym(o,e[0],t,null):Xm(e[0]),null)},i(e){a||(sg(c,e),e&&(i||$b((()=>{i=og(t,kv,{delay:50,duration:500}),i.start()}))),a=!0)},o(e){ig(c,e),a=!1},d(e){e&&fb(t),c&&c.d(e)}}}function ow(e,t,n){let{$$slots:r={},$$scope:s}=t;return e.$$set=e=>{"$$scope"in e&&n(0,s=e.$$scope)},[s,r]}class cw extends kg{constructor(e){super(),xg(this,e,ow,aw,$m,{},iw)}}function lw(e){lb(e,"svelte-1kfgpsl",".container.svelte-1kfgpsl{padding:var(--onboard-spacing-4, var(--spacing-4));color:var(\n --onboard-connect-accent-text-color,\n var(--onboard-gray-700, var(--gray-700))\n )}.connecting-container.svelte-1kfgpsl{padding:var(--onboard-spacing-4, var(--spacing-4));border-radius:var(--onboard-border-radius-1, var(--border-radius-1));background:var(--onboard-success-100, var(--success-100));border:1px solid var(--onboard-success-600, var(--success-600));width:100%}.text.svelte-1kfgpsl{right:var(--onboard-spacing-5, var(--spacing-5))}.tick.svelte-1kfgpsl{color:var(--onboard-success-700, var(--success-700))}")}function uw(e){let t,n,r,s,i,a,o,c,l,u,d,h,p,f,m,b,g,y=e[2]("connect.connectedWallet.mainText",{default:Vy.connect.connectedWallet.mainText,values:{wallet:e[0].label}})+"";return i=new sw({props:{size:40,padding:8,background:e[1]&&e[1].icon?"lightBlue":"lightGray",border:"darkGreen",icon:e[1]&&e[1].icon||qf}}),c=new Uv({props:{size:17}}),d=new sw({props:{size:40,padding:8,border:"darkGreen",background:"white",icon:e[0].icon}}),{c(){t=bb("div"),n=bb("div"),r=bb("div"),s=bb("div"),gg(i.$$.fragment),a=yb(),o=bb("div"),gg(c.$$.fragment),l=yb(),u=bb("div"),gg(d.$$.fragment),h=yb(),p=bb("div"),f=gb(y),m=yb(),b=bb("div"),kb(o,"class","relative"),Ab(o,"right","1rem"),Ab(o,"top","4px"),Ab(o,"z-index","1"),kb(u,"class","relative"),Ab(u,"right","1.75rem"),kb(s,"class","flex justify-center items-end relative"),kb(p,"class","text relative svelte-1kfgpsl"),kb(r,"class","flex items-center"),kb(b,"class","tick flex items-center svelte-1kfgpsl"),Ab(b,"width","24px"),kb(n,"class","connecting-container flex justify-between items-center svelte-1kfgpsl"),kb(t,"class","container svelte-1kfgpsl")},m(e,y){pb(e,t,y),cb(t,n),cb(n,r),cb(r,s),yg(i,s,null),cb(s,a),cb(s,o),yg(c,o,null),cb(s,l),cb(s,u),yg(d,u,null),cb(r,h),cb(r,p),cb(p,f),cb(n,m),cb(n,b),b.innerHTML=Vf,g=!0},p(e,[t]){const n={};2&t&&(n.background=e[1]&&e[1].icon?"lightBlue":"lightGray"),2&t&&(n.icon=e[1]&&e[1].icon||qf),i.$set(n);const r={};1&t&&(r.icon=e[0].icon),d.$set(r),(!g||5&t)&&y!==(y=e[2]("connect.connectedWallet.mainText",{default:Vy.connect.connectedWallet.mainText,values:{wallet:e[0].label}})+"")&&Eb(f,y)},i(e){g||(sg(i.$$.fragment,e),sg(c.$$.fragment,e),sg(d.$$.fragment,e),g=!0)},o(e){ig(i.$$.fragment,e),ig(c.$$.fragment,e),ig(d.$$.fragment,e),g=!1},d(e){e&&fb(t),vg(i),vg(c),vg(d)}}}function dw(e,t,n){let r,s;Zm(e,Rr,(e=>n(2,s=e)));let{selectedWallet:i}=t;const a=Lm.select("appMetadata").pipe(De(Lm.get().appMetadata),Ue(1));return Zm(e,a,(e=>n(1,r=e))),e.$$set=e=>{"selectedWallet"in e&&n(0,i=e.selectedWallet)},[i,r,s,a]}class hw extends kg{constructor(e){super(),xg(this,e,dw,uw,$m,{selectedWallet:0},lw)}}function pw(e){lb(e,"svelte-j1ywa3",".container.svelte-j1ywa3{padding:var(--onboard-spacing-4, var(--spacing-4))}.connecting-container.svelte-j1ywa3{width:100%;padding:var(--onboard-spacing-4, var(--spacing-4));transition:background-color 100ms ease-in-out,\n border-color 100ms ease-in-out;border-radius:24px;background:var(--onboard-primary-100, var(--primary-100));border:1px solid;border-color:var(--onboard-primary-300, var(--primary-300));color:var(--onboard-gray-600, var(--gray-600))}.connecting-container.warning.svelte-j1ywa3{background:var(--onboard-warning-100, var(--warning-100));border-color:var(--onboard-warning-400, var(--warning-400))}.text.svelte-j1ywa3{line-height:16px;margin-bottom:var(--onboard-spacing-5, var(--spacing-5))}.text.text-rejected.svelte-j1ywa3{line-height:24px;margin-bottom:0}.subtext.svelte-j1ywa3{font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:16px}.rejected-cta.svelte-j1ywa3{color:var(--onboard-primary-500, var(--primary-500))}.onboard-button-primary.svelte-j1ywa3{bottom:var(--onboard-spacing-3, var(--spacing-3))}.ml.svelte-j1ywa3{margin-left:var(--onboard-spacing-4, var(--spacing-4))}@media all and (max-width: 520px){.connecting-container.svelte-j1ywa3{border-radius:var(--onboard-border-radius-4, var(--border-radius-4))}.container.svelte-j1ywa3{padding-bottom:0}.wallet-badges.svelte-j1ywa3{display:none}.connecting-wallet-info.svelte-j1ywa3{margin:0}.onboard-button-primary.svelte-j1ywa3{display:none}}")}function fw(e){let t,n,r=e[7]("connect.connectingWallet."+(e[5]?"previousConnection":"paragraph"),{default:Vy.connect.connectingWallet.paragraph,values:{wallet:e[1].label}})+"";return{c(){t=bb("div"),n=gb(r),kb(t,"class","subtext svelte-j1ywa3")},m(e,r){pb(e,t,r),cb(t,n)},p(e,t){162&t&&r!==(r=e[7]("connect.connectingWallet."+(e[5]?"previousConnection":"paragraph"),{default:Vy.connect.connectingWallet.paragraph,values:{wallet:e[1].label}})+"")&&Eb(n,r)},d(e){e&&fb(t)}}}function mw(e){let t,n,r,s,i=e[7]("connect.connectingWallet.rejectedCTA",{default:Vy.connect.connectingWallet.rejectedCTA,values:{wallet:e[1].label}})+"";return{c(){t=bb("div"),n=gb(i),kb(t,"class","rejected-cta pointer subtext svelte-j1ywa3")},m(i,a){pb(i,t,a),cb(t,n),r||(s=wb(t,"click",(function(){qm(e[0])&&e[0].apply(this,arguments)})),r=!0)},p(t,r){e=t,130&r&&i!==(i=e[7]("connect.connectingWallet.rejectedCTA",{default:Vy.connect.connectingWallet.rejectedCTA,values:{wallet:e[1].label}})+"")&&Eb(n,i)},d(e){e&&fb(t),r=!1,s()}}}function bw(e){let t,n,r,s,i,a,o,c,l,u,d,h,p,f,m,b,g,y,v,w=e[7]("connect.connectingWallet."+(e[4]?"rejectedText":"mainText"),{default:e[4]?Vy.connect.connectingWallet.rejectedText:Vy.connect.connectingWallet.mainText,values:{wallet:e[1].label}})+"",x=e[7]("connect.connectingWallet.primaryButton",{default:Vy.connect.connectingWallet.primaryButton})+"";function k(e,t){return e[4]?mw:fw}i=new sw({props:{size:40,padding:8,icon:e[6]&&e[6].icon||qf,border:e[4]||e[5]?"yellow":"blue",background:"lightGray"}}),c=new sw({props:{size:40,padding:8,border:e[4]||e[5]?"yellow":"blue",background:"white",icon:e[1].icon}});let E=k(e),A=E(e);return{c(){t=bb("div"),n=bb("div"),r=bb("div"),s=bb("div"),gg(i.$$.fragment),a=yb(),o=bb("div"),gg(c.$$.fragment),l=yb(),u=bb("div"),d=bb("div"),h=gb(w),p=yb(),A.c(),f=yb(),m=bb("button"),b=gb(x),kb(o,"class","relative"),Ab(o,"right","0.5rem"),kb(s,"class","flex justify-center relative wallet-badges svelte-j1ywa3"),kb(d,"class","text svelte-j1ywa3"),Pb(d,"text-rejected",e[4]),kb(u,"class","flex flex-column justify-center ml connecting-wallet-info svelte-j1ywa3"),kb(r,"class","flex"),kb(n,"class","connecting-container flex justify-between items-center svelte-j1ywa3"),Pb(n,"warning",e[4]||e[5]),kb(m,"class","onboard-button-primary absolute svelte-j1ywa3"),kb(t,"class","container flex flex-column items-center svelte-j1ywa3")},m(w,x){pb(w,t,x),cb(t,n),cb(n,r),cb(r,s),yg(i,s,null),cb(s,a),cb(s,o),yg(c,o,null),cb(r,l),cb(r,u),cb(u,d),cb(d,h),cb(u,p),A.m(u,null),cb(t,f),cb(t,m),cb(m,b),g=!0,y||(v=wb(m,"click",e[9]),y=!0)},p(e,[t]){const r={};64&t&&(r.icon=e[6]&&e[6].icon||qf),48&t&&(r.border=e[4]||e[5]?"yellow":"blue"),i.$set(r);const s={};48&t&&(s.border=e[4]||e[5]?"yellow":"blue"),2&t&&(s.icon=e[1].icon),c.$set(s),(!g||146&t)&&w!==(w=e[7]("connect.connectingWallet."+(e[4]?"rejectedText":"mainText"),{default:e[4]?Vy.connect.connectingWallet.rejectedText:Vy.connect.connectingWallet.mainText,values:{wallet:e[1].label}})+"")&&Eb(h,w),(!g||16&t)&&Pb(d,"text-rejected",e[4]),E===(E=k(e))&&A?A.p(e,t):(A.d(1),A=E(e),A&&(A.c(),A.m(u,null))),(!g||48&t)&&Pb(n,"warning",e[4]||e[5]),(!g||128&t)&&x!==(x=e[7]("connect.connectingWallet.primaryButton",{default:Vy.connect.connectingWallet.primaryButton})+"")&&Eb(b,x)},i(e){g||(sg(i.$$.fragment,e),sg(c.$$.fragment,e),g=!0)},o(e){ig(i.$$.fragment,e),ig(c.$$.fragment,e),g=!1},d(e){e&&fb(t),vg(i),vg(c),A.d(),y=!1,v()}}}function gw(e,t,n){let r,s;Zm(e,Rr,(e=>n(7,s=e)));let{connectWallet:i}=t,{selectedWallet:a}=t,{deselectWallet:o}=t,{setStep:c}=t,{connectionRejected:l}=t,{previousConnectionRequest:u}=t;const d=Lm.select("appMetadata").pipe(De(Lm.get().appMetadata),Ue(1));Zm(e,d,(e=>n(6,r=e)));return e.$$set=e=>{"connectWallet"in e&&n(0,i=e.connectWallet),"selectedWallet"in e&&n(1,a=e.selectedWallet),"deselectWallet"in e&&n(2,o=e.deselectWallet),"setStep"in e&&n(3,c=e.setStep),"connectionRejected"in e&&n(4,l=e.connectionRejected),"previousConnectionRequest"in e&&n(5,u=e.previousConnectionRequest)},[i,a,o,c,l,u,r,s,d,()=>{o(a.label),c("selectingWallet")}]}class yw extends kg{constructor(e){super(),xg(this,e,gw,bw,$m,{connectWallet:0,selectedWallet:1,deselectWallet:2,setStep:3,connectionRejected:4,previousConnectionRequest:5},pw)}}function vw(e){lb(e,"svelte-1uy2ffh",".outer-container.svelte-1uy2ffh{padding:var(--onboard-spacing-4, var(--spacing-4))}.link.svelte-1uy2ffh{font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:16px;color:var(--onboard-primary-500, var(--primary-500));text-decoration:none}")}function ww(e,t,n){const r=e.slice();return r[3]=t[n].name,r[4]=t[n].url,r[6]=n,r}function xw(e){let t,n=e[1]("connect.selectingWallet.installWallet",{default:Vy.connect.selectingWallet.installWallet,values:{app:e[0].name||"this app"}})+"";return{c(){t=gb(n)},m(e,n){pb(e,t,n)},p(e,r){3&r&&n!==(n=e[1]("connect.selectingWallet.installWallet",{default:Vy.connect.selectingWallet.installWallet,values:{app:e[0].name||"this app"}})+"")&&Eb(t,n)},d(e){e&&fb(t)}}}function kw(e){let t,n,r,s,i=e[1]("connect.selectingWallet.recommendedWalletsPart1",{default:Vy.connect.selectingWallet.recommendedWalletsPart1,values:{app:e[0].name||"This app"}})+"",a=e[1]("connect.selectingWallet.recommendedWalletsPart2",{default:Vy.connect.selectingWallet.recommendedWalletsPart2})+"",o=e[0].recommendedInjectedWallets,c=[];for(let t=0;tn(1,s=e)));const i=Lm.select("appMetadata").pipe(De(Lm.get().appMetadata),Ue(1));return Zm(e,i,(e=>n(0,r=e))),[r,s,i]}class _w extends kg{constructor(e){super(),xg(this,e,Pw,Cw,$m,{},vw)}}function Sw(e){lb(e,"svelte-1ct6vh0","button.svelte-1ct6vh0:disabled{opacity:0.5}button.wallet-button-styling.svelte-1ct6vh0{position:relative;align-items:flex-start;flex:1;padding:0;background:none;color:var(--onboard-wallet-button-color, inherit)}.wallet-button-container.svelte-1ct6vh0{display:flex}.wallet-button-container-inner.svelte-1ct6vh0{position:relative;display:flex;flex-flow:column;align-items:center;gap:0.5rem;padding:0.75rem;width:5rem}.name.svelte-1ct6vh0{font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:1rem;text-overflow:ellipsis;max-width:5rem;max-height:2rem;overflow:hidden}.status-icon.svelte-1ct6vh0{position:absolute;top:3.5rem;left:3.5rem}@media screen and (min-width: 768px){button.wallet-button-styling.svelte-1ct6vh0{transition:background-color 250ms ease-in-out;background:var(--onboard-wallet-button-background, none);border:1px solid transparent;border-color:var(--onboard-wallet-button-border-color, var(--border-color));border-radius:var(--onboard-wallet-button-border-radius, var(--border-radius-1))}button.wallet-button-styling.svelte-1ct6vh0:hover{background:var(--onboard-wallet-button-background-hover, var(--foreground-color));color:var(--onboard-wallet-button-color-hover)}.wallet-button-container-inner.svelte-1ct6vh0{flex:1;flex-flow:row nowrap;gap:1rem;padding:1rem}button.connected.svelte-1ct6vh0{border-color:var(--onboard-success-500, var(--success-500))}.name.svelte-1ct6vh0{font-size:var(--onboard-font-size-5, var(--font-size-5));line-height:1.25rem;text-align:initial;max-width:inherit;max-height:3rem}.status-icon.svelte-1ct6vh0{top:0;bottom:0;left:auto;right:1rem;margin:auto;height:20px}}")}function Iw(e){let t,n,r;return n=new Uv({props:{size:20}}),{c(){t=bb("div"),gg(n.$$.fragment),kb(t,"class","status-icon svelte-1ct6vh0")},m(e,s){pb(e,t,s),yg(n,t,null),r=!0},i(e){r||(sg(n.$$.fragment,e),r=!0)},o(e){ig(n.$$.fragment,e),r=!1},d(e){e&&fb(t),vg(n)}}}function Bw(e){let t,n,r,s,i,a,o,c,l,u,d,h;$b(e[7]),s=new sw({props:{size:e[6]>=bm?48:56,icon:e[0],loading:e[4],border:e[3]?"green":"custom",background:"transparent"}});let p=e[3]&&Iw();return{c(){t=bb("div"),n=bb("button"),r=bb("div"),gg(s.$$.fragment),i=yb(),a=bb("div"),o=gb(e[1]),c=yb(),p&&p.c(),kb(a,"class","name svelte-1ct6vh0"),kb(r,"class","wallet-button-container-inner svelte-1ct6vh0"),kb(n,"class","wallet-button-styling svelte-1ct6vh0"),n.disabled=e[5],Pb(n,"connected",e[3]),kb(t,"class","wallet-button-container svelte-1ct6vh0")},m(l,f){pb(l,t,f),cb(t,n),cb(n,r),yg(s,r,null),cb(r,i),cb(r,a),cb(a,o),cb(r,c),p&&p.m(r,null),u=!0,d||(h=[wb(window,"resize",e[7]),wb(n,"click",(function(){qm(e[2])&&e[2].apply(this,arguments)}))],d=!0)},p(t,[i]){e=t;const a={};64&i&&(a.size=e[6]>=bm?48:56),1&i&&(a.icon=e[0]),16&i&&(a.loading=e[4]),8&i&&(a.border=e[3]?"green":"custom"),s.$set(a),(!u||2&i)&&Eb(o,e[1]),e[3]?p?8&i&&sg(p,1):(p=Iw(),p.c(),sg(p,1),p.m(r,null)):p&&(ng(),ig(p,1,1,(()=>{p=null})),rg()),(!u||32&i)&&(n.disabled=e[5]),(!u||8&i)&&Pb(n,"connected",e[3])},i(e){u||(sg(s.$$.fragment,e),sg(p),e&&(l||$b((()=>{l=og(n,wv,{}),l.start()}))),u=!0)},o(e){ig(s.$$.fragment,e),ig(p),u=!1},d(e){e&&fb(t),vg(s),p&&p.d(),d=!1,Gm(h)}}}function Tw(e,t,n){let r,{icon:s}=t,{label:i}=t,{onClick:a}=t,{connected:o}=t,{connecting:c}=t,{disabled:l}=t;return e.$$set=e=>{"icon"in e&&n(0,s=e.icon),"label"in e&&n(1,i=e.label),"onClick"in e&&n(2,a=e.onClick),"connected"in e&&n(3,o=e.connected),"connecting"in e&&n(4,c=e.connecting),"disabled"in e&&n(5,l=e.disabled)},[s,i,a,o,c,l,r,function(){n(6,r=window.innerWidth)}]}class Mw extends kg{constructor(e){super(),xg(this,e,Tw,Bw,$m,{icon:0,label:1,onClick:2,connected:3,connecting:4,disabled:5},Sw)}}function Ow(e){lb(e,"svelte-kpc6js",".wallets-container.svelte-kpc6js{display:flex;gap:0.5rem;overflow-x:scroll;overflow-y:hidden;padding:0.75rem 0.5rem;border-bottom:1px solid var(--border-color);-ms-overflow-style:none;scrollbar-width:none}.wallets-container.svelte-kpc6js::-webkit-scrollbar{display:none}.warning-container.svelte-kpc6js{margin:1rem 1rem 0}.notice-container.svelte-kpc6js{flex:0 0 100%;margin-top:0.75rem}@media all and (min-width: 768px){.wallets-container.svelte-kpc6js{display:grid;grid-template-columns:repeat(var(--onboard-wallet-columns, 2), 1fr);padding:1rem;border:none}.notice-container.svelte-kpc6js{grid-column:span 2;margin:0}}")}function Nw(e,t,n){const r=e.slice();return r[10]=t[n],r}function Rw(e){let t,n,r;return n=new cw({props:{$$slots:{default:[Fw]},$$scope:{ctx:e}}}),{c(){t=bb("div"),gg(n.$$.fragment),kb(t,"class","warning-container svelte-kpc6js")},m(e,s){pb(e,t,s),yg(n,t,null),r=!0},p(e,t){const r={};8200&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(sg(n.$$.fragment,e),r=!0)},o(e){ig(n.$$.fragment,e),r=!1},d(e){e&&fb(t),vg(n)}}}function Fw(e){let t,n;return{c(){t=new _b(!1),n=vb(),t.a=n},m(r,s){t.m(e[3],r,s),pb(r,n,s)},p(e,n){8&n&&t.p(e[3])},d(e){e&&fb(n),e&&t.d()}}}function jw(e){let t,n;function r(){return e[9](e[10])}return t=new Mw({props:{connected:e[7](e[10].label),connecting:e[2]===e[10].label,label:e[10].label,icon:e[10].icon,onClick:r,disabled:e[4]<=bm&&e[2]&&e[2]!==e[10].label}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(n,s){e=n;const i={};1&s&&(i.connected=e[7](e[10].label)),5&s&&(i.connecting=e[2]===e[10].label),1&s&&(i.label=e[10].label),1&s&&(i.icon=e[10].icon),3&s&&(i.onClick=r),21&s&&(i.disabled=e[4]<=bm&&e[2]&&e[2]!==e[10].label),t.$set(i)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function Lw(e){let t,n,r,s,i,a=e[5]("connect.selectingWallet.whyDontISeeMyWallet",{default:Vy.connect.selectingWallet.whyDontISeeMyWallet})+"",o=e[5]("connect.selectingWallet.learnMore",{default:Vy.connect.selectingWallet.learnMore})+"";return{c(){t=bb("div"),n=gb(a),r=yb(),s=bb("a"),i=gb(o),kb(s,"class","link pointer"),kb(s,"href",e[6].wheresMyWalletLink||Dw),kb(s,"target","_blank"),kb(s,"rel","noreferrer noopener")},m(e,a){pb(e,t,a),cb(t,n),pb(e,r,a),pb(e,s,a),cb(s,i)},p(e,t){32&t&&a!==(a=e[5]("connect.selectingWallet.whyDontISeeMyWallet",{default:Vy.connect.selectingWallet.whyDontISeeMyWallet})+"")&&Eb(n,a),32&t&&o!==(o=e[5]("connect.selectingWallet.learnMore",{default:Vy.connect.selectingWallet.learnMore})+"")&&Eb(i,o)},d(e){e&&fb(t),e&&fb(r),e&&fb(s)}}}function Uw(e){let t,n,r,s,i,a,o;$b(e[8]);let c=e[3]&&Rw(e),l=e[0],u=[];for(let t=0;tig(u[e],1,1,(()=>{u[e]=null}));let h=!e[6].removeWhereIsMyWalletWarning&&function(e){let t,n,r;return n=new cw({props:{$$slots:{default:[Lw]},$$scope:{ctx:e}}}),{c(){t=bb("div"),gg(n.$$.fragment),kb(t,"class","notice-container svelte-kpc6js")},m(e,s){pb(e,t,s),yg(n,t,null),r=!0},p(e,t){const r={};8224&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(sg(n.$$.fragment,e),r=!0)},o(e){ig(n.$$.fragment,e),r=!1},d(e){e&&fb(t),vg(n)}}}(e);return{c(){t=bb("div"),c&&c.c(),n=yb(),r=bb("div");for(let e=0;e{c=null})),rg()),151&i){let t;for(l=e[0],t=0;tn(5,r=e)));let s,{wallets:i}=t,{selectWallet:a}=t,{connectingWalletLabel:o}=t,{connectingErrorMessage:c}=t;const{connect:l}=Lm.get();return e.$$set=e=>{"wallets"in e&&n(0,i=e.wallets),"selectWallet"in e&&n(1,a=e.selectWallet),"connectingWalletLabel"in e&&n(2,o=e.connectingWalletLabel),"connectingErrorMessage"in e&&n(3,c=e.connectingErrorMessage)},[i,a,o,c,s,r,l,function(e){const{wallets:t}=Lm.get();return!!t.find((t=>t.label===e))},function(){n(4,s=window.innerWidth)},e=>a(e)]}class Hw extends kg{constructor(e){super(),xg(this,e,zw,Uw,$m,{wallets:0,selectWallet:1,connectingWalletLabel:2,connectingErrorMessage:3},Ow)}}function Gw(e){lb(e,"svelte-obaru3",".sidebar.svelte-obaru3{--background-color:var(\n --onboard-connect-sidebar-background,\n var(--w3o-foreground-color, none)\n );--text-color:var(--onboard-connect-sidebar-color, inherit);--border-color:var(--onboard-connect-sidebar-border-color, inherit);display:flex;flex-flow:column;gap:1rem;padding:1rem;align-items:center}.inner-container.svelte-obaru3{display:flex;flex-flow:column;align-items:center;align-self:stretch;gap:0.5rem;padding:1.5rem;text-align:center;border:1px solid transparent;border-radius:12px;border-color:var(--border-color);background:var(--background-color);color:var(--text-color)}.icon-container.svelte-obaru3{display:flex;height:3.5rem;width:auto;min-width:3.5rem;max-width:100%}.heading.svelte-obaru3{font-size:var(--onboard-font-size-3, var(--font-size-3));margin:0 0 var(--onboard-spacing-5, var(--spacing-5)) 0}.subheading.svelte-obaru3{line-height:1rem}.description.svelte-obaru3{line-height:1.25rem;font-size:var(--onboard-font-size-6, var(--font-size-6))}img.svelte-obaru3{max-width:100%;height:auto}.indicators.svelte-obaru3{margin-top:auto}.indicator.svelte-obaru3{box-sizing:content-box;width:8px;height:8px;border-radius:8px;background:var(\n --onboard-connect-sidebar-progress-background,\n var(--onboard-gray-700, var(--gray-700))\n );transition:background 250ms ease-in-out}.indicator.on.svelte-obaru3{background:var(\n --onboard-connect-sidebar-progress-color,\n var(--action-color)\n );border:2px solid\n var(\n --onboard-connect-sidebar-progress-background,\n var(--onboard-gray-700, var(--gray-700))\n )}.join.svelte-obaru3{box-sizing:content-box;z-index:1;right:4px;height:2px;background:var(\n --onboard-connect-sidebar-progress-background,\n var(--onboard-gray-700, var(--gray-700))\n );transition:background 250ms ease-in-out}.join.active.svelte-obaru3{background:var(\n --onboard-connect-sidebar-progress-color,\n var(--action-color)\n )}.no-link.svelte-obaru3{display:flex;flex-direction:row;align-items:center;padding:0.25rem 0.5rem 0.25rem 0.75rem;gap:0.25rem;font-size:var(--onboard-font-size-6, var(--font-size-6))}.info-icon.svelte-obaru3{width:1.25rem;display:flex;align-items:center}@media all and (min-width: 768px){.sidebar.svelte-obaru3{max-width:280px;border-right:1px solid;border-color:var(--border-color);background:var(--background-color)}.inner-container.svelte-obaru3{border:none;text-align:initial;flex:1;align-items:flex-start;gap:1rem}.indicators.svelte-obaru3{margin-bottom:0.25rem}}")}function qw(e){let t,n,r,s=e[3](`connect.${e[0]}.sidebar.header`,{default:""});function i(e,t){return e[2]&&(e[2].logo||e[2].icon)?Vw:$w}let a=i(e),o=a(e),c=s&&Qw(e);return{c(){t=bb("div"),o.c(),n=yb(),c&&c.c(),r=vb(),kb(t,"class","icon-container svelte-obaru3")},m(e,s){pb(e,t,s),o.m(t,null),pb(e,n,s),c&&c.m(e,s),pb(e,r,s)},p(e,n){a===(a=i(e))&&o?o.p(e,n):(o.d(1),o=a(e),o&&(o.c(),o.m(t,null))),9&n&&(s=e[3](`connect.${e[0]}.sidebar.header`,{default:""})),s?c?c.p(e,n):(c=Qw(e),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},d(e){e&&fb(t),o.d(),e&&fb(n),c&&c.d(e),e&&fb(r)}}}function $w(e){let t,n;return{c(){t=new _b(!1),n=vb(),t.a=n},m(e,r){t.m(jf,e,r),pb(e,n,r)},p:Um,d(e){e&&fb(n),e&&t.d()}}}function Vw(e){let t,n;function r(e,n){return 4&n&&(t=null),null==t&&(t=!!Zf(e[2].logo||e[2].icon)),t?Zw:Ww}let s=r(e,-1),i=s(e);return{c(){i.c(),n=vb()},m(e,t){i.m(e,t),pb(e,n,t)},p(e,t){s===(s=r(e,t))&&i?i.p(e,t):(i.d(1),i=s(e),i&&(i.c(),i.m(n.parentNode,n)))},d(e){i.d(e),e&&fb(n)}}}function Ww(e){let t,n;return{c(){t=bb("img"),Wm(t.src,n=e[2].logo||e[2].icon)||kb(t,"src",n),kb(t,"alt","logo"),kb(t,"class","svelte-obaru3")},m(e,n){pb(e,t,n)},p(e,r){4&r&&!Wm(t.src,n=e[2].logo||e[2].icon)&&kb(t,"src",n)},d(e){e&&fb(t)}}}function Zw(e){let t,n,r=(e[2].logo||e[2].icon)+"";return{c(){t=new _b(!1),n=gb("​"),t.a=n},m(e,s){t.m(r,e,s),pb(e,n,s)},p(e,n){4&n&&r!==(r=(e[2].logo||e[2].icon)+"")&&t.p(r)},d(e){e&&t.d(),e&&fb(n)}}}function Qw(e){let t,n,r=e[3](`connect.${e[0]}.sidebar.header`,{default:e[7]})+"";return{c(){t=bb("div"),n=gb(r),kb(t,"class","heading svelte-obaru3")},m(e,r){pb(e,t,r),cb(t,n)},p(e,t){9&t&&r!==(r=e[3](`connect.${e[0]}.sidebar.header`,{default:e[7]})+"")&&Eb(n,r)},d(e){e&&fb(t)}}}function Kw(e){let t,n,r,s,i,a,o,c,l,u,d,h;return{c(){t=bb("div"),n=bb("div"),r=yb(),s=bb("div"),a=yb(),o=bb("div"),c=yb(),l=bb("div"),d=yb(),h=bb("div"),kb(n,"class","indicator relative svelte-obaru3"),Pb(n,"on",!0),kb(s,"class","join relative svelte-obaru3"),kb(s,"style",i=""+("selectingWallet"!==e[0]?"right: 4px; width: 52px;":"right: 2px; width: 54px;")),Pb(s,"active","selectingWallet"!==e[0]),kb(o,"class","indicator relative svelte-obaru3"),kb(o,"style","right: 8px;"),Pb(o,"on","selectingWallet"!==e[0]),kb(l,"class","join relative svelte-obaru3"),kb(l,"style",u=""+("connectedWallet"===e[0]?"right: 12px; width: 52px;":"right: 10px; width: 54px;")),Pb(l,"active","connectedWallet"===e[0]),kb(h,"style","right: 16px;"),kb(h,"class","indicator relative svelte-obaru3"),Pb(h,"on","connectedWallet"===e[0]),kb(t,"class","indicators flex items-center svelte-obaru3")},m(e,i){pb(e,t,i),cb(t,n),cb(t,r),cb(t,s),cb(t,a),cb(t,o),cb(t,c),cb(t,l),cb(t,d),cb(t,h)},p(e,t){1&t&&i!==(i=""+("selectingWallet"!==e[0]?"right: 4px; width: 52px;":"right: 2px; width: 54px;"))&&kb(s,"style",i),1&t&&Pb(s,"active","selectingWallet"!==e[0]),1&t&&Pb(o,"on","selectingWallet"!==e[0]),1&t&&u!==(u=""+("connectedWallet"===e[0]?"right: 12px; width: 52px;":"right: 10px; width: 54px;"))&&kb(l,"style",u),1&t&&Pb(l,"active","connectedWallet"===e[0]),1&t&&Pb(h,"on","connectedWallet"===e[0])},d(e){e&&fb(t)}}}function Yw(e){let t,n,r,s,i,a,o,c,l,u,d,h;return{c(){t=bb("div"),n=bb("div"),r=yb(),s=bb("div"),a=yb(),o=bb("div"),c=yb(),l=bb("div"),d=yb(),h=bb("div"),kb(n,"class","indicator relative svelte-obaru3"),Pb(n,"on",!0),kb(s,"class","join relative svelte-obaru3"),kb(s,"style",i="right: 2px; "+("selectingWallet"!==e[0]?"width: 78px;":"width: 82px;")),Pb(s,"active","selectingWallet"!==e[0]),kb(o,"class","indicator relative svelte-obaru3"),kb(o,"style","right: 4px;"),Pb(o,"on","selectingWallet"!==e[0]),kb(l,"class","join relative svelte-obaru3"),kb(l,"style",u="right: 6px; "+("connectedWallet"===e[0]?"width: 74px;":"width: 81px;")),Pb(l,"active","connectedWallet"===e[0]),kb(h,"style","right: 8px;"),kb(h,"class","indicator relative svelte-obaru3"),Pb(h,"on","connectedWallet"===e[0]),kb(t,"class","indicators flex items-center svelte-obaru3")},m(e,i){pb(e,t,i),cb(t,n),cb(t,r),cb(t,s),cb(t,a),cb(t,o),cb(t,c),cb(t,l),cb(t,d),cb(t,h)},p(e,t){1&t&&i!==(i="right: 2px; "+("selectingWallet"!==e[0]?"width: 78px;":"width: 82px;"))&&kb(s,"style",i),1&t&&Pb(s,"active","selectingWallet"!==e[0]),1&t&&Pb(o,"on","selectingWallet"!==e[0]),1&t&&u!==(u="right: 6px; "+("connectedWallet"===e[0]?"width: 74px;":"width: 81px;"))&&kb(l,"style",u),1&t&&Pb(l,"active","connectedWallet"===e[0]),1&t&&Pb(h,"on","connectedWallet"===e[0])},d(e){e&&fb(t)}}}function Jw(e){let t,n,r,s,i,a,o,c,l,u,d,h,p,f,m,b=e[3](`connect.${e[0]}.sidebar.subheading`,{default:e[5]})+"",g=e[3](`connect.${e[0]}.sidebar.paragraph`,{values:{app:e[2]&&e[2].name||"This App"},default:e[6]})+"";$b(e[9]);let y=e[1]>=bm&&qw(e),v=!e[4].removeIDontHaveAWalletInfoLink&&function(e){let t,n,r,s,i=e[3]("connect.selectingWallet.sidebar.IDontHaveAWallet",{default:Vy.connect.selectingWallet.sidebar.IDontHaveAWallet})+"";return{c(){t=bb("a"),n=gb(i),r=yb(),s=bb("div"),kb(s,"class","info-icon svelte-obaru3"),kb(t,"href",e[4].iDontHaveAWalletLink||"https://ethereum.org/en/wallets/find-wallet/#main-content"),kb(t,"target","_blank"),kb(t,"rel","noreferrer noopener"),kb(t,"class","no-link svelte-obaru3")},m(e,i){pb(e,t,i),cb(t,n),cb(t,r),cb(t,s),s.innerHTML=$f},p(e,t){8&t&&i!==(i=e[3]("connect.selectingWallet.sidebar.IDontHaveAWallet",{default:Vy.connect.selectingWallet.sidebar.IDontHaveAWallet})+"")&&Eb(n,i)},d(e){e&&fb(t)}}}(e),w=e[1]=bm&&Yw(e);return{c(){t=bb("div"),n=bb("div"),y&&y.c(),r=yb(),s=bb("div"),i=gb(b),a=yb(),o=bb("div"),c=gb(g),l=yb(),v&&v.c(),u=yb(),w&&w.c(),d=yb(),x&&x.c(),h=yb(),p=bb("div"),kb(s,"class","subheading svelte-obaru3"),kb(o,"class","description svelte-obaru3"),kb(n,"class","inner-container svelte-obaru3"),kb(t,"class","sidebar svelte-obaru3")},m(b,g){pb(b,t,g),cb(t,n),y&&y.m(n,null),cb(n,r),cb(n,s),cb(s,i),cb(n,a),cb(n,o),cb(o,c),cb(n,l),v&&v.m(n,null),cb(n,u),w&&w.m(n,null),cb(t,d),x&&x.m(t,null),cb(t,h),cb(t,p),p.innerHTML=Lf,f||(m=wb(window,"resize",e[9]),f=!0)},p(e,[s]){e[1]>=bm?y?y.p(e,s):(y=qw(e),y.c(),y.m(n,r)):y&&(y.d(1),y=null),9&s&&b!==(b=e[3](`connect.${e[0]}.sidebar.subheading`,{default:e[5]})+"")&&Eb(i,b),13&s&&g!==(g=e[3](`connect.${e[0]}.sidebar.paragraph`,{values:{app:e[2]&&e[2].name||"This App"},default:e[6]})+"")&&Eb(c,g),e[4].removeIDontHaveAWalletInfoLink||v.p(e,s),e[1]=bm?x?x.p(e,s):(x=Yw(e),x.c(),x.m(t,h)):x&&(x.d(1),x=null)},i:Um,o:Um,d(e){e&&fb(t),y&&y.d(),v&&v.d(),w&&w.d(),x&&x.d(),f=!1,m()}}}function Xw(e,t,n){let r,s;Zm(e,Rr,(e=>n(3,s=e)));let{step:i}=t;const{connect:a}=Lm.get(),o=Vy.connect[i].sidebar,{subheading:c,paragraph:l}=o,{heading:u}=o;let d;const h=Lm.select("appMetadata").pipe(De(Lm.get().appMetadata),Ue(1));return Zm(e,h,(e=>n(2,r=e))),e.$$set=e=>{"step"in e&&n(0,i=e.step)},[i,d,r,s,a,c,l,u,h,function(){n(1,d=window.innerWidth)}]}class ex extends kg{constructor(e){super(),xg(this,e,Xw,Jw,$m,{step:0},Gw)}}function tx(e){lb(e,"svelte-1qwmck3",".container.svelte-1qwmck3{--background-color:var(\n --onboard-main-scroll-container-background,\n var(--w3o-background-color)\n );--foreground-color:var(--w3o-foreground-color);--text-color:var(--onboard-connect-text-color, var(--w3o-text-color));--border-color:var(--w3o-border-color, var(--gray-200));--action-color:var(--w3o-action-color, var(--primary-500));font-family:var(--onboard-font-family-normal, var(--font-family-normal));font-size:var(--onboard-font-size-5, 1rem);background:var(--background-color);color:var(--text-color);border-color:var(--border-color);line-height:24px;overflow:hidden;position:relative;display:flex;height:min-content;flex-flow:column-reverse}.content.svelte-1qwmck3{width:var(--onboard-connect-content-width, 100%)}.header.svelte-1qwmck3{display:flex;padding:1rem;border-bottom:1px solid transparent;background:var(--onboard-connect-header-background);color:var(--onboard-connect-header-color);border-color:var(--border-color)}.header-heading.svelte-1qwmck3{line-height:1rem}.button-container.svelte-1qwmck3{right:0.5rem;top:0.5rem}.mobile-header.svelte-1qwmck3{display:flex;gap:0.5rem;height:4.5rem;padding:1rem;border-bottom:1px solid;border-color:var(--border-color)}.mobile-subheader.svelte-1qwmck3{opacity:0.6;font-size:0.875rem;font-weight:400;line-height:1rem;margin-top:0.25rem}.icon-container.svelte-1qwmck3{display:flex;flex:0 0 auto;height:2.5rem;width:2.5rem;min-width:2.5rem;justify-content:center;align-items:center}.disabled.svelte-1qwmck3{opacity:0.2;pointer-events:none;overflow:hidden}.icon-container svg{display:block;height:100%;width:auto}.w-full.svelte-1qwmck3{width:100%}.scroll-container.svelte-1qwmck3{overflow-y:auto;transition:opacity 250ms ease-in-out;scrollbar-width:none}.scroll-container.svelte-1qwmck3::-webkit-scrollbar{display:none}@media all and (min-width: 768px){.container.svelte-1qwmck3{margin:0;flex-flow:row;height:var(--onboard-connect-content-height, 440px)}.content.svelte-1qwmck3{width:var(--onboard-connect-content-width, 488px)}.mobile-subheader.svelte-1qwmck3{display:none}.icon-container.svelte-1qwmck3{display:none}}")}function nx(e){let t,n;return t=new Pv({props:{close:!e[16].disableClose&&e[20],$$slots:{default:[fx]},$$scope:{ctx:e}}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,n){const r={};32766&n[0]|32&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function rx(e){let t,n,r,s,i,a=e[14](`connect.${e[5]}.header`,{default:Vy.connect[e[5]].header,values:{connectionRejected:e[1],wallet:e[3]&&e[3].label}})+"",o="selectingWallet"===e[5]?`(${e[12]})`:"";return{c(){t=bb("div"),n=bb("div"),r=gb(a),s=yb(),i=gb(o),kb(n,"class","header-heading svelte-1qwmck3"),kb(t,"class","header relative flex items-center svelte-1qwmck3")},m(e,a){pb(e,t,a),cb(t,n),cb(n,r),cb(n,s),cb(n,i)},p(e,t){16426&t[0]&&a!==(a=e[14](`connect.${e[5]}.header`,{default:Vy.connect[e[5]].header,values:{connectionRejected:e[1],wallet:e[3]&&e[3].label}})+"")&&Eb(r,a),4128&t[0]&&o!==(o="selectingWallet"===e[5]?`(${e[12]})`:"")&&Eb(i,o)},d(e){e&&fb(t)}}}function sx(e){let t,n,r,s,i,a,o,c,l,u=e[14]("connectingWallet"===e[5]&&e[3]?`connect.${e[5]}.header`:`connect.${e[5]}.sidebar.subheading`,{default:"connectingWallet"===e[5]&&e[3]?Vy.connect[e[5]].header:Vy.connect[e[5]].sidebar.subheading,values:{connectionRejected:e[1],wallet:e[3]&&e[3].label}})+"",d="selectingWallet"===e[5]?`${e[12]} available wallets`:"1 account selected";function h(e,t){return e[13]&&e[13].icon?ax:ix}let p=h(e),f=p(e);return{c(){t=bb("div"),n=bb("div"),f.c(),r=yb(),s=bb("div"),i=bb("div"),a=gb(u),o=yb(),c=bb("div"),l=gb(d),kb(n,"class","icon-container svelte-1qwmck3"),kb(i,"class","header-heading svelte-1qwmck3"),kb(c,"class","mobile-subheader svelte-1qwmck3"),kb(s,"class","flex flex-column justify-center w-full svelte-1qwmck3"),kb(t,"class","mobile-header svelte-1qwmck3")},m(e,u){pb(e,t,u),cb(t,n),f.m(n,null),cb(t,r),cb(t,s),cb(s,i),cb(i,a),cb(s,o),cb(s,c),cb(c,l)},p(e,t){p===(p=h(e))&&f?f.p(e,t):(f.d(1),f=p(e),f&&(f.c(),f.m(n,null))),16426&t[0]&&u!==(u=e[14]("connectingWallet"===e[5]&&e[3]?`connect.${e[5]}.header`:`connect.${e[5]}.sidebar.subheading`,{default:"connectingWallet"===e[5]&&e[3]?Vy.connect[e[5]].header:Vy.connect[e[5]].sidebar.subheading,values:{connectionRejected:e[1],wallet:e[3]&&e[3].label}})+"")&&Eb(a,u),4128&t[0]&&d!==(d="selectingWallet"===e[5]?`${e[12]} available wallets`:"1 account selected")&&Eb(l,d)},d(e){e&&fb(t),f.d()}}}function ix(e){let t,n;return{c(){t=new _b(!1),n=vb(),t.a=n},m(e,r){t.m(jf,e,r),pb(e,n,r)},p:Um,d(e){e&&fb(n),e&&t.d()}}}function ax(e){let t,n;function r(e,n){return 8192&n[0]&&(t=null),null==t&&(t=!!Zf(e[13].icon)),t?cx:ox}let s=r(e,[-1,-1]),i=s(e);return{c(){i.c(),n=vb()},m(e,t){i.m(e,t),pb(e,n,t)},p(e,t){s===(s=r(e,t))&&i?i.p(e,t):(i.d(1),i=s(e),i&&(i.c(),i.m(n.parentNode,n)))},d(e){i.d(e),e&&fb(n)}}}function ox(e){let t,n;return{c(){t=bb("img"),Wm(t.src,n=e[13].icon)||kb(t,"src",n),kb(t,"alt","logo")},m(e,n){pb(e,t,n)},p(e,r){8192&r[0]&&!Wm(t.src,n=e[13].icon)&&kb(t,"src",n)},d(e){e&&fb(t)}}}function cx(e){let t,n,r=e[13].icon+"";return{c(){t=new _b(!1),n=vb(),t.a=n},m(e,s){t.m(r,e,s),pb(e,n,s)},p(e,n){8192&n[0]&&r!==(r=e[13].icon+"")&&t.p(r)},d(e){e&&fb(n),e&&t.d()}}}function lx(e){let t,n,r,s;const i=[dx,ux],a=[];function o(e,t){return e[2].length?0:1}return t=o(e),n=a[t]=i[t](e),{c(){n.c(),r=vb()},m(e,n){a[t].m(e,n),pb(e,r,n),s=!0},p(e,s){let c=t;t=o(e),t===c?a[t].p(e,s):(ng(),ig(a[c],1,1,(()=>{a[c]=null})),rg(),n=a[t],n?n.p(e,s):(n=a[t]=i[t](e),n.c()),sg(n,1),n.m(r.parentNode,r))},i(e){s||(sg(n),s=!0)},o(e){ig(n),s=!1},d(e){a[t].d(e),e&&fb(r)}}}function ux(e){let t,n;return t=new _w({}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p:Um,i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function dx(e){let t,n,r,s,i,a;function o(t){e[24](t)}let c={};return void 0!==e[7]&&(c.agreed=e[7]),t=new Tv({props:c}),Db.push((()=>bg(t,"agreed",o))),i=new Hw({props:{selectWallet:e[18],wallets:e[2],connectingWalletLabel:e[8],connectingErrorMessage:e[9]}}),{c(){gg(t.$$.fragment),r=yb(),s=bb("div"),gg(i.$$.fragment),kb(s,"class","svelte-1qwmck3"),Pb(s,"disabled",!e[7])},m(e,n){yg(t,e,n),pb(e,r,n),pb(e,s,n),yg(i,s,null),a=!0},p(e,r){const o={};!n&&128&r[0]&&(n=!0,o.agreed=e[7],Vb((()=>n=!1))),t.$set(o);const c={};4&r[0]&&(c.wallets=e[2]),256&r[0]&&(c.connectingWalletLabel=e[8]),512&r[0]&&(c.connectingErrorMessage=e[9]),i.$set(c),(!a||128&r[0])&&Pb(s,"disabled",!e[7])},i(e){a||(sg(t.$$.fragment,e),sg(i.$$.fragment,e),a=!0)},o(e){ig(t.$$.fragment,e),ig(i.$$.fragment,e),a=!1},d(e){vg(t,e),e&&fb(r),e&&fb(s),vg(i)}}}function hx(e){let t,n;return t=new yw({props:{connectWallet:e[21],connectionRejected:e[1],previousConnectionRequest:e[6],setStep:e[22],deselectWallet:e[19],selectedWallet:e[3]}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.connectionRejected=e[1]),64&n[0]&&(r.previousConnectionRequest=e[6]),8&n[0]&&(r.selectedWallet=e[3]),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function px(e){let t,n;return t=new hw({props:{selectedWallet:e[3]}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,n){const r={};8&n[0]&&(r.selectedWallet=e[3]),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function fx(e){let t,n,r,s,i,a,o,c,l,u=e[16].showSidebar&&function(e){let t,n;return t=new ex({props:{step:e[5]}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,n){const r={};32&n[0]&&(r.step=e[5]),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}(e);function d(e,t){return e[4]<=bm?sx:rx}let h=d(e),p=h(e),f=!e[16].disableClose&&function(e){let t,n,r,s,i;return n=new gv({}),{c(){t=bb("div"),gg(n.$$.fragment),kb(t,"class","button-container absolute svelte-1qwmck3")},m(a,o){pb(a,t,o),yg(n,t,null),r=!0,s||(i=wb(t,"click",e[20]),s=!0)},p:Um,i(e){r||(sg(n.$$.fragment,e),r=!0)},o(e){ig(n.$$.fragment,e),r=!1},d(e){e&&fb(t),vg(n),s=!1,i()}}}(e),m=("selectingWallet"===e[5]||e[4]<=bm)&&lx(e),b=e[11]&&hx(e),g="connectedWallet"===e[5]&&e[3]&&e[4]>=bm&&px(e);return{c(){t=bb("div"),u&&u.c(),n=yb(),r=bb("div"),p.c(),s=yb(),f&&f.c(),i=yb(),a=bb("div"),m&&m.c(),o=yb(),b&&b.c(),c=yb(),g&&g.c(),kb(a,"class","scroll-container svelte-1qwmck3"),kb(r,"class","content flex flex-column svelte-1qwmck3"),kb(t,"class","container svelte-1qwmck3")},m(d,h){pb(d,t,h),u&&u.m(t,null),cb(t,n),cb(t,r),p.m(r,null),cb(r,s),f&&f.m(r,null),cb(r,i),cb(r,a),m&&m.m(a,null),cb(a,o),b&&b.m(a,null),cb(a,c),g&&g.m(a,null),e[25](a),l=!0},p(e,t){e[16].showSidebar&&u.p(e,t),h===(h=d(e))&&p?p.p(e,t):(p.d(1),p=h(e),p&&(p.c(),p.m(r,s))),e[16].disableClose||f.p(e,t),"selectingWallet"===e[5]||e[4]<=bm?m?(m.p(e,t),48&t[0]&&sg(m,1)):(m=lx(e),m.c(),sg(m,1),m.m(a,o)):m&&(ng(),ig(m,1,1,(()=>{m=null})),rg()),e[11]?b?(b.p(e,t),2048&t[0]&&sg(b,1)):(b=hx(e),b.c(),sg(b,1),b.m(a,c)):b&&(ng(),ig(b,1,1,(()=>{b=null})),rg()),"connectedWallet"===e[5]&&e[3]&&e[4]>=bm?g?(g.p(e,t),56&t[0]&&sg(g,1)):(g=px(e),g.c(),sg(g,1),g.m(a,null)):g&&(ng(),ig(g,1,1,(()=>{g=null})),rg())},i(e){l||(sg(u),sg(f),sg(m),sg(b),sg(g),l=!0)},o(e){ig(u),ig(f),ig(m),ig(b),ig(g),l=!1},d(n){n&&fb(t),u&&u.d(),p.d(),f&&f.d(),m&&m.d(),b&&b.d(),g&&g.d(),e[25](null)}}}function mx(e){let t,n,r,s;$b(e[23]);let i=!e[0].disableModals&&nx(e);return{c(){i&&i.c(),t=vb()},m(a,o){i&&i.m(a,o),pb(a,t,o),n=!0,r||(s=wb(window,"resize",e[23]),r=!0)},p(e,n){e[0].disableModals?i&&(ng(),ig(i,1,1,(()=>{i=null})),rg()):i?(i.p(e,n),1&n[0]&&sg(i,1)):(i=nx(e),i.c(),sg(i,1),i.m(t.parentNode,t))},i(e){n||(sg(i),n=!0)},o(e){ig(i),n=!1},d(e){i&&i.d(e),e&&fb(t),r=!1,s()}}}function bx(e,t,n){let r,s,i,a,o;Zm(e,Rr,(e=>n(14,o=e)));let{autoSelect:c}=t;const l=Lm.select("appMetadata").pipe(De(Lm.get().appMetadata),Ue(1));Zm(e,l,(e=>n(13,i=e)));const{walletModules:u,connect:d,chains:h}=Lm.get(),p=new U,{unstoppableResolution:f,wagmi:m}=hm;let b,g,y,v,w,x,k=!1,E=!1,A=[];const C=new z("selectingWallet");async function P({label:e,icon:t,getInterface:r}){n(8,y=e);try{const s=Lm.get().wallets.find((t=>t.label===e));if(s)return By(s),setTimeout((()=>S("connectedWallet")),1),void n(3,b=s);const{chains:a}=Lm.get(),{provider:o,instance:c}=await r({chains:a,EventEmitter:Rf,appMetadata:i}),l=await t;n(3,b={label:e,icon:l,provider:o,instance:c,accounts:[],chains:[{namespace:"evm",id:"0x1"}]}),n(9,v=""),I(),setTimeout((()=>S("connectingWallet")),1)}catch(e){const{message:t}=e;n(9,v=t),n(8,y=""),I()}}async function _(){n(1,k=!1);const{provider:e,label:t}=b;p.next();try{let r,s;if(m){const{buildWagmiConfig:n,wagmiConnect:i,getWagmiConnector:a}=m,o=await n(h,{label:t,provider:e});qy(o),s=a(t);const c=await Promise.race([i(o,{connector:s}),ge(p.pipe(Oe([])))]);if(!c||!("accounts"in c))return;const[l]=c.accounts;r=l}else{const[t]=await Promise.race([Zy(e),ge(p.pipe(Oe([])))]);if(!t)return;r=t}if(Lm.get().connect.autoConnectLastWallet||Lm.get().connect.autoConnectAllPreviousWallet){let e=lm(mm.LAST_CONNECTED_WALLET);try{let n=JSON.parse(e);if(n&&Array.isArray(n)){e=[...new Set([t,...n])]}}catch(t){if(!(t instanceof SyntaxError&&e&&"string"==typeof e))throw new Error(t);e=[e]}e||(e=[t]),um(mm.LAST_CONNECTED_WALLET,JSON.stringify(e))}const i=await Qy(e);if(Lm.get().notify.enabled){const e=await dv();if(e)try{e.subscribe({id:r,chainId:i,type:"account"})}catch(e){}}const a={accounts:[{address:r,ens:null,uns:null,balance:null}],chains:[{namespace:"evm",id:i}],wagmiConnector:s};By(Object.assign(Object.assign({},b),a)),Yy(e,t),function(e){n(3,b=Object.assign(Object.assign({},b),e))}(a),S("connectedWallet"),I()}catch(e){const{code:t}=e;if(I(),t===Ta.ACCOUNT_ACCESS_REJECTED)return n(1,k=!0),void(c.disableModals?Cg.next({inProgress:!1}):c.label&&n(0,c.label="",c));if(t===Ta.ACCOUNT_ACCESS_ALREADY_REQUESTED)return n(6,E=!0),c.disableModals?void Cg.next({inProgress:!1}):void Ky({provider:b.provider,disconnected$:Cg.pipe(Te((({inProgress:e})=>!e)),Oe(""))}).pipe(Me(1)).subscribe((([e])=>{e&&_()}))}}function S(e){p.next(),C.next(e)}function I(){x&&x.scrollTo(0,0)}return Zm(e,C,(e=>n(5,a=e))),Cg.pipe(Ne(((e,t)=>e.autoSelect&&t.autoSelect&&e.autoSelect.disableModals===t.autoSelect.disableModals)),Te((({autoSelect:e})=>e&&!1===e.disableModals)),He(Bg)).subscribe((()=>{b&&_()})),C.pipe(He(Bg)).subscribe((e=>{switch(e){case"selectingWallet":if(c.label){const e=u.find((({label:e})=>e.toLowerCase()===c.label.toLowerCase()));e?async function(e){const{getIcon:t,getInterface:n,label:r}=e;P({label:r,icon:t(),getInterface:n})}(e):c.disableModals&&Cg.next({inProgress:!1})}else n(8,y=""),async function(){n(2,A=u.map((({getIcon:e,getInterface:t,label:n})=>({label:n,icon:e(),getInterface:t}))))}();break;case"connectingWallet":_();break;case"connectedWallet":n(8,y=""),async function(){const{accounts:e,chains:t}=b,n=Lm.get().chains,[r]=t,s=n.find((({namespace:e,id:t})=>e===r.namespace&&t===r.id)),{address:i}=e[0];let{balance:a,ens:o,uns:c,secondaryTokens:l}=e[0];if(null===a&&ev(i,s).then((e=>{Oy(b.label,i,{balance:e})})),s&&!l&&Array.isArray(s.secondaryTokens)&&s.secondaryTokens.length&&iv(i,s).then((e=>{Oy(b.label,i,{secondaryTokens:e})})),null===o&&em(r.id)){const e=h.find((({id:e})=>e===em(r.id)));Jy(i,e).then((e=>{Oy(b.label,i,{ens:e})}))}null===c&&f&&Xy(i,s).then((e=>{Oy(b.label,i,{uns:e})})),setTimeout((()=>Cg.next({inProgress:!1})),1500)}()}})),e.$$set=e=>{"autoSelect"in e&&n(0,c=e.autoSelect)},e.$$.update=()=>{4&e.$$.dirty[0]&&n(12,r=A.length-Lm.get().wallets.length),58&e.$$.dirty[0]&&n(11,s="connectingWallet"===a&&b&&w>=bm||w<=bm&&k&&"connectingWallet"===a&&b)},[c,k,A,b,w,a,E,g,y,v,x,s,r,i,o,l,d,C,P,function(){n(3,b=null)},function(){Cg.next({inProgress:!1})},_,S,function(){n(4,w=window.innerWidth)},function(e){g=e,n(7,g)},function(e){Db[e?"unshift":"push"]((()=>{x=e,n(10,x)}))}]}let gx=class extends kg{constructor(e){super(),xg(this,e,bx,mx,$m,{autoSelect:0},tx,[-1,-1])}};function yx(e){lb(e,"svelte-12yam41",".container.svelte-12yam41{padding:var(--onboard-spacing-4, var(--spacing-4));font-family:var(--onboard-font-family-normal, var(--font-family-normal));line-height:16px;font-size:var(--onboard-font-size-5, var(--font-size-5))}.close.svelte-12yam41{top:var(--onboard-spacing-5, var(--spacing-5));right:var(--onboard-spacing-5, var(--spacing-5));padding:0.5rem}h4.svelte-12yam41{font-size:var(--onboard-font-size-3, var(--font-size-3));margin:var(--onboard-spacing-4, var(--spacing-4)) 0}p.svelte-12yam41{margin:0 0 var(--onboard-spacing-4, var(--spacing-4)) 0;max-width:488px}")}function vx(e){let t,n,r,s,i,a,o,c,l,u,d,h,p,f,m,b=e[0]("modals.switchChain.heading",{default:Vy.modals.switchChain.heading})+"",g=e[0]("modals.switchChain.paragraph1",{default:Vy.modals.switchChain.paragraph1,values:{app:e[1]&&e[1].name||"This app",nextNetworkName:e[2]}})+"",y=e[0]("modals.switchChain.paragraph2",{default:Vy.modals.switchChain.paragraph2})+"";return h=new gv({}),{c(){t=bb("div"),n=bb("h4"),r=gb(b),s=yb(),i=bb("p"),a=gb(g),o=yb(),c=bb("p"),l=gb(y),u=yb(),d=bb("div"),gg(h.$$.fragment),kb(n,"class","svelte-12yam41"),kb(i,"class","svelte-12yam41"),kb(c,"class","svelte-12yam41"),kb(d,"class","close absolute svelte-12yam41"),kb(t,"class","container relative svelte-12yam41")},m(b,g){pb(b,t,g),cb(t,n),cb(n,r),cb(t,s),cb(t,i),cb(i,a),cb(t,o),cb(t,c),cb(c,l),cb(t,u),cb(t,d),yg(h,d,null),p=!0,f||(m=wb(d,"click",e[3]),f=!0)},p(e,t){(!p||1&t)&&b!==(b=e[0]("modals.switchChain.heading",{default:Vy.modals.switchChain.heading})+"")&&Eb(r,b),(!p||3&t)&&g!==(g=e[0]("modals.switchChain.paragraph1",{default:Vy.modals.switchChain.paragraph1,values:{app:e[1]&&e[1].name||"This app",nextNetworkName:e[2]}})+"")&&Eb(a,g),(!p||1&t)&&y!==(y=e[0]("modals.switchChain.paragraph2",{default:Vy.modals.switchChain.paragraph2})+"")&&Eb(l,y)},i(e){p||(sg(h.$$.fragment,e),p=!0)},o(e){ig(h.$$.fragment,e),p=!1},d(e){e&&fb(t),vg(h),f=!1,m()}}}function wx(e){let t,n;return t=new Pv({props:{close:e[3],$$slots:{default:[vx]},$$scope:{ctx:e}}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,[n]){const r={};67&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function xx(e,t,n){let r,s,i;Zm(e,Pg,(e=>n(5,r=e))),Zm(e,Rr,(e=>n(0,s=e)));const a=r.chain.label;const o=state.select("appMetadata").pipe(startWith(state.get().appMetadata),shareReplay(1));return Zm(e,o,(e=>n(1,i=e))),[s,i,a,function(){Pg.next(null)},o]}class kx extends kg{constructor(e){super(),xg(this,e,xx,wx,$m,{},yx)}}function Ex(e){lb(e,"svelte-z54y2j",".icon.svelte-z54y2j{border-radius:50px;color:var(--onboard-primary-500, var(--primary-500))}")}function Ax(e){let t,n;return{c(){t=bb("div"),kb(t,"class","icon flex svelte-z54y2j"),kb(t,"style",n=`width: ${e[0]}px; height: ${e[0]}px;`)},m(e,n){pb(e,t,n),t.innerHTML=$f},p(e,[r]){1&r&&n!==(n=`width: ${e[0]}px; height: ${e[0]}px;`)&&kb(t,"style",n)},i:Um,o:Um,d(e){e&&fb(t)}}}function Cx(e,t,n){let{size:r=20}=t;return e.$$set=e=>{"size"in e&&n(0,r=e.size)},[r]}class Px extends kg{constructor(e){super(),xg(this,e,Cx,Ax,$m,{size:0},Ex)}}function _x(e){lb(e,"svelte-20hjq1",".content.svelte-20hjq1{padding:1rem;width:300px;font-family:var(--onboard-font-family-normal, var(--font-family-normal));font-size:var(--onboard-font-size-5, var(--font-size-5));line-height:24px;background:var(\n --onboard-action-required-modal-background,\n var(--onboard-white, var(--white))\n )}.icon-container.svelte-20hjq1{width:3rem;height:3rem;background:var(--onboard-primary-100, var(--primary-100));border-radius:24px}h4.svelte-20hjq1{margin:1.5rem 0 0.5rem 0;font-weight:600}.action-required-heading.svelte-20hjq1,.action-required-info.svelte-20hjq1{color:var(\n --onboard-action-required-text-color,\n var(--onboard-black, inherit)\n )}.action-required-btn.svelte-20hjq1{color:var(\n --onboard-action-required-btn-text-color,\n var(--onboard-black, inherit)\n )}p.svelte-20hjq1{margin:0;font-weight:400}a.svelte-20hjq1{font-weight:600}button.svelte-20hjq1{margin-top:1.5rem;font-weight:600}")}function Sx(e){let t,n,r=e[1]("modals.actionRequired.linkText",{values:{wallet:e[0]}})+"";return{c(){t=bb("a"),n=gb(r),kb(t,"href","https://metamask.zendesk.com/hc/en-us/articles/360061346311-Switching-accounts-in-MetaMask"),kb(t,"target","_blank"),kb(t,"rel","noreferrer noopener"),kb(t,"class","svelte-20hjq1")},m(e,r){pb(e,t,r),cb(t,n)},p(e,t){3&t&&r!==(r=e[1]("modals.actionRequired.linkText",{values:{wallet:e[0]}})+"")&&Eb(n,r)},d(e){e&&fb(t)}}}function Ix(e){let t,n,r,s,i,a,o,c,l,u,d,h,p,f,m,b,g=e[1]("modals.actionRequired.heading",{values:{wallet:e[0]}})+"",y=e[1]("modals.actionRequired.paragraph",{values:{wallet:e[0]}})+"",v=e[1]("modals.actionRequired.buttonText")+"";r=new Px({});let w="MetaMask"===e[0]&&Sx(e);return{c(){t=bb("div"),n=bb("div"),gg(r.$$.fragment),s=yb(),i=bb("h4"),a=gb(g),o=yb(),c=bb("p"),l=gb(y),u=yb(),w&&w.c(),d=yb(),h=bb("button"),p=gb(v),kb(n,"class","icon-container flex justify-center items-center svelte-20hjq1"),kb(i,"class","action-required-heading svelte-20hjq1"),kb(c,"class","action-required-info svelte-20hjq1"),kb(h,"class","button-neutral-solid rounded action-required-btn svelte-20hjq1"),kb(t,"class","content svelte-20hjq1")},m(g,y){pb(g,t,y),cb(t,n),yg(r,n,null),cb(t,s),cb(t,i),cb(i,a),cb(t,o),cb(t,c),cb(c,l),cb(c,u),w&&w.m(c,null),cb(t,d),cb(t,h),cb(h,p),f=!0,m||(b=wb(h,"click",e[2]),m=!0)},p(e,t){(!f||3&t)&&g!==(g=e[1]("modals.actionRequired.heading",{values:{wallet:e[0]}})+"")&&Eb(a,g),(!f||3&t)&&y!==(y=e[1]("modals.actionRequired.paragraph",{values:{wallet:e[0]}})+"")&&Eb(l,y),"MetaMask"===e[0]?w?w.p(e,t):(w=Sx(e),w.c(),w.m(c,null)):w&&(w.d(1),w=null),(!f||2&t)&&v!==(v=e[1]("modals.actionRequired.buttonText")+"")&&Eb(p,v)},i(e){f||(sg(r.$$.fragment,e),f=!0)},o(e){ig(r.$$.fragment,e),f=!1},d(e){e&&fb(t),vg(r),w&&w.d(),m=!1,b()}}}function Bx(e){let t,n;return t=new Pv({props:{close:e[2],$$slots:{default:[Ix]},$$scope:{ctx:e}}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,[n]){const r={};11&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function Tx(e,t,n){let r;Zm(e,Rr,(e=>n(1,r=e)));let{wallet:s}=t;return e.$$set=e=>{"wallet"in e&&n(0,s=e.wallet)},[s,r,function(){Cg.next({inProgress:!1,actionRequired:""})}]}class Mx extends kg{constructor(e){super(),xg(this,e,Tx,Bx,$m,{wallet:0},_x)}}function Ox(e){lb(e,"svelte-w5zexe",".flex{display:flex}.inline-flex{display:inline-flex}.flex-column{flex-direction:column}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-center{justify-content:center}.justify-start{justify-content:flex-start}.justify-between{justify-content:space-between}.justify-end{justify-content:flex-end}.justify-around{justify-content:space-around}.relative{position:relative}.absolute{position:absolute}.fixed{position:fixed}.pointer{cursor:pointer}.shadow-1{box-shadow:var(--onboard-shadow-1, var(--shadow-1))}.w-100{width:100%}*{box-sizing:border-box}input{background:var(--onboard-white, var(--white))}input{width:100%;padding:0.5rem 1rem;outline:2px solid var(--onboard-gray-200, var(--gray-200));border:none;border-radius:8px;font-size:1rem;line-height:1.5;color:var(--onboard-gray-600, var(--gray-600));transition:all 200ms ease-in-out}input[type='checkbox']{-webkit-appearance:none;appearance:none;width:auto;background:var(--onboard-white, var(--white));outline:1px solid var(--onboard-gray-300, var(--gray-300));border:none;padding:0.5em;border-radius:3px;display:flex;justify-content:center;align-items:center;position:relative;cursor:pointer}input[type='checkbox']:hover{border-color:var(\n --onboard-checkbox-background,\n var(--onboard-primary-500, var(--primary-500))\n )}input[type='checkbox']:checked{background:var(\n --onboard-checkbox-background,\n var(--onboard-primary-500, var(--primary-500))\n );border-color:var(\n --onboard-checkbox-background,\n var(--onboard-primary-500, var(--primary-500))\n );color:var(--onboard-checkbox-color, var(--onboard-white, var(--white)))}input[type='checkbox']:checked:after{content:url(\"data:image/svg+xml,%3Csvg width='0.885em' height='0.6em' viewBox='0 0 14 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M0 6L5 11L14 2L12.59 0.58L5 8.17L1.41 4.59L0 6Z' fill='white'/%3E%3C/svg%3E\");font-size:12px;position:absolute;color:var(--onboard-checkbox-color, var(--onboard-white, var(--white)))}input:hover{border-color:var(\n --onboard-checkbox-color,\n var(--onboard-white, var(--white))\n )}input:focus{border-color:var(--onboard-primary-500, var(--primary-500));box-shadow:0 0 1px 1px\n var(\n --onboard-checkbox-background,\n var(--onboard-primary-500, var(--primary-500))\n );box-shadow:0 0 0 1px -moz-mac-focusring}input:disabled, textarea:disabled, select:disabled{background:var(--gray-100)}input::-moz-focus-inner{outline:0;padding:0;margin-top:-2px;margin-bottom:-2px}a{color:var(\n --onboard-link-color,\n var(--onboard-primary-500, var(--primary-500))\n );text-decoration:none}a:hover{text-decoration:underline}button{display:flex;align-items:center;justify-content:center;padding:calc(var(--onboard-spacing-4, var(--spacing-4)) - 1px);border-radius:24px;cursor:pointer;font:inherit;border:none;transition:background-color 150ms ease-in-out, color 150ms ease-in-out}.onboard-button-primary{background:var(--onboard-white, var(--white));padding:calc(var(--onboard-spacing-5, var(--spacing-5)) - 1px)\n calc(var(--onboard-spacing-4, var(--spacing-4)) - 1px);color:var(--onboard-gray-500, var(--gray-500));font-size:var(--onboard-font-size-6, var(--font-size-6));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));border:1px solid var(--onboard-gray-500, var(--gray-500));font-weight:600}.button-neutral-solid{width:100%;border-radius:8px;background:var(--onboard-gray-500, var(--gray-500));color:var(--onboard-white, var(--white));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3))}.button-neutral-solid-b{width:100%;background:var(--onboard-gray-100, var(--gray-100));color:var(--onboard-gray-500, var(--gray-500));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3))}button.rounded{border-radius:24px}.button-neutral-solid:hover{background:var(--onboard-gray-700, var(--gray-700))}.button-neutral-solid-b:hover{background:var(--onboard-gray-200, var(--gray-200))}.button-neutral-solid:active{color:var(--onboard-gray-300, var(--gray-300))}.button-neutral-solid-b:active{color:var(--onboard-gray-600, var(--gray-600));background:var(--onboard-gray-300, var(--gray-300))}.container.svelte-w5zexe{padding:16px;font-family:var(--onboard-font-family-normal, var(--font-family-normal));pointer-events:none;touch-action:none;width:100%}.z-indexed.svelte-w5zexe{z-index:var(--account-center-z-index)}@media all and (min-width: 428px){.container.svelte-w5zexe{max-width:348px}}")}function Nx(e){let t,n;return t=new gx({props:{autoSelect:e[8].autoSelect}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,n){const r={};256&n&&(r.autoSelect=e[8].autoSelect),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function Rx(e){let t,n;return t=new Mx({props:{wallet:e[8].actionRequired}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,n){const r={};256&n&&(r.wallet=e[8].actionRequired),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function Fx(e){let t,n;return t=new kx({}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function jx(e){let t;return{c(){t=bb("div"),kb(t,"class","container flex flex-column fixed z-indexed svelte-w5zexe"),kb(t,"style","top: 0; right: 0; "+("mobile"===e[11].type?"padding-bottom: 0;":"")),kb(t,"id","w3o-transaction-preview-container")},m(e,n){pb(e,t,n)},p:Um,d(e){e&&fb(t)}}}function Lx(e){let t,n,r,s,i,a,o,c,l=e[3].position.includes("bottom")&&e[1].position.includes("bottom")&&e[7],u=e[1].position.includes("bottom"),d=e[1].position.includes("top"),h=e[3].position.includes("top")&&e[1].position.includes("top")&&e[7],p=l&&Ux(e),f=u&&Gx(),m={ctx:e,current:null,token:null,hasCatch:!1,pending:Vx,then:$x,catch:qx,value:23,blocks:[,,,]};ug(e[16],m);let b=d&&Wx(),g=h&&Zx(e);return{c(){t=bb("div"),p&&p.c(),n=yb(),f&&f.c(),r=yb(),s=bb("div"),m.block.c(),i=yb(),b&&b.c(),a=yb(),g&&g.c(),kb(s,"id","account-center-with-notify"),kb(t,"class","container flex flex-column fixed z-indexed svelte-w5zexe"),kb(t,"style",o=e[15](hk)[e[1].position]+"; "+("mobile"===e[11].type&&e[1].position.includes("top")?"padding-bottom: 0;":"mobile"===e[11].type&&e[1].position.includes("bottom")?"padding-top:0;":""))},m(e,o){pb(e,t,o),p&&p.m(t,null),cb(t,n),f&&f.m(t,null),cb(t,r),cb(t,s),m.block.m(s,m.anchor=null),m.mount=()=>s,m.anchor=null,cb(t,i),b&&b.m(t,null),cb(t,a),g&&g.m(t,null),c=!0},p(s,i){e=s,138&i&&(l=e[3].position.includes("bottom")&&e[1].position.includes("bottom")&&e[7]),l?p?(p.p(e,i),138&i&&sg(p,1)):(p=Ux(e),p.c(),sg(p,1),p.m(t,n)):p&&(ng(),ig(p,1,1,(()=>{p=null})),rg()),2&i&&(u=e[1].position.includes("bottom")),u?f||(f=Gx(),f.c(),f.m(t,r)):f&&(f.d(1),f=null),dg(m,e,i),2&i&&(d=e[1].position.includes("top")),d?b||(b=Wx(),b.c(),b.m(t,a)):b&&(b.d(1),b=null),138&i&&(h=e[3].position.includes("top")&&e[1].position.includes("top")&&e[7]),h?g?(g.p(e,i),138&i&&sg(g,1)):(g=Zx(e),g.c(),sg(g,1),g.m(t,null)):g&&(ng(),ig(g,1,1,(()=>{g=null})),rg()),(!c||2&i&&o!==(o=e[15](hk)[e[1].position]+"; "+("mobile"===e[11].type&&e[1].position.includes("top")?"padding-bottom: 0;":"mobile"===e[11].type&&e[1].position.includes("bottom")?"padding-top:0;":"")))&&kb(t,"style",o)},i(e){c||(sg(p),sg(m.block),sg(g),c=!0)},o(e){ig(p);for(let e=0;e<3;e+=1){ig(m.blocks[e])}ig(g),c=!1},d(e){e&&fb(t),p&&p.d(),f&&f.d(),m.block.d(),m.token=null,m=null,b&&b.d(),g&&g.d()}}}function Ux(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:Hx,then:zx,catch:Dx,value:22,blocks:[,,,]};return ug(e[17],r),{c(){t=vb(),r.block.c()},m(e,s){pb(e,t,s),r.block.m(e,r.anchor=s),r.mount=()=>t.parentNode,r.anchor=t,n=!0},p(t,n){dg(r,e=t,n)},i(e){n||(sg(r.block),n=!0)},o(e){for(let e=0;e<3;e+=1){ig(r.blocks[e])}n=!1},d(e){e&&fb(t),r.block.d(e),r.token=null,r=null}}}function Dx(e){return{c:Um,m:Um,p:Um,i:Um,o:Um,d:Um}}function zx(e){let t,n,r=e[22]&&function(e){let t,n,r;var s=e[22];function i(e){return{props:{notifications:e[10],position:e[3].position,sharedContainer:e[0]}}}s&&(t=Sb(s,i(e)));return{c(){t&&gg(t.$$.fragment),n=vb()},m(e,s){t&&yg(t,e,s),pb(e,n,s),r=!0},p(e,r){const a={};if(1024&r&&(a.notifications=e[10]),8&r&&(a.position=e[3].position),1&r&&(a.sharedContainer=e[0]),s!==(s=e[22])){if(t){ng();const e=t;ig(e.$$.fragment,1,0,(()=>{vg(e,1)})),rg()}s?(t=Sb(s,i(e)),gg(t.$$.fragment),sg(t.$$.fragment,1),yg(t,n.parentNode,n)):t=null}else s&&t.$set(a)},i(e){r||(t&&sg(t.$$.fragment,e),r=!0)},o(e){t&&ig(t.$$.fragment,e),r=!1},d(e){e&&fb(n),t&&vg(t,e)}}}(e);return{c(){r&&r.c(),t=vb()},m(e,s){r&&r.m(e,s),pb(e,t,s),n=!0},p(e,t){e[22]&&r.p(e,t)},i(e){n||(sg(r),n=!0)},o(e){ig(r),n=!1},d(e){r&&r.d(e),e&&fb(t)}}}function Hx(e){return{c:Um,m:Um,p:Um,i:Um,o:Um,d:Um}}function Gx(e){let t;return{c(){t=bb("div"),kb(t,"id","w3o-transaction-preview-container"),Ab(t,"margin-bottom","8px")},m(e,n){pb(e,t,n)},d(e){e&&fb(t)}}}function qx(e){return{c:Um,m:Um,p:Um,i:Um,o:Um,d:Um}}function $x(e){let t,n,r=e[23]&&function(e){let t,n,r;var s=e[23];function i(e){return{}}s&&(t=Sb(s,i()));return{c(){t&&gg(t.$$.fragment),n=vb()},m(e,s){t&&yg(t,e,s),pb(e,n,s),r=!0},p(e,r){if(s!==(s=e[23])){if(t){ng();const e=t;ig(e.$$.fragment,1,0,(()=>{vg(e,1)})),rg()}s?(t=Sb(s,i()),gg(t.$$.fragment),sg(t.$$.fragment,1),yg(t,n.parentNode,n)):t=null}},i(e){r||(t&&sg(t.$$.fragment,e),r=!0)},o(e){t&&ig(t.$$.fragment,e),r=!1},d(e){e&&fb(n),t&&vg(t,e)}}}(e);return{c(){r&&r.c(),t=vb()},m(e,s){r&&r.m(e,s),pb(e,t,s),n=!0},p(e,t){e[23]&&r.p(e,t)},i(e){n||(sg(r),n=!0)},o(e){ig(r),n=!1},d(e){r&&r.d(e),e&&fb(t)}}}function Vx(e){return{c:Um,m:Um,p:Um,i:Um,o:Um,d:Um}}function Wx(e){let t;return{c(){t=bb("div"),kb(t,"id","w3o-transaction-preview-container"),Ab(t,"margin-top","8px")},m(e,n){pb(e,t,n)},d(e){e&&fb(t)}}}function Zx(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:Yx,then:Kx,catch:Qx,value:22,blocks:[,,,]};return ug(e[17],r),{c(){t=vb(),r.block.c()},m(e,s){pb(e,t,s),r.block.m(e,r.anchor=s),r.mount=()=>t.parentNode,r.anchor=t,n=!0},p(t,n){dg(r,e=t,n)},i(e){n||(sg(r.block),n=!0)},o(e){for(let e=0;e<3;e+=1){ig(r.blocks[e])}n=!1},d(e){e&&fb(t),r.block.d(e),r.token=null,r=null}}}function Qx(e){return{c:Um,m:Um,p:Um,i:Um,o:Um,d:Um}}function Kx(e){let t,n,r=e[22]&&function(e){let t,n,r;var s=e[22];function i(e){return{props:{notifications:e[10],position:e[3].position,sharedContainer:e[0]}}}s&&(t=Sb(s,i(e)));return{c(){t&&gg(t.$$.fragment),n=vb()},m(e,s){t&&yg(t,e,s),pb(e,n,s),r=!0},p(e,r){const a={};if(1024&r&&(a.notifications=e[10]),8&r&&(a.position=e[3].position),1&r&&(a.sharedContainer=e[0]),s!==(s=e[22])){if(t){ng();const e=t;ig(e.$$.fragment,1,0,(()=>{vg(e,1)})),rg()}s?(t=Sb(s,i(e)),gg(t.$$.fragment),sg(t.$$.fragment,1),yg(t,n.parentNode,n)):t=null}else s&&t.$set(a)},i(e){r||(t&&sg(t.$$.fragment,e),r=!0)},o(e){t&&ig(t.$$.fragment,e),r=!1},d(e){e&&fb(n),t&&vg(t,e)}}}(e);return{c(){r&&r.c(),t=vb()},m(e,s){r&&r.m(e,s),pb(e,t,s),n=!0},p(e,t){e[22]&&r.p(e,t)},i(e){n||(sg(r),n=!0)},o(e){ig(r),n=!1},d(e){r&&r.d(e),e&&fb(t)}}}function Yx(e){return{c:Um,m:Um,p:Um,i:Um,o:Um,d:Um}}function Jx(e){let t,n,r,s,i,a,o=e[1].position.includes("bottom"),c=e[1].position.includes("top"),l=o&&Xx(),u=e[1].enabled&&e[2].length&&ek(e),d=c&&sk();return{c(){t=bb("div"),l&&l.c(),n=yb(),r=bb("div"),u&&u.c(),s=yb(),d&&d.c(),kb(t,"class","container flex flex-column fixed z-indexed svelte-w5zexe"),kb(t,"style",i=e[15](hk)[e[1].position]+"; "+("mobile"===e[11].type&&e[1].position.includes("top")?"padding-bottom: 0;":"mobile"===e[11].type&&e[1].position.includes("bottom")?"padding-top:0;":""))},m(e,i){pb(e,t,i),l&&l.m(t,null),cb(t,n),cb(t,r),u&&u.m(r,null),cb(t,s),d&&d.m(t,null),a=!0},p(e,s){2&s&&(o=e[1].position.includes("bottom")),o?l||(l=Xx(),l.c(),l.m(t,n)):l&&(l.d(1),l=null),e[1].enabled&&e[2].length?u?(u.p(e,s),6&s&&sg(u,1)):(u=ek(e),u.c(),sg(u,1),u.m(r,null)):u&&(ng(),ig(u,1,1,(()=>{u=null})),rg()),2&s&&(c=e[1].position.includes("top")),c?d||(d=sk(),d.c(),d.m(t,null)):d&&(d.d(1),d=null),(!a||2&s&&i!==(i=e[15](hk)[e[1].position]+"; "+("mobile"===e[11].type&&e[1].position.includes("top")?"padding-bottom: 0;":"mobile"===e[11].type&&e[1].position.includes("bottom")?"padding-top:0;":"")))&&kb(t,"style",i)},i(e){a||(sg(u),a=!0)},o(e){ig(u),a=!1},d(e){e&&fb(t),l&&l.d(),u&&u.d(),d&&d.d()}}}function Xx(e){let t;return{c(){t=bb("div"),kb(t,"id","w3o-transaction-preview-container"),Ab(t,"margin-bottom","8px")},m(e,n){pb(e,t,n)},d(e){e&&fb(t)}}}function ek(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:rk,then:nk,catch:tk,value:23,blocks:[,,,]};return ug(e[16],r),{c(){t=vb(),r.block.c()},m(e,s){pb(e,t,s),r.block.m(e,r.anchor=s),r.mount=()=>t.parentNode,r.anchor=t,n=!0},p(t,n){dg(r,e=t,n)},i(e){n||(sg(r.block),n=!0)},o(e){for(let e=0;e<3;e+=1){ig(r.blocks[e])}n=!1},d(e){e&&fb(t),r.block.d(e),r.token=null,r=null}}}function tk(e){return{c:Um,m:Um,p:Um,i:Um,o:Um,d:Um}}function nk(e){let t,n,r=e[23]&&function(e){let t,n,r;var s=e[23];function i(e){return{}}s&&(t=Sb(s,i()));return{c(){t&&gg(t.$$.fragment),n=vb()},m(e,s){t&&yg(t,e,s),pb(e,n,s),r=!0},p(e,r){if(s!==(s=e[23])){if(t){ng();const e=t;ig(e.$$.fragment,1,0,(()=>{vg(e,1)})),rg()}s?(t=Sb(s,i()),gg(t.$$.fragment),sg(t.$$.fragment,1),yg(t,n.parentNode,n)):t=null}},i(e){r||(t&&sg(t.$$.fragment,e),r=!0)},o(e){t&&ig(t.$$.fragment,e),r=!1},d(e){e&&fb(n),t&&vg(t,e)}}}(e);return{c(){r&&r.c(),t=vb()},m(e,s){r&&r.m(e,s),pb(e,t,s),n=!0},p(e,t){e[23]&&r.p(e,t)},i(e){n||(sg(r),n=!0)},o(e){ig(r),n=!1},d(e){r&&r.d(e),e&&fb(t)}}}function rk(e){return{c:Um,m:Um,p:Um,i:Um,o:Um,d:Um}}function sk(e){let t;return{c(){t=bb("div"),kb(t,"id","w3o-transaction-preview-container"),Ab(t,"margin-top","8px")},m(e,n){pb(e,t,n)},d(e){e&&fb(t)}}}function ik(e){let t,n,r,s,i,a=e[3].position.includes("top"),o=e[3].position.includes("bottom"),c=a&&ak(),l={ctx:e,current:null,token:null,hasCatch:!1,pending:lk,then:ck,catch:ok,value:22,blocks:[,,,]};ug(e[17],l);let u=o&&uk();return{c(){t=bb("div"),c&&c.c(),n=yb(),l.block.c(),r=yb(),u&&u.c(),kb(t,"class","container flex flex-column fixed z-indexed svelte-w5zexe"),kb(t,"style",s=e[15](pk)[e[3].position]+"; "+("mobile"===e[11].type&&e[3].position.includes("top")?"padding-bottom: 0;":"mobile"===e[11].type&&e[3].position.includes("bottom")?"padding-top:0;":""))},m(e,s){pb(e,t,s),c&&c.m(t,null),cb(t,n),l.block.m(t,l.anchor=null),l.mount=()=>t,l.anchor=r,cb(t,r),u&&u.m(t,null),i=!0},p(r,d){e=r,8&d&&(a=e[3].position.includes("top")),a?c||(c=ak(),c.c(),c.m(t,n)):c&&(c.d(1),c=null),dg(l,e,d),8&d&&(o=e[3].position.includes("bottom")),o?u||(u=uk(),u.c(),u.m(t,null)):u&&(u.d(1),u=null),(!i||8&d&&s!==(s=e[15](pk)[e[3].position]+"; "+("mobile"===e[11].type&&e[3].position.includes("top")?"padding-bottom: 0;":"mobile"===e[11].type&&e[3].position.includes("bottom")?"padding-top:0;":"")))&&kb(t,"style",s)},i(e){i||(sg(l.block),i=!0)},o(e){for(let e=0;e<3;e+=1){ig(l.blocks[e])}i=!1},d(e){e&&fb(t),c&&c.d(),l.block.d(),l.token=null,l=null,u&&u.d()}}}function ak(e){let t;return{c(){t=bb("div"),kb(t,"id","w3o-transaction-preview-container")},m(e,n){pb(e,t,n)},d(e){e&&fb(t)}}}function ok(e){return{c:Um,m:Um,p:Um,i:Um,o:Um,d:Um}}function ck(e){let t,n,r=e[22]&&function(e){let t,n,r;var s=e[22];function i(e){return{props:{notifications:e[10],position:e[3].position,sharedContainer:e[0]}}}s&&(t=Sb(s,i(e)));return{c(){t&&gg(t.$$.fragment),n=vb()},m(e,s){t&&yg(t,e,s),pb(e,n,s),r=!0},p(e,r){const a={};if(1024&r&&(a.notifications=e[10]),8&r&&(a.position=e[3].position),1&r&&(a.sharedContainer=e[0]),s!==(s=e[22])){if(t){ng();const e=t;ig(e.$$.fragment,1,0,(()=>{vg(e,1)})),rg()}s?(t=Sb(s,i(e)),gg(t.$$.fragment),sg(t.$$.fragment,1),yg(t,n.parentNode,n)):t=null}else s&&t.$set(a)},i(e){r||(t&&sg(t.$$.fragment,e),r=!0)},o(e){t&&ig(t.$$.fragment,e),r=!1},d(e){e&&fb(n),t&&vg(t,e)}}}(e);return{c(){r&&r.c(),t=vb()},m(e,s){r&&r.m(e,s),pb(e,t,s),n=!0},p(e,t){e[22]&&r.p(e,t)},i(e){n||(sg(r),n=!0)},o(e){ig(r),n=!1},d(e){r&&r.d(e),e&&fb(t)}}}function lk(e){return{c:Um,m:Um,p:Um,i:Um,o:Um,d:Um}}function uk(e){let t;return{c(){t=bb("div"),kb(t,"id","w3o-transaction-preview-container")},m(e,n){pb(e,t,n)},d(e){e&&fb(t)}}}function dk(e){let t,n,r,s,i,a,o,c,l=e[8].inProgress&&Nx(e),u=e[8].actionRequired&&Rx(e),d=e[9]&&Fx(),h=!e[1].enabled&&!e[3].enabled&&jx(e),p=e[4]&&Lx(e),f=e[5]&&Jx(e),m=e[6]&&ik(e);return{c(){l&&l.c(),t=yb(),u&&u.c(),n=yb(),d&&d.c(),r=yb(),h&&h.c(),s=yb(),p&&p.c(),i=yb(),f&&f.c(),a=yb(),m&&m.c(),o=vb()},m(e,b){l&&l.m(e,b),pb(e,t,b),u&&u.m(e,b),pb(e,n,b),d&&d.m(e,b),pb(e,r,b),h&&h.m(e,b),pb(e,s,b),p&&p.m(e,b),pb(e,i,b),f&&f.m(e,b),pb(e,a,b),m&&m.m(e,b),pb(e,o,b),c=!0},p(e,[c]){e[8].inProgress?l?(l.p(e,c),256&c&&sg(l,1)):(l=Nx(e),l.c(),sg(l,1),l.m(t.parentNode,t)):l&&(ng(),ig(l,1,1,(()=>{l=null})),rg()),e[8].actionRequired?u?(u.p(e,c),256&c&&sg(u,1)):(u=Rx(e),u.c(),sg(u,1),u.m(n.parentNode,n)):u&&(ng(),ig(u,1,1,(()=>{u=null})),rg()),e[9]?d?512&c&&sg(d,1):(d=Fx(),d.c(),sg(d,1),d.m(r.parentNode,r)):d&&(ng(),ig(d,1,1,(()=>{d=null})),rg()),e[1].enabled||e[3].enabled?h&&(h.d(1),h=null):h?h.p(e,c):(h=jx(e),h.c(),h.m(s.parentNode,s)),e[4]?p?(p.p(e,c),16&c&&sg(p,1)):(p=Lx(e),p.c(),sg(p,1),p.m(i.parentNode,i)):p&&(ng(),ig(p,1,1,(()=>{p=null})),rg()),e[5]?f?(f.p(e,c),32&c&&sg(f,1)):(f=Jx(e),f.c(),sg(f,1),f.m(a.parentNode,a)):f&&(ng(),ig(f,1,1,(()=>{f=null})),rg()),e[6]?m?(m.p(e,c),64&c&&sg(m,1)):(m=ik(e),m.c(),sg(m,1),m.m(o.parentNode,o)):m&&(ng(),ig(m,1,1,(()=>{m=null})),rg())},i(e){c||(sg(l),sg(u),sg(d),sg(p),sg(f),sg(m),c=!0)},o(e){ig(l),ig(u),ig(d),ig(p),ig(f),ig(m),c=!1},d(e){l&&l.d(e),e&&fb(t),u&&u.d(e),e&&fb(n),d&&d.d(e),e&&fb(r),h&&h.d(e),e&&fb(s),p&&p.d(e),e&&fb(i),f&&f.d(e),e&&fb(a),m&&m.d(e),e&&fb(o)}}}const hk="account-center",pk="notify-onboard-container";function fk(e,t,n){let r,s,i,a,o,c,l,u,d,h,p,f;Zm(e,_g,(e=>n(2,u=e))),Zm(e,Cg,(e=>n(8,h=e))),Zm(e,Pg,(e=>n(9,p=e)));const{device:m,containerElements:b}=hm,g=Lm.select("accountCenter").pipe(De(Lm.get().accountCenter),Ue(1));Zm(e,g,(e=>n(1,l=e)));const y=Lm.select("notify").pipe(De(Lm.get().notify),Ue(1));Zm(e,y,(e=>n(3,d=e)));const v=Lm.select("notifications").pipe(De(Lm.get().notifications));Zm(e,v,(e=>n(10,f=e)));const w=l.enabled?Promise.resolve().then((function(){return Lwe})).then((e=>e.default)):Promise.resolve(null),x=d.enabled?Promise.resolve().then((function(){return Sxe})).then((e=>e.default)):Promise.resolve(null),k=l.enabled&&b&&b.accountCenter;if(k){((e,t,n,r)=>{const s=e.attachShadow({mode:"open"});let i=document.querySelector("onboard-v2").shadowRoot.styleSheets;const a=new CSSStyleSheet;Object.values(i).forEach((e=>{Object.values(e.cssRules).forEach((e=>a.insertRule(e.cssText)))})),s.adoptedStyleSheets=[a];const o=document.querySelector(t);if(o.appendChild(e),!o)throw new Error(`Element with query ${t} does not exist.`);(async()=>{let e=await n;e&&new e({target:s,props:{settings:r,mountInContainer:!0}})})()})(document.createElement("onboard-account-center"),k,w,l)}return e.$$.update=()=>{10&e.$$.dirty&&n(0,r=!k&&l.enabled&&d.enabled&&d.position===l.position),10&e.$$.dirty&&n(7,s="mobile"===m.type||l.position===d.position),10&e.$$.dirty&&n(18,i=d.position.includes("bottom")&&l.position.includes("bottom")||d.position.includes("top")&&l.position.includes("top")),262158&e.$$.dirty&&n(6,a=d.enabled&&(!l.enabled||k||d.position!==l.position&&"mobile"!==m.type||"mobile"===m.type&&!i||!u.length)),262158&e.$$.dirty&&n(5,o=l.enabled&&(!d.enabled||d.position!==l.position&&"mobile"!==m.type||"mobile"===m.type&&!i)&&u.length),262159&e.$$.dirty&&n(4,c=d.enabled&&l.enabled&&(r||"mobile"===m.type&&i)&&u.length)},[r,l,u,d,c,o,a,s,h,p,f,m,g,y,v,e=>({topLeft:`\n top: var(--${e}-position-top, 0); \n left: var(--${e}-position-left, 0);`,topRight:`\n top: var(--${e}-position-top, 0); \n right: var(--${e}-position-right, 0);`,bottomRight:`\n bottom: var(--${e}-position-bottom, 0); \n right: var(--${e}-position-right, 0);`,bottomLeft:`\n bottom: var(--${e}-position-bottom, 0); \n left: var(--${e}-position-left, 0);`}),w,x,i]}let mk,bk=class extends kg{constructor(e){super(),xg(this,e,fk,dk,$m,{},Ox)}};Lm.select("notifications").subscribe((e=>{mk=e}));const gk=(e,t)=>({eventCode:e,type:ov(e),id:t,key:yk(t,e),message:wk(e),startTime:Date.now(),network:Object.keys(nm).find((e=>nm[e]===Lm.get().chains[0].id)),autoDismiss:0}),yk=(e,t)=>`${e}-${t}`,vk=e=>`${e}-preflight`,wk=e=>{const t=Vy.notify;return t.transaction,t.transaction[e]};const xk=async(e,t)=>{if(!e||!t)return Promise.resolve([]);const n=e();if(!n.then)throw new Error("The `estimateGas` function must return a Promise");const r=t();if(!r.then)throw new Error("The `gasPrice` function must return a Promise");return Promise.all([n,r]).then((([e,t])=>{if("string"!=typeof e)throw new Error(`The Promise returned from calling 'estimateGas' must resolve with a value of type 'string'. Received a value of: ${e} with a type: ${typeof e}`);if("string"!=typeof t)throw new Error(`The Promise returned from calling 'gasPrice' must resolve with a value of type 'string'. Received a value of: ${t} with a type: ${typeof t}`);return[BigInt(e),BigInt(t)]})).catch((e=>{throw new Error(`There was an error getting gas estimates: ${e}`)}))},kk={connectWallet:$y,disconnectWallet:hv,setChain:pv,state:{get:Lm.get,select:Lm.select,actions:{setWalletModules:Dy,setLocale:function(e){const t=Ay(e);if(t)throw t;jm({type:Sm,payload:e})},updateNotify:Fy,customNotification:function(e){const t=_y(e);if(t)throw t;const n=`customNotification-${Fr()}`,r=Object.assign(Object.assign({},e),{id:n,key:n});Ly(r);const s=()=>{r.id&&Uy(r.id)},i=t=>{const n=_y(e);if(n)throw n;return Ly(Object.assign(Object.assign({},t),{id:r.id,key:r.key})),{dismiss:s,update:i}};return Ly(r),{dismiss:s,update:i}},preflightNotifications:async function(e){const t=Ma(gy,e);if(t)throw t;const{sendTransaction:n,estimateGas:r,gasPrice:s,balance:i,txDetails:a,txApproveReminderTimeout:o}=e,c=o&&o>3e3?o:15e3,[l,u]=await xk(r||(()=>Promise.resolve("")),s||(()=>Promise.resolve(""))),d=vk(Fr()),h=BigInt(a&&a.value||0);if(i&&l&&u){const e=BigInt(l)*BigInt(u)+h;if(Sa(e)>Sa(_a(i))){jy(gk("nsfFail",d))}}const p=mk.find((e=>"txRequest"===e.eventCode));if(p){jy(gk("txAwaitingApproval",p.id))}if(setTimeout((()=>{const e=mk.find((e=>e.id===d&&"txRequest"===e.eventCode));if(e){jy(gk("txConfirmReminder",e.id))}}),c),jy(gk("txRequest",d)),!n)return d;let f;try{f=await n()}catch(e){const{eventCode:t,errorMsg:n}=function(e){if(!e.stack||!e.message)return{eventCode:"txError",errorMsg:"An unknown error occurred"};const t=e.stack||e.message;if(t.includes("User denied transaction signature"))return{eventCode:"txSendFail",errorMsg:"User denied transaction signature"};if(t.includes("transaction underpriced"))return{eventCode:"txUnderpriced",errorMsg:"Transaction is under priced"};return{eventCode:"txError",errorMsg:t}}(e);return jy(gk(t,d)),void console.error(n)}return Uy(d),f||void 0},updateBalances:sv,updateAccountCenter:Ny,setPrimaryWallet:My,updateTheme:Hy,updateAppMetadata:Gy}}};const Ek=(e,t)=>!!t||(!(!document.body||!getComputedStyle(document.body).getPropertyValue("--onboard-font-family-normal")&&!getComputedStyle(document.body).getPropertyValue("--w3o-font-family"))||!!e&&!("object"!=typeof e||!e["--w3o-font-family"])),Ak=async()=>{const{InterVar:e}=await Promise.resolve().then((function(){return ja})),t=document.createElement("style");t.innerHTML=`\n ${e}\n `,document.body.appendChild(t)},Ck=async(e,t)=>{const n=[],r=e;if(t.autoConnectAllPreviousWallet)for(let e=r.length;e--;){(await kk.connectWallet({autoSelect:{label:r[e],disableModals:!0}})).some((t=>t.label===r[e]))&&n.unshift(r[e])}else kk.connectWallet({autoSelect:{label:r[0],disableModals:!0}}),n.push(r[0]);um(mm.LAST_CONNECTED_WALLET,JSON.stringify(n))};var Pk={exports:{}};!function(e,t){var n=200,r="__lodash_hash_undefined__",s=1,i=2,a=1/0,o=9007199254740991,c="[object Arguments]",l="[object Array]",u="[object Boolean]",d="[object Date]",h="[object Error]",p="[object Function]",f="[object GeneratorFunction]",m="[object Map]",b="[object Number]",g="[object Object]",y="[object Promise]",v="[object RegExp]",w="[object Set]",x="[object String]",k="[object Symbol]",E="[object WeakMap]",A="[object ArrayBuffer]",C="[object DataView]",P=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_=/^\w*$/,S=/^\./,I=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/\\(\\)?/g,T=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,O={};O["[object Float32Array]"]=O["[object Float64Array]"]=O["[object Int8Array]"]=O["[object Int16Array]"]=O["[object Int32Array]"]=O["[object Uint8Array]"]=O["[object Uint8ClampedArray]"]=O["[object Uint16Array]"]=O["[object Uint32Array]"]=!0,O[c]=O[l]=O[A]=O[u]=O[C]=O[d]=O[h]=O[p]=O[m]=O[b]=O[g]=O[v]=O[w]=O[x]=O[E]=!1;var N="object"==typeof qe&&qe&&qe.Object===Object&&qe,R="object"==typeof self&&self&&self.Object===Object&&self,F=N||R||Function("return this")(),j=t&&!t.nodeType&&t,L=j&&e&&!e.nodeType&&e,U=L&&L.exports===j&&N.process,D=function(){try{return U&&U.binding("util")}catch(e){}}(),z=D&&D.isTypedArray;function H(e,t){return!!(e?e.length:0)&&function(e,t,n){if(t!=t)return function(e,t,n){var r=e.length,s=n+-1;for(;++s-1}function G(e,t){for(var n=-1,r=e?e.length:0;++n-1},Pe.prototype.set=function(e,t){var n=this.__data__,r=Te(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},_e.prototype.clear=function(){this.__data__={hash:new Ce,map:new(he||Pe),string:new Ce}},_e.prototype.delete=function(e){return ze(this,e).delete(e)},_e.prototype.get=function(e){return ze(this,e).get(e)},_e.prototype.has=function(e){return ze(this,e).has(e)},_e.prototype.set=function(e,t){return ze(this,e).set(e,t),this},Se.prototype.add=Se.prototype.push=function(e){return this.__data__.set(e,r),this},Se.prototype.has=function(e){return this.__data__.has(e)},Ie.prototype.clear=function(){this.__data__=new Pe},Ie.prototype.delete=function(e){return this.__data__.delete(e)},Ie.prototype.get=function(e){return this.__data__.get(e)},Ie.prototype.has=function(e){return this.__data__.has(e)},Ie.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Pe){var s=r.__data__;if(!he||s.lengthl))return!1;var d=o.get(e);if(d&&o.get(t))return d==t;var h=-1,p=!0,f=a&s?new Se:void 0;for(o.set(e,t),o.set(t,e);++h-1&&e%1==0&&e-1&&e%1==0&&e<=o}function it(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function at(e){return!!e&&"object"==typeof e}function ot(e){return"symbol"==typeof e||at(e)&&se.call(e)==k}var ct=z?function(e){return function(t){return e(t)}}(z):function(e){return at(e)&&st(e.length)&&!!O[se.call(e)]};function lt(e){return nt(e)?Be(e):je(e)}function ut(e){return e}e.exports=function(e,t){return e&&e.length?function(e,t,r){var s=-1,i=H,a=e.length,o=!0,c=[],l=c;if(a>=n){var u=t?null:Ue(e);if(u)return Z(u);o=!1,i=$,l=new Se}else l=t?[]:c;e:for(;++s({provider:window.ethereum.providers&&Array.isArray(window.ethereum.providers)?Nk(e,t):window.ethereum})}function Nk(e,t){return window.ethereum.providers.find((n=>t?!!n[e]&&!Rk(e,n):!!n[e]))}function Rk(e,t){const n=Object.values(_k).filter((t=>t!==e&&t!==_k.Detected));return n.some((e=>!!t[e]))}const Fk={label:Ik.MetaMask,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.MetaMask]&&!Rk(_k.MetaMask,e),getIcon:async()=>(await Promise.resolve().then((function(){return Ixe}))).default,getInterface:Ok(_k.MetaMask,!0),platforms:["all"],externalUrl:Sk.MetaMask},jk={label:Ik.InfinityWallet,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.InfinityWallet],getIcon:async()=>(await Promise.resolve().then((function(){return Bxe}))).default,getInterface:Ok(_k.InfinityWallet),platforms:["desktop"]},Lk={label:Ik.Exodus,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Exodus],getIcon:async()=>(await Promise.resolve().then((function(){return Txe}))).default,getInterface:Ok(_k.Exodus),platforms:["all"]},Uk={label:Ik.Frontier,injectedNamespace:Bk.Frontier,checkProviderIdentity:({provider:e})=>!!e&&!!e.ethereum&&!!e.ethereum[_k.Frontier],getIcon:async()=>(await Promise.resolve().then((function(){return Mxe}))).default,getInterface:async()=>({provider:Dr(window.frontier.ethereum)}),platforms:["all"]},Dk={label:Ik.Brave,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.BraveWallet],getIcon:async()=>(await Promise.resolve().then((function(){return Oxe}))).default,getInterface:Ok(_k.BraveWallet),platforms:["all"]},zk={label:Ik.Binance,injectedNamespace:Bk.Binance,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Binance],getIcon:async()=>(await Promise.resolve().then((function(){return Nxe}))).default,getInterface:async()=>{let e={...window.BinanceChain};window.BinanceChain=e;const t=window.BinanceChain.on.bind(window.BinanceChain);window.BinanceChain.on=(e,n)=>{t(e,"chainChanged"===e?e=>{n(`0x${parseInt(e).toString(16)}`)}:n)};const n=Dr(window.BinanceChain,{eth_chainId:({baseRequest:e})=>e({method:"eth_chainId"}).then((e=>`0x${parseInt(e).toString(16)}`)),eth_selectAccounts:Mk,wallet_switchEthereumChain:Mk});return n.removeListener=(e,t)=>{},{provider:n}},platforms:["desktop"],externalUrl:Sk.Binance},Hk={label:Ik.Coinbase,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Coinbase]||!!e&&!!e[_k.CoinbaseExtension],getIcon:async()=>(await Promise.resolve().then((function(){return Rxe}))).default,getInterface:async()=>{const{provider:e}=await Ok(_k.CoinbaseExtension)(),t=e.on.bind(e);return e.on=(e,n)=>{t(e,"chainChanged"===e?e=>{n(`0x${parseInt(e).toString(16)}`)}:n)},{provider:e}},platforms:["all"],externalUrl:Sk.Coinbase},Gk={label:Ik.Detected,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Detected],getIcon:async()=>(await Promise.resolve().then((function(){return Fxe}))).default,getInterface:async()=>({provider:window.ethereum}),platforms:["all"]},qk={label:Ik.Trust,injectedNamespace:Bk.Trust,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Trust],getIcon:async()=>(await Promise.resolve().then((function(){return jxe}))).default,getInterface:async()=>{let e;return e=window.hasOwnProperty(Bk.Ethereum)&&window[Bk.Ethereum].isTrust?window[Bk.Ethereum]:window[Bk.Trust],{provider:e}},platforms:["all"],externalUrl:Sk.Trust},$k={label:Ik.Opera,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Opera],getIcon:async()=>(await Promise.resolve().then((function(){return Lxe}))).default,getInterface:async()=>({provider:Dr(window.ethereum,{eth_requestAccounts:async({baseRequest:e})=>e({method:"eth_accounts"}),eth_selectAccounts:Mk})}),platforms:["all"]},Vk={label:Ik.Status,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Status],getIcon:async()=>(await Promise.resolve().then((function(){return Uxe}))).default,getInterface:async()=>({provider:window.ethereum}),platforms:["mobile"]},Wk={label:Ik.AlphaWallet,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.AlphaWallet],getIcon:async()=>(await Promise.resolve().then((function(){return Dxe}))).default,getInterface:async()=>({provider:Dr(window.ethereum,{wallet_switchEthereumChain:Mk,eth_selectAccounts:Mk})}),platforms:["mobile"]},Zk={label:Ik.ApexWallet,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.ApexWallet],getIcon:async()=>(await Promise.resolve().then((function(){return zxe}))).default,getInterface:async()=>({provider:window.ethereum}),platforms:["desktop","Chrome","Chromium","Microsoft Edge"]},Qk={label:Ik.AToken,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.AToken],getIcon:async()=>(await Promise.resolve().then((function(){return Hxe}))).default,getInterface:async()=>({provider:window.ethereum}),platforms:["mobile"]},Kk={label:Ik.BifrostWallet,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.BifrostWallet],getIcon:async()=>(await Promise.resolve().then((function(){return Gxe}))).default,getInterface:Ok(_k.BifrostWallet),platforms:["all"]},Yk={label:Ik.Bitpie,injectedNamespace:Bk.Ethereum,checkProviderIdentity:()=>!!window.Bitpie,getIcon:async()=>(await Promise.resolve().then((function(){return qxe}))).default,getInterface:async()=>({provider:Dr(window.ethereum,{wallet_switchEthereumChain:Mk,eth_selectAccounts:Mk})}),platforms:["mobile"]},Jk={label:Ik.BlockWallet,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.BlockWallet],getIcon:async()=>(await Promise.resolve().then((function(){return $xe}))).default,getInterface:Ok(_k.BlockWallet),platforms:["desktop"]},Xk={label:Ik.Frame,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Frame],getIcon:async()=>(await Promise.resolve().then((function(){return Vxe}))).default,getInterface:async()=>{const e=window.ethereum;if(!e||!e.connected)throw new Error("Frame App must be open with a hot wallet connected. If not installed first download the Frame App.");return{provider:e}},platforms:["desktop"]},eE={label:Ik.HuobiWallet,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.HuobiWallet],getIcon:async()=>(await Promise.resolve().then((function(){return Wxe}))).default,getInterface:async()=>({provider:Dr(window.ethereum,{wallet_switchEthereumChain:Mk,eth_selectAccounts:Mk})}),platforms:["mobile"]},tE={label:Ik.HyperPay,injectedNamespace:Bk.Ethereum,checkProviderIdentity:()=>!!window.hiWallet,getIcon:async()=>(await Promise.resolve().then((function(){return Zxe}))).default,getInterface:async()=>({provider:Dr(window.ethereum,{wallet_switchEthereumChain:Mk,eth_selectAccounts:Mk})}),platforms:["mobile"]},nE={label:Ik.ImToken,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.ImToken],getIcon:async()=>(await Promise.resolve().then((function(){return Qxe}))).default,getInterface:async()=>({provider:Dr(window.ethereum,{eth_selectAccounts:Mk})}),platforms:["mobile"]},rE={label:Ik.Liquality,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Liquality],getIcon:async()=>(await Promise.resolve().then((function(){return Kxe}))).default,getInterface:async()=>{const e=Dr(window.ethereum,{wallet_switchEthereumChain:Mk,eth_selectAccounts:Mk});return e.removeListener=(e,t)=>{},{provider:e}},platforms:["desktop"]},sE={label:Ik.MeetOne,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&"MEETONE"===e[_k.MeetOne],getIcon:async()=>(await Promise.resolve().then((function(){return Yxe}))).default,getInterface:async()=>({provider:window.ethereum}),platforms:["mobile"]},iE={label:Ik.MyKey,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.MyKey],getIcon:async()=>(await Promise.resolve().then((function(){return Jxe}))).default,getInterface:async()=>({provider:window.ethereum}),platforms:["mobile"]},aE={label:Ik.OwnBit,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.OwnBit],getIcon:async()=>(await Promise.resolve().then((function(){return Xxe}))).default,getInterface:async()=>{const e=Dr(window.ethereum,{eth_chainId:({baseRequest:e})=>e({method:"eth_chainId"}).then((e=>`0x${parseInt(e).toString(16)}`)),wallet_switchEthereumChain:Mk,eth_selectAccounts:Mk});return e.removeListener=(e,t)=>{},e.on=(e,t)=>{},{provider:e}},platforms:["mobile"]},oE={label:Ik.TokenPocket,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.TokenPocket]&&!e[_k.TP],getIcon:async()=>(await Promise.resolve().then((function(){return eke}))).default,getInterface:Ok(_k.TokenPocket),platforms:["all"]},cE={label:Ik.TP,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.TP],getIcon:async()=>(await Promise.resolve().then((function(){return tke}))).default,getInterface:async()=>({provider:Dr(window.ethereum,{wallet_switchEthereumChain:Mk,eth_selectAccounts:Mk})}),platforms:["mobile"]},lE={label:Ik.XDEFI,injectedNamespace:Bk.XFI,checkProviderIdentity:({provider:e})=>e&&e.ethereum&&e.ethereum[_k.XDEFI],getIcon:async()=>(await Promise.resolve().then((function(){return nke}))).default,getInterface:async()=>({provider:window.xfi&&window.xfi.ethereum}),platforms:["all"],externalUrl:Sk.XDEFI},uE={label:Ik.OneInch,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.OneInch],getIcon:async()=>(await Promise.resolve().then((function(){return rke}))).default,getInterface:async()=>({provider:Dr(window.ethereum)}),platforms:["mobile"]},dE={label:Ik.Tokenary,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Tokenary],getIcon:async()=>(await Promise.resolve().then((function(){return ske}))).default,getInterface:async()=>({provider:Dr(window.ethereum)}),platforms:["all"]},hE={label:Ik.Tally,injectedNamespace:Bk.Tally,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Tally],getIcon:async()=>(await Promise.resolve().then((function(){return ike}))).default,getInterface:async()=>({provider:Dr(window.tally)}),platforms:["desktop"]},pE={label:Ik.Zeal,injectedNamespace:Bk.Zeal,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Zeal],getIcon:async()=>(await Promise.resolve().then((function(){return ake}))).default,getInterface:async()=>({provider:Dr(window.zeal)}),platforms:["desktop"]},fE={label:Ik.Rabby,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Rabby],getIcon:async()=>(await Promise.resolve().then((function(){return oke}))).default,getInterface:async()=>({provider:Dr(window.ethereum)}),platforms:["desktop","mobile"]},mE={label:Ik.MathWallet,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.MathWallet],getIcon:async()=>(await Promise.resolve().then((function(){return cke}))).default,getInterface:Ok(_k.MathWallet),platforms:["all"]},bE={label:Ik.Bitget,injectedNamespace:Bk.Bitget,checkProviderIdentity:({provider:e})=>!!e&&!!e.ethereum[_k.Bitget],getIcon:async()=>(await Promise.resolve().then((function(){return lke}))).default,getInterface:async()=>({provider:window.bitkeep&&window.bitkeep.ethereum}),platforms:["all"],externalUrl:Sk.Bitget},gE={label:Ik.Sequence,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Sequence],getIcon:async()=>(await Promise.resolve().then((function(){return uke}))).default,getInterface:async()=>({provider:window.ethereum}),platforms:["all"]},yE={label:Ik.Core,injectedNamespace:Bk.Avalanche,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Core],getIcon:async()=>(await Promise.resolve().then((function(){return dke}))).default,getInterface:Ok(_k.Core),platforms:["desktop","Chrome","Chromium","Microsoft Edge"]},vE={label:Ik.Bitski,injectedNamespace:Bk.Bitski,checkProviderIdentity:({provider:e})=>!!e&&!!e.getProvider&&!!e.getProvider().isBitski,getIcon:async()=>(await Promise.resolve().then((function(){return hke}))).default,getInterface:async()=>({provider:window.Bitski&&window.Bitski.getProvider&&window.Bitski.getProvider()}),platforms:["all"]},wE={label:Ik.Zerion,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Zerion],getIcon:async()=>(await Promise.resolve().then((function(){return pke}))).default,getInterface:async()=>({provider:Dr(window.ethereum)}),platforms:["all"]},xE={label:Ik.Enkrypt,injectedNamespace:Bk.Enkrypt,checkProviderIdentity:({provider:e})=>!!e&&!!e.providers&&!!e.providers.ethereum,getIcon:async()=>(await Promise.resolve().then((function(){return fke}))).default,getInterface:async()=>{const e=window.enkrypt.providers.ethereum.on.bind(window.enkrypt.providers.ethereum);window.enkrypt.providers.ethereum.on=(t,n)=>{e(t,"chainChanged"===t?e=>{n(`0x${parseInt(e).toString(16)}`)}:n)};const t=Dr(window.enkrypt.providers.ethereum,{eth_chainId:({baseRequest:e})=>e({method:"eth_chainId"}).then((e=>`0x${parseInt(e).toString(16)}`))});return t.removeListener=(e,t)=>{},{provider:t}},platforms:["all"]},kE={label:Ik.Phantom,injectedNamespace:Bk.Phantom,checkProviderIdentity:({provider:e})=>!!e&&!!e.ethereum&&!!e.ethereum[_k.Phantom],getIcon:async()=>(await Promise.resolve().then((function(){return mke}))).default,getInterface:async()=>({provider:Dr(window.phantom.ethereum)}),platforms:["all"],externalUrl:Sk.Phantom},EE={label:Ik.SafePal,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.SafePal],getIcon:async()=>(await Promise.resolve().then((function(){return bke}))).default,getInterface:async()=>({provider:Dr(window.ethereum)}),platforms:["all"]},AE={label:Ik.Rainbow,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Rainbow],getIcon:async()=>(await Promise.resolve().then((function(){return gke}))).default,getInterface:Ok(_k.Rainbow),platforms:["all"]},CE={label:Ik.OKXWallet,injectedNamespace:Bk.OKXWallet,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.OKXWallet],getIcon:async()=>(await Promise.resolve().then((function(){return yke}))).default,getInterface:async()=>({provider:Dr(window.okxwallet)}),platforms:["all"],externalUrl:Sk.OKXWallet},PE={label:Ik.DeFiWallet,injectedNamespace:Bk.DeFiConnectProvider,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.DeFiWallet],getIcon:async()=>(await Promise.resolve().then((function(){return vke}))).default,getInterface:async()=>({provider:Dr(window.deficonnectProvider)}),platforms:["all"]},_E={label:Ik.Safeheron,injectedNamespace:Bk.Safeheron,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Safeheron],getIcon:async()=>(await Promise.resolve().then((function(){return wke}))).default,getInterface:async()=>({provider:Dr(window.safeheron)}),platforms:["desktop","Chrome","Chromium","Microsoft Edge"]},SE={label:Ik.Talisman,injectedNamespace:Bk.Talisman,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Talisman],getIcon:async()=>(await Promise.resolve().then((function(){return xke}))).default,getInterface:async()=>({provider:Dr(window.talismanEth)}),platforms:["desktop"],externalUrl:Sk.Talisman},IE={label:Ik.RoninWallet,injectedNamespace:Bk.RoninWallet,checkProviderIdentity:({provider:e})=>!!e,getIcon:async()=>(await Promise.resolve().then((function(){return kke}))).default,getInterface:async()=>({provider:Dr(window.ronin.provider)}),platforms:["all"],externalUrl:Sk.RoninWallet},BE={label:Ik.OneKey,injectedNamespace:Bk.OneKey,checkProviderIdentity:({provider:e})=>!!e&&!!e.ethereum&&!!e.ethereum[_k.OneKey],getIcon:async()=>(await Promise.resolve().then((function(){return Eke}))).default,getInterface:async()=>({provider:Dr(window.$onekey.ethereum)}),platforms:["all"],externalUrl:Sk.OneKey},TE={label:Ik.Fordefi,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Fordefi],getIcon:async()=>(await Promise.resolve().then((function(){return Ake}))).default,getInterface:Ok(_k.Fordefi,!0),platforms:["desktop"]},ME={label:Ik.Coin98Wallet,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Coin98Wallet],getIcon:async()=>(await Promise.resolve().then((function(){return Cke}))).default,getInterface:async()=>{let e;return e=window.hasOwnProperty(Bk.Ethereum)&&window[Bk.Ethereum].isCoin98?window[Bk.Ethereum]:window[Bk.Coin98Wallet].provider,{provider:e}},platforms:["all"],externalUrl:Sk.Coin98Wallet},OE={label:Ik.SubWallet,injectedNamespace:Bk.SubWallet,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.SubWallet],getIcon:async()=>(await Promise.resolve().then((function(){return Pke}))).default,getInterface:async()=>({provider:Dr(window.SubWallet)}),platforms:["all"],externalUrl:Sk.SubWallet},NE={label:Ik.Kayros,injectedNamespace:Bk.Kayros,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Kayros],getIcon:async()=>(await Promise.resolve().then((function(){return _ke}))).default,getInterface:async()=>({provider:Dr(window.kayros)}),platforms:["desktop"]},RE={label:Ik.FoxWallet,injectedNamespace:Bk.FoxWallet,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.FoxWallet],getIcon:async()=>(await Promise.resolve().then((function(){return Ske}))).default,getInterface:async()=>({provider:Dr(window.foxwallet)}),platforms:["mobile"]},FE={label:Ik.Lif3Wallet,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Lif3Wallet],getIcon:async()=>(await Promise.resolve().then((function(){return Ike}))).default,getInterface:async()=>({provider:Dr(window.ethereum,{wallet_switchEthereumChain:Mk,eth_selectAccounts:Mk})}),platforms:["mobile"]},jE={label:Ik.ZodiacPilot,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.ZodiacPilot],getIcon:async()=>(await Promise.resolve().then((function(){return Bke}))).default,getInterface:async()=>({provider:Dr(window.ethereum)}),platforms:["desktop"],externalUrl:Sk.ZodiacPilot},LE={label:Ik.StableWallet,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.StableWallet],getIcon:async()=>(await Promise.resolve().then((function(){return Tke}))).default,getInterface:Ok(_k.StableWallet),platforms:["mobile"]},UE={label:Ik.Echooo,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Echooo],getIcon:async()=>(await Promise.resolve().then((function(){return Mke}))).default,getInterface:Ok(_k.Echooo),platforms:["all"],externalUrl:Sk.Echooo},DE={label:Ik.Keplr,injectedNamespace:Bk.Ethereum,checkProviderIdentity:({provider:e})=>!!e&&!!e[_k.Keplr],getIcon:async()=>(await Promise.resolve().then((function(){return Oke}))).default,getInterface:Ok(_k.Keplr),platforms:["all"],externalUrl:Sk.Keplr},zE=[pE,Lk,Uk,Fk,Kk,zk,Hk,Gk,qk,$k,Vk,Wk,Zk,Qk,bE,Yk,Jk,Dk,Xk,eE,tE,nE,rE,sE,iE,aE,oE,cE,lE,uE,dE,hE,fE,mE,gE,yE,vE,xE,kE,CE,wE,AE,EE,PE,jk,_E,SE,BE,TE,IE,ME,OE,NE,RE,FE,jE,LE,UE,DE],HE=Lr.object({label:Lr.string().required(),getIcon:Lr.function().arity(0).required(),getInterface:Lr.function().maxArity(1).required(),injectedNamespace:Lr.string().required(),checkProviderIdentity:Lr.function().arity(1).required(),platforms:Lr.array().items(Lr.string()),externalUrl:Lr.string()}),GE=Lr.array().items(HE),qE=Lr.object().pattern(/\w+/,Lr.any().allow(Lr.boolean(),Lr.array().items(Lr.string())));Lr.object({custom:GE,filter:qE,displayUnavailable:[Lr.boolean(),Lr.array().items(Lr.string())],walletUnavailableMessage:Lr.function(),sort:Lr.function(),externalUrl:Lr.string(),disable6963Support:Lr.boolean()});const $E=Lr.object({uuid:Lr.string().required(),name:Lr.string().required(),icon:Lr.string().required(),rdns:Lr.string().required()}),VE=Lr.object({info:$E.required(),provider:Lr.object().required()}),WE=e=>Ma(VE,e);const ZE=[];let QE=class e extends Error{constructor(t,n={}){const r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof e&&n.cause.docsPath||n.docsPath;super([t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...r?[`Details: ${r}`]:[],"Version: abitype@1.0.5"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}};function KE(e,t){const n=e.exec(t);return n?.groups}const YE=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,JE=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,XE=/^\(.+?\).*?$/,eA=/^tuple(?(\[(\d*)\])*)$/;function tA(e){let t=e.type;if(eA.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;const sA=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;const iA=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;const aA=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function oA(e){return aA.test(e)}function cA(e){return KE(aA,e)}const lA=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;const uA=/^fallback\(\) external(?:\s(?payable{1}))?$/;const dA=/^receive\(\) external payable$/;const hA=new Set(["indexed"]),pA=new Set(["calldata","memory","storage"]);let fA=class extends QE{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}},mA=class extends QE{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}},bA=class extends QE{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}},gA=class extends QE{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}},yA=class extends QE{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}},vA=class extends QE{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}},wA=class extends QE{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}},xA=class extends QE{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}};class kA extends QE{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}let EA=class extends QE{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}},AA=class extends QE{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}},CA=class extends QE{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}};const PA=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function _A(e,t={}){if(function(e){return iA.test(e)}(e)){const n=function(e){return KE(iA,e)}(e);if(!n)throw new xA({signature:e,type:"function"});const r=MA(n.parameters),s=[],i=r.length;for(let e=0;e[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,IA=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,BA=/^u?int$/;function TA(e,t){const n=function(e,t){return t?`${t}:${e}`:e}(e,t?.type);if(PA.has(n))return PA.get(n);const r=XE.test(e),s=KE(r?IA:SA,e);if(!s)throw new bA({param:e});if(s.name&&function(e){return"address"===e||"bool"===e||"function"===e||"string"===e||"tuple"===e||YE.test(e)||JE.test(e)||NA.test(e)}(s.name))throw new gA({param:e,name:s.name});const i=s.name?{name:s.name}:{},a="indexed"===s.modifier?{indexed:!0}:{},o=t?.structs??{};let c,l={};if(r){c="tuple";const e=MA(s.type),t=[],n=e.length;for(let r=0;r[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function FA(e,t,n=new Set){const r=[],s=e.length;for(let i=0;it(e,n)}function UA(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new dC(e.type);return`${e.name}(${DA(e.inputs,{includeName:t})})`}function DA(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${DA(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}function zA(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function HA(e){return zA(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}let GA=class e extends Error{constructor(t,n={}){super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"viem@2.17.11"});const r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof e&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${n.docsBaseUrl??"https://viem.sh"}${s}${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join("\n"),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(e){return qA(this,e)}};function qA(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?qA(e.cause,t):t?null:e}let $A=class extends GA{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}},VA=class extends GA{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}},WA=class extends GA{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${DA(t,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=n}},ZA=class extends GA{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}},QA=class extends GA{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}},KA=class extends GA{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${HA(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}},YA=class extends GA{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}},JA=class extends GA{constructor(e,{docsPath:t}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}},XA=class extends GA{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}},eC=class extends GA{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}},tC=class extends GA{constructor(e,{docsPath:t}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}},nC=class extends GA{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}},rC=class extends GA{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}},sC=class extends GA{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${UA(e.abiItem)}\`, and`,`\`${t.type}\` in \`${UA(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}},iC=class extends GA{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}},aC=class extends GA{constructor({abiItem:e,data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for non-indexed event parameters.`].join("\n"),{metaMessages:[`Params: (${DA(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=n,this.size=r}},oC=class extends GA{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${UA(e,{includeName:!0})}".`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}},cC=class extends GA{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}},lC=class extends GA{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}},uC=class extends GA{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}},dC=class extends GA{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}},hC=class extends GA{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}},pC=class extends GA{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}},fC=class extends GA{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}},mC=class extends GA{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${t} ${n} long, but is ${e} ${n} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}};function bC(e,{dir:t,size:n=32}={}){return"string"==typeof e?gC(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new fC({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s2*n)throw new fC({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}let yC=class extends GA{constructor({max:e,min:t,signed:n,size:r,value:s}){super(`Number "${s}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}},vC=class extends GA{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}},wC=class extends GA{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}};function xC(e,{dir:t="left"}={}){let n="string"==typeof e?e.replace("0x",""):e,r=0;for(let e=0;et)throw new wC({givenSize:HA(e),maxSize:t})}function EC(e,t={}){const{signed:n}=t;t.size&&kC(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2;return r<=(1n<<8n*BigInt(s)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*s,"f")}`)-1n}function AC(e,t={}){return Number(EC(e,t))}const CC=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function PC(e,t={}){return"number"==typeof e||"bigint"==typeof e?IC(e,t):"string"==typeof e?TC(e,t):"boolean"==typeof e?_C(e,t):SC(e,t)}function _C(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(kC(n,{size:t.size}),bC(n,{size:t.size})):n}function SC(e,t={}){let n="";for(let t=0;ti||s=NC.zero&&e<=NC.nine?e-NC.zero:e>=NC.A&&e<=NC.F?e-(NC.A-10):e>=NC.a&&e<=NC.f?e-(NC.a-10):void 0}function FC(e,t={}){let n=e;t.size&&(kC(n,{size:t.size}),n=bC(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,i=new Uint8Array(s);for(let e=0,t=0;e0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function DC(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function zC(e,t){UC(e);const n=t.outputLen;if(e.length>GC&HC)}:{h:0|Number(e>>GC&HC),l:0|Number(e&HC)}}function $C(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;snew DataView(e.buffer,e.byteOffset,e.byteLength),ZC=(e,t)=>e<<32-t|e>>>t,QC=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function KC(e){for(let n=0;n>>8&65280|t>>>24&255;var t}function YC(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),UC(e),e}let JC=class{clone(){return this._cloneInto()}};function XC(e){const t=t=>e().update(YC(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function eP(e=32){if(VC&&"function"==typeof VC.getRandomValues)return VC.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const tP=[],nP=[],rP=[],sP=BigInt(0),iP=BigInt(1),aP=BigInt(2),oP=BigInt(7),cP=BigInt(256),lP=BigInt(113);for(let e=0,t=iP,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],tP.push(2*(5*r+n)),nP.push((e+1)*(e+2)/2%64);let s=sP;for(let e=0;e<7;e++)t=(t<>oP)*lP)%cP,t&aP&&(s^=iP<<(iP<n>32?((e,t,n)=>t<>>64-n)(e,t,n):((e,t,n)=>e<>>32-n)(e,t,n),pP=(e,t,n)=>n>32?((e,t,n)=>e<>>64-n)(e,t,n):((e,t,n)=>t<>>32-n)(e,t,n);let fP=class e extends JC{constructor(e,t,n,r=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,LC(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}keccak(){QC||KC(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,s=(t+2)%10,i=n[s],a=n[s+1],o=hP(i,a,1)^n[r],c=pP(i,a,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=c}let t=e[2],s=e[3];for(let n=0;n<24;n++){const r=nP[n],i=hP(t,s,r),a=pP(t,s,r),o=tP[n];t=e[o],s=e[o+1],e[o]=i,e[o+1]=a}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=uP[r],e[1]^=dP[r]}n.fill(0)}(this.state32,this.rounds),QC||KC(this.state32),this.posOut=0,this.pos=0}update(e){DC(this);const{blockLen:t,state:n}=this,r=(e=YC(e)).length;for(let s=0;s=n&&this.keccak();const i=Math.min(n-this.posOut,s-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return LC(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(zC(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:a}=this;return t||(t=new e(n,r,s,a,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=s,t.enableXOF=a,t.destroyed=this.destroyed,t}};const mP=((e,t,n)=>XC((()=>new fP(t,e,n))))(1,136,32);function bP(e,t){const n=t||"hex",r=mP(zA(e,{strict:!1})?OC(e):e);return"bytes"===n?r:PC(r)}const gP=e=>bP(OC(e));const yP=e=>{var t;return function(e){let t=!0,n="",r=0,s="",i=!1;for(let a=0;athis.maxSize&&this.delete(this.keys().next().value),this}};const EP=new kP(8192);function AP(e,t){if(EP.has(`${e}.${t}`))return EP.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=bP(jC(n),"bytes"),s=n.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&s[e]&&(s[e]=s[e].toUpperCase()),(15&r[e>>1])>=8&&s[e+1]&&(s[e+1]=s[e+1].toUpperCase());const i=`0x${s.join("")}`;return EP.set(`${e}.${t}`,i),i}function CP(e,t){if(!SP(e,{strict:!1}))throw new xP({address:e});return AP(e,t)}const PP=/^0x[a-fA-F0-9]{40}$/,_P=new kP(8192);function SP(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(_P.has(r))return _P.get(r);const s=!(!PP.test(e)||e.toLowerCase()!==e&&n&&AP(e)!==e);return _P.set(r,s),s}function IP(e){return"string"==typeof e[0]?BP(e):function(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(e)}function BP(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}function TP(e,t,n,{strict:r}={}){return zA(e,{strict:!1})?RP(e,t,n,{strict:r}):NP(e,t,n,{strict:r})}function MP(e,t){if("number"==typeof t&&t>0&&t>HA(e)-1)throw new pC({offset:t,position:"start",size:HA(e)})}function OP(e,t,n){if("number"==typeof t&&"number"==typeof n&&HA(e)!==n-t)throw new pC({offset:n,position:"end",size:HA(e)})}function NP(e,t,n,{strict:r}={}){MP(e,t);const s=e.slice(t,n);return r&&OP(s,t,n),s}function RP(e,t,n,{strict:r}={}){MP(e,t);const s=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;return r&&OP(s,t,n),s}function FP(e,t){if(e.length!==t.length)throw new YA({expectedLength:e.length,givenLength:t.length});const n=function({params:e,values:t}){const n=[];for(let r=0;r0?IP([t,e]):t}}if(s)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:IP(i.map((({encoded:e})=>e)))}}(t,{length:r,param:{...e,type:s}})}if("tuple"===e.type)return function(e,{param:t}){let n=!1;const r=[];for(let s=0;se)))}}(t,{param:e});if("address"===e.type)return function(e){if(!SP(e))throw new xP({address:e});return{dynamic:!1,encoded:gC(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){if("boolean"!=typeof e)throw new GA(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:gC(_C(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){return function(e,{signed:t}){return{dynamic:!1,encoded:IC(e,{size:32,signed:t})}}(t,{signed:e.type.startsWith("int")})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),r=HA(e);if(!n){let t=e;return r%32!=0&&(t=gC(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:IP([gC(IC(r,{size:32})),t])}}if(r!==Number.parseInt(n))throw new KA({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:gC(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=TC(e),n=Math.ceil(HA(t)/32),r=[];for(let e=0;eTP(vP(e),0,4);function zP(e){const{abi:t,args:n=[],name:r}=e,s=zA(r,{strict:!1}),i=t.filter((e=>s?"function"===e.type?DP(e)===r:"event"===e.type&&wP(e)===r:"name"in e&&e.name===r));if(0===i.length)return;if(1===i.length)return i[0];let a;for(const e of i){if(!("inputs"in e))continue;if(!n||0===n.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==n.length)continue;const t=n.every(((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&HP(t,r)}));if(t){if(a&&"inputs"in a&&a.inputs){const t=GP(e.inputs,a.inputs,n);if(t)throw new sC({abiItem:e,type:t[0]},{abiItem:a,type:t[1]})}a=e}}return a||i[0]}function HP(e,t){const n=typeof e,r=t.type;switch(r){case"address":return SP(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every(((t,n)=>HP(Object.values(e)[n],t))):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every((e=>HP(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function GP(e,t,n){for(const r in e){const s=e[r],i=t[r];if("tuple"===s.type&&"tuple"===i.type&&"components"in s&&"components"in i)return GP(s.components,i.components,n[r]);const a=[s.type,i.type];if(!(!a.includes("address")||!a.includes("bytes20"))||(a.includes("address")&&a.includes("string")||!(!a.includes("address")||!a.includes("bytes")))&&SP(n[r],{strict:!1}))return a}}const qP="/docs/contract/encodeEventTopics";function $P(e){const{abi:t,eventName:n,args:r}=e;let s=t[0];if(n){const e=zP({abi:t,name:n});if(!e)throw new tC(n,{docsPath:qP});s=e}if("event"!==s.type)throw new tC(void 0,{docsPath:qP});const i=UA(s),a=wP(i);let o=[];if(r&&"inputs"in s){const e=s.inputs?.filter((e=>"indexed"in e&&e.indexed)),t=Array.isArray(r)?r:Object.values(r).length>0?e?.map((e=>r[e.name]))??[]:[];t.length>0&&(o=e?.map(((e,n)=>Array.isArray(t[n])?t[n].map(((r,s)=>VP({param:e,value:t[n][s]}))):t[n]?VP({param:e,value:t[n]}):null))??[])}return[a,...o]}function VP({param:e,value:t}){if("string"===e.type||"bytes"===e.type)return bP(OC(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new hC(e.type);return FP([e],[t])}function WP(e,{method:t}){const n={};return"fallback"===e.transport.type&&e.transport.onResponse?.((({method:e,response:r,status:s,transport:i})=>{"success"===s&&t===e&&(n[r]=i.request)})),t=>n[t]||e.request}async function ZP(e,t){const{address:n,abi:r,args:s,eventName:i,fromBlock:a,strict:o,toBlock:c}=t,l=WP(e,{method:"eth_newFilter"}),u=i?$P({abi:r,args:s,eventName:i}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:"bigint"==typeof a?IC(a):a,toBlock:"bigint"==typeof c?IC(c):c,topics:u}]});return{abi:r,args:s,eventName:i,id:d,request:l(d),strict:Boolean(o),type:"event"}}function QP(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}const KP="/docs/contract/encodeFunctionData";function YP(e){const{args:t}=e,{abi:n,functionName:r}=1===e.abi.length&&e.functionName?.startsWith("0x")?e:function(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const e=zP({abi:t,args:n,name:r});if(!e)throw new nC(r,{docsPath:KP});s=e}if("function"!==s.type)throw new nC(void 0,{docsPath:KP});return{abi:[s],functionName:DP(UA(s))}}(e),s=n[0];return BP([r,("inputs"in s&&s.inputs?FP(s.inputs,t??[]):void 0)??"0x"])}const JP={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},XP={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},e_={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let t_=class extends GA{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}},n_=class extends GA{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}},r_=class extends GA{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}};const s_={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new r_({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new n_({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new t_({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new t_({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function i_(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(s_);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function a_(e,t={}){void 0!==t.size&&kC(e,{size:t.size});return EC(SC(e,t),t)}function o_(e,t={}){let n=e;if(void 0!==t.size&&(kC(n,{size:t.size}),n=xC(n)),n.length>1||n[0]>1)throw new vC(n);return Boolean(n[0])}function c_(e,t={}){void 0!==t.size&&kC(e,{size:t.size});return AC(SC(e,t),t)}function l_(e,t){const n="string"==typeof t?FC(t):t,r=i_(n);if(0===HA(n)&&e.length>0)throw new ZA;if(HA(t)&&HA(t)<32)throw new WA({data:"string"==typeof t?t:SC(t),params:e,size:HA(t)});let s=0;const i=[];for(let t=0;t!e)),s=r?[]:{};let i=0;if(p_(t)){const a=n+c_(e.readBytes(h_));for(let n=0;n48?a_(s,{signed:n}):c_(s,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,{staticPosition:t}){const n=c_(e.readBytes(32)),r=t+n;e.setPosition(r);const s=c_(e.readBytes(32));if(0===s)return e.setPosition(t+32),["",32];const i=e.readBytes(s,32),a=function(e,t={}){let n=e;return void 0!==t.size&&(kC(n,{size:t.size}),n=xC(n,{dir:"right"})),(new TextDecoder).decode(n)}(xC(i));return e.setPosition(t+32),[a,32]}(e,{staticPosition:n});throw new lC(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const d_=32,h_=32;function p_(e){const{type:t}=e;if("string"===t)return!0;if("bytes"===t)return!0;if(t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(p_);const n=UP(e.type);return!(!n||!p_({...e,type:n[1]}))}function f_(e){const{abi:t,data:n}=e,r=TP(n,0,4);if("0x"===r)throw new ZA;const s=[...t||[],XP,e_].find((e=>"error"===e.type&&r===DP(UA(e))));if(!s)throw new JA(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?l_(s.inputs,TP(n,4)):void 0,errorName:s.name}}const m_=(e,t,n)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),n);function b_({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map(((e,n)=>`${r&&e.name?`${e.name}: `:""}${"object"==typeof t[n]?m_(t[n]):t[n]}`)).join(", ")})`}const g_={gwei:9,wei:18},y_={ether:-9,wei:9};function v_(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${i?`.${i}`:""}`}function w_(e,t="wei"){return v_(e,g_[t])}function x_(e,t="wei"){return v_(e,y_[t])}let k_=class extends GA{constructor({address:e}){super(`State for account "${e}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}},E_=class extends GA{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}};function A_(e){return e.reduce(((e,{slot:t,value:n})=>`${e} ${t}: ${n}\n`),"")}function C_(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),n=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`)).join("\n")}let P_=class extends GA{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}},__=class extends GA{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}},S_=class extends GA{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",C_(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}},I_=class extends GA{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}},B_=class extends GA{constructor(e,{account:t,docsPath:n,chain:r,data:s,gas:i,gasPrice:a,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const h=C_({chain:r&&`${r?.name} (id: ${r?.id})`,from:t?.address,to:u,value:void 0!==d&&`${w_(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:void 0!==a&&`${x_(a)} gwei`,maxFeePerGas:void 0!==o&&`${x_(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${x_(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}},T_=class extends GA{constructor({blockHash:e,blockNumber:t,blockTag:n,hash:r,index:s}){let i="Transaction";n&&void 0!==s&&(i=`Transaction at block time "${n}" at index "${s}"`),e&&void 0!==s&&(i=`Transaction at block hash "${e}" at index "${s}"`),t&&void 0!==s&&(i=`Transaction at block number "${t}" at index "${s}"`),r&&(i=`Transaction with hash "${r}"`),super(`${i} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}},M_=class extends GA{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}},O_=class extends GA{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}},N_=class extends GA{constructor(e,{account:t,docsPath:n,chain:r,data:s,gas:i,gasPrice:a,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d,stateOverride:h}){const p=t?QP(t):void 0;let f=C_({from:p?.address,to:u,value:void 0!==d&&`${w_(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:void 0!==a&&`${x_(a)} gwei`,maxFeePerGas:void 0!==o&&`${x_(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${x_(c)} gwei`,nonce:l});h&&(f+=`\n${function(e){return e.reduce(((e,{address:t,...n})=>{let r=`${e} ${t}:\n`;return n.nonce&&(r+=` nonce: ${n.nonce}\n`),n.balance&&(r+=` balance: ${n.balance}\n`),n.code&&(r+=` code: ${n.code}\n`),n.state&&(r+=" state:\n",r+=A_(n.state)),n.stateDiff&&(r+=" stateDiff:\n",r+=A_(n.stateDiff)),r})," State Override:\n").slice(0,-1)}(h)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",f].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}},R_=class extends GA{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:s,functionName:i,sender:a}){const o=zP({abi:t,args:n,name:i}),c=o?b_({abiItem:o,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=C_({address:r&&r,function:o?UA(o,{includeName:!0}):void 0,args:c&&"()"!==c&&`${[...Array(i?.length??0).keys()].map((()=>" ")).join("")}${c}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",l].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=t,this.args=n,this.cause=e,this.contractAddress=r,this.functionName=i,this.sender=a}},F_=class extends GA{constructor({abi:e,data:t,functionName:n,message:r}){let s,i,a,o,c;if(t&&"0x"!==t)try{i=f_({abi:e,data:t});const{abiItem:n,errorName:r,args:s}=i;if("Error"===r)o=s[0];else if("Panic"===r){const[e]=s;o=JP[e]}else{const e=n?UA(n,{includeName:!0}):void 0,t=n&&s?b_({abiItem:n,args:s,includeFunctionName:!1,includeName:!1}):void 0;a=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(r?.length??0).keys()].map((()=>" ")).join("")}${t}`:""]}}catch(e){s=e}else r&&(o=r);s instanceof JA&&(c=s.signature,a=[`Unable to decode signature "${c}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${c}.`]),super(o&&"execution reverted"!==o||c?[`The contract function "${n}" reverted with the following ${c?"signature":"reason"}:`,o||c].join("\n"):`The contract function "${n}" reverted.`,{cause:s,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.reason=o,this.signature=c}},j_=class extends GA{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}};class L_ extends GA{constructor({factory:e}){super("Deployment for counterfactual contract call failed"+(e?` for factory "${e}".`:""),{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CounterfactualDeploymentFailedError"})}}let U_=class extends GA{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}},D_=class extends GA{constructor({body:e,cause:t,details:n,headers:r,status:s,url:i}){super("HTTP request failed.",{cause:t,details:n,metaMessages:[s&&`Status: ${s}`,`URL: ${i}`,e&&`Request body: ${m_(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=r,this.status=s,this.url=i}},z_=class extends GA{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${m_(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}},H_=class extends GA{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${t}`,`Request body: ${m_(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}};let G_=class extends GA{constructor(e,{code:t,docsPath:n,metaMessages:r,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:r||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof z_?e.code:t??-1}},q_=class extends G_{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}},$_=class e extends G_{constructor(t){super(t,{code:e.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}};Object.defineProperty($_,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});let V_=class e extends G_{constructor(t){super(t,{code:e.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}};Object.defineProperty(V_,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});let W_=class e extends G_{constructor(t){super(t,{code:e.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}};Object.defineProperty(W_,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});let Z_=class e extends G_{constructor(t){super(t,{code:e.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}};Object.defineProperty(Z_,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});let Q_=class e extends G_{constructor(t){super(t,{code:e.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}};Object.defineProperty(Q_,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});let K_=class e extends G_{constructor(t){super(t,{code:e.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}};Object.defineProperty(K_,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});let Y_=class e extends G_{constructor(t){super(t,{code:e.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};Object.defineProperty(Y_,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});let J_=class e extends G_{constructor(t){super(t,{code:e.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}};Object.defineProperty(J_,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});let X_=class e extends G_{constructor(t){super(t,{code:e.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}};Object.defineProperty(X_,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});let eS=class e extends G_{constructor(t){super(t,{code:e.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}};Object.defineProperty(eS,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});let tS=class e extends G_{constructor(t){super(t,{code:e.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}};Object.defineProperty(tS,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});let nS=class e extends G_{constructor(t){super(t,{code:e.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}};Object.defineProperty(nS,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});let rS=class e extends q_{constructor(t){super(t,{code:e.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}};Object.defineProperty(rS,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});let sS=class e extends q_{constructor(t){super(t,{code:e.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}};Object.defineProperty(sS,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});let iS=class e extends q_{constructor(t){super(t,{code:e.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}};Object.defineProperty(iS,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});let aS=class e extends q_{constructor(t){super(t,{code:e.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}};Object.defineProperty(aS,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});let oS=class e extends q_{constructor(t){super(t,{code:e.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}};Object.defineProperty(oS,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});let cS=class e extends q_{constructor(t){super(t,{code:e.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}};Object.defineProperty(cS,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});let lS=class extends G_{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}};const uS=3;function dS(e,{abi:t,address:n,args:r,docsPath:s,functionName:i,sender:a}){const{code:o,data:c,message:l,shortMessage:u}=e instanceof U_?e:e instanceof GA?e.walk((e=>"data"in e))||e.walk():{},d=e instanceof ZA?new j_({functionName:i}):[uS,Q_.code].includes(o)&&(c||l||u)?new F_({abi:t,data:"object"==typeof c?c.data:c,functionName:i,message:u??l}):e;return new R_(d,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:i,sender:a})}let hS=class extends GA{constructor(e,{account:t,docsPath:n,chain:r,data:s,gas:i,gasPrice:a,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const h=C_({from:t?.address,to:u,value:void 0!==d&&`${w_(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:void 0!==a&&`${x_(a)} gwei`,maxFeePerGas:void 0!==o&&`${x_(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${x_(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}},pS=class extends GA{constructor({cause:e,message:t}={}){const n=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}};Object.defineProperty(pS,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(pS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});let fS=class extends GA{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${x_(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}};Object.defineProperty(fS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});let mS=class extends GA{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${x_(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}};Object.defineProperty(mS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});let bS=class extends GA{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}};Object.defineProperty(bS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});let gS=class extends GA{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}};Object.defineProperty(gS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});let yS=class extends GA{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}};Object.defineProperty(yS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});let vS=class extends GA{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}};Object.defineProperty(vS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});let wS=class extends GA{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}};Object.defineProperty(wS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});let xS=class extends GA{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}};Object.defineProperty(xS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});let kS=class extends GA{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}};Object.defineProperty(kS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});let ES=class extends GA{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${x_(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${x_(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}};Object.defineProperty(ES,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});let AS=class extends GA{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}};function CS(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof GA?e.walk((e=>e.code===pS.code)):e;return r instanceof GA?new pS({cause:e,message:r.details}):pS.nodeMessage.test(n)?new pS({cause:e,message:e.details}):fS.nodeMessage.test(n)?new fS({cause:e,maxFeePerGas:t?.maxFeePerGas}):mS.nodeMessage.test(n)?new mS({cause:e,maxFeePerGas:t?.maxFeePerGas}):bS.nodeMessage.test(n)?new bS({cause:e,nonce:t?.nonce}):gS.nodeMessage.test(n)?new gS({cause:e,nonce:t?.nonce}):yS.nodeMessage.test(n)?new yS({cause:e,nonce:t?.nonce}):vS.nodeMessage.test(n)?new vS({cause:e}):wS.nodeMessage.test(n)?new wS({cause:e,gas:t?.gas}):xS.nodeMessage.test(n)?new xS({cause:e,gas:t?.gas}):kS.nodeMessage.test(n)?new kS({cause:e}):ES.nodeMessage.test(n)?new ES({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new AS({cause:e})}function PS(e,{format:t}){if(!t)return{};const n={};return function t(r){const s=Object.keys(r);for(const i of s)i in e&&(n[i]=e[i]),r[i]&&"object"==typeof r[i]&&!Array.isArray(r[i])&&t(r[i])}(t(e||{})),n}function _S(e,t){return({exclude:n,format:r})=>({exclude:n,format:e=>{const s=t(e);if(n)for(const e of n)delete s[e];return{...s,...r(e)}},type:e})}const SS={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function IS(e){const t={};return void 0!==e.accessList&&(t.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?t.blobs=e.blobs.map((e=>SC(e))):t.blobs=e.blobs),void 0!==e.data&&(t.data=e.data),void 0!==e.from&&(t.from=e.from),void 0!==e.gas&&(t.gas=IC(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=IC(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=IC(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=IC(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=IC(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=IC(e.nonce)),void 0!==e.to&&(t.to=e.to),void 0!==e.type&&(t.type=SS[e.type]),void 0!==e.value&&(t.value=IC(e.value)),t}function BS(e){if(e&&0!==e.length)return e.reduce(((e,{slot:t,value:n})=>{if(66!==t.length)throw new mC({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new mC({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e}),{})}function TS(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:i}=e,a={};if(void 0!==i&&(a.code=i),void 0!==t&&(a.balance=IC(t)),void 0!==n&&(a.nonce=IC(n)),void 0!==r&&(a.state=BS(r)),void 0!==s){if(a.state)throw new E_;a.stateDiff=BS(s)}return a}function MS(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!SP(n,{strict:!1}))throw new xP({address:n});if(t[n])throw new k_({address:n});t[n]=TS(r)}return t}function OS(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:i}=e,a=t?QP(t):void 0;if(a&&!SP(a.address))throw new xP({address:a.address});if(i&&!SP(i))throw new xP({address:i});if(void 0!==n&&(void 0!==r||void 0!==s))throw new P_;if(r&&r>2n**256n-1n)throw new fS({maxFeePerGas:r});if(s&&r&&s>r)throw new ES({maxFeePerGas:r,maxPriorityFeePerGas:s})}let NS=class extends GA{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}},RS=class extends GA{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}},FS=class extends GA{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${x_(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}},jS=class extends GA{constructor({blockHash:e,blockNumber:t}){let n="Block";e&&(n=`Block at hash "${e}"`),t&&(n=`Block at number "${t}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}};const LS={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function US(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?AC(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?AC(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?LS[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof t.v){if(0n===t.v||27n===t.v)return 0;if(1n===t.v||28n===t.v)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),"eip2930"===t.type&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip1559"===t.type&&delete t.maxFeePerBlobGas,t}const DS=_S("transaction",US);function zS(e){const t=e.transactions?.map((e=>"string"==typeof e?e:US(e)));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const HS=_S("block",zS);async function GS(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:s}={}){const i=r??"latest",a=s??!1,o=void 0!==n?IC(n):void 0;let c=null;if(c=t?await e.request({method:"eth_getBlockByHash",params:[t,a]},{dedupe:!0}):await e.request({method:"eth_getBlockByNumber",params:[o||i,a]},{dedupe:Boolean(o)}),!c)throw new jS({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||zS)(c)}async function qS(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function $S(e,t){const{block:n,chain:r=e.chain,request:s}=t||{};if("function"==typeof r?.fees?.defaultPriorityFee){const t=n||await LA(e,GS,"getBlock")({});return r.fees.defaultPriorityFee({block:t,client:e,request:s})}if(void 0!==r?.fees?.defaultPriorityFee)return r?.fees?.defaultPriorityFee;try{return EC(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,r]=await Promise.all([n?Promise.resolve(n):LA(e,GS,"getBlock")({}),LA(e,qS,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new RS;const s=r-t.baseFeePerGas;return s<0n?0n:s}}async function VS(e,t){const{block:n,chain:r=e.chain,request:s,type:i="eip1559"}=t||{},a=await(async()=>"function"==typeof r?.fees?.baseFeeMultiplier?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):r?.fees?.baseFeeMultiplier??1.2)();if(a<1)throw new NS;const o=10**(a.toString().split(".")[1]?.length??0),c=e=>e*BigInt(Math.ceil(a*o))/BigInt(o),l=n||await LA(e,GS,"getBlock")({});if("function"==typeof r?.fees?.estimateFeesPerGas){const t=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:s,type:i});if(null!==t)return t}if("eip1559"===i){if("bigint"!=typeof l.baseFeePerGas)throw new RS;const t="bigint"==typeof s?.maxPriorityFeePerGas?s.maxPriorityFeePerGas:await $S(e,{block:l,chain:r,request:s}),n=c(l.baseFeePerGas);return{maxFeePerGas:s?.maxFeePerGas??n+t,maxPriorityFeePerGas:t}}return{gasPrice:s?.gasPrice??c(await LA(e,qS,"getGasPrice")({}))}}async function WS(e,{address:t,blockTag:n="latest",blockNumber:r}){return AC(await e.request({method:"eth_getTransactionCount",params:[t,r?IC(r):n]},{dedupe:Boolean(r)}))}function ZS(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>FC(e))):e.blobs,s=[];for(const e of r)s.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?s:s.map((e=>SC(e)))}function QS(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>FC(e))):e.blobs,s="string"==typeof e.commitments[0]?e.commitments.map((e=>FC(e))):e.commitments,i=[];for(let e=0;eSC(e)))}const KS=(e,t,n)=>e&t^~e&n,YS=(e,t,n)=>e&t^e&n^t&n;class JS extends JC{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=WC(this.buffer)}update(e){DC(this);const{view:t,buffer:n,blockLen:r}=this,s=(e=YC(e)).length;for(let i=0;ir-i&&(this.process(n,0),i=0);for(let e=i;e>s&i),o=Number(n&i),c=r?4:0,l=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),s),this.process(n,0);const a=WC(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e>>3,s=ZC(n,17)^ZC(n,19)^n>>>10;tI[e]=s+tI[e-7]+r+tI[e-16]|0}let{A:n,B:r,C:s,D:i,E:a,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(ZC(a,6)^ZC(a,11)^ZC(a,25))+KS(a,o,c)+XS[e]+tI[e]|0,u=(ZC(n,2)^ZC(n,13)^ZC(n,22))+YS(n,r,s)|0;l=c,c=o,o=a,a=i+t|0,i=s,s=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,s=s+this.C|0,i=i+this.D|0,a=a+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,s,i,a,o,c,l)}roundClean(){tI.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const rI=XC((()=>new nI));function sI(e){const{commitment:t,version:n=1}=e,r=e.to??("string"==typeof t?"hex":"bytes"),s=rI(zA(i=t,{strict:!1})?OC(i):i);var i;return s.set([n],0),"bytes"===r?s:SC(s)}function iI(e){const{commitments:t,version:n}=e,r=e.to??("string"==typeof t[0]?"hex":"bytes"),s=[];for(const e of t)s.push(sI({commitment:e,to:r,version:n}));return s}const aI=32,oI=4096,cI=aI*oI,lI=6*cI-1-1*oI*6,uI=1;let dI=class extends GA{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}},hI=class extends GA{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}},pI=class extends GA{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}},fI=class extends GA{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${uI}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}};function mI(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??function(e){const t=e.to??("string"==typeof e.data?"hex":"bytes"),n="string"==typeof e.data?FC(e.data):e.data,r=HA(n);if(!r)throw new hI;if(r>lI)throw new dI({maxSize:lI,size:r});const s=[];let i=!0,a=0;for(;i;){const e=i_(new Uint8Array(cI));let t=0;for(;te.bytes)):s.map((e=>SC(e.bytes)))}({data:t,to:r}),i=e.commitments??ZS({blobs:s,kzg:n,to:r}),a=e.proofs??QS({blobs:s,commitments:i,kzg:n,to:r}),o=[];for(let e=0;e{const t=CS(e,n);return t instanceof AS?e:t})();return new hS(r,{docsPath:t,...n})}(n,{...t,account:r,chain:e.chain})}}async function xI(e,t){const{abi:n,address:r,args:s,functionName:i,...a}=t,o=YP({abi:n,args:s,functionName:i});try{return await LA(e,wI,"estimateGas")({data:o,to:r,...a})}catch(e){const t=a.account?QP(a.account):void 0;throw dS(e,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:i,sender:t?.address})}}const kI="/docs/contract/decodeEventLog";function EI(e){const{abi:t,data:n,strict:r,topics:s}=e,i=r??!0,[a,...o]=s;if(!a)throw new XA({docsPath:kI});const c=t.find((e=>"event"===e.type&&a===wP(UA(e))));if(!c||!("name"in c)||"event"!==c.type)throw new eC(a,{docsPath:kI});const{name:l,inputs:u}=c,d=u?.some((e=>!("name"in e&&e.name)));let h=d?[]:{};const p=u.filter((e=>"indexed"in e&&e.indexed));for(let e=0;e!("indexed"in e&&e.indexed)));if(f.length>0)if(n&&"0x"!==n)try{const e=l_(f,n);if(e)if(d)h=[...h,...e];else for(let t=0;t0?h:void 0}}function AI({param:e,value:t}){if("string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))return t;return(l_([e],t)||[])[0]}function CI({abi:e,eventName:t,logs:n,strict:r=!0}){return n.map((n=>{try{const s=EI({...n,abi:e,strict:r});return t&&!t.includes(s.eventName)?null:{...s,...n}}catch(e){let t,s;if(e instanceof eC)return null;if(e instanceof aC||e instanceof oC){if(r)return null;t=e.abiItem.name,s=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return{...n,args:s?[]:{},eventName:t}}})).filter(Boolean)}function PI(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}async function _I(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:i,events:a,args:o,strict:c}={}){const l=c??!1,u=a??(i?[i]:void 0);let d,h=[];if(u){const e=u.flatMap((e=>$P({abi:[e],eventName:e.name,args:o})));h=[e],i&&(h=h[0])}d=n?await e.request({method:"eth_getLogs",params:[{address:t,topics:h,blockHash:n}]}):await e.request({method:"eth_getLogs",params:[{address:t,topics:h,fromBlock:"bigint"==typeof r?IC(r):r,toBlock:"bigint"==typeof s?IC(s):s}]});const p=d.map((e=>PI(e)));return u?CI({abi:u,logs:p,strict:l}):p}async function SI(e,t){const{abi:n,address:r,args:s,blockHash:i,eventName:a,fromBlock:o,toBlock:c,strict:l}=t,u=a?zP({abi:n,name:a}):void 0,d=u?void 0:n.filter((e=>"event"===e.type));return LA(e,_I,"getLogs")({address:r,args:s,blockHash:i,event:u,events:d,fromBlock:o,toBlock:c,strict:l})}const II="/docs/contract/decodeFunctionResult";function BI(e){const{abi:t,args:n,functionName:r,data:s}=e;let i=t[0];if(r){const e=zP({abi:t,args:n,name:r});if(!e)throw new nC(r,{docsPath:II});i=e}if("function"!==i.type)throw new nC(void 0,{docsPath:II});if(!i.outputs)throw new rC(i.name,{docsPath:II});const a=l_(i.outputs,s);return a&&a.length>1?a:a&&1===a.length?a[0]:void 0}const TI=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],MI=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],OI=[...MI,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],NI=[...MI,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],RI=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],FI=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],jI=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],LI="0x82ad56cb",UI="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",DI="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",zI="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";let HI=class extends GA{constructor({blockNumber:e,chain:t,contract:n}){super(`Chain "${t.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}},GI=class extends GA{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}},qI=class extends GA{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}},$I=class extends GA{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}},VI=class extends GA{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}};const WI="/docs/contract/encodeDeployData";function ZI(e){const{abi:t,args:n,bytecode:r}=e;if(!n||0===n.length)return r;const s=t.find((e=>"type"in e&&"constructor"===e.type));if(!s)throw new $A({docsPath:WI});if(!("inputs"in s))throw new VA({docsPath:WI});if(!s.inputs||0===s.inputs.length)throw new VA({docsPath:WI});return BP([r,FP(s.inputs,n)])}function QI({blockNumber:e,chain:t,contract:n}){const r=t?.contracts?.[n];if(!r)throw new HI({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new HI({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const KI=new Map;function YI({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const i=async()=>{const t=o();a();const n=t.map((({args:e})=>e));0!==n.length&&e(n).then((e=>{s&&Array.isArray(e)&&e.sort(s);for(let n=0;n{for(let n=0;nKI.delete(t),o=()=>KI.get(t)||[],c=e=>KI.set(t,[...o(),e]);return{flush:a,async schedule(e){const t={},s=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),a=n?.([...o().map((({args:e})=>e)),e]);a&&i();return o().length>0?(c({args:e,pendingPromise:t}),s):(c({args:e,pendingPromise:t}),setTimeout(i,r),s)}}}async function JI(e,t){const{account:n=e.account,batch:r=Boolean(e.batch?.multicall),blockNumber:s,blockTag:i="latest",accessList:a,blobs:o,code:c,data:l,factory:u,factoryData:d,gas:h,gasPrice:p,maxFeePerBlobGas:f,maxFeePerGas:m,maxPriorityFeePerGas:b,nonce:g,to:y,value:v,stateOverride:w,...x}=t,k=n?QP(n):void 0;if(c&&(u||d))throw new GA("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&y)throw new GA("Cannot provide both `code` & `to` as parameters.");const E=c&&l,A=u&&d&&y&&l,C=E||A,P=E?function(e){const{code:t,data:n}=e;return ZI({abi:jA(["constructor(bytes, bytes)"]),bytecode:UI,args:[t,n]})}({code:c,data:l}):A?function(e){const{data:t,factory:n,factoryData:r,to:s}=e;return ZI({abi:jA(["constructor(address, bytes, address, bytes)"]),bytecode:DI,args:[s,t,n,r]})}({data:l,factory:u,factoryData:d,to:y}):l;try{OS(t);const n=(s?IC(s):void 0)||i,c=MS(w),l=e.chain?.formatters?.transactionRequest?.format,u=(l||IS)({...PS(x,{format:l}),from:k?.address,accessList:a,blobs:o,data:P,gas:h,gasPrice:p,maxFeePerBlobGas:f,maxFeePerGas:m,maxPriorityFeePerGas:b,nonce:g,to:C?void 0:y,value:v});if(r&&function({request:e}){const{data:t,to:n,...r}=e;return!!t&&(!t.startsWith(LI)&&(!!n&&!(Object.values(r).filter((e=>void 0!==e)).length>0)))}({request:u})&&!c)try{return await async function(e,t){const{batchSize:n=1024,wait:r=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockNumber:s,blockTag:i="latest",data:a,multicallAddress:o,to:c}=t;let l=o;if(!l){if(!e.chain)throw new $I;l=QI({blockNumber:s,chain:e.chain,contract:"multicall3"})}const u=s?IC(s):void 0,d=u||i,{schedule:h}=YI({id:`${e.uid}.${d}`,wait:r,shouldSplitBatch(e){const t=e.reduce(((e,{data:t})=>e+(t.length-2)),0);return t>2*n},fn:async t=>{const n=t.map((e=>({allowFailure:!0,callData:e.data,target:e.to}))),r=YP({abi:TI,args:[n],functionName:"aggregate3"}),s=await e.request({method:"eth_call",params:[{data:r,to:l},d]});return BI({abi:TI,args:[n],functionName:"aggregate3",data:s||"0x"})}}),[{returnData:p,success:f}]=await h({data:a,to:c});if(!f)throw new U_({data:p});return"0x"===p?{data:void 0}:{data:p}}(e,{...u,blockNumber:s,blockTag:i})}catch(e){if(!(e instanceof $I||e instanceof HI))throw e}const d=await e.request({method:"eth_call",params:c?[u,n,c]:[u,n]});return"0x"===d?{data:void 0}:{data:d}}catch(n){const r=function(e){if(!(e instanceof GA))return;const t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(n),{offchainLookup:s,offchainLookupSignature:i}=await Promise.resolve().then((function(){return mT}));if(!1!==e.ccipRead&&r?.slice(0,10)===i&&y)return{data:await s(e,{data:r,to:y})};if(C&&"0x101bb98d"===r?.slice(0,10))throw new L_({factory:u});throw function(e,{docsPath:t,...n}){const r=(()=>{const t=CS(e,n);return t instanceof AS?e:t})();return new N_(r,{docsPath:t,...n})}(n,{...t,account:k,chain:e.chain})}}async function XI(e,t){const{abi:n,address:r,args:s,functionName:i,...a}=t,o=YP({abi:n,args:s,functionName:i});try{const{data:t}=await LA(e,JI,"call")({...a,data:o,to:r});return BI({abi:n,args:s,functionName:i,data:t||"0x"})}catch(e){throw dS(e,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:i})}}async function eB(e,t){const{abi:n,address:r,args:s,dataSuffix:i,functionName:a,...o}=t,c=o.account?QP(o.account):e.account,l=YP({abi:n,args:s,functionName:a});try{const{data:u}=await LA(e,JI,"call")({batch:!1,data:`${l}${i?i.replace("0x",""):""}`,to:r,...o,account:c}),d=BI({abi:n,args:s,functionName:a,data:u||"0x"});return{result:d,request:{abi:n.filter((e=>"name"in e&&e.name===t.functionName)),address:r,args:s,dataSuffix:i,functionName:a,...o,account:c}}}catch(e){throw dS(e,{abi:n,address:r,args:s,docsPath:"/docs/contract/simulateContract",functionName:a,sender:c?.address})}}const tB=new Map,nB=new Map;let rB=0;function sB(e,t,n){const r=++rB,s=()=>tB.get(e)||[],i=()=>{const t=nB.get(e);1===s().length&&t&&t(),(()=>{const t=s();tB.set(e,t.filter((e=>e.id!==r)))})()},a=s();if(tB.set(e,[...a,{id:r,fns:t}]),a&&a.length>0)return i;const o={};for(const e in t)o[e]=(...t)=>{const n=s();if(0!==n.length)for(const r of n)r.fns[e]?.(...t)};const c=n(o);return"function"==typeof c&&nB.set(e,c),i}async function iB(e){return new Promise((t=>setTimeout(t,e)))}function aB(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let s=!0;const i=()=>s=!1;return(async()=>{let a;t&&(a=await e({unpoll:i}));const o=await(n?.(a))??r;await iB(o);const c=async()=>{s&&(await e({unpoll:i}),await iB(r),c())};c()})(),i}const oB=new Map,cB=new Map;async function lB(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=function(e){const t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:n=>t.set(e,n)}),n=t(e,oB),r=t(e,cB);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}(t),s=r.response.get();if(s&&n>0){if((new Date).getTime()-s.created.getTime()`blockNumber.${e}`;async function dB(e,{cacheTime:t=e.cacheTime}={}){const n=await lB((()=>e.request({method:"eth_blockNumber"})),{cacheKey:uB(e.uid),cacheTime:t});return BigInt(n)}async function hB(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if("string"==typeof r[0])return r;const s=r.map((e=>PI(e)));return"abi"in t&&t.abi?CI({abi:t.abi,logs:s,strict:n}):s}async function pB(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function fB(e,t){const{abi:n,address:r,args:s,batch:i=!0,eventName:a,fromBlock:o,onError:c,onLogs:l,poll:u,pollingInterval:d=e.pollingInterval,strict:h}=t;return(void 0!==u?u:"bigint"==typeof o||"webSocket"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type))?(()=>{const t=h??!1;return sB(m_(["watchContractEvent",r,s,i,e.uid,a,d,t,o]),{onLogs:l,onError:c},(c=>{let l,u;void 0!==o&&(l=o-1n);let h=!1;const p=aB((async()=>{if(h)try{let o;if(u)o=await LA(e,hB,"getFilterChanges")({filter:u});else{const i=await LA(e,dB,"getBlockNumber")({});o=l&&l{u&&await LA(e,pB,"uninstallFilter")({filter:u}),p()}}))})():(()=>{const t=h??!1,o=m_(["watchContractEvent",r,s,i,e.uid,a,d,t]);let u=!0,p=()=>u=!1;return sB(o,{onLogs:l,onError:c},(t=>((async()=>{try{const i=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find((e=>"webSocket"===e.config.type));return t?t.value:e.transport}return e.transport})(),o=a?$P({abi:n,eventName:a,args:s}):[],{unsubscribe:c}=await i.subscribe({params:["logs",{address:r,topics:o}],onData(e){if(!u)return;const r=e.result;try{const{eventName:e,args:s}=EI({abi:n,data:r.data,topics:r.topics,strict:h}),i=PI(r,{args:s,eventName:e});t.onLogs([i])}catch(e){let n,s;if(e instanceof aC||e instanceof oC){if(h)return;n=e.abiItem.name,s=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const i=PI(r,{args:s?[]:{},eventName:n});t.onLogs([i])}},onError(e){t.onError?.(e)}});p=c,u||p()}catch(e){c?.(e)}})(),()=>p())))})()}let mB=class extends GA{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join("\n"),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}};function bB({chain:e,currentChainId:t}){if(!e)throw new qI;if(t!==e.id)throw new GI({chain:e,currentChainId:t})}async function gB(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}async function yB(e,t){const{account:n=e.account,chain:r=e.chain,accessList:s,blobs:i,data:a,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:h,to:p,value:f,...m}=t;if(!n)throw new mB({docsPath:"/docs/actions/wallet/sendTransaction"});const b=QP(n);try{let n;if(OS(t),null!==r&&(n=await LA(e,gI,"getChainId")({}),bB({currentChainId:n,chain:r})),"local"===b.type){const t=await LA(e,vI,"prepareTransactionRequest")({account:b,accessList:s,blobs:i,chain:r,chainId:n,data:a,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:h,parameters:[...yI,"sidecars"],to:p,value:f,...m}),g=r?.serializers?.transaction,y=await b.signTransaction(t,{serializer:g});return await LA(e,gB,"sendRawTransaction")({serializedTransaction:y})}const g=e.chain?.formatters?.transactionRequest?.format,y=(g||IS)({...PS(m,{format:g}),accessList:s,blobs:i,chainId:n,data:a,from:b.address,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:h,to:p,value:f});return await e.request({method:"eth_sendTransaction",params:[y]},{retryCount:0})}catch(e){throw function(e,{docsPath:t,...n}){const r=(()=>{const t=CS(e,n);return t instanceof AS?e:t})();return new B_(r,{docsPath:t,...n})}(e,{...t,account:b,chain:t.chain||void 0})}}async function vB(e,t){const{abi:n,address:r,args:s,dataSuffix:i,functionName:a,...o}=t,c=YP({abi:n,args:s,functionName:a});return LA(e,yB,"sendTransaction")({data:`${c}${i?i.replace("0x",""):""}`,to:r,...o})}function wB(e){const t=e.length&&Array.isArray(e[0]);return{args:t?e[0]:[],options:(t?e[1]:e[0])??{}}}function xB(e,t){let n=!1;Array.isArray(e[0])?n=!0:1===e.length?n=t.inputs.some((e=>e.indexed)):2===e.length&&(n=!0);return{args:n?e[0]:void 0,options:(n?e[1]:e[0])??{}}}class kB extends GA{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip712DomainNotFoundError"})}}const EB=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];const AB=256;let CB,PB=AB;function _B(e=11){if(!CB||PB+e>2*AB){CB="",PB=0;for(let e=0;e{const r=n(t);for(const e in p)delete r[e];const s={...t,...r};return Object.assign(s,{extend:e(s)})}}(p)})}const IB=new kP(8192);function BB(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise(((s,i)=>{const a=async({count:o=0}={})=>{try{const t=await e();s(t)}catch(e){if(o{const n="function"==typeof t?t({count:o,error:e}):t;n&&await iB(n),a({count:o+1})})({error:e});i(e)}};a()}))}function TB(e,t={}){return async(n,r={})=>{const{dedupe:s=!1,retryDelay:i=150,retryCount:a=3,uid:o}={...t,...r};return function(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(IB.get(n))return IB.get(n);const r=e().finally((()=>IB.delete(n)));return IB.set(n,r),r}((()=>BB((async()=>{try{return await e(n)}catch(e){const t=e;switch(t.code){case $_.code:throw new $_(t);case V_.code:throw new V_(t);case W_.code:throw new W_(t);case Z_.code:throw new Z_(t);case Q_.code:throw new Q_(t);case K_.code:throw new K_(t);case Y_.code:throw new Y_(t);case J_.code:throw new J_(t);case X_.code:throw new X_(t);case eS.code:throw new eS(t);case tS.code:throw new tS(t);case nS.code:throw new nS(t);case rS.code:throw new rS(t);case sS.code:throw new sS(t);case iS.code:throw new iS(t);case aS.code:throw new aS(t);case oS.code:throw new oS(t);case cS.code:throw new cS(t);case 5e3:throw new rS(t);default:if(e instanceof GA)throw e;throw new lS(t)}}}),{delay:({count:e,error:t})=>{if(t&&t instanceof D_){const e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e)}return(1<function(e){if("code"in e&&"number"==typeof e.code)return-1===e.code||(e.code===tS.code||e.code===Q_.code);if(e instanceof D_&&e.status)return 403===e.status||(408===e.status||(413===e.status||(429===e.status||(500===e.status||(502===e.status||(503===e.status||504===e.status))))));return!0}(e)})),{enabled:s,id:s?bP(TC(`${o}.${m_(n)}`)):void 0})}}function MB({key:e,name:t,request:n,retryCount:r=3,retryDelay:s=150,timeout:i,type:a},o){return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:s,timeout:i,type:a},request:TB(n,{retryCount:r,retryDelay:s,uid:_B()}),value:o}}function OB(e,t={}){const{key:n="custom",name:r="Custom Provider",retryDelay:s}=t;return({retryCount:i})=>MB({key:n,name:r,request:e.request.bind(e),retryCount:t.retryCount??i,retryDelay:s,type:"custom"})}let NB=class extends GA{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}};function RB(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const FB=RB();function jB(e,t={}){return{async request(n){const{body:r,onRequest:s=t.onRequest,onResponse:i=t.onResponse,timeout:a=t.timeout??1e4}=n,o={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:c,method:l,signal:u}=o;try{const t=await function(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise(((s,i)=>{(async()=>{let a;try{const o=new AbortController;n>0&&(a=setTimeout((()=>{r?o.abort():i(t)}),n)),s(await e({signal:o?.signal||null}))}catch(e){"AbortError"===e?.name&&i(t),i(e)}finally{clearTimeout(a)}})()}))}((async({signal:t})=>{const n={...o,body:Array.isArray(r)?m_(r.map((e=>({jsonrpc:"2.0",id:e.id??FB.take(),...e})))):m_({jsonrpc:"2.0",id:r.id??FB.take(),...r}),headers:{"Content-Type":"application/json",...c},method:l||"POST",signal:u||(a>0?t:null)},i=new Request(e,n);s&&await s(i);return await fetch(e,n)}),{errorInstance:new H_({body:r,url:e}),timeout:a,signal:!0});let n;if(i&&await i(t),t.headers.get("Content-Type")?.startsWith("application/json")?n=await t.json():(n=await t.text(),n=JSON.parse(n||"{}")),!t.ok)throw new D_({body:r,details:m_(n.error)||t.statusText,headers:t.headers,status:t.status,url:e});return n}catch(t){if(t instanceof D_)throw t;if(t instanceof H_)throw t;throw new D_({body:r,cause:t,url:e})}}}}function LB(e,t={}){const{batch:n,fetchOptions:r,key:s="http",name:i="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:o,retryDelay:c}=t;return({chain:l,retryCount:u,timeout:d})=>{const{batchSize:h=1e3,wait:p=0}="object"==typeof n?n:{},f=t.retryCount??u,m=d??t.timeout??1e4,b=e||l?.rpcUrls.default.http[0];if(!b)throw new NB;const g=jB(b,{fetchOptions:r,onRequest:a,onResponse:o,timeout:m});return MB({key:s,name:i,async request({method:e,params:t}){const r={method:e,params:t},{schedule:s}=YI({id:b,wait:p,shouldSplitBatch:e=>e.length>h,fn:e=>g.request({body:e}),sort:(e,t)=>e.id-t.id}),[{error:i,result:a}]=await(async e=>n?s(e):[await g.request({body:e})])(r);if(i)throw new z_({body:r,error:i,url:b});return a},retryCount:f,retryDelay:c,timeout:m,type:"http"},{fetchOptions:r,url:b})}}function UB(e,t){if(!(e instanceof GA))return!1;const n=e.walk((e=>e instanceof F_));return n instanceof F_&&("ResolverNotFound"===n.data?.errorName||("ResolverWildcardNotSupported"===n.data?.errorName||("ResolverNotContract"===n.data?.errorName||("ResolverError"===n.data?.errorName||("HttpError"===n.data?.errorName||(!!n.reason?.includes("Wildcard on non-extended resolvers is not supported")||"reverse"===t&&n.reason===JP[50]))))))}function DB(e){if(66!==e.length)return null;if(0!==e.indexOf("["))return null;if(65!==e.indexOf("]"))return null;const t=`0x${e.slice(1,65)}`;return zA(t)?t:null}function zB(e){let t=new Uint8Array(32).fill(0);if(!e)return SC(t);const n=e.split(".");for(let e=n.length-1;e>=0;e-=1){const r=DB(n[e]),s=r?OC(r):bP(jC(n[e]),"bytes");t=bP(IP([t,s]),"bytes")}return SC(t)}function HB(e){return`[${e.slice(2)}]`}function GB(e){const t=new Uint8Array(32).fill(0);return e?DB(e)||bP(jC(e)):SC(t)}function qB(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const n=new Uint8Array(jC(t).byteLength+2);let r=0;const s=t.split(".");for(let e=0;e255&&(t=jC(HB(GB(s[e])))),n[r]=t.length,n.set(t,r+1),r+=t.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}let $B=class extends GA{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}},VB=class extends GA{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}},WB=class extends GA{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}},ZB=class extends GA{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}};const QB=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,KB=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,YB=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,JB=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function XB(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function eT({uri:e,gatewayUrls:t}){const n=YB.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=XB(t?.ipfs,"https://ipfs.io"),s=XB(t?.arweave,"https://arweave.net"),i=e.match(QB),{protocol:a,subpath:o,target:c,subtarget:l=""}=i?.groups||{},u="ipns:/"===a||"ipns/"===o,d="ipfs:/"===a||"ipfs/"===o||KB.test(e);if(e.startsWith("http")&&!u&&!d){let n=e;return t?.arweave&&(n=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:n,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${r}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===a&&c)return{uri:`${s}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let h=e.replace(JB,"");if(h.startsWith("{const n=new Image;n.onload=()=>{t(!0)},n.onerror=()=>{t(!1)},n.src=e}))}}(n);if(s)return n;throw new WB({uri:t})}async function rT(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?async function(e,{gatewayUrls:t,record:n}){const r=function(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[i,a]=n.split(":"),[o,c]=r.split(":");if(!i||"eip155"!==i.toLowerCase())throw new VB({reason:"Only EIP-155 supported"});if(!a)throw new VB({reason:"Chain ID not found"});if(!c)throw new VB({reason:"Contract address not found"});if(!s)throw new VB({reason:"Token ID not found"});if(!o)throw new VB({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a),namespace:o.toLowerCase(),contractAddress:c,tokenID:s}}(n),s=await async function(e,{nft:t}){if("erc721"===t.namespace)return XI(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return XI(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new ZB({namespace:t.namespace})}(e,{nft:r}),{uri:i,isOnChain:a,isEncoded:o}=eT({uri:s,gatewayUrls:t});if(a&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){const e=o?atob(i.replace("data:application/json;base64,","")):i;return nT({uri:tT(JSON.parse(e)),gatewayUrls:t})}let c=r.tokenID;"erc1155"===r.namespace&&(c=c.replace("0x","").padStart(64,"0"));return async function({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then((e=>e.json()));return await nT({gatewayUrls:e,uri:tT(n)})}catch{throw new WB({uri:t})}}({gatewayUrls:t,uri:i.replace(/(?:0x)?{id}/,c)})}(e,{gatewayUrls:t,record:n}):nT({uri:n,gatewayUrls:t})}async function sT(e,{blockNumber:t,blockTag:n,name:r,key:s,gatewayUrls:i,strict:a,universalResolverAddress:o}){let c=o;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=QI({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const a={address:c,abi:OI,functionName:"resolve",args:[PC(qB(r)),YP({abi:RI,functionName:"text",args:[zB(r),s]})],blockNumber:t,blockTag:n},o=LA(e,XI,"readContract"),l=i?await o({...a,args:[...a.args,i]}):await o(a);if("0x"===l[0])return null;const u=BI({abi:RI,functionName:"text",data:l[0]});return""===u?null:u}catch(e){if(a)throw e;if(UB(e,"resolve"))return null;throw e}}async function iT(e,{address:t,args:n,event:r,events:s,fromBlock:i,strict:a,toBlock:o}={}){const c=s??(r?[r]:void 0),l=WP(e,{method:"eth_newFilter"});let u=[];if(c){const e=c.flatMap((e=>$P({abi:[e],eventName:e.name,args:n})));u=[e],r&&(u=u[0])}const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof i?IC(i):i,toBlock:"bigint"==typeof o?IC(o):o,...u.length?{topics:u}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:i,id:d,request:l(d),strict:Boolean(a),toBlock:o,type:"event"}}async function aT(e){const t=WP(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function oT(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=void 0!==n?IC(n):void 0,i=await e.request({method:"eth_getCode",params:[t,s||r]},{dedupe:Boolean(s)});if("0x"!==i)return i}async function cT(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const i=n?IC(n):void 0;return function(e){return{baseFeePerGas:e.baseFeePerGas.map((e=>BigInt(e))),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:e.reward?.map((e=>e.map((e=>BigInt(e)))))}}(await e.request({method:"eth_feeHistory",params:[IC(t),i||r,s]},{dedupe:Boolean(i)}))}let lT=class extends GA{constructor({callbackSelector:e,cause:t,data:n,extraData:r,sender:s,urls:i}){super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],t.metaMessages?.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map((e=>` ${e}`))],` Sender: ${s}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${r}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}},uT=class extends GA{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${t}`,`Response: ${m_(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}},dT=class extends GA{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}};function hT(e,t){if(!SP(e,{strict:!1}))throw new xP({address:e});if(!SP(t,{strict:!1}))throw new xP({address:t});return e.toLowerCase()===t.toLowerCase()}const pT={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function fT({data:e,sender:t,urls:n}){let r=new Error("An unknown error occurred.");for(let s=0;s`${t} ${e}`)).join(",")})`;return n}({primaryType:e,types:t}));return bP(n)}function ET({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),s=r?.[0];if(n.has(s)||void 0===t[s])return n;n.add(s);for(const e of t[s])ET({primaryType:e.type,types:t},n);return n}function AT({types:e,name:t,type:n,value:r}){if(void 0!==e[n])return[{type:"bytes32"},bP(xT({data:r,primaryType:n,types:e}))];if("bytes"===n){return[{type:"bytes32"},bP(r=`0x${(r.length%2?"0":"")+r.slice(2)}`)]}if("string"===n)return[{type:"bytes32"},bP(PC(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),i=r.map((n=>AT({name:t,type:s,types:e,value:n})));return[{type:"bytes32"},bP(FP(i.map((([e])=>e)),i.map((([,e])=>e))))]}return[{type:n},r]}function CT(e){const{domain:t,message:n,primaryType:r,types:s}=e,i=(e,t)=>{for(const n of e){const{name:e,type:r}=n,a=t[e],o=r.match(yT);if(o&&("number"==typeof a||"bigint"==typeof a)){const[e,t,n]=o;IC(a,{signed:"int"===t,size:Number.parseInt(n)/8})}if("address"===r&&"string"==typeof a&&!SP(a))throw new xP({address:a});const c=r.match(gT);if(c){const[e,t]=c;if(t&&HA(a)!==Number.parseInt(t))throw new iC({expectedSize:Number.parseInt(t),givenSize:HA(a)})}const l=s[r];l&&i(l,a)}};s.EIP712Domain&&t&&i(s.EIP712Domain,t),"EIP712Domain"!==r&&i(s[r],n)}function PT({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},"number"==typeof e?.chainId&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function _T(e,t="hex"){const n=ST(e),r=i_(new Uint8Array(n.length));return n.encode(r),"hex"===t?SC(r.bytes):r.bytes}function ST(e){return Array.isArray(e)?function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=IT(t);return{length:t<=55?1+t:1+n+t,encode(r){t<=55?r.pushByte(192+t):(r.pushByte(247+n),1===n?r.pushUint8(t):2===n?r.pushUint16(t):3===n?r.pushUint24(t):r.pushUint32(t));for(const{encode:t}of e)t(r)}}}(e.map((e=>ST(e)))):function(e){const t="string"==typeof e?FC(e):e,n=IT(t.length),r=1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length;return{length:r,encode(e){1===t.length&&t[0]<128?e.pushBytes(t):t.length<=55?(e.pushByte(128+t.length),e.pushBytes(t)):(e.pushByte(183+n),1===n?e.pushUint8(t.length):2===n?e.pushUint16(t.length):3===n?e.pushUint24(t.length):e.pushUint32(t.length),e.pushBytes(t))}}}(e)}function IT(e){if(e<256)return 1;if(e<65536)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new GA("Length is too large.")}const BT={"0x0":"reverted","0x1":"success"};function TT(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map((e=>PI(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?AC(e.transactionIndex):null,status:e.status?BT[e.status]:null,type:e.type?LS[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const MT=_S("transactionReceipt",TT);function OT(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw new Error("Invalid yParityOrV value")}async function NT({hash:e,signature:t}){return n=await async function({hash:e,signature:t}){const n=zA(e)?e:PC(e),{secp256k1:r}=await Promise.resolve().then((function(){return eO})),s=(()=>{if("object"==typeof t&&"r"in t&&"s"in t){const{r:e,s:n,v:s,yParity:i}=t,a=OT(Number(i??s));return new r.Signature(EC(e),EC(n)).addRecoveryBit(a)}const e=zA(t)?t:PC(t),n=OT(AC(`0x${e.slice(130)}`));return r.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(n)})();return`0x${s.recoverPublicKey(n.substring(2)).toHex(!1)}`}({hash:e,signature:t}),AP(`0x${bP(`0x${n.substring(4)}`).substring(26)}`);var n}const RT="Ethereum Signed Message:\n";function FT(e,t){return bP(function(e){const t="string"==typeof e?TC(e):"string"==typeof e.raw?e.raw:SC(e.raw);return IP([TC(`${RT}${HA(t)}`),t])}(e),t)}const jT="0x6492649264926492649264926492649264926492649264926492649264926492";function LT(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new VI({chainId:t});if(s&&!SP(s))throw new xP({address:s});if(r&&r>2n**256n-1n)throw new fS({maxFeePerGas:r});if(n&&r&&n>r)throw new ES({maxFeePerGas:r,maxPriorityFeePerGas:n})}function UT(e){if(!e||0===e.length)return[];const t=[];for(let n=0;n2n**256n-1n)throw new fS({maxFeePerGas:r})}(e);const u=UT(c),d=[PC(n),i?PC(i):"0x",l?PC(l):"0x",r?PC(r):"0x",a??"0x",o?PC(o):"0x",s??"0x",u,...zT(e,t)];return BP(["0x01",_T(d)])}(e,t):"eip4844"===n?function(e,t){const{chainId:n,gas:r,nonce:s,to:i,value:a,maxFeePerBlobGas:o,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;!function(e){const{blobVersionedHashes:t}=e;if(t){if(0===t.length)throw new hI;for(const e of t){const t=HA(e),n=AC(TP(e,0,1));if(32!==t)throw new pI({hash:e,size:t});if(n!==uI)throw new fI({hash:e,version:n})}}LT(e)}(e);let h=e.blobVersionedHashes,p=e.sidecars;if(e.blobs&&(void 0===h||void 0===p)){const t="string"==typeof e.blobs[0]?e.blobs:e.blobs.map((e=>SC(e))),n=e.kzg,r=ZS({blobs:t,kzg:n});if(void 0===h&&(h=iI({commitments:r})),void 0===p){p=mI({blobs:t,commitments:r,proofs:QS({blobs:t,commitments:r,kzg:n})})}}const f=UT(u),m=[PC(n),s?PC(s):"0x",l?PC(l):"0x",c?PC(c):"0x",r?PC(r):"0x",i??"0x",a?PC(a):"0x",d??"0x",f,o?PC(o):"0x",h??[],...zT(e,t)],b=[],g=[],y=[];if(p)for(let e=0;e2n**256n-1n)throw new fS({maxFeePerGas:r});if(a)throw new GA("`accessList` is not a valid Legacy Transaction attribute.")}(e);let l=[i?PC(i):"0x",c?PC(c):"0x",r?PC(r):"0x",a??"0x",o?PC(o):"0x",s??"0x"];if(t){const e=(()=>{if(t.v>=35n){return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n)}if(n>0)return BigInt(2*n)+BigInt(35n+t.v-27n);const e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new __({v:t.v});return e})(),r=xC(t.r),s=xC(t.s);l=[...l,PC(e),"0x00"===r?"0x":r,"0x00"===s?"0x":s]}else n>0&&(l=[...l,PC(n),"0x","0x"]);return _T(l)}(e,t)}function zT(e,t){const n=t??e,{v:r,yParity:s}=n;if(void 0===n.r)return[];if(void 0===n.s)return[];if(void 0===r&&void 0===s)return[];const i=xC(n.r),a=xC(n.s);return["number"==typeof s?s?PC(1):"0x":0n===r?"0x":1n===r?PC(1):27n===r?"0x":PC(1),"0x00"===i?"0x":i,"0x00"===a?"0x":a]}async function HT(e,{address:t,blockNumber:n,blockTag:r,storageKeys:s}){const i=r??"latest",a=void 0!==n?IC(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?AC(e.nonce):void 0,storageProof:e.storageProof?(t=e.storageProof,t.map((e=>({...e,value:BigInt(e.value)})))):void 0};var t}(await e.request({method:"eth_getProof",params:[t,s,a||i]}))}async function GT(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:i}){const a=r||"latest",o=void 0!==n?IC(n):void 0;let c=null;if(s?c=await e.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,IC(i)]},{dedupe:!0}):(o||a)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||a,IC(i)]},{dedupe:Boolean(o)})),!c)throw new T_({blockHash:t,blockNumber:n,blockTag:a,hash:s,index:i});return(e.chain?.formatters?.transaction?.format||US)(c)}async function qT(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new M_({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||TT)(n)} /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ const $T=BigInt(0),VT=BigInt(1),WT=BigInt(2);function ZT(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function QT(e){if(!ZT(e))throw new Error("Uint8Array expected")}const KT=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function YT(e){QT(e);let t="";for(let n=0;n=eM._0&&e<=eM._9?e-eM._0:e>=eM._A&&e<=eM._F?e-(eM._A-10):e>=eM._a&&e<=eM._f?e-(eM._a-10):void 0}function nM(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,s=0;t(WT<new Uint8Array(e),hM=e=>Uint8Array.from(e);function pM(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=dM(e),s=dM(e),i=0;const a=()=>{r.fill(1),s.fill(0),i=0},o=(...e)=>n(s,r,...e),c=(e=dM())=>{s=o(hM([0]),e),r=o(),0!==e.length&&(s=o(hM([1]),e),r=o())},l=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e{let n;for(a(),c(e);!(n=t(l()));)c();return a(),n}}const fM={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||ZT(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function mM(e,t,n={}){const r=(t,n,r)=>{const s=fM[n];if("function"!=typeof s)throw new Error(`Invalid validator "${n}", expected function`);const i=e[t];if(!(r&&void 0===i||s(i,e)))throw new Error(`Invalid param ${String(t)}=${i} (${typeof i}), expected ${n}`)};for(const[e,n]of Object.entries(t))r(e,n,!1);for(const[e,t]of Object.entries(n))r(e,t,!0);return e}var bM=Object.freeze({__proto__:null,abytes:QT,bitGet:function(e,t){return e>>BigInt(t)&VT},bitLen:function(e){let t;for(t=0;e>$T;e>>=VT,t+=1);return t},bitMask:uM,bitSet:function(e,t,n){return e|(n?VT:$T)<=gM?n:t+n}function CM(e,t,n){if(n<=gM||t 0");if(n===yM)return gM;let r=yM;for(;t>gM;)t&yM&&(r=r*e%n),e=e*e%n,t>>=yM;return r}function PM(e,t,n){let r=e;for(;t-- >gM;)r*=r,r%=n;return r}function _M(e,t){if(e===gM||t<=gM)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=AM(e,t),r=t,s=gM,i=yM;for(;n!==gM;){const e=r%n,t=s-i*(r/n);r=n,n=e,s=i,i=t}if(r!==yM)throw new Error("invert: does not exist");return AM(s,t)}function SM(e){if(e%xM===wM){const t=(e+yM)/xM;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%EM===kM){const t=(e-kM)/EM;return function(e,n){const r=e.mul(n,vM),s=e.pow(r,t),i=e.mul(n,s),a=e.mul(e.mul(i,vM),s),o=e.mul(i,e.sub(a,e.ONE));if(!e.eql(e.sqr(o),n))throw new Error("Cannot find square root");return o}}return function(e){const t=(e-yM)/vM;let n,r,s;for(n=e-yM,r=0;n%vM===gM;n/=vM,r++);for(s=vM;s(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});mM(e,t)}(e.Fp),mM(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...BM(e.n,e.nBitLength),...e,p:e.Fp.ORDER})} /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const{bytesToNumberBE:FM,hexToBytes:jM}=bM,LM={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=LM;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(128&r[0])throw new t("Invalid signature integer: negative");if(0===r[0]&&!(128&r[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:FM(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=LM,n="string"==typeof e?jM(e):e;QT(n);let r=n.length;if(r<2||48!=n[0])throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:i}=LM._parseInt(n.subarray(2)),{d:a,l:o}=LM._parseInt(i);if(o.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,n=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},r=t(n(e.s)),s=t(n(e.r)),i=r.length/2,a=s.length/2,o=n(i),c=n(a);return`30${n(a+i+4)}02${c}${s}02${o}${r}`}},UM=BigInt(0),DM=BigInt(1);BigInt(2);const zM=BigInt(3);function HM(e){const t=function(e){const t=RM(e);mM(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:n}=t,r=t.toBytes||((e,t,r)=>{const s=t.toAffine();return cM(Uint8Array.from([4]),n.toBytes(s.x),n.toBytes(s.y))}),s=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function i(e){const{a:r,b:s}=t,i=n.sqr(e),a=n.mul(i,e);return n.add(n.add(a,n.mul(e,r)),s)}if(!n.eql(n.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function a(e){return"bigint"==typeof e&&UMn.eql(e,n.ZERO);return s(t)&&s(r)?d.ZERO:new d(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(d.fromAffine)}static fromHex(e){const t=d.fromAffine(s(oM("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(c(e))}_setWindowSize(e){this._WINDOW_SIZE=e,l.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:r}=this.toAffine();if(!n.isValid(e)||!n.isValid(r))throw new Error("bad point: x or y not FE");const s=n.sqr(r),a=i(e);if(!n.eql(s,a))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){u(e);const{px:t,py:r,pz:s}=this,{px:i,py:a,pz:o}=e,c=n.eql(n.mul(t,o),n.mul(i,s)),l=n.eql(n.mul(r,o),n.mul(a,s));return c&&l}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){const{a:e,b:r}=t,s=n.mul(r,zM),{px:i,py:a,pz:o}=this;let c=n.ZERO,l=n.ZERO,u=n.ZERO,h=n.mul(i,i),p=n.mul(a,a),f=n.mul(o,o),m=n.mul(i,a);return m=n.add(m,m),u=n.mul(i,o),u=n.add(u,u),c=n.mul(e,u),l=n.mul(s,f),l=n.add(c,l),c=n.sub(p,l),l=n.add(p,l),l=n.mul(c,l),c=n.mul(m,c),u=n.mul(s,u),f=n.mul(e,f),m=n.sub(h,f),m=n.mul(e,m),m=n.add(m,u),u=n.add(h,h),h=n.add(u,h),h=n.add(h,f),h=n.mul(h,m),l=n.add(l,h),f=n.mul(a,o),f=n.add(f,f),h=n.mul(f,m),c=n.sub(c,h),u=n.mul(f,p),u=n.add(u,u),u=n.add(u,u),new d(c,l,u)}add(e){u(e);const{px:r,py:s,pz:i}=this,{px:a,py:o,pz:c}=e;let l=n.ZERO,h=n.ZERO,p=n.ZERO;const f=t.a,m=n.mul(t.b,zM);let b=n.mul(r,a),g=n.mul(s,o),y=n.mul(i,c),v=n.add(r,s),w=n.add(a,o);v=n.mul(v,w),w=n.add(b,g),v=n.sub(v,w),w=n.add(r,i);let x=n.add(a,c);return w=n.mul(w,x),x=n.add(b,y),w=n.sub(w,x),x=n.add(s,i),l=n.add(o,c),x=n.mul(x,l),l=n.add(g,y),x=n.sub(x,l),p=n.mul(f,w),l=n.mul(m,y),p=n.add(l,p),l=n.sub(g,p),p=n.add(g,p),h=n.mul(l,p),g=n.add(b,b),g=n.add(g,b),y=n.mul(f,y),w=n.mul(m,w),g=n.add(g,y),y=n.sub(b,y),y=n.mul(f,y),w=n.add(w,y),b=n.mul(g,w),h=n.add(h,b),b=n.mul(x,w),l=n.mul(v,l),l=n.sub(l,b),b=n.mul(v,g),p=n.mul(x,p),p=n.add(p,b),new d(l,h,p)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return p.wNAFCached(this,l,e,(e=>{const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(d.fromAffine)}))}multiplyUnsafe(e){const r=d.ZERO;if(e===UM)return r;if(o(e),e===DM)return this;const{endo:s}=t;if(!s)return p.unsafeLadder(this,e);let{k1neg:i,k1:a,k2neg:c,k2:l}=s.splitScalar(e),u=r,h=r,f=this;for(;a>UM||l>UM;)a&DM&&(u=u.add(f)),l&DM&&(h=h.add(f)),f=f.double(),a>>=DM,l>>=DM;return i&&(u=u.negate()),c&&(h=h.negate()),h=new d(n.mul(h.px,s.beta),h.py,h.pz),u.add(h)}multiply(e){o(e);let r,s,i=e;const{endo:a}=t;if(a){const{k1neg:e,k1:t,k2neg:o,k2:c}=a.splitScalar(i);let{p:l,f:u}=this.wNAF(t),{p:h,f:f}=this.wNAF(c);l=p.constTimeNegate(e,l),h=p.constTimeNegate(o,h),h=new d(n.mul(h.px,a.beta),h.py,h.pz),r=l.add(h),s=u.add(f)}else{const{p:e,f:t}=this.wNAF(i);r=e,s=t}return d.normalizeZ([r,s])[0]}multiplyAndAddUnsafe(e,t,n){const r=d.BASE,s=(e,t)=>t!==UM&&t!==DM&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),i=s(this,t).add(s(e,n));return i.is0()?void 0:i}toAffine(e){const{px:t,py:r,pz:s}=this,i=this.is0();null==e&&(e=i?n.ONE:n.inv(s));const a=n.mul(t,e),o=n.mul(r,e),c=n.mul(s,e);if(i)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw new Error("invZ was invalid");return{x:a,y:o}}isTorsionFree(){const{h:e,isTorsionFree:n}=t;if(e===DM)return!0;if(n)return n(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:n}=t;return e===DM?this:n?n(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),r(d,this,e)}toHex(e=!0){return YT(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);const h=t.nBitLength,p=function(e,t){const n=(e,t)=>{const n=t.negate();return e?n:t},r=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,s=t;for(;n>OM;)n&NM&&(r=r.add(s)),s=s.double(),n>>=NM;return r},precomputeWindow(e,t){const{windows:n,windowSize:s}=r(t),i=[];let a=e,o=a;for(let e=0;e>=h,r>o&&(r-=d,i+=NM);const a=t,p=t+Math.abs(r)-1,f=e%2!=0,m=r<0;0===r?l=l.add(n(f,s[a])):c=c.add(n(m,s[p]))}return{p:c,f:l}},wNAFCached(e,t,n,r){const s=e._WINDOW_SIZE||1;let i=t.get(e);return i||(i=this.precomputeWindow(e,s),1!==s&&t.set(e,r(i))),this.wNAF(s,i,n)}}}(d,t.endo?Math.ceil(h/2):h);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:i,isWithinCurveOrder:a}}function GM(e){const t=function(e){const t=RM(e);return mM(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:n,n:r}=t,s=n.BYTES+1,i=2*n.BYTES+1;function a(e){return AM(e,r)}function o(e){return _M(e,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:l,weierstrassEquation:u,isWithinCurveOrder:d}=HM({...t,toBytes(e,t,r){const s=t.toAffine(),i=n.toBytes(s.x),a=cM;return r?a(Uint8Array.from([t.hasEvenY()?2:3]),i):a(Uint8Array.from([4]),i,n.toBytes(s.y))},fromBytes(e){const t=e.length,r=e[0],a=e.subarray(1);if(t!==s||2!==r&&3!==r){if(t===i&&4===r){return{x:n.fromBytes(a.subarray(0,n.BYTES)),y:n.fromBytes(a.subarray(n.BYTES,2*n.BYTES))}}throw new Error(`Point of length ${t} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}{const e=rM(a);if(!(UM<(o=e)&&oYT(iM(e,t.nByteLength));function p(e){return e>r>>DM}const f=(e,t,n)=>rM(e.slice(t,n));class m{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){const n=t.nByteLength;return e=oM("compactSignature",e,2*n),new m(f(e,0,n),f(e,n,2*n))}static fromDER(e){const{r:t,s:n}=LM.toSig(oM("DER",e));return new m(t,n)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new m(this.r,this.s,e)}recoverPublicKey(e){const{r:r,s:s,recovery:i}=this,l=v(oM("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const u=2===i||3===i?r+t.n:r;if(u>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=1&i?"03":"02",p=c.fromHex(d+h(u)),f=o(u),m=a(-l*f),b=a(s*f),g=c.BASE.multiplyAndAddUnsafe(p,m,b);if(!g)throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return nM(this.toDERHex())}toDERHex(){return LM.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return nM(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const b={isValidPrivateKey(e){try{return l(e),!0}catch(e){return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const e=MM(t.n);return function(e,t,n=!1){const r=e.length,s=TM(t),i=MM(t);if(r<16||r1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);const a=AM(n?rM(e):sM(e),t-yM)+yM;return n?aM(a,s):iM(a,s)}(t.randomBytes(e),t.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function g(e){const t=ZT(e),n="string"==typeof e,r=(t||n)&&e.length;return t?r===s||r===i:n?r===2*s||r===2*i:e instanceof c}const y=t.bits2int||function(e){const n=rM(e),r=8*e.length-t.nBitLength;return r>0?n>>BigInt(r):n},v=t.bits2int_modN||function(e){return a(y(e))},w=uM(t.nBitLength);function x(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(UM<=e&&ee in s)))throw new Error("sign() legacy options not supported");const{hash:i,randomBytes:u}=t;let{lowS:h,prehash:f,extraEntropy:b}=s;null==h&&(h=!0),e=oM("msgHash",e),f&&(e=oM("prehashed msgHash",i(e)));const g=v(e),w=l(r),k=[x(w),x(g)];if(null!=b&&!1!==b){const e=!0===b?u(n.BYTES):b;k.push(oM("extraEntropy",e))}const A=cM(...k),C=g;return{seed:A,k2sig:function(e){const t=y(e);if(!d(t))return;const n=o(t),r=c.BASE.multiply(t).toAffine(),s=a(r.x);if(s===UM)return;const i=a(n*a(C+s*w));if(i===UM)return;let l=(r.x===s?0:2)|Number(r.y&DM),u=i;return h&&p(i)&&(u=function(e){return p(e)?a(-e):e}(i),l^=1),new m(s,u,l)}}}const E={lowS:t.lowS,prehash:!1},A={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,n=!0){if(g(e))throw new Error("first arg must be private key");if(!g(t))throw new Error("second arg must be public key");return c.fromHex(t).multiply(l(e)).toRawBytes(n)},sign:function(e,n,r=E){const{seed:s,k2sig:i}=k(e,n,r),a=t;return pM(a.hash.outputLen,a.nByteLength,a.hmac)(s,i)},verify:function(e,n,r,s=A){const i=e;if(n=oM("msgHash",n),r=oM("publicKey",r),"strict"in s)throw new Error("options.strict was renamed to lowS");const{lowS:l,prehash:u}=s;let d,h;try{if("string"==typeof i||ZT(i))try{d=m.fromDER(i)}catch(e){if(!(e instanceof LM.Err))throw e;d=m.fromCompact(i)}else{if("object"!=typeof i||"bigint"!=typeof i.r||"bigint"!=typeof i.s)throw new Error("PARSE");{const{r:e,s:t}=i;d=new m(e,t)}}h=c.fromHex(r)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(l&&d.hasHighS())return!1;u&&(n=t.hash(n));const{r:p,s:f}=d,b=v(n),g=o(f),y=a(b*g),w=a(p*g),x=c.BASE.multiplyAndAddUnsafe(h,y,w)?.toAffine();return!!x&&a(x.x)===p},ProjectivePoint:c,Signature:m,utils:b}}BigInt(4);let qM=class extends JC{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");LC(e.outputLen),LC(e.blockLen)}(e);const n=YC(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,s=new Uint8Array(r);s.set(n.length>r?e.create().update(n).digest():n);for(let e=0;enew qM(e,t).update(n).digest(); /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ function VM(e){return{hash:e,hmac:(t,...n)=>$M(e,t,function(...e){let t=0;for(let n=0;nnew qM(e,t); /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ const WM=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),ZM=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),QM=BigInt(1),KM=BigInt(2),YM=(e,t)=>(e+t/KM)/t;const JM=function(e,t,n=!1,r={}){if(e<=gM)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:i}=BM(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=SM(e),o=Object.freeze({ORDER:e,BITS:s,BYTES:i,MASK:uM(s),ZERO:gM,ONE:yM,create:t=>AM(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return gM<=t&&te===gM,isOdd:e=>(e&yM)===yM,neg:t=>AM(-t,e),eql:(e,t)=>e===t,sqr:t=>AM(t*t,e),add:(t,n)=>AM(t+n,e),sub:(t,n)=>AM(t-n,e),mul:(t,n)=>AM(t*n,e),pow:(e,t)=>function(e,t,n){if(n 0");if(n===gM)return e.ONE;if(n===yM)return t;let r=e.ONE,s=t;for(;n>gM;)n&yM&&(r=e.mul(r,s)),s=e.sqr(s),n>>=yM;return r}(o,e,t),div:(t,n)=>AM(t*_M(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>_M(t,e),sqrt:r.sqrt||(e=>a(o,e)),invertBatch:e=>function(e,t){const n=new Array(t.length),r=t.reduce(((t,r,s)=>e.is0(r)?t:(n[s]=t,e.mul(t,r))),e.ONE),s=e.inv(r);return t.reduceRight(((t,r,s)=>e.is0(r)?t:(n[s]=e.mul(t,n[s]),e.mul(t,r))),s),n}(o,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?aM(e,i):iM(e,i),fromBytes:e=>{if(e.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${e.length}`);return n?sM(e):rM(e)}});return Object.freeze(o)}(WM,void 0,void 0,{sqrt:function(e){const t=WM,n=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),a=BigInt(23),o=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=PM(u,n,t)*u%t,h=PM(d,n,t)*u%t,p=PM(h,KM,t)*l%t,f=PM(p,s,t)*p%t,m=PM(f,i,t)*f%t,b=PM(m,o,t)*m%t,g=PM(b,c,t)*b%t,y=PM(g,o,t)*m%t,v=PM(y,n,t)*u%t,w=PM(v,a,t)*f%t,x=PM(w,r,t)*l%t,k=PM(x,KM,t);if(!JM.eql(JM.sqr(k),e))throw new Error("Cannot find square root");return k}}),XM=function(e,t){const n=t=>GM({...e,...VM(t)});return Object.freeze({...n(t),create:n})}({a:BigInt(0),b:BigInt(7),Fp:JM,n:ZM,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=ZM,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-QM*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,a=BigInt("0x100000000000000000000000000000000"),o=YM(i*e,t),c=YM(-r*e,t);let l=AM(e-o*n-c*s,t),u=AM(-o*r-c*i,t);const d=l>a,h=u>a;if(d&&(l=t-l),h&&(u=t-u),l>a||u>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:h,k2:u}}}},rI);BigInt(0),XM.ProjectivePoint;var eO=Object.freeze({__proto__:null,secp256k1:XM});async function tO(e,t){const{address:n,factory:r,factoryData:s,hash:i,signature:a,...o}=t,c=zA(a)?a:"object"==typeof a&&"r"in a&&"s"in a?function({r:e,s:t,v:n,yParity:r}){const s=(()=>{if(0===r||1===r)return r;if(n&&(27n===n||28n===n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})();return`0x${new XM.Signature(EC(e),EC(t)).toCompactHex()}${0===s?"1b":"1c"}`}(a):SC(a),l=await(async()=>{if(!r&&!s)return c;if(function(e){return RP(e,-32)===jT}(c))return c;return await LA(e,oT,"getCode")({address:n})?c:function(e){const{address:t,data:n,signature:r}=e;return BP([FP([{type:"address"},{type:"bytes"},{type:"bytes"}],[t,n,r]),jT])}({address:r,data:s,signature:c})})();try{const{data:t}=await LA(e,JI,"call")({data:ZI({abi:jI,args:[n,i,l],bytecode:zI}),...o});return d="0x1",lM(zA(u=t??"0x0")?OC(u):u,zA(d)?OC(d):d)}catch(e){try{if(hT(CP(n),await NT({hash:i,signature:a})))return!0}catch{}if(e instanceof N_)return!1;throw e}var u,d}function nO(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:s,poll:i,pollingInterval:a=e.pollingInterval}){let o;return(void 0!==i?i:"webSocket"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type))?sB(m_(["watchBlockNumber",e.uid,t,n,a]),{onBlockNumber:r,onError:s},(r=>aB((async()=>{try{const t=await LA(e,dB,"getBlockNumber")({cacheTime:0});if(o){if(t===o)return;if(t-o>1&&n)for(let e=o+1n;eo)&&(r.onBlockNumber(t,o),o=t)}catch(e){r.onError?.(e)}}),{emitOnBegin:t,interval:a}))):sB(m_(["watchBlockNumber",e.uid,t,n]),{onBlockNumber:r,onError:s},(t=>{let n=!0,r=()=>n=!1;return(async()=>{try{const s=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find((e=>"webSocket"===e.config.type));return t?t.value:e.transport}return e.transport})(),{unsubscribe:i}=await s.subscribe({params:["newHeads"],onData(e){if(!n)return;const r=EC(e.result?.number);t.onBlockNumber(r,o),o=r},onError(e){t.onError?.(e)}});r=i,n||r()}catch(e){s?.(e)}})(),()=>r()}))}const rO=/^(?:(?[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?
0x[a-fA-F0-9]{40})\n\n(?:(?.*)\n\n)?/,sO=/(?:URI: (?.+))\n(?:Version: (?.+))\n(?:Chain ID: (?\d+))\n(?:Nonce: (?[a-zA-Z0-9]+))\n(?:Issued At: (?.+))(?:\nExpiration Time: (?.+))?(?:\nNot Before: (?.+))?(?:\nRequest ID: (?.+))?/;async function iO(e,t){const{address:n,domain:r,message:s,nonce:i,scheme:a,signature:o,time:c=new Date,...l}=t,u=function(e){const{scheme:t,statement:n,...r}=e.match(rO)?.groups??{},{chainId:s,expirationTime:i,issuedAt:a,notBefore:o,requestId:c,...l}=e.match(sO)?.groups??{},u=e.split("Resources:")[1]?.split("\n- ").slice(1);return{...r,...l,...s?{chainId:Number(s)}:{},...i?{expirationTime:new Date(i)}:{},...a?{issuedAt:new Date(a)}:{},...o?{notBefore:new Date(o)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}(s);if(!u.address)return!1;const d=function(e){const{address:t,domain:n,message:r,nonce:s,scheme:i,time:a=new Date}=e;if(n&&r.domain!==n)return!1;if(s&&r.nonce!==s)return!1;if(i&&r.scheme!==i)return!1;if(r.expirationTime&&a>=r.expirationTime)return!1;if(r.notBefore&&aJI(e,t),createBlockFilter:()=>async function(e){const t=WP(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>ZP(e,t),createEventFilter:t=>iT(e,t),createPendingTransactionFilter:()=>aT(e),estimateContractGas:t=>xI(e,t),estimateGas:t=>wI(e,t),getBalance:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n?IC(n):void 0,i=await e.request({method:"eth_getBalance",params:[t,s||r]});return BigInt(i)}(e,t),getBlobBaseFee:()=>async function(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}(e),getBlock:t=>GS(e,t),getBlockNumber:t=>dB(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=void 0!==n?IC(n):void 0;let i;return i=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]},{dedupe:Boolean(s)}),AC(i)}(e,t),getBytecode:t=>oT(e,t),getChainId:()=>gI(e),getCode:t=>oT(e,t),getContractEvents:t=>SI(e,t),getEip712Domain:t=>async function(e,t){const{address:n,factory:r,factoryData:s}=t;try{const[t,i,a,o,c,l,u]=await LA(e,XI,"readContract")({abi:EB,address:n,functionName:"eip712Domain",factory:r,factoryData:s});return{domain:{name:i,version:a,chainId:Number(o),verifyingContract:c,salt:l},extensions:u,fields:t}}catch(e){const t=e;if("ContractFunctionExecutionError"===t.name&&"ContractFunctionZeroDataError"===t.cause.name)throw new kB({address:n});throw t}}(e,t),getEnsAddress:t=>async function(e,{blockNumber:t,blockTag:n,coinType:r,name:s,gatewayUrls:i,strict:a,universalResolverAddress:o}){let c=o;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=QI({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const a=YP({abi:FI,functionName:"addr",...null!=r?{args:[zB(s),BigInt(r)]}:{args:[zB(s)]}}),o={address:c,abi:OI,functionName:"resolve",args:[PC(qB(s)),a],blockNumber:t,blockTag:n},l=LA(e,XI,"readContract"),u=i?await l({...o,args:[...o.args,i]}):await l(o);if("0x"===u[0])return null;const d=BI({abi:FI,args:null!=r?[zB(s),BigInt(r)]:void 0,functionName:"addr",data:u[0]});return"0x"===d||"0x00"===xC(d)?null:d}catch(e){if(a)throw e;if(UB(e,"resolve"))return null;throw e}}(e,t),getEnsAvatar:t=>async function(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:i,strict:a,universalResolverAddress:o}){const c=await LA(e,sT,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:o,gatewayUrls:i,strict:a});if(!c)return null;try{return await rT(e,{record:c,gatewayUrls:r})}catch{return null}}(e,t),getEnsName:t=>async function(e,{address:t,blockNumber:n,blockTag:r,gatewayUrls:s,strict:i,universalResolverAddress:a}){let o=a;if(!o){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=QI({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const i={address:o,abi:NI,functionName:"reverse",args:[PC(qB(c))],blockNumber:n,blockTag:r},a=LA(e,XI,"readContract"),[l,u]=s?await a({...i,args:[...i.args,s]}):await a(i);return t.toLowerCase()!==u.toLowerCase()?null:l}catch(e){if(i)throw e;if(UB(e,"reverse"))return null;throw e}}(e,t),getEnsResolver:t=>async function(e,{blockNumber:t,blockTag:n,name:r,universalResolverAddress:s}){let i=s;if(!i){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=QI({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[a]=await LA(e,XI,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[PC(qB(r))],blockNumber:t,blockTag:n});return a}(e,t),getEnsText:t=>sT(e,t),getFeeHistory:t=>cT(e,t),estimateFeesPerGas:t=>async function(e,t){return VS(e,t)}(e,t),getFilterChanges:e=>hB(0,e),getFilterLogs:e=>async function(e,{filter:t}){const n=t.strict??!1,r=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map((e=>PI(e)));return t.abi?CI({abi:t.abi,logs:r,strict:n}):r}(0,e),getGasPrice:()=>qS(e),getLogs:t=>_I(e,t),getProof:t=>HT(e,t),estimateMaxPriorityFeePerGas:t=>async function(e,t){return $S(e,t)}(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest",slot:s}){const i=void 0!==n?IC(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,i||r]})}(e,t),getTransaction:t=>GT(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([LA(e,dB,"getBlockNumber")({}),t?LA(e,GT,"getTransaction")({hash:t}):void 0]),i=n?.blockNumber||s?.blockNumber;return i?r-i+1n:0n}(e,t),getTransactionCount:t=>WS(e,t),getTransactionReceipt:t=>qT(e,t),multicall:t=>async function(e,t){const{allowFailure:n=!0,batchSize:r,blockNumber:s,blockTag:i,multicallAddress:a,stateOverride:o}=t,c=t.contracts,l=r??("object"==typeof e.batch?.multicall&&e.batch.multicall.batchSize||1024);let u=a;if(!u){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");u=QI({blockNumber:s,chain:e.chain,contract:"multicall3"})}const d=[[]];let h=0,p=0;for(let e=0;e0&&p>l&&d[h].length>0&&(h++,p=(e.length-2)/2,d[h]=[]),d[h]=[...d[h],{allowFailure:!0,callData:e,target:r}]}catch(e){const a=dS(e,{abi:t,address:r,args:s,docsPath:"/docs/contract/multicall",functionName:i});if(!n)throw a;d[h]=[...d[h],{allowFailure:!0,callData:"0x",target:r}]}}const f=await Promise.allSettled(d.map((t=>LA(e,XI,"readContract")({abi:TI,address:u,args:[t],blockNumber:s,blockTag:i,functionName:"aggregate3",stateOverride:o})))),m=[];for(let e=0;evI(e,t),readContract:t=>XI(e,t),sendRawTransaction:t=>gB(e,t),simulateContract:t=>eB(e,t),verifyMessage:t=>async function(e,{address:t,message:n,factory:r,factoryData:s,signature:i,...a}){return tO(e,{address:t,factory:r,factoryData:s,hash:FT(n),signature:i,...a})}(e,t),verifySiweMessage:t=>iO(e,t),verifyTypedData:t=>async function(e,t){const{address:n,factory:r,factoryData:s,signature:i,message:a,primaryType:o,types:c,domain:l,...u}=t;return tO(e,{address:n,factory:r,factoryData:s,hash:vT({message:a,primaryType:o,types:c,domain:l}),signature:i,...u})}(e,t),uninstallFilter:e=>pB(0,e),waitForTransactionReceipt:t=>async function(e,{confirmations:t=1,hash:n,onReplaced:r,pollingInterval:s=e.pollingInterval,retryCount:i=6,retryDelay:a=({count:e})=>200*(1<{o&&setTimeout((()=>m(new O_({hash:n}))),o);const b=sB(c,{onReplaced:r,resolve:f,reject:m},(r=>{const o=LA(e,nO,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:s,async onBlockNumber(s){const c=e=>{o(),e(),b()};let f=s;if(!p){h>i&&c((()=>r.reject(new O_({hash:n}))));try{if(d){if(t>1&&(!d.blockNumber||f-d.blockNumber+1nr.resolve(d)))}if(l||(p=!0,await BB((async()=>{l=await LA(e,GT,"getTransaction")({hash:n}),l.blockNumber&&(f=l.blockNumber)}),{delay:a,retryCount:i}),p=!1),d=await LA(e,qT,"getTransactionReceipt")({hash:n}),t>1&&(!d.blockNumber||f-d.blockNumber+1nr.resolve(d)))}catch(n){if(n instanceof T_||n instanceof M_){if(!l)return void(p=!1);try{u=l,p=!0;const n=await BB((()=>LA(e,GS,"getBlock")({blockNumber:f,includeTransactions:!0})),{delay:a,retryCount:i,shouldRetry:({error:e})=>e instanceof jS});p=!1;const s=n.transactions.find((({from:e,nonce:t})=>e===u.from&&t===u.nonce));if(!s)return;if(d=await LA(e,qT,"getTransactionReceipt")({hash:s.hash}),t>1&&(!d.blockNumber||f-d.blockNumber+1n{r.onReplaced?.({reason:o,replacedTransaction:u,transaction:s,transactionReceipt:d}),r.resolve(d)}))}catch(e){c((()=>r.reject(e)))}}else c((()=>r.reject(n)))}finally{h++}}}})}))}))}(e,t),watchBlocks:t=>function(e,{blockTag:t="latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:i,includeTransactions:a,poll:o,pollingInterval:c=e.pollingInterval}){const l=void 0!==o?o:"webSocket"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type),u=a??!1;let d;return l?sB(m_(["watchBlocks",e.uid,t,n,r,u,c]),{onBlock:s,onError:i},(s=>aB((async()=>{try{const r=await LA(e,GS,"getBlock")({blockTag:t,includeTransactions:u});if(r.number&&d?.number){if(r.number===d.number)return;if(r.number-d.number>1&&n)for(let t=d?.number+1n;td.number)&&(s.onBlock(r,d),d=r)}catch(e){s.onError?.(e)}}),{emitOnBegin:r,interval:c}))):(()=>{let t=!0,n=()=>t=!1;return(async()=>{try{const r=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find((e=>"webSocket"===e.config.type));return t?t.value:e.transport}return e.transport})(),{unsubscribe:a}=await r.subscribe({params:["newHeads"],onData(n){if(!t)return;const r=(e.chain?.formatters?.block?.format||zS)(n.result);s(r,d),d=r},onError(e){i?.(e)}});n=a,t||n()}catch(e){i?.(e)}})(),()=>n()})()}(e,t),watchBlockNumber:t=>nO(e,t),watchContractEvent:t=>fB(e,t),watchEvent:t=>function(e,{address:t,args:n,batch:r=!0,event:s,events:i,fromBlock:a,onError:o,onLogs:c,poll:l,pollingInterval:u=e.pollingInterval,strict:d}){const h=void 0!==l?l:"bigint"==typeof a||"webSocket"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type),p=d??!1;return h?sB(m_(["watchEvent",t,n,r,e.uid,s,u,a]),{onLogs:c,onError:o},(o=>{let c,l;void 0!==a&&(c=a-1n);let d=!1;const h=aB((async()=>{if(d)try{let a;if(l)a=await LA(e,hB,"getFilterChanges")({filter:l});else{const r=await LA(e,dB,"getBlockNumber")({});a=c&&c!==r?await LA(e,_I,"getLogs")({address:t,args:n,event:s,events:i,fromBlock:c+1n,toBlock:r}):[],c=r}if(0===a.length)return;if(r)o.onLogs(a);else for(const e of a)o.onLogs([e])}catch(e){l&&e instanceof K_&&(d=!1),o.onError?.(e)}else{try{l=await LA(e,iT,"createEventFilter")({address:t,args:n,event:s,events:i,strict:p,fromBlock:a})}catch{}d=!0}}),{emitOnBegin:!0,interval:u});return async()=>{l&&await LA(e,pB,"uninstallFilter")({filter:l}),h()}})):(()=>{let r=!0,a=()=>r=!1;return(async()=>{try{const l=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find((e=>"webSocket"===e.config.type));return t?t.value:e.transport}return e.transport})(),u=i??(s?[s]:void 0);let h=[];if(u){const e=u.flatMap((e=>$P({abi:[e],eventName:e.name,args:n})));h=[e],s&&(h=h[0])}const{unsubscribe:f}=await l.subscribe({params:["logs",{address:t,topics:h}],onData(e){if(!r)return;const t=e.result;try{const{eventName:e,args:n}=EI({abi:u??[],data:t.data,topics:t.topics,strict:p}),r=PI(t,{args:n,eventName:e});c([r])}catch(e){let n,r;if(e instanceof aC||e instanceof oC){if(d)return;n=e.abiItem.name,r=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const s=PI(t,{args:r?[]:{},eventName:n});c([s])}},onError(e){o?.(e)}});a=f,r||a()}catch(e){o?.(e)}})(),()=>a()})()}(e,t),watchPendingTransactions:t=>function(e,{batch:t=!0,onError:n,onTransactions:r,poll:s,pollingInterval:i=e.pollingInterval}){return(void 0!==s?s:"webSocket"!==e.transport.type)?sB(m_(["watchPendingTransactions",e.uid,t,i]),{onTransactions:r,onError:n},(n=>{let r;const s=aB((async()=>{try{if(!r)try{return void(r=await LA(e,aT,"createPendingTransactionFilter")({}))}catch(e){throw s(),e}const i=await LA(e,hB,"getFilterChanges")({filter:r});if(0===i.length)return;if(t)n.onTransactions(i);else for(const e of i)n.onTransactions([e])}catch(e){n.onError?.(e)}}),{emitOnBegin:!0,interval:i});return async()=>{r&&await LA(e,pB,"uninstallFilter")({filter:r}),s()}})):(()=>{let t=!0,s=()=>t=!1;return(async()=>{try{const{unsubscribe:i}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!t)return;const n=e.result;r([n])},onError(e){n?.(e)}});s=i,t||s()}catch(e){n?.(e)}})(),()=>s()})()}(e,t)}}async function oO(e,t){const{account:n=e.account,domain:r,message:s,primaryType:i}=t;if(!n)throw new mB({docsPath:"/docs/actions/wallet/signTypedData"});const a=QP(n),o={EIP712Domain:PT({domain:r}),...t.types};if(CT({domain:r,message:s,primaryType:i,types:o}),"local"===a.type)return a.signTypedData({domain:r,message:s,primaryType:i,types:o});const c=function(e){const{domain:t,message:n,primaryType:r,types:s}=e,i=(e,t)=>{const n={...t};for(const t of e){const{name:e,type:r}=t;"address"===r&&(n[e]=n[e].toLowerCase())}return n},a=s.EIP712Domain&&t?i(s.EIP712Domain,t):{},o=(()=>{if("EIP712Domain"!==r)return i(s[r],n)})();return m_({domain:a,message:o,primaryType:r,types:s})}({domain:r,message:s,primaryType:i,types:o});return e.request({method:"eth_signTypedData_v4",params:[a.address,c]},{retryCount:0})}function cO(e){return{addChain:t=>async function(e,{chain:t}){const{id:n,name:r,nativeCurrency:s,rpcUrls:i,blockExplorers:a}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:IC(n),chainName:r,nativeCurrency:s,rpcUrls:i.default.http,blockExplorerUrls:a?Object.values(a).map((({url:e})=>e)):void 0}]},{dedupe:!0,retryCount:0})}(e,t),deployContract:t=>function(e,t){const{abi:n,args:r,bytecode:s,...i}=t;return yB(e,{...i,data:ZI({abi:n,args:r,bytecode:s})})}(e,t),getAddresses:()=>async function(e){return"local"===e.account?.type?[e.account.address]:(await e.request({method:"eth_accounts"},{dedupe:!0})).map((e=>AP(e)))}(e),getChainId:()=>gI(e),getPermissions:()=>async function(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}(e),prepareTransactionRequest:t=>vI(e,t),requestAddresses:()=>async function(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map((e=>CP(e)))}(e),requestPermissions:t=>async function(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}(e,t),sendRawTransaction:t=>gB(e,t),sendTransaction:t=>yB(e,t),signMessage:t=>async function(e,{account:t=e.account,message:n}){if(!t)throw new mB({docsPath:"/docs/actions/wallet/signMessage"});const r=QP(t);if("local"===r.type)return r.signMessage({message:n});const s="string"==typeof n?TC(n):n.raw instanceof Uint8Array?PC(n.raw):n.raw;return e.request({method:"personal_sign",params:[s,r.address]},{retryCount:0})}(e,t),signTransaction:t=>async function(e,t){const{account:n=e.account,chain:r=e.chain,...s}=t;if(!n)throw new mB({docsPath:"/docs/actions/wallet/signTransaction"});const i=QP(n);OS({account:i,...t});const a=await LA(e,gI,"getChainId")({});null!==r&&bB({currentChainId:a,chain:r});const o=r?.formatters||e.chain?.formatters,c=o?.transactionRequest?.format||IS;return"local"===i.type?i.signTransaction({...s,chainId:a},{serializer:e.chain?.serializers?.transaction}):await e.request({method:"eth_signTransaction",params:[{...c(s),chainId:IC(a),from:i.address}]},{retryCount:0})}(e,t),signTypedData:t=>oO(e,t),switchChain:t=>async function(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:IC(t)}]},{retryCount:0})}(e,t),watchAsset:t=>async function(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}(e,t),writeContract:t=>vB(e,t)}}const lO=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"kernel",type:"address"},{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnerChanged",type:"event"},{inputs:[{internalType:"bytes",name:"",type:"bytes"}],name:"disable",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"ecdsaValidatorStorage",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"enable",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_caller",type:"address"},{internalType:"bytes",name:"",type:"bytes"}],name:"validCaller",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"validateSignature",outputs:[{internalType:"ValidationData",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"_userOp",type:"tuple"},{internalType:"bytes32",name:"_userOpHash",type:"bytes32"},{internalType:"uint256",name:"",type:"uint256"}],name:"validateUserOp",outputs:[{internalType:"ValidationData",name:"validationData",type:"uint256"}],stateMutability:"payable",type:"function"}],uO=[{inputs:[{internalType:"contract IEntryPoint",name:"_entryPoint",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AlreadyInitialized",type:"error"},{inputs:[],name:"DisabledMode",type:"error"},{inputs:[],name:"NotAuthorizedCaller",type:"error"},{inputs:[],name:"NotEntryPoint",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldValidator",type:"address"},{indexed:!0,internalType:"address",name:"newValidator",type:"address"}],name:"DefaultValidatorChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes4",name:"selector",type:"bytes4"},{indexed:!0,internalType:"address",name:"executor",type:"address"},{indexed:!0,internalType:"address",name:"validator",type:"address"}],name:"ExecutionChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Received",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newImplementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[{internalType:"bytes4",name:"_disableFlag",type:"bytes4"}],name:"disableMode",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"entryPoint",outputs:[{internalType:"contract IEntryPoint",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"enum Operation",name:"",type:"uint8"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct Call[]",name:"calls",type:"tuple[]"}],name:"executeBatch",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"getDefaultValidator",outputs:[{internalType:"contract IKernelValidator",name:"validator",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getDisabledMode",outputs:[{internalType:"bytes4",name:"disabled",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"_selector",type:"bytes4"}],name:"getExecution",outputs:[{components:[{internalType:"ValidAfter",name:"validAfter",type:"uint48"},{internalType:"ValidUntil",name:"validUntil",type:"uint48"},{internalType:"address",name:"executor",type:"address"},{internalType:"contract IKernelValidator",name:"validator",type:"address"}],internalType:"struct ExecutionDetail",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastDisabledTime",outputs:[{internalType:"uint48",name:"",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint192",name:"key",type:"uint192"}],name:"getNonce",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getNonce",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IKernelValidator",name:"_defaultValidator",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"initialize",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155BatchReceived",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"contract IKernelValidator",name:"_defaultValidator",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"setDefaultValidator",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes4",name:"_selector",type:"bytes4"},{internalType:"address",name:"_executor",type:"address"},{internalType:"contract IKernelValidator",name:"_validator",type:"address"},{internalType:"ValidUntil",name:"_validUntil",type:"uint48"},{internalType:"ValidAfter",name:"_validAfter",type:"uint48"},{internalType:"bytes",name:"_enableData",type:"bytes"}],name:"setExecution",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_newImplementation",type:"address"}],name:"upgradeTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"_userOp",type:"tuple"},{internalType:"bytes32",name:"userOpHash",type:"bytes32"},{internalType:"uint256",name:"missingAccountFunds",type:"uint256"}],name:"validateUserOp",outputs:[{internalType:"ValidationData",name:"validationData",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"}],dO=[{inputs:[{internalType:"address",name:"_owner",type:"address"},{internalType:"contract IEntryPoint",name:"_entryPoint",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"DeploymentFailed",type:"error"},{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"SaltDoesNotStartWithCaller",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"proxy",type:"address"},{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Deployed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"}],name:"addStake",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"cancelOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"pendingOwner",type:"address"}],name:"completeOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_implementation",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"uint256",name:"_index",type:"uint256"}],name:"createAccount",outputs:[{internalType:"address",name:"proxy",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[],name:"entryPoint",outputs:[{internalType:"contract IEntryPoint",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"uint256",name:"_index",type:"uint256"}],name:"getAccountAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"initCodeHash",outputs:[{internalType:"bytes32",name:"result",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"isAllowedImplementation",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"result",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pendingOwner",type:"address"}],name:"ownershipHandoverExpiresAt",outputs:[{internalType:"uint256",name:"result",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ownershipHandoverValidFor",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"predictDeterministicAddress",outputs:[{internalType:"address",name:"predicted",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"requestOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"contract IEntryPoint",name:"_entryPoint",type:"address"}],name:"setEntryPoint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_implementation",type:"address"},{internalType:"bool",name:"_allow",type:"bool"}],name:"setImplementation",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"unlockStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"withdrawAddress",type:"address"}],name:"withdrawStake",outputs:[],stateMutability:"nonpayable",type:"function"}],hO=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"bytes",name:"transactions",type:"bytes"}],name:"multiSend",outputs:[],stateMutability:"payable",type:"function"}],pO=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint8",name:"decimals_",type:"uint8"},{internalType:"uint256",name:"initialBalance_",type:"uint256"},{internalType:"address payable",name:"feeReceiver_",type:"address"}],stateMutability:"payable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];function fO(e,t={}){const{fees:n=e.fees,formatters:r=e.formatters,serializers:s=e.serializers}=t;return{...e,fees:n,formatters:r,serializers:s}}const mO=fO({id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),bO=fO({id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:88114}},testnet:!0});let gO=class e extends Error{constructor(t,n={}){super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"viem@1.21.3"});const r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof e&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://viem.sh${s}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join("\n"),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(e){return yO(this,e)}};function yO(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?yO(e.cause,t):t?null:e}let vO=class extends gO{constructor({max:e,min:t,signed:n,size:r,value:s}){super(`Number "${s}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}},wO=class extends gO{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexBooleanError"})}},xO=class extends gO{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}};function kO(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function EO(e){return kO(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function AO(e,{dir:t="left"}={}){let n="string"==typeof e?e.replace("0x",""):e,r=0;for(let e=0;en)throw new PO({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s2*n)throw new PO({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}const IO=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function BO(e,t={}){return"number"==typeof e||"bigint"==typeof e?OO(e,t):"string"==typeof e?RO(e,t):"boolean"==typeof e?TO(e,t):MO(e,t)}function TO(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(HO(n,{size:t.size}),_O(n,{size:t.size})):n}function MO(e,t={}){let n="";for(let t=0;ti||s=LO.zero&&e<=LO.nine?e-LO.zero:e>=LO.A&&e<=LO.F?e-(LO.A-10):e>=LO.a&&e<=LO.f?e-(LO.a-10):void 0}function DO(e,t={}){let n=e;t.size&&(HO(n,{size:t.size}),n=_O(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,i=new Uint8Array(s);for(let e=0,t=0;et)throw new xO({givenSize:EO(e),maxSize:t})}function GO(e,t){const n={to:t},r=n.to;return"number"===r?VO(e,n):"bigint"===r?qO(e,n):"string"===r?WO(e,n):"boolean"===r?$O(e,n):DO(e,n)}function qO(e,t={}){const{signed:n}=t;t.size&&HO(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2;return r<=(1n<<8n*BigInt(s)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*s,"f")}`)-1n}function $O(e,t={}){let n=e;if(t.size&&(HO(n,{size:t.size}),n=AO(n)),"0x00"===AO(n))return!1;if("0x01"===AO(n))return!0;throw new wO(n)}function VO(e,t={}){return Number(qO(e,t))}function WO(e,t={}){let n=DO(e);return t.size&&(HO(n,{size:t.size}),n=AO(n,{dir:"right"})),(new TextDecoder).decode(n)}const ZO={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559"};function QO(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?VO(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?VO(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?ZO[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof t.v){if(0n===t.v||27n===t.v)return 0;if(1n===t.v||28n===t.v)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),"eip2930"===t.type&&(delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t}function KO(e){const t=e.transactions?.map((e=>"string"==typeof e?e:QO(e)));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,difficulty:e.difficulty?BigInt(e.difficulty):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}function YO(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const JO={"0x0":"reverted","0x1":"success"};function XO(e){return{...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map((e=>YO(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?VO(e.transactionIndex):null,status:e.status?JO[e.status]:null,type:e.type?ZO[e.type]||e.type:null}}const eN={legacy:"0x0",eip2930:"0x1",eip1559:"0x2"};function tN(e){return{...e,gas:void 0!==e.gas?OO(e.gas):void 0,gasPrice:void 0!==e.gasPrice?OO(e.gasPrice):void 0,maxFeePerGas:void 0!==e.maxFeePerGas?OO(e.maxFeePerGas):void 0,maxPriorityFeePerGas:void 0!==e.maxPriorityFeePerGas?OO(e.maxPriorityFeePerGas):void 0,nonce:void 0!==e.nonce?OO(e.nonce):void 0,type:void 0!==e.type?eN[e.type]:void 0,value:void 0!==e.value?OO(e.value):void 0}}let nN=class extends gO{constructor({address:e}){super(`Address "${e}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}},rN=class extends gO{constructor({blockNumber:e,chain:t,contract:n}){super(`Chain "${t.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}};class sN extends gO{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class iN extends gO{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}let aN=class extends gO{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}};const oN={gwei:9,wei:18},cN={ether:-9,wei:9};function lN(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${i?`.${i}`:""}`}function uN(e,t="wei"){return lN(e,cN[t])}let dN=class extends gO{constructor({cause:e,message:t}={}){const n=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}};Object.defineProperty(dN,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(dN,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});let hN=class extends gO{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${uN(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}};Object.defineProperty(hN,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});let pN=class extends gO{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${uN(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}};Object.defineProperty(pN,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});let fN=class extends gO{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}};Object.defineProperty(fN,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});let mN=class extends gO{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}};Object.defineProperty(mN,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});let bN=class extends gO{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}};Object.defineProperty(bN,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});let gN=class extends gO{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}};Object.defineProperty(gN,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});let yN=class extends gO{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}};Object.defineProperty(yN,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});let vN=class extends gO{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}};Object.defineProperty(vN,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});let wN=class extends gO{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}};Object.defineProperty(wN,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});let xN=class extends gO{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${uN(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${uN(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}};Object.defineProperty(xN,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});let kN=class extends gO{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}};const EN=/^0x[a-fA-F0-9]{40}$/;function AN(e){return EN.test(e)}function CN(e){return"string"==typeof e[0]?PN(e):function(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(e)}function PN(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}let _N=class e extends Error{constructor(t,n={}){const r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof e&&n.cause.docsPath||n.docsPath;super([t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...r?[`Details: ${r}`]:[],"Version: abitype@0.9.8"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}};function SN(e,t){const n=e.exec(t);return n?.groups}const IN=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,BN=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,TN=/^\(.+?\).*?$/,MN=/^tuple(?(\[(\d*)\])*)$/;function ON(e){let t=e.type;if(MN.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}};const qN=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),$N=/^(?[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,VN=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,WN=/^u?int$/;function ZN(e,t){const n=function(e,t){return t?`${t}:${e}`:e}(e,t?.type);if(qN.has(n))return qN.get(n);const r=TN.test(e),s=SN(r?VN:$N,e);if(!s)throw new UN({param:e});if(s.name&&function(e){return"address"===e||"bool"===e||"function"===e||"string"===e||"tuple"===e||IN.test(e)||BN.test(e)||KN.test(e)}(s.name))throw new DN({param:e,name:s.name});const i=s.name?{name:s.name}:{},a="indexed"===s.modifier?{indexed:!0}:{},o=t?.structs??{};let c,l={};if(r){c="tuple";const e=QN(s.type),t=[],n=e.length;for(let r=0;re[t.name||n]?.(r)??t(e,r)}function XN(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new xR(e.type);return`${e.name}(${eR(e.inputs,{includeName:t})})`}function eR(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${eR(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}let tR=class extends gO{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}},nR=class extends gO{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}},rR=class extends gO{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${eR(t,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=n}},sR=class extends gO{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}},iR=class extends gO{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}},aR=class extends gO{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${EO(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}},oR=class extends gO{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}},cR=class extends gO{constructor(e,{docsPath:t}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}},lR=class extends gO{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}},uR=class extends gO{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}},dR=class extends gO{constructor(e,{docsPath:t}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}},hR=class extends gO{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}},pR=class extends gO{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}},fR=class extends gO{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${XN(e.abiItem)}\`, and`,`\`${t.type}\` in \`${XN(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}},mR=class extends gO{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}},bR=class extends gO{constructor({abiItem:e,data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for non-indexed event parameters.`].join("\n"),{metaMessages:[`Params: (${eR(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=n,this.size=r}},gR=class extends gO{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${XN(e,{includeName:!0})}".`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}},yR=class extends gO{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}},vR=class extends gO{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}},wR=class extends gO{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}},xR=class extends gO{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}},kR=class extends gO{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}};const ER=e=>{var t;return function(e){let t=!0,n="",r=0,s="",i=!1;for(let a=0;a0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function PR(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const _R=BigInt(2**32-1),SR=BigInt(32);function IR(e,t=!1){return t?{h:Number(e&_R),l:Number(e>>SR&_R)}:{h:0|Number(e>>SR&_R),l:0|Number(e&_R)}}function BR(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;se instanceof Uint8Array;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function MR(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!TR(e))throw new Error("expected Uint8Array, got "+typeof e);return e}let OR=class{clone(){return this._cloneInto()}};const[NR,RR,FR]=[[],[],[]],jR=BigInt(0),LR=BigInt(1),UR=BigInt(2),DR=BigInt(7),zR=BigInt(256),HR=BigInt(113);for(let e=0,t=LR,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],NR.push(2*(5*r+n)),RR.push((e+1)*(e+2)/2%64);let s=jR;for(let e=0;e<7;e++)t=(t<>DR)*HR)%zR,t&UR&&(s^=LR<<(LR<n>32?((e,t,n)=>t<>>64-n)(e,t,n):((e,t,n)=>e<>>32-n)(e,t,n),VR=(e,t,n)=>n>32?((e,t,n)=>e<>>64-n) /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */(e,t,n):((e,t,n)=>t<>>32-n)(e,t,n);let WR=class e extends OR{constructor(e,t,n,r=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,AR(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}keccak(){!function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,s=(t+2)%10,i=n[s],a=n[s+1],o=$R(i,a,1)^n[r],c=VR(i,a,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=c}let t=e[2],s=e[3];for(let n=0;n<24;n++){const r=RR[n],i=$R(t,s,r),a=VR(t,s,r),o=NR[n];t=e[o],s=e[o+1],e[o]=i,e[o+1]=a}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=GR[r],e[1]^=qR[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){PR(this);const{blockLen:t,state:n}=this,r=(e=MR(e)).length;for(let s=0;s=n&&this.keccak();const i=Math.min(n-this.posOut,s-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return AR(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(function(e,t){CR(e);const n=t.outputLen;if(e.lengthfunction(e){const t=t=>e().update(MR(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}((()=>new WR(t,e,n))))(1,136,32);function QR(e,t){const n=t||"hex",r=ZR(kO(e,{strict:!1})?jO(e):e);return"bytes"===n?r:BO(r)}const KR=e=>{return t=(e=>ER(e))(e),QR(jO(t));var t};function YR(e,t,n,{strict:r}={}){return kO(e,{strict:!1})?function(e,t,n,{strict:r}={}){JR(e,t);const s=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;r&&XR(s,t,n);return s}(e,t,n,{strict:r}):function(e,t,n,{strict:r}={}){JR(e,t);const s=e.slice(t,n);r&&XR(s,t,n);return s}(e,t,n,{strict:r})}function JR(e,t){if("number"==typeof t&&t>0&&t>EO(e)-1)throw new CO({offset:t,position:"start",size:EO(e)})}function XR(e,t,n){if("number"==typeof t&&"number"==typeof n&&EO(e)!==n-t)throw new CO({offset:n,position:"end",size:EO(e)})}function eF(e,t){if(e.length!==t.length)throw new oR({expectedLength:e.length,givenLength:t.length});const n=function({params:e,values:t}){const n=[];for(let r=0;r0?CN([t,e]):t}}if(s)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:CN(i.map((({encoded:e})=>e)))}}(t,{length:r,param:{...e,type:s}})}if("tuple"===e.type)return function(e,{param:t}){let n=!1;const r=[];for(let s=0;se)))}}(t,{param:e});if("address"===e.type)return function(e){if(!AN(e))throw new nN({address:e});return{dynamic:!1,encoded:SO(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){return{dynamic:!1,encoded:SO(TO(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){return function(e,{signed:t}){return{dynamic:!1,encoded:OO(e,{size:32,signed:t})}}(t,{signed:e.type.startsWith("int")})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),r=EO(e);if(!n){let t=e;return r%32!=0&&(t=SO(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:CN([SO(OO(r,{size:32})),t])}}if(r!==parseInt(n))throw new aR({expectedSize:parseInt(n),value:e});return{dynamic:!1,encoded:SO(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=RO(e),n=Math.ceil(EO(t)/32),r=[];for(let e=0;eYR(QR(jO(ER(e))),0,4);function iF({abi:e,args:t=[],name:n}){const r=kO(n,{strict:!1}),s=e.filter((e=>r?"function"===e.type?sF(e)===n:"event"===e.type&&KR(e)===n:"name"in e&&e.name===n));if(0===s.length)return;if(1===s.length)return s[0];let i;for(const e of s){if(!("inputs"in e))continue;if(!t||0===t.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==t.length)continue;const n=t.every(((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&aF(t,r)}));if(n){if(i&&"inputs"in i&&i.inputs){const n=oF(e.inputs,i.inputs,t);if(n)throw new fR({abiItem:e,type:n[0]},{abiItem:i,type:n[1]})}i=e}}return i||s[0]}function aF(e,t){const n=typeof e,r=t.type;switch(r){case"address":return AN(e);case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every(((t,n)=>aF(Object.values(e)[n],t))):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every((e=>aF(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function oF(e,t,n){for(const r in e){const s=e[r],i=t[r];if("tuple"===s.type&&"tuple"===i.type&&"components"in s&&"components"in i)return oF(s.components,i.components,n[r]);const a=[s.type,i.type];if(!(!a.includes("address")||!a.includes("bytes20"))||(a.includes("address")&&a.includes("string")||!(!a.includes("address")||!a.includes("bytes")))&&AN(n[r]))return a}}function cF({abi:e,eventName:t,args:n}){let r=e[0];if(t&&(r=iF({abi:e,args:n,name:t}),!r))throw new dR(t,{docsPath:"/docs/contract/encodeEventTopics"});if("event"!==r.type)throw new dR(void 0,{docsPath:"/docs/contract/encodeEventTopics"});const s=XN(r),i=KR(s);let a=[];if(n&&"inputs"in r){const e=r.inputs?.filter((e=>"indexed"in e&&e.indexed)),t=Array.isArray(n)?n:Object.values(n).length>0?e?.map((e=>n[e.name]))??[]:[];t.length>0&&(a=e?.map(((e,n)=>Array.isArray(t[n])?t[n].map(((r,s)=>lF({param:e,value:t[n][s]}))):t[n]?lF({param:e,value:t[n]}):null))??[])}return[i,...a]}function lF({param:e,value:t}){if("string"===e.type||"bytes"===e.type)return QR(jO(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new kR(e.type);return eF([e],[t])}function uF(e,{method:t}){const n={};return"fallback"===e.transport.type&&e.transport.onResponse?.((({method:e,response:r,status:s,transport:i})=>{"success"===s&&t===e&&(n[r]=i.request)})),t=>n[t]||e.request}async function dF(e,{address:t,abi:n,args:r,eventName:s,fromBlock:i,strict:a,toBlock:o}){const c=uF(e,{method:"eth_newFilter"}),l=s?cF({abi:n,args:r,eventName:s}):void 0,u=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof i?OO(i):i,toBlock:"bigint"==typeof o?OO(o):o,topics:l}]});return{abi:n,args:r,eventName:s,id:u,request:c(u),strict:a,type:"event"}}function hF(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}function pF({abi:e,args:t,functionName:n}){let r=e[0];if(n&&(r=iF({abi:e,args:t,name:n}),!r))throw new hR(n,{docsPath:"/docs/contract/encodeFunctionData"});if("function"!==r.type)throw new hR(void 0,{docsPath:"/docs/contract/encodeFunctionData"});const s=XN(r);return PN([sF(s),("inputs"in r&&r.inputs?eF(r.inputs,t??[]):void 0)??"0x"])}const fF={1:"An `assert` condition failed.",17:"Arithmic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},mF={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},bF={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function gF(e,t){const n=e.substring(2).toLowerCase(),r=QR(zO(n),"bytes"),s=n.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&s[e]&&(s[e]=s[e].toUpperCase()),(15&r[e>>1])>=8&&s[e+1]&&(s[e+1]=s[e+1].toUpperCase());return`0x${s.join("")}`}function yF(e,t){if("0x"===t&&e.length>0)throw new sR;if(EO(t)&&EO(t)<32)throw new rR({data:t,params:e,size:EO(t)});return function({data:e,params:t}){const n=[];let r=0;for(let s=0;s=EO(e))throw new rR({data:e,params:t,size:EO(e)});const i=t[s],{consumed:a,value:o}=vF({data:e,param:i,position:r});n.push(o),r+=a}return n}({data:t,params:e})}function vF({data:e,param:t,position:n}){const r=rF(t.type);if(r){const[s,i]=r;return function(e,{param:t,length:n,position:r}){if(!n){const n=VO(YR(e,r,r+32,{strict:!0})),s=VO(YR(e,n,n+32,{strict:!0}));let i=0;const a=[];for(let r=0;r!e)),s=r?[]:{};let i=0;if(wF(t)){const a=VO(YR(e,n,n+32,{strict:!0}));for(let n=0;n48?qO(e,{signed:n}):VO(e,{signed:n})}}(s,{param:t});if("address"===t.type)return function(e){return{consumed:32,value:gF(YR(e,-20))}}(s);if("bool"===t.type)return function(e){return{consumed:32,value:$O(e)}}(s);throw new vR(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function wF(e){const{type:t}=e;if("string"===t)return!0;if("bytes"===t)return!0;if(t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(wF);const n=rF(e.type);return!(!n||!wF({...e,type:n[1]}))}function xF({abi:e,data:t}){const n=YR(t,0,4);if("0x"===n)throw new sR;const r=[...e||[],mF,bF].find((e=>"error"===e.type&&n===sF(XN(e))));if(!r)throw new cR(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:r,args:"inputs"in r&&r.inputs&&r.inputs.length>0?yF(r.inputs,YR(t,4)):void 0,errorName:r.name}}const kF=(e,t,n)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),n);function EF({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map(((e,n)=>`${r&&e.name?`${e.name}: `:""}${"object"==typeof t[n]?kF(t[n]):t[n]}`)).join(", ")})`}function AF(e,t="wei"){return lN(e,oN[t])}function CF(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),n=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`)).join("\n")}let PF=class extends gO{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}},_F=class extends gO{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",CF(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}};class SF extends gO{constructor(e,{account:t,docsPath:n,chain:r,data:s,gas:i,gasPrice:a,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const h=CF({chain:r&&`${r?.name} (id: ${r?.id})`,from:t?.address,to:u,value:void 0!==d&&`${AF(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:void 0!==a&&`${uN(a)} gwei`,maxFeePerGas:void 0!==o&&`${uN(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${uN(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}}let IF=class extends gO{constructor({blockHash:e,blockNumber:t,blockTag:n,hash:r,index:s}){let i="Transaction";n&&void 0!==s&&(i=`Transaction at block time "${n}" at index "${s}"`),e&&void 0!==s&&(i=`Transaction at block hash "${e}" at index "${s}"`),t&&void 0!==s&&(i=`Transaction at block number "${t}" at index "${s}"`),r&&(i=`Transaction with hash "${r}"`),super(`${i} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}},BF=class extends gO{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}},TF=class extends gO{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}},MF=class extends gO{constructor(e,{account:t,docsPath:n,chain:r,data:s,gas:i,gasPrice:a,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const h=t?hF(t):void 0,p=CF({from:h?.address,to:u,value:void 0!==d&&`${AF(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:void 0!==a&&`${uN(a)} gwei`,maxFeePerGas:void 0!==o&&`${uN(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${uN(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}},OF=class extends gO{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:s,functionName:i,sender:a}){const o=iF({abi:t,args:n,name:i}),c=o?EF({abiItem:o,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=CF({address:r&&r,function:o?XN(o,{includeName:!0}):void 0,args:c&&"()"!==c&&`${[...Array(i?.length??0).keys()].map((()=>" ")).join("")}${c}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",l].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=t,this.args=n,this.cause=e,this.contractAddress=r,this.functionName=i,this.sender=a}},NF=class extends gO{constructor({abi:e,data:t,functionName:n,message:r}){let s,i,a,o,c;if(t&&"0x"!==t)try{i=xF({abi:e,data:t});const{abiItem:n,errorName:r,args:s}=i;if("Error"===r)o=s[0];else if("Panic"===r){const[e]=s;o=fF[e]}else{const e=n?XN(n,{includeName:!0}):void 0,t=n&&s?EF({abiItem:n,args:s,includeFunctionName:!1,includeName:!1}):void 0;a=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(r?.length??0).keys()].map((()=>" ")).join("")}${t}`:""]}}catch(e){s=e}else r&&(o=r);s instanceof cR&&(c=s.signature,a=[`Unable to decode signature "${c}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${c}.`]),super(o&&"execution reverted"!==o||c?[`The contract function "${n}" reverted with the following ${c?"signature":"reason"}:`,o||c].join("\n"):`The contract function "${n}" reverted.`,{cause:s,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.reason=o,this.signature=c}},RF=class extends gO{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}},FF=class extends gO{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}},jF=class extends gO{constructor({body:e,details:t,headers:n,status:r,url:s}){super("HTTP request failed.",{details:t,metaMessages:[r&&`Status: ${r}`,`URL: ${s}`,e&&`Request body: ${kF(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=r,this.url=s}},LF=class extends gO{constructor({body:e,details:t,url:n}){super("WebSocket request failed.",{details:t,metaMessages:[`URL: ${n}`,`Request body: ${kF(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WebSocketRequestError"})}},UF=class extends gO{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${kF(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}},DF=class extends gO{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${t}`,`Request body: ${kF(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}};let zF=class extends gO{constructor(e,{code:t,docsPath:n,metaMessages:r,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:r||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof UF?e.code:t??-1}},HF=class extends zF{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}},GF=class e extends zF{constructor(t){super(t,{code:e.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}};Object.defineProperty(GF,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});let qF=class e extends zF{constructor(t){super(t,{code:e.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}};Object.defineProperty(qF,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});let $F=class e extends zF{constructor(t){super(t,{code:e.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}};Object.defineProperty($F,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});let VF=class e extends zF{constructor(t){super(t,{code:e.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}};Object.defineProperty(VF,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});let WF=class e extends zF{constructor(t){super(t,{code:e.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}};Object.defineProperty(WF,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});let ZF=class e extends zF{constructor(t){super(t,{code:e.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}};Object.defineProperty(ZF,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});let QF=class e extends zF{constructor(t){super(t,{code:e.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};Object.defineProperty(QF,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});let KF=class e extends zF{constructor(t){super(t,{code:e.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}};Object.defineProperty(KF,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});let YF=class e extends zF{constructor(t){super(t,{code:e.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}};Object.defineProperty(YF,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});let JF=class e extends zF{constructor(t){super(t,{code:e.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}};Object.defineProperty(JF,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});let XF=class e extends zF{constructor(t){super(t,{code:e.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}};Object.defineProperty(XF,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});let ej=class e extends zF{constructor(t){super(t,{code:e.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}};Object.defineProperty(ej,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});let tj=class e extends HF{constructor(t){super(t,{code:e.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}};Object.defineProperty(tj,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});let nj=class e extends HF{constructor(t){super(t,{code:e.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}};Object.defineProperty(nj,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});let rj=class e extends HF{constructor(t){super(t,{code:e.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}};Object.defineProperty(rj,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});let sj=class e extends HF{constructor(t){super(t,{code:e.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}};Object.defineProperty(sj,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});let ij=class e extends HF{constructor(t){super(t,{code:e.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}};Object.defineProperty(ij,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});let aj=class e extends HF{constructor(t){super(t,{code:e.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}};Object.defineProperty(aj,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});let oj=class extends zF{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}};const cj=3;function lj(e,{abi:t,address:n,args:r,docsPath:s,functionName:i,sender:a}){const{code:o,data:c,message:l,shortMessage:u}=e instanceof FF?e:e instanceof gO?e.walk((e=>"data"in e))||e.walk():{},d=e instanceof sR?new RF({functionName:i}):[cj,WF.code].includes(o)&&(c||l||u)?new NF({abi:t,data:"object"==typeof c?c.data:c,functionName:i,message:u??l}):e;return new OF(d,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:i,sender:a})}let uj=class extends gO{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join("\n"),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}},dj=class extends gO{constructor(e,{account:t,docsPath:n,chain:r,data:s,gas:i,gasPrice:a,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const h=CF({from:t?.address,to:u,value:void 0!==d&&`${AF(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:void 0!==a&&`${uN(a)} gwei`,maxFeePerGas:void 0!==o&&`${uN(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${uN(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}};function hj(e,t){const n=(e.details||"").toLowerCase(),r=e.walk((e=>e.code===dN.code));return r instanceof gO?new dN({cause:e,message:r.details}):dN.nodeMessage.test(n)?new dN({cause:e,message:e.details}):hN.nodeMessage.test(n)?new hN({cause:e,maxFeePerGas:t?.maxFeePerGas}):pN.nodeMessage.test(n)?new pN({cause:e,maxFeePerGas:t?.maxFeePerGas}):fN.nodeMessage.test(n)?new fN({cause:e,nonce:t?.nonce}):mN.nodeMessage.test(n)?new mN({cause:e,nonce:t?.nonce}):bN.nodeMessage.test(n)?new bN({cause:e,nonce:t?.nonce}):gN.nodeMessage.test(n)?new gN({cause:e}):yN.nodeMessage.test(n)?new yN({cause:e,gas:t?.gas}):vN.nodeMessage.test(n)?new vN({cause:e,gas:t?.gas}):wN.nodeMessage.test(n)?new wN({cause:e}):xN.nodeMessage.test(n)?new xN({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new kN({cause:e})}function pj(e,{format:t}){if(!t)return{};const n={};return function t(r){const s=Object.keys(r);for(const i of s)i in e&&(n[i]=e[i]),r[i]&&"object"==typeof r[i]&&!Array.isArray(r[i])&&t(r[i])}(t(e||{})),n}function fj(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:i}=e,a=t?hF(t):void 0;if(a&&!AN(a.address))throw new nN({address:a.address});if(i&&!AN(i))throw new nN({address:i});if(void 0!==n&&(void 0!==r||void 0!==s))throw new PF;if(r&&r>2n**256n-1n)throw new hN({maxFeePerGas:r});if(s&&r&&s>r)throw new xN({maxFeePerGas:r,maxPriorityFeePerGas:s})}let mj=class extends gO{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}},bj=class extends gO{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}},gj=class extends gO{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${uN(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}},yj=class extends gO{constructor({blockHash:e,blockNumber:t}){let n="Block";e&&(n=`Block at hash "${e}"`),t&&(n=`Block at number "${t}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}};async function vj(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:s}={}){const i=r??"latest",a=s??!1,o=void 0!==n?OO(n):void 0;let c=null;if(c=t?await e.request({method:"eth_getBlockByHash",params:[t,a]}):await e.request({method:"eth_getBlockByNumber",params:[o||i,a]}),!c)throw new yj({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||KO)(c)}async function wj(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function xj(e,t){const{block:n,chain:r=e.chain,request:s}=t||{};if("function"==typeof r?.fees?.defaultPriorityFee){const t=n||await JN(e,vj,"getBlock")({});return r.fees.defaultPriorityFee({block:t,client:e,request:s})}if(void 0!==r?.fees?.defaultPriorityFee)return r?.fees?.defaultPriorityFee;try{return qO(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,r]=await Promise.all([n?Promise.resolve(n):JN(e,vj,"getBlock")({}),JN(e,wj,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new bj;const s=r-t.baseFeePerGas;return s<0n?0n:s}}async function kj(e,t){const{block:n,chain:r=e.chain,request:s,type:i="eip1559"}=t||{},a=await(async()=>"function"==typeof r?.fees?.baseFeeMultiplier?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):r?.fees?.baseFeeMultiplier??1.2)();if(a<1)throw new mj;const o=10**(a.toString().split(".")[1]?.length??0),c=e=>e*BigInt(Math.ceil(a*o))/BigInt(o),l=n||await JN(e,vj,"getBlock")({});if("function"==typeof r?.fees?.estimateFeesPerGas)return r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:s,type:i});if("eip1559"===i){if("bigint"!=typeof l.baseFeePerGas)throw new bj;const t=s?.maxPriorityFeePerGas?s.maxPriorityFeePerGas:await xj(e,{block:l,chain:r,request:s}),n=c(l.baseFeePerGas);return{maxFeePerGas:s?.maxFeePerGas??n+t,maxPriorityFeePerGas:t}}return{gasPrice:s?.gasPrice??c(await JN(e,wj,"getGasPrice")({}))}}async function Ej(e,{address:t,blockTag:n="latest",blockNumber:r}){return VO(await e.request({method:"eth_getTransactionCount",params:[t,r?OO(r):n]}))}async function Aj(e,t){const{account:n=e.account,chain:r,gas:s,nonce:i,type:a}=t;if(!n)throw new uj;const o=hF(n),c=await JN(e,vj,"getBlock")({blockTag:"latest"}),l={...t,from:o.address};if(void 0===i&&(l.nonce=await JN(e,Ej,"getTransactionCount")({address:o.address,blockTag:"pending"})),void 0===a)try{l.type=function(e){if(e.type)return e.type;if(void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas)return"eip1559";if(void 0!==e.gasPrice)return void 0!==e.accessList?"eip2930":"legacy";throw new _F({transaction:e})}(l)}catch{l.type="bigint"==typeof c.baseFeePerGas?"eip1559":"legacy"}if("eip1559"===l.type){const{maxFeePerGas:n,maxPriorityFeePerGas:s}=await kj(e,{block:c,chain:r,request:l});if(void 0===t.maxPriorityFeePerGas&&t.maxFeePerGas&&t.maxFeePerGas{const t=hj(e,n);return t instanceof kN?e:t})();return new dj(r,{docsPath:t,...n})}(n,{...t,account:r,chain:e.chain})}}async function Pj(e,{abi:t,address:n,args:r,functionName:s,...i}){const a=pF({abi:t,args:r,functionName:s});try{return await JN(e,Cj,"estimateGas")({data:a,to:n,...i})}catch(e){const a=i.account?hF(i.account):void 0;throw lj(e,{abi:t,address:n,args:r,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:a?.address})}}const _j="/docs/contract/decodeEventLog";function Sj({abi:e,data:t,strict:n,topics:r}){const s=n??!0,[i,...a]=r;if(!i)throw new lR({docsPath:_j});const o=e.find((e=>"event"===e.type&&i===KR(XN(e))));if(!o||!("name"in o)||"event"!==o.type)throw new uR(i,{docsPath:_j});const{name:c,inputs:l}=o,u=l?.some((e=>!("name"in e&&e.name)));let d=u?[]:{};const h=l.filter((e=>"indexed"in e&&e.indexed));for(let e=0;e!("indexed"in e&&e.indexed)));if(p.length>0)if(t&&"0x"!==t)try{const e=yF(p,t);if(e)if(u)d=[...d,...e];else for(let t=0;t0?d:void 0}}function Ij({param:e,value:t}){if("string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))return t;return(yF([e],t)||[])[0]}async function Bj(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:i,events:a,args:o,strict:c}={}){const l=c??!1,u=a??(i?[i]:void 0);let d,h=[];return u&&(h=[u.flatMap((e=>cF({abi:[e],eventName:e.name,args:o})))],i&&(h=h[0])),d=n?await e.request({method:"eth_getLogs",params:[{address:t,topics:h,blockHash:n}]}):await e.request({method:"eth_getLogs",params:[{address:t,topics:h,fromBlock:"bigint"==typeof r?OO(r):r,toBlock:"bigint"==typeof s?OO(s):s}]}),d.map((e=>{try{const{eventName:t,args:n}=u?Sj({abi:u,data:e.data,topics:e.topics,strict:l}):{eventName:void 0,args:void 0};return YO(e,{args:n,eventName:t})}catch(t){let n,r;if(t instanceof bR||t instanceof gR){if(l)return;n=t.abiItem.name,r=t.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return YO(e,{args:r?[]:{},eventName:n})}})).filter(Boolean)}async function Tj(e,{abi:t,address:n,args:r,blockHash:s,eventName:i,fromBlock:a,toBlock:o,strict:c}){const l=i?iF({abi:t,name:i}):void 0,u=l?void 0:t.filter((e=>"event"===e.type));return JN(e,Bj,"getLogs")({address:n,args:r,blockHash:s,event:l,events:u,fromBlock:a,toBlock:o,strict:c})}const Mj="/docs/contract/decodeFunctionResult";function Oj({abi:e,args:t,functionName:n,data:r}){let s=e[0];if(n&&(s=iF({abi:e,args:t,name:n}),!s))throw new hR(n,{docsPath:Mj});if("function"!==s.type)throw new hR(void 0,{docsPath:Mj});if(!s.outputs)throw new pR(s.name,{docsPath:Mj});const i=yF(s.outputs,r);return i&&i.length>1?i:i&&1===i.length?i[0]:void 0}const Nj=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],Rj=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"}],Fj=[...Rj,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],jj=[...Rj,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],Lj=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Uj=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],Dj=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],zj="0x82ad56cb";function Hj({blockNumber:e,chain:t,contract:n}){const r=t?.contracts?.[n];if(!r)throw new rN({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new rN({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const Gj=new Map;function qj({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const i=async()=>{const t=o();a();const n=t.map((({args:e})=>e));0!==n.length&&e(n).then((e=>{s&&Array.isArray(e)&&e.sort(s);for(let n=0;n{for(let n=0;nGj.delete(t),o=()=>Gj.get(t)||[],c=e=>Gj.set(t,[...o(),e]);return{flush:a,async schedule(e){const t={},s=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),a=n?.([...o().map((({args:e})=>e)),e]);a&&i();return o().length>0?(c({args:e,pendingPromise:t}),s):(c({args:e,pendingPromise:t}),setTimeout(i,r),s)}}}async function $j(e,t){const{account:n=e.account,batch:r=Boolean(e.batch?.multicall),blockNumber:s,blockTag:i="latest",accessList:a,data:o,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:h,to:p,value:f,...m}=t,b=n?hF(n):void 0;try{fj(t);const n=(s?OO(s):void 0)||i,g=e.chain?.formatters?.transactionRequest?.format,y=(g||tN)({...pj(m,{format:g}),from:b?.address,accessList:a,data:o,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:h,to:p,value:f});if(r&&function({request:e}){const{data:t,to:n,...r}=e;return!!t&&(!t.startsWith(zj)&&(!!n&&!(Object.values(r).filter((e=>void 0!==e)).length>0)))}({request:y}))try{return await async function(e,t){const{batchSize:n=1024,wait:r=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockNumber:s,blockTag:i="latest",data:a,multicallAddress:o,to:c}=t;let l=o;if(!l){if(!e.chain)throw new aN;l=Hj({blockNumber:s,chain:e.chain,contract:"multicall3"})}const u=s?OO(s):void 0,d=u||i,{schedule:h}=qj({id:`${e.uid}.${d}`,wait:r,shouldSplitBatch(e){const t=e.reduce(((e,{data:t})=>e+(t.length-2)),0);return t>2*n},fn:async t=>{const n=t.map((e=>({allowFailure:!0,callData:e.data,target:e.to}))),r=pF({abi:Nj,args:[n],functionName:"aggregate3"}),s=await e.request({method:"eth_call",params:[{data:r,to:l},d]});return Oj({abi:Nj,args:[n],functionName:"aggregate3",data:s||"0x"})}}),[{returnData:p,success:f}]=await h({data:a,to:c});if(!f)throw new FF({data:p});return"0x"===p?{data:void 0}:{data:p}}(e,{...y,blockNumber:s,blockTag:i})}catch(e){if(!(e instanceof aN||e instanceof rN))throw e}const v=await e.request({method:"eth_call",params:n?[y,n]:[y]});return"0x"===v?{data:void 0}:{data:v}}catch(n){const r=function(e){if(!(e instanceof gO))return;const t=e.walk();return"object"==typeof t.data?t.data.data:t.data}(n),{offchainLookup:s,offchainLookupSignature:i}=await Promise.resolve().then((function(){return tU}));if(r?.slice(0,10)===i&&p)return{data:await s(e,{data:r,to:p})};throw function(e,{docsPath:t,...n}){const r=(()=>{const t=hj(e,n);return t instanceof kN?e:t})();return new MF(r,{docsPath:t,...n})}(n,{...t,account:b,chain:e.chain})}}async function Vj(e,{abi:t,address:n,args:r,functionName:s,...i}){const a=pF({abi:t,args:r,functionName:s});try{const{data:o}=await JN(e,$j,"call")({data:a,to:n,...i});return Oj({abi:t,args:r,functionName:s,data:o||"0x"})}catch(e){throw lj(e,{abi:t,address:n,args:r,docsPath:"/docs/contract/readContract",functionName:s})}}async function Wj(e,{abi:t,address:n,args:r,dataSuffix:s,functionName:i,...a}){const o=a.account?hF(a.account):void 0,c=pF({abi:t,args:r,functionName:i});try{const{data:o}=await JN(e,$j,"call")({batch:!1,data:`${c}${s?s.replace("0x",""):""}`,to:n,...a});return{result:Oj({abi:t,args:r,functionName:i,data:o||"0x"}),request:{abi:t,address:n,args:r,dataSuffix:s,functionName:i,...a}}}catch(e){throw lj(e,{abi:t,address:n,args:r,docsPath:"/docs/contract/simulateContract",functionName:i,sender:o?.address})}}const Zj=new Map,Qj=new Map;let Kj=0;function Yj(e,t,n){const r=++Kj,s=()=>Zj.get(e)||[],i=()=>{const t=Qj.get(e);1===s().length&&t&&t(),(()=>{const t=s();Zj.set(e,t.filter((e=>e.id!==r)))})()},a=s();if(Zj.set(e,[...a,{id:r,fns:t}]),a&&a.length>0)return i;const o={};for(const e in t)o[e]=(...t)=>{const n=s();if(0!==n.length)for(const r of n)r.fns[e]?.(...t)};const c=n(o);return"function"==typeof c&&Qj.set(e,c),i}async function Jj(e){return new Promise((t=>setTimeout(t,e)))}function Xj(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let s=!0;const i=()=>s=!1;return(async()=>{let a;t&&(a=await e({unpoll:i}));const o=await(n?.(a))??r;await Jj(o);const c=async()=>{s&&(await e({unpoll:i}),await Jj(r),c())};c()})(),i}const eL=new Map,tL=new Map;async function nL(e,{cacheKey:t,cacheTime:n=1/0}){const r=function(e){const t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:n=>t.set(e,n)}),n=t(e,eL),r=t(e,tL);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}(t),s=r.response.get();if(s&&n>0){if((new Date).getTime()-s.created.getTime()`blockNumber.${e}`;async function sL(e,{cacheTime:t=e.cacheTime,maxAge:n}={}){const r=await nL((()=>e.request({method:"eth_blockNumber"})),{cacheKey:rL(e.uid),cacheTime:n??t});return BigInt(r)}async function iL(e,{filter:t}){const n="strict"in t&&t.strict;return(await t.request({method:"eth_getFilterChanges",params:[t.id]})).map((e=>{if("string"==typeof e)return e;try{const{eventName:r,args:s}="abi"in t&&t.abi?Sj({abi:t.abi,data:e.data,topics:e.topics,strict:n}):{eventName:void 0,args:void 0};return YO(e,{args:s,eventName:r})}catch(n){let r,s;if(n instanceof bR||n instanceof gR){if("strict"in t&&t.strict)return;r=n.abiItem.name,s=n.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return YO(e,{args:s?[]:{},eventName:r})}})).filter(Boolean)}async function aL(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function oL(e,{abi:t,address:n,args:r,batch:s=!0,eventName:i,onError:a,onLogs:o,poll:c,pollingInterval:l=e.pollingInterval,strict:u}){return(void 0!==c?c:"webSocket"!==e.transport.type)?(()=>{const c=kF(["watchContractEvent",n,r,s,e.uid,i,l]),d=u??!1;return Yj(c,{onLogs:o,onError:a},(a=>{let o,c,u=!1;const h=Xj((async()=>{if(u)try{let l;if(c)l=await JN(e,iL,"getFilterChanges")({filter:c});else{const s=await JN(e,sL,"getBlockNumber")({});l=o&&o!==s?await JN(e,Tj,"getContractEvents")({abi:t,address:n,args:r,eventName:i,fromBlock:o+1n,toBlock:s,strict:d}):[],o=s}if(0===l.length)return;if(s)a.onLogs(l);else for(const e of l)a.onLogs([e])}catch(e){c&&e instanceof ZF&&(u=!1),a.onError?.(e)}else{try{c=await JN(e,dF,"createContractEventFilter")({abi:t,address:n,args:r,eventName:i,strict:d})}catch{}u=!0}}),{emitOnBegin:!0,interval:l});return async()=>{c&&await JN(e,aL,"uninstallFilter")({filter:c}),h()}}))})():(()=>{let s=!0,c=()=>s=!1;return(async()=>{try{const l=i?cF({abi:t,eventName:i,args:r}):[],{unsubscribe:d}=await e.transport.subscribe({params:["logs",{address:n,topics:l}],onData(e){if(!s)return;const n=e.result;try{const{eventName:e,args:r}=Sj({abi:t,data:n.data,topics:n.topics,strict:u}),s=YO(n,{args:r,eventName:e});o([s])}catch(e){let t,r;if(e instanceof bR||e instanceof gR){if(u)return;t=e.abiItem.name,r=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const s=YO(n,{args:r?[]:{},eventName:t});o([s])}},onError(e){a?.(e)}});c=d,s||c()}catch(e){a?.(e)}})(),c})()}async function cL(e){return VO(await e.request({method:"eth_chainId"}))}async function lL(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]})}async function uL(e,t){const{account:n=e.account,chain:r=e.chain,accessList:s,data:i,gas:a,gasPrice:o,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:h,...p}=t;if(!n)throw new uj({docsPath:"/docs/actions/wallet/sendTransaction"});const f=hF(n);try{let n;if(fj(t),null!==r&&(n=await JN(e,cL,"getChainId")({}),function({chain:e,currentChainId:t}){if(!e)throw new iN;if(t!==e.id)throw new sN({chain:e,currentChainId:t})}({currentChainId:n,chain:r})),"local"===f.type){const t=await JN(e,Aj,"prepareTransactionRequest")({account:f,accessList:s,chain:r,data:i,gas:a,gasPrice:o,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:h,...p});n||(n=await JN(e,cL,"getChainId")({}));const m=r?.serializers?.transaction,b=await f.signTransaction({...t,chainId:n},{serializer:m});return await JN(e,lL,"sendRawTransaction")({serializedTransaction:b})}const m=e.chain?.formatters?.transactionRequest?.format,b=(m||tN)({...pj(p,{format:m}),accessList:s,data:i,from:f.address,gas:a,gasPrice:o,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:h});return await e.request({method:"eth_sendTransaction",params:[b]})}catch(e){throw function(e,{docsPath:t,...n}){const r=(()=>{const t=hj(e,n);return t instanceof kN?e:t})();return new SF(r,{docsPath:t,...n})}(e,{...t,account:f,chain:t.chain||void 0})}}async function dL(e,{abi:t,address:n,args:r,dataSuffix:s,functionName:i,...a}){const o=pF({abi:t,args:r,functionName:i});return await JN(e,uL,"sendTransaction")({data:`${o}${s?s.replace("0x",""):""}`,to:n,...a})}function hL(e){const t=e.length&&Array.isArray(e[0]);return{args:t?e[0]:[],options:(t?e[1]:e[0])??{}}}function pL(e,t){let n=!1;Array.isArray(e[0])?n=!0:1===e.length?n=t.inputs.some((e=>e.indexed)):2===e.length&&(n=!0);return{args:n?e[0]:void 0,options:(n?e[1]:e[0])??{}}}const fL=256;let mL,bL=fL;function gL(e=11){if(!mL||bL+e>2*fL){mL="",bL=0;for(let e=0;e!0}={}){return new Promise(((s,i)=>{const a=async({count:o=0}={})=>{try{const t=await e();s(t)}catch(e){if(o{const n="function"==typeof t?t({count:o,error:e}):t;n&&await Jj(n),a({count:o+1})})({error:e});i(e)}};a()}))}const vL=e=>"code"in e?-1!==e.code&&-32004!==e.code&&-32005!==e.code&&-32042!==e.code&&-32603!==e.code:!!(e instanceof jF&&e.status)&&(403!==e.status&&408!==e.status&&413!==e.status&&429!==e.status&&500!==e.status&&502!==e.status&&503!==e.status&&504!==e.status);function wL(e,{retryDelay:t=150,retryCount:n=3}={}){return async r=>yL((async()=>{try{return await e(r)}catch(e){const t=e;switch(t.code){case GF.code:throw new GF(t);case qF.code:throw new qF(t);case $F.code:throw new $F(t);case VF.code:throw new VF(t);case WF.code:throw new WF(t);case ZF.code:throw new ZF(t);case QF.code:throw new QF(t);case KF.code:throw new KF(t);case YF.code:throw new YF(t);case JF.code:throw new JF(t);case XF.code:throw new XF(t);case ej.code:throw new ej(t);case tj.code:throw new tj(t);case nj.code:throw new nj(t);case rj.code:throw new rj(t);case sj.code:throw new sj(t);case ij.code:throw new ij(t);case aj.code:throw new aj(t);case 5e3:throw new tj(t);default:if(e instanceof gO)throw e;throw new oj(t)}}}),{delay:({count:e,error:n})=>{if(n&&n instanceof jF){const e=n?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*parseInt(e)}return(1<!vL(e)})}let xL=class extends gO{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}};var kL="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function EL(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise(((s,i)=>{(async()=>{let a;try{const o=new AbortController;n>0&&(a=setTimeout((()=>{r?o.abort():i(t)}),n)),s(await e({signal:o?.signal}))}catch(e){"AbortError"===e.name&&i(t),i(e)}finally{clearTimeout(a)}})()}))}let AL=0;const CL={http:async function(e,{body:t,fetchOptions:n={},timeout:r=1e4}){const{headers:s,method:i,signal:a}=n;try{const o=await EL((async({signal:o})=>await fetch(e,{...n,body:Array.isArray(t)?kF(t.map((e=>({jsonrpc:"2.0",id:e.id??AL++,...e})))):kF({jsonrpc:"2.0",id:t.id??AL++,...t}),headers:{...s,"Content-Type":"application/json"},method:i||"POST",signal:a||(r>0?o:void 0)})),{errorInstance:new DF({body:t,url:e}),timeout:r,signal:!0});let c;if(c=o.headers.get("Content-Type")?.startsWith("application/json")?await o.json():await o.text(),!o.ok)throw new jF({body:t,details:kF(c.error)||o.statusText,headers:o.headers,status:o.status,url:e});return c}catch(n){if(n instanceof jF)throw n;if(n instanceof DF)throw n;throw new jF({body:t,details:n.message,url:e})}},webSocket:function(e,{body:t,onResponse:n}){if(e.readyState===e.CLOSED||e.readyState===e.CLOSING)throw new LF({body:t,url:e.url,details:"Socket is closed."});const r=AL++,s=({data:i})=>{const a=JSON.parse(i);"number"==typeof a.id&&r!==a.id||(n?.(a),"eth_subscribe"===t.method&&"string"==typeof a.result&&e.subscriptions.set(a.result,s),"eth_unsubscribe"===t.method&&e.subscriptions.delete(t.params?.[0]))};return e.requests.set(r,s),e.send(JSON.stringify({jsonrpc:"2.0",...t,id:r})),e},webSocketAsync:async function(e,{body:t,timeout:n=1e4}){return EL((()=>new Promise((n=>CL.webSocket(e,{body:t,onResponse:n})))),{errorInstance:new DF({body:t,url:e.url}),timeout:n})}};function PL(e,t={}){const{batch:n,fetchOptions:r,key:s="http",name:i="HTTP JSON-RPC",retryDelay:a}=t;return({chain:o,retryCount:c,timeout:l})=>{const{batchSize:u=1e3,wait:d=0}="object"==typeof n?n:{},h=t.retryCount??c,p=l??t.timeout??1e4,f=e||o?.rpcUrls.default.http[0];if(!f)throw new xL;return function({key:e,name:t,request:n,retryCount:r=3,retryDelay:s=150,timeout:i,type:a},o){return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:s,timeout:i,type:a},request:wL(n,{retryCount:r,retryDelay:s}),value:o}}({key:s,name:i,async request({method:t,params:s}){const i={method:t,params:s},{schedule:a}=qj({id:`${e}`,wait:d,shouldSplitBatch:e=>e.length>u,fn:e=>CL.http(f,{body:e,fetchOptions:r,timeout:p}),sort:(e,t)=>e.id-t.id}),[{error:o,result:c}]=await(async e=>n?a(e):[await CL.http(f,{body:e,fetchOptions:r,timeout:p})])(i);if(o)throw new UF({body:i,error:o,url:f});return c},retryCount:h,retryDelay:a,timeout:p,type:"http"},{fetchOptions:r,url:e})}}function _L(e,t){if(!(e instanceof gO))return!1;const n=e.walk((e=>e instanceof NF));return n instanceof NF&&("ResolverNotFound"===n.data?.errorName||("ResolverWildcardNotSupported"===n.data?.errorName||(!!n.reason?.includes("Wildcard on non-extended resolvers is not supported")||"reverse"===t&&n.reason===fF[50])))}function SL(e){if(66!==e.length)return null;if(0!==e.indexOf("["))return null;if(65!==e.indexOf("]"))return null;const t=`0x${e.slice(1,65)}`;return kO(t)?t:null}function IL(e){let t=new Uint8Array(32).fill(0);if(!e)return MO(t);const n=e.split(".");for(let e=n.length-1;e>=0;e-=1){const r=SL(n[e]),s=r?jO(r):QR(zO(n[e]),"bytes");t=QR(CN([t,s]),"bytes")}return MO(t)}function BL(e){return`[${e.slice(2)}]`}function TL(e){const t=new Uint8Array(32).fill(0);return e?SL(e)||QR(zO(e)):MO(t)}function ML(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const n=new Uint8Array(zO(t).byteLength+2);let r=0;const s=t.split(".");for(let e=0;e255&&(t=zO(BL(TL(s[e])))),n[r]=t.length,n.set(t,r+1),r+=t.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}let OL=class extends gO{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}},NL=class extends gO{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}},RL=class extends gO{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}},FL=class extends gO{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}};const jL=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,LL=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,UL=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,DL=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function zL(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function HL({uri:e,gatewayUrls:t}){const n=UL.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=zL(t?.ipfs,"https://ipfs.io"),s=zL(t?.arweave,"https://arweave.net"),i=e.match(jL),{protocol:a,subpath:o,target:c,subtarget:l=""}=i?.groups||{},u="ipns:/"===a||"ipns/"===o,d="ipfs:/"===a||"ipfs/"===o||LL.test(e);if(e.startsWith("http")&&!u&&!d){let n=e;return t?.arweave&&(n=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:n,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${r}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===a&&c)return{uri:`${s}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let h=e.replace(DL,"");if(h.startsWith("{const n=new Image;n.onload=()=>{t(!0)},n.onerror=()=>{t(!1)},n.src=e}))}}(n);if(s)return n;throw new RL({uri:t})}async function $L(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?async function(e,{gatewayUrls:t,record:n}){const r=function(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[i,a]=n.split(":"),[o,c]=r.split(":");if(!i||"eip155"!==i.toLowerCase())throw new NL({reason:"Only EIP-155 supported"});if(!a)throw new NL({reason:"Chain ID not found"});if(!c)throw new NL({reason:"Contract address not found"});if(!s)throw new NL({reason:"Token ID not found"});if(!o)throw new NL({reason:"ERC namespace not found"});return{chainID:parseInt(a),namespace:o.toLowerCase(),contractAddress:c,tokenID:s}}(n),s=await async function(e,{nft:t}){if("erc721"===t.namespace)return Vj(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return Vj(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new FL({namespace:t.namespace})}(e,{nft:r}),{uri:i,isOnChain:a,isEncoded:o}=HL({uri:s,gatewayUrls:t});if(a&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){const e=o?atob(i.replace("data:application/json;base64,","")):i;return qL({uri:GL(JSON.parse(e)),gatewayUrls:t})}let c=r.tokenID;"erc1155"===r.namespace&&(c=c.replace("0x","").padStart(64,"0"));return async function({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then((e=>e.json()));return await qL({gatewayUrls:e,uri:GL(n)})}catch{throw new RL({uri:t})}}({gatewayUrls:t,uri:i.replace(/(?:0x)?{id}/,c)})}(e,{gatewayUrls:t,record:n}):qL({uri:n,gatewayUrls:t})}async function VL(e,{blockNumber:t,blockTag:n,name:r,key:s,universalResolverAddress:i}){let a=i;if(!a){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Hj({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const i=await JN(e,Vj,"readContract")({address:a,abi:Fj,functionName:"resolve",args:[BO(ML(r)),pF({abi:Lj,functionName:"text",args:[IL(r),s]})],blockNumber:t,blockTag:n});if("0x"===i[0])return null;const o=Oj({abi:Lj,functionName:"text",data:i[0]});return""===o?null:o}catch(e){if(_L(e,"resolve"))return null;throw e}}async function WL(e,{address:t,args:n,event:r,events:s,fromBlock:i,strict:a,toBlock:o}={}){const c=s??(r?[r]:void 0),l=uF(e,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap((e=>cF({abi:[e],eventName:e.name,args:n})))],r&&(u=u[0]));const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof i?OO(i):i,toBlock:"bigint"==typeof o?OO(o):o,...u.length?{topics:u}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:i,id:d,request:l(d),strict:a,toBlock:o,type:"event"}}async function ZL(e){const t=uF(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function QL(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const i=n?OO(n):void 0;return function(e){return{baseFeePerGas:e.baseFeePerGas.map((e=>BigInt(e))),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:e.reward?.map((e=>e.map((e=>BigInt(e)))))}}(await e.request({method:"eth_feeHistory",params:[OO(t),i||r,s]}))}let KL=class extends gO{constructor({callbackSelector:e,cause:t,data:n,extraData:r,sender:s,urls:i}){super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],t.metaMessages?.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map((e=>` ${e}`))],` Sender: ${s}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${r}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}},YL=class extends gO{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${t}`,`Response: ${kF(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}},JL=class extends gO{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}};const XL={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function eU({data:e,sender:t,urls:n}){let r=new Error("An unknown error occurred.");for(let s=0;s{for(const n of e){const{name:e,type:r}=n,a=r,o=t[e],c=a.match(rU);if(c&&("number"==typeof o||"bigint"==typeof o)){const[e,t,n]=c;OO(o,{signed:"int"===t,size:parseInt(n)/8})}if("address"===a&&"string"==typeof o&&!AN(o))throw new nN({address:o});const l=a.match(nU);if(l){const[e,t]=l;if(t&&EO(o)!==parseInt(t))throw new mR({expectedSize:parseInt(t),givenSize:EO(o)})}const u=s[a];u&&i(u,o)}};s.EIP712Domain&&e&&i(s.EIP712Domain,e);if("EIP712Domain"!==n){const e=s[n];i(e,t)}}({domain:s,message:t,primaryType:n,types:i});const a=["0x1901"];return s&&a.push(function({domain:e,types:t}){return iU({data:e,primaryType:"EIP712Domain",types:t})}({domain:s,types:i})),"EIP712Domain"!==n&&a.push(iU({data:t,primaryType:n,types:i})),QR(CN(a))}function iU({data:e,primaryType:t,types:n}){return QR(aU({data:e,primaryType:t,types:n}))}function aU({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],s=[oU({primaryType:t,types:n})];for(const i of n[t]){const[t,a]=lU({types:n,name:i.name,type:i.type,value:e[i.name]});r.push(t),s.push(a)}return eF(r,s)}function oU({primaryType:e,types:t}){const n=BO(function({primaryType:e,types:t}){let n="";const r=cU({primaryType:e,types:t});r.delete(e);const s=[e,...Array.from(r).sort()];for(const e of s)n+=`${e}(${t[e].map((({name:e,type:t})=>`${t} ${e}`)).join(",")})`;return n}({primaryType:e,types:t}));return QR(n)}function cU({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),s=r?.[0];if(n.has(s)||void 0===t[s])return n;n.add(s);for(const e of t[s])cU({primaryType:e.type,types:t},n);return n}function lU({types:e,name:t,type:n,value:r}){if(void 0!==e[n])return[{type:"bytes32"},QR(aU({data:r,primaryType:n,types:e}))];if("bytes"===n){return[{type:"bytes32"},QR(r=`0x${(r.length%2?"0":"")+r.slice(2)}`)]}if("string"===n)return[{type:"bytes32"},QR(BO(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),i=r.map((n=>lU({name:t,type:s,types:e,value:n})));return[{type:"bytes32"},QR(eF(i.map((([e])=>e)),i.map((([,e])=>e))))]}return[{type:n},r]}function uU({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},"number"==typeof e?.chainId&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}const dU="/docs/contract/encodeDeployData";function hU({abi:e,args:t,bytecode:n}){if(!t||0===t.length)return n;const r=e.find((e=>"type"in e&&"constructor"===e.type));if(!r)throw new tR({docsPath:dU});if(!("inputs"in r))throw new nR({docsPath:dU});if(!r.inputs||0===r.inputs.length)throw new nR({docsPath:dU});return PN([n,eF(r.inputs,t)])}const pU="Ethereum Signed Message:\n";async function fU(e,{address:t,blockNumber:n,blockTag:r,storageKeys:s}){const i=r??"latest",a=void 0!==n?OO(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?VO(e.nonce):void 0,storageProof:e.storageProof?(t=e.storageProof,t.map((e=>({...e,value:BigInt(e.value)})))):void 0};var t}(await e.request({method:"eth_getProof",params:[t,s,a||i]}))}async function mU(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:i}){const a=r||"latest",o=void 0!==n?OO(n):void 0;let c=null;if(s?c=await e.request({method:"eth_getTransactionByHash",params:[s]}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,OO(i)]}):(o||a)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||a,OO(i)]})),!c)throw new IF({blockHash:t,blockNumber:n,blockTag:a,hash:s,index:i});return(e.chain?.formatters?.transaction?.format||QO)(c)}async function bU(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(!n)throw new BF({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||XO)(n)}const gU="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572"; /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */async function yU(e,{address:t,hash:n,signature:r,...s}){const i=kO(r)?r:BO(r);try{const{data:r}=await JN(e,$j,"call")({data:hU({abi:Dj,args:[t,n,i],bytecode:gU}),...s});return o="0x1",function(e,t){if(e.length!==t.length)return!1;for(let n=0;nXj((async()=>{try{const t=await JN(e,sL,"getBlockNumber")({cacheTime:0});if(o){if(t===o)return;if(t-o>1&&n)for(let e=o+1n;eo)&&(r.onBlockNumber(t,o),o=t)}catch(e){r.onError?.(e)}}),{emitOnBegin:t,interval:a}))):(()=>{let t=!0,n=()=>t=!1;return(async()=>{try{const{unsubscribe:i}=await e.transport.subscribe({params:["newHeads"],onData(e){if(!t)return;const n=qO(e.result?.number);r(n,o),o=n},onError(e){s?.(e)}});n=i,t||n()}catch(e){s?.(e)}})(),n})()}function xU(e){return{call:t=>$j(e,t),createBlockFilter:()=>async function(e){const t=uF(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>dF(e,t),createEventFilter:t=>WL(e,t),createPendingTransactionFilter:()=>ZL(e),estimateContractGas:t=>Pj(e,t),estimateGas:t=>Cj(e,t),getBalance:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n?OO(n):void 0,i=await e.request({method:"eth_getBalance",params:[t,s||r]});return BigInt(i)}(e,t),getBlock:t=>vj(e,t),getBlockNumber:t=>sL(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=void 0!==n?OO(n):void 0;let i;return i=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]}),VO(i)}(e,t),getBytecode:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=void 0!==n?OO(n):void 0,i=await e.request({method:"eth_getCode",params:[t,s||r]});if("0x"!==i)return i}(e,t),getChainId:()=>cL(e),getContractEvents:t=>Tj(e,t),getEnsAddress:t=>async function(e,{blockNumber:t,blockTag:n,coinType:r,name:s,universalResolverAddress:i}){let a=i;if(!a){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Hj({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const i=pF({abi:Uj,functionName:"addr",...null!=r?{args:[IL(s),BigInt(r)]}:{args:[IL(s)]}}),o=await JN(e,Vj,"readContract")({address:a,abi:Fj,functionName:"resolve",args:[BO(ML(s)),i],blockNumber:t,blockTag:n});if("0x"===o[0])return null;const c=Oj({abi:Uj,args:null!=r?[IL(s),BigInt(r)]:void 0,functionName:"addr",data:o[0]});return"0x"===c||"0x00"===AO(c)?null:c}catch(e){if(_L(e,"resolve"))return null;throw e}}(e,t),getEnsAvatar:t=>async function(e,{blockNumber:t,blockTag:n,gatewayUrls:r,name:s,universalResolverAddress:i}){const a=await JN(e,VL,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:i});if(!a)return null;try{return await $L(e,{record:a,gatewayUrls:r})}catch{return null}}(e,t),getEnsName:t=>async function(e,{address:t,blockNumber:n,blockTag:r,universalResolverAddress:s}){let i=s;if(!i){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=Hj({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const a=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const[s,o]=await JN(e,Vj,"readContract")({address:i,abi:jj,functionName:"reverse",args:[BO(ML(a))],blockNumber:n,blockTag:r});return t.toLowerCase()!==o.toLowerCase()?null:s}catch(e){if(_L(e,"reverse"))return null;throw e}}(e,t),getEnsResolver:t=>async function(e,{blockNumber:t,blockTag:n,name:r,universalResolverAddress:s}){let i=s;if(!i){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=Hj({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[a]=await JN(e,Vj,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[BO(ML(r))],blockNumber:t,blockTag:n});return a}(e,t),getEnsText:t=>VL(e,t),getFeeHistory:t=>QL(e,t),estimateFeesPerGas:t=>async function(e,t){return kj(e,t)}(e,t),getFilterChanges:e=>iL(0,e),getFilterLogs:e=>async function(e,{filter:t}){const n=t.strict??!1;return(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map((e=>{try{const{eventName:r,args:s}="abi"in t&&t.abi?Sj({abi:t.abi,data:e.data,topics:e.topics,strict:n}):{eventName:void 0,args:void 0};return YO(e,{args:s,eventName:r})}catch(n){let r,s;if(n instanceof bR||n instanceof gR){if("strict"in t&&t.strict)return;r=n.abiItem.name,s=n.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return YO(e,{args:s?[]:{},eventName:r})}})).filter(Boolean)}(0,e),getGasPrice:()=>wj(e),getLogs:t=>Bj(e,t),getProof:t=>fU(e,t),estimateMaxPriorityFeePerGas:t=>async function(e,t){return xj(e,t)}(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest",slot:s}){const i=void 0!==n?OO(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,i||r]})}(e,t),getTransaction:t=>mU(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([JN(e,sL,"getBlockNumber")({}),t?JN(e,mU,"getBlockNumber")({hash:t}):void 0]),i=n?.blockNumber||s?.blockNumber;return i?r-i+1n:0n}(e,t),getTransactionCount:t=>Ej(e,t),getTransactionReceipt:t=>bU(e,t),multicall:t=>async function(e,t){const{allowFailure:n=!0,batchSize:r,blockNumber:s,blockTag:i,contracts:a,multicallAddress:o}=t,c=r??("object"==typeof e.batch?.multicall&&e.batch.multicall.batchSize||1024);let l=o;if(!l){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");l=Hj({blockNumber:s,chain:e.chain,contract:"multicall3"})}const u=[[]];let d=0,h=0;for(let e=0;e0&&h>c&&u[d].length>0&&(d++,h=(e.length-2)/2,u[d]=[]),u[d]=[...u[d],{allowFailure:!0,callData:e,target:r}]}catch(e){const a=lj(e,{abi:t,address:r,args:s,docsPath:"/docs/contract/multicall",functionName:i});if(!n)throw a;u[d]=[...u[d],{allowFailure:!0,callData:"0x",target:r}]}}const p=await Promise.allSettled(u.map((t=>JN(e,Vj,"readContract")({abi:Nj,address:l,args:[t],blockNumber:s,blockTag:i,functionName:"aggregate3"})))),f=[];for(let e=0;eAj(e,t),readContract:t=>Vj(e,t),sendRawTransaction:t=>lL(e,t),simulateContract:t=>Wj(e,t),verifyMessage:t=>vU(e,t),verifyTypedData:t=>async function(e,{address:t,signature:n,message:r,primaryType:s,types:i,domain:a,...o}){return yU(e,{address:t,hash:sU({message:r,primaryType:s,types:i,domain:a}),signature:n,...o})}(e,t),uninstallFilter:e=>aL(0,e),waitForTransactionReceipt:t=>async function(e,{confirmations:t=1,hash:n,onReplaced:r,pollingInterval:s=e.pollingInterval,timeout:i}){const a=kF(["waitForTransactionReceipt",e.uid,n]);let o,c,l,u=!1;return new Promise(((d,h)=>{i&&setTimeout((()=>h(new TF({hash:n}))),i);const p=Yj(a,{onReplaced:r,resolve:d,reject:h},(r=>{const i=JN(e,wU,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:s,async onBlockNumber(s){if(u)return;let a=s;const d=e=>{i(),e(),p()};try{if(l){if(t>1&&(!l.blockNumber||a-l.blockNumber+1nr.resolve(l)))}if(o||(u=!0,await yL((async()=>{o=await JN(e,mU,"getTransaction")({hash:n}),o.blockNumber&&(a=o.blockNumber)}),{delay:({count:e})=>200*(1<1&&(!l.blockNumber||a-l.blockNumber+1nr.resolve(l)))}catch(n){if(o&&(n instanceof IF||n instanceof BF))try{c=o,u=!0;const n=await yL((()=>JN(e,vj,"getBlock")({blockNumber:a,includeTransactions:!0})),{delay:({count:e})=>200*(1<e instanceof yj});u=!1;const s=n.transactions.find((({from:e,nonce:t})=>e===c.from&&t===c.nonce));if(!s)return;if(l=await JN(e,bU,"getTransactionReceipt")({hash:s.hash}),t>1&&(!l.blockNumber||a-l.blockNumber+1n{r.onReplaced?.({reason:i,replacedTransaction:c,transaction:s,transactionReceipt:l}),r.resolve(l)}))}catch(e){d((()=>r.reject(e)))}else d((()=>r.reject(n)))}}})}))}))}(e,t),watchBlocks:t=>function(e,{blockTag:t="latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:i,includeTransactions:a,poll:o,pollingInterval:c=e.pollingInterval}){const l=void 0!==o?o:"webSocket"!==e.transport.type,u=a??!1;let d;return l?Yj(kF(["watchBlocks",e.uid,n,r,u,c]),{onBlock:s,onError:i},(s=>Xj((async()=>{try{const r=await JN(e,vj,"getBlock")({blockTag:t,includeTransactions:u});if(r.number&&d?.number){if(r.number===d.number)return;if(r.number-d.number>1&&n)for(let t=d?.number+1n;td.number)&&(s.onBlock(r,d),d=r)}catch(e){s.onError?.(e)}}),{emitOnBegin:r,interval:c}))):(()=>{let t=!0,n=()=>t=!1;return(async()=>{try{const{unsubscribe:r}=await e.transport.subscribe({params:["newHeads"],onData(n){if(!t)return;const r=(e.chain?.formatters?.block?.format||KO)(n.result);s(r,d),d=r},onError(e){i?.(e)}});n=r,t||n()}catch(e){i?.(e)}})(),n})()}(e,t),watchBlockNumber:t=>wU(e,t),watchContractEvent:t=>oL(e,t),watchEvent:t=>function(e,{address:t,args:n,batch:r=!0,event:s,events:i,onError:a,onLogs:o,poll:c,pollingInterval:l=e.pollingInterval,strict:u}){const d=void 0!==c?c:"webSocket"!==e.transport.type,h=u??!1;return d?Yj(kF(["watchEvent",t,n,r,e.uid,s,l]),{onLogs:o,onError:a},(a=>{let o,c,u=!1;const d=Xj((async()=>{if(u)try{let l;if(c)l=await JN(e,iL,"getFilterChanges")({filter:c});else{const r=await JN(e,sL,"getBlockNumber")({});l=o&&o!==r?await JN(e,Bj,"getLogs")({address:t,args:n,event:s,events:i,fromBlock:o+1n,toBlock:r}):[],o=r}if(0===l.length)return;if(r)a.onLogs(l);else for(const e of l)a.onLogs([e])}catch(e){c&&e instanceof ZF&&(u=!1),a.onError?.(e)}else{try{c=await JN(e,WL,"createEventFilter")({address:t,args:n,event:s,events:i,strict:h})}catch{}u=!0}}),{emitOnBegin:!0,interval:l});return async()=>{c&&await JN(e,aL,"uninstallFilter")({filter:c}),d()}})):(()=>{let r=!0,c=()=>r=!1;return(async()=>{try{const l=i??(s?[s]:void 0);let d=[];l&&(d=[l.flatMap((e=>cF({abi:[e],eventName:e.name,args:n})))],s&&(d=d[0]));const{unsubscribe:p}=await e.transport.subscribe({params:["logs",{address:t,topics:d}],onData(e){if(!r)return;const t=e.result;try{const{eventName:e,args:n}=Sj({abi:l,data:t.data,topics:t.topics,strict:h}),r=YO(t,{args:n,eventName:e});o([r])}catch(e){let n,r;if(e instanceof bR||e instanceof gR){if(u)return;n=e.abiItem.name,r=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const s=YO(t,{args:r?[]:{},eventName:n});o([s])}},onError(e){a?.(e)}});c=p,r||c()}catch(e){a?.(e)}})(),c})()}(e,t),watchPendingTransactions:t=>function(e,{batch:t=!0,onError:n,onTransactions:r,poll:s,pollingInterval:i=e.pollingInterval}){return(void 0!==s?s:"webSocket"!==e.transport.type)?Yj(kF(["watchPendingTransactions",e.uid,t,i]),{onTransactions:r,onError:n},(n=>{let r;const s=Xj((async()=>{try{if(!r)try{return void(r=await JN(e,ZL,"createPendingTransactionFilter")({}))}catch(e){throw s(),e}const i=await JN(e,iL,"getFilterChanges")({filter:r});if(0===i.length)return;if(t)n.onTransactions(i);else for(const e of i)n.onTransactions([e])}catch(e){n.onError?.(e)}}),{emitOnBegin:!0,interval:i});return async()=>{r&&await JN(e,aL,"uninstallFilter")({filter:r}),s()}})):(()=>{let t=!0,s=()=>t=!1;return(async()=>{try{const{unsubscribe:i}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!t)return;const n=e.result;r([n])},onError(e){n?.(e)}});s=i,t||s()}catch(e){n?.(e)}})(),s})()}(e,t)}}function kU(e){const{key:t="public",name:n="Public Client"}=e,r=function(e){const{batch:t,cacheTime:n=e.pollingInterval??4e3,key:r="base",name:s="Base Client",pollingInterval:i=4e3,type:a="base"}=e,o=e.chain,c=e.account?hF(e.account):void 0,{config:l,request:u,value:d}=e.transport({chain:o,pollingInterval:i}),h={account:c,batch:t,cacheTime:n,chain:o,key:r,name:s,pollingInterval:i,request:u,transport:{...l,...d},type:a,uid:gL()};return Object.assign(h,{extend:function e(t){return n=>{const r=n(t);for(const e in h)delete r[e];const s={...t,...r};return Object.assign(s,{extend:e(s)})}}(h)})}({...e,key:t,name:n,type:"publicClient"});return r.extend(xU)}BigInt(0),BigInt(1),BigInt(2);const EU=[{inputs:[{internalType:"uint256",name:"preOpGas",type:"uint256"},{internalType:"uint256",name:"paid",type:"uint256"},{internalType:"uint48",name:"validAfter",type:"uint48"},{internalType:"uint48",name:"validUntil",type:"uint48"},{internalType:"bool",name:"targetSuccess",type:"bool"},{internalType:"bytes",name:"targetResult",type:"bytes"}],name:"ExecutionResult",type:"error"},{inputs:[{internalType:"uint256",name:"opIndex",type:"uint256"},{internalType:"string",name:"reason",type:"string"}],name:"FailedOp",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"},{inputs:[{internalType:"address",name:"aggregator",type:"address"}],name:"SignatureValidationFailed",type:"error"},{inputs:[{components:[{internalType:"uint256",name:"preOpGas",type:"uint256"},{internalType:"uint256",name:"prefund",type:"uint256"},{internalType:"bool",name:"sigFailed",type:"bool"},{internalType:"uint48",name:"validAfter",type:"uint48"},{internalType:"uint48",name:"validUntil",type:"uint48"},{internalType:"bytes",name:"paymasterContext",type:"bytes"}],internalType:"struct IEntryPoint.ReturnInfo",name:"returnInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"senderInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"factoryInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"paymasterInfo",type:"tuple"}],name:"ValidationResult",type:"error"},{inputs:[{components:[{internalType:"uint256",name:"preOpGas",type:"uint256"},{internalType:"uint256",name:"prefund",type:"uint256"},{internalType:"bool",name:"sigFailed",type:"bool"},{internalType:"uint48",name:"validAfter",type:"uint48"},{internalType:"uint48",name:"validUntil",type:"uint48"},{internalType:"bytes",name:"paymasterContext",type:"bytes"}],internalType:"struct IEntryPoint.ReturnInfo",name:"returnInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"senderInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"factoryInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"paymasterInfo",type:"tuple"},{components:[{internalType:"address",name:"aggregator",type:"address"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"stakeInfo",type:"tuple"}],internalType:"struct IEntryPoint.AggregatorStakeInfo",name:"aggregatorInfo",type:"tuple"}],name:"ValidationResultWithAggregation",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"address",name:"factory",type:"address"},{indexed:!1,internalType:"address",name:"paymaster",type:"address"}],name:"AccountDeployed",type:"event"},{anonymous:!1,inputs:[],name:"BeforeExecution",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"uint256",name:"totalDeposit",type:"uint256"}],name:"Deposited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"aggregator",type:"address"}],name:"SignatureAggregatorChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"uint256",name:"totalStaked",type:"uint256"},{indexed:!1,internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],name:"StakeLocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"uint256",name:"withdrawTime",type:"uint256"}],name:"StakeUnlocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"address",name:"withdrawAddress",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"StakeWithdrawn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!0,internalType:"address",name:"paymaster",type:"address"},{indexed:!1,internalType:"uint256",name:"nonce",type:"uint256"},{indexed:!1,internalType:"bool",name:"success",type:"bool"},{indexed:!1,internalType:"uint256",name:"actualGasCost",type:"uint256"},{indexed:!1,internalType:"uint256",name:"actualGasUsed",type:"uint256"}],name:"UserOperationEvent",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"nonce",type:"uint256"},{indexed:!1,internalType:"bytes",name:"revertReason",type:"bytes"}],name:"UserOperationRevertReason",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"address",name:"withdrawAddress",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Withdrawn",type:"event"},{inputs:[],name:"SIG_VALIDATION_FAILED",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"address",name:"sender",type:"address"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"}],name:"_validateSenderAndPaymaster",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"}],name:"addStake",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"depositTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"deposits",outputs:[{internalType:"uint112",name:"deposit",type:"uint112"},{internalType:"bool",name:"staked",type:"bool"},{internalType:"uint112",name:"stake",type:"uint112"},{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"},{internalType:"uint48",name:"withdrawTime",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"getDepositInfo",outputs:[{components:[{internalType:"uint112",name:"deposit",type:"uint112"},{internalType:"bool",name:"staked",type:"bool"},{internalType:"uint112",name:"stake",type:"uint112"},{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"},{internalType:"uint48",name:"withdrawTime",type:"uint48"}],internalType:"struct IStakeManager.DepositInfo",name:"info",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint192",name:"key",type:"uint192"}],name:"getNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"initCode",type:"bytes"}],name:"getSenderAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"userOp",type:"tuple"}],name:"getUserOpHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation[]",name:"userOps",type:"tuple[]"},{internalType:"contract IAggregator",name:"aggregator",type:"address"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct IEntryPoint.UserOpsPerAggregator[]",name:"opsPerAggregator",type:"tuple[]"},{internalType:"address payable",name:"beneficiary",type:"address"}],name:"handleAggregatedOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation[]",name:"ops",type:"tuple[]"},{internalType:"address payable",name:"beneficiary",type:"address"}],name:"handleOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint192",name:"key",type:"uint192"}],name:"incrementNonce",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"callData",type:"bytes"},{components:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"address",name:"paymaster",type:"address"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"}],internalType:"struct EntryPoint.MemoryUserOp",name:"mUserOp",type:"tuple"},{internalType:"bytes32",name:"userOpHash",type:"bytes32"},{internalType:"uint256",name:"prefund",type:"uint256"},{internalType:"uint256",name:"contextOffset",type:"uint256"},{internalType:"uint256",name:"preOpGas",type:"uint256"}],internalType:"struct EntryPoint.UserOpInfo",name:"opInfo",type:"tuple"},{internalType:"bytes",name:"context",type:"bytes"}],name:"innerHandleOp",outputs:[{internalType:"uint256",name:"actualGasCost",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint192",name:"",type:"uint192"}],name:"nonceSequenceNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"op",type:"tuple"},{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"targetCallData",type:"bytes"}],name:"simulateHandleOp",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"userOp",type:"tuple"}],name:"simulateValidation",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unlockStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"withdrawAddress",type:"address"}],name:"withdrawStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"withdrawAddress",type:"address"},{internalType:"uint256",name:"withdrawAmount",type:"uint256"}],name:"withdrawTo",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],AU=e=>{const t=e;return{...t,estimateUserOperationGas:(e,n)=>t.request({method:"eth_estimateUserOperationGas",params:[e,n]}),sendUserOperation:(e,n)=>t.request({method:"eth_sendUserOperation",params:[e,n]}),getUserOperationByHash:e=>t.request({method:"eth_getUserOperationByHash",params:[e]}),getUserOperationReceipt:e=>t.request({method:"eth_getUserOperationReceipt",params:[e]}),getSupportedEntryPoints:()=>t.request({method:"eth_supportedEntryPoints",params:[]}),getMaxPriorityFeePerGas:()=>t.request({method:"eth_maxPriorityFeePerGas",params:[]}),async getFeeData(){const e=await t.getBlock({blockTag:"latest"});if(e&&e.baseFeePerGas){const t=BigInt(15e8);return{maxPriorityFeePerGas:t,maxFeePerGas:e.baseFeePerGas*BigInt(2)+t}}return{maxFeePerGas:0,maxPriorityFeePerGas:0}},getContractCode:async e=>await t.getBytecode({address:e})??"0x"}},CU=({chain:e,rpcUrl:t,fetchOptions:n})=>AU(kU({chain:e,transport:PL(t,{fetchOptions:{...n,headers:{...n?.headers,"Alchemy-AA-Sdk-Version":"0.1.0-alpha.23"}}})}));var PU;!function(e){e[e.DEBUG=4]="DEBUG",e[e.INFO=3]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=1]="ERROR",e[e.NONE=0]="NONE"}(PU||(PU={}));let _U=class{static setLogLevel(e){this.logLevel=e}static setLogFilter(e){this.logFilter=e}static error(e,...t){this.shouldLog(e,PU.ERROR)&&console.error(e,...t)}static warn(e,...t){this.shouldLog(e,PU.WARN)&&console.warn(e,...t)}static debug(e,...t){this.shouldLog(e,PU.DEBUG)&&console.debug(e,...t)}static info(e,...t){this.shouldLog(e,PU.INFO)&&console.info(e,...t)}static shouldLog(e,t){return!(this.logLevel(...r)=>{const{args:i,options:a}=hL(r);return JN(n,Vj,"readContract")({abi:e,address:t,functionName:s,args:i,...a})}})),c&&(a.simulate=new Proxy({},{get:(r,s)=>(...r)=>{const{args:i,options:a}=hL(r);return JN(n,Wj,"simulateContract")({abi:e,address:t,functionName:s,args:i,...a})}})),l&&(a.createEventFilter=new Proxy({},{get:(r,s)=>(...r)=>{const i=e.find((e=>"event"===e.type&&e.name===s)),{args:a,options:o}=pL(r,i);return JN(n,dF,"createContractEventFilter")({abi:e,address:t,eventName:s,args:a,...o})}}),a.getEvents=new Proxy({},{get:(r,s)=>(...r)=>{const i=e.find((e=>"event"===e.type&&e.name===s)),{args:a,options:o}=pL(r,i);return JN(n,Tj,"getContractEvents")({abi:e,address:t,eventName:s,args:a,...o})}}),a.watchEvent=new Proxy({},{get:(r,s)=>(...r)=>{const i=e.find((e=>"event"===e.type&&e.name===s)),{args:a,options:o}=pL(r,i);return JN(n,oL,"watchContractEvent")({abi:e,address:t,eventName:s,args:a,...o})}}))),i&&c&&(a.write=new Proxy({},{get:(n,s)=>(...n)=>{const{args:i,options:a}=hL(n);return JN(r,dL,"writeContract")({abi:e,address:t,functionName:s,args:i,...a})}})),(s||i)&&c&&(a.estimateGas=new Proxy({},{get:(s,i)=>(...s)=>{const{args:a,options:o}=hL(s);return JN(n??r,Pj,"estimateContractGas")({abi:e,address:t,functionName:i,args:a,...o,account:o.account??r.account})}})),a.address=t,a.abi=e,a}({address:e.entryPointAddress,abi:EU,publicClient:this.rpcProvider})}async signMessageWith6492(e){throw new Error("signMessageWith6492 not supported")}async signTypedData(e){throw new Error("signTypedData not supported")}async signTypedDataWith6492(e){throw new Error("signTypedDataWith6492 not supported")}async encodeBatchExecute(e){throw new Error("encodeBatchExecute not supported")}async getNonce(){if(!await this.isAccountDeployed())return 0n;const e=await this.getAddress();return this.entryPoint.read.getNonce([e,BigInt(0)])}async getInitCode(){if(this.deploymentState===SU.DEPLOYED)return"0x";const e=await this.rpcProvider.getContractCode(await this.getAddress());return(e?.length??0)>2?(this.deploymentState=SU.DEPLOYED,"0x"):(this.deploymentState=SU.NOT_DEPLOYED,this.getAccountInitCode())}async getAddress(){if(!this.accountAddress){const e=await this.getAccountInitCode();_U.debug("[BaseSmartContractAccount](getAddress) initCode: ",e);try{await this.entryPoint.simulate.getSenderAddress([e])}catch(e){if(_U.debug("[BaseSmartContractAccount](getAddress) entrypoint.getSenderAddress result: ",e),"SenderAddressResult"===e.cause?.data?.errorName)return this.accountAddress=e.cause.data.args[0],this.accountAddress}throw new Error("getCounterFactualAddress failed")}return this.accountAddress}async isAccountDeployed(){return await this.getDeploymentState()===SU.DEPLOYED}async getDeploymentState(){if(this.deploymentState===SU.UNDEFINED){return"0x"===await this.getInitCode()?SU.DEPLOYED:SU.NOT_DEPLOYED}return this.deploymentState}}const BU=({factoryAddress:e,initCode:t,signature:n})=>CN([eF(YN("address, bytes, bytes"),[e,t,n]),"0x6492649264926492649264926492649264926492649264926492649264926492"]);var TU={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function s(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new s(r,i||e,a),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],o]:e._events[c].push(o):(e._events[c]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,r,s=[];if(0===this._eventsCount)return s;for(r in e=this._events)t.call(e,r)&&s.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},o.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,i=r.length,a=new Array(i);sasync t=>{let n=t;for(const t of e)n=await t(n);return n};async function RU(e){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return(await Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}function FU(e){if("function"!=typeof e)return null==e||"string"==typeof e||"boolean"==typeof e?e:"bigint"==typeof e?BO(e):null!=e._isBigNumber||"object"!=typeof e?BO(e).replace(/^0x0/,"0x"):Array.isArray(e)?e.map((e=>FU(e))):Object.keys(e).reduce(((t,n)=>({...t,[n]:FU(e[n])})),{})}function jU(e,t,n){const r=eF([{type:"bytes32"},{type:"address"},{type:"uint256"}],[QR(LU(e)),t,n]);return QR(r)}function LU(e){const t=QR(e.initCode),n=QR(e.callData),r=QR(e.paymasterAndData);return eF([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"bytes32"}],[e.sender,qO(e.nonce),t,n,qO(e.callGasLimit),qO(e.verificationGasLimit),qO(e.preVerificationGas),qO(e.maxFeePerGas),qO(e.maxPriorityFeePerGas),r])}function UU(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}const DU=async e=>e,zU=new Map([[mO.id,10000000n],[bO.id,10000000n]]);class HU extends OU{constructor(e,t,n,r,s){super(),Object.defineProperty(this,"entryPointAddress",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"chain",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"account",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"txMaxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"txRetryIntervalMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"txRetryMulitplier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minPriorityFeePerBid",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rpcClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const{method:t,params:n}=e;switch(t){case"eth_sendTransaction":const[t]=n;return this.sendTransaction(t);case"eth_sign":case"personal_sign":const[r,s]=n;if(s!==await this.getAddress())throw new Error("cannot sign for address that is not the current account");return this.signMessage(r);default:return this.rpcClient.request(e)}}}),Object.defineProperty(this,"getAddress",{enumerable:!0,configurable:!0,writable:!0,value:()=>{if(!this.account)throw new Error("account not connected!");return this.account.getAddress()}}),Object.defineProperty(this,"sendTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(!e.to)throw new Error("transaction is missing to address");const t={};e.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);const{hash:n}=await this.sendUserOperation({target:e.to,data:e.data??"0x",value:e.value?GO(e.value,"bigint"):0n},t);return await this.waitForUserOperationTransaction(n)}}),Object.defineProperty(this,"signMessage",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(!this.account)throw new Error("account not connected!");return this.account.signMessage(e)}}),Object.defineProperty(this,"signTypedData",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(!this.account)throw new Error("account not connected!");return this.account.signTypedData(e)}}),Object.defineProperty(this,"sendTransactions",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const t=e.map((e=>{if(!e.to)throw new Error("one transaction in the batch is missing a target address");return{target:e.to,data:e.data??"0x",value:e.value?GO(e.value,"bigint"):0n}})),n=(...e)=>{if(e.length)return e.reduce(((e,t)=>e>t?e:t))},r=n(...e.filter((e=>null!=e.maxFeePerGas)).map((e=>GO(e.maxFeePerGas,"bigint")))),s=n(...e.filter((e=>null!=e.maxPriorityFeePerGas)).map((e=>GO(e.maxPriorityFeePerGas,"bigint")))),i={};null!=r&&(i.maxFeePerGas=r),null!=s&&(i.maxPriorityFeePerGas=s);const{hash:a}=await this.sendUserOperation(t,i);return await this.waitForUserOperationTransaction(a)}}),Object.defineProperty(this,"waitForUserOperationTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{for(let t=0;tsetTimeout(e,n)));const r=await this.getUserOperationReceipt(e).catch((()=>null));if(r)return this.getTransaction(r.receipt.transactionHash).then((e=>e.hash))}throw new Error("Failed to find transaction for User Operation")}}),Object.defineProperty(this,"getUserOperationByHash",{enumerable:!0,configurable:!0,writable:!0,value:e=>this.rpcClient.getUserOperationByHash(e)}),Object.defineProperty(this,"getUserOperationReceipt",{enumerable:!0,configurable:!0,writable:!0,value:e=>this.rpcClient.getUserOperationReceipt(e)}),Object.defineProperty(this,"getTransaction",{enumerable:!0,configurable:!0,writable:!0,value:e=>this.rpcClient.getTransaction({hash:e})}),Object.defineProperty(this,"sendUserOperation",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t)=>{if(!this.account)throw new Error("account not connected!");const n=await this.account.getInitCode(),r=await NU(this.dummyPaymasterDataMiddleware,this.feeDataGetter,this.gasEstimator,this.paymasterDataMiddleware,this.customMiddleware??DU,(async e=>({...e,...t})))({initCode:n,sender:this.getAddress(),nonce:this.account.getNonce(),callData:Array.isArray(e)?this.account.encodeBatchExecute(e):this.account.encodeExecute(e.target,e.value??0n,e.data),signature:this.account.getDummySignature()}),s=FU(await RU(r));if(!function(e){return!!(e.callGasLimit&&e.maxFeePerGas&&null!=e.maxPriorityFeePerGas&&e.preVerificationGas&&e.verificationGasLimit)}(s))throw new Error(`Request is missing parameters. All properties on UserOperationStruct must be set. uo: ${JSON.stringify(s,null,2)}`);return s.signature=await this.account.signMessage(jU(s,this.entryPointAddress,BigInt(this.chain.id))),{hash:await this.rpcClient.sendUserOperation(s,this.entryPointAddress),request:s}}}),Object.defineProperty(this,"dummyPaymasterDataMiddleware",{enumerable:!0,configurable:!0,writable:!0,value:async e=>(e.paymasterAndData="0x",e)}),Object.defineProperty(this,"paymasterDataMiddleware",{enumerable:!0,configurable:!0,writable:!0,value:async e=>(e.paymasterAndData="0x",e)}),Object.defineProperty(this,"gasEstimator",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const t=FU(await RU(e)),n=await this.rpcClient.estimateUserOperationGas(t,this.entryPointAddress);return e.callGasLimit=n.callGasLimit,e.verificationGasLimit=n.verificationGasLimit,e.preVerificationGas=n.preVerificationGas,e}}),Object.defineProperty(this,"feeDataGetter",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const t=await this.rpcClient.getMaxPriorityFeePerGas(),n=await this.rpcClient.getFeeData();if(!n.maxFeePerGas||!n.maxPriorityFeePerGas)throw new Error("feeData is missing maxFeePerGas or maxPriorityFeePerGas");let r=4n*BigInt(t)/3n;r{UU(this,"dummyPaymasterDataMiddleware",e.dummyPaymasterDataMiddleware?this.overrideMiddlewareFunction(e.dummyPaymasterDataMiddleware):this.dummyPaymasterDataMiddleware);return UU(this,"paymasterDataMiddleware",e.paymasterDataMiddleware?this.overrideMiddlewareFunction(e.paymasterDataMiddleware):this.paymasterDataMiddleware),this}}),Object.defineProperty(this,"withGasEstimator",{enumerable:!0,configurable:!0,writable:!0,value:e=>(UU(this,"gasEstimator",this.overrideMiddlewareFunction(e)),this)}),Object.defineProperty(this,"withFeeDataGetter",{enumerable:!0,configurable:!0,writable:!0,value:e=>(UU(this,"feeDataGetter",this.overrideMiddlewareFunction(e)),this)}),Object.defineProperty(this,"withCustomMiddleware",{enumerable:!0,configurable:!0,writable:!0,value:e=>(UU(this,"customMiddleware",e),this)}),Object.defineProperty(this,"overrideMiddlewareFunction",{enumerable:!0,configurable:!0,writable:!0,value:e=>async t=>({...t,...await e(t)})}),this.txMaxRetries=s?.txMaxRetries??5,this.txRetryIntervalMs=s?.txRetryIntervalMs??2e3,this.txRetryMulitplier=s?.txRetryMulitplier??1.5,this.minPriorityFeePerBid=s?.minPriorityFeePerBid??zU.get(n.id)??100000000n,this.rpcClient="string"==typeof e?CU({chain:n,rpcUrl:e}):e}signMessageWith6492(e){if(!this.account)throw new Error("account not connected!");return this.account.signMessageWith6492(e)}signTypedDataWith6492(e){if(!this.account)throw new Error("account not connected!");return this.account.signTypedDataWith6492(e)}connect(e){const t=e(this.rpcClient);return UU(this,"account",t),this.emit("connect",{chainId:BO(this.chain.id)}),t.getAddress().then((e=>this.emit("accountsChanged",[e]))),this}disconnect(){return this.account&&(this.emit("disconnect"),this.emit("accountsChanged",[])),UU(this,"account",void 0),this}isConnected(){return void 0!==this.account}}let GU=class e extends Error{constructor(t,n={}){const r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof e&&n.cause.docsPath||n.docsPath;super([t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...r?[`Details: ${r}`]:[],"Version: abitype@0.9.8"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}};function qU(e,t){const n=e.exec(t);return n?.groups}const $U=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,VU=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,WU=/^\(.+?\).*?$/,ZU=/^tuple(?(\[(\d*)\])*)$/;function QU(e){let t=e.type;if(ZU.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function JU(e){return YU.test(e)}function XU(e){return qU(YU,e)}const eD=new Set(["memory","indexed","storage","calldata"]),tD=new Set(["calldata","memory","storage"]);class nD extends GU{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class rD extends GU{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class sD extends GU{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human.html#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class iD extends GU{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class aD extends GU{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class oD extends GU{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class cD extends GU{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class lD extends GU{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class uD extends GU{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class dD extends GU{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class hD extends GU{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class pD extends GU{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}const fD=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),mD=/^(?[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,bD=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,gD=/^u?int$/;function yD(e,t){const n=function(e,t){return t?`${t}:${e}`:e}(e,t?.type);if(fD.has(n))return fD.get(n);const r=WU.test(e),s=qU(r?bD:mD,e);if(!s)throw new iD({param:e});if(s.name&&function(e){return"address"===e||"bool"===e||"function"===e||"string"===e||"tuple"===e||$U.test(e)||VU.test(e)||xD.test(e)}(s.name))throw new aD({param:e,name:s.name});const i=s.name?{name:s.name}:{},a="indexed"===s.modifier?{indexed:!0}:{},o=t?.structs??{};let c,l={};if(r){c="tuple";const e=vD(s.type),t=[],n=e.length;for(let r=0;r[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function ED(e,t,n=new Set){const r=[],s=e.length;for(let i=0;ie[t.name||n]?.(r)??t(e,r)}function PD(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new XD(e.type);return`${e.name}(${_D(e.inputs,{includeName:t})})`}function _D(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${_D(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}function SD(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function ID(e){return SD(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}let BD=class e extends Error{constructor(t,n={}){super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"viem@1.21.3"});const r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof e&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://viem.sh${s}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join("\n"),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(e){return TD(this,e)}};function TD(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?TD(e.cause,t):t?null:e}class MD extends BD{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class OD extends BD{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}let ND=class extends BD{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${_D(t,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=n}},RD=class extends BD{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}},FD=class extends BD{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}},jD=class extends BD{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${ID(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}},LD=class extends BD{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}},UD=class extends BD{constructor(e,{docsPath:t}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}};class DD extends BD{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class zD extends BD{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class HD extends BD{constructor(e,{docsPath:t}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}let GD=class extends BD{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}},qD=class extends BD{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}};class $D extends BD{constructor(e,{docsPath:t}){super([`Encoded function signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionSignatureNotFoundError"})}}let VD=class extends BD{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${PD(e.abiItem)}\`, and`,`\`${t.type}\` in \`${PD(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}};class WD extends BD{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class ZD extends BD{constructor({abiItem:e,data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for non-indexed event parameters.`].join("\n"),{metaMessages:[`Params: (${_D(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=n,this.size=r}}class QD extends BD{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${PD(e,{includeName:!0})}".`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}let KD=class extends BD{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}},YD=class extends BD{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}},JD=class extends BD{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}},XD=class extends BD{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}};class ez extends BD{constructor(e){super(`Type "${e}" is not supported for packed encoding.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedPackedAbiType"})}}class tz extends BD{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}let nz=class extends BD{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}},rz=class extends BD{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}};function sz(e,{dir:t,size:n=32}={}){return"string"==typeof e?iz(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new rz({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s2*n)throw new rz({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}let az=class extends BD{constructor({max:e,min:t,signed:n,size:r,value:s}){super(`Number "${s}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}},oz=class extends BD{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}};class cz extends BD{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexBooleanError"})}}let lz=class extends BD{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}};function uz(e,{dir:t="left"}={}){let n="string"==typeof e?e.replace("0x",""):e,r=0;for(let e=0;et)throw new lz({givenSize:ID(e),maxSize:t})}function hz(e,t){const n={to:t},r=n.to;return"number"===r?mz(e,n):"bigint"===r?pz(e,n):"string"===r?bz(e,n):"boolean"===r?fz(e,n):Sz(e,n)}function pz(e,t={}){const{signed:n}=t;t.size&&dz(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2;return r<=(1n<<8n*BigInt(s)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*s,"f")}`)-1n}function fz(e,t={}){let n=e;if(t.size&&(dz(n,{size:t.size}),n=uz(n)),"0x00"===uz(n))return!1;if("0x01"===uz(n))return!0;throw new cz(n)}function mz(e,t={}){return Number(pz(e,t))}function bz(e,t={}){let n=Sz(e);return t.size&&(dz(n,{size:t.size}),n=uz(n,{dir:"right"})),(new TextDecoder).decode(n)}const gz=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function yz(e,t={}){return"number"==typeof e||"bigint"==typeof e?xz(e,t):"string"==typeof e?Ez(e,t):"boolean"==typeof e?vz(e,t):wz(e,t)}function vz(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(dz(n,{size:t.size}),sz(n,{size:t.size})):n}function wz(e,t={}){let n="";for(let t=0;ti||s=Pz.zero&&e<=Pz.nine?e-Pz.zero:e>=Pz.A&&e<=Pz.F?e-(Pz.A-10):e>=Pz.a&&e<=Pz.f?e-(Pz.a-10):void 0}function Sz(e,t={}){let n=e;t.size&&(dz(n,{size:t.size}),n=sz(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,i=new Uint8Array(s);for(let e=0,t=0;e{var t;return function(e){let t=!0,n="",r=0,s="",i=!1;for(let a=0;a0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Oz(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Nz(e,t){Mz(e);const n=t.outputLen;if(e.length>Fz&Rz)}:{h:0|Number(e>>Fz&Rz),l:0|Number(e&Rz)}}function Lz(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;se instanceof Uint8Array,zz=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Hz=(e,t)=>e<<32-t|e>>>t;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function Gz(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!Dz(e))throw new Error("expected Uint8Array, got "+typeof e);return e}let qz=class{clone(){return this._cloneInto()}};function $z(e){const t=t=>e().update(Gz(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Vz(e=32){if(Uz&&"function"==typeof Uz.getRandomValues)return Uz.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const[Wz,Zz,Qz]=[[],[],[]],Kz=BigInt(0),Yz=BigInt(1),Jz=BigInt(2),Xz=BigInt(7),eH=BigInt(256),tH=BigInt(113);for(let e=0,t=Yz,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Wz.push(2*(5*r+n)),Zz.push((e+1)*(e+2)/2%64);let s=Kz;for(let e=0;e<7;e++)t=(t<>Xz)*tH)%eH,t&Jz&&(s^=Yz<<(Yz<n>32?((e,t,n)=>t<>>64-n)(e,t,n):((e,t,n)=>e<>>32-n)(e,t,n),iH=(e,t,n)=>n>32?((e,t,n)=>e<>>64-n)(e,t,n):((e,t,n)=>t<>>32-n)(e,t,n);let aH=class e extends qz{constructor(e,t,n,r=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Tz(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}keccak(){!function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,s=(t+2)%10,i=n[s],a=n[s+1],o=sH(i,a,1)^n[r],c=iH(i,a,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=c}let t=e[2],s=e[3];for(let n=0;n<24;n++){const r=Zz[n],i=sH(t,s,r),a=iH(t,s,r),o=Wz[n];t=e[o],s=e[o+1],e[o]=i,e[o+1]=a}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=nH[r],e[1]^=rH[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Oz(this);const{blockLen:t,state:n}=this,r=(e=Gz(e)).length;for(let s=0;s=n&&this.keccak();const i=Math.min(n-this.posOut,s-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Tz(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Nz(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:a}=this;return t||(t=new e(n,r,s,a,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=s,t.enableXOF=a,t.destroyed=this.destroyed,t}};const oH=((e,t,n)=>$z((()=>new aH(t,e,n))))(1,136,32);function cH(e,t){const n=t||"hex",r=oH(SD(e,{strict:!1})?Cz(e):e);return"bytes"===n?r:yz(r)}const lH=e=>{return t=(e=>Bz(e))(e),cH(Cz(t));var t};let uH=class extends BD{constructor({address:e}){super(`Address "${e}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}};const dH=/^0x[a-fA-F0-9]{40}$/;function hH(e){return dH.test(e)}function pH(e){return"string"==typeof e[0]?fH(e):function(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(e)}function fH(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}function mH(e,t,n,{strict:r}={}){return SD(e,{strict:!1})?function(e,t,n,{strict:r}={}){bH(e,t);const s=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;r&&gH(s,t,n);return s}(e,t,n,{strict:r}):function(e,t,n,{strict:r}={}){bH(e,t);const s=e.slice(t,n);r&&gH(s,t,n);return s}(e,t,n,{strict:r})}function bH(e,t){if("number"==typeof t&&t>0&&t>ID(e)-1)throw new nz({offset:t,position:"start",size:ID(e)})}function gH(e,t,n){if("number"==typeof t&&"number"==typeof n&&ID(e)!==n-t)throw new nz({offset:n,position:"end",size:ID(e)})}function yH(e,t){if(e.length!==t.length)throw new LD({expectedLength:e.length,givenLength:t.length});const n=function({params:e,values:t}){const n=[];for(let r=0;r0?pH([t,e]):t}}if(s)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:pH(i.map((({encoded:e})=>e)))}}(t,{length:r,param:{...e,type:s}})}if("tuple"===e.type)return function(e,{param:t}){let n=!1;const r=[];for(let s=0;se)))}}(t,{param:e});if("address"===e.type)return function(e){if(!hH(e))throw new uH({address:e});return{dynamic:!1,encoded:iz(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){return{dynamic:!1,encoded:iz(vz(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){return function(e,{signed:t}){return{dynamic:!1,encoded:xz(e,{size:32,signed:t})}}(t,{signed:e.type.startsWith("int")})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),r=ID(e);if(!n){let t=e;return r%32!=0&&(t=iz(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:pH([iz(xz(r,{size:32})),t])}}if(r!==parseInt(n))throw new jD({expectedSize:parseInt(n),value:e});return{dynamic:!1,encoded:iz(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=Ez(e),n=Math.ceil(ID(t)/32),r=[];for(let e=0;emH(cH(Cz(Bz(e))),0,4);function EH({abi:e,args:t=[],name:n}){const r=SD(n,{strict:!1}),s=e.filter((e=>r?"function"===e.type?kH(e)===n:"event"===e.type&&lH(e)===n:"name"in e&&e.name===n));if(0===s.length)return;if(1===s.length)return s[0];let i;for(const e of s){if(!("inputs"in e))continue;if(!t||0===t.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==t.length)continue;const n=t.every(((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&AH(t,r)}));if(n){if(i&&"inputs"in i&&i.inputs){const n=CH(e.inputs,i.inputs,t);if(n)throw new VD({abiItem:e,type:n[0]},{abiItem:i,type:n[1]})}i=e}}return i||s[0]}function AH(e,t){const n=typeof e,r=t.type;switch(r){case"address":return hH(e);case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every(((t,n)=>AH(Object.values(e)[n],t))):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every((e=>AH(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function CH(e,t,n){for(const r in e){const s=e[r],i=t[r];if("tuple"===s.type&&"tuple"===i.type&&"components"in s&&"components"in i)return CH(s.components,i.components,n[r]);const a=[s.type,i.type];if(!(!a.includes("address")||!a.includes("bytes20"))||(a.includes("address")&&a.includes("string")||!(!a.includes("address")||!a.includes("bytes")))&&hH(n[r]))return a}}function PH({abi:e,eventName:t,args:n}){let r=e[0];if(t&&(r=EH({abi:e,args:n,name:t}),!r))throw new HD(t,{docsPath:"/docs/contract/encodeEventTopics"});if("event"!==r.type)throw new HD(void 0,{docsPath:"/docs/contract/encodeEventTopics"});const s=PD(r),i=lH(s);let a=[];if(n&&"inputs"in r){const e=r.inputs?.filter((e=>"indexed"in e&&e.indexed)),t=Array.isArray(n)?n:Object.values(n).length>0?e?.map((e=>n[e.name]))??[]:[];t.length>0&&(a=e?.map(((e,n)=>Array.isArray(t[n])?t[n].map(((r,s)=>_H({param:e,value:t[n][s]}))):t[n]?_H({param:e,value:t[n]}):null))??[])}return[i,...a]}function _H({param:e,value:t}){if("string"===e.type||"bytes"===e.type)return cH(Cz(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new tz(e.type);return yH([e],[t])}function SH(e,{method:t}){const n={};return"fallback"===e.transport.type&&e.transport.onResponse?.((({method:e,response:r,status:s,transport:i})=>{"success"===s&&t===e&&(n[r]=i.request)})),t=>n[t]||e.request}async function IH(e,{address:t,abi:n,args:r,eventName:s,fromBlock:i,strict:a,toBlock:o}){const c=SH(e,{method:"eth_newFilter"}),l=s?PH({abi:n,args:r,eventName:s}):void 0,u=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof i?xz(i):i,toBlock:"bigint"==typeof o?xz(o):o,topics:l}]});return{abi:n,args:r,eventName:s,id:u,request:c(u),strict:a,type:"event"}}function BH(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}function TH({abi:e,args:t,functionName:n}){let r=e[0];if(n&&(r=EH({abi:e,args:t,name:n}),!r))throw new GD(n,{docsPath:"/docs/contract/encodeFunctionData"});if("function"!==r.type)throw new GD(void 0,{docsPath:"/docs/contract/encodeFunctionData"});const s=PD(r);return fH([kH(s),("inputs"in r&&r.inputs?yH(r.inputs,t??[]):void 0)??"0x"])}const MH={1:"An `assert` condition failed.",17:"Arithmic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},OH={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},NH={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function RH(e,t){const n=e.substring(2).toLowerCase(),r=cH(Iz(n),"bytes"),s=n.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&s[e]&&(s[e]=s[e].toUpperCase()),(15&r[e>>1])>=8&&s[e+1]&&(s[e+1]=s[e+1].toUpperCase());return`0x${s.join("")}`}function FH(e,t){if("0x"===t&&e.length>0)throw new RD;if(ID(t)&&ID(t)<32)throw new ND({data:t,params:e,size:ID(t)});return function({data:e,params:t}){const n=[];let r=0;for(let s=0;s=ID(e))throw new ND({data:e,params:t,size:ID(e)});const i=t[s],{consumed:a,value:o}=jH({data:e,param:i,position:r});n.push(o),r+=a}return n}({data:t,params:e})}function jH({data:e,param:t,position:n}){const r=xH(t.type);if(r){const[s,i]=r;return function(e,{param:t,length:n,position:r}){if(!n){const n=mz(mH(e,r,r+32,{strict:!0})),s=mz(mH(e,n,n+32,{strict:!0}));let i=0;const a=[];for(let r=0;r!e)),s=r?[]:{};let i=0;if(LH(t)){const a=mz(mH(e,n,n+32,{strict:!0}));for(let n=0;n48?pz(e,{signed:n}):mz(e,{signed:n})}}(s,{param:t});if("address"===t.type)return function(e){return{consumed:32,value:RH(mH(e,-20))}}(s);if("bool"===t.type)return function(e){return{consumed:32,value:fz(e)}}(s);throw new YD(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function LH(e){const{type:t}=e;if("string"===t)return!0;if("bytes"===t)return!0;if(t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(LH);const n=xH(e.type);return!(!n||!LH({...e,type:n[1]}))}function UH({abi:e,data:t}){const n=mH(t,0,4);if("0x"===n)throw new RD;const r=[...e||[],OH,NH].find((e=>"error"===e.type&&n===kH(PD(e))));if(!r)throw new UD(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:r,args:"inputs"in r&&r.inputs&&r.inputs.length>0?FH(r.inputs,mH(t,4)):void 0,errorName:r.name}}const DH=(e,t,n)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),n);function zH({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map(((e,n)=>`${r&&e.name?`${e.name}: `:""}${"object"==typeof t[n]?DH(t[n]):t[n]}`)).join(", ")})`}const HH={gwei:9,wei:18},GH={ether:-9,wei:9};function qH(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${i?`.${i}`:""}`}function $H(e,t="wei"){return qH(e,HH[t])}function VH(e,t="wei"){return qH(e,GH[t])}function WH(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),n=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`)).join("\n")}let ZH=class extends BD{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}},QH=class extends BD{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}},KH=class extends BD{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",WH(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}},YH=class extends BD{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}};class JH extends BD{constructor({blockHash:e,blockNumber:t,blockTag:n,hash:r,index:s}){let i="Transaction";n&&void 0!==s&&(i=`Transaction at block time "${n}" at index "${s}"`),e&&void 0!==s&&(i=`Transaction at block hash "${e}" at index "${s}"`),t&&void 0!==s&&(i=`Transaction at block number "${t}" at index "${s}"`),r&&(i=`Transaction with hash "${r}"`),super(`${i} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class XH extends BD{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class eG extends BD{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}let tG=class extends BD{constructor(e,{account:t,docsPath:n,chain:r,data:s,gas:i,gasPrice:a,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const h=t?BH(t):void 0,p=WH({from:h?.address,to:u,value:void 0!==d&&`${$H(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:void 0!==a&&`${VH(a)} gwei`,maxFeePerGas:void 0!==o&&`${VH(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${VH(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}},nG=class extends BD{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:s,functionName:i,sender:a}){const o=EH({abi:t,args:n,name:i}),c=o?zH({abiItem:o,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=WH({address:r&&r,function:o?PD(o,{includeName:!0}):void 0,args:c&&"()"!==c&&`${[...Array(i?.length??0).keys()].map((()=>" ")).join("")}${c}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",l].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=t,this.args=n,this.cause=e,this.contractAddress=r,this.functionName=i,this.sender=a}},rG=class extends BD{constructor({abi:e,data:t,functionName:n,message:r}){let s,i,a,o,c;if(t&&"0x"!==t)try{i=UH({abi:e,data:t});const{abiItem:n,errorName:r,args:s}=i;if("Error"===r)o=s[0];else if("Panic"===r){const[e]=s;o=MH[e]}else{const e=n?PD(n,{includeName:!0}):void 0,t=n&&s?zH({abiItem:n,args:s,includeFunctionName:!1,includeName:!1}):void 0;a=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(r?.length??0).keys()].map((()=>" ")).join("")}${t}`:""]}}catch(e){s=e}else r&&(o=r);s instanceof UD&&(c=s.signature,a=[`Unable to decode signature "${c}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${c}.`]),super(o&&"execution reverted"!==o||c?[`The contract function "${n}" reverted with the following ${c?"signature":"reason"}:`,o||c].join("\n"):`The contract function "${n}" reverted.`,{cause:s,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.reason=o,this.signature=c}},sG=class extends BD{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}},iG=class extends BD{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}},aG=class extends BD{constructor({body:e,details:t,headers:n,status:r,url:s}){super("HTTP request failed.",{details:t,metaMessages:[r&&`Status: ${r}`,`URL: ${s}`,e&&`Request body: ${DH(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=r,this.url=s}};class oG extends BD{constructor({body:e,details:t,url:n}){super("WebSocket request failed.",{details:t,metaMessages:[`URL: ${n}`,`Request body: ${DH(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WebSocketRequestError"})}}let cG=class extends BD{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${DH(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}},lG=class extends BD{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${t}`,`Request body: ${DH(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}};let uG=class extends BD{constructor(e,{code:t,docsPath:n,metaMessages:r,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:r||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof cG?e.code:t??-1}};class dG extends uG{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class hG extends uG{constructor(e){super(e,{code:hG.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(hG,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class pG extends uG{constructor(e){super(e,{code:pG.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(pG,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class fG extends uG{constructor(e){super(e,{code:fG.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(fG,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class mG extends uG{constructor(e){super(e,{code:mG.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(mG,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});let bG=class e extends uG{constructor(t){super(t,{code:e.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}};Object.defineProperty(bG,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class gG extends uG{constructor(e){super(e,{code:gG.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(gG,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class yG extends uG{constructor(e){super(e,{code:yG.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(yG,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class vG extends uG{constructor(e){super(e,{code:vG.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(vG,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class wG extends uG{constructor(e){super(e,{code:wG.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(wG,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class xG extends uG{constructor(e){super(e,{code:xG.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(xG,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class kG extends uG{constructor(e){super(e,{code:kG.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(kG,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class EG extends uG{constructor(e){super(e,{code:EG.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(EG,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class AG extends dG{constructor(e){super(e,{code:AG.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(AG,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class CG extends dG{constructor(e){super(e,{code:CG.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(CG,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class PG extends dG{constructor(e){super(e,{code:PG.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(PG,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class _G extends dG{constructor(e){super(e,{code:_G.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(_G,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class SG extends dG{constructor(e){super(e,{code:SG.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(SG,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class IG extends dG{constructor(e){super(e,{code:IG.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(IG,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class BG extends uG{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const TG=3;function MG(e,{abi:t,address:n,args:r,docsPath:s,functionName:i,sender:a}){const{code:o,data:c,message:l,shortMessage:u}=e instanceof iG?e:e instanceof BD?e.walk((e=>"data"in e))||e.walk():{},d=e instanceof RD?new sG({functionName:i}):[TG,bG.code].includes(o)&&(c||l||u)?new rG({abi:t,data:"object"==typeof c?c.data:c,functionName:i,message:u??l}):e;return new nG(d,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:i,sender:a})}class OG extends BD{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join("\n"),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}class NG extends BD{constructor(e,{account:t,docsPath:n,chain:r,data:s,gas:i,gasPrice:a,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const h=WH({from:t?.address,to:u,value:void 0!==d&&`${$H(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:void 0!==a&&`${VH(a)} gwei`,maxFeePerGas:void 0!==o&&`${VH(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${VH(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}let RG=class extends BD{constructor({cause:e,message:t}={}){const n=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}};Object.defineProperty(RG,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(RG,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});let FG=class extends BD{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${VH(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}};Object.defineProperty(FG,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});let jG=class extends BD{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${VH(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}};Object.defineProperty(jG,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});let LG=class extends BD{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}};Object.defineProperty(LG,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});let UG=class extends BD{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}};Object.defineProperty(UG,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});let DG=class extends BD{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}};Object.defineProperty(DG,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});let zG=class extends BD{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}};Object.defineProperty(zG,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});let HG=class extends BD{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}};Object.defineProperty(HG,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});let GG=class extends BD{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}};Object.defineProperty(GG,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});let qG=class extends BD{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}};Object.defineProperty(qG,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});let $G=class extends BD{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${VH(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${VH(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}};Object.defineProperty($G,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});let VG=class extends BD{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}};function WG(e,t){const n=(e.details||"").toLowerCase(),r=e.walk((e=>e.code===RG.code));return r instanceof BD?new RG({cause:e,message:r.details}):RG.nodeMessage.test(n)?new RG({cause:e,message:e.details}):FG.nodeMessage.test(n)?new FG({cause:e,maxFeePerGas:t?.maxFeePerGas}):jG.nodeMessage.test(n)?new jG({cause:e,maxFeePerGas:t?.maxFeePerGas}):LG.nodeMessage.test(n)?new LG({cause:e,nonce:t?.nonce}):UG.nodeMessage.test(n)?new UG({cause:e,nonce:t?.nonce}):DG.nodeMessage.test(n)?new DG({cause:e,nonce:t?.nonce}):zG.nodeMessage.test(n)?new zG({cause:e}):HG.nodeMessage.test(n)?new HG({cause:e,gas:t?.gas}):GG.nodeMessage.test(n)?new GG({cause:e,gas:t?.gas}):qG.nodeMessage.test(n)?new qG({cause:e}):$G.nodeMessage.test(n)?new $G({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new VG({cause:e})}function ZG(e,{format:t}){if(!t)return{};const n={};return function t(r){const s=Object.keys(r);for(const i of s)i in e&&(n[i]=e[i]),r[i]&&"object"==typeof r[i]&&!Array.isArray(r[i])&&t(r[i])}(t(e||{})),n}function QG(e,t){return({exclude:n,format:r})=>({exclude:n,format:e=>{const s=t(e);if(n)for(const e of n)delete s[e];return{...s,...r(e)}},type:e})}const KG={legacy:"0x0",eip2930:"0x1",eip1559:"0x2"};function YG(e){return{...e,gas:void 0!==e.gas?xz(e.gas):void 0,gasPrice:void 0!==e.gasPrice?xz(e.gasPrice):void 0,maxFeePerGas:void 0!==e.maxFeePerGas?xz(e.maxFeePerGas):void 0,maxPriorityFeePerGas:void 0!==e.maxPriorityFeePerGas?xz(e.maxPriorityFeePerGas):void 0,nonce:void 0!==e.nonce?xz(e.nonce):void 0,type:void 0!==e.type?KG[e.type]:void 0,value:void 0!==e.value?xz(e.value):void 0}}const JG=QG("transactionRequest",YG);function XG(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:i}=e,a=t?BH(t):void 0;if(a&&!hH(a.address))throw new uH({address:a.address});if(i&&!hH(i))throw new uH({address:i});if(void 0!==n&&(void 0!==r||void 0!==s))throw new ZH;if(r&&r>2n**256n-1n)throw new FG({maxFeePerGas:r});if(s&&r&&s>r)throw new $G({maxFeePerGas:r,maxPriorityFeePerGas:s})}class eq extends BD{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}let tq=class extends BD{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}};class nq extends BD{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${VH(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class rq extends BD{constructor({blockHash:e,blockNumber:t}){let n="Block";e&&(n=`Block at hash "${e}"`),t&&(n=`Block at number "${t}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}const sq={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559"};function iq(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?mz(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?mz(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?sq[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof t.v){if(0n===t.v||27n===t.v)return 0;if(1n===t.v||28n===t.v)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),"eip2930"===t.type&&(delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t}const aq=QG("transaction",iq);function oq(e){const t=e.transactions?.map((e=>"string"==typeof e?e:iq(e)));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,difficulty:e.difficulty?BigInt(e.difficulty):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const cq=QG("block",oq);async function lq(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:s}={}){const i=r??"latest",a=s??!1,o=void 0!==n?xz(n):void 0;let c=null;if(c=t?await e.request({method:"eth_getBlockByHash",params:[t,a]}):await e.request({method:"eth_getBlockByNumber",params:[o||i,a]}),!c)throw new rq({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||oq)(c)}async function uq(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function dq(e,t){const{block:n,chain:r=e.chain,request:s}=t||{};if("function"==typeof r?.fees?.defaultPriorityFee){const t=n||await CD(e,lq,"getBlock")({});return r.fees.defaultPriorityFee({block:t,client:e,request:s})}if(void 0!==r?.fees?.defaultPriorityFee)return r?.fees?.defaultPriorityFee;try{return pz(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,r]=await Promise.all([n?Promise.resolve(n):CD(e,lq,"getBlock")({}),CD(e,uq,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new tq;const s=r-t.baseFeePerGas;return s<0n?0n:s}}async function hq(e,t){const{block:n,chain:r=e.chain,request:s,type:i="eip1559"}=t||{},a=await(async()=>"function"==typeof r?.fees?.baseFeeMultiplier?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):r?.fees?.baseFeeMultiplier??1.2)();if(a<1)throw new eq;const o=10**(a.toString().split(".")[1]?.length??0),c=e=>e*BigInt(Math.ceil(a*o))/BigInt(o),l=n||await CD(e,lq,"getBlock")({});if("function"==typeof r?.fees?.estimateFeesPerGas)return r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:s,type:i});if("eip1559"===i){if("bigint"!=typeof l.baseFeePerGas)throw new tq;const t=s?.maxPriorityFeePerGas?s.maxPriorityFeePerGas:await dq(e,{block:l,chain:r,request:s}),n=c(l.baseFeePerGas);return{maxFeePerGas:s?.maxFeePerGas??n+t,maxPriorityFeePerGas:t}}return{gasPrice:s?.gasPrice??c(await CD(e,uq,"getGasPrice")({}))}}async function pq(e,{address:t,blockTag:n="latest",blockNumber:r}){return mz(await e.request({method:"eth_getTransactionCount",params:[t,r?xz(r):n]}))}function fq(e){if(e.type)return e.type;if(void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas)return"eip1559";if(void 0!==e.gasPrice)return void 0!==e.accessList?"eip2930":"legacy";throw new KH({transaction:e})}async function mq(e,t){const{account:n=e.account,chain:r,gas:s,nonce:i,type:a}=t;if(!n)throw new OG;const o=BH(n),c=await CD(e,lq,"getBlock")({blockTag:"latest"}),l={...t,from:o.address};if(void 0===i&&(l.nonce=await CD(e,pq,"getTransactionCount")({address:o.address,blockTag:"pending"})),void 0===a)try{l.type=fq(l)}catch{l.type="bigint"==typeof c.baseFeePerGas?"eip1559":"legacy"}if("eip1559"===l.type){const{maxFeePerGas:n,maxPriorityFeePerGas:s}=await hq(e,{block:c,chain:r,request:l});if(void 0===t.maxPriorityFeePerGas&&t.maxFeePerGas&&t.maxFeePerGas{const t=WG(e,n);return t instanceof VG?e:t})();return new NG(r,{docsPath:t,...n})}(n,{...t,account:r,chain:e.chain})}}const gq="/docs/contract/decodeEventLog";function yq({abi:e,data:t,strict:n,topics:r}){const s=n??!0,[i,...a]=r;if(!i)throw new DD({docsPath:gq});const o=e.find((e=>"event"===e.type&&i===lH(PD(e))));if(!o||!("name"in o)||"event"!==o.type)throw new zD(i,{docsPath:gq});const{name:c,inputs:l}=o,u=l?.some((e=>!("name"in e&&e.name)));let d=u?[]:{};const h=l.filter((e=>"indexed"in e&&e.indexed));for(let e=0;e!("indexed"in e&&e.indexed)));if(p.length>0)if(t&&"0x"!==t)try{const e=FH(p,t);if(e)if(u)d=[...d,...e];else for(let t=0;t0?d:void 0}}function vq({param:e,value:t}){if("string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))return t;return(FH([e],t)||[])[0]}function wq(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}async function xq(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:i,events:a,args:o,strict:c}={}){const l=c??!1,u=a??(i?[i]:void 0);let d,h=[];return u&&(h=[u.flatMap((e=>PH({abi:[e],eventName:e.name,args:o})))],i&&(h=h[0])),d=n?await e.request({method:"eth_getLogs",params:[{address:t,topics:h,blockHash:n}]}):await e.request({method:"eth_getLogs",params:[{address:t,topics:h,fromBlock:"bigint"==typeof r?xz(r):r,toBlock:"bigint"==typeof s?xz(s):s}]}),d.map((e=>{try{const{eventName:t,args:n}=u?yq({abi:u,data:e.data,topics:e.topics,strict:l}):{eventName:void 0,args:void 0};return wq(e,{args:n,eventName:t})}catch(t){let n,r;if(t instanceof ZD||t instanceof QD){if(l)return;n=t.abiItem.name,r=t.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return wq(e,{args:r?[]:{},eventName:n})}})).filter(Boolean)}async function kq(e,{abi:t,address:n,args:r,blockHash:s,eventName:i,fromBlock:a,toBlock:o,strict:c}){const l=i?EH({abi:t,name:i}):void 0,u=l?void 0:t.filter((e=>"event"===e.type));return CD(e,xq,"getLogs")({address:n,args:r,blockHash:s,event:l,events:u,fromBlock:a,toBlock:o,strict:c})}const Eq="/docs/contract/decodeFunctionResult";function Aq({abi:e,args:t,functionName:n,data:r}){let s=e[0];if(n&&(s=EH({abi:e,args:t,name:n}),!s))throw new GD(n,{docsPath:Eq});if("function"!==s.type)throw new GD(void 0,{docsPath:Eq});if(!s.outputs)throw new qD(s.name,{docsPath:Eq});const i=FH(s.outputs,r);return i&&i.length>1?i:i&&1===i.length?i[0]:void 0}const Cq=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],Pq=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"}],_q=[...Pq,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Sq=[...Pq,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],Iq=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Bq=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],Tq=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],Mq="0x82ad56cb";let Oq=class extends BD{constructor({blockNumber:e,chain:t,contract:n}){super(`Chain "${t.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}},Nq=class extends BD{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}},Rq=class extends BD{constructor({chainId:e}){super(`Chain ID "${e}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}};function Fq({blockNumber:e,chain:t,contract:n}){const r=t?.contracts?.[n];if(!r)throw new Oq({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new Oq({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const jq=new Map;function Lq({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const i=async()=>{const t=o();a();const n=t.map((({args:e})=>e));0!==n.length&&e(n).then((e=>{s&&Array.isArray(e)&&e.sort(s);for(let n=0;n{for(let n=0;njq.delete(t),o=()=>jq.get(t)||[],c=e=>jq.set(t,[...o(),e]);return{flush:a,async schedule(e){const t={},s=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),a=n?.([...o().map((({args:e})=>e)),e]);a&&i();return o().length>0?(c({args:e,pendingPromise:t}),s):(c({args:e,pendingPromise:t}),setTimeout(i,r),s)}}}async function Uq(e,t){const{account:n=e.account,batch:r=Boolean(e.batch?.multicall),blockNumber:s,blockTag:i="latest",accessList:a,data:o,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:h,to:p,value:f,...m}=t,b=n?BH(n):void 0;try{XG(t);const n=(s?xz(s):void 0)||i,g=e.chain?.formatters?.transactionRequest?.format,y=(g||YG)({...ZG(m,{format:g}),from:b?.address,accessList:a,data:o,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:h,to:p,value:f});if(r&&function({request:e}){const{data:t,to:n,...r}=e;return!!t&&(!t.startsWith(Mq)&&(!!n&&!(Object.values(r).filter((e=>void 0!==e)).length>0)))}({request:y}))try{return await async function(e,t){const{batchSize:n=1024,wait:r=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockNumber:s,blockTag:i="latest",data:a,multicallAddress:o,to:c}=t;let l=o;if(!l){if(!e.chain)throw new Nq;l=Fq({blockNumber:s,chain:e.chain,contract:"multicall3"})}const u=s?xz(s):void 0,d=u||i,{schedule:h}=Lq({id:`${e.uid}.${d}`,wait:r,shouldSplitBatch(e){const t=e.reduce(((e,{data:t})=>e+(t.length-2)),0);return t>2*n},fn:async t=>{const n=t.map((e=>({allowFailure:!0,callData:e.data,target:e.to}))),r=TH({abi:Cq,args:[n],functionName:"aggregate3"}),s=await e.request({method:"eth_call",params:[{data:r,to:l},d]});return Aq({abi:Cq,args:[n],functionName:"aggregate3",data:s||"0x"})}}),[{returnData:p,success:f}]=await h({data:a,to:c});if(!f)throw new iG({data:p});return"0x"===p?{data:void 0}:{data:p}}(e,{...y,blockNumber:s,blockTag:i})}catch(e){if(!(e instanceof Nq||e instanceof Oq))throw e}const v=await e.request({method:"eth_call",params:n?[y,n]:[y]});return"0x"===v?{data:void 0}:{data:v}}catch(n){const r=function(e){if(!(e instanceof BD))return;const t=e.walk();return"object"==typeof t.data?t.data.data:t.data}(n),{offchainLookup:s,offchainLookupSignature:i}=await Promise.resolve().then((function(){return H$}));if(r?.slice(0,10)===i&&p)return{data:await s(e,{data:r,to:p})};throw function(e,{docsPath:t,...n}){const r=(()=>{const t=WG(e,n);return t instanceof VG?e:t})();return new tG(r,{docsPath:t,...n})}(n,{...t,account:b,chain:e.chain})}}async function Dq(e,{abi:t,address:n,args:r,functionName:s,...i}){const a=TH({abi:t,args:r,functionName:s});try{const{data:o}=await CD(e,Uq,"call")({data:a,to:n,...i});return Aq({abi:t,args:r,functionName:s,data:o||"0x"})}catch(e){throw MG(e,{abi:t,address:n,args:r,docsPath:"/docs/contract/readContract",functionName:s})}}const zq=new Map,Hq=new Map;let Gq=0;function qq(e,t,n){const r=++Gq,s=()=>zq.get(e)||[],i=()=>{const t=Hq.get(e);1===s().length&&t&&t(),(()=>{const t=s();zq.set(e,t.filter((e=>e.id!==r)))})()},a=s();if(zq.set(e,[...a,{id:r,fns:t}]),a&&a.length>0)return i;const o={};for(const e in t)o[e]=(...t)=>{const n=s();if(0!==n.length)for(const r of n)r.fns[e]?.(...t)};const c=n(o);return"function"==typeof c&&Hq.set(e,c),i}async function $q(e){return new Promise((t=>setTimeout(t,e)))}function Vq(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let s=!0;const i=()=>s=!1;return(async()=>{let a;t&&(a=await e({unpoll:i}));const o=await(n?.(a))??r;await $q(o);const c=async()=>{s&&(await e({unpoll:i}),await $q(r),c())};c()})(),i}const Wq=new Map,Zq=new Map;async function Qq(e,{cacheKey:t,cacheTime:n=1/0}){const r=function(e){const t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:n=>t.set(e,n)}),n=t(e,Wq),r=t(e,Zq);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}(t),s=r.response.get();if(s&&n>0){if((new Date).getTime()-s.created.getTime()`blockNumber.${e}`;async function Yq(e,{cacheTime:t=e.cacheTime,maxAge:n}={}){const r=await Qq((()=>e.request({method:"eth_blockNumber"})),{cacheKey:Kq(e.uid),cacheTime:n??t});return BigInt(r)}async function Jq(e,{filter:t}){const n="strict"in t&&t.strict;return(await t.request({method:"eth_getFilterChanges",params:[t.id]})).map((e=>{if("string"==typeof e)return e;try{const{eventName:r,args:s}="abi"in t&&t.abi?yq({abi:t.abi,data:e.data,topics:e.topics,strict:n}):{eventName:void 0,args:void 0};return wq(e,{args:s,eventName:r})}catch(n){let r,s;if(n instanceof ZD||n instanceof QD){if("strict"in t&&t.strict)return;r=n.abiItem.name,s=n.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return wq(e,{args:s?[]:{},eventName:r})}})).filter(Boolean)}async function Xq(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}const e$=256;let t$,n$=e$;function r$(e=11){if(!t$||n$+e>2*e$){t$="",n$=0;for(let e=0;e!0}={}){return new Promise(((s,i)=>{const a=async({count:o=0}={})=>{try{const t=await e();s(t)}catch(e){if(o{const n="function"==typeof t?t({count:o,error:e}):t;n&&await $q(n),a({count:o+1})})({error:e});i(e)}};a()}))}const i$=e=>"code"in e?-1!==e.code&&-32004!==e.code&&-32005!==e.code&&-32042!==e.code&&-32603!==e.code:!!(e instanceof aG&&e.status)&&(403!==e.status&&408!==e.status&&413!==e.status&&429!==e.status&&500!==e.status&&502!==e.status&&503!==e.status&&504!==e.status);function a$(e,{retryDelay:t=150,retryCount:n=3}={}){return async r=>s$((async()=>{try{return await e(r)}catch(e){const t=e;switch(t.code){case hG.code:throw new hG(t);case pG.code:throw new pG(t);case fG.code:throw new fG(t);case mG.code:throw new mG(t);case bG.code:throw new bG(t);case gG.code:throw new gG(t);case yG.code:throw new yG(t);case vG.code:throw new vG(t);case wG.code:throw new wG(t);case xG.code:throw new xG(t);case kG.code:throw new kG(t);case EG.code:throw new EG(t);case AG.code:throw new AG(t);case CG.code:throw new CG(t);case PG.code:throw new PG(t);case _G.code:throw new _G(t);case SG.code:throw new SG(t);case IG.code:throw new IG(t);case 5e3:throw new AG(t);default:if(e instanceof BD)throw e;throw new BG(t)}}}),{delay:({count:e,error:n})=>{if(n&&n instanceof aG){const e=n?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*parseInt(e)}return(1<!i$(e)})}function o$({key:e,name:t,request:n,retryCount:r=3,retryDelay:s=150,timeout:i,type:a},o){return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:s,timeout:i,type:a},request:a$(n,{retryCount:r,retryDelay:s}),value:o}}function c$(e,t={}){const{key:n="custom",name:r="Custom Provider",retryDelay:s}=t;return({retryCount:i})=>o$({key:n,name:r,request:e.request.bind(e),retryCount:t.retryCount??i,retryDelay:s,type:"custom"})}class l$ extends BD{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function u$(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise(((s,i)=>{(async()=>{let a;try{const o=new AbortController;n>0&&(a=setTimeout((()=>{r?o.abort():i(t)}),n)),s(await e({signal:o?.signal}))}catch(e){"AbortError"===e.name&&i(t),i(e)}finally{clearTimeout(a)}})()}))}let d$=0;const h$={http:async function(e,{body:t,fetchOptions:n={},timeout:r=1e4}){const{headers:s,method:i,signal:a}=n;try{const o=await u$((async({signal:o})=>await fetch(e,{...n,body:Array.isArray(t)?DH(t.map((e=>({jsonrpc:"2.0",id:e.id??d$++,...e})))):DH({jsonrpc:"2.0",id:t.id??d$++,...t}),headers:{...s,"Content-Type":"application/json"},method:i||"POST",signal:a||(r>0?o:void 0)})),{errorInstance:new lG({body:t,url:e}),timeout:r,signal:!0});let c;if(c=o.headers.get("Content-Type")?.startsWith("application/json")?await o.json():await o.text(),!o.ok)throw new aG({body:t,details:DH(c.error)||o.statusText,headers:o.headers,status:o.status,url:e});return c}catch(n){if(n instanceof aG)throw n;if(n instanceof lG)throw n;throw new aG({body:t,details:n.message,url:e})}},webSocket:function(e,{body:t,onResponse:n}){if(e.readyState===e.CLOSED||e.readyState===e.CLOSING)throw new oG({body:t,url:e.url,details:"Socket is closed."});const r=d$++,s=({data:i})=>{const a=JSON.parse(i);"number"==typeof a.id&&r!==a.id||(n?.(a),"eth_subscribe"===t.method&&"string"==typeof a.result&&e.subscriptions.set(a.result,s),"eth_unsubscribe"===t.method&&e.subscriptions.delete(t.params?.[0]))};return e.requests.set(r,s),e.send(JSON.stringify({jsonrpc:"2.0",...t,id:r})),e},webSocketAsync:async function(e,{body:t,timeout:n=1e4}){return u$((()=>new Promise((n=>h$.webSocket(e,{body:t,onResponse:n})))),{errorInstance:new lG({body:t,url:e.url}),timeout:n})}};function p$(e,t={}){const{batch:n,fetchOptions:r,key:s="http",name:i="HTTP JSON-RPC",retryDelay:a}=t;return({chain:o,retryCount:c,timeout:l})=>{const{batchSize:u=1e3,wait:d=0}="object"==typeof n?n:{},h=t.retryCount??c,p=l??t.timeout??1e4,f=e||o?.rpcUrls.default.http[0];if(!f)throw new l$;return o$({key:s,name:i,async request({method:t,params:s}){const i={method:t,params:s},{schedule:a}=Lq({id:`${e}`,wait:d,shouldSplitBatch:e=>e.length>u,fn:e=>h$.http(f,{body:e,fetchOptions:r,timeout:p}),sort:(e,t)=>e.id-t.id}),[{error:o,result:c}]=await(async e=>n?a(e):[await h$.http(f,{body:e,fetchOptions:r,timeout:p})])(i);if(o)throw new cG({body:i,error:o,url:f});return c},retryCount:h,retryDelay:a,timeout:p,type:"http"},{fetchOptions:r,url:e})}}function f$(e,t){if(!(e instanceof BD))return!1;const n=e.walk((e=>e instanceof rG));return n instanceof rG&&("ResolverNotFound"===n.data?.errorName||("ResolverWildcardNotSupported"===n.data?.errorName||(!!n.reason?.includes("Wildcard on non-extended resolvers is not supported")||"reverse"===t&&n.reason===MH[50])))}function m$(e){if(66!==e.length)return null;if(0!==e.indexOf("["))return null;if(65!==e.indexOf("]"))return null;const t=`0x${e.slice(1,65)}`;return SD(t)?t:null}function b$(e){let t=new Uint8Array(32).fill(0);if(!e)return wz(t);const n=e.split(".");for(let e=n.length-1;e>=0;e-=1){const r=m$(n[e]),s=r?Cz(r):cH(Iz(n[e]),"bytes");t=cH(pH([t,s]),"bytes")}return wz(t)}function g$(e){return`[${e.slice(2)}]`}function y$(e){const t=new Uint8Array(32).fill(0);return e?m$(e)||cH(Iz(e)):wz(t)}function v$(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const n=new Uint8Array(Iz(t).byteLength+2);let r=0;const s=t.split(".");for(let e=0;e255&&(t=Iz(g$(y$(s[e])))),n[r]=t.length,n.set(t,r+1),r+=t.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}let w$=class extends BD{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}},x$=class extends BD{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}},k$=class extends BD{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}},E$=class extends BD{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}};const A$=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,C$=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,P$=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,_$=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function S$(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function I$({uri:e,gatewayUrls:t}){const n=P$.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=S$(t?.ipfs,"https://ipfs.io"),s=S$(t?.arweave,"https://arweave.net"),i=e.match(A$),{protocol:a,subpath:o,target:c,subtarget:l=""}=i?.groups||{},u="ipns:/"===a||"ipns/"===o,d="ipfs:/"===a||"ipfs/"===o||C$.test(e);if(e.startsWith("http")&&!u&&!d){let n=e;return t?.arweave&&(n=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:n,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${r}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===a&&c)return{uri:`${s}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let h=e.replace(_$,"");if(h.startsWith("{const n=new Image;n.onload=()=>{t(!0)},n.onerror=()=>{t(!1)},n.src=e}))}}(n);if(s)return n;throw new k$({uri:t})}async function M$(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?async function(e,{gatewayUrls:t,record:n}){const r=function(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[i,a]=n.split(":"),[o,c]=r.split(":");if(!i||"eip155"!==i.toLowerCase())throw new x$({reason:"Only EIP-155 supported"});if(!a)throw new x$({reason:"Chain ID not found"});if(!c)throw new x$({reason:"Contract address not found"});if(!s)throw new x$({reason:"Token ID not found"});if(!o)throw new x$({reason:"ERC namespace not found"});return{chainID:parseInt(a),namespace:o.toLowerCase(),contractAddress:c,tokenID:s}}(n),s=await async function(e,{nft:t}){if("erc721"===t.namespace)return Dq(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return Dq(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new E$({namespace:t.namespace})}(e,{nft:r}),{uri:i,isOnChain:a,isEncoded:o}=I$({uri:s,gatewayUrls:t});if(a&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){const e=o?atob(i.replace("data:application/json;base64,","")):i;return T$({uri:B$(JSON.parse(e)),gatewayUrls:t})}let c=r.tokenID;"erc1155"===r.namespace&&(c=c.replace("0x","").padStart(64,"0"));return async function({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then((e=>e.json()));return await T$({gatewayUrls:e,uri:B$(n)})}catch{throw new k$({uri:t})}}({gatewayUrls:t,uri:i.replace(/(?:0x)?{id}/,c)})}(e,{gatewayUrls:t,record:n}):T$({uri:n,gatewayUrls:t})}async function O$(e,{blockNumber:t,blockTag:n,name:r,key:s,universalResolverAddress:i}){let a=i;if(!a){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Fq({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const i=await CD(e,Dq,"readContract")({address:a,abi:_q,functionName:"resolve",args:[yz(v$(r)),TH({abi:Iq,functionName:"text",args:[b$(r),s]})],blockNumber:t,blockTag:n});if("0x"===i[0])return null;const o=Aq({abi:Iq,functionName:"text",data:i[0]});return""===o?null:o}catch(e){if(f$(e,"resolve"))return null;throw e}}async function N$(e,{address:t,args:n,event:r,events:s,fromBlock:i,strict:a,toBlock:o}={}){const c=s??(r?[r]:void 0),l=SH(e,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap((e=>PH({abi:[e],eventName:e.name,args:n})))],r&&(u=u[0]));const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof i?xz(i):i,toBlock:"bigint"==typeof o?xz(o):o,...u.length?{topics:u}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:i,id:d,request:l(d),strict:a,toBlock:o,type:"event"}}async function R$(e){const t=SH(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function F$(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const i=n?xz(n):void 0;return function(e){return{baseFeePerGas:e.baseFeePerGas.map((e=>BigInt(e))),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:e.reward?.map((e=>e.map((e=>BigInt(e)))))}}(await e.request({method:"eth_feeHistory",params:[xz(t),i||r,s]}))}let j$=class extends BD{constructor({callbackSelector:e,cause:t,data:n,extraData:r,sender:s,urls:i}){super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],t.metaMessages?.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map((e=>` ${e}`))],` Sender: ${s}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${r}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}},L$=class extends BD{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${t}`,`Response: ${DH(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}},U$=class extends BD{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}};const D$={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function z$({data:e,sender:t,urls:n}){let r=new Error("An unknown error occurred.");for(let s=0;s{for(const n of e){const{name:e,type:r}=n,a=r,o=t[e],c=a.match(V$);if(c&&("number"==typeof o||"bigint"==typeof o)){const[e,t,n]=c;xz(o,{signed:"int"===t,size:parseInt(n)/8})}if("address"===a&&"string"==typeof o&&!hH(o))throw new uH({address:o});const l=a.match($$);if(l){const[e,t]=l;if(t&&ID(o)!==parseInt(t))throw new WD({expectedSize:parseInt(t),givenSize:ID(o)})}const u=s[a];u&&i(u,o)}};s.EIP712Domain&&e&&i(s.EIP712Domain,e);if("EIP712Domain"!==n){const e=s[n];i(e,t)}}({domain:s,message:t,primaryType:n,types:i});const a=["0x1901"];return s&&a.push(function({domain:e,types:t}){return Z$({data:e,primaryType:"EIP712Domain",types:t})}({domain:s,types:i})),"EIP712Domain"!==n&&a.push(Z$({data:t,primaryType:n,types:i})),cH(pH(a))}function Z$({data:e,primaryType:t,types:n}){return cH(Q$({data:e,primaryType:t,types:n}))}function Q$({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],s=[K$({primaryType:t,types:n})];for(const i of n[t]){const[t,a]=J$({types:n,name:i.name,type:i.type,value:e[i.name]});r.push(t),s.push(a)}return yH(r,s)}function K$({primaryType:e,types:t}){const n=yz(function({primaryType:e,types:t}){let n="";const r=Y$({primaryType:e,types:t});r.delete(e);const s=[e,...Array.from(r).sort()];for(const e of s)n+=`${e}(${t[e].map((({name:e,type:t})=>`${t} ${e}`)).join(",")})`;return n}({primaryType:e,types:t}));return cH(n)}function Y$({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),s=r?.[0];if(n.has(s)||void 0===t[s])return n;n.add(s);for(const e of t[s])Y$({primaryType:e.type,types:t},n);return n}function J$({types:e,name:t,type:n,value:r}){if(void 0!==e[n])return[{type:"bytes32"},cH(Q$({data:r,primaryType:n,types:e}))];if("bytes"===n){return[{type:"bytes32"},cH(r=`0x${(r.length%2?"0":"")+r.slice(2)}`)]}if("string"===n)return[{type:"bytes32"},cH(yz(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),i=r.map((n=>J$({name:t,type:s,types:e,value:n})));return[{type:"bytes32"},cH(yH(i.map((([e])=>e)),i.map((([,e])=>e))))]}return[{type:n},r]}function X$({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},"number"==typeof e?.chainId&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function eV({abi:e,data:t}){const n=mH(t,0,4),r=e.find((e=>"function"===e.type&&n===kH(PD(e))));if(!r)throw new $D(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:r.name,args:"inputs"in r&&r.inputs&&r.inputs.length>0?FH(r.inputs,mH(t,4)):void 0}}const tV="/docs/contract/encodeDeployData";function nV({abi:e,args:t,bytecode:n}){if(!t||0===t.length)return n;const r=e.find((e=>"type"in e&&"constructor"===e.type));if(!r)throw new MD({docsPath:tV});if(!("inputs"in r))throw new OD({docsPath:tV});if(!r.inputs||0===r.inputs.length)throw new OD({docsPath:tV});return fH([n,yH(r.inputs,t)])}function rV(e,t,n=!1){if("address"===e){const e=t;if(!hH(e))throw new uH({address:e});return sz(e.toLowerCase(),{size:n?32:null})}if("string"===e)return Ez(t);if("bytes"===e)return t;if("bool"===e)return sz(vz(t),{size:n?32:1});const r=e.match(V$);if(r){const[e,s,i="256"]=r,a=parseInt(i)/8;return xz(t,{size:n?32:a,signed:"int"===s})}const s=e.match($$);if(s){const[e,r]=s;if(parseInt(r)!==(t.length-2)/2)throw new WD({expectedSize:parseInt(r),givenSize:(t.length-2)/2});return sz(t,{dir:"right",size:n?32:null})}const i=e.match(q$);if(i&&Array.isArray(t)){const[e,n]=i,r=[];for(let e=0;ethis.bytes.length-1)throw new iV({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new sV({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},incrementPosition(e){if(e<0)throw new sV({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){const e=this.inspectByte();return this.position++,e},readBytes(e){const t=this.inspectBytes(e);return this.position+=e,t},readUint8(){const e=this.inspectUint8();return this.position+=1,e},readUint16(){const e=this.inspectUint16();return this.position+=2,e},readUint24(){const e=this.inspectUint24();return this.position+=3,e},readUint32(){const e=this.inspectUint32();return this.position+=4,e},setPosition(e){this.assertPosition(e),this.position=e}};function oV(e,t="hex"){const n=cV(e),r=function(e){const t=Object.create(aV);return t.bytes=e,t.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),t}(new Uint8Array(n.length));return n.encode(r),"hex"===t?wz(r.bytes):r.bytes}function cV(e){return Array.isArray(e)?function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=lV(t);return{length:t<=55?1+t:1+n+t,encode(r){t<=55?r.pushByte(192+t):(r.pushByte(247+n),1===n?r.pushUint8(t):2===n?r.pushUint16(t):3===n?r.pushUint24(t):r.pushUint32(t));for(const{encode:t}of e)t(r)}}}(e.map((e=>cV(e)))):function(e){const t="string"==typeof e?Sz(e):e,n=lV(t.length),r=1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length;return{length:r,encode(e){1===t.length&&t[0]<128?e.pushBytes(t):t.length<=55?(e.pushByte(128+t.length),e.pushBytes(t)):(e.pushByte(183+n),1===n?e.pushUint8(t.length):2===n?e.pushUint16(t.length):3===n?e.pushUint24(t.length):e.pushUint32(t.length),e.pushBytes(t))}}}(e)}function lV(e){if(e<256)return 1;if(e<65536)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new BD("Length is too large.")}const uV={"0x0":"reverted","0x1":"success"};function dV(e){return{...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map((e=>wq(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?mz(e.transactionIndex):null,status:e.status?uV[e.status]:null,type:e.type?sq[e.type]||e.type:null}}const hV=QG("transactionReceipt",dV);function pV(e,t){const n={to:t},r=n.to;return"number"===r?function(e,t={}){void 0!==t.size&&dz(e,{size:t.size});const n=wz(e,t);return mz(n)}(e,n):"bigint"===r?function(e,t={}){void 0!==t.size&&dz(e,{size:t.size});const n=wz(e,t);return pz(n)}(e,n):"boolean"===r?function(e,t={}){let n=e;void 0!==t.size&&(dz(n,{size:t.size}),n=uz(n));if(n.length>1||n[0]>1)throw new oz(n);return Boolean(n[0])}(e,n):"string"===r?function(e,t={}){let n=e;void 0!==t.size&&(dz(n,{size:t.size}),n=uz(n,{dir:"right"}));return(new TextDecoder).decode(n)}(e,n):wz(e,n)}let fV=class extends qz{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=zz(this.buffer)}update(e){Oz(this);const{view:t,buffer:n,blockLen:r}=this,s=(e=Gz(e)).length;for(let i=0;ir-i&&(this.process(n,0),i=0);for(let e=i;e>s&i),o=Number(n&i),c=r?4:0,l=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),s),this.process(n,0);const a=zz(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;ee&t^~e&n,bV=(e,t,n)=>e&t^e&n^t&n,gV=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),yV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),vV=new Uint32Array(64);let wV=class extends fV{constructor(){super(64,32,8,!1),this.A=0|yV[0],this.B=0|yV[1],this.C=0|yV[2],this.D=0|yV[3],this.E=0|yV[4],this.F=0|yV[5],this.G=0|yV[6],this.H=0|yV[7]}get(){const{A:e,B:t,C:n,D:r,E:s,F:i,G:a,H:o}=this;return[e,t,n,r,s,i,a,o]}set(e,t,n,r,s,i,a,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|s,this.F=0|i,this.G=0|a,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)vV[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=vV[e-15],n=vV[e-2],r=Hz(t,7)^Hz(t,18)^t>>>3,s=Hz(n,17)^Hz(n,19)^n>>>10;vV[e]=s+vV[e-7]+r+vV[e-16]|0}let{A:n,B:r,C:s,D:i,E:a,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(Hz(a,6)^Hz(a,11)^Hz(a,25))+mV(a,o,c)+gV[e]+vV[e]|0,u=(Hz(n,2)^Hz(n,13)^Hz(n,22))+bV(n,r,s)|0;l=c,c=o,o=a,a=i+t|0,i=s,s=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,s=s+this.C|0,i=i+this.D|0,a=a+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,s,i,a,o,c,l)}roundClean(){vV.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const xV=$z((()=>new wV)),kV="Ethereum Signed Message:\n";function EV(e,t){const n="string"==typeof e?Iz(e):e.raw instanceof Uint8Array?e.raw:Cz(e.raw);return cH(pH([Iz(`${kV}${n.length}`),n]),t)}function AV(e){if(!e||0===e.length)return[];const t=[];for(let n=0;n2n**256n-1n)throw new FG({maxFeePerGas:s});if(n&&s&&n>s)throw new $G({maxFeePerGas:s,maxPriorityFeePerGas:n})}(e);const d=AV(l),h=[yz(n),s?yz(s):"0x",c?yz(c):"0x",o?yz(o):"0x",r?yz(r):"0x",i??"0x",a?yz(a):"0x",u??"0x",d];if(t){const e=0n===t.v?"0x":1n===t.v?yz(1):27n===t.v?"0x":yz(1);h.push(e,uz(t.r),uz(t.s))}return fH(["0x02",oV(h)])}(e,t):"eip2930"===n?function(e,t){const{chainId:n,gas:r,data:s,nonce:i,to:a,value:o,accessList:c,gasPrice:l}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i}=e;if(t<=0)throw new Rq({chainId:t});if(i&&!hH(i))throw new uH({address:i});if(n||s)throw new BD("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new FG({maxFeePerGas:r})}(e);const u=AV(c),d=[yz(n),i?yz(i):"0x",l?yz(l):"0x",r?yz(r):"0x",a??"0x",o?yz(o):"0x",s??"0x",u];if(t){const e=0n===t.v?"0x":1n===t.v?yz(1):27n===t.v?"0x":yz(1);d.push(e,uz(t.r),uz(t.s))}return fH(["0x01",oV(d)])}(e,t):function(e,t){const{chainId:n=0,gas:r,data:s,nonce:i,to:a,value:o,gasPrice:c}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i,accessList:a}=e;if(i&&!hH(i))throw new uH({address:i});if(void 0!==t&&t<=0)throw new Rq({chainId:t});if(n||s)throw new BD("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new FG({maxFeePerGas:r});if(a)throw new BD("`accessList` is not a valid Legacy Transaction attribute.")}(e);let l=[i?yz(i):"0x",c?yz(c):"0x",r?yz(r):"0x",a??"0x",o?yz(o):"0x",s??"0x"];if(t){const e=(()=>{if(n>0)return BigInt(2*n)+BigInt(35n+t.v-27n);if(t.v>=35n){return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n)}const e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new QH({v:t.v});return e})();l=[...l,yz(e),t.r,t.s]}else n>0&&(l=[...l,yz(n),"0x","0x"]);return oV(l)}(e,t)}function PV(e,t){let[n,r="0"]=e.split(".");const s=n.startsWith("-");if(s&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),0===t)1===Math.round(Number(`.${r}`))&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){const[e,s,i]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],a=Math.round(Number(`${s}.${i}`));r=a>9?`${BigInt(e)+BigInt(1)}0`.padStart(e.length+1,"0"):`${e}${a}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${s?"-":""}${n}${r}`)}async function _V(e,{address:t,blockNumber:n,blockTag:r,storageKeys:s}){const i=r??"latest",a=void 0!==n?xz(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?mz(e.nonce):void 0,storageProof:e.storageProof?(t=e.storageProof,t.map((e=>({...e,value:BigInt(e.value)})))):void 0};var t}(await e.request({method:"eth_getProof",params:[t,s,a||i]}))}async function SV(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:i}){const a=r||"latest",o=void 0!==n?xz(n):void 0;let c=null;if(s?c=await e.request({method:"eth_getTransactionByHash",params:[s]}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,xz(i)]}):(o||a)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||a,xz(i)]})),!c)throw new JH({blockHash:t,blockNumber:n,blockTag:a,hash:s,index:i});return(e.chain?.formatters?.transaction?.format||iq)(c)}async function IV(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(!n)throw new XH({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||dV)(n)}const BV="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",TV=BigInt(0),MV=BigInt(1),OV=BigInt(2),NV=e=>e instanceof Uint8Array,RV=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0"))); /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function FV(e){if(!NV(e))throw new Error("Uint8Array expected");let t="";for(let n=0;ne+t.length),0));let n=0;return e.forEach((e=>{if(!NV(e))throw new Error("Uint8Array expected");t.set(e,n),n+=e.length})),t}function VV(e,t){if(e.length!==t.length)return!1;for(let n=0;n(OV<new Uint8Array(e),QV=e=>Uint8Array.from(e);function KV(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=ZV(e),s=ZV(e),i=0;const a=()=>{r.fill(1),s.fill(0),i=0},o=(...e)=>n(s,r,...e),c=(e=ZV())=>{s=o(QV([0]),e),r=o(),0!==e.length&&(s=o(QV([1]),e),r=o())},l=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e{let n;for(a(),c(e);!(n=t(l()));)c();return a(),n}}const YV={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function JV(e,t,n={}){const r=(t,n,r)=>{const s=YV[n];if("function"!=typeof s)throw new Error(`Invalid validator "${n}", expected function`);const i=e[t];if(!(r&&void 0===i||s(i,e)))throw new Error(`Invalid param ${String(t)}=${i} (${typeof i}), expected ${n}`)};for(const[e,n]of Object.entries(t))r(e,n,!1);for(const[e,t]of Object.entries(n))r(e,t,!0);return e}var XV=Object.freeze({__proto__:null,bitGet:function(e,t){return e>>BigInt(t)&MV},bitLen:function(e){let t;for(t=0;e>TV;e>>=MV,t+=1);return t},bitMask:WV,bitSet:(e,t,n)=>e|(n?MV:TV)<Vq((async()=>{try{const t=await CD(e,Yq,"getBlockNumber")({cacheTime:0});if(o){if(t===o)return;if(t-o>1&&n)for(let e=o+1n;eo)&&(r.onBlockNumber(t,o),o=t)}catch(e){r.onError?.(e)}}),{emitOnBegin:t,interval:a}))):(()=>{let t=!0,n=()=>t=!1;return(async()=>{try{const{unsubscribe:i}=await e.transport.subscribe({params:["newHeads"],onData(e){if(!t)return;const n=pz(e.result?.number);r(n,o),o=n},onError(e){s?.(e)}});n=i,t||n()}catch(e){s?.(e)}})(),n})()}function nW(e){return{call:t=>Uq(e,t),createBlockFilter:()=>async function(e){const t=SH(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>IH(e,t),createEventFilter:t=>N$(e,t),createPendingTransactionFilter:()=>R$(e),estimateContractGas:t=>async function(e,{abi:t,address:n,args:r,functionName:s,...i}){const a=TH({abi:t,args:r,functionName:s});try{return await CD(e,bq,"estimateGas")({data:a,to:n,...i})}catch(e){const a=i.account?BH(i.account):void 0;throw MG(e,{abi:t,address:n,args:r,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:a?.address})}}(e,t),estimateGas:t=>bq(e,t),getBalance:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n?xz(n):void 0,i=await e.request({method:"eth_getBalance",params:[t,s||r]});return BigInt(i)}(e,t),getBlock:t=>lq(e,t),getBlockNumber:t=>Yq(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=void 0!==n?xz(n):void 0;let i;return i=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]}),mz(i)}(e,t),getBytecode:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=void 0!==n?xz(n):void 0,i=await e.request({method:"eth_getCode",params:[t,s||r]});if("0x"!==i)return i}(e,t),getChainId:()=>async function(e){return mz(await e.request({method:"eth_chainId"}))}(e),getContractEvents:t=>kq(e,t),getEnsAddress:t=>async function(e,{blockNumber:t,blockTag:n,coinType:r,name:s,universalResolverAddress:i}){let a=i;if(!a){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Fq({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const i=TH({abi:Bq,functionName:"addr",...null!=r?{args:[b$(s),BigInt(r)]}:{args:[b$(s)]}}),o=await CD(e,Dq,"readContract")({address:a,abi:_q,functionName:"resolve",args:[yz(v$(s)),i],blockNumber:t,blockTag:n});if("0x"===o[0])return null;const c=Aq({abi:Bq,args:null!=r?[b$(s),BigInt(r)]:void 0,functionName:"addr",data:o[0]});return"0x"===c||"0x00"===uz(c)?null:c}catch(e){if(f$(e,"resolve"))return null;throw e}}(e,t),getEnsAvatar:t=>async function(e,{blockNumber:t,blockTag:n,gatewayUrls:r,name:s,universalResolverAddress:i}){const a=await CD(e,O$,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:i});if(!a)return null;try{return await M$(e,{record:a,gatewayUrls:r})}catch{return null}}(e,t),getEnsName:t=>async function(e,{address:t,blockNumber:n,blockTag:r,universalResolverAddress:s}){let i=s;if(!i){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=Fq({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const a=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const[s,o]=await CD(e,Dq,"readContract")({address:i,abi:Sq,functionName:"reverse",args:[yz(v$(a))],blockNumber:n,blockTag:r});return t.toLowerCase()!==o.toLowerCase()?null:s}catch(e){if(f$(e,"reverse"))return null;throw e}}(e,t),getEnsResolver:t=>async function(e,{blockNumber:t,blockTag:n,name:r,universalResolverAddress:s}){let i=s;if(!i){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=Fq({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[a]=await CD(e,Dq,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[yz(v$(r))],blockNumber:t,blockTag:n});return a}(e,t),getEnsText:t=>O$(e,t),getFeeHistory:t=>F$(e,t),estimateFeesPerGas:t=>async function(e,t){return hq(e,t)}(e,t),getFilterChanges:e=>Jq(0,e),getFilterLogs:e=>async function(e,{filter:t}){const n=t.strict??!1;return(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map((e=>{try{const{eventName:r,args:s}="abi"in t&&t.abi?yq({abi:t.abi,data:e.data,topics:e.topics,strict:n}):{eventName:void 0,args:void 0};return wq(e,{args:s,eventName:r})}catch(n){let r,s;if(n instanceof ZD||n instanceof QD){if("strict"in t&&t.strict)return;r=n.abiItem.name,s=n.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return wq(e,{args:s?[]:{},eventName:r})}})).filter(Boolean)}(0,e),getGasPrice:()=>uq(e),getLogs:t=>xq(e,t),getProof:t=>_V(e,t),estimateMaxPriorityFeePerGas:t=>async function(e,t){return dq(e,t)}(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest",slot:s}){const i=void 0!==n?xz(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,i||r]})}(e,t),getTransaction:t=>SV(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([CD(e,Yq,"getBlockNumber")({}),t?CD(e,SV,"getBlockNumber")({hash:t}):void 0]),i=n?.blockNumber||s?.blockNumber;return i?r-i+1n:0n}(e,t),getTransactionCount:t=>pq(e,t),getTransactionReceipt:t=>IV(e,t),multicall:t=>async function(e,t){const{allowFailure:n=!0,batchSize:r,blockNumber:s,blockTag:i,contracts:a,multicallAddress:o}=t,c=r??("object"==typeof e.batch?.multicall&&e.batch.multicall.batchSize||1024);let l=o;if(!l){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");l=Fq({blockNumber:s,chain:e.chain,contract:"multicall3"})}const u=[[]];let d=0,h=0;for(let e=0;e0&&h>c&&u[d].length>0&&(d++,h=(e.length-2)/2,u[d]=[]),u[d]=[...u[d],{allowFailure:!0,callData:e,target:r}]}catch(e){const a=MG(e,{abi:t,address:r,args:s,docsPath:"/docs/contract/multicall",functionName:i});if(!n)throw a;u[d]=[...u[d],{allowFailure:!0,callData:"0x",target:r}]}}const p=await Promise.allSettled(u.map((t=>CD(e,Dq,"readContract")({abi:Cq,address:l,args:[t],blockNumber:s,blockTag:i,functionName:"aggregate3"})))),f=[];for(let e=0;emq(e,t),readContract:t=>Dq(e,t),sendRawTransaction:t=>async function(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]})}(e,t),simulateContract:t=>async function(e,{abi:t,address:n,args:r,dataSuffix:s,functionName:i,...a}){const o=a.account?BH(a.account):void 0,c=TH({abi:t,args:r,functionName:i});try{const{data:o}=await CD(e,Uq,"call")({batch:!1,data:`${c}${s?s.replace("0x",""):""}`,to:n,...a});return{result:Aq({abi:t,args:r,functionName:i,data:o||"0x"}),request:{abi:t,address:n,args:r,dataSuffix:s,functionName:i,...a}}}catch(e){throw MG(e,{abi:t,address:n,args:r,docsPath:"/docs/contract/simulateContract",functionName:i,sender:o?.address})}}(e,t),verifyMessage:t=>async function(e,{address:t,message:n,signature:r,...s}){return eW(e,{address:t,hash:EV(n),signature:r,...s})}(e,t),verifyTypedData:t=>async function(e,{address:t,signature:n,message:r,primaryType:s,types:i,domain:a,...o}){return eW(e,{address:t,hash:W$({message:r,primaryType:s,types:i,domain:a}),signature:n,...o})}(e,t),uninstallFilter:e=>Xq(0,e),waitForTransactionReceipt:t=>async function(e,{confirmations:t=1,hash:n,onReplaced:r,pollingInterval:s=e.pollingInterval,timeout:i}){const a=DH(["waitForTransactionReceipt",e.uid,n]);let o,c,l,u=!1;return new Promise(((d,h)=>{i&&setTimeout((()=>h(new eG({hash:n}))),i);const p=qq(a,{onReplaced:r,resolve:d,reject:h},(r=>{const i=CD(e,tW,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:s,async onBlockNumber(s){if(u)return;let a=s;const d=e=>{i(),e(),p()};try{if(l){if(t>1&&(!l.blockNumber||a-l.blockNumber+1nr.resolve(l)))}if(o||(u=!0,await s$((async()=>{o=await CD(e,SV,"getTransaction")({hash:n}),o.blockNumber&&(a=o.blockNumber)}),{delay:({count:e})=>200*(1<1&&(!l.blockNumber||a-l.blockNumber+1nr.resolve(l)))}catch(n){if(o&&(n instanceof JH||n instanceof XH))try{c=o,u=!0;const n=await s$((()=>CD(e,lq,"getBlock")({blockNumber:a,includeTransactions:!0})),{delay:({count:e})=>200*(1<e instanceof rq});u=!1;const s=n.transactions.find((({from:e,nonce:t})=>e===c.from&&t===c.nonce));if(!s)return;if(l=await CD(e,IV,"getTransactionReceipt")({hash:s.hash}),t>1&&(!l.blockNumber||a-l.blockNumber+1n{r.onReplaced?.({reason:i,replacedTransaction:c,transaction:s,transactionReceipt:l}),r.resolve(l)}))}catch(e){d((()=>r.reject(e)))}else d((()=>r.reject(n)))}}})}))}))}(e,t),watchBlocks:t=>function(e,{blockTag:t="latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:i,includeTransactions:a,poll:o,pollingInterval:c=e.pollingInterval}){const l=void 0!==o?o:"webSocket"!==e.transport.type,u=a??!1;let d;return l?qq(DH(["watchBlocks",e.uid,n,r,u,c]),{onBlock:s,onError:i},(s=>Vq((async()=>{try{const r=await CD(e,lq,"getBlock")({blockTag:t,includeTransactions:u});if(r.number&&d?.number){if(r.number===d.number)return;if(r.number-d.number>1&&n)for(let t=d?.number+1n;td.number)&&(s.onBlock(r,d),d=r)}catch(e){s.onError?.(e)}}),{emitOnBegin:r,interval:c}))):(()=>{let t=!0,n=()=>t=!1;return(async()=>{try{const{unsubscribe:r}=await e.transport.subscribe({params:["newHeads"],onData(n){if(!t)return;const r=(e.chain?.formatters?.block?.format||oq)(n.result);s(r,d),d=r},onError(e){i?.(e)}});n=r,t||n()}catch(e){i?.(e)}})(),n})()}(e,t),watchBlockNumber:t=>tW(e,t),watchContractEvent:t=>function(e,{abi:t,address:n,args:r,batch:s=!0,eventName:i,onError:a,onLogs:o,poll:c,pollingInterval:l=e.pollingInterval,strict:u}){return(void 0!==c?c:"webSocket"!==e.transport.type)?(()=>{const c=DH(["watchContractEvent",n,r,s,e.uid,i,l]),d=u??!1;return qq(c,{onLogs:o,onError:a},(a=>{let o,c,u=!1;const h=Vq((async()=>{if(u)try{let l;if(c)l=await CD(e,Jq,"getFilterChanges")({filter:c});else{const s=await CD(e,Yq,"getBlockNumber")({});l=o&&o!==s?await CD(e,kq,"getContractEvents")({abi:t,address:n,args:r,eventName:i,fromBlock:o+1n,toBlock:s,strict:d}):[],o=s}if(0===l.length)return;if(s)a.onLogs(l);else for(const e of l)a.onLogs([e])}catch(e){c&&e instanceof gG&&(u=!1),a.onError?.(e)}else{try{c=await CD(e,IH,"createContractEventFilter")({abi:t,address:n,args:r,eventName:i,strict:d})}catch{}u=!0}}),{emitOnBegin:!0,interval:l});return async()=>{c&&await CD(e,Xq,"uninstallFilter")({filter:c}),h()}}))})():(()=>{let s=!0,c=()=>s=!1;return(async()=>{try{const l=i?PH({abi:t,eventName:i,args:r}):[],{unsubscribe:d}=await e.transport.subscribe({params:["logs",{address:n,topics:l}],onData(e){if(!s)return;const n=e.result;try{const{eventName:e,args:r}=yq({abi:t,data:n.data,topics:n.topics,strict:u}),s=wq(n,{args:r,eventName:e});o([s])}catch(e){let t,r;if(e instanceof ZD||e instanceof QD){if(u)return;t=e.abiItem.name,r=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const s=wq(n,{args:r?[]:{},eventName:t});o([s])}},onError(e){a?.(e)}});c=d,s||c()}catch(e){a?.(e)}})(),c})()}(e,t),watchEvent:t=>function(e,{address:t,args:n,batch:r=!0,event:s,events:i,onError:a,onLogs:o,poll:c,pollingInterval:l=e.pollingInterval,strict:u}){const d=void 0!==c?c:"webSocket"!==e.transport.type,h=u??!1;return d?qq(DH(["watchEvent",t,n,r,e.uid,s,l]),{onLogs:o,onError:a},(a=>{let o,c,u=!1;const d=Vq((async()=>{if(u)try{let l;if(c)l=await CD(e,Jq,"getFilterChanges")({filter:c});else{const r=await CD(e,Yq,"getBlockNumber")({});l=o&&o!==r?await CD(e,xq,"getLogs")({address:t,args:n,event:s,events:i,fromBlock:o+1n,toBlock:r}):[],o=r}if(0===l.length)return;if(r)a.onLogs(l);else for(const e of l)a.onLogs([e])}catch(e){c&&e instanceof gG&&(u=!1),a.onError?.(e)}else{try{c=await CD(e,N$,"createEventFilter")({address:t,args:n,event:s,events:i,strict:h})}catch{}u=!0}}),{emitOnBegin:!0,interval:l});return async()=>{c&&await CD(e,Xq,"uninstallFilter")({filter:c}),d()}})):(()=>{let r=!0,c=()=>r=!1;return(async()=>{try{const l=i??(s?[s]:void 0);let d=[];l&&(d=[l.flatMap((e=>PH({abi:[e],eventName:e.name,args:n})))],s&&(d=d[0]));const{unsubscribe:p}=await e.transport.subscribe({params:["logs",{address:t,topics:d}],onData(e){if(!r)return;const t=e.result;try{const{eventName:e,args:n}=yq({abi:l,data:t.data,topics:t.topics,strict:h}),r=wq(t,{args:n,eventName:e});o([r])}catch(e){let n,r;if(e instanceof ZD||e instanceof QD){if(u)return;n=e.abiItem.name,r=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const s=wq(t,{args:r?[]:{},eventName:n});o([s])}},onError(e){a?.(e)}});c=p,r||c()}catch(e){a?.(e)}})(),c})()}(e,t),watchPendingTransactions:t=>function(e,{batch:t=!0,onError:n,onTransactions:r,poll:s,pollingInterval:i=e.pollingInterval}){return(void 0!==s?s:"webSocket"!==e.transport.type)?qq(DH(["watchPendingTransactions",e.uid,t,i]),{onTransactions:r,onError:n},(n=>{let r;const s=Vq((async()=>{try{if(!r)try{return void(r=await CD(e,R$,"createPendingTransactionFilter")({}))}catch(e){throw s(),e}const i=await CD(e,Jq,"getFilterChanges")({filter:r});if(0===i.length)return;if(t)n.onTransactions(i);else for(const e of i)n.onTransactions([e])}catch(e){n.onError?.(e)}}),{emitOnBegin:!0,interval:i});return async()=>{r&&await CD(e,Xq,"uninstallFilter")({filter:r}),s()}})):(()=>{let t=!0,s=()=>t=!1;return(async()=>{try{const{unsubscribe:i}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!t)return;const n=e.result;r([n])},onError(e){n?.(e)}});s=i,t||s()}catch(e){n?.(e)}})(),s})()}(e,t)}}function rW(e){const{key:t="public",name:n="Public Client"}=e,r=function(e){const{batch:t,cacheTime:n=e.pollingInterval??4e3,key:r="base",name:s="Base Client",pollingInterval:i=4e3,type:a="base"}=e,o=e.chain,c=e.account?BH(e.account):void 0,{config:l,request:u,value:d}=e.transport({chain:o,pollingInterval:i}),h={account:c,batch:t,cacheTime:n,chain:o,key:r,name:s,pollingInterval:i,request:u,transport:{...l,...d},type:a,uid:r$()};return Object.assign(h,{extend:function e(t){return n=>{const r=n(t);for(const e in h)delete r[e];const s={...t,...r};return Object.assign(s,{extend:e(s)})}}(h)})}({...e,key:t,name:n,type:"publicClient"});return r.extend(nW)}const sW=BigInt(0),iW=BigInt(1),aW=BigInt(2),oW=BigInt(3),cW=BigInt(4),lW=BigInt(5),uW=BigInt(8); /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function dW(e,t){const n=e%t;return n>=sW?n:t+n}function hW(e,t,n){if(n<=sW||t 0");if(n===iW)return sW;let r=iW;for(;t>sW;)t&iW&&(r=r*e%n),e=e*e%n,t>>=iW;return r}function pW(e,t,n){let r=e;for(;t-- >sW;)r*=r,r%=n;return r}function fW(e,t){if(e===sW||t<=sW)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=dW(e,t),r=t,s=sW,i=iW;for(;n!==sW;){const e=r%n,t=s-i*(r/n);r=n,n=e,s=i,i=t}if(r!==iW)throw new Error("invert: does not exist");return dW(s,t)}function mW(e){if(e%cW===oW){const t=(e+iW)/cW;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%uW===lW){const t=(e-lW)/uW;return function(e,n){const r=e.mul(n,aW),s=e.pow(r,t),i=e.mul(n,s),a=e.mul(e.mul(i,aW),s),o=e.mul(i,e.sub(a,e.ONE));if(!e.eql(e.sqr(o),n))throw new Error("Cannot find square root");return o}}return function(e){const t=(e-iW)/aW;let n,r,s;for(n=e-iW,r=0;n%aW===sW;n/=aW,r++);for(s=aW;s(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});JV(e,t)}(e.Fp),JV(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...gW(e.n,e.nBitLength),...e,p:e.Fp.ORDER})} /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const{bytesToNumberBE:EW,hexToBytes:AW}=XV,CW={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=CW;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(128&r[0])throw new t("Invalid signature integer: negative");if(0===r[0]&&!(128&r[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:EW(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=CW,n="string"==typeof e?AW(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||48!=n[0])throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:i}=CW._parseInt(n.subarray(2)),{d:a,l:o}=CW._parseInt(i);if(o.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,n=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},r=t(n(e.s)),s=t(n(e.r)),i=r.length/2,a=s.length/2,o=n(i),c=n(a);return`30${n(a+i+4)}02${c}${s}02${o}${r}`}},PW=BigInt(0),_W=BigInt(1);BigInt(2);const SW=BigInt(3);function IW(e){const t=function(e){const t=kW(e);JV(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:n}=t,r=t.toBytes||((e,t,r)=>{const s=t.toAffine();return $V(Uint8Array.from([4]),n.toBytes(s.x),n.toBytes(s.y))}),s=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function i(e){const{a:r,b:s}=t,i=n.sqr(e),a=n.mul(i,e);return n.add(n.add(a,n.mul(e,r)),s)}if(!n.eql(n.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function a(e){return"bigint"==typeof e&&PWn.eql(e,n.ZERO);return s(t)&&s(r)?d.ZERO:new d(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(d.fromAffine)}static fromHex(e){const t=d.fromAffine(s(qV("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(c(e))}_setWindowSize(e){this._WINDOW_SIZE=e,l.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:r}=this.toAffine();if(!n.isValid(e)||!n.isValid(r))throw new Error("bad point: x or y not FE");const s=n.sqr(r),a=i(e);if(!n.eql(s,a))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){u(e);const{px:t,py:r,pz:s}=this,{px:i,py:a,pz:o}=e,c=n.eql(n.mul(t,o),n.mul(i,s)),l=n.eql(n.mul(r,o),n.mul(a,s));return c&&l}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){const{a:e,b:r}=t,s=n.mul(r,SW),{px:i,py:a,pz:o}=this;let c=n.ZERO,l=n.ZERO,u=n.ZERO,h=n.mul(i,i),p=n.mul(a,a),f=n.mul(o,o),m=n.mul(i,a);return m=n.add(m,m),u=n.mul(i,o),u=n.add(u,u),c=n.mul(e,u),l=n.mul(s,f),l=n.add(c,l),c=n.sub(p,l),l=n.add(p,l),l=n.mul(c,l),c=n.mul(m,c),u=n.mul(s,u),f=n.mul(e,f),m=n.sub(h,f),m=n.mul(e,m),m=n.add(m,u),u=n.add(h,h),h=n.add(u,h),h=n.add(h,f),h=n.mul(h,m),l=n.add(l,h),f=n.mul(a,o),f=n.add(f,f),h=n.mul(f,m),c=n.sub(c,h),u=n.mul(f,p),u=n.add(u,u),u=n.add(u,u),new d(c,l,u)}add(e){u(e);const{px:r,py:s,pz:i}=this,{px:a,py:o,pz:c}=e;let l=n.ZERO,h=n.ZERO,p=n.ZERO;const f=t.a,m=n.mul(t.b,SW);let b=n.mul(r,a),g=n.mul(s,o),y=n.mul(i,c),v=n.add(r,s),w=n.add(a,o);v=n.mul(v,w),w=n.add(b,g),v=n.sub(v,w),w=n.add(r,i);let x=n.add(a,c);return w=n.mul(w,x),x=n.add(b,y),w=n.sub(w,x),x=n.add(s,i),l=n.add(o,c),x=n.mul(x,l),l=n.add(g,y),x=n.sub(x,l),p=n.mul(f,w),l=n.mul(m,y),p=n.add(l,p),l=n.sub(g,p),p=n.add(g,p),h=n.mul(l,p),g=n.add(b,b),g=n.add(g,b),y=n.mul(f,y),w=n.mul(m,w),g=n.add(g,y),y=n.sub(b,y),y=n.mul(f,y),w=n.add(w,y),b=n.mul(g,w),h=n.add(h,b),b=n.mul(x,w),l=n.mul(v,l),l=n.sub(l,b),b=n.mul(v,g),p=n.mul(x,p),p=n.add(p,b),new d(l,h,p)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return p.wNAFCached(this,l,e,(e=>{const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(d.fromAffine)}))}multiplyUnsafe(e){const r=d.ZERO;if(e===PW)return r;if(o(e),e===_W)return this;const{endo:s}=t;if(!s)return p.unsafeLadder(this,e);let{k1neg:i,k1:a,k2neg:c,k2:l}=s.splitScalar(e),u=r,h=r,f=this;for(;a>PW||l>PW;)a&_W&&(u=u.add(f)),l&_W&&(h=h.add(f)),f=f.double(),a>>=_W,l>>=_W;return i&&(u=u.negate()),c&&(h=h.negate()),h=new d(n.mul(h.px,s.beta),h.py,h.pz),u.add(h)}multiply(e){o(e);let r,s,i=e;const{endo:a}=t;if(a){const{k1neg:e,k1:t,k2neg:o,k2:c}=a.splitScalar(i);let{p:l,f:u}=this.wNAF(t),{p:h,f:f}=this.wNAF(c);l=p.constTimeNegate(e,l),h=p.constTimeNegate(o,h),h=new d(n.mul(h.px,a.beta),h.py,h.pz),r=l.add(h),s=u.add(f)}else{const{p:e,f:t}=this.wNAF(i);r=e,s=t}return d.normalizeZ([r,s])[0]}multiplyAndAddUnsafe(e,t,n){const r=d.BASE,s=(e,t)=>t!==PW&&t!==_W&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),i=s(this,t).add(s(e,n));return i.is0()?void 0:i}toAffine(e){const{px:t,py:r,pz:s}=this,i=this.is0();null==e&&(e=i?n.ONE:n.inv(s));const a=n.mul(t,e),o=n.mul(r,e),c=n.mul(s,e);if(i)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw new Error("invZ was invalid");return{x:a,y:o}}isTorsionFree(){const{h:e,isTorsionFree:n}=t;if(e===_W)return!0;if(n)return n(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:n}=t;return e===_W?this:n?n(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),r(d,this,e)}toHex(e=!0){return FV(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);const h=t.nBitLength,p=function(e,t){const n=(e,t)=>{const n=t.negate();return e?n:t},r=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,s=t;for(;n>wW;)n&xW&&(r=r.add(s)),s=s.double(),n>>=xW;return r},precomputeWindow(e,t){const{windows:n,windowSize:s}=r(t),i=[];let a=e,o=a;for(let e=0;e>=h,r>o&&(r-=d,i+=xW);const a=t,p=t+Math.abs(r)-1,f=e%2!=0,m=r<0;0===r?l=l.add(n(f,s[a])):c=c.add(n(m,s[p]))}return{p:c,f:l}},wNAFCached(e,t,n,r){const s=e._WINDOW_SIZE||1;let i=t.get(e);return i||(i=this.precomputeWindow(e,s),1!==s&&t.set(e,r(i))),this.wNAF(s,i,n)}}}(d,t.endo?Math.ceil(h/2):h);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:i,isWithinCurveOrder:a}}function BW(e){const t=function(e){const t=kW(e);return JV(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:n,n:r}=t,s=n.BYTES+1,i=2*n.BYTES+1;function a(e){return dW(e,r)}function o(e){return fW(e,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:l,weierstrassEquation:u,isWithinCurveOrder:d}=IW({...t,toBytes(e,t,r){const s=t.toAffine(),i=n.toBytes(s.x),a=$V;return r?a(Uint8Array.from([t.hasEvenY()?2:3]),i):a(Uint8Array.from([4]),i,n.toBytes(s.y))},fromBytes(e){const t=e.length,r=e[0],a=e.subarray(1);if(t!==s||2!==r&&3!==r){if(t===i&&4===r){return{x:n.fromBytes(a.subarray(0,n.BYTES)),y:n.fromBytes(a.subarray(n.BYTES,2*n.BYTES))}}throw new Error(`Point of length ${t} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}{const e=DV(a);if(!(PW<(o=e)&&oFV(HV(e,t.nByteLength));function p(e){return e>r>>_W}const f=(e,t,n)=>DV(e.slice(t,n));class m{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){const n=t.nByteLength;return e=qV("compactSignature",e,2*n),new m(f(e,0,n),f(e,n,2*n))}static fromDER(e){const{r:t,s:n}=CW.toSig(qV("DER",e));return new m(t,n)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new m(this.r,this.s,e)}recoverPublicKey(e){const{r:r,s:s,recovery:i}=this,l=v(qV("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const u=2===i||3===i?r+t.n:r;if(u>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=1&i?"03":"02",p=c.fromHex(d+h(u)),f=o(u),m=a(-l*f),b=a(s*f),g=c.BASE.multiplyAndAddUnsafe(p,m,b);if(!g)throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return UV(this.toDERHex())}toDERHex(){return CW.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return UV(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const b={isValidPrivateKey(e){try{return l(e),!0}catch(e){return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const e=vW(t.n);return function(e,t,n=!1){const r=e.length,s=yW(t),i=vW(t);if(r<16||r1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);const a=dW(n?DV(e):zV(e),t-iW)+iW;return n?GV(a,s):HV(a,s)}(t.randomBytes(e),t.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function g(e){const t=e instanceof Uint8Array,n="string"==typeof e,r=(t||n)&&e.length;return t?r===s||r===i:n?r===2*s||r===2*i:e instanceof c}const y=t.bits2int||function(e){const n=DV(e),r=8*e.length-t.nBitLength;return r>0?n>>BigInt(r):n},v=t.bits2int_modN||function(e){return a(y(e))},w=WV(t.nBitLength);function x(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(PW<=e&&ee in s)))throw new Error("sign() legacy options not supported");const{hash:i,randomBytes:u}=t;let{lowS:h,prehash:f,extraEntropy:b}=s;null==h&&(h=!0),e=qV("msgHash",e),f&&(e=qV("prehashed msgHash",i(e)));const g=v(e),w=l(r),k=[x(w),x(g)];if(null!=b){const e=!0===b?u(n.BYTES):b;k.push(qV("extraEntropy",e))}const A=$V(...k),C=g;return{seed:A,k2sig:function(e){const t=y(e);if(!d(t))return;const n=o(t),r=c.BASE.multiply(t).toAffine(),s=a(r.x);if(s===PW)return;const i=a(n*a(C+s*w));if(i===PW)return;let l=(r.x===s?0:2)|Number(r.y&_W),u=i;return h&&p(i)&&(u=function(e){return p(e)?a(-e):e}(i),l^=1),new m(s,u,l)}}}const E={lowS:t.lowS,prehash:!1},A={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,n=!0){if(g(e))throw new Error("first arg must be private key");if(!g(t))throw new Error("second arg must be public key");return c.fromHex(t).multiply(l(e)).toRawBytes(n)},sign:function(e,n,r=E){const{seed:s,k2sig:i}=k(e,n,r),a=t;return KV(a.hash.outputLen,a.nByteLength,a.hmac)(s,i)},verify:function(e,n,r,s=A){const i=e;if(n=qV("msgHash",n),r=qV("publicKey",r),"strict"in s)throw new Error("options.strict was renamed to lowS");const{lowS:l,prehash:u}=s;let d,h;try{if("string"==typeof i||i instanceof Uint8Array)try{d=m.fromDER(i)}catch(e){if(!(e instanceof CW.Err))throw e;d=m.fromCompact(i)}else{if("object"!=typeof i||"bigint"!=typeof i.r||"bigint"!=typeof i.s)throw new Error("PARSE");{const{r:e,s:t}=i;d=new m(e,t)}}h=c.fromHex(r)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(l&&d.hasHighS())return!1;u&&(n=t.hash(n));const{r:p,s:f}=d,b=v(n),g=o(f),y=a(b*g),w=a(p*g),x=c.BASE.multiplyAndAddUnsafe(h,y,w)?.toAffine();return!!x&&a(x.x)===p},ProjectivePoint:c,Signature:m,utils:b}}BigInt(4);let TW=class extends qz{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Tz(e.outputLen),Tz(e.blockLen)}(e);const n=Gz(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,s=new Uint8Array(r);s.set(n.length>r?e.create().update(n).digest():n);for(let e=0;enew TW(e,t).update(n).digest(); /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ function OW(e){return{hash:e,hmac:(t,...n)=>MW(e,t,function(...e){const t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0));let n=0;return e.forEach((e=>{if(!Dz(e))throw new Error("Uint8Array expected");t.set(e,n),n+=e.length})),t}(...n)),randomBytes:Vz}}MW.create=(e,t)=>new TW(e,t); /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ const NW=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),RW=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),FW=BigInt(1),jW=BigInt(2),LW=(e,t)=>(e+t/jW)/t;const UW=function(e,t,n=!1,r={}){if(e<=sW)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:i}=gW(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=mW(e),o=Object.freeze({ORDER:e,BITS:s,BYTES:i,MASK:WV(s),ZERO:sW,ONE:iW,create:t=>dW(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return sW<=t&&te===sW,isOdd:e=>(e&iW)===iW,neg:t=>dW(-t,e),eql:(e,t)=>e===t,sqr:t=>dW(t*t,e),add:(t,n)=>dW(t+n,e),sub:(t,n)=>dW(t-n,e),mul:(t,n)=>dW(t*n,e),pow:(e,t)=>function(e,t,n){if(n 0");if(n===sW)return e.ONE;if(n===iW)return t;let r=e.ONE,s=t;for(;n>sW;)n&iW&&(r=e.mul(r,s)),s=e.sqr(s),n>>=iW;return r}(o,e,t),div:(t,n)=>dW(t*fW(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>fW(t,e),sqrt:r.sqrt||(e=>a(o,e)),invertBatch:e=>function(e,t){const n=new Array(t.length),r=t.reduce(((t,r,s)=>e.is0(r)?t:(n[s]=t,e.mul(t,r))),e.ONE),s=e.inv(r);return t.reduceRight(((t,r,s)=>e.is0(r)?t:(n[s]=e.mul(t,n[s]),e.mul(t,r))),s),n}(o,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?GV(e,i):HV(e,i),fromBytes:e=>{if(e.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${e.length}`);return n?zV(e):DV(e)}});return Object.freeze(o)}(NW,void 0,void 0,{sqrt:function(e){const t=NW,n=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),a=BigInt(23),o=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=pW(u,n,t)*u%t,h=pW(d,n,t)*u%t,p=pW(h,jW,t)*l%t,f=pW(p,s,t)*p%t,m=pW(f,i,t)*f%t,b=pW(m,o,t)*m%t,g=pW(b,c,t)*b%t,y=pW(g,o,t)*m%t,v=pW(y,n,t)*u%t,w=pW(v,a,t)*f%t,x=pW(w,r,t)*l%t,k=pW(x,jW,t);if(!UW.eql(UW.sqr(k),e))throw new Error("Cannot find square root");return k}}),DW=function(e,t){const n=t=>BW({...e,...OW(t)});return Object.freeze({...n(t),create:n})}({a:BigInt(0),b:BigInt(7),Fp:UW,n:RW,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=RW,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-FW*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,a=BigInt("0x100000000000000000000000000000000"),o=LW(i*e,t),c=LW(-r*e,t);let l=dW(e-o*n-c*s,t),u=dW(-o*r-c*i,t);const d=l>a,h=u>a;if(d&&(l=t-l),h&&(u=t-u),l>a||u>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:h,k2:u}}}},xV);BigInt(0),DW.ProjectivePoint;const zW=G$({id:787,name:"Acala",network:"acala",nativeCurrency:{name:"Acala",symbol:"ACA",decimals:18},rpcUrls:{public:{http:["https://eth-rpc-acala.aca-api.network"],webSocket:["wss://eth-rpc-acala.aca-api.network"]},default:{http:["https://eth-rpc-acala.aca-api.network"],webSocket:["wss://eth-rpc-acala.aca-api.network"]}},blockExplorers:{default:{name:"Acala Blockscout",url:"https://blockscout.acala.network"}},testnet:!1}),HW=G$({id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),GW=G$({id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:88114}},testnet:!0}),qW=G$({id:42170,name:"Arbitrum Nova",network:"arbitrum-nova",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{blast:{http:["https://arbitrum-nova.public.blastapi.io"],webSocket:["wss://arbitrum-nova.public.blastapi.io"]},default:{http:["https://nova.arbitrum.io/rpc"]},public:{http:["https://nova.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://nova.arbiscan.io"},blockScout:{name:"BlockScout",url:"https://nova-explorer.arbitrum.io/"},default:{name:"Arbiscan",url:"https://nova.arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1746963}}}),$W=G$({id:592,name:"Astar",network:"astar-mainnet",nativeCurrency:{name:"Astar",symbol:"ASTR",decimals:18},rpcUrls:{public:{http:["https://astar.api.onfinality.io/public"]},default:{http:["https://astar.api.onfinality.io/public"]}},blockExplorers:{default:{name:"Astar Subscan",url:"https://astar.subscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:761794}},testnet:!1}),VW=G$({id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-sepolia.g.alchemy.com/v2"],webSocket:["wss://arb-sepolia.g.alchemy.com/v2"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://sepolia.arbiscan.io"},default:{name:"Arbiscan",url:"https://sepolia.arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:81930}},testnet:!0}),WW=G$({id:1261120,name:"Astar zkEVM Testnet zKatana",network:"zKatana",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.zkatana.gelato.digital","https://rpc.startale.com/zkatana"]},public:{http:["https://rpc.zkatana.gelato.digital","https://rpc.startale.com/zkatana"]}},blockExplorers:{blockscout:{name:"Blockscout zKatana chain explorer",url:"https://zkatana.blockscout.com"},default:{name:"zKatana Explorer",url:"https://zkatana.explorer.startale.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:31317}},testnet:!0}),ZW=G$({id:1313161554,name:"Aurora",network:"aurora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{infura:{http:["https://aurora-mainnet.infura.io/v3"]},default:{http:["https://mainnet.aurora.dev"]},public:{http:["https://mainnet.aurora.dev"]}},blockExplorers:{etherscan:{name:"Aurorascan",url:"https://aurorascan.dev"},default:{name:"Aurorascan",url:"https://aurorascan.dev"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:62907816}}}),QW=G$({id:1313161555,name:"Aurora Testnet",network:"aurora-testnet",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{infura:{http:["https://aurora-testnet.infura.io/v3"]},default:{http:["https://testnet.aurora.dev"]},public:{http:["https://testnet.aurora.dev"]}},blockExplorers:{etherscan:{name:"Aurorascan",url:"https://testnet.aurorascan.dev"},default:{name:"Aurorascan",url:"https://testnet.aurorascan.dev"}},testnet:!0}),KW=G$({id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),YW=G$({id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7096959}},testnet:!0}),JW=G$({id:5165,network:"bahamut",name:"Bahamut",nativeCurrency:{name:"Fasttoken",symbol:"FTN",decimals:18},rpcUrls:{default:{http:["https://rpc1.bahamut.io","https://bahamut.publicnode.com","https://rpc2.bahamut.io"],webSocket:["wss://ws1.sahara.bahamutchain.com","wss://bahamut.publicnode.com","wss://ws2.sahara.bahamutchain.com"]},public:{http:["https://rpc1.bahamut.io","https://bahamut.publicnode.com","https://rpc2.bahamut.io"],webSocket:["wss://ws1.sahara.bahamutchain.com","wss://bahamut.publicnode.com","wss://ws2.sahara.bahamutchain.com"]}},blockExplorers:{default:{name:"Ftnscan",url:"https://www.ftnscan.com"}}}),XW={block:cq({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=iq(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?pz(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:aq({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?pz(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:hV({format:e=>({l1GasPrice:e.l1GasPrice?pz(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?pz(e.l1GasUsed):null,l1Fee:e.l1Fee?pz(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})},eZ=G$({id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://base-mainnet.g.alchemy.com/v2"],webSocket:["wss://base-mainnet.g.alchemy.com/v2"]},infura:{http:["https://base-mainnet.infura.io/v3"],webSocket:["wss://base-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{blockscout:{name:"Basescout",url:"https://base.blockscout.com"},default:{name:"Basescan",url:"https://basescan.org"},etherscan:{name:"Basescan",url:"https://basescan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022}}},{formatters:XW}),tZ=G$({id:84531,network:"base-goerli",name:"Base Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://base-goerli.g.alchemy.com/v2"],webSocket:["wss://base-goerli.g.alchemy.com/v2"]},default:{http:["https://goerli.base.org"]},public:{http:["https://goerli.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://goerli.basescan.org"},default:{name:"Basescan",url:"https://goerli.basescan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1376988}},testnet:!0,sourceId:5},{formatters:XW}),nZ=G$({id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://base-sepolia.g.alchemy.com/v2"],webSocket:["wss://base-sepolia.g.alchemy.com/v2"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{blockscout:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"},default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0,sourceId:11155111},{formatters:XW}),rZ=G$({id:641230,name:"Bear Network Chain Mainnet",network:"BearNetworkChainMainnet",nativeCurrency:{decimals:18,name:"BearNetworkChain",symbol:"BRNKC"},rpcUrls:{public:{http:["https://brnkc-mainnet.bearnetwork.net"]},default:{http:["https://brnkc-mainnet.bearnetwork.net"]}},blockExplorers:{default:{name:"BrnkScan",url:"https://brnkscan.bearnetwork.net"}}}),sZ=G$({id:751230,name:"Bear Network Chain Testnet",network:"BearNetworkChainTestnet",nativeCurrency:{decimals:18,name:"tBRNKC",symbol:"tBRNKC"},rpcUrls:{public:{http:["https://brnkc-test.bearnetwork.net"]},default:{http:["https://brnkc-test.bearnetwork.net"]}},blockExplorers:{default:{name:"BrnkTestScan",url:"https://brnktest-scan.bearnetwork.net"}},testnet:!0}),iZ=G$({id:199,name:"BitTorrent",network:"bittorrent-chain-mainnet",nativeCurrency:{name:"BitTorrent",symbol:"BTT",decimals:18},rpcUrls:{default:{http:["https://rpc.bittorrentchain.io"]},public:{http:["https://rpc.bittorrentchain.io"]}},blockExplorers:{etherscan:{name:"Bttcscan",url:"https://bttcscan.com"},default:{name:"Bttcscan",url:"https://bttcscan.com"}}}),aZ=G$({id:1028,name:"BitTorrent Chain Testnet",network:"bittorrent-chain-testnet",nativeCurrency:{name:"BitTorrent",symbol:"BTT",decimals:18},rpcUrls:{default:{http:["https://testrpc.bittorrentchain.io"]},public:{http:["https://testrpc.bittorrentchain.io"]}},blockExplorers:{etherscan:{name:"Bttcscan",url:"https://testnet.bttcscan.com"},default:{name:"Bttcscan",url:"https://testnet.bttcscan.com"}},testnet:!0}),oZ=G$({id:288,name:"Boba Network",network:"boba",nativeCurrency:{decimals:18,name:"Boba",symbol:"BOBA"},rpcUrls:{default:{http:["https://mainnet.boba.network"]},public:{http:["https://mainnet.boba.network"]}},blockExplorers:{etherscan:{name:"BOBAScan",url:"https://bobascan.com"},default:{name:"BOBAScan",url:"https://bobascan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:446859}}}),cZ=G$({id:1039,name:"Bronos",network:"bronos",nativeCurrency:{decimals:18,name:"BRO",symbol:"BRO"},rpcUrls:{default:{http:["https://evm.bronos.org"]},public:{http:["https://evm.bronos.org"]}},blockExplorers:{default:{name:"BronoScan",url:"https://broscan.bronos.org"}}}),lZ=G$({id:1038,name:"Bronos Testnet",network:"bronos-testnet",nativeCurrency:{decimals:18,name:"Bronos Coin",symbol:"tBRO"},rpcUrls:{default:{http:["https://evm-testnet.bronos.org"]},public:{http:["https://evm-testnet.bronos.org"]}},blockExplorers:{default:{name:"BronoScan",url:"https://tbroscan.bronos.org"}},testnet:!0}),uZ=G$({id:56,name:"BNB Smart Chain",network:"bsc",nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://rpc.ankr.com/bsc"]},public:{http:["https://rpc.ankr.com/bsc"]}},blockExplorers:{etherscan:{name:"BscScan",url:"https://bscscan.com"},default:{name:"BscScan",url:"https://bscscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}}),dZ=G$({id:97,name:"Binance Smart Chain Testnet",network:"bsc-testnet",nativeCurrency:{decimals:18,name:"BNB",symbol:"tBNB"},rpcUrls:{default:{http:["https://data-seed-prebsc-1-s1.bnbchain.org:8545"]},public:{http:["https://data-seed-prebsc-1-s1.bnbchain.org:8545"]}},blockExplorers:{etherscan:{name:"BscScan",url:"https://testnet.bscscan.com"},default:{name:"BscScan",url:"https://testnet.bscscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:17422483}},testnet:!0}),hZ=G$({id:4999,name:"BlackFort Exchange Network",network:"bxn",nativeCurrency:{name:"BlackFort Token",symbol:"BXN",decimals:18},rpcUrls:{default:{http:["https://mainnet.blackfort.network/rpc"]},public:{http:["https://mainnet.blackfort.network/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.blackfort.network"}}}),pZ=G$({id:4777,name:"BlackFort Exchange Network Testnet",network:"bxnTestnet",nativeCurrency:{name:"BlackFort Testnet Token",symbol:"TBXN",decimals:18},rpcUrls:{default:{http:["https://testnet.blackfort.network/rpc"]},public:{http:["https://testnet.blackfort.network/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://testnet-explorer.blackfort.network"}}}),fZ=G$({id:7700,name:"Canto",network:"canto",nativeCurrency:{decimals:18,name:"Canto",symbol:"CANTO"},rpcUrls:{default:{http:["https://canto.gravitychain.io"]},public:{http:["https://canto.gravitychain.io"]}},blockExplorers:{default:{name:"Tuber.Build (Blockscout)",url:"https://tuber.build"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:2905789}}});function mZ(e){return 0===e||0n===e||null==e||"0"===e||""===e||"string"==typeof e&&("0x"===uz(e).toLowerCase()||"0x00"===uz(e).toLowerCase())}function bZ(e){return!mZ(e)}function gZ(e){return bZ(e.maxFeePerGas)&&bZ(e.maxPriorityFeePerGas)}function yZ(e){return"cip42"===e.type||gZ(e)&&(bZ(e.feeCurrency)||bZ(e.gatewayFeeRecipient)||bZ(e.gatewayFee))}function vZ(e){return"cip64"===e.type||gZ(e)&&bZ(e.feeCurrency)&&mZ(e.gatewayFee)&&mZ(e.gatewayFeeRecipient)}const wZ={block:cq({exclude:["difficulty","gasLimit","mixHash","nonce","uncles"],format(e){const t=e.transactions?.map((e=>"string"==typeof e?e:{...iq(e),feeCurrency:e.feeCurrency,..."0x7b"!==e.type?{gatewayFee:e.gatewayFee?pz(e.gatewayFee):null,gatewayFeeRecipient:e.gatewayFeeRecipient||null}:{}}));return{randomness:e.randomness,transactions:t}}}),transaction:aq({format(e){const t={feeCurrency:e.feeCurrency};return"0x7b"===e.type?t.type="cip64":("0x7c"===e.type&&(t.type="cip42"),t.gatewayFee=e.gatewayFee?pz(e.gatewayFee):null,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}}),transactionRequest:JG({format(e){const t={feeCurrency:e.feeCurrency};return vZ(e)?t.type="0x7b":(yZ(e)&&(t.type="0x7c"),t.gatewayFee=void 0!==e.gatewayFee?xz(e.gatewayFee):void 0,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}})},xZ={transaction:(e,t)=>vZ(e)?function(e,t){!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i,feeCurrency:a}=e;if(t<=0)throw new Rq({chainId:t});if(i&&!hH(i))throw new uH({address:i});if(r)throw new BD("`gasPrice` is not a valid CIP-64 Transaction attribute.");if(bZ(s)&&s>kZ)throw new FG({maxFeePerGas:s});if(bZ(n)&&bZ(s)&&n>s)throw new $G({maxFeePerGas:s,maxPriorityFeePerGas:n});if(bZ(a)&&!hH(a))throw new BD("`feeCurrency` MUST be a token address for CIP-64 transactions.");if(mZ(a))throw new BD("`feeCurrency` must be provided for CIP-64 transactions.")}(e);const{chainId:n,gas:r,nonce:s,to:i,value:a,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,feeCurrency:u,data:d}=e,h=[yz(n),s?yz(s):"0x",c?yz(c):"0x",o?yz(o):"0x",r?yz(r):"0x",i??"0x",a?yz(a):"0x",d??"0x",AV(l),u];t&&h.push(27n===t.v?"0x":yz(1),uz(t.r),uz(t.s));return fH(["0x7b",oV(h)])}(e,t):yZ(e)?function(e,t){!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i,feeCurrency:a,gatewayFee:o,gatewayFeeRecipient:c}=e;if(t<=0)throw new Rq({chainId:t});if(i&&!hH(i))throw new uH({address:i});if(r)throw new BD("`gasPrice` is not a valid CIP-42 Transaction attribute.");if(bZ(s)&&s>kZ)throw new FG({maxFeePerGas:s});if(bZ(n)&&bZ(s)&&n>s)throw new $G({maxFeePerGas:s,maxPriorityFeePerGas:n});if(bZ(o)&&mZ(c)||bZ(c)&&mZ(o))throw new BD("`gatewayFee` and `gatewayFeeRecipient` must be provided together.");if(bZ(a)&&!hH(a))throw new BD("`feeCurrency` MUST be a token address for CIP-42 transactions.");if(bZ(c)&&!hH(c))throw new uH(c);if(mZ(a)&&mZ(c))throw new BD("Either `feeCurrency` or `gatewayFeeRecipient` must be provided for CIP-42 transactions.")}(e);const{chainId:n,gas:r,nonce:s,to:i,value:a,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,feeCurrency:u,gatewayFeeRecipient:d,gatewayFee:h,data:p}=e,f=[yz(n),s?yz(s):"0x",c?yz(c):"0x",o?yz(o):"0x",r?yz(r):"0x",u??"0x",d??"0x",h?yz(h):"0x",i??"0x",a?yz(a):"0x",p??"0x",AV(l)];t&&f.push(27n===t.v?"0x":yz(1),uz(t.r),uz(t.s));return fH(["0x7c",oV(f)])}(e,t):CV(e,t)};const kZ=2n**256n-1n;const EZ=G$({id:42220,name:"Celo",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:13112599}},testnet:!1},{formatters:wZ,serializers:xZ}),AZ=G$({id:44787,name:"Alfajores",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"A-CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:14569001}},testnet:!0},{formatters:wZ,serializers:xZ}),CZ=G$({id:88888,name:"Chiliz Chain",network:"chiliz-chain",nativeCurrency:{decimals:18,name:"CHZ",symbol:"CHZ"},rpcUrls:{default:{http:["https://rpc.ankr.com/chiliz","https://chiliz.publicnode.com"]},public:{http:["https://rpc.ankr.com/chiliz","https://chiliz.publicnode.com"]}},blockExplorers:{default:{name:"Chiliz Explorer",url:"https://scan.chiliz.com"}}}),PZ=G$({id:17323,name:"Cannoli",network:"celo-cannoli",nativeCurrency:{decimals:18,name:"CELO",symbol:"C-CELO"},rpcUrls:{default:{http:["https://forno.cannoli.celo-testnet.org"]},public:{http:["https://forno.cannoli.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/cannoli"}},contracts:{multicall3:{address:"0x5Acb0aa8BF4E8Ff0d882Ee187140713C12BF9718",blockCreated:87429}},testnet:!0},{formatters:wZ,serializers:xZ}),_Z=G$({id:61,name:"Ethereum Classic",network:"classic",nativeCurrency:{decimals:18,name:"ETC",symbol:"ETC"},rpcUrls:{default:{http:["https://etc.rivet.link"]},public:{http:["https://etc.rivet.link"]}},blockExplorers:{default:{name:"Blockscout",url:"https://blockscout.com/etc/mainnet"}}}),SZ=G$({id:1030,name:"Conflux eSpace",network:"cfx-espace",nativeCurrency:{name:"Conflux",symbol:"CFX",decimals:18},rpcUrls:{default:{http:["https://evm.confluxrpc.org"],webSocket:["wss://evm.confluxrpc.org/ws"]},public:{http:["https://evm.confluxrpc.org"],webSocket:["wss://evm.confluxrpc.org/ws"]}},blockExplorers:{default:{name:"ConfluxScan",url:"https://evm.confluxscan.io"}},contracts:{multicall3:{address:"0xEFf0078910f638cd81996cc117bccD3eDf2B072F",blockCreated:68602935}}}),IZ=G$({id:71,name:"Conflux eSpace Testnet",network:"cfx-espace-testnet",testnet:!0,nativeCurrency:{name:"Conflux",symbol:"CFX",decimals:18},rpcUrls:{default:{http:["https://evmtestnet.confluxrpc.org"],webSocket:["wss://evmtestnet.confluxrpc.org/ws"]},public:{http:["https://evmtestnet.confluxrpc.org"],webSocket:["wss://evmtestnet.confluxrpc.org/ws"]}},blockExplorers:{default:{name:"ConfluxScan",url:"https://evmtestnet.confluxscan.io"}},contracts:{multicall3:{address:"0xEFf0078910f638cd81996cc117bccD3eDf2B072F",blockCreated:117499050}}}),BZ=G$({id:1116,name:"Core Dao",network:"coreDao",nativeCurrency:{decimals:18,name:"Core",symbol:"CORE"},rpcUrls:{public:{http:["https://rpc.coredao.org"]},default:{http:["https://rpc.coredao.org"]}},blockExplorers:{default:{name:"CoreDao",url:"https://scan.coredao.org"},etherscan:{name:"CoreDao",url:"https://scan.coredao.org"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:11907934}},testnet:!1}),TZ=G$({id:25,name:"Cronos Mainnet",network:"cronos",nativeCurrency:{decimals:18,name:"Cronos",symbol:"CRO"},rpcUrls:{default:{http:["https://evm.cronos.org"]},public:{http:["https://evm.cronos.org"]}},blockExplorers:{default:{name:"Cronoscan",url:"https://cronoscan.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1963112}}}),MZ=G$({id:338,name:"Cronos Testnet",network:"cronos-testnet",nativeCurrency:{decimals:18,name:"CRO",symbol:"tCRO"},rpcUrls:{default:{http:["https://evm-t3.cronos.org"]},public:{http:["https://evm-t3.cronos.org"]}},blockExplorers:{default:{name:"Cronos Explorer",url:"https://cronos.org/explorer/testnet3"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:10191251}},testnet:!0}),OZ=G$({id:3737,network:"crossbell",name:"Crossbell",nativeCurrency:{decimals:18,name:"CSB",symbol:"CSB"},rpcUrls:{default:{http:["https://rpc.crossbell.io"]},public:{http:["https://rpc.crossbell.io"]}},blockExplorers:{default:{name:"CrossScan",url:"https://scan.crossbell.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:38246031}}}),NZ=G$({id:53935,name:"DFK Chain",network:"dfk",nativeCurrency:{decimals:18,name:"Jewel",symbol:"JEWEL"},rpcUrls:{default:{http:["https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"]},public:{http:["https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"]}},blockExplorers:{etherscan:{name:"DFKSubnetScan",url:"https://subnets.avax.network/defi-kingdoms"},default:{name:"DFKSubnetScan",url:"https://subnets.avax.network/defi-kingdoms"}}}),RZ=G$({id:2e3,name:"Dogechain",network:"dogechain",nativeCurrency:{decimals:18,name:"Dogechain",symbol:"DC"},rpcUrls:{default:{http:["https://rpc.dogechain.dog"]},public:{http:["https://rpc.dogechain.dog"]}},blockExplorers:{etherscan:{name:"DogeChainExplorer",url:"https://explorer.dogechain.dog"},default:{name:"DogeChainExplorer",url:"https://explorer.dogechain.dog"}}}),FZ=G$({id:2021,name:"Edgeware EdgeEVM Mainnet",network:"edgeware",nativeCurrency:{decimals:18,name:"Edgeware",symbol:"EDG"},rpcUrls:{default:{http:["https://edgeware-evm.jelliedowl.net"]},public:{http:["https://edgeware-evm.jelliedowl.net"]}},blockExplorers:{etherscan:{name:"Edgscan by Bharathcoorg",url:"https://edgscan.live"},default:{name:"Edgscan by Bharathcoorg",url:"https://edgscan.live"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:18117872}}}),jZ=G$({id:2022,name:"Beresheet BereEVM Testnet",network:"edgewareTestnet",nativeCurrency:{decimals:18,name:"Testnet EDG",symbol:"tEDG"},rpcUrls:{default:{http:["https://beresheet-evm.jelliedowl.net"]},public:{http:["https://beresheet-evm.jelliedowl.net"]}},blockExplorers:{etherscan:{name:"Edgscan by Bharathcoorg",url:"https://testnet.edgscan.live"},default:{name:"Edgscan by Bharathcoorg",url:"https://testnet.edgscan.live"}}}),LZ=G$({id:17777,name:"EOS EVM",network:"eos",nativeCurrency:{decimals:18,name:"EOS",symbol:"EOS"},rpcUrls:{default:{http:["https://api.evm.eosnetwork.com"]},public:{http:["https://api.evm.eosnetwork.com"]}},blockExplorers:{etherscan:{name:"EOS EVM Explorer",url:"https://explorer.evm.eosnetwork.com"},default:{name:"EOS EVM Explorer",url:"https://explorer.evm.eosnetwork.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7943933}}}),UZ=G$({id:15557,name:"EOS EVM Testnet",network:"eos",nativeCurrency:{decimals:18,name:"EOS",symbol:"EOS"},rpcUrls:{default:{http:["https://api.testnet.evm.eosnetwork.com"]},public:{http:["https://api.testnet.evm.eosnetwork.com"]}},blockExplorers:{etherscan:{name:"EOS EVM Testnet Explorer",url:"https://explorer.testnet.evm.eosnetwork.com"},default:{name:"EOS EVM Testnet Explorer",url:"https://explorer.testnet.evm.eosnetwork.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:9067940}},testnet:!0}),DZ=G$({id:9001,name:"Evmos",network:"evmos",nativeCurrency:{decimals:18,name:"Evmos",symbol:"EVMOS"},rpcUrls:{default:{http:["https://eth.bd.evmos.org:8545"]},public:{http:["https://eth.bd.evmos.org:8545"]}},blockExplorers:{default:{name:"Evmos Block Explorer",url:"https://escan.live"}}}),zZ=G$({id:9e3,name:"Evmos Testnet",network:"evmos-testnet",nativeCurrency:{decimals:18,name:"Evmos",symbol:"EVMOS"},rpcUrls:{default:{http:["https://eth.bd.evmos.dev:8545"]},public:{http:["https://eth.bd.evmos.dev:8545"]}},blockExplorers:{default:{name:"Evmos Testnet Block Explorer",url:"https://evm.evmos.dev/"}}}),HZ=G$({id:1994,name:"Ekta",network:"ekta",nativeCurrency:{decimals:18,name:"EKTA",symbol:"EKTA"},rpcUrls:{public:{http:["https://main.ekta.io"]},default:{http:["https://main.ekta.io"]}},blockExplorers:{default:{name:"Ektascan",url:"https://ektascan.io"}}}),GZ=G$({id:1004,name:"Ekta Testnet",network:"ekta-testnet",nativeCurrency:{decimals:18,name:"EKTA",symbol:"EKTA"},rpcUrls:{public:{http:["https://test.ekta.io:8545"]},default:{http:["https://test.ekta.io:8545"]}},blockExplorers:{default:{name:"Test Ektascan",url:"https://test.ektascan.io"}},testnet:!0}),qZ=G$({id:250,name:"Fantom",network:"fantom",nativeCurrency:{decimals:18,name:"Fantom",symbol:"FTM"},rpcUrls:{default:{http:["https://rpc.ankr.com/fantom"]},public:{http:["https://rpc.ankr.com/fantom"]}},blockExplorers:{etherscan:{name:"FTMScan",url:"https://ftmscan.com"},default:{name:"FTMScan",url:"https://ftmscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:33001987}}}),$Z=G$({id:64240,name:"Fantom Sonic Open Testnet",network:"fantom-sonic-testnet",nativeCurrency:{decimals:18,name:"Fantom",symbol:"FTM"},rpcUrls:{default:{http:["https://rpcapi.sonic.fantom.network"]},public:{http:["https://rpcapi.sonic.fantom.network"]}},blockExplorers:{default:{name:"Fantom Sonic Open Testnet Explorer",url:"https://public-sonic.fantom.network"}},testnet:!0}),VZ=G$({id:4002,name:"Fantom Testnet",network:"fantom-testnet",nativeCurrency:{decimals:18,name:"Fantom",symbol:"FTM"},rpcUrls:{default:{http:["https://rpc.testnet.fantom.network"]},public:{http:["https://rpc.testnet.fantom.network"]}},blockExplorers:{etherscan:{name:"FTMScan",url:"https://testnet.ftmscan.com"},default:{name:"FTMScan",url:"https://testnet.ftmscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:8328688}}}),WZ=G$({id:12306,name:"Fibo Chain",network:"fibochain",nativeCurrency:{decimals:18,name:"fibo",symbol:"FIBO"},rpcUrls:{default:{http:["https://network.hzroc.art"]},public:{http:["https://network.hzroc.art"]}},blockExplorers:{default:{name:"FiboScan",url:"https://scan.fibochain.org"}}}),ZZ=G$({id:314,name:"Filecoin Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3328594}}}),QZ=G$({id:314159,name:"Filecoin Calibration",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}}),KZ=G$({id:3141,name:"Filecoin Hyperspace",network:"filecoin-hyperspace",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.hyperspace.node.glif.io/rpc/v1"]},public:{http:["https://api.hyperspace.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://hyperspace.filfox.info/en"},filscan:{name:"Filscan",url:"https://hyperspace.filscan.io"}}}),YZ=G$({id:14,name:"Flare Mainnet",network:"flare-mainnet",nativeCurrency:{decimals:18,name:"flare",symbol:"FLR"},rpcUrls:{default:{http:["https://flare-api.flare.network/ext/C/rpc"]},public:{http:["https://flare-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Flare Explorer",url:"https://flare-explorer.flare.network"}}}),JZ=G$({id:114,name:"Coston2",network:"coston2",nativeCurrency:{decimals:18,name:"coston2flare",symbol:"C2FLR"},rpcUrls:{default:{http:["https://coston2-api.flare.network/ext/C/rpc"]},public:{http:["https://coston2-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Coston2 Explorer",url:"https://coston2-explorer.flare.network"}},testnet:!0}),XZ=G$({id:31337,name:"Foundry",network:"foundry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]},public:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]}}}),eQ=G$({id:122,name:"Fuse",network:"fuse",nativeCurrency:{name:"Fuse",symbol:"FUSE",decimals:18},rpcUrls:{default:{http:["https://rpc.fuse.io"]},public:{http:["https://rpc.fuse.io"]}},blockExplorers:{default:{name:"Fuse Explorer",url:"https://explorer.fuse.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:16146628}}}),tQ=G$({id:123,name:"Fuse Sparknet",network:"fuse",nativeCurrency:{name:"Spark",symbol:"SPARK",decimals:18},rpcUrls:{default:{http:["https://rpc.fusespark.io"]},public:{http:["https://rpc.fusespark.io"]}},blockExplorers:{default:{name:"Sparkent Explorer",url:"https://explorer.fusespark.io"}}}),nQ=G$({id:4689,name:"IoTeX",network:"iotex",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.mainnet.iotex.io"],webSocket:["wss://babel-api.mainnet.iotex.io"]},public:{http:["https://babel-api.mainnet.iotex.io"],webSocket:["wss://babel-api.mainnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://iotexscan.io"}}}),rQ=G$({id:4690,name:"IoTeX Testnet",network:"iotex-testnet",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.testnet.iotex.io"],webSocket:["wss://babel-api.testnet.iotex.io"]},public:{http:["https://babel-api.testnet.iotex.io"],webSocket:["wss://babel-api.testnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://testnet.iotexscan.io"}}}),sQ=G$({id:8899,name:"JIBCHAIN L1",network:"jbc",nativeCurrency:{name:"JBC",symbol:"JBC",decimals:18},rpcUrls:{default:{http:["https://rpc-l1.jibchain.net"]},public:{http:["https://rpc-l1.jibchain.net"]}},blockExplorers:{default:{name:"Blockscout",url:"https://exp-l1.jibchain.net"}},contracts:{multicall3:{address:"0xc0C8C486D1466C57Efe13C2bf000d4c56F47CBdC",blockCreated:2299048}},testnet:!1}),iQ=G$({id:686,name:"Karura",network:"karura",nativeCurrency:{name:"Karura",symbol:"KAR",decimals:18},rpcUrls:{public:{http:["https://eth-rpc-karura.aca-api.network"],webSocket:["wss://eth-rpc-karura.aca-api.network"]},default:{http:["https://eth-rpc-karura.aca-api.network"],webSocket:["wss://eth-rpc-karura.aca-api.network"]}},blockExplorers:{default:{name:"Karura Blockscout",url:"https://blockscout.karura.network"}},testnet:!1}),aQ=G$({id:1663,name:"Horizen Gobi Testnet",network:"gobi",nativeCurrency:{decimals:18,name:"Test ZEN",symbol:"tZEN"},rpcUrls:{public:{http:["https://gobi-testnet.horizenlabs.io/ethv1"]},default:{http:["https://gobi-testnet.horizenlabs.io/ethv1"]}},blockExplorers:{default:{name:"Gobi Explorer",url:"https://gobi-explorer.horizen.io"}},contracts:{},testnet:!0}),oQ=G$({id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x56522D00C410a43BFfDF00a9A569489297385790",blockCreated:8765204},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}),cQ=G$({id:100,name:"Gnosis",network:"gnosis",nativeCurrency:{decimals:18,name:"Gnosis",symbol:"xDAI"},rpcUrls:{default:{http:["https://rpc.gnosischain.com"],webSocket:["wss://rpc.gnosischain.com/wss"]},public:{http:["https://rpc.gnosischain.com"],webSocket:["wss://rpc.gnosischain.com/wss"]}},blockExplorers:{etherscan:{name:"Gnosisscan",url:"https://gnosisscan.io"},default:{name:"Gnosis Chain Explorer",url:"https://blockscout.com/xdai/mainnet"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:21022491}}}),lQ=G$({id:10200,name:"Gnosis Chiado",network:"chiado",nativeCurrency:{decimals:18,name:"Gnosis",symbol:"xDAI"},rpcUrls:{default:{http:["https://rpc.chiadochain.net"],webSocket:["wss://rpc.chiadochain.net/wss"]},public:{http:["https://rpc.chiadochain.net"],webSocket:["wss://rpc.chiadochain.net/wss"]}},blockExplorers:{default:{name:"Blockscout",url:"https://blockscout.chiadochain.net"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:4967313}},testnet:!0}),uQ=G$({id:31337,name:"Hardhat",network:"hardhat",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]},public:{http:["http://127.0.0.1:8545"]}}}),dQ=G$({id:16666e5,name:"Harmony One",network:"harmony",nativeCurrency:{name:"Harmony",symbol:"ONE",decimals:18},rpcUrls:{public:{http:["https://rpc.ankr.com/harmony"]},default:{http:["https://rpc.ankr.com/harmony"]}},blockExplorers:{default:{name:"Harmony Explorer",url:"https://explorer.harmony.one"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:24185753}}}),hQ=G$({id:11235,name:"HAQQ Mainnet",network:"haqq-mainnet",nativeCurrency:{decimals:18,name:"Islamic Coin",symbol:"ISLM"},rpcUrls:{default:{http:["https://rpc.eth.haqq.network"]},public:{http:["https://rpc.eth.haqq.network"]}},blockExplorers:{default:{name:"HAQQ Explorer",url:"https://explorer.haqq.network"}}}),pQ=G$({id:54211,name:"HAQQ Testedge 2",network:"haqq-testedge-2",nativeCurrency:{decimals:18,name:"Islamic Coin",symbol:"ISLMT"},rpcUrls:{default:{http:["https://rpc.eth.testedge2.haqq.network"]},public:{http:["https://rpc.eth.testedge2.haqq.network"]}},blockExplorers:{default:{name:"HAQQ Explorer",url:"https://explorer.testedge2.haqq.network"}}}),fQ=G$({id:17e3,network:"holesky",name:"Holesky",nativeCurrency:{name:"Holesky Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:77}},testnet:!0}),mQ=G$({id:2222,name:"Kava EVM",network:"kava-mainnet",nativeCurrency:{name:"Kava",symbol:"KAVA",decimals:18},rpcUrls:{public:{http:["https://evm.kava.io"]},default:{http:["https://evm.kava.io"]}},blockExplorers:{default:{name:"Kava EVM Explorer",url:"https://kavascan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3661165}},testnet:!1}),bQ=G$({id:2221,name:"Kava EVM Testnet",network:"kava-testnet",nativeCurrency:{name:"Kava",symbol:"KAVA",decimals:18},rpcUrls:{public:{http:["https://evm.testnet.kava.io"]},default:{http:["https://evm.testnet.kava.io"]}},blockExplorers:{default:{name:"Kava EVM Testnet Explorer",url:"https://testnet.kavascan.com/"}},contracts:{multicall3:{address:"0xDf1D724A7166261eEB015418fe8c7679BBEa7fd6",blockCreated:7242179}},testnet:!0}),gQ=G$({id:8217,name:"Klaytn",network:"klaytn",nativeCurrency:{decimals:18,name:"Klaytn",symbol:"KLAY"},rpcUrls:{default:{http:["https://public-en-cypress.klaytn.net"]},public:{http:["https://public-en-cypress.klaytn.net"]}},blockExplorers:{etherscan:{name:"KlaytnScope",url:"https://scope.klaytn.com"},default:{name:"KlaytnScope",url:"https://scope.klaytn.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:96002415}}}),yQ=G$({id:1001,name:"Klaytn Baobab Testnet",network:"klaytn-baobab",nativeCurrency:{decimals:18,name:"Baobab Klaytn",symbol:"KLAY"},rpcUrls:{default:{http:["https://public-en-baobab.klaytn.net"]},public:{http:["https://public-en-baobab.klaytn.net"]}},blockExplorers:{etherscan:{name:"KlaytnScope",url:"https://baobab.klaytnscope.com"},default:{name:"KlaytnScope",url:"https://baobab.klaytnscope.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:123390593}},testnet:!0}),vQ=G$({id:255,network:"kroma",name:"Kroma",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://api.kroma.network"]},public:{http:["https://api.kroma.network"]}},blockExplorers:{default:{name:"Kroma Explorer",url:"https://blockscout.kroma.network"}},testnet:!1}),wQ=G$({id:2358,network:"kroma-sepolia",name:"Kroma Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://api.sepolia.kroma.network"]},public:{http:["https://api.sepolia.kroma.network"]}},blockExplorers:{default:{name:"Kroma Sepolia Explorer",url:"https://blockscout.sepolia.kroma.network"}},testnet:!0}),xQ=G$({id:59144,name:"Linea Mainnet",network:"linea-mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-mainnet.infura.io/v3"],webSocket:["wss://linea-mainnet.infura.io/ws/v3"]},default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"},blockscout:{name:"Blockscout",url:"https://explorer.linea.build"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:42}},testnet:!1}),kQ=G$({id:59140,name:"Linea Goerli Testnet",network:"linea-testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"},blockscout:{name:"Blockscout",url:"https://explorer.goerli.linea.build"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:498623}},testnet:!0}),EQ=G$({id:1337,name:"Localhost",network:"localhost",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]},public:{http:["http://127.0.0.1:8545"]}}}),AQ=G$({id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]},public:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}}),CQ=G$({id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),PQ=G$({id:595,name:"Mandala TC9",network:"mandala",nativeCurrency:{name:"Mandala",symbol:"mACA",decimals:18},rpcUrls:{public:{http:["https://eth-rpc-tc9.aca-staging.network"],webSocket:["wss://eth-rpc-tc9.aca-staging.network"]},default:{http:["https://eth-rpc-tc9.aca-staging.network"],webSocket:["wss://eth-rpc-tc9.aca-staging.network"]}},blockExplorers:{default:{name:"Mandala Blockscout",url:"https://blockscout.mandala.aca-staging.network"}},testnet:!0}),_Q=G$({id:169,name:"Manta Pacific Mainnet",network:"manta",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://pacific-rpc.manta.network/http"]},public:{http:["https://pacific-rpc.manta.network/http"]}},blockExplorers:{etherscan:{name:"Manta Explorer",url:"https://pacific-explorer.manta.network"},default:{name:"Manta Explorer",url:"https://pacific-explorer.manta.network"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:332890}}}),SQ=G$({id:3441005,name:"Manta Pacific Testnet",network:"manta-testnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://manta-testnet.calderachain.xyz/http"]},public:{http:["https://manta-testnet.calderachain.xyz/http"]}},blockExplorers:{etherscan:{name:"Manta Testnet Explorer",url:"https://pacific-explorer.testnet.manta.network"},default:{name:"Manta Testnet Explorer",url:"https://pacific-explorer.testnet.manta.network"}},contracts:{multicall3:{address:"0x211B1643b95Fe76f11eD8880EE810ABD9A4cf56C",blockCreated:419915}},testnet:!0}),IQ=G$({id:5e3,name:"Mantle",network:"mantle",nativeCurrency:{decimals:18,name:"MNT",symbol:"MNT"},rpcUrls:{default:{http:["https://rpc.mantle.xyz"]},public:{http:["https://rpc.mantle.xyz"]}},blockExplorers:{etherscan:{name:"Mantle Explorer",url:"https://explorer.mantle.xyz"},default:{name:"Mantle Explorer",url:"https://explorer.mantle.xyz"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:304717}}}),BQ=G$({id:5001,name:"Mantle Testnet",network:"mantle",nativeCurrency:{decimals:18,name:"MNT",symbol:"MNT"},rpcUrls:{default:{http:["https://rpc.testnet.mantle.xyz"]},public:{http:["https://rpc.testnet.mantle.xyz"]}},blockExplorers:{etherscan:{name:"Mantle Testnet Explorer",url:"https://explorer.testnet.mantle.xyz"},default:{name:"Mantle Testnet Explorer",url:"https://explorer.testnet.mantle.xyz"}},testnet:!0}),TQ=G$({id:82,name:"Meter",network:"meter",nativeCurrency:{decimals:18,name:"MTR",symbol:"MTR"},rpcUrls:{default:{http:["https://rpc.meter.io"]},public:{http:["https://rpc.meter.io"]}},blockExplorers:{default:{name:"MeterScan",url:"https://scan.meter.io"}}}),MQ=G$({id:83,name:"Meter Testnet",network:"meter-testnet",nativeCurrency:{decimals:18,name:"MTR",symbol:"MTR"},rpcUrls:{default:{http:["https://rpctest.meter.io"]},public:{http:["https://rpctest.meter.io"]}},blockExplorers:{default:{name:"MeterTestnetScan",url:"https://scan-warringstakes.meter.io"}}}),OQ=G$({id:1088,name:"Metis",network:"andromeda",nativeCurrency:{decimals:18,name:"Metis",symbol:"METIS"},rpcUrls:{default:{http:["https://andromeda.metis.io/?owner=1088"]},public:{http:["https://andromeda.metis.io/?owner=1088"]}},blockExplorers:{default:{name:"Andromeda Explorer",url:"https://andromeda-explorer.metis.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:2338552}}}),NQ=G$({id:599,name:"Metis Goerli",network:"metis-goerli",nativeCurrency:{decimals:18,name:"Metis Goerli",symbol:"METIS"},rpcUrls:{default:{http:["https://goerli.gateway.metisdevops.link"]},public:{http:["https://goerli.gateway.metisdevops.link"]}},blockExplorers:{default:{name:"Metis Goerli Explorer",url:"https://goerli.explorer.metisdevops.link"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1006207}}}),RQ=G$({id:7518,network:"MEVerse",name:"MEVerse Chain Mainnet",nativeCurrency:{decimals:18,name:"MEVerse",symbol:"MEV"},rpcUrls:{default:{http:["https://rpc.meversemainnet.io"]},public:{http:["https://rpc.meversemainnet.io"]}},blockExplorers:{default:{name:"Explorer",url:"https://www.meversescan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:86881340}}}),FQ=G$({id:4759,network:"MEVerse Testnet",name:"MEVerse Chain Testnet",nativeCurrency:{decimals:18,name:"MEVerse",symbol:"MEV"},rpcUrls:{default:{http:["https://rpc.meversetestnet.io"]},public:{http:["https://rpc.meversetestnet.io"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.meversescan.io/"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:64371115}},testnet:!0}),jQ=G$({id:919,name:"Mode Testnet",network:"mode-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.mode.network"]},public:{http:["https://sepolia.mode.network"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia.explorer.mode.network"}},contracts:{multicall3:{address:"0xBAba8373113Fb7a68f195deF18732e01aF8eDfCF",blockCreated:3019007}},testnet:!0}),LQ=G$({id:1287,name:"Moonbase Alpha",network:"moonbase-alpha",nativeCurrency:{decimals:18,name:"DEV",symbol:"DEV"},rpcUrls:{default:{http:["https://rpc.api.moonbase.moonbeam.network"],webSocket:["wss://wss.api.moonbase.moonbeam.network"]},public:{http:["https://rpc.api.moonbase.moonbeam.network"],webSocket:["wss://wss.api.moonbase.moonbeam.network"]}},blockExplorers:{default:{name:"Moonscan",url:"https://moonbase.moonscan.io"},etherscan:{name:"Moonscan",url:"https://moonbase.moonscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1850686}},testnet:!0}),UQ=G$({id:1284,name:"Moonbeam",network:"moonbeam",nativeCurrency:{decimals:18,name:"GLMR",symbol:"GLMR"},rpcUrls:{public:{http:["https://moonbeam.public.blastapi.io"],webSocket:["wss://moonbeam.public.blastapi.io"]},default:{http:["https://moonbeam.public.blastapi.io"],webSocket:["wss://moonbeam.public.blastapi.io"]}},blockExplorers:{default:{name:"Moonscan",url:"https://moonscan.io"},etherscan:{name:"Moonscan",url:"https://moonscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:609002}},testnet:!1}),DQ=G$({id:1281,name:"Moonbeam Development Node",network:"development",nativeCurrency:{decimals:18,name:"DEV",symbol:"DEV"},rpcUrls:{default:{http:["http://127.0.0.1:9944"],webSocket:["wss://127.0.0.1:9944"]},public:{http:["http://127.0.0.1:9944"],webSocket:["wss://127.0.0.1:9944"]}}}),zQ=G$({id:1285,name:"Moonriver",network:"moonriver",nativeCurrency:{decimals:18,name:"MOVR",symbol:"MOVR"},rpcUrls:{public:{http:["https://moonriver.public.blastapi.io"],webSocket:["wss://moonriver.public.blastapi.io"]},default:{http:["https://moonriver.public.blastapi.io"],webSocket:["wss://moonriver.public.blastapi.io"]}},blockExplorers:{default:{name:"Moonscan",url:"https://moonriver.moonscan.io"},etherscan:{name:"Moonscan",url:"https://moonriver.moonscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1597904}},testnet:!1}),HQ=G$({id:245022926,network:"neonDevnet",name:"Neon EVM DevNet",nativeCurrency:{name:"NEON",symbol:"NEON",decimals:18},rpcUrls:{default:{http:["https://devnet.neonevm.org"]},public:{http:["https://devnet.neonevm.org"]}},blockExplorers:{default:{name:"Neonscan",url:"https://devnet.neonscan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:205206112}},testnet:!0}),GQ=G$({id:245022934,network:"neonMainnet",name:"Neon EVM MainNet",nativeCurrency:{name:"NEON",symbol:"NEON",decimals:18},rpcUrls:{default:{http:["https://neon-proxy-mainnet.solana.p2p.org"]},public:{http:["https://neon-proxy-mainnet.solana.p2p.org"]}},blockExplorers:{default:{name:"Neonscan",url:"https://neonscan.org"}},contracts:{},testnet:!1}),qQ=G$({id:4242,name:"Nexi",network:"nexi",nativeCurrency:{name:"Nexi",symbol:"NEXI",decimals:18},rpcUrls:{default:{http:["https://rpc.chain.nexi.technology"]},public:{http:["https://rpc.chain.nexi.technology"]}},blockExplorers:{etherscan:{name:"NexiScan",url:"https://www.nexiscan.com"},default:{name:"NexiScan",url:"https://www.nexiscan.com"}},contracts:{multicall3:{address:"0x0277A46Cc69A57eE3A6C8c158bA874832F718B8E",blockCreated:25770160}}}),$Q=G$({id:240,name:"Nexilix Smart Chain",network:"nexilix",nativeCurrency:{decimals:18,name:"Nexilix",symbol:"NEXILIX"},rpcUrls:{default:{http:["https://rpcurl.pos.nexilix.com"]},public:{http:["https://rpcurl.pos.nexilix.com"]}},blockExplorers:{etherscan:{name:"NexilixScan",url:"https://scan.nexilix.com"},default:{name:"NexilixScan",url:"https://scan.nexilix.com"}},contracts:{multicall3:{address:"0x58381c8e2BF9d0C2C4259cA14BdA9Afe02831244",blockCreated:74448}}}),VQ=G$({id:248,name:"Oasys",network:"oasys",nativeCurrency:{name:"Oasys",symbol:"OAS",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.oasys.games"]},public:{http:["https://rpc.mainnet.oasys.games"]}},blockExplorers:{default:{name:"OasysScan",url:"https://scan.oasys.games"}}}),WQ=G$({id:4090,network:"oasis-testnet",name:"Oasis Testnet",nativeCurrency:{name:"Fasttoken",symbol:"FTN",decimals:18},rpcUrls:{default:{http:["https://rpc1.oasis.bahamutchain.com"]},public:{http:["https://rpc1.oasis.bahamutchain.com"]}},blockExplorers:{default:{name:"Ftnscan",url:"https://oasis.ftnscan.com"}},testnet:!0}),ZQ=G$({id:66,name:"OKC",network:"okc",nativeCurrency:{decimals:18,name:"OKT",symbol:"OKT"},rpcUrls:{default:{http:["https://exchainrpc.okex.org"]},public:{http:["https://exchainrpc.okex.org"]}},blockExplorers:{default:{name:"oklink",url:"https://www.oklink.com/okc"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:10364792}}}),QQ=G$({id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263}}},{formatters:XW}),KQ=G$({id:420,name:"Optimism Goerli",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"],webSocket:["wss://opt-goerli.g.alchemy.com/v2"]},infura:{http:["https://optimism-goerli.infura.io/v3"],webSocket:["wss://optimism-goerli.infura.io/ws/v3"]},default:{http:["https://goerli.optimism.io"]},public:{http:["https://goerli.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461}},testnet:!0},{formatters:XW}),YQ=G$({id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-sepolia.g.alchemy.com/v2"],webSocket:["wss://opt-sepolia.g.alchemy.com/v2"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]}},blockExplorers:{blockscout:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"},default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1620204}},testnet:!0},{formatters:XW}),JQ=G$({id:204,name:"opBNB",network:"opBNB Mainnet",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{public:{http:["https://opbnb-mainnet-rpc.bnbchain.org"]},default:{http:["https://opbnb-mainnet-rpc.bnbchain.org"]}},blockExplorers:{default:{name:"opbnbscan",url:"https://mainnet.opbnbscan.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:512881}}}),XQ=G$({id:5611,name:"opBNB Testnet",network:"opBNB Testnet",nativeCurrency:{decimals:18,name:"tBNB",symbol:"tBNB"},rpcUrls:{public:{http:["https://opbnb-testnet-rpc.bnbchain.org"]},default:{http:["https://opbnb-testnet-rpc.bnbchain.org"]}},blockExplorers:{default:{name:"opbnbscan",url:"https://testnet.opbnbscan.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3705108}},testnet:!0}),eK=G$({id:424,network:"pgn",name:"PGN",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.publicgoods.network"]},public:{http:["https://rpc.publicgoods.network"]}},blockExplorers:{default:{name:"PGN Explorer",url:"https://explorer.publicgoods.network"},blocksout:{name:"PGN Explorer",url:"https://explorer.publicgoods.network"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3380209}}},{formatters:XW}),tK=G$({id:58008,network:"pgn-testnet",name:"PGN ",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.publicgoods.network"]},public:{http:["https://sepolia.publicgoods.network"]}},blockExplorers:{default:{name:"PGN Testnet Explorer",url:"https://explorer.sepolia.publicgoods.network"},blocksout:{name:"PGN Testnet Explorer",url:"https://explorer.sepolia.publicgoods.network"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3754925}},testnet:!0},{formatters:XW}),nK=G$({id:242,name:"Plinga",network:"plinga",nativeCurrency:{name:"Plinga",symbol:"PLINGA",decimals:18},rpcUrls:{default:{http:["https://rpcurl.mainnet.plgchain.com"]},public:{http:["https://rpcurl.mainnet.plgchain.com"]}},blockExplorers:{default:{name:"Plgscan",url:"https://www.plgscan.com"}},contracts:{multicall3:{address:"0x0989576160f2e7092908BB9479631b901060b6e4",blockCreated:204489}}}),rK=G$({id:137,name:"Polygon",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),sK=G$({id:80001,name:"Polygon Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mumbai.g.alchemy.com/v2"],webSocket:["wss://polygon-mumbai.g.alchemy.com/v2"]},infura:{http:["https://polygon-mumbai.infura.io/v3"],webSocket:["wss://polygon-mumbai.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/polygon_mumbai"]},public:{http:["https://rpc.ankr.com/polygon_mumbai"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"},default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}},testnet:!0}),iK=G$({id:1442,name:"Polygon zkEVM Testnet",network:"polygon-zkevm-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.public.zkevm-test.net"]},public:{http:["https://rpc.public.zkevm-test.net"]}},blockExplorers:{blockscout:{name:"Blockscout",url:"https://explorer.public.zkevm-test.net"},default:{name:"PolygonScan",url:"https://testnet-zkevm.polygonscan.com"}},testnet:!0,contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:525686}}}),aK=G$({id:1101,name:"Polygon zkEVM",network:"polygon-zkevm",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://zkevm-rpc.com"]},public:{http:["https://zkevm-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://zkevm.polygonscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:57746}}}),oK=G$({id:369,network:"pulsechain",name:"PulseChain",nativeCurrency:{name:"Pulse",symbol:"PLS",decimals:18},testnet:!1,rpcUrls:{default:{http:["https://rpc.pulsechain.com"],webSocket:["wss://ws.pulsechain.com"]},public:{http:["https://rpc.pulsechain.com"],webSocket:["wss://ws.pulsechain.com"]}},blockExplorers:{default:{name:"PulseScan",url:"https://scan.pulsechain.com"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),cK=G$({id:943,network:"pulsechainV4",name:"PulseChain V4",testnet:!0,nativeCurrency:{name:"V4 Pulse",symbol:"v4PLS",decimals:18},rpcUrls:{default:{http:["https://rpc.v4.testnet.pulsechain.com"],webSocket:["wss://ws.v4.testnet.pulsechain.com"]},public:{http:["https://rpc.v4.testnet.pulsechain.com"],webSocket:["wss://ws.v4.testnet.pulsechain.com"]}},blockExplorers:{default:{name:"PulseScan",url:"https://scan.v4.testnet.pulsechain.com"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),lK=G$({id:35441,name:"Q Mainnet",network:"q-mainnet",nativeCurrency:{decimals:18,name:"Q",symbol:"Q"},rpcUrls:{default:{http:["https://rpc.q.org"]},public:{http:["https://rpc.q.org"]}},blockExplorers:{default:{name:"Q Mainnet Explorer",url:"https://explorer.q.org"}}}),uK=G$({id:35443,name:"Q Testnet",network:"q-testnet",nativeCurrency:{decimals:18,name:"Q",symbol:"Q"},rpcUrls:{default:{http:["https://rpc.qtestnet.org"]},public:{http:["https://rpc.qtestnet.org"]}},blockExplorers:{default:{name:"Q Testnet Explorer",url:"https://explorer.qtestnet.org"}},testnet:!0}),dK=G$({id:570,name:"Rollux Mainnet",network:"rollux",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc.rollux.com"],webSocket:["wss://rpc.rollux.com/wss"]},public:{http:["https://rollux.public-rpc.com"]}},blockExplorers:{default:{name:"RolluxExplorer",url:"https://explorer.rollux.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:119222}}}),hK=G$({id:57e3,name:"Rollux Testnet",network:"rollux-testnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc-tanenbaum.rollux.com/"],webSocket:["wss://rpc-tanenbaum.rollux.com/wss"]},public:{http:["https://rpc-tanenbaum.rollux.com/"]}},blockExplorers:{default:{name:"RolluxTestnetExplorer",url:"https://rollux.tanenbaum.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1813675}}}),pK=G$({id:2020,name:"Ronin",network:"ronin",nativeCurrency:{name:"RON",symbol:"RON",decimals:18},rpcUrls:{default:{http:["https://api.roninchain.com/rpc"]},public:{http:["https://api.roninchain.com/rpc"]}},blockExplorers:{default:{name:"Ronin Explorer",url:"https://app.roninchain.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:26023535}}}),fK=G$({id:30,name:"Rootstock Mainnet",network:"rootstock",nativeCurrency:{decimals:18,name:"Rootstock Bitcoin",symbol:"RBTC"},rpcUrls:{public:{http:["https://public-node.rsk.co"]},default:{http:["https://public-node.rsk.co"]}},blockExplorers:{blockscout:{name:"Blockscout",url:"https://rootstock.blockscout.com"},default:{name:"RSK Explorer",url:"https://explorer.rsk.co"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:4249540}}}),mK=G$({id:2021,name:"Saigon Testnet",network:"saigon",nativeCurrency:{name:"RON",symbol:"RON",decimals:18},rpcUrls:{default:{http:["https://saigon-testnet.roninchain.com/rpc"]},public:{http:["https://saigon-testnet.roninchain.com/rpc"]}},blockExplorers:{default:{name:"Saigon Explorer",url:"https://saigon-explorer.roninchain.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:18736871}},testnet:!0}),bK=G$({id:23294,name:"Oasis Sapphire",network:"sapphire",nativeCurrency:{name:"Sapphire Rose",symbol:"ROSE",decimals:18},rpcUrls:{default:{http:["https://sapphire.oasis.io"],webSocket:["wss://sapphire.oasis.io/ws"]},public:{http:["https://sapphire.oasis.io"],webSocket:["wss://sapphire.oasis.io/ws"]}},blockExplorers:{default:{name:"Oasis Sapphire Explorer",url:"https://explorer.sapphire.oasis.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:734531}}}),gK=G$({id:23295,name:"Oasis Sapphire Testnet",network:"sapphire-testnet",nativeCurrency:{name:"Sapphire Test Rose",symbol:"TEST",decimals:18},rpcUrls:{default:{http:["https://testnet.sapphire.oasis.dev"],webSocket:["wss://testnet.sapphire.oasis.dev/ws"]},public:{http:["https://testnet.sapphire.oasis.dev"],webSocket:["wss://testnet.sapphire.oasis.dev/ws"]}},blockExplorers:{default:{name:"Oasis Sapphire Testnet Explorer",url:"https://testnet.explorer.sapphire.oasis.dev"}},testnet:!0}),yK=G$({id:534352,name:"Scroll",network:"scroll",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.scroll.io"],webSocket:["wss://wss-rpc.scroll.io/ws"]},public:{http:["https://rpc.scroll.io"],webSocket:["wss://wss-rpc.scroll.io/ws"]}},blockExplorers:{default:{name:"Scrollscan",url:"https://scrollscan.com"},blockscout:{name:"Blockscout",url:"https://blockscout.scroll.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14}},testnet:!1}),vK=G$({id:534351,name:"Scroll Sepolia",network:"scroll-sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rpc.scroll.io"]},public:{http:["https://sepolia-rpc.scroll.io"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-blockscout.scroll.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:9473}},testnet:!0}),wK=G$({id:534353,name:"Scroll Testnet",network:"scroll-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://alpha-rpc.scroll.io/l2"],webSocket:["wss://alpha-rpc.scroll.io/l2/ws"]},public:{http:["https://alpha-rpc.scroll.io/l2"],webSocket:["wss://alpha-rpc.scroll.io/l2/ws"]}},blockExplorers:{default:{name:"Blockscout",url:"https://blockscout.scroll.io"}},testnet:!0}),xK=G$({id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x21B000Fd62a880b2125A61e36a284BB757b76025",blockCreated:3914906}},testnet:!0}),kK=G$({id:148,name:"Shimmer",network:"shimmer",nativeCurrency:{decimals:18,name:"Shimmer",symbol:"SMR"},rpcUrls:{public:{http:["https://json-rpc.evm.shimmer.network"]},default:{http:["https://json-rpc.evm.shimmer.network"]}},blockExplorers:{default:{name:"Shimmer Network Explorer",url:"https://explorer.evm.shimmer.network"}}}),EK=G$({id:1073,name:"Shimmer Testnet",network:"shimmer-testnet",nativeCurrency:{decimals:18,name:"Shimmer",symbol:"SMR"},rpcUrls:{public:{http:["https://json-rpc.evm.testnet.shimmer.network"]},default:{http:["https://json-rpc.evm.testnet.shimmer.network"]}},blockExplorers:{default:{name:"Shimmer Network Explorer",url:"https://explorer.evm.testnet.shimmer.network"}},testnet:!0}),AK=G$({id:391845894,name:"SKALE | Block Brawlers",network:"skale-brawl",nativeCurrency:{name:"BRAWL",symbol:"BRAWL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/frayed-decent-antares"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/frayed-decent-antares"]},public:{http:["https://mainnet.skalenodes.com/v1/frayed-decent-antares"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/frayed-decent-antares"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://frayed-decent-antares.explorer.mainnet.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://frayed-decent-antares.explorer.mainnet.skalenodes.com"}},contracts:{}}),CK=G$({id:1564830818,name:"SKALE | Calypso NFT Hub",network:"skale-calypso",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/honorable-steel-rasalhague"]},public:{http:["https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/honorable-steel-rasalhague"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3107626}}}),PK=G$({id:344106930,name:"SKALE | Calypso NFT Hub Testnet",network:"skale-calypso-testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://staging-v3.skalenodes.com/v1/staging-utter-unripe-menkar"],webSocket:["wss://staging-v3.skalenodes.com/v1/ws/staging-utter-unripe-menkar"]},public:{http:["https://staging-v3.skalenodes.com/v1/staging-utter-unripe-menkar"],webSocket:["wss://staging-v3.skalenodes.com/v1/ws/staging-utter-unripe-menkar"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://staging-utter-unripe-menkar.explorer.staging-v3.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://staging-utter-unripe-menkar.explorer.staging-v3.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2131424}},testnet:!0}),_K=G$({id:1351057110,name:"SKALE | Chaos Testnet",network:"skale-chaos-testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://staging-v3.skalenodes.com/v1/staging-fast-active-bellatrix"],webSocket:["wss://staging-v3.skalenodes.com/v1/ws/staging-fast-active-bellatrix"]},public:{http:["https://staging-v3.skalenodes.com/v1/staging-fast-active-bellatrix"],webSocket:["wss://staging-v3.skalenodes.com/v1/ws/staging-fast-active-bellatrix"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://staging-fast-active-bellatrix.explorer.staging-v3.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://staging-fast-active-bellatrix.explorer.staging-v3.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1192202}},testnet:!0}),SK=G$({id:1026062157,name:"SKALE | CryptoBlades",network:"skale-cryptoblades",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/affectionate-immediate-pollux"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/affectionate-immediate-pollux"]},public:{http:["https://mainnet.skalenodes.com/v1/affectionate-immediate-pollux"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/affectionate-immediate-pollux"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://affectionate-immediate-pollux.explorer.mainnet.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://affectionate-immediate-pollux.explorer.mainnet.skalenodes.com"}},contracts:{}}),IK=G$({id:2046399126,name:"SKALE | Crypto Colosseum",network:"skale-crypto-coloseeum",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/haunting-devoted-deneb"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/haunting-devoted-deneb"]},public:{http:["https://mainnet.skalenodes.com/v1/haunting-devoted-deneb"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/haunting-devoted-deneb"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://haunting-devoted-deneb.explorer.mainnet.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://haunting-devoted-deneb.explorer.mainnet.skalenodes.com"}},contracts:{}}),BK=G$({id:2046399126,name:"SKALE | Europa Liquidity Hub",network:"skale-europa",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/elated-tan-skat"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/elated-tan-skat"]},public:{http:["https://mainnet.skalenodes.com/v1/elated-tan-skat"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/elated-tan-skat"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://elated-tan-skat.explorer.mainnet.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://elated-tan-skat.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3113495}}}),TK=G$({id:476158412,name:"SKALE | Europa Liquidity Hub Testnet",network:"skale-europa-testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://staging-v3.skalenodes.com/v1/staging-legal-crazy-castor"],webSocket:["wss://staging-v3.skalenodes.com/v1/ws/staging-legal-crazy-castor"]},public:{http:["https://staging-v3.skalenodes.com/v1/staging-legal-crazy-castor"],webSocket:["wss://staging-v3.skalenodes.com/v1/ws/staging-legal-crazy-castor"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://staging-legal-crazy-castor.explorer.staging-v3.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://staging-legal-crazy-castor.explorer.staging-v3.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2071911}},testnet:!0}),MK=G$({id:2139927552,name:"SKALE | Exorde",network:"skale-exorde",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/light-vast-diphda"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/light-vast-diphda"]},public:{http:["https://mainnet.skalenodes.com/v1/light-vast-diphda"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/light-vast-diphda"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://light-vast-diphda.explorer.mainnet.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://light-vast-diphda.explorer.mainnet.skalenodes.com"}},contracts:{}}),OK=G$({id:1273227453,name:"SKALE | Human Protocol",network:"skale-human-protocol",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/wan-red-ain"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/wan-red-ain"]},public:{http:["https://mainnet.skalenodes.com/v1/wan-red-ain"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/wan-red-ain"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://wan-red-ain.explorer.mainnet.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://wan-red-ain.explorer.mainnet.skalenodes.com"}},contracts:{}}),NK=G$({id:1482601649,name:"SKALE | Nebula Gaming Hub",network:"skale-nebula",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/green-giddy-denebola"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/green-giddy-denebola"]},public:{http:["https://mainnet.skalenodes.com/v1/green-giddy-denebola"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/green-giddy-denebola"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://green-giddy-denebola.explorer.mainnet.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://green-giddy-denebola.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2372986}}}),RK=G$({id:503129905,name:"SKALE | Nebula Gaming Hub Testnet",network:"skale-nebula-testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://staging-v3.skalenodes.com/v1/staging-faint-slimy-achird"],webSocket:["wss://staging-v3.skalenodes.com/v1/ws/staging-faint-slimy-achird"]},public:{http:["https://staging-v3.skalenodes.com/v1/staging-faint-slimy-achird"],webSocket:["wss://staging-v3.skalenodes.com/v1/ws/staging-faint-slimy-achird"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://staging-faint-slimy-achird.explorer.staging-v3.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://staging-faint-slimy-achird.explorer.staging-v3.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2205882}},testnet:!0}),FK=G$({id:278611351,name:"SKALE | Razor Network",network:"skale-razor",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/turbulent-unique-scheat"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/turbulent-unique-scheat"]},public:{http:["https://mainnet.skalenodes.com/v1/turbulent-unique-scheat"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/turbulent-unique-scheat"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://turbulent-unique-scheat.explorer.mainnet.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://turbulent-unique-scheat.explorer.mainnet.skalenodes.com"}},contracts:{}}),jK=G$({id:1350216234,name:"SKALE | Titan Community Hub",network:"skale-titan",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/parallel-stormy-spica"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/parallel-stormy-spica"]},public:{http:["https://mainnet.skalenodes.com/v1/parallel-stormy-spica"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/parallel-stormy-spica"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://parallel-stormy-spica.explorer.mainnet.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://parallel-stormy-spica.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2076458}}}),LK=G$({id:1517929550,name:"SKALE | Titan Community Hub Testnet",network:"skale-titan-testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://staging-v3.skalenodes.com/v1/staging-aware-chief-gianfar"],webSocket:["wss://staging-v3.skalenodes.com/v1/ws/staging-aware-chief-gianfar"]},public:{http:["https://staging-v3.skalenodes.com/v1/staging-aware-chief-gianfar"],webSocket:["wss://staging-v3.skalenodes.com/v1/ws/staging-aware-chief-gianfar"]}},blockExplorers:{blockscout:{name:"SKALE Explorer",url:"https://staging-aware-chief-gianfar.explorer.staging-v3.skalenodes.com"},default:{name:"SKALE Explorer",url:"https://staging-aware-chief-gianfar.explorer.staging-v3.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2085155}},testnet:!0}),UK=G$({id:19,name:"Songbird Mainnet",network:"songbird-mainnet",nativeCurrency:{decimals:18,name:"songbird",symbol:"SGB"},rpcUrls:{default:{http:["https://songbird-api.flare.network/ext/C/rpc"]},public:{http:["https://songbird-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Songbird Explorer",url:"https://songbird-explorer.flare.network"}}}),DK=G$({id:16,name:"Coston",network:"coston",nativeCurrency:{decimals:18,name:"costonflare",symbol:"CFLR"},rpcUrls:{default:{http:["https://coston-api.flare.network/ext/C/rpc"]},public:{http:["https://coston-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Coston Explorer",url:"https://coston-explorer.flare.network"}},testnet:!0}),zK=G$({id:88882,name:"Chiliz Spicy Testnet",network:"chiliz-spicy-Testnet",nativeCurrency:{decimals:18,name:"CHZ",symbol:"CHZ"},rpcUrls:{default:{http:["https://spicy-rpc.chiliz.com","https://chiliz-spicy.publicnode.com"],webSocket:["wss://spicy-rpc-ws.chiliz.com","wss://chiliz-spicy.publicnode.com"]},public:{http:["https://spicy-rpc.chiliz.com","https://chiliz-spicy.publicnode.com"],webSocket:["wss://spicy-rpc-ws.chiliz.com","wss://chiliz-spicy.publicnode.com"]}},blockExplorers:{default:{name:"Chiliz Explorer",url:"http://spicy-explorer.chiliz.com"}},testnet:!0}),HK=G$({id:8082,name:"Shardeum Sphinx",network:"shmSphinx",nativeCurrency:{name:"SHARDEUM",symbol:"SHM",decimals:18},rpcUrls:{default:{http:["https://sphinx.shardeum.org"]},public:{http:["https://sphinx.shardeum.org"]}},blockExplorers:{default:{name:"Shardeum Explorer",url:"https://explorer-sphinx.shardeum.org"}},testnet:!0}),GK=G$({id:109,name:"Shibarium",network:"shibarium",nativeCurrency:{name:"Bone",symbol:"BONE",decimals:18},rpcUrls:{default:{http:["https://rpc.shibrpc.com"]},public:{http:["https://rpc.shibrpc.com"]}},blockExplorers:{etherscan:{name:"Blockscout",url:"https://shibariumscan.io"},default:{name:"Blockscout",url:"https://shibariumscan.io"}},contracts:{multicall3:{address:"0x864Bf681ADD6052395188A89101A1B37d3B4C961",blockCreated:265900}}}),qK=G$({id:57,name:"Syscoin Mainnet",network:"syscoin",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc.syscoin.org"],webSocket:["wss://rpc.syscoin.org/wss"]},public:{http:["https://rpc.syscoin.org"],webSocket:["wss://rpc.syscoin.org/wss"]}},blockExplorers:{default:{name:"SyscoinExplorer",url:"https://explorer.syscoin.org"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:287139}}}),$K=G$({id:5700,name:"Syscoin Tanenbaum Testnet",network:"syscoin-testnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc.tanenbaum.io"],webSocket:["wss://rpc.tanenbaum.io/wss"]},public:{http:["https://rpc.tanenbaum.io"],webSocket:["wss://rpc.tanenbaum.io/wss"]}},blockExplorers:{default:{name:"SyscoinTestnetExplorer",url:"https://tanenbaum.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:271288}}}),VK=G$({id:841,name:"Taraxa Mainnet",network:"taraxa",nativeCurrency:{name:"Tara",symbol:"TARA",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.taraxa.io"]},public:{http:["https://rpc.mainnet.taraxa.io"]}},blockExplorers:{default:{name:"Taraxa Explorer",url:"https://explorer.mainnet.taraxa.io"}}}),WK=G$({id:167007,name:"Taiko Jolnir (Alpha-5 Testnet)",network:"tko-jolnir",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.jolnir.taiko.xyz"]},public:{http:["https://rpc.jolnir.taiko.xyz"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.jolnir.taiko.xyz"}}}),ZK=G$({id:167005,name:"Taiko (Alpha-3 Testnet)",network:"taiko-sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.test.taiko.xyz"]},public:{http:["https://rpc.test.taiko.xyz"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.test.taiko.xyz"}}}),QK=G$({id:842,name:"Taraxa Testnet",network:"taraxa-testnet",nativeCurrency:{name:"Tara",symbol:"TARA",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.taraxa.io"]},public:{http:["https://rpc.testnet.taraxa.io"]}},blockExplorers:{default:{name:"Taraxa Explorer",url:"https://explorer.testnet.taraxa.io"}},testnet:!0}),KK=G$({id:40,name:"Telos",network:"telos",nativeCurrency:{decimals:18,name:"Telos",symbol:"TLOS"},rpcUrls:{default:{http:["https://mainnet.telos.net/evm"]},public:{http:["https://mainnet.telos.net/evm"]}},blockExplorers:{default:{name:"Teloscan",url:"https://www.teloscan.io/"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:246530709}}}),YK=G$({id:41,name:"Telos",network:"telosTestnet",nativeCurrency:{decimals:18,name:"Telos",symbol:"TLOS"},rpcUrls:{default:{http:["https://testnet.telos.net/evm"]},public:{http:["https://testnet.telos.net/evm"]}},blockExplorers:{default:{name:"Teloscan (testnet)",url:"https://testnet.teloscan.io/"}},testnet:!0}),JK=G$({id:1559,name:"Tenet",network:"tenet-mainnet",nativeCurrency:{name:"TENET",symbol:"TENET",decimals:18},rpcUrls:{public:{http:["https://rpc.tenet.org"]},default:{http:["https://rpc.tenet.org"]}},blockExplorers:{default:{name:"TenetScan Mainnet",url:"https://tenetscan.io"}},testnet:!1}),XK=G$({id:997,name:"5ireChain Thunder Testnet",network:"5ireChain",nativeCurrency:{name:"5ire Token",symbol:"5IRE",decimals:18},rpcUrls:{default:{http:["https://rpc-testnet.5ire.network"]},public:{http:["https://rpc-testnet.5ire.network"]}},blockExplorers:{default:{name:"5ireChain Explorer",url:"https://explorer.5ire.network"}},testnet:!0}),eY=G$({id:100009,name:"Vechain",network:"vechain",nativeCurrency:{name:"VeChain",symbol:"VET",decimals:18},rpcUrls:{default:{http:["https://mainnet.vechain.org"]},public:{http:["https://mainnet.vechain.org"]}},blockExplorers:{default:{name:"Vechain Explorer",url:"https://explore.vechain.org"},vechainStats:{name:"Vechain Stats",url:"https://vechainstats.com"}}}),tY=G$({id:888,name:"Wanchain",network:"wanchain",nativeCurrency:{name:"WANCHAIN",symbol:"WAN",decimals:18},rpcUrls:{default:{http:["https://gwan-ssl.wandevs.org:56891","https://gwan2-ssl.wandevs.org"]},public:{http:["https://gwan-ssl.wandevs.org:56891","https://gwan2-ssl.wandevs.org"]}},blockExplorers:{etherscan:{name:"WanScan",url:"https://wanscan.org"},default:{name:"WanScan",url:"https://wanscan.org"}},contracts:{multicall3:{address:"0xcDF6A1566e78EB4594c86Fe73Fcdc82429e97fbB",blockCreated:25312390}}}),nY=G$({id:999,name:"Wanchain Testnet",network:"wanchainTestnet",nativeCurrency:{name:"WANCHAIN",symbol:"WANt",decimals:18},rpcUrls:{default:{http:["https://gwan-ssl.wandevs.org:46891"]},public:{http:["https://gwan-ssl.wandevs.org:46891"]}},blockExplorers:{etherscan:{name:"WanScanTest",url:"https://wanscan.org"},default:{name:"WanScanTest",url:"https://wanscan.org"}},contracts:{multicall3:{address:"0x11c89bF4496c39FB80535Ffb4c92715839CC5324",blockCreated:24743448}},testnet:!0}),rY=G$({id:1111,name:"WEMIX",network:"wemix-mainnet",nativeCurrency:{name:"WEMIX",symbol:"WEMIX",decimals:18},rpcUrls:{default:{http:["https://api.wemix.com"]},public:{http:["https://api.wemix.com"]}},blockExplorers:{etherscan:{name:"wemixExplorer",url:"https://explorer.wemix.com"},default:{name:"wemixExplorer",url:"https://explorer.wemix.com"}}}),sY=G$({id:1112,name:"WEMIX Testnet",network:"wemix-testnet",nativeCurrency:{name:"WEMIX",symbol:"tWEMIX",decimals:18},rpcUrls:{default:{http:["https://api.test.wemix.com"]},public:{http:["https://api.test.wemix.com"]}},blockExplorers:{etherscan:{name:"wemixExplorer",url:"https://testnet.wemixscan.com"},default:{name:"wemixExplorer",url:"https://testnet.wemixscan.com"}},testnet:!0}),iY=G$({id:50,name:"XinFin Network",network:"xdc",nativeCurrency:{decimals:18,name:"XDC",symbol:"XDC"},rpcUrls:{default:{http:["https://rpc.xinfin.network"]},public:{http:["https://rpc.xinfin.network"]}},blockExplorers:{xinfin:{name:"XinFin",url:"https://explorer.xinfin.network"},default:{name:"Blocksscan",url:"https://xdc.blocksscan.io"}}}),aY=G$({id:51,name:"Apothem Network",network:"xdc-testnet",nativeCurrency:{decimals:18,name:"TXDC",symbol:"TXDC"},rpcUrls:{default:{http:["https://erpc.apothem.network"]},public:{http:["https://erpc.apothem.network"]}},blockExplorers:{xinfin:{name:"XinFin",url:"https://explorer.apothem.network"},default:{name:"Blocksscan",url:"https://apothem.blocksscan.io"}}}),oY=G$({id:1337803,network:"zhejiang",name:"Zhejiang",nativeCurrency:{name:"Zhejiang Ether",symbol:"ZhejETH",decimals:18},rpcUrls:{default:{http:["https://rpc.zhejiang.ethpandaops.io"]},public:{http:["https://rpc.zhejiang.ethpandaops.io"]}},blockExplorers:{beaconchain:{name:"Etherscan",url:"https://zhejiang.beaconcha.in"},blockscout:{name:"Blockscout",url:"https://blockscout.com/eth/zhejiang-testnet"},default:{name:"Beaconchain",url:"https://zhejiang.beaconcha.in"}},testnet:!0}),cY=G$({id:42766,name:"ZKFair Mainnet",network:"zkfair-mainnet",nativeCurrency:{decimals:18,name:"USD Coin",symbol:"USDC"},rpcUrls:{default:{http:["https://rpc.zkfair.io"]},public:{http:["https://rpc.zkfair.io"]}},blockExplorers:{default:{name:"zkFair Explorer",url:"https://scan.zkfair.io"}},testnet:!1}),lY=G$({id:43851,name:"ZKFair Testnet",network:"zkfair-testnet",nativeCurrency:{decimals:18,name:"USD Coin",symbol:"USDC"},rpcUrls:{default:{http:["https://testnet-rpc.zkfair.io"]},public:{http:["https://testnet-rpc.zkfair.io"]}},blockExplorers:{default:{name:"zkFair Explorer",url:"https://testnet-scan.zkfair.io"}},testnet:!0}),uY={block:cq({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=uY.transaction.format(e);return"0x71"===t.typeHex?t.type="eip712":"0xff"===t.typeHex&&(t.type="priority"),t}));return{l1BatchNumber:e.l1BatchNumber?pz(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?pz(e.l1BatchTimestamp):null,transactions:t}}}),transaction:aq({format(e){const t={};return"0x71"===e.type?t.type="eip712":"0xff"===e.type&&(t.type="priority"),{...t,l1BatchNumber:e.l1BatchNumber?pz(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?pz(e.l1BatchTxIndex):null}}}),transactionReceipt:hV({format:e=>({l1BatchNumber:e.l1BatchNumber?pz(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?pz(e.l1BatchTxIndex):null,logs:e.logs.map((e=>({...wq(e),l1BatchNumber:e.l1BatchNumber?pz(e.l1BatchNumber):null,transactionLogIndex:mz(e.transactionLogIndex),logType:e.logType}))),l2ToL1Logs:e.l2ToL1Logs.map((e=>({blockNumber:pz(e.blockHash),blockHash:e.blockHash,l1BatchNumber:pz(e.l1BatchNumber),transactionIndex:pz(e.transactionIndex),shardId:pz(e.shardId),isService:e.isService,sender:e.sender,key:e.key,value:e.value,transactionHash:e.transactionHash,logIndex:pz(e.logIndex)})))})}),transactionRequest:JG({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format:e=>e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:yz(e.gasPerPubdata)}:{},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(Sz(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps}:{},...e.customSignature?{customSignature:e.customSignature}:{}},type:"eip712"===e.type?"0x71":"0xff"}:{}})},dY={transaction:(e,t)=>function(e){return"customSignature"in e||"paymaster"in e||"paymasterInput"in e||"gasPerPubdata"in e||"factoryDeps"in e}(e)?function(e){const{chainId:t,gas:n,nonce:r,to:s,from:i,value:a,maxFeePerGas:o,maxPriorityFeePerGas:c,customSignature:l,factoryDeps:u,paymaster:d,paymasterInput:h,gasPerPubdata:p,data:f}=e;!function(e){const{chainId:t,to:n,from:r,paymaster:s,paymasterInput:i}=e;if(t<=0)throw new Rq({chainId:t});if(n&&!hH(n))throw new uH({address:n});if(r&&!hH(r))throw new uH({address:r});if(s&&!hH(s))throw new uH({address:s});if(s&&!i)throw new BD("`paymasterInput` must be provided when `paymaster` is defined");if(!s&&i)throw new BD("`paymaster` must be provided when `paymasterInput` is defined")}(e);const m=[r?yz(r):"0x",c?yz(c):"0x",o?yz(o):"0x",n?yz(n):"0x",s??"0x",a?yz(a):"0x",f??"0x",yz(t),yz(""),yz(""),yz(t),i??"0x",p?yz(p):"0x",u??[],l??"0x",d&&h?[d,h]:[]];return fH(["0x71",oV(m)])}(e):CV(e,t)};const hY=G$({id:324,name:"zkSync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]},public:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"zkExplorer",url:"https://explorer.zksync.io"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}}},{serializers:dY,formatters:uY}),pY=G$({id:280,name:"zkSync Era Testnet",network:"zksync-era-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://testnet.era.zksync.dev"],webSocket:["wss://testnet.era.zksync.dev/ws"]},public:{http:["https://testnet.era.zksync.dev"],webSocket:["wss://testnet.era.zksync.dev/ws"]}},blockExplorers:{default:{name:"zkExplorer",url:"https://goerli.explorer.zksync.io"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}},testnet:!0},{serializers:dY,formatters:uY}),fY=G$({id:300,name:"zkSync Sepolia Testnet",network:"zksync-sepolia-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.era.zksync.dev"],webSocket:["wss://sepolia.era.zksync.dev/ws"]},public:{http:["https://sepolia.era.zksync.dev"],webSocket:["wss://sepolia.era.zksync.dev/ws"]}},blockExplorers:{default:{name:"zkExplorer",url:"https://sepolia.explorer.zksync.io/"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}},testnet:!0},{serializers:dY,formatters:uY}),mY=G$({id:7001,name:"ZetaChain Athens Testnet",network:"zetachain-athens-testnet",nativeCurrency:{decimals:18,name:"Zeta",symbol:"aZETA"},rpcUrls:{public:{http:["https://zetachain-athens-evm.blockpi.network/v1/rpc/public"]},default:{http:["https://zetachain-athens-evm.blockpi.network/v1/rpc/public"]}},blockExplorers:{default:{name:"ZetaScan",url:"https://athens3.explorer.zetachain.com"}},testnet:!0}),bY=G$({id:32769,name:"Zilliqa",network:"zilliqa",nativeCurrency:{name:"Zilliqa",symbol:"ZIL",decimals:18},rpcUrls:{default:{http:["https://api.zilliqa.com"]},public:{http:["https://api.zilliqa.com"]}},blockExplorers:{default:{name:"Ethernal",url:"https://evmx.zilliqa.com"}},testnet:!1}),gY=G$({id:33101,name:"Zilliqa Testnet",network:"zilliqa-testnet",nativeCurrency:{name:"Zilliqa",symbol:"ZIL",decimals:18},rpcUrls:{default:{http:["https://dev-api.zilliqa.com"]},public:{http:["https://dev-api.zilliqa.com"]}},blockExplorers:{default:{name:"Ethernal",url:"https://evmx.testnet.zilliqa.com"}},testnet:!0}),yY=G$({id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:5882}}},{formatters:XW}),vY=G$({id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:83160}},testnet:!0},{formatters:XW}),wY=G$({id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:189123}},testnet:!0},{formatters:XW});var xY=Object.freeze({__proto__:null,acala:zW,arbitrum:HW,arbitrumGoerli:GW,arbitrumNova:qW,arbitrumSepolia:VW,astar:$W,astarZkatana:WW,aurora:ZW,auroraTestnet:QW,avalanche:KW,avalancheFuji:YW,bahamut:JW,base:eZ,baseGoerli:tZ,baseSepolia:nZ,bearNetworkChainMainnet:rZ,bearNetworkChainTestnet:sZ,bitTorrent:iZ,bitTorrentTestnet:aZ,boba:oZ,bronos:cZ,bronosTestnet:lZ,bsc:uZ,bscTestnet:dZ,bxn:hZ,bxnTestnet:pZ,canto:fZ,celo:EZ,celoAlfajores:AZ,celoCannoli:PZ,chiliz:CZ,classic:_Z,confluxESpace:SZ,confluxESpaceTestnet:IZ,coreDao:BZ,cronos:TZ,cronosTestnet:MZ,crossbell:OZ,dfk:NZ,dogechain:RZ,edgeware:FZ,edgewareTestnet:jZ,ekta:HZ,ektaTestnet:GZ,eos:LZ,eosTestnet:UZ,evmos:DZ,evmosTestnet:zZ,fantom:qZ,fantomSonicTestnet:$Z,fantomTestnet:VZ,fibo:WZ,filecoin:ZZ,filecoinCalibration:QZ,filecoinHyperspace:KZ,flare:YZ,flareTestnet:JZ,foundry:XZ,fuse:eQ,fuseSparknet:tQ,gnosis:cQ,gnosisChiado:lQ,gobi:aQ,goerli:oQ,haqqMainnet:hQ,haqqTestedge2:pQ,hardhat:uQ,harmonyOne:dQ,holesky:fQ,iotex:nQ,iotexTestnet:rQ,jbc:sQ,karura:iQ,kava:mQ,kavaTestnet:bQ,klaytn:gQ,klaytnBaobab:yQ,kroma:vQ,kromaSepolia:wQ,linea:xQ,lineaTestnet:kQ,localhost:EQ,lukso:AQ,mainnet:CQ,mandala:PQ,manta:_Q,mantaTestnet:SQ,mantle:IQ,mantleTestnet:BQ,meter:TQ,meterTestnet:MQ,metis:OQ,metisGoerli:NQ,mev:RQ,mevTestnet:FQ,modeTestnet:jQ,moonbaseAlpha:LQ,moonbeam:UQ,moonbeamDev:DQ,moonriver:zQ,neonDevnet:HQ,neonMainnet:GQ,nexi:qQ,nexilix:$Q,oasisTestnet:WQ,oasys:VQ,okc:ZQ,opBNB:JQ,opBNBTestnet:XQ,optimism:QQ,optimismGoerli:KQ,optimismSepolia:YQ,pgn:eK,pgnTestnet:tK,plinga:nK,polygon:rK,polygonMumbai:sK,polygonZkEvm:aK,polygonZkEvmTestnet:iK,pulsechain:oK,pulsechainV4:cK,qMainnet:lK,qTestnet:uK,rollux:dK,rolluxTestnet:hK,ronin:pK,rootstock:fK,saigon:mK,sapphire:bK,sapphireTestnet:gK,scroll:yK,scrollSepolia:vK,scrollTestnet:wK,sepolia:xK,shardeumSphinx:HK,shibarium:GK,shimmer:kK,shimmerTestnet:EK,skaleBlockBrawlers:AK,skaleCalypso:CK,skaleCalypsoTestnet:PK,skaleChaosTestnet:_K,skaleCryptoBlades:SK,skaleCryptoColosseum:IK,skaleEuropa:BK,skaleEuropaTestnet:TK,skaleExorde:MK,skaleHumanProtocol:OK,skaleNebula:NK,skaleNebulaTestnet:RK,skaleRazor:FK,skaleTitan:jK,skaleTitanTestnet:LK,songbird:UK,songbirdTestnet:DK,spicy:zK,syscoin:qK,syscoinTestnet:$K,taikoJolnir:WK,taikoTestnetSepolia:ZK,taraxa:VK,taraxaTestnet:QK,telos:KK,telosTestnet:YK,tenet:JK,thunderTestnet:XK,vechain:eY,wanchain:tY,wanchainTestnet:nY,wemix:rY,wemixTestnet:sY,xdc:iY,xdcTestnet:aY,zetachainAthensTestnet:mY,zhejiang:oY,zilliqa:bY,zilliqaTestnet:gY,zkFair:cY,zkFairTestnet:lY,zkSync:hY,zkSyncSepoliaTestnet:fY,zkSyncTestnet:pY,zora:yY,zoraSepolia:vY,zoraTestnet:wY});const kY="https://meta-aa-provider.onrender.com/api/v1/bundler",EY="https://meta-aa-provider.onrender.com/api/v1/paymaster",AY="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",CY="0x8ae01fcf7c655655ff2c6ef907b8b4718ab4e17c",PY="0x0DA6a956B9488eD4dd761E59f52FDc6c8068E6B5",_Y={USDC:{1:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",137:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",42161:"0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",43114:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"},PEPE:{1:"0x6982508145454Ce325dDbE47a25d4ec3d2311933"}},SY={[_Y.USDC[1]]:PV("100",6),[_Y.USDC[5]]:PV("100",6),[_Y.USDC[137]]:PV("10",6),[_Y.USDC[42161]]:PV("10",6),[_Y.USDC[43114]]:PV("10",6),[_Y.PEPE[1]]:PV("50000000",18),"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B":PV("100",18)},IY=new Map([[rK.id,30000000000n]]),BY="f36f7f706a58477884ce6fe89165666c",TY={1:`https://mainnet.infura.io/v3/${BY}`,5:`https://goerli.infura.io/v3/${BY}`,11155111:"https://fittest-ultra-aura.ethereum-sepolia.quiknode.pro/3893d01b1dd411fdfa9b6dd372dd2b4f69fcf1ea/",137:`https://polygon-mainnet.infura.io/v3/${BY}`,80001:`https://polygon-mumbai.infura.io/v3/${BY}`,80002:`https://polygon-amoy.infura.io/v3/${BY}`,10:`https://optimism-mainnet.infura.io/v3/${BY}`,420:`https://optimism-goerli.infura.io/v3/${BY}`,42161:`https://arbitrum-mainnet.infura.io/v3/${BY}`,421613:`https://arbitrum-goerli.infura.io/v3/${BY}`,43114:`https://avalanche-mainnet.infura.io/v3/${BY}`,43113:`https://avalanche-fuji.infura.io/v3/${BY}`,1313161554:`https://aurora-mainnet.infura.io/v3/${BY}`,1313161555:`https://aurora-testnet.infura.io/v3/${BY}`,56:"https://neat-greatest-layer.bsc.quiknode.pro/9405a499ceee314e5f2f68c9d47518d3537fce6a/",8453:"https://twilight-red-tree.base-mainnet.quiknode.pro/dc6eb27bf0f917df215922488dd97f4de7d9b08e/",84531:"https://icy-long-mountain.base-goerli.quiknode.pro/5b80d93e97cc9412a63c10a30841869abbef9596/",100:"https://thrilling-fluent-film.xdai.quiknode.pro/305955cffb9868cdd95b5e3dc9775f20678ad9ac/",10200:"https://nd-810-853-201.p2pify.com/e828b09f0d43591de96c297b3f36fffd",59144:`https://linea-mainnet.infura.io/v3/${BY}`,59140:`https://linea-goerli.infura.io/v3/${BY}`,204:"https://opbnb.rpc.thirdweb.com/eed98c1f30120c0508f17c1f01d3102b",42069:"https://rpc.op-testnet.gelato.digital",1261120:"https://rpc.zkatana.gelato.digital",84532:"https://floral-old-feather.base-sepolia.quiknode.pro/4c3b4295d0c174410872b1e461a91cc33c7969a9/",421614:`https://arbitrum-sepolia.infura.io/v3/${BY}`,11155420:`https://optimism-sepolia.infura.io/v3/${BY}`,42220:`https://celo-mainnet.infura.io/v3/${BY}`,44787:`https://celo-alfajores.infura.io/v3/${BY}`,168587773:"https://168587773.rpc.thirdweb.com/eed98c1f30120c0508f17c1f01d3102b",81457:"https://rpc.blast.io",3776:"https://rpc.startale.com/astar-zkevm",122:"https://rpc.fuse.io",42170:"https://nova.arbitrum.io/rpc",94204209:"https://rpc.polygon-blackberry.gelato.digital",88153591557:"https://rpc.arb-blueberry.gelato.digital",123420111:"https://rpc.opcelestia-raspberry.gelato.digital",6038361:"https://rpc.startale.com/zkyoto",666666666:"https://rpc.degen.tips",7560:"https://cyber.alt.technology",111557560:"https://cyber-testnet.alt.technology"};var MY;!function(e){e.sudo="0x00000000",e.plugin="0x00000001",e.enable="0x00000002"}(MY||(MY={}));class OY{constructor(e){Object.defineProperty(this,"validatorAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"projectId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"entryPointAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"enableSignature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"validUntil",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"validAfter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"executor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"selector",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rpcUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"publicClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.projectId=e.projectId,this.validatorAddress=e.validatorAddress??"0xd9AB5096a832b9ce79914329DAEE236f8Eea0390",this.mode=e.mode??MY.sudo,this.entryPointAddress=e.entryPointAddress??AY,this.enableSignature=e.enableSignature,this.validUntil=e.validUntil??0,this.validAfter=e.validAfter??0,this.executor=e.executor,this.selector=e.selector,this.chain=e.chain,this.rpcUrl=e.rpcUrl,this.publicClient=rW({transport:p$(e.rpcUrl??TY[this.chain?.id??sK.id]),chain:this.chain??sK})}shouldDelegateViaFallback(){return!0}getPluginValidatorData(){if(!this.selector||!this.executor)throw Error("Plugin Validator data params uninitialised");return{selector:this.selector,executor:this.executor,validAfter:this.validAfter,validUntil:this.validUntil}}getNonceKey(){return 0n}async getDynamicDummySignature(e,t){const n=await this.resolveValidatorMode(e,t);if(n===MY.enable){const n=await this.getEnableData(e),r=n.length/2-1,s=65,i=fH(["0x000000000000000000000000",this.getAddress(),this.executor]);return fH([MY.enable,i,sz(yz(r),{size:32}),n,sz(yz(s),{size:32}),"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",await this.getDummyUserOpSignature(t)])}return fH([n,await this.getDummyUserOpSignature(t)])}setEnableSignature(e){this.enableSignature=e}getEnableSignature(){return this.enableSignature}getAddress(){return this.validatorAddress}getPublicClient(){if(!this.publicClient)throw new Error("Validator uninitialized: PublicClient missing");return this.publicClient}async approveExecutor(e,t,n,r,s,i){if(!this.chain)throw new Error("Validator uninitialized");let a;try{const t=await this.getPublicClient().getStorageAt({address:e,slot:"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"});a=t?"0x"+t.slice(26):t}catch(e){}const o=e,c=await this.signer();return await c.signTypedData({domain:{name:"Kernel",version:a?.toLowerCase()===PY.toLowerCase()||a?.toLowerCase()==="0x8dD4DBB54d8A8Cf0DE6F9CCC4609470A30EfF18C".toLowerCase()||void 0===a||"0x0000000000000000000000000000000000000000"===a?"0.2.2":"0.2.1",chainId:this.chain.id,verifyingContract:o},types:{ValidatorApproved:[{name:"sig",type:"bytes4"},{name:"validatorData",type:"uint256"},{name:"executor",type:"address"},{name:"enableData",type:"bytes"}]},message:{sig:t,validatorData:pz(fH([sz(yz(r),{size:6}),sz(yz(s),{size:6}),i.getAddress()]),{size:32}),executor:n,enableData:await i.getEnableData(e)},primaryType:"ValidatorApproved"})}async resolveValidatorMode(e,t){if(!this.chain||!this.publicClient)throw new Error("Validator uninitialized");let n;try{const r=await this.publicClient.readContract({abi:uO,address:e,functionName:"getDefaultValidator"});n=r?.toLowerCase()===this.validatorAddress.toLowerCase()||this.mode===MY.sudo?MY.sudo:await this.isPluginEnabled(e,t.toString().slice(0,10))?MY.plugin:MY.enable}catch(e){n=this.mode===MY.plugin?MY.enable:this.mode}return n}async getSignature(e){const t=await this.resolveValidatorMode(e.sender,e.callData);if(t===MY.sudo||t===MY.plugin)return fH([this.mode,await this.signUserOp(e)]);{const n=await this.getEnableData(e.sender),r=n.length/2-1,s=this.getEnableSignature();if(!s)throw new Error("Enable signature not set");return pH([t,sz(yz(this.validUntil),{size:6}),sz(yz(this.validAfter),{size:6}),sz(this.validatorAddress,{size:20}),sz(this.executor,{size:20}),sz(yz(r),{size:32}),n,sz(yz(s.length/2-1),{size:32}),s,await this.signUserOp(e)])}}}function NY(){throw new Error("setTimeout has not been defined")}function RY(){throw new Error("clearTimeout has not been defined")}var FY=NY,jY=RY;function LY(e){if(FY===setTimeout)return setTimeout(e,0);if((FY===NY||!FY)&&setTimeout)return FY=setTimeout,setTimeout(e,0);try{return FY(e,0)}catch(t){try{return FY.call(null,e,0)}catch(t){return FY.call(this,e,0)}}}"function"==typeof kL.setTimeout&&(FY=setTimeout),"function"==typeof kL.clearTimeout&&(jY=clearTimeout);var UY,DY=[],zY=!1,HY=-1;function GY(){zY&&UY&&(zY=!1,UY.length?DY=UY.concat(DY):HY=-1,DY.length&&qY())}function qY(){if(!zY){var e=LY(GY);zY=!0;for(var t=DY.length;t;){for(UY=DY,DY=[];++HY1)for(var n=1;n{const t=iJ.call(e);return cJ[t]||(cJ[t]=t.slice(8,-1).toLowerCase())});var cJ;const lJ=e=>(e=e.toLowerCase(),t=>oJ(t)===e),uJ=e=>t=>typeof t===e,{isArray:dJ}=Array,hJ=uJ("undefined");const pJ=lJ("ArrayBuffer");const fJ=uJ("string"),mJ=uJ("function"),bJ=uJ("number"),gJ=e=>null!==e&&"object"==typeof e,yJ=e=>{if("object"!==oJ(e))return!1;const t=aJ(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},vJ=lJ("Date"),wJ=lJ("File"),xJ=lJ("Blob"),kJ=lJ("FileList"),EJ=lJ("URLSearchParams"),[AJ,CJ,PJ,_J]=["ReadableStream","Request","Response","Headers"].map(lJ);function SJ(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),dJ(e))for(r=0,s=e.length;r0;)if(r=n[s],t===r.toLowerCase())return r;return null}const BJ="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:kL,TJ=e=>!hJ(e)&&e!==BJ;const MJ=(OJ="undefined"!=typeof Uint8Array&&aJ(Uint8Array),e=>OJ&&e instanceof OJ);var OJ;const NJ=lJ("HTMLFormElement"),RJ=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),FJ=lJ("RegExp"),jJ=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};SJ(n,((n,s)=>{let i;!1!==(i=t(n,s,e))&&(r[s]=i||n)})),Object.defineProperties(e,r)},LJ="abcdefghijklmnopqrstuvwxyz",UJ="0123456789",DJ={DIGIT:UJ,ALPHA:LJ,ALPHA_DIGIT:LJ+LJ.toUpperCase()+UJ};const zJ=lJ("AsyncFunction"),HJ=(GJ="function"==typeof setImmediate,qJ=mJ(BJ.postMessage),GJ?setImmediate:qJ?($J=`axios@${Math.random()}`,VJ=[],BJ.addEventListener("message",(({source:e,data:t})=>{e===BJ&&t===$J&&VJ.length&&VJ.shift()()}),!1),e=>{VJ.push(e),BJ.postMessage($J,"*")}):e=>setTimeout(e));var GJ,qJ,$J,VJ;const WJ="undefined"!=typeof queueMicrotask?queueMicrotask.bind(BJ):void 0!==rJ&&rJ.nextTick||HJ;var ZJ={isArray:dJ,isArrayBuffer:pJ,isBuffer:function(e){return null!==e&&!hJ(e)&&null!==e.constructor&&!hJ(e.constructor)&&mJ(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||mJ(e.append)&&("formdata"===(t=oJ(e))||"object"===t&&mJ(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&pJ(e.buffer),t},isString:fJ,isNumber:bJ,isBoolean:e=>!0===e||!1===e,isObject:gJ,isPlainObject:yJ,isReadableStream:AJ,isRequest:CJ,isResponse:PJ,isHeaders:_J,isUndefined:hJ,isDate:vJ,isFile:wJ,isBlob:xJ,isRegExp:FJ,isFunction:mJ,isStream:e=>gJ(e)&&mJ(e.pipe),isURLSearchParams:EJ,isTypedArray:MJ,isFileList:kJ,forEach:SJ,merge:function e(){const{caseless:t}=TJ(this)&&this||{},n={},r=(r,s)=>{const i=t&&IJ(n,s)||s;yJ(n[i])&&yJ(r)?n[i]=e(n[i],r):yJ(r)?n[i]=e({},r):dJ(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e(SJ(t,((t,r)=>{n&&mJ(t)?e[r]=sJ(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let s,i,a;const o={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],r&&!r(a,e,t)||o[a]||(t[a]=e[a],o[a]=!0);e=!1!==n&&aJ(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:oJ,kindOfTest:lJ,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(dJ(e))return e;let t=e.length;if(!bJ(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:NJ,hasOwnProperty:RJ,hasOwnProp:RJ,reduceDescriptors:jJ,freezeMethods:e=>{jJ(e,((t,n)=>{if(mJ(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];mJ(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return dJ(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:IJ,global:BJ,isContextDefined:TJ,ALPHABET:DJ,generateString:(e=16,t=DJ.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&mJ(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(gJ(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const s=dJ(e)?[]:{};return SJ(e,((e,t)=>{const i=n(e,r+1);!hJ(i)&&(s[t]=i)})),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:zJ,isThenable:e=>e&&(gJ(e)||mJ(e))&&mJ(e.then)&&mJ(e.catch),setImmediate:HJ,asap:WJ},QJ=[],KJ=[],YJ="undefined"!=typeof Uint8Array?Uint8Array:Array,JJ=!1;function XJ(){JJ=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)QJ[t]=e[t],KJ[e.charCodeAt(t)]=t;KJ["-".charCodeAt(0)]=62,KJ["_".charCodeAt(0)]=63}function eX(e,t,n){for(var r,s,i=[],a=t;a>18&63]+QJ[s>>12&63]+QJ[s>>6&63]+QJ[63&s]);return i.join("")}function tX(e){var t;JJ||XJ();for(var n=e.length,r=n%3,s="",i=[],a=16383,o=0,c=n-r;oc?c:o+a));return 1===r?(t=e[n-1],s+=QJ[t>>2],s+=QJ[t<<4&63],s+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],s+=QJ[t>>10],s+=QJ[t>>4&63],s+=QJ[t<<2&63],s+="="),i.push(s),i.join("")}function nX(e,t,n,r,s){var i,a,o=8*s-r-1,c=(1<>1,u=-7,d=n?s-1:0,h=n?-1:1,p=e[t+d];for(d+=h,i=p&(1<<-u)-1,p>>=-u,u+=o;u>0;i=256*i+e[t+d],d+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=h,u-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=l}return(p?-1:1)*a*Math.pow(2,i-r)}function rX(e,t,n,r,s,i){var a,o,c,l=8*i-s-1,u=(1<>1,h=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?h/c:h*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=u?(o=0,a=u):a+d>=1?(o=(t*c-1)*Math.pow(2,s),a+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,s),a=0));s>=8;e[n+p]=255&o,p+=f,o/=256,s-=8);for(a=a<0;e[n+p]=255&a,p+=f,a/=256,l-=8);e[n+p-f]|=128*m}var sX={}.toString,iX=Array.isArray||function(e){return"[object Array]"==sX.call(e)};lX.TYPED_ARRAY_SUPPORT=void 0===kL.TYPED_ARRAY_SUPPORT||kL.TYPED_ARRAY_SUPPORT;var aX=oX();function oX(){return lX.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function cX(e,t){if(oX()=oX())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oX().toString(16)+" bytes");return 0|e}function mX(e){return!(null==e||!e._isBuffer)}function bX(e,t){if(mX(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return GX(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return qX(e).length;default:if(r)return GX(e).length;t=(""+t).toLowerCase(),r=!0}}function gX(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return MX(this,t,n);case"utf8":case"utf-8":return SX(this,t,n);case"ascii":return BX(this,t,n);case"latin1":case"binary":return TX(this,t,n);case"base64":return _X(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return OX(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function yX(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function vX(e,t,n,r,s){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=s?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(s)return-1;n=e.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof t&&(t=lX.from(t,r)),mX(t))return 0===t.length?-1:wX(e,t,n,r,s);if("number"==typeof t)return t&=255,lX.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):wX(e,[t],n,r,s);throw new TypeError("val must be string, number or Buffer")}function wX(e,t,n,r,s){var i,a=1,o=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,o/=2,c/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(s){var u=-1;for(i=n;io&&(n=o-c),i=n;i>=0;i--){for(var d=!0,h=0;hs&&(r=s):r=s;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,s=n%256,i.push(s),i.push(r);return i}(t,e.length-n),e,n,r)}function _X(e,t,n){return 0===t&&n===e.length?tX(e):tX(e.slice(t,n))}function SX(e,t,n){n=Math.min(e.length,n);for(var r=[],s=t;s239?4:l>223?3:l>191?2:1;if(s+d<=n)switch(d){case 1:l<128&&(u=l);break;case 2:128==(192&(i=e[s+1]))&&(c=(31&l)<<6|63&i)>127&&(u=c);break;case 3:i=e[s+1],a=e[s+2],128==(192&i)&&128==(192&a)&&(c=(15&l)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:i=e[s+1],a=e[s+2],o=e[s+3],128==(192&i)&&128==(192&a)&&128==(192&o)&&(c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&o)>65535&&c<1114112&&(u=c)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),s+=d}return function(e){var t=e.length;if(t<=IX)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},lX.prototype.compare=function(e,t,n,r,s){if(!mX(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===s&&(s=this.length),t<0||n>e.length||r<0||s>this.length)throw new RangeError("out of range index");if(r>=s&&t>=n)return 0;if(r>=s)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(s>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),o=Math.min(i,a),c=this.slice(r,s),l=e.slice(t,n),u=0;us)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return xX(this,e,t,n);case"utf8":case"utf-8":return kX(this,e,t,n);case"ascii":return EX(this,e,t,n);case"latin1":case"binary":return AX(this,e,t,n);case"base64":return CX(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return PX(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},lX.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var IX=4096;function BX(e,t,n){var r="";n=Math.min(e.length,n);for(var s=t;sr)&&(n=r);for(var s="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function RX(e,t,n,r,s,i){if(!mX(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||te.length)throw new RangeError("Index out of range")}function FX(e,t,n,r){t<0&&(t=65535+t+1);for(var s=0,i=Math.min(e.length-n,2);s>>8*(r?s:1-s)}function jX(e,t,n,r){t<0&&(t=4294967295+t+1);for(var s=0,i=Math.min(e.length-n,4);s>>8*(r?s:3-s)&255}function LX(e,t,n,r,s,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function UX(e,t,n,r,s){return s||LX(e,0,n,4),rX(e,t,n,r,23,4),n+4}function DX(e,t,n,r,s){return s||LX(e,0,n,8),rX(e,t,n,r,52,8),n+8}lX.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(s*=256);)r+=this[e+--t]*s;return r},lX.prototype.readUInt8=function(e,t){return t||NX(e,1,this.length),this[e]},lX.prototype.readUInt16LE=function(e,t){return t||NX(e,2,this.length),this[e]|this[e+1]<<8},lX.prototype.readUInt16BE=function(e,t){return t||NX(e,2,this.length),this[e]<<8|this[e+1]},lX.prototype.readUInt32LE=function(e,t){return t||NX(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},lX.prototype.readUInt32BE=function(e,t){return t||NX(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},lX.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||NX(e,t,this.length);for(var r=this[e],s=1,i=0;++i=(s*=128)&&(r-=Math.pow(2,8*t)),r},lX.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||NX(e,t,this.length);for(var r=t,s=1,i=this[e+--r];r>0&&(s*=256);)i+=this[e+--r]*s;return i>=(s*=128)&&(i-=Math.pow(2,8*t)),i},lX.prototype.readInt8=function(e,t){return t||NX(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},lX.prototype.readInt16LE=function(e,t){t||NX(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},lX.prototype.readInt16BE=function(e,t){t||NX(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},lX.prototype.readInt32LE=function(e,t){return t||NX(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},lX.prototype.readInt32BE=function(e,t){return t||NX(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},lX.prototype.readFloatLE=function(e,t){return t||NX(e,4,this.length),nX(this,e,!0,23,4)},lX.prototype.readFloatBE=function(e,t){return t||NX(e,4,this.length),nX(this,e,!1,23,4)},lX.prototype.readDoubleLE=function(e,t){return t||NX(e,8,this.length),nX(this,e,!0,52,8)},lX.prototype.readDoubleBE=function(e,t){return t||NX(e,8,this.length),nX(this,e,!1,52,8)},lX.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||RX(this,e,t,n,Math.pow(2,8*n)-1,0);var s=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+s]=e/i&255;return t+n},lX.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||RX(this,e,t,1,255,0),lX.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},lX.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||RX(this,e,t,2,65535,0),lX.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):FX(this,e,t,!0),t+2},lX.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||RX(this,e,t,2,65535,0),lX.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):FX(this,e,t,!1),t+2},lX.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||RX(this,e,t,4,4294967295,0),lX.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):jX(this,e,t,!0),t+4},lX.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||RX(this,e,t,4,4294967295,0),lX.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):jX(this,e,t,!1),t+4},lX.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var s=Math.pow(2,8*n-1);RX(this,e,t,n,s-1,-s)}var i=0,a=1,o=0;for(this[t]=255&e;++i=0&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+n},lX.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||RX(this,e,t,1,127,-128),lX.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},lX.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||RX(this,e,t,2,32767,-32768),lX.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):FX(this,e,t,!0),t+2},lX.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||RX(this,e,t,2,32767,-32768),lX.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):FX(this,e,t,!1),t+2},lX.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||RX(this,e,t,4,2147483647,-2147483648),lX.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):jX(this,e,t,!0),t+4},lX.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||RX(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),lX.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):jX(this,e,t,!1),t+4},lX.prototype.writeFloatLE=function(e,t,n){return UX(this,e,t,!0,n)},lX.prototype.writeFloatBE=function(e,t,n){return UX(this,e,t,!1,n)},lX.prototype.writeDoubleLE=function(e,t,n){return DX(this,e,t,!0,n)},lX.prototype.writeDoubleBE=function(e,t,n){return DX(this,e,t,!1,n)},lX.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--s)e[s+t]=this[s+n];else if(i<1e3||!lX.TYPED_ARRAY_SUPPORT)for(s=0;s>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!s){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}s=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),s=n;continue}n=65536+(s-55296<<10|n-56320)}else s&&(t-=3)>-1&&i.push(239,191,189);if(s=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function qX(e){return function(e){var t,n,r,s,i,a;JJ||XJ();var o=e.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i="="===e[o-2]?2:"="===e[o-1]?1:0,a=new YJ(3*o/4-i),r=i>0?o-4:o;var c=0;for(t=0,n=0;t>16&255,a[c++]=s>>8&255,a[c++]=255&s;return 2===i?(s=KJ[e.charCodeAt(t)]<<2|KJ[e.charCodeAt(t+1)]>>4,a[c++]=255&s):1===i&&(s=KJ[e.charCodeAt(t)]<<10|KJ[e.charCodeAt(t+1)]<<4|KJ[e.charCodeAt(t+2)]>>2,a[c++]=s>>8&255,a[c++]=255&s),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(zX,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $X(e,t,n,r){for(var s=0;s=t.length||s>=e.length);++s)t[s+n]=e[s];return s}function VX(e){return null!=e&&(!!e._isBuffer||WX(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&WX(e.slice(0,0))}(e))}function WX(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var ZX=Object.freeze({__proto__:null,Buffer:lX,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),lX.alloc(+e)},isBuffer:VX,kMaxLength:aX});function QX(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}ZJ.inherits(QX,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ZJ.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const KX=QX.prototype,YX={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{YX[e]={value:e}})),Object.defineProperties(QX,YX),Object.defineProperty(KX,"isAxiosError",{value:!0}),QX.from=(e,t,n,r,s,i)=>{const a=Object.create(KX);return ZJ.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),QX.call(a,e.message,t,n,r,s),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};function JX(e){return ZJ.isPlainObject(e)||ZJ.isArray(e)}function XX(e){return ZJ.endsWith(e,"[]")?e.slice(0,-2):e}function e0(e,t,n){return e?e.concat(t).map((function(e,t){return e=XX(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const t0=ZJ.toFlatObject(ZJ,{},null,(function(e){return/^is[A-Z]/.test(e)}));function n0(e,t,n){if(!ZJ.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=ZJ.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!ZJ.isUndefined(t[e])}))).metaTokens,s=n.visitor||l,i=n.dots,a=n.indexes,o=(n.Blob||"undefined"!=typeof Blob&&Blob)&&ZJ.isSpecCompliantForm(t);if(!ZJ.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(ZJ.isDate(e))return e.toISOString();if(!o&&ZJ.isBlob(e))throw new QX("Blob is not supported. Use a Buffer instead.");return ZJ.isArrayBuffer(e)||ZJ.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):lX.from(e):e}function l(e,n,s){let o=e;if(e&&!s&&"object"==typeof e)if(ZJ.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(ZJ.isArray(e)&&function(e){return ZJ.isArray(e)&&!e.some(JX)}(e)||(ZJ.isFileList(e)||ZJ.endsWith(n,"[]"))&&(o=ZJ.toArray(e)))return n=XX(n),o.forEach((function(e,r){!ZJ.isUndefined(e)&&null!==e&&t.append(!0===a?e0([n],r,i):null===a?n:n+"[]",c(e))})),!1;return!!JX(e)||(t.append(e0(s,n,i),c(e)),!1)}const u=[],d=Object.assign(t0,{defaultVisitor:l,convertValue:c,isVisitable:JX});if(!ZJ.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!ZJ.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),ZJ.forEach(n,(function(n,i){!0===(!(ZJ.isUndefined(n)||null===n)&&s.call(t,n,ZJ.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])})),u.pop()}}(e),t}function r0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function s0(e,t){this._pairs=[],e&&n0(e,this,t)}const i0=s0.prototype;function a0(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function o0(e,t,n){if(!t)return e;const r=n&&n.encode||a0,s=n&&n.serialize;let i;if(i=s?s(t,n):ZJ.isURLSearchParams(t)?t.toString():new s0(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}i0.append=function(e,t){this._pairs.push([e,t])},i0.toString=function(e){const t=e?function(t){return e.call(this,t,r0)}:r0;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class c0{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ZJ.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var l0={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},u0={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:s0,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const d0="undefined"!=typeof window&&"undefined"!=typeof document,h0=(p0="undefined"!=typeof navigator&&navigator.product,d0&&["ReactNative","NativeScript","NS"].indexOf(p0)<0);var p0;const f0="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,m0=d0&&window.location.href||"http://localhost";var b0={...Object.freeze({__proto__:null,hasBrowserEnv:d0,hasStandardBrowserEnv:h0,hasStandardBrowserWebWorkerEnv:f0,origin:m0}),...u0};function g0(e){function t(e,n,r,s){let i=e[s++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),o=s>=e.length;if(i=!i&&ZJ.isArray(r)?r.length:i,o)return ZJ.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&ZJ.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],s)&&ZJ.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r{t(function(e){return ZJ.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const y0={transitional:l0,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=ZJ.isObject(e);s&&ZJ.isHTMLForm(e)&&(e=new FormData(e));if(ZJ.isFormData(e))return r?JSON.stringify(g0(e)):e;if(ZJ.isArrayBuffer(e)||ZJ.isBuffer(e)||ZJ.isStream(e)||ZJ.isFile(e)||ZJ.isBlob(e)||ZJ.isReadableStream(e))return e;if(ZJ.isArrayBufferView(e))return e.buffer;if(ZJ.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return n0(e,new b0.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return b0.isNode&&ZJ.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=ZJ.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return n0(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(ZJ.isString(e))try{return(t||JSON.parse)(e),ZJ.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||y0.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(ZJ.isResponse(e)||ZJ.isReadableStream(e))return e;if(e&&ZJ.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw QX.from(e,QX.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:b0.classes.FormData,Blob:b0.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ZJ.forEach(["delete","get","head","post","put","patch"],(e=>{y0.headers[e]={}}));const v0=ZJ.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const w0=Symbol("internals");function x0(e){return e&&String(e).trim().toLowerCase()}function k0(e){return!1===e||null==e?e:ZJ.isArray(e)?e.map(k0):String(e)}function E0(e,t,n,r,s){return ZJ.isFunction(r)?r.call(this,t,n):(s&&(t=n),ZJ.isString(t)?ZJ.isString(r)?-1!==t.indexOf(r):ZJ.isRegExp(r)?r.test(t):void 0:void 0)}let A0=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=x0(t);if(!s)throw new Error("header name must be a non-empty string");const i=ZJ.findKey(r,s);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=k0(e))}const i=(e,t)=>ZJ.forEach(e,((e,n)=>s(e,n,t)));if(ZJ.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(ZJ.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),r=e.substring(s+1).trim(),!n||t[n]&&v0[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(ZJ.isHeaders(e))for(const[t,r]of e.entries())s(r,t,n);else null!=e&&s(t,e,n);return this}get(e,t){if(e=x0(e)){const n=ZJ.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(ZJ.isFunction(t))return t.call(this,e,n);if(ZJ.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=x0(e)){const n=ZJ.findKey(this,e);return!(!n||void 0===this[n]||t&&!E0(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=x0(e)){const s=ZJ.findKey(n,e);!s||t&&!E0(0,n[s],s,t)||(delete n[s],r=!0)}}return ZJ.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const s=t[n];e&&!E0(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return ZJ.forEach(this,((r,s)=>{const i=ZJ.findKey(n,s);if(i)return t[i]=k0(r),void delete t[s];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(s):String(s).trim();a!==s&&delete t[s],t[a]=k0(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ZJ.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&ZJ.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[w0]=this[w0]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=x0(e);t[r]||(!function(e,t){const n=ZJ.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,s){return this[r].call(this,t,e,n,s)},configurable:!0})}))}(n,e),t[r]=!0)}return ZJ.isArray(e)?e.forEach(r):r(e),this}};function C0(e,t){const n=this||y0,r=t||n,s=A0.from(r.headers);let i=r.data;return ZJ.forEach(e,(function(e){i=e.call(n,i,s.normalize(),t?t.status:void 0)})),s.normalize(),i}function P0(e){return!(!e||!e.__CANCEL__)}function _0(e,t,n){QX.call(this,null==e?"canceled":e,QX.ERR_CANCELED,t,n),this.name="CanceledError"}function S0(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new QX("Request failed with status code "+n.status,[QX.ERR_BAD_REQUEST,QX.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}A0.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ZJ.reduceDescriptors(A0.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),ZJ.freezeMethods(A0),ZJ.inherits(_0,QX,{__CANCEL__:!0});const I0=(e,t,n=3)=>{let r=0;const s=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s,i=0,a=0;return t=void 0!==t?t:1e3,function(o){const c=Date.now(),l=r[a];s||(s=c),n[i]=o,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-s{s=i,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),o=t-s;o>=i?a(e,t):(n=e,r||(r=setTimeout((()=>{r=null,a(n)}),i-o)))},()=>n&&a(n)]}((n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,o=i-r,c=s(o);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:o,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),n)},B0=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},T0=e=>(...t)=>ZJ.asap((()=>e(...t)));var M0=b0.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=ZJ.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},O0=b0.hasStandardBrowserEnv?{write(e,t,n,r,s,i){const a=[e+"="+encodeURIComponent(t)];ZJ.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),ZJ.isString(r)&&a.push("path="+r),ZJ.isString(s)&&a.push("domain="+s),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function N0(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const R0=e=>e instanceof A0?{...e}:e;function F0(e,t){t=t||{};const n={};function r(e,t,n){return ZJ.isPlainObject(e)&&ZJ.isPlainObject(t)?ZJ.merge.call({caseless:n},e,t):ZJ.isPlainObject(t)?ZJ.merge({},t):ZJ.isArray(t)?t.slice():t}function s(e,t,n){return ZJ.isUndefined(t)?ZJ.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!ZJ.isUndefined(t))return r(void 0,t)}function a(e,t){return ZJ.isUndefined(t)?ZJ.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function o(n,s,i){return i in t?r(n,s):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(e,t)=>s(R0(e),R0(t),!0)};return ZJ.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=c[r]||s,a=i(e[r],t[r],r);ZJ.isUndefined(a)&&i!==o||(n[r]=a)})),n}var j0=e=>{const t=F0({},e);let n,{data:r,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:c}=t;if(t.headers=o=A0.from(o),t.url=o0(N0(t.baseURL,t.url),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),ZJ.isFormData(r))if(b0.hasStandardBrowserEnv||b0.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(!1!==(n=o.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}if(b0.hasStandardBrowserEnv&&(s&&ZJ.isFunction(s)&&(s=s(t)),s||!1!==s&&M0(t.url))){const e=i&&a&&O0.read(a);e&&o.set(i,e)}return t};var L0="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=j0(e);let s=r.data;const i=A0.from(r.headers).normalize();let a,o,c,l,u,{responseType:d,onUploadProgress:h,onDownloadProgress:p}=r;function f(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function b(){if(!m)return;const r=A0.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());S0((function(e){t(e),f()}),(function(e){n(e),f()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=b:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(b)},m.onabort=function(){m&&(n(new QX("Request aborted",QX.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new QX("Network Error",QX.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||l0;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new QX(t,s.clarifyTimeoutError?QX.ETIMEDOUT:QX.ECONNABORTED,e,m)),m=null},void 0===s&&i.setContentType(null),"setRequestHeader"in m&&ZJ.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),ZJ.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),p&&([c,u]=I0(p,!0),m.addEventListener("progress",c)),h&&m.upload&&([o,l]=I0(h),m.upload.addEventListener("progress",o),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(a=t=>{m&&(n(!t||t.type?new _0(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===b0.protocols.indexOf(g)?n(new QX("Unsupported protocol "+g+":",QX.ERR_BAD_REQUEST,e)):m.send(s||null)}))};const U0=(e,t)=>{let n,r=new AbortController;const s=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof QX?t:new _0(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{s(new QX(`timeout ${t} of ms exceeded`,QX.ETIMEDOUT))}),t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e&&(e.removeEventListener?e.removeEventListener("abort",s):e.unsubscribe(s))})),e=null)};e.forEach((e=>e&&e.addEventListener&&e.addEventListener("abort",s)));const{signal:o}=r;return o.unsubscribe=a,[o,()=>{i&&clearTimeout(i),i=null}]},D0=function*(e,t){let n=e.byteLength;if(!t||n{const i=async function*(e,t,n){for await(const r of e)yield*D0(ArrayBuffer.isView(r)?r:await n(String(r)),t)}(e,t,s);let a,o=0,c=e=>{a||(a=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return c(),void e.close();let s=r.byteLength;if(n){let e=o+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw c(e),e}},cancel:e=>(c(e),i.return())},{highWaterMark:2})},H0="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,G0=H0&&"function"==typeof ReadableStream,q0=H0&&("function"==typeof TextEncoder?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),$0=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},V0=G0&&$0((()=>{let e=!1;const t=new Request(b0.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),W0=G0&&$0((()=>ZJ.isReadableStream(new Response("").body))),Z0={stream:W0&&(e=>e.body)};var Q0;H0&&(Q0=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Z0[e]&&(Z0[e]=ZJ.isFunction(Q0[e])?t=>t[e]():(t,n)=>{throw new QX(`Response type '${e}' is not supported`,QX.ERR_NOT_SUPPORT,n)})})));const K0=async(e,t)=>{const n=ZJ.toFiniteNumber(e.getContentLength());return null==n?(async e=>null==e?0:ZJ.isBlob(e)?e.size:ZJ.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:ZJ.isArrayBufferView(e)||ZJ.isArrayBuffer(e)?e.byteLength:(ZJ.isURLSearchParams(e)&&(e+=""),ZJ.isString(e)?(await q0(e)).byteLength:void 0))(t):n};var Y0=H0&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:i,timeout:a,onDownloadProgress:o,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:h}=j0(e);l=l?(l+"").toLowerCase():"text";let p,f,[m,b]=s||i||a?U0([s,i],a):[];const g=()=>{!p&&setTimeout((()=>{m&&m.unsubscribe()})),p=!0};let y;try{if(c&&V0&&"get"!==n&&"head"!==n&&0!==(y=await K0(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(ZJ.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=B0(y,I0(T0(c)));r=z0(n.body,65536,e,t,q0)}}ZJ.isString(d)||(d=d?"include":"omit"),f=new Request(t,{...h,signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:d});let s=await fetch(f);const i=W0&&("stream"===l||"response"===l);if(W0&&(o||i)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=s[t]}));const t=ZJ.toFiniteNumber(s.headers.get("content-length")),[n,r]=o&&B0(t,I0(T0(o),!0))||[];s=new Response(z0(s.body,65536,n,(()=>{r&&r(),i&&g()}),q0),e)}l=l||"text";let a=await Z0[ZJ.findKey(Z0,l)||"text"](s,e);return!i&&g(),b&&b(),await new Promise(((t,n)=>{S0(t,n,{data:a,headers:A0.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:f})}))}catch(t){if(g(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new QX("Network Error",QX.ERR_NETWORK,e,f),{cause:t.cause||t});throw QX.from(t,t&&t.code,e,f)}});const J0={http:null,xhr:L0,fetch:Y0};ZJ.forEach(J0,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const X0=e=>`- ${e}`,e1=e=>ZJ.isFunction(e)||null===e||!1===e;var t1=e=>{e=ZJ.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let i=0;i`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new QX("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(X0).join("\n"):" "+X0(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function n1(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _0(null,e)}function r1(e){n1(e),e.headers=A0.from(e.headers),e.data=C0.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return t1(e.adapter||y0.adapter)(e).then((function(t){return n1(e),t.data=C0.call(e,e.transformResponse,t),t.headers=A0.from(t.headers),t}),(function(t){return P0(t)||(n1(e),t&&t.response&&(t.response.data=C0.call(e,e.transformResponse,t.response),t.response.headers=A0.from(t.response.headers))),Promise.reject(t)}))}const s1="1.7.4",i1={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{i1[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const a1={};i1.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.4] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,i)=>{if(!1===e)throw new QX(r(s," has been removed"+(t?" in "+t:"")),QX.ERR_DEPRECATED);return t&&!a1[s]&&(a1[s]=!0,console.warn(r(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,i)}};var o1={assertOptions:function(e,t,n){if("object"!=typeof e)throw new QX("options must be an object",QX.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new QX("option "+i+" must be "+n,QX.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new QX("Unknown option "+i,QX.ERR_BAD_OPTION)}},validators:i1};const c1=o1.validators;let l1=class{constructor(e){this.defaults=e,this.interceptors={request:new c0,response:new c0}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=F0(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&o1.assertOptions(n,{silentJSONParsing:c1.transitional(c1.boolean),forcedJSONParsing:c1.transitional(c1.boolean),clarifyTimeoutError:c1.transitional(c1.boolean)},!1),null!=r&&(ZJ.isFunction(r)?t.paramsSerializer={serialize:r}:o1.assertOptions(r,{encode:c1.function,serialize:c1.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=s&&ZJ.merge(s.common,s[t.method]);s&&ZJ.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=A0.concat(i,s);const a=[];let o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,d=0;if(!o){const e=[r1.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);d{u1[t]=e}));const d1=function e(t){const n=new l1(t),r=sJ(l1.prototype.request,n);return ZJ.extend(r,l1.prototype,n,{allOwnKeys:!0}),ZJ.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(F0(t,n))},r}(y0);d1.Axios=l1,d1.CanceledError=_0,d1.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,s){n.reason||(n.reason=new _0(e,r,s),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let t;const n=new e((function(e){t=e}));return{token:n,cancel:t}}},d1.isCancel=P0,d1.VERSION=s1,d1.toFormData=n0,d1.AxiosError=QX,d1.Cancel=d1.CanceledError,d1.all=function(e){return Promise.all(e)},d1.spread=function(e){return function(t){return e.apply(null,t)}},d1.isAxiosError=function(e){return ZJ.isObject(e)&&!0===e.isAxiosError},d1.mergeConfig=F0,d1.AxiosHeaders=A0,d1.formToJSON=e=>g0(ZJ.isHTMLForm(e)?new FormData(e):e),d1.getAdapter=t1,d1.HttpStatusCode=u1,d1.default=d1;const{Axios:h1,AxiosError:p1,CanceledError:f1,isCancel:m1,CancelToken:b1,VERSION:g1,all:y1,Cancel:v1,isAxiosError:w1,spread:x1,toFormData:k1,AxiosHeaders:E1,HttpStatusCode:A1,formToJSON:C1,getAdapter:P1,mergeConfig:_1}=d1,S1=async(e,t)=>{try{const{data:{chainId:n}}=await d1.post(`${t??"https://backend-vikp.onrender.com"}/v1/projects/get-chain-id`,{projectId:e},{headers:{"Content-Type":"application/json"}});return n}catch(e){return void console.log(e)}},I1=G$({id:42069,name:"Gelato OPTestnet",network:"gelatoOPTestnet",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.op-testnet.gelato.digital"],webSocket:[]},public:{http:["https://rpc.op-testnet.gelato.digital"],webSocket:[]}},blockExplorers:{default:{name:"Explorer",url:"https://blockscout.op-testnet.gelato.digital"}}}),B1=G$({id:1261120,name:"Astar zKatana",network:"astarZKatana",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zkatana.gelato.digital"],webSocket:["https://ws.zkatana.gelato.digital"]},public:{http:["https://rpc.zkatana.gelato.digital"],webSocket:["https://ws.zkatana.gelato.digital"]}},blockExplorers:{default:{name:"Explorer",url:"https://zkatana.blockscout.com"}}}),T1=G$({id:3776,name:"Astar zkEVM",network:"AstarZkEVM",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.startale.com/astar-zkevm"]},public:{http:["https://rpc.startale.com/astar-zkevm"]}},blockExplorers:{default:{name:"Astar zkEVM Explorer",url:"https://astar-zkevm.explorer.startale.com"}},contracts:{multicall3:{address:"0x36eabf148272BA81A5225C6a3637972F0EE17771",blockCreated:93528}},testnet:!1}),M1=G$({id:42170,name:"Arbitrum Nova",network:"arbitrumNova",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://nova.arbitrum.io/rpc"]},public:{http:["https://nova.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://nova.arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1746963}},testnet:!1}),O1=G$({id:88153591557,name:"Arbitrum Blueberry",network:"arbitrum-blueberry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.arb-blueberry.gelato.digital"]},public:{http:["https://rpc.arb-blueberry.gelato.digital"]}},blockExplorers:{default:{name:"Gelatoscout",url:"https://arb-blueberry.gelatoscout.com"}},testnet:!0}),N1=G$({id:123420111,name:"OP Celestia Raspberry",network:"op-celestia-raspberry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.opcelestia-raspberry.gelato.digital"]},public:{http:["https://rpc.opcelestia-raspberry.gelato.digital"]}},blockExplorers:{default:{name:"Gelatoscout",url:"https://opcelestia-raspberry.gelatoscout.com"}},testnet:!0}),R1=G$({id:94204209,name:"Polygon Blackberry",network:"polybon-blackberry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.polygon-blackberry.gelato.digital"]},public:{http:["https://rpc.polygon-blackberry.gelato.digital"]}},blockExplorers:{default:{name:"Gelatoscout",url:"https://polygon-blackberry.gelatoscout.com"}},testnet:!0}),F1=G$({id:7560,name:"Cyber Mainnet",network:"cyber-mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cyber.alt.technology/"]},public:{http:["https://cyber.alt.technology/"]}},blockExplorers:{default:{name:"Cyber Mainnet Explorer",url:"https://cyber-explorer.alt.technology/"}},testnet:!1}),j1=G$({id:111557560,name:"Cyber Testnet",network:"cyber-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cyber-testnet.alt.technology"]},public:{http:["https://cyber-testnet.alt.technology"]}},blockExplorers:{default:{name:"Cyber Testnet Explorer",url:"https://cyber-testnet-explorer.alt.technology/"}},testnet:!0}),L1=G$({id:6038361,name:"Astar zkEVM Testnet zKyoto",network:"zKyoto",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.startale.com/zkyoto"]},public:{http:["https://rpc.startale.com/zkyoto"]}},blockExplorers:{default:{name:"zKyoto Explorer",url:"https://zkyoto.explorer.startale.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:196153}},testnet:!0}),U1=G$({id:666666666,name:"Degen",nativeCurrency:{decimals:18,name:"Degen",symbol:"DEGEN"},network:"degen",rpcUrls:{default:{http:["https://rpc.degen.tips"],webSocket:["wss://rpc.degen.tips"]},public:{http:["https://rpc.degen.tips"],webSocket:["wss://rpc.degen.tips"]}},blockExplorers:{default:{name:"Degen Chain Explorer",url:"https://explorer.degen.tips"}}}),D1=G$({id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://rpc-amoy.polygon.technology"]},public:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3127388}},testnet:!0});var z1=Object.freeze({__proto__:null,arbitrumBlueberry:O1,arbitrumNova:M1,astarZKatana:B1,astarZkEVM:T1,astarZkyoto:L1,cyberMainnet:F1,cyberTestnet:j1,degen:U1,gelatoOPTestnet:I1,opCelestiaRaspberry:N1,polygonAmoy:D1,polygonBlackberry:R1});let H1=!1,G1=!1;const q1={debug:1,default:2,info:2,warning:3,error:4,off:5};let $1=q1.default,V1=null;const W1=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var Z1,Q1;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(Z1||(Z1={})),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"}(Q1||(Q1={}));const K1="0123456789abcdef";class Y1{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==q1[n]&&this.throwArgumentError("invalid log level name","logLevel",e),$1>q1[n]||console.log.apply(console,t)}debug(...e){this._log(Y1.levels.DEBUG,e)}info(...e){this._log(Y1.levels.INFO,e)}warn(...e){this._log(Y1.levels.WARNING,e)}makeError(e,t,n){if(G1)return this.makeError("censored error",t,{});t||(t=Y1.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((e=>{const t=n[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e>4],n+=K1[15&t[e]];r.push(e+"=Uint8Array(0x"+n+")")}else r.push(e+"="+JSON.stringify(t))}catch(t){r.push(e+"="+JSON.stringify(n[e].toString()))}})),r.push(`code=${t}`),r.push(`version=${this.version}`);const s=e;let i="";switch(t){case Q1.NUMERIC_FAULT:{i="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":i+="-"+t;break;case"negative-power":case"negative-width":i+="-unsupported";break;case"unbound-bitwise-result":i+="-unbound-result"}break}case Q1.CALL_EXCEPTION:case Q1.INSUFFICIENT_FUNDS:case Q1.MISSING_NEW:case Q1.NONCE_EXPIRED:case Q1.REPLACEMENT_UNDERPRICED:case Q1.TRANSACTION_REPLACED:case Q1.UNPREDICTABLE_GAS_LIMIT:i=t}i&&(e+=" [ See: https://links.ethers.org/v5-errors-"+i+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=t,Object.keys(n).forEach((function(e){a[e]=n[e]})),a}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,Y1.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(e){W1&&this.throwError("platform missing String.prototype.normalize",Y1.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:W1})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,Y1.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,Y1.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",et&&this.throwError("too many arguments"+n,Y1.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",Y1.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",Y1.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",Y1.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return V1||(V1=new Y1("logger/5.7.0")),V1}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",Y1.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),H1){if(!e)return;this.globalLogger().throwError("error censorship permanent",Y1.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}G1=!!e,H1=!!t}static setLogLevel(e){const t=q1[e.toLowerCase()];null!=t?$1=t:Y1.globalLogger().warn("invalid log level - "+e)}static from(e){return new Y1(e)}}Y1.errors=Q1,Y1.levels=Z1;var J1=function(e,t,n,r){return new(n||(n=Promise))((function(s,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((r=r.apply(e,t||[])).next())}))};const X1=new Y1("properties/5.7.0");function e2(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function t2(e,t){for(let n=0;n<32;n++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function n2(e){return J1(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function r2(e){const t={};for(const n in e)t[n]=e[n];return t}const s2={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function i2(e){if(null==e||s2[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let n=0;no2(e))));if("object"==typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&e2(t,n,o2(r))}return t}return X1.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function o2(e){return a2(e)}class c2{constructor(e){for(const t in e)this[t]=o2(e[t])}}var l2=function(e,t,n,r){return new(n||(n=Promise))((function(s,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((r=r.apply(e,t||[])).next())}))};const u2=new Y1("abstract-signer/5.7.0"),d2=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],h2=[Y1.errors.INSUFFICIENT_FUNDS,Y1.errors.NONCE_EXPIRED,Y1.errors.REPLACEMENT_UNDERPRICED];class p2{constructor(){u2.checkAbstract(new.target,p2),e2(this,"_isSigner",!0)}getBalance(e){return l2(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return l2(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return l2(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield n2(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return l2(this,void 0,void 0,(function*(){this._checkProvider("call");const n=yield n2(this.checkTransaction(e));return yield this.provider.call(n,t)}))}sendTransaction(e){return l2(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),n=yield this.signTransaction(t);return yield this.provider.sendTransaction(n)}))}getChainId(){return l2(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return l2(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return l2(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return l2(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===d2.indexOf(t)&&u2.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=r2(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&u2.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return l2(this,void 0,void 0,(function*(){const t=yield n2(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>l2(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&u2.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const n=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!n?0!==t.type&&1!==t.type||!n||u2.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):u2.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(n&&u2.throwError("network does not support EIP-1559",Y1.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):u2.throwError("failed to get consistent fee data",Y1.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(h2.indexOf(e.code)>=0)throw e;return u2.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Y1.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&u2.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield n2(t)}))}_checkProvider(e){this.provider||u2.throwError("missing provider",Y1.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}const f2=new Y1("bytes/5.7.0");function m2(e){return!!e.toHexString}function b2(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return b2(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function g2(e){return E2(e)&&!(e.length%2)||v2(e)}function y2(e){return"number"==typeof e&&e==e&&e%1==0}function v2(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!y2(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function w2(e,t){if(t||(t={}),"number"==typeof e){f2.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),b2(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),m2(e)&&(e=e.toHexString()),E2(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":f2.throwArgumentError("hex data is odd-length","value",e));const r=[];for(let e=0;ew2(e))),n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);return t.reduce(((e,t)=>(r.set(t,e),e+t.length)),0),b2(r)}function k2(e){let t=w2(e);if(0===t.length)return t;let n=0;for(;n>4]+A2[15&r]}return t}return f2.throwArgumentError("invalid hexlify value","value",e)}function P2(e){if("string"!=typeof e)e=C2(e);else if(!E2(e)||e.length%2)return null;return(e.length-2)/2}function _2(e,t,n){return"string"!=typeof e?e=C2(e):(!E2(e)||e.length%2)&&f2.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function S2(e){let t="0x";return e.forEach((e=>{t+=C2(e).substring(2)})),t}function I2(e){const t=function(e){"string"!=typeof e&&(e=C2(e));E2(e)||f2.throwArgumentError("invalid hex string","value",e);e=e.substring(2);let t=0;for(;t2*t+2&&f2.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function T2(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(g2(e)){let n=w2(e);64===n.length?(t.v=27+(n[32]>>7),n[32]&=127,t.r=C2(n.slice(0,32)),t.s=C2(n.slice(32,64))):65===n.length?(t.r=C2(n.slice(0,32)),t.s=C2(n.slice(32,64)),t.v=n[64]):f2.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:f2.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=C2(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const n=function(e,t){(e=w2(e)).length>t&&f2.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(t);return n.set(e,t-e.length),b2(n)}(w2(t._vs),32);t._vs=C2(n);const r=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=r:t.recoveryParam!==r&&f2.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;const s=C2(n);null==t.s?t.s=s:t.s!==s&&f2.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?f2.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{const n=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==n&&f2.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&E2(t.r)?t.r=B2(t.r,32):f2.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&E2(t.s)?t.s=B2(t.s,32):f2.throwArgumentError("signature missing or invalid s","signature",e);const n=w2(t.s);n[0]>=128&&f2.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(n[0]|=128);const r=C2(n);t._vs&&(E2(t._vs)||f2.throwArgumentError("signature invalid _vs","signature",e),t._vs=B2(t._vs,32)),null==t._vs?t._vs=r:t._vs!==r&&f2.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}var M2={exports:{}},O2=Ve(ZX);!function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function s(e,t,n){if(s.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var i;"object"==typeof e?e.exports=s:t.BN=s,s.BN=s,s.wordSize=26;try{i="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:O2.Buffer}catch(e){}function a(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 o(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function c(e,t,r,s){for(var i=0,a=0,o=Math.min(e.length,r),c=t;c=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&a0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.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 s=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(s++,this.negative=1),s=0;s-=3)a=e[s]|e[s-1]<<8|e[s-2]<<16,this.words[i]|=a<>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if("le"===r)for(s=0,i=0;s>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this._strip()},s.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)s=o(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=s>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=s>>>26):i+=8;this._strip()},s.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,s=1;s<=67108863;s*=t)r++;r--,s=s/t|0;for(var i=e.length-n,a=i%r,o=Math.min(i,i-a)+n,l=0,u=n;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch(e){s.prototype.inspect=u}else s.prototype.inspect=u;function u(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],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],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var s=0,i=0,a=0;a>>24-s&16777215,(s+=2)>=26&&(s-=26,a--),r=0!==i||a!==this.length-1?d[6-c.length]+c+r:c+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 l=h[e],u=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(u).toString(e);r=(f=f.idivn(u)).isZero()?m+r:d[l-m.length]+m+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")},s.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},s.prototype.toJSON=function(){return this.toString(16,2)},i&&(s.prototype.toBuffer=function(e,t){return this.toArrayLike(i,e,t)}),s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var s=0|e.words[0],i=0|t.words[0],a=s*i,o=67108863&a,c=a/67108864|0;n.words[0]=o;for(var l=1;l>>26,d=67108863&c,h=Math.min(l,t.length-1),p=Math.max(0,l-e.length+1);p<=h;p++){var f=l-p|0;u+=(a=(s=0|e.words[f])*(i=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[l]=0|d,c=0|u}return 0!==c?n.words[l]=0|c:n.length--,n._strip()}s.prototype.toArrayLike=function(e,t,r){this._strip();var s=this.byteLength(),i=r||Math.max(1,s);n(s<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,s),a},s.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,s=0,i=0;s>8&255),n>16&255),6===i?(n>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===i?(n>=0&&(e[n--]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?s.prototype._countBits=function(e){return 32-Math.clz32(e)}:s.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 8191&t||(n+=13,t>>>=13),127&t||(n+=7,t>>>=7),15&t||(n+=4,t>>>=4),3&t||(n+=2,t>>>=2),1&t||n++,n},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.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 s=0;s0&&(this.words[s]=~this.words[s]&67108863>>26-r),this._strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,s=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(n=this,r=e):(n=e,r=this);for(var s=0,i=0;i>>26;for(;0!==s&&i>>26;if(this.length=n.length,0!==s)this.words[this.length]=s,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,s=this.cmp(e);if(0===s)return this.negative=0,this.length=1,this.words[0]=0,this;s>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,p=0|a[1],f=8191&p,m=p>>>13,b=0|a[2],g=8191&b,y=b>>>13,v=0|a[3],w=8191&v,x=v>>>13,k=0|a[4],E=8191&k,A=k>>>13,C=0|a[5],P=8191&C,_=C>>>13,S=0|a[6],I=8191&S,B=S>>>13,T=0|a[7],M=8191&T,O=T>>>13,N=0|a[8],R=8191&N,F=N>>>13,j=0|a[9],L=8191&j,U=j>>>13,D=0|o[0],z=8191&D,H=D>>>13,G=0|o[1],q=8191&G,$=G>>>13,V=0|o[2],W=8191&V,Z=V>>>13,Q=0|o[3],K=8191&Q,Y=Q>>>13,J=0|o[4],X=8191&J,ee=J>>>13,te=0|o[5],ne=8191&te,re=te>>>13,se=0|o[6],ie=8191&se,ae=se>>>13,oe=0|o[7],ce=8191&oe,le=oe>>>13,ue=0|o[8],de=8191&ue,he=ue>>>13,pe=0|o[9],fe=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var be=(l+(r=Math.imul(d,z))|0)+((8191&(s=(s=Math.imul(d,H))+Math.imul(h,z)|0))<<13)|0;l=((i=Math.imul(h,H))+(s>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(f,z),s=(s=Math.imul(f,H))+Math.imul(m,z)|0,i=Math.imul(m,H);var ge=(l+(r=r+Math.imul(d,q)|0)|0)+((8191&(s=(s=s+Math.imul(d,$)|0)+Math.imul(h,q)|0))<<13)|0;l=((i=i+Math.imul(h,$)|0)+(s>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,z),s=(s=Math.imul(g,H))+Math.imul(y,z)|0,i=Math.imul(y,H),r=r+Math.imul(f,q)|0,s=(s=s+Math.imul(f,$)|0)+Math.imul(m,q)|0,i=i+Math.imul(m,$)|0;var ye=(l+(r=r+Math.imul(d,W)|0)|0)+((8191&(s=(s=s+Math.imul(d,Z)|0)+Math.imul(h,W)|0))<<13)|0;l=((i=i+Math.imul(h,Z)|0)+(s>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,z),s=(s=Math.imul(w,H))+Math.imul(x,z)|0,i=Math.imul(x,H),r=r+Math.imul(g,q)|0,s=(s=s+Math.imul(g,$)|0)+Math.imul(y,q)|0,i=i+Math.imul(y,$)|0,r=r+Math.imul(f,W)|0,s=(s=s+Math.imul(f,Z)|0)+Math.imul(m,W)|0,i=i+Math.imul(m,Z)|0;var ve=(l+(r=r+Math.imul(d,K)|0)|0)+((8191&(s=(s=s+Math.imul(d,Y)|0)+Math.imul(h,K)|0))<<13)|0;l=((i=i+Math.imul(h,Y)|0)+(s>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(E,z),s=(s=Math.imul(E,H))+Math.imul(A,z)|0,i=Math.imul(A,H),r=r+Math.imul(w,q)|0,s=(s=s+Math.imul(w,$)|0)+Math.imul(x,q)|0,i=i+Math.imul(x,$)|0,r=r+Math.imul(g,W)|0,s=(s=s+Math.imul(g,Z)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,Z)|0,r=r+Math.imul(f,K)|0,s=(s=s+Math.imul(f,Y)|0)+Math.imul(m,K)|0,i=i+Math.imul(m,Y)|0;var we=(l+(r=r+Math.imul(d,X)|0)|0)+((8191&(s=(s=s+Math.imul(d,ee)|0)+Math.imul(h,X)|0))<<13)|0;l=((i=i+Math.imul(h,ee)|0)+(s>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(P,z),s=(s=Math.imul(P,H))+Math.imul(_,z)|0,i=Math.imul(_,H),r=r+Math.imul(E,q)|0,s=(s=s+Math.imul(E,$)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,$)|0,r=r+Math.imul(w,W)|0,s=(s=s+Math.imul(w,Z)|0)+Math.imul(x,W)|0,i=i+Math.imul(x,Z)|0,r=r+Math.imul(g,K)|0,s=(s=s+Math.imul(g,Y)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,Y)|0,r=r+Math.imul(f,X)|0,s=(s=s+Math.imul(f,ee)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,ee)|0;var xe=(l+(r=r+Math.imul(d,ne)|0)|0)+((8191&(s=(s=s+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;l=((i=i+Math.imul(h,re)|0)+(s>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(I,z),s=(s=Math.imul(I,H))+Math.imul(B,z)|0,i=Math.imul(B,H),r=r+Math.imul(P,q)|0,s=(s=s+Math.imul(P,$)|0)+Math.imul(_,q)|0,i=i+Math.imul(_,$)|0,r=r+Math.imul(E,W)|0,s=(s=s+Math.imul(E,Z)|0)+Math.imul(A,W)|0,i=i+Math.imul(A,Z)|0,r=r+Math.imul(w,K)|0,s=(s=s+Math.imul(w,Y)|0)+Math.imul(x,K)|0,i=i+Math.imul(x,Y)|0,r=r+Math.imul(g,X)|0,s=(s=s+Math.imul(g,ee)|0)+Math.imul(y,X)|0,i=i+Math.imul(y,ee)|0,r=r+Math.imul(f,ne)|0,s=(s=s+Math.imul(f,re)|0)+Math.imul(m,ne)|0,i=i+Math.imul(m,re)|0;var ke=(l+(r=r+Math.imul(d,ie)|0)|0)+((8191&(s=(s=s+Math.imul(d,ae)|0)+Math.imul(h,ie)|0))<<13)|0;l=((i=i+Math.imul(h,ae)|0)+(s>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(M,z),s=(s=Math.imul(M,H))+Math.imul(O,z)|0,i=Math.imul(O,H),r=r+Math.imul(I,q)|0,s=(s=s+Math.imul(I,$)|0)+Math.imul(B,q)|0,i=i+Math.imul(B,$)|0,r=r+Math.imul(P,W)|0,s=(s=s+Math.imul(P,Z)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,Z)|0,r=r+Math.imul(E,K)|0,s=(s=s+Math.imul(E,Y)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,Y)|0,r=r+Math.imul(w,X)|0,s=(s=s+Math.imul(w,ee)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,ee)|0,r=r+Math.imul(g,ne)|0,s=(s=s+Math.imul(g,re)|0)+Math.imul(y,ne)|0,i=i+Math.imul(y,re)|0,r=r+Math.imul(f,ie)|0,s=(s=s+Math.imul(f,ae)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0;var Ee=(l+(r=r+Math.imul(d,ce)|0)|0)+((8191&(s=(s=s+Math.imul(d,le)|0)+Math.imul(h,ce)|0))<<13)|0;l=((i=i+Math.imul(h,le)|0)+(s>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(R,z),s=(s=Math.imul(R,H))+Math.imul(F,z)|0,i=Math.imul(F,H),r=r+Math.imul(M,q)|0,s=(s=s+Math.imul(M,$)|0)+Math.imul(O,q)|0,i=i+Math.imul(O,$)|0,r=r+Math.imul(I,W)|0,s=(s=s+Math.imul(I,Z)|0)+Math.imul(B,W)|0,i=i+Math.imul(B,Z)|0,r=r+Math.imul(P,K)|0,s=(s=s+Math.imul(P,Y)|0)+Math.imul(_,K)|0,i=i+Math.imul(_,Y)|0,r=r+Math.imul(E,X)|0,s=(s=s+Math.imul(E,ee)|0)+Math.imul(A,X)|0,i=i+Math.imul(A,ee)|0,r=r+Math.imul(w,ne)|0,s=(s=s+Math.imul(w,re)|0)+Math.imul(x,ne)|0,i=i+Math.imul(x,re)|0,r=r+Math.imul(g,ie)|0,s=(s=s+Math.imul(g,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0,r=r+Math.imul(f,ce)|0,s=(s=s+Math.imul(f,le)|0)+Math.imul(m,ce)|0,i=i+Math.imul(m,le)|0;var Ae=(l+(r=r+Math.imul(d,de)|0)|0)+((8191&(s=(s=s+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;l=((i=i+Math.imul(h,he)|0)+(s>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(L,z),s=(s=Math.imul(L,H))+Math.imul(U,z)|0,i=Math.imul(U,H),r=r+Math.imul(R,q)|0,s=(s=s+Math.imul(R,$)|0)+Math.imul(F,q)|0,i=i+Math.imul(F,$)|0,r=r+Math.imul(M,W)|0,s=(s=s+Math.imul(M,Z)|0)+Math.imul(O,W)|0,i=i+Math.imul(O,Z)|0,r=r+Math.imul(I,K)|0,s=(s=s+Math.imul(I,Y)|0)+Math.imul(B,K)|0,i=i+Math.imul(B,Y)|0,r=r+Math.imul(P,X)|0,s=(s=s+Math.imul(P,ee)|0)+Math.imul(_,X)|0,i=i+Math.imul(_,ee)|0,r=r+Math.imul(E,ne)|0,s=(s=s+Math.imul(E,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0,r=r+Math.imul(w,ie)|0,s=(s=s+Math.imul(w,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,r=r+Math.imul(g,ce)|0,s=(s=s+Math.imul(g,le)|0)+Math.imul(y,ce)|0,i=i+Math.imul(y,le)|0,r=r+Math.imul(f,de)|0,s=(s=s+Math.imul(f,he)|0)+Math.imul(m,de)|0,i=i+Math.imul(m,he)|0;var Ce=(l+(r=r+Math.imul(d,fe)|0)|0)+((8191&(s=(s=s+Math.imul(d,me)|0)+Math.imul(h,fe)|0))<<13)|0;l=((i=i+Math.imul(h,me)|0)+(s>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,q),s=(s=Math.imul(L,$))+Math.imul(U,q)|0,i=Math.imul(U,$),r=r+Math.imul(R,W)|0,s=(s=s+Math.imul(R,Z)|0)+Math.imul(F,W)|0,i=i+Math.imul(F,Z)|0,r=r+Math.imul(M,K)|0,s=(s=s+Math.imul(M,Y)|0)+Math.imul(O,K)|0,i=i+Math.imul(O,Y)|0,r=r+Math.imul(I,X)|0,s=(s=s+Math.imul(I,ee)|0)+Math.imul(B,X)|0,i=i+Math.imul(B,ee)|0,r=r+Math.imul(P,ne)|0,s=(s=s+Math.imul(P,re)|0)+Math.imul(_,ne)|0,i=i+Math.imul(_,re)|0,r=r+Math.imul(E,ie)|0,s=(s=s+Math.imul(E,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,r=r+Math.imul(w,ce)|0,s=(s=s+Math.imul(w,le)|0)+Math.imul(x,ce)|0,i=i+Math.imul(x,le)|0,r=r+Math.imul(g,de)|0,s=(s=s+Math.imul(g,he)|0)+Math.imul(y,de)|0,i=i+Math.imul(y,he)|0;var Pe=(l+(r=r+Math.imul(f,fe)|0)|0)+((8191&(s=(s=s+Math.imul(f,me)|0)+Math.imul(m,fe)|0))<<13)|0;l=((i=i+Math.imul(m,me)|0)+(s>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(L,W),s=(s=Math.imul(L,Z))+Math.imul(U,W)|0,i=Math.imul(U,Z),r=r+Math.imul(R,K)|0,s=(s=s+Math.imul(R,Y)|0)+Math.imul(F,K)|0,i=i+Math.imul(F,Y)|0,r=r+Math.imul(M,X)|0,s=(s=s+Math.imul(M,ee)|0)+Math.imul(O,X)|0,i=i+Math.imul(O,ee)|0,r=r+Math.imul(I,ne)|0,s=(s=s+Math.imul(I,re)|0)+Math.imul(B,ne)|0,i=i+Math.imul(B,re)|0,r=r+Math.imul(P,ie)|0,s=(s=s+Math.imul(P,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,r=r+Math.imul(E,ce)|0,s=(s=s+Math.imul(E,le)|0)+Math.imul(A,ce)|0,i=i+Math.imul(A,le)|0,r=r+Math.imul(w,de)|0,s=(s=s+Math.imul(w,he)|0)+Math.imul(x,de)|0,i=i+Math.imul(x,he)|0;var _e=(l+(r=r+Math.imul(g,fe)|0)|0)+((8191&(s=(s=s+Math.imul(g,me)|0)+Math.imul(y,fe)|0))<<13)|0;l=((i=i+Math.imul(y,me)|0)+(s>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(L,K),s=(s=Math.imul(L,Y))+Math.imul(U,K)|0,i=Math.imul(U,Y),r=r+Math.imul(R,X)|0,s=(s=s+Math.imul(R,ee)|0)+Math.imul(F,X)|0,i=i+Math.imul(F,ee)|0,r=r+Math.imul(M,ne)|0,s=(s=s+Math.imul(M,re)|0)+Math.imul(O,ne)|0,i=i+Math.imul(O,re)|0,r=r+Math.imul(I,ie)|0,s=(s=s+Math.imul(I,ae)|0)+Math.imul(B,ie)|0,i=i+Math.imul(B,ae)|0,r=r+Math.imul(P,ce)|0,s=(s=s+Math.imul(P,le)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,le)|0,r=r+Math.imul(E,de)|0,s=(s=s+Math.imul(E,he)|0)+Math.imul(A,de)|0,i=i+Math.imul(A,he)|0;var Se=(l+(r=r+Math.imul(w,fe)|0)|0)+((8191&(s=(s=s+Math.imul(w,me)|0)+Math.imul(x,fe)|0))<<13)|0;l=((i=i+Math.imul(x,me)|0)+(s>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,X),s=(s=Math.imul(L,ee))+Math.imul(U,X)|0,i=Math.imul(U,ee),r=r+Math.imul(R,ne)|0,s=(s=s+Math.imul(R,re)|0)+Math.imul(F,ne)|0,i=i+Math.imul(F,re)|0,r=r+Math.imul(M,ie)|0,s=(s=s+Math.imul(M,ae)|0)+Math.imul(O,ie)|0,i=i+Math.imul(O,ae)|0,r=r+Math.imul(I,ce)|0,s=(s=s+Math.imul(I,le)|0)+Math.imul(B,ce)|0,i=i+Math.imul(B,le)|0,r=r+Math.imul(P,de)|0,s=(s=s+Math.imul(P,he)|0)+Math.imul(_,de)|0,i=i+Math.imul(_,he)|0;var Ie=(l+(r=r+Math.imul(E,fe)|0)|0)+((8191&(s=(s=s+Math.imul(E,me)|0)+Math.imul(A,fe)|0))<<13)|0;l=((i=i+Math.imul(A,me)|0)+(s>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,ne),s=(s=Math.imul(L,re))+Math.imul(U,ne)|0,i=Math.imul(U,re),r=r+Math.imul(R,ie)|0,s=(s=s+Math.imul(R,ae)|0)+Math.imul(F,ie)|0,i=i+Math.imul(F,ae)|0,r=r+Math.imul(M,ce)|0,s=(s=s+Math.imul(M,le)|0)+Math.imul(O,ce)|0,i=i+Math.imul(O,le)|0,r=r+Math.imul(I,de)|0,s=(s=s+Math.imul(I,he)|0)+Math.imul(B,de)|0,i=i+Math.imul(B,he)|0;var Be=(l+(r=r+Math.imul(P,fe)|0)|0)+((8191&(s=(s=s+Math.imul(P,me)|0)+Math.imul(_,fe)|0))<<13)|0;l=((i=i+Math.imul(_,me)|0)+(s>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(L,ie),s=(s=Math.imul(L,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),r=r+Math.imul(R,ce)|0,s=(s=s+Math.imul(R,le)|0)+Math.imul(F,ce)|0,i=i+Math.imul(F,le)|0,r=r+Math.imul(M,de)|0,s=(s=s+Math.imul(M,he)|0)+Math.imul(O,de)|0,i=i+Math.imul(O,he)|0;var Te=(l+(r=r+Math.imul(I,fe)|0)|0)+((8191&(s=(s=s+Math.imul(I,me)|0)+Math.imul(B,fe)|0))<<13)|0;l=((i=i+Math.imul(B,me)|0)+(s>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(L,ce),s=(s=Math.imul(L,le))+Math.imul(U,ce)|0,i=Math.imul(U,le),r=r+Math.imul(R,de)|0,s=(s=s+Math.imul(R,he)|0)+Math.imul(F,de)|0,i=i+Math.imul(F,he)|0;var Me=(l+(r=r+Math.imul(M,fe)|0)|0)+((8191&(s=(s=s+Math.imul(M,me)|0)+Math.imul(O,fe)|0))<<13)|0;l=((i=i+Math.imul(O,me)|0)+(s>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(L,de),s=(s=Math.imul(L,he))+Math.imul(U,de)|0,i=Math.imul(U,he);var Oe=(l+(r=r+Math.imul(R,fe)|0)|0)+((8191&(s=(s=s+Math.imul(R,me)|0)+Math.imul(F,fe)|0))<<13)|0;l=((i=i+Math.imul(F,me)|0)+(s>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Ne=(l+(r=Math.imul(L,fe))|0)+((8191&(s=(s=Math.imul(L,me))+Math.imul(U,fe)|0))<<13)|0;return l=((i=Math.imul(U,me))+(s>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c[0]=be,c[1]=ge,c[2]=ye,c[3]=ve,c[4]=we,c[5]=xe,c[6]=ke,c[7]=Ee,c[8]=Ae,c[9]=Ce,c[10]=Pe,c[11]=_e,c[12]=Se,c[13]=Ie,c[14]=Be,c[15]=Te,c[16]=Me,c[17]=Oe,c[18]=Ne,0!==l&&(c[19]=l,n.length++),n};function b(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,s=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=o,r=a,a=s}return 0!==r?n.words[i]=r:n.length--,n._strip()}function g(e,t,n){return b(e,t,n)}Math.imul||(m=f),s.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?f(this,e,t):n<1024?b(this,e,t):g(this,e,t)},s.prototype.mul=function(e){var t=new s(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},s.prototype.mulf=function(e){var t=new s(null);return t.words=new Array(this.length+e.length),g(this,e,t)},s.prototype.imul=function(e){return this.clone().mulTo(e,this)},s.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,s=0;s>=26,r+=i/67108864|0,r+=a>>>26,this.words[s]=67108863&a}return 0!==r&&(this.words[s]=r,this.length++),t?this.ineg():this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>s&1}return t}(e);if(0===t.length)return new s(1);for(var n=this,r=0;r=0);var t,r=e%26,s=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==s){for(t=this.length-1;t>=0;t--)this.words[t+s]=this.words[t];for(t=0;t=0),s=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),o=67108863^67108863>>>i<a)for(this.length-=a,l=0;l=0&&(0!==u||l>=s);l--){var d=0|this.words[l];this.words[l]=u<<26-i|d>>>i,u=d&o}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,s=1<=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 s=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.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>26)-(c/67108864|0),this.words[s+r]=67108863&i}for(;s>26,this.words[s+r]=67108863&i;if(0===o)return this._strip();for(n(-1===o),o=0,s=0;s>26,this.words[s]=67108863&i;return this.negative=1,this._strip()},s.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var o,c=r.length-i.length;if("mod"!==t){(o=new s(null)).length=c+1,o.words=new Array(o.length);for(var l=0;l=0;d--){var h=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(i,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);o&&(o.words[d]=h)}return o&&o._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:o||null,mod:r}},s.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(a=o.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):this.negative&e.negative?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(a=o.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:o.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,o},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),s=e.andln(1),i=n.cmp(r);return i<0||1===s&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,s=0,i=this.length-1;i>=0;i--)s=(r*s+(0|this.words[i]))%e;return t?-s:s},s.prototype.modn=function(e){return this.modrn(e)},s.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,s=this.length-1;s>=0;s--){var i=(0|this.words[s])+67108864*r;this.words[s]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},s.prototype.divn=function(e){return this.clone().idivn(e)},s.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 i=new s(1),a=new s(0),o=new s(0),c=new s(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(u),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var f=0,m=1;!(r.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(u),c.isub(d)),o.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o),a.isub(c)):(r.isub(t),o.isub(i),c.isub(a))}return{a:o,b:c,gcd:r.iushln(l)}},s.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 i,a=new s(1),o=new s(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,u=1;!(t.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,h=1;!(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(o)):(r.isub(t),o.isub(a))}return(i=0===t.cmpn(1)?a:o).cmpn(0)<0&&i.iadd(e),i},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var s=t.cmp(n);if(s<0){var i=t;t=n,n=i}else if(0===s||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return!(1&this.words[0])},s.prototype.isOdd=function(){return!(1&~this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,s=1<>>26,o&=67108863,this.words[a]=o}return 0!==i&&(this.words[a]=i,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.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 s=0|this.words[0];t=s===e?0:se.length)return 1;if(this.length=0;n--){var r=0|this.words[n],s=0|e.words[n];if(r!==s){rs&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new A(e)},s.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)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(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 v(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=s._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 C(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},r(w,v),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),s=0;s>>22,i=a}i>>>=22,e.words[s-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=s,t=r}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new x;else if("p192"===e)t=new k;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return y[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(!(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.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 s(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var o=new s(1).toRed(this),c=o.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);0!==this.pow(u,l).cmp(c);)u.redIAdd(c);for(var d=this.pow(u,i),h=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),f=a;0!==p.cmp(o);){for(var m=p,b=0;0!==m.cmp(o);b++)m=m.redSqr();n(b=0;r--){for(var l=t.words[r],u=c-1;u>=0;u--){var d=l>>u&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4===++o||0===r&&0===u)&&(i=this.mul(i,n[a]),o=0,a=0)):o=0}c=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new C(e)},r(C,A),C.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},C.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},C.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=n.isub(r).iushrn(this.shift),i=s;return s.cmp(this.m)>=0?i=s.isub(this.m):s.cmpn(0)<0&&(i=s.iadd(this.m)),i._forceRed(this)},C.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},C.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,qe)}(M2);var N2=$e(M2.exports);var R2=N2.BN;const F2=new Y1("bignumber/5.7.0"),j2={},L2=9007199254740991;let U2=!1;class D2{constructor(e,t){e!==j2&&F2.throwError("cannot call constructor directly; use BigNumber.from",Y1.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return H2(G2(this).fromTwos(e))}toTwos(e){return H2(G2(this).toTwos(e))}abs(){return"-"===this._hex[0]?D2.from(this._hex.substring(1)):this}add(e){return H2(G2(this).add(G2(e)))}sub(e){return H2(G2(this).sub(G2(e)))}div(e){return D2.from(e).isZero()&&q2("division-by-zero","div"),H2(G2(this).div(G2(e)))}mul(e){return H2(G2(this).mul(G2(e)))}mod(e){const t=G2(e);return t.isNeg()&&q2("division-by-zero","mod"),H2(G2(this).umod(t))}pow(e){const t=G2(e);return t.isNeg()&&q2("negative-power","pow"),H2(G2(this).pow(t))}and(e){const t=G2(e);return(this.isNegative()||t.isNeg())&&q2("unbound-bitwise-result","and"),H2(G2(this).and(t))}or(e){const t=G2(e);return(this.isNegative()||t.isNeg())&&q2("unbound-bitwise-result","or"),H2(G2(this).or(t))}xor(e){const t=G2(e);return(this.isNegative()||t.isNeg())&&q2("unbound-bitwise-result","xor"),H2(G2(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&q2("negative-width","mask"),H2(G2(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&q2("negative-width","shl"),H2(G2(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&q2("negative-width","shr"),H2(G2(this).shrn(e))}eq(e){return G2(this).eq(G2(e))}lt(e){return G2(this).lt(G2(e))}lte(e){return G2(this).lte(G2(e))}gt(e){return G2(this).gt(G2(e))}gte(e){return G2(this).gte(G2(e))}isNegative(){return"-"===this._hex[0]}isZero(){return G2(this).isZero()}toNumber(){try{return G2(this).toNumber()}catch(e){q2("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return F2.throwError("this platform does not support BigInt",Y1.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?U2||(U2=!0,F2.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?F2.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Y1.errors.UNEXPECTED_ARGUMENT,{}):F2.throwError("BigNumber.toString does not accept parameters",Y1.errors.UNEXPECTED_ARGUMENT,{})),G2(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof D2)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new D2(j2,z2(e)):e.match(/^-?[0-9]+$/)?new D2(j2,z2(new R2(e))):F2.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&q2("underflow","BigNumber.from",e),(e>=L2||e<=-L2)&&q2("overflow","BigNumber.from",e),D2.from(String(e));const t=e;if("bigint"==typeof t)return D2.from(t.toString());if(v2(t))return D2.from(C2(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return D2.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(E2(e)||"-"===e[0]&&E2(e.substring(1))))return D2.from(e)}return F2.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function z2(e){if("string"!=typeof e)return z2(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&F2.throwArgumentError("invalid hex","value",e),"0x00"===(e=z2(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 H2(e){return D2.from(z2(e))}function G2(e){const t=D2.from(e).toHexString();return"-"===t[0]?new R2("-"+t.substring(3),16):new R2(t.substring(2),16)}function q2(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),F2.throwError(e,Y1.errors.NUMERIC_FAULT,r)}var $2={exports:{}};!function(e){!function(){var t="input is invalid type",n="object"==typeof window,r=n?window:{};r.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof rJ&&rJ.versions&&rJ.versions.node?r=qe:s&&(r=self);var i=!r.JS_SHA3_NO_COMMON_JS&&e.exports,a=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,o="0123456789abcdef".split(""),c=[4,1024,262144,67108864],l=[0,8,16,24],u=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],d=[224,256,384,512],h=[128,256],p=["hex","buffer","arrayBuffer","array","digest"],f={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var m=function(e,t,n){return function(r){return new B(e,t,e).update(r)[n]()}},b=function(e,t,n){return function(r,s){return new B(e,t,s).update(r)[n]()}},g=function(e,t,n){return function(t,r,s,i){return k["cshake"+e].update(t,r,s,i)[n]()}},y=function(e,t,n){return function(t,r,s,i){return k["kmac"+e].update(t,r,s,i)[n]()}},v=function(e,t,n,r){for(var s=0;s>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function T(e,t,n){B.call(this,e,t,n)}B.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var n,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var s,i,o=this.blocks,c=this.byteCount,u=e.length,d=this.blockCount,h=0,p=this.s;h>2]|=e[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[s>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=c){for(this.start=s-c,this.block=o[d],s=0;s>=8);n>0;)s.unshift(n),n=255&(e>>=8),++r;return t?s.push(r):s.unshift(r),this.update(s),s.length},B.prototype.encodeString=function(e){var n,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}var s=0,i=e.length;if(n)s=i;else for(var o=0;o=57344?s+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++o)),s+=4)}return s+=this.encode(8*s),this.update(e),s},B.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t>4&15]+o[15&e]+o[e>>12&15]+o[e>>8&15]+o[e>>20&15]+o[e>>16&15]+o[e>>28&15]+o[e>>24&15];a%t==0&&(M(n),i=0)}return s&&(e=n[i],c+=o[e>>4&15]+o[15&e],s>1&&(c+=o[e>>12&15]+o[e>>8&15]),s>2&&(c+=o[e>>20&15]+o[e>>16&15])),c},B.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,s=this.extraBytes,i=0,a=0,o=this.outputBits>>3;e=s?new ArrayBuffer(r+1<<2):new ArrayBuffer(o);for(var c=new Uint32Array(e);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;o%n==0&&M(r)}return i&&(e=o<<2,t=r[a],c[e]=255&t,i>1&&(c[e+1]=t>>8&255),i>2&&(c[e+2]=t>>16&255)),c},T.prototype=new B,T.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var M=function(e){var t,n,r,s,i,a,o,c,l,d,h,p,f,m,b,g,y,v,w,x,k,E,A,C,P,_,S,I,B,T,M,O,N,R,F,j,L,U,D,z,H,G,q,$,V,W,Z,Q,K,Y,J,X,ee,te,ne,re,se,ie,ae,oe,ce,le,ue;for(r=0;r<48;r+=2)s=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(p=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|o>>>31),n=(f=e[9]^e[19]^e[29]^e[39]^e[49])^(o<<1|a>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=s^(c<<1|l>>>31),n=i^(l<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=a^(d<<1|h>>>31),n=o^(h<<1|d>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(p<<1|f>>>31),n=l^(f<<1|p>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=d^(s<<1|i>>>31),n=h^(i<<1|s>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,m=e[0],b=e[1],W=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,I=e[20]<<3|e[21]>>>29,B=e[21]<<3|e[20]>>>29,oe=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,G=e[40]<<18|e[41]>>>14,q=e[41]<<18|e[40]>>>14,R=e[2]<<1|e[3]>>>31,F=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,Q=e[22]<<10|e[23]>>>22,K=e[23]<<10|e[22]>>>22,T=e[33]<<13|e[32]>>>19,M=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ue=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,L=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,N=e[44]<<29|e[45]>>>3,C=e[6]<<28|e[7]>>>4,P=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,se=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,D=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,k=e[37]<<21|e[36]>>>11,X=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,$=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,_=e[18]<<20|e[19]>>>12,S=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,z=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,A=e[49]<<14|e[48]>>>18,e[0]=m^~g&v,e[1]=b^~y&w,e[10]=C^~_&I,e[11]=P^~S&B,e[20]=R^~j&U,e[21]=F^~L&D,e[30]=$^~W&Q,e[31]=V^~Z&K,e[40]=te^~re&ie,e[41]=ne^~se&ae,e[2]=g^~v&x,e[3]=y^~w&k,e[12]=_^~I&T,e[13]=S^~B&M,e[22]=j^~U&z,e[23]=L^~D&H,e[32]=W^~Q&Y,e[33]=Z^~K&J,e[42]=re^~ie&oe,e[43]=se^~ae&ce,e[4]=v^~x&E,e[5]=w^~k&A,e[14]=I^~T&O,e[15]=B^~M&N,e[24]=U^~z&G,e[25]=D^~H&q,e[34]=Q^~Y&X,e[35]=K^~J&ee,e[44]=ie^~oe&le,e[45]=ae^~ce&ue,e[6]=x^~E&m,e[7]=k^~A&b,e[16]=T^~O&C,e[17]=M^~N&P,e[26]=z^~G&R,e[27]=H^~q&F,e[36]=Y^~X&$,e[37]=J^~ee&V,e[46]=oe^~le&te,e[47]=ce^~ue&ne,e[8]=E^~m&g,e[9]=A^~b&y,e[18]=O^~C&_,e[19]=N^~P&S,e[28]=G^~R&j,e[29]=q^~F&L,e[38]=X^~$&W,e[39]=ee^~V&Z,e[48]=le^~te&re,e[49]=ue^~ne&se,e[0]^=u[r],e[1]^=u[r+1]};if(i)e.exports=k;else for(A=0;A>=8;return t}function K2(e,t,n){let r=0;for(let s=0;st+1+r&&Z2.throwError("child data too short",Y1.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:s}}function e3(e,t){if(0===e.length&&Z2.throwError("data too short",Y1.errors.BUFFER_OVERRUN,{}),e[t]>=248){const n=e[t]-247;t+1+n>e.length&&Z2.throwError("data short segment too short",Y1.errors.BUFFER_OVERRUN,{});const r=K2(e,t+1,n);return t+1+n+r>e.length&&Z2.throwError("data long segment too short",Y1.errors.BUFFER_OVERRUN,{}),X2(e,t,t+1+n,n+r)}if(e[t]>=192){const n=e[t]-192;return t+1+n>e.length&&Z2.throwError("data array too short",Y1.errors.BUFFER_OVERRUN,{}),X2(e,t,t+1,n)}if(e[t]>=184){const n=e[t]-183;t+1+n>e.length&&Z2.throwError("data array too short",Y1.errors.BUFFER_OVERRUN,{});const r=K2(e,t+1,n);t+1+n+r>e.length&&Z2.throwError("data array too short",Y1.errors.BUFFER_OVERRUN,{});return{consumed:1+n+r,result:C2(e.slice(t+1+n,t+1+n+r))}}if(e[t]>=128){const n=e[t]-128;t+1+n>e.length&&Z2.throwError("data too short",Y1.errors.BUFFER_OVERRUN,{});return{consumed:1+n,result:C2(e.slice(t+1,t+1+n))}}return{consumed:1,result:C2(e[t])}}function t3(e){const t=w2(e),n=e3(t,0);return n.consumed!==t.length&&Z2.throwArgumentError("invalid rlp data","data",e),n.result}const n3=new Y1("address/5.7.0");function r3(e){E2(e,20)||n3.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);const r=w2(W2(n));for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&r[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const s3={};for(let e=0;e<10;e++)s3[String(e)]=String(e);for(let e=0;e<26;e++)s3[String.fromCharCode(65+e)]=String(10+e);const i3=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function a3(e){let t=null;if("string"!=typeof e&&n3.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=r3(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&n3.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)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>s3[e])).join("");for(;t.length>=i3;){let e=t.substring(0,i3);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}(e)&&n3.throwArgumentError("bad icap checksum","address",e),n=e.substring(4),t=new R2(n,36).toString(16);t.length<40;)t="0"+t;t=r3("0x"+t)}else n3.throwArgumentError("invalid address","address",e);var n;return t}var o3=function(e,t,n,r){return new(n||(n=Promise))((function(s,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((r=r.apply(e,t||[])).next())}))};const c3=new Y1("abstract-provider/5.7.0");class l3 extends c2{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class u3{constructor(){c3.checkAbstract(new.target,u3),e2(this,"_isProvider",!0)}getFeeData(){return o3(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield n2({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let n=null,r=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=D2.from("1500000000"),r=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:r,maxPriorityFeePerGas:s,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}const d3=D2.from(0),h3=new Y1("strings/5.7.0");var p3,f3;function m3(e,t,n,r,s){if(e===f3.BAD_PREFIX||e===f3.UNEXPECTED_CONTINUE){let e=0;for(let r=t+1;r>6==2;r++)e++;return e}return e===f3.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(p3||(p3={})),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"}(f3||(f3={}));const b3=Object.freeze({error:function(e,t,n,r,s){return h3.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)},ignore:m3,replace:function(e,t,n,r,s){return e===f3.OVERLONG?(r.push(s),0):(r.push(65533),m3(e,t,n))}});function g3(e,t){null==t&&(t=b3.error),e=w2(e);const n=[];let r=0;for(;r>7)){n.push(s);continue}let i=null,a=null;if(192==(224&s))i=1,a=127;else if(224==(240&s))i=2,a=2047;else{if(240!=(248&s)){r+=t(128==(192&s)?f3.UNEXPECTED_CONTINUE:f3.BAD_PREFIX,r-1,e,n);continue}i=3,a=65535}if(r-1+i>=e.length){r+=t(f3.OVERRUN,r-1,e,n);continue}let o=s&(1<<8-i-1)-1;for(let s=0;s1114111?r+=t(f3.OUT_OF_RANGE,r-1-i,e,n,o):o>=55296&&o<=57343?r+=t(f3.UTF16_SURROGATE,r-1-i,e,n,o):o<=a?r+=t(f3.OVERLONG,r-1-i,e,n,o):n.push(o))}return n}function y3(e,t=p3.current){t!=p3.current&&(h3.checkNormalize(),e=e.normalize(t));let n=[];for(let t=0;t>6|192),n.push(63&r|128);else if(55296==(64512&r)){t++;const s=e.charCodeAt(t);if(t>=e.length||56320!=(64512&s))throw new Error("invalid utf-8 string");const i=65536+((1023&r)<<10)+(1023&s);n.push(i>>18|240),n.push(i>>12&63|128),n.push(i>>6&63|128),n.push(63&i|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return w2(n)}function v3(e,t){return g3(e,t).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function w3(e){return W2(y3(e))}const x3="hash/5.7.0";function k3(e){e=atob(e);const t=[];for(let n=0;n0&&Array.isArray(e)?s(e,t-1):n.push(e)}))};return s(e,t),n}function C3(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,i=[0,1];for(let e=1;e>--c&1}const d=Math.pow(2,31),h=d>>>1,p=h>>1,f=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|u();let b=[],g=0,y=d;for(;;){let e=Math.floor(((m-g+1)*s-1)/y),t=0,n=r;for(;n-t>1;){let r=t+n>>>1;e>>1|u(),a=a<<1^h,o=(o^h)<<1|h|1;g=a,y=1+o-a}let v=r-4;return b.map((t=>{switch(t-v){case 3:return v+65792+(e[o++]<<16|e[o++]<<8|e[o++]);case 2:return v+256+(e[o++]<<8|e[o++]);case 1:return v+e[o++];default:return t-1}}))}(e))}function P3(e){return 1&e?~e>>1:e>>1}function _3(e,t){let n=Array(e);for(let r=0,s=-1;rt[e])):n}function B3(e,t,n){let r=Array(e).fill(void 0).map((()=>[]));for(let s=0;sr[t].push(e)));return r}function T3(e,t){let n=1+t(),r=t(),s=function(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(n)}return t}(t);return A3(B3(s.length,1+e,t).map(((e,t)=>{const i=e[0],a=e.slice(1);return Array(s[t]).fill(void 0).map(((e,t)=>{let s=t*r;return[i+t*n,a.map((e=>e+s))]}))})))}function M3(e,t){return B3(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const O3=C3(k3("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==")),N3=new Set(I3(O3)),R3=new Set(I3(O3)),F3=function(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(T3(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(M3(n,e))}return function(e){const t={};for(let n=0;ne-t));return function n(){let r=[];for(;;){let s=I3(e,t);if(0==s.length)break;r.push({set:new Set(s),node:n()})}r.sort(((e,t)=>t.set.size-e.set.size));let s=e(),i=s%3;s=s/3|0;let a=!!(1&s);return s>>=1,{branches:r,valid:i,fe0f:a,save:1==s,check:2==s}}()}(O3),L3=45,U3=95;function D3(e){return function(e,t=p3.current){return g3(y3(e,t))}(e)}function z3(e){return e.filter((e=>65039!=e))}function H3(e){for(let t of e.split(".")){let e=D3(t);try{for(let t=e.lastIndexOf(U3)-1;t>=0;t--)if(e[t]!==U3)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===L3&&e[3]===L3)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function G3(e){return H3(function(e,t){let n=D3(e).reverse(),r=[];for(;n.length;){let e=q3(n);if(e){r.push(...t(e));continue}let s=n.pop();if(N3.has(s)){r.push(s);continue}if(R3.has(s))continue;let i=F3[s];if(!i)throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`);r.push(...i)}return H3(function(e){return e.normalize("NFC")}(String.fromCodePoint(...r)))}(e,z3))}function q3(e,t){var n;let r,s,i=j3,a=[],o=e.length;for(;o;){let t=e[--o];if(i=null===(n=i.branches.find((e=>e.set.has(t))))||void 0===n?void 0:n.node,!i)break;if(i.save)s=t;else if(i.check&&t===s)break;a.push(t),i.fe0f&&(a.push(65039),o>0&&65039==e[o-1]&&o--),i.valid&&(r=a.slice(),2==i.valid&&r.splice(1,1),e.length=o)}return r}const $3=new Y1(x3),V3=new Uint8Array(32);function W3(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Z3(e){const t=y3(G3(e)),n=[];if(0===e.length)return n;let r=0;for(let e=0;e=t.length)throw new Error("invalid ENS name; empty component");return n.push(W3(t.slice(r))),n}function Q3(e){"string"!=typeof e&&$3.throwArgumentError("invalid ENS name; not a string","name",e);let t=V3;const n=Z3(e);for(;n.length;)t=W2(x2([t,W2(n.pop())]));return C2(t)}V3.fill(0);var K3=function(e,t,n,r){return new(n||(n=Promise))((function(s,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((r=r.apply(e,t||[])).next())}))};const Y3=new Y1(x3),J3=new Uint8Array(32);J3.fill(0);const X3=D2.from(-1),e6=D2.from(0),t6=D2.from(1),n6=D2.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const r6=B2(t6.toHexString(),32),s6=B2(e6.toHexString(),32),i6={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},a6=["name","version","chainId","verifyingContract","salt"];function o6(e){return function(t){return"string"!=typeof t&&Y3.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const c6={name:o6("name"),version:o6("version"),chainId:function(e){try{return D2.from(e).toString()}catch(e){}return Y3.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return a3(e).toLowerCase()}catch(e){}return Y3.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=w2(e);if(32!==t.length)throw new Error("bad length");return C2(t)}catch(e){}return Y3.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function l6(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const n=""===t[1],r=parseInt(t[2]||"256");(r%8!=0||r>256||t[2]&&t[2]!==String(r))&&Y3.throwArgumentError("invalid numeric width","type",e);const s=n6.mask(n?r-1:r),i=n?s.add(t6).mul(X3):e6;return function(t){const n=D2.from(t);return(n.lt(i)||n.gt(s))&&Y3.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),B2(n.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const n=parseInt(t[1]);return(0===n||n>32||t[1]!==String(n))&&Y3.throwArgumentError("invalid bytes width","type",e),function(t){return w2(t).length!==n&&Y3.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=w2(e),n=t.length%32;return n?S2([t,J3.slice(n)]):C2(t)}(t)}}}switch(e){case"address":return function(e){return B2(a3(e),32)};case"bool":return function(e){return e?r6:s6};case"bytes":return function(e){return W2(e)};case"string":return function(e){return w3(e)}}return null}function u6(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class d6{constructor(e){e2(this,"types",Object.freeze(o2(e))),e2(this,"_encoderCache",{}),e2(this,"_types",{});const t={},n={},r={};Object.keys(e).forEach((e=>{t[e]={},n[e]=[],r[e]={}}));for(const r in e){const s={};e[r].forEach((i=>{s[i.name]&&Y3.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(r)}`,"types",e),s[i.name]=!0;const a=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===r&&Y3.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e);l6(a)||(n[a]||Y3.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",e),n[a].push(r),t[r][a]=!0)}))}const s=Object.keys(n).filter((e=>0===n[e].length));0===s.length?Y3.throwArgumentError("missing primary type","types",e):s.length>1&&Y3.throwArgumentError(`ambiguous primary types or unused types: ${s.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),e2(this,"primaryType",s[0]),function s(i,a){a[i]&&Y3.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",e),a[i]=!0,Object.keys(t[i]).forEach((e=>{n[e]&&(s(e,a),Object.keys(a).forEach((t=>{r[t][e]=!0})))})),delete a[i]}(this.primaryType,{});for(const t in r){const n=Object.keys(r[t]);n.sort(),this._types[t]=u6(t,e[t])+n.map((t=>u6(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=l6(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],n=this.getEncoder(e),r=parseInt(t[3]);return t=>{r>=0&&t.length!==r&&Y3.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let s=t.map(n);return this._types[e]&&(s=s.map(W2)),W2(S2(s))}}const n=this.types[e];if(n){const t=w3(this._types[e]);return e=>{const r=n.map((({name:t,type:n})=>{const r=this.getEncoder(n)(e[t]);return this._types[n]?W2(r):r}));return r.unshift(t),S2(r)}}return Y3.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Y3.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return W2(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(l6(e))return n(e,t);const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const e=r[1],s=parseInt(r[3]);return s>=0&&t.length!==s&&Y3.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,n)))}const s=this.types[e];return s?s.reduce(((e,{name:r,type:s})=>(e[r]=this._visit(s,t[r],n),e)),{}):Y3.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new d6(e)}static getPrimaryType(e){return d6.from(e).primaryType}static hashStruct(e,t,n){return d6.from(t).hashStruct(e,n)}static hashDomain(e){const t=[];for(const n in e){const r=i6[n];r||Y3.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:r})}return t.sort(((e,t)=>a6.indexOf(e.name)-a6.indexOf(t.name))),d6.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return S2(["0x1901",d6.hashDomain(e),d6.from(t).hash(n)])}static hash(e,t,n){return W2(d6.encode(e,t,n))}static resolveNames(e,t,n,r){return K3(this,void 0,void 0,(function*(){e=r2(e);const s={};e.verifyingContract&&!E2(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const i=d6.from(t);i.visit(n,((e,t)=>("address"!==e||E2(t,20)||(s[t]="0x"),t)));for(const e in s)s[e]=yield r(e);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=i.visit(n,((e,t)=>"address"===e&&s[t]?s[t]:t)),{domain:e,value:n}}))}static getPayload(e,t,n){d6.hashDomain(e);const r={},s=[];a6.forEach((t=>{const n=e[t];null!=n&&(r[t]=c6[t](n),s.push({name:t,type:i6[t]}))}));const i=d6.from(t),a=r2(t);return a.EIP712Domain?Y3.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=s,i.encode(n),{types:a,domain:r,primaryType:i.primaryType,message:i.visit(n,((e,t)=>{if(e.match(/^bytes(\d*)/))return C2(w2(t));if(e.match(/^u?int/))return D2.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Y3.throwArgumentError("invalid string","value",t),t}return Y3.throwArgumentError("unsupported type","type",e)}))}}}class h6{constructor(e){e2(this,"alphabet",e),e2(this,"base",e.length),e2(this,"_alphabetMap",{}),e2(this,"_leader",e.charAt(0));for(let t=0;t0;)n.push(r%this.base),r=r/this.base|0}let r="";for(let e=0;0===t[e]&&e=0;--e)r+=this.alphabet[n[e]];return r}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let n=0;n>=8;for(;s>0;)t.push(255&s),s>>=8}for(let n=0;e[n]===this._leader&&n=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function E6(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function A6(e){return 1===e.length?"0"+e:e}function C6(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}m6.inherits=x6,m6.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),s=0;s>6|192,n[r++]=63&i|128):k6(e,s)?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++s)),n[r++]=i>>18|240,n[r++]=i>>12&63|128,n[r++]=i>>6&63|128,n[r++]=63&i|128):(n[r++]=i>>12|224,n[r++]=i>>6&63|128,n[r++]=63&i|128)}else for(s=0;s>>0}return i},m6.split32=function(e,t){for(var n=new Array(4*e.length),r=0,s=0;r>>24,n[s+1]=i>>>16&255,n[s+2]=i>>>8&255,n[s+3]=255&i):(n[s+3]=i>>>24,n[s+2]=i>>>16&255,n[s+1]=i>>>8&255,n[s]=255&i)}return n},m6.rotr32=function(e,t){return e>>>t|e<<32-t},m6.rotl32=function(e,t){return e<>>32-t},m6.sum32=function(e,t){return e+t>>>0},m6.sum32_3=function(e,t,n){return e+t+n>>>0},m6.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},m6.sum32_5=function(e,t,n,r,s){return e+t+n+r+s>>>0},m6.sum64=function(e,t,n,r){var s=e[t],i=r+e[t+1]>>>0,a=(i>>0,e[t+1]=i},m6.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},m6.sum64_lo=function(e,t,n,r){return t+r>>>0},m6.sum64_4_hi=function(e,t,n,r,s,i,a,o){var c=0,l=t;return c+=(l=l+r>>>0)>>0)>>0)>>0},m6.sum64_4_lo=function(e,t,n,r,s,i,a,o){return t+r+i+o>>>0},m6.sum64_5_hi=function(e,t,n,r,s,i,a,o,c,l){var u=0,d=t;return u+=(d=d+r>>>0)>>0)>>0)>>0)>>0},m6.sum64_5_lo=function(e,t,n,r,s,i,a,o,c,l){return t+r+i+o+l>>>0},m6.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},m6.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},m6.shr64_hi=function(e,t,n){return e>>>n},m6.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0};var P6={},_6=m6,S6=b6;function I6(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}P6.BlockHash=I6,I6.prototype.update=function(e,t){if(e=_6.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=_6.join32(e,0,e.length-n,this.endian);for(var r=0;r>>24&255,r[s++]=e>>>16&255,r[s++]=e>>>8&255,r[s++]=255&e}else for(r[s++]=255&e,r[s++]=e>>>8&255,r[s++]=e>>>16&255,r[s++]=e>>>24&255,r[s++]=0,r[s++]=0,r[s++]=0,r[s++]=0,i=8;i>>3},T6.g1_256=function(e){return M6(e,17)^M6(e,19)^e>>>10};var F6=m6,j6=P6,L6=T6,U6=F6.rotl32,D6=F6.sum32,z6=F6.sum32_5,H6=L6.ft_1,G6=j6.BlockHash,q6=[1518500249,1859775393,2400959708,3395469782];function $6(){if(!(this instanceof $6))return new $6;G6.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}F6.inherits($6,G6);var V6=$6;$6.blockSize=512,$6.outSize=160,$6.hmacStrength=80,$6.padLength=64,$6.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;rthis.blockSize&&(e=(new this.Hash).update(e).digest()),d4(e.length<=this.blockSize);for(var t=e.length;t>8,a=255&s;i?n.push(i,a):n.push(a)}return n},n.zero2=r,n.toHex=s,n.encode=function(e,t){return"hex"===t?s(e):e}})),w4=b4((function(e,t){var n=t;n.assert=g4,n.toArray=v4.toArray,n.zero2=v4.zero2,n.toHex=v4.toHex,n.encode=v4.encode,n.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var s=1<(s>>1)-1?(s>>1)-c:c,i.isubn(o)):o=0,r[a]=o,i.iushrn(1)}return r},n.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,s=0,i=0;e.cmpn(-s)>0||t.cmpn(-i)>0;){var a,o,c=e.andln(3)+s&3,l=t.andln(3)+i&3;3===c&&(c=-1),3===l&&(l=-1),a=1&c?3!==(r=e.andln(7)+s&7)&&5!==r||2!==l?c:-c:0,n[0].push(a),o=1&l?3!==(r=t.andln(7)+i&7)&&5!==r||2!==c?l:-l:0,n[1].push(o),2*s===a+1&&(s=1-s),2*i===o+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return n},n.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new N2(e,"hex","le")}})),x4=w4.getNAF,k4=w4.getJSF,E4=w4.assert;function A4(e,t){this.type=e,this.p=new N2(t.p,16),this.red=t.prime?N2.red(t.prime):N2.mont(this.p),this.zero=new N2(0).toRed(this.red),this.one=new N2(1).toRed(this.red),this.two=new N2(2).toRed(this.red),this.n=t.n&&new N2(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var C4=A4;function P4(e,t){this.curve=e,this.type=t,this.precomputed=null}A4.prototype.point=function(){throw new Error("Not implemented")},A4.prototype.validate=function(){throw new Error("Not implemented")},A4.prototype._fixedNafMul=function(e,t){E4(e.precomputed);var n=e._getDoubles(),r=x4(t,1,this._bitLength),s=(1<=i;c--)a=(a<<1)+r[c];o.push(a)}for(var l=this.jpoint(null,null,null),u=this.jpoint(null,null,null),d=s;d>0;d--){for(i=0;i=0;o--){for(var c=0;o>=0&&0===i[o];o--)c++;if(o>=0&&c++,a=a.dblp(c),o<0)break;var l=i[o];E4(0!==l),a="affine"===e.type?l>0?a.mixedAdd(s[l-1>>1]):a.mixedAdd(s[-l-1>>1].neg()):l>0?a.add(s[l-1>>1]):a.add(s[-l-1>>1].neg())}return"affine"===e.type?a.toP():a},A4.prototype._wnafMulAdd=function(e,t,n,r,s){var i,a,o,c=this._wnafT1,l=this._wnafT2,u=this._wnafT3,d=0;for(i=0;i=1;i-=2){var p=i-1,f=i;if(1===c[p]&&1===c[f]){var m=[t[p],null,null,t[f]];0===t[p].y.cmp(t[f].y)?(m[1]=t[p].add(t[f]),m[2]=t[p].toJ().mixedAdd(t[f].neg())):0===t[p].y.cmp(t[f].y.redNeg())?(m[1]=t[p].toJ().mixedAdd(t[f]),m[2]=t[p].add(t[f].neg())):(m[1]=t[p].toJ().mixedAdd(t[f]),m[2]=t[p].toJ().mixedAdd(t[f].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],g=k4(n[p],n[f]);for(d=Math.max(g[0].length,d),u[p]=new Array(d),u[f]=new Array(d),a=0;a=0;i--){for(var k=0;i>=0;){var E=!0;for(a=0;a=0&&k++,w=w.dblp(k),i<0)break;for(a=0;a0?o=l[a][A-1>>1]:A<0&&(o=l[a][-A-1>>1].neg()),w="affine"===o.type?w.mixedAdd(o):w.add(o))}}for(i=0;i=Math.ceil((e.bitLength()+1)/t.step)},P4.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,s=0;s=0&&(i=t,a=n),r.negative&&(r=r.neg(),s=s.neg()),i.negative&&(i=i.neg(),a=a.neg()),[{a:r,b:s},{a:i,b:a}]},I4.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],s=r.b.mul(e).divRound(this.n),i=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),o=i.mul(r.a),c=s.mul(n.b),l=i.mul(r.b);return{k1:e.sub(a).sub(o),k2:c.add(l).neg()}},I4.prototype.pointFromX=function(e,t){(e=new N2(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var s=r.fromRed().isOdd();return(t&&!s||!t&&s)&&(r=r.redNeg()),this.point(e,r)},I4.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),s=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(s).cmpn(0)},I4.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,s=this._endoWnafT2,i=0;i":""},T4.prototype.isInfinity=function(){return this.inf},T4.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},T4.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),i=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},T4.prototype.getX=function(){return this.x.fromRed()},T4.prototype.getY=function(){return this.y.fromRed()},T4.prototype.mul=function(e){return e=new N2(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)},T4.prototype.mulAdd=function(e,t,n){var r=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,s):this.curve._wnafMulAdd(1,r,s,2)},T4.prototype.jmulAdd=function(e,t,n){var r=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,s,!0):this.curve._wnafMulAdd(1,r,s,2,!0)},T4.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))},T4.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},T4.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},_4(M4,C4.BasePoint),I4.prototype.jpoint=function(e,t,n){return new M4(this,e,t,n)},M4.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},M4.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},M4.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),s=e.x.redMul(n),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),o=r.redSub(s),c=i.redSub(a);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),u=l.redMul(o),d=r.redMul(l),h=c.redSqr().redIAdd(u).redISub(d).redISub(d),p=c.redMul(d.redISub(h)).redISub(i.redMul(u)),f=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(h,p,f)},M4.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),s=this.y,i=e.y.redMul(t).redMul(this.z),a=n.redSub(r),o=s.redSub(i);if(0===a.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),l=c.redMul(a),u=n.redMul(c),d=o.redSqr().redIAdd(l).redISub(u).redISub(u),h=o.redMul(u.redISub(d)).redISub(s.redMul(l)),p=this.z.redMul(a);return this.curve.jpoint(d,h,p)},M4.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t=0)return!1;if(n.redIAdd(s),0===this.x.cmp(n))return!0}},M4.prototype.inspect=function(){return this.isInfinity()?"":""},M4.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var O4=b4((function(e,t){var n=t;n.base=C4,n.short=B4,n.mont=null,n.edwards=null})),N4=b4((function(e,t){var n,r=t,s=w4.assert;function i(e){"short"===e.type?this.curve=new O4.short(e):"edwards"===e.type?this.curve=new O4.edwards(e):this.curve=new O4.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new i(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=i,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:f4.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:f4.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:f4.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:f4.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:f4.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:f4.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:f4.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(e){n=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:f4.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function R4(e){if(!(this instanceof R4))return new R4(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=v4.toArray(e.entropy,e.entropyEnc||"hex"),n=v4.toArray(e.nonce,e.nonceEnc||"hex"),r=v4.toArray(e.pers,e.persEnc||"hex");g4(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var F4=R4;R4.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},R4.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=n,n=t,t=null),n&&(n=v4.toArray(n,r||"hex"),this._update(n));for(var s=[];s.length"};var D4=w4.assert;function z4(e,t){if(e instanceof z4)return e;this._importDER(e,t)||(D4(e.r&&e.s,"Signature without r or s"),this.r=new N2(e.r,16),this.s=new N2(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var H4=z4;function G4(){this.place=0}function q4(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var s=0,i=0,a=t.place;i>>=0;return!(s<=127)&&(t.place=a,s)}function $4(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}z4.prototype._importDER=function(e,t){e=w4.toArray(e,t);var n=new G4;if(48!==e[n.place++])return!1;var r=q4(e,n);if(!1===r)return!1;if(r+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var s=q4(e,n);if(!1===s)return!1;var i=e.slice(n.place,s+n.place);if(n.place+=s,2!==e[n.place++])return!1;var a=q4(e,n);if(!1===a)return!1;if(e.length!==a+n.place)return!1;var o=e.slice(n.place,a+n.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}return this.r=new N2(i),this.s=new N2(o),this.recoveryParam=null,!0},z4.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=$4(t),n=$4(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];V4(r,t.length),(r=r.concat(t)).push(2),V4(r,n.length);var s=r.concat(n),i=[48];return V4(i,s.length),i=i.concat(s),w4.encode(i,e)};var W4=function(){throw new Error("unsupported")},Z4=w4.assert;function Q4(e){if(!(this instanceof Q4))return new Q4(e);"string"==typeof e&&(Z4(Object.prototype.hasOwnProperty.call(N4,e),"Unknown curve "+e),e=N4[e]),e instanceof N4.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 K4=Q4;Q4.prototype.keyPair=function(e){return new U4(this,e)},Q4.prototype.keyFromPrivate=function(e,t){return U4.fromPrivate(this,e,t)},Q4.prototype.keyFromPublic=function(e,t){return U4.fromPublic(this,e,t)},Q4.prototype.genKeyPair=function(e){e||(e={});for(var t=new F4({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||W4(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new N2(2));;){var s=new N2(t.generate(n));if(!(s.cmp(r)>0))return s.iaddn(1),this.keyFromPrivate(s)}},Q4.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Q4.prototype.sign=function(e,t,n,r){"object"==typeof n&&(r=n,n=null),r||(r={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new N2(e,16));for(var s=this.n.byteLength(),i=t.getPrivate().toArray("be",s),a=e.toArray("be",s),o=new F4({hash:this.hash,entropy:i,nonce:a,pers:r.pers,persEnc:r.persEnc||"utf8"}),c=this.n.sub(new N2(1)),l=0;;l++){var u=r.k?r.k(l):new N2(o.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(c)>=0)){var d=this.g.mul(u);if(!d.isInfinity()){var h=d.getX(),p=h.umod(this.n);if(0!==p.cmpn(0)){var f=u.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(f=f.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==h.cmp(p)?2:0);return r.canonical&&f.cmp(this.nh)>0&&(f=this.n.sub(f),m^=1),new H4({r:p,s:f,recoveryParam:m})}}}}}},Q4.prototype.verify=function(e,t,n,r){e=this._truncateToN(new N2(e,16)),n=this.keyFromPublic(n,r);var s=(t=new H4(t,"hex")).r,i=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;var a,o=i.invm(this.n),c=o.mul(e).umod(this.n),l=o.mul(s).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,n.getPublic(),l)).isInfinity()&&a.eqXToP(s):!(a=this.g.mulAdd(c,n.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(s)},Q4.prototype.recoverPubKey=function(e,t,n,r){Z4((3&n)===n,"The recovery param is more than two bits"),t=new H4(t,r);var s=this.n,i=new N2(e),a=t.r,o=t.s,c=1&n,l=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var u=t.r.invm(s),d=s.sub(i).mul(u).umod(s),h=o.mul(u).umod(s);return this.g.mulAdd(d,a,h)},Q4.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new H4(t,r)).recoveryParam)return t.recoveryParam;for(var s=0;s<4;s++){var i;try{i=this.recoverPubKey(e,t,s)}catch(e){continue}if(i.eq(n))return s}throw new Error("Unable to find valid recovery factor")};var Y4=b4((function(e,t){var n=t;n.version="6.5.4",n.utils=w4,n.rand=function(){throw new Error("unsupported")},n.curve=O4,n.curves=N4,n.ec=K4,n.eddsa=null})).ec;const J4=new Y1("signing-key/5.7.0");let X4=null;function e8(){return X4||(X4=new Y4("secp256k1")),X4}class t8{constructor(e){e2(this,"curve","secp256k1"),e2(this,"privateKey",C2(e)),32!==P2(this.privateKey)&&J4.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=e8().keyFromPrivate(w2(this.privateKey));e2(this,"publicKey","0x"+t.getPublic(!1,"hex")),e2(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),e2(this,"_isSigningKey",!0)}_addPoint(e){const t=e8().keyFromPublic(w2(this.publicKey)),n=e8().keyFromPublic(w2(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const t=e8().keyFromPrivate(w2(this.privateKey)),n=w2(e);32!==n.length&&J4.throwArgumentError("bad digest length","digest",e);const r=t.sign(n,{canonical:!0});return T2({recoveryParam:r.recoveryParam,r:B2("0x"+r.r.toString(16),32),s:B2("0x"+r.s.toString(16),32)})}computeSharedSecret(e){const t=e8().keyFromPrivate(w2(this.privateKey)),n=e8().keyFromPublic(w2(n8(e)));return B2("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function n8(e,t){const n=w2(e);if(32===n.length){return new t8(n).publicKey}return 33===n.length?"0x"+e8().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?C2(n):J4.throwArgumentError("invalid public or private key","key","[REDACTED]")}const r8=new Y1("transactions/5.7.0");var s8;function i8(e){return"0x"===e?null:a3(e)}function a8(e){return"0x"===e?d3:D2.from(e)}function o8(e,t){return function(e){return a3(_2(W2(_2(n8(e),1)),12))}(function(e,t){const n=T2(t),r={r:w2(n.r),s:w2(n.s)};return"0x"+e8().recoverPubKey(w2(e),r,n.recoveryParam).encode("hex",!1)}(w2(e),t))}function c8(e,t){const n=k2(D2.from(e).toHexString());return n.length>32&&r8.throwArgumentError("invalid length for "+t,"transaction:"+t,e),n}function l8(e,t){return{address:a3(e),storageKeys:(t||[]).map(((t,n)=>(32!==P2(t)&&r8.throwArgumentError("invalid access list storageKey",`accessList[${e}:${n}]`,t),t.toLowerCase())))}}function u8(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&r8.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),l8(e[0],e[1])):l8(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const n=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return l8(t,Object.keys(n).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function d8(e){return u8(e).map((e=>[e.address,e.storageKeys]))}function h8(e,t){if(null!=e.gasPrice){const t=D2.from(e.gasPrice),n=D2.from(e.maxFeePerGas||0);t.eq(n)||r8.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:n})}const n=[c8(e.chainId||0,"chainId"),c8(e.nonce||0,"nonce"),c8(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),c8(e.maxFeePerGas||0,"maxFeePerGas"),c8(e.gasLimit||0,"gasLimit"),null!=e.to?a3(e.to):"0x",c8(e.value||0,"value"),e.data||"0x",d8(e.accessList||[])];if(t){const e=T2(t);n.push(c8(e.recoveryParam,"recoveryParam")),n.push(k2(e.r)),n.push(k2(e.s))}return S2(["0x02",J2(n)])}function p8(e,t){const n=[c8(e.chainId||0,"chainId"),c8(e.nonce||0,"nonce"),c8(e.gasPrice||0,"gasPrice"),c8(e.gasLimit||0,"gasLimit"),null!=e.to?a3(e.to):"0x",c8(e.value||0,"value"),e.data||"0x",d8(e.accessList||[])];if(t){const e=T2(t);n.push(c8(e.recoveryParam,"recoveryParam")),n.push(k2(e.r)),n.push(k2(e.s))}return S2(["0x01",J2(n)])}function f8(e,t,n){try{const n=a8(t[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");e.v=n}catch(e){r8.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=B2(t[1],32),e.s=B2(t[2],32);try{const t=W2(n(e));e.from=o8(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function m8(e){const t=w2(e);if(t[0]>127)return function(e){const t=t3(e);9!==t.length&&6!==t.length&&r8.throwArgumentError("invalid raw transaction","rawTransaction",e);const n={nonce:a8(t[0]).toNumber(),gasPrice:a8(t[1]),gasLimit:a8(t[2]),to:i8(t[3]),value:a8(t[4]),data:t[5],chainId:0};if(6===t.length)return n;try{n.v=D2.from(t[6]).toNumber()}catch(e){return n}if(n.r=B2(t[7],32),n.s=B2(t[8],32),D2.from(n.r).isZero()&&D2.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);let r=n.v-27;const s=t.slice(0,6);0!==n.chainId&&(s.push(C2(n.chainId)),s.push("0x"),s.push("0x"),r-=2*n.chainId+8);const i=W2(J2(s));try{n.from=o8(i,{r:C2(n.r),s:C2(n.s),recoveryParam:r})}catch(e){}n.hash=W2(e)}return n.type=null,n}(t);switch(t[0]){case 1:return function(e){const t=t3(e.slice(1));8!==t.length&&11!==t.length&&r8.throwArgumentError("invalid component count for transaction type: 1","payload",C2(e));const n={type:1,chainId:a8(t[0]).toNumber(),nonce:a8(t[1]).toNumber(),gasPrice:a8(t[2]),gasLimit:a8(t[3]),to:i8(t[4]),value:a8(t[5]),data:t[6],accessList:u8(t[7])};return 8===t.length||(n.hash=W2(e),f8(n,t.slice(8),p8)),n}(t);case 2:return function(e){const t=t3(e.slice(1));9!==t.length&&12!==t.length&&r8.throwArgumentError("invalid component count for transaction type: 2","payload",C2(e));const n=a8(t[2]),r=a8(t[3]),s={type:2,chainId:a8(t[0]).toNumber(),nonce:a8(t[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:a8(t[4]),to:i8(t[5]),value:a8(t[6]),data:t[7],accessList:u8(t[8])};return 9===t.length||(s.hash=W2(e),f8(s,t.slice(9),h8)),s}(t)}return r8.throwError(`unsupported transaction type: ${t[0]}`,Y1.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(s8||(s8={}));const b8=e=>{const t=Cz(e.data),n=function(e,t){if(e.length!==t.length)throw new LD({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r"0x"+e.map((e=>b8(e))).join("");const y8=e=>{let t=e;if(!SD(t)&&(t=`0x${t}`,!SD(t)))throw new Error("Invalid signed data "+e);let{r:n,s:r,v:s}=function(e){const{r:t,s:n}=DW.Signature.fromCompact(e.slice(2,130)),r=BigInt(`0x${e.slice(130)}`);return{r:xz(t,{size:32}),s:xz(n,{size:32}),v:r}}(t);0n!==s&&1n!==s||(s+=27n);const i=function({r:e,s:t,v:n}){return`0x${new DW.Signature(pz(e),pz(t)).toCompactHex()}${yz(n).slice(2)}`}({r:n,s:r,v:s});return i},v8=e=>{for(const t of Object.values(xY).concat(Object.values(z1)))if(t.id===e)return t;throw new Error("could not find chain")};class w8 extends OY{constructor(e){super(e),Object.defineProperty(this,"owner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.owner=e.owner}static async init(e){const t=await S1(e.projectId);if(!t)throw new Error("ChainId not found");const n=v8(t);return new w8({...e,chain:n})}async signer(){return await Promise.resolve(this.owner)}async getOwner(){return this.owner.getAddress()}async getEnableData(){return this.getOwner()}encodeEnable(e){return TH({abi:lO,functionName:"enable",args:[e]})}encodeDisable(e="0x"){return TH({abi:lO,functionName:"disable",args:[e]})}async getDummyUserOpSignature(){return"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"}async isPluginEnabled(e,t){if(!this.publicClient)throw new Error("Validator uninitialized: PublicClient missing");const n=await this.publicClient.readContract({abi:uO,address:e,functionName:"getExecution",args:[t]}),r=await this.publicClient.readContract({abi:lO,address:this.validatorAddress,functionName:"ecdsaValidatorStorage",args:[e]});return n.validator.toLowerCase()===this.validatorAddress.toLowerCase()&&r.toLowerCase()===(await this.getEnableData()).toLowerCase()}async signMessage(e){return await this.owner.signMessage(e)}async signTypedData(e){return y8(await this.owner.signTypedData(e))}async signUserOp(e){if(!this.chain)throw new Error("Validator uninitialized");const t=jU({...e,signature:"0x"},this.entryPointAddress,BigInt(this.chain.id)),n="string"==typeof t?Cz(t):t;return await this.owner.signMessage(n)}}kH("doRecovery(address, bytes)");var x8={},k8={exports:{}};var E8,A8={exports:{}},C8=Ve(Object.freeze({__proto__:null,default:{}}));function P8(){return E8||(E8=1,function(e){var t;e.exports=(t=t||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==qe&&qe.crypto&&(n=qe.crypto),!n)try{n=C8}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},a=i.lib={},o=a.Base={extend:function(e){var t=s(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=o.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,s=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var o=0;o>>2]=n[o>>>2];return this.sigBytes+=s,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-s%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},d=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],s=0;s>>2]>>>24-s%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},h=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,s=r.words,i=r.sigBytes,a=this.blockSize,o=i/(4*a),l=(o=t?e.ceil(o):e.max((0|o)-this._minBufferSize,0))*a,u=e.min(4*l,i);if(l){for(var d=0;d>>7)^(f<<14|f>>>18)^f>>>3,b=l[p-2],g=(b<<15|b>>>17)^(b<<13|b>>>19)^b>>>10;l[p]=m+l[p-7]+g+l[p-16]}var y=r&s^r&i^s&i,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=h+((o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25))+(o&u^~o&d)+c[p]+l[p];h=d,d=u,u=o,o=a+w|0,a=i,i=s,s=r,r=w+(v+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+s|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+o|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,s=8*t.sigBytes;return n[s>>>5]|=128<<24-s%32,n[14+(s+64>>>9<<4)]=e.floor(r/4294967296),n[15+(s+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=i._createHelper(u),n.HmacSHA256=i._createHmacHelper(u)}(Math),t.SHA256)}(k8);var _8=k8.exports,S8={exports:{}};!function(e){e.exports=function(){function e(e,t){var n=t?"└":"├";return n+=e?"─ ":"──┐"}function t(e,t){var n=[];for(var r in e)e.hasOwnProperty(r)&&(t&&"function"==typeof e[r]||n.push(r));return n}function n(r,s,i,a,o,c,l){var u,d,h="",p=0,f=a.slice(0);if(f.push([s,i])&&a.length>0&&(a.forEach((function(e,t){t>0&&(h+=(e[1]?" ":"│")+" "),d||e[0]!==s||(d=!0)})),h+=e(r,i)+r,o&&("object"!=typeof s||s instanceof Date)&&(h+=": "+s),d&&(h+=" (circular ref.)"),l(h)),!d&&"object"==typeof s){var m=t(s,c);m.forEach((function(e){u=++p===m.length,n(e,s[e],u,f,o,c,l)}))}}var r={asLines:function(e,t,r,s){n(".",e,!1,[],t,"function"!=typeof r&&r,s||r)},asTree:function(e,t,r){var s="";return n(".",e,!1,[],t,r,(function(e){s+=e+"\n"})),s}};return r}()}(S8);var I8,B8=S8.exports,T8={},M8={exports:{}},O8={exports:{}};function N8(){return I8||(I8=1,function(e){var t;e.exports=(t=P8(),function(e){var n=t,r=n.lib,s=r.Base,i=r.WordArray,a=n.x64={};a.Word=s.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=s.extend({init:function(t,n){t=this.words=t||[],this.sigBytes=n!=e?n:8*t.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r>>2]|=e[s]<<24-s%4*8;n.call(this,r,t)}else n.apply(this,arguments)};r.prototype=e}}(),t.lib.WordArray)}(F8)),F8.exports}var L8,U8={exports:{}};function D8(){return L8||(L8=1,function(e){var t;e.exports=(t=P8(),function(){var e=t,n=e.lib.WordArray,r=e.enc;function s(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],s=0;s>>2]>>>16-s%4*8&65535;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,r=[],s=0;s>>1]|=e.charCodeAt(s)<<16-s%2*16;return n.create(r,2*t)}},r.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>16-i%4*8&65535);r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=s(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}}}(),t.enc.Utf16)}(U8)),U8.exports}var z8,H8={exports:{}};function G8(){return z8||(z8=1,function(e){var t;e.exports=(t=P8(),function(){var e=t,n=e.lib.WordArray;function r(e,t,r){for(var s=[],i=0,a=0;a>>6-a%4*2;s[i>>>2]|=o<<24-i%4*8,i++}return n.create(s,i)}e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var s=[],i=0;i>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,o=0;o<4&&i+.75*o>>6*(3-o)&63));var c=r.charAt(64);if(c)for(;s.length%4;)s.push(c);return s.join("")},parse:function(e){var t=e.length,n=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var i=0;i>>6-a%4*2;s[i>>>2]|=o<<24-i%4*8,i++}return n.create(s,i)}e.enc.Base64url={stringify:function(e,t){void 0===t&&(t=!0);var n=e.words,r=e.sigBytes,s=t?this._safe_map:this._map;e.clamp();for(var i=[],a=0;a>>2]>>>24-a%4*8&255)<<16|(n[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|n[a+2>>>2]>>>24-(a+2)%4*8&255,c=0;c<4&&a+.75*c>>6*(3-c)&63));var l=s.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(e,t){void 0===t&&(t=!0);var n=e.length,s=t?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>24)|4278255360&(s<<24|s>>>8)}var i=this._hash.words,a=e[t+0],c=e[t+1],p=e[t+2],f=e[t+3],m=e[t+4],b=e[t+5],g=e[t+6],y=e[t+7],v=e[t+8],w=e[t+9],x=e[t+10],k=e[t+11],E=e[t+12],A=e[t+13],C=e[t+14],P=e[t+15],_=i[0],S=i[1],I=i[2],B=i[3];_=l(_,S,I,B,a,7,o[0]),B=l(B,_,S,I,c,12,o[1]),I=l(I,B,_,S,p,17,o[2]),S=l(S,I,B,_,f,22,o[3]),_=l(_,S,I,B,m,7,o[4]),B=l(B,_,S,I,b,12,o[5]),I=l(I,B,_,S,g,17,o[6]),S=l(S,I,B,_,y,22,o[7]),_=l(_,S,I,B,v,7,o[8]),B=l(B,_,S,I,w,12,o[9]),I=l(I,B,_,S,x,17,o[10]),S=l(S,I,B,_,k,22,o[11]),_=l(_,S,I,B,E,7,o[12]),B=l(B,_,S,I,A,12,o[13]),I=l(I,B,_,S,C,17,o[14]),_=u(_,S=l(S,I,B,_,P,22,o[15]),I,B,c,5,o[16]),B=u(B,_,S,I,g,9,o[17]),I=u(I,B,_,S,k,14,o[18]),S=u(S,I,B,_,a,20,o[19]),_=u(_,S,I,B,b,5,o[20]),B=u(B,_,S,I,x,9,o[21]),I=u(I,B,_,S,P,14,o[22]),S=u(S,I,B,_,m,20,o[23]),_=u(_,S,I,B,w,5,o[24]),B=u(B,_,S,I,C,9,o[25]),I=u(I,B,_,S,f,14,o[26]),S=u(S,I,B,_,v,20,o[27]),_=u(_,S,I,B,A,5,o[28]),B=u(B,_,S,I,p,9,o[29]),I=u(I,B,_,S,y,14,o[30]),_=d(_,S=u(S,I,B,_,E,20,o[31]),I,B,b,4,o[32]),B=d(B,_,S,I,v,11,o[33]),I=d(I,B,_,S,k,16,o[34]),S=d(S,I,B,_,C,23,o[35]),_=d(_,S,I,B,c,4,o[36]),B=d(B,_,S,I,m,11,o[37]),I=d(I,B,_,S,y,16,o[38]),S=d(S,I,B,_,x,23,o[39]),_=d(_,S,I,B,A,4,o[40]),B=d(B,_,S,I,a,11,o[41]),I=d(I,B,_,S,f,16,o[42]),S=d(S,I,B,_,g,23,o[43]),_=d(_,S,I,B,w,4,o[44]),B=d(B,_,S,I,E,11,o[45]),I=d(I,B,_,S,P,16,o[46]),_=h(_,S=d(S,I,B,_,p,23,o[47]),I,B,a,6,o[48]),B=h(B,_,S,I,y,10,o[49]),I=h(I,B,_,S,C,15,o[50]),S=h(S,I,B,_,b,21,o[51]),_=h(_,S,I,B,E,6,o[52]),B=h(B,_,S,I,f,10,o[53]),I=h(I,B,_,S,x,15,o[54]),S=h(S,I,B,_,c,21,o[55]),_=h(_,S,I,B,v,6,o[56]),B=h(B,_,S,I,P,10,o[57]),I=h(I,B,_,S,g,15,o[58]),S=h(S,I,B,_,A,21,o[59]),_=h(_,S,I,B,m,6,o[60]),B=h(B,_,S,I,k,10,o[61]),I=h(I,B,_,S,p,15,o[62]),S=h(S,I,B,_,w,21,o[63]),i[0]=i[0]+_|0,i[1]=i[1]+S|0,i[2]=i[2]+I|0,i[3]=i[3]+B|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,s=8*t.sigBytes;n[s>>>5]|=128<<24-s%32;var i=e.floor(r/4294967296),a=r;n[15+(s+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(s+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(n.length+1),this._process();for(var o=this._hash,c=o.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,n,r,s,i,a){var o=e+(t&n|~t&r)+s+a;return(o<>>32-i)+t}function u(e,t,n,r,s,i,a){var o=e+(t&r|n&~r)+s+a;return(o<>>32-i)+t}function d(e,t,n,r,s,i,a){var o=e+(t^n^r)+s+a;return(o<>>32-i)+t}function h(e,t,n,r,s,i,a){var o=e+(n^(t|~r))+s+a;return(o<>>32-i)+t}n.MD5=i._createHelper(c),n.HmacMD5=i._createHmacHelper(c)}(Math),t.MD5)}(Z8)),Z8.exports}var K8,Y8={exports:{}};function J8(){return K8||(K8=1,function(e){var t;e.exports=(t=P8(),function(){var e=t,n=e.lib,r=n.WordArray,s=n.Hasher,i=e.algo,a=[],o=i.SHA1=s.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],s=n[1],i=n[2],o=n[3],c=n[4],l=0;l<80;l++){if(l<16)a[l]=0|e[t+l];else{var u=a[l-3]^a[l-8]^a[l-14]^a[l-16];a[l]=u<<1|u>>>31}var d=(r<<5|r>>>27)+c+a[l];d+=l<20?1518500249+(s&i|~s&o):l<40?1859775393+(s^i^o):l<60?(s&i|s&o|i&o)-1894007588:(s^i^o)-899497514,c=o,o=i,i=s<<30|s>>>2,s=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+s|0,n[2]=n[2]+i|0,n[3]=n[3]+o|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=s._createHelper(o),e.HmacSHA1=s._createHmacHelper(o)}(),t.SHA1)}(Y8)),Y8.exports}var X8,e7={exports:{}};var t7,n7={exports:{}};function r7(){return t7||(t7=1,function(e){var t;e.exports=(t=P8(),N8(),function(){var e=t,n=e.lib.Hasher,r=e.x64,s=r.Word,i=r.WordArray,a=e.algo;function o(){return s.create.apply(s,arguments)}var c=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=o()}();var u=a.SHA512=n.extend({_doReset:function(){this._hash=new i.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],s=n[1],i=n[2],a=n[3],o=n[4],u=n[5],d=n[6],h=n[7],p=r.high,f=r.low,m=s.high,b=s.low,g=i.high,y=i.low,v=a.high,w=a.low,x=o.high,k=o.low,E=u.high,A=u.low,C=d.high,P=d.low,_=h.high,S=h.low,I=p,B=f,T=m,M=b,O=g,N=y,R=v,F=w,j=x,L=k,U=E,D=A,z=C,H=P,G=_,q=S,$=0;$<80;$++){var V,W,Z=l[$];if($<16)W=Z.high=0|e[t+2*$],V=Z.low=0|e[t+2*$+1];else{var Q=l[$-15],K=Q.high,Y=Q.low,J=(K>>>1|Y<<31)^(K>>>8|Y<<24)^K>>>7,X=(Y>>>1|K<<31)^(Y>>>8|K<<24)^(Y>>>7|K<<25),ee=l[$-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,se=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),ie=l[$-7],ae=ie.high,oe=ie.low,ce=l[$-16],le=ce.high,ue=ce.low;W=(W=(W=J+ae+((V=X+oe)>>>0>>0?1:0))+re+((V+=se)>>>0>>0?1:0))+le+((V+=ue)>>>0>>0?1:0),Z.high=W,Z.low=V}var de,he=j&U^~j&z,pe=L&D^~L&H,fe=I&T^I&O^T&O,me=B&M^B&N^M&N,be=(I>>>28|B<<4)^(I<<30|B>>>2)^(I<<25|B>>>7),ge=(B>>>28|I<<4)^(B<<30|I>>>2)^(B<<25|I>>>7),ye=(j>>>14|L<<18)^(j>>>18|L<<14)^(j<<23|L>>>9),ve=(L>>>14|j<<18)^(L>>>18|j<<14)^(L<<23|j>>>9),we=c[$],xe=we.high,ke=we.low,Ee=G+ye+((de=q+ve)>>>0>>0?1:0),Ae=ge+me;G=z,q=H,z=U,H=D,U=j,D=L,j=R+(Ee=(Ee=(Ee=Ee+he+((de+=pe)>>>0>>0?1:0))+xe+((de+=ke)>>>0>>0?1:0))+W+((de+=V)>>>0>>0?1:0))+((L=F+de|0)>>>0>>0?1:0)|0,R=O,F=N,O=T,N=M,T=I,M=B,I=Ee+(be+fe+(Ae>>>0>>0?1:0))+((B=de+Ae|0)>>>0>>0?1:0)|0}f=r.low=f+B,r.high=p+I+(f>>>0>>0?1:0),b=s.low=b+M,s.high=m+T+(b>>>0>>0?1:0),y=i.low=y+N,i.high=g+O+(y>>>0>>0?1:0),w=a.low=w+F,a.high=v+R+(w>>>0>>0?1:0),k=o.low=k+L,o.high=x+j+(k>>>0>>0?1:0),A=u.low=A+D,u.high=E+U+(A>>>0>>0?1:0),P=d.low=P+H,d.high=C+z+(P>>>0>>0?1:0),S=h.low=S+q,h.high=_+G+(S>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=n._createHelper(u),e.HmacSHA512=n._createHmacHelper(u)}(),t.SHA512)}(n7)),n7.exports}var s7,i7={exports:{}};var a7,o7={exports:{}};function c7(){return a7||(a7=1,function(e){var t;e.exports=(t=P8(),N8(),function(e){var n=t,r=n.lib,s=r.WordArray,i=r.Hasher,a=n.x64.Word,o=n.algo,c=[],l=[],u=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var s=1,i=0;i<24;i++){for(var o=0,d=0,h=0;h<7;h++){if(1&s){var p=(1<>>24)|4278255360&(i<<24|i>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(S=n[s]).high^=a,S.low^=i}for(var o=0;o<24;o++){for(var h=0;h<5;h++){for(var p=0,f=0,m=0;m<5;m++)p^=(S=n[h+5*m]).high,f^=S.low;var b=d[h];b.high=p,b.low=f}for(h=0;h<5;h++){var g=d[(h+4)%5],y=d[(h+1)%5],v=y.high,w=y.low;for(p=g.high^(v<<1|w>>>31),f=g.low^(w<<1|v>>>31),m=0;m<5;m++)(S=n[h+5*m]).high^=p,S.low^=f}for(var x=1;x<25;x++){var k=(S=n[x]).high,E=S.low,A=c[x];A<32?(p=k<>>32-A,f=E<>>32-A):(p=E<>>64-A,f=k<>>64-A);var C=d[l[x]];C.high=p,C.low=f}var P=d[0],_=n[0];for(P.high=_.high,P.low=_.low,h=0;h<5;h++)for(m=0;m<5;m++){var S=n[x=h+5*m],I=d[x],B=d[(h+1)%5+5*m],T=d[(h+2)%5+5*m];S.high=I.high^~B.high&T.high,S.low=I.low^~B.low&T.low}S=n[0];var M=u[o];S.high^=M.high,S.low^=M.low}},_doFinalize:function(){var t=this._data,n=t.words;this._nDataBytes;var r=8*t.sigBytes,i=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(e.ceil((r+1)/i)*i>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var a=this._state,o=this.cfg.outputLength/8,c=o/8,l=[],u=0;u>>24)|4278255360&(h<<24|h>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),l.push(p),l.push(h)}return new s.init(l,o)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=i._createHelper(h),n.HmacSHA3=i._createHmacHelper(h)}(Math),t.SHA3)}(o7)),o7.exports}var l7,u7={exports:{}};var d7,h7={exports:{}};function p7(){return d7||(d7=1,function(e){var t;e.exports=(t=P8(),void function(){var e=t,n=e.lib.Base,r=e.enc.Utf8;e.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,s=4*n;t.sigBytes>s&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),o=i.words,c=a.words,l=0;l>>2];e.sigBytes-=t}};r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:p,padding:f}),reset:function(){var e;u.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var m=r.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),b=(n.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?i.create([1398893684,1701076831]).concat(n).concat(t):t).toString(c)},parse:function(e){var t,n=c.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=i.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),m.create({ciphertext:n,salt:t})}},g=r.SerializableCipher=s.extend({cfg:s.extend({format:b}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var s=e.createEncryptor(n,r),i=s.finalize(t),a=s.cfg;return m.create({ciphertext:i,key:n,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),y=(n.kdf={}).OpenSSL={execute:function(e,t,n,r,s){if(r||(r=i.random(8)),s)a=l.create({keySize:t+n,hasher:s}).compute(e,r);else var a=l.create({keySize:t+n}).compute(e,r);var o=i.create(a.words.slice(t),4*n);return a.sigBytes=4*t,m.create({key:a,iv:o,salt:r})}},v=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:y}),encrypt:function(e,t,n,r){var s=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=s.iv;var i=g.encrypt.call(this,e,t,s.key,r);return i.mixIn(s),i},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var s=r.kdf.execute(n,e.keySize,e.ivSize,t.salt,r.hasher);return r.iv=s.iv,g.decrypt.call(this,e,t,s.key,r)}})}()))}(w7)),w7.exports}var k7,E7={exports:{}};function A7(){return k7||(k7=1,function(e){var t;e.exports=(t=P8(),x7(),t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function n(e,t,n,r){var s,i=this._iv;i?(s=i.slice(0),this._iv=void 0):s=this._prevBlock,r.encryptBlock(s,0);for(var a=0;a>24))e+=1<<24;else{var t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}return e}function r(e){return 0===(e[0]=n(e[0]))&&(e[1]=n(e[1])),e}var s=e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,s=n.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0),r(a);var o=a.slice(0);n.encryptBlock(o,0);for(var c=0;c>>5]>>>31-r%32&1}for(var s=this._subKeys=[],i=0;i<16;i++){var l=s[i]=[],u=c[i];for(n=0;n<24;n++)l[n/6|0]|=t[(o[n]-1+u)%28]<<31-n%6,l[4+(n/6|0)]|=t[28+(o[n+24]-1+u)%28]<<31-n%6;for(l[0]=l[0]<<1|l[0]>>>31,n=1;n<7;n++)l[n]=l[n]>>>4*(n-1)+3;l[7]=l[7]<<5|l[7]>>>27}var d=this._invSubKeys=[];for(n=0;n<16;n++)d[n]=s[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],h.call(this,4,252645135),h.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),h.call(this,1,1431655765);for(var r=0;r<16;r++){for(var s=n[r],i=this._lBlock,a=this._rBlock,o=0,c=0;c<8;c++)o|=l[c][((a^s[c])&u[c])>>>0];this._lBlock=a,this._rBlock=i^o}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,h.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function h(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),s=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(r.create(t)),this._des2=d.createEncryptor(r.create(n)),this._des3=d.createEncryptor(r.create(s))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=s._createHelper(f)}(),t.TripleDES)}(Y7)),Y7.exports}var X7,e9={exports:{}};var t9,n9={exports:{}};var r9,s9={exports:{}};var i9,a9={exports:{}};function o9(){return i9||(i9=1,function(e){var t;e.exports=(t=P8(),G8(),Q8(),y7(),x7(),function(){var e=t,n=e.lib.BlockCipher,r=e.algo;const s=16,i=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],a=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function c(e,t){let n=t>>24&255,r=t>>16&255,s=t>>8&255,i=255&t,a=e.sbox[0][n]+e.sbox[1][r];return a^=e.sbox[2][s],a+=e.sbox[3][i],a}function l(e,t,n){let r,i=t,a=n;for(let t=0;t1;--t)i^=e.pbox[t],a=c(e,i)^a,r=i,i=a,a=r;return r=i,i=a,a=r,a^=e.pbox[1],i^=e.pbox[0],{left:i,right:a}}function d(e,t,n){for(let t=0;t<4;t++){e.sbox[t]=[];for(let n=0;n<256;n++)e.sbox[t][n]=a[t][n]}let r=0;for(let a=0;a=n&&(r=0);let o=0,c=0,u=0;for(let t=0;t>>24)|4278255360&(s<<24|s>>>8)}var i,h,v,w,x,k,E,A,C,P,_,S=this._hash.words,I=u.words,B=d.words,T=a.words,M=o.words,O=c.words,N=l.words;for(k=i=S[0],E=h=S[1],A=v=S[2],C=w=S[3],P=x=S[4],n=0;n<80;n+=1)_=i+e[t+T[n]]|0,_+=n<16?p(h,v,w)+I[0]:n<32?f(h,v,w)+I[1]:n<48?m(h,v,w)+I[2]:n<64?b(h,v,w)+I[3]:g(h,v,w)+I[4],_=(_=y(_|=0,O[n]))+x|0,i=x,x=w,w=y(v,10),v=h,h=_,_=k+e[t+M[n]]|0,_+=n<16?g(E,A,C)+B[0]:n<32?b(E,A,C)+B[1]:n<48?m(E,A,C)+B[2]:n<64?f(E,A,C)+B[3]:p(E,A,C)+B[4],_=(_=y(_|=0,N[n]))+P|0,k=P,P=C,C=y(A,10),A=E,E=_;_=S[1]+v+C|0,S[1]=S[2]+w+P|0,S[2]=S[3]+x+k|0,S[3]=S[4]+i+E|0,S[4]=S[0]+h+A|0,S[0]=_},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var s=this._hash,i=s.words,a=0;a<5;a++){var o=i[a];i[a]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}return s},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,n){return e^t^n}function f(e,t,n){return e&t|~e&n}function m(e,t,n){return(e|~t)^n}function b(e,t,n){return e&n|t&~n}function g(e,t,n){return e^(t|~n)}function y(e,t){return e<>>32-t}e.RIPEMD160=s._createHelper(h),e.HmacRIPEMD160=s._createHmacHelper(h)}(),t.RIPEMD160)}(u7)),p7(),f7||(f7=1,function(e){var t;e.exports=(t=P8(),p7(),function(){var e=t,n=e.lib,r=n.Base,s=n.WordArray,i=e.algo,a=i.SHA256,o=i.HMAC,c=i.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:a,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=o.create(n.hasher,e),i=s.create(),a=s.create([1]),c=i.words,l=a.words,u=n.keySize,d=n.iterations;c.length>>2]|=s<<24-i%4*8,e.sigBytes+=s},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},t.pad.Ansix923)}(j7)),L7||(L7=1,function(e){var t;e.exports=(t=P8(),x7(),t.pad.Iso10126={pad:function(e,n){var r=4*n,s=r-e.sigBytes%r;e.concat(t.lib.WordArray.random(s-1)).concat(t.lib.WordArray.create([s<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},t.pad.Iso10126)}(U7)),D7||(D7=1,function(e){var t;e.exports=(t=P8(),x7(),t.pad.Iso97971={pad:function(e,n){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,n)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971)}(z7)),H7||(H7=1,function(e){var t;e.exports=(t=P8(),x7(),t.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},t.pad.ZeroPadding)}(G7)),q7||(q7=1,function(e){var t;e.exports=(t=P8(),x7(),t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding)}($7)),V7||(V7=1,function(e){var t;e.exports=(t=P8(),x7(),function(){var e=t,n=e.lib.CipherParams,r=e.enc.Hex;e.format.Hex={stringify:function(e){return e.ciphertext.toString(r)},parse:function(e){var t=r.parse(e);return n.create({ciphertext:t})}}}(),t.format.Hex)}(W7)),Z7||(Z7=1,function(e){var t;e.exports=(t=P8(),G8(),Q8(),y7(),x7(),function(){var e=t,n=e.lib.BlockCipher,r=e.algo,s=[],i=[],a=[],o=[],c=[],l=[],u=[],d=[],h=[],p=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var f=r^r<<1^r<<2^r<<3^r<<4;f=f>>>8^255&f^99,s[n]=f,i[f]=n;var m=e[n],b=e[m],g=e[b],y=257*e[f]^16843008*f;a[n]=y<<24|y>>>8,o[n]=y<<16|y>>>16,c[n]=y<<8|y>>>24,l[n]=y,y=16843009*g^65537*b^257*m^16843008*n,u[f]=y<<24|y>>>8,d[f]=y<<16|y>>>16,h[f]=y<<8|y>>>24,p[f]=y,n?(n=m^e[e[e[g^m]]],r^=e[e[r]]):n=r=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],m=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],a=0;a6&&a%n==4&&(l=s[l>>>24]<<24|s[l>>>16&255]<<16|s[l>>>8&255]<<8|s[255&l]):(l=s[(l=l<<8|l>>>24)>>>24]<<24|s[l>>>16&255]<<16|s[l>>>8&255]<<8|s[255&l],l^=f[a/n|0]<<24),i[a]=i[a-n]^l);for(var o=this._invKeySchedule=[],c=0;c>>24]]^d[s[l>>>16&255]]^h[s[l>>>8&255]]^p[s[255&l]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,o,c,l,s)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,h,p,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,s,i,a,o){for(var c=this._nRounds,l=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],h=e[t+3]^n[3],p=4,f=1;f>>24]^s[u>>>16&255]^i[d>>>8&255]^a[255&h]^n[p++],b=r[u>>>24]^s[d>>>16&255]^i[h>>>8&255]^a[255&l]^n[p++],g=r[d>>>24]^s[h>>>16&255]^i[l>>>8&255]^a[255&u]^n[p++],y=r[h>>>24]^s[l>>>16&255]^i[u>>>8&255]^a[255&d]^n[p++];l=m,u=b,d=g,h=y}m=(o[l>>>24]<<24|o[u>>>16&255]<<16|o[d>>>8&255]<<8|o[255&h])^n[p++],b=(o[u>>>24]<<24|o[d>>>16&255]<<16|o[h>>>8&255]<<8|o[255&l])^n[p++],g=(o[d>>>24]<<24|o[h>>>16&255]<<16|o[l>>>8&255]<<8|o[255&u])^n[p++],y=(o[h>>>24]<<24|o[l>>>16&255]<<16|o[u>>>8&255]<<8|o[255&d])^n[p++],e[t]=m,e[t+1]=b,e[t+2]=g,e[t+3]=y},keySize:8});e.AES=n._createHelper(m)}(),t.AES)}(Q7)),J7(),X7||(X7=1,function(e){var t;e.exports=(t=P8(),G8(),Q8(),y7(),x7(),function(){var e=t,n=e.lib.StreamCipher,r=e.algo,s=r.RC4=n.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],s=0;s<256;s++)r[s]=s;s=0;for(var i=0;s<256;s++){var a=s%n,o=t[a>>>2]>>>24-a%4*8&255;i=(i+r[s]+o)%256;var c=r[s];r[s]=r[i],r[i]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,n=this._j,r=0,s=0;s<4;s++){n=(n+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[n],e[n]=i,r|=e[(e[t]+e[n])%256]<<24-8*s}return this._i=t,this._j=n,r}e.RC4=n._createHelper(s);var a=r.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});e.RC4Drop=n._createHelper(a)}(),t.RC4)}(e9)),t9||(t9=1,function(e){var t;e.exports=(t=P8(),G8(),Q8(),y7(),x7(),function(){var e=t,n=e.lib.StreamCipher,r=e.algo,s=[],i=[],a=[],o=r.Rabbit=n.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],s=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)s[n]^=r[n+4&7];if(t){var i=t.words,a=i[0],o=i[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),d=l>>>16|4294901760&u,h=u<<16|65535&l;for(s[0]^=l,s[1]^=d,s[2]^=u,s[3]^=h,s[4]^=l,s[5]^=d,s[6]^=u,s[7]^=h,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),s[0]=n[0]^n[5]>>>16^n[3]<<16,s[1]=n[2]^n[7]>>>16^n[5]<<16,s[2]=n[4]^n[1]>>>16^n[7]<<16,s[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)s[r]=16711935&(s[r]<<8|s[r]>>>24)|4278255360&(s[r]<<24|s[r]>>>8),e[t+r]^=s[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],s=65535&r,o=r>>>16,c=((s*s>>>17)+s*o>>>15)+o*o,l=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=n._createHelper(o)}(),t.Rabbit)}(n9)),r9||(r9=1,function(e){var t;e.exports=(t=P8(),G8(),Q8(),y7(),x7(),function(){var e=t,n=e.lib.StreamCipher,r=e.algo,s=[],i=[],a=[],o=r.RabbitLegacy=n.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var s=0;s<4;s++)c.call(this);for(s=0;s<8;s++)r[s]^=n[s+4&7];if(t){var i=t.words,a=i[0],o=i[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),d=l>>>16|4294901760&u,h=u<<16|65535&l;for(r[0]^=l,r[1]^=d,r[2]^=u,r[3]^=h,r[4]^=l,r[5]^=d,r[6]^=u,r[7]^=h,s=0;s<4;s++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),s[0]=n[0]^n[5]>>>16^n[3]<<16,s[1]=n[2]^n[7]>>>16^n[5]<<16,s[2]=n[4]^n[1]>>>16^n[7]<<16,s[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)s[r]=16711935&(s[r]<<8|s[r]>>>24)|4278255360&(s[r]<<24|s[r]>>>8),e[t+r]^=s[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],s=65535&r,o=r>>>16,c=((s*s>>>17)+s*o>>>15)+o*o,l=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=n._createHelper(o)}(),t.RabbitLegacy)}(s9)),o9(),t)}(M8);var c9=M8.exports,l9=qe&&qe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(T8,"__esModule",{value:!0}),T8.Base=void 0;const u9=O2,d9=l9(c9);let h9=class e{print(){e.print(this)}bufferIndexOf(e,t,n=!1){if(n)return this.binarySearch(e,t,u9.Buffer.compare);return this.linearSearch(e,t,((e,t)=>e.equals(t)))}static binarySearch(e,t,n){let r=0,s=e.length-1;for(;r<=s;){const i=Math.floor((r+s)/2),a=n(e[i],t);if(0===a){for(let r=i-1;r>=0;r--)if(0!==n(e[r],t))return r+1;return 0}a<0?r=i+1:s=i-1}return-1}binarySearch(t,n,r){return e.binarySearch(t,n,r)}static linearSearch(e,t,n){for(let r=0;r{const n=e(t);return u9.Buffer.isBuffer(n)?n:this.isHexString(n)?u9.Buffer.from(n.replace("0x",""),"hex"):"string"==typeof n?u9.Buffer.from(n):"bigint"==typeof n?u9.Buffer.from(t.toString(16),"hex"):ArrayBuffer.isView(n)?u9.Buffer.from(n.buffer,n.byteOffset,n.byteLength):u9.Buffer.from(e(d9.default.enc.Hex.parse(t.toString("hex"))).toString(d9.default.enc.Hex),"hex")}}isHexString(t){return e.isHexString(t)}log2(e){return 1===e?0:1+this.log2(e/2|0)}zip(e,t){return e.map(((e,n)=>[e,t[n]]))}static hexZeroPad(e,t){return"0x"+e.replace("0x","").padStart(t,"0")}};T8.Base=h9,T8.default=h9;var p9=qe&&qe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(x8,"__esModule",{value:!0}),x8.MerkleTree=void 0;const f9=O2,m9=p9((function(e){for(var t=new lX(e.length),n=0,r=e.length-1;n<=r;++n,--r)t[n]=e[r],t[r]=e[n];return t})),b9=p9(_8),g9=p9(B8),y9=p9(T8);class v9 extends y9.default{constructor(e,t=b9.default,n={}){if(super(),this.duplicateOdd=!1,this.concatenator=f9.Buffer.concat,this.hashLeaves=!1,this.isBitcoinTree=!1,this.leaves=[],this.layers=[],this.sortLeaves=!1,this.sortPairs=!1,this.sort=!1,this.fillDefaultHash=null,this.complete=!1,n.complete){if(n.isBitcoinTree)throw new Error('option "complete" is incompatible with "isBitcoinTree"');if(n.duplicateOdd)throw new Error('option "complete" is incompatible with "duplicateOdd"')}if(this.isBitcoinTree=!!n.isBitcoinTree,this.hashLeaves=!!n.hashLeaves,this.sortLeaves=!!n.sortLeaves,this.sortPairs=!!n.sortPairs,this.complete=!!n.complete,n.fillDefaultHash)if("function"==typeof n.fillDefaultHash)this.fillDefaultHash=n.fillDefaultHash;else{if(!f9.Buffer.isBuffer(n.fillDefaultHash)&&"string"!=typeof n.fillDefaultHash)throw new Error('method "fillDefaultHash" must be a function, Buffer, or string');this.fillDefaultHash=(e,t)=>n.fillDefaultHash}this.sort=!!n.sort,this.sort&&(this.sortLeaves=!0,this.sortPairs=!0),this.duplicateOdd=!!n.duplicateOdd,n.concatenator&&(this.concatenator=n.concatenator),this.hashFn=this.bufferifyFn(t),this.processLeaves(e)}getOptions(){var e,t;return{complete:this.complete,isBitcoinTree:this.isBitcoinTree,hashLeaves:this.hashLeaves,sortLeaves:this.sortLeaves,sortPairs:this.sortPairs,sort:this.sort,fillDefaultHash:null!==(t=null===(e=this.fillDefaultHash)||void 0===e?void 0:e.toString())&&void 0!==t?t:null,duplicateOdd:this.duplicateOdd}}processLeaves(e){if(this.hashLeaves&&(e=e.map(this.hashFn)),this.leaves=e.map(this.bufferify),this.sortLeaves&&(this.leaves=this.leaves.sort(f9.Buffer.compare)),this.fillDefaultHash)for(let e=this.leaves.length;e1;){const t=this.layers.length;this.layers.push([]);const n=this.complete&&1===t&&!Number.isInteger(Math.log2(e.length))?2*e.length-Math.pow(2,Math.ceil(Math.log2(e.length))):e.length;for(let r=0;r=n){this.layers[t].push(...e.slice(n));break}if(r+1===e.length&&e.length%2==1){const n=e[e.length-1];let s=n;if(this.isBitcoinTree){s=this.hashFn(this.concatenator([m9.default(n),m9.default(n)])),s=m9.default(this.hashFn(s)),this.layers[t].push(s);continue}if(!this.duplicateOdd){this.layers[t].push(e[r]);continue}}const s=e[r],i=r+1===e.length?s:e[r+1];let a=null;a=this.isBitcoinTree?[m9.default(s),m9.default(i)]:[s,i],this.sortPairs&&a.sort(f9.Buffer.compare);let o=this.hashFn(this.concatenator(a));this.isBitcoinTree&&(o=m9.default(this.hashFn(o))),this.layers[t].push(o)}e=this.layers[t]}}addLeaf(e,t=!1){t&&(e=this.hashFn(e)),this.processLeaves(this.leaves.concat(e))}addLeaves(e,t=!1){t&&(e=e.map(this.hashFn)),this.processLeaves(this.leaves.concat(e))}getLeaves(e){return Array.isArray(e)?(this.hashLeaves&&(e=e.map(this.hashFn),this.sortLeaves&&(e=e.sort(f9.Buffer.compare))),this.leaves.filter((t=>-1!==this.bufferIndexOf(e,t,this.sortLeaves)))):this.leaves}getLeaf(e){return e<0||e>this.leaves.length-1?f9.Buffer.from([]):this.leaves[e]}getLeafIndex(e){e=this.bufferify(e);const t=this.getLeaves();for(let n=0;nthis.bufferToHex(e)))}static marshalLeaves(e){return JSON.stringify(e.map((e=>v9.bufferToHex(e))),null,2)}static unmarshalLeaves(e){let t=null;if("string"==typeof e)t=JSON.parse(e);else{if(!(e instanceof Object))throw new Error("Expected type of string or object");t=e}if(!t)return[];if(!Array.isArray(t))throw new Error("Expected JSON string to be array");return t.map(v9.bufferify)}getLayers(){return this.layers}getHexLayers(){return this.layers.reduce(((e,t)=>(Array.isArray(t)?e.push(t.map((e=>this.bufferToHex(e)))):e.push(t),e)),[])}getLayersFlat(){const e=this.layers.reduce(((e,t)=>(Array.isArray(t)?e.unshift(...t):e.unshift(t),e)),[]);return e.unshift(f9.Buffer.from([0])),e}getHexLayersFlat(){return this.getLayersFlat().map((e=>this.bufferToHex(e)))}getLayerCount(){return this.getLayers().length}getRoot(){return 0===this.layers.length?f9.Buffer.from([]):this.layers[this.layers.length-1][0]||f9.Buffer.from([])}getHexRoot(){return this.bufferToHex(this.getRoot())}getProof(e,t){if(void 0===e)throw new Error("leaf is required");e=this.bufferify(e);const n=[];if(!Number.isInteger(t)){t=-1;for(let n=0;nthis.bufferToHex(e.data)))}getProofs(){const e=[];return this.getProofsDFS(this.layers.length-1,0,[],e),e}getProofsDFS(e,t,n,r){const s=t%2;if(-1===e)return void(s||r.push([...n].reverse()));if(t>=this.layers[e].length)return;const i=this.layers[e],a=s?t-1:t+1;let o=!1;athis.bufferToHex(e.data)))}getPositionalHexProof(e,t){return this.getProof(e,t).map((e=>["left"===e.position?0:1,this.bufferToHex(e.data)]))}static marshalProof(e){const t=e.map((e=>"string"==typeof e?e:f9.Buffer.isBuffer(e)?v9.bufferToHex(e):{position:e.position,data:v9.bufferToHex(e.data)}));return JSON.stringify(t,null,2)}static unmarshalProof(e){let t=null;if("string"==typeof e)t=JSON.parse(e);else{if(!(e instanceof Object))throw new Error("Expected type of string or object");t=e}if(!t)return[];if(!Array.isArray(t))throw new Error("Expected JSON string to be array");return t.map((e=>{if("string"==typeof e)return v9.bufferify(e);if(e instanceof Object)return{position:e.position,data:v9.bufferify(e.data)};throw new Error("Expected item to be of type string or object")}))}static marshalTree(e){const t=e.getHexRoot(),n=e.leaves.map((e=>v9.bufferToHex(e))),r=e.getHexLayers(),s=e.getOptions();return JSON.stringify({options:s,root:t,layers:r,leaves:n},null,2)}static unmarshalTree(e,t=b9.default,n={}){let r=null;if("string"==typeof e)r=JSON.parse(e);else{if(!(e instanceof Object))throw new Error("Expected type of string or object");r=e}if(!r)throw new Error("could not parse json");return n=Object.assign({},r.options||{},n),new v9(r.leaves,t,n)}getProofIndices(e,t){const n=Math.pow(2,t);let r=new Set;for(const t of e){let e=n+t;for(;e>1;)r.add(1^e),e=e/2|0}const s=e.map((e=>n+e)),i=Array.from(r).sort(((e,t)=>e-t)).reverse();r=s.concat(i);const a=new Set,o=[];for(let e of r)if(!a.has(e))for(o.push(e);e>1&&(a.add(e),a.has(1^e));)e=e/2|0;return o.filter((t=>!e.includes(t-n)))}getProofIndicesForUnevenTree(e,t){const n=Math.ceil(Math.log2(t)),r=[];for(let e=0;ee%2==0?e+1:e-1));let n=t.filter((e=>!i.includes(e)));const a=r.find((({index:t})=>t===e));a&&i.includes(a.leavesCount-1)&&(n=n.slice(0,-1)),s.push(n),i=[...new Set(i.map((e=>e%2==0?e/2:e%2==0?(e+1)/2:(e-1)/2)))]}return s}getMultiProof(e,t){this.complete||console.warn("Warning: For correct multiProofs it's strongly recommended to set complete: true"),t||(t=e,e=this.getLayersFlat());if(this.isUnevenTree()&&t.every(Number.isInteger))return this.getMultiProofForUnevenTree(t);if(!t.every(Number.isInteger)){let e=t;this.sortPairs&&(e=e.sort(f9.Buffer.compare));let n=e.map((e=>this.bufferIndexOf(this.leaves,e,this.sortLeaves))).sort(((e,t)=>e===t?0:e>t?1:-1));if(!n.every((e=>-1!==e)))throw new Error("Element does not exist in Merkle tree");const r=[],s=[];let i=[];for(let e=0;en.indexOf(e)===t)),i=[]}return s.filter((e=>!r.includes(e)))}return this.getProofIndices(t,Math.log2(e.length/2|0)).map((t=>e[t]))}getMultiProofForUnevenTree(e,t){t||(t=e,e=this.getLayers());let n=[],r=t;for(const t of e){const e=[];for(const n of r){if(n%2==0){const s=n+1;if(!r.includes(s)&&t[s]){e.push(t[s]);continue}}const s=n-1;r.includes(s)||!t[s]||e.push(t[s])}n=n.concat(e);const s=new Set;for(const e of r)e%2!=0?e%2!=0?s.add((e-1)/2):s.add((e+1)/2):s.add(e/2);r=Array.from(s)}return n}getHexMultiProof(e,t){return this.getMultiProof(e,t).map((e=>this.bufferToHex(e)))}getProofFlags(e,t){if(!Array.isArray(e)||e.length<=0)throw new Error("Invalid Inputs!");let n;if(n=e.every(Number.isInteger)?[...e].sort(((e,t)=>e===t?0:e>t?1:-1)):e.map((e=>this.bufferIndexOf(this.leaves,e,this.sortLeaves))).sort(((e,t)=>e===t?0:e>t?1:-1)),!n.every((e=>-1!==e)))throw new Error("Element does not exist in Merkle tree");const r=t.map((e=>this.bufferify(e))),s=[],i=[];for(let e=0;e{if(!s.includes(t[n])){const e=this.getPairNode(t,n),a=r.includes(t[n])||r.includes(e);e&&i.push(!a),s.push(t[n]),s.push(e)}return e.push(n/2|0),e}),[])}return i}verify(e,t,n){let r=this.bufferify(t);if(n=this.bufferify(n),!Array.isArray(e)||!t||!n)return!1;for(let t=0;tthis.bufferify(e))),s=s.map((e=>this.bufferify(e)));const a={};for(const[e,r]of this.zip(t,n))a[Math.pow(2,i)+e]=r;for(const[e,n]of this.zip(this.getProofIndices(t,i),s))a[e]=n;let o=Object.keys(a).map((e=>+e)).sort(((e,t)=>e-t));o=o.slice(0,o.length-1);let c=0;for(;c=2&&{}.hasOwnProperty.call(a,1^e)){let t=[a[e-e%2],a[e-e%2+1]];this.sortPairs&&(t=t.sort(f9.Buffer.compare));const n=t[1]?this.hashFn(this.concatenator(t)):t[0];a[e/2|0]=n,o.push(e/2|0)}c+=1}return!t.length||{}.hasOwnProperty.call(a,1)&&a[1].equals(e)}verifyMultiProofWithFlags(e,t,n,r){e=this.bufferify(e),t=t.map(this.bufferify),n=n.map(this.bufferify);const s=t.length,i=r.length,a=[];let o=0,c=0,l=0;for(let e=0;ethis.bufferify(e))),s=s.map((e=>this.bufferify(e)));const i=this.calculateRootForUnevenTree(t,n,r,s);return e.equals(i)}getDepth(){return this.getLayers().length-1}getLayersAsObject(){const e=this.getLayers().map((e=>e.map((e=>this.bufferToHex(e,!1))))),t=[];for(let n=0;ne-t)),i=s.map((([e])=>e)),a=this.getProofIndicesForUnevenTree(i,n);let o=0;const c=[];for(let e=0;ee-t)).map((([,e])=>e)),n=l[e].map((([e])=>e)),r=[...new Set(n.map((e=>e%2==0?e/2:e%2==0?(e+1)/2:(e-1)/2)))],s=[];for(let e=0;e0&&!(e&1<=t));i--);if(r!==n.length)throw new Error("invalid bit calculation");return n}numOfPeaks(e){let t=e,n=0;for(;t>0;)t%2==1&&n++,t>>=1;return n}peakBagging(e,t){const n=this.getSize(e);if(this.numOfPeaks(e)!==t.length)throw new Error("received invalid number of peaks");return 0!==e||t.length?this.peakBaggingFn?this.bufferify(this.peakBaggingFn(n,t)):this.hashFn(k9.Buffer.concat([this.bufferify(n),...t.map(this.bufferify)])):k9.Buffer.alloc(0)}getSize(e){return(e<<1)-this.numOfPeaks(e)}getRoot(){return this.root}getHexRoot(){return this.bufferToHex(this.getRoot())}getNode(e){return this.hashes[e]}mountainHeight(e){let t=1;for(;1<n;)t-=(1<this.size)throw new Error("out of range");if(!this.isLeaf(e))throw new Error("not a leaf");const t=this.root,n=this.width,r=this.getPeakIndexes(this.width),s=[];let i=0;for(let t=0;t=e&&0===i&&(i=r[t]);let a=0,o=0,c=this.heightAt(i);const l=[];for(;i!==e;)c--,[a,o]=this.getChildren(i),i=e<=a?a:o,l[c-1]=this.hashes[e<=a?o:a];return{root:t,width:n,peakBagging:s,siblings:l}}verify(e,t,n,r,s,i){r=this.bufferify(r);if(this.getSize(t)=n){a=s[e],o=c[e];break}if(!a)throw new Error("target not found");let l=i.length+1;const u=new Array(l);let d,h=0,p=0;for(;l>0&&(u[--l]=o,o!==n);)[h,p]=this.getChildren(o),o=n>h?p:h;for(;lthis.size)throw new Error("out of range");if(!this.hashes[e]){const[t,n]=this.getChildren(e),r=this._getOrCreateNode(t),s=this._getOrCreateNode(n);this.hashes[e]=this.hashBranch(e,r,s)}return this.hashes[e]}}w9.MerkleMountainRange=C9,"undefined"!=typeof window&&(window.MerkleMountainRange=C9),w9.default=C9;var P9={},_9=qe&&qe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(P9,"__esModule",{value:!0}),P9.IncrementalMerkleTree=void 0;const S9=_9(T8),I9=_9(B8);class B9 extends S9.default{constructor(e,t){if(super(),this.hashFn=e,t.depth&&(this.depth=t.depth),t.arity&&(this.arity=t.arity),this.depth<1)throw new Error("depth must be greater than 0");if(this.arity<1)throw new Error("arity must be greater than 0");const n=[];let r=t.zeroValue;if(this.zeroValue=r,this.zeroes=[],this.depth)for(let e=0;e=this.getMaxLeaves())throw new Error("tree is full");let t=e,n=this.nodes[0].length;for(let e=0;e=this.nodes[0].length)throw new Error("out of bounds");let n=t;for(let t=0;tBigInt(e)))}getLayers(){const e=[];for(const t of this.nodes)e.push(this.copyList(t));if(e[0].length=e[n].length&&(e[n][t]=this.zeroes[n]);t=Math.floor(t/this.arity)}}return e.push([this.root]),e}getHexLayers(){return this.getLayers().reduce(((e,t)=>(Array.isArray(t)?e.push(t.map((e=>this.bufferToHex(this.bufferify(e))))):e.push(t),e)),[])}getLayersAsObject(){const e=this.getLayers().map((e=>e.map((e=>this.bufferToHex(this.bufferify(e),!1))))),t=[];for(let n=0;n=this.nodes[0].length)throw new Error("The leaf does not exist in this tree");const t=[],n=[],r=e;for(let r=0;rBigInt(e))),this.data=n}getBucket(){let e;return e=this.data?this.hashFn(this.data):lX.alloc(32),new O9(BigInt(this.rng[1])-BigInt(this.rng[0]),e)}};class N9{constructor(e,t){this.bucket=e,this.right=t}}T9.ProofStep=N9;class R9 extends M9.Base{constructor(e,t){super(),this.leaves=e,this.hashFn=t,R9.checkConsecutive(e),this.buckets=[];for(const t of e)this.buckets.push(t.getBucket());let n=[];for(const e of this.buckets)n.push(e);for(;1!==n.length;){const e=[];for(;n.length;)if(n.length>=2){const t=n.shift(),r=n.shift(),s=t.size+r.size,i=this.hashFn(lX.concat([this.sizeToBuffer(t.size),this.bufferify(t.hashed),this.sizeToBuffer(r.size),this.bufferify(r.hashed)])),a=new O9(s,i);r.parent=a,t.parent=r.parent,t.right=r,r.left=t,e.push(a)}else e.push(n.shift());n=e}this.root=n[0]}sizeToBuffer(e){const t=lX.alloc(8);return new DataView(t.buffer).setBigInt64(0,BigInt(e),!1),t}static checkConsecutive(e){let t=BigInt(0);for(const n of e){if(n.rng[0]!==t)throw new Error("leaf ranges are invalid");t=BigInt(n.rng[1])}}getProof(e){let t=this.buckets[Number(e)];const n=[];for(;t&&t.parent;){const e=!!t.right,r=t.right?t.right:t.left;t=t.parent,n.push(new N9(r,e))}return n}sum(e){let t=BigInt(0);for(const n of e)t+=BigInt(n);return t}verifyProof(e,t,n){const r=[this.sum(n.filter((e=>!e.right)).map((e=>e.bucket.size))),BigInt(e.size)-this.sum(n.filter((e=>e.right)).map((e=>e.bucket.size)))];if(r[0]!==t.rng[0]||r[1]!==t.rng[1])return!1;let s,i=t.getBucket();for(const e of n)s=e.right?this.hashFn(lX.concat([this.sizeToBuffer(i.size),this.bufferify(i.hashed),this.sizeToBuffer(e.bucket.size),this.bufferify(e.bucket.hashed)])):this.hashFn(lX.concat([this.sizeToBuffer(e.bucket.size),this.bufferify(e.bucket.hashed),this.sizeToBuffer(i.size),this.bufferify(i.hashed)])),i=new O9(BigInt(i.size)+BigInt(e.bucket.size),s);return i.size===e.size&&i.hashed.toString("hex")===e.hashed.toString("hex")}}T9.MerkleSumTree=R9,"undefined"!=typeof window&&(window.MerkleSumTree=R9),T9.default=R9,function(e){var t=qe&&qe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.MerkleTree=void 0;const n=t(x8);e.MerkleTree=n.default;var r=w9;Object.defineProperty(e,"MerkleMountainRange",{enumerable:!0,get:function(){return r.MerkleMountainRange}});var s=P9;Object.defineProperty(e,"IncrementalMerkleTree",{enumerable:!0,get:function(){return s.IncrementalMerkleTree}});var i=T9;Object.defineProperty(e,"MerkleSumTree",{enumerable:!0,get:function(){return i.MerkleSumTree}}),e.default=n.default}({});const F9=({chain:e,rpcUrl:t,bundlerRpcUrl:n,projectId:r,bundlerProvider:s})=>{const i=p$(n??kY,{fetchOptions:{headers:n===kY?{projectId:r,bundlerProvider:s}:{}},name:"Connected bundler network",key:"connected-bundler-network",retryCount:0,timeout:35e3}),a=p$(t??TY[e.id]);let o=AU(rW({chain:e,transport:c$({async request({method:t,params:n}){let r;return r=["eth_sendUserOperation","eth_estimateUserOperationGas","eth_getUserOperationReceipt","eth_getUserOperationByHash","eth_supportedEntryPoints","eth_maxPriorityFeePerGas","rundler_maxPriorityFeePerGas","pimlico_getUserOperationGasPrice"].includes(t)?await i({chain:e}).request({method:t,params:n}):await a({chain:e}).request({method:t,params:n}),r}})}));return o};var j9;function L9(e){return e&&void 0!==e.connectValidator}!function(e){e.UNDEFINED="0x0",e.NOT_DEPLOYED="0x1",e.DEPLOYED="0x2"}(j9||(j9={}));class U9 extends IU{constructor(e){super({...e,entryPointAddress:e.entryPointAddress??AY,chain:e.chain??sK,rpcClient:e.rpcClient??kY}),Object.defineProperty(this,"factoryAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"initCode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"validator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"defaultValidator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.index=e.index??0n,this.factoryAddress=e.factoryAddress??"0x5de4839a76cf55d0c90e2061ef4386d962E15ae3",this.validator=e.validator,this.defaultValidator=e.defaultValidator,this.initCode=e.initCode}static async init(e){const t=await S1(e.projectId);if(!t)throw new Error("ChainId not found");const n=v8(t),r="string"==typeof e.rpcClient?F9({chain:n,rpcUrl:e.rpcClient,bundlerRpcUrl:e.rpcClient??kY,projectId:e.projectId,bundlerProvider:e.bundlerProvider}):e.rpcClient;return new U9({...e,chain:n,rpcClient:r})}connectValidator(e){return UU(this,"validator",e),this}getValidator(){if(!this.validator)throw new Error("Validator not connected");return this.validator}getDummySignature(){return"0x00000000870fe151d548a1c527c3804866fab30abf28ed17b79d5fc5149f19ca0819fefc3c57f3da4fdf9b10fab3f2f3dca536467ae44943b9dbb8433efe7760ddd72aaa1c"}async getInitCode(){if(this.deploymentState===j9.DEPLOYED)return"0x";const e=await this.rpcProvider.getContractCode(await this.getAddress());return(e?.length??0)>2?(this.deploymentState=j9.DEPLOYED,"0x"):(this.deploymentState=j9.NOT_DEPLOYED,this.initCode??this.getAccountInitCode())}getIndex(){return this.index}async approvePlugin(){if(!this.validator)throw new Error("Validator not connected");if(this.defaultValidator&&!this.validator.getEnableSignature()){const{executor:e,selector:t,validAfter:n,validUntil:r}=this.validator.getPluginValidatorData(),s=await this.defaultValidator.approveExecutor(await this.getAddress(),t,e,r,n,this.validator);this.validator.setEnableSignature(s)}}async encodeExecute(e,t,n){if(!this.validator)throw new Error("Validator not connected");return e.toLowerCase()===(await this.getAddress()).toLowerCase()&&this.validator.shouldDelegateViaFallback()?n:this.encodeExecuteAction(e,t,n,0)}async encodeBatchExecute(e){const t=await this.getKernelImplementationAddess(),n=await this.getInitCode();if(t?.toLowerCase()!==PY.toLowerCase()&&t?.toLowerCase()!=="0x8dD4DBB54d8A8Cf0DE6F9CCC4609470A30EfF18C".toLowerCase()&&t?.toLowerCase()!=="0xd3f582f6b4814e989ee8e96bc3175320b5a540ab".toLowerCase()&&"0x"===n){const t=TH({abi:hO,functionName:"multiSend",args:[g8(e)]});return await this.encodeExecuteDelegate(CY,BigInt(0),t)}return await this.encodeExecuteBatchAction(e)}async encodeExecuteDelegate(e,t,n){return this.encodeExecuteAction(e,t,n,1)}async encodeSetExection(){if(!this.validator)throw new Error("Validator not connected");const{executor:e,selector:t,validAfter:n,validUntil:r}=await this.validator.getPluginValidatorData(),s=await this.validator.getEnableData();return TH({abi:uO,functionName:"setExecution",args:[t,e,this.validator.validatorAddress,r,n,s]})}async encodeUgradeTo(){return TH({abi:uO,functionName:"upgradeTo",args:[PY]})}async getKernelImplementationAddess(){try{const e=await this.rpcProvider.getStorageAt({address:await this.getAddress(),slot:"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"});return e?"0x"+e.slice(26):e}catch(e){return}}async signMessageWith6492(e){try{if(!this.validator)throw new Error("Validator not connected");const t="string"==typeof e?Cz(e):e;let n=await this.validator.signMessage(Cz(EV({raw:t})));return await this.isAccountDeployed()||(n=BU({factoryAddress:this.factoryAddress,initCode:await this.getFactoryInitCode(),signature:n})),n}catch(e){throw console.error("Got Error - ",e.message),new Error("Message Signing with EIP6492 failed")}}async signTypedDataWith6492(e){try{if(!this.validator)throw new Error("Validator not connected");let t=await this.validator.signTypedData(e);return await this.isAccountDeployed()||(t=BU({factoryAddress:this.factoryAddress,initCode:await this.getFactoryInitCode(),signature:t})),t}catch(e){throw console.error("Got Error - ",e.message),new Error("Message Signing with EIP6492 failed")}}async signMessage(e){if(!this.validator)throw new Error("Validator not connected");const t="string"==typeof e?Cz(e):e;return await this.validator.signMessage(t)}async signTypedData(e){if(!this.validator)throw new Error("Validator not connected");return await this.validator.signTypedData(e)}signUserOp(e){if(!this.validator)throw new Error("Validator not connected");return this.validator.signUserOp(e)}encodeExecuteAction(e,t,n,r){return TH({abi:uO,functionName:"execute",args:[e,t,n,r]})}encodeExecuteBatchAction(e){return TH({abi:uO,functionName:"executeBatch",args:[e.map((e=>({to:e.target,value:e.value??0n,data:e.data})))]})}async getAccountInitCode(){return fH([this.factoryAddress,await this.getFactoryInitCode()])}async getNonce(){if(!await this.isAccountDeployed())return 0n;if(!this.validator)throw Error("Validator unintialized");const e=await this.getAddress(),t=this.validator.getNonceKey();return this.entryPoint.read.getNonce([e,t])}async getFactoryInitCode(){const e=this.defaultValidator??this.validator;if(!e)throw new Error("Validator not connected");try{return TH({abi:dO,functionName:"createAccount",args:[PY,TH({abi:uO,functionName:"initialize",args:[e.getAddress(),await e.getEnableData()]}),this.index]})}catch(e){throw console.error("err occurred:",e.message),new Error("Factory Code generation failed")}}}const D9=EU.find((e=>"simulateValidation"===e.name))?.inputs[0];function z9(e,t=!0){if(t){let t=yH({components:[{type:"address",name:"sender"},{type:"uint256",name:"nonce"},{type:"bytes",name:"initCode"},{type:"bytes",name:"callData"},{type:"uint256",name:"callGasLimit"},{type:"uint256",name:"verificationGasLimit"},{type:"uint256",name:"preVerificationGas"},{type:"uint256",name:"maxFeePerGas"},{type:"uint256",name:"maxPriorityFeePerGas"},{type:"bytes",name:"paymasterAndData"},{type:"bytes",name:"signature"}],name:"userOp",type:"tuple"}.components,Object.values({...e,signature:"0x"}));return t="0x"+t.slice(66,t.length-64),t}const n=D9.components.map((t=>({type:t.type,val:e[t.name]})));return function(e,t){const n=e.map((e=>"bytes"===e.type&&t?"bytes32":e.type)).join(", "),r=e.map((e=>"bytes"===e.type&&t?cH(e.val):e.val));return yH(AD(n),r)}(n,t)}function H9(e){return!!(e.callGasLimit&&e.maxFeePerGas&&null!=e.maxPriorityFeePerGas&&e.preVerificationGas&&e.verificationGasLimit)}const G9={fixed:21e3,perUserOp:18300,perUserOpWord:4,zeroByte:4,nonZeroByte:16,bundleSize:1,sigSize:65};class q9 extends BD{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}const $9=async(e,t)=>{if(null==t||"0x"===t)return BigInt(0);const n=t.substring(0,42),r="0x"+t.substring(42);return await e.rpcClient.estimateGas({account:AY,to:n,data:r})},V9=async e=>function(e){const t={...G9},n=Cz(z9({preVerificationGas:21e3,signature:yz(lX.alloc(t.sigSize,1)),...e},!1)),r=n.map((e=>0===e?t.zeroByte:t.nonZeroByte)).reduce(((e,t)=>e+t));return Math.round(r+t.fixed/t.bundleSize+t.perUserOp+t.perUserOpWord*n.length)}(await RU(e)),W9={STACKUP:"eth_maxPriorityFeePerGas",ALCHEMY:"rundler_maxPriorityFeePerGas",PIMLICO:"pimlico_getUserOperationGasPrice",GELATO:"eth_maxPriorityFeePerGas"},Z9=async e=>{let[t,n]=await Promise.all([e.rpcClient.request({method:W9[e.bundlerProvider]??"eth_maxPriorityFeePerGas",params:[]}),e.rpcClient.getBlock({blockTag:"latest"})]);if("PIMLICO"===e.bundlerProvider&&(t=t.standard.maxPriorityFeePerGas),"bigint"!=typeof n.baseFeePerGas)throw new q9;const r=10**1.2.toString().split(".")[1].length,s=BigInt(t),i=(e=>e*BigInt(1.2*r)/BigInt(r))(n.baseFeePerGas);return{maxFeePerGas:i+s,maxPriorityFeePerGas:s}},Q9=async e=>{const{block:t,gasPrice:n}=await RU({block:e.rpcClient.getBlock({blockTag:"latest"}),gasPrice:e.rpcClient.getGasPrice().catch((e=>(console.warn("Legacy: Failed to get gas price",e),null)))});let r=null,s=null;if(t&&null!=t.baseFeePerGas){const i=BigInt("1500000000");s=n?n-t.baseFeePerGas:null,(null==s||s-BigInt(0)||s>i)&&(s=i),s=s{let t=d[e];return"string"==typeof t&&t.startsWith("0x")||(t=yz(t)),[e,t]})).reduce(((e,[t,n])=>({...e,[t]:n})),{}));const h=await S1(this.provider.getProjectId());if(!h)throw new Error("ChainId not found");let p=Object.fromEntries(Object.entries({projectId:this.provider.getProjectId(),chainId:h,userOp:c,entryPointAddress:AY,callData:t instanceof Promise?await t:t,gasTokenData:n&&u&&s?{tokenAddress:n,erc20UserOp:u,erc20CallData:s instanceof Promise?await s:s}:void 0,tokenAddress:n,erc20UserOp:u,erc20CallData:s instanceof Promise?await s:s,paymasterProvider:i,shouldOverrideFee:a,shouldConsume:o}).filter((([e,t])=>void 0!==t)));const{data:f}=await d1.post(`${EY}/getPaymasterAndData`,{...p},{headers:{"Content-Type":"application/json"}});return f}}const eee={VERIFYING_PAYMASTER:class extends X9{constructor(e,t){super(e)}async getPaymasterResponse(e,t,n,r){const s=FU(await RU(e));return await this.signUserOp({userOp:s,paymasterProvider:t,shouldOverrideFee:n,shouldConsume:r})}},TOKEN_PAYMASTER:class extends X9{constructor(e,t){super(e),Object.defineProperty(this,"paymasterConfig",{enumerable:!0,configurable:!0,writable:!0,value:t})}async getPaymasterAddress(e){const t=await S1(this.provider.getProjectId());try{const{data:n}=await d1.post(`${EY}/getPaymasterAddress`,{chainId:t,entryPointAddress:AY,paymasterProvider:e},{headers:{"Content-Type":"application/json"}});return n}catch(e){return void console.log(e)}}async decodeMainCallFromCallData(e,t){let n="0x";if(t instanceof Promise){const e=await t;n=e instanceof Uint8Array?yz(e):e}else n=t instanceof Uint8Array?yz(t):t;try{const{functionName:e,args:t}=eV({abi:uO,data:n});if("execute"===e){const[e,n,r]=t;let s;try{({functionName:s}=eV({abi:hO,data:r}))}catch(e){}let i={target:e,value:n??0n,data:r};return"multiSend"===s&&(i={...i,target:CY,delegateCall:!0,data:r}),i}if("executeBatch"===e){const[e]=t;return e.map((e=>({target:e.to,value:e.value??0n,data:e.data})))}}catch(t){return{target:e instanceof Promise?await e:e,data:n,value:0n,delegateCall:!0}}}async getERC20UserOp(e,t,n,r){try{const i={target:n,value:BigInt(0),data:TH({abi:pO,functionName:"approve",args:[r,SY[n]]})};if(!this.provider.account)throw J9;let a;a=(s=t)&&Array.isArray(s)?[i,...t]:[i,t];const o=await this.provider.account.encodeBatchExecute(a);return{...e,callData:o,callGasLimit:await this.provider.rpcClient.estimateGas({account:AY,to:await this.provider.getAddress(),data:o}),signature:await this.provider.getAccount().getValidator().getDynamicDummySignature(await e.sender,o)}}catch(e){return}var s}async getPaymasterResponse(e,t,n,r){const s=await this.decodeMainCallFromCallData(e.sender,e.callData);if(!s)throw Y9;const i=await S1(this.provider.getProjectId());if(!i)throw new Error("ChainId not found");const a=function(e,t){return"TEST_ERC20"===e?"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B":_Y[e][t]||void 0}(this.paymasterConfig.gasToken,i);let o=await this.getPaymasterAddress(t);if(void 0!==a&&void 0!==o&&hH(o)){const i=await this.getERC20UserOp(e,s,a,o);if(!i)return;return await this.signUserOp({userOp:e,callData:e.callData,gasTokenAddress:a,erc20UserOp:i,erc20CallData:i.callData,paymasterProvider:t,shouldOverrideFee:n,shouldConsume:r})}}}},tee=(e,t)=>(e.withPaymasterMiddleware(nee(e,t)),e),nee=(e,t)=>({dummyPaymasterDataMiddleware:async e=>(e.paymasterAndData="0xe93eca6595fe94091dc1af46aac2a8b5d79907700000000000000000000000000000000000000000000000000000000064ee5cd9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",e),paymasterDataMiddleware:async n=>{const r=BigInt("100000"),s=BigInt("1000000"),i=BigInt("55000"),a=new eee[t.policy](e,t);let o;try{o=await a.getPaymasterResponse({...n,preVerificationGas:r,verificationGasLimit:s,callGasLimit:i},t.paymasterProvider,!1,e.shouldConsume())}catch(e){if(console.error(e),t.onlySendSponsoredTransaction)throw e instanceof p1?Error(e.response?.data.message):e}if(t.onlySendSponsoredTransaction&&(!o||!o.paymasterAndData||"0x"===o.paymasterAndData))throw new Error("Transaction is not sponsored");return o&&o.paymasterAndData&&"0x"!==o.paymasterAndData?{...n,...o}:{...n,paymasterAndData:"0x"}}});var ree,see;!function(e){e[e.Call=0]="Call",e[e.DelegateCall=1]="DelegateCall"}(ree||(ree={}));class iee extends HU{constructor({projectId:e,chain:t,entryPointAddress:n=AY,rpcUrl:r,bundlerRpcUrl:s=kY,account:i,bundlerProvider:a,opts:o}){const c="number"==typeof t?v8(t):t;super(F9({chain:c,rpcUrl:r,bundlerRpcUrl:s,projectId:e,bundlerProvider:a}),n,c,i,{...o,txMaxRetries:o?.txMaxRetries??20,txRetryIntervalMs:o?.txRetryIntervalMs??1e4,minPriorityFeePerBid:o?.minPriorityFeePerBid??IY.get(c.id)}),Object.defineProperty(this,"projectId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sendTxMaxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sendTxRetryIntervalMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bundlerProvider",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_txMaxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_txRetryIntervalMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_shouldConsume",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"feeOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"getProjectId",{enumerable:!0,configurable:!0,writable:!0,value:()=>this.projectId}),Object.defineProperty(this,"shouldConsume",{enumerable:!0,configurable:!0,writable:!0,value:()=>this._shouldConsume}),Object.defineProperty(this,"sendTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t=ree.Call)=>{if(!e.to)throw new Error("transaction is missing to address");const n={};e.maxFeePerGas&&(n.maxFeePerGas=e.maxFeePerGas),e.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas);const{hash:r}=await this.sendUserOperation({target:e.to,data:e.data??"0x",value:e.value?hz(e.value,"bigint"):0n},n,t);return await this.waitForUserOperationTransaction(r)}}),Object.defineProperty(this,"buildUserOperation",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t,n=ree.Call)=>{if(this._shouldConsume=!1,!L9(this.account))throw new Error("account not connected!");if(!this.account.validator)throw new Error("validator not connected!");let r="0x";if(Array.isArray(e)){if(n!==ree.Call)throw K9;r=await this.account.encodeBatchExecute(e)}else{if(!L9(this.account))throw K9;if(n===ree.DelegateCall)r=await this.account.encodeExecuteDelegate(e.target,e.value??0n,e.data);else{if(n!==ree.Call)throw K9;r=await this.account.encodeExecute(e.target,e.value??0n,e.data)}}const s=await this.account.getInitCode(),i=await this.account.getNonce(),a=await this._runMiddlewareStack({initCode:s,sender:this.getAddress(),nonce:i,callData:r,signature:await this.account.getValidator().getDynamicDummySignature(await this.getAddress(),r)},t);return this._shouldConsume=!0,a}}),Object.defineProperty(this,"_runMiddlewareStack",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t)=>{const n=await NU(this.dummyPaymasterDataMiddleware,this.feeDataGetter,this.paymasterDataMiddleware,this.gasEstimator,this.customMiddleware??DU,(async e=>({...e,...t})))(e);return FU(await RU(n))}}),Object.defineProperty(this,"sendUserOperation",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t,n=ree.Call)=>{if(!this._shouldConsume)throw new Error("Cannot send user operation while building user operation");if(!L9(this.account))throw new Error("account not connected!");if(!this.account.validator)throw new Error("validator not connected!");let r="0x";if(Array.isArray(e)){if(n!==ree.Call)throw K9;r=await this.account.encodeBatchExecute(e)}else{if(!L9(this.account))throw K9;if(n===ree.DelegateCall)r=await this.account.encodeExecuteDelegate(e.target,e.value??0n,e.data);else{if(n!==ree.Call)throw K9;r=await this.account.encodeExecute(e.target,e.value??0n,e.data)}}const s=await this.account.getInitCode();let i="",a=0;const o=await this.account.getNonce();let c,l,u,d;do{if(c=await NU(this.dummyPaymasterDataMiddleware,this.feeDataGetter,this.paymasterDataMiddleware,this.gasEstimator,this.customMiddleware??DU,(async e=>({...e,...t})))({initCode:s,sender:this.getAddress(),nonce:o,callData:r,signature:await this.account.getValidator().getDynamicDummySignature(await this.getAddress(),r),maxFeePerGas:u,maxPriorityFeePerGas:d}),l=FU(await RU(c)),!H9(l))throw new Error(`Request is missing parameters. All properties on UserOperationStruct must be set. uo: ${JSON.stringify(l,null,2)}`);await this.account.approvePlugin(),l.signature=await this.account.validator.getSignature(l);try{i=await this.rpcClient.sendUserOperation(l,this.entryPointAddress)}catch(e){if(this.isReplacementOpError(e)&&a++setTimeout(e,this.sendTxRetryIntervalMs)));continue}throw this.unwrapError(e)}}while(""===i);return{hash:i,request:l}}}),Object.defineProperty(this,"waitForUserOperationTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{let t=await this.rpcClient.getBlockNumber();for(let n=0;nnull));if(t)return this.getTransaction(t.receipt.transactionHash).then((e=>e.hash))}else{const n=await this.rpcClient.getLogs({address:AY,event:EH({abi:EU,name:"UserOperationEvent"}),args:{userOpHash:e},fromBlock:t-100n});if(n.length)return n[0].transactionHash}await new Promise((e=>setTimeout(e,this._txRetryIntervalMs)))}throw new Error("Failed to find transaction for User Operation")}}),Object.defineProperty(this,"getAccount",{enumerable:!0,configurable:!0,writable:!0,value:()=>{if(!L9(this.account))throw new Error("account not connected!");return this.account}}),Object.defineProperty(this,"dummyPaymasterDataMiddleware",{enumerable:!0,configurable:!0,writable:!0,value:async e=>(e.paymasterAndData="0x",e)}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const{method:t,params:n}=e;switch(t){case"eth_chainId":return this.chain.id;case"eth_sendTransaction":const[t]=n;return this.sendTransaction(t);case"eth_signTypedData_v4":return this.signTypedData(JSON.parse(n[1]));case"personal_sign":if(!this.account)throw new Error("account not connected!");const[r,s]=n;if(s.toLowerCase()!==(await this.getAddress()).toLowerCase())throw new Error("cannot sign for address that is not the current account");return this.account.signMessageWith6492(r);default:return this.rpcClient.request(e)}}}),this.feeOptions={maxFeePerGasBufferPercentage:o?.feeOptions?.maxFeePerGasBufferPercentage??0,maxPriorityFeePerGasBufferPercentage:o?.feeOptions?.maxPriorityFeePerGasBufferPercentage??13},this._txMaxRetries=o?.txMaxRetries??20,this._txRetryIntervalMs=o?.txRetryIntervalMs??5e3,this.bundlerProvider=a,this.projectId=e,this.sendTxMaxRetries=o?.sendTxMaxRetries??3,this.sendTxRetryIntervalMs=o?.sendTxRetryIntervalMs??6e4,(e=>{e.withFeeDataGetter((async t=>{let n,r,s=await RU({maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas});if("GELATO"===e.bundlerProvider)return{maxFeePerGas:0n,maxPriorityFeePerGas:0n};try{({maxFeePerGas:n,maxPriorityFeePerGas:r}=await Z9(e))}catch(e){console.warn("getGas: eth_maxPriorityFeePerGas failed, falling back to legacy gas price.")}if(void 0===n||void 0===r){const t=await Q9(e);n=t?.maxFeePerGas?BigInt(t?.maxFeePerGas):0n,r=t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):0n}return s.maxFeePerGas||s.maxPriorityFeePerGas?{maxFeePerGas:s.maxFeePerGas??n,maxPriorityFeePerGas:s.maxPriorityFeePerGas??r}:{maxFeePerGas:n,maxPriorityFeePerGas:r}})),e.withGasEstimator((async t=>{if(void 0!==t.callGasLimit&&void 0!==t.verificationGasLimit&&void 0!==t.preVerificationGas)return t;const n=await(e.account?.getInitCode()),r=await $9(e,n),s={...t,callGasLimit:void 0!==n&&n.length>2?BigInt("1000000"):BigInt(55e3),verificationGasLimit:BigInt(11e4)+r,preVerificationGas:BigInt(1e5)};s.preVerificationGas=await V9(s);const i=FU(await RU(s));let a;a=await e.rpcClient.estimateUserOperationGas(i,AY);const{preVerificationGas:o,verificationGasLimit:c,callGasLimit:l}=a;return i.preVerificationGas=BigInt(o)??i.preVerificationGas,i.verificationGasLimit=BigInt(c)??i.verificationGasLimit,i.callGasLimit=BigInt(l)??i.callGasLimit,{...t,...i}}))})(this)}isReplacementOpError(e){if(null!=e.cause){const t=e?.cause?.message;return(t?.includes("replacement op must increase maxFeePerGas and MaxPriorityFeePerGas")||null!==t?.match(/.*replacement.*underpriced.*/))??!1}return!1}unwrapError(e){if(null!=e?.cause){let t="",n=e?.cause?.message;if(!0===n?.includes("FailedOp")){const e=n.match(/FailedOp\((.*)\)/);if(null!=e){const r=e[1].split(",");t=`(paymaster address: ${r[1]})`,n=r[2]}}const r=new Error(`The bundler has failed to include UserOperation in a batch: ${n} ${t}`);return r.stack=e.stack,r}return e}withZeroDevPaymasterAndData(e){if(!this.isConnected())throw new Error("ZeroDevProvider: account is not set, did you call `connect` first?");return tee(this,e)}}BigInt.prototype.toJSON=function(){return this.toString()},function(e){e[e.EQUAL=0]="EQUAL",e[e.GREATER_THAN=1]="GREATER_THAN",e[e.LESS_THAN=2]="LESS_THAN",e[e.GREATER_THAN_OR_EQUAL=3]="GREATER_THAN_OR_EQUAL",e[e.LESS_THAN_OR_EQUAL=4]="LESS_THAN_OR_EQUAL",e[e.NOT_EQUAL=5]="NOT_EQUAL"}(see||(see={}));class aee extends iee{constructor(e,t){let n=e.bundlerProvider;const r=(void 0===e.usePaymaster||e.usePaymaster)&&"GELATO"!==n;if(e.opts?.paymasterConfig&&"TOKEN_PAYMASTER"===e.opts?.paymasterConfig.policy&&r&&(n="STACKUP"),super({...e.opts?.providerConfig,chain:e.opts?.providerConfig?.chain??sK,rpcUrl:e.opts?.providerConfig?.rpcUrl,projectId:e.projectId,bundlerProvider:n}),Object.defineProperty(this,"defaultProvider",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"getValidator",{enumerable:!0,configurable:!0,writable:!0,value:()=>{if(!L9(this.account)||!this.account.validator)throw new Error("ValidatorProvider: account with validator is not set, did you call all connects first?");return this.account.getValidator()}}),Object.defineProperty(this,"getEncodedEnableData",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(!L9(this.account)||!this.account.validator)throw new Error("ValidatorProvider: account with validator is not set, did you call all connects first?");return await this.account.validator.encodeEnable(e)}}),Object.defineProperty(this,"getEncodedDisableData",{enumerable:!0,configurable:!0,writable:!0,value:async(e="0x")=>{if(!L9(this.account)||!this.account.validator)throw new Error("ValidatorProvider: account with validator is not set, did you call all connects first?");return await this.account.validator.encodeDisable(e)}}),Object.defineProperty(this,"sendEnableUserOperation",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const t=await this.getEncodedEnableData(e);if(!L9(this.account)||!this.account.validator)throw new Error("ValidatorProvider: account with validator is not set, did you call all connects first?");return await this.sendUserOperation({target:this.account.validator.validatorAddress,data:t})}}),Object.defineProperty(this,"sendDisableUserOperation",{enumerable:!0,configurable:!0,writable:!0,value:async(e="0x")=>{const t=await this.getEncodedDisableData(e);if(!L9(this.account)||!this.account.validator)throw new Error("ValidatorProvider: account with validator is not set, did you call all connects first?");if(!this.defaultProvider)throw Error("Default Validator provider unintialized");return await this.defaultProvider.sendUserOperation({target:this.account.validator.validatorAddress,data:t})}}),this.defaultProvider=e.defaultProvider,"number"==typeof e.opts?.providerConfig?.chain&&"number"==typeof e.defaultProvider?.chain&&e.opts?.providerConfig?.chain!==e.defaultProvider?.chain||"object"==typeof e.opts?.providerConfig?.chain&&"object"==typeof e.defaultProvider?.chain&&e.opts?.providerConfig?.chain.id!==e.defaultProvider?.chain.id)throw new Error("chainId mismatch between default provider and current provider - check projectIds");if(this.connect((()=>new U9({projectId:e.projectId,validator:t,defaultValidator:e.defaultProvider?.getValidator(),rpcClient:this.rpcClient,bundlerProvider:n,index:e.defaultProvider?.getAccount().getIndex(),...e.opts?.accountConfig}))),r){let t=e.opts?.paymasterConfig??{policy:"VERIFYING_PAYMASTER"};t={...t,paymasterProvider:e.opts?.paymasterConfig?.paymasterProvider??n},tee(this,t)}}}class oee extends aee{constructor(e){const t="number"==typeof e.opts?.providerConfig?.chain?v8(e.opts.providerConfig.chain):e.opts?.providerConfig?.chain??sK,n=new w8({projectId:e.projectId,owner:e.owner,chain:t,rpcUrl:e.opts?.providerConfig?.rpcUrl,...e.opts?.validatorConfig});super({...e,opts:{...e.opts,providerConfig:{...e.opts?.providerConfig,chain:t}}},n),Object.defineProperty(this,"changeOwner",{enumerable:!0,configurable:!0,writable:!0,value:this.sendEnableUserOperation}),Object.defineProperty(this,"deleteOwner",{enumerable:!0,configurable:!0,writable:!0,value:this.sendDisableUserOperation})}static async init(e){const t=await S1(e.projectId);if(!t)throw new Error("ChainId not found");const n=v8(t);return new oee({...e,opts:{...e.opts,providerConfig:{chain:n,...e.opts?.providerConfig}}})}}const cee=new Y1("networks/5.7.1");function lee(e){const t=function(t,n){null==n&&(n={});const r=[];if(t.InfuraProvider&&"-"!==n.infura)try{r.push(new t.InfuraProvider(e,n.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==n.etherscan)try{r.push(new t.EtherscanProvider(e,n.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==n.alchemy)try{r.push(new t.AlchemyProvider(e,n.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==n.pocket){const s=["goerli","ropsten","rinkeby","sepolia"];try{const i=new t.PocketProvider(e,n.pocket);i.network&&-1===s.indexOf(i.network.name)&&r.push(i)}catch(e){}}if(t.CloudflareProvider&&"-"!==n.cloudflare)try{r.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==n.ankr)try{const s=["ropsten"],i=new t.AnkrProvider(e,n.ankr);i.network&&-1===s.indexOf(i.network.name)&&r.push(i)}catch(e){}if(0===r.length)return null;if(t.FallbackProvider){let s=1;return null!=n.quorum?s=n.quorum:"homestead"===e&&(s=2),new t.FallbackProvider(r,s)}return r[0]};return t.renetwork=function(e){return lee(e)},t}function uee(e,t){const n=function(n,r){return n.JsonRpcProvider?new n.JsonRpcProvider(e,t):null};return n.renetwork=function(t){return uee(e,t)},n}const dee={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:lee("homestead")},hee={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:lee("ropsten")},pee={chainId:63,name:"classicMordor",_defaultProvider:uee("https://www.ethercluster.com/mordor","classicMordor")},fee={unspecified:{chainId:0,name:"unspecified"},homestead:dee,mainnet:dee,morden:{chainId:2,name:"morden"},ropsten:hee,testnet:hee,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:lee("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:lee("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:lee("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:lee("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:uee("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:pee,classicTestnet:pee,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:uee("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:lee("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:lee("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"}};var mee=function(e,t,n,r){return new(n||(n=Promise))((function(s,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((r=r.apply(e,t||[])).next())}))};function bee(e,t){return mee(this,void 0,void 0,(function*(){null==t&&(t={});const n={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(n.mode=e.mode),e.cache&&(n.cache=e.cache),e.credentials&&(n.credentials=e.credentials),e.redirect&&(n.redirect=e.redirect),e.referrer&&(n.referrer=e.referrer)}const r=yield fetch(e,n),s=yield r.arrayBuffer(),i={};return r.headers.forEach?r.headers.forEach(((e,t)=>{i[t.toLowerCase()]=e})):r.headers.keys().forEach((e=>{i[e.toLowerCase()]=r.headers.get(e)})),{headers:i,statusCode:r.status,statusMessage:r.statusText,body:w2(new Uint8Array(s))}}))}var gee=function(e,t,n,r){return new(n||(n=Promise))((function(s,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((r=r.apply(e,t||[])).next())}))};const yee=new Y1("web/5.7.1");function vee(e){return new Promise((t=>{setTimeout(t,e)}))}function wee(e,t){if(null==e)return null;if("string"==typeof e)return e;if(g2(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return v3(e)}catch(e){}return C2(e)}return e}function xee(e,t,n){let r=null;if(null!=t){r=y3(t);const n="string"==typeof e?{url:e}:r2(e);if(n.headers){const e=0!==Object.keys(n.headers).filter((e=>"content-type"===e.toLowerCase())).length;e||(n.headers=r2(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};e=n}return function(e,t,n){const r="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;yee.assertArgument(r>0&&r%1==0,"invalid connection throttle limit","connection.throttleLimit",r);const s="object"==typeof e?e.throttleCallback:null,i="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;yee.assertArgument(i>0&&i%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",i);const a="object"==typeof e&&!!e.errorPassThrough,o={};let c=null;const l={method:"GET"};let u=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||yee.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)o[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(u=!0);if(l.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&yee.throwError("basic authentication requires a secure https url",Y1.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;o.authorization={key:"Authorization",value:"Basic "+E3(y3(t))}}null!=e.skipFetchSetup&&(l.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(l.fetchOptions=r2(e.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),p=c?c.match(h):null;if(p)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":p[1]||"text/plain"},body:p[2]?k3(p[3]):(f=p[3],y3(f.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return n&&(t=n(e.body,e)),Promise.resolve(t)}catch(e){yee.throwError("processing response error",Y1.errors.SERVER_ERROR,{body:wee(p[1],p[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var f;t&&(l.method="POST",l.body=t,null==o["content-type"]&&(o["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==o["content-length"]&&(o["content-length"]={key:"Content-Length",value:String(t.length)}));const m={};Object.keys(o).forEach((e=>{const t=o[e];m[t.key]=t.value})),l.headers=m;const b=function(){let e=null;return{promise:new Promise((function(t,n){d&&(e=setTimeout((()=>{null!=e&&(e=null,n(yee.makeError("timeout",Y1.errors.TIMEOUT,{requestBody:wee(l.body,m["content-type"]),requestMethod:l.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),g=function(){return gee(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(b.cancel(),yee.throwError("bad response",Y1.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:wee(o,t.headers?t.headers["content-type"]:null),requestBody:wee(l.body,m["content-type"]),requestMethod:l.method,url:c})),n)try{const e=yield n(o,t);return b.cancel(),e}catch(n){if(n.throttleRetry&&e{let r=null;if(null!=e)try{r=JSON.parse(v3(e))}catch(t){yee.throwError("invalid JSON",Y1.errors.SERVER_ERROR,{body:e,error:t})}return n&&(r=n(r,t)),r}))}function kee(e,t){return t||(t={}),null==(t=r2(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(n,r){let s=null,i=!1;const a=()=>!i&&(i=!0,s&&clearTimeout(s),!0);t.timeout&&(s=setTimeout((()=>{a()&&r(new Error("timeout"))}),t.timeout));const o=t.retryLimit;let c=0;!function s(){return e().then((function(e){if(void 0!==e)a()&&n(e);else if(t.oncePoll)t.oncePoll.once("poll",s);else if(t.onceBlock)t.onceBlock.once("block",s);else if(!i){if(c++,c>o)return void(a()&&r(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));et.ceiling&&(e=t.ceiling),setTimeout(s,e)}return null}),(function(e){a()&&r(e)}))}()}))}for(var Eee="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Aee={},Cee=0;Cee<32;Cee++){var Pee=Eee.charAt(Cee);if(void 0!==Aee[Pee])throw new TypeError(Pee+" is ambiguous");Aee[Pee]=Cee}function _ee(e){var t=e>>25;return(33554431&e)<<5^996825010&-(1&t)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function See(e){for(var t=1,n=0;n126)return"Invalid prefix ("+e+")";t=_ee(t)^r>>5}for(t=_ee(t),n=0;nt)return"Exceeds length limit";var n=e.toLowerCase(),r=e.toUpperCase();if(e!==n&&e!==r)return"Mixed-case string "+e;var s=(e=n).lastIndexOf("1");if(-1===s)return"No separator character for "+e;if(0===s)return"Missing prefix for "+e;var i=e.slice(0,s),a=e.slice(s+1);if(a.length<6)return"Data too short";var o=See(i);if("string"==typeof o)return o;for(var c=[],l=0;l=a.length||c.push(d)}return 1!==o?"Invalid checksum for "+e:{prefix:i,words:c}}function Bee(e,t,n,r){for(var s=0,i=0,a=(1<=n;)i-=n,o.push(s>>i&a);if(r)i>0&&o.push(s<=t)return"Excess padding";if(s<n)throw new TypeError("Exceeds length limit");var r=See(e=e.toLowerCase());if("string"==typeof r)throw new Error(r);for(var s=e+"1",i=0;i>5)throw new Error("Non 5-bit word");r=_ee(r)^a,s+=Eee.charAt(a)}for(i=0;i<6;++i)r=_ee(r);for(r^=1,i=0;i<6;++i){s+=Eee.charAt(r>>5*(5-i)&31)}return s},toWordsUnsafe:function(e){var t=Bee(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=Bee(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=Bee(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=Bee(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}},Mee=$e(Tee);const Oee="providers/5.7.2",Nee=new Y1(Oee);class Ree{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),n=this.bigNumber.bind(this),r=this.blockTag.bind(this),s=this.data.bind(this),i=this.hash.bind(this),a=this.hex.bind(this),o=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:i,type:c,accessList:Ree.allowNull(this.accessList.bind(this),null),blockHash:Ree.allowNull(i,null),blockNumber:Ree.allowNull(o,null),transactionIndex:Ree.allowNull(o,null),confirmations:Ree.allowNull(o,null),from:t,gasPrice:Ree.allowNull(n),maxPriorityFeePerGas:Ree.allowNull(n),maxFeePerGas:Ree.allowNull(n),gasLimit:n,to:Ree.allowNull(t,null),value:n,nonce:o,data:s,r:Ree.allowNull(this.uint256),s:Ree.allowNull(this.uint256),v:Ree.allowNull(o),creates:Ree.allowNull(t,null),raw:Ree.allowNull(s)},e.transactionRequest={from:Ree.allowNull(t),nonce:Ree.allowNull(o),gasLimit:Ree.allowNull(n),gasPrice:Ree.allowNull(n),maxPriorityFeePerGas:Ree.allowNull(n),maxFeePerGas:Ree.allowNull(n),to:Ree.allowNull(t),value:Ree.allowNull(n),data:Ree.allowNull((e=>this.data(e,!0))),type:Ree.allowNull(o),accessList:Ree.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:o,blockNumber:o,transactionHash:i,address:t,topics:Ree.arrayOf(i),data:s,logIndex:o,blockHash:i},e.receipt={to:Ree.allowNull(this.address,null),from:Ree.allowNull(this.address,null),contractAddress:Ree.allowNull(t,null),transactionIndex:o,root:Ree.allowNull(a),gasUsed:n,logsBloom:Ree.allowNull(s),blockHash:i,transactionHash:i,logs:Ree.arrayOf(this.receiptLog.bind(this)),blockNumber:o,confirmations:Ree.allowNull(o,null),cumulativeGasUsed:n,effectiveGasPrice:Ree.allowNull(n),status:Ree.allowNull(o),type:c},e.block={hash:Ree.allowNull(i),parentHash:i,number:o,timestamp:o,nonce:Ree.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:Ree.allowNull(t),extraData:s,transactions:Ree.allowNull(Ree.arrayOf(i)),baseFeePerGas:Ree.allowNull(n)},e.blockWithTransactions=r2(e.block),e.blockWithTransactions.transactions=Ree.allowNull(Ree.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Ree.allowNull(r,void 0),toBlock:Ree.allowNull(r,void 0),blockHash:Ree.allowNull(i,void 0),address:Ree.allowNull(t,void 0),topics:Ree.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Ree.allowNull(o),blockHash:Ree.allowNull(i),transactionIndex:o,removed:Ree.allowNull(this.boolean.bind(this)),address:t,data:Ree.allowFalsish(s,"0x"),topics:Ree.arrayOf(i),transactionHash:i,logIndex:o},e}accessList(e){return u8(e||[])}number(e){return"0x"===e?0:D2.from(e).toNumber()}type(e){return"0x"===e||null==e?0:D2.from(e).toNumber()}bigNumber(e){return D2.from(e)}boolean(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)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),E2(e))?e.toLowerCase():Nee.throwArgumentError("invalid hash","value",e)}data(e,t){const n=this.hex(e,t);if(n.length%2!=0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return a3(e)}callAddress(e){if(!E2(e,32))return null;const t=a3(_2(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return function(e){let t=null;try{t=a3(e.from)}catch(t){n3.throwArgumentError("missing from address","transaction",e)}return a3(_2(W2(J2([t,k2(w2(D2.from(e.nonce).toHexString()))])),12))}(e)}blockTag(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||E2(e))return I2(e);throw new Error("invalid blockTag")}hash(e,t){const n=this.hex(e,t);return 32!==P2(n)?Nee.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(null==e)return null;const t=D2.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!E2(e))throw new Error("invalid uint256");return B2(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const n=null!=e._difficulty?e._difficulty:e.difficulty,r=Ree.check(t,e);return r._difficulty=null==n?null:D2.from(n),r}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Ree.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&D2.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=Ree.check(this.formats.transaction,e);if(null!=e.chainId){let n=e.chainId;E2(n)&&(n=D2.from(n).toNumber()),t.chainId=n}else{let n=e.networkId;null==n&&null==t.v&&(n=e.chainId),E2(n)&&(n=D2.from(n).toNumber()),"number"!=typeof n&&null!=t.v&&(n=(t.v-35)/2,n<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),t.chainId=n}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return m8(e)}receiptLog(e){return Ree.check(this.formats.receiptLog,e)}receipt(e){const t=Ree.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=D2.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Nee.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Nee.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Nee.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return Ree.check(this.formats.filter,e)}filterLog(e){return Ree.check(this.formats.filterLog,e)}static check(e,t){const n={};for(const r in e)try{const s=e[r](t[r]);void 0!==s&&(n[r]=s)}catch(e){throw e.checkKey=r,e.checkValue=t[r],e}return n}static allowNull(e,t){return function(n){return null==n?t:e(n)}}static allowFalsish(e,t){return function(n){return n?e(n):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const n=[];return t.forEach((function(t){n.push(e(t))})),n}}}var Fee=function(e,t,n,r){return new(n||(n=Promise))((function(s,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((r=r.apply(e,t||[])).next())}))};const jee=new Y1(Oee);function Lee(e){return null==e?"null":(32!==P2(e)&&jee.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Uee(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[Lee(e)]=!0}));const n=Object.keys(t);return n.sort(),n.join("|")}return Lee(e)})).join("&")}function Dee(e){if("string"==typeof e){if(32===P2(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Uee(e);if(l3.isForkEvent(e))throw jee.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Uee(e.topics||[])}throw new Error("invalid event - "+e)}function zee(){return(new Date).getTime()}function Hee(e){return new Promise((t=>{setTimeout(t,e)}))}const Gee=["block","network","pending","poll"];class qee{constructor(e,t,n){e2(this,"tag",e),e2(this,"listener",t),e2(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],n=""===(r=e[2])?[]:r.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var r;const s={};return n.length>0&&(s.topics=n),t&&"*"!==t&&(s.address=t),s}pollable(){return this.tag.indexOf(":")>=0||Gee.indexOf(this.tag)>=0}}const $ee={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 Vee(e){return B2(D2.from(e).toHexString(),32)}function Wee(e){return p6.encode(x2([e,_2(m4(m4(e)),0,4)]))}const Zee=new RegExp("^(ipfs)://(.*)$","i"),Qee=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Zee,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Kee(e,t){try{return v3(Yee(e,t))}catch(e){}return null}function Yee(e,t){if("0x"===e)return null;const n=D2.from(_2(e,t,t+32)).toNumber(),r=D2.from(_2(e,n,n+32)).toNumber();return _2(e,n+32,n+32+r)}function Jee(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):jee.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function Xee(e){const t=w2(e);if(t.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(t,32-t.length),n}function ete(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function tte(e){const t=[];let n=0;for(let r=0;rD2.from(e).eq(1))).catch((e=>{if(e.code===Y1.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return Fee(this,void 0,void 0,(function*(){const n={to:this.address,ccipReadEnabled:!0,data:S2([e,Q3(this.name),t||"0x"])};let r=!1;var s;(yield this.supportsWildcard())&&(r=!0,n.data=S2(["0x9061b923",tte([(s=this.name,C2(x2(Z3(s).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"),n.data])]));try{let e=yield this.provider.call(n);return w2(e).length%32==4&&jee.throwError("resolver threw error",Y1.errors.CALL_EXCEPTION,{transaction:n,data:e}),r&&(e=Yee(e,0)),e}catch(e){if(e.code===Y1.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return Fee(this,void 0,void 0,(function*(){const n=yield this._fetch(e,t);return null!=n?Yee(n,0):null}))}_getAddress(e,t){const n=$ee[String(e)];if(null==n&&jee.throwError(`unsupported coin type: ${e}`,Y1.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===n.ilk)return this.provider.formatter.address(t);const r=w2(t);if(null!=n.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return Wee(x2([[n.p2pkh],"0x"+e[2]]))}}if(null!=n.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return Wee(x2([[n.p2sh],"0x"+e[2]]))}}if(null!=n.prefix){const e=r[1];let t=r[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&r.length===2+e&&e>=1&&e<=75){const e=Mee.toWords(r.slice(2));return e.unshift(t),Mee.encode(n.prefix,e)}}return null}getAddress(e){return Fee(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||"0x0000000000000000000000000000000000000000000000000000000000000000"===e?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===Y1.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",Vee(e));if(null==t||"0x"===t)return null;const n=this._getAddress(e,t);return null==n&&jee.throwError("invalid or unsupported coin data",Y1.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),n}))}getAvatar(){return Fee(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let n=0;ne[t]));return"sia://"+t}return jee.throwError("invalid or unsupported content hash data",Y1.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return Fee(this,void 0,void 0,(function*(){let t=y3(e);t=x2([Vee(64),Vee(t.length),t]),t.length%32!=0&&(t=x2([t,B2("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",C2(t));return null==n||"0x"===n?null:v3(n)}))}}let rte=null,ste=1;class ite extends u3{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),e2(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=t2(new.target,"getNetwork")(e);t?(e2(this,"_network",t),this.emit("network",t,null)):jee.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Fee(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||jee.throwError("no network detected",Y1.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:e2(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return kee((()=>this._ready().then((e=>e),(e=>{if(e.code!==Y1.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==rte&&(rte=new Ree),rte}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in fee){const n=fee[t];if(n.chainId===e)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=fee[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=fee[e.name];if(!t)return"number"!=typeof e.chainId&&cee.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&cee.throwArgumentError("network chainId mismatch","network",e);let n=e._defaultProvider||null;var r;return null==n&&t._defaultProvider&&(n=(r=t._defaultProvider)&&"function"==typeof r.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:n}}(null==e?"homestead":e)}ccipReadFetch(e,t,n){return Fee(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===n.length)return null;const r=e.to.toLowerCase(),s=t.toLowerCase(),i=[];for(let e=0;e=0?null:JSON.stringify({data:s,sender:r}),c=yield xee({url:a,errorPassThrough:!0},o,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const l=c.message||"unknown error";if(c.status>=400&&c.status<500)return jee.throwError(`response not found during CCIP fetch: ${l}`,Y1.errors.SERVER_ERROR,{url:t,errorMessage:l});i.push(l)}return jee.throwError(`error encountered during CCIP fetch: ${i.map((e=>JSON.stringify(e))).join(", ")}`,Y1.errors.SERVER_ERROR,{urls:n,errorMessages:i})}))}_getInternalBlockNumber(e){return Fee(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const n=yield t;if(zee()-n.respTime<=e)return n.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=zee(),n=n2({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:r})=>{if(r)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),r;const s=zee();return(e=D2.from(e).toNumber()){this._internalBlockNumber===n&&(this._internalBlockNumber=null)})),(yield n).blockNumber}))}poll(){return Fee(this,void 0,void 0,(function*(){const e=ste++,t=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)jee.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",jee.makeError("network block skew detected",Y1.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let e=this._emitted.block+1;e<=n;e++)this.emit("block",e);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&n-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((e=>{switch(e.type){case"tx":{const n=e.hash;let r=this.getTransactionReceipt(n).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+n]=e.blockNumber,this.emit(n,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(r);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=n-1);const r=e.filter;r.fromBlock=e._lastBlockNumber+1,r.toBlock=n;const s=r.toBlock-this._maxFilterBlockRange;s>r.fromBlock&&(r.fromBlock=s),r.fromBlock<0&&(r.fromBlock=0);const i=this.getLogs(r).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(r,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(i)}}})),this._lastBlockNumber=n,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Fee(this,void 0,void 0,(function*(){return jee.throwError("provider does not support network detection",Y1.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Fee(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,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",t,e),yield Hee(0),this._network;const n=jee.makeError("underlying network changed",Y1.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",n),n}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("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((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=zee();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,n){return Fee(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,n||0,null)}))}_waitForTransaction(e,t,n,r){return Fee(this,void 0,void 0,(function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=t?s:new Promise(((s,i)=>{const a=[];let o=!1;const c=function(){return!!o||(o=!0,a.forEach((e=>{e()})),!1)},l=e=>{e.confirmations{this.removeListener(e,l)})),r){let n=r.startBlock,s=null;const l=a=>Fee(this,void 0,void 0,(function*(){o||(yield Hee(1e3),this.getTransactionCount(r.from).then((u=>Fee(this,void 0,void 0,(function*(){if(!o){if(u<=r.nonce)n=a;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==s&&(s=n-3,s{o||this.once("block",l)})))}));if(o)return;this.once("block",l),a.push((()=>{this.removeListener("block",l)}))}if("number"==typeof n&&n>0){const e=setTimeout((()=>{c()||i(jee.makeError("timeout exceeded",Y1.errors.TIMEOUT,{timeout:n}))}),n);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return Fee(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Fee(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return D2.from(e)}catch(t){return jee.throwError("bad result from backend",Y1.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return Fee(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield n2({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getBalance",n);try{return D2.from(r)}catch(e){return jee.throwError("bad result from backend",Y1.errors.SERVER_ERROR,{method:"getBalance",params:n,result:r,error:e})}}))}getTransactionCount(e,t){return Fee(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield n2({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getTransactionCount",n);try{return D2.from(r).toNumber()}catch(e){return jee.throwError("bad result from backend",Y1.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:r,error:e})}}))}getCode(e,t){return Fee(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield n2({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),r=yield this.perform("getCode",n);try{return C2(r)}catch(e){return jee.throwError("bad result from backend",Y1.errors.SERVER_ERROR,{method:"getCode",params:n,result:r,error:e})}}))}getStorageAt(e,t,n){return Fee(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield n2({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(t).then((e=>I2(e)))}),s=yield this.perform("getStorageAt",r);try{return C2(s)}catch(e){return jee.throwError("bad result from backend",Y1.errors.SERVER_ERROR,{method:"getStorageAt",params:r,result:s,error:e})}}))}_wrapTransaction(e,t,n){if(null!=t&&32!==P2(t))throw new Error("invalid response - sendTransaction");const r=e;return null!=t&&e.hash!==t&&jee.throwError("Transaction hash mismatch from Provider.sendTransaction.",Y1.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),r.wait=(t,r)=>Fee(this,void 0,void 0,(function*(){let s;null==t&&(t=1),null==r&&(r=0),0!==t&&null!=n&&(s={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const i=yield this._waitForTransaction(e.hash,t,r,s);return null==i&&0===t?null:(this._emitted["t:"+e.hash]=i.blockNumber,0===i.status&&jee.throwError("transaction failed",Y1.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:i}),i)})),r}sendTransaction(e){return Fee(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>C2(e))),n=this.formatter.transaction(e);null==n.confirmations&&(n.confirmations=0);const r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(n,e,r)}catch(e){throw e.transaction=n,e.transactionHash=n.hash,e}}))}_getTransactionRequest(e){return Fee(this,void 0,void 0,(function*(){const t=yield e,n={};return["from","to"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?D2.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(n.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(n[e]=Promise.resolve(t[e]).then((e=>e?C2(e):null)))})),this.formatter.transactionRequest(yield n2(n))}))}_getFilter(e){return Fee(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((n=>{null!=e[n]&&(t[n]=e[n])})),["fromBlock","toBlock"].forEach((n=>{null!=e[n]&&(t[n]=this._getBlockTag(e[n]))})),this.formatter.filter(yield n2(t))}))}_call(e,t,n){return Fee(this,void 0,void 0,(function*(){n>=10&&jee.throwError("CCIP read exceeded maximum redirections",Y1.errors.SERVER_ERROR,{redirects:n,transaction:e});const r=e.to,s=yield this.perform("call",{transaction:e,blockTag:t});if(n>=0&&"latest"===t&&null!=r&&"0x556f1830"===s.substring(0,10)&&P2(s)%32==4)try{const i=_2(s,4),a=_2(i,0,32);D2.from(a).eq(r)||jee.throwError("CCIP Read sender did not match",Y1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const o=[],c=D2.from(_2(i,32,64)).toNumber(),l=D2.from(_2(i,c,c+32)).toNumber(),u=_2(i,c+32);for(let t=0;tFee(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",r);if(null==e)return null!=r.blockHash&&null==this._emitted["b:"+r.blockHash]||null!=r.blockTag&&n>this._emitted.block?null:void 0;if(t){let t=null;for(let n=0;nthis._wrapTransaction(e))),n}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Fee(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return kee((()=>Fee(this,void 0,void 0,(function*(){const n=yield this.perform("getTransaction",t);if(null==n)return null==this._emitted["t:"+e]?null:void 0;const r=this.formatter.transactionResponse(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}return this._wrapTransaction(r)}))),{oncePoll:this})}))}getTransactionReceipt(e){return Fee(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return kee((()=>Fee(this,void 0,void 0,(function*(){const n=yield this.perform("getTransactionReceipt",t);if(null==n)return null==this._emitted["t:"+e]?null:void 0;if(null==n.blockHash)return;const r=this.formatter.receipt(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}return r}))),{oncePoll:this})}))}getLogs(e){return Fee(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield n2({filter:this._getFilter(e)}),n=yield this.perform("getLogs",t);return n.forEach((e=>{null==e.removed&&(e.removed=!1)})),Ree.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)}))}getEtherPrice(){return Fee(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return Fee(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&jee.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return Fee(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const n=yield this._getResolver(t,"getResolver");if(null!=n){const r=new nte(this,n,e);return t===e||(yield r.supportsWildcard())?r:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return Fee(this,void 0,void 0,(function*(){null==t&&(t="ENS");const n=yield this.getNetwork();n.ensAddress||jee.throwError("network does not support ENS",Y1.errors.UNSUPPORTED_OPERATION,{operation:t,network:n.name});try{const t=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+Q3(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return Fee(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(E2(e))throw t}"string"!=typeof e&&jee.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return Fee(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(t,"lookupAddress");if(null==n)return null;const r=Kee(yield this.call({to:n,data:"0x691f3431"+Q3(t).substring(2)}),0);return(yield this.resolveName(r))!=e?null:r}))}getAvatar(e){return Fee(this,void 0,void 0,(function*(){let t=null;if(E2(e)){const n=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(n,"getAvatar");if(!r)return null;t=new nte(this,r,n);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==Y1.errors.CALL_EXCEPTION)throw e}try{const e=Kee(yield this.call({to:r,data:"0x691f3431"+Q3(n).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==Y1.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const n=yield t.getAvatar();return null==n?null:n.url}))}perform(e,t){return jee.throwError(e+" not implemented",Y1.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,n){const r=new qee(Dee(e),t,n);return this._events.push(r),this._startEvent(r),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let n=!1,r=[],s=Dee(e);return this._events=this._events.filter((e=>e.tag!==s||(setTimeout((()=>{e.listener.apply(this,t)}),0),n=!0,!e.once||(r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),n}listenerCount(e){if(!e)return this._events.length;let t=Dee(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Dee(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const n=[];let r=!1,s=Dee(e);return this._events=this._events.filter((e=>e.tag!==s||e.listener!=t||(!!r||(r=!0,n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const n=Dee(e);this._events=this._events.filter((e=>e.tag!==n||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var ate=function(e,t,n,r){return new(n||(n=Promise))((function(s,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((r=r.apply(e,t||[])).next())}))};const ote=new Y1(Oee),cte=["call","estimateGas"];function lte(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const n=E2(e.data)?e.data:null;if(!t||n)return{message:e.message,data:n}}if("object"==typeof e){for(const n in e){const r=lte(e[n],t);if(r)return r}return null}if("string"==typeof e)try{return lte(JSON.parse(e),t)}catch(e){}return null}function ute(e,t,n){const r=n.transaction||n.signedTransaction;if("call"===e){const e=lte(t,!0);if(e)return e.data;ote.throwError("missing revert data in call exception; Transaction reverted without a reason string",Y1.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:t})}if("estimateGas"===e){let n=lte(t.body,!1);null==n&&(n=lte(t,!1)),n&&ote.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Y1.errors.UNPREDICTABLE_GAS_LIMIT,{reason:n.message,method:e,transaction:r,error:t})}let s=t.message;throw t.code===Y1.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?s=t.error.message:"string"==typeof t.body?s=t.body:"string"==typeof t.responseText&&(s=t.responseText),s=(s||"").toLowerCase(),s.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&ote.throwError("insufficient funds for intrinsic transaction cost",Y1.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),s.match(/nonce (is )?too low/i)&&ote.throwError("nonce has already been used",Y1.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),s.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ote.throwError("replacement fee too low",Y1.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),s.match(/only replay-protected/i)&&ote.throwError("legacy pre-eip-155 transactions not supported",Y1.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:r}),cte.indexOf(e)>=0&&s.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ote.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Y1.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}function dte(e){return new Promise((function(t){setTimeout(t,e)}))}function hte(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function pte(e){return e?e.toLowerCase():e}const fte={};class mte extends p2{constructor(e,t,n){if(super(),e!==fte)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");e2(this,"provider",t),null==n&&(n=0),"string"==typeof n?(e2(this,"_address",this.provider.formatter.address(n)),e2(this,"_index",null)):"number"==typeof n?(e2(this,"_index",n),e2(this,"_address",null)):ote.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return ote.throwError("cannot alter JSON-RPC Signer connection",Y1.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new bte(fte,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&ote.throwError("unknown account #"+this._index,Y1.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=r2(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const n=r2(e);n.from=t,e.gasLimit=this.provider.estimateGas(n)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>ate(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&ote.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),n2({tx:n2(e),sender:t}).then((({tx:t,sender:n})=>{null!=t.from?t.from.toLowerCase()!==n&&ote.throwArgumentError("from address mismatch","transaction",e):t.from=n;const r=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[r]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&ote.throwError("user rejected transaction",Y1.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),ute("sendTransaction",e,r))))}))}signTransaction(e){return ote.throwError("signing transactions is unsupported",Y1.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return ate(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield kee((()=>ate(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(n);if(null!==e)return this.provider._wrapTransaction(e,n,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=n,e}}))}signMessage(e){return ate(this,void 0,void 0,(function*(){const t="string"==typeof e?y3(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[C2(t),n.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&ote.throwError("user rejected signing",Y1.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),t}}))}_legacySignMessage(e){return ate(this,void 0,void 0,(function*(){const t="string"==typeof e?y3(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),C2(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&ote.throwError("user rejected signing",Y1.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),t}}))}_signTypedData(e,t,n){return ate(this,void 0,void 0,(function*(){const r=yield d6.resolveNames(e,t,n,(e=>this.provider.resolveName(e))),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(d6.getPayload(r.domain,t,r.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&ote.throwError("user rejected signing",Y1.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:r.domain,types:t,value:r.value}}),e}}))}unlock(e){return ate(this,void 0,void 0,(function*(){const t=this.provider,n=yield this.getAddress();return t.send("personal_unlockAccount",[n.toLowerCase(),e,null])}))}}class bte extends mte{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const gte={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class yte extends ite{constructor(e,t){let n=t;null==n&&(n=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(n),e||(e=t2(this.constructor,"defaultUrl")()),e2(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(r2(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return ate(this,void 0,void 0,(function*(){yield dte(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=t2(this.constructor,"getNetwork");try{return t(D2.from(e).toNumber())}catch(t){return ote.throwError("could not detect network",Y1.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return ote.throwError("could not detect network",Y1.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new mte(fte,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:o2(n),provider:this});const r=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(r&&this._cache[e])return this._cache[e];const s=xee(this.connection,JSON.stringify(n),hte).then((e=>(this.emit("debug",{action:"response",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:n,provider:this}),e}));return r&&(this._cache[e]=s,setTimeout((()=>{this._cache[e]=null}),0)),s}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[pte(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[pte(t.address),t.blockTag]];case"getCode":return["eth_getCode",[pte(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[pte(t.address),B2(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",[t2(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[t2(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=pte(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return ate(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&D2.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((t=r2(t)).transaction=r2(e),delete t.transaction.type)}}const n=this.prepareRequest(e,t);null==n&&ote.throwError(e+" not implemented",Y1.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(n){return ute(e,n,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(n){return function r(){e.send("eth_getFilterChanges",[n]).then((function(n){if(e._pendingFilter!=t)return null;let r=Promise.resolve();return n.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",r=r.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),r.then((function(){return dte(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){r()}),0),null;e.send("eth_uninstallFilter",[n])})).catch((e=>{}))}(),n})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const n=r2(gte);if(t)for(const e in t)t[e]&&(n[e]=!0);var r,s;s=n,(r=e)&&"object"==typeof r||X1.throwArgumentError("invalid object","object",r),Object.keys(r).forEach((e=>{s[e]||X1.throwArgumentError("invalid object key - "+e,"transaction:"+e,r)}));const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const n=I2(D2.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=n})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=C2(e[t]))})),e.accessList&&(i.accessList=u8(e.accessList)),i}}const vte=new Y1(Oee);let wte=1;function xte(e,t){const n="Web3LegacyFetcher";return function(e,r){const s={method:e,params:r,id:wte++,jsonrpc:"2.0"};return new Promise(((e,r)=>{this.emit("debug",{action:"request",fetcher:n,request:o2(s),provider:this}),t(s,((t,i)=>{if(t)return this.emit("debug",{action:"response",fetcher:n,error:t,request:s,provider:this}),r(t);if(this.emit("debug",{action:"response",fetcher:n,request:s,response:i,provider:this}),i.error){const e=new Error(i.error.message);return e.code=i.error.code,e.data=i.error.data,r(e)}e(i.result)}))}))}}class kte extends yte{constructor(e,t){null==e&&vte.throwArgumentError("missing provider","provider",e);let n=null,r=null,s=null;"function"==typeof e?(n="unknown:",r=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(""===n&&(n="eip-1193:"),r=function(e){return function(t,n){null==n&&(n=[]);const r={method:t,params:n};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:o2(r),provider:this}),e.request(r).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:e,provider:this}),e}))}}(e)):e.sendAsync?r=xte(0,e.sendAsync.bind(e)):e.send?r=xte(0,e.send.bind(e)):vte.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,t),e2(this,"jsonRpcFetchFunc",r),e2(this,"provider",s)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}function Ete(e){const t=new kte(e).getSigner();return{getAddress:async()=>Promise.resolve(await t.getAddress()),signMessage:async e=>await t.signMessage(e),signTypedData:async e=>y8(await t._signTypedData(e.domain,e.types,e.message))}}const Ate={block:HS({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=US(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?EC(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:DS({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?EC(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:MT({format:e=>({l1GasPrice:e.l1GasPrice?EC(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?EC(e.l1GasUsed):null,l1Fee:e.l1Fee?EC(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})};const Cte={transaction:function(e,t){return function(e){return"deposit"===e.type||void 0!==e.sourceHash}(e)?function(e){!function(e){const{from:t,to:n}=e;if(t&&!SP(t))throw new xP({address:t});if(n&&!SP(n))throw new xP({address:n})}(e);const{sourceHash:t,data:n,from:r,gas:s,isSystemTx:i,mint:a,to:o,value:c}=e,l=[t,r,o??"0x",a?PC(a):"0x",c?PC(c):"0x",s?PC(s):"0x",i?"0x1":"0x",n??"0x"];return BP(["0x7e",_T(l)])}(e):DT(e,t)}};const Pte={contracts:{gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters:Ate,serializers:Cte},_te=1,Ste=bT({...Pte,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...Pte.contracts,l2OutputOracle:{[_te]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[_te]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[_te]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),Ite=11155111,Bte=bT({...Pte,id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://sepolia.basescan.org",apiUrl:"https://api-sepolia.basescan.org/api"}},contracts:{...Pte.contracts,disputeGameFactory:{[Ite]:{address:"0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1"}},l2OutputOracle:{[Ite]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[Ite]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[Ite]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:Ite}),Tte="undefined"==typeof window?()=>null:(window.addEventListener("eip6963:announceProvider",(e=>{const t=e,{detail:n}=t;if(!n)return;if(t){const e=WE(n);if(e&&e.error)throw e.error}const{info:r,provider:s}=n,{name:i,icon:a}=r;var o;(o=a)&&(/)<[^<]*)*<\/script>/gi.test(o)||/\bon[a-z]+\s*=\s*["']?(?:javascript:)?/gi.test(o)||/\b(href|xlink:href)\s*=\s*["']?javascript:/gi.test(o))?console.error(`The icon for injected wallet: ${i} contains executable JavaScript and has been blocked.`):ZE.push({label:i,getIcon:async()=>a,getInterface:async()=>({provider:s}),platforms:["all"],eip6963Provider:s,checkProviderIdentity:({provider:e})=>!!e})})),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),e=>{const{device:t}=e,{custom:n=[],filter:r={},displayUnavailable:s,sort:i,walletUnavailableMessage:a}={},o=Tk([...n,...ZE,...zE],(({label:e})=>e)).reduce(((e,n)=>{const{label:i,platforms:o,injectedNamespace:c,checkProviderIdentity:l,eip6963Provider:u}=n,d=r[i],h=!1===d,p=((e,t,n)=>!(!e||!t({provider:e,device:n})&&!e.providers?.some((e=>t({provider:e,device:n})))))(u||window[c],l,t);let f=!1;Array.isArray(d)&&(d.includes(t.type)||t.os&&d.includes(t.os.name))&&(f=!0),"unavailable"!==d||p||(f=!0);const m=!o.includes("all")&&null!==t.type&&!o.includes(t.type)&&!o.includes(t.os.name);return!h&&!f&&!m&&(p||!0===s||Array.isArray(s)&&s.length&&s.includes(n.label))&&e.push((!0===s||Array.isArray(s)&&s.length&&s.includes(n.label))&&!p?{...n,getInterface:async()=>{throw new Error(a?a(n):(({label:e,externalUrl:t})=>t?`Please install or switch to ${e} to continue`:`Please install or enable ${e} to continue`)(n))}}:n),e}),[]);if(o.length){const e=o.length>1,t=o.filter((t=>{const{label:n}=t;return!(n===Ik.Detected&&e)})).map((({label:e,getIcon:t,getInterface:n})=>({label:e,getIcon:t,getInterface:n}))).sort(((e,t)=>e.labelt.label?1:0));return i?i(t):t}return[]}),Mte=function({supportedWalletType:e="all",darkMode:t=!1,enableMobileWalletLink:n=!1,reloadOnDisconnect:r=!0}={}){return()=>({label:"Coinbase Wallet",getIcon:async()=>(await Promise.resolve().then((function(){return Nke}))).default,getInterface:async({chains:s,appMetadata:i})=>{(n||r||t)&&console.warn("darkMode, enableMobileWalletLink and reloadOnDisconnect init props are deprecated after version 2.2.7 of @web3-onboard/coinbase");const{name:a,icon:o}=i||{},{default:c}=await Promise.resolve().then((function(){return hTe})),l=c.default?c.default:c,{isHex:u,toHex:d,createEIP1193Provider:h,fromHex:p}=await Promise.resolve().then((function(){return ja})),f=`data:image/svg+xml;base64,${window.btoa(o||"")}`,m=s.map((({id:e})=>p(e,"number"))),b=new l({appName:a||"",appLogoUrl:f,appChainIds:m}),g=b.makeWeb3Provider({options:e}),y=g.on.bind(g);g.on=(e,t)=>(y(e,(n=>{if("chainChanged"===e){let e;return e=u(n)?n:d(n),void t(e)}t(n)})),g);const v=h(g);return v.removeListener=(e,t)=>{},{provider:v,instance:b}}})}(),Ote="undefined"==typeof window?()=>null:()=>({label:"Phantom",getIcon:async()=>(await Promise.resolve().then((function(){return pTe}))).default,getInterface:async()=>{if("phantom"in window){const e=window;if("phantom"in e&&"ethereum"in e.phantom&&e.phantom.ethereum.isPhantom)return{provider:Dr(e.phantom.ethereum)}}throw new Error(Ia("Phantom","https://phantom.app/download"))},platforms:["all"]}),Nte={"0x14a34":"cb470a59-62fd-4623-804e-e12e06e7cabe","0x2105":"a5d7f360-4a91-4037-9f34-e6b34ad376df"},Rte=[{id:"0x2105",token:"ETH",label:"Base",rpcUrl:"https://base-mainnet.g.alchemy.com/v2/26uv2UQi8g99zBpSFbpQ2hqNCYVzQLci"},{id:"0x14a34",token:"ETH",label:"BaseSepolia",rpcUrl:"https://base-sepolia.g.alchemy.com/v2/26uv2UQi8g99zBpSFbpQ2hqNCYVzQLci"}],Fte=function(e){if("undefined"==typeof window)return kk;if(e){const t=Ma(dy,e);if(t)throw t}const{wallets:t,chains:n,appMetadata:r,i18n:s,accountCenter:i,apiKey:a,notify:o,gas:c,connect:l,containerElements:u,transactionPreview:d,theme:h,disableFontDownload:p,unstoppableResolution:f,wagmi:m}=e;u&&pm({containerElements:u});const{device:b,svelteInstance:g}=hm;if(g&&(console.warn("Re-initializing Onboard and resetting back to initial state"),Eg.next()),function(e){if(e){const{en:t}=e;zn("en",Of(Vy,t||{}));const n=Object.keys(e).filter((e=>"en"!==e));n.forEach((t=>{const n=e[t];n&&zn(t,n)}))}else zn("en",Vy);tr({fallbackLocale:"en",initialLocale:br()})}(s),function(e){const t={type:ym,payload:e.map((e=>{var{namespace:t="evm",id:n,rpcUrl:r}=e,s=Ff(e,["namespace","id","rpcUrl"]);return Object.assign(Object.assign({},s),{namespace:t,id:n.toLowerCase(),rpcUrl:r?r.trim():null})}))};jm(t)}(function(e){return e.map((e=>{var{id:t}=e,n=Ff(e,["id"]);const r=Yf(t);return Object.assign({id:r},n)}))}(n)),void 0!==l&&Ry(l),void 0!==i){let e;const{hideTransactionProtectionBtn:t,transactionProtectionInfoLink:n}=i;"mobile"===b.type?e=Object.assign(Object.assign(Object.assign({},fm.accountCenter),{hideTransactionProtectionBtn:t,transactionProtectionInfoLink:n}),i.mobile?i.mobile:{}):i.desktop&&(e=Object.assign(Object.assign(Object.assign({},fm.accountCenter),{hideTransactionProtectionBtn:t,transactionProtectionInfoLink:n}),i.desktop)),void 0!==e&&Ny(e)}let y;if(void 0!==m&&(y=m(Object.assign({disconnect:hv,updateChain:Iy},{addOrSwitchChain:rv,getChainId:Qy,requestAccounts:Zy,switchChain:tv}))),void 0!==o)if("desktop"in o||"mobile"in o){const e=function(e){return Ma(ry,e)}(o);if(e)throw e;o&&o.desktop&&o.desktop.position&&i&&i.desktop&&i.desktop.position&&(o.desktop.position=i.desktop.position),o&&o.mobile&&o.mobile.position&&i&&i.mobile&&i.mobile.position&&(o.mobile.position=i.mobile.position);let t={};"mobile"===b.type&&o.mobile?t=Object.assign(Object.assign({},fm.notify),o.mobile):o.desktop&&(t=Object.assign(Object.assign({},fm.notify),o.desktop)),Fy(t)}else{const e=Cy(o);if(e)throw e;Fy(Object.assign(Object.assign({},fm.notify),o))}else{Fy(fm.notify)}const v=g||function(e,t){class n extends HTMLElement{constructor(){super()}}customElements.get("onboard-v2")||customElements.define("onboard-v2",n);Ek(e,t)||Ak();const r=document.createElement("onboard-v2"),s=r.attachShadow({mode:"open"});let i;r.style.all="initial",s.innerHTML="\n\n \n ",hm&&hm.containerElements&&hm.containerElements.connectModal&&(i=hm.containerElements.connectModal);const a=i||Lm.get().accountCenter.containerElement||"body",o=document.querySelector(a);if(!o)throw new Error(`Element with query ${a} does not exist.`);o.appendChild(r);const c=new bk({target:s});return c}(h||{},p||!1);if(pm({svelteInstance:v,apiKey:a,initialWalletInit:t,gas:c,transactionPreview:d,unstoppableResolution:f,wagmi:y}),r&&Gy(r),a&&d){console.warn("Transaction Preview support is going to be sunset on July 1st 2024 and will no longer work after that date");const e=async()=>{const e=await async function(){var e;const{apiKey:t}=hm;if(!t)return null;if(!uv){const{default:t}=await Promise.resolve().then((function(){return ove}));return uv=new t({dappId:null!==(e=hm.apiKey)&&void 0!==e?e:"",networkId:1}),uv}return uv}();e&&(d.init({containerElement:"#w3o-transaction-preview-container",sdk:e,apiKey:a}),_g.subscribe((e=>{e.forEach((({provider:e})=>{d.patchProvider(e)}))})))};e()}if(h&&Hy(h),l&&(l.autoConnectLastWallet||l.autoConnectAllPreviousWallet)){const e=lm(mm.LAST_CONNECTED_WALLET);try{const t=JSON.parse(e);t&&Array.isArray(t)&&t.length&&Ck(t,l),t&&"string"==typeof t&&Ck([t],l)}catch(t){t instanceof SyntaxError&&e&&kk.connectWallet({autoSelect:{label:e,disableModals:!0}})}}return kk}({wallets:[Tte,Mte,Ote],chains:Rte});async function jte(e){const[t]=await Fte.state.get().wallets;if(zte(e),t){if(t.chains[0].id!==e){if(!await Fte.setChain({chainId:e}))throw new Error("Failed to switch chain")}OB(t.provider),console.log("setting zeroDev",Nte[e],t.provider);const n=await oee.init({projectId:Nte[e],owner:Ete(t.provider),opts:{paymasterConfig:{policy:"VERIFYING_PAYMASTER"}}});return console.log("new prov",n),n}throw new Error(`Failed to get smart account for chain ${e}`)}async function Lte(){try{const e=await Fte.connectWallet();console.log("Connected wallets:",e)}catch(e){console.error("Failed to connect wallet:",e)}}async function Ute(){const[e]=Fte.state.get().wallets;e&&(await Fte.disconnectWallet({label:e.label}),console.log("Wallet disconnected"))}function Dte(e){document.querySelectorAll("#layered-component-connect").forEach((t=>{e.length>0?(t.innerHTML="Disconnect",t.removeEventListener("click",Lte),t.addEventListener("click",Ute)):(t.innerHTML="Connect",t.removeEventListener("click",Ute),t.addEventListener("click",Lte))}))}function zte(e){let t;switch(e){case"0x2105":t=Ste;break;case"0x14a34":t=Bte;break;default:throw new Error("Unsupported chain")}return t}async function Hte(e,t){try{const[n]=Fte.state.get().wallets;if(!n)throw new Error("No wallet connected");const r=zte(t),s=n.accounts[0],i=await jte(t),a=await i.getAddress(),o=Rte.filter((e=>e.id===t))[0].rpcUrl;if(!a)throw new Error("Could not attach Smart Account");if(!o)throw new Error(`Could not get RPC for chain ${t}`);const c=function(e){const{key:t="wallet",name:n="Wallet Client",transport:r}=e;return SB({...e,key:t,name:n,transport:r,type:"walletClient"}).extend(cO)}({chain:r,transport:OB(i)}),l=function(e){const{key:t="public",name:n="Public Client"}=e;return SB({...e,key:t,name:n,type:"publicClient"}).extend(aO)}({chain:r,transport:LB(o)}),u=function({abi:e,address:t,client:n}){const r=n,[s,i]=r?"public"in r&&"wallet"in r?[r.public,r.wallet]:"public"in r?[r.public,void 0]:"wallet"in r?[void 0,r.wallet]:[r,r]:[void 0,void 0],a=null!=s,o=null!=i,c={};let l=!1,u=!1,d=!1;for(const t of e)if("function"===t.type?"view"===t.stateMutability||"pure"===t.stateMutability?l=!0:u=!0:"event"===t.type&&(d=!0),l&&u&&d)break;return a&&(l&&(c.read=new Proxy({},{get:(n,r)=>(...n)=>{const{args:i,options:a}=wB(n);return LA(s,XI,"readContract")({abi:e,address:t,functionName:r,args:i,...a})}})),u&&(c.simulate=new Proxy({},{get:(n,r)=>(...n)=>{const{args:i,options:a}=wB(n);return LA(s,eB,"simulateContract")({abi:e,address:t,functionName:r,args:i,...a})}})),d&&(c.createEventFilter=new Proxy({},{get:(n,r)=>(...n)=>{const i=e.find((e=>"event"===e.type&&e.name===r)),{args:a,options:o}=xB(n,i);return LA(s,ZP,"createContractEventFilter")({abi:e,address:t,eventName:r,args:a,...o})}}),c.getEvents=new Proxy({},{get:(n,r)=>(...n)=>{const i=e.find((e=>"event"===e.type&&e.name===r)),{args:a,options:o}=xB(n,i);return LA(s,SI,"getContractEvents")({abi:e,address:t,eventName:r,args:a,...o})}}),c.watchEvent=new Proxy({},{get:(n,r)=>(...n)=>{const i=e.find((e=>"event"===e.type&&e.name===r)),{args:a,options:o}=xB(n,i);return LA(s,fB,"watchContractEvent")({abi:e,address:t,eventName:r,args:a,...o})}}))),o&&u&&(c.write=new Proxy({},{get:(n,r)=>(...n)=>{const{args:s,options:a}=wB(n);return LA(i,vB,"writeContract")({abi:e,address:t,functionName:r,args:s,...a})}})),(a||o)&&u&&(c.estimateGas=new Proxy({},{get:(n,r)=>(...n)=>{const{args:a,options:o}=wB(n);return LA(s??i,xI,"estimateContractGas")({abi:e,address:t,functionName:r,args:a,...o,account:o.account??i.account})}})),c.address=t,c.abi=e,c}({address:e,abi:[{inputs:[{internalType:"address",name:"to",type:"address"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"}],client:c}),d=await u.write.safeMint([s.address],{account:a}),h=await l.waitForTransactionReceipt({hash:d});console.log("Minting successful",h)}catch(e){throw console.error("Minting failed:",e),e}}async function Gte(e){const t=e.target,n=t.getAttribute("chainId"),r=t.getAttribute("contractAddress");if(n&&r)try{const[e]=Fte.state.get().wallets;if(!e)throw new Error("No wallet connected");if(e.chains[0].id!==n){if(!await Fte.setChain({chainId:n}))throw new Error("Failed to switch chain")}await Hte(r,n)}catch(e){console.error("Minting process failed:",e)}else console.error("Missing chainId or contractAddress attribute")}var qte;Fte.state.select("wallets").subscribe((e=>{Dte(e);const[t]=e;console.log("got a state change",t),jte("0x14a34")})),qte=()=>{console.log("doc ready"),Dte(Fte.state.get().wallets),document.querySelectorAll("#layered-component-mint").forEach((e=>{e.addEventListener("click",Gte)}))},"complete"===document.readyState||"interactive"===document.readyState?setTimeout(qte,1):document.addEventListener("DOMContentLoaded",qte);const $te=ca({id:787,name:"Acala",network:"acala",nativeCurrency:{name:"Acala",symbol:"ACA",decimals:18},rpcUrls:{public:{http:["https://eth-rpc-acala.aca-api.network"],webSocket:["wss://eth-rpc-acala.aca-api.network"]},default:{http:["https://eth-rpc-acala.aca-api.network"],webSocket:["wss://eth-rpc-acala.aca-api.network"]}},blockExplorers:{default:{name:"Acala Blockscout",url:"https://blockscout.acala.network",apiUrl:"https://blockscout.acala.network/api"}},testnet:!1}),Vte={block:Ni({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=Ti(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?rs(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:Mi({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?rs(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:fa({format:e=>({l1GasPrice:e.l1GasPrice?rs(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?rs(e.l1GasUsed):null,l1Fee:e.l1Fee?rs(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})};const Wte={transaction:function(e,t){return function(e){return"deposit"===e.type||void 0!==e.sourceHash}(e)?function(e){!function(e){const{from:t,to:n}=e;if(t&&!si(t))throw new Js({address:t});if(n&&!si(n))throw new Js({address:n})}(e);const{sourceHash:t,data:n,from:r,gas:s,isSystemTx:i,mint:a,to:o,value:c}=e,l=[t,r,o??"0x",a?cs(a):"0x",c?cs(c):"0x",s?cs(s):"0x",i?"0x1":"0x",n??"0x"];return ii(["0x7e",la(l)])}(e):va(e,t)}};const Zte={contracts:{gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters:Vte,serializers:Wte},Qte=1,Kte=ca({...Zte,id:888888888,name:"Ancient8",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ancient8.gg"]}},blockExplorers:{default:{name:"Ancient8 explorer",url:"https://scan.ancient8.gg",apiUrl:"https://scan.ancient8.gg/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[Qte]:{address:"0xB09DC08428C8b4EFB4ff9C0827386CDF34277996"}},portal:{[Qte]:{address:"0x639F2AECE398Aa76b07e59eF6abe2cFe32bacb68",blockCreated:19070571}},l1StandardBridge:{[Qte]:{address:"0xd5e3eDf5b68135D559D572E26bF863FBC1950033",blockCreated:19070571}}},sourceId:1}),Yte=11155111,Jte=ca({...Zte,id:28122024,name:"Ancient8 Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpcv2-testnet.ancient8.gg"]}},blockExplorers:{default:{name:"Ancient8 Celestia Testnet explorer",url:"https://scanv2-testnet.ancient8.gg",apiUrl:"https://scanv2-testnet.ancient8.gg/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[Yte]:{address:"0x942fD5017c0F60575930D8574Eaca13BEcD6e1bB"}},portal:{[Yte]:{address:"0xfa1d9E26A6aCD7b22115D27572c1221B9803c960",blockCreated:4972908}},l1StandardBridge:{[Yte]:{address:"0xF6Bc0146d3c74D48306e79Ae134A260E418C9335",blockCreated:4972908}}},sourceId:Yte}),Xte=ca({id:31337,name:"Anvil",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]}}}),ene=ca({id:3993,name:"APEX Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc-testnet.apexlayer.xyz"]}},blockExplorers:{default:{name:"Blockscout",url:"https://exp-testnet.apexlayer.xyz",apiUrl:"https://exp-testnet.apexlayer.xyz/api"}},contracts:{multicall3:{address:"0xf7642be33a6b18D16a995657adb5a68CD0438aE2",blockCreated:283775}},testnet:!0}),tne=ca({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),nne=ca({id:421613,name:"Arbitrum Goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:88114}},testnet:!0}),rne=ca({id:42170,name:"Arbitrum Nova",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://nova.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://nova.arbiscan.io",apiUrl:"https://api-nova.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1746963}}}),sne=ca({id:592,name:"Astar",network:"astar-mainnet",nativeCurrency:{name:"Astar",symbol:"ASTR",decimals:18},rpcUrls:{default:{http:["https://astar.api.onfinality.io/public"]}},blockExplorers:{default:{name:"Astar Subscan",url:"https://astar.subscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:761794}},testnet:!1}),ine=ca({id:3776,name:"Astar zkEVM",network:"AstarZkEVM",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.startale.com/astar-zkevm"]}},blockExplorers:{default:{name:"Astar zkEVM Explorer",url:"https://astar-zkevm.explorer.startale.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:93528}},testnet:!1}),ane=ca({id:6038361,name:"Astar zkEVM Testnet zKyoto",network:"zKyoto",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.startale.com/zkyoto"]}},blockExplorers:{default:{name:"zKyoto Explorer",url:"https://zkyoto.explorer.startale.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:196153}},testnet:!0}),one=ca({id:421614,name:"Arbitrum Sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://sepolia.arbiscan.io",apiUrl:"https://api-sepolia.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:81930}},testnet:!0}),cne=ca({id:463,name:"Areon Network",nativeCurrency:{decimals:18,name:"AREA",symbol:"AREA"},rpcUrls:{default:{http:["https://mainnet-rpc.areon.network"],webSocket:["wss://mainnet-ws.areon.network"]}},blockExplorers:{default:{name:"Areonscan",url:"https://areonscan.com"}},testnet:!1}),lne=ca({id:462,name:"Areon Network Testnet",nativeCurrency:{decimals:18,name:"TAREA",symbol:"TAREA"},rpcUrls:{default:{http:["https://testnet-rpc.areon.network"],webSocket:["wss://testnet-ws.areon.network"]}},blockExplorers:{default:{name:"Areonscan",url:"https://areonscan.com"}},testnet:!0}),une=ca({id:1313161554,name:"Aurora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.aurora.dev"]}},blockExplorers:{default:{name:"Aurorascan",url:"https://aurorascan.dev",apiUrl:"https://aurorascan.dev/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:62907816}}}),dne=ca({id:1313161555,name:"Aurora Testnet",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.aurora.dev"]}},blockExplorers:{default:{name:"Aurorascan",url:"https://testnet.aurorascan.dev",apiUrl:"https://testnet.aurorascan.dev/api"}},testnet:!0}),hne=ca({id:205205,name:"Auroria Testnet",network:"auroria",nativeCurrency:{name:"Auroria Stratis",symbol:"tSTRAX",decimals:18},rpcUrls:{default:{http:["https://auroria.rpc.stratisevm.com"]}},blockExplorers:{default:{name:"Auroria Testnet Explorer",url:"https://auroria.explorer.stratisevm.com"}},testnet:!0}),pne=ca({id:43114,name:"Avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowScan",url:"https://snowscan.xyz",apiUrl:"https://api.snowscan.xyz/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),fne=ca({id:43113,name:"Avalanche Fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowScan",url:"https://testnet.snowscan.xyz",apiUrl:"https://api-testnet.snowscan.xyz"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7096959}},testnet:!0}),mne=ca({id:5165,network:"bahamut",name:"Bahamut",nativeCurrency:{name:"Fasttoken",symbol:"FTN",decimals:18},rpcUrls:{default:{http:["https://rpc1.bahamut.io","https://bahamut-rpc.publicnode.com","https://rpc2.bahamut.io"],webSocket:["wss://ws1.sahara.bahamutchain.com","wss://bahamut-rpc.publicnode.com","wss://ws2.sahara.bahamutchain.com"]},public:{http:["https://rpc1.bahamut.io","https://bahamut-rpc.publicnode.com","https://rpc2.bahamut.io"],webSocket:["wss://ws1.sahara.bahamutchain.com","wss://bahamut-rpc.publicnode.com","wss://ws2.sahara.bahamutchain.com"]}},blockExplorers:{default:{name:"Ftnscan",url:"https://www.ftnscan.com",apiUrl:"https://www.ftnscan.com/api"}}}),bne=1,gne=ca({...Zte,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[bne]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[bne]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[bne]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),yne=5,vne=ca({...Zte,id:84531,name:"Base Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org",apiUrl:"https://goerli.basescan.org/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[yne]:{address:"0x2A35891ff30313CcFa6CE88dcf3858bb075A2298"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1376988},portal:{[yne]:{address:"0xe93c8cD0D409341205A592f8c4Ac1A5fe5585cfA"}},l1StandardBridge:{[yne]:{address:"0xfA6D8Ee5BE770F84FC001D098C4bD604Fe01284a"}}},testnet:!0,sourceId:5}),wne=11155111,xne=ca({...Zte,id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://sepolia.basescan.org",apiUrl:"https://api-sepolia.basescan.org/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[wne]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[wne]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[wne]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:wne}),kne=ca({id:4337,name:"Beam",network:"beam",nativeCurrency:{decimals:18,name:"Beam",symbol:"BEAM"},rpcUrls:{public:{http:["https://build.onbeam.com/rpc"],webSocket:["wss://build.onbeam.com/ws"]},default:{http:["https://build.onbeam.com/rpc"],webSocket:["wss://build.onbeam.com/ws"]}},blockExplorers:{default:{name:"Beam Explorer",url:"https://subnets.avax.network/beam"}},contracts:{multicall3:{address:"0x4956f15efdc3dc16645e90cc356eafa65ffc65ec",blockCreated:1}}}),Ene=ca({id:13337,name:"Beam Testnet",network:"beam",nativeCurrency:{decimals:18,name:"Beam",symbol:"BEAM"},rpcUrls:{public:{http:["https://build.onbeam.com/rpc/testnet"],webSocket:["wss://build.onbeam.com/ws/testnet"]},default:{http:["https://build.onbeam.com/rpc/testnet"],webSocket:["wss://build.onbeam.com/ws/testnet"]}},blockExplorers:{default:{name:"Beam Explorer",url:"https://subnets-test.avax.network/beam"}},contracts:{multicall3:{address:"0x9bf49b704ee2a095b95c1f2d4eb9010510c41c9e",blockCreated:3}},testnet:!0}),Ane=ca({id:641230,name:"Bear Network Chain Mainnet",nativeCurrency:{decimals:18,name:"BearNetworkChain",symbol:"BRNKC"},rpcUrls:{default:{http:["https://brnkc-mainnet.bearnetwork.net"]}},blockExplorers:{default:{name:"BrnkScan",url:"https://brnkscan.bearnetwork.net",apiUrl:"https://brnkscan.bearnetwork.net/api"}}}),Cne=ca({id:751230,name:"Bear Network Chain Testnet",nativeCurrency:{decimals:18,name:"tBRNKC",symbol:"tBRNKC"},rpcUrls:{default:{http:["https://brnkc-test.bearnetwork.net"]}},blockExplorers:{default:{name:"BrnkTestScan",url:"https://brnktest-scan.bearnetwork.net",apiUrl:"https://brnktest-scan.bearnetwork.net/api"}},testnet:!0}),Pne=ca({id:80085,name:"Berachain Artio",nativeCurrency:{decimals:18,name:"BERA Token",symbol:"BERA"},rpcUrls:{default:{http:["https://artio.rpc.berachain.com"]}},blockExplorers:{default:{name:"Berachain",url:"https://artio.beratrail.io"}},testnet:!0}),_ne=ca({id:11501,name:"BEVM Mainnet",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:18},rpcUrls:{default:{http:["https://rpc-mainnet-1.bevm.io"]}},blockExplorers:{default:{name:"Bevmscan",url:"https://scan-mainnet.bevm.io",apiUrl:"https://scan-mainnet-api.bevm.io/api"}}}),Sne=ca({id:199,name:"BitTorrent",network:"bittorrent-chain-mainnet",nativeCurrency:{name:"BitTorrent",symbol:"BTT",decimals:18},rpcUrls:{default:{http:["https://rpc.bittorrentchain.io"]},public:{http:["https://rpc.bittorrentchain.io"]}},blockExplorers:{default:{name:"Bttcscan",url:"https://bttcscan.com",apiUrl:"https://api.bttcscan.com/api"}}}),Ine=ca({id:1028,name:"BitTorrent Chain Testnet",network:"bittorrent-chain-testnet",nativeCurrency:{name:"BitTorrent",symbol:"BTT",decimals:18},rpcUrls:{default:{http:["https://testrpc.bittorrentchain.io"]},public:{http:["https://testrpc.bittorrentchain.io"]}},blockExplorers:{default:{name:"Bttcscan",url:"https://testnet.bttcscan.com",apiUrl:"https://testnet.bttcscan.com/api"}},testnet:!0}),Bne=ca({id:81457,name:"Blast",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.blast.io"]}},blockExplorers:{default:{name:"Blastscan",url:"https://blastscan.io",apiUrl:"https://api.blastscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:212929}},sourceId:1}),Tne=ca({id:168587773,name:"Blast Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.blast.io"]}},blockExplorers:{default:{name:"Blastscan",url:"https://sepolia.blastscan.io",apiUrl:"https://api-sepolia.blastscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:756690}},testnet:!0,sourceId:11155111}),Mne=ca({id:60808,name:"BOB",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.gobob.xyz"],webSocket:["wss://rpc.gobob.xyz"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.gobob.xyz"}},contracts:{multicall3:{address:"0x63f8279bccDb75c0F38e0CD6B6A0c72a0a760FF9",blockCreated:457045}},testnet:!1}),One=ca({id:288,name:"Boba Network",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.boba.network"]}},blockExplorers:{default:{name:"BOBAScan",url:"https://bobascan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:446859}}}),Nne=ca({id:1039,name:"Bronos",nativeCurrency:{decimals:18,name:"BRO",symbol:"BRO"},rpcUrls:{default:{http:["https://evm.bronos.org"]}},blockExplorers:{default:{name:"BronoScan",url:"https://broscan.bronos.org"}}}),Rne=ca({id:1038,name:"Bronos Testnet",nativeCurrency:{decimals:18,name:"Bronos Coin",symbol:"tBRO"},rpcUrls:{default:{http:["https://evm-testnet.bronos.org"]}},blockExplorers:{default:{name:"BronoScan",url:"https://tbroscan.bronos.org"}},testnet:!0}),Fne=ca({id:56,name:"BNB Smart Chain",nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://rpc.ankr.com/bsc"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}}),jne=ca({id:97,name:"Binance Smart Chain Testnet",nativeCurrency:{decimals:18,name:"BNB",symbol:"tBNB"},rpcUrls:{default:{http:["https://data-seed-prebsc-1-s1.bnbchain.org:8545"]}},blockExplorers:{default:{name:"BscScan",url:"https://testnet.bscscan.com",apiUrl:"https://testnet.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:17422483}},testnet:!0}),Lne=ca({id:1017,name:"BNB Greenfield Chain",nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://greenfield-chain.bnbchain.org"]}},blockExplorers:{default:{name:"BNB Greenfield Mainnet Scan",url:"https://greenfieldscan.com"}},testnet:!1}),Une=ca({id:200901,name:"Bitlayer",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.bitlayer.org","https://rpc.bitlayer-rpc.com","https://rpc.ankr.com/bitlayer"],webSocket:["wss://ws.bitlayer.org","wss://ws.bitlayer-rpc.com"]}},blockExplorers:{default:{name:"btrscan",url:"https://www.btrscan.com",apiUrl:"https://www.btrscan.com/apis"}}}),Dne=ca({id:200810,name:"Bitlayer Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://testnet-rpc.bitlayer.org"],webSocket:["wss://testnet-ws.bitlayer.org","wss://testnet-ws.bitlayer-rpc.com"]}},blockExplorers:{default:{name:"btrscan",url:"https://testnet-scan.bitlayer.org",apiUrl:"https://testnet-scan.bitlayer.org/apis"}}}),zne=ca({id:4999,name:"BlackFort Exchange Network",nativeCurrency:{name:"BlackFort Token",symbol:"BXN",decimals:18},rpcUrls:{default:{http:["https://mainnet.blackfort.network/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.blackfort.network",apiUrl:"https://explorer.blackfort.network/api"}}}),Hne=ca({id:4777,name:"BlackFort Exchange Network Testnet",nativeCurrency:{name:"BlackFort Testnet Token",symbol:"TBXN",decimals:18},rpcUrls:{default:{http:["https://testnet.blackfort.network/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://testnet-explorer.blackfort.network",apiUrl:"https://testnet-explorer.blackfort.network/api"}},testnet:!0}),Gne=ca({id:7700,name:"Canto",nativeCurrency:{decimals:18,name:"Canto",symbol:"CANTO"},rpcUrls:{default:{http:["https://canto.gravitychain.io"]}},blockExplorers:{default:{name:"Tuber.Build (Blockscout)",url:"https://tuber.build"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:2905789}}}),qne={estimateFeesPerGas:async e=>{if(!e.request?.feeCurrency)return null;const[t,n]=await Promise.all([$ne(e.client,e.request.feeCurrency),Vne(e.client,e.request.feeCurrency)]);return{maxFeePerGas:t,maxPriorityFeePerGas:n}}};async function $ne(e,t){const n=await e.request({method:"eth_gasPrice",params:[t]});return BigInt(n)}async function Vne(e,t){const n=await e.request({method:"eth_maxPriorityFeePerGas",params:[t]});return BigInt(n)}function Wne(e){return 0===e||0n===e||null==e||"0"===e||""===e||"string"==typeof e&&("0x"===es(e).toLowerCase()||"0x00"===es(e).toLowerCase())}function Zne(e){return!Wne(e)}function Qne(e){return"cip64"===e.type||function(e){return void 0!==e.maxFeePerGas&&void 0!==e.maxPriorityFeePerGas}(e)&&Zne(e.feeCurrency)}const Kne={block:Ni({exclude:["difficulty","gasLimit","mixHash","nonce","uncles"],format(e){const t=e.transactions?.map((e=>"string"==typeof e?e:{...Ti(e),feeCurrency:e.feeCurrency,..."0x7b"!==e.type?{gatewayFee:e.gatewayFee?rs(e.gatewayFee):null,gatewayFeeRecipient:e.gatewayFeeRecipient||null}:{}}));return{randomness:e.randomness,transactions:t}}}),transaction:Mi({format(e){const t={feeCurrency:e.feeCurrency};return"0x7b"===e.type?t.type="cip64":("0x7c"===e.type&&(t.type="cip42"),t.gatewayFee=e.gatewayFee?rs(e.gatewayFee):null,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}}),transactionRequest:Ii({format(e){const t={feeCurrency:e.feeCurrency};return Qne(e)&&(t.type="0x7b"),t}})};const Yne={transaction:function(e,t){return Qne(e)?function(e,t){!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i,feeCurrency:a}=e;if(t<=0)throw new oa({chainId:t});if(i&&!si(i))throw new Js({address:i});if(r)throw new qr("`gasPrice` is not a valid CIP-64 Transaction attribute.");if(Zne(s)&&s>Jne)throw new Ai({maxFeePerGas:s});if(Zne(n)&&Zne(s)&&n>s)throw new Ci({maxFeePerGas:s,maxPriorityFeePerGas:n});if(Zne(a)&&!si(a))throw new qr("`feeCurrency` MUST be a token address for CIP-64 transactions.");if(Wne(a))throw new qr("`feeCurrency` must be provided for CIP-64 transactions.")}(e);const{chainId:n,gas:r,nonce:s,to:i,value:a,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,feeCurrency:u,data:d}=e,h=[cs(n),s?cs(s):"0x",c?cs(c):"0x",o?cs(o):"0x",r?cs(r):"0x",i??"0x",a?cs(a):"0x",d??"0x",ya(l),u,...wa(e,t)];return ii(["0x7b",la(h)])}(e,t):va(e,t)}};const Jne=2n**256n-1n;const Xne={formatters:Kne,serializers:Yne,fees:qne},ere=ca({...Xne,id:42220,name:"Celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://celoscan.io",apiUrl:"https://api.celoscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:13112599}},testnet:!1}),tre=ca({...Xne,id:44787,name:"Alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"A-CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores",apiUrl:"https://explorer.celo.org/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:14569001}},testnet:!0}),nre=ca({id:88888,name:"Chiliz Chain",network:"chiliz-chain",nativeCurrency:{decimals:18,name:"CHZ",symbol:"CHZ"},rpcUrls:{default:{http:["https://rpc.ankr.com/chiliz","https://chiliz-rpc.publicnode.com"]}},blockExplorers:{default:{name:"Chiliz Explorer",url:"https://scan.chiliz.com",apiUrl:"https://scan.chiliz.com/api"}}}),rre=ca({id:61,name:"Ethereum Classic",nativeCurrency:{decimals:18,name:"ETC",symbol:"ETC"},rpcUrls:{default:{http:["https://etc.rivet.link"]}},blockExplorers:{default:{name:"Blockscout",url:"https://blockscout.com/etc/mainnet"}}}),sre=ca({id:1030,name:"Conflux eSpace",nativeCurrency:{name:"Conflux",symbol:"CFX",decimals:18},rpcUrls:{default:{http:["https://evm.confluxrpc.org"],webSocket:["wss://evm.confluxrpc.org/ws"]}},blockExplorers:{default:{name:"ConfluxScan",url:"https://evm.confluxscan.io"}},contracts:{multicall3:{address:"0xEFf0078910f638cd81996cc117bccD3eDf2B072F",blockCreated:68602935}}}),ire=ca({id:71,name:"Conflux eSpace Testnet",network:"cfx-espace-testnet",testnet:!0,nativeCurrency:{name:"Conflux",symbol:"CFX",decimals:18},rpcUrls:{default:{http:["https://evmtestnet.confluxrpc.org"],webSocket:["wss://evmtestnet.confluxrpc.org/ws"]}},blockExplorers:{default:{name:"ConfluxScan",url:"https://evmtestnet.confluxscan.io"}},contracts:{multicall3:{address:"0xEFf0078910f638cd81996cc117bccD3eDf2B072F",blockCreated:117499050}}}),are=ca({id:1116,name:"Core Dao",nativeCurrency:{decimals:18,name:"Core",symbol:"CORE"},rpcUrls:{default:{http:["https://rpc.coredao.org"]}},blockExplorers:{default:{name:"CoreDao",url:"https://scan.coredao.org"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:11907934}},testnet:!1}),ore=ca({id:25,name:"Cronos Mainnet",nativeCurrency:{decimals:18,name:"Cronos",symbol:"CRO"},rpcUrls:{default:{http:["https://evm.cronos.org"]}},blockExplorers:{default:{name:"Cronos Explorer",url:"https://explorer.cronos.org",apiUrl:"https://explorer-api.cronos.org/mainnet/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1963112}}}),cre=ca({id:338,name:"Cronos Testnet",nativeCurrency:{decimals:18,name:"CRO",symbol:"tCRO"},rpcUrls:{default:{http:["https://evm-t3.cronos.org"]}},blockExplorers:{default:{name:"Cronos Explorer",url:"https://cronos.org/explorer/testnet3"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:10191251}},testnet:!0}),lre=ca({id:3737,name:"Crossbell",nativeCurrency:{decimals:18,name:"CSB",symbol:"CSB"},rpcUrls:{default:{http:["https://rpc.crossbell.io"]}},blockExplorers:{default:{name:"CrossScan",url:"https://scan.crossbell.io",apiUrl:"https://scan.crossbell.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:38246031}}}),ure=ca({id:7560,name:"Cyber",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cyber.alt.technology"]}},blockExplorers:{default:{name:"Blockscout",url:"https://cyberscan.co",apiUrl:"https://cyberscan.co/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0}}}),dre=ca({id:111557560,name:"Cyber Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cyber-testnet.alt.technology"]}},blockExplorers:{default:{name:"Blockscout",url:"https://testnet.cyberscan.co",apiUrl:"https://testnet.cyberscan.co/api"}},contracts:{multicall3:{address:"0xffc391F0018269d4758AEA1a144772E8FB99545E",blockCreated:304545}},testnet:!0}),hre=ca({id:46,name:"Darwinia Network",nativeCurrency:{decimals:18,name:"RING",symbol:"RING"},rpcUrls:{default:{http:["https://rpc.darwinia.network"],webSocket:["wss://rpc.darwinia.network"]}},blockExplorers:{default:{name:"Explorer",url:"https://darwinia.subscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:69420}}}),pre=ca({id:1130,network:"defichain-evm",name:"DeFiChain EVM Mainnet",nativeCurrency:{name:"DeFiChain",symbol:"DFI",decimals:8},rpcUrls:{default:{http:["https://eth.mainnet.ocean.jellyfishsdk.com"]},public:{http:["https://eth.mainnet.ocean.jellyfishsdk.com"]}},blockExplorers:{default:{name:"DeFiScan",url:"https://meta.defiscan.live"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:137852}}}),fre=ca({id:1131,network:"defichain-evm-testnet",name:"DeFiChain EVM Testnet",nativeCurrency:{name:"DeFiChain",symbol:"DFI",decimals:8},rpcUrls:{default:{http:["https://eth.testnet.ocean.jellyfishsdk.com"]},public:{http:["https://eth.testnet.ocean.jellyfishsdk.com"]}},blockExplorers:{default:{name:"DeFiScan",url:"https://meta.defiscan.live/?network=TestNet"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:156462}},testnet:!0}),mre=ca({id:666666666,name:"Degen",nativeCurrency:{decimals:18,name:"Degen",symbol:"DEGEN"},rpcUrls:{default:{http:["https://rpc.degen.tips"],webSocket:["wss://rpc.degen.tips"]}},blockExplorers:{default:{name:"Degen Chain Explorer",url:"https://explorer.degen.tips",apiUrl:"https://explorer.degen.tips/api/v2"}}}),bre=ca({id:53935,name:"DFK Chain",nativeCurrency:{decimals:18,name:"Jewel",symbol:"JEWEL"},rpcUrls:{default:{http:["https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"]}},blockExplorers:{default:{name:"DFKSubnetScan",url:"https://subnets.avax.network/defi-kingdoms"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14790551}}}),gre=ca({id:53457,name:"DODOchain Testnet",nativeCurrency:{decimals:18,name:"DODO",symbol:"DODO"},rpcUrls:{default:{http:["https://dodochain-testnet.alt.technology"],webSocket:["wss://dodochain-testnet.alt.technology/ws"]}},blockExplorers:{default:{name:"DODOchain Testnet (Sepolia) Explorer",url:"https://testnet-scan.dodochain.com"}},testnet:!0}),yre=ca({id:2e3,name:"Dogechain",nativeCurrency:{decimals:18,name:"Dogechain",symbol:"DC"},rpcUrls:{default:{http:["https://rpc.dogechain.dog"]}},blockExplorers:{default:{name:"DogeChainExplorer",url:"https://explorer.dogechain.dog",apiUrl:"https://explorer.dogechain.dog/api"}}}),vre=ca({id:23451,name:"DreyerX Mainnet",nativeCurrency:{name:"DreyerX",symbol:"DRX",decimals:18},rpcUrls:{default:{http:["https://rpc.dreyerx.com"]}},blockExplorers:{default:{name:"DreyerX Scan",url:"https://scan.dreyerx.com"}}}),wre=ca({id:2026,name:"Edgeless Network",nativeCurrency:{name:"Edgeless Wrapped ETH",symbol:"EwETH",decimals:18},rpcUrls:{default:{http:["https://rpc.edgeless.network/http"],webSocket:["wss://rpc.edgeless.network/ws"]}},blockExplorers:{default:{name:"Edgeless Explorer",url:"https://explorer.edgeless.network"}}}),xre=ca({id:202,name:"Edgeless Testnet",nativeCurrency:{name:"Edgeless Wrapped ETH",symbol:"EwETH",decimals:18},rpcUrls:{default:{http:["https://edgeless-testnet.rpc.caldera.xyz/http"],webSocket:["wss://edgeless-testnet.rpc.caldera.xyz/ws"]}},blockExplorers:{default:{name:"Edgeless Testnet Explorer",url:"https://testnet.explorer.edgeless.network"}}}),kre=ca({id:2021,name:"Edgeware EdgeEVM Mainnet",nativeCurrency:{decimals:18,name:"Edgeware",symbol:"EDG"},rpcUrls:{default:{http:["https://edgeware-evm.jelliedowl.net"]}},blockExplorers:{default:{name:"Edgscan by Bharathcoorg",url:"https://edgscan.live",apiUrl:"https://edgscan.live/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:18117872}}}),Ere=ca({id:2022,name:"Beresheet BereEVM Testnet",nativeCurrency:{decimals:18,name:"Testnet EDG",symbol:"tEDG"},rpcUrls:{default:{http:["https://beresheet-evm.jelliedowl.net"]}},blockExplorers:{default:{name:"Edgscan by Bharathcoorg",url:"https://testnet.edgscan.live",apiUrl:"https://testnet.edgscan.live/api"}}}),Are=ca({id:7332,name:"Horizen EON",nativeCurrency:{decimals:18,name:"ZEN",symbol:"ZEN"},rpcUrls:{default:{http:["https://eon-rpc.horizenlabs.io/ethv1"]}},blockExplorers:{default:{name:"EON Explorer",url:"https://eon-explorer.horizenlabs.io"}},contracts:{}}),Cre=ca({id:17777,name:"EOS EVM",nativeCurrency:{decimals:18,name:"EOS",symbol:"EOS"},rpcUrls:{default:{http:["https://api.evm.eosnetwork.com"]}},blockExplorers:{default:{name:"EOS EVM Explorer",url:"https://explorer.evm.eosnetwork.com",apiUrl:"https://explorer.evm.eosnetwork.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7943933}}}),Pre=ca({id:15557,name:"EOS EVM Testnet",nativeCurrency:{decimals:18,name:"EOS",symbol:"EOS"},rpcUrls:{default:{http:["https://api.testnet.evm.eosnetwork.com"]}},blockExplorers:{default:{name:"EOS EVM Testnet Explorer",url:"https://explorer.testnet.evm.eosnetwork.com",apiUrl:"https://explorer.testnet.evm.eosnetwork.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:9067940}},testnet:!0}),_re=ca({id:128123,name:"Etherlink Testnet",nativeCurrency:{decimals:18,name:"Tez",symbol:"XTZ"},rpcUrls:{default:{http:["https://node.ghostnet.etherlink.com"]}},blockExplorers:{default:{name:"Etherlink Testnet",url:"https://testnet-explorer.etherlink.com"}},testnet:!0}),Sre=ca({id:9001,name:"Evmos",nativeCurrency:{decimals:18,name:"Evmos",symbol:"EVMOS"},rpcUrls:{default:{http:["https://eth.bd.evmos.org:8545"]}},blockExplorers:{default:{name:"Evmos Block Explorer",url:"https://escan.live"}}}),Ire=ca({id:9e3,name:"Evmos Testnet",nativeCurrency:{decimals:18,name:"Evmos",symbol:"EVMOS"},rpcUrls:{default:{http:["https://eth.bd.evmos.dev:8545"]}},blockExplorers:{default:{name:"Evmos Testnet Block Explorer",url:"https://evm.evmos.dev/"}}}),Bre=ca({id:1994,name:"Ekta",nativeCurrency:{decimals:18,name:"EKTA",symbol:"EKTA"},rpcUrls:{default:{http:["https://main.ekta.io"]}},blockExplorers:{default:{name:"Ektascan",url:"https://ektascan.io",apiUrl:"https://ektascan.io/api"}}}),Tre=ca({id:1004,name:"Ekta Testnet",nativeCurrency:{decimals:18,name:"EKTA",symbol:"EKTA"},rpcUrls:{default:{http:["https://test.ekta.io:8545"]}},blockExplorers:{default:{name:"Test Ektascan",url:"https://test.ektascan.io",apiUrl:"https://test.ektascan.io/api"}},testnet:!0}),Mre=ca({id:250,name:"Fantom",nativeCurrency:{decimals:18,name:"Fantom",symbol:"FTM"},rpcUrls:{default:{http:["https://rpc.ankr.com/fantom"]}},blockExplorers:{default:{name:"FTMScan",url:"https://ftmscan.com",apiUrl:"https://api.ftmscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:33001987}}}),Ore=ca({id:64240,name:"Fantom Sonic Open Testnet",network:"fantom-sonic-testnet",nativeCurrency:{decimals:18,name:"Fantom",symbol:"FTM"},rpcUrls:{default:{http:["https://rpcapi.sonic.fantom.network"]}},blockExplorers:{default:{name:"Fantom Sonic Open Testnet Explorer",url:"https://public-sonic.fantom.network"}},testnet:!0}),Nre=ca({id:4002,name:"Fantom Testnet",nativeCurrency:{decimals:18,name:"Fantom",symbol:"FTM"},rpcUrls:{default:{http:["https://rpc.testnet.fantom.network"]}},blockExplorers:{default:{name:"FTMScan",url:"https://testnet.ftmscan.com",apiUrl:"https://testnet.ftmscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:8328688}}}),Rre=ca({id:12306,name:"Fibo Chain",nativeCurrency:{decimals:18,name:"fibo",symbol:"FIBO"},rpcUrls:{default:{http:["https://network.hzroc.art"]}},blockExplorers:{default:{name:"FiboScan",url:"https://scan.fibochain.org"}}}),Fre=ca({id:314,name:"Filecoin Mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3328594}}}),jre=ca({id:314159,name:"Filecoin Calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}},testnet:!0}),Lre=ca({id:3141,name:"Filecoin Hyperspace",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.hyperspace.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://hyperspace.filfox.info/en"}},testnet:!0}),Ure=ca({id:14,name:"Flare Mainnet",nativeCurrency:{decimals:18,name:"flare",symbol:"FLR"},rpcUrls:{default:{http:["https://flare-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Flare Explorer",url:"https://flare-explorer.flare.network",apiUrl:"https://flare-explorer.flare.network/api"}}}),Dre=ca({id:114,name:"Coston2",nativeCurrency:{decimals:18,name:"coston2flare",symbol:"C2FLR"},rpcUrls:{default:{http:["https://coston2-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Coston2 Explorer",url:"https://coston2-explorer.flare.network",apiUrl:"https://coston2-explorer.flare.network/api"}},testnet:!0}),zre=ca({id:646,name:"FlowEVM Previewnet",nativeCurrency:{decimals:18,name:"Flow",symbol:"FLOW"},rpcUrls:{default:{http:["https://previewnet.evm.nodes.onflow.org"]}},blockExplorers:{default:{name:"Previewnet Explorer",url:"https://previewnet.flowdiver.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6205}}}),Hre=ca({id:747,name:"FlowEVM Mainnet",nativeCurrency:{decimals:18,name:"Flow",symbol:"FLOW"},rpcUrls:{default:{http:["https://mainnet.evm.nodes.onflow.org"]}},blockExplorers:{default:{name:"Mainnet Explorer",url:"https://flowdiver.io"}}}),Gre=ca({id:545,name:"FlowEVM Testnet",nativeCurrency:{decimals:18,name:"Flow",symbol:"FLOW"},rpcUrls:{default:{http:["https://testnet.evm.nodes.onflow.org"]}},blockExplorers:{default:{name:"Flow Diver",url:"https://testnet.flowdiver.io"}}}),qre=ca({id:31337,name:"Foundry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]}}}),$re=1,Vre=ca({...Zte,id:252,name:"Fraxtal",nativeCurrency:{name:"Frax Ether",symbol:"frxETH",decimals:18},rpcUrls:{default:{http:["https://rpc.frax.com"]}},blockExplorers:{default:{name:"fraxscan",url:"https://fraxscan.com",apiUrl:"https://api.fraxscan.com/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[$re]:{address:"0x66CC916Ed5C6C2FA97014f7D1cD141528Ae171e4"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[$re]:{address:"0x36cb65c1967A0Fb0EEE11569C51C2f2aA1Ca6f6D",blockCreated:19135323}},l1StandardBridge:{[$re]:{address:"0x34C0bD5877A5Ee7099D0f5688D65F4bB9158BDE2",blockCreated:19135323}}},sourceId:1}),Wre=17e3,Zre=ca({...Zte,id:2522,name:"Fraxtal Testnet",nativeCurrency:{name:"Frax Ether",symbol:"frxETH",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.frax.com"]}},blockExplorers:{default:{name:"fraxscan testnet",url:"https://holesky.fraxscan.com",apiUrl:"https://api-holesky.fraxscan.com/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[Wre]:{address:"0x715EA64DA13F4d0831ece4Ad3E8c1aa013167F32"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[Wre]:{address:"0xB9c64BfA498d5b9a8398Ed6f46eb76d90dE5505d",blockCreated:318416}},l1StandardBridge:{[Wre]:{address:"0x0BaafC217162f64930909aD9f2B27125121d6332",blockCreated:318416}}},sourceId:Wre}),Qre=ca({...Zte,id:3397901,network:"funkiSepolia",name:"Funki Sepolia Sandbox",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://funki-testnet.alt.technology"]}},blockExplorers:{default:{name:"Funki Sepolia Sandbox Explorer",url:"https://sepolia-sandbox.funkichain.com/"}},testnet:!0,contracts:{...Zte.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1620204}},sourceId:11155111}),Kre=ca({id:122,name:"Fuse",nativeCurrency:{name:"Fuse",symbol:"FUSE",decimals:18},rpcUrls:{default:{http:["https://rpc.fuse.io"]}},blockExplorers:{default:{name:"Fuse Explorer",url:"https://explorer.fuse.io",apiUrl:"https://explorer.fuse.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:16146628}}}),Yre=ca({id:123,name:"Fuse Sparknet",nativeCurrency:{name:"Spark",symbol:"SPARK",decimals:18},rpcUrls:{default:{http:["https://rpc.fusespark.io"]}},blockExplorers:{default:{name:"Sparkent Explorer",url:"https://explorer.fusespark.io",apiUrl:"https://explorer.fusespark.io/api"}}}),Jre=ca({id:4689,name:"IoTeX",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.mainnet.iotex.io"],webSocket:["wss://babel-api.mainnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://iotexscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:22163670}}}),Xre=ca({id:4690,name:"IoTeX Testnet",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.testnet.iotex.io"],webSocket:["wss://babel-api.testnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://testnet.iotexscan.io"}},testnet:!0}),ese=ca({id:8899,name:"JIBCHAIN L1",network:"jbc",nativeCurrency:{name:"JBC",symbol:"JBC",decimals:18},rpcUrls:{default:{http:["https://rpc-l1.jibchain.net"]},public:{http:["https://rpc-l1.jibchain.net"]}},blockExplorers:{default:{name:"Blockscout",url:"https://exp-l1.jibchain.net",apiUrl:"https://exp-l1.jibchain.net/api"}},contracts:{multicall3:{address:"0xc0C8C486D1466C57Efe13C2bf000d4c56F47CBdC",blockCreated:2299048}},testnet:!1}),tse=ca({id:88991,name:"Jibchain Testnet",nativeCurrency:{name:"tJBC",symbol:"tJBC",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.jibchain.net"]}},blockExplorers:{default:{name:"Blockscout",url:"https://exp.testnet.jibchain.net",apiUrl:"https://exp.testnet.jibchain.net/api"}},contracts:{multicall3:{address:"0xa1a858ad9041B4741e620355a3F96B3c78e70ecE",blockCreated:32848}},testnet:!0}),nse=ca({id:686,name:"Karura",network:"karura",nativeCurrency:{name:"Karura",symbol:"KAR",decimals:18},rpcUrls:{public:{http:["https://eth-rpc-karura.aca-api.network"],webSocket:["wss://eth-rpc-karura.aca-api.network"]},default:{http:["https://eth-rpc-karura.aca-api.network"],webSocket:["wss://eth-rpc-karura.aca-api.network"]}},blockExplorers:{default:{name:"Karura Blockscout",url:"https://blockscout.karura.network",apiUrl:"https://blockscout.karura.network/api"}},testnet:!1}),rse=ca({id:1663,name:"Horizen Gobi Testnet",nativeCurrency:{decimals:18,name:"Test ZEN",symbol:"tZEN"},rpcUrls:{default:{http:["https://gobi-testnet.horizenlabs.io/ethv1"]}},blockExplorers:{default:{name:"Gobi Explorer",url:"https://gobi-explorer.horizen.io"}},contracts:{},testnet:!0}),sse=ca({id:5,name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io",apiUrl:"https://api-goerli.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xfc4AC75C46C914aF5892d6d3eFFcebD7917293F1",blockCreated:10339206},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}),ise=ca({id:100,name:"Gnosis",nativeCurrency:{decimals:18,name:"Gnosis",symbol:"xDAI"},rpcUrls:{default:{http:["https://rpc.gnosischain.com"],webSocket:["wss://rpc.gnosischain.com/wss"]}},blockExplorers:{default:{name:"Gnosisscan",url:"https://gnosisscan.io",apiUrl:"https://api.gnosisscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:21022491}}}),ase=ca({id:10200,name:"Gnosis Chiado",nativeCurrency:{decimals:18,name:"Gnosis",symbol:"xDAI"},rpcUrls:{default:{http:["https://rpc.chiadochain.net"],webSocket:["wss://rpc.chiadochain.net/wss"]}},blockExplorers:{default:{name:"Blockscout",url:"https://blockscout.chiadochain.net",apiUrl:"https://blockscout.chiadochain.net/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:4967313}},testnet:!0}),ose=ca({id:31337,name:"Hardhat",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]}}}),cse=ca({id:16666e5,name:"Harmony One",nativeCurrency:{name:"Harmony",symbol:"ONE",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/harmony"]}},blockExplorers:{default:{name:"Harmony Explorer",url:"https://explorer.harmony.one"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:24185753}}}),lse=ca({id:11235,name:"HAQQ Mainnet",nativeCurrency:{decimals:18,name:"Islamic Coin",symbol:"ISLM"},rpcUrls:{default:{http:["https://rpc.eth.haqq.network"]}},blockExplorers:{default:{name:"HAQQ Explorer",url:"https://explorer.haqq.network",apiUrl:"https://explorer.haqq.network/api"}}}),use=ca({id:54211,name:"HAQQ Testedge 2",nativeCurrency:{decimals:18,name:"Islamic Coin",symbol:"ISLMT"},rpcUrls:{default:{http:["https://rpc.eth.testedge2.haqq.network"]}},blockExplorers:{default:{name:"HAQQ Explorer",url:"https://explorer.testedge2.haqq.network",apiUrl:"https://explorer.testedge2.haqq.network/api"}}}),dse=ca({id:295,name:"Hedera Mainnet",network:"hedera-mainnet",nativeCurrency:{symbol:"HBAR",name:"HBAR",decimals:18},rpcUrls:{default:{http:["https://mainnet.hashio.io/api"]}},blockExplorers:{default:{name:"Hashscan",url:"https://hashscan.io/mainnet"}},testnet:!1}),hse=ca({id:296,name:"Hedera Testnet",network:"hedera-testnet",nativeCurrency:{symbol:"HBAR",name:"HBAR",decimals:18},rpcUrls:{default:{http:["https://testnet.hashio.io/api"]}},blockExplorers:{default:{name:"Hashscan",url:"https://hashscan.io/testnet"}},testnet:!0}),pse=ca({id:297,name:"Hedera Previewnet",network:"hedera-previewnet",nativeCurrency:{symbol:"HBAR",name:"HBAR",decimals:18},rpcUrls:{default:{http:["https://previewnet.hashio.io/api"]}},blockExplorers:{default:{name:"Hashscan",url:"https://hashscan.io/previewnet"}},testnet:!0}),fse=ca({id:17e3,name:"Holesky",nativeCurrency:{name:"Holesky Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky-rpc.publicnode.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://holesky.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:77},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",blockCreated:801613},ensUniversalResolver:{address:"0xa6AC935D4971E3CD133b950aE053bECD16fE7f3b",blockCreated:973484}},testnet:!0}),mse=ca({id:13371,name:"Immutable zkEVM",nativeCurrency:{decimals:18,name:"Immutable Coin",symbol:"IMX"},rpcUrls:{default:{http:["https://rpc.immutable.com"]}},blockExplorers:{default:{name:"Immutable Explorer",url:"https://explorer.immutable.com"}},contracts:{multicall3:{address:"0x236bdA4589e44e6850f5aC6a74BfCa398a86c6c0",blockCreated:4335972}}}),bse=ca({id:13473,name:"Immutable zkEVM Testnet",nativeCurrency:{decimals:18,name:"Immutable Coin",symbol:"IMX"},rpcUrls:{default:{http:["https://rpc.testnet.immutable.com"]}},blockExplorers:{default:{name:"Immutable Testnet Explorer",url:"https://explorer.testnet.immutable.com/"}},contracts:{multicall3:{address:"0x2CC787Ed364600B0222361C4188308Fa8E68bA60",blockCreated:5977391}},testnet:!0}),gse=ca({id:2525,name:"inEVM Mainnet",nativeCurrency:{decimals:18,name:"Injective",symbol:"INJ"},rpcUrls:{default:{http:["https://mainnet.rpc.inevm.com/http"]}},blockExplorers:{default:{name:"inEVM Explorer",url:"https://inevm.calderaexplorer.xyz",apiUrl:"https://inevm.calderaexplorer.xyz/api/v2"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:118606}}}),yse=ca({id:107107114116,name:"Kakarot Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rpc.kakarot.org"]}},blockExplorers:{default:{name:"Kakarot Scan",url:"https://sepolia.kakarotscan.org"}},testnet:!0}),vse=ca({id:2222,name:"Kava EVM",network:"kava-mainnet",nativeCurrency:{name:"Kava",symbol:"KAVA",decimals:18},rpcUrls:{default:{http:["https://evm.kava.io"]}},blockExplorers:{default:{name:"Kava EVM Explorer",url:"https://kavascan.com",apiUrl:"https://kavascan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3661165}},testnet:!1}),wse=ca({id:2221,name:"Kava EVM Testnet",network:"kava-testnet",nativeCurrency:{name:"Kava",symbol:"KAVA",decimals:18},rpcUrls:{default:{http:["https://evm.testnet.kava.io"]}},blockExplorers:{default:{name:"Kava EVM Testnet Explorer",url:"https://testnet.kavascan.com/",apiUrl:"https://testnet.kavascan.com/api"}},contracts:{multicall3:{address:"0xDf1D724A7166261eEB015418fe8c7679BBEa7fd6",blockCreated:7242179}},testnet:!0}),xse=ca({id:321,name:"KCC Mainnet",network:"KCC Mainnet",nativeCurrency:{decimals:18,name:"KCS",symbol:"KCS"},rpcUrls:{default:{http:["https://kcc-rpc.com"]},public:{http:["https://kcc-rpc.com"]}},blockExplorers:{default:{name:"KCC Explorer",url:"https://explorer.kcc.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11760430}},testnet:!1}),kse=ca({id:8217,name:"Klaytn",nativeCurrency:{decimals:18,name:"Klaytn",symbol:"KLAY"},rpcUrls:{default:{http:["https://public-en-cypress.klaytn.net"]}},blockExplorers:{default:{name:"KlaytnScope",url:"https://scope.klaytn.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:96002415}}}),Ese=ca({id:1001,name:"Klaytn Baobab Testnet",network:"klaytn-baobab",nativeCurrency:{decimals:18,name:"Baobab Klaytn",symbol:"KLAY"},rpcUrls:{default:{http:["https://public-en-baobab.klaytn.net"]}},blockExplorers:{default:{name:"KlaytnScope",url:"https://baobab.klaytnscope.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:123390593}},testnet:!0}),Ase=ca({id:255,name:"Kroma",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://api.kroma.network"]}},blockExplorers:{default:{name:"Kroma Explorer",url:"https://blockscout.kroma.network",apiUrl:"https://blockscout.kroma.network/api"}},testnet:!1}),Cse=ca({id:2358,name:"Kroma Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://api.sepolia.kroma.network"]}},blockExplorers:{default:{name:"Kroma Sepolia Explorer",url:"https://blockscout.sepolia.kroma.network",apiUrl:"https://blockscout.sepolia.kroma.network/api"}},testnet:!0}),Pse=ca({id:12324,name:"L3X Protocol",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc-mainnet.l3x.com"],webSocket:["wss://rpc-mainnet.l3x.com"]}},blockExplorers:{default:{name:"L3X Mainnet Explorer",url:"https://explorer.l3x.com",apiUrl:"https://explorer.l3x.com/api/v2"}},testnet:!1}),_se=ca({id:12325,name:"L3X Protocol Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc-testnet.l3x.com"],webSocket:["wss://rpc-testnet.l3x.com"]}},blockExplorers:{default:{name:"L3X Testnet Explorer",url:"https://explorer-testnet.l3x.com",apiUrl:"https://explorer-testnet.l3x.com/api/v2"}},testnet:!0}),Sse=ca({id:1891,name:"LightLink Pegasus Testnet",network:"lightlink-pegasus",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://replicator.pegasus.lightlink.io/rpc/v1"]}},blockExplorers:{default:{name:"LightLink Pegasus Explorer",url:"https://pegasus.lightlink.io"}},testnet:!0}),Ise=ca({id:1890,name:"LightLink Phoenix Mainnet",network:"lightlink-phoenix",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://replicator.phoenix.lightlink.io/rpc/v1"]}},blockExplorers:{default:{name:"LightLink Phoenix Explorer",url:"https://phoenix.lightlink.io"}},testnet:!1}),Bse=ca({id:59144,name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build",apiUrl:"https://api.lineascan.build/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:42}},testnet:!1}),Tse=ca({id:59140,name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build",apiUrl:"https://api-goerli.lineascan.build/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:498623}},testnet:!0}),Mse=ca({id:59141,name:"Linea Sepolia Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.sepolia.linea.build"],webSocket:["wss://rpc.sepolia.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.lineascan.build",apiUrl:"https://api-sepolia.lineascan.build/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:227427}},testnet:!0}),Ose=ca({id:59140,name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build",apiUrl:"https://goerli.lineascan.build/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:498623}},testnet:!0}),Nse=50000n,Rse=2097120n,Fse={block:Ni({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=Fse.transaction?.format(e);return"0x71"===t.typeHex?t.type="eip712":"0xff"===t.typeHex&&(t.type="priority"),t}));return{l1BatchNumber:e.l1BatchNumber?rs(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?rs(e.l1BatchTimestamp):null,transactions:t}}}),transaction:Mi({format(e){const t={};return"0x71"===e.type?t.type="eip712":"0xff"===e.type&&(t.type="priority"),{...t,l1BatchNumber:e.l1BatchNumber?rs(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?rs(e.l1BatchTxIndex):null}}}),transactionReceipt:fa({format:e=>({l1BatchNumber:e.l1BatchNumber?rs(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?rs(e.l1BatchTxIndex):null,logs:e.logs.map((e=>({...aa(e),l1BatchNumber:e.l1BatchNumber?rs(e.l1BatchNumber):null,transactionLogIndex:is(e.transactionLogIndex),logType:e.logType}))),l2ToL1Logs:e.l2ToL1Logs.map((e=>({blockNumber:rs(e.blockHash),blockHash:e.blockHash,l1BatchNumber:rs(e.l1BatchNumber),transactionIndex:rs(e.transactionIndex),shardId:rs(e.shardId),isService:e.isService,sender:e.sender,key:e.key,value:e.value,transactionHash:e.transactionHash,logIndex:rs(e.logIndex)})))})}),transactionRequest:Ii({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format:e=>e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:cs(e.gasPerPubdata)}:{gasPerPubdata:cs(Nse)},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(vs(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps.map((e=>Array.from(vs(e))))}:{},...e.customSignature?{customSignature:Array.from(vs(e.customSignature))}:{}},type:"0x71"}:{}})};class jse extends qr{constructor(){super(["Transaction is not an EIP712 transaction.","","Transaction must:",' - include `type: "eip712"`'," - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`"].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidEip712TransactionError"})}}function Lse(e){return"eip712"===e.type||!!("customSignature"in e&&e.customSignature||"paymaster"in e&&e.paymaster||"paymasterInput"in e&&e.paymasterInput||"gasPerPubdata"in e&&"bigint"==typeof e.gasPerPubdata||"factoryDeps"in e&&e.factoryDeps)}function Use(e){const{chainId:t,to:n,from:r,paymaster:s,paymasterInput:i}=e;if(!Lse(e))throw new jse;if(!t||t<=0)throw new oa({chainId:t});if(n&&!si(n))throw new Js({address:n});if(r&&!si(r))throw new Js({address:r});if(s&&!si(s))throw new Js({address:s});if(s&&!i)throw new qr("`paymasterInput` must be provided when `paymaster` is defined");if(!s&&i)throw new qr("`paymaster` must be provided when `paymasterInput` is defined")}const Dse={transaction:function(e,t){return Lse(e)?function(e){const{chainId:t,gas:n,nonce:r,to:s,from:i,value:a,maxFeePerGas:o,maxPriorityFeePerGas:c,customSignature:l,factoryDeps:u,paymaster:d,paymasterInput:h,gasPerPubdata:p,data:f}=e;Use(e);const m=[r?cs(r):"0x",c?cs(c):"0x",o?cs(o):"0x",n?cs(n):"0x",s??"0x",a?cs(a):"0x",f??"0x0",cs(t),cs(""),cs(""),cs(t),i??"0x",cs(p||Nse),u??[],l??"0x",d&&h?[d,h]:[]];return ii(["0x71",la(m)])}(e):va(e,t)}};class zse extends qr{constructor({givenLength:e,maxBytecodeSize:t}){super(`Bytecode cannot be longer than ${t} bytes. Given length: ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytecodeLengthExceedsMaxSizeError"})}}class Hse extends qr{constructor({givenLengthInWords:e}){super(`Bytecode length in 32-byte words must be odd. Given length in words: ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytecodeLengthInWordsMustBeOddError"})}}class Gse extends qr{constructor({givenLength:e}){super(`The bytecode length in bytes must be divisible by 32. Given length: ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytecodeLengthMustBeDivisibleBy32Error"})}}const qse={formatters:Fse,serializers:Dse,custom:{getEip712Domain:e=>{Use(e);const t=function(e){const{gas:t,nonce:n,to:r,from:s,value:i,maxFeePerGas:a,maxPriorityFeePerGas:o,factoryDeps:c,paymaster:l,paymasterInput:u,gasPerPubdata:d,data:h}=e;return{txType:113n,from:BigInt(s),to:r?BigInt(r):0n,gasLimit:t??0n,gasPerPubdataByteLimit:d??Nse,maxFeePerGas:a??0n,maxPriorityFeePerGas:o??0n,paymaster:l?BigInt(l):0n,nonce:n?BigInt(n):0n,value:i??0n,data:h||"0x0",factoryDeps:c?.map((e=>cs(function(e){const t=ms(e);if(t.length%32!=0)throw new Gse({givenLength:t.length});if(t.length>Rse)throw new zse({givenLength:t.length,maxBytecodeSize:Rse});const n=ms($i(t)),r=t.length/32;if(r%2==0)throw new Hse({givenLengthInWords:r});const s=Zr(ms(r),{size:2}),i=new Uint8Array([1,0]);return n.set(i,0),n.set(s,2),n}(e))))??[],paymasterInput:u||"0x"}}(e);return{domain:{name:"zkSync",version:"2",chainId:e.chainId},types:{Transaction:[{name:"txType",type:"uint256"},{name:"from",type:"uint256"},{name:"to",type:"uint256"},{name:"gasLimit",type:"uint256"},{name:"gasPerPubdataByteLimit",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymaster",type:"uint256"},{name:"nonce",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"factoryDeps",type:"bytes32[]"},{name:"paymasterInput",type:"bytes"}]},primaryType:"Transaction",message:t}}}},$se=ca({...qse,id:1135,name:"Lisk",network:"lisk",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.api.lisk.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://blockscout.lisk.com",apiUrl:"https://blockscout.lisk.com/api"}},contracts:{multicall3:{address:"0xA9d71E1dd7ca26F26e656E66d6AA81ed7f745bf0"}}}),Vse=11155111,Wse=ca({...Zte,id:4202,network:"lisk-sepolia",name:"Lisk Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.sepolia-api.lisk.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-blockscout.lisk.com",apiUrl:"https://sepolia-blockscout.lisk.com/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[Vse]:{address:"0xA0E35F56C318DE1bD5D9ca6A94Fe7e37C5663348"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[Vse]:{address:"0xe3d90F21490686Ec7eF37BE788E02dfC12787264"}},l1StandardBridge:{[Vse]:{address:"0x1Fb30e446eA791cd1f011675E5F3f5311b70faF5"}}},testnet:!0,sourceId:Vse}),Zse=ca({id:1337,name:"Localhost",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]}}}),Qse=ca({id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network",apiUrl:"https://api.explorer.execution.mainnet.lukso.network/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:468183}}}),Kse=ca({id:4201,name:"LUKSO Testnet",nativeCurrency:{decimals:18,name:"LUKSO Testnet",symbol:"LYXt"},rpcUrls:{default:{http:["https://rpc.testnet.lukso.network"],webSocket:["wss://ws-rpc.testnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Testnet Explorer",url:"https://explorer.execution.testnet.lukso.network",apiUrl:"https://api.explorer.execution.testnet.lukso.network/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:605348}},testnet:!0}),Yse=ca({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Jse=ca({id:595,name:"Mandala TC9",network:"mandala",nativeCurrency:{name:"Mandala",symbol:"mACA",decimals:18},rpcUrls:{public:{http:["https://eth-rpc-tc9.aca-staging.network"],webSocket:["wss://eth-rpc-tc9.aca-staging.network"]},default:{http:["https://eth-rpc-tc9.aca-staging.network"],webSocket:["wss://eth-rpc-tc9.aca-staging.network"]}},blockExplorers:{default:{name:"Mandala Blockscout",url:"https://blockscout.mandala.aca-staging.network",apiUrl:"https://blockscout.mandala.aca-staging.network/api"}},testnet:!0}),Xse=ca({id:169,name:"Manta Pacific Mainnet",network:"manta",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://pacific-rpc.manta.network/http"]}},blockExplorers:{default:{name:"Manta Explorer",url:"https://pacific-explorer.manta.network",apiUrl:"https://pacific-explorer.manta.network/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:332890}}}),eie=ca({id:3441006,name:"Manta Pacific Sepolia Testnet",network:"manta-sepolia",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://pacific-rpc.sepolia-testnet.manta.network/http"]}},blockExplorers:{default:{name:"Manta Sepolia Testnet Explorer",url:"https://pacific-explorer.sepolia-testnet.manta.network",apiUrl:"https://pacific-explorer.sepolia-testnet.manta.network/api"}},contracts:{multicall3:{address:"0xca54918f7B525C8df894668846506767412b53E3",blockCreated:479584}},testnet:!0}),tie=ca({id:3441005,name:"Manta Pacific Testnet",network:"manta-testnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://manta-testnet.calderachain.xyz/http"]}},blockExplorers:{default:{name:"Manta Testnet Explorer",url:"https://pacific-explorer.testnet.manta.network",apiUrl:"https://pacific-explorer.testnet.manta.network/api"}},contracts:{multicall3:{address:"0x211B1643b95Fe76f11eD8880EE810ABD9A4cf56C",blockCreated:419915}},testnet:!0}),nie=ca({id:5e3,name:"Mantle",nativeCurrency:{decimals:18,name:"MNT",symbol:"MNT"},rpcUrls:{default:{http:["https://rpc.mantle.xyz"]}},blockExplorers:{default:{name:"Mantle Explorer",url:"https://mantlescan.xyz/",apiUrl:"https://api.mantlescan.xyz/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:304717}}}),rie=ca({id:5003,name:"Mantle Sepolia Testnet",nativeCurrency:{decimals:18,name:"MNT",symbol:"MNT"},rpcUrls:{default:{http:["https://rpc.sepolia.mantle.xyz"]}},blockExplorers:{default:{name:"Mantle Testnet Explorer",url:"https://explorer.sepolia.mantle.xyz/",apiUrl:"https://explorer.sepolia.mantle.xyz/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:4584012}},testnet:!0}),sie=ca({id:5001,name:"Mantle Testnet",nativeCurrency:{decimals:18,name:"MNT",symbol:"MNT"},rpcUrls:{default:{http:["https://rpc.testnet.mantle.xyz"]}},blockExplorers:{default:{name:"Mantle Testnet Explorer",url:"https://explorer.testnet.mantle.xyz",apiUrl:"https://explorer.testnet.mantle.xyz/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:561333}},testnet:!0}),iie=ca({id:4200,name:"Merlin",nativeCurrency:{name:"BTC",symbol:"BTC",decimals:18},rpcUrls:{default:{http:["https://rpc.merlinchain.io"]}},blockExplorers:{default:{name:"blockscout",url:"https://scan.merlinchain.io",apiUrl:"https://scan.merlinchain.io/api"}}}),aie=ca({id:571,name:"MetaChain Mainnet",nativeCurrency:{name:"Metatime Coin",symbol:"MTC",decimals:18},rpcUrls:{default:{http:["https://rpc.metatime.com"]}},blockExplorers:{default:{name:"MetaExplorer",url:"https://explorer.metatime.com"}},contracts:{multicall3:{address:"0x0000000000000000000000000000000000003001",blockCreated:0}}}),oie=ca({id:1453,name:"MetaChain Istanbul",nativeCurrency:{name:"Metatime Coin",symbol:"MTC",decimals:18},rpcUrls:{default:{http:["https://istanbul-rpc.metachain.dev"]}},blockExplorers:{default:{name:"MetaExplorer",url:"https://istanbul-explorer.metachain.dev"}},contracts:{multicall3:{address:"0x0000000000000000000000000000000000003001",blockCreated:0}},testnet:!0}),cie=1,lie=ca({...Zte,id:1750,name:"Metal L2",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.metall2.com"],webSocket:["wss://rpc.metall2.com"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.metall2.com",apiUrl:"https://explorer.metall2.com/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[cie]:{address:"0x3B1F7aDa0Fcc26B13515af752Dd07fB1CAc11426"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0},portal:{[cie]:{address:"0x3F37aBdE2C6b5B2ed6F8045787Df1ED1E3753956"}},l1StandardBridge:{[cie]:{address:"0x6d0f65D59b55B0FEC5d2d15365154DcADC140BF3"}}},sourceId:1}),uie=ca({id:82,name:"Meter",nativeCurrency:{decimals:18,name:"MTR",symbol:"MTR"},rpcUrls:{default:{http:["https://rpc.meter.io"]}},blockExplorers:{default:{name:"MeterScan",url:"https://scan.meter.io"}}}),die=ca({id:83,name:"Meter Testnet",nativeCurrency:{decimals:18,name:"MTR",symbol:"MTR"},rpcUrls:{default:{http:["https://rpctest.meter.io"]}},blockExplorers:{default:{name:"MeterTestnetScan",url:"https://scan-warringstakes.meter.io"}}}),hie=ca({id:1088,name:"Metis",nativeCurrency:{decimals:18,name:"Metis",symbol:"METIS"},rpcUrls:{default:{http:["https://andromeda.metis.io/?owner=1088"]}},blockExplorers:{default:{name:"Metis Explorer",url:"https://explorer.metis.io",apiUrl:"https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan/api"},blockscout:{name:"Andromeda Explorer",url:"https://andromeda-explorer.metis.io",apiUrl:"https://andromeda-explorer.metis.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:2338552}}}),pie=ca({id:599,name:"Metis Goerli",nativeCurrency:{decimals:18,name:"Metis Goerli",symbol:"METIS"},rpcUrls:{default:{http:["https://goerli.gateway.metisdevops.link"]}},blockExplorers:{default:{name:"Metis Goerli Explorer",url:"https://goerli.explorer.metisdevops.link",apiUrl:"https://goerli.explorer.metisdevops.link/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1006207}}}),fie=ca({id:7518,name:"MEVerse Chain Mainnet",nativeCurrency:{decimals:18,name:"MEVerse",symbol:"MEV"},rpcUrls:{default:{http:["https://rpc.meversemainnet.io"]}},blockExplorers:{default:{name:"Explorer",url:"https://www.meversescan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:86881340}}}),mie=ca({id:4759,name:"MEVerse Chain Testnet",nativeCurrency:{decimals:18,name:"MEVerse",symbol:"MEV"},rpcUrls:{default:{http:["https://rpc.meversetestnet.io"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.meversescan.io/"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:64371115}},testnet:!0}),bie=ca({id:1686,name:"Mint Sepolia Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://testnet-rpc.mintchain.io"]}},blockExplorers:{default:{name:"Mintchain Testnet explorer",url:"https://testnet-explorer.mintchain.io"}},testnet:!0}),gie=ca({id:34443,name:"Mode Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.mode.network"]}},blockExplorers:{default:{name:"Modescan",url:"https://modescan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:2465882}},sourceId:1}),yie=ca({id:919,name:"Mode Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.mode.network"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia.explorer.mode.network",apiUrl:"https://sepolia.explorer.mode.network/api"}},contracts:{multicall3:{address:"0xBAba8373113Fb7a68f195deF18732e01aF8eDfCF",blockCreated:3019007}},testnet:!0,sourceId:11155111}),vie=ca({id:1287,name:"Moonbase Alpha",nativeCurrency:{decimals:18,name:"DEV",symbol:"DEV"},rpcUrls:{default:{http:["https://rpc.api.moonbase.moonbeam.network"],webSocket:["wss://wss.api.moonbase.moonbeam.network"]}},blockExplorers:{default:{name:"Moonscan",url:"https://moonbase.moonscan.io",apiUrl:"https://moonbase.moonscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1850686}},testnet:!0}),wie=ca({id:1284,name:"Moonbeam",nativeCurrency:{decimals:18,name:"GLMR",symbol:"GLMR"},rpcUrls:{default:{http:["https://moonbeam.public.blastapi.io"],webSocket:["wss://moonbeam.public.blastapi.io"]}},blockExplorers:{default:{name:"Moonscan",url:"https://moonscan.io",apiUrl:"https://api-moonbeam.moonscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:609002}},testnet:!1}),xie=ca({id:1281,name:"Moonbeam Development Node",nativeCurrency:{decimals:18,name:"DEV",symbol:"DEV"},rpcUrls:{default:{http:["http://127.0.0.1:9944"],webSocket:["wss://127.0.0.1:9944"]}}}),kie=ca({id:1285,name:"Moonriver",nativeCurrency:{decimals:18,name:"MOVR",symbol:"MOVR"},rpcUrls:{default:{http:["https://moonriver.public.blastapi.io"],webSocket:["wss://moonriver.public.blastapi.io"]}},blockExplorers:{default:{name:"Moonscan",url:"https://moonriver.moonscan.io",apiUrl:"https://api-moonriver.moonscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1597904}},testnet:!1}),Eie=ca({id:2710,name:"Morph Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc-testnet.morphl2.io"]}},blockExplorers:{default:{name:"Morph Testnet Explorer",url:"https://explorer-testnet.morphl2.io",apiUrl:"https://explorer-api-testnet.morphl2.io/api"}},testnet:!0}),Aie=ca({id:22222,name:"Nautilus Mainnet",nativeCurrency:{name:"ZBC",symbol:"ZBC",decimals:9},rpcUrls:{default:{http:["https://api.nautilus.nautchain.xyz"]}},blockExplorers:{default:{name:"NautScan",url:"https://nautscan.com"}}}),Cie=ca({id:245022926,name:"Neon EVM DevNet",nativeCurrency:{name:"NEON",symbol:"NEON",decimals:18},rpcUrls:{default:{http:["https://devnet.neonevm.org"]}},blockExplorers:{default:{name:"Neonscan",url:"https://devnet.neonscan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:205206112}},testnet:!0}),Pie=ca({id:245022934,network:"neonMainnet",name:"Neon EVM MainNet",nativeCurrency:{name:"NEON",symbol:"NEON",decimals:18},rpcUrls:{default:{http:["https://neon-proxy-mainnet.solana.p2p.org"]}},blockExplorers:{default:{name:"Neonscan",url:"https://neonscan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:206545524}},testnet:!1}),_ie=ca({id:4242,name:"Nexi",nativeCurrency:{name:"Nexi",symbol:"NEXI",decimals:18},rpcUrls:{default:{http:["https://rpc.chain.nexi.technology"]}},blockExplorers:{default:{name:"NexiScan",url:"https://www.nexiscan.com",apiUrl:"https://www.nexiscan.com/api"}},contracts:{multicall3:{address:"0x0277A46Cc69A57eE3A6C8c158bA874832F718B8E",blockCreated:25770160}}}),Sie=ca({id:240,name:"Nexilix Smart Chain",nativeCurrency:{decimals:18,name:"Nexilix",symbol:"NEXILIX"},rpcUrls:{default:{http:["https://rpcurl.pos.nexilix.com"]}},blockExplorers:{default:{name:"NexilixScan",url:"https://scan.nexilix.com"}},contracts:{multicall3:{address:"0x58381c8e2BF9d0C2C4259cA14BdA9Afe02831244",blockCreated:74448}}}),Iie=ca({id:248,name:"Oasys",nativeCurrency:{name:"Oasys",symbol:"OAS",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.oasys.games"]}},blockExplorers:{default:{name:"OasysScan",url:"https://scan.oasys.games",apiUrl:"https://scan.oasys.games/api"}}}),Bie=ca({id:4090,network:"oasis-testnet",name:"Oasis Testnet",nativeCurrency:{name:"Fasttoken",symbol:"FTN",decimals:18},rpcUrls:{default:{http:["https://rpc1.oasis.bahamutchain.com"]},public:{http:["https://rpc1.oasis.bahamutchain.com"]}},blockExplorers:{default:{name:"Ftnscan",url:"https://oasis.ftnscan.com",apiUrl:"https://oasis.ftnscan.com/api"}},testnet:!0}),Tie=ca({id:66,name:"OKC",nativeCurrency:{decimals:18,name:"OKT",symbol:"OKT"},rpcUrls:{default:{http:["https://exchainrpc.okex.org"]}},blockExplorers:{default:{name:"oklink",url:"https://www.oklink.com/okc"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:10364792}}}),Mie=1,Oie=ca({...Zte,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[Mie]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[Mie]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[Mie]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:1}),Nie=5,Rie=ca({...Zte,id:420,name:"Optimism Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io",apiUrl:"https://goerli-optimism.etherscan.io/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[Nie]:{address:"0xE6Dfba0953616Bacab0c9A8ecb3a9BBa77FC15c0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461},portal:{[Nie]:{address:"0x5b47E1A08Ea6d985D6649300584e6722Ec4B1383"}},l1StandardBridge:{[Nie]:{address:"0x636Af16bf2f682dD3109e60102b8E1A089FedAa8"}}},testnet:!0,sourceId:5}),Fie=11155111,jie=ca({...Zte,id:11155420,name:"OP Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.optimism.io"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com",apiUrl:"https://optimism-sepolia.blockscout.com/api"}},contracts:{...Zte.contracts,disputeGameFactory:{[Fie]:{address:"0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1"}},l2OutputOracle:{[Fie]:{address:"0x90E9c4f8a994a250F6aEfd61CAFb4F2e895D458F"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1620204},portal:{[Fie]:{address:"0x16Fc5058F25648194471939df75CF27A2fdC48BC"}},l1StandardBridge:{[Fie]:{address:"0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1"}}},testnet:!0,sourceId:Fie}),Lie=ca({id:204,name:"opBNB",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{default:{http:["https://opbnb-mainnet-rpc.bnbchain.org"]}},blockExplorers:{default:{name:"opbnbscan",url:"https://mainnet.opbnbscan.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:512881}}}),Uie=ca({id:5611,name:"opBNB Testnet",nativeCurrency:{decimals:18,name:"tBNB",symbol:"tBNB"},rpcUrls:{default:{http:["https://opbnb-testnet-rpc.bnbchain.org"]}},blockExplorers:{default:{name:"opbnbscan",url:"https://testnet.opbnbscan.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3705108}},testnet:!0}),Die=ca({id:9700,name:"OORT MainnetDev",nativeCurrency:{decimals:18,name:"OORT",symbol:"OORT"},rpcUrls:{default:{http:["https://dev-rpc.oortech.com"]}},blockExplorers:{oort:{name:"OORT MainnetDev Explorer",url:"https://dev-scan.oortech.com"},default:{name:"OORT MainnetDev Explorer",url:"https://dev-scan.oortech.com"}}}),zie=ca({id:41144114,name:"Otim Devnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["http://devnet.otim.xyz"]}},contracts:{batchInvoker:{address:"0x5FbDB2315678afecb367f032d93F642f64180aa3"}}}),Hie=ca({id:11297108109,name:"Palm",nativeCurrency:{decimals:18,name:"PALM",symbol:"PALM"},rpcUrls:{default:{http:["https://palm-mainnet.public.blastapi.io"],webSocket:["wss://palm-mainnet.public.blastapi.io"]}},blockExplorers:{default:{name:"Chainlens",url:"https://palm.chainlens.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15429248}}}),Gie=ca({id:11297108099,name:"Palm Testnet",nativeCurrency:{decimals:18,name:"PALM",symbol:"PALM"},rpcUrls:{default:{http:["https://palm-mainnet.public.blastapi.io"],webSocket:["wss://palm-mainnet.public.blastapi.io"]}},blockExplorers:{default:{name:"Chainlens",url:"https://palm.chainlens.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15429248}},testnet:!0}),qie=ca({...qse,id:1612127,name:"PlayFi Albireo Testnet",network:"albireo",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://albireo-rpc.playfi.ai"],webSocket:["wss://albireo-rpc-ws.playfi.ai/ws"]}},blockExplorers:{default:{name:"PlayFi Albireo Explorer",url:"https://albireo-explorer.playfi.ai"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}},testnet:!0}),$ie=1,Vie=ca({id:424,network:"pgn",name:"PGN",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.publicgoods.network"]}},blockExplorers:{default:{name:"PGN Explorer",url:"https://explorer.publicgoods.network",apiUrl:"https://explorer.publicgoods.network/api"},blocksout:{name:"PGN Explorer",url:"https://explorer.publicgoods.network",apiUrl:"https://explorer.publicgoods.network/api"}},contracts:{l2OutputOracle:{[$ie]:{address:"0x9E6204F750cD866b299594e2aC9eA824E2e5f95c"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3380209},portal:{[$ie]:{address:"0xb26Fd985c5959bBB382BAFdD0b879E149e48116c"}},l1StandardBridge:{[$ie]:{address:"0xD0204B9527C1bA7bD765Fa5CCD9355d38338272b"}}},formatters:Vte,sourceId:1}),Wie=11155111,Zie=ca({id:58008,network:"pgn-testnet",name:"PGN ",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.publicgoods.network"]}},blockExplorers:{default:{name:"PGN Testnet Explorer",url:"https://explorer.sepolia.publicgoods.network",apiUrl:"https://explorer.sepolia.publicgoods.network/api"},blocksout:{name:"PGN Testnet Explorer",url:"https://explorer.sepolia.publicgoods.network",apiUrl:"https://explorer.sepolia.publicgoods.network/api"}},contracts:{l2OutputOracle:{[Wie]:{address:"0xD5bAc3152ffC25318F848B3DD5dA6C85171BaEEe"}},portal:{[Wie]:{address:"0xF04BdD5353Bb0EFF6CA60CfcC78594278eBfE179"}},l1StandardBridge:{[Wie]:{address:"0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3754925}},formatters:Vte,sourceId:Wie,testnet:!0}),Qie=ca({id:13381,name:"Phoenix Blockchain",nativeCurrency:{name:"Phoenix",symbol:"PHX",decimals:18},rpcUrls:{default:{http:["https://rpc.phoenixplorer.com"]}},blockExplorers:{default:{name:"Phoenixplorer",url:"https://phoenixplorer.com",apiUrl:"https://phoenixplorer.com/api"}},contracts:{multicall3:{address:"0x498cF757a575cFF2c2Ed9f532f56Efa797f86442",blockCreated:5620192}}}),Kie=ca({id:242,name:"Plinga",nativeCurrency:{name:"Plinga",symbol:"PLINGA",decimals:18},rpcUrls:{default:{http:["https://rpcurl.mainnet.plgchain.com"]}},blockExplorers:{default:{name:"Plgscan",url:"https://www.plgscan.com"}},contracts:{multicall3:{address:"0x0989576160f2e7092908BB9479631b901060b6e4",blockCreated:204489}}}),Yie=ca({id:161221135,name:"Plume Testnet",nativeCurrency:{name:"Plume Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://testnet-rpc.plumenetwork.xyz/http"],webSocket:["wss://testnet-rpc.plumenetwork.xyz/ws"]}},blockExplorers:{default:{name:"Blockscout",url:"https://testnet-explorer.plumenetwork.xyz",apiUrl:"https://testnet-explorer.plumenetwork.xyz/api"}},testnet:!0,sourceId:11155111}),Jie=ca({id:137,name:"Polygon",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),Xie=ca({id:80002,name:"Polygon Amoy",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://amoy.polygonscan.com/",apiUrl:"https://api-amoy.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3127388}},testnet:!0}),eae=ca({id:80001,name:"Polygon Mumbai",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/polygon_mumbai"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com",apiUrl:"https://api-testnet.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}},testnet:!0}),tae=ca({id:1101,name:"Polygon zkEVM",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://zkevm-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://zkevm.polygonscan.com",apiUrl:"https://api-zkevm.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:57746}}}),nae=ca({id:2442,name:"Polygon zkEVM Cardona",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.cardona.zkevm-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://cardona-zkevm.polygonscan.com",apiUrl:"https://cardona-zkevm.polygonscan.com/api"}},testnet:!0,contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:114091}}}),rae=ca({id:1442,name:"Polygon zkEVM Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.public.zkevm-test.net"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://testnet-zkevm.polygonscan.com",apiUrl:"https://testnet-zkevm.polygonscan.com/api"}},testnet:!0,contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:525686}}}),sae=ca({id:369,name:"PulseChain",nativeCurrency:{name:"Pulse",symbol:"PLS",decimals:18},testnet:!1,rpcUrls:{default:{http:["https://rpc.pulsechain.com"],webSocket:["wss://ws.pulsechain.com"]}},blockExplorers:{default:{name:"PulseScan",url:"https://scan.pulsechain.com",apiUrl:"https://api.scan.pulsechain.com/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),iae=ca({id:943,name:"PulseChain V4",testnet:!0,nativeCurrency:{name:"V4 Pulse",symbol:"v4PLS",decimals:18},rpcUrls:{default:{http:["https://rpc.v4.testnet.pulsechain.com"],webSocket:["wss://ws.v4.testnet.pulsechain.com"]}},blockExplorers:{default:{name:"PulseScan",url:"https://scan.v4.testnet.pulsechain.com",apiUrl:"https://scan.v4.testnet.pulsechain.com/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),aae=ca({id:35441,name:"Q Mainnet",nativeCurrency:{decimals:18,name:"Q",symbol:"Q"},rpcUrls:{default:{http:["https://rpc.q.org"]}},blockExplorers:{default:{name:"Q Mainnet Explorer",url:"https://explorer.q.org",apiUrl:"https://explorer.q.org/api"}}}),oae=ca({id:35443,name:"Q Testnet",nativeCurrency:{decimals:18,name:"Q",symbol:"Q"},rpcUrls:{default:{http:["https://rpc.qtestnet.org"]}},blockExplorers:{default:{name:"Q Testnet Explorer",url:"https://explorer.qtestnet.org",apiUrl:"https://explorer.qtestnet.org/api"}},testnet:!0}),cae=ca({id:1729,name:"Reya Network",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.reya.network"],webSocket:["wss://ws.reya.network"]}},blockExplorers:{default:{name:"Reya Network Explorer",url:"https://explorer.reya.network"}},testnet:!1}),lae=ca({id:570,name:"Rollux Mainnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc.rollux.com"],webSocket:["wss://rpc.rollux.com/wss"]}},blockExplorers:{default:{name:"RolluxExplorer",url:"https://explorer.rollux.com",apiUrl:"https://explorer.rollux.com/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:119222}}}),uae=ca({id:57e3,name:"Rollux Testnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc-tanenbaum.rollux.com/"],webSocket:["wss://rpc-tanenbaum.rollux.com/wss"]}},blockExplorers:{default:{name:"RolluxTestnetExplorer",url:"https://rollux.tanenbaum.io",apiUrl:"https://rollux.tanenbaum.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1813675}}}),dae=ca({id:2020,name:"Ronin",nativeCurrency:{name:"RON",symbol:"RON",decimals:18},rpcUrls:{default:{http:["https://api.roninchain.com/rpc"]}},blockExplorers:{default:{name:"Ronin Explorer",url:"https://app.roninchain.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:26023535}}}),hae=ca({id:30,name:"Rootstock Mainnet",network:"rootstock",nativeCurrency:{decimals:18,name:"Rootstock Bitcoin",symbol:"RBTC"},rpcUrls:{default:{http:["https://public-node.rsk.co"]}},blockExplorers:{default:{name:"RSK Explorer",url:"https://explorer.rsk.co"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:4249540}}}),pae=ca({id:31,name:"Rootstock Testnet",network:"rootstock",nativeCurrency:{decimals:18,name:"Rootstock Bitcoin",symbol:"tRBTC"},rpcUrls:{default:{http:["https://public-node.testnet.rsk.co"]}},blockExplorers:{default:{name:"RSK Explorer",url:"https://explorer.testnet.rootstock.io"}}}),fae=1,mae=ca({...Zte,id:12553,name:"RSS3 VSL Mainnet",nativeCurrency:{name:"RSS3",symbol:"RSS3",decimals:18},rpcUrls:{default:{http:["https://rpc.rss3.io"]}},blockExplorers:{default:{name:"RSS3 VSL Mainnet Scan",url:"https://scan.rss3.io",apiUrl:"https://scan.rss3.io/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[fae]:{address:"0xE6f24d2C32B3109B18ed33cF08eFb490b1e09C10"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14193},portal:{[fae]:{address:"0x6A12432491bbbE8d3babf75F759766774C778Db4",blockCreated:19387057}},l1StandardBridge:{[fae]:{address:"0x4cbab69108Aa72151EDa5A3c164eA86845f18438"}}},sourceId:1}),bae=11155111,gae=ca({...Zte,id:2331,name:"RSS3 VSL Sepolia Testnet",nativeCurrency:{name:"RSS3",symbol:"RSS3",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.rss3.io"]}},blockExplorers:{default:{name:"RSS3 VSL Sepolia Testnet Scan",url:"https://scan.testnet.rss3.io",apiUrl:"https://scan.testnet.rss3.io/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[bae]:{address:"0xDb5c46C3Eaa6Ed6aE8b2379785DF7dd029C0dC81"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:55697},portal:{[bae]:{address:"0xcBD77E8E1E7F06B25baDe67142cdE82652Da7b57",blockCreated:5345035}},l1StandardBridge:{[bae]:{address:"0xdDD29bb63B0839FB1cE0eE439Ff027738595D07B"}}},testnet:!0,sourceId:bae}),yae=ca({id:2021,name:"Saigon Testnet",nativeCurrency:{name:"RON",symbol:"RON",decimals:18},rpcUrls:{default:{http:["https://saigon-testnet.roninchain.com/rpc"]}},blockExplorers:{default:{name:"Saigon Explorer",url:"https://saigon-app.roninchain.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:18736871}},testnet:!0}),vae=ca({id:23294,name:"Oasis Sapphire",network:"sapphire",nativeCurrency:{name:"Sapphire Rose",symbol:"ROSE",decimals:18},rpcUrls:{default:{http:["https://sapphire.oasis.io"],webSocket:["wss://sapphire.oasis.io/ws"]}},blockExplorers:{default:{name:"Oasis Explorer",url:"https://explorer.oasis.io/mainnet/sapphire"},blockscout:{name:"Oasis Sapphire Explorer",url:"https://old-explorer.sapphire.oasis.io",apiUrl:"https://old-explorer.sapphire.oasis.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:734531}}}),wae=ca({id:23295,name:"Oasis Sapphire Testnet",network:"sapphire-testnet",nativeCurrency:{name:"Sapphire Test Rose",symbol:"TEST",decimals:18},rpcUrls:{default:{http:["https://testnet.sapphire.oasis.dev"],webSocket:["wss://testnet.sapphire.oasis.dev/ws"]}},blockExplorers:{default:{name:"Oasis Explorer",url:"https://explorer.oasis.io/testnet/sapphire"},blockscout:{name:"Oasis Sapphire Testnet Explorer",url:"https://testnet.old-explorer.sapphire.oasis.dev",apiUrl:"https://testnet.old-explorer.sapphire.oasis.dev/api"}},testnet:!0}),xae=ca({id:534352,name:"Scroll",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.scroll.io"],webSocket:["wss://wss-rpc.scroll.io/ws"]}},blockExplorers:{default:{name:"Scrollscan",url:"https://scrollscan.com",apiUrl:"https://api.scrollscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14}},testnet:!1}),kae=ca({id:534351,name:"Scroll Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rpc.scroll.io"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-blockscout.scroll.io",apiUrl:"https://sepolia-blockscout.scroll.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:9473}},testnet:!0}),Eae=ca({id:534353,name:"Scroll Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://alpha-rpc.scroll.io/l2"],webSocket:["wss://alpha-rpc.scroll.io/l2/ws"]}},blockExplorers:{default:{name:"Blockscout",url:"https://blockscout.scroll.io",apiUrl:"https://blockscout.scroll.io/api"}},testnet:!0}),Aae=ca({id:713715,name:"Sei Devnet",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc-arctic-1.sei-apis.com"]}},blockExplorers:{default:{name:"Seitrace",url:"https://seitrace.com"}},testnet:!0}),Cae=ca({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.sepolia.org"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",blockCreated:5317080}},testnet:!0}),Pae=ca({id:148,name:"Shimmer",network:"shimmer",nativeCurrency:{decimals:18,name:"Shimmer",symbol:"SMR"},rpcUrls:{default:{http:["https://json-rpc.evm.shimmer.network"]}},blockExplorers:{default:{name:"Shimmer Network Explorer",url:"https://explorer.evm.shimmer.network",apiUrl:"https://explorer.evm.shimmer.network/api"}}}),_ae=ca({id:1073,name:"Shimmer Testnet",network:"shimmer-testnet",nativeCurrency:{decimals:18,name:"Shimmer",symbol:"SMR"},rpcUrls:{default:{http:["https://json-rpc.evm.testnet.shimmer.network"]}},blockExplorers:{default:{name:"Shimmer Network Explorer",url:"https://explorer.evm.testnet.shimmer.network",apiUrl:"https://explorer.evm.testnet.shimmer.network/api"}},testnet:!0}),Sae=ca({id:391845894,name:"SKALE | Block Brawlers",nativeCurrency:{name:"BRAWL",symbol:"BRAWL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/frayed-decent-antares"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/frayed-decent-antares"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://frayed-decent-antares.explorer.mainnet.skalenodes.com"}},contracts:{}}),Iae=ca({id:1564830818,name:"SKALE | Calypso NFT Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/honorable-steel-rasalhague"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3107626}}}),Bae=ca({id:974399131,name:"SKALE Calypso Testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://testnet.skalenodes.com/v1/giant-half-dual-testnet"],webSocket:["wss://testnet.skalenodes.com/v1/ws/giant-half-dual-testnet"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://giant-half-dual-testnet.explorer.testnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:103220}},testnet:!0}),Tae=ca({id:1026062157,name:"SKALE | CryptoBlades",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/affectionate-immediate-pollux"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/affectionate-immediate-pollux"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://affectionate-immediate-pollux.explorer.mainnet.skalenodes.com"}},contracts:{}}),Mae=ca({id:1032942172,name:"SKALE | Crypto Colosseum",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/haunting-devoted-deneb"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/haunting-devoted-deneb"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://haunting-devoted-deneb.explorer.mainnet.skalenodes.com"}},contracts:{}}),Oae=ca({id:2046399126,name:"SKALE | Europa Liquidity Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/elated-tan-skat"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/elated-tan-skat"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://elated-tan-skat.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3113495}}}),Nae=ca({id:1444673419,name:"SKALE Europa Testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://testnet.skalenodes.com/v1/juicy-low-small-testnet"],webSocket:["wss://testnet.skalenodes.com/v1/ws/juicy-low-small-testnet"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://juicy-low-small-testnet.explorer.testnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:110858}},testnet:!0}),Rae=ca({id:2139927552,name:"SKALE | Exorde",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/light-vast-diphda"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/light-vast-diphda"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://light-vast-diphda.explorer.mainnet.skalenodes.com"}},contracts:{}}),Fae=ca({id:1273227453,name:"SKALE | Human Protocol",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/wan-red-ain"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/wan-red-ain"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://wan-red-ain.explorer.mainnet.skalenodes.com"}},contracts:{}}),jae=ca({id:1482601649,name:"SKALE | Nebula Gaming Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/green-giddy-denebola"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/green-giddy-denebola"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://green-giddy-denebola.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2372986}}}),Lae=ca({id:37084624,name:"SKALE Nebula Testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://testnet.skalenodes.com/v1/lanky-ill-funny-testnet"],webSocket:["wss://testnet.skalenodes.com/v1/ws/lanky-ill-funny-testnet"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://lanky-ill-funny-testnet.explorer.testnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:105141}},testnet:!0}),Uae=ca({id:278611351,name:"SKALE | Razor Network",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/turbulent-unique-scheat"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/turbulent-unique-scheat"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://turbulent-unique-scheat.explorer.mainnet.skalenodes.com"}},contracts:{}}),Dae=ca({id:1350216234,name:"SKALE | Titan Community Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/parallel-stormy-spica"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/parallel-stormy-spica"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://parallel-stormy-spica.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2076458}}}),zae=ca({id:1020352220,name:"SKALE Titan Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://testnet.skalenodes.com/v1/aware-fake-trim-testnet"],webSocket:["wss://testnet.skalenodes.com/v1/ws/aware-fake-trim-testnet"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://aware-fake-trim-testnet.explorer.testnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:104072}},testnet:!0}),Hae=ca({id:19,name:"Songbird Mainnet",nativeCurrency:{decimals:18,name:"songbird",symbol:"SGB"},rpcUrls:{default:{http:["https://songbird-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Songbird Explorer",url:"https://songbird-explorer.flare.network",apiUrl:"https://songbird-explorer.flare.network/api"}}}),Gae=ca({id:16,name:"Coston",nativeCurrency:{decimals:18,name:"costonflare",symbol:"CFLR"},rpcUrls:{default:{http:["https://coston-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Coston Explorer",url:"https://coston-explorer.flare.network",apiUrl:"https://coston-explorer.flare.network/api"}},testnet:!0}),qae=ca({id:88882,name:"Chiliz Spicy Testnet",network:"chiliz-spicy-Testnet",nativeCurrency:{decimals:18,name:"CHZ",symbol:"CHZ"},rpcUrls:{default:{http:["https://spicy-rpc.chiliz.com","https://chiliz-spicy-rpc.publicnode.com"],webSocket:["wss://spicy-rpc-ws.chiliz.com","wss://chiliz-spicy-rpc.publicnode.com"]}},blockExplorers:{default:{name:"Chiliz Explorer",url:"http://spicy-explorer.chiliz.com",apiUrl:"http://spicy-explorer.chiliz.com/api"}},testnet:!0}),$ae=ca({id:8082,name:"Shardeum Sphinx",nativeCurrency:{name:"SHARDEUM",symbol:"SHM",decimals:18},rpcUrls:{default:{http:["https://sphinx.shardeum.org"]}},blockExplorers:{default:{name:"Shardeum Explorer",url:"https://explorer-sphinx.shardeum.org"}},testnet:!0}),Vae=ca({id:109,name:"Shibarium",network:"shibarium",nativeCurrency:{name:"Bone",symbol:"BONE",decimals:18},rpcUrls:{default:{http:["https://rpc.shibrpc.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://shibariumscan.io"}},contracts:{multicall3:{address:"0x864Bf681ADD6052395188A89101A1B37d3B4C961",blockCreated:265900}}}),Wae=ca({id:105105,name:"Stratis Mainnet",network:"stratis",nativeCurrency:{name:"Stratis",symbol:"STRAX",decimals:18},rpcUrls:{default:{http:["https://rpc.stratisevm.com"]}},blockExplorers:{default:{name:"Stratis Explorer",url:"https://explorer.stratisevm.com"}}}),Zae=ca({id:57,name:"Syscoin Mainnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc.syscoin.org"],webSocket:["wss://rpc.syscoin.org/wss"]}},blockExplorers:{default:{name:"SyscoinExplorer",url:"https://explorer.syscoin.org",apiUrl:"https://explorer.syscoin.org/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:287139}}}),Qae=ca({id:5700,name:"Syscoin Tanenbaum Testnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc.tanenbaum.io"],webSocket:["wss://rpc.tanenbaum.io/wss"]}},blockExplorers:{default:{name:"SyscoinTestnetExplorer",url:"https://tanenbaum.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:271288}}}),Kae=ca({id:841,name:"Taraxa Mainnet",nativeCurrency:{name:"Tara",symbol:"TARA",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.taraxa.io"]}},blockExplorers:{default:{name:"Taraxa Explorer",url:"https://explorer.mainnet.taraxa.io"}}}),Yae=ca({id:167009,name:"Taiko Hekla L2",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.hekla.taiko.xyz"]}},blockExplorers:{default:{name:"Taikoscan",url:"https://hekla.taikoscan.network"}}}),Jae=ca({id:167007,name:"Taiko Jolnir (Alpha-5 Testnet)",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.jolnir.taiko.xyz"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.jolnir.taiko.xyz"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:732706}},testnet:!0}),Xae=ca({id:167008,name:"Taiko Katla (Alpha-6 Testnet)",network:"tko-katla",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.katla.taiko.xyz"]},public:{http:["https://rpc.katla.taiko.xyz"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.katla.taiko.xyz"}}}),eoe=ca({id:167005,name:"Taiko (Alpha-3 Testnet)",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.test.taiko.xyz"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.test.taiko.xyz"}}}),toe=ca({id:842,name:"Taraxa Testnet",nativeCurrency:{name:"Tara",symbol:"TARA",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.taraxa.io"]}},blockExplorers:{default:{name:"Taraxa Explorer",url:"https://explorer.testnet.taraxa.io"}},testnet:!0}),noe=ca({id:2017,name:"Telcoin Adiri Testnet",nativeCurrency:{name:"Telcoin",symbol:"TEL",decimals:18},rpcUrls:{default:{http:["https://rpc.telcoin.network"]}},blockExplorers:{default:{name:"telscan",url:"https://telscan.io"}},testnet:!0}),roe=ca({id:40,name:"Telos",nativeCurrency:{decimals:18,name:"Telos",symbol:"TLOS"},rpcUrls:{default:{http:["https://mainnet.telos.net/evm"]}},blockExplorers:{default:{name:"Teloscan",url:"https://www.teloscan.io/"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:246530709}}}),soe=ca({id:41,name:"Telos",nativeCurrency:{decimals:18,name:"Telos",symbol:"TLOS"},rpcUrls:{default:{http:["https://testnet.telos.net/evm"]}},blockExplorers:{default:{name:"Teloscan (testnet)",url:"https://testnet.teloscan.io/"}},testnet:!0}),ioe=ca({id:1559,name:"Tenet",network:"tenet-mainnet",nativeCurrency:{name:"TENET",symbol:"TENET",decimals:18},rpcUrls:{default:{http:["https://rpc.tenet.org"]}},blockExplorers:{default:{name:"TenetScan Mainnet",url:"https://tenetscan.io",apiUrl:"https://tenetscan.io/api"}},testnet:!1}),aoe=ca({id:7,name:"ThaiChain",nativeCurrency:{name:"TCH",symbol:"TCH",decimals:18},rpcUrls:{default:{http:["hhttps://rpc.thaichain.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://exp.thaichain.org",apiUrl:"https://exp.thaichain.org/api"}},contracts:{multicall3:{address:"0x0DaD6130e832c21719C5CE3bae93454E16A84826",blockCreated:4806386}},testnet:!1}),ooe=ca({id:997,name:"5ireChain Thunder Testnet",nativeCurrency:{name:"5ire Token",symbol:"5IRE",decimals:18},rpcUrls:{default:{http:["https://rpc-testnet.5ire.network"]}},blockExplorers:{default:{name:"5ireChain Explorer",url:"https://explorer.5ire.network"}},testnet:!0}),coe=ca({id:100009,name:"Vechain",nativeCurrency:{name:"VeChain",symbol:"VET",decimals:18},rpcUrls:{default:{http:["https://mainnet.vechain.org"]}},blockExplorers:{default:{name:"Vechain Explorer",url:"https://explore.vechain.org"},vechainStats:{name:"Vechain Stats",url:"https://vechainstats.com"}}}),loe=ca({id:888,name:"Wanchain",nativeCurrency:{name:"WANCHAIN",symbol:"WAN",decimals:18},rpcUrls:{default:{http:["https://gwan-ssl.wandevs.org:56891","https://gwan2-ssl.wandevs.org"]}},blockExplorers:{default:{name:"WanScan",url:"https://wanscan.org"}},contracts:{multicall3:{address:"0xcDF6A1566e78EB4594c86Fe73Fcdc82429e97fbB",blockCreated:25312390}}}),uoe=ca({id:999,name:"Wanchain Testnet",nativeCurrency:{name:"WANCHAIN",symbol:"WANt",decimals:18},rpcUrls:{default:{http:["https://gwan-ssl.wandevs.org:46891"]}},blockExplorers:{default:{name:"WanScanTest",url:"https://wanscan.org"}},contracts:{multicall3:{address:"0x11c89bF4496c39FB80535Ffb4c92715839CC5324",blockCreated:24743448}},testnet:!0}),doe=ca({id:1111,name:"WEMIX",network:"wemix-mainnet",nativeCurrency:{name:"WEMIX",symbol:"WEMIX",decimals:18},rpcUrls:{default:{http:["https://api.wemix.com"]},public:{http:["https://api.wemix.com"]}},blockExplorers:{default:{name:"wemixExplorer",url:"https://explorer.wemix.com"}}}),hoe=ca({id:1112,name:"WEMIX Testnet",network:"wemix-testnet",nativeCurrency:{name:"WEMIX",symbol:"tWEMIX",decimals:18},rpcUrls:{default:{http:["https://api.test.wemix.com"]},public:{http:["https://api.test.wemix.com"]}},blockExplorers:{default:{name:"wemixExplorer",url:"https://testnet.wemixscan.com",apiUrl:"https://testnet.wemixscan.com/api"}},testnet:!0}),poe=ca({id:195,name:"X1 Testnet",nativeCurrency:{decimals:18,name:"OKB",symbol:"OKB"},rpcUrls:{default:{http:["https://x1testrpc.okx.com"]}},blockExplorers:{default:{name:"OKLink",url:"https://www.oklink.com/x1-test"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:624344}},testnet:!0}),foe=ca({id:196,name:"X Layer Mainnet",nativeCurrency:{decimals:18,name:"OKB",symbol:"OKB"},rpcUrls:{default:{http:["https://rpc.xlayer.tech"]}},blockExplorers:{default:{name:"OKLink",url:"https://www.oklink.com/xlayer"}}}),moe=ca({id:50,name:"XinFin Network",nativeCurrency:{decimals:18,name:"XDC",symbol:"XDC"},rpcUrls:{default:{http:["https://rpc.xinfin.network"]}},blockExplorers:{xinfin:{name:"XinFin",url:"https://explorer.xinfin.network"},default:{name:"Blocksscan",url:"https://xdc.blocksscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:71542788}}}),boe=ca({id:51,name:"Apothem Network",nativeCurrency:{decimals:18,name:"TXDC",symbol:"TXDC"},rpcUrls:{default:{http:["https://erpc.apothem.network"]}},blockExplorers:{default:{name:"Blocksscan",url:"https://apothem.blocksscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:59765389}}}),goe=ca({id:50005,name:"Yooldo Verse",nativeCurrency:{name:"OAS",symbol:"OAS",decimals:18},rpcUrls:{default:{http:["https://rpc.yooldo-verse.xyz"]}},blockExplorers:{default:{name:"Yooldo Verse Explorer",url:"https://explorer.yooldo-verse.xyz"}}}),yoe=ca({id:50006,name:"Yooldo Verse Testnet",nativeCurrency:{name:"OAS",symbol:"OAS",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.yooldo-verse.xyz"]}},blockExplorers:{default:{name:"Yooldo Verse Testnet Explorer",url:"https://explorer.testnet.yooldo-verse.xyz"}},testnet:!0}),voe=ca({id:7e3,name:"ZetaChain",nativeCurrency:{decimals:18,name:"Zeta",symbol:"ZETA"},rpcUrls:{default:{http:["https://zetachain-evm.blockpi.network/v1/rpc/public"]}},blockExplorers:{default:{name:"ZetaScan",url:"https://explorer.zetachain.com"}},testnet:!1}),woe=ca({id:7001,name:"ZetaChain Athens Testnet",nativeCurrency:{decimals:18,name:"Zeta",symbol:"aZETA"},rpcUrls:{default:{http:["https://zetachain-athens-evm.blockpi.network/v1/rpc/public"]}},blockExplorers:{default:{name:"ZetaScan",url:"https://athens.explorer.zetachain.com"}},testnet:!0}),xoe=ca({id:1337803,name:"Zhejiang",nativeCurrency:{name:"Zhejiang Ether",symbol:"ZhejETH",decimals:18},rpcUrls:{default:{http:["https://rpc.zhejiang.ethpandaops.io"]}},blockExplorers:{default:{name:"Beaconchain",url:"https://zhejiang.beaconcha.in"}},testnet:!0}),koe=ca({id:32769,name:"Zilliqa",network:"zilliqa",nativeCurrency:{name:"Zilliqa",symbol:"ZIL",decimals:18},rpcUrls:{default:{http:["https://api.zilliqa.com"]}},blockExplorers:{default:{name:"Ethernal",url:"https://evmx.zilliqa.com"}},testnet:!1}),Eoe=ca({id:33101,name:"Zilliqa Testnet",network:"zilliqa-testnet",nativeCurrency:{name:"Zilliqa",symbol:"ZIL",decimals:18},rpcUrls:{default:{http:["https://dev-api.zilliqa.com"]}},blockExplorers:{default:{name:"Ethernal",url:"https://evmx.testnet.zilliqa.com"}},testnet:!0}),Aoe=ca({id:42766,name:"ZKFair Mainnet",network:"zkfair-mainnet",nativeCurrency:{decimals:18,name:"USD Coin",symbol:"USDC"},rpcUrls:{default:{http:["https://rpc.zkfair.io"]},public:{http:["https://rpc.zkfair.io"]}},blockExplorers:{default:{name:"zkFair Explorer",url:"https://scan.zkfair.io",apiUrl:"https://scan.zkfair.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6090959}},testnet:!1}),Coe=ca({id:43851,name:"ZKFair Testnet",network:"zkfair-testnet",nativeCurrency:{decimals:18,name:"USD Coin",symbol:"USDC"},rpcUrls:{default:{http:["https://testnet-rpc.zkfair.io"]},public:{http:["https://testnet-rpc.zkfair.io"]}},blockExplorers:{default:{name:"zkFair Explorer",url:"https://testnet-scan.zkfair.io"}},testnet:!0}),Poe=ca({...qse,id:324,name:"zkSync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://era.zksync.network/",apiUrl:"https://api-era.zksync.network/api"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}}}),_oe=ca({...qse,id:260,name:"zkSync InMemory Node",network:"zksync-in-memory-node",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:8011"]}},testnet:!0}),Soe=ca({...qse,id:270,name:"zkSync CLI Local Node",network:"zksync-cli-local-node",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["http://localhost:3050"]}},testnet:!0}),Ioe=ca({...qse,id:300,name:"zkSync Sepolia Testnet",network:"zksync-sepolia-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.era.zksync.dev"],webSocket:["wss://sepolia.era.zksync.dev/ws"]}},blockExplorers:{default:{name:"zkExplorer",url:"https://sepolia.explorer.zksync.io/"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}},testnet:!0}),Boe=ca({...qse,id:280,name:"zkSync Era Testnet",network:"zksync-era-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://testnet.era.zksync.dev"],webSocket:["wss://testnet.era.zksync.dev/ws"]}},blockExplorers:{default:{name:"zkExplorer",url:"https://goerli.explorer.zksync.io"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}},testnet:!0}),Toe=1,Moe=ca({...Zte,id:7777777,name:"Zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy",apiUrl:"https://explorer.zora.energy/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[Toe]:{address:"0x9E6204F750cD866b299594e2aC9eA824E2e5f95c"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:5882},portal:{[Toe]:{address:"0x1a0ad011913A150f69f6A19DF447A0CfD9551054"}},l1StandardBridge:{[Toe]:{address:"0x3e2Ea9B92B7E48A52296fD261dc26fd995284631"}}},sourceId:1}),Ooe=11155111,Noe=ca({...Zte,id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/",apiUrl:"https://sepolia.explorer.zora.energy/api"}},contracts:{...Zte.contracts,l2OutputOracle:{[Ooe]:{address:"0x2615B481Bd3E5A1C0C7Ca3Da1bdc663E8615Ade9"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:83160},portal:{[Ooe]:{address:"0xeffE2C6cA9Ab797D418f0D91eA60807713f3536f"}},l1StandardBridge:{[Ooe]:{address:"0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB"}}},sourceId:Ooe,testnet:!0}),Roe=5,Foe=ca({...Zte,id:999,name:"Zora Goerli Testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy",apiUrl:"https://testnet.explorer.zora.energy/api"}},contracts:{...Zte.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:189123},portal:{[Roe]:{address:"0xDb9F51790365e7dc196e7D072728df39Be958ACe"}}},sourceId:5,testnet:!0});var joe=Object.freeze({__proto__:null,acala:$te,ancient8:Kte,ancient8Sepolia:Jte,anvil:Xte,apexTestnet:ene,arbitrum:tne,arbitrumGoerli:nne,arbitrumNova:rne,arbitrumSepolia:one,areonNetwork:cne,areonNetworkTestnet:lne,astar:sne,astarZkEVM:ine,astarZkyoto:ane,aurora:une,auroraTestnet:dne,auroria:hne,avalanche:pne,avalancheFuji:fne,bahamut:mne,base:gne,baseGoerli:vne,baseSepolia:xne,beam:kne,beamTestnet:Ene,bearNetworkChainMainnet:Ane,bearNetworkChainTestnet:Cne,berachainTestnet:Pne,bevmMainnet:_ne,bitTorrent:Sne,bitTorrentTestnet:Ine,blast:Bne,blastSepolia:Tne,bob:Mne,boba:One,bronos:Nne,bronosTestnet:Rne,bsc:Fne,bscGreenfield:Lne,bscTestnet:jne,btr:Une,btrTestnet:Dne,bxn:zne,bxnTestnet:Hne,canto:Gne,celo:ere,celoAlfajores:tre,chiliz:nre,classic:rre,confluxESpace:sre,confluxESpaceTestnet:ire,coreDao:are,cronos:ore,cronosTestnet:cre,crossbell:lre,cyber:ure,cyberTestnet:dre,darwinia:hre,defichainEvm:pre,defichainEvmTestnet:fre,degen:mre,dfk:bre,dodochainTestnet:gre,dogechain:yre,dreyerxMainnet:vre,edgeless:wre,edgelessTestnet:xre,edgeware:kre,edgewareTestnet:Ere,ekta:Bre,ektaTestnet:Tre,eon:Are,eos:Cre,eosTestnet:Pre,etherlinkTestnet:_re,evmos:Sre,evmosTestnet:Ire,fantom:Mre,fantomSonicTestnet:Ore,fantomTestnet:Nre,fibo:Rre,filecoin:Fre,filecoinCalibration:jre,filecoinHyperspace:Lre,flare:Ure,flareTestnet:Dre,flowMainnet:Hre,flowPreviewnet:zre,flowTestnet:Gre,foundry:qre,fraxtal:Vre,fraxtalTestnet:Zre,funkiSepolia:Qre,fuse:Kre,fuseSparknet:Yre,gnosis:ise,gnosisChiado:ase,gobi:rse,goerli:sse,haqqMainnet:lse,haqqTestedge2:use,hardhat:ose,harmonyOne:cse,hedera:dse,hederaPreviewnet:pse,hederaTestnet:hse,holesky:fse,immutableZkEvm:mse,immutableZkEvmTestnet:bse,inEVM:gse,iotex:Jre,iotexTestnet:Xre,jbc:ese,jbcTestnet:tse,kakarotSepolia:yse,karura:nse,kava:vse,kavaTestnet:wse,kcc:xse,klaytn:kse,klaytnBaobab:Ese,kroma:Ase,kromaSepolia:Cse,l3x:Pse,l3xTestnet:_se,lightlinkPegasus:Sse,lightlinkPhoenix:Ise,linea:Bse,lineaGoerli:Tse,lineaSepolia:Mse,lineaTestnet:Ose,lisk:$se,liskSepolia:Wse,localhost:Zse,lukso:Qse,luksoTestnet:Kse,mainnet:Yse,mandala:Jse,manta:Xse,mantaSepoliaTestnet:eie,mantaTestnet:tie,mantle:nie,mantleSepoliaTestnet:rie,mantleTestnet:sie,merlin:iie,metachain:aie,metachainIstanbul:oie,metalL2:lie,meter:uie,meterTestnet:die,metis:hie,metisGoerli:pie,mev:fie,mevTestnet:mie,mintSepoliaTestnet:bie,mode:gie,modeTestnet:yie,moonbaseAlpha:vie,moonbeam:wie,moonbeamDev:xie,moonriver:kie,morphSepolia:Eie,nautilus:Aie,neonDevnet:Cie,neonMainnet:Pie,nexi:_ie,nexilix:Sie,oasisTestnet:Bie,oasys:Iie,okc:Tie,oortMainnetDev:Die,opBNB:Lie,opBNBTestnet:Uie,optimism:Oie,optimismGoerli:Rie,optimismSepolia:jie,otimDevnet:zie,palm:Hie,palmTestnet:Gie,pgn:Vie,pgnTestnet:Zie,phoenix:Qie,playfiAlbireo:qie,plinga:Kie,plumeTestnet:Yie,polygon:Jie,polygonAmoy:Xie,polygonMumbai:eae,polygonZkEvm:tae,polygonZkEvmCardona:nae,polygonZkEvmTestnet:rae,pulsechain:sae,pulsechainV4:iae,qMainnet:aae,qTestnet:oae,reyaNetwork:cae,rollux:lae,rolluxTestnet:uae,ronin:dae,rootstock:hae,rootstockTestnet:pae,rss3:mae,rss3Sepolia:gae,saigon:yae,sapphire:vae,sapphireTestnet:wae,scroll:xae,scrollSepolia:kae,scrollTestnet:Eae,seiDevnet:Aae,sepolia:Cae,shardeumSphinx:$ae,shibarium:Vae,shimmer:Pae,shimmerTestnet:_ae,skaleBlockBrawlers:Sae,skaleCalypso:Iae,skaleCalypsoTestnet:Bae,skaleCryptoBlades:Tae,skaleCryptoColosseum:Mae,skaleEuropa:Oae,skaleEuropaTestnet:Nae,skaleExorde:Rae,skaleHumanProtocol:Fae,skaleNebula:jae,skaleNebulaTestnet:Lae,skaleRazor:Uae,skaleTitan:Dae,skaleTitanTestnet:zae,songbird:Hae,songbirdTestnet:Gae,spicy:qae,stratis:Wae,syscoin:Zae,syscoinTestnet:Qae,taikoHekla:Yae,taikoJolnir:Jae,taikoKatla:Xae,taikoTestnetSepolia:eoe,taraxa:Kae,taraxaTestnet:toe,telcoinTestnet:noe,telos:roe,telosTestnet:soe,tenet:ioe,thaiChain:aoe,thunderTestnet:ooe,vechain:coe,wanchain:loe,wanchainTestnet:uoe,wemix:doe,wemixTestnet:hoe,x1Testnet:poe,xLayer:foe,xLayerTestnet:poe,xdc:moe,xdcTestnet:boe,yooldoVerse:goe,yooldoVerseTestnet:yoe,zetachain:voe,zetachainAthensTestnet:woe,zhejiang:xoe,zilliqa:koe,zilliqaTestnet:Eoe,zkFair:Aoe,zkFairTestnet:Coe,zkSync:Poe,zkSyncInMemoryNode:_oe,zkSyncLocalNode:Soe,zkSyncSepoliaTestnet:Ioe,zkSyncTestnet:Boe,zora:Moe,zoraSepolia:Noe,zoraTestnet:Foe});class Loe extends Error{constructor(e,t={}){super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"viem@2.12.0"});const n=t.cause instanceof Loe?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof Loe&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://viem.sh${r}${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join("\n"),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return Uoe(this,e)}}function Uoe(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?Uoe(e.cause,t):t?null:e}class Doe extends Loe{constructor({max:e,min:t,signed:n,size:r,value:s}){super(`Number "${s}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class zoe extends Loe{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}}class Hoe extends Loe{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}function Goe(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function qoe(e){return Goe(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function $oe(e,{dir:t="left"}={}){let n="string"==typeof e?e.replace("0x",""):e,r=0;for(let e=0;en)throw new Woe({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s2*n)throw new Woe({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}const Yoe=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Joe(e,t={}){return"number"==typeof e||"bigint"==typeof e?tce(e,t):"string"==typeof e?rce(e,t):"boolean"==typeof e?Xoe(e,t):ece(e,t)}function Xoe(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(uce(n,{size:t.size}),Qoe(n,{size:t.size})):n}function ece(e,t={}){let n="";for(let t=0;ti||s=ace.zero&&e<=ace.nine?e-ace.zero:e>=ace.A&&e<=ace.F?e-(ace.A-10):e>=ace.a&&e<=ace.f?e-(ace.a-10):void 0}function cce(e,t={}){let n=e;t.size&&(uce(n,{size:t.size}),n=Qoe(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,i=new Uint8Array(s);for(let e=0,t=0;et)throw new Hoe({givenSize:qoe(e),maxSize:t})}function dce(e,t={}){const{signed:n}=t;t.size&&uce(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2;return r<=(1n<<8n*BigInt(s)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*s,"f")}`)-1n}function hce(e,t={}){return Number(dce(e,t))}function pce(e,t){return({exclude:n,format:r})=>({exclude:n,format:e=>{const s=t(e);if(n)for(const e of n)delete s[e];return{...s,...r(e)}},type:e})}class fce extends Loe{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}class mce extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}set(e,t){return super.set(e,t),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}function bce(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function gce(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function yce(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function vce(e,t){gce(e);const n=t.outputLen;if(e.length>xce&wce)}:{h:0|Number(e>>xce&wce),l:0|Number(e&wce)}}function Ece(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;se instanceof Uint8Array,Cce=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Pce=(e,t)=>e<<32-t|e>>>t;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function _ce(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!Ace(e))throw new Error("expected Uint8Array, got "+typeof e);return e}let Sce=class{clone(){return this._cloneInto()}};function Ice(e){const t=t=>e().update(_ce(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const[Bce,Tce,Mce]=[[],[],[]],Oce=BigInt(0),Nce=BigInt(1),Rce=BigInt(2),Fce=BigInt(7),jce=BigInt(256),Lce=BigInt(113);for(let e=0,t=Nce,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Bce.push(2*(5*r+n)),Tce.push((e+1)*(e+2)/2%64);let s=Oce;for(let e=0;e<7;e++)t=(t<>Fce)*Lce)%jce,t&Rce&&(s^=Nce<<(Nce<n>32?((e,t,n)=>t<>>64-n)(e,t,n):((e,t,n)=>e<>>32-n)(e,t,n),Hce=(e,t,n)=>n>32?((e,t,n)=>e<>>64-n) /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */(e,t,n):((e,t,n)=>t<>>32-n)(e,t,n);let Gce=class e extends Sce{constructor(e,t,n,r=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,bce(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}keccak(){!function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,s=(t+2)%10,i=n[s],a=n[s+1],o=zce(i,a,1)^n[r],c=Hce(i,a,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=c}let t=e[2],s=e[3];for(let n=0;n<24;n++){const r=Tce[n],i=zce(t,s,r),a=Hce(t,s,r),o=Bce[n];t=e[o],s=e[o+1],e[o]=i,e[o+1]=a}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=Uce[r],e[1]^=Dce[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){yce(this);const{blockLen:t,state:n}=this,r=(e=_ce(e)).length;for(let s=0;s=n&&this.keccak();const i=Math.min(n-this.posOut,s-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return bce(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(vce(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:a}=this;return t||(t=new e(n,r,s,a,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=s,t.enableXOF=a,t.destroyed=this.destroyed,t}};const qce=((e,t,n)=>Ice((()=>new Gce(t,e,n))))(1,136,32);function $ce(e,t){const n=t||"hex",r=qce(Goe(e,{strict:!1})?ice(e):e);return"bytes"===n?r:Joe(r)}const Vce=new mce(8192);function Wce(e,t){if(Vce.has(`${e}.${t}`))return Vce.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=$ce(lce(n),"bytes"),s=n.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&s[e]&&(s[e]=s[e].toUpperCase()),(15&r[e>>1])>=8&&s[e+1]&&(s[e+1]=s[e+1].toUpperCase());const i=`0x${s.join("")}`;return Vce.set(`${e}.${t}`,i),i}const Zce=/^0x[a-fA-F0-9]{40}$/,Qce=new mce(8192);function Kce(e,t){const{strict:n=!0}=t??{};if(Qce.has(e))return Qce.get(e);const r=!(!Zce.test(e)||e.toLowerCase()!==e&&n&&Wce(e)!==e);return Qce.set(e,r),r}function Yce(e){return"string"==typeof e[0]?Jce(e):function(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(e)}function Jce(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}class Xce extends Loe{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class ele extends Loe{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class tle extends Loe{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}const nle={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new tle({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new ele({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Xce({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Xce({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function rle(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(nle);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}const sle={gwei:9,wei:18},ile={ether:-9,wei:9};function ale(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${i?`.${i}`:""}`}function ole(e,t="wei"){return ale(e,ile[t])}function cle(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),n=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`)).join("\n")}class lle extends Loe{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class ule extends Loe{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class dle extends Loe{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",cle(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class hle extends Loe{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}}class ple extends Loe{constructor({blockNumber:e,chain:t,contract:n}){super(`Chain "${t.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class fle extends Loe{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class mle extends Loe{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}class ble extends Loe{constructor({cause:e,message:t}={}){const n=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(ble,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(ble,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class gle extends Loe{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${ole(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(gle,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class yle extends Loe{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${ole(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(yle,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class vle extends Loe{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(vle,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class wle extends Loe{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(wle,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class xle extends Loe{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(xle,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class kle extends Loe{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(kle,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class Ele extends Loe{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(Ele,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Ale extends Loe{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(Ale,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Cle extends Loe{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Cle,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Ple extends Loe{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${ole(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${ole(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(Ple,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class _le extends Loe{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}function Sle(e,t,n,{strict:r}={}){return Goe(e,{strict:!1})?function(e,t,n,{strict:r}={}){Ile(e,t);const s=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;r&&Ble(s,t,n);return s}(e,t,n,{strict:r}):Tle(e,t,n,{strict:r})}function Ile(e,t){if("number"==typeof t&&t>0&&t>qoe(e)-1)throw new Voe({offset:t,position:"start",size:qoe(e)})}function Ble(e,t,n){if("number"==typeof t&&"number"==typeof n&&qoe(e)!==n-t)throw new Voe({offset:n,position:"end",size:qoe(e)})}function Tle(e,t,n,{strict:r}={}){Ile(e,t);const s=e.slice(t,n);return r&&Ble(s,t,n),s}const Mle={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function Ole(e){const t={};return void 0!==e.accessList&&(t.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?t.blobs=e.blobs.map((e=>ece(e))):t.blobs=e.blobs),void 0!==e.data&&(t.data=e.data),void 0!==e.from&&(t.from=e.from),void 0!==e.gas&&(t.gas=tce(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=tce(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=tce(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=tce(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=tce(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=tce(e.nonce)),void 0!==e.to&&(t.to=e.to),void 0!==e.type&&(t.type=Mle[e.type]),void 0!==e.value&&(t.value=tce(e.value)),t}function Nle(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const Rle={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function Fle(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?hce(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?hce(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Rle[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof t.v){if(0n===t.v||27n===t.v)return 0;if(1n===t.v||28n===t.v)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),"eip2930"===t.type&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip1559"===t.type&&delete t.maxFeePerBlobGas,t}const jle=pce("transaction",Fle);function Lle(e){const t=e.transactions?.map((e=>"string"==typeof e?e:Fle(e)));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Ule=pce("block",Lle);const Dle={"0x0":"reverted","0x1":"success"};function zle(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map((e=>function(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?hce(e.transactionIndex):null,status:e.status?Dle[e.status]:null,type:e.type?Rle[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const Hle=pce("transactionReceipt",zle),Gle={block:Ule({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=Fle(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?dce(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:jle({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?dce(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:Hle({format:e=>({l1GasPrice:e.l1GasPrice?dce(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?dce(e.l1GasUsed):null,l1Fee:e.l1Fee?dce(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})};function qle(e,t="hex"){const n=$le(e),r=rle(new Uint8Array(n.length));return n.encode(r),"hex"===t?ece(r.bytes):r.bytes}function $le(e){return Array.isArray(e)?function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=Vle(t);return{length:t<=55?1+t:1+n+t,encode(r){t<=55?r.pushByte(192+t):(r.pushByte(247+n),1===n?r.pushUint8(t):2===n?r.pushUint16(t):3===n?r.pushUint24(t):r.pushUint32(t));for(const{encode:t}of e)t(r)}}}(e.map((e=>$le(e)))):function(e){const t="string"==typeof e?cce(e):e,n=Vle(t.length),r=1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length;return{length:r,encode(e){1===t.length&&t[0]<128?e.pushBytes(t):t.length<=55?(e.pushByte(128+t.length),e.pushBytes(t)):(e.pushByte(183+n),1===n?e.pushUint8(t.length):2===n?e.pushUint16(t.length):3===n?e.pushUint24(t.length):e.pushUint32(t.length),e.pushBytes(t))}}}(e)}function Vle(e){if(e<256)return 1;if(e<65536)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new Loe("Length is too large.")}function Wle(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>cce(e))):e.blobs,s=[];for(const e of r)s.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?s:s.map((e=>ece(e)))}function Zle(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>cce(e))):e.blobs,s="string"==typeof e.commitments[0]?e.commitments.map((e=>cce(e))):e.commitments,i=[];for(let e=0;eece(e)))}class Qle extends Sce{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Cce(this.buffer)}update(e){yce(this);const{view:t,buffer:n,blockLen:r}=this,s=(e=_ce(e)).length;for(let i=0;ir-i&&(this.process(n,0),i=0);for(let e=i;e>s&i),o=Number(n&i),c=r?4:0,l=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),s),this.process(n,0);const a=Cce(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;ee&t^~e&n,Yle=(e,t,n)=>e&t^e&n^t&n,Jle=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Xle=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),eue=new Uint32Array(64);let tue=class extends Qle{constructor(){super(64,32,8,!1),this.A=0|Xle[0],this.B=0|Xle[1],this.C=0|Xle[2],this.D=0|Xle[3],this.E=0|Xle[4],this.F=0|Xle[5],this.G=0|Xle[6],this.H=0|Xle[7]}get(){const{A:e,B:t,C:n,D:r,E:s,F:i,G:a,H:o}=this;return[e,t,n,r,s,i,a,o]}set(e,t,n,r,s,i,a,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|s,this.F=0|i,this.G=0|a,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)eue[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=eue[e-15],n=eue[e-2],r=Pce(t,7)^Pce(t,18)^t>>>3,s=Pce(n,17)^Pce(n,19)^n>>>10;eue[e]=s+eue[e-7]+r+eue[e-16]|0}let{A:n,B:r,C:s,D:i,E:a,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(Pce(a,6)^Pce(a,11)^Pce(a,25))+Kle(a,o,c)+Jle[e]+eue[e]|0,u=(Pce(n,2)^Pce(n,13)^Pce(n,22))+Yle(n,r,s)|0;l=c,c=o,o=a,a=i+t|0,i=s,s=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,s=s+this.C|0,i=i+this.D|0,a=a+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,s,i,a,o,c,l)}roundClean(){eue.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const nue=Ice((()=>new tue));function rue(e){const{commitment:t,version:n=1}=e,r=e.to??("string"==typeof t?"hex":"bytes"),s=nue(Goe(i=t,{strict:!1})?ice(i):i);var i;return s.set([n],0),"bytes"===r?s:ece(s)}const sue=32,iue=4096,aue=sue*iue,oue=6*aue-1-1*iue*6,cue=1;class lue extends Loe{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class uue extends Loe{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class due extends Loe{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}}class hue extends Loe{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${cue}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}function pue(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??function(e){const t=e.to??("string"==typeof e.data?"hex":"bytes"),n="string"==typeof e.data?cce(e.data):e.data,r=qoe(n);if(!r)throw new uue;if(r>oue)throw new lue({maxSize:oue,size:r});const s=[];let i=!0,a=0;for(;i;){const e=rle(new Uint8Array(aue));let t=0;for(;te.bytes)):s.map((e=>ece(e.bytes)))}({data:t,to:r}),i=e.commitments??Wle({blobs:s,kzg:n,to:r}),a=e.proofs??Zle({blobs:s,commitments:i,kzg:n,to:r}),o=[];for(let e=0;e2n**256n-1n)throw new gle({maxFeePerGas:r});if(n&&r&&n>r)throw new Ple({maxFeePerGas:r,maxPriorityFeePerGas:n})}function mue(e){if(!e||0===e.length)return[];const t=[];for(let n=0;n2n**256n-1n)throw new gle({maxFeePerGas:r})}(e);const u=mue(c),d=[Joe(n),i?Joe(i):"0x",l?Joe(l):"0x",r?Joe(r):"0x",a??"0x",o?Joe(o):"0x",s??"0x",u,...gue(e,t)];return Jce(["0x01",qle(d)])}(e,t):"eip4844"===n?function(e,t){const{chainId:n,gas:r,nonce:s,to:i,value:a,maxFeePerBlobGas:o,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;!function(e){const{blobVersionedHashes:t}=e;if(t){if(0===t.length)throw new uue;for(const e of t){const t=qoe(e),n=hce(Sle(e,0,1));if(32!==t)throw new due({hash:e,size:t});if(n!==cue)throw new hue({hash:e,version:n})}}fue(e)}(e);let h=e.blobVersionedHashes,p=e.sidecars;if(e.blobs&&(void 0===h||void 0===p)){const t="string"==typeof e.blobs[0]?e.blobs:e.blobs.map((e=>ece(e))),n=e.kzg,r=Wle({blobs:t,kzg:n});if(void 0===h&&(h=function(e){const{commitments:t,version:n}=e,r=e.to??("string"==typeof t[0]?"hex":"bytes"),s=[];for(const e of t)s.push(rue({commitment:e,to:r,version:n}));return s}({commitments:r})),void 0===p){p=pue({blobs:t,commitments:r,proofs:Zle({blobs:t,commitments:r,kzg:n})})}}const f=mue(u),m=[Joe(n),s?Joe(s):"0x",l?Joe(l):"0x",c?Joe(c):"0x",r?Joe(r):"0x",i??"0x",a?Joe(a):"0x",d??"0x",f,o?Joe(o):"0x",h??[],...gue(e,t)],b=[],g=[],y=[];if(p)for(let e=0;e2n**256n-1n)throw new gle({maxFeePerGas:r});if(a)throw new Loe("`accessList` is not a valid Legacy Transaction attribute.")}(e);let l=[i?Joe(i):"0x",c?Joe(c):"0x",r?Joe(r):"0x",a??"0x",o?Joe(o):"0x",s??"0x"];if(t){const e=(()=>{if(t.v>=35n){return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n)}if(n>0)return BigInt(2*n)+BigInt(35n+t.v-27n);const e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new ule({v:t.v});return e})();l=[...l,Joe(e),t.r,t.s]}else n>0&&(l=[...l,Joe(n),"0x","0x"]);return qle(l)}(e,t)}function gue(e,t){const{r:n,s:r,v:s,yParity:i}=t??e;if(void 0===n)return[];if(void 0===r)return[];if(void 0===s&&void 0===i)return[];return["number"==typeof i?i?Joe(1):"0x":0n===s?"0x":1n===s?Joe(1):27n===s?"0x":Joe(1),$oe(n),$oe(r)]}const yue={transaction:function(e,t){return function(e){return"deposit"===e.type||void 0!==e.sourceHash}(e)?function(e){!function(e){const{from:t,to:n}=e;if(t&&!Kce(t))throw new fce({address:t});if(n&&!Kce(n))throw new fce({address:n})}(e);const{sourceHash:t,data:n,from:r,gas:s,isSystemTx:i,mint:a,to:o,value:c}=e,l=[t,r,o??"0x",a?Joe(a):"0x",c?Joe(c):"0x",s?Joe(s):"0x",i?"0x1":"0x",n??"0x"];return Jce(["0x7e",qle(l)])}(e):bue(e,t)}};const vue={contracts:{gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters:Gle,serializers:yue};Nle({id:60808,name:"BOB",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.gobob.xyz"],webSocket:["wss://rpc.gobob.xyz"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.gobob.xyz"}},contracts:{multicall3:{address:"0x63f8279bccDb75c0F38e0CD6B6A0c72a0a760FF9",blockCreated:457045}},testnet:!1}),Nle({id:53457,name:"DODOchain Testnet",nativeCurrency:{decimals:18,name:"DODO",symbol:"DODO"},rpcUrls:{default:{http:["https://dodochain-testnet.alt.technology"],webSocket:["wss://dodochain-testnet.alt.technology/ws"]}},blockExplorers:{default:{name:"DODOchain Testnet (Sepolia) Explorer",url:"https://testnet-scan.dodochain.com"}},testnet:!0});Nle({...vue,id:3397901,network:"funkiSepolia",name:"Funki Sepolia Sandbox",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://funki-testnet.alt.technology"]}},blockExplorers:{default:{name:"Funki Sepolia Sandbox Explorer",url:"https://sepolia-sandbox.funkichain.com/"}},testnet:!0,contracts:{...vue.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1620204}},sourceId:11155111});const wue=Nle({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),xue=Nle({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.sepolia.org"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",blockCreated:5317080}},testnet:!0});var kue=Object.freeze({__proto__:null,mainnet:wue,sepolia:xue});function Eue(e,t="wei"){return ale(e,sle[t])}var Aue="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const Cue=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Pue=4;function _ue(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,i=[0,1];for(let e=1;e>--c&1}const d=2**31,h=d>>>1,p=h>>1,f=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|u();let b=[],g=0,y=d;for(;;){let e=Math.floor(((m-g+1)*s-1)/y),t=0,n=r;for(;n-t>1;){let r=t+n>>>1;e>>1|u(),a=a<<1^h,o=(o^h)<<1|h|1;g=a,y=1+o-a}let v=r-4;return b.map((t=>{switch(t-v){case 3:return v+65792+(e[o++]<<16|e[o++]<<8|e[o++]);case 2:return v+256+(e[o++]<<8|e[o++]);case 1:return v+e[o++];default:return t-1}}))}(function(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((e,n)=>t[e.charCodeAt(0)]=n));let n=e.length,r=new Uint8Array(6*n>>3);for(let s=0,i=0,a=0,o=0;s=8&&(r[i++]=o>>(a-=8));return r}(e)))}function Sue(e){return 1&e?~e>>1:e>>1}function Iue(e,t){let n=Array(e);for(let r=0,s=0;r{let t=Bue(e);if(t.length)return t}))}function Mue(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(Rue(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(Fue(n,e))}return t.flat()}function Oue(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function Nue(e,t,n){let r=Array(e).fill().map((()=>[]));for(let s=0;sr[t].push(e)));return r}function Rue(e,t){let n=1+t(),r=t(),s=Oue(t);return Nue(s.length,1+e,t).flatMap(((e,t)=>{let[i,...a]=e;return Array(s[t]).fill().map(((e,t)=>{let s=t*r;return[i+t*n,a.map((e=>e+s))]}))}))}function Fue(e,t){return Nue(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}function jue(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function Lue(e){let t=e.length;if(t<4096)return String.fromCodePoint(...e);let n=[];for(let r=0;r>24&255}function Jue(e){return 16777215&e}let Xue,ede,tde,nde;function rde(e){return e>=zue&&e=Hue&&e=Gue&&tque&&te.map((e=>[e,t+1<<24]))))),ede=new Set(Bue(e)),tde=new Map,nde=new Map;for(let[t,n]of Mue(e)){if(!ede.has(t)&&2==n.length){let[e,r]=n,s=nde.get(e);s||(s=new Map,nde.set(e,s)),s.set(r,t)}tde.set(t,n.reverse())}}();let t=[],n=[],r=!1;function s(e){let n=Xue.get(e);n&&(r=!0,e|=n),t.push(e)}for(let r of e)for(;;){if(r<128)t.push(r);else if(rde(r)){let e=r-zue,t=e%Vue/$ue|0,n=e%$ue;s(Hue+(e/Vue|0)),s(Gue+t),n>0&&s(que+n)}else{let e=tde.get(r);e?n.push(...e):s(r)}if(!n.length)break;r=n.pop()}if(r&&t.length>1){let e=Yue(t[0]);for(let n=1;n0&&s>=e)0==e?(t.push(r,...n),n.length=0,r=a):n.push(a),s=e;else{let i=sde(r,a);i>=0?r=i:0==s&&0==e?(t.push(r),r=a):(n.push(a),s=e)}}return r>=0&&t.push(r,...n),t}(ide(e))}const cde=45,lde=".",ude=65039,dde=1,hde=e=>Array.from(e);function pde(e,t){return e.P.has(t)||e.Q.has(t)}class fde extends Array{get is_emoji(){return!0}}let mde,bde,gde,yde,vde,wde,xde,kde,Ede,Ade,Cde;function Pde(){if(mde)return;let e=_ue(Aue);const t=()=>Bue(e),n=()=>new Set(t());mde=new Map(Mue(e)),bde=n(),gde=t(),yde=new Set(t().map((e=>gde[e]))),gde=new Set(gde),vde=n(),n();let r=Tue(e),s=e();const i=()=>new Set(t().flatMap((e=>r[e])).concat(t()));wde=Oue((t=>{let n=Oue(e).map((e=>e+96));if(n.length){let r=t>=s;return n[0]-=32,n=Lue(n),r&&(n=`Restricted[${n}]`),{N:n,P:i(),Q:i(),M:!e(),R:r}}})),xde=n(),kde=new Map;let a=t().concat(hde(xde)).sort(((e,t)=>e-t));a.forEach(((t,n)=>{let r=e(),s=a[n]=r?a[n-r]:{V:[],M:new Map};s.V.push(t),xde.has(t)||kde.set(t,s)}));for(let{V:e,M:t}of new Set(kde.values())){let n=[];for(let t of e){let e=wde.filter((e=>pde(e,t))),r=n.find((({G:t})=>e.some((e=>t.has(e)))));r||(r={G:new Set,V:[]},n.push(r)),r.V.push(t),e.forEach((e=>r.G.add(e)))}let r=n.flatMap((e=>hde(e.G)));for(let{G:e,V:s}of n){let n=new Set(r.filter((t=>!e.has(t))));for(let e of s)t.set(e,n)}}let o=new Set,c=new Set;const l=e=>o.has(e)?c.add(e):o.add(e);for(let e of wde){for(let t of e.P)l(t);for(let t of e.Q)l(t)}for(let e of o)kde.has(e)||c.has(e)||kde.set(e,dde);Ede=new Set(hde(o).concat(hde(ade(o)))),Ade=function(e){let t=[],n=Bue(e);return function e({S:n,B:r},s,i){if(!(4&n&&i===s[s.length-1])){2&n&&(i=s[s.length-1]),1&n&&t.push(s);for(let t of r)for(let n of t.Q)e(t,[...s,n],i)}}(function t(r){let s=e(),i=Oue((()=>{let r=Bue(e).map((e=>n[e]));if(r.length)return t(r)}));return{S:s,B:i,Q:r}}([]),[]),t}(e).map((e=>fde.from(e))).sort(Uue),Cde=new Map;for(let e of Ade){let t=[Cde];for(let n of e){let e=t.map((e=>{let t=e.get(n);return t||(t=new Map,e.set(n,t)),t}));n===ude?t.push(...e):t=e}for(let n of t)n.V=e}}function _de(e){return(Bde(e)?"":`${Sde(Ide([e]))} `)+jue(e)}function Sde(e){return`"${e}"‎`}function Ide(e,t=jue){let n=[];var r;r=e[0],Pde(),gde.has(r)&&n.push("◌");let s=0,i=e.length;for(let r=0;r{if(n){let r=n.message;throw new Error(1==e.length?r:`Invalid label ${Sde(Ide(t))}: ${r}`)}return Lue(r)})).join(lde)}(function(e,t,n){if(!e)return[];Pde();let r=0;return e.split(lde).map((e=>{let s=function(e){let t=[];for(let n=0,r=e.length;n0;)if(95!==e[--t])throw new Error("underscore allowed only at start")}(o),!(i.emoji=a>1||r[0].is_emoji)&&o.every((e=>e<128)))!function(e){if(e.length>=4&&e[2]==cde&&e[3]==cde)throw new Error(`invalid label extension: "${Lue(e.slice(0,4))}"`)}(o),e="ASCII";else{let t=r.flatMap((e=>e.is_emoji?[]:e));if(t.length){if(gde.has(o[0]))throw Nde("leading combining mark");for(let e=1;epde(e,n)));if(!e.length)throw wde.some((e=>pde(e,n)))?Ode(t[0],n):Mde(n);if(t=e,1==e.length)break}return t}(n);!function(e,t){for(let n of t)if(!pde(e,n))throw Ode(e,n);if(e.M){let e=ade(t);for(let t=1,n=e.length;tPue)throw new Error(`excessive non-spacing marks: ${Sde(Ide(e.slice(t-1,r)))} (${r-t}/${Pue})`);t=r}}}(s,t),function(e,t){let n,r=[];for(let e of t){let t=kde.get(e);if(t===dde)return;if(t){let r=t.M.get(e);if(n=n?n.filter((e=>r.has(e))):hde(r),!n.length)return}else r.push(e)}if(n)for(let t of n)if(r.every((e=>pde(t,e))))throw new Error(`whole-script confusable: ${e.N}/${t.N}`)}(s,n),e=s.N}else e="Emoji"}i.type=e}catch(e){i.error=e}return i}))}(e,ode,Rde))}function Mde(e){return new Error(`disallowed character: ${_de(e)}`)}function Ode(e,t){let n=_de(t),r=wde.find((e=>e.P.has(t)));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function Nde(e){return new Error(`illegal placement: ${e}`)}function Rde(e){return e.filter((e=>e!=ude))}function Fde(e,t){let n,r=Cde,s=e.length;for(;s&&(r=r.get(e[--s]),r);){let{V:t}=r;t&&(n=t,e.length=s)}return n}const jde=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],Lde=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],Ude=[...Lde,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Dde=[...Lde,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],zde=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Hde=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}];function Gde(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new rhe(e.type);return`${e.name}(${qde(e.inputs,{includeName:t})})`}function qde(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${qde(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}class $de extends Loe{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${qde(t,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=n}}class Vde extends Loe{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class Wde extends Loe{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class Zde extends Loe{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${qoe(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class Qde extends Loe{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class Kde extends Loe{constructor(e,{docsPath:t}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class Yde extends Loe{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class Jde extends Loe{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class Xde extends Loe{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Gde(e.abiItem)}\`, and`,`\`${t.type}\` in \`${Gde(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}}class ehe extends Loe{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class the extends Loe{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class nhe extends Loe{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class rhe extends Loe{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}function she(e,t={}){void 0!==t.size&&uce(e,{size:t.size});return dce(ece(e,t),t)}function ihe(e,t={}){let n=e;if(void 0!==t.size&&(uce(n,{size:t.size}),n=$oe(n)),n.length>1||n[0]>1)throw new zoe(n);return Boolean(n[0])}function ahe(e,t={}){void 0!==t.size&&uce(e,{size:t.size});return hce(ece(e,t),t)}function ohe(e,t){if(e.length!==t.length)throw new Qde({expectedLength:e.length,givenLength:t.length});const n=function({params:e,values:t}){const n=[];for(let r=0;r0?Yce([t,e]):t}}if(s)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:Yce(i.map((({encoded:e})=>e)))}}(t,{length:r,param:{...e,type:s}})}if("tuple"===e.type)return function(e,{param:t}){let n=!1;const r=[];for(let s=0;se)))}}(t,{param:e});if("address"===e.type)return function(e){if(!Kce(e))throw new fce({address:e});return{dynamic:!1,encoded:Koe(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){if("boolean"!=typeof e)throw new Loe(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Koe(Xoe(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){return function(e,{signed:t}){return{dynamic:!1,encoded:tce(e,{size:32,signed:t})}}(t,{signed:e.type.startsWith("int")})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),r=qoe(e);if(!n){let t=e;return r%32!=0&&(t=Koe(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:Yce([Koe(tce(r,{size:32})),t])}}if(r!==Number.parseInt(n))throw new Zde({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:Koe(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=rce(e),n=Math.ceil(qoe(t)/32),r=[];for(let e=0;e0)throw new Vde;if(qoe(t)&&qoe(t)<32)throw new $de({data:"string"==typeof t?t:ece(t),params:e,size:qoe(t)});let s=0;const i=[];for(let t=0;t!e)),s=r?[]:{};let i=0;if(mhe(t)){const a=n+ahe(e.readBytes(fhe));for(let n=0;n48?she(s,{signed:n}):ahe(s,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,{staticPosition:t}){const n=ahe(e.readBytes(32)),r=t+n;e.setPosition(r);const s=ahe(e.readBytes(32));if(0===s)return e.setPosition(t+32),["",32];const i=e.readBytes(s,32),a=function(e,t={}){let n=e;return void 0!==t.size&&(uce(n,{size:t.size}),n=$oe(n,{dir:"right"})),(new TextDecoder).decode(n)}($oe(i));return e.setPosition(t+32),[a,32]}(e,{staticPosition:n});throw new the(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const phe=32,fhe=32;function mhe(e){const{type:t}=e;if("string"===t)return!0;if("bytes"===t)return!0;if(t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(mhe);const n=uhe(e.type);return!(!n||!mhe({...e,type:n[1]}))}const bhe=e=>$ce(ice(e));const ghe=/^tuple(?(\[(\d*)\])*)$/;function yhe(e){let t=e.type;if(ghe.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r{var t;return function(e){let t=!0,n="",r=0,s="",i=!1;for(let a=0;aSle(xhe(e),0,4);function Ahe(e){const{abi:t,args:n=[],name:r}=e,s=Goe(r,{strict:!1}),i=t.filter((e=>s?"function"===e.type?Ehe(e)===r:"event"===e.type&&khe(e)===r:"name"in e&&e.name===r));if(0===i.length)return;if(1===i.length)return i[0];let a;for(const e of i){if(!("inputs"in e))continue;if(!n||0===n.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==n.length)continue;const t=n.every(((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&Che(t,r)}));if(t){if(a&&"inputs"in a&&a.inputs){const t=Phe(e.inputs,a.inputs,n);if(t)throw new Xde({abiItem:e,type:t[0]},{abiItem:a,type:t[1]})}a=e}}return a||i[0]}function Che(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Kce(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every(((t,n)=>Che(Object.values(e)[n],t))):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every((e=>Che(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function Phe(e,t,n){for(const r in e){const s=e[r],i=t[r];if("tuple"===s.type&&"tuple"===i.type&&"components"in s&&"components"in i)return Phe(s.components,i.components,n[r]);const a=[s.type,i.type];if(!(!a.includes("address")||!a.includes("bytes20"))||(a.includes("address")&&a.includes("string")||!(!a.includes("address")||!a.includes("bytes")))&&Kce(n[r],{strict:!1}))return a}}const _he="/docs/contract/decodeFunctionResult";function She(e){const{abi:t,args:n,functionName:r,data:s}=e;let i=t[0];if(r){const e=Ahe({abi:t,args:n,name:r});if(!e)throw new Yde(r,{docsPath:_he});i=e}if("function"!==i.type)throw new Yde(void 0,{docsPath:_he});if(!i.outputs)throw new Jde(i.name,{docsPath:_he});const a=dhe(i.outputs,s);return a&&a.length>1?a:a&&1===a.length?a[0]:void 0}const Ihe="/docs/contract/encodeFunctionData";function Bhe(e){const{args:t}=e,{abi:n,functionName:r}=1===e.abi.length&&e.functionName?.startsWith("0x")?e:function(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const e=Ahe({abi:t,args:n,name:r});if(!e)throw new Yde(r,{docsPath:Ihe});s=e}if("function"!==s.type)throw new Yde(void 0,{docsPath:Ihe});return{abi:[s],functionName:Ehe(Gde(s))}}(e),s=n[0];return Jce([r,("inputs"in s&&s.inputs?ohe(s.inputs,t??[]):void 0)??"0x"])}function The({blockNumber:e,chain:t,contract:n}){const r=t?.contracts?.[n];if(!r)throw new ple({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new ple({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const Mhe={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Ohe={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Nhe={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function Rhe(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}function Fhe(e){const{abi:t,data:n}=e,r=Sle(n,0,4);if("0x"===r)throw new Vde;const s=[...t||[],Ohe,Nhe].find((e=>"error"===e.type&&r===Ehe(Gde(e))));if(!s)throw new Kde(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?dhe(s.inputs,Sle(n,4)):void 0,errorName:s.name}}const jhe=(e,t,n)=>JSON.stringify(e,((e,n)=>{const r="bigint"==typeof n?n.toString():n;return"function"==typeof t?t(e,r):r}),n);function Lhe({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map(((e,n)=>`${r&&e.name?`${e.name}: `:""}${"object"==typeof t[n]?jhe(t[n]):t[n]}`)).join(", ")})`}class Uhe extends Loe{constructor({address:e}){super(`State for account "${e}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}}class Dhe extends Loe{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function zhe(e){return e.reduce(((e,{slot:t,value:n})=>`${e} ${t}: ${n}\n`),"")}class Hhe extends Loe{constructor(e,{account:t,docsPath:n,chain:r,data:s,gas:i,gasPrice:a,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d,stateOverride:h}){const p=t?Rhe(t):void 0;let f=cle({from:p?.address,to:u,value:void 0!==d&&`${Eue(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:void 0!==a&&`${ole(a)} gwei`,maxFeePerGas:void 0!==o&&`${ole(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${ole(c)} gwei`,nonce:l});h&&(f+=`\n${function(e){return e.reduce(((e,{address:t,...n})=>{let r=`${e} ${t}:\n`;return n.nonce&&(r+=` nonce: ${n.nonce}\n`),n.balance&&(r+=` balance: ${n.balance}\n`),n.code&&(r+=` code: ${n.code}\n`),n.state&&(r+=" state:\n",r+=zhe(n.state)),n.stateDiff&&(r+=" stateDiff:\n",r+=zhe(n.stateDiff)),r})," State Override:\n").slice(0,-1)}(h)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",f].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}}class Ghe extends Loe{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:s,functionName:i,sender:a}){const o=Ahe({abi:t,args:n,name:i}),c=o?Lhe({abiItem:o,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=cle({address:r&&r,function:o?Gde(o,{includeName:!0}):void 0,args:c&&"()"!==c&&`${[...Array(i?.length??0).keys()].map((()=>" ")).join("")}${c}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",l].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=t,this.args=n,this.cause=e,this.contractAddress=r,this.functionName=i,this.sender=a}}class qhe extends Loe{constructor({abi:e,data:t,functionName:n,message:r}){let s,i,a,o,c;if(t&&"0x"!==t)try{i=Fhe({abi:e,data:t});const{abiItem:n,errorName:r,args:s}=i;if("Error"===r)o=s[0];else if("Panic"===r){const[e]=s;o=Mhe[e]}else{const e=n?Gde(n,{includeName:!0}):void 0,t=n&&s?Lhe({abiItem:n,args:s,includeFunctionName:!1,includeName:!1}):void 0;a=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(r?.length??0).keys()].map((()=>" ")).join("")}${t}`:""]}}catch(e){s=e}else r&&(o=r);s instanceof Kde&&(c=s.signature,a=[`Unable to decode signature "${c}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${c}.`]),super(o&&"execution reverted"!==o||c?[`The contract function "${n}" reverted with the following ${c?"signature":"reason"}:`,o||c].join("\n"):`The contract function "${n}" reverted.`,{cause:s,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.reason=o,this.signature=c}}class $he extends Loe{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class Vhe extends Loe{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}function Whe(e,t){if(!(e instanceof Loe))return!1;const n=e.walk((e=>e instanceof qhe));return n instanceof qhe&&("ResolverNotFound"===n.data?.errorName||("ResolverWildcardNotSupported"===n.data?.errorName||("ResolverNotContract"===n.data?.errorName||("ResolverError"===n.data?.errorName||("HttpError"===n.data?.errorName||(!!n.reason?.includes("Wildcard on non-extended resolvers is not supported")||"reverse"===t&&n.reason===Mhe[50]))))))}function Zhe(e){if(66!==e.length)return null;if(0!==e.indexOf("["))return null;if(65!==e.indexOf("]"))return null;const t=`0x${e.slice(1,65)}`;return Goe(t)?t:null}function Qhe(e){let t=new Uint8Array(32).fill(0);if(!e)return ece(t);const n=e.split(".");for(let e=n.length-1;e>=0;e-=1){const r=Zhe(n[e]),s=r?ice(r):$ce(lce(n[e]),"bytes");t=$ce(Yce([t,s]),"bytes")}return ece(t)}function Khe(e){return`[${e.slice(2)}]`}function Yhe(e){const t=new Uint8Array(32).fill(0);return e?Zhe(e)||$ce(lce(e)):ece(t)}function Jhe(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const n=new Uint8Array(lce(t).byteLength+2);let r=0;const s=t.split(".");for(let e=0;e255&&(t=lce(Khe(Yhe(s[e])))),n[r]=t.length,n.set(t,r+1),r+=t.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}function Xhe(e,t,n){return r=>e[t.name]?.(r)??e[n]?.(r)??t(e,r)}class epe extends Loe{constructor({body:e,details:t,headers:n,status:r,url:s}){super("HTTP request failed.",{details:t,metaMessages:[r&&`Status: ${r}`,`URL: ${s}`,e&&`Request body: ${jhe(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=r,this.url=s}}class tpe extends Loe{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${jhe(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}}class npe extends Loe{constructor(e,{code:t,docsPath:n,metaMessages:r,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:r||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof tpe?e.code:t??-1}}class rpe extends npe{constructor(e){super(e,{code:rpe.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(rpe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});const spe=3;const ipe="0x82ad56cb";function ape(e,{docsPath:t,...n}){const r=(()=>{const t=function(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof Loe?e.walk((e=>e.code===ble.code)):e;return r instanceof Loe?new ble({cause:e,message:r.details}):ble.nodeMessage.test(n)?new ble({cause:e,message:e.details}):gle.nodeMessage.test(n)?new gle({cause:e,maxFeePerGas:t?.maxFeePerGas}):yle.nodeMessage.test(n)?new yle({cause:e,maxFeePerGas:t?.maxFeePerGas}):vle.nodeMessage.test(n)?new vle({cause:e,nonce:t?.nonce}):wle.nodeMessage.test(n)?new wle({cause:e,nonce:t?.nonce}):xle.nodeMessage.test(n)?new xle({cause:e,nonce:t?.nonce}):kle.nodeMessage.test(n)?new kle({cause:e}):Ele.nodeMessage.test(n)?new Ele({cause:e,gas:t?.gas}):Ale.nodeMessage.test(n)?new Ale({cause:e,gas:t?.gas}):Cle.nodeMessage.test(n)?new Cle({cause:e}):Ple.nodeMessage.test(n)?new Ple({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new _le({cause:e})}(e,n);return t instanceof _le?e:t})();return new Hhe(r,{docsPath:t,...n})}function ope(e,{format:t}){if(!t)return{};const n={};return function t(r){const s=Object.keys(r);for(const i of s)i in e&&(n[i]=e[i]),r[i]&&"object"==typeof r[i]&&!Array.isArray(r[i])&&t(r[i])}(t(e||{})),n}const cpe=new Map;function lpe(e){if(e&&0!==e.length)return e.reduce(((e,{slot:t,value:n})=>{if(66!==t.length)throw new Zoe({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new Zoe({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e}),{})}function upe(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:i}=e,a={};if(void 0!==i&&(a.code=i),void 0!==t&&(a.balance=tce(t)),void 0!==n&&(a.nonce=tce(n)),void 0!==r&&(a.state=lpe(r)),void 0!==s){if(a.state)throw new Dhe;a.stateDiff=lpe(s)}return a}async function dpe(e,t){const{account:n=e.account,batch:r=Boolean(e.batch?.multicall),blockNumber:s,blockTag:i="latest",accessList:a,blobs:o,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:f,to:m,value:b,stateOverride:g,...y}=t,v=n?Rhe(n):void 0;try{!function(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:i}=e,a=t?Rhe(t):void 0;if(a&&!Kce(a.address))throw new fce({address:a.address});if(i&&!Kce(i))throw new fce({address:i});if(void 0!==n&&(void 0!==r||void 0!==s))throw new lle;if(r&&r>2n**256n-1n)throw new gle({maxFeePerGas:r});if(s&&r&&s>r)throw new Ple({maxFeePerGas:r,maxPriorityFeePerGas:s})}(t);const n=(s?tce(s):void 0)||i,w=function(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!Kce(n,{strict:!1}))throw new fce({address:n});if(t[n])throw new Uhe({address:n});t[n]=upe(r)}return t}(g),x=e.chain?.formatters?.transactionRequest?.format,k=(x||Ole)({...ope(y,{format:x}),from:v?.address,accessList:a,blobs:o,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:f,to:m,value:b});if(r&&function({request:e}){const{data:t,to:n,...r}=e;return!!t&&(!t.startsWith(ipe)&&(!!n&&!(Object.values(r).filter((e=>void 0!==e)).length>0)))}({request:k})&&!w)try{return await async function(e,t){const{batchSize:n=1024,wait:r=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockNumber:s,blockTag:i="latest",data:a,multicallAddress:o,to:c}=t;let l=o;if(!l){if(!e.chain)throw new fle;l=The({blockNumber:s,chain:e.chain,contract:"multicall3"})}const u=s?tce(s):void 0,d=u||i,{schedule:h}=function({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const i=async()=>{const t=o();a();const n=t.map((({args:e})=>e));0!==n.length&&e(n).then((e=>{s&&Array.isArray(e)&&e.sort(s);for(let n=0;n{for(let n=0;ncpe.delete(t),o=()=>cpe.get(t)||[],c=e=>cpe.set(t,[...o(),e]);return{flush:a,async schedule(e){const t={},s=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),a=n?.([...o().map((({args:e})=>e)),e]);return a&&i(),o().length>0?(c({args:e,pendingPromise:t}),s):(c({args:e,pendingPromise:t}),setTimeout(i,r),s)}}}({id:`${e.uid}.${d}`,wait:r,shouldSplitBatch(e){const t=e.reduce(((e,{data:t})=>e+(t.length-2)),0);return t>2*n},fn:async t=>{const n=t.map((e=>({allowFailure:!0,callData:e.data,target:e.to}))),r=Bhe({abi:jde,args:[n],functionName:"aggregate3"}),s=await e.request({method:"eth_call",params:[{data:r,to:l},d]});return She({abi:jde,args:[n],functionName:"aggregate3",data:s||"0x"})}}),[{returnData:p,success:f}]=await h({data:a,to:c});if(!f)throw new Vhe({data:p});return"0x"===p?{data:void 0}:{data:p}}(e,{...k,blockNumber:s,blockTag:i})}catch(e){if(!(e instanceof fle||e instanceof ple))throw e}const E=await e.request({method:"eth_call",params:w?[k,n,w]:[k,n]});return"0x"===E?{data:void 0}:{data:E}}catch(n){const r=function(e){if(!(e instanceof Loe))return;const t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(n),{offchainLookup:s,offchainLookupSignature:i}=await Promise.resolve().then((function(){return vTe}));if(!1!==e.ccipRead&&r?.slice(0,10)===i&&m)return{data:await s(e,{data:r,to:m})};throw ape(n,{...t,account:v,chain:e.chain})}}async function hpe(e,t){const{abi:n,address:r,args:s,functionName:i,...a}=t,o=Bhe({abi:n,args:s,functionName:i});try{const{data:t}=await Xhe(e,dpe,"call")({...a,data:o,to:r});return She({abi:n,args:s,functionName:i,data:t||"0x"})}catch(e){throw function(e,{abi:t,address:n,args:r,docsPath:s,functionName:i,sender:a}){const{code:o,data:c,message:l,shortMessage:u}=e instanceof Vhe?e:e instanceof Loe?e.walk((e=>"data"in e))||e.walk():{},d=e instanceof Vde?new $he({functionName:i}):[spe,rpe.code].includes(o)&&(c||l||u)?new qhe({abi:t,data:"object"==typeof c?c.data:c,functionName:i,message:u??l}):e;return new Ghe(d,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:i,sender:a})}(e,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:i})}}class ppe extends Loe{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class fpe extends Loe{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class mpe extends Loe{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class bpe extends Loe{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const gpe=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,ype=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,vpe=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,wpe=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function xpe(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function kpe({uri:e,gatewayUrls:t}){const n=vpe.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=xpe(t?.ipfs,"https://ipfs.io"),s=xpe(t?.arweave,"https://arweave.net"),i=e.match(gpe),{protocol:a,subpath:o,target:c,subtarget:l=""}=i?.groups||{},u="ipns:/"===a||"ipns/"===o,d="ipfs:/"===a||"ipfs/"===o||ype.test(e);if(e.startsWith("http")&&!u&&!d){let n=e;return t?.arweave&&(n=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:n,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${r}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===a&&c)return{uri:`${s}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let h=e.replace(wpe,"");if(h.startsWith("{const n=new Image;n.onload=()=>{t(!0)},n.onerror=()=>{t(!1)},n.src=e}))}}(n);if(s)return n;throw new mpe({uri:t})}async function Cpe(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?async function(e,{gatewayUrls:t,record:n}){const r=function(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[i,a]=n.split(":"),[o,c]=r.split(":");if(!i||"eip155"!==i.toLowerCase())throw new fpe({reason:"Only EIP-155 supported"});if(!a)throw new fpe({reason:"Chain ID not found"});if(!c)throw new fpe({reason:"Contract address not found"});if(!s)throw new fpe({reason:"Token ID not found"});if(!o)throw new fpe({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a),namespace:o.toLowerCase(),contractAddress:c,tokenID:s}}(n),s=await async function(e,{nft:t}){if("erc721"===t.namespace)return hpe(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return hpe(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new bpe({namespace:t.namespace})}(e,{nft:r}),{uri:i,isOnChain:a,isEncoded:o}=kpe({uri:s,gatewayUrls:t});if(a&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){const e=o?atob(i.replace("data:application/json;base64,","")):i;return Ape({uri:Epe(JSON.parse(e)),gatewayUrls:t})}let c=r.tokenID;"erc1155"===r.namespace&&(c=c.replace("0x","").padStart(64,"0"));return async function({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then((e=>e.json()));return await Ape({gatewayUrls:e,uri:Epe(n)})}catch{throw new mpe({uri:t})}}({gatewayUrls:t,uri:i.replace(/(?:0x)?{id}/,c)})}(e,{gatewayUrls:t,record:n}):Ape({uri:n,gatewayUrls:t})}async function Ppe(e,{blockNumber:t,blockTag:n,name:r,key:s,gatewayUrls:i,strict:a,universalResolverAddress:o}){let c=o;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=The({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const a={address:c,abi:Ude,functionName:"resolve",args:[Joe(Jhe(r)),Bhe({abi:zde,functionName:"text",args:[Qhe(r),s]})],blockNumber:t,blockTag:n},o=Xhe(e,hpe,"readContract"),l=i?await o({...a,args:[...a.args,i]}):await o(a);if("0x"===l[0])return null;const u=She({abi:zde,functionName:"text",data:l[0]});return""===u?null:u}catch(e){if(a)throw e;if(Whe(e,"resolve"))return null;throw e}}var _pe=Object.freeze({__proto__:null,normalize:function(e){return Tde(e)},getEnsAddress:async function(e,{blockNumber:t,blockTag:n,coinType:r,name:s,gatewayUrls:i,strict:a,universalResolverAddress:o}){let c=o;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=The({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const a=Bhe({abi:Hde,functionName:"addr",...null!=r?{args:[Qhe(s),BigInt(r)]}:{args:[Qhe(s)]}}),o={address:c,abi:Ude,functionName:"resolve",args:[Joe(Jhe(s)),a],blockNumber:t,blockTag:n},l=Xhe(e,hpe,"readContract"),u=i?await l({...o,args:[...o.args,i]}):await l(o);if("0x"===u[0])return null;const d=She({abi:Hde,args:null!=r?[Qhe(s),BigInt(r)]:void 0,functionName:"addr",data:u[0]});return"0x"===d||"0x00"===$oe(d)?null:d}catch(e){if(a)throw e;if(Whe(e,"resolve"))return null;throw e}},getEnsAvatar:async function(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:i,strict:a,universalResolverAddress:o}){const c=await Xhe(e,Ppe,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:o,gatewayUrls:i,strict:a});if(!c)return null;try{return await Cpe(e,{record:c,gatewayUrls:r})}catch{return null}},getEnsName:async function(e,{address:t,blockNumber:n,blockTag:r,gatewayUrls:s,strict:i,universalResolverAddress:a}){let o=a;if(!o){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=The({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const i={address:o,abi:Dde,functionName:"reverse",args:[Joe(Jhe(c))],blockNumber:n,blockTag:r},a=Xhe(e,hpe,"readContract"),[l,u]=s?await a({...i,args:[...i.args,s]}):await a(i);return t.toLowerCase()!==u.toLowerCase()?null:l}catch(e){if(i)throw e;if(Whe(e,"reverse"))return null;throw e}},getEnsResolver:async function(e,{blockNumber:t,blockTag:n,name:r,universalResolverAddress:s}){let i=s;if(!i){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=The({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[a]=await Xhe(e,hpe,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Joe(Jhe(r))],blockNumber:t,blockTag:n});return a},getEnsText:Ppe,labelhash:Yhe,namehash:Qhe,parseAvatarRecord:Cpe,packetToBytes:Jhe}),Spe=Object.freeze({__proto__:null,H:epe,c:dpe,d:Fhe,e:ohe,i:_pe,s:jhe}),Ipe={},Bpe=9007199254740991,Tpe="[object Arguments]",Mpe="[object Function]",Ope="[object GeneratorFunction]",Npe=/^(?:0|[1-9]\d*)$/;function Rpe(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Fpe=Object.prototype,jpe=Fpe.hasOwnProperty,Lpe=Fpe.toString,Upe=Fpe.propertyIsEnumerable,Dpe=Math.max;function zpe(e,t){var n=Zpe(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Qpe(e)}(e)&&jpe.call(e,"callee")&&(!Upe.call(e,"callee")||Lpe.call(e)==Tpe)}(e)?function(e,t){for(var n=-1,r=Array(e);++n-1&&e%1==0&&e-1&&e%1==0&&e<=Bpe}(e.length)&&!function(e){var t=Kpe(e)?Lpe.call(e):"";return t==Mpe||t==Ope}(e)}function Kpe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var Ype,Jpe=(Ype=function(e,t,n,r){!function(e,t,n,r){n||(n={});for(var s=-1,i=t.length;++s1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(s=Ype.length>3&&"function"==typeof s?(r--,s):void 0,i&&function(e,t,n){if(!Kpe(n))return!1;var r=typeof t;return!!("number"==r?Qpe(n)&&Vpe(t,n.length):"string"==r&&t in n)&&Wpe(n[t],e)}(t[0],t[1],i)&&(s=r<3?void 0:s,r=1),e=Object(e);++n=r)this.stopReconnecting(e,this.getTooManyFailedReconnectsMessage());else{var i=s(e);"boolean"==typeof i?this.handleWillReconnect(i,e,"Provided shouldReconnect() returned false. Closing permanently."):i.then((function(n){t.isClosed||t.handleWillReconnect(n,e,"Provided shouldReconnect() resolved to false. Closing permanently.")}))}}},e.prototype.handleError=function(e){this.dispatchEventOfType("error",e),this.debugLog("WebSocket encountered an error.")},e.prototype.handleWillReconnect=function(e,t,n){e?this.reconnect():this.stopReconnecting(t,n)},e.prototype.reconnect=function(){var e=this,t=this.options,n=t.minReconnectDelay,r=t.maxReconnectDelay,s=t.reconnectBackoffFactor;this.reconnectCount++;var i=this.nextRetryTime;this.nextRetryTime=Math.max(n,Math.min(this.nextRetryTime*s,r)),setTimeout((function(){return e.openNewWebSocket()}),i);var a=i/1e3|0;this.debugLog("WebSocket was closed. Re-opening in "+a+" seconds.")},e.prototype.stopReconnecting=function(e,t){this.debugLog(t),this.shutdown(),this.dispatchEventOfType("close",e)},e.prototype.shutdown=function(){this.isClosed=!0,this.clearAllTimeouts(),this.messageBuffer=[]},e.prototype.clearAllTimeouts=function(){this.clearConnectTimeout(),this.clearAllClearTimeout()},e.prototype.clearConnectTimeout=function(){null!=this.connectTimeoutId&&(clearTimeout(this.connectTimeoutId),this.connectTimeoutId=void 0)},e.prototype.clearAllClearTimeout=function(){null!=this.allClearTimeoutId&&(clearTimeout(this.allClearTimeoutId),this.allClearTimeoutId=void 0)},e.prototype.dispatchEventOfType=function(e,t){var n=this;switch(e){case"close":this.onclose&&this.onclose(t);break;case"error":this.onerror&&this.onerror(t);break;case"message":this.onmessage&&this.onmessage(t);break;case"open":this.onopen&&this.onopen(t);break;case"down":this.ondown&&this.ondown(t);break;case"reopen":this.onreopen&&this.onreopen(t)}return e in this.listeners&&this.listeners[e].slice().forEach((function(e){return n.callListener(e,t)})),!t||!t.defaultPrevented},e.prototype.callListener=function(e,t){"function"==typeof e?e.call(this,t):e.handleEvent.call(this,t)},e.prototype.debugLog=function(e){this.options.debug&&console.log(e)},e.prototype.getTooManyFailedReconnectsMessage=function(){var e=this.options.maxReconnectAttempts;return"Failed to reconnect after "+e+" "+function(e,t){return 1===t?e:e+"s"}("attempt",e)+". Closing permanently."},e.DEFAULT_OPTIONS={allClearResetTime:5e3,connectTimeout:5e3,debug:!1,minReconnectDelay:1e3,maxReconnectDelay:3e4,maxReconnectAttempts:Number.POSITIVE_INFINITY,reconnectBackoffFactor:1.5,shouldReconnect:function(){return!0},wsConstructor:void 0},e.CONNECTING=0,e.OPEN=1,e.CLOSING=2,e.CLOSED=3,e}(),nfe=Ipe.default=tfe;class rfe{static create(...e){return new this(...e)}mixIn(e){return Object.assign(this,e)}clone(){const e=new this.constructor;return Object.assign(e,this),e}}class sfe extends rfe{constructor(e=[],t=4*e.length){super();let n=e;if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),(n instanceof Int8Array||n instanceof Uint8ClampedArray||n instanceof Int16Array||n instanceof Uint16Array||n instanceof Int32Array||n instanceof Uint32Array||n instanceof Float32Array||n instanceof Float64Array)&&(n=new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),n instanceof Uint8Array){const e=n.byteLength,t=[];for(let r=0;r>>2]|=n[r]<<24-r%4*8;this.words=t,this.sigBytes=e}else this.words=e,this.sigBytes=t}static random(e){const t=[],n=e=>{let t=e,n=987654321;const r=4294967295;return()=>{n=36969*(65535&n)+(n>>16)&r,t=18e3*(65535&t)+(t>>16)&r;let e=(n<<16)+t&r;return e/=4294967296,e+=.5,e*(Math.random()>.5?1:-1)}};for(let r,s=0;s>>2]>>>24-e%4*8&255;t[r+e>>>2]|=s<<24-(r+e)%4*8}else for(let e=0;e>>2]=n[e>>>2];return this.sigBytes+=s,this}clamp(){const{words:e,sigBytes:t}=this;e[t>>>2]&=4294967295<<32-t%4*8,e.length=Math.ceil(t/4)}clone(){const e=super.clone.call(this);return e.words=this.words.slice(0),e}}const ife={stringify(e){const{words:t,sigBytes:n}=e,r=[];for(let e=0;e>>2]>>>24-e%4*8&255;r.push((n>>>4).toString(16)),r.push((15&n).toString(16))}return r.join("")},parse(e){const t=e.length,n=[];for(let r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new sfe(n,t/2)}},afe={stringify(e){const{words:t,sigBytes:n}=e,r=[];for(let e=0;e>>2]>>>24-e%4*8&255;r.push(String.fromCharCode(n))}return r.join("")},parse(e){const t=e.length,n=[];for(let r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new sfe(n,t)}},ofe={stringify(e){try{return decodeURIComponent(escape(afe.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:e=>afe.parse(unescape(encodeURIComponent(e)))};class cfe extends rfe{constructor(){super(),this._minBufferSize=0}reset(){this._data=new sfe,this._nDataBytes=0}_append(e){let t=e;"string"==typeof t&&(t=ofe.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes}_process(e){let t;const{_data:n,blockSize:r}=this,s=n.words,i=n.sigBytes;let a=i/(4*r);a=e?Math.ceil(a):Math.max((0|a)-this._minBufferSize,0);const o=a*r,c=Math.min(4*o,i);if(o){for(let e=0;enew e(n).finalize(t)}static _createHmacHelper(e){return(t,n)=>new ufe(e,n).finalize(t)}reset(){super.reset.call(this),this._doReset()}update(e){return this._append(e),this._process(),this}finalize(e){e&&this._append(e);return this._doFinalize()}}class ufe extends rfe{constructor(e,t){super();const n=new e;this._hasher=n;let r=t;"string"==typeof r&&(r=ofe.parse(r));const s=n.blockSize,i=4*s;r.sigBytes>i&&(r=n.finalize(t)),r.clamp();const a=r.clone();this._oKey=a;const o=r.clone();this._iKey=o;const c=a.words,l=o.words;for(let e=0;e>>2]>>>24-e%4*8&255)<<16|(t[e+1>>>2]>>>24-(e+1)%4*8&255)<<8|t[e+2>>>2]>>>24-(e+2)%4*8&255;for(let t=0;t<4&&e+.75*t>>6*(3-t)&63))}const i=r.charAt(64);if(i)for(;s.length%4;)s.push(i);return s.join("")},parse(e){let t=e.length;const n=this._map;let r=this._reverseMap;if(!r){this._reverseMap=[],r=this._reverseMap;for(let e=0;e{const r=[];let s=0;for(let i=0;i>>6-i%4*2;r[s>>>2]|=t<<24-s%4*8,s+=1}return sfe.create(r,s)})(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},mfe=[];for(let e=0;e<64;e+=1)mfe[e]=4294967296*Math.abs(Math.sin(e+1))|0;const bfe=(e,t,n,r,s,i,a)=>{const o=e+(t&n|~t&r)+s+a;return(o<>>32-i)+t},gfe=(e,t,n,r,s,i,a)=>{const o=e+(t&r|n&~r)+s+a;return(o<>>32-i)+t},yfe=(e,t,n,r,s,i,a)=>{const o=e+(t^n^r)+s+a;return(o<>>32-i)+t},vfe=(e,t,n,r,s,i,a)=>{const o=e+(n^(t|~r))+s+a;return(o<>>32-i)+t};class wfe extends lfe{_doReset(){this._hash=new sfe([1732584193,4023233417,2562383102,271733878])}_doProcessBlock(e,t){const n=e;for(let r=0;r<16;r+=1){const s=t+r,i=e[s];n[s]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}const r=this._hash.words,s=n[t+0],i=n[t+1],a=n[t+2],o=n[t+3],c=n[t+4],l=n[t+5],u=n[t+6],d=n[t+7],h=n[t+8],p=n[t+9],f=n[t+10],m=n[t+11],b=n[t+12],g=n[t+13],y=n[t+14],v=n[t+15];let w=r[0],x=r[1],k=r[2],E=r[3];w=bfe(w,x,k,E,s,7,mfe[0]),E=bfe(E,w,x,k,i,12,mfe[1]),k=bfe(k,E,w,x,a,17,mfe[2]),x=bfe(x,k,E,w,o,22,mfe[3]),w=bfe(w,x,k,E,c,7,mfe[4]),E=bfe(E,w,x,k,l,12,mfe[5]),k=bfe(k,E,w,x,u,17,mfe[6]),x=bfe(x,k,E,w,d,22,mfe[7]),w=bfe(w,x,k,E,h,7,mfe[8]),E=bfe(E,w,x,k,p,12,mfe[9]),k=bfe(k,E,w,x,f,17,mfe[10]),x=bfe(x,k,E,w,m,22,mfe[11]),w=bfe(w,x,k,E,b,7,mfe[12]),E=bfe(E,w,x,k,g,12,mfe[13]),k=bfe(k,E,w,x,y,17,mfe[14]),x=bfe(x,k,E,w,v,22,mfe[15]),w=gfe(w,x,k,E,i,5,mfe[16]),E=gfe(E,w,x,k,u,9,mfe[17]),k=gfe(k,E,w,x,m,14,mfe[18]),x=gfe(x,k,E,w,s,20,mfe[19]),w=gfe(w,x,k,E,l,5,mfe[20]),E=gfe(E,w,x,k,f,9,mfe[21]),k=gfe(k,E,w,x,v,14,mfe[22]),x=gfe(x,k,E,w,c,20,mfe[23]),w=gfe(w,x,k,E,p,5,mfe[24]),E=gfe(E,w,x,k,y,9,mfe[25]),k=gfe(k,E,w,x,o,14,mfe[26]),x=gfe(x,k,E,w,h,20,mfe[27]),w=gfe(w,x,k,E,g,5,mfe[28]),E=gfe(E,w,x,k,a,9,mfe[29]),k=gfe(k,E,w,x,d,14,mfe[30]),x=gfe(x,k,E,w,b,20,mfe[31]),w=yfe(w,x,k,E,l,4,mfe[32]),E=yfe(E,w,x,k,h,11,mfe[33]),k=yfe(k,E,w,x,m,16,mfe[34]),x=yfe(x,k,E,w,y,23,mfe[35]),w=yfe(w,x,k,E,i,4,mfe[36]),E=yfe(E,w,x,k,c,11,mfe[37]),k=yfe(k,E,w,x,d,16,mfe[38]),x=yfe(x,k,E,w,f,23,mfe[39]),w=yfe(w,x,k,E,g,4,mfe[40]),E=yfe(E,w,x,k,s,11,mfe[41]),k=yfe(k,E,w,x,o,16,mfe[42]),x=yfe(x,k,E,w,u,23,mfe[43]),w=yfe(w,x,k,E,p,4,mfe[44]),E=yfe(E,w,x,k,b,11,mfe[45]),k=yfe(k,E,w,x,v,16,mfe[46]),x=yfe(x,k,E,w,a,23,mfe[47]),w=vfe(w,x,k,E,s,6,mfe[48]),E=vfe(E,w,x,k,d,10,mfe[49]),k=vfe(k,E,w,x,y,15,mfe[50]),x=vfe(x,k,E,w,l,21,mfe[51]),w=vfe(w,x,k,E,b,6,mfe[52]),E=vfe(E,w,x,k,o,10,mfe[53]),k=vfe(k,E,w,x,f,15,mfe[54]),x=vfe(x,k,E,w,i,21,mfe[55]),w=vfe(w,x,k,E,h,6,mfe[56]),E=vfe(E,w,x,k,v,10,mfe[57]),k=vfe(k,E,w,x,u,15,mfe[58]),x=vfe(x,k,E,w,g,21,mfe[59]),w=vfe(w,x,k,E,c,6,mfe[60]),E=vfe(E,w,x,k,m,10,mfe[61]),k=vfe(k,E,w,x,a,15,mfe[62]),x=vfe(x,k,E,w,p,21,mfe[63]),r[0]=r[0]+w|0,r[1]=r[1]+x|0,r[2]=r[2]+k|0,r[3]=r[3]+E|0}_doFinalize(){const e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32;const s=Math.floor(n/4294967296),i=n;t[15+(r+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t[14+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e.sigBytes=4*(t.length+1),this._process();const a=this._hash,o=a.words;for(let e=0;e<4;e+=1){const t=o[e];o[e]=16711935&(t<<8|t>>>24)|4278255360&(t<<24|t>>>8)}return a}clone(){const e=super.clone.call(this);return e._hash=this._hash.clone(),e}}const xfe=lfe._createHelper(wfe),kfe=lfe._createHmacHelper(wfe);class Efe extends rfe{constructor(e){super(),this.cfg=Object.assign(new rfe,{keySize:4,hasher:wfe,iterations:1},e)}compute(e,t){let n;const{cfg:r}=this,s=r.hasher.create(),i=sfe.create(),a=i.words,{keySize:o,iterations:c}=r;for(;a.length"string"==typeof e?Rfe:Ofe;return{encrypt:(n,r,s)=>t(r).encrypt(e,n,r,s),decrypt:(n,r,s)=>t(r).decrypt(e,n,r,s)}}reset(){super.reset.call(this),this._doReset()}process(e){return this._append(e),this._process()}finalize(e){e&&this._append(e);return this._doFinalize()}}Afe._ENC_XFORM_MODE=1,Afe._DEC_XFORM_MODE=2,Afe.keySize=4,Afe.ivSize=4;class Cfe extends Afe{constructor(...e){super(...e),this.blockSize=1}_doFinalize(){return this._process(!0)}}class Pfe extends rfe{constructor(e,t){super(),this._cipher=e,this._iv=t}static createEncryptor(e,t){return this.Encryptor.create(e,t)}static createDecryptor(e,t){return this.Decryptor.create(e,t)}}function _fe(e,t,n){const r=e;let s;const i=this._iv;i?(s=i,this._iv=void 0):s=this._prevBlock;for(let e=0;e>>2];t.sigBytes-=n}};class Bfe extends Afe{constructor(e,t,n){super(e,t,Object.assign({mode:Sfe,padding:Ife},n)),this.blockSize=4}reset(){let e;super.reset.call(this);const{cfg:t}=this,{iv:n,mode:r}=t;this._xformMode===this.constructor._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e}_doProcessBlock(e,t){this._mode.processBlock(e,t)}_doFinalize(){let e;const{padding:t}=this.cfg;return this._xformMode===this.constructor._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e}}class Tfe extends rfe{constructor(e){super(),this.mixIn(e)}toString(e){return(e||this.formatter).stringify(this)}}const Mfe={stringify(e){let t;const{ciphertext:n,salt:r}=e;return t=r?sfe.create([1398893684,1701076831]).concat(r).concat(n):n,t.toString(ffe)},parse(e){let t;const n=ffe.parse(e),r=n.words;return 1398893684===r[0]&&1701076831===r[1]&&(t=sfe.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),Tfe.create({ciphertext:n,salt:t})}};class Ofe extends rfe{static encrypt(e,t,n,r){const s=Object.assign(new rfe,this.cfg,r),i=e.createEncryptor(n,s),a=i.finalize(t),o=i.cfg;return Tfe.create({ciphertext:a,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:i.blockSize,formatter:s.format})}static decrypt(e,t,n,r){let s=t;const i=Object.assign(new rfe,this.cfg,r);s=this._parse(s,i.format);return e.createDecryptor(n,i).finalize(s.ciphertext)}static _parse(e,t){return"string"==typeof e?t.parse(e,this):e}}Ofe.cfg=Object.assign(new rfe,{format:Mfe});const Nfe={execute(e,t,n,r){let s=r;s||(s=sfe.random(8));const i=Efe.create({keySize:t+n}).compute(e,s),a=sfe.create(i.words.slice(t),4*n);return i.sigBytes=4*t,Tfe.create({key:i,iv:a,salt:s})}};class Rfe extends Ofe{static encrypt(e,t,n,r){const s=Object.assign(new rfe,this.cfg,r),i=s.kdf.execute(n,e.keySize,e.ivSize);s.iv=i.iv;const a=Ofe.encrypt.call(this,e,t,i.key,s);return a.mixIn(i),a}static decrypt(e,t,n,r){let s=t;const i=Object.assign(new rfe,this.cfg,r);s=this._parse(s,i.format);const a=i.kdf.execute(n,e.keySize,e.ivSize,s.salt);i.iv=a.iv;return Ofe.decrypt.call(this,e,s,a.key,i)}}Rfe.cfg=Object.assign(Ofe.cfg,{kdf:Nfe});const Ffe=e=>e<<8&4278255360|e>>>8&16711935,jfe={stringify(e){const{words:t,sigBytes:n}=e,r=[];for(let e=0;e>>2]>>>16-e%4*8&65535;r.push(String.fromCharCode(n))}return r.join("")},parse(e){const t=e.length,n=[];for(let r=0;r>>1]|=e.charCodeAt(r)<<16-r%2*16;return sfe.create(n,2*t)}},Lfe=jfe,Ufe={stringify(e){const{words:t,sigBytes:n}=e,r=[];for(let e=0;e>>2]>>>16-e%4*8&65535);r.push(String.fromCharCode(n))}return r.join("")},parse(e){const t=e.length,n=[];for(let r=0;r>>1]|=Ffe(e.charCodeAt(r)<<16-r%2*16);return sfe.create(n,2*t)}},Dfe=[];class zfe extends lfe{_doReset(){this._hash=new sfe([1732584193,4023233417,2562383102,271733878,3285377520])}_doProcessBlock(e,t){const n=this._hash.words;let r=n[0],s=n[1],i=n[2],a=n[3],o=n[4];for(let n=0;n<80;n+=1){if(n<16)Dfe[n]=0|e[t+n];else{const e=Dfe[n-3]^Dfe[n-8]^Dfe[n-14]^Dfe[n-16];Dfe[n]=e<<1|e>>>31}let c=(r<<5|r>>>27)+o+Dfe[n];c+=n<20?1518500249+(s&i|~s&a):n<40?1859775393+(s^i^a):n<60?(s&i|s&a|i&a)-1894007588:(s^i^a)-899497514,o=a,a=i,i=s<<30|s>>>2,s=r,r=c}n[0]=n[0]+r|0,n[1]=n[1]+s|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+o|0}_doFinalize(){const e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash}clone(){const e=super.clone.call(this);return e._hash=this._hash.clone(),e}}const Hfe=lfe._createHelper(zfe),Gfe=lfe._createHmacHelper(zfe),qfe=[],$fe=[],Vfe=e=>{const t=Math.sqrt(e);for(let n=2;n<=t;n+=1)if(!(e%n))return!1;return!0},Wfe=e=>4294967296*(e-(0|e))|0;let Zfe=2,Qfe=0;for(;Qfe<64;)Vfe(Zfe)&&(Qfe<8&&(qfe[Qfe]=Wfe(Zfe**.5)),$fe[Qfe]=Wfe(Zfe**(1/3)),Qfe+=1),Zfe+=1;const Kfe=[];class Yfe extends lfe{_doReset(){this._hash=new sfe(qfe.slice(0))}_doProcessBlock(e,t){const n=this._hash.words;let r=n[0],s=n[1],i=n[2],a=n[3],o=n[4],c=n[5],l=n[6],u=n[7];for(let n=0;n<64;n+=1){if(n<16)Kfe[n]=0|e[t+n];else{const e=Kfe[n-15],t=(e<<25|e>>>7)^(e<<14|e>>>18)^e>>>3,r=Kfe[n-2],s=(r<<15|r>>>17)^(r<<13|r>>>19)^r>>>10;Kfe[n]=t+Kfe[n-7]+s+Kfe[n-16]}const d=r&s^r&i^s&i,h=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),p=u+((o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25))+(o&c^~o&l)+$fe[n]+Kfe[n];u=l,l=c,c=o,o=a+p|0,a=i,i=s,s=r,r=p+(h+d)|0}n[0]=n[0]+r|0,n[1]=n[1]+s|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+o|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+u|0}_doFinalize(){const e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash}clone(){const e=super.clone.call(this);return e._hash=this._hash.clone(),e}}const Jfe=lfe._createHelper(Yfe),Xfe=lfe._createHmacHelper(Yfe);class eme extends Yfe{_doReset(){this._hash=new sfe([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])}_doFinalize(){const e=super._doFinalize.call(this);return e.sigBytes-=4,e}}const tme=Yfe._createHelper(eme),nme=Yfe._createHmacHelper(eme),rme=[new hfe(1116352408,3609767458),new hfe(1899447441,602891725),new hfe(3049323471,3964484399),new hfe(3921009573,2173295548),new hfe(961987163,4081628472),new hfe(1508970993,3053834265),new hfe(2453635748,2937671579),new hfe(2870763221,3664609560),new hfe(3624381080,2734883394),new hfe(310598401,1164996542),new hfe(607225278,1323610764),new hfe(1426881987,3590304994),new hfe(1925078388,4068182383),new hfe(2162078206,991336113),new hfe(2614888103,633803317),new hfe(3248222580,3479774868),new hfe(3835390401,2666613458),new hfe(4022224774,944711139),new hfe(264347078,2341262773),new hfe(604807628,2007800933),new hfe(770255983,1495990901),new hfe(1249150122,1856431235),new hfe(1555081692,3175218132),new hfe(1996064986,2198950837),new hfe(2554220882,3999719339),new hfe(2821834349,766784016),new hfe(2952996808,2566594879),new hfe(3210313671,3203337956),new hfe(3336571891,1034457026),new hfe(3584528711,2466948901),new hfe(113926993,3758326383),new hfe(338241895,168717936),new hfe(666307205,1188179964),new hfe(773529912,1546045734),new hfe(1294757372,1522805485),new hfe(1396182291,2643833823),new hfe(1695183700,2343527390),new hfe(1986661051,1014477480),new hfe(2177026350,1206759142),new hfe(2456956037,344077627),new hfe(2730485921,1290863460),new hfe(2820302411,3158454273),new hfe(3259730800,3505952657),new hfe(3345764771,106217008),new hfe(3516065817,3606008344),new hfe(3600352804,1432725776),new hfe(4094571909,1467031594),new hfe(275423344,851169720),new hfe(430227734,3100823752),new hfe(506948616,1363258195),new hfe(659060556,3750685593),new hfe(883997877,3785050280),new hfe(958139571,3318307427),new hfe(1322822218,3812723403),new hfe(1537002063,2003034995),new hfe(1747873779,3602036899),new hfe(1955562222,1575990012),new hfe(2024104815,1125592928),new hfe(2227730452,2716904306),new hfe(2361852424,442776044),new hfe(2428436474,593698344),new hfe(2756734187,3733110249),new hfe(3204031479,2999351573),new hfe(3329325298,3815920427),new hfe(3391569614,3928383900),new hfe(3515267271,566280711),new hfe(3940187606,3454069534),new hfe(4118630271,4000239992),new hfe(116418474,1914138554),new hfe(174292421,2731055270),new hfe(289380356,3203993006),new hfe(460393269,320620315),new hfe(685471733,587496836),new hfe(852142971,1086792851),new hfe(1017036298,365543100),new hfe(1126000580,2618297676),new hfe(1288033470,3409855158),new hfe(1501505948,4234509866),new hfe(1607167915,987167468),new hfe(1816402316,1246189591)],sme=[];for(let e=0;e<80;e+=1)sme[e]=new hfe;class ime extends lfe{constructor(){super(),this.blockSize=32}_doReset(){this._hash=new pfe([new hfe(1779033703,4089235720),new hfe(3144134277,2227873595),new hfe(1013904242,4271175723),new hfe(2773480762,1595750129),new hfe(1359893119,2917565137),new hfe(2600822924,725511199),new hfe(528734635,4215389547),new hfe(1541459225,327033209)])}_doProcessBlock(e,t){const n=this._hash.words,r=n[0],s=n[1],i=n[2],a=n[3],o=n[4],c=n[5],l=n[6],u=n[7],d=r.high;let h=r.low;const p=s.high;let f=s.low;const m=i.high;let b=i.low;const g=a.high;let y=a.low;const v=o.high;let w=o.low;const x=c.high;let k=c.low;const E=l.high;let A=l.low;const C=u.high;let P=u.low,_=d,S=h,I=p,B=f,T=m,M=b,O=g,N=y,R=v,F=w,j=x,L=k,U=E,D=A,z=C,H=P;for(let n=0;n<80;n+=1){let r,s;const i=sme[n];if(n<16)i.high=0|e[t+2*n],s=i.high,i.low=0|e[t+2*n+1],r=i.low;else{const e=sme[n-15],t=e.high,a=e.low,o=(t>>>1|a<<31)^(t>>>8|a<<24)^t>>>7,c=(a>>>1|t<<31)^(a>>>8|t<<24)^(a>>>7|t<<25),l=sme[n-2],u=l.high,d=l.low,h=(u>>>19|d<<13)^(u<<3|d>>>29)^u>>>6,p=(d>>>19|u<<13)^(d<<3|u>>>29)^(d>>>6|u<<26),f=sme[n-7],m=f.high,b=f.low,g=sme[n-16],y=g.high,v=g.low;r=c+b,s=o+m+(r>>>0>>0?1:0),r+=p,s=s+h+(r>>>0

>>0?1:0),r+=v,s=s+y+(r>>>0>>0?1:0),i.high=s,i.low=r}const a=R&j^~R&U,o=F&L^~F&D,c=_&I^_&T^I&T,l=S&B^S&M^B&M,u=(_>>>28|S<<4)^(_<<30|S>>>2)^(_<<25|S>>>7),d=(S>>>28|_<<4)^(S<<30|_>>>2)^(S<<25|_>>>7),h=(R>>>14|F<<18)^(R>>>18|F<<14)^(R<<23|F>>>9),p=(F>>>14|R<<18)^(F>>>18|R<<14)^(F<<23|R>>>9),f=rme[n],m=f.high,b=f.low;let g=H+p,y=z+h+(g>>>0>>0?1:0);g+=o,y=y+a+(g>>>0>>0?1:0),g+=b,y=y+m+(g>>>0>>0?1:0),g+=r,y=y+s+(g>>>0>>0?1:0);const v=d+l;z=U,H=D,U=j,D=L,j=R,L=F,F=N+g|0,R=O+y+(F>>>0>>0?1:0)|0,O=T,N=M,T=I,M=B,I=_,B=S,S=g+v|0,_=y+(u+c+(v>>>0>>0?1:0))+(S>>>0>>0?1:0)|0}r.low=h+S,h=r.low,r.high=d+_+(h>>>0>>0?1:0),s.low=f+B,f=s.low,s.high=p+I+(f>>>0>>0?1:0),i.low=b+M,b=i.low,i.high=m+T+(b>>>0>>0?1:0),a.low=y+N,y=a.low,a.high=g+O+(y>>>0>>0?1:0),o.low=w+F,w=o.low,o.high=v+R+(w>>>0>>0?1:0),c.low=k+L,k=c.low,c.high=x+j+(k>>>0>>0?1:0),l.low=A+D,A=l.low,l.high=E+U+(A>>>0>>0?1:0),u.low=P+H,P=u.low,u.high=C+z+(P>>>0>>0?1:0)}_doFinalize(){const e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process();return this._hash.toX32()}clone(){const e=super.clone.call(this);return e._hash=this._hash.clone(),e}}const ame=lfe._createHelper(ime),ome=lfe._createHmacHelper(ime);class cme extends ime{_doReset(){this._hash=new pfe([new hfe(3418070365,3238371032),new hfe(1654270250,914150663),new hfe(2438529370,812702999),new hfe(355462360,4144912697),new hfe(1731405415,4290775857),new hfe(2394180231,1750603025),new hfe(3675008525,1694076839),new hfe(1203062813,3204075428)])}_doFinalize(){const e=super._doFinalize.call(this);return e.sigBytes-=16,e}}const lme=ime._createHelper(cme),ume=ime._createHmacHelper(cme),dme=[],hme=[],pme=[];let fme=1,mme=0;for(let e=0;e<24;e+=1){dme[fme+5*mme]=(e+1)*(e+2)/2%64;const t=(2*fme+3*mme)%5;fme=mme%5,mme=t}for(let e=0;e<5;e+=1)for(let t=0;t<5;t+=1)hme[e+5*t]=t+(2*e+3*t)%5*5;let bme=1;for(let e=0;e<24;e+=1){let t=0,n=0;for(let e=0;e<7;e+=1){if(1&bme){const r=(1<>>24)|4278255360&(r<<24|r>>>8),i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);const a=n[s];a.high^=i,a.low^=r}for(let e=0;e<24;e+=1){for(let e=0;e<5;e+=1){let t=0,r=0;for(let s=0;s<5;s+=1){const i=n[e+5*s];t^=i.high,r^=i.low}const s=gme[e];s.high=t,s.low=r}for(let e=0;e<5;e+=1){const t=gme[(e+4)%5],r=gme[(e+1)%5],s=r.high,i=r.low,a=t.high^(s<<1|i>>>31),o=t.low^(i<<1|s>>>31);for(let t=0;t<5;t+=1){const r=n[e+5*t];r.high^=a,r.low^=o}}for(let e=1;e<25;e+=1){let t,r;const s=n[e],i=s.high,a=s.low,o=dme[e];o<32?(t=i<>>32-o,r=a<>>32-o):(t=a<>>64-o,r=i<>>64-o);const c=gme[hme[e]];c.high=t,c.low=r}const t=gme[0],r=n[0];t.high=r.high,t.low=r.low;for(let e=0;e<5;e+=1)for(let t=0;t<5;t+=1){const r=e+5*t,s=n[r],i=gme[r],a=gme[(e+1)%5+5*t],o=gme[(e+2)%5+5*t];s.high=i.high^~a.high&o.high,s.low=i.low^~a.low&o.low}const s=n[0],i=pme[e];s.high^=i.high,s.low^=i.low}}_doFinalize(){const e=this._data,t=e.words,n=8*e.sigBytes,r=32*this.blockSize;t[n>>>5]|=1<<24-n%32,t[(Math.ceil((n+1)/r)*r>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();const s=this._state,i=this.cfg.outputLength/8,a=i/8,o=[];for(let e=0;e>>24)|4278255360&(n<<24|n>>>8),r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),o.push(r),o.push(n)}return new sfe(o,i)}clone(){const e=super.clone.call(this);e._state=this._state.slice(0);const t=e._state;for(let e=0;e<25;e+=1)t[e]=t[e].clone();return e}}const vme=lfe._createHelper(yme),wme=lfe._createHmacHelper(yme),xme=sfe.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),kme=sfe.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),Eme=sfe.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),Ame=sfe.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),Cme=sfe.create([0,1518500249,1859775393,2400959708,2840853838]),Pme=sfe.create([1352829926,1548603684,1836072691,2053994217,0]),_me=(e,t,n)=>e^t^n,Sme=(e,t,n)=>e&t|~e&n,Ime=(e,t,n)=>(e|~t)^n,Bme=(e,t,n)=>e&n|t&~n,Tme=(e,t,n)=>e^(t|~n),Mme=(e,t)=>e<>>32-t;class Ome extends lfe{_doReset(){this._hash=sfe.create([1732584193,4023233417,2562383102,271733878,3285377520])}_doProcessBlock(e,t){const n=e;for(let e=0;e<16;e+=1){const r=t+e,s=n[r];n[r]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}const r=this._hash.words,s=Cme.words,i=Pme.words,a=xme.words,o=kme.words,c=Eme.words,l=Ame.words;let u,d=r[0],h=r[1],p=r[2],f=r[3],m=r[4],b=r[0],g=r[1],y=r[2],v=r[3],w=r[4];for(let e=0;e<80;e+=1)u=d+n[t+a[e]]|0,u+=e<16?_me(h,p,f)+s[0]:e<32?Sme(h,p,f)+s[1]:e<48?Ime(h,p,f)+s[2]:e<64?Bme(h,p,f)+s[3]:Tme(h,p,f)+s[4],u|=0,u=Mme(u,c[e]),u=u+m|0,d=m,m=f,f=Mme(p,10),p=h,h=u,u=b+n[t+o[e]]|0,u+=e<16?Tme(g,y,v)+i[0]:e<32?Bme(g,y,v)+i[1]:e<48?Ime(g,y,v)+i[2]:e<64?Sme(g,y,v)+i[3]:_me(g,y,v)+i[4],u|=0,u=Mme(u,l[e]),u=u+w|0,b=w,w=v,v=Mme(y,10),y=g,g=u;u=r[1]+p+v|0,r[1]=r[2]+f+w|0,r[2]=r[3]+m+b|0,r[3]=r[4]+d+g|0,r[4]=r[0]+h+y|0,r[0]=u}_doFinalize(){const e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();const s=this._hash,i=s.words;for(let e=0;e<5;e+=1){const t=i[e];i[e]=16711935&(t<<8|t>>>24)|4278255360&(t<<24|t>>>8)}return s}clone(){const e=super.clone.call(this);return e._hash=this._hash.clone(),e}}const Nme=lfe._createHelper(Ome),Rme=lfe._createHmacHelper(Ome);class Fme extends rfe{constructor(e){super(),this.cfg=Object.assign(new rfe,{keySize:4,hasher:zfe,iterations:1},e)}compute(e,t){const{cfg:n}=this,r=ufe.create(n.hasher,e),s=sfe.create(),i=sfe.create([1]),a=s.words,o=i.words,{keySize:c,iterations:l}=n;for(;a.length>>8^255&e^99,jme[Zme]=e,Lme[e]=Zme;const t=Wme[Zme],n=Wme[t],r=Wme[n];let s=257*Wme[e]^16843008*e;Ume[Zme]=s<<24|s>>>8,Dme[Zme]=s<<16|s>>>16,zme[Zme]=s<<8|s>>>24,Hme[Zme]=s,s=16843009*r^65537*n^257*t^16843008*Zme,Gme[e]=s<<24|s>>>8,qme[e]=s<<16|s>>>16,$me[e]=s<<8|s>>>24,Vme[e]=s,Zme?(Zme=t^Wme[Wme[Wme[r^t]]],Qme^=Wme[Wme[Qme]]):(Qme=1,Zme=Qme)}const Kme=[0,1,2,4,8,16,32,64,128,27,54];class Yme extends Bfe{_doReset(){let e;if(this._nRounds&&this._keyPriorReset===this._key)return;this._keyPriorReset=this._key;const t=this._keyPriorReset,n=t.words,r=t.sigBytes/4;this._nRounds=r+6;const s=4*(this._nRounds+1);this._keySchedule=[];const i=this._keySchedule;for(let t=0;t6&&t%r==4&&(e=jme[e>>>24]<<24|jme[e>>>16&255]<<16|jme[e>>>8&255]<<8|jme[255&e]):(e=e<<8|e>>>24,e=jme[e>>>24]<<24|jme[e>>>16&255]<<16|jme[e>>>8&255]<<8|jme[255&e],e^=Kme[t/r|0]<<24),i[t]=i[t-r]^e);this._invKeySchedule=[];const a=this._invKeySchedule;for(let t=0;t>>24]]^qme[jme[e>>>16&255]]^$me[jme[e>>>8&255]]^Vme[jme[255&e]]}}encryptBlock(e,t){this._doCryptBlock(e,t,this._keySchedule,Ume,Dme,zme,Hme,jme)}decryptBlock(e,t){const n=e;let r=n[t+1];n[t+1]=n[t+3],n[t+3]=r,this._doCryptBlock(n,t,this._invKeySchedule,Gme,qme,$me,Vme,Lme),r=n[t+1],n[t+1]=n[t+3],n[t+3]=r}_doCryptBlock(e,t,n,r,s,i,a,o){const c=e,l=this._nRounds;let u=c[t]^n[0],d=c[t+1]^n[1],h=c[t+2]^n[2],p=c[t+3]^n[3],f=4;for(let e=1;e>>24]^s[d>>>16&255]^i[h>>>8&255]^a[255&p]^n[f];f+=1;const t=r[d>>>24]^s[h>>>16&255]^i[p>>>8&255]^a[255&u]^n[f];f+=1;const o=r[h>>>24]^s[p>>>16&255]^i[u>>>8&255]^a[255&d]^n[f];f+=1;const c=r[p>>>24]^s[u>>>16&255]^i[d>>>8&255]^a[255&h]^n[f];f+=1,u=e,d=t,h=o,p=c}const m=(o[u>>>24]<<24|o[d>>>16&255]<<16|o[h>>>8&255]<<8|o[255&p])^n[f];f+=1;const b=(o[d>>>24]<<24|o[h>>>16&255]<<16|o[p>>>8&255]<<8|o[255&u])^n[f];f+=1;const g=(o[h>>>24]<<24|o[p>>>16&255]<<16|o[u>>>8&255]<<8|o[255&d])^n[f];f+=1;const y=(o[p>>>24]<<24|o[u>>>16&255]<<16|o[d>>>8&255]<<8|o[255&h])^n[f];f+=1,c[t]=m,c[t+1]=b,c[t+2]=g,c[t+3]=y}}Yme.keySize=8;const Jme=Bfe._createHelper(Yme),Xme=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],ebe=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],tbe=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],nbe=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],rbe=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679];function sbe(e,t){const n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<>>5]>>>31-r%32&1}this._subKeys=[];const n=this._subKeys;for(let e=0;e<16;e+=1){n[e]=[];const r=n[e],s=tbe[e];for(let e=0;e<24;e+=1)r[e/6|0]|=t[(ebe[e]-1+s)%28]<<31-e%6,r[4+(e/6|0)]|=t[28+(ebe[e+24]-1+s)%28]<<31-e%6;r[0]=r[0]<<1|r[0]>>>31;for(let e=1;e<7;e+=1)r[e]>>>=4*(e-1)+3;r[7]=r[7]<<5|r[7]>>>27}this._invSubKeys=[];const r=this._invSubKeys;for(let e=0;e<16;e+=1)r[e]=n[15-e]}encryptBlock(e,t){this._doCryptBlock(e,t,this._subKeys)}decryptBlock(e,t){this._doCryptBlock(e,t,this._invSubKeys)}_doCryptBlock(e,t,n){const r=e;this._lBlock=e[t],this._rBlock=e[t+1],sbe.call(this,4,252645135),sbe.call(this,16,65535),ibe.call(this,2,858993459),ibe.call(this,8,16711935),sbe.call(this,1,1431655765);for(let e=0;e<16;e+=1){const t=n[e],r=this._lBlock,s=this._rBlock;let i=0;for(let e=0;e<8;e+=1)i|=nbe[e][((s^t[e])&rbe[e])>>>0];this._lBlock=s,this._rBlock=r^i}const s=this._lBlock;this._lBlock=this._rBlock,this._rBlock=s,sbe.call(this,1,1431655765),ibe.call(this,8,16711935),ibe.call(this,2,858993459),sbe.call(this,16,65535),sbe.call(this,4,252645135),r[t]=this._lBlock,r[t+1]=this._rBlock}}abe.keySize=2,abe.ivSize=2,abe.blockSize=2;const obe=Bfe._createHelper(abe);class cbe extends Bfe{_doReset(){const e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");const t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),r=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=abe.createEncryptor(sfe.create(t)),this._des2=abe.createEncryptor(sfe.create(n)),this._des3=abe.createEncryptor(sfe.create(r))}encryptBlock(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)}decryptBlock(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)}}cbe.keySize=6,cbe.ivSize=2,cbe.blockSize=2;const lbe=Bfe._createHelper(cbe),ube=[],dbe=[],hbe=[];function pbe(){const e=this._X,t=this._C;for(let e=0;e<8;e+=1)dbe[e]=t[e];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(let n=0;n<8;n+=1){const r=e[n]+t[n],s=65535&r,i=r>>>16,a=((s*s>>>17)+s*i>>>15)+i*i,o=((4294901760&r)*r|0)+((65535&r)*r|0);hbe[n]=a^o}e[0]=hbe[0]+(hbe[7]<<16|hbe[7]>>>16)+(hbe[6]<<16|hbe[6]>>>16)|0,e[1]=hbe[1]+(hbe[0]<<8|hbe[0]>>>24)+hbe[7]|0,e[2]=hbe[2]+(hbe[1]<<16|hbe[1]>>>16)+(hbe[0]<<16|hbe[0]>>>16)|0,e[3]=hbe[3]+(hbe[2]<<8|hbe[2]>>>24)+hbe[1]|0,e[4]=hbe[4]+(hbe[3]<<16|hbe[3]>>>16)+(hbe[2]<<16|hbe[2]>>>16)|0,e[5]=hbe[5]+(hbe[4]<<8|hbe[4]>>>24)+hbe[3]|0,e[6]=hbe[6]+(hbe[5]<<16|hbe[5]>>>16)+(hbe[4]<<16|hbe[4]>>>16)|0,e[7]=hbe[7]+(hbe[6]<<8|hbe[6]>>>24)+hbe[5]|0}class fbe extends Cfe{constructor(...e){super(...e),this.blockSize=4,this.ivSize=2}_doReset(){const e=this._key.words,{iv:t}=this.cfg;for(let t=0;t<4;t+=1)e[t]=16711935&(e[t]<<8|e[t]>>>24)|4278255360&(e[t]<<24|e[t]>>>8);this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16];const n=this._X;this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];const r=this._C;this._b=0;for(let e=0;e<4;e+=1)pbe.call(this);for(let e=0;e<8;e+=1)r[e]^=n[e+4&7];if(t){const e=t.words,n=e[0],s=e[1],i=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),a=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),o=i>>>16|4294901760&a,c=a<<16|65535&i;r[0]^=i,r[1]^=o,r[2]^=a,r[3]^=c,r[4]^=i,r[5]^=o,r[6]^=a,r[7]^=c;for(let e=0;e<4;e+=1)pbe.call(this)}}_doProcessBlock(e,t){const n=e,r=this._X;pbe.call(this),ube[0]=r[0]^r[5]>>>16^r[3]<<16,ube[1]=r[2]^r[7]>>>16^r[5]<<16,ube[2]=r[4]^r[1]>>>16^r[7]<<16,ube[3]=r[6]^r[3]>>>16^r[1]<<16;for(let e=0;e<4;e+=1)ube[e]=16711935&(ube[e]<<8|ube[e]>>>24)|4278255360&(ube[e]<<24|ube[e]>>>8),n[t+e]^=ube[e]}}const mbe=Cfe._createHelper(fbe),bbe=[],gbe=[],ybe=[];function vbe(){const e=this._X,t=this._C;for(let e=0;e<8;e+=1)gbe[e]=t[e];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(let n=0;n<8;n+=1){const r=e[n]+t[n],s=65535&r,i=r>>>16,a=((s*s>>>17)+s*i>>>15)+i*i,o=((4294901760&r)*r|0)+((65535&r)*r|0);ybe[n]=a^o}e[0]=ybe[0]+(ybe[7]<<16|ybe[7]>>>16)+(ybe[6]<<16|ybe[6]>>>16)|0,e[1]=ybe[1]+(ybe[0]<<8|ybe[0]>>>24)+ybe[7]|0,e[2]=ybe[2]+(ybe[1]<<16|ybe[1]>>>16)+(ybe[0]<<16|ybe[0]>>>16)|0,e[3]=ybe[3]+(ybe[2]<<8|ybe[2]>>>24)+ybe[1]|0,e[4]=ybe[4]+(ybe[3]<<16|ybe[3]>>>16)+(ybe[2]<<16|ybe[2]>>>16)|0,e[5]=ybe[5]+(ybe[4]<<8|ybe[4]>>>24)+ybe[3]|0,e[6]=ybe[6]+(ybe[5]<<16|ybe[5]>>>16)+(ybe[4]<<16|ybe[4]>>>16)|0,e[7]=ybe[7]+(ybe[6]<<8|ybe[6]>>>24)+ybe[5]|0}class wbe extends Cfe{constructor(...e){super(...e),this.blockSize=4,this.ivSize=2}_doReset(){const e=this._key.words,{iv:t}=this.cfg;this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16];const n=this._X;this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];const r=this._C;this._b=0;for(let e=0;e<4;e+=1)vbe.call(this);for(let e=0;e<8;e+=1)r[e]^=n[e+4&7];if(t){const e=t.words,n=e[0],s=e[1],i=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),a=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),o=i>>>16|4294901760&a,c=a<<16|65535&i;r[0]^=i,r[1]^=o,r[2]^=a,r[3]^=c,r[4]^=i,r[5]^=o,r[6]^=a,r[7]^=c;for(let e=0;e<4;e+=1)vbe.call(this)}}_doProcessBlock(e,t){const n=e,r=this._X;vbe.call(this),bbe[0]=r[0]^r[5]>>>16^r[3]<<16,bbe[1]=r[2]^r[7]>>>16^r[5]<<16,bbe[2]=r[4]^r[1]>>>16^r[7]<<16,bbe[3]=r[6]^r[3]>>>16^r[1]<<16;for(let e=0;e<4;e+=1)bbe[e]=16711935&(bbe[e]<<8|bbe[e]>>>24)|4278255360&(bbe[e]<<24|bbe[e]>>>8),n[t+e]^=bbe[e]}}const xbe=Cfe._createHelper(wbe);function kbe(){const e=this._S;let t=this._i,n=this._j,r=0;for(let s=0;s<4;s+=1){t=(t+1)%256,n=(n+e[t])%256;const i=e[t];e[t]=e[n],e[n]=i,r|=e[(e[t]+e[n])%256]<<24-8*s}return this._i=t,this._j=n,r}class Ebe extends Cfe{_doReset(){const e=this._key,t=e.words,n=e.sigBytes;this._S=[];const r=this._S;for(let e=0;e<256;e+=1)r[e]=e;for(let e=0,s=0;e<256;e+=1){const i=e%n,a=t[i>>>2]>>>24-i%4*8&255;s=(s+r[e]+a)%256;const o=r[e];r[e]=r[s],r[s]=o}this._j=0,this._i=this._j}_doProcessBlock(e,t){e[t]^=kbe.call(this)}}Ebe.keySize=8,Ebe.ivSize=0;const Abe=Cfe._createHelper(Ebe);class Cbe extends Ebe{constructor(...e){super(...e),Object.assign(this.cfg,{drop:192})}_doReset(){super._doReset.call(this);for(let e=this.cfg.drop;e>0;e-=1)kbe.call(this)}}const Pbe=Cfe._createHelper(Cbe);function _be(e,t,n,r){const s=e;let i;const a=this._iv;a?(i=a.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(let e=0;e{let t=e;if(255&~(e>>24))t+=1<<24;else{let n=e>>16&255,r=e>>8&255,s=255&e;255===n?(n=0,255===r?(r=0,255===s?s=0:s+=1):r+=1):n+=1,t=0,t+=n<<16,t+=r<<8,t+=s}return t}; /** @preserve * Counter block mode compatible with Dr Brian Gladman fileenc.c * derived from CryptoJS.mode.CTR * Jan Hruby jhruby.web@gmail.com */ class Tbe extends Pfe{}Tbe.Encryptor=class extends Tbe{processBlock(e,t){const n=e,r=this._cipher,{blockSize:s}=r,i=this._iv;let a=this._counter;i&&(this._counter=i.slice(0),a=this._counter,this._iv=void 0),(e=>{const t=e;t[0]=Bbe(t[0]),0===t[0]&&(t[1]=Bbe(t[1]))})(a);const o=a.slice(0);r.encryptBlock(o,0);for(let e=0;e>>2]|=i<<24-a%4*8,n.sigBytes+=i},unpad(e){const t=e,n=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=n}},Rbe={pad(e,t){const n=4*t,r=n-e.sigBytes%n;e.concat(sfe.random(r-1)).concat(sfe.create([r<<24],1))},unpad(e){const t=e,n=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=n}},Fbe={pad(e,t){const n=e,r=4*t;n.clamp(),n.sigBytes+=r-(e.sigBytes%r||r)},unpad(e){const t=e,n=t.words;for(let e=t.sigBytes-1;e>=0;e-=1)if(n[e>>>2]>>>24-e%4*8&255){t.sigBytes=e+1;break}}},jbe={pad(e,t){e.concat(sfe.create([2147483648],1)),Fbe.pad(e,t)},unpad(e){const t=e;Fbe.unpad(t),t.sigBytes-=1}},Lbe={pad(){},unpad(){}},Ube={stringify:e=>e.ciphertext.toString(ife),parse(e){const t=ife.parse(e);return Tfe.create({ciphertext:t})}};var Dbe={lib:{Base:rfe,WordArray:sfe,BufferedBlockAlgorithm:cfe,Hasher:lfe,Cipher:Afe,StreamCipher:Cfe,BlockCipherMode:Pfe,BlockCipher:Bfe,CipherParams:Tfe,SerializableCipher:Ofe,PasswordBasedCipher:Rfe},x64:{Word:hfe,WordArray:pfe},enc:{Hex:ife,Latin1:afe,Utf8:ofe,Utf16:Lfe,Utf16BE:jfe,Utf16LE:Ufe,Base64:ffe},algo:{HMAC:ufe,MD5:wfe,SHA1:zfe,SHA224:eme,SHA256:Yfe,SHA384:cme,SHA512:ime,SHA3:yme,RIPEMD160:Ome,PBKDF2:Fme,EvpKDF:Efe,AES:Yme,DES:abe,TripleDES:cbe,Rabbit:fbe,RabbitLegacy:wbe,RC4:Ebe,RC4Drop:Cbe},mode:{CBC:Sfe,CFB:Sbe,CTR:Ibe,CTRGladman:Tbe,ECB:Mbe,OFB:Obe},pad:{Pkcs7:Ife,AnsiX923:Nbe,Iso10126:Rbe,Iso97971:jbe,NoPadding:Lbe,ZeroPadding:Fbe},format:{OpenSSL:Mfe,Hex:Ube},kdf:{OpenSSL:Nfe},MD5:xfe,HmacMD5:kfe,SHA1:Hfe,HmacSHA1:Gfe,SHA224:tme,HmacSHA224:nme,SHA256:Jfe,HmacSHA256:Xfe,SHA384:lme,HmacSHA384:ume,SHA512:ame,HmacSHA512:ome,SHA3:vme,HmacSHA3:wme,RIPEMD160:Nme,HmacRIPEMD160:Rme,PBKDF2:(e,t,n)=>Fme.create(n).compute(e,t),EvpKDF:(e,t,n)=>Efe.create(n).compute(e,t),AES:Jme,DES:obe,TripleDES:lbe,Rabbit:mbe,RabbitLegacy:xbe,RC4:Abe,RC4Drop:Pbe};let zbe=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"");function Hbe(e){return"function"==typeof e}var Gbe=!1,qbe={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;Gbe=e},get useDeprecatedSynchronousErrorHandling(){return Gbe}};function $be(e){setTimeout((function(){throw e}),0)}var Vbe={closed:!0,next:function(e){},error:function(e){if(qbe.useDeprecatedSynchronousErrorHandling)throw e;$be(e)},complete:function(){}},Wbe=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();function Zbe(e){return null!==e&&"object"==typeof e}var Qbe=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),Kbe=Qbe,Ybe=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this,r=n._parentOrParents,s=n._ctorUnsubscribe,i=n._unsubscribe,a=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof e)r.remove(this);else if(null!==r)for(var o=0;o0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},n}(Pge);function Bge(e,t,n,r){return Hbe(n)&&(r=n,n=void 0),r?Bge(e,t,n).pipe(vge((function(e){return Wbe(e)?r.apply(void 0,e):r(e)}))):new sge((function(r){Tge(e,t,(function(e){arguments.length>1?r.next(Array.prototype.slice.call(arguments)):r.next(e)}),r,n)}))}function Tge(e,t,n,r,s){var i;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(e)){var a=e;e.addEventListener(t,n,s),i=function(){return a.removeEventListener(t,n,s)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(e)){var o=e;e.on(t,n),i=function(){return o.off(t,n)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(e)){var c=e;e.addListener(t,n),i=function(){return c.removeListener(t,n)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var l=0,u=e.length;l=0}function Oge(){for(var e=[],t=0;t1&&"number"==typeof e[e.length-1]&&(n=e.pop())):"number"==typeof s&&(n=e.pop()),null===r&&1===e.length&&e[0]instanceof sge?e[0]:function(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),_ge(rge,e)}(n)(gge(e,r))}function Nge(e){var t=e.index,n=e.period,r=e.subscriber;if(r.next(t),!r.closed){if(-1===n)return r.complete();e.index=t+1,this.schedule(e,n)}}const Rge={ethereum:{1:"main",11155111:"sepolia",100:"xdai",137:"matic-main",80002:"matic-amoy"}},Fge=[2,3,4,42,56,250],jge={points:150,duration:1};function Lge(e){const{name:t,value:n,type:r,optional:s,customValidation:i}=e;if(!s&&void 0===n)throw new Error(`"${t}" is required`);if(void 0!==n&&("array"===r?Array.isArray(r):typeof n!==r))throw new Error(`"${t}" must be of type: ${r}, received type: ${typeof n} from value: ${n}`);if(void 0!==n&&i&&!i(n))throw new Error(`"${n}" is not a valid "${t}"`)}function Uge(e){Lge({name:"sdk options",value:e,type:"object"});const{dappId:t,system:n,name:r,appVersion:s,networkId:i,transactionHandlers:a,apiUrl:o,ws:c,onopen:l,ondown:u,onreopen:d,onerror:h,onclose:p,...f}=e;!function(e,t,n){const r=Object.keys(e);if(r.length>0)throw new Error(`${r[0]} is not a valid parameter for ${n}, must be one of the following valid parameters: ${t.join(", ")}`)}(f,["dappId","system","name","appVersion","networkId","transactionHandlers","apiUrl","ws","onopen","ondown","onreopen","onerror","onclose"],"Initialization Options"),Lge({name:"dappId",value:t,type:"string",optional:!0}),Lge({name:"system",value:n,type:"string",optional:!0,customValidation:Dge}),Lge({name:"name",value:r,type:"string",optional:!0}),Lge({name:"appVersion",value:s,type:"string",optional:!0}),Lge({name:"networkId",value:i,type:"number"}),Fge.includes(i)&&console.error(`Blocknative SDK: Network with ID: ${i} has been deprecated and you will no longer receive transaction events on this network.`),Lge({name:"transactionHandler",value:a,type:"array",optional:!0}),a&&a.forEach((e=>Lge({name:"transactionHandler",value:e,type:"function"}))),Lge({name:"apiUrl",value:o,type:"string",optional:!0}),Lge({name:"ws",value:c,type:"function",optional:!0}),Lge({name:"onopen",value:l,type:"function",optional:!0}),Lge({name:"ondown",value:u,type:"function",optional:!0}),Lge({name:"onreopen",value:d,type:"function",optional:!0}),Lge({name:"onerror",value:h,type:"function",optional:!0}),Lge({name:"onclose",value:p,type:"function",optional:!0})}function Dge(e){return!!Rge[e]}function zge(){return{listeners:{},on:function(e,t){switch(e){case"txSent":case"txPool":case"txConfirmed":case"txSpeedUp":case"txCancel":case"txFailed":case"txDropped":case"txRequest":case"nsfFail":case"txRepeat":case"txAwaitingApproval":case"txConfirmReminder":case"txSendFail":case"txError":case"txUnderPriced":case"txPoolSimulation":case"all":break;default:throw new Error(`${e} is not a valid event code, for a list of valid event codes see: https://docs.blocknative.com/notify-sdk#event-codes`)}if("function"!=typeof t)throw new Error("Listener must be a function");this.listeners[e]=t},off:function(e){delete this.listeners[e]},emit:function(e){return this.listeners[e.eventCode]?this.listeners[e.eventCode](e):this.listeners.all?this.listeners.all(e):void 0}}}function Hge(e,t){return Rge[e][t]}function Gge(e){return new Promise((t=>{setTimeout(t,e)}))}const qge=(e,t)=>void 0===t?"undefined":t;function $ge(){if("undefined"!=typeof window&&"localStorage"in window){const e="__testLocalStorage";try{return window.localStorage.setItem(e,"1"),window.localStorage.removeItem(e),!0}catch(e){return!1}}return!1}function Vge(e,t){if(this._destroyed)throw new Error("The WebSocket instance has been destroyed, re-initialize to continue making requests.");const n=Date.now(),r=zge(),s="txSent";this.watchedTransactions.push({hash:e,emitter:r});const i={..."ethereum"===this._system?{hash:e}:{txid:e},id:t||e,startTime:n,status:"sent"},a={...i,eventCode:s};this._sendMessage({eventCode:s,categoryCode:"activeTransaction",transaction:i});const o={details:a,emitter:r};return setTimeout(function(){const e=r.emit(a);this._transactionHandlers.forEach((t=>t({transaction:a,emitterResult:e})))}.bind(this),5),o}function Wge(e){if(this._destroyed)throw new Error("The WebSocket instance has been destroyed, re-initialize to continue making requests.");e="ethereum"===this._system?e.toLowerCase():e;const t=zge(),n=this.watchedAccounts.find((t=>t.address===e));return n?n.emitters.push(t):this.watchedAccounts.push({address:e,emitters:[t]}),this._sendMessage({eventCode:"watch",categoryCode:"accountAddress",account:{address:e}}),{emitter:t,details:{address:e}}}function Zge(e){if(this._destroyed)throw new Error("The WebSocket instance has been destroyed, re-initialize to continue making requests.");this._sendMessage(e)} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var Qge=function(e,t){return Qge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Qge(e,t)};function Kge(e,t){function n(){this.constructor=e}Qge(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Yge(e){return"function"==typeof e}var Jge=!1,Xge={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;Jge=e},get useDeprecatedSynchronousErrorHandling(){return Jge}};function eye(e){setTimeout((function(){throw e}),0)}var tye={closed:!0,next:function(e){},error:function(e){if(Xge.useDeprecatedSynchronousErrorHandling)throw e;eye(e)},complete:function(){}},nye=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();function rye(e){return null!==e&&"object"==typeof e}var sye=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),iye=sye,aye=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this,r=n._parentOrParents,s=n._ctorUnsubscribe,i=n._unsubscribe,a=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof e)r.remove(this);else if(null!==r)for(var o=0;o{zye.pipe(Cye((({eventId:e})=>e===r)),Sye(1)).subscribe({next:({transaction:t})=>e(t),error:({error:e})=>t(e.message)})}))}function Gye(e){if(this._destroyed)throw new Error("The WebSocket instance has been destroyed, re-initialize to continue making requests.");const t=zbe();return this._sendMessage({categoryCode:"simulate",eventCode:"txSimulation",eventId:t,transaction:e}),new Promise(((e,n)=>{zye.pipe(Cye((({eventId:e})=>e===t)),Sye(1)).subscribe({next:({transaction:t})=>e(t),error:({error:e})=>n(e.message)})}))}function qye(e){if(this._destroyed)throw new Error("The WebSocket instance has been destroyed, re-initialize to continue making requests.");const t=function(e,t){switch(e){case"ethereum":return 42===t.length;case"bitcoin":return 64!==t.length;default:return!1}}(this._system,e),n=function(e,t){switch(e){case"ethereum":return 66===t.length;case"bitcoin":return 64===t.length;default:return!1}}(this._system,e);if(t){const t="ethereum"===this._system?e.toLowerCase():e;this.watchedAccounts=this.watchedAccounts.filter((e=>e.address!==t)),this.configurations.delete(t),this._sendMessage({categoryCode:"accountAddress",eventCode:"unwatch",account:{address:t}})}else{if(!n)throw new Error(`Error trying to unsubscribe ${e}: not a valid address or transaction id/hash`);{this.watchedTransactions=this.watchedTransactions.filter((t=>t.hash!==e));const t={..."ethereum"===this._system?{hash:e}:{txid:e},id:e,status:"unsubscribed"};this._sendMessage({categoryCode:"activeTransaction",eventCode:"unwatch",transaction:t})}}}function $ye(e){if(this._destroyed)throw new Error("The WebSocket instance has been destroyed, re-initialize to continue making requests.");const t="ethereum"===this._system?e.scope.toLowerCase():e.scope,n=this.configurations.get(t);n&&n.subscription&&n.subscription.next();const r=new lge,s=e.watchAddress?{emitter:zge()}:{};return this.configurations.set(t,{...e,...s,subscription:r}),this._sendMessage({categoryCode:"configs",eventCode:"put",config:e}),new Promise(((t,n)=>{r.pipe(Sye(1),Dye(5e3)).subscribe({next:()=>t({...s,details:{config:e}}),error:r=>{const s="Timeout has occurred"===r.message?`Configuration with scope: ${e.scope} has been sent to the Blocknative server, but has not received a reply within 5 seconds.`:r.message;this._onerror?(this._onerror({message:s}),t(`Error: ${s}`)):n(s)}})}))}function Vye(e){const{id:t,chainId:n,type:r}=e;if(!Hge("ethereum",parseInt(n,16)))throw new Error(`chainId: ${n} is an unsupported network`);this.connections[n]||(this.connections[n]=new this.Blocknative({system:"ethereum",networkId:parseInt(n,16),dappId:this.apiKey,ws:this.ws,apiUrl:this.apiUrl,transactionHandlers:[({transaction:e})=>{this.onTransaction$.next(e)}],onerror:e=>this.errors$.next(e)}));const s=this.connections[n];if("account"===r){const{filters:r=[],abi:i}=e;return s.configuration({scope:t,filters:r,...i?{abi:i}:{},watchAddress:!0}),this.transactions$.pipe(Cye((({watchedAddress:e})=>e===t)),Tye((()=>{this.unsubscribe({id:t,chainId:n})})))}{const{emitter:e}=s.transaction(t);return Bge(e,"all").pipe((i=({status:e})=>"confirmed"!==e&&"failed"!==e&&"dropped"!==e,a=!0,function(e){return e.lift(new Nye(i,a))}),Tye((()=>{this.unsubscribe({id:t,chainId:n})})))}var i,a}function Wye(e){const{id:t,chainId:n,timeout:r=0}=e,s=function(e,t,n){void 0===e&&(e=0);var r=-1;return Mge(t)?r=Number(t)<1?1:Number(t):mge(t)&&(n=t),mge(n)||(n=yge),new sge((function(t){var s=Mge(e)?e:+e-n.now();return n.schedule(Nge,s,{index:0,period:r,subscriber:t})}))}(r),i=this.transactions$.pipe(Cye((({hash:e,watchedAddress:n})=>e===t||n===t)));Oge(i,s).pipe(Sye(1)).subscribe((r=>{if("number"==typeof r){Object.entries(this.connections).filter((([e,t])=>null!==t)).forEach((([e,r])=>{n&&e!==n||(r.unsubscribe(t),r.watchedAccounts.length||r.watchedTransactions.length||r.configurations.size||(r.destroy(),this.connections[e]=null))}))}else this.unsubscribe(e)}))}class Zye{constructor(e,t){const{ws:n}=e,{apiKey:r}=e,{apiUrl:s}=e;this.apiKey=r,this.apiUrl=s,this.ws=n,this.connections={},this.onTransaction$=new lge,this.transactions$=this.onTransaction$.asObservable(),this.errors$=new lge,this.Blocknative=t,this.subscribe=Vye.bind(this),this.unsubscribe=Wye.bind(this)}}var Qye="4.6.9";function Kye(e){if(this._queuedMessages.length>1e4)throw new Error("Queue limit of 10000 messages has been reached.");this._queuedMessages.push(Xye.bind(this)(e)),this._processingQueue||this._processQueue()}async function Yye(){for(this._processingQueue=!0,this._connected||await eve.bind(this)();this._queuedMessages.length>0;){await Gge(1),null!==this._waitToRetry&&(await this._waitToRetry,this._waitToRetry=null);const e=this._queuedMessages.shift(),t=this._limitRules.duration/this._limitRules.points*1e3;await Gge(t),this._socket.send(e)}this._processingQueue=!1,this._limitRules=jge}function Jye(e){const{status:t,reason:n,event:r,connectionId:s,serverVersion:i,retryMs:a,limitRules:o,blockedMsg:c,dispatchTimestamp:l}=JSON.parse(e.data);if(s&&($ge()&&window.localStorage.setItem(this._storageKey,s),this._connectionId=s),"error"===t){if(n.includes("ratelimit")&&!n.match(/IP (PendingSimulation|Notification) ratelimit reached/))return this._waitToRetry=Gge(a),this._limitRules=o,void(c&&this._queuedMessages.unshift(c));if(n.includes("upgrade your plan")){if(this._onerror)return void this._onerror({message:n});throw new Error(n)}if(n.includes("not a valid API key")){if(this._onerror)return void this._onerror({message:n});throw new Error(n)}if(n.includes("network not supported")){if(this._onerror)return void this._onerror({message:n});throw new Error(n)}if(n.includes("maximum allowed amount")){if(this._onerror)return void this._onerror({message:n});throw new Error(n)}if(n.includes("invalid txid")){const e=`${r.transaction.txid} is an invalid txid`;if(this._onerror)return void this._onerror({message:e,transaction:r.transaction.txid});throw new Error(e)}if(n.includes("invalid hash")){const e=`${r.transaction.hash} is an invalid transaction hash`;if(this._onerror)return void this._onerror({message:e,transaction:r.transaction.hash});throw new Error(e)}if(n.includes("invalid address")){const e=`${r.account.address} is an invalid address`;if(this._onerror)return void this._onerror({message:e,account:r.account.address});throw new Error(e)}if(n.includes("not a valid Bitcoin")){if(this._onerror)return void this._onerror({message:n,account:r.account.address});throw new Error(n)}if(n.includes("not a valid Ethereum")){if(this._onerror)return void this._onerror({message:n,account:r.account.address});throw new Error(n)}if(r&&"simulate"===r.categoryCode)return void zye.error({eventId:r.eventId,error:{message:n}});if(r&&r.config){const e=this.configurations.get(r.config.scope);return void(e&&e.subscription&&e.subscription.error({message:n}))}if(this._onerror)return void this._onerror({message:n});throw new Error(n)}if(r&&r.config){const e="ethereum"===this._system?r.config.scope.toLowerCase():r.config.scope,t=this.configurations.get(e);t&&t.subscription&&t.subscription.next()}if(r&&r.transaction){const{eventId:e,transaction:t,eventCode:n,contractCall:s,timeStamp:a,blockchain:{system:o,network:c}}=r,u="ethereum"===this._system?{...t,serverVersion:i,eventCode:n,timeStamp:a,dispatchTimestamp:l,system:o,network:c,contractCall:s}:{...t,serverVersion:i,eventCode:n,timeStamp:a,dispatchTimestamp:l,system:o,network:c};if(function(e){switch(e){case"txRequest":case"nsfFail":case"txRepeat":case"txAwaitingApproval":case"txConfirmReminder":case"txSendFail":case"txError":case"txUnderPriced":case"txSent":return!0;default:return!1}}(n)||"unsubscribed"===t.status)return;if(u.originalHash&&(u.replaceHash=u.hash,u.hash=u.originalHash,delete u.originalHash),"txSpeedUp"===n&&"speedup"!==u.status&&(u.status="speedup"),"txCancel"===n&&"cancel"!==u.status&&(u.status="cancel"),"txSpeedUp"!==n&&"txCancel"!==n||(this.watchedTransactions=this.watchedTransactions.map((e=>(e.hash===u.replaceHash&&(e.hash=t.hash||t.txid),e)))),r&&"simulate"===r.categoryCode)return u.contractCall=r.transaction.contractCall,delete u.dispatchTimestamp,void zye.next({eventId:e,transaction:u});const d=t.watchedAddress&&"ethereum"===this._system?t.watchedAddress.toLowerCase():t.watchedAddress;if(d){const e=this.watchedAccounts.find((e=>e.address===d)),t=!!e&&e.emitters.map((e=>e.emit(u))).reverse()[0],n=this.configurations.get(d),r=n&&n.emitter&&n.emitter.emit(u)||t;this._transactionHandlers.forEach((e=>e({transaction:u,emitterResult:r})))}else{const e=this.watchedTransactions.find((e=>e.hash===u.hash||u.txid)),t=e&&e.emitter.emit(u);this._transactionHandlers.forEach((e=>e({transaction:u,emitterResult:t}))),"speedup"!==u.status&&"cancel"!==u.status||(this.watchedTransactions=this.watchedTransactions.map((e=>e.hash===u.hash||u.txid?{...e,hash:u.replaceHash}:e)))}}}function Xye(e){return JSON.stringify({timeStamp:(new Date).toISOString(),dappId:this._dappId,version:Qye,appName:this._appName,appVersion:this._appVersion,blockchain:{system:this._system,network:Hge(this._system,this._networkId)||"local"},...e},"configs"===e.categoryCode?qge:void 0)}function eve(){return new Promise((e=>{const t=setInterval((()=>{this._connected&&(setTimeout(e,100),clearInterval(t))}))}))}const tve="unknown",nve="unknown",rve="ethereum";function sve(e){this._connected=!0;const t={categoryCode:"initialize",eventCode:"checkDappId",connectionId:this._connectionId};this._socket.send(Xye.bind(this)(t)),this._heartbeat&&this._heartbeat(),e&&e()}function ive(e,t){this._connected=!1,e&&e(t),this._pingTimeout&&clearTimeout(this._pingTimeout)}async function ave(e){this._connected=!0;const t={categoryCode:"initialize",eventCode:"checkDappId",connectionId:this._connectionId};this._socket.send(Xye.bind(this)(t));const n=Array.from(this.configurations.values()),r=this.configurations.get("global");if(r)try{const{emitter:e,subscription:t,...n}=r;await this.configuration(n)}catch(e){console.warn("Error re-sending global configuration upon reconnection:",e)}n.filter((({scope:e})=>"global"!==e)).forEach((e=>{const{emitter:t,subscription:n,...r}=e;this._sendMessage({categoryCode:"configs",eventCode:"put",config:r})})),this.watchedAccounts.forEach((e=>{this._sendMessage({eventCode:"accountAddress",categoryCode:"watch",account:{address:e.address}})})),e&&e(),this._socket.ws&&this._socket.ws.on&&(this._socket.ws.on("ping",(()=>{this._heartbeat&&this._heartbeat()})),this._heartbeat())}var ove=Object.freeze({__proto__:null,default:class{constructor(e){Uge(e);const{system:t=rve,name:n=tve,appVersion:r=nve,networkId:s,transactionHandlers:i=[],ws:a,onopen:o,ondown:c,onreopen:l,onerror:u,onclose:d}=e,{apiUrl:h}=e,{dappId:p}=e,f={connectTimeout:1e4},m=new nfe(h||"wss://api.blocknative.com/v0",a?{wsConstructor:a,...f}:{...f});m.onopen=sve.bind(this,o),m.ondown=ive.bind(this,c),m.onreopen=ave.bind(this,l),m.onmessage=Jye.bind(this),m.onerror=e=>u&&u({message:"There was a WebSocket error",error:e}),m.onclose=()=>{this._pingTimeout&&clearInterval(this._pingTimeout),d&&d()};const b=Dbe.SHA1(`${p} - ${n}`).toString(),g=$ge()&&window.localStorage.getItem(b);this._storageKey=b,this._connectionId=g||void 0,this._dappId=p,this._system=t,this._networkId=s,this._appName=n,this._appVersion=r,this._transactionHandlers=i,this._socket=m,this._connected=!1,this._sendMessage=Kye.bind(this),this._pingTimeout=void 0,this._destroyed=!1,this._onerror=u,this._queuedMessages=[],this._limitRules=jge,this._waitToRetry=null,this._processingQueue=!1,this._processQueue=Yye.bind(this),this._socket.ws.on&&(this._heartbeat=()=>{this._pingTimeout&&clearTimeout(this._pingTimeout),this._pingTimeout=setTimeout((()=>{this._socket.ws.terminate()}),31e3)},this._socket.ws.on("ping",(()=>{this._heartbeat&&this._heartbeat()}))),this.watchedTransactions=[],this.watchedAccounts=[],this.configurations=new Map,this.transaction=Vge.bind(this),this.account=Wge.bind(this),this.event=Zge.bind(this),this.simulate=Hye.bind(this),this.multiSim=Gye.bind(this),this.unsubscribe=qye.bind(this),this.configuration=$ye.bind(this),this.destroy=()=>{this._socket.close(),this._destroyed=!0,this._socket.onclose()}}static multichain(e){return new Zye(e,this)}}}),cve='',lve='\n \n \n \n';function uve(e){lb(e,"svelte-1uqued6","select.svelte-1uqued6{border:none;background-image:none;background-color:transparent;-webkit-appearance:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;appearance:none;font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));transition:width 250ms ease-in-out;background-repeat:no-repeat, repeat;background-position:right 0px top 0px, 0 0;scrollbar-width:none;-ms-overflow-style:none;padding:0 14px 0 0;white-space:nowrap;text-overflow:ellipsis}select.minimized_ac.svelte-1uqued6{min-width:80px;max-width:80px}select.maximized_ac.svelte-1uqued6{width:auto !important}select.svelte-1uqued6:focus{outline:none}span.switching-placeholder.svelte-1uqued6{font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));min-width:80px;max-width:80px;padding:0 8px 0 4px}")}function dve(e,t,n){const r=e.slice();return r[15]=t[n],r}function hve(e){let t;function n(e,t){return e[7]?fve:pve}let r=n(e),s=r(e);return{c(){s.c(),t=vb()},m(e,n){s.m(e,n),pb(e,t,n)},p(e,i){r===(r=n(e))&&s?s.p(e,i):(s.d(1),s=r(e),s&&(s.c(),s.m(t.parentNode,t)))},d(e){s.d(e),e&&fb(t)}}}function pve(e){let t,n,r,s,i,a,o,c=!am(e[6].chains[0],e[2]),l=[],u=new Map,d=c&&mve(e),h=e[2];const p=e=>e[15].id;for(let t=0;tn(12,i=e)));let{selectIcon:o=cve}=t,{colorVar:c}=t,{chains:l}=t,{bold:u=!1}=t,{parentCSSId:d=""}=t;const h=new z(!1);let p;Zm(e,h,(e=>n(7,a=e)));const f=Be(_g,h.pipe((g=1,Te((function(e,t){return g<=t}))))).pipe((m=50,void 0===b&&(b=Q),R((function(e,t){var n=null,r=null,s=null,i=function(){if(n){n.unsubscribe(),n=null;var e=r;r=null,t.next(e)}};function a(){var e=s+m,r=b.now();if(r"boolean"!=typeof e&&"boolean"!=typeof t&&(e[0]&&t[0]&&e[0].chains[0].id===t[0].chains[0].id))));var m,b,g;return Zm(e,f,(e=>n(11,s=e))),e.$$set=e=>{"selectIcon"in e&&n(0,o=e.selectIcon),"colorVar"in e&&n(1,c=e.colorVar),"chains"in e&&n(2,l=e.chains),"bold"in e&&n(3,u=e.bold),"parentCSSId"in e&&n(4,d=e.parentCSSId)},e.$$.update=()=>{4096&e.$$.dirty&&n(6,[r]=i,r),2048&e.$$.dirty&&s&&function(){if(!p)return;let e=document.createElement("option");e.textContent=p.selectedOptions[0].textContent;let t=document.createElement("select");t.style.visibility="hidden",t.style.position="fixed",t.appendChild(e),p.after(t),n(5,p.style.width=t.clientWidth-22+"px",p),t.remove()}()},[o,c,l,u,d,p,r,a,h,f,async function(){const e=p.selectedOptions[0].value;e!==r.chains[0].id&&(h.next(!0),await pv({chainId:e,chainNamespace:"evm",wallet:r.label}),h.next(!1))},s,i,function(e){Db[e?"unshift":"push"]((()=>{p=e,n(5,p),n(2,l),n(6,r),n(12,i)}))}]}class vve extends kg{constructor(e){super(),xg(this,e,yve,gve,$m,{selectIcon:0,colorVar:1,chains:2,bold:3,parentCSSId:4},uve)}}var wve='\n \n \n \n';function xve(e){lb(e,"svelte-hb2n95",".container.svelte-hb2n95.svelte-hb2n95{display:flex;align-items:center;gap:0.5rem;cursor:pointer;position:relative;z-index:0;width:100%;padding:0.25rem;margin-bottom:0.25rem;border-radius:12px;transition:background-color 150ms ease-in-out}.container.svelte-hb2n95.svelte-hb2n95::before{content:'';display:block;position:absolute;top:0;bottom:0;left:0;right:0;height:100%;width:100%;background:var(--action-color);border-radius:12px;z-index:-1;opacity:0}.container.svelte-hb2n95.svelte-hb2n95:hover::before{opacity:0.2}.container.svelte-hb2n95:hover .balance.svelte-hb2n95,.container.svelte-hb2n95:hover .elipsis-container.svelte-hb2n95{opacity:1}.container.svelte-hb2n95:hover .balance.svelte-hb2n95{color:var(--account-center-maximized-balance-color, inherit)}.container.primary.svelte-hb2n95.svelte-hb2n95:hover{background-color:var(\n --account-center-maximized-account-section-background-hover\n )}.account-details.svelte-hb2n95.svelte-hb2n95{flex:1 1;display:flex;gap:inherit;overflow:hidden}.address-domain.svelte-hb2n95.svelte-hb2n95{flex:1 0 auto;max-width:70%;white-space:nowrap;font-weight:600;color:var(--account-center-maximized-address-color, inherit);overflow:scroll;scrollbar-width:none;-ms-overflow-style:none}.address-domain.svelte-hb2n95.svelte-hb2n95::-webkit-scrollbar{display:none}.balance.svelte-hb2n95.svelte-hb2n95{flex:1 1 auto;max-width:70%;white-space:nowrap;text-align:end;opacity:0.4;transition:color 150ms ease-in-out, background-color 150ms ease-in-out;overflow:scroll;scrollbar-width:none;-ms-overflow-style:none}.balance.svelte-hb2n95.svelte-hb2n95::-webkit-scrollbar{display:none}.elipsis-container.svelte-hb2n95.svelte-hb2n95{flex:0;padding:0.25rem;border-radius:24px;transition:color 150ms ease-in-out, background-color 150ms ease-in-out;background-color:transparent;opacity:0.4}.elipsis-container.svelte-hb2n95.svelte-hb2n95:hover{color:var(--text-color)}.elipsis-container.active.svelte-hb2n95.svelte-hb2n95{color:var(--text-color)}.elipsis.svelte-hb2n95.svelte-hb2n95{width:24px}.menu.svelte-hb2n95.svelte-hb2n95{background:var(--onboard-white, var(--white));border:1px solid var(--onboard-gray-100, var(--gray-100));border-radius:8px;list-style-type:none;right:0.25rem;top:2.25rem;margin:0;padding:0;border:none;overflow:hidden;z-index:1}.menu.svelte-hb2n95 li.svelte-hb2n95{color:var(--onboard-primary-500, var(--primary-500));font-size:var(--onboard-font-size-5, var(--font-size-5));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));padding:12px 16px;background:var(--onboard-white, var(--white));transition:background-color 150ms ease-in-out;cursor:pointer}.menu.svelte-hb2n95 li.svelte-hb2n95:hover{background:var(--onboard-primary-200, var(--primary-200))}")}function kve(e,t,n){const r=e.slice();return r[14]=t[n].address,r[15]=t[n].ens,r[16]=t[n].uns,r[17]=t[n].balance,r[19]=n,r}function Eve(e){let t,n,r;return n=new Uv({props:{size:14}}),{c(){t=bb("div"),gg(n.$$.fragment),Ab(t,"right","-5px"),Ab(t,"bottom","-5px"),kb(t,"class","drop-shadow absolute")},m(e,s){pb(e,t,s),yg(n,t,null),r=!0},i(e){r||(sg(n.$$.fragment,e),r=!0)},o(e){ig(n.$$.fragment,e),r=!1},d(e){e&&fb(t),vg(n)}}}function Ave(e){let t,n,r,s=Ive(e[17])+"";return{c(){t=bb("div"),n=gb(s),kb(t,"class","balance svelte-hb2n95")},m(e,r){pb(e,t,r),cb(t,n)},p(e,t){1&t&&s!==(s=Ive(e[17])+"")&&Eb(n,s)},i(e){e&&(r||$b((()=>{r=og(t,wv,{}),r.start()})))},o:Um,d(e){e&&fb(t)}}}function Cve(e){let t,n,r,s,i,a,o,c,l,u,d,h,p,f=e[4]("accountCenter.addAccount",{default:e[2].accountCenter.addAccount})+"",m=e[4]("accountCenter.disconnectWallet",{default:e[2].accountCenter.disconnectWallet})+"",b=e[2].accountCenter.copyAddress+"",g=!(e[1]&&0===e[19])&&Pve(e);function y(){return e[13](e[15],e[16],e[14])}return{c(){t=bb("ul"),n=bb("li"),r=gb(f),s=yb(),g&&g.c(),i=yb(),a=bb("li"),o=gb(m),c=yb(),l=bb("li"),u=gb(b),kb(n,"class","svelte-hb2n95"),kb(a,"class","svelte-hb2n95"),kb(l,"class","svelte-hb2n95"),kb(t,"class","menu absolute svelte-hb2n95")},m(d,f){pb(d,t,f),cb(t,n),cb(n,r),cb(t,s),g&&g.m(t,null),cb(t,i),cb(t,a),cb(a,o),cb(t,c),cb(t,l),cb(l,u),h||(p=[wb(n,"click",xb(e[10])),wb(a,"click",xb(e[12])),wb(l,"click",xb(y))],h=!0)},p(n,s){e=n,20&s&&f!==(f=e[4]("accountCenter.addAccount",{default:e[2].accountCenter.addAccount})+"")&&Eb(r,f),e[1]&&0===e[19]?g&&(g.d(1),g=null):g?g.p(e,s):(g=Pve(e),g.c(),g.m(t,i)),20&s&&m!==(m=e[4]("accountCenter.disconnectWallet",{default:e[2].accountCenter.disconnectWallet})+"")&&Eb(o,m),4&s&&b!==(b=e[2].accountCenter.copyAddress+"")&&Eb(u,b)},i(e){e&&(d||$b((()=>{d=og(t,wv,{}),d.start()})))},o:Um,d(e){e&&fb(t),g&&g.d(),h=!1,Gm(p)}}}function Pve(e){let t,n,r,s,i=e[4]("accountCenter.setPrimaryAccount",{default:e[2].accountCenter.setPrimaryAccount})+"";function a(){return e[11](e[14])}return{c(){t=bb("li"),n=gb(i),kb(t,"class","svelte-hb2n95")},m(e,i){pb(e,t,i),cb(t,n),r||(s=wb(t,"click",xb(a)),r=!0)},p(t,r){e=t,20&r&&i!==(i=e[4]("accountCenter.setPrimaryAccount",{default:e[2].accountCenter.setPrimaryAccount})+"")&&Eb(n,i)},d(e){e&&fb(t),r=!1,s()}}}function _ve(e){let t,n,r,s,i,a,o,c,l,u,d,h,p,f,m,b,g,y,v=(e[15]?Kf(e[15].name):e[16]?Kf(e[16].name):Qf(e[14]))+"";s=new sw({props:{size:32,padding:4,background:"custom",color:"#EFF1FC",customBackgroundColor:e[1]&&0===e[19]?"rgba(24, 206, 102, 0.2)":"rgba(235, 235, 237, 0.1)",border:e[1]&&0===e[19]?"green":"gray",radius:8,icon:e[0].icon}});let w=e[1]&&0===e[19]&&Eve(),x=e[17]&&Ave(e);function k(){return e[8](e[14])}function E(){return e[9](e[14])}let A=e[3]===e[14]&&Cve(e);return{c(){t=bb("div"),n=bb("div"),r=bb("div"),gg(s.$$.fragment),i=yb(),w&&w.c(),a=yb(),o=bb("div"),c=bb("div"),l=gb(v),u=yb(),x&&x.c(),d=yb(),h=bb("div"),p=bb("div"),f=yb(),A&&A.c(),m=yb(),kb(r,"class","flex items-center relative"),kb(c,"class","address-domain svelte-hb2n95"),kb(o,"class","account-details svelte-hb2n95"),kb(p,"class","elipsis pointer flex items-center justify-center relative svelte-hb2n95"),kb(h,"class","elipsis-container svelte-hb2n95"),Pb(h,"active",e[3]===e[14]),kb(n,"class","container svelte-hb2n95"),Pb(n,"primary",e[1]&&0===e[19]),kb(t,"class","relative")},m(e,v){pb(e,t,v),cb(t,n),cb(n,r),yg(s,r,null),cb(r,i),w&&w.m(r,null),cb(n,a),cb(n,o),cb(o,c),cb(c,l),cb(o,u),x&&x.m(o,null),cb(n,d),cb(n,h),cb(h,p),p.innerHTML=wve,cb(t,f),A&&A.m(t,null),cb(t,m),b=!0,g||(y=[wb(p,"click",xb(k)),wb(n,"click",E)],g=!0)},p(i,a){e=i;const c={};2&a&&(c.customBackgroundColor=e[1]&&0===e[19]?"rgba(24, 206, 102, 0.2)":"rgba(235, 235, 237, 0.1)"),2&a&&(c.border=e[1]&&0===e[19]?"green":"gray"),1&a&&(c.icon=e[0].icon),s.$set(c),e[1]&&0===e[19]?w?2&a&&sg(w,1):(w=Eve(),w.c(),sg(w,1),w.m(r,null)):w&&(ng(),ig(w,1,1,(()=>{w=null})),rg()),(!b||1&a)&&v!==(v=(e[15]?Kf(e[15].name):e[16]?Kf(e[16].name):Qf(e[14]))+"")&&Eb(l,v),e[17]?x?(x.p(e,a),1&a&&sg(x,1)):(x=Ave(e),x.c(),sg(x,1),x.m(o,null)):x&&(x.d(1),x=null),(!b||9&a)&&Pb(h,"active",e[3]===e[14]),(!b||2&a)&&Pb(n,"primary",e[1]&&0===e[19]),e[3]===e[14]?A?(A.p(e,a),9&a&&sg(A,1)):(A=Cve(e),A.c(),sg(A,1),A.m(t,m)):A&&(A.d(1),A=null)},i(e){b||(sg(s.$$.fragment,e),sg(w),sg(x),sg(A),b=!0)},o(e){ig(s.$$.fragment,e),ig(w),b=!1},d(e){e&&fb(t),vg(s),w&&w.d(),x&&x.d(),A&&A.d(),g=!1,Gm(y)}}}function Sve(e){let t,n,r=e[0].accounts,s=[];for(let t=0;tig(s[e],1,1,(()=>{s[e]=null}));return{c(){for(let e=0;e7?e[t].slice(0,7):e[t]} ${t}`}function Bve(e,t,n){let r;Zm(e,Rr,(e=>n(4,r=e)));let{wallet:s}=t,{primary:i}=t;function a(){n(3,o="")}let o="";async function c(e){try{await function(e){return e.request({method:"eth_selectAccounts"})}(e.provider)}catch(t){const{code:n}=t;n!==Ta.UNSUPPORTED_METHOD&&n!==Ta.DOES_NOT_EXIST||Cg.next({inProgress:!1,actionRequired:e.label})}}function l(){n(2,Vy.accountCenter.copyAddress="Copied Successfully",Vy),setTimeout(a,500),setTimeout((()=>{n(2,Vy.accountCenter.copyAddress="Copy Wallet address",Vy)}),700)}return e.$$set=e=>{"wallet"in e&&n(0,s=e.wallet),"primary"in e&&n(1,i=e.primary)},[s,i,Vy,o,r,c,l,a,e=>n(3,o=o===e?"":e),e=>My(s,e),()=>{n(3,o=""),c(s)},e=>{n(3,o=""),My(s,e)},()=>{n(3,o=""),hv({label:s.label})},(e,t,n)=>{(async function(e){try{return await navigator.clipboard.writeText(e)}catch(e){console.error("Failed to copy: ",e)}})(e?e.name:t?t.name:n).then((()=>{l()}))}]}class Tve extends kg{constructor(e){super(),xg(this,e,Bve,Sve,$m,{wallet:0,primary:1,hideMenu:7},xve)}get hideMenu(){return this.$$.ctx[7]}}var Mve='\n \n \n \n',Ove='\n \n \n \n',Nve='',Rve='\n\n\n';function Fve(e){lb(e,"svelte-1ubxcdp",".content.svelte-1ubxcdp{padding:1rem;width:300px;font-family:var(--onboard-font-family-normal, var(--font-family-normal));font-size:var(--onboard-font-size-5, var(--font-size-5));line-height:24px}.icon-container.svelte-1ubxcdp{width:3rem;height:3rem;background:var(--onboard-warning-100, var(--warning-100));border-radius:24px;padding:12px;color:var(--onboard-warning-500, var(--warning-500))}h4.svelte-1ubxcdp{margin:1.5rem 0 0.5rem 0;font-weight:600}p.svelte-1ubxcdp{margin:0;font-weight:400}button.svelte-1ubxcdp{margin-top:1.5rem;width:50%;font-weight:600}.right.svelte-1ubxcdp{margin-left:0.5rem;width:60%}")}function jve(e){let t,n,r,s,i,a,o,c,l,u,d,h,p,f,m,b,g,y=e[2]("modals.confirmDisconnectAll.heading",{default:Vy.modals.confirmDisconnectAll.heading})+"",v=e[2]("modals.confirmDisconnectAll.description")+"",w=e[2]("modals.confirmDisconnectAll.cancel",{default:Vy.modals.confirmDisconnectAll.cancel})+"",x=e[2]("modals.confirmDisconnectAll.confirm",{default:Vy.modals.confirmDisconnectAll.confirm})+"";return{c(){t=bb("div"),n=bb("div"),r=yb(),s=bb("h4"),i=gb(y),a=yb(),o=bb("p"),c=gb(v),l=yb(),u=bb("div"),d=bb("button"),h=gb(w),p=yb(),f=bb("button"),m=gb(x),kb(n,"class","icon-container flex justify-center items-center svelte-1ubxcdp"),kb(s,"class","svelte-1ubxcdp"),kb(o,"class","svelte-1ubxcdp"),kb(d,"class","button-neutral-solid-b rounded svelte-1ubxcdp"),kb(f,"class","right button-neutral-solid rounded svelte-1ubxcdp"),kb(u,"class","flex justify-between items-center w-100"),kb(t,"class","content svelte-1ubxcdp")},m(y,v){pb(y,t,v),cb(t,n),n.innerHTML=lve,cb(t,r),cb(t,s),cb(s,i),cb(t,a),cb(t,o),cb(o,c),cb(t,l),cb(t,u),cb(u,d),cb(d,h),cb(u,p),cb(u,f),cb(f,m),b||(g=[wb(d,"click",(function(){qm(e[1])&&e[1].apply(this,arguments)})),wb(f,"click",(function(){qm(e[0])&&e[0].apply(this,arguments)}))],b=!0)},p(t,n){e=t,4&n&&y!==(y=e[2]("modals.confirmDisconnectAll.heading",{default:Vy.modals.confirmDisconnectAll.heading})+"")&&Eb(i,y),4&n&&v!==(v=e[2]("modals.confirmDisconnectAll.description")+"")&&Eb(c,v),4&n&&w!==(w=e[2]("modals.confirmDisconnectAll.cancel",{default:Vy.modals.confirmDisconnectAll.cancel})+"")&&Eb(h,w),4&n&&x!==(x=e[2]("modals.confirmDisconnectAll.confirm",{default:Vy.modals.confirmDisconnectAll.confirm})+"")&&Eb(m,x)},d(e){e&&fb(t),b=!1,Gm(g)}}}function Lve(e){let t,n;return t=new Pv({props:{close:e[1],$$slots:{default:[jve]},$$scope:{ctx:e}}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,[n]){const r={};2&n&&(r.close=e[1]),15&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function Uve(e,t,n){let r;Zm(e,Rr,(e=>n(2,r=e)));let{onConfirm:s}=t,{onClose:i}=t;return e.$$set=e=>{"onConfirm"in e&&n(0,s=e.onConfirm),"onClose"in e&&n(1,i=e.onClose)},[s,i,r]}class Dve extends kg{constructor(e){super(),xg(this,e,Uve,Lve,$m,{onConfirm:0,onClose:1},Fve)}}function zve(e){lb(e,"svelte-ruodf3",".content.svelte-ruodf3{--background-color:var(--w3o-background-color);--text-color:var(--w3o-text-color);--action-color:var(--w3o-action-color, var(--primary-500));font-size:1rem;line-height:1.5rem;display:flex;flex-flow:column;gap:1.5rem;padding:1rem;max-width:320px;background:var(--background-color);color:var(--text-color)}.icon-container.svelte-ruodf3{position:relative;overflow:hidden;width:3rem;height:3rem;border-radius:24px;padding:0.75rem;background:none}.icon-container.svelte-ruodf3::before{content:'';position:absolute;height:100%;width:100%;opacity:0.2;background:var(--action-color)}.text-container.svelte-ruodf3{display:flex;flex-flow:column;gap:0.5rem;padding:0 0.5rem}.actions-container.svelte-ruodf3{display:flex;flex-flow:row nowrap;gap:1rem}.heading.svelte-ruodf3{font-weight:600}button.svelte-ruodf3{font-weight:600}button.primary.svelte-ruodf3{background:var(--action-color)}")}function Hve(e){let t,n,r,s,i,a,o,c,l,u,d,h,p,f,m,b,g,y,v,w,x,k=e[3]("modals.confirmTransactionProtection.heading",{default:Vy.modals.confirmTransactionProtection.heading})+"",E=e[3]("modals.confirmTransactionProtection.description")+"",A=e[3]("modals.confirmTransactionProtection.link",{default:Vy.modals.confirmTransactionProtection.link})+"",C=e[3]("modals.confirmTransactionProtection.dismiss",{default:Vy.modals.confirmTransactionProtection.dismiss})+"",P=e[3]("modals.confirmTransactionProtection.enable",{default:Vy.modals.confirmTransactionProtection.enable})+"";return{c(){t=bb("div"),n=bb("div"),r=yb(),s=bb("div"),i=bb("div"),a=gb(k),o=yb(),c=bb("div"),l=gb(E),u=yb(),d=bb("a"),h=gb(A),p=yb(),f=bb("div"),m=bb("button"),b=gb(C),g=yb(),y=bb("button"),v=gb(P),kb(n,"class","icon-container flex justify-center items-center svelte-ruodf3"),kb(i,"class","heading svelte-ruodf3"),kb(d,"href",e[2]),kb(d,"target","_blank"),kb(d,"rel","noreferrer noopener"),kb(d,"class","no-link"),kb(s,"class","text-container svelte-ruodf3"),kb(m,"class","button-neutral-solid-b svelte-ruodf3"),kb(y,"class","button-neutral-solid rounded primary svelte-ruodf3"),kb(f,"class","actions-container svelte-ruodf3"),kb(t,"class","content svelte-ruodf3")},m(k,E){pb(k,t,E),cb(t,n),n.innerHTML=Rve,cb(t,r),cb(t,s),cb(s,i),cb(i,a),cb(s,o),cb(s,c),cb(c,l),cb(s,u),cb(s,d),cb(d,h),cb(t,p),cb(t,f),cb(f,m),cb(m,b),cb(f,g),cb(f,y),cb(y,v),w||(x=[wb(m,"click",(function(){qm(e[1])&&e[1].apply(this,arguments)})),wb(y,"click",(function(){qm(e[0])&&e[0].apply(this,arguments)}))],w=!0)},p(t,n){e=t,8&n&&k!==(k=e[3]("modals.confirmTransactionProtection.heading",{default:Vy.modals.confirmTransactionProtection.heading})+"")&&Eb(a,k),8&n&&E!==(E=e[3]("modals.confirmTransactionProtection.description")+"")&&Eb(l,E),8&n&&A!==(A=e[3]("modals.confirmTransactionProtection.link",{default:Vy.modals.confirmTransactionProtection.link})+"")&&Eb(h,A),4&n&&kb(d,"href",e[2]),8&n&&C!==(C=e[3]("modals.confirmTransactionProtection.dismiss",{default:Vy.modals.confirmTransactionProtection.dismiss})+"")&&Eb(b,C),8&n&&P!==(P=e[3]("modals.confirmTransactionProtection.enable",{default:Vy.modals.confirmTransactionProtection.enable})+"")&&Eb(v,P)},d(e){e&&fb(t),w=!1,Gm(x)}}}function Gve(e){let t,n;return t=new Pv({props:{close:e[1],$$slots:{default:[Hve]},$$scope:{ctx:e}}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,[n]){const r={};2&n&&(r.close=e[1]),31&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function qve(e,t,n){let r;Zm(e,Rr,(e=>n(3,r=e)));let{onEnable:s}=t,{onDismiss:i}=t,{infoLink:a}=t;return e.$$set=e=>{"onEnable"in e&&n(0,s=e.onEnable),"onDismiss"in e&&n(1,i=e.onDismiss),"infoLink"in e&&n(2,a=e.infoLink)},[s,i,a,r]}class $ve extends kg{constructor(e){super(),xg(this,e,qve,Gve,$m,{onEnable:0,onDismiss:1,infoLink:2},zve)}}function Vve(e){lb(e,"svelte-b848yl",".secondary-token-container.svelte-b848yl.svelte-b848yl{width:100%}table.svelte-b848yl.svelte-b848yl{width:100%}tr.svelte-b848yl.svelte-b848yl{padding:0.25rem 1rem;line-height:1rem;border-bottom:1px solid var(--border-color);display:flex;flex-direction:row;align-items:flex-start;gap:1rem}thead.svelte-b848yl .secondary-token-table-header.svelte-b848yl{text-align:inherit;font-size:var(--onboard-font-size-7, var(--font-size-7))}.token-icon.svelte-b848yl.svelte-b848yl{width:30%;font-weight:700;font-size:var(--onboard-font-size-6, var(--font-size-6));color:var(--text-color)}.icon-name-container.svelte-b848yl.svelte-b848yl{display:flex;flex-direction:row;align-items:flex-start;padding:0px;gap:0.5rem}.icon.svelte-b848yl.svelte-b848yl{width:1rem;height:1rem}img.svelte-b848yl.svelte-b848yl{height:100%;width:100%}.token-balance.svelte-b848yl.svelte-b848yl{width:70%;font-weight:200;font-size:var(--onboard-font-size-6, var(--font-size-6));color:var(--text-color)}")}function Wve(e,t,n){const r=e.slice();return r[1]=t[n],r}function Zve(e){let t,n,r,s,i,a,o,c,l,u=e[1].name.toUpperCase()+"",d=(e[1].balance.length>7?e[1].balance.slice(0,7):e[1].balance)+"";function h(e,t){return e[1].icon?Kve:Qve}let p=h(e),f=p(e);return{c(){t=bb("tr"),n=bb("td"),r=bb("div"),f.c(),s=yb(),i=gb(u),a=yb(),o=bb("td"),c=gb(d),l=yb(),kb(r,"class","icon-name-container svelte-b848yl"),kb(n,"class","token-icon svelte-b848yl"),kb(o,"class","token-balance svelte-b848yl"),kb(t,"class","token-row svelte-b848yl")},m(e,u){pb(e,t,u),cb(t,n),cb(n,r),f.m(r,null),cb(r,s),cb(r,i),cb(t,a),cb(t,o),cb(o,c),cb(t,l)},p(e,t){p===(p=h(e))&&f?f.p(e,t):(f.d(1),f=p(e),f&&(f.c(),f.m(r,s))),1&t&&u!==(u=e[1].name.toUpperCase()+"")&&Eb(i,u),1&t&&d!==(d=(e[1].balance.length>7?e[1].balance.slice(0,7):e[1].balance)+"")&&Eb(c,d)},d(e){e&&fb(t),f.d()}}}function Qve(e){let t;return{c(){t=bb("div"),kb(t,"class","icon svelte-b848yl")},m(e,n){pb(e,t,n)},p:Um,d(e){e&&fb(t)}}}function Kve(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:twe,then:Jve,catch:Yve,value:4};return ug(n=e[1].icon,r),{c(){t=vb(),r.block.c()},m(e,n){pb(e,t,n),r.block.m(e,r.anchor=n),r.mount=()=>t.parentNode,r.anchor=t},p(t,s){e=t,r.ctx=e,1&s&&n!==(n=e[1].icon)&&ug(n,r)||dg(r,e,s)},d(e){e&&fb(t),r.block.d(e),r.token=null,r=null}}}function Yve(e){return{c:Um,m:Um,p:Um,i:Um,o:Um,d:Um}}function Jve(e){let t,n,r;function s(e,t){return 1&t&&(n=null),null==n&&(n=!!Zf(e[4])),n?ewe:Xve}let i=s(e,-1),a=i(e);return{c(){t=bb("div"),a.c(),kb(t,"class","icon svelte-b848yl")},m(e,n){pb(e,t,n),a.m(t,null)},p(e,n){i===(i=s(e,n))&&a?a.p(e,n):(a.d(1),a=i(e),a&&(a.c(),a.m(t,null)))},i(e){e&&(r||$b((()=>{r=og(t,wv,{}),r.start()})))},o:Um,d(e){e&&fb(t),a.d()}}}function Xve(e){let t,n;return{c(){t=bb("img"),Wm(t.src,n=e[4])||kb(t,"src",n),kb(t,"alt","logo"),kb(t,"class","svelte-b848yl")},m(e,n){pb(e,t,n)},p(e,r){1&r&&!Wm(t.src,n=e[4])&&kb(t,"src",n)},d(e){e&&fb(t)}}}function ewe(e){let t,n,r=e[4]+"";return{c(){t=new _b(!1),n=vb(),t.a=n},m(e,s){t.m(r,e,s),pb(e,n,s)},p(e,n){1&n&&r!==(r=e[4]+"")&&t.p(r)},d(e){e&&fb(n),e&&t.d()}}}function twe(e){return{c:Um,m:Um,p:Um,i:Um,o:Um,d:Um}}function nwe(e){let t,n=e[1]&&e[1].name&&e[1].balance&&Zve(e);return{c(){n&&n.c(),t=vb()},m(e,r){n&&n.m(e,r),pb(e,t,r)},p(e,r){e[1]&&e[1].name&&e[1].balance?n?n.p(e,r):(n=Zve(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(e){n&&n.d(e),e&&fb(t)}}}function rwe(e){let t,n,r,s,i,a=e[0],o=[];for(let t=0;tToken Balances:',s=yb(),i=bb("tbody");for(let e=0;e{"secondaryTokens"in e&&n(0,r=e.secondaryTokens)},[r]}class iwe extends kg{constructor(e){super(),xg(this,e,swe,rwe,$m,{secondaryTokens:0},Vve)}}function awe(e){lb(e,"svelte-177u10y",".outer-container.svelte-177u10y{--background-color:var(--w3o-background-color);--text-color:var(--w3o-text-color);--border-color:var(--w3o-border-color, var(--gray-500));--action-color:var(--w3o-action-color, var(--primary-500));--border-radius:var(--w3o-border-radius, 1rem);--account-center-network-selector-color:var(--text-color, white);width:100%;overflow:hidden;pointer-events:auto;border:1px solid transparent;background:var(\n --account-center-maximized-upper-background,\n var(--background-color)\n );border-color:var(--border-color);border-radius:var(--account-center-border-radius, var(--border-radius))}.wallets-section.svelte-177u10y{width:100%;color:var(--text-color, var(--gray-100));background:var(--background-color, var(--gray-700))}.p5.svelte-177u10y{padding:var(--onboard-spacing-5, var(--spacing-5))}.wallets.svelte-177u10y{width:100%;margin-bottom:0.5rem}.actions.svelte-177u10y{color:var(\n --account-center-maximized-upper-action-color,\n var(--action-color)\n );padding-left:2px}.action-container.svelte-177u10y{padding:0.25rem 12px 0.25rem 0.5rem;border-radius:0.5rem;transition:background-color 150ms ease-in-out}.action-container.svelte-177u10y:hover{background-color:var(\n --account-center-maximized-upper-action-background-hover,\n rgba(146, 155, 237, 0.2)\n )}.plus-icon.svelte-177u10y{width:20px}.arrow-forward.svelte-177u10y{width:20px}.mt.svelte-177u10y{margin-top:0.25rem}.action-text.svelte-177u10y{font-size:var(--onboard-font-size-6, var(--font-size-6));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));margin-left:0.5rem}.background-blue.svelte-177u10y{background:var(\n --account-center-maximized-network-section-background,\n var(--onboard-primary-100, var(--primary-100))\n )}.background-gray.svelte-177u10y{background:var(--onboard-gray-100, var(--gray-100))}.background-yellow.svelte-177u10y{background:var(--onboard-warning-100, var(--warning-100))}.network-container.svelte-177u10y{background:var(--background-color);border-top:1px solid var(--border-color);width:100%;display:flex;flex-direction:column;align-items:flex-start;padding:0.75rem;gap:0.5rem;border-radius:var(\n --account-center-border-radius,\n var(--onboard-border-radius-3, var(--border-radius-3))\n );color:var(\n --account-center-maximized-network-text-color,\n var(--account-center-maximized-network-section, inherit)\n )}.network-section.svelte-177u10y{flex-direction:row;align-items:flex-start;padding:0px;gap:16px}.network-selector-container.svelte-177u10y{width:100%}.protect.svelte-177u10y{flex-direction:row;padding:0.25rem 0.375rem 0;gap:0.375rem;width:100%}.shield.svelte-177u10y{width:20px;height:20px;display:flex;justify-content:center}.protect-text.svelte-177u10y{font-size:var(--onboard-font-size-6, var(--font-size-6));color:var(\n --account-center-maximized-upper-action-color,\n var(--action-color)\n );line-height:1.75rem;display:flex;align-items:center}.network-selector-container.svelte-177u10y{margin-left:1rem;width:100%}.network-selector-label.svelte-177u10y{font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3))}.app-info-container.svelte-177u10y{color:var(--text-color, var(--gray-700));background:var(\n --account-center-maximized-info-section-background-color,\n var(\n --account-center-maximized-info-section,\n var(--background-color, #fff)\n )\n );border-top:1px solid var(--border-color);border-radius:var(--account-center-border-radius, inherit);display:flex;flex-direction:column;align-items:flex-start;padding:0px}.app-info-header.svelte-177u10y{width:100%;flex-direction:column;align-items:flex-start;padding:0.75rem;gap:0.5rem;border-bottom:1px solid var(--border-color)}.app-icon-name.svelte-177u10y{display:flex;align-items:center;flex-direction:row;gap:0.75rem}.app-name.svelte-177u10y{font-size:1rem;font-weight:600;line-height:1rem;margin-bottom:0.25rem;color:var(--account-center-maximized-app-name-color, inherit)}.app-description.svelte-177u10y{margin:0;font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));color:var(--account-center-maximized-app-info-color, inherit);display:flex;flex-direction:row;align-items:flex-start;padding:0px 0.25rem;gap:1rem}.app-info.svelte-177u10y{width:100%;font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));color:var(--account-center-maximized-app-info-color, inherit);border-bottom:1px solid var(--border-color);display:flex;flex-direction:column;align-items:flex-start;padding:0.5rem 1rem;gap:0.25rem}.app-info-heading.svelte-177u10y{font-weight:700;color:var(--account-center-maximized-app-info-color, inherit)}.w100.svelte-177u10y{width:100%}a.svelte-177u10y{font-weight:700}.powered-by-container.svelte-177u10y{color:var(--text-color);padding:0.75rem}")}function owe(e,t,n){const r=e.slice();return r[29]=t[n],r[31]=n,r}function cwe(e){let t,n;return t=new Dve({props:{onClose:e[22],onConfirm:e[13]}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,n){const r={};4&n[0]&&(r.onClose=e[22]),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function lwe(e){let t,n;return t=new $ve({props:{onDismiss:e[23],onEnable:e[24],infoLink:e[9].transactionProtectionInfoLink||gm}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,n){const r={};16&n[0]&&(r.onDismiss=e[23]),512&n[0]&&(r.infoLink=e[9].transactionProtectionInfoLink||gm),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function uwe(e){let t,n,r,s,i,a,o,c,l,u,d,h,p,f,m,b,g,y,v,w,x,k,E,A,C,P,_,S,I,B,T=[],M=new Map,O=e[10]("accountCenter.currentNetwork",{default:Vy.accountCenter.currentNetwork})+"",N=e[1];const R=e=>e[29].label;for(let t=0;t{j=null})),rg()),(!S||1024&n[0])&&O!==(O=e[10]("accountCenter.currentNetwork",{default:Vy.accountCenter.currentNetwork})+"")&&Eb(b,O),!e[9].hideTransactionProtectionBtn&&(e[6]||e[5]&&e[5].protectedRpcUrl)?L?L.p(e,n):(L=pwe(e),L.c(),L.m(c,null)):L&&(L.d(1),L=null),(!S||160&n[0])&&Pb(c,"background-blue",e[5]&&e[5].icon||e[7]),(!S||32&n[0])&&Pb(c,"background-yellow",!e[5]),(!S||160&n[0])&&Pb(c,"background-gray",e[5]&&!e[7]),e[11]?U?(U.p(e,n),2048&n[0]&&sg(U,1)):(U=fwe(e),U.c(),sg(U,1),U.m(k,E)):U&&(ng(),ig(U,1,1,(()=>{U=null})),rg()),e[8]&&e[8].length?D?(D.p(e,n),256&n[0]&&sg(D,1)):(D=ywe(e),D.c(),sg(D,1),D.m(k,A)):D&&(ng(),ig(D,1,1,(()=>{D=null})),rg())},i(n){if(!S){for(let e=0;e{S&&(_||(_=lg(t,xv,{duration:600,y:e[16].includes("bottom")?56:-76,easing:vv,opacity:0},!0)),_.run(1))})),S=!0}},o(n){for(let e=0;ebg(r,"hideMenu",a))),{key:e,first:null,c(){n=vb(),gg(r.$$.fragment),this.first=n},m(e,t){pb(e,n,t),yg(r,e,t),i=!0},p(e,n){t=e;const i={};2&n[0]&&(i.wallet=t[29]),2&n[0]&&(i.primary=0===t[31]),!s&&8&n[0]&&(s=!0,i.hideMenu=t[3],Vb((()=>s=!1))),r.$set(i)},i(e){i||(sg(r.$$.fragment,e),i=!0)},o(e){ig(r.$$.fragment,e),i=!1},d(e){e&&fb(n),vg(r,e)}}}function hwe(e){let t,n,r;return n=new Uv({props:{size:14}}),{c(){t=bb("div"),gg(n.$$.fragment),Ab(t,"right","-5px"),Ab(t,"bottom","-5px"),kb(t,"class","drop-shadow absolute")},m(e,s){pb(e,t,s),yg(n,t,null),r=!0},i(e){r||(sg(n.$$.fragment,e),r=!0)},o(e){ig(n.$$.fragment,e),r=!1},d(e){e&&fb(t),vg(n)}}}function pwe(e){let t,n,r,s,i,a,o,c=e[10]("accountCenter.enableTransactionProtection",{default:Vy.accountCenter.enableTransactionProtection})+"";return{c(){t=bb("div"),n=bb("div"),r=yb(),s=bb("span"),i=gb(c),kb(n,"class","shield svelte-177u10y"),kb(s,"class","protect-text svelte-177u10y"),kb(t,"class","protect action-container flex items-center pointer svelte-177u10y")},m(c,l){pb(c,t,l),cb(t,n),n.innerHTML=Rve,cb(t,r),cb(t,s),cb(s,i),a||(o=wb(t,"click",e[28]),a=!0)},p(e,t){1024&t[0]&&c!==(c=e[10]("accountCenter.enableTransactionProtection",{default:Vy.accountCenter.enableTransactionProtection})+"")&&Eb(i,c)},d(e){e&&fb(t),a=!1,o()}}}function fwe(e){let t,n,r,s,i,a,o,c,l,u,d,h,p=(e[11]&&e[11].name||"App Name")+"",f=(e[11]&&e[11].description||"This app has not added a description.")+"";r=new sw({props:{size:32,padding:4,background:"white",border:"black",radius:8,icon:e[11]&&e[11].icon||qf}});let m=(e[11].gettingStartedGuide||e[11].explore)&&mwe(e);return{c(){t=bb("div"),n=bb("div"),gg(r.$$.fragment),s=yb(),i=bb("div"),a=gb(p),o=yb(),c=bb("div"),l=gb(f),u=yb(),m&&m.c(),d=vb(),kb(i,"class","app-name svelte-177u10y"),kb(n,"class","relative flex app-icon-name svelte-177u10y"),kb(c,"class","app-description svelte-177u10y"),kb(t,"class","flex items-start app-info-header svelte-177u10y")},m(e,p){pb(e,t,p),cb(t,n),yg(r,n,null),cb(n,s),cb(n,i),cb(i,a),cb(t,o),cb(t,c),cb(c,l),pb(e,u,p),m&&m.m(e,p),pb(e,d,p),h=!0},p(e,t){const n={};2048&t[0]&&(n.icon=e[11]&&e[11].icon||qf),r.$set(n),(!h||2048&t[0])&&p!==(p=(e[11]&&e[11].name||"App Name")+"")&&Eb(a,p),(!h||2048&t[0])&&f!==(f=(e[11]&&e[11].description||"This app has not added a description.")+"")&&Eb(l,f),e[11].gettingStartedGuide||e[11].explore?m?m.p(e,t):(m=mwe(e),m.c(),m.m(d.parentNode,d)):m&&(m.d(1),m=null)},i(e){h||(sg(r.$$.fragment,e),h=!0)},o(e){ig(r.$$.fragment,e),h=!1},d(e){e&&fb(t),vg(r),e&&fb(u),m&&m.d(e),e&&fb(d)}}}function mwe(e){let t,n,r,s,i,a=e[10]("accountCenter.appInfo",{default:Vy.accountCenter.appInfo})+"",o=e[11].gettingStartedGuide&&bwe(e),c=e[11].explore&&gwe(e);return{c(){t=bb("div"),n=bb("div"),r=gb(a),s=yb(),o&&o.c(),i=yb(),c&&c.c(),kb(n,"class","app-info-heading svelte-177u10y"),kb(t,"class","app-info svelte-177u10y")},m(e,a){pb(e,t,a),cb(t,n),cb(n,r),cb(t,s),o&&o.m(t,null),cb(t,i),c&&c.m(t,null)},p(e,n){1024&n[0]&&a!==(a=e[10]("accountCenter.appInfo",{default:Vy.accountCenter.appInfo})+"")&&Eb(r,a),e[11].gettingStartedGuide?o?o.p(e,n):(o=bwe(e),o.c(),o.m(t,i)):o&&(o.d(1),o=null),e[11].explore?c?c.p(e,n):(c=gwe(e),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},d(e){e&&fb(t),o&&o.d(),c&&c.d()}}}function bwe(e){let t,n,r,s,i,a,o,c=e[10]("accountCenter.learnMore",{default:Vy.accountCenter.learnMore})+"",l=e[10]("accountCenter.gettingStartedGuide",{default:Vy.accountCenter.gettingStartedGuide})+"";return{c(){t=bb("div"),n=bb("div"),r=gb(c),s=yb(),i=bb("a"),a=gb(l),kb(i,"href",o=e[11].gettingStartedGuide),kb(i,"target","_blank"),kb(i,"rel","noreferrer noopener"),kb(i,"class","svelte-177u10y"),kb(t,"class","flex justify-between items-center w100 svelte-177u10y")},m(e,o){pb(e,t,o),cb(t,n),cb(n,r),cb(t,s),cb(t,i),cb(i,a)},p(e,t){1024&t[0]&&c!==(c=e[10]("accountCenter.learnMore",{default:Vy.accountCenter.learnMore})+"")&&Eb(r,c),1024&t[0]&&l!==(l=e[10]("accountCenter.gettingStartedGuide",{default:Vy.accountCenter.gettingStartedGuide})+"")&&Eb(a,l),2048&t[0]&&o!==(o=e[11].gettingStartedGuide)&&kb(i,"href",o)},d(e){e&&fb(t)}}}function gwe(e){let t,n,r,s,i,a,o,c=e[10]("accountCenter.smartContracts",{default:Vy.accountCenter.smartContracts})+"",l=e[10]("accountCenter.explore",{default:Vy.accountCenter.explore})+"";return{c(){t=bb("div"),n=bb("div"),r=gb(c),s=yb(),i=bb("a"),a=gb(l),kb(i,"href",o=e[11].explore),kb(i,"target","_blank"),kb(i,"rel","noreferrer noopener"),kb(i,"class","svelte-177u10y"),kb(t,"class","flex justify-between items-center w100 svelte-177u10y")},m(e,o){pb(e,t,o),cb(t,n),cb(n,r),cb(t,s),cb(t,i),cb(i,a)},p(e,t){1024&t[0]&&c!==(c=e[10]("accountCenter.smartContracts",{default:Vy.accountCenter.smartContracts})+"")&&Eb(r,c),1024&t[0]&&l!==(l=e[10]("accountCenter.explore",{default:Vy.accountCenter.explore})+"")&&Eb(a,l),2048&t[0]&&o!==(o=e[11].explore)&&kb(i,"href",o)},d(e){e&&fb(t)}}}function ywe(e){let t,n;return t=new iwe({props:{secondaryTokens:e[8]}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,n){const r={};256&n[0]&&(r.secondaryTokens=e[8]),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function vwe(e){let t,n,r,s,i=e[2]&&cwe(e),a=e[4]&&lwe(e),o=e[0]&&uwe(e);return{c(){i&&i.c(),t=yb(),a&&a.c(),n=yb(),o&&o.c(),r=vb()},m(e,c){i&&i.m(e,c),pb(e,t,c),a&&a.m(e,c),pb(e,n,c),o&&o.m(e,c),pb(e,r,c),s=!0},p(e,s){e[2]?i?(i.p(e,s),4&s[0]&&sg(i,1)):(i=cwe(e),i.c(),sg(i,1),i.m(t.parentNode,t)):i&&(ng(),ig(i,1,1,(()=>{i=null})),rg()),e[4]?a?(a.p(e,s),16&s[0]&&sg(a,1)):(a=lwe(e),a.c(),sg(a,1),a.m(n.parentNode,n)):a&&(ng(),ig(a,1,1,(()=>{a=null})),rg()),e[0]?o?(o.p(e,s),1&s[0]&&sg(o,1)):(o=uwe(e),o.c(),sg(o,1),o.m(r.parentNode,r)):o&&(ng(),ig(o,1,1,(()=>{o=null})),rg())},i(e){s||(sg(i),sg(a),sg(o),s=!0)},o(e){ig(i),ig(a),ig(o),s=!1},d(e){i&&i.d(e),e&&fb(t),a&&a.d(e),e&&fb(n),o&&o.d(e),e&&fb(r)}}}function wwe(e,t,n){let r,s,i,a,o,c,l,u,d,h;Zm(e,_g,(e=>n(1,l=e))),Zm(e,Rr,(e=>n(10,d=e)));let{expanded:p}=t;const f=Lm.select("accountCenter").pipe(De(Lm.get().accountCenter),Ue(1));Zm(e,f,(e=>n(9,u=e)));const{chains:m}=Lm.get();let b,g=!1,y=!1;const v=Lm.select("appMetadata").pipe(De(Lm.get().appMetadata),Ue(1));Zm(e,v,(e=>n(11,h=e)));const{position:w}=Lm.get().accountCenter,{device:x}=hm,k=async()=>{if(a)try{await function(e,t,n){return e.request({method:"wallet_addEthereumChain",params:[{chainId:t.id,chainName:t.label,nativeCurrency:{name:t.label,symbol:t.token,decimals:18},rpcUrls:[n],blockExplorerUrls:t.blockExplorerUrl?[t.blockExplorerUrl]:void 0}]})}(r.provider,a,a.protectedRpcUrl||"https://rpc.blocknative.com/boost"),n(4,y=!1)}catch(e){const{code:t}=e;console.log(e,t)}};return e.$$set=e=>{"expanded"in e&&n(0,p=e.expanded)},e.$$.update=()=>{2&e.$$.dirty[0]&&n(19,[r]=l,r),524288&e.$$.dirty[0]&&n(20,[s]=r?r.chains:[],s),524288&e.$$.dirty[0]&&n(8,i=r&&r.accounts.length&&r.accounts[0].secondaryTokens),1048576&e.$$.dirty[0]&&n(5,a=m.find((({id:e,namespace:t})=>!!s&&(e===s.id&&t===s.namespace)))),1048576&e.$$.dirty[0]&&n(7,o=im(s&&s.id)),1048576&e.$$.dirty[0]&&n(6,c=s&&"0x1"===s.id)},[p,l,g,b,y,a,c,o,i,u,d,h,f,function(){l.forEach((({label:e})=>hv({label:e})))},m,v,w,x,k,r,s,function(t){Lb.call(this,e,t)},()=>n(2,g=!1),()=>n(4,y=!1),()=>k(),function(e){b=e,n(3,b)},()=>$y(),()=>n(2,g=!0),()=>n(4,y=!0)]}class xwe extends kg{constructor(e){super(),xg(this,e,wwe,vwe,$m,{expanded:0},awe,[-1,-1])}}function kwe(e){lb(e,"svelte-1xsvwqj",".ac-trigger.svelte-1xsvwqj{--background-color:var(\n --account-center-minimized-background,\n var(--w3o-background-color, white)\n );--text-color:var(--w3o-text-color, var(--gray-700));--border-color:var(\n --account-center-border,\n var(--w3o-border-color, var(--onboard-gray-200, var(--gray-200)))\n );--border-radius:var(\n --account-center-border-radius,\n var(--w3o-border-radius, 1rem)\n );cursor:pointer;pointer-events:auto;width:100%;padding:0.5rem;border:1px solid;background:var(--background-color);color:var(--text-color);border-color:var(--border-color);border-radius:var(--border-radius);box-shadow:var(\n --account-center-box-shadow,\n var(--onboard-shadow-3, var(--shadow-3))\n );z-index:var(--account-center-z-index, 1)}.inner-row.svelte-1xsvwqj{display:flex;flex-flow:row nowrap;align-items:center;gap:0.5rem;padding:0 0.25rem}.wallet-info.svelte-1xsvwqj{display:flex;flex:1;flex-flow:column;height:2.5rem;overflow:hidden}.address.svelte-1xsvwqj{font-weight:600;line-height:1.25rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--account-center-minimized-address-color, inherit)}.balance.svelte-1xsvwqj{font-weight:400;line-height:1.25rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;opacity:0.6;color:var(--account-center-minimized-balance-color, inherit)}.chain-icon-container.svelte-1xsvwqj{margin-right:4px}.container.svelte-1xsvwqj{border:1px solid transparent;border-radius:16px;padding:1px;transition:border-color 250ms ease-in-out, backround 250ms ease-in-out;max-width:128px;cursor:default}.drop-shadow.svelte-1xsvwqj{filter:drop-shadow(0px 1px 4px rgba(0, 0, 0, 0.2))}")}function Ewe(e){let t,n,r,s,i,a=(e[5].length>7?e[5].slice(0,7):e[5])+"";return{c(){t=bb("div"),n=gb(a),r=yb(),s=gb(e[2]),kb(t,"class","balance svelte-1xsvwqj")},m(e,i){pb(e,t,i),cb(t,n),cb(t,r),cb(t,s)},p(e,t){32&t&&a!==(a=(e[5].length>7?e[5].slice(0,7):e[5])+"")&&Eb(n,a),4&t&&Eb(s,e[2])},i(e){e&&(i||$b((()=>{i=og(t,wv,{}),i.start()})))},o:Um,d(e){e&&fb(t)}}}function Awe(e){let t,n,r,s,i,a,o,c,l,u,d,h,p,f,m,b,g,y,v,w,x,k,E,A,C,P,_,S,I,B,T=(e[8]?Kf(e[8]):e[7]?Kf(e[7]):e[6])+"";i=new sw({props:{size:32,padding:4,background:"white",border:"darkGreen",radius:8,icon:e[9]&&e[9].icon||qf}}),c=new sw({props:{size:32,padding:4,background:"green",border:"darkGreen",radius:8,icon:e[1]?e[1].icon:""}}),d=new Uv({props:{size:14}});let M=e[5]&&Ewe(e);return k=new sw({props:{size:22,padding:4,background:"custom",color:e[4]?e[4].icon?void 0:"var(--onboard-primary-100, var(--primary-100))":"var(\n --account-center-chain-warning,\n var(--onboard-warning-500, var(--warning-500))\n )",customBackgroundColor:e[4]?e[4].color||e[3]&&e[3].color||sm.color:"var(--onboard-warning-200, var(--warning-200))",border:"transparent",radius:25,icon:e[4]?e[4].icon||e[3]&&e[3].icon||sm.icon:lve}}),A=new vve({props:{chains:e[11],colorVar:"--account-center-minimized-network-selector-color",selectIcon:cve,parentCSSId:"minimized_ac"}}),{c(){t=bb("div"),n=bb("div"),r=bb("div"),s=bb("div"),gg(i.$$.fragment),a=yb(),o=bb("div"),gg(c.$$.fragment),l=yb(),u=bb("div"),gg(d.$$.fragment),h=yb(),p=bb("div"),f=bb("div"),m=gb(T),b=yb(),M&&M.c(),g=yb(),y=bb("div"),v=bb("div"),w=bb("div"),x=bb("div"),gg(k.$$.fragment),E=yb(),gg(A.$$.fragment),kb(s,"class","drop-shadow svelte-1xsvwqj"),Ab(o,"margin-left","-0.5rem"),kb(o,"class","drop-shadow svelte-1xsvwqj"),Ab(u,"right","-4px"),Ab(u,"bottom","-4px"),kb(u,"class","drop-shadow absolute svelte-1xsvwqj"),kb(r,"class","flex relative"),kb(f,"class","address svelte-1xsvwqj"),kb(p,"class","wallet-info svelte-1xsvwqj"),kb(x,"class","chain-icon-container svelte-1xsvwqj"),kb(w,"class","flex items-center"),kb(v,"class","container shadow-1 flex items-center svelte-1xsvwqj"),kb(v,"style",C=`border-color: var(${e[4]?"--onboard-primary-200, var(--primary-200)":"--onboard-warning-500, var(--warning-500)"}); background-color: var(${e[4]?"--account-center-minimized-chain-select-background, var(--primary-100)":"--account-center-minimized-chain-select-background-warning, var(--warning-100)"})`),kb(y,"class","network"),kb(n,"class","inner-row svelte-1xsvwqj"),kb(t,"class","ac-trigger svelte-1xsvwqj")},m(C,P){pb(C,t,P),cb(t,n),cb(n,r),cb(r,s),yg(i,s,null),cb(r,a),cb(r,o),yg(c,o,null),cb(r,l),cb(r,u),yg(d,u,null),cb(n,h),cb(n,p),cb(p,f),cb(f,m),cb(p,b),M&&M.m(p,null),cb(n,g),cb(n,y),cb(y,v),cb(v,w),cb(w,x),yg(k,x,null),cb(w,E),yg(A,w,null),S=!0,I||(B=[wb(v,"click",xb(e[15])),wb(t,"click",xb((function(){qm(e[0])&&e[0].apply(this,arguments)})))],I=!0)},p(t,[n]){e=t;const r={};512&n&&(r.icon=e[9]&&e[9].icon||qf),i.$set(r);const s={};2&n&&(s.icon=e[1]?e[1].icon:""),c.$set(s),(!S||448&n)&&T!==(T=(e[8]?Kf(e[8]):e[7]?Kf(e[7]):e[6])+"")&&Eb(m,T),e[5]?M?(M.p(e,n),32&n&&sg(M,1)):(M=Ewe(e),M.c(),sg(M,1),M.m(p,null)):M&&(M.d(1),M=null);const a={};16&n&&(a.color=e[4]?e[4].icon?void 0:"var(--onboard-primary-100, var(--primary-100))":"var(\n --account-center-chain-warning,\n var(--onboard-warning-500, var(--warning-500))\n )"),24&n&&(a.customBackgroundColor=e[4]?e[4].color||e[3]&&e[3].color||sm.color:"var(--onboard-warning-200, var(--warning-200))"),24&n&&(a.icon=e[4]?e[4].icon||e[3]&&e[3].icon||sm.icon:lve),k.$set(a),(!S||16&n&&C!==(C=`border-color: var(${e[4]?"--onboard-primary-200, var(--primary-200)":"--onboard-warning-500, var(--warning-500)"}); background-color: var(${e[4]?"--account-center-minimized-chain-select-background, var(--primary-100)":"--account-center-minimized-chain-select-background-warning, var(--warning-100)"})`))&&kb(v,"style",C)},i(e){S||(sg(i.$$.fragment,e),sg(c.$$.fragment,e),sg(d.$$.fragment,e),sg(M),sg(k.$$.fragment,e),sg(A.$$.fragment,e),e&&$b((()=>{S&&(_&&_.end(1),P=og(t,wv,{duration:250}),P.start())})),S=!0)},o(e){ig(i.$$.fragment,e),ig(c.$$.fragment,e),ig(d.$$.fragment,e),ig(k.$$.fragment,e),ig(A.$$.fragment,e),P&&P.invalidate(),_=cg(t,wv,{duration:100}),S=!1},d(e){e&&fb(t),vg(i),vg(c),vg(d),M&&M.d(),vg(k),vg(A),e&&_&&_.end(),I=!1,Gm(B)}}}function Cwe(e,t,n){let r,s,i,a,o,c,l,u,d,h,p,f;Zm(e,_g,(e=>n(14,p=e)));let{toggle:m}=t;const b=Lm.select("appMetadata").pipe(De(Lm.get().appMetadata),Ue(1));Zm(e,b,(e=>n(9,f=e)));const g=Lm.get().chains;return e.$$set=e=>{"toggle"in e&&n(0,m=e.toggle)},e.$$.update=()=>{16384&e.$$.dirty&&n(1,[r]=p,r),2&e.$$.dirty&&n(13,[s]=r?r.accounts:[],s),8192&e.$$.dirty&&n(8,i=s&&s.ens&&Kf(s.ens.name)),8192&e.$$.dirty&&n(7,a=s&&s.uns&&Kf(s.uns.name)),8192&e.$$.dirty&&n(6,o=s?Qf(s.address):""),8192&e.$$.dirty&&n(2,[c]=s&&s.balance?Object.keys(s.balance):[],c),8196&e.$$.dirty&&n(5,l=s&&s.balance?s.balance[c]:null),2&e.$$.dirty&&n(12,u=r&&r.chains[0]),4096&e.$$.dirty&&n(4,d=g.find((({id:e,namespace:t})=>!!u&&(e===u.id&&t===u.namespace)))),4096&e.$$.dirty&&n(3,h=im(u&&u.id))},[m,r,c,h,d,l,o,a,i,f,b,g,u,s,p,function(t){Lb.call(this,e,t)}]}class Pwe extends kg{constructor(e){super(),xg(this,e,Cwe,Awe,$m,{toggle:0},kwe)}}function _we(e){lb(e,"svelte-1o9vinu",".ac-trigger.svelte-1o9vinu{--background-color:var(\n --account-center-minimized-background,\n var(--w3o-background-color, white)\n );--text-color:var(--w3o-text-color, var(--gray-700));--border-color:var(\n --account-center-border,\n var(--w3o-border-color, var(--onboard-gray-200, var(--gray-200)))\n );--border-radius:var(\n --account-center-border-radius,\n var(--w3o-border-radius, 1rem)\n );position:relative;cursor:pointer;pointer-events:auto;min-width:80px;background:var(--background-color);color:var(--text-color);border:1px solid var(--border-color);border-radius:var(--border-radius);box-shadow:var(\n --account-center-box-shadow,\n var(--onboard-shadow-3, var(--shadow-3))\n );z-index:var(--account-center-z-index, 1)}.wallet-square-wrapper.svelte-1o9vinu{position:relative;margin-left:-8px}.check-icon-wrapper.svelte-1o9vinu{position:absolute;right:-4px;bottom:-4px}.inner-row.svelte-1o9vinu{display:flex;flex-flow:row nowrap;width:80px;padding:0.75rem}.drop-shadow.svelte-1o9vinu{filter:drop-shadow(0px 1px 4px rgba(0, 0, 0, 0.2))}")}function Swe(e){let t,n,r,s,i,a,o,c,l,u,d,h,p,f,m;return s=new sw({props:{size:32,padding:4,background:"white",border:"darkGreen",radius:8,icon:e[3]&&e[3].icon||qf}}),c=new sw({props:{size:32,padding:4,background:"green",border:"darkGreen",radius:8,icon:e[1]?e[1].icon:""}}),d=new Uv({props:{size:14}}),{c(){t=bb("div"),n=bb("div"),r=bb("div"),gg(s.$$.fragment),i=yb(),a=bb("div"),o=bb("div"),gg(c.$$.fragment),l=yb(),u=bb("div"),gg(d.$$.fragment),kb(r,"class","drop-shadow svelte-1o9vinu"),kb(o,"class","drop-shadow svelte-1o9vinu"),kb(u,"class","check-icon-wrapper drop-shadow svelte-1o9vinu"),kb(a,"class","wallet-square-wrapper svelte-1o9vinu"),kb(n,"class","inner-row svelte-1o9vinu"),kb(t,"class","ac-trigger svelte-1o9vinu"),kb(t,"style",h=e[2].position.includes("Left")?"align-self: flex-start":null)},m(h,b){pb(h,t,b),cb(t,n),cb(n,r),yg(s,r,null),cb(n,i),cb(n,a),cb(a,o),yg(c,o,null),cb(a,l),cb(a,u),yg(d,u,null),p=!0,f||(m=wb(t,"click",xb((function(){qm(e[0])&&e[0].apply(this,arguments)}))),f=!0)},p(n,[r]){e=n;const i={};8&r&&(i.icon=e[3]&&e[3].icon||qf),s.$set(i);const a={};2&r&&(a.icon=e[1]?e[1].icon:""),c.$set(a),(!p||4&r&&h!==(h=e[2].position.includes("Left")?"align-self: flex-start":null))&&kb(t,"style",h)},i(e){p||(sg(s.$$.fragment,e),sg(c.$$.fragment,e),sg(d.$$.fragment,e),p=!0)},o(e){ig(s.$$.fragment,e),ig(c.$$.fragment,e),ig(d.$$.fragment,e),p=!1},d(e){e&&fb(t),vg(s),vg(c),vg(d),f=!1,m()}}}function Iwe(e,t,n){let r,s,i,a;Zm(e,_g,(e=>n(6,s=e)));let{toggle:o}=t;const c=Lm.select("appMetadata").pipe(De(Lm.get().appMetadata),Ue(1));Zm(e,c,(e=>n(3,a=e)));const l=Lm.select("accountCenter").pipe(De(Lm.get().accountCenter),Ue(1));return Zm(e,l,(e=>n(2,i=e))),e.$$set=e=>{"toggle"in e&&n(0,o=e.toggle)},e.$$.update=()=>{64&e.$$.dirty&&n(1,[r]=s,r)},[o,r,i,a,c,l,s]}class Bwe extends kg{constructor(e){super(),xg(this,e,Iwe,Swe,$m,{toggle:0},_we)}}function Twe(e){lb(e,"svelte-1nua59o",".ac-container.svelte-1nua59o{display:flex;flex-flow:column;align-items:flex-end;gap:0.5rem}")}function Mwe(e){let t,n;return t=new xwe({props:{expanded:e[0]}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.expanded=e[0]),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function Owe(e){let t,n;return t=new Pwe({props:{toggle:e[4]}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p:Um,i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function Nwe(e){let t,n;return t=new Bwe({props:{toggle:e[4]}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p:Um,i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function Rwe(e){let t,n;return t=new xwe({props:{expanded:e[0]}}),{c(){gg(t.$$.fragment)},m(e,r){yg(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.expanded=e[0]),t.$set(r)},i(e){n||(sg(t.$$.fragment,e),n=!0)},o(e){ig(t.$$.fragment,e),n=!1},d(e){vg(t,e)}}}function Fwe(e){let t,n,r,s,i,a,o,c,l=e[1].position.includes("bottom"),u=e[1].position.includes("top"),d=l&&Mwe(e);const h=[Nwe,Owe],p=[];function f(e,t){return e[1].minimal?0:1}r=f(e),s=p[r]=h[r](e);let m=u&&Rwe(e);return{c(){t=bb("div"),d&&d.c(),n=yb(),s.c(),i=yb(),m&&m.c(),kb(t,"class","ac-container svelte-1nua59o")},m(s,l){pb(s,t,l),d&&d.m(t,null),cb(t,n),p[r].m(t,null),cb(t,i),m&&m.m(t,null),a=!0,o||(c=wb(window,"click",e[3]),o=!0)},p(e,[a]){2&a&&(l=e[1].position.includes("bottom")),l?d?(d.p(e,a),2&a&&sg(d,1)):(d=Mwe(e),d.c(),sg(d,1),d.m(t,n)):d&&(ng(),ig(d,1,1,(()=>{d=null})),rg());let o=r;r=f(e),r===o?p[r].p(e,a):(ng(),ig(p[o],1,1,(()=>{p[o]=null})),rg(),s=p[r],s?s.p(e,a):(s=p[r]=h[r](e),s.c()),sg(s,1),s.m(t,i)),2&a&&(u=e[1].position.includes("top")),u?m?(m.p(e,a),2&a&&sg(m,1)):(m=Rwe(e),m.c(),sg(m,1),m.m(t,null)):m&&(ng(),ig(m,1,1,(()=>{m=null})),rg())},i(e){a||(sg(d),sg(s),sg(m),a=!0)},o(e){ig(d),ig(s),ig(m),a=!1},d(e){e&&fb(t),d&&d.d(),p[r].d(),m&&m.d(),o=!1,c()}}}function jwe(e,t,n){let r,s=!1;const i=Lm.select("accountCenter").pipe(De(Lm.get().accountCenter),Ue(1));function a(){r.expanded&&(Ny({expanded:!1}),n(0,s=!1))}return Zm(e,i,(e=>n(1,r=e))),jb(a),[s,r,i,a,function(){Ny({expanded:!r.expanded}),n(0,s=!s)}]}var Lwe=Object.freeze({__proto__:null,default:class extends kg{constructor(e){super(),xg(this,e,jwe,Fwe,$m,{},Twe)}}});function Uwe(e,{from:t,to:n},r={}){const s=getComputedStyle(e),i="none"===s.transform?"":s.transform,[a,o]=s.transformOrigin.split(" ").map(parseFloat),c=t.left+t.width*a/n.width-(n.left+a),l=t.top+t.height*o/n.height-(n.top+o),{delay:u=0,duration:d=e=>120*Math.sqrt(e),easing:h=yv}=r;return{delay:u,duration:qm(d)?d(Math.sqrt(c*c+l*l)):d,easing:h,css:(e,r)=>{const s=r*c,a=r*l,o=e+r*t.width/n.width,u=e+r*t.height/n.height;return`transform: ${i} translate(${s}px, ${a}px) scale(${o}, ${u});`}}}function Dwe(e){lb(e,"svelte-13cuwwo","div.svelte-13cuwwo{box-sizing:content-box}.border.svelte-13cuwwo{border:2px solid;border-radius:120px;overflow:hidden}")}function zwe(e){let t,n;return{c(){t=bb("div"),kb(t,"class","border svelte-13cuwwo"),kb(t,"style",n=`\n width: ${e[2]-2*e[3]}px; \n height: ${e[2]-2*e[3]}px; \n border-color: var(${e[1]}); \n padding: ${e[3]}px; \n background-color: ${e[4]};\n border-radius: 50%;\n display: flex;\n justify-content: center;\n `)},m(n,r){pb(n,t,r),t.innerHTML=e[0]},p(e,[r]){1&r&&(t.innerHTML=e[0]),30&r&&n!==(n=`\n width: ${e[2]-2*e[3]}px; \n height: ${e[2]-2*e[3]}px; \n border-color: var(${e[1]}); \n padding: ${e[3]}px; \n background-color: ${e[4]};\n border-radius: 50%;\n display: flex;\n justify-content: center;\n `)&&kb(t,"style",n)},i:Um,o:Um,d(e){e&&fb(t)}}}function Hwe(e,t,n){let{icon:r}=t,{borderColorVar:s}=t,{size:i}=t,{padding:a=0}=t,{background:o="transparent"}=t;return e.$$set=e=>{"icon"in e&&n(0,r=e.icon),"borderColorVar"in e&&n(1,s=e.borderColorVar),"size"in e&&n(2,i=e.size),"padding"in e&&n(3,a=e.padding),"background"in e&&n(4,o=e.background)},[r,s,i,a,o]}class Gwe extends kg{constructor(e){super(),xg(this,e,Hwe,zwe,$m,{icon:0,borderColorVar:1,size:2,padding:3,background:4},Dwe)}}function qwe(e){lb(e,"svelte-jvic9v","div.notification-icons-wrapper.svelte-jvic9v{height:32px;width:32px}.border.svelte-jvic9v{border-radius:8px}div.notification-icon.svelte-jvic9v{padding:6px}div.pending-icon.svelte-jvic9v{animation:svelte-jvic9v-blink 2s ease-in infinite;height:100%;width:100%;padding:7px}@keyframes svelte-jvic9v-blink{from,to{opacity:1}50%{opacity:0.2}}div.border-action.svelte-jvic9v{height:32px;min-width:32px;border-radius:8px;overflow:hidden;will-change:transform}div.border-action.svelte-jvic9v:before{content:'';background-image:conic-gradient(#b1b7f2 20deg, #6370e5 120deg);height:140%;width:140%;position:absolute;left:-25%;top:-25%;animation:svelte-jvic9v-rotate 2s infinite linear}div.chain-icon-container.svelte-jvic9v{left:18px;top:18px}@keyframes svelte-jvic9v-rotate{100%{transform:rotate(-360deg)}}")}function $we(e){let t,n,r,s,i,a,o,c,l=om[e[1].type].eventIcon+"",u=!e[1].id.includes("customNotification")&&!e[1].id.includes("preflight"),d="pending"===e[1].type&&Vwe(),h=u&&Wwe(e);return{c(){t=bb("div"),d&&d.c(),n=yb(),r=bb("div"),s=bb("div"),o=yb(),h&&h.c(),kb(s,"class",i=eb("notification-icon flex items-center justify-center "+("pending"===e[1].type?"pending-icon":""))+" svelte-jvic9v"),kb(r,"class","flex items-center justify-center border relative notification-icons-wrapper svelte-jvic9v"),kb(r,"style",a=`background:${om[e[1].type].backgroundColor}; color: ${om[e[1].type].iconColor||""}; ${"pending"===e[1].type?"height: 28px; width: 28px; margin: 2px;":`border: 2px solid ${om[e[1].type].borderColor}`}; `),kb(t,"class","relative")},m(e,i){pb(e,t,i),d&&d.m(t,null),cb(t,n),cb(t,r),cb(r,s),s.innerHTML=l,cb(t,o),h&&h.m(t,null),c=!0},p(e,o){"pending"===e[1].type?d||(d=Vwe(),d.c(),d.m(t,n)):d&&(d.d(1),d=null),(!c||2&o)&&l!==(l=om[e[1].type].eventIcon+"")&&(s.innerHTML=l),(!c||2&o&&i!==(i=eb("notification-icon flex items-center justify-center "+("pending"===e[1].type?"pending-icon":""))+" svelte-jvic9v"))&&kb(s,"class",i),(!c||2&o&&a!==(a=`background:${om[e[1].type].backgroundColor}; color: ${om[e[1].type].iconColor||""}; ${"pending"===e[1].type?"height: 28px; width: 28px; margin: 2px;":`border: 2px solid ${om[e[1].type].borderColor}`}; `))&&kb(r,"style",a),2&o&&(u=!e[1].id.includes("customNotification")&&!e[1].id.includes("preflight")),u?h?(h.p(e,o),2&o&&sg(h,1)):(h=Wwe(e),h.c(),sg(h,1),h.m(t,null)):h&&(ng(),ig(h,1,1,(()=>{h=null})),rg())},i(e){c||(sg(h),c=!0)},o(e){ig(h),c=!1},d(e){e&&fb(t),d&&d.d(),h&&h.d()}}}function Vwe(e){let t;return{c(){t=bb("div"),kb(t,"class","border-action absolute svelte-jvic9v")},m(e,n){pb(e,t,n)},d(e){e&&fb(t)}}}function Wwe(e){let t,n,r;return n=new Gwe({props:{icon:e[0].icon,size:16,background:e[0].color,borderColorVar:"--notify-onboard-background, var(--onboard-gray-600, var(--gray-600))",padding:3}}),{c(){t=bb("div"),gg(n.$$.fragment),kb(t,"class","absolute chain-icon-container svelte-jvic9v")},m(e,s){pb(e,t,s),yg(n,t,null),r=!0},p(e,t){const r={};1&t&&(r.icon=e[0].icon),1&t&&(r.background=e[0].color),n.$set(r)},i(e){r||(sg(n.$$.fragment,e),r=!0)},o(e){ig(n.$$.fragment,e),r=!1},d(e){e&&fb(t),vg(n)}}}function Zwe(e){let t,n,r=e[1].type&&$we(e);return{c(){r&&r.c(),t=vb()},m(e,s){r&&r.m(e,s),pb(e,t,s),n=!0},p(e,[n]){e[1].type?r?(r.p(e,n),2&n&&sg(r,1)):(r=$we(e),r.c(),sg(r,1),r.m(t.parentNode,t)):r&&(ng(),ig(r,1,1,(()=>{r=null})),rg())},i(e){n||(sg(r),n=!0)},o(e){ig(r),n=!1},d(e){r&&r.d(e),e&&fb(t)}}}function Qwe(e,t,n){let{chainStyles:r=sm}=t,{notification:s}=t;return e.$$set=e=>{"chainStyles"in e&&n(0,r=e.chainStyles),"notification"in e&&n(1,s=e.notification)},[r,s]}class Kwe extends kg{constructor(e){super(),xg(this,e,Qwe,Zwe,$m,{chainStyles:0,notification:1},qwe)}}function Ywe(e){lb(e,"svelte-pm7idu","div.svelte-pm7idu{display:flex;justify-content:center;font-size:inherit;font-family:inherit;margin:0 1.5rem 0 0.75rem}span.svelte-pm7idu{font-family:inherit;display:flex;align-items:center;margin:0 2px}.time.svelte-pm7idu{color:var(\n --notify-onboard-timer-color,\n var(--onboard-gray-300, var(--gray-300))\n );margin-left:4px}")}function Jwe(e){let t,n,r,s,i=e[2](e[1]-e[0])+"";return{c(){t=gb("-\n "),n=bb("span"),r=gb(i),s=gb("\n ago"),kb(n,"class","svelte-pm7idu")},m(e,i){pb(e,t,i),pb(e,n,i),cb(n,r),pb(e,s,i)},p(e,t){3&t&&i!==(i=e[2](e[1]-e[0])+"")&&Eb(r,i)},d(e){e&&fb(t),e&&fb(n),e&&fb(s)}}}function Xwe(e){let t,n=e[0]&&Jwe(e);return{c(){t=bb("div"),n&&n.c(),kb(t,"class","time svelte-pm7idu")},m(e,r){pb(e,t,r),n&&n.m(t,null)},p(e,[r]){e[0]?n?n.p(e,r):(n=Jwe(e),n.c(),n.m(t,null)):n&&(n.d(1),n=null)},i:Um,o:Um,d(e){e&&fb(t),n&&n.d()}}}function exe(e,t,n){let r,s;Zm(e,Rr,(e=>n(3,r=e))),Zm(e,mr,(e=>n(4,s=e)));let{startTime:i}=t;let a=Date.now();const o=setInterval((()=>{n(1,a=Date.now())}),1e3);return jb((()=>{clearInterval(o)})),e.$$set=e=>{"startTime"in e&&n(0,i=e.startTime)},[i,a,function(e){const t=Math.floor(e/1e3),n=t<0?0:t;return n>=60?`${Math.floor(n/60).toLocaleString(s)} ${r("notify.time.minutes")}`:`${n.toLocaleString(s)} ${r("notify.time.seconds")}`}]}class txe extends kg{constructor(e){super(),xg(this,e,exe,Xwe,$m,{startTime:0},Ywe)}}function nxe(e){lb(e,"svelte-1otz6tt","div.notify-transaction-data.svelte-1otz6tt{font-size:var(\n --notify-onboard-transaction-font-size,\n var(--onboard-font-size-6, var(--font-size-6))\n );font-family:inherit;margin:0px 20px 0px 8px;justify-content:center}.hash-time.svelte-1otz6tt{display:inline-flex;margin-top:4px;font-size:var(\n --notify-onboard-hash-time-font-size,\n var(--onboard-font-size-7, var(--font-size-7))\n );line-height:var(\n --notify-onboard-hash-time-font-line-height,\n var(--onboard-font-line-height-4, var(--font-line-height-4))\n )}.address-hash.svelte-1otz6tt{color:var(\n --notify-onboard-address-hash-color,\n var(--onboard-primary-200, var(--primary-200))\n )}a.address-hash.svelte-1otz6tt{color:var(\n --notify-onboard-anchor-color,\n var(--onboard-primary-400, var(--primary-400))\n )}a.svelte-1otz6tt{display:flex;text-decoration:none;color:inherit}.transaction-status.svelte-1otz6tt{color:var(--notify-onboard-transaction-status, inherit);line-height:var(\n --notify-onboard-font-size-5,\n var(--onboard-font-size-5, var(--font-size-5))\n );font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}")}function rxe(e){let t,n,r,s;function i(e,t){return e[0].link?ixe:sxe}let a=i(e),o=a(e);return r=new txe({props:{startTime:e[0].startTime}}),{c(){t=bb("span"),o.c(),n=yb(),gg(r.$$.fragment),kb(t,"class","hash-time svelte-1otz6tt")},m(e,i){pb(e,t,i),o.m(t,null),cb(t,n),yg(r,t,null),s=!0},p(e,s){a===(a=i(e))&&o?o.p(e,s):(o.d(1),o=a(e),o&&(o.c(),o.m(t,n)));const c={};1&s&&(c.startTime=e[0].startTime),r.$set(c)},i(e){s||(sg(r.$$.fragment,e),s=!0)},o(e){ig(r.$$.fragment,e),s=!1},d(e){e&&fb(t),o.d(),vg(r)}}}function sxe(e){let t,n,r=Qf(e[0].id)+"";return{c(){t=bb("div"),n=gb(r),kb(t,"class","address-hash svelte-1otz6tt")},m(e,r){pb(e,t,r),cb(t,n)},p(e,t){1&t&&r!==(r=Qf(e[0].id)+"")&&Eb(n,r)},d(e){e&&fb(t)}}}function ixe(e){let t,n,r,s=Qf(e[0].id)+"";return{c(){t=bb("a"),n=gb(s),kb(t,"class","address-hash svelte-1otz6tt"),kb(t,"href",r=e[0].link),kb(t,"target","_blank"),kb(t,"rel","noreferrer noopener")},m(e,r){pb(e,t,r),cb(t,n)},p(e,i){1&i&&s!==(s=Qf(e[0].id)+"")&&Eb(n,s),1&i&&r!==(r=e[0].link)&&kb(t,"href",r)},d(e){e&&fb(t)}}}function axe(e){let t,n,r,s,i,a=e[0].message+"",o=e[0].id&&!e[0].id.includes("customNotification")&&!e[0].id.includes("preflight"),c=o&&rxe(e);return{c(){t=bb("div"),n=bb("span"),r=gb(a),s=yb(),c&&c.c(),kb(n,"class","transaction-status svelte-1otz6tt"),kb(t,"class","flex flex-column notify-transaction-data svelte-1otz6tt")},m(e,a){pb(e,t,a),cb(t,n),cb(n,r),cb(t,s),c&&c.m(t,null),i=!0},p(e,[n]){(!i||1&n)&&a!==(a=e[0].message+"")&&Eb(r,a),1&n&&(o=e[0].id&&!e[0].id.includes("customNotification")&&!e[0].id.includes("preflight")),o?c?(c.p(e,n),1&n&&sg(c,1)):(c=rxe(e),c.c(),sg(c,1),c.m(t,null)):c&&(ng(),ig(c,1,1,(()=>{c=null})),rg())},i(e){i||(sg(c),i=!0)},o(e){ig(c),i=!1},d(e){e&&fb(t),c&&c.d()}}}function oxe(e,t,n){let{notification:r}=t;return e.$$set=e=>{"notification"in e&&n(0,r=e.notification)},[r]}class cxe extends kg{constructor(e){super(),xg(this,e,oxe,axe,$m,{notification:0},nxe)}}const lxe=["txPool"],uxe=["main","matic-main"],dxe=["Ledger","Trezor","Keystone","KeepKey","D'CENT"],hxe=e=>lxe.includes(e),pxe=e=>uxe.includes(e),fxe=e=>e&&dxe.includes(e.label);async function mxe({type:e,wallet:t,transaction:n}){const{from:r,input:s,value:i,to:a,nonce:o,gas:c,network:l}=n,u=nm[l],{gasPriceProbability:d}=Lm.get().notify.replacement,{gas:h,apiKey:p}=hm;if(!h)return;const[f]=await h.get({chains:[nm[l]],endpoint:"blockPrices",apiKey:p}),{maxFeePerGas:m,maxPriorityFeePerGas:b}=f.blockPrices[0].estimatedPrices.find((({confidence:t})=>t===("speedup"===e?null==d?void 0:d.speedup:null==d?void 0:d.cancel)))||{};if(!m||!b)return;const g=Jf(m),y=Jf(b),v="0x"===s?{}:{data:s};return t.provider.request({method:"eth_sendTransaction",params:[Object.assign({type:"0x2",from:r,to:"cancel"===e?r:a,chainId:parseInt(u),value:Sa(BigInt(i)),nonce:Yf(o),gasLimit:Yf(c),maxFeePerGas:g,maxPriorityFeePerGas:y},v)]})}function bxe(e){lb(e,"svelte-ftkynd",".bn-notify-notification.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{--backround-color:var(--notify-onboard-background, var(--w3o-backround-color, var(--gray-700)));--foreground-color:var(--w3o-foreground-color, var(--gray-600));--text-color:var(--w3o-text-color, #FFF);--border-color:var(--w3o-border-color);font-family:inherit;transition:background 300ms ease-in-out, color 300ms ease-in-out;pointer-events:all;backdrop-filter:blur(5px);width:100%;min-height:56px;display:flex;flex-direction:column;position:relative;overflow:hidden;border:1px solid transparent;border-radius:var(\n --notify-onboard-border-radius,\n var(--onboard-border-radius-4, var(--border-radius-4))\n );background:var(--foreground-color);color:var(--text-color)}.bn-notify-notification-inner.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{padding:0.75rem}.bn-notify-notification.svelte-ftkynd:hover>div.bn-notify-notification-inner.svelte-ftkynd>div.notify-close-btn-desktop.svelte-ftkynd{visibility:visible;opacity:1}div.notify-close-btn.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{margin-left:auto;margin-bottom:auto;height:24px;width:24px;position:absolute;top:8px;right:8px;justify-content:center;align-items:center}div.notify-close-btn-desktop.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{visibility:hidden;transition:visibility 0.15s linear, opacity 0.15s linear;opacity:0}.notify-close-btn.svelte-ftkynd .close-icon.svelte-ftkynd.svelte-ftkynd{width:20px;margin:auto;color:var(--text-color)}.notify-close-btn.svelte-ftkynd>.close-icon.svelte-ftkynd.svelte-ftkynd{color:var(--notify-onboard-close-icon-color)}.notify-close-btn.svelte-ftkynd:hover>.close-icon.svelte-ftkynd.svelte-ftkynd{color:var(--notify-onboard-close-icon-hover)}.transaction-status.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{color:var(\n --notify-onboard-transaction-status-color,\n var(--onboard-primary-100, var(--primary-100))\n );line-height:14px}.dropdown.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{height:0px;overflow:hidden;transition:height 150ms ease-in-out}.dropdown-visible.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{height:48px}.dropdown-buttons.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{background-color:var(\n --notify-onboard-dropdown-background,\n var(--onboard-gray-700, var(--gray-700))\n );width:100%;padding:8px}.dropdown-button.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{padding:4px 12px;border-radius:var(\n --notify-onboard-dropdown-border-radius,\n var(--onboard-border-radius-5, var(--border-radius-5))\n );background-color:transparent;font-size:var(\n --notify-onboard-dropdown-font-size,\n var(--onboard-font-size-6, var(--font-size-6))\n );color:var(\n --notify-onboard-dropdown-text-color,\n var(--onboard-primary-400, var(--primary-400))\n );transition:all 150ms ease-in-out;cursor:pointer}.dropdown-button.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd:hover{background:var(\n --notify-onboard-dropdown-btn-hover-background,\n rgba(146, 155, 237, 0.2)\n )}")}function gxe(e){let t,n,r,s,i,a;return{c(){t=bb("div"),n=bb("button"),n.textContent="Cancel",r=yb(),s=bb("button"),s.textContent="Speed-up",kb(n,"class","dropdown-button svelte-ftkynd"),kb(s,"class","dropdown-button svelte-ftkynd"),kb(t,"class","dropdown-buttons flex items-center justify-end svelte-ftkynd")},m(o,c){pb(o,t,c),cb(t,n),cb(t,r),cb(t,s),i||(a=[wb(n,"click",e[10]),wb(s,"click",e[11])],i=!0)},p:Um,d(e){e&&fb(t),i=!1,Gm(a)}}}function yxe(e){let t,n,r,s,i,a,o,c,l,u,d,h,p,f;r=new Kwe({props:{notification:e[0],chainStyles:rm[nm[e[0].network]]}}),i=new cxe({props:{notification:e[0]}});let m="txPool"===e[0].eventCode&&gxe(e);return{c(){t=bb("div"),n=bb("div"),gg(r.$$.fragment),s=yb(),gg(i.$$.fragment),a=yb(),o=bb("div"),c=bb("div"),l=yb(),u=bb("div"),m&&m.c(),kb(c,"class","flex items-center close-icon svelte-ftkynd"),kb(o,"class","notify-close-btn notify-close-btn-"+e[4].type+" pointer flex svelte-ftkynd"),kb(n,"class","flex bn-notify-notification-inner svelte-ftkynd"),kb(u,"class","dropdown svelte-ftkynd"),Pb(u,"dropdown-visible",e[2]&&e[5]&&hxe(e[0].eventCode)&&pxe(e[0].network)&&fxe(e[7])),kb(t,"class",d="bn-notify-notification bn-notify-notification-"+e[0].type+"} svelte-ftkynd"),Pb(t,"bn-notify-clickable",e[0].onClick)},m(d,b){pb(d,t,b),cb(t,n),yg(r,n,null),cb(n,s),yg(i,n,null),cb(n,a),cb(n,o),cb(o,c),c.innerHTML='\n\n \n\n',cb(t,l),cb(t,u),m&&m.m(u,null),h=!0,p||(f=[wb(o,"click",xb(e[9])),wb(t,"mouseenter",e[12]),wb(t,"mouseleave",e[13]),wb(t,"click",e[8])],p=!0)},p(e,[n]){const s={};1&n&&(s.notification=e[0]),1&n&&(s.chainStyles=rm[nm[e[0].network]]),r.$set(s);const a={};1&n&&(a.notification=e[0]),i.$set(a),"txPool"===e[0].eventCode?m?m.p(e,n):(m=gxe(e),m.c(),m.m(u,null)):m&&(m.d(1),m=null),(!h||165&n)&&Pb(u,"dropdown-visible",e[2]&&e[5]&&hxe(e[0].eventCode)&&pxe(e[0].network)&&fxe(e[7])),(!h||1&n&&d!==(d="bn-notify-notification bn-notify-notification-"+e[0].type+"} svelte-ftkynd"))&&kb(t,"class",d),(!h||1&n)&&Pb(t,"bn-notify-clickable",e[0].onClick)},i(e){h||(sg(r.$$.fragment,e),sg(i.$$.fragment,e),h=!0)},o(e){ig(r.$$.fragment,e),ig(i.$$.fragment,e),h=!1},d(e){e&&fb(t),vg(r),vg(i),m&&m.d(),p=!1,Gm(f)}}}function vxe(e,t,n){let r,s;Zm(e,_g,(e=>n(15,r=e))),Zm(e,Rr,(e=>n(3,s=e)));const{device:i,gas:a}=hm;let o,{notification:c}=t,{updateParentOnRemove:l}=t,u=!1;const d=Sg.getValue().find((({hash:e})=>e===c.id)),h=d&&r.find((({accounts:e})=>!!e.find((({address:e})=>e.toLowerCase()===d.from.toLowerCase()))));jb((()=>{clearTimeout(o)}));return e.$$set=e=>{"notification"in e&&n(0,c=e.notification),"updateParentOnRemove"in e&&n(1,l=e.updateParentOnRemove)},e.$$.update=()=>{1&e.$$.dirty&&c.autoDismiss&&(o=setTimeout((()=>{Uy(c.id),Ig(c.id)}),c.autoDismiss))},[c,l,u,s,i,a,d,h,function(e){(null==c?void 0:c.onClick)&&c.onClick(e)},()=>{Uy(c.id),Ig(c.id),l()},async()=>{try{await mxe({type:"cancel",wallet:h,transaction:d})}catch(e){const t=`${d.hash.slice(0,9)}:txReplaceError${d.hash.slice(-5)}`;Ly({id:t,type:"hint",eventCode:"txError",message:s("notify.transaction.txReplaceError"),key:t,autoDismiss:4e3})}},async()=>{try{await mxe({type:"speedup",wallet:h,transaction:d})}catch(e){const t=`${d.hash.slice(0,9)}:txReplaceError${d.hash.slice(-5)}`;Ly({id:t,type:"hint",eventCode:"txError",message:s("notify.transaction.txReplaceError"),key:t,autoDismiss:4e3})}},()=>n(2,u=!0),()=>n(2,u=!1)]}class wxe extends kg{constructor(e){super(),xg(this,e,vxe,yxe,$m,{notification:0,updateParentOnRemove:1},bxe)}}function xxe(e){lb(e,"svelte-1h8mmo3","ul.svelte-1h8mmo3{padding-left:0;display:flex;flex-flow:column nowrap;font-size:var(\n --notify-onboard-font-size,\n var(--onboard-font-size-5, var(--font-size-5))\n );list-style-type:none;overflow:visible;scrollbar-width:none;box-sizing:border-box;z-index:var(--notify-onboard-z-index, 300);font-family:var(\n --notify-onboard-font-family,\n var(--onboard-font-family-normal, inherit)\n );margin:8px 0;pointer-events:all}.y-scroll.svelte-1h8mmo3{overflow-y:scroll}.y-visible.svelte-1h8mmo3{overflow-y:visible}li.notification-list-top.svelte-1h8mmo3:not(:first-child){margin-top:8px}li.notification-list-bottom.svelte-1h8mmo3:not(:first-child){margin-bottom:8px}ul.bn-notify-bottomLeft.svelte-1h8mmo3,ul.bn-notify-bottomRight.svelte-1h8mmo3{flex-direction:column-reverse}@media only screen and (max-width: 450px){ul.svelte-1h8mmo3{width:100%}}.bn-notify-clickable:hover{cursor:pointer}.svelte-1h8mmo3::-webkit-scrollbar{display:none}")}function kxe(e,t,n){const r=e.slice();return r[12]=t[n],r}function Exe(e){let t,n,r,s,i=[],a=new Map,o=e[2];const c=e=>e[12].key;for(let t=0;t{if(!f&&e>=c&&(f=!0),f&&e>=l&&(u(1,0),m()),!p)return!1;if(f){const t=0+1*o((e-c)/a);u(t,1-t)}return!0})),d&&(h=Mb(e,0,1,a,i,o,d)),i||(f=!0),u(0,1),m}(n,c,Uwe,{duration:500})},i(e){l||(sg(r.$$.fragment,e),e&&$b((()=>{l&&(o&&o.end(1),a=og(n,xv,{duration:1200,delay:300,x:t[3],y:t[4],easing:Pxe}),a.start())})),l=!0)},o(e){ig(r.$$.fragment,e),a&&a.invalidate(),o=cg(n,wv,{duration:300,easing:yv}),l=!1},d(e){e&&fb(n),vg(r),e&&o&&o.end(),u=!1,d()}}}function Cxe(e){let t,n,r=e[2].length&&Exe(e);return{c(){r&&r.c(),t=vb()},m(e,s){r&&r.m(e,s),pb(e,t,s),n=!0},p(e,[n]){e[2].length?r?(r.p(e,n),4&n&&sg(r,1)):(r=Exe(e),r.c(),sg(r,1),r.m(t.parentNode,t)):r&&(ng(),ig(r,1,1,(()=>{r=null})),rg())},i(e){n||(sg(r),n=!0)},o(e){ig(r),n=!1},d(e){r&&r.d(e),e&&fb(t)}}}function Pxe(e){return Math.sin(-13*(e+1)*Math.PI/2)*Math.pow(2,-35*e)+1}function _xe(e,t,n){let r;const{device:s}=hm,i=Lm.select("accountCenter").pipe(De(Lm.get().accountCenter),Ue(1));Zm(e,i,(e=>n(6,r=e)));let a,o,{position:c}=t,{sharedContainer:l}=t,{notifications:u}=t;a=0,o=0;let d="y-scroll";const h=function(){let e=null;return(t,n)=>{clearTimeout(e),e=setTimeout(t,n)}}();return e.$$set=e=>{"position"in e&&n(0,c=e.position),"sharedContainer"in e&&n(1,l=e.sharedContainer),"notifications"in e&&n(2,u=e.notifications)},e.$$.update=()=>{1&e.$$.dirty&&(c.includes("top")?n(4,o=-50):n(4,o=50))},[c,l,u,0,o,d,r,s,i,()=>{"y-visible"!==d&&n(5,d="y-visible"),h((function(){n(5,d="y-scroll")}),1e3)},function(t){Lb.call(this,e,t)}]}var Sxe=Object.freeze({__proto__:null,default:class extends kg{constructor(e){super(),xg(this,e,_xe,Cxe,$m,{position:0,sharedContainer:1,notifications:2},xxe)}}}),Ixe=Object.freeze({__proto__:null,default:'\n\n\n\n\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\n\n\t\n\t\n\n\n\n\n\t\n\t\n\t\n\t\n\n\n\t\n\t\n\t\n\t\n\n\n\n\n\n\n\t\n\t\n\n\n\n\n\n'}),Bxe=Object.freeze({__proto__:null,default:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n'}),Txe=Object.freeze({__proto__:null,default:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIyIiBoZWlnaHQ9IjEyNCIgdmlld0JveD0iMCAwIDEyMiAxMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxtYXNrIGlkPSJtYXNrMF8zMF8xMTAiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMjIiIGhlaWdodD0iMTI0Ij4KPHBhdGggZD0iTTEyMS43ODcgMzQuODMzMUw2OS4zODc2IDAuNDc2NTYyVjE5LjY4NTVMMTAzLjAwMiA0MS41Mjg4TDk5LjA0NzQgNTQuMDQySDY5LjM4NzZWNjkuOTU4SDk5LjA0NzRMMTAzLjAwMiA4Mi40NzEyTDY5LjM4NzYgMTA0LjMxNFYxMjMuNTIzTDEyMS43ODcgODkuMjc2N0wxMTMuMjE4IDYyLjA1NDlMMTIxLjc4NyAzNC44MzMxWiIgZmlsbD0iIzFEMUQxQiIvPgo8cGF0aCBkPSJNMjMuNzk5MyA2OS45NThINTMuMzQ5M1Y1NC4wNDJIMjMuNjg5NEwxOS44NDQ2IDQxLjUyODhMNTMuMzQ5MyAxOS42ODU1VjAuNDc2NTYyTDAuOTUwMTk1IDM0LjgzMzFMOS41MTg2IDYyLjA1NDlMMC45NTAxOTUgODkuMjc2N0w1My40NTkxIDEyMy41MjNWMTA0LjMxNEwxOS44NDQ2IDgyLjQ3MTJMMjMuNzk5MyA2OS45NThaIiBmaWxsPSIjMUQxRDFCIi8+CjwvbWFzaz4KPGcgbWFzaz0idXJsKCNtYXNrMF8zMF8xMTApIj4KPHBhdGggZD0iTTEyMS43ODcgMzQuODMzMUw2OS4zODc2IDAuNDc2NTYyVjE5LjY4NTVMMTAzLjAwMiA0MS41Mjg4TDk5LjA0NzQgNTQuMDQySDY5LjM4NzZWNjkuOTU4SDk5LjA0NzRMMTAzLjAwMiA4Mi40NzEyTDY5LjM4NzYgMTA0LjMxNFYxMjMuNTIzTDEyMS43ODcgODkuMjc2N0wxMTMuMjE4IDYyLjA1NDlMMTIxLjc4NyAzNC44MzMxWiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTIzLjc5OTMgNjkuOTU4SDUzLjM0OTNWNTQuMDQySDIzLjY4OTRMMTkuODQ0NiA0MS41Mjg4TDUzLjM0OTMgMTkuNjg1NVYwLjQ3NjU2MkwwLjk1MDE5NSAzNC44MzMxTDkuNTE4NiA2Mi4wNTQ5TDAuOTUwMTk1IDg5LjI3NjdMNTMuNDU5MSAxMjMuNTIzVjEwNC4zMTRMMTkuODQ0NiA4Mi40NzEyTDIzLjc5OTMgNjkuOTU4WiIgZmlsbD0id2hpdGUiLz4KPHJlY3QgeD0iMS4xMDYzMiIgeT0iMC40NzY1NjIiIHdpZHRoPSIxMzMuNzQ0IiBoZWlnaHQ9IjEzNi4wODUiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8zMF8xMTApIi8+CjxlbGxpcHNlIGN4PSI4LjQzMTc2IiBjeT0iMjcuNDYwMiIgcng9IjExNy42MzkiIHJ5PSIxMjcuNTQ1IiB0cmFuc2Zvcm09InJvdGF0ZSgtMzMuOTMwMyA4LjQzMTc2IDI3LjQ2MDIpIiBmaWxsPSJ1cmwoI3BhaW50MV9yYWRpYWxfMzBfMTEwKSIvPgo8L2c+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfMzBfMTEwIiB4MT0iMTA1LjA4NCIgeTE9IjEzMi41OTQiIHgyPSI2OS44NDM5IiB5Mj0iLTEyLjI3NjUiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iIzBCNDZGOSIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNCQkZCRTAiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDFfcmFkaWFsXzMwXzExMCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg4LjQzMTc1IDI3LjQ2MDIpIHJvdGF0ZSg3Mi4yNTU3KSBzY2FsZSg5Ni40OTc5IDkwLjQ1NDMpIj4KPHN0b3Agb2Zmc2V0PSIwLjExOTc5MiIgc3RvcC1jb2xvcj0iIzg5NTJGRiIgc3RvcC1vcGFjaXR5PSIwLjg3Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0RBQkRGRiIgc3RvcC1vcGFjaXR5PSIwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjwvZGVmcz4KPC9zdmc+Cg=="}),Mxe=Object.freeze({__proto__:null,default:'\n\n\n\n'}),Oxe=Object.freeze({__proto__:null,default:'\n\n brave-browser\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n'}),Nxe=Object.freeze({__proto__:null,default:'\n\n \n \n \n \n \n \n \n\n'}),Rxe=Object.freeze({__proto__:null,default:'\n\t\n\t\t\n\t\t\n\t\n'}),Fxe=Object.freeze({__proto__:null,default:'\n\n'}),jxe=Object.freeze({__proto__:null,default:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n'}),Lxe=Object.freeze({__proto__:null,default:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t\n\t\t\n\t\t\n\t\n'}),Uxe=Object.freeze({__proto__:null,default:''}),Dxe=Object.freeze({__proto__:null,default:'\nIcons/Illustrations/Logo_40x40_white_background\n\n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n'}),zxe=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'}),Hxe=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'}),Gxe=Object.freeze({__proto__:null,default:'\n\n'}),qxe=Object.freeze({__proto__:null,default:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n'}),$xe=Object.freeze({__proto__:null,default:'\n\t\n\t\t\n\t\n'}),Vxe=Object.freeze({__proto__:null,default:'\n\n \n'}),Wxe=Object.freeze({__proto__:null,default:'\n\n \n \n \n \n \n \n \n\n'}),Zxe=Object.freeze({__proto__:null,default:'\n\n\n'}),Qxe=Object.freeze({__proto__:null,default:'\n\n\n \n \n \n \n\n\n \n \n\n\n'}),Kxe=Object.freeze({__proto__:null,default:'\n\n\n \n \n \n \n \n \n \n \n\n'}),Yxe=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n\n\n\n'}),Jxe=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n\n\n\n'}),Xxe=Object.freeze({__proto__:null,default:'\n\nShape Copy\nCreated with Sketch.\n\n \n \n \n \n\n\n \n\n\n'}),eke=Object.freeze({__proto__:null,default:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n'}),tke=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n\n\n\n'}),nke=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n\n \n \n \n \n\n'}),rke=Object.freeze({__proto__:null,default:'\n\n\x3c!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n\n'}),ske=Object.freeze({__proto__:null,default:'\n \n \n \n \n \n \n \n '}),ike=Object.freeze({__proto__:null,default:'\n\n \n \n \n\n'}),ake=Object.freeze({__proto__:null,default:'\n\n\n\n\n'}),oke=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'}),cke=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'}),lke=Object.freeze({__proto__:null,default:''}),uke=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'}),dke=Object.freeze({__proto__:null,default:'\n\n\n'}),hke=Object.freeze({__proto__:null,default:''}),pke=Object.freeze({__proto__:null,default:'\n\n\n\n'}),fke=Object.freeze({__proto__:null,default:'\n\n\x3c!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n\n\n\n\n\n'}),mke=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'}),bke=Object.freeze({__proto__:null,default:' \n'}),gke=Object.freeze({__proto__:null,default:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n'}),yke=Object.freeze({__proto__:null,default:'\n\n\n\n'}),vke=Object.freeze({__proto__:null,default:'\n\n\n'}),wke=Object.freeze({__proto__:null,default:'\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n'}),xke=Object.freeze({__proto__:null,default:'\n\n \n \n \n \n \n \n \n \n \n\n'}),kke=Object.freeze({__proto__:null,default:'\n\n\n\n\n'}),Eke=Object.freeze({__proto__:null,default:'\n\n\n\n\n'}),Ake=Object.freeze({__proto__:null,default:'\n \n'}),Cke=Object.freeze({__proto__:null,default:'Coin98'}),Pke=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'}),_ke=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'}),Ske=Object.freeze({__proto__:null,default:''}),Ike=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'}),Bke=Object.freeze({__proto__:null,default:'\n\n'}),Tke=Object.freeze({__proto__:null,default:'\n\n\n\n\n\n \n \n \n \n \n \n \n \n\n\n'}),Mke=Object.freeze({__proto__:null,default:'\n\n \n \n \n \n \n \n \n\n'}),Oke=Object.freeze({__proto__:null,default:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n'}),Nke=Object.freeze({__proto__:null,default:'\n \n \n \n \n'}),Rke={},Fke={},jke={};Object.defineProperty(jke,"__esModule",{value:!0}),jke.walletLogo=void 0;jke.walletLogo=(e,t)=>{let n;switch(e){case"standard":default:return n=t,`data:image/svg+xml,%3Csvg width='${t}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return n=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${n}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return n=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return n=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return n=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return n=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`}};var Lke={},Uke={},Dke={};Object.defineProperty(Dke,"__esModule",{value:!0}),Dke.errorValues=Dke.standardErrorCodes=void 0,Dke.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},Dke.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var zke={},Hke={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Dke,n="Unspecified error message.";function r(r,s=n){if(r&&Number.isInteger(r)){const n=r.toString();if(o(t.errorValues,n))return t.errorValues[n].message;if(i(r))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return s}function s(e){if(!Number.isInteger(e))return!1;const n=e.toString();return!!t.errorValues[n]||!!i(e)}function i(e){return e>=-32099&&e<=-32e3}function a(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){return"object"==typeof e&&null!==e&&t in e&&"string"==typeof e[t]}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=r,e.isValidCode=s,e.getErrorCode=function(e){var t;return"number"==typeof e?e:function(e){return"object"==typeof e&&null!==e&&("number"==typeof e.code||"number"==typeof e.errorCode)}(e)?null!==(t=e.code)&&void 0!==t?t:e.errorCode:void 0},e.serialize=function(e,{shouldIncludeStack:i=!1}={}){const l={};if(e&&"object"==typeof e&&!Array.isArray(e)&&o(e,"code")&&s(e.code)){const t=e;l.code=t.code,t.message&&"string"==typeof t.message?(l.message=t.message,o(t,"data")&&(l.data=t.data)):(l.message=r(l.code),l.data={originalError:a(e)})}else l.code=t.standardErrorCodes.rpc.internal,l.message=c(e,"message")?e.message:n,l.data={originalError:a(e)};return i&&(l.stack=c(e,"stack")?e.stack:void 0),l}}(Hke),Object.defineProperty(zke,"__esModule",{value:!0}),zke.standardErrors=void 0;const Gke=Dke,qke=Hke;function $ke(e,t){const[n,r]=Wke(t);return new Zke(e,n||(0,qke.getMessageFromCode)(e),r)}function Vke(e,t){const[n,r]=Wke(t);return new Qke(e,n||(0,qke.getMessageFromCode)(e),r)}function Wke(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,n]}}return[]}zke.standardErrors={rpc:{parse:e=>$ke(Gke.standardErrorCodes.rpc.parse,e),invalidRequest:e=>$ke(Gke.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>$ke(Gke.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>$ke(Gke.standardErrorCodes.rpc.methodNotFound,e),internal:e=>$ke(Gke.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return $ke(t,e)},invalidInput:e=>$ke(Gke.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>$ke(Gke.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>$ke(Gke.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>$ke(Gke.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>$ke(Gke.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>$ke(Gke.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Vke(Gke.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Vke(Gke.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Vke(Gke.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Vke(Gke.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Vke(Gke.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Vke(Gke.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:n,data:r}=e;if(!n||"string"!=typeof n)throw new Error('"message" must be a nonempty string');return new Qke(t,n,r)}}};class Zke extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==n&&(this.data=n)}}class Qke extends Zke{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=void 0;var t=Dke;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});var n=zke;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return n.standardErrors}})}(Uke);var Kke={},Yke={};Object.defineProperty(Yke,"__esModule",{value:!0}),Yke.isErrorResponse=void 0,Yke.isErrorResponse=function(e){return void 0!==e.errorMessage};var Jke={};Object.defineProperty(Jke,"__esModule",{value:!0}),Jke.LIB_VERSION=void 0,Jke.LIB_VERSION="4.0.3",Object.defineProperty(Kke,"__esModule",{value:!0}),Kke.serializeError=void 0;const Xke=Yke,eEe=Jke,tEe=Dke,nEe=Hke;Kke.serializeError=function(e,t){const n=(0,nEe.serialize)(function(e){if("string"==typeof e)return{message:e,code:tEe.standardErrorCodes.rpc.internal};if((0,Xke.isErrorResponse)(e))return Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}});return e}(e),{shouldIncludeStack:!0}),r=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");r.searchParams.set("version",eEe.LIB_VERSION),r.searchParams.set("code",n.code.toString());const s=function(e,t){const n=null==e?void 0:e.method;if(n)return n;if(void 0===t)return;if("string"==typeof t)return t;if(!Array.isArray(t))return t.method;if(t.length>0)return t[0].method;return}(n.data,t);return s&&r.searchParams.set("method",s),r.searchParams.set("message",n.message),Object.assign(Object.assign({},n),{docUrl:r.href})};var rEe={};function sEe(){return e=>e}Object.defineProperty(rEe,"__esModule",{value:!0}),rEe.RegExpString=rEe.IntNumber=rEe.BigIntString=rEe.AddressString=rEe.HexString=rEe.OpaqueType=void 0,rEe.OpaqueType=sEe,rEe.HexString=e=>e,rEe.AddressString=e=>e,rEe.BigIntString=e=>e,rEe.IntNumber=function(e){return Math.floor(e)},rEe.RegExpString=e=>e;var iEe={};Object.defineProperty(iEe,"__esModule",{value:!0}),iEe.areAddressArraysEqual=iEe.getFavicon=iEe.range=iEe.isBigNumber=iEe.ensureParsedJSONObject=iEe.ensureBigInt=iEe.ensureRegExpString=iEe.ensureIntNumber=iEe.ensureBuffer=iEe.ensureAddressString=iEe.ensureEvenLengthHexString=iEe.ensureHexString=iEe.isHexString=iEe.prepend0x=iEe.strip0x=iEe.has0xPrefix=iEe.hexStringFromIntNumber=iEe.intNumberFromHexString=iEe.bigIntStringFromBigInt=iEe.hexStringFromBuffer=iEe.hexStringToUint8Array=iEe.uint8ArrayToHex=iEe.randomBytesHex=void 0;const aEe=Uke,oEe=rEe,cEe=/^[0-9]*$/,lEe=/^[a-f0-9]*$/;function uEe(e){return[...e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function dEe(e){return e.startsWith("0x")||e.startsWith("0X")}function hEe(e){return dEe(e)?e.slice(2):e}function pEe(e){return dEe(e)?`0x${e.slice(2)}`:`0x${e}`}function fEe(e){if("string"!=typeof e)return!1;const t=hEe(e).toLowerCase();return lEe.test(t)}function mEe(e,t=!1){if("string"==typeof e){const n=hEe(e).toLowerCase();if(lEe.test(n))return(0,oEe.HexString)(t?`0x${n}`:n)}throw aEe.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}function bEe(e,t=!1){let n=mEe(e,!1);return n.length%2==1&&(n=(0,oEe.HexString)(`0${n}`)),t?(0,oEe.HexString)(`0x${n}`):n}function gEe(e){if("number"==typeof e&&Number.isInteger(e))return(0,oEe.IntNumber)(e);if("string"==typeof e){if(cEe.test(e))return(0,oEe.IntNumber)(Number(e));if(fEe(e))return(0,oEe.IntNumber)(Number(BigInt(bEe(e,!0))))}throw aEe.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}function yEe(e){if(null==e||"function"!=typeof e.constructor)return!1;const{constructor:t}=e;return"function"==typeof t.config&&"number"==typeof t.EUCLID}iEe.randomBytesHex=function(e){return uEe(crypto.getRandomValues(new Uint8Array(e)))},iEe.uint8ArrayToHex=uEe,iEe.hexStringToUint8Array=function(e){return new Uint8Array(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))},iEe.hexStringFromBuffer=function(e,t=!1){const n=e.toString("hex");return(0,oEe.HexString)(t?`0x${n}`:n)},iEe.bigIntStringFromBigInt=function(e){return(0,oEe.BigIntString)(e.toString(10))},iEe.intNumberFromHexString=function(e){return(0,oEe.IntNumber)(Number(BigInt(bEe(e,!0))))},iEe.hexStringFromIntNumber=function(e){return(0,oEe.HexString)(`0x${BigInt(e).toString(16)}`)},iEe.has0xPrefix=dEe,iEe.strip0x=hEe,iEe.prepend0x=pEe,iEe.isHexString=fEe,iEe.ensureHexString=mEe,iEe.ensureEvenLengthHexString=bEe,iEe.ensureAddressString=function(e){if("string"==typeof e){const t=hEe(e).toLowerCase();if(fEe(t)&&40===t.length)return(0,oEe.AddressString)(pEe(t))}throw aEe.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)},iEe.ensureBuffer=function(e){if(lX.isBuffer(e))return e;if("string"==typeof e){if(fEe(e)){const t=bEe(e,!1);return lX.from(t,"hex")}return lX.from(e,"utf8")}throw aEe.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)},iEe.ensureIntNumber=gEe,iEe.ensureRegExpString=function(e){if(e instanceof RegExp)return(0,oEe.RegExpString)(e.toString());throw aEe.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)},iEe.ensureBigInt=function(e){if(null!==e&&("bigint"==typeof e||yEe(e)))return BigInt(e.toString(10));if("number"==typeof e)return BigInt(gEe(e));if("string"==typeof e){if(cEe.test(e))return BigInt(e);if(fEe(e))return BigInt(bEe(e,!0))}throw aEe.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)},iEe.ensureParsedJSONObject=function(e){if("string"==typeof e)return JSON.parse(e);if("object"==typeof e)return e;throw aEe.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)},iEe.isBigNumber=yEe,iEe.range=function(e,t){return Array.from({length:t-e},((t,n)=>e+n))},iEe.getFavicon=function(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:n}=document.location,r=e?e.getAttribute("href"):null;return!r||r.startsWith("javascript:")||r.startsWith("vbscript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?t+r:`${t}//${n}${r}`},iEe.areAddressArraysEqual=function(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))};var vEe={},wEe={},xEe={},kEe={};Object.defineProperty(kEe,"__esModule",{value:!0}),kEe.decryptContent=kEe.encryptContent=kEe.importKeyFromHexString=kEe.exportKeyToHexString=kEe.decrypt=kEe.encrypt=kEe.deriveSharedSecret=kEe.generateKeyPair=void 0;const EEe=iEe;async function AEe(e,t){const n=crypto.getRandomValues(new Uint8Array(12));return{iv:n,cipherText:await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,(new TextEncoder).encode(t))}}async function CEe(e,{iv:t,cipherText:n}){const r=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},e,n);return(new TextDecoder).decode(r)}function PEe(e){switch(e){case"public":return"spki";case"private":return"pkcs8"}}kEe.generateKeyPair=async function(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])},kEe.deriveSharedSecret=async function(e,t){return crypto.subtle.deriveKey({name:"ECDH",public:t},e,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])},kEe.encrypt=AEe,kEe.decrypt=CEe,kEe.exportKeyToHexString=async function(e,t){const n=PEe(e),r=await crypto.subtle.exportKey(n,t);return(0,EEe.uint8ArrayToHex)(new Uint8Array(r))},kEe.importKeyFromHexString=async function(e,t){const n=PEe(e),r=(0,EEe.hexStringToUint8Array)(t).buffer;return await crypto.subtle.importKey(n,r,{name:"ECDH",namedCurve:"P-256"},!0,"private"===e?["deriveKey"]:[])},kEe.encryptContent=async function(e,t){const n=JSON.stringify(e,((e,t)=>{if(!(t instanceof Error))return t;const n=t;return Object.assign(Object.assign({},n.code?{code:n.code}:{}),{message:n.message})}));return AEe(t,n)},kEe.decryptContent=async function(e,t){return JSON.parse(await CEe(t,e))};var _Ee={};Object.defineProperty(_Ee,"__esModule",{value:!0}),_Ee.ScopedLocalStorage=void 0;class SEe{constructor(e,t){this.scope=e,this.module=t}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),t=[];for(let n=0;nlocalStorage.removeItem(e)))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new SEe("CBWSDK").clear(),new SEe("walletlink").clear()}}_Ee.ScopedLocalStorage=SEe,Object.defineProperty(xEe,"__esModule",{value:!0}),xEe.SCWKeyManager=void 0;const IEe=kEe,BEe=_Ee,TEe={storageKey:"ownPrivateKey",keyType:"private"},MEe={storageKey:"ownPublicKey",keyType:"public"},OEe={storageKey:"peerPublicKey",keyType:"public"};xEe.SCWKeyManager=class{constructor(){this.storage=new BEe.ScopedLocalStorage("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(OEe,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(MEe.storageKey),this.storage.removeItem(TEe.storageKey),this.storage.removeItem(OEe.storageKey)}async generateKeyPair(){const e=await(0,IEe.generateKeyPair)();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(TEe,e.privateKey),await this.storeKey(MEe,e.publicKey)}async loadKeysIfNeeded(){if(null===this.ownPrivateKey&&(this.ownPrivateKey=await this.loadKey(TEe)),null===this.ownPublicKey&&(this.ownPublicKey=await this.loadKey(MEe)),null!==this.ownPrivateKey&&null!==this.ownPublicKey||await this.generateKeyPair(),null===this.peerPublicKey&&(this.peerPublicKey=await this.loadKey(OEe)),null===this.sharedSecret){if(null===this.ownPrivateKey||null===this.peerPublicKey)return;this.sharedSecret=await(0,IEe.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const t=this.storage.getItem(e.storageKey);return t?(0,IEe.importKeyFromHexString)(e.keyType,t):null}async storeKey(e,t){const n=await(0,IEe.exportKeyToHexString)(e.keyType,t);this.storage.setItem(e.storageKey,n)}};var NEe={};Object.defineProperty(NEe,"__esModule",{value:!0}),NEe.SCWStateManager=void 0;const REe=_Ee,FEe="accounts",jEe="activeChain",LEe="availableChains",UEe="walletCapabilities";NEe.SCWStateManager=class{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(e){var t,n;this.storage=new REe.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=e.updateListener,this.availableChains=this.loadItemFromStorage(LEe),this._walletCapabilities=this.loadItemFromStorage(UEe);const r=this.loadItemFromStorage(FEe),s=this.loadItemFromStorage(jEe);r&&this.updateListener.onAccountsUpdate({accounts:r,source:"storage"}),s&&this.updateListener.onChainUpdate({chain:s,source:"storage"}),this._accounts=r||[],this._activeChain=s||{id:null!==(n=null===(t=e.appChainIds)||void 0===t?void 0:t[0])&&void 0!==n?n:1}}updateAccounts(e){this._accounts=e,this.storeItemToStorage(FEe,e),this.updateListener.onAccountsUpdate({accounts:e,source:"wallet"})}switchChain(e){var t;const n=null===(t=this.availableChains)||void 0===t?void 0:t.find((t=>t.id===e));return!!n&&(n===this._activeChain||(this._activeChain=n,this.storeItemToStorage(jEe,n),this.updateListener.onChainUpdate({chain:n,source:"wallet"})),!0)}updateAvailableChains(e){if(!e||0===Object.keys(e).length)return;const t=Object.entries(e).map((([e,t])=>({id:Number(e),rpcUrl:t})));this.availableChains=t,this.storeItemToStorage(LEe,t),this.switchChain(this._activeChain.id)}updateWalletCapabilities(e){this._walletCapabilities=e,this.storeItemToStorage(UEe,e)}storeItemToStorage(e,t){this.storage.setItem(e,JSON.stringify(t))}loadItemFromStorage(e){const t=this.storage.getItem(e);return t?JSON.parse(t):void 0}clear(){this.storage.clear()}},Object.defineProperty(wEe,"__esModule",{value:!0}),wEe.SCWSigner=void 0;const DEe=xEe,zEe=NEe,HEe=Uke,GEe=iEe,qEe=kEe;wEe.SCWSigner=class{constructor(e){this.metadata=e.metadata,this.communicator=e.communicator,this.keyManager=new DEe.SCWKeyManager,this.stateManager=new zEe.SCWStateManager({appChainIds:this.metadata.appChainIds,updateListener:e.updateListener}),this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(){const e=await this.createRequestMessage({handshake:{method:"eth_requestAccounts",params:this.metadata}}),t=await this.communicator.postRequestAndWaitForResponse(e);if("failure"in t.content)throw t.content.failure;const n=await(0,qEe.importKeyFromHexString)("public",t.sender);await this.keyManager.setPeerPublicKey(n);const r=await this.decryptResponseMessage(t);this.updateInternalState({method:"eth_requestAccounts"},r);const s=r.result;if("error"in s)throw s.error;return this.stateManager.accounts}async request(e){const t=this.tryLocalHandling(e);if(void 0!==t){if(t instanceof Error)throw t;return t}await this.communicator.waitForPopupLoaded();const n=await this.sendEncryptedRequest(e),r=await this.decryptResponseMessage(n);this.updateInternalState(e,r);const s=r.result;if("error"in s)throw s.error;return s.value}async disconnect(){this.stateManager.clear(),await this.keyManager.clear()}tryLocalHandling(e){var t;switch(e.method){case"wallet_switchEthereumChain":{const n=e.params;if(!n||!(null===(t=n[0])||void 0===t?void 0:t.chainId))throw HEe.standardErrors.rpc.invalidParams();const r=(0,GEe.ensureIntNumber)(n[0].chainId);return this.stateManager.switchChain(r)?null:void 0}case"wallet_getCapabilities":{const e=this.stateManager.walletCapabilities;if(!e)throw HEe.standardErrors.provider.unauthorized("No wallet capabilities found, please disconnect and reconnect");return e}default:return}}async sendEncryptedRequest(e){const t=await this.keyManager.getSharedSecret();if(!t)throw HEe.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");const n=await(0,qEe.encryptContent)({action:e,chainId:this.stateManager.activeChain.id},t),r=await this.createRequestMessage({encrypted:n});return this.communicator.postRequestAndWaitForResponse(r)}async createRequestMessage(e){const t=await(0,qEe.exportKeyToHexString)("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:t,content:e,timestamp:new Date}}async decryptResponseMessage(e){const t=e.content;if("failure"in t)throw t.failure;const n=await this.keyManager.getSharedSecret();if(!n)throw HEe.standardErrors.provider.unauthorized("Invalid session");return(0,qEe.decryptContent)(t.encrypted,n)}updateInternalState(e,t){var n,r;const s=null===(n=t.data)||void 0===n?void 0:n.chains;s&&this.stateManager.updateAvailableChains(s);const i=null===(r=t.data)||void 0===r?void 0:r.capabilities;i&&this.stateManager.updateWalletCapabilities(i);const a=t.result;if(!("error"in a))switch(e.method){case"eth_requestAccounts":{const e=a.value;this.stateManager.updateAccounts(e);break}case"wallet_switchEthereumChain":{if(null!==a.value)return;const t=e.params,n=(0,GEe.ensureIntNumber)(t[0].chainId);this.stateManager.switchChain(n);break}}}};var $Ee={},VEe={exports:{}};function WEe(){}function ZEe(){ZEe.init.call(this)}function QEe(e){return void 0===e._maxListeners?ZEe.defaultMaxListeners:e._maxListeners}function KEe(e,t,n,r){var s,i,a;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((i=e._events)?(i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]):(i=e._events=new WEe,e._eventsCount=0),a){if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),!a.warned&&(s=QEe(e))&&s>0&&a.length>s){a.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=t,o.count=a.length,function(e){"function"==typeof console.warn?console.warn(e):console.log(e)}(o)}}else a=i[t]=n,++e._eventsCount;return e}function YEe(e,t,n){var r=!1;function s(){e.removeListener(t,s),r||(r=!0,n.apply(e,arguments))}return s.listener=n,s}function JEe(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function XEe(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}WEe.prototype=Object.create(null),ZEe.EventEmitter=ZEe,ZEe.usingDomains=!1,ZEe.prototype.domain=void 0,ZEe.prototype._events=void 0,ZEe.prototype._maxListeners=void 0,ZEe.defaultMaxListeners=10,ZEe.init=function(){this.domain=null,ZEe.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new WEe,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ZEe.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ZEe.prototype.getMaxListeners=function(){return QEe(this)},ZEe.prototype.emit=function(e){var t,n,r,s,i,a,o,c="error"===e;if(a=this._events)c=c&&null==a.error;else if(!c)return!1;if(o=this.domain,c){if(t=arguments[1],!o){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=o,t.domainThrown=!1,o.emit("error",t),!1}if(!(n=a[e]))return!1;var u="function"==typeof n;switch(r=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var r=e.length,s=XEe(e,r),i=0;i0;)if(n[i]===t||n[i].listener&&n[i].listener===t){a=n[i].listener,s=i;break}if(s<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new WEe,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,s=e.length;r0?Reflect.ownKeys(this._events):[]};var eAe,tAe,nAe=Ve(Object.freeze({__proto__:null,EventEmitter:ZEe,default:ZEe}));function rAe(){return tAe?eAe:(tAe=1,eAe=nAe.EventEmitter)}var sAe="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},iAe=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r=s)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),a=r[n];n=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),vAe(t)?n.showHidden=t:t&&jAe(n,t),CAe(n.showHidden)&&(n.showHidden=!1),CAe(n.depth)&&(n.depth=2),CAe(n.colors)&&(n.colors=!1),CAe(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=pAe),mAe(n,e,n.depth)}function pAe(e,t){var n=hAe.styles[t];return n?"["+hAe.colors[n][0]+"m"+e+"["+hAe.colors[n][1]+"m":e}function fAe(e,t){return e}function mAe(e,t,n){if(e.customInspect&&t&&BAe(t.inspect)&&t.inspect!==hAe&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return EAe(r)||(r=mAe(e,r,n)),r}var s=function(e,t){if(CAe(t))return e.stylize("undefined","undefined");if(EAe(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(kAe(t))return e.stylize(""+t,"number");if(vAe(t))return e.stylize(""+t,"boolean");if(wAe(t))return e.stylize("null","null")}(e,t);if(s)return s;var i=Object.keys(t),a=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(t)),IAe(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return bAe(t);if(0===i.length){if(BAe(t)){var o=t.name?": "+t.name:"";return e.stylize("[Function"+o+"]","special")}if(PAe(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(SAe(t))return e.stylize(Date.prototype.toString.call(t),"date");if(IAe(t))return bAe(t)}var c,l="",u=!1,d=["{","}"];(yAe(t)&&(u=!0,d=["[","]"]),BAe(t))&&(l=" [Function"+(t.name?": "+t.name:"")+"]");return PAe(t)&&(l=" "+RegExp.prototype.toString.call(t)),SAe(t)&&(l=" "+Date.prototype.toUTCString.call(t)),IAe(t)&&(l=" "+bAe(t)),0!==i.length||u&&0!=t.length?n<0?PAe(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),c=u?function(e,t,n,r,s){for(var i=[],a=0,o=t.length;a60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(c,l,d)):d[0]+l+d[1]}function bAe(e){return"["+Error.prototype.toString.call(e)+"]"}function gAe(e,t,n,r,s,i){var a,o,c;if((c=Object.getOwnPropertyDescriptor(t,s)||{value:t[s]}).get?o=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(o=e.stylize("[Setter]","special")),LAe(r,s)||(a="["+s+"]"),o||(e.seen.indexOf(c.value)<0?(o=wAe(n)?mAe(e,c.value,null):mAe(e,c.value,n-1)).indexOf("\n")>-1&&(o=i?o.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+o.split("\n").map((function(e){return" "+e})).join("\n")):o=e.stylize("[Circular]","special")),CAe(a)){if(i&&s.match(/^\d+$/))return o;(a=JSON.stringify(""+s)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+o}function yAe(e){return Array.isArray(e)}function vAe(e){return"boolean"==typeof e}function wAe(e){return null===e}function xAe(e){return null==e}function kAe(e){return"number"==typeof e}function EAe(e){return"string"==typeof e}function AAe(e){return"symbol"==typeof e}function CAe(e){return void 0===e}function PAe(e){return _Ae(e)&&"[object RegExp]"===OAe(e)}function _Ae(e){return"object"==typeof e&&null!==e}function SAe(e){return _Ae(e)&&"[object Date]"===OAe(e)}function IAe(e){return _Ae(e)&&("[object Error]"===OAe(e)||e instanceof Error)}function BAe(e){return"function"==typeof e}function TAe(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function MAe(e){return lX.isBuffer(e)}function OAe(e){return Object.prototype.toString.call(e)}function NAe(e){return e<10?"0"+e.toString(10):e.toString(10)}hAe.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},hAe.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var RAe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function FAe(){console.log("%s - %s",function(){var e=new Date,t=[NAe(e.getHours()),NAe(e.getMinutes()),NAe(e.getSeconds())].join(":");return[e.getDate(),RAe[e.getMonth()],t].join(" ")}(),oAe.apply(null,arguments))}function jAe(e,t){if(!t||!_Ae(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function LAe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var UAe="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function DAe(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(UAe&&e[UAe]){var t;if("function"!=typeof(t=e[UAe]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,UAe,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),s=[],i=0;i0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var t,n,r,s=i.allocUnsafe(e>>>0),a=this.head,o=0;a;)t=a.data,n=s,r=o,i.prototype.copy.call(t,n,r),o+=a.data.length,a=a.next;return s}},{key:"consume",value:function(e,t){var n;return es.length?s.length:e;if(i===s.length?r+=s:r+=s.slice(0,e),0===(e-=i)){i===s.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=s.slice(i));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=i.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var s=n.data,a=e>s.length?s.length:e;if(s.copy(t,t.length-e,0,a),0===(e-=a)){a===s.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++r}return this.length-=r,t}},{key:o,value:function(e,n){return a(this,t(t({},n),{},{depth:0,customInspect:!1}))}}]),e}(),GAe}function KAe(){if(VAe)return $Ae;function e(e,r){n(e,r),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n(e,t){e.emit("error",t)}return VAe=1,$Ae={destroy:function(r,s){var i=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(s?s(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,rJ.nextTick(n,this,r)):rJ.nextTick(n,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,(function(n){!s&&n?i._writableState?i._writableState.errorEmitted?rJ.nextTick(t,i):(i._writableState.errorEmitted=!0,rJ.nextTick(e,i,n)):rJ.nextTick(e,i,n):s?(rJ.nextTick(t,i),s(n)):rJ.nextTick(t,i)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}}var YAe={};var JAe,XAe,eCe,tCe,nCe,rCe,sCe,iCe,aCe={};function oCe(e,t,n){n||(n=Error);var r=function(e){var n,r;function s(n,r,s){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,s))||this}return r=e,(n=s).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,s}(n);r.prototype.name=n.name,r.prototype.code=e,aCe[e]=r}function cCe(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}function lCe(){if(XAe)return JAe;XAe=1;var e=YAe.codes.ERR_INVALID_OPT_VALUE;return JAe={getHighWaterMark:function(t,n,r,s){var i=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(n,s,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new e(s?r:"highWaterMark",i);return Math.floor(i)}return t.objectMode?16:16384}},JAe}function uCe(){if(tCe)return eCe;function e(e){try{if(!qe.localStorage)return!1}catch(e){return!1}var t=qe.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}return tCe=1,eCe=function(t,n){if(e("noDeprecation"))return t;var r=!1;return function(){if(!r){if(e("throwDeprecation"))throw new Error(n);e("traceDeprecation")?console.trace(n):console.warn(n),r=!0}return t.apply(this,arguments)}},eCe}function dCe(){if(rCe)return nCe;function e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var s=r.callback;t.pendingcb--,s(n),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}var t;rCe=1,nCe=x,x.WritableState=w;var n={deprecate:uCe()},r=rAe(),s=O2.Buffer,i=(void 0!==qe?qe:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a,o=KAe(),c=lCe().getHighWaterMark,l=YAe.codes,u=l.ERR_INVALID_ARG_TYPE,d=l.ERR_METHOD_NOT_IMPLEMENTED,h=l.ERR_MULTIPLE_CALLBACK,p=l.ERR_STREAM_CANNOT_PIPE,f=l.ERR_STREAM_DESTROYED,m=l.ERR_STREAM_NULL_VALUES,b=l.ERR_STREAM_WRITE_AFTER_END,g=l.ERR_UNKNOWN_ENCODING,y=o.errorOrDestroy;function v(){}function w(n,r,s){t=t||hCe(),n=n||{},"boolean"!=typeof s&&(s=r instanceof t),this.objectMode=!!n.objectMode,s&&(this.objectMode=this.objectMode||!!n.writableObjectMode),this.highWaterMark=c(this,n,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===n.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,s=n.writecb;if("function"!=typeof s)throw new h;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,s){--t.pendingcb,n?(rJ.nextTick(s,r),rJ.nextTick(_,e,t),e._writableState.errorEmitted=!0,y(e,r)):(s(r),e._writableState.errorEmitted=!0,y(e,r),_(e,t))}(e,n,r,t,s);else{var i=C(n)||e.destroyed;i||n.corked||n.bufferProcessing||!n.bufferedRequest||A(e,n),r?rJ.nextTick(E,e,n,i,s):E(e,n,i,s)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==n.emitClose,this.autoDestroy=!!n.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function x(e){var n=this instanceof(t=t||hCe());if(!n&&!a.call(x,this))return new x(e);this._writableState=new w(e,this,n),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),r.call(this)}function k(e,t,n,r,s,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new f("write")):n?e._writev(s,t.onwrite):e._write(s,i,t.onwrite),t.sync=!1}function E(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),_(e,t)}function A(t,n){n.bufferProcessing=!0;var r=n.bufferedRequest;if(t._writev&&r&&r.next){var s=n.bufferedRequestCount,i=new Array(s),a=n.corkedRequestsFree;a.entry=r;for(var o=0,c=!0;r;)i[o]=r,r.isBuf||(c=!1),r=r.next,o+=1;i.allBuffers=c,k(t,n,!0,n.length,i,"",a.finish),n.pendingcb++,n.lastBufferedRequest=null,a.next?(n.corkedRequestsFree=a.next,a.next=null):n.corkedRequestsFree=new e(n),n.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,d=r.callback;if(k(t,n,!1,n.objectMode?1:l.length,l,u,d),r=r.next,n.bufferedRequestCount--,n.writing)break}null===r&&(n.lastBufferedRequest=null)}n.bufferedRequest=r,n.bufferProcessing=!1}function C(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function P(e,t){e._final((function(n){t.pendingcb--,n&&y(e,n),t.prefinished=!0,e.emit("prefinish"),_(e,t)}))}function _(e,t){var n=C(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,rJ.nextTick(P,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}return v6(x,r),w.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(w.prototype,"buffer",{get:n.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===x&&(e&&e._writableState instanceof w)}})):a=function(e){return e instanceof this},x.prototype.pipe=function(){y(this,new p)},x.prototype.write=function(e,t,n){var r,a=this._writableState,o=!1,c=!a.objectMode&&(r=e,s.isBuffer(r)||r instanceof i);return c&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"==typeof t&&(n=t,t=null),c?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof n&&(n=v),a.ending?function(e,t){var n=new b;y(e,n),rJ.nextTick(t,n)}(this,n):(c||function(e,t,n,r){var s;return null===n?s=new m:"string"==typeof n||t.objectMode||(s=new u("chunk",["string","Buffer"],n)),!s||(y(e,s),rJ.nextTick(r,s),!1)}(this,a,e,n))&&(a.pendingcb++,o=function(e,t,n,r,i,a){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=s.from(t,n));return t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var c=t.objectMode?1:r.length;t.length+=c;var l=t.length-1))throw new g(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(e,t,n){n(new d("_write()"))},x.prototype._writev=null,x.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,_(e,t),n&&(t.finished?rJ.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),x.prototype.destroy=o.destroy,x.prototype._undestroy=o.undestroy,x.prototype._destroy=function(e,t){t(e)},nCe}function hCe(){if(iCe)return sCe;iCe=1;var e=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};sCe=a;var t=ICe(),n=dCe();v6(a,t);for(var r=e(n.prototype),s=0;se.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))i="The ".concat(e," ").concat(r," ").concat(cCe(t,"type"));else{var a=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(a," ").concat(r," ").concat(cCe(t,"type"))}return i+=". Received type ".concat(typeof n)}),TypeError),oCe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),oCe("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),oCe("ERR_STREAM_PREMATURE_CLOSE","Premature close"),oCe("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),oCe("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),oCe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),oCe("ERR_STREAM_WRITE_AFTER_END","write after end"),oCe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),oCe("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),oCe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),YAe.codes=aCe;var pCe=lX.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function fCe(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!pCe(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=bCe;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=gCe;break;default:return void(this.write=mCe)}this.charBuffer=new lX(6),this.charReceived=0,this.charLength=0}function mCe(e){return e.toString(this.encoding)}function bCe(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function gCe(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}fCe.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&s<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var r=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived);var s;r=(t+=e.toString(this.encoding,0,r)).length-1;if((s=t.charCodeAt(r))>=55296&&s<=56319){var i=this.surrogateSize;return this.charLength+=i,this.charReceived+=i,this.charBuffer.copy(this.charBuffer,i,0,i),e.copy(this.charBuffer,0,0,i),t.substring(0,r)}return t},fCe.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},fCe.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,s=this.encoding;t+=r.slice(0,n).toString(s)}return t};var yCe=Ve(Object.freeze({__proto__:null,StringDecoder:fCe})),vCe=YAe.codes.ERR_STREAM_PREMATURE_CLOSE;function wCe(){}var xCe,kCe,ECe,ACe,CCe,PCe,_Ce=function e(t,n,r){if("function"==typeof n)return e(t,null,n);n||(n={}),r=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),s=0;s0)if("string"==typeof t||l.objectMode||Object.getPrototypeOf(t)===r.prototype||(t=function(e){return r.from(e)}(t)),a)l.endEmitted?y(e,new g):E(e,l,t,!0);else if(l.ended)y(e,new m);else{if(l.destroyed)return!1;l.reading=!1,l.decoder&&!n?(t=l.decoder.write(t),l.objectMode||0!==t.length?E(e,l,t,!1):S(e,l)):E(e,l,t,!1)}else a||(l.reading=!1,S(e,l));return!l.ended&&(l.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=A?e=A:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function P(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,rJ.nextTick(_,e))}function _(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,O(e)}function S(e,t){t.readingMore||(t.readingMore=!0,rJ.nextTick(I,e,t))}function I(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function T(e){i("readable nexttick read 0"),e.read(0)}function M(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),O(e),t.flowing&&!t.reading&&e.read(0)}function O(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function R(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,rJ.nextTick(F,t,e))}function F(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function j(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):P(this),null;if(0===(e=C(e,t))&&t.ended)return 0===t.length&&R(this),null;var r,s=t.needReadable;return i("need readable",s),(0===t.length||t.length-e0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&R(this)),null!==r&&this.emit("data",r),r},x.prototype._read=function(e){y(this,new b("_read()"))},x.prototype.pipe=function(e,n){var r=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=e;break;case 1:s.pipes=[s.pipes,e];break;default:s.pipes.push(e)}s.pipesCount+=1,i("pipe count=%d opts=%j",s.pipesCount,n);var a=(!n||!1!==n.end)&&e!==rJ.stdout&&e!==rJ.stderr?c:m;function o(t,n){i("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,i("cleanup"),e.removeListener("close",p),e.removeListener("finish",f),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",o),r.removeListener("end",c),r.removeListener("end",m),r.removeListener("data",d),u=!0,!s.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){i("onend"),e.end()}s.endEmitted?rJ.nextTick(a):r.once("end",a),e.on("unpipe",o);var l=function(e){return function(){var n=e._readableState;i("pipeOnDrain",n.awaitDrain),n.awaitDrain&&n.awaitDrain--,0===n.awaitDrain&&t(e,"data")&&(n.flowing=!0,O(e))}}(r);e.on("drain",l);var u=!1;function d(t){i("ondata");var n=e.write(t);i("dest.write",n),!1===n&&((1===s.pipesCount&&s.pipes===e||s.pipesCount>1&&-1!==j(s.pipes,e))&&!u&&(i("false write response, pause",s.awaitDrain),s.awaitDrain++),r.pause())}function h(n){i("onerror",n),m(),e.removeListener("error",h),0===t(e,"error")&&y(e,n)}function p(){e.removeListener("finish",f),m()}function f(){i("onfinish"),e.removeListener("close",p),m()}function m(){i("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",h),e.once("close",p),e.once("finish",f),e.emit("pipe",r),s.flowing||(i("pipe resume"),r.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,s=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==s.flowing&&this.resume()):"readable"===e&&(s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.flowing=!1,s.emittedReadable=!1,i("on readable",s.length,s.reading),s.length?P(this):s.reading||rJ.nextTick(T,this))),r},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(e,t){var r=n.prototype.removeListener.call(this,e,t);return"readable"===e&&rJ.nextTick(B,this),r},x.prototype.removeAllListeners=function(e){var t=n.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||rJ.nextTick(B,this),t},x.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,rJ.nextTick(M,e,t))}(this,e)),e.paused=!1,this},x.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var s in e.on("end",(function(){if(i("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(s){(i("wrapped data"),n.decoder&&(s=n.decoder.write(s)),n.objectMode&&null==s)||(n.objectMode||s&&s.length)&&(t.push(s)||(r=!0,e.pause()))})),e)void 0===this[s]&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var a=0;a0,(function(e){r||(r=e),e&&i.forEach(QCe),a||(i.forEach(QCe),s(r))}))}));return t.reduce(KCe)};!function(e,t){(t=e.exports=ICe()).Stream=t,t.Readable=t,t.Writable=dCe(),t.Duplex=hCe(),t.Transform=BCe,t.PassThrough=HCe,t.finished=_Ce,t.pipeline=YCe}(VEe,VEe.exports);var JCe=VEe.exports;const{Transform:XCe}=JCe;const{Transform:ePe}=JCe;const tPe=e=>class t extends XCe{constructor(t,n,r,s,i){super(i),this._rate=t,this._capacity=n,this._delimitedSuffix=r,this._hashBitLength=s,this._options=i,this._state=new e,this._state.initialize(t,n),this._finalized=!1}_transform(e,t,n){let r=null;try{this.update(e,t)}catch(e){r=e}n(r)}_flush(e){let t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}update(e,t){if(!lX.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return lX.isBuffer(e)||(e=lX.from(e,t)),this._state.absorb(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}},nPe=e=>class t extends ePe{constructor(t,n,r,s){super(s),this._rate=t,this._capacity=n,this._delimitedSuffix=r,this._options=s,this._state=new e,this._state.initialize(t,n),this._finalized=!1}_transform(e,t,n){let r=null;try{this.update(e,t)}catch(e){r=e}n(r)}_flush(){}_read(e){this.push(this.squeeze(e))}update(e,t){if(!lX.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return lX.isBuffer(e)||(e=lX.from(e,t)),this._state.absorb(e),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let n=this._state.squeeze(e);return void 0!==t&&(n=n.toString(t)),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}};var rPe={};const sPe=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];rPe.p1600=function(e){for(let t=0;t<24;++t){const n=e[0]^e[10]^e[20]^e[30]^e[40],r=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],i=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],o=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],u=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49];let h=u^(s<<1|i>>>31),p=d^(i<<1|s>>>31);const f=e[0]^h,m=e[1]^p,b=e[10]^h,g=e[11]^p,y=e[20]^h,v=e[21]^p,w=e[30]^h,x=e[31]^p,k=e[40]^h,E=e[41]^p;h=n^(a<<1|o>>>31),p=r^(o<<1|a>>>31);const A=e[2]^h,C=e[3]^p,P=e[12]^h,_=e[13]^p,S=e[22]^h,I=e[23]^p,B=e[32]^h,T=e[33]^p,M=e[42]^h,O=e[43]^p;h=s^(c<<1|l>>>31),p=i^(l<<1|c>>>31);const N=e[4]^h,R=e[5]^p,F=e[14]^h,j=e[15]^p,L=e[24]^h,U=e[25]^p,D=e[34]^h,z=e[35]^p,H=e[44]^h,G=e[45]^p;h=a^(u<<1|d>>>31),p=o^(d<<1|u>>>31);const q=e[6]^h,$=e[7]^p,V=e[16]^h,W=e[17]^p,Z=e[26]^h,Q=e[27]^p,K=e[36]^h,Y=e[37]^p,J=e[46]^h,X=e[47]^p;h=c^(n<<1|r>>>31),p=l^(r<<1|n>>>31);const ee=e[8]^h,te=e[9]^p,ne=e[18]^h,re=e[19]^p,se=e[28]^h,ie=e[29]^p,ae=e[38]^h,oe=e[39]^p,ce=e[48]^h,le=e[49]^p,ue=f,de=m,he=g<<4|b>>>28,pe=b<<4|g>>>28,fe=y<<3|v>>>29,me=v<<3|y>>>29,be=x<<9|w>>>23,ge=w<<9|x>>>23,ye=k<<18|E>>>14,ve=E<<18|k>>>14,we=A<<1|C>>>31,xe=C<<1|A>>>31,ke=_<<12|P>>>20,Ee=P<<12|_>>>20,Ae=S<<10|I>>>22,Ce=I<<10|S>>>22,Pe=T<<13|B>>>19,_e=B<<13|T>>>19,Se=M<<2|O>>>30,Ie=O<<2|M>>>30,Be=R<<30|N>>>2,Te=N<<30|R>>>2,Me=F<<6|j>>>26,Oe=j<<6|F>>>26,Ne=U<<11|L>>>21,Re=L<<11|U>>>21,Fe=D<<15|z>>>17,je=z<<15|D>>>17,Le=G<<29|H>>>3,Ue=H<<29|G>>>3,De=q<<28|$>>>4,ze=$<<28|q>>>4,He=W<<23|V>>>9,Ge=V<<23|W>>>9,qe=Z<<25|Q>>>7,$e=Q<<25|Z>>>7,Ve=K<<21|Y>>>11,We=Y<<21|K>>>11,Ze=X<<24|J>>>8,Qe=J<<24|X>>>8,Ke=ee<<27|te>>>5,Ye=te<<27|ee>>>5,Je=ne<<20|re>>>12,Xe=re<<20|ne>>>12,et=ie<<7|se>>>25,tt=se<<7|ie>>>25,nt=ae<<8|oe>>>24,rt=oe<<8|ae>>>24,st=ce<<14|le>>>18,it=le<<14|ce>>>18;e[0]=ue^~ke&Ne,e[1]=de^~Ee&Re,e[10]=De^~Je&fe,e[11]=ze^~Xe&me,e[20]=we^~Me&qe,e[21]=xe^~Oe&$e,e[30]=Ke^~he&Ae,e[31]=Ye^~pe&Ce,e[40]=Be^~He&et,e[41]=Te^~Ge&tt,e[2]=ke^~Ne&Ve,e[3]=Ee^~Re&We,e[12]=Je^~fe&Pe,e[13]=Xe^~me&_e,e[22]=Me^~qe&nt,e[23]=Oe^~$e&rt,e[32]=he^~Ae&Fe,e[33]=pe^~Ce&je,e[42]=He^~et&be,e[43]=Ge^~tt&ge,e[4]=Ne^~Ve&st,e[5]=Re^~We&it,e[14]=fe^~Pe&Le,e[15]=me^~_e&Ue,e[24]=qe^~nt&ye,e[25]=$e^~rt&ve,e[34]=Ae^~Fe&Ze,e[35]=Ce^~je&Qe,e[44]=et^~be&Se,e[45]=tt^~ge&Ie,e[6]=Ve^~st&ue,e[7]=We^~it&de,e[16]=Pe^~Le&De,e[17]=_e^~Ue&ze,e[26]=nt^~ye&we,e[27]=rt^~ve&xe,e[36]=Fe^~Ze&Ke,e[37]=je^~Qe&Ye,e[46]=be^~Se&Be,e[47]=ge^~Ie&Te,e[8]=st^~ue&ke,e[9]=it^~de&Ee,e[18]=Le^~De&Je,e[19]=Ue^~ze&Xe,e[28]=ye^~we&Me,e[29]=ve^~xe&Oe,e[38]=Ze^~Ke&he,e[39]=Qe^~Ye&pe,e[48]=Se^~Be&He,e[49]=Ie^~Te&Ge,e[0]^=sPe[2*t],e[1]^=sPe[2*t+1]}};const iPe=rPe;function aPe(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}aPe.prototype.initialize=function(e,t){for(let e=0;e<50;++e)this.state[e]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},aPe.prototype.absorb=function(e){for(let t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(iPe.p1600(this.state),this.count=0);return t},aPe.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var oPe=function(e){const t=tPe(e),n=nPe(e);return function(e,r){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,r);case"keccak256":return new t(1088,512,null,256,r);case"keccak384":return new t(832,768,null,384,r);case"keccak512":return new t(576,1024,null,512,r);case"sha3-224":return new t(1152,448,6,224,r);case"sha3-256":return new t(1088,512,6,256,r);case"sha3-384":return new t(832,768,6,384,r);case"sha3-512":return new t(576,1024,6,512,r);case"shake128":return new n(1344,256,31,r);case"shake256":return new n(1088,512,31,r);default:throw new Error("Invald algorithm: "+e)}}}(aPe);const cPe=oPe;function lPe(e){return lX.allocUnsafe(e).fill(0)}function uPe(e,t){let n=e.toString(16);n.length%2!=0&&(n="0"+n);const r=n.match(/.{1,2}/g).map((e=>parseInt(e,16)));for(;r.lengthn)throw new Error("Elements exceed array size: "+n);for(i in s=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)s.push(kPe(e,t[i]));if("dynamic"===n){var a=kPe("uint256",t.length);s.unshift(a)}return lX.concat(s)}if("bytes"===e)return t=new lX(t),s=lX.concat([kPe("uint256",t.length),t]),t.length%32!=0&&(s=lX.concat([s,bPe.zeros(32-t.length%32)])),s;if(e.startsWith("bytes")){if((n=yPe(e))<1||n>32)throw new Error("Invalid bytes width: "+n);return bPe.setLengthRight(t,32)}if(e.startsWith("uint")){if((n=yPe(e))%8||n<8||n>256)throw new Error("Invalid uint width: "+n);r=xPe(t);const s=bPe.bitLengthFromBigInt(r);if(s>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+s);if(r<0)throw new Error("Supplied uint is negative");return bPe.bufferBEFromBigInt(r,32)}if(e.startsWith("int")){if((n=yPe(e))%8||n<8||n>256)throw new Error("Invalid int width: "+n);r=xPe(t);const s=bPe.bitLengthFromBigInt(r);if(s>n)throw new Error("Supplied int exceeds width: "+n+" vs "+s);const i=bPe.twosFromBigInt(r,256);return bPe.bufferBEFromBigInt(i,32)}if(e.startsWith("ufixed")){if(n=vPe(e),(r=xPe(t))<0)throw new Error("Supplied ufixed is negative");return kPe("uint256",r*BigInt(2)**BigInt(n[1]))}if(e.startsWith("fixed"))return n=vPe(e),kPe("int256",xPe(t)*BigInt(2)**BigInt(n[1]));throw new Error("Unsupported or invalid type: "+e)}function EPe(e){return"string"===e||"bytes"===e||"dynamic"===wPe(e)}function APe(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var n,r,s=[],i=0;i32)throw new Error("Invalid bytes width: "+n);s.push(bPe.setLengthRight(o,n))}else if(a.startsWith("uint")){if((n=yPe(a))%8||n<8||n>256)throw new Error("Invalid uint width: "+n);r=xPe(o);const e=bPe.bitLengthFromBigInt(r);if(e>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+e);s.push(bPe.bufferBEFromBigInt(r,n/8))}else{if(!a.startsWith("int"))throw new Error("Unsupported or invalid type: "+a);{if((n=yPe(a))%8||n<8||n>256)throw new Error("Invalid int width: "+n);r=xPe(o);const e=bPe.bitLengthFromBigInt(r);if(e>n)throw new Error("Supplied int exceeds width: "+n+" vs "+e);const t=bPe.twosFromBigInt(r,n);s.push(bPe.bufferBEFromBigInt(t,n/8))}}}return lX.concat(s)}var CPe={rawEncode:function(e,t){var n=[],r=[],s=32*e.length;for(var i in e){var a=gPe(e[i]),o=kPe(a,t[i]);EPe(a)?(n.push(kPe("uint256",s)),r.push(o),s+=o.length):n.push(o)}return lX.concat(n.concat(r))},solidityPack:APe,soliditySHA3:function(e,t){return bPe.keccak(APe(e,t))}};const PPe=mPe,_Pe=CPe,SPe={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"]},IPe={encodeData(e,t,n,r=!0){const s=["bytes32"],i=[this.hashType(e,n)];if(r){const a=(e,t,s)=>{if(void 0!==n[t])return["bytes32",null==s?"0x0000000000000000000000000000000000000000000000000000000000000000":PPe.keccak(this.encodeData(t,s,n,r))];if(void 0===s)throw new Error(`missing value for field ${e} of type ${t}`);if("bytes"===t)return["bytes32",PPe.keccak(s)];if("string"===t)return"string"==typeof s&&(s=lX.from(s,"utf8")),["bytes32",PPe.keccak(s)];if(t.lastIndexOf("]")===t.length-1){const n=t.slice(0,t.lastIndexOf("[")),r=s.map((t=>a(e,n,t)));return["bytes32",PPe.keccak(_Pe.rawEncode(r.map((([e])=>e)),r.map((([,e])=>e))))]}return[t,s]};for(const r of n[e]){const[e,n]=a(r.name,r.type,t[r.name]);s.push(e),i.push(n)}}else for(const a of n[e]){let e=t[a.name];if(void 0!==e)if("bytes"===a.type)s.push("bytes32"),e=PPe.keccak(e),i.push(e);else if("string"===a.type)s.push("bytes32"),"string"==typeof e&&(e=lX.from(e,"utf8")),e=PPe.keccak(e),i.push(e);else if(void 0!==n[a.type])s.push("bytes32"),e=PPe.keccak(this.encodeData(a.type,e,n,r)),i.push(e);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(a.type),i.push(e)}}return _Pe.rawEncode(s,i)},encodeType(e,t){let n="",r=this.findTypeDependencies(e,t).filter((t=>t!==e));r=[e].concat(r.sort());for(const e of r){if(!t[e])throw new Error("No type definition specified: "+e);n+=e+"("+t[e].map((({name:e,type:t})=>t+" "+e)).join(",")+")"}return n},findTypeDependencies(e,t,n=[]){if(e=e.match(/^\w*/)[0],n.includes(e)||void 0===t[e])return n;n.push(e);for(const r of t[e])for(const e of this.findTypeDependencies(r.type,t,n))!n.includes(e)&&n.push(e);return n},hashStruct(e,t,n,r=!0){return PPe.keccak(this.encodeData(e,t,n,r))},hashType(e,t){return PPe.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const n in SPe.properties)e[n]&&(t[n]=e[n]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const n=this.sanitizeData(e),r=[lX.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,t)),"EIP712Domain"!==n.primaryType&&r.push(this.hashStruct(n.primaryType,n.message,n.types,t)),PPe.keccak(lX.concat(r))}};var BPe={TYPED_MESSAGE_SCHEMA:SPe,TypedDataUtils:IPe,hashForSignTypedDataLegacy:function(e){return function(e){const t=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!e.length)throw t;const n=e.map((function(e){return"bytes"===e.type?PPe.toBuffer(e.value):e.value})),r=e.map((function(e){return e.type})),s=e.map((function(e){if(!e.name)throw t;return e.type+" "+e.name}));return _Pe.soliditySHA3(["bytes32","bytes32"],[_Pe.soliditySHA3(new Array(e.length).fill("string"),s),_Pe.soliditySHA3(r,n)])}(e.data)},hashForSignTypedData_v3:function(e){return IPe.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return IPe.hash(e.data)}};var TPe={};Object.defineProperty(TPe,"__esModule",{value:!0}),TPe.APP_VERSION_KEY=TPe.LOCAL_STORAGE_ADDRESSES_KEY=TPe.WALLET_USER_NAME_KEY=void 0,TPe.WALLET_USER_NAME_KEY="walletUsername",TPe.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",TPe.APP_VERSION_KEY="AppVersion";var MPe={};Object.defineProperty(MPe,"__esModule",{value:!0}),MPe.RelayEventManager=void 0;const OPe=iEe;MPe.RelayEventManager=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,t=(0,OPe.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}};var NPe={},RPe={},FPe={};Object.defineProperty(FPe,"__esModule",{value:!0}),FPe.WalletLinkCipher=void 0;const jPe=iEe;FPe.WalletLinkCipher=class{constructor(e){this.secret=e}async encrypt(e){const t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.importKey("raw",(0,jPe.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,i=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},r,s.encode(e)),a=i.slice(i.byteLength-16),o=i.slice(0,i.byteLength-16),c=new Uint8Array(a),l=new Uint8Array(o),u=new Uint8Array([...n,...c,...l]);return(0,jPe.uint8ArrayToHex)(u)}async decrypt(e){const t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");return new Promise(((n,r)=>{!async function(){const s=await crypto.subtle.importKey("raw",(0,jPe.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=(0,jPe.hexStringToUint8Array)(e),a=i.slice(0,12),o=i.slice(12,28),c=i.slice(28),l=new Uint8Array([...c,...o]),u={name:"AES-GCM",iv:new Uint8Array(a)};try{const e=await window.crypto.subtle.decrypt(u,s,l),t=new TextDecoder;n(t.decode(e))}catch(e){r(e)}}()}))}};var LPe={};Object.defineProperty(LPe,"__esModule",{value:!0}),LPe.WalletLinkHTTP=void 0;LPe.WalletLinkHTTP=class{constructor(e,t,n){this.linkAPIUrl=e,this.sessionId=t;const r=`${t}:${n}`;this.auth=`Basic ${btoa(r)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map((e=>fetch(`${this.linkAPIUrl}/events/${e.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}})))).catch((e=>console.error("Unabled to mark event as failed:",e)))}async fetchUnseenEvents(){var e;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:n,error:r}=await t.json();if(r)throw new Error(`Check unseen events failed: ${r}`);const s=null!==(e=null==n?void 0:n.filter((e=>"Web3Response"===e.event)).map((e=>({type:"Event",sessionId:this.sessionId,eventId:e.id,event:e.event,data:e.data}))))&&void 0!==e?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${t.status}`)}};var UPe,DPe={};Object.defineProperty(DPe,"__esModule",{value:!0}),DPe.WalletLinkWebSocket=DPe.ConnectionState=void 0,function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(UPe||(DPe.ConnectionState=UPe={}));DPe.WalletLinkWebSocket=class{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise(((e,t)=>{var n;let r;try{this.webSocket=r=new this.WebSocketClass(this.url)}catch(e){return void t(e)}null===(n=this.connectionStateListener)||void 0===n||n.call(this,UPe.CONNECTING),r.onclose=e=>{var n;this.clearWebSocket(),t(new Error(`websocket error ${e.code}: ${e.reason}`)),null===(n=this.connectionStateListener)||void 0===n||n.call(this,UPe.DISCONNECTED)},r.onopen=t=>{var n;if(e(),null===(n=this.connectionStateListener)||void 0===n||n.call(this,UPe.CONNECTED),this.pendingData.length>0){[...this.pendingData].forEach((e=>this.sendData(e))),this.pendingData=[]}},r.onmessage=e=>{var t,n;if("h"===e.data)null===(t=this.incomingDataListener)||void 0===t||t.call(this,{type:"Heartbeat"});else try{const t=JSON.parse(e.data);null===(n=this.incomingDataListener)||void 0===n||n.call(this,t)}catch(e){}}}))}disconnect(){var e;const{webSocket:t}=this;if(t){this.clearWebSocket(),null===(e=this.connectionStateListener)||void 0===e||e.call(this,UPe.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch(e){}}}sendData(e){const{webSocket:t}=this;if(!t)return this.pendingData.push(e),void this.connect();t.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}},Object.defineProperty(RPe,"__esModule",{value:!0}),RPe.WalletLinkConnection=void 0;const zPe=TPe,HPe=FPe,GPe=LPe,qPe=DPe,$Pe=rEe;RPe.WalletLinkConnection=class{constructor({session:e,linkAPIUrl:t,listener:n,WebSocketClass:r=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,$Pe.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=e=>{if(!e)return;const t=new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",t=>e.JsonRpcUrl&&this.handleChainUpdated(t,e.JsonRpcUrl)]]);t.forEach(((t,n)=>{const r=e[n];void 0!==r&&t(r)}))},this.handleDestroyed=e=>{var t;"1"===e&&(null===(t=this.listener)||void 0===t||t.resetAndReload())},this.handleAccountUpdated=async e=>{var t;{const n=await this.cipher.decrypt(e);null===(t=this.listener)||void 0===t||t.accountUpdated(n)}},this.handleMetadataUpdated=async(e,t)=>{var n;{const r=await this.cipher.decrypt(t);null===(n=this.listener)||void 0===n||n.metadataUpdated(e,r)}},this.handleWalletUsernameUpdated=async e=>{this.handleMetadataUpdated(zPe.WALLET_USER_NAME_KEY,e)},this.handleAppVersionUpdated=async e=>{this.handleMetadataUpdated(zPe.APP_VERSION_KEY,e)},this.handleChainUpdated=async(e,t)=>{var n;{const r=await this.cipher.decrypt(e),s=await this.cipher.decrypt(t);null===(n=this.listener)||void 0===n||n.chainUpdated(r,s)}},this.session=e,this.cipher=new HPe.WalletLinkCipher(e.secret),this.listener=n;const s=new qPe.WalletLinkWebSocket(`${t}/rpc`,r);s.setConnectionStateListener((async e=>{let t=!1;switch(e){case qPe.ConnectionState.DISCONNECTED:if(!this.destroyed){const e=async()=>{await new Promise((e=>setTimeout(e,5e3))),this.destroyed||s.connect().catch((()=>{e()}))};e()}break;case qPe.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),t=!0}catch(e){}this.updateLastHeartbeat(),setInterval((()=>{this.heartbeat()}),1e4),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();case qPe.ConnectionState.CONNECTING:}this.connected!==t&&(this.connected=t)})),s.setIncomingDataListener((e=>{var t;switch(e.type){case"Heartbeat":return void this.updateLastHeartbeat();case"IsLinkedOK":case"Linked":{const t="IsLinkedOK"===e.type?e.linked:void 0;this.linked=t||e.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":this.handleSessionMetadataUpdated(e.metadata);break;case"Event":this.handleIncomingEvent(e)}void 0!==e.id&&(null===(t=this.requestResolutions.get(e.id))||void 0===t||t(e))})),this.ws=s,this.http=new GPe.WalletLinkHTTP(t,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}destroy(){this.destroyed=!0,this.ws.disconnect(),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var t;this._connected=e,e&&(null===(t=this.onceConnected)||void 0===t||t.call(this))}setOnceConnected(e){return new Promise((t=>{this.connected?e().then(t):this.onceConnected=()=>{e().then(t),this.onceConnected=void 0}}))}get linked(){return this._linked}set linked(e){var t,n;this._linked=e,e&&(null===(t=this.onceLinked)||void 0===t||t.call(this)),null===(n=this.listener)||void 0===n||n.linkedUpdated(e)}setOnceLinked(e){return new Promise((t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}}))}async handleIncomingEvent(e){var t;if("Event"===e.type&&"Web3Response"===e.event){const n=await this.cipher.decrypt(e.data),r=JSON.parse(n);if("WEB3_RESPONSE"!==r.type)return;null===(t=this.listener)||void 0===t||t.handleWeb3ResponseMessage(r)}}async checkUnseenEvents(){if(this.connected){await new Promise((e=>setTimeout(e,250)));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}else this.shouldFetchUnseenEventsOnConnect=!0}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1;(await this.http.fetchUnseenEvents()).forEach((e=>this.handleIncomingEvent(e)))}async setSessionMetadata(e,t){const n={type:"SetSessionConfig",id:(0,$Pe.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:t}};return this.setOnceConnected((async()=>{const e=await this.makeRequest(n);if("Fail"===e.type)throw new Error(e.error||"failed to set session metadata")}))}async publishEvent(e,t,n=!1){const r=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,$Pe.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:r,callWebhook:n};return this.setOnceLinked((async()=>{const e=await this.makeRequest(s);if("Fail"===e.type)throw new Error(e.error||"failed to publish event");return e.eventId}))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(e){}}async makeRequest(e,t=6e4){const n=e.id;let r;return this.sendData(e),Promise.race([new Promise(((e,s)=>{r=window.setTimeout((()=>{s(new Error(`request ${n} timed out`))}),t)})),new Promise((e=>{this.requestResolutions.set(n,(t=>{clearTimeout(r),e(t),this.requestResolutions.delete(n)}))}))])}async authenticate(){const e={type:"HostSession",id:(0,$Pe.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},t=await this.makeRequest(e);if("Fail"===t.type)throw new Error(t.error||"failed to authenticate")}sendIsLinked(){const e={type:"IsLinked",id:(0,$Pe.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,$Pe.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}};var VPe={},WPe={exports:{}},ZPe={exports:{}}; /*! safe-buffer. MIT License. Feross Aboukhadijeh */ !function(e,t){var n=O2,r=n.Buffer;function s(e,t){for(var n in e)t[n]=e[n]}function i(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(s(n,t),t.Buffer=i),i.prototype=Object.create(r.prototype),s(r,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var s=r(e);return void 0!==t?"string"==typeof n?s.fill(t,n):s.fill(t):s.fill(0),s},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}(ZPe,ZPe.exports);var QPe=ZPe.exports,KPe=QPe.Buffer;function YPe(e,t){this._block=KPe.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}YPe.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=KPe.from(e,t));for(var n=this._block,r=this._blockSize,s=e.length,i=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,s=(n-r)/4294967296;this._block.writeUInt32BE(s,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},YPe.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var JPe=YPe,XPe=v6,e_e=JPe,t_e=QPe.Buffer,n_e=[1518500249,1859775393,-1894007588,-899497514],r_e=new Array(80);function s_e(){this.init(),this._w=r_e,e_e.call(this,64,56)}function i_e(e){return e<<30|e>>>2}function a_e(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}XPe(s_e,e_e),s_e.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s_e.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,s=0|this._b,i=0|this._c,a=0|this._d,o=0|this._e,c=0;c<16;++c)n[c]=e.readInt32BE(4*c);for(;c<80;++c)n[c]=n[c-3]^n[c-8]^n[c-14]^n[c-16];for(var l=0;l<80;++l){var u=~~(l/20),d=0|((t=r)<<5|t>>>27)+a_e(u,s,i,a)+o+n[l]+n_e[u];o=a,a=i,i=i_e(s),s=r,r=d}this._a=r+this._a|0,this._b=s+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=o+this._e|0},s_e.prototype._hash=function(){var e=t_e.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var o_e=s_e,c_e=v6,l_e=JPe,u_e=QPe.Buffer,d_e=[1518500249,1859775393,-1894007588,-899497514],h_e=new Array(80);function p_e(){this.init(),this._w=h_e,l_e.call(this,64,56)}function f_e(e){return e<<5|e>>>27}function m_e(e){return e<<30|e>>>2}function b_e(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}c_e(p_e,l_e),p_e.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},p_e.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,s=0|this._b,i=0|this._c,a=0|this._d,o=0|this._e,c=0;c<16;++c)n[c]=e.readInt32BE(4*c);for(;c<80;++c)n[c]=(t=n[c-3]^n[c-8]^n[c-14]^n[c-16])<<1|t>>>31;for(var l=0;l<80;++l){var u=~~(l/20),d=f_e(r)+b_e(u,s,i,a)+o+n[l]+d_e[u]|0;o=a,a=i,i=m_e(s),s=r,r=d}this._a=r+this._a|0,this._b=s+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=o+this._e|0},p_e.prototype._hash=function(){var e=u_e.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var g_e=p_e,y_e=v6,v_e=JPe,w_e=QPe.Buffer,x_e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],k_e=new Array(64);function E_e(){this.init(),this._w=k_e,v_e.call(this,64,56)}function A_e(e,t,n){return n^e&(t^n)}function C_e(e,t,n){return e&t|n&(e|t)}function P_e(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function __e(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function S_e(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function I_e(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}y_e(E_e,v_e),E_e.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},E_e.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,s=0|this._c,i=0|this._d,a=0|this._e,o=0|this._f,c=0|this._g,l=0|this._h,u=0;u<16;++u)t[u]=e.readInt32BE(4*u);for(;u<64;++u)t[u]=I_e(t[u-2])+t[u-7]+S_e(t[u-15])+t[u-16]|0;for(var d=0;d<64;++d){var h=l+__e(a)+A_e(a,o,c)+x_e[d]+t[d]|0,p=P_e(n)+C_e(n,r,s)|0;l=c,c=o,o=a,a=i+h|0,i=s,s=r,r=n,n=h+p|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=a+this._e|0,this._f=o+this._f|0,this._g=c+this._g|0,this._h=l+this._h|0},E_e.prototype._hash=function(){var e=w_e.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var B_e=E_e,T_e=v6,M_e=B_e,O_e=JPe,N_e=QPe.Buffer,R_e=new Array(64);function F_e(){this.init(),this._w=R_e,O_e.call(this,64,56)}T_e(F_e,M_e),F_e.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},F_e.prototype._hash=function(){var e=N_e.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var j_e=F_e,L_e=v6,U_e=JPe,D_e=QPe.Buffer,z_e=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],H_e=new Array(160);function G_e(){this.init(),this._w=H_e,U_e.call(this,128,112)}function q_e(e,t,n){return n^e&(t^n)}function $_e(e,t,n){return e&t|n&(e|t)}function V_e(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function W_e(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Z_e(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Q_e(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function K_e(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Y_e(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function J_e(e,t){return e>>>0>>0?1:0}L_e(G_e,U_e),G_e.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},G_e.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,s=0|this._ch,i=0|this._dh,a=0|this._eh,o=0|this._fh,c=0|this._gh,l=0|this._hh,u=0|this._al,d=0|this._bl,h=0|this._cl,p=0|this._dl,f=0|this._el,m=0|this._fl,b=0|this._gl,g=0|this._hl,y=0;y<32;y+=2)t[y]=e.readInt32BE(4*y),t[y+1]=e.readInt32BE(4*y+4);for(;y<160;y+=2){var v=t[y-30],w=t[y-30+1],x=Z_e(v,w),k=Q_e(w,v),E=K_e(v=t[y-4],w=t[y-4+1]),A=Y_e(w,v),C=t[y-14],P=t[y-14+1],_=t[y-32],S=t[y-32+1],I=k+P|0,B=x+C+J_e(I,k)|0;B=(B=B+E+J_e(I=I+A|0,A)|0)+_+J_e(I=I+S|0,S)|0,t[y]=B,t[y+1]=I}for(var T=0;T<160;T+=2){B=t[T],I=t[T+1];var M=$_e(n,r,s),O=$_e(u,d,h),N=V_e(n,u),R=V_e(u,n),F=W_e(a,f),j=W_e(f,a),L=z_e[T],U=z_e[T+1],D=q_e(a,o,c),z=q_e(f,m,b),H=g+j|0,G=l+F+J_e(H,g)|0;G=(G=(G=G+D+J_e(H=H+z|0,z)|0)+L+J_e(H=H+U|0,U)|0)+B+J_e(H=H+I|0,I)|0;var q=R+O|0,$=N+M+J_e(q,R)|0;l=c,g=b,c=o,b=m,o=a,m=f,a=i+G+J_e(f=p+H|0,p)|0,i=s,p=h,s=r,h=d,r=n,d=u,n=G+$+J_e(u=H+q|0,H)|0}this._al=this._al+u|0,this._bl=this._bl+d|0,this._cl=this._cl+h|0,this._dl=this._dl+p|0,this._el=this._el+f|0,this._fl=this._fl+m|0,this._gl=this._gl+b|0,this._hl=this._hl+g|0,this._ah=this._ah+n+J_e(this._al,u)|0,this._bh=this._bh+r+J_e(this._bl,d)|0,this._ch=this._ch+s+J_e(this._cl,h)|0,this._dh=this._dh+i+J_e(this._dl,p)|0,this._eh=this._eh+a+J_e(this._el,f)|0,this._fh=this._fh+o+J_e(this._fl,m)|0,this._gh=this._gh+c+J_e(this._gl,b)|0,this._hh=this._hh+l+J_e(this._hl,g)|0},G_e.prototype._hash=function(){var e=D_e.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var X_e=G_e,eSe=v6,tSe=X_e,nSe=JPe,rSe=QPe.Buffer,sSe=new Array(160);function iSe(){this.init(),this._w=sSe,nSe.call(this,128,112)}eSe(iSe,tSe),iSe.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},iSe.prototype._hash=function(){var e=rSe.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var aSe=iSe,oSe=WPe.exports=function(e){e=e.toLowerCase();var t=oSe[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};oSe.sha=o_e,oSe.sha1=g_e,oSe.sha224=j_e,oSe.sha256=B_e,oSe.sha384=aSe,oSe.sha512=X_e;var cSe=WPe.exports;Object.defineProperty(VPe,"__esModule",{value:!0}),VPe.WalletLinkSession=void 0;const lSe=cSe,uSe=iEe,dSe="session:id",hSe="session:secret",pSe="session:linked";class fSe{constructor(e,t,n,r){this._storage=e,this._id=t||(0,uSe.randomBytesHex)(16),this._secret=n||(0,uSe.randomBytesHex)(32),this._key=(new lSe.sha256).update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!r}static load(e){const t=e.getItem(dSe),n=e.getItem(pSe),r=e.getItem(hSe);return t&&r?new fSe(e,t,r,"1"===n):null}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(dSe,this._id),this._storage.setItem(hSe,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(pSe,this._linked?"1":"0")}}VPe.WalletLinkSession=fSe;var mSe={};Object.defineProperty(mSe,"__esModule",{value:!0}),mSe.isDarkMode=mSe.isMobileWeb=mSe.getLocation=mSe.createQrUrl=void 0,mSe.createQrUrl=function(e,t,n,r,s,i){const a=r?"parent-id":"id";return`${n}/#/link?${new URLSearchParams({[a]:e,secret:t,server:n,v:s,chainId:i.toString()}).toString()}`},mSe.getLocation=function(){try{return function(){try{return null!==window.frameElement}catch(e){return!1}}()&&window.top?window.top.location:window.location}catch(e){return window.location}},mSe.isMobileWeb=function(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(null===(e=null===window||void 0===window?void 0:window.navigator)||void 0===e?void 0:e.userAgent)},mSe.isDarkMode=function(){var e,t;return null!==(t=null===(e=null===window||void 0===window?void 0:window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)&&void 0!==t&&t};var bSe={},gSe={},ySe={};Object.defineProperty(ySe,"__esModule",{value:!0}),ySe.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var vSe=qe&&qe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gSe,"__esModule",{value:!0}),gSe.injectCssReset=void 0;const wSe=vSe(ySe);gSe.injectCssReset=function(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(wSe.default)),document.documentElement.appendChild(e)};var xSe={};function kSe(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t2&&(a.children=arguments.length>3?ASe.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return qSe(e,a,r,s,null)}function qSe(e,t,n,r,s){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++PSe:s,__i:-1,__u:0};return null==s&&null!=CSe.vnode&&CSe.vnode(i),i}function $Se(e){return e.children}function VSe(e,t){this.props=e,this.context=t}function WSe(e,t){if(null==t)return e.__?WSe(e.__,e.__i+1):null;for(var n;tt&&SSe.sort(TSe));KSe.__r=0}function YSe(e,t,n,r,s,i,a,o,c,l,u){var d,h,p,f,m,b=r&&r.__k||LSe,g=t.length;for(n.__d=c,function(e,t,n){var r,s,i,a,o,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],r=0;r0?qSe(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)?(s.__=e,s.__b=e.__b+1,o=XSe(s,n,a,u),s.__i=o,i=null,-1!==o&&(u--,(i=n[o])&&(i.__u|=131072)),null==i||null===i.__v?(-1==o&&d--,"function"!=typeof s.type&&(s.__u|=65536)):o!==a&&(o==a-1?d--:o==a+1?d++:o>a?u>c-a?d+=o-a:d--:o(null==c||131072&c.__u?0:1))for(;a>=0||o=0){if((c=t[a])&&!(131072&c.__u)&&s==c.key&&i===c.type)return a;a--}if(o2&&(o.children=arguments.length>3?ASe.call(arguments,2):n),qSe(e.type,o,r||e.key,s||e.ref,null)},createContext:function(e,t){var n={__c:t="__cC"+RSe++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,QSe(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},createElement:GSe,createRef:function(){return{current:null}},h:GSe,hydrate:function e(t,n){lIe(t,n,e)},get isValidElement(){return _Se},get options(){return CSe},render:lIe,toChildArray:function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(DSe(t)?t.some((function(t){e(t,n)})):n.push(t)),n}}),mIe=Ve(fIe),bIe=0,gIe=[],yIe=CSe,vIe=yIe.__b,wIe=yIe.__r,xIe=yIe.diffed,kIe=yIe.__c,EIe=yIe.unmount,AIe=yIe.__;function CIe(e,t){yIe.__h&&yIe.__h(dIe,e,bIe||t),bIe=0;var n=dIe.__H||(dIe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function PIe(e){return bIe=1,_Ie(FIe,e)}function _Ie(e,t,n){var r=CIe(uIe++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):FIe(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=dIe,!dIe.u)){var s=function(e,t,n){if(!r.__c.__H)return!0;var s=r.__c.__H.__.filter((function(e){return!!e.__c}));if(s.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var a=!1;return s.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};dIe.u=!0;var i=dIe.shouldComponentUpdate,a=dIe.componentWillUpdate;dIe.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,s(e,t,n),i=r}a&&a.call(this,e,t,n)},dIe.shouldComponentUpdate=s}return r.__N||r.__}function SIe(e,t){var n=CIe(uIe++,4);!yIe.__s&&RIe(n.__H,t)&&(n.__=e,n.i=t,dIe.__h.push(n))}function IIe(e,t){var n=CIe(uIe++,7);return RIe(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function BIe(){for(var e;e=gIe.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(OIe),e.__H.__h.forEach(NIe),e.__H.__h=[]}catch(t){e.__H.__h=[],yIe.__e(t,e.__v)}}yIe.__b=function(e){dIe=null,vIe&&vIe(e)},yIe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),AIe&&AIe(e,t)},yIe.__r=function(e){wIe&&wIe(e),uIe=0;var t=(dIe=e.__c).__H;t&&(hIe===dIe?(t.__h=[],dIe.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(OIe),t.__h.forEach(NIe),t.__h=[],uIe=0)),hIe=dIe},yIe.diffed=function(e){xIe&&xIe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==gIe.push(t)&&pIe===yIe.requestAnimationFrame||((pIe=yIe.requestAnimationFrame)||MIe)(BIe)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),hIe=dIe=null},yIe.__c=function(e,t){t.some((function(e){try{e.__h.forEach(OIe),e.__h=e.__h.filter((function(e){return!e.__||NIe(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],yIe.__e(n,e.__v)}})),kIe&&kIe(e,t)},yIe.unmount=function(e){EIe&&EIe(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{OIe(e)}catch(e){t=e}})),n.__H=void 0,t&&yIe.__e(t,n.__v))};var TIe="function"==typeof requestAnimationFrame;function MIe(e){var t,n=function(){clearTimeout(r),TIe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);TIe&&(t=requestAnimationFrame(n))}function OIe(e){var t=dIe,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),dIe=t}function NIe(e){var t=dIe;e.__c=e.__(),dIe=t}function RIe(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function FIe(e,t){return"function"==typeof t?t(e):t}var jIe=Object.freeze({__proto__:null,useCallback:function(e,t){return bIe=8,IIe((function(){return e}),t)},useContext:function(e){var t=dIe.context[e.__c],n=CIe(uIe++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(dIe)),t.props.value):e.__},useDebugValue:function(e,t){yIe.useDebugValue&&yIe.useDebugValue(t?t(e):e)},useEffect:function(e,t){var n=CIe(uIe++,3);!yIe.__s&&RIe(n.__H,t)&&(n.__=e,n.i=t,dIe.__H.__h.push(n))},useErrorBoundary:function(e){var t=CIe(uIe++,10),n=PIe();return t.__=e,dIe.componentDidCatch||(dIe.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]},useId:function(){var e=CIe(uIe++,11);if(!e.__){for(var t=dIe.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__},useImperativeHandle:function(e,t,n){bIe=6,SIe((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))},useLayoutEffect:SIe,useMemo:IIe,useReducer:_Ie,useRef:function(e){return bIe=5,IIe((function(){return{current:e}}),[])},useState:PIe}),LIe=Ve(jIe),UIe={};Object.defineProperty(UIe,"__esModule",{value:!0}),UIe.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}",function(e){var t=qe&&qe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const n=t(FSe),r=mIe,s=LIe,i=mSe,a=t(UIe);e.Snackbar=class{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=(0,i.isDarkMode)()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){const t=this.nextItemKey++;return this.items.set(t,e),this.render(),()=>{this.items.delete(t),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,r.render)((0,r.h)("div",null,(0,r.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map((([t,n])=>(0,r.h)(e.SnackbarInstance,Object.assign({},n,{key:t})))))),this.root)}};e.SnackbarContainer=e=>(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-container")},(0,r.h)("style",null,a.default),(0,r.h)("div",{class:"-cbwsdk-snackbar"},e.children));e.SnackbarInstance=({autoExpand:e,message:t,menuItems:i})=>{const[a,o]=(0,s.useState)(!0),[c,l]=(0,s.useState)(null!=e&&e);(0,s.useEffect)((()=>{const e=[window.setTimeout((()=>{o(!1)}),1),window.setTimeout((()=>{l(!0)}),1e4)];return()=>{e.forEach(window.clearTimeout)}}));return(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance",a&&"-cbwsdk-snackbar-instance-hidden",c&&"-cbwsdk-snackbar-instance-expanded")},(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{l(!c)}},(0,r.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},t),(0,r.h)("div",{class:"-gear-container"},!c&&(0,r.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,r.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),i&&i.length>0&&(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},i.map(((e,t)=>(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,r.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,r.h)("span",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info))))))}}(xSe),Object.defineProperty(bSe,"__esModule",{value:!0}),bSe.WalletLinkRelayUI=void 0;const DIe=gSe,zIe=xSe;bSe.WalletLinkRelayUI=class{constructor(){this.attached=!1,this.snackbar=new zIe.Snackbar}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.snackbar.attach(t),this.attached=!0,(0,DIe.injectCssReset)()}showConnecting(e){let 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)}};var HIe={},GIe={},qIe={};Object.defineProperty(qIe,"__esModule",{value:!0}),qIe.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var $Ie=qe&&qe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(GIe,"__esModule",{value:!0}),GIe.RedirectDialog=void 0;const VIe=$Ie(FSe),WIe=mIe,ZIe=gSe,QIe=xSe,KIe=mSe,YIe=$Ie(qIe);GIe.RedirectDialog=class{constructor(){this.root=null,this.darkMode=(0,KIe.isDarkMode)()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,ZIe.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,WIe.render)(null,this.root),e&&(0,WIe.render)((0,WIe.h)(JIe,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}};const JIe=({title:e,buttonText:t,darkMode:n,onButtonClick:r,onDismiss:s})=>{const i=n?"dark":"light";return(0,WIe.h)(QIe.SnackbarContainer,{darkMode:n},(0,WIe.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,WIe.h)("style",null,YIe.default),(0,WIe.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,WIe.h)("div",{class:(0,VIe.default)("-cbwsdk-redirect-dialog-box",i)},(0,WIe.h)("p",null,e),(0,WIe.h)("button",{onClick:r},t))))};var XIe={};Object.defineProperty(XIe,"__esModule",{value:!0}),XIe.CBW_MOBILE_DEEPLINK_URL=XIe.WALLETLINK_URL=XIe.CB_KEYS_URL=void 0,XIe.CB_KEYS_URL="https://keys.coinbase.com/connect",XIe.WALLETLINK_URL="https://www.walletlink.org",XIe.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink",Object.defineProperty(HIe,"__esModule",{value:!0}),HIe.WLMobileRelayUI=void 0;const eBe=GIe,tBe=mSe,nBe=XIe;HIe.WLMobileRelayUI=class{constructor(){this.attached=!1,this.redirectDialog=new eBe.RedirectDialog}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const t=new URL(nBe.CBW_MOBILE_DEEPLINK_URL);t.searchParams.append("redirect_url",(0,tBe.getLocation)().href),e&&t.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=t.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout((()=>{this.redirectToCoinbaseWallet(e)}),99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}},Object.defineProperty(NPe,"__esModule",{value:!0}),NPe.WalletLinkRelay=void 0;const rBe=RPe,sBe=TPe,iBe=MPe,aBe=VPe,oBe=Yke,cBe=mSe,lBe=bSe,uBe=HIe,dBe=Uke,hBe=iEe,pBe=_Ee;class fBe{constructor(e){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,cBe.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=e=>{this.isLinked=e;const t=this.storage.getItem(sBe.LOCAL_STORAGE_ADDRESSES_KEY);if(e&&(this._session.linked=e),this.isUnlinkedErrorState=!1,t){const n=t.split(" "),r="true"===this.storage.getItem("IsStandaloneSigning");""===n[0]||e||!this._session.linked||r||(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(e,t)=>{this.storage.setItem(e,t)},this.chainUpdated=(e,t)=>{this.chainCallbackParams.chainId===e&&this.chainCallbackParams.jsonRpcUrl===t||(this.chainCallbackParams={chainId:e,jsonRpcUrl:t},this.chainCallback&&this.chainCallback(e,t))},this.accountUpdated=e=>{this.accountsCallback&&this.accountsCallback([e]),fBe.accountRequestCallbackIds.size>0&&(Array.from(fBe.accountRequestCallbackIds.values()).forEach((t=>{const n={type:"WEB3_RESPONSE",id:t,response:{method:"requestEthereumAccounts",result:[e]}};this.invokeCallback(Object.assign(Object.assign({},n),{id:t}))})),fBe.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage;const{session:t,ui:n,connection:r}=this.subscribe();this._session=t,this.connection=r,this.relayEventManager=new iBe.RelayEventManager,this.ui=n}subscribe(){const e=aBe.WalletLinkSession.load(this.storage)||new aBe.WalletLinkSession(this.storage).save(),{linkAPIUrl:t}=this,n=new rBe.WalletLinkConnection({session:e,linkAPIUrl:t,listener:this}),r=this.isMobileWeb?new uBe.WLMobileRelayUI:new lBe.WalletLinkRelayUI;return n.connect(),{session:e,ui:r,connection:n}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise((e=>setTimeout((()=>e(null)),1e3)))]).then((()=>{this.connection.destroy();const e=aBe.WalletLinkSession.load(this.storage);(null==e?void 0:e.id)===this._session.id&&pBe.ScopedLocalStorage.clearAll(),document.location.reload()})).catch((e=>{}))}setAppInfo(e,t){this.appName=e,this.appLogoUrl=t}getStorageItem(e){return this.storage.getItem(e)}setStorageItem(e,t){this.storage.setItem(e,t)}signEthereumMessage(e,t,n,r){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,hBe.hexStringFromBuffer)(e,!0),address:t,addPrefix:n,typedDataJson:r||null}})}ethereumAddressFromSignedMessage(e,t,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,hBe.hexStringFromBuffer)(e,!0),signature:(0,hBe.hexStringFromBuffer)(t,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,hBe.bigIntStringFromBigInt)(e.weiValue),data:(0,hBe.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,hBe.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,hBe.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,hBe.bigIntStringFromBigInt)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,hBe.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,hBe.bigIntStringFromBigInt)(e.weiValue),data:(0,hBe.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,hBe.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,hBe.bigIntStringFromBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,hBe.bigIntStringFromBigInt)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,hBe.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,hBe.hexStringFromBuffer)(e,!0),chainId:t}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getWalletLinkSession(){return this._session}genericRequest(e,t){return this.sendRequest({method:"generic",params:{action:t,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let t=null;const n=(0,hBe.randomBytesHex)(8),r=r=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,r),null==t||t()};return new Promise(((s,i)=>{t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:r,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,(e=>{if(null==t||t(),(0,oBe.isErrorResponse)(e))return i(new Error(e.errorMessage));s(e)})),this.publishWeb3RequestEvent(n,e)}))}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e}publishWeb3RequestEvent(e,t){const n={type:"WEB3_REQUEST",id:e,request:t};this.publishEvent("Web3Request",n,!0).then((e=>{})).catch((e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n.id,response:{method:t.method,errorMessage:e.message}})})),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(t.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof uBe.WLMobileRelayUI)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",(()=>{window.addEventListener("focus",(()=>{this.connection.checkUnseenEvents()}),{once:!0})}),{once:!0}),this.ui.openCoinbaseWalletDeeplink()}}publishWeb3RequestCanceledEvent(e){const t={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",t,!1).then()}publishEvent(e,t,n){return this.connection.publishEvent(e,t,n)}handleWeb3ResponseMessage(e){const{response:t}=e;if("requestEthereumAccounts"===t.method)return fBe.accountRequestCallbackIds.forEach((t=>this.invokeCallback(Object.assign(Object.assign({},e),{id:t})))),void fBe.accountRequestCallbackIds.clear();this.invokeCallback(e)}handleErrorResponse(e,t,n){var r;const s=null!==(r=null==n?void 0:n.message)&&void 0!==r?r:"Unspecified error message.";this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:t,errorMessage:s}})}invokeCallback(e){const t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},t=(0,hBe.randomBytesHex)(8);return new Promise(((n,r)=>{this.relayEventManager.callbacks.set(t,(e=>{if((0,oBe.isErrorResponse)(e))return r(new Error(e.errorMessage));n(e)})),fBe.accountRequestCallbackIds.add(t),this.publishWeb3RequestEvent(t,e)}))}watchAsset(e,t,n,r,s,i){const a={method:"watchAsset",params:{type:e,options:{address:t,symbol:n,decimals:r,image:s},chainId:i}};let o=null;const c=(0,hBe.randomBytesHex)(8),l=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,a.method,e),null==o||o()};return o=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}),new Promise(((e,t)=>{this.relayEventManager.callbacks.set(c,(n=>{if(null==o||o(),(0,oBe.isErrorResponse)(n))return t(new Error(n.errorMessage));e(n)})),this.publishWeb3RequestEvent(c,a)}))}addEthereumChain(e,t,n,r,s,i){const a={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:r,chainName:s,iconUrls:n,nativeCurrency:i}};let o=null;const c=(0,hBe.randomBytesHex)(8),l=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,a.method,e),null==o||o()};return o=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}),new Promise(((e,t)=>{this.relayEventManager.callbacks.set(c,(n=>{if(null==o||o(),(0,oBe.isErrorResponse)(n))return t(new Error(n.errorMessage));e(n)})),this.publishWeb3RequestEvent(c,a)}))}switchEthereumChain(e,t){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})},r=(0,hBe.randomBytesHex)(8);return new Promise(((e,t)=>{this.relayEventManager.callbacks.set(r,(n=>(0,oBe.isErrorResponse)(n)&&n.errorCode?t(dBe.standardErrors.provider.custom({code:n.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):(0,oBe.isErrorResponse)(n)?t(new Error(n.errorMessage)):void e(n))),this.publishWeb3RequestEvent(r,n)}))}}NPe.WalletLinkRelay=fBe,fBe.accountRequestCallbackIds=new Set;var mBe=qe&&qe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($Ee,"__esModule",{value:!0}),$Ee.WalletLinkSigner=void 0;const bBe=mBe(BPe),gBe=TPe,yBe=MPe,vBe=Yke,wBe=NPe,xBe=XIe,kBe=Uke,EBe=iEe,ABe=_Ee,CBe="DefaultChainId",PBe="DefaultJsonRpcUrl";$Ee.WalletLinkSigner=class{constructor(e){var t,n;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;const{appName:r,appLogoUrl:s}=e.metadata;this._appName=r,this._appLogoUrl=s,this._storage=new ABe.ScopedLocalStorage("walletlink",xBe.WALLETLINK_URL),this.updateListener=e.updateListener,this._relayEventManager=new yBe.RelayEventManager,this._jsonRpcUrlFromOpts="";const i=this._storage.getItem(gBe.LOCAL_STORAGE_ADDRESSES_KEY);if(i){const e=i.split(" ");""!==e[0]&&(this._addresses=e.map((e=>(0,EBe.ensureAddressString)(e))),null===(t=this.updateListener)||void 0===t||t.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(CBe)&&(null===(n=this.updateListener)||void 0===n||n.onChainUpdate({chain:{id:this.getChainId(),rpcUrl:this.jsonRpcUrl},source:"storage"}),this.hasMadeFirstChainChangedEmission=!0),this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:t,secret:n}=e.getWalletLinkSession();return{id:t,secret:n}}async handshake(){return await this.request({method:"eth_requestAccounts"})}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return null!==(e=this._storage.getItem(PBe))&&void 0!==e?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(PBe,e)}updateProviderInfo(e,t){var n;this.jsonRpcUrl=e;const r=this.getChainId();this._storage.setItem(CBe,t.toString(10));!((0,EBe.ensureIntNumber)(t)!==r)&&this.hasMadeFirstChainChangedEmission||(null===(n=this.updateListener)||void 0===n||n.onChainUpdate({chain:{id:t,rpcUrl:e},source:"wallet"}),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,t,n,r,s,i){const a=this.initializeRelay(),o=await a.watchAsset(e,t,n,r,s,null==i?void 0:i.toString());return!(0,vBe.isErrorResponse)(o)&&!!o.result}async addEthereumChain(e,t,n,r,s,i){var a,o;if((0,EBe.ensureIntNumber)(e)===this.getChainId())return!1;const c=this.initializeRelay();this._isAuthorized()||await c.requestEthereumAccounts();const l=await c.addEthereumChain(e.toString(),t,s,n,r,i);return!(0,vBe.isErrorResponse)(l)&&(!0===(null===(a=l.result)||void 0===a?void 0:a.isApproved)&&this.updateProviderInfo(t[0],e),!0===(null===(o=l.result)||void 0===o?void 0:o.isApproved))}async switchEthereumChain(e){const t=this.initializeRelay(),n=await t.switchEthereumChain(e.toString(10),this.selectedAddress||void 0);if((0,vBe.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===kBe.standardErrorCodes.provider.unsupportedChain?kBe.standardErrors.provider.unsupportedChain():kBe.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const r=n.result;r.isApproved&&r.rpcUrl.length>0&&this.updateProviderInfo(r.rpcUrl,e)}async disconnect(){this._relay&&this._relay.resetAndReload(),this._storage.clear()}async request(e){try{return this._request(e).catch((e=>{throw e}))}catch(e){return Promise.reject(e)}}async _request(e){if(!e||"object"!=typeof e||Array.isArray(e))throw kBe.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:t,params:n}=e;if("string"!=typeof t||0===t.length)throw kBe.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(void 0!==n&&!Array.isArray(n)&&("object"!=typeof n||null===n))throw kBe.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const r=void 0===n?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:t,params:r,jsonrpc:"2.0",id:s})).result}_setAddresses(e,t){var n;if(!Array.isArray(e))throw new Error("addresses is not an array");const r=e.map((e=>(0,EBe.ensureAddressString)(e)));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses=r,null===(n=this.updateListener)||void 0===n||n.onAccountsUpdate({accounts:r,source:"wallet"}),this._storage.setItem(gBe.LOCAL_STORAGE_ADDRESSES_KEY,r.join(" ")))}_sendRequestAsync(e){return new Promise(((t,n)=>{try{const n=this._handleSynchronousMethods(e);if(void 0!==n)return t({jsonrpc:"2.0",id:e.id,result:n})}catch(e){return n(e)}this._handleAsynchronousMethods(e).then((n=>n&&t(Object.assign(Object.assign({},n),{id:e.id})))).catch((e=>n(e)))}))}_handleSynchronousMethods(e){const{method:t}=e;switch(t){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:t}=e,n=e.params||[];switch(t){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":default:return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}}_isKnownAddress(e){try{const t=(0,EBe.ensureAddressString)(e);return this._addresses.map((e=>(0,EBe.ensureAddressString)(e))).includes(t)}catch(e){}return!1}_ensureKnownAddress(e){if(!this._isKnownAddress(e))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const t=e.from?(0,EBe.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(t);return{fromAddress:t,toAddress:e.to?(0,EBe.ensureAddressString)(e.to):null,weiValue:null!=e.value?(0,EBe.ensureBigInt)(e.value):BigInt(0),data:e.data?(0,EBe.ensureBuffer)(e.data):lX.alloc(0),nonce:null!=e.nonce?(0,EBe.ensureIntNumber)(e.nonce):null,gasPriceInWei:null!=e.gasPrice?(0,EBe.ensureBigInt)(e.gasPrice):null,maxFeePerGas:null!=e.maxFeePerGas?(0,EBe.ensureBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?(0,EBe.ensureBigInt)(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?(0,EBe.ensureBigInt)(e.gas):null,chainId:e.chainId?(0,EBe.ensureIntNumber)(e.chainId):this.getChainId()}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw kBe.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw kBe.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,t,n,r){this._ensureKnownAddress(t);try{const s=this.initializeRelay(),i=await s.signEthereumMessage(e,t,n,r);if((0,vBe.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw kBe.standardErrors.provider.userRejectedRequest("User denied message signature");throw e}}async _ethereumAddressFromSignedMessage(e,t,n){const r=this.initializeRelay(),s=await r.ethereumAddressFromSignedMessage(e,t,n);if((0,vBe.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,EBe.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(CBe);if(!e)return(0,EBe.ensureIntNumber)(1);const t=parseInt(e,10);return(0,EBe.ensureIntNumber)(t)}async _eth_requestAccounts(){if(this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{const t=this.initializeRelay();if(e=await t.requestEthereumAccounts(),(0,vBe.isErrorResponse)(e))throw new Error(e.errorMessage)}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw kBe.standardErrors.provider.userRejectedRequest("User denied account authorization");throw e}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const t=(0,EBe.ensureAddressString)(e[0]),n=(0,EBe.ensureBuffer)(e[1]);return this._signEthereumMessage(n,t,!1)}_eth_ecRecover(e){const t=(0,EBe.ensureBuffer)(e[0]),n=(0,EBe.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!1)}_personal_sign(e){this._requireAuthorization();const t=(0,EBe.ensureBuffer)(e[0]),n=(0,EBe.ensureAddressString)(e[1]);return this._signEthereumMessage(t,n,!0)}_personal_ecRecover(e){const t=(0,EBe.ensureBuffer)(e[0]),n=(0,EBe.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const e=this.initializeRelay(),n=await e.signEthereumTransaction(t);if((0,vBe.isErrorResponse)(n))throw new Error(n.errorMessage);return{jsonrpc:"2.0",id:0,result:n.result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw kBe.standardErrors.provider.userRejectedRequest("User denied transaction signature");throw e}}async _eth_sendRawTransaction(e){const t=(0,EBe.ensureBuffer)(e[0]),n=this.initializeRelay(),r=await n.submitEthereumTransaction(t,this.getChainId());if((0,vBe.isErrorResponse)(r))throw new Error(r.errorMessage);return{jsonrpc:"2.0",id:0,result:r.result}}async _eth_sendTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const e=this.initializeRelay(),n=await e.signAndSubmitEthereumTransaction(t);if((0,vBe.isErrorResponse)(n))throw new Error(n.errorMessage);return{jsonrpc:"2.0",id:0,result:n.result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw kBe.standardErrors.provider.userRejectedRequest("User denied transaction signature");throw e}}async _eth_signTypedData_v1(e){this._requireAuthorization();const t=(0,EBe.ensureParsedJSONObject)(e[0]),n=(0,EBe.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const r=bBe.default.hashForSignTypedDataLegacy({data:t}),s=JSON.stringify(t,null,2);return this._signEthereumMessage(r,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const t=(0,EBe.ensureAddressString)(e[0]),n=(0,EBe.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const r=bBe.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(r,t,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const t=(0,EBe.ensureAddressString)(e[0]),n=(0,EBe.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const r=bBe.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(r,t,!1,s)}async _wallet_addEthereumChain(e){var t,n,r,s;const i=e[0];if(0===(null===(t=i.rpcUrls)||void 0===t?void 0:t.length))return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!i.chainName||""===i.chainName.trim())throw kBe.standardErrors.rpc.invalidParams("chainName is a required field");if(!i.nativeCurrency)throw kBe.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(i.chainId,16);return await this.addEthereumChain(a,null!==(n=i.rpcUrls)&&void 0!==n?n:[],null!==(r=i.blockExplorerUrls)&&void 0!==r?r:[],i.chainName,null!==(s=i.iconUrls)&&void 0!==s?s:[],i.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const t=e[0];return await this.switchEthereumChain(parseInt(t.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const t=Array.isArray(e)?e[0]:e;if(!t.type)throw kBe.standardErrors.rpc.invalidParams("Type is required");if("ERC20"!==(null==t?void 0:t.type))throw kBe.standardErrors.rpc.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(null==t?void 0:t.options))throw kBe.standardErrors.rpc.invalidParams("Options are required");if(!(null==t?void 0:t.options.address))throw kBe.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:r,symbol:s,image:i,decimals:a}=t.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(t.type,r,s,a,i,n)}}initializeRelay(){if(!this._relay){const e=new wBe.WalletLinkRelay({linkAPIUrl:xBe.WALLETLINK_URL,storage:this._storage});e.setAppInfo(this._appName,this._appLogoUrl),e.attachUI(),e.setAccountsCallback(((e,t)=>this._setAddresses(e,t))),e.setChainCallback(((e,t)=>{this.updateProviderInfo(t,parseInt(e,10))})),this._relay=e}return this._relay}};var _Be={};Object.defineProperty(_Be,"__esModule",{value:!0}),_Be.checkErrorForInvalidRequestArgs=_Be.getCoinbaseInjectedProvider=_Be.getCoinbaseInjectedSigner=_Be.fetchRPCRequest=void 0;const SBe=Jke,IBe=Uke;function BBe(){return globalThis.coinbaseWalletSigner}_Be.fetchRPCRequest=async function(e,t){if(!t.rpcUrl)throw IBe.standardErrors.rpc.internal("No RPC URL set for chain");const n=Object.assign(Object.assign({},e),{jsonrpc:"2.0",id:crypto.randomUUID()}),r=await window.fetch(t.rpcUrl,{method:"POST",body:JSON.stringify(n),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":SBe.LIB_VERSION}});return(await r.json()).result},_Be.getCoinbaseInjectedSigner=BBe,_Be.getCoinbaseInjectedProvider=function({metadata:e,preference:t}){var n,r,s;const i=globalThis;if("smartWalletOnly"!==t.options){if(BBe())return;const t=i.coinbaseWalletExtension;if(t){const{appName:r,appLogoUrl:s,appChainIds:i}=e;return null===(n=t.setAppInfo)||void 0===n||n.call(t,r,s,i),t}}const a=null!==(r=i.ethereum)&&void 0!==r?r:null===(s=i.top)||void 0===s?void 0:s.ethereum;if(null==a?void 0:a.isCoinbaseBrowser)return a},_Be.checkErrorForInvalidRequestArgs=function(e){if(!e||"object"!=typeof e||Array.isArray(e))return IBe.standardErrors.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:e});const{method:t,params:n}=e;return"string"!=typeof t||0===t.length?IBe.standardErrors.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:e}):void 0===n||Array.isArray(n)||"object"==typeof n&&null!==n?void 0:IBe.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:e})},Object.defineProperty(vEe,"__esModule",{value:!0}),vEe.createSigner=vEe.fetchSignerType=vEe.storeSignerType=vEe.loadSignerType=void 0;const TBe=wEe,MBe=$Ee,OBe=Uke,NBe=_Be,RBe="SignerType",FBe=new _Ee.ScopedLocalStorage("CBWSDK","SignerConfigurator");vEe.loadSignerType=function(){return FBe.getItem(RBe)},vEe.storeSignerType=function(e){FBe.setItem(RBe,e)},vEe.fetchSignerType=async function(e){const{communicator:t,metadata:n}=e;(async function(e,t){await e.onMessage((({event:e})=>"WalletLinkSessionRequest"===e));const n=new MBe.WalletLinkSigner({metadata:t});e.postMessage({event:"WalletLinkUpdate",data:{session:n.getSession()}}),await n.handshake(),e.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})})(t,n).catch((()=>{}));const r={id:crypto.randomUUID(),event:"selectSignerType",data:e.preference},{data:s}=await t.postRequestAndWaitForResponse(r);return s},vEe.createSigner=function(e){const{signerType:t,metadata:n,communicator:r,updateListener:s}=e;switch(t){case"scw":return new TBe.SCWSigner({metadata:n,updateListener:s,communicator:r});case"walletlink":return new MBe.WalletLinkSigner({metadata:n,updateListener:s});case"extension":{const e=(0,NBe.getCoinbaseInjectedSigner)();if(!e)throw OBe.standardErrors.rpc.internal("injected signer not found");return e}}};var jBe={},LBe={};Object.defineProperty(LBe,"__esModule",{value:!0}),LBe.closePopup=LBe.openPopup=void 0;const UBe=Uke;LBe.openPopup=function(e){const t=(window.innerWidth-420)/2+window.screenX,n=(window.innerHeight-540)/2+window.screenY,r=window.open(e,"Smart Wallet",`width=420, height=540, left=${t}, top=${n}`);if(null==r||r.focus(),!r)throw UBe.standardErrors.rpc.internal("Pop up window failed to open");return r},LBe.closePopup=function(e){e&&!e.closed&&e.close()},Object.defineProperty(jBe,"__esModule",{value:!0}),jBe.Communicator=void 0;const DBe=Jke,zBe=LBe,HBe=XIe,GBe=Uke;jBe.Communicator=class{constructor(e=HBe.CB_KEYS_URL){this.popup=null,this.listeners=new Map,this.postMessage=async e=>{(await this.waitForPopupLoaded()).postMessage(e,this.url.origin)},this.postRequestAndWaitForResponse=async e=>{const t=this.onMessage((({requestId:t})=>t===e.id));return this.postMessage(e),await t},this.onMessage=async e=>new Promise(((t,n)=>{const r=n=>{if(n.origin!==this.url.origin)return;const s=n.data;e(s)&&(t(s),window.removeEventListener("message",r),this.listeners.delete(r))};window.addEventListener("message",r),this.listeners.set(r,{reject:n})})),this.disconnect=()=>{(0,zBe.closePopup)(this.popup),this.popup=null,this.listeners.forEach((({reject:e},t)=>{e(GBe.standardErrors.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",t)})),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?this.popup:(this.popup=(0,zBe.openPopup)(this.url),this.onMessage((({event:e})=>"PopupUnload"===e)).then(this.disconnect).catch((()=>{})),this.onMessage((({event:e})=>"PopupLoaded"===e)).then((e=>{this.postMessage({requestId:e.id,data:{version:DBe.LIB_VERSION}})})).then((()=>{if(!this.popup)throw GBe.standardErrors.rpc.internal();return this.popup}))),this.url=new URL(e)}};var qBe={};Object.defineProperty(qBe,"__esModule",{value:!0}),qBe.determineMethodCategory=void 0;const $Be={handshake:["eth_requestAccounts"],sign:["eth_ecRecover","personal_sign","personal_ecRecover","eth_signTransaction","eth_sendTransaction","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTypedData","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus"],state:["eth_chainId","eth_accounts","eth_coinbase","net_version"],deprecated:["eth_sign","eth_signTypedData_v2"],unsupported:["eth_subscribe","eth_unsubscribe"],fetch:[]};qBe.determineMethodCategory=function(e){for(const t in $Be){const n=t;if($Be[n].includes(e))return n}};var VBe=qe&&qe.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s{try{if(this.connected)return this.emit("connect",{chainId:(0,JBe.hexStringFromIntNumber)((0,YBe.IntNumber)(this.chain.id))}),this.accounts;const e=await this.requestSignerSelection(),t=this.initSigner(e),n=await t.handshake();return this.signer=t,(0,XBe.storeSignerType)(e),this.emit("connect",{chainId:(0,JBe.hexStringFromIntNumber)((0,YBe.IntNumber)(this.chain.id))}),n}catch(e){throw this.handleUnauthorizedError(e),e}},sign:async e=>{if(!this.connected||!this.signer)throw QBe.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");try{return await this.signer.request(e)}catch(e){throw this.handleUnauthorizedError(e),e}},fetch:e=>(0,eTe.fetchRPCRequest)(e,this.chain),state:e=>{const t=()=>{if(this.connected)return this.accounts;throw QBe.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(e.method){case"eth_chainId":return(0,JBe.hexStringFromIntNumber)((0,YBe.IntNumber)(this.chain.id));case"net_version":return this.chain.id;case"eth_accounts":return t();case"eth_coinbase":return t()[0];default:return this.handlers.unsupported(e)}},deprecated:({method:e})=>{throw QBe.standardErrors.rpc.methodNotSupported(`Method ${e} is deprecated.`)},unsupported:({method:e})=>{throw QBe.standardErrors.rpc.methodNotSupported(`Method ${e} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:e,source:t})=>{(0,JBe.areAddressArraysEqual)(this.accounts,e)||(this.accounts=e,"storage"!==t&&this.emit("accountsChanged",this.accounts))},onChainUpdate:({chain:e,source:t})=>{e.id===this.chain.id&&e.rpcUrl===this.chain.rpcUrl||(this.chain=e,"storage"!==t&&this.emit("chainChanged",(0,JBe.hexStringFromIntNumber)((0,YBe.IntNumber)(e.id))))}},this.metadata=r,this.preference=a,this.communicator=new tTe.Communicator(i),this.chain={id:null!==(n=null===(t=r.appChainIds)||void 0===t?void 0:t[0])&&void 0!==n?n:1};const o=(0,XBe.loadSignerType)();this.signer=o?this.initSigner(o):null}get connected(){return this.accounts.length>0}async request(e){var t;try{const n=(0,eTe.checkErrorForInvalidRequestArgs)(e);if(n)throw n;const r=null!==(t=(0,nTe.determineMethodCategory)(e.method))&&void 0!==t?t:"fetch";return this.handlers[r](e)}catch(t){return Promise.reject((0,KBe.serializeError)(t,e.method))}}handleUnauthorizedError(e){e.code===QBe.standardErrorCodes.provider.unauthorized&&this.disconnect()}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){this.accounts=[],this.chain={id:1},rTe.ScopedLocalStorage.clearAll(),this.emit("disconnect",QBe.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,XBe.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(e){return(0,XBe.createSigner)({signerType:e,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}}Lke.CoinbaseWalletProvider=sTe,Object.defineProperty(Fke,"__esModule",{value:!0}),Fke.CoinbaseWalletSDK=void 0;const iTe=jke,aTe=Lke,oTe=_Ee,cTe=Jke,lTe=iEe,uTe=_Be;Fke.CoinbaseWalletSDK=class{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||(0,lTe.getFavicon)(),appChainIds:e.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(e={options:"all"}){var t;const n={metadata:this.metadata,preference:e};return null!==(t=(0,uTe.getCoinbaseInjectedProvider)(n))&&void 0!==t?t:new aTe.CoinbaseWalletProvider(n)}getCoinbaseWalletLogo(e,t=240){return(0,iTe.walletLogo)(e,t)}storeLatestVersion(){new oTe.ScopedLocalStorage("CBWSDK").setItem("VERSION",cTe.LIB_VERSION)}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletSDK=void 0;const t=Fke;e.default=t.CoinbaseWalletSDK;var n=Fke;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}})}(Rke);var dTe=$e(Rke),hTe=Object.freeze({__proto__:null,default:dTe}),pTe=Object.freeze({__proto__:null,default:'\n\n\n'});class fTe extends Loe{constructor({callbackSelector:e,cause:t,data:n,extraData:r,sender:s,urls:i}){super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],t.metaMessages?.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map((e=>` ${e}`))],` Sender: ${s}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${r}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class mTe extends Loe{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${t}`,`Response: ${jhe(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class bTe extends Loe{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}const gTe={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function yTe({data:e,sender:t,urls:n}){let r=new Error("An unknown error occurred.");for(let s=0;s