diff --git a/esprit-woo/.gitignore b/esprit-woo/.gitignore index db441cf..8e606cd 100644 --- a/esprit-woo/.gitignore +++ b/esprit-woo/.gitignore @@ -1,2 +1,3 @@ node_modules/ -old/ \ No newline at end of file +old/ +src/test.html diff --git a/esprit-woo/assets/icon.png b/esprit-woo/assets/icon.png deleted file mode 100644 index 9bdc73f..0000000 Binary files a/esprit-woo/assets/icon.png and /dev/null differ diff --git a/esprit-woo/assets/logosmall.png b/esprit-woo/assets/logosmall.png new file mode 100644 index 0000000..665ba85 --- /dev/null +++ b/esprit-woo/assets/logosmall.png @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/esprit-woo/assets/logosmall.svg b/esprit-woo/assets/logosmall.svg new file mode 100644 index 0000000..d66eb81 --- /dev/null +++ b/esprit-woo/assets/logosmall.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/esprit-woo/build/index.asset.php b/esprit-woo/build/index.asset.php index 2d8eacb..05c3cfb 100644 --- a/esprit-woo/build/index.asset.php +++ b/esprit-woo/build/index.asset.php @@ -1 +1 @@ - array(), 'version' => 'caa9ae0720f92f20607c'); + array(), 'version' => '1f6fbcae425714b61ad3'); diff --git a/esprit-woo/build/index.js b/esprit-woo/build/index.js index 1f336af..4c5188c 100644 --- a/esprit-woo/build/index.js +++ b/esprit-woo/build/index.js @@ -1 +1 @@ -(()=>{var t={987:t=>{"use strict";var e={single_source_shortest_paths:function(t,n,r){var i={},s={};s[n]=0;var o,a,c,h,u,l,d,p=e.PriorityQueue.make();for(p.push(n,0);!p.empty();)for(c in a=(o=p.pop()).value,h=o.cost,u=t[a]||{})u.hasOwnProperty(c)&&(l=h+u[c],d=s[c],(void 0===s[c]||d>l)&&(s[c]=l,p.push(c,l),i[c]=a));if(void 0!==r&&void 0===s[r]){var f=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(f)}return i},extract_shortest_path_from_predecessor_list:function(t,e){for(var n=[],r=e;r;)n.push(r),t[r],r=t[r];return n.reverse(),n},find_path:function(t,n,r){var i=e.single_source_shortest_paths(t,n,r);return e.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var n,r=e.PriorityQueue,i={};for(n in t=t||{},r)r.hasOwnProperty(n)&&(i[n]=r[n]);return i.queue=[],i.sorter=t.sorter||r.default_sorter,i},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=e},378:t=>{"use strict";t.exports=function(t){for(var e=[],n=t.length,r=0;r=55296&&i<=56319&&n>r+1){var s=t.charCodeAt(r+1);s>=56320&&s<=57343&&(i=1024*(i-55296)+s-56320+65536,r+=1)}i<128?e.push(i):i<2048?(e.push(i>>6|192),e.push(63&i|128)):i<55296||i>=57344&&i<65536?(e.push(i>>12|224),e.push(i>>6&63|128),e.push(63&i|128)):i>=65536&&i<=1114111?(e.push(i>>18|240),e.push(i>>12&63|128),e.push(i>>6&63|128),e.push(63&i|128)):e.push(239,191,189)}return new Uint8Array(e).buffer}},606:t=>{var e;window,e=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function __(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)});Object.defineProperty(e,"__esModule",{value:!0});var s=256,o=function(){function t(t){void 0===t&&(t="="),this._paddingCharacter=t}return t.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(8*t+5)/6|0},t.prototype.encode=function(t){for(var e="",n=0;n>>18&63),e+=this._encodeByte(r>>>12&63),e+=this._encodeByte(r>>>6&63),e+=this._encodeByte(r>>>0&63)}var i=t.length-n;return i>0&&(r=t[n]<<16|(2===i?t[n+1]<<8:0),e+=this._encodeByte(r>>>18&63),e+=this._encodeByte(r>>>12&63),e+=2===i?this._encodeByte(r>>>6&63):this._paddingCharacter||"",e+=this._paddingCharacter||""),e},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var e=this._getPaddingLength(t),n=t.length-e,r=new Uint8Array(this.maxDecodedLength(n)),i=0,o=0,a=0,c=0,h=0,u=0,l=0;o>>4,r[i++]=h<<4|u>>>2,r[i++]=u<<6|l,a|=c&s,a|=h&s,a|=u&s,a|=l&s;if(o>>4,a|=c&s,a|=h&s),o>>2,a|=u&s),o>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-15,e+=62-t>>>8&3,String.fromCharCode(e)},t.prototype._decodeChar=function(t){var e=s;return e+=(42-t&t-44)>>>8&-256+t-43+62,e+=(46-t&t-48)>>>8&-256+t-47+63,e+=(47-t&t-58)>>>8&-256+t-48+52,(e+=(64-t&t-91)>>>8&-256+t-65+0)+((96-t&t-123)>>>8&-256+t-97+26)},t.prototype._getPaddingLength=function(t){var e=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)e++;if(t.length<4||e>2)throw new Error("Base64Coder: incorrect padding")}return e},t}();e.Coder=o;var a=new o;e.encode=function(t){return a.encode(t)},e.decode=function(t){return a.decode(t)};var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype._encodeByte=function(t){var e=t;return e+=65,e+=25-t>>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-13,e+=62-t>>>8&49,String.fromCharCode(e)},e.prototype._decodeChar=function(t){var e=s;return e+=(44-t&t-46)>>>8&-256+t-45+62,e+=(94-t&t-96)>>>8&-256+t-95+63,e+=(47-t&t-58)>>>8&-256+t-48+52,(e+=(64-t&t-91)>>>8&-256+t-65+0)+((96-t&t-123)>>>8&-256+t-97+26)},e}(o);e.URLSafeCoder=c;var h=new c;e.encodeURLSafe=function(t){return h.encode(t)},e.decodeURLSafe=function(t){return h.decode(t)},e.encodedLength=function(t){return a.encodedLength(t)},e.maxDecodedLength=function(t){return a.maxDecodedLength(t)},e.decodedLength=function(t){return a.decodedLength(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="utf8: invalid string",i="utf8: invalid source encoding";function s(t){for(var e=0,n=0;n=t.length-1)throw new Error(r);n++,e+=4}}return e}e.encode=function(t){for(var e=new Uint8Array(s(t)),n=0,r=0;r>6,e[n++]=128|63&i):i<55296?(e[n++]=224|i>>12,e[n++]=128|i>>6&63,e[n++]=128|63&i):(r++,i=(1023&i)<<10,i|=1023&t.charCodeAt(r),i+=65536,e[n++]=240|i>>18,e[n++]=128|i>>12&63,e[n++]=128|i>>6&63,e[n++]=128|63&i)}return e},e.encodedLength=s,e.decode=function(t){for(var e=[],n=0;n=t.length)throw new Error(i);if(128!=(192&(o=t[++n])))throw new Error(i);r=(31&r)<<6|63&o,s=128}else if(r<240){if(n>=t.length-1)throw new Error(i);var o=t[++n],a=t[++n];if(128!=(192&o)||128!=(192&a))throw new Error(i);r=(15&r)<<12|(63&o)<<6|63&a,s=2048}else{if(!(r<248))throw new Error(i);if(n>=t.length-2)throw new Error(i);o=t[++n],a=t[++n];var c=t[++n];if(128!=(192&o)||128!=(192&a)||128!=(192&c))throw new Error(i);r=(15&r)<<18|(63&o)<<12|(63&a)<<6|63&c,s=65536}if(r=55296&&r<=57343)throw new Error(i);if(r>=65536){if(r>1114111)throw new Error(i);r-=65536,e.push(String.fromCharCode(55296|r>>10)),r=56320|1023&r}}e.push(String.fromCharCode(r))}return e.join("")}},function(t,e,n){t.exports=n(3).default},function(t,e,n){"use strict";n.r(e);class r{constructor(t,e){this.lastId=0,this.prefix=t,this.name=e}create(t){this.lastId++;var e=this.lastId,n=this.prefix+e,r=this.name+"["+e+"]",i=!1,s=function(){i||(t.apply(null,arguments),i=!0)};return this[e]=s,{number:e,id:n,name:r,callback:s}}remove(t){delete this[t.number]}}var i=new r("_pusher_script_","Pusher.ScriptReceivers"),s={VERSION:"8.4.0-rc2",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},o=new r("_pusher_dependencies","Pusher.DependenciesReceivers"),a=new class{constructor(t){this.options=t,this.receivers=t.receivers||i,this.loading={}}load(t,e,n){var r=this;if(r.loading[t]&&r.loading[t].length>0)r.loading[t].push(n);else{r.loading[t]=[n];var i=oe.createScriptRequest(r.getPath(t,e)),s=r.receivers.create((function(e){if(r.receivers.remove(s),r.loading[t]){var n=r.loading[t];delete r.loading[t];for(var o=function(t){t||i.cleanup()},a=0;a>>6)+C(128|63&e):C(224|e>>>12&15)+C(128|e>>>6&63)+C(128|63&e)},E=function(t){return t.replace(/[^\x00-\x7F]/g,k)},P=function(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[S.charAt(n>>>18),S.charAt(n>>>12&63),e>=2?"=":S.charAt(n>>>6&63),e>=1?"=":S.charAt(63&n)].join("")},A=window.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,P)},x=class{constructor(t,e,n,r){this.clear=e,this.timer=t((()=>{this.timer&&(this.timer=r(this.timer))}),n)}isRunning(){return null!==this.timer}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}};function I(t){window.clearTimeout(t)}function R(t){window.clearInterval(t)}class L extends x{constructor(t,e){super(setTimeout,I,t,(function(t){return e(),null}))}}class O extends x{constructor(t,e){super(setInterval,R,t,(function(t){return e(),t}))}}var N={now:()=>Date.now?Date.now():(new Date).valueOf(),defer:t=>new L(0,t),method(t,...e){var n=Array.prototype.slice.call(arguments,1);return function(e){return e[t].apply(e,n.concat(arguments))}}},M=N;function U(t,...e){for(var n=0;n{window.console&&window.console.log&&window.console.log(t)}}debug(...t){this.log(this.globalLog,t)}warn(...t){this.log(this.globalLogWarn,t)}error(...t){this.log(this.globalLogError,t)}globalLogWarn(t){window.console&&window.console.warn?window.console.warn(t):this.globalLog(t)}globalLogError(t){window.console&&window.console.error?window.console.error(t):this.globalLogWarn(t)}log(t,...e){var n=B.apply(this,arguments);Ae.log?Ae.log(n):Ae.logToConsole&&t.bind(this)(n)}},K=function(t,e,n,r,i){void 0===n.headers&&null==n.headersProvider||Y.warn(`To send headers with the ${r.toString()} request, you must use AJAX, rather than JSONP.`);var s=t.nextAuthCallbackID.toString();t.nextAuthCallbackID++;var o=t.getDocument(),a=o.createElement("script");t.auth_callbacks[s]=function(t){i(null,t)};var c="Pusher.auth_callbacks['"+s+"']";a.src=n.endpoint+"?callback="+encodeURIComponent(c)+"&"+e;var h=o.getElementsByTagName("head")[0]||o.documentElement;h.insertBefore(a,h.firstChild)};class W{constructor(t){this.src=t}send(t){var e=this,n="Error loading "+e.src;e.script=document.createElement("script"),e.script.id=t.id,e.script.src=e.src,e.script.type="text/javascript",e.script.charset="UTF-8",e.script.addEventListener?(e.script.onerror=function(){t.callback(n)},e.script.onload=function(){t.callback(null)}):e.script.onreadystatechange=function(){"loaded"!==e.script.readyState&&"complete"!==e.script.readyState||t.callback(null)},void 0===e.script.async&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(e.errorScript=document.createElement("script"),e.errorScript.id=t.id+"_error",e.errorScript.text=t.name+"('"+n+"');",e.script.async=e.errorScript.async=!1):e.script.async=!0;var r=document.getElementsByTagName("head")[0];r.insertBefore(e.script,r.firstChild),e.errorScript&&r.insertBefore(e.errorScript,e.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class Q{constructor(t,e){this.url=t,this.data=e}send(t){if(!this.request){var e=X(this.data),n=this.url+"/"+t.number+"?"+e;this.request=oe.createScriptRequest(n),this.request.send(t)}}cleanup(){this.request&&this.request.cleanup()}}var G={name:"jsonp",getAgent:function(t,e){return function(n,r){var s="http"+(e?"s":"")+"://"+(t.host||t.options.host)+t.options.path,o=oe.createJSONPRequest(s,n),a=oe.ScriptReceivers.create((function(e,n){i.remove(a),o.cleanup(),n&&n.host&&(t.host=n.host),r&&r(e,n)}));o.send(a)}}};function Z(t,e,n){return t+(e.useTLS?"s":"")+"://"+(e.useTLS?e.hostTLS:e.hostNonTLS)+n}function tt(t,e){return"/app/"+t+"?protocol="+s.PROTOCOL+"&client=js&version="+s.VERSION+(e?"&"+e:"")}var et={getInitial:function(t,e){return Z("ws",e,(e.httpPath||"")+tt(t,"flash=false"))}},nt={getInitial:function(t,e){return Z("http",e,(e.httpPath||"/pusher")+tt(t))}},rt={getInitial:function(t,e){return Z("http",e,e.httpPath||"/pusher")},getPath:function(t,e){return tt(t)}};class it{constructor(){this._callbacks={}}get(t){return this._callbacks[st(t)]}add(t,e,n){var r=st(t);this._callbacks[r]=this._callbacks[r]||[],this._callbacks[r].push({fn:e,context:n})}remove(t,e,n){if(t||e||n){var r=t?[st(t)]:H(this._callbacks);e||n?this.removeCallback(r,e,n):this.removeAllCallbacks(r)}else this._callbacks={}}removeCallback(t,e,n){z(t,(function(t){this._callbacks[t]=F(this._callbacks[t]||[],(function(t){return e&&e!==t.fn||n&&n!==t.context})),0===this._callbacks[t].length&&delete this._callbacks[t]}),this)}removeAllCallbacks(t){z(t,(function(t){delete this._callbacks[t]}),this)}}function st(t){return"_"+t}class ot{constructor(t){this.callbacks=new it,this.global_callbacks=[],this.failThrough=t}bind(t,e,n){return this.callbacks.add(t,e,n),this}bind_global(t){return this.global_callbacks.push(t),this}unbind(t,e,n){return this.callbacks.remove(t,e,n),this}unbind_global(t){return t?(this.global_callbacks=F(this.global_callbacks||[],(e=>e!==t)),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(t,e,n){for(var r=0;r0)for(r=0;r{this.onError(t),this.changeState("closed")})),!1}return this.bindListeners(),Y.debug("Connecting",{transport:this.name,url:t}),this.changeState("connecting"),!0}close(){return!!this.socket&&(this.socket.close(),!0)}send(t){return"open"===this.state&&(M.defer((()=>{this.socket&&this.socket.send(t)})),!0)}ping(){"open"===this.state&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(t){this.emit("error",{type:"WebSocketError",error:t}),this.timeline.error(this.buildTimelineMessage({error:t.toString()}))}onClose(t){t?this.changeState("closed",{code:t.code,reason:t.reason,wasClean:t.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(t){this.emit("message",t)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=t=>{this.onError(t)},this.socket.onclose=t=>{this.onClose(t)},this.socket.onmessage=t=>{this.onMessage(t)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(t,e){this.state=t,this.timeline.info(this.buildTimelineMessage({state:t,params:e})),this.emit(t,e)}buildTimelineMessage(t){return U({cid:this.id},t)}}class ct{constructor(t){this.hooks=t}isSupported(t){return this.hooks.isSupported(t)}createConnection(t,e,n,r){return new at(this.hooks,t,e,n,r)}}var ht=new ct({urls:et,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return Boolean(oe.getWebSocketAPI())},isSupported:function(){return Boolean(oe.getWebSocketAPI())},getSocket:function(t){return oe.createWebSocket(t)}}),ut={urls:nt,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},lt=U({getSocket:function(t){return oe.HTTPFactory.createStreamingSocket(t)}},ut),dt=U({getSocket:function(t){return oe.HTTPFactory.createPollingSocket(t)}},ut),pt={isSupported:function(){return oe.isXHRSupported()}},ft={ws:ht,xhr_streaming:new ct(U({},lt,pt)),xhr_polling:new ct(U({},dt,pt))},gt=new ct({file:"sockjs",urls:rt,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return void 0!==window.SockJS},getSocket:function(t,e){return new window.SockJS(t,null,{js_path:a.getPath("sockjs",{useTLS:e.useTLS}),ignore_null_origin:e.ignoreNullOrigin})},beforeOpen:function(t,e){t.send(JSON.stringify({path:e}))}}),mt={isSupported:function(t){return oe.isXDRSupported(t.useTLS)}},vt=new ct(U({},lt,mt)),bt=new ct(U({},dt,mt));ft.xdr_streaming=vt,ft.xdr_polling=bt,ft.sockjs=gt;var yt=ft,wt=new class extends ot{constructor(){super();var t=this;void 0!==window.addEventListener&&(window.addEventListener("online",(function(){t.emit("online")}),!1),window.addEventListener("offline",(function(){t.emit("offline")}),!1))}isOnline(){return void 0===window.navigator.onLine||window.navigator.onLine}};class Ct{constructor(t,e,n){this.manager=t,this.transport=e,this.minPingDelay=n.minPingDelay,this.maxPingDelay=n.maxPingDelay,this.pingDelay=void 0}createConnection(t,e,n,r){r=U({},r,{activityTimeout:this.pingDelay});var i=this.transport.createConnection(t,e,n,r),s=null,o=function(){i.unbind("open",o),i.bind("closed",a),s=M.now()},a=t=>{if(i.unbind("closed",a),1002===t.code||1003===t.code)this.manager.reportDeath();else if(!t.wasClean&&s){var e=M.now()-s;e<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(e/2,this.minPingDelay))}};return i.bind("open",o),i}isSupported(t){return this.manager.isAlive()&&this.transport.isSupported(t)}}const St={decodeMessage:function(t){try{var e=JSON.parse(t.data),n=e.data;if("string"==typeof n)try{n=JSON.parse(e.data)}catch(t){}var r={event:e.event,channel:e.channel,data:n};return e.user_id&&(r.user_id=e.user_id),r}catch(e){throw{type:"MessageParseError",error:e,data:t.data}}},encodeMessage:function(t){return JSON.stringify(t)},processHandshake:function(t){var e=St.decodeMessage(t);if("pusher:connection_established"===e.event){if(!e.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:e.data.socket_id,activityTimeout:1e3*e.data.activity_timeout}}if("pusher:error"===e.event)return{action:this.getCloseAction(e.data),error:this.getCloseError(e.data)};throw"Invalid handshake"},getCloseAction:function(t){return t.code<4e3?t.code>=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}};var _t=St;class Tt extends ot{constructor(t,e){super(),this.id=t,this.transport=e,this.activityTimeout=e.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(t){return this.transport.send(t)}send_event(t,e,n){var r={event:t,data:e};return n&&(r.channel=n),Y.debug("Event sent",r),this.send(_t.encodeMessage(r))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var t={message:t=>{var e;try{e=_t.decodeMessage(t)}catch(e){this.emit("error",{type:"MessageParseError",error:e,data:t.data})}if(void 0!==e){switch(Y.debug("Event recd",e),e.event){case"pusher:error":this.emit("error",{type:"PusherError",data:e.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong")}this.emit("message",e)}},activity:()=>{this.emit("activity")},error:t=>{this.emit("error",t)},closed:t=>{e(),t&&t.code&&this.handleCloseEvent(t),this.transport=null,this.emit("closed")}},e=()=>{j(t,((t,e)=>{this.transport.unbind(e,t)}))};j(t,((t,e)=>{this.transport.bind(e,t)}))}handleCloseEvent(t){var e=_t.getCloseAction(t),n=_t.getCloseError(t);n&&this.emit("error",n),e&&this.emit(e,{action:e,error:n})}}class kt{constructor(t,e){this.transport=t,this.callback=e,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=t=>{var e;this.unbindListeners();try{e=_t.processHandshake(t)}catch(t){return this.finish("error",{error:t}),void this.transport.close()}"connected"===e.action?this.finish("connected",{connection:new Tt(e.id,this.transport),activityTimeout:e.activityTimeout}):(this.finish(e.action,{error:e.error}),this.transport.close())},this.onClosed=t=>{this.unbindListeners();var e=_t.getCloseAction(t)||"backoff",n=_t.getCloseError(t);this.finish(e,{error:n})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(t,e){this.callback(U({transport:this.transport,action:t},e))}}class Et{constructor(t,e){this.timeline=t,this.options=e||{}}send(t,e){this.timeline.isEmpty()||this.timeline.send(oe.TimelineTransport.getAgent(this,t),e)}}class Pt extends ot{constructor(t,e){super((function(e,n){Y.debug("No callbacks on "+t+" for "+e)})),this.name=t,this.pusher=e,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(t,e){return e(null,{auth:""})}trigger(t,e){if(0!==t.indexOf("client-"))throw new l("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var n=u("triggeringClientEvents");Y.warn(`Client event triggered before channel 'subscription_succeeded' event . ${n}`)}return this.pusher.send_event(t,e,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(t){var e=t.event,n=t.data;"pusher_internal:subscription_succeeded"===e?this.handleSubscriptionSucceededEvent(t):"pusher_internal:subscription_count"===e?this.handleSubscriptionCountEvent(t):0!==e.indexOf("pusher_internal:")&&this.emit(e,n,{})}handleSubscriptionSucceededEvent(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)}handleSubscriptionCountEvent(t){t.data.subscription_count&&(this.subscriptionCount=t.data.subscription_count),this.emit("pusher:subscription_count",t.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,((t,e)=>{t?(this.subscriptionPending=!1,Y.error(t.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:t.message},t instanceof y?{status:t.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:e.auth,channel_data:e.channel_data,channel:this.name})})))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class At extends Pt{authorize(t,e){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:t},e)}}class xt{constructor(){this.reset()}get(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null}each(t){j(this.members,((e,n)=>{t(this.get(n))}))}setMyID(t){this.myID=t}onSubscription(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)}addMember(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)}removeMember(t){var e=this.get(t.user_id);return e&&(delete this.members[t.user_id],this.count--),e}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}class It extends At{constructor(t,e){super(t,e),this.members=new xt}authorize(t,e){super.authorize(t,((t,n)=>{return r=this,i=void 0,o=function*(){if(!t)if(null!=n.channel_data){var r=JSON.parse(n.channel_data);this.members.setMyID(r.user_id)}else{if(yield this.pusher.user.signinDonePromise,null==this.pusher.user.user_data){let t=u("authorizationEndpoint");return Y.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${t}, or the user should be signed in.`),void e("Invalid auth response")}this.members.setMyID(this.pusher.user.user_data.id)}e(t,n)},new((s=void 0)||(s=Promise))((function(t,e){function n(t){try{c(o.next(t))}catch(t){e(t)}}function a(t){try{c(o.throw(t))}catch(t){e(t)}}function c(e){var r;e.done?t(e.value):(r=e.value,r instanceof s?r:new s((function(t){t(r)}))).then(n,a)}c((o=o.apply(r,i||[])).next())}));var r,i,s,o}))}handleEvent(t){var e=t.event;if(0===e.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var n=t.data,r={};t.user_id&&(r.user_id=t.user_id),this.emit(e,n,r)}}handleInternalEvent(t){var e=t.event,n=t.data;switch(e){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(t);break;case"pusher_internal:member_added":var r=this.members.addMember(n);this.emit("pusher:member_added",r);break;case"pusher_internal:member_removed":var i=this.members.removeMember(n);i&&this.emit("pusher:member_removed",i)}}handleSubscriptionSucceededEvent(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var Rt=n(1),Lt=n(0);class Ot extends At{constructor(t,e,n){super(t,e),this.key=null,this.nacl=n}authorize(t,e){super.authorize(t,((t,n)=>{if(t)return void e(t,n);let r=n.shared_secret;r?(this.key=Object(Lt.decode)(r),delete n.shared_secret,e(null,n)):e(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null)}))}trigger(t,e){throw new m("Client events are not currently supported for encrypted channels")}handleEvent(t){var e=t.event,n=t.data;0!==e.indexOf("pusher_internal:")&&0!==e.indexOf("pusher:")?this.handleEncryptedEvent(e,n):super.handleEvent(t)}handleEncryptedEvent(t,e){if(!this.key)return void Y.debug("Received encrypted event before key has been retrieved from the authEndpoint");if(!e.ciphertext||!e.nonce)return void Y.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+e);let n=Object(Lt.decode)(e.ciphertext);if(n.length{e?Y.error(`Failed to make a request to the authEndpoint: ${s}. Unable to fetch new key, so dropping encrypted event`):(i=this.nacl.secretbox.open(n,r,this.key),null!==i?this.emit(t,this.getDataToEmit(i)):Y.error("Failed to decrypt event with new key. Dropping encrypted event"))}));this.emit(t,this.getDataToEmit(i))}getDataToEmit(t){let e=Object(Rt.decode)(t);try{return JSON.parse(e)}catch(t){return e}}}class Nt extends ot{constructor(t,e){super(),this.state="initialized",this.connection=null,this.key=t,this.options=e,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var n=oe.getNetwork();n.bind("online",(()=>{this.timeline.info({netinfo:"online"}),"connecting"!==this.state&&"unavailable"!==this.state||this.retryIn(0)})),n.bind("offline",(()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()})),this.updateStrategy()}switchCluster(t){this.key=t,this.updateStrategy(),this.retryIn(0)}connect(){this.connection||this.runner||(this.strategy.isSupported()?(this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()):this.updateState("failed"))}send(t){return!!this.connection&&this.connection.send(t)}send_event(t,e,n){return!!this.connection&&this.connection.send_event(t,e,n)}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var t=(e,n)=>{e?this.runner=this.strategy.connect(0,t):"error"===n.action?(this.emit("error",{type:"HandshakeError",error:n.error}),this.timeline.error({handshakeError:n.error})):(this.abortConnecting(),this.handshakeCallbacks[n.action](n))};this.runner=this.strategy.connect(0,t)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection&&this.abandonConnection().close()}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(t){this.timeline.info({action:"retry",delay:t}),t>0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new L(t||0,(()=>{this.disconnectInternally(),this.connect()}))}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new L(this.options.unavailableTimeout,(()=>{this.updateState("unavailable")}))}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new L(this.options.pongTimeout,(()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)}))}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new L(this.activityTimeout,(()=>{this.sendActivityCheck()})))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(t){return U({},t,{message:t=>{this.resetActivityCheck(),this.emit("message",t)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:t=>{this.emit("error",t)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(t){return U({},t,{connected:t=>{this.activityTimeout=Math.min(this.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(t.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let t=t=>e=>{e.error&&this.emit("error",{type:"WebSocketError",error:e.error}),t(e)};return{tls_only:t((()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)})),refused:t((()=>{this.disconnect()})),backoff:t((()=>{this.retryIn(1e3)})),retry:t((()=>{this.retryIn(0)}))}}setConnection(t){for(var e in this.connection=t,this.connectionCallbacks)this.connection.bind(e,this.connectionCallbacks[e]);this.resetActivityCheck()}abandonConnection(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var e=this.connection;return this.connection=null,e}}updateState(t,e){var n=this.state;if(this.state=t,n!==t){var r=t;"connected"===r&&(r+=" with new socket ID "+e.socket_id),Y.debug("State changed",n+" -> "+r),this.timeline.info({state:t,params:e}),this.emit("state_change",{previous:n,current:t}),this.emit(t,e)}}shouldRetry(){return"connecting"===this.state||"connected"===this.state}}class Mt{constructor(){this.channels={}}add(t,e){return this.channels[t]||(this.channels[t]=function(t,e){if(0===t.indexOf("private-encrypted-")){if(e.config.nacl)return Ut.createEncryptedChannel(t,e,e.config.nacl);let n="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",r=u("encryptedChannelSupport");throw new m(`${n}. ${r}`)}if(0===t.indexOf("private-"))return Ut.createPrivateChannel(t,e);if(0===t.indexOf("presence-"))return Ut.createPresenceChannel(t,e);if(0===t.indexOf("#"))throw new d('Cannot create a channel with name "'+t+'".');return Ut.createChannel(t,e)}(t,e)),this.channels[t]}all(){return t=this.channels,e=[],j(t,(function(t){e.push(t)})),e;var t,e}find(t){return this.channels[t]}remove(t){var e=this.channels[t];return delete this.channels[t],e}disconnect(){j(this.channels,(function(t){t.disconnect()}))}}var Ut={createChannels:()=>new Mt,createConnectionManager:(t,e)=>new Nt(t,e),createChannel:(t,e)=>new Pt(t,e),createPrivateChannel:(t,e)=>new At(t,e),createPresenceChannel:(t,e)=>new It(t,e),createEncryptedChannel:(t,e,n)=>new Ot(t,e,n),createTimelineSender:(t,e)=>new Et(t,e),createHandshake:(t,e)=>new kt(t,e),createAssistantToTheTransportManager:(t,e,n)=>new Ct(t,e,n)};class Bt{constructor(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}getAssistant(t){return Ut.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Dt{constructor(t,e){this.strategies=t,this.loop=Boolean(e.loop),this.failFast=Boolean(e.failFast),this.timeout=e.timeout,this.timeoutLimit=e.timeoutLimit}isSupported(){return $(this.strategies,M.method("isSupported"))}connect(t,e){var n=this.strategies,r=0,i=this.timeout,s=null,o=(a,c)=>{c?e(null,c):(r+=1,this.loop&&(r%=n.length),r0&&(i=new L(n.timeout,(function(){s.abort(),r(!0)}))),s=t.connect(e,(function(t,e){t&&i&&i.isRunning()&&!n.failFast||(i&&i.ensureAborted(),r(t,e))})),{abort:function(){i&&i.ensureAborted(),s.abort()},forceMinPriority:function(t){s.forceMinPriority(t)}}}}class jt{constructor(t){this.strategies=t}isSupported(){return $(this.strategies,M.method("isSupported"))}connect(t,e){return function(t,n,r){var i=q(t,(function(t,r,i,s){return t.connect(n,function(t,n){return function(r,i){n[t].error=r,r?function(t){return function(t,e){for(var n=0;n=M.now()){var o=this.transports[r.transport];o&&(["ws","wss"].includes(r.transport)||i>3?(this.timeline.info({cached:!0,transport:r.transport,latency:r.latency}),s.push(new Dt([o],{timeout:2*r.latency+1e3,failFast:!0}))):i++)}var a=M.now(),c=s.pop().connect(t,(function r(o,h){o?(Ft(n),s.length>0?(a=M.now(),c=s.pop().connect(t,r)):e(o)):(function(t,e,n,r){var i=oe.getLocalStorage();if(i)try{i[qt(t)]=V({timestamp:M.now(),transport:e,latency:n,cacheSkipCount:r})}catch(t){}}(n,h.transport.name,M.now()-a,i),e(null,h))}));return{abort:function(){c.abort()},forceMinPriority:function(e){t=e,c&&c.forceMinPriority(e)}}}}function qt(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function Ft(t){var e=oe.getLocalStorage();if(e)try{delete e[qt(t)]}catch(t){}}class Jt{constructor(t,{delay:e}){this.strategy=t,this.options={delay:e}}isSupported(){return this.strategy.isSupported()}connect(t,e){var n,r=this.strategy,i=new L(this.options.delay,(function(){n=r.connect(t,e)}));return{abort:function(){i.ensureAborted(),n&&n.abort()},forceMinPriority:function(e){t=e,n&&n.forceMinPriority(e)}}}}class $t{constructor(t,e,n){this.test=t,this.trueBranch=e,this.falseBranch=n}isSupported(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()}connect(t,e){return(this.test()?this.trueBranch:this.falseBranch).connect(t,e)}}class Xt{constructor(t){this.strategy=t}isSupported(){return this.strategy.isSupported()}connect(t,e){var n=this.strategy.connect(t,(function(t,r){r&&n.abort(),e(t,r)}));return n}}function Vt(t){return function(){return t.isSupported()}}var Yt,Kt={getRequest:function(t){var e=new window.XDomainRequest;return e.ontimeout=function(){t.emit("error",new p),t.close()},e.onerror=function(e){t.emit("error",e),t.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText),t.emit("finished",200),t.close()},e},abortRequest:function(t){t.ontimeout=t.onerror=t.onprogress=t.onload=null,t.abort()}};class Wt extends ot{constructor(t,e,n){super(),this.hooks=t,this.method=e,this.url=n}start(t){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},oe.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)}close(){this.unloader&&(oe.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(t,e){for(;;){var n=this.advanceBuffer(e);if(!n)break;this.emit("chunk",{status:t,data:n})}this.isBufferTooLong(e)&&this.emit("buffer_too_long")}advanceBuffer(t){var e=t.slice(this.position),n=e.indexOf("\n");return-1!==n?(this.position+=n+1,e.slice(0,n)):null}isBufferTooLong(t){return this.position===t.length&&t.length>262144}}!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(Yt||(Yt={}));var Qt=Yt,Gt=1;function Zt(t){var e=-1===t.indexOf("?")?"?":"&";return t+e+"t="+ +new Date+"&n="+Gt++}function te(t){return oe.randomInt(t)}var ee,ne=class{constructor(t,e){this.hooks=t,this.session=te(1e3)+"/"+function(t){for(var e=[],n=0;n<8;n++)e.push(te(32).toString(32));return e.join("")}(),this.location=function(t){var e=/([^\?]*)\/*(\??.*)/.exec(t);return{base:e[1],queryString:e[2]}}(e),this.readyState=Qt.CONNECTING,this.openStream()}send(t){return this.sendRaw(JSON.stringify([t]))}ping(){this.hooks.sendHeartbeat(this)}close(t,e){this.onClose(t,e,!0)}sendRaw(t){if(this.readyState!==Qt.OPEN)return!1;try{return oe.createSocketRequest("POST",Zt((e=this.location,n=this.session,e.base+"/"+n+"/xhr_send"))).start(t),!0}catch(t){return!1}var e,n}reconnect(){this.closeStream(),this.openStream()}onClose(t,e,n){this.closeStream(),this.readyState=Qt.CLOSED,this.onclose&&this.onclose({code:t,reason:e,wasClean:n})}onChunk(t){var e;if(200===t.status)switch(this.readyState===Qt.OPEN&&this.onActivity(),t.data.slice(0,1)){case"o":e=JSON.parse(t.data.slice(1)||"{}"),this.onOpen(e);break;case"a":e=JSON.parse(t.data.slice(1)||"[]");for(var n=0;n{this.onChunk(t)})),this.stream.bind("finished",(t=>{this.hooks.onFinished(this,t)})),this.stream.bind("buffer_too_long",(()=>{this.reconnect()}));try{this.stream.start()}catch(t){M.defer((()=>{this.onError(t),this.onClose(1006,"Could not start streaming",!1)}))}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}},re={getReceiveURL:function(t,e){return t.base+"/"+e+"/xhr_streaming"+t.queryString},onHeartbeat:function(t){t.sendRaw("[]")},sendHeartbeat:function(t){t.sendRaw("[]")},onFinished:function(t,e){t.onClose(1006,"Connection interrupted ("+e+")",!1)}},ie={getReceiveURL:function(t,e){return t.base+"/"+e+"/xhr"+t.queryString},onHeartbeat:function(){},sendHeartbeat:function(t){t.sendRaw("[]")},onFinished:function(t,e){200===e?t.reconnect():t.onClose(1006,"Connection interrupted ("+e+")",!1)}},se={getRequest:function(t){var e=new(oe.getXHRAPI());return e.onreadystatechange=e.onprogress=function(){switch(e.readyState){case 3:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText);break;case 4:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText),t.emit("finished",e.status),t.close()}},e},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},oe={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:i,DependenciesReceivers:o,getDefaultStrategy:function(t,e,n){var r={};function i(e,i,s,o,a){var c=n(t,e,i,s,o,a);return r[e]=c,c}var s,o=Object.assign({},e,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),a=Object.assign({},o,{useTLS:!0}),c=Object.assign({},e,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),h={loop:!0,timeout:15e3,timeoutLimit:6e4},u=new Bt({minPingDelay:1e4,maxPingDelay:t.activityTimeout}),l=new Bt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),d=i("ws","ws",3,o,u),p=i("wss","ws",3,a,u),f=i("sockjs","sockjs",1,c),g=i("xhr_streaming","xhr_streaming",1,c,l),m=i("xdr_streaming","xdr_streaming",1,c,l),v=i("xhr_polling","xhr_polling",1,c),b=i("xdr_polling","xdr_polling",1,c),y=new Dt([d],h),w=new Dt([p],h),C=new Dt([f],h),S=new Dt([new $t(Vt(g),g,m)],h),_=new Dt([new $t(Vt(v),v,b)],h),T=new Dt([new $t(Vt(S),new jt([S,new Jt(_,{delay:4e3})]),_)],h),k=new $t(Vt(T),T,C);return s=e.useTLS?new jt([y,new Jt(k,{delay:2e3})]):new jt([y,new Jt(w,{delay:2e3}),new Jt(k,{delay:5e3})]),new zt(new Xt(new $t(Vt(d),s,k)),r,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},Transports:yt,transportConnectionInitializer:function(){var t=this;t.timeline.info(t.buildTimelineMessage({transport:t.name+(t.options.useTLS?"s":"")})),t.hooks.isInitialized()?t.changeState("initialized"):t.hooks.file?(t.changeState("initializing"),a.load(t.hooks.file,{useTLS:t.options.useTLS},(function(e,n){t.hooks.isInitialized()?(t.changeState("initialized"),n(!0)):(e&&t.onError(e),t.onClose(),n(!1))}))):t.onClose()},HTTPFactory:{createStreamingSocket(t){return this.createSocket(re,t)},createPollingSocket(t){return this.createSocket(ie,t)},createSocket:(t,e)=>new ne(t,e),createXHR(t,e){return this.createRequest(se,t,e)},createRequest:(t,e,n)=>new Wt(t,e,n),createXDR:function(t,e){return this.createRequest(Kt,t,e)}},TimelineTransport:G,getXHRAPI:()=>window.XMLHttpRequest,getWebSocketAPI:()=>window.WebSocket||window.MozWebSocket,setup(t){window.Pusher=t;var e=()=>{this.onDocumentBody(t.ready)};window.JSON?e():a.load("json2",{},e)},getDocument:()=>document,getProtocol(){return this.getDocument().location.protocol},getAuthorizers:()=>({ajax:w,jsonp:K}),onDocumentBody(t){document.body?t():setTimeout((()=>{this.onDocumentBody(t)}),0)},createJSONPRequest:(t,e)=>new Q(t,e),createScriptRequest:t=>new W(t),getLocalStorage(){try{return window.localStorage}catch(t){return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){return new(this.getXHRAPI())},createMicrosoftXHR:()=>new ActiveXObject("Microsoft.XMLHTTP"),getNetwork:()=>wt,createWebSocket(t){return new(this.getWebSocketAPI())(t)},createSocketRequest(t,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,e);if(this.isXDRSupported(0===e.indexOf("https:")))return this.HTTPFactory.createXDR(t,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var t=this.getXHRAPI();return Boolean(t)&&void 0!==(new t).withCredentials},isXDRSupported(t){var e=t?"https:":"http:",n=this.getProtocol();return Boolean(window.XDomainRequest)&&n===e},addUnloadListener(t){void 0!==window.addEventListener?window.addEventListener("unload",t,!1):void 0!==window.attachEvent&&window.attachEvent("onunload",t)},removeUnloadListener(t){void 0!==window.addEventListener?window.removeEventListener("unload",t,!1):void 0!==window.detachEvent&&window.detachEvent("onunload",t)},randomInt:t=>Math.floor((window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)*t)};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(ee||(ee={}));var ae=ee;class ce{constructor(t,e,n){this.key=t,this.session=e,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}log(t,e){t<=this.options.level&&(this.events.push(U({},e,{timestamp:M.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(t){this.log(ae.ERROR,t)}info(t){this.log(ae.INFO,t)}debug(t){this.log(ae.DEBUG,t)}isEmpty(){return 0===this.events.length}send(t,e){var n=U({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(n,((t,n)=>{t||this.sent++,e&&e(t,n)})),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class he{constructor(t,e,n,r){this.name=t,this.priority=e,this.transport=n,this.options=r||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(t,e){if(!this.isSupported())return ue(new b,e);if(this.priority{n||(h(),i?i.close():r.close())},forceMinPriority:t=>{n||this.priority{if(void 0===oe.getAuthorizers()[t.transport])throw`'${t.transport}' is not a recognized auth transport`;return(e,n)=>{const r=((t,e)=>{var n="socket_id="+encodeURIComponent(t.socketId);for(var r in e.params)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(e.params[r]);if(null!=e.paramsProvider){let t=e.paramsProvider();for(var r in t)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r])}return n})(e,t);oe.getAuthorizers()[t.transport](oe,r,t,h.UserAuthentication,n)}},ge=t=>{if(void 0===oe.getAuthorizers()[t.transport])throw`'${t.transport}' is not a recognized auth transport`;return(e,n)=>{const r=((t,e)=>{var n="socket_id="+encodeURIComponent(t.socketId);for(var r in n+="&channel_name="+encodeURIComponent(t.channelName),e.params)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(e.params[r]);if(null!=e.paramsProvider){let t=e.paramsProvider();for(var r in t)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r])}return n})(e,t);oe.getAuthorizers()[t.transport](oe,r,t,h.ChannelAuthorization,n)}};const me=(t,e,n)=>{const r={authTransport:e.transport,authEndpoint:e.endpoint,auth:{params:e.params,headers:e.headers}};return(e,i)=>{const s=t.channel(e.channelName);n(s,r).authorize(e.socketId,i)}};function ve(t,e){let n={activityTimeout:t.activityTimeout||s.activityTimeout,cluster:t.cluster,httpPath:t.httpPath||s.httpPath,httpPort:t.httpPort||s.httpPort,httpsPort:t.httpsPort||s.httpsPort,pongTimeout:t.pongTimeout||s.pongTimeout,statsHost:t.statsHost||s.stats_host,unavailableTimeout:t.unavailableTimeout||s.unavailableTimeout,wsPath:t.wsPath||s.wsPath,wsPort:t.wsPort||s.wsPort,wssPort:t.wssPort||s.wssPort,enableStats:Ce(t),httpHost:be(t),useTLS:we(t),wsHost:ye(t),userAuthenticator:_e(t),channelAuthorizer:Te(t,e)};return"disabledTransports"in t&&(n.disabledTransports=t.disabledTransports),"enabledTransports"in t&&(n.enabledTransports=t.enabledTransports),"ignoreNullOrigin"in t&&(n.ignoreNullOrigin=t.ignoreNullOrigin),"timelineParams"in t&&(n.timelineParams=t.timelineParams),"nacl"in t&&(n.nacl=t.nacl),n}function be(t){return t.httpHost?t.httpHost:t.cluster?`sockjs-${t.cluster}.pusher.com`:s.httpHost}function ye(t){return t.wsHost?t.wsHost:`ws-${t.cluster}.pusher.com`}function we(t){return"https:"===oe.getProtocol()||!1!==t.forceTLS}function Ce(t){return"enableStats"in t?t.enableStats:"disableStats"in t&&!t.disableStats}const Se=t=>"customHandler"in t&&null!=t.customHandler;function _e(t){const e=Object.assign(Object.assign({},s.userAuthentication),t.userAuthentication);return Se(e)?e.customHandler:fe(e)}function Te(t,e){const n=function(t,e){let n;if("channelAuthorization"in t)n=Object.assign(Object.assign({},s.channelAuthorization),t.channelAuthorization);else if(n={transport:t.authTransport||s.authTransport,endpoint:t.authEndpoint||s.authEndpoint},"auth"in t&&("params"in t.auth&&(n.params=t.auth.params),"headers"in t.auth&&(n.headers=t.auth.headers)),"authorizer"in t)return{customHandler:me(e,n,t.authorizer)};return n}(t,e);return Se(n)?n.customHandler:ge(n)}class ke extends ot{constructor(t){super((function(t,e){Y.debug(`No callbacks on watchlist events for ${t}`)})),this.pusher=t,this.bindWatchlistInternalEvent()}handleEvent(t){t.data.events.forEach((t=>{this.emit(t.name,t)}))}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",(t=>{"pusher_internal:watchlist_events"===t.event&&this.handleEvent(t)}))}}class Ee extends ot{constructor(t){super((function(t,e){Y.debug("No callbacks on user for "+t)})),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(t,e)=>{if(t)return Y.warn(`Error during signin: ${t}`),void this._cleanup();this.pusher.send_event("pusher:signin",{auth:e.auth,user_data:e.user_data})},this.pusher=t,this.pusher.connection.bind("state_change",(({previous:t,current:e})=>{"connected"!==t&&"connected"===e&&this._signin(),"connected"===t&&"connected"!==e&&(this._cleanup(),this._newSigninPromiseIfNeeded())})),this.watchlist=new ke(t),this.pusher.connection.bind("message",(t=>{"pusher:signin_success"===t.event&&this._onSigninSuccess(t.data),this.serverToUserChannel&&this.serverToUserChannel.name===t.channel&&this.serverToUserChannel.handleEvent(t)}))}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),"connected"===this.pusher.connection.state&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(t){try{this.user_data=JSON.parse(t.user_data)}catch(e){return Y.error(`Failed parsing user data after signin: ${t.user_data}`),void this._cleanup()}if("string"!=typeof this.user_data.id||""===this.user_data.id)return Y.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),void this._cleanup();this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){this.serverToUserChannel=new Pt(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global(((t,e)=>{0!==t.indexOf("pusher_internal:")&&0!==t.indexOf("pusher:")&&this.emit(t,e)})),(t=>{t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():t.subscriptionPending||"connected"!==this.pusher.connection.state||t.subscribe()})(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested)return;if(this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:t,resolve:e,reject:n}=function(){let t,e;return{promise:new Promise(((n,r)=>{t=n,e=r})),resolve:t,reject:e}}();t.done=!1;const r=()=>{t.done=!0};t.then(r).catch(r),this.signinDonePromise=t,this._signinDoneResolve=e}}class Pe{static ready(){Pe.isReady=!0;for(var t=0,e=Pe.instances.length;toe.getDefaultStrategy(this.config,t,de),timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:Boolean(this.config.useTLS)}),this.connection.bind("connected",(()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())})),this.connection.bind("message",(t=>{var e=0===t.event.indexOf("pusher_internal:");if(t.channel){var n=this.channel(t.channel);n&&n.handleEvent(t)}e||this.global_emitter.emit(t.event,t.data)})),this.connection.bind("connecting",(()=>{this.channels.disconnect()})),this.connection.bind("disconnected",(()=>{this.channels.disconnect()})),this.connection.bind("error",(t=>{Y.warn(t)})),Pe.instances.push(this),this.timeline.info({instances:Pe.instances.length}),this.user=new Ee(this),Pe.isReady&&this.connect()}switchCluster(t){const{appKey:e,cluster:n}=t;this.key=e,this.options=Object.assign(Object.assign({},this.options),{cluster:n}),this.config=ve(this.options,this),this.connection.switchCluster(this.key)}channel(t){return this.channels.find(t)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var t=this.connection.isUsingTLS(),e=this.timelineSender;this.timelineSenderTimer=new O(6e4,(function(){e.send(t)}))}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(t,e,n){return this.global_emitter.bind(t,e,n),this}unbind(t,e,n){return this.global_emitter.unbind(t,e,n),this}bind_global(t){return this.global_emitter.bind_global(t),this}unbind_global(t){return this.global_emitter.unbind_global(t),this}unbind_all(t){return this.global_emitter.unbind_all(),this}subscribeAll(){var t;for(t in this.channels.channels)this.channels.channels.hasOwnProperty(t)&&this.subscribe(t)}subscribe(t){var e=this.channels.add(t,this);return e.subscriptionPending&&e.subscriptionCancelled?e.reinstateSubscription():e.subscriptionPending||"connected"!==this.connection.state||e.subscribe(),e}unsubscribe(t){var e=this.channels.find(t);e&&e.subscriptionPending?e.cancelSubscription():(e=this.channels.remove(t))&&e.subscribed&&e.unsubscribe()}send_event(t,e,n){return this.connection.send_event(t,e,n)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}Pe.instances=[],Pe.isReady=!1,Pe.logToConsole=!1,Pe.Runtime=oe,Pe.ScriptReceivers=oe.ScriptReceivers,Pe.DependenciesReceivers=oe.DependenciesReceivers,Pe.auth_callbacks=oe.auth_callbacks;var Ae=e.default=Pe;oe.setup(Pe)}])},t.exports=e()},592:(t,e,n)=>{const r=n(138),i=n(115),s=n(907),o=n(776);function a(t,e,n,s,o){const a=[].slice.call(arguments,1),c=a.length,h="function"==typeof a[c-1];if(!h&&!r())throw new Error("Callback required as last argument");if(!h){if(c<1)throw new Error("Too few arguments provided");return 1===c?(n=e,e=s=void 0):2!==c||e.getContext||(s=n,n=e,e=void 0),new Promise((function(r,o){try{const o=i.create(n,s);r(t(o,e,s))}catch(t){o(t)}}))}if(c<2)throw new Error("Too few arguments provided");2===c?(o=n,n=e,e=s=void 0):3===c&&(e.getContext&&void 0===o?(o=s,s=void 0):(o=s,s=n,n=e,e=void 0));try{const r=i.create(n,s);o(null,t(r,e,s))}catch(t){o(t)}}e.create=i.create,e.toCanvas=a.bind(null,s.render),e.toDataURL=a.bind(null,s.renderToDataURL),e.toString=a.bind(null,(function(t,e,n){return o.render(t,n)}))},138:t=>{t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},845:(t,e,n)=>{const r=n(242).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];const e=Math.floor(t/7)+2,n=r(t),i=145===n?26:2*Math.ceil((n-13)/(2*e-2)),s=[n-7];for(let t=1;t{const r=n(910),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function s(t){this.mode=r.ALPHANUMERIC,this.data=t}s.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let n=45*i.indexOf(this.data[e]);n+=i.indexOf(this.data[e+1]),t.put(n,11)}this.data.length%2&&t.put(i.indexOf(this.data[e]),6)},t.exports=s},245:t=>{function e(){this.buffer=[],this.length=0}e.prototype={get:function(t){const e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(let n=0;n>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},t.exports=e},280:t=>{function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}e.prototype.set=function(t,e,n,r){const i=t*this.size+e;this.data[i]=n,r&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,e){return this.data[t*this.size+e]},e.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n},e.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},t.exports=e},424:(t,e,n)=>{const r=n(378),i=n(910);function s(t){this.mode=i.BYTE,"string"==typeof t&&(t=r(t)),this.data=new Uint8Array(t)}s.getBitsLength=function(t){return 8*t},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(t){for(let e=0,n=this.data.length;e{const r=n(908),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],s=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(t,e){switch(e){case r.L:return i[4*(t-1)+0];case r.M:return i[4*(t-1)+1];case r.Q:return i[4*(t-1)+2];case r.H:return i[4*(t-1)+3];default:return}},e.getTotalCodewordsCount=function(t,e){switch(e){case r.L:return s[4*(t-1)+0];case r.M:return s[4*(t-1)+1];case r.Q:return s[4*(t-1)+2];case r.H:return s[4*(t-1)+3];default:return}}},908:(t,e)=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2},e.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(t){return n}}},526:(t,e,n)=>{const r=n(242).getSymbolSize;e.getPositions=function(t){const e=r(t);return[[0,0],[e-7,0],[0,e-7]]}},642:(t,e,n)=>{const r=n(242),i=r.getBCHDigit(1335);e.getEncodedBits=function(t,e){const n=t.bit<<3|e;let s=n<<10;for(;r.getBCHDigit(s)-i>=0;)s^=1335<{const n=new Uint8Array(512),r=new Uint8Array(256);!function(){let t=1;for(let e=0;e<255;e++)n[e]=t,r[t]=e,t<<=1,256&t&&(t^=285);for(let t=255;t<512;t++)n[t]=n[t-255]}(),e.log=function(t){if(t<1)throw new Error("log("+t+")");return r[t]},e.exp=function(t){return n[t]},e.mul=function(t,e){return 0===t||0===e?0:n[r[t]+r[e]]}},442:(t,e,n)=>{const r=n(910),i=n(242);function s(t){this.mode=r.KANJI,this.data=t}s.getBitsLength=function(t){return 13*t},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(t){let e;for(e=0;e=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),t.put(n,13)}},t.exports=s},126:(t,e)=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}e.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(t){const e=t.size;let n=0,r=0,i=0,s=null,o=null;for(let a=0;a=5&&(n+=r-5+3),s=e,r=1),e=t.get(c,a),e===o?i++:(i>=5&&(n+=i-5+3),o=e,i=1)}r>=5&&(n+=r-5+3),i>=5&&(n+=i-5+3)}return n},e.getPenaltyN2=function(t){const e=t.size;let n=0;for(let r=0;r=10&&(1488===r||93===r)&&n++,i=i<<1&2047|t.get(o,s),o>=10&&(1488===i||93===i)&&n++}return 40*n},e.getPenaltyN4=function(t){let e=0;const n=t.data.length;for(let r=0;r{const r=n(114),i=n(7);e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(t,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!r.isValid(e))throw new Error("Invalid version: "+e);return e>=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},e.getBestModeForData=function(t){return i.testNumeric(t)?e.NUMERIC:i.testAlphanumeric(t)?e.ALPHANUMERIC:i.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},e.isValid=function(t){return t&&t.bit&&t.ccBits},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(t){return n}}},85:(t,e,n)=>{const r=n(910);function i(t){this.mode=r.NUMERIC,this.data=t.toString()}i.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let e,n,r;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),r=parseInt(n,10),t.put(r,10);const i=this.data.length-e;i>0&&(n=this.data.substr(e),r=parseInt(n,10),t.put(r,3*i+1))},t.exports=i},143:(t,e,n)=>{const r=n(729);e.mul=function(t,e){const n=new Uint8Array(t.length+e.length-1);for(let i=0;i=0;){const t=n[0];for(let i=0;i{const r=n(242),i=n(908),s=n(245),o=n(280),a=n(845),c=n(526),h=n(126),u=n(393),l=n(882),d=n(103),p=n(642),f=n(910),g=n(130);function m(t,e,n){const r=t.size,i=p.getEncodedBits(e,n);let s,o;for(s=0;s<15;s++)o=1==(i>>s&1),s<6?t.set(s,8,o,!0):s<8?t.set(s+1,8,o,!0):t.set(r-15+s,8,o,!0),s<8?t.set(8,r-s-1,o,!0):s<9?t.set(8,15-s-1+1,o,!0):t.set(8,15-s-1,o,!0);t.set(r-8,8,1,!0)}function v(t,e,n,i){let p;if(Array.isArray(t))p=g.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");{let r=e;if(!r){const e=g.rawSplit(t);r=d.getBestVersionForData(e,n)}p=g.fromString(t,r||40)}}const v=d.getBestVersionForData(p,n);if(!v)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e=0&&e<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===e||6===e)||e>=2&&e<=4&&r>=2&&r<=4?t.set(i+e,s+r,!0,!0):t.set(i+e,s+r,!1,!0))}}(w,e),function(t){const e=t.size;for(let n=8;n=7&&function(t,e){const n=t.size,r=d.getEncodedBits(e);let i,s,o;for(let e=0;e<18;e++)i=Math.floor(e/3),s=e%3+n-8-3,o=1==(r>>e&1),t.set(i,s,o,!0),t.set(s,i,o,!0)}(w,e),function(t,e){const n=t.size;let r=-1,i=n-1,s=7,o=0;for(let a=n-1;a>0;a-=2)for(6===a&&a--;;){for(let n=0;n<2;n++)if(!t.isReserved(i,a-n)){let r=!1;o>>s&1)),t.set(i,a-n,r),s--,-1===s&&(o++,s=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}(w,b),isNaN(i)&&(i=h.getBestMask(w,m.bind(null,w,n))),h.applyMask(i,w),m(w,n,i),{modules:w,version:e,errorCorrectionLevel:n,maskPattern:i,segments:p}}e.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");let n,s,o=i.M;return void 0!==e&&(o=i.from(e.errorCorrectionLevel,i.M),n=d.from(e.version),s=h.from(e.maskPattern),e.toSJISFunc&&r.setToSJISFunction(e.toSJISFunc)),v(t,n,o,s)}},882:(t,e,n)=>{const r=n(143);function i(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(t){this.degree=t,this.genPoly=r.generateECPolynomial(this.degree)},i.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const e=new Uint8Array(t.length+this.degree);e.set(t);const n=r.mod(e,this.genPoly),i=this.degree-n.length;if(i>0){const t=new Uint8Array(this.degree);return t.set(n,i),t}return n},t.exports=i},7:(t,e)=>{const n="[0-9]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+")(?:.|[\r\n]))+";e.KANJI=new RegExp(r,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(i,"g"),e.NUMERIC=new RegExp(n,"g"),e.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const s=new RegExp("^"+r+"$"),o=new RegExp("^"+n+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(t){return s.test(t)},e.testNumeric=function(t){return o.test(t)},e.testAlphanumeric=function(t){return a.test(t)}},130:(t,e,n)=>{const r=n(910),i=n(85),s=n(260),o=n(424),a=n(442),c=n(7),h=n(242),u=n(987);function l(t){return unescape(encodeURIComponent(t)).length}function d(t,e,n){const r=[];let i;for(;null!==(i=t.exec(n));)r.push({data:i[0],index:i.index,mode:e,length:i[0].length});return r}function p(t){const e=d(c.NUMERIC,r.NUMERIC,t),n=d(c.ALPHANUMERIC,r.ALPHANUMERIC,t);let i,s;return h.isKanjiModeEnabled()?(i=d(c.BYTE,r.BYTE,t),s=d(c.KANJI,r.KANJI,t)):(i=d(c.BYTE_KANJI,r.BYTE,t),s=[]),e.concat(n,i,s).sort((function(t,e){return t.index-e.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function f(t,e){switch(e){case r.NUMERIC:return i.getBitsLength(t);case r.ALPHANUMERIC:return s.getBitsLength(t);case r.KANJI:return a.getBitsLength(t);case r.BYTE:return o.getBitsLength(t)}}function g(t,e){let n;const c=r.getBestModeForData(t);if(n=r.from(e,c),n!==r.BYTE&&n.bit=0?t[t.length-1]:null;return n&&n.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)}),[]))},e.rawSplit=function(t){return e.fromArray(p(t,h.isKanjiModeEnabled()))}},242:(t,e)=>{let n;const r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},e.getSymbolTotalCodewords=function(t){return r[t]},e.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},e.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');n=t},e.isKanjiModeEnabled=function(){return void 0!==n},e.toSJIS=function(t){return n(t)}},114:(t,e)=>{e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},103:(t,e,n)=>{const r=n(242),i=n(393),s=n(908),o=n(910),a=n(114),c=r.getBCHDigit(7973);function h(t,e){return o.getCharCountIndicator(t,e)+4}function u(t,e){let n=0;return t.forEach((function(t){const r=h(t.mode,e);n+=r+t.getBitsLength()})),n}e.from=function(t,e){return a.isValid(t)?parseInt(t,10):e},e.getCapacity=function(t,e,n){if(!a.isValid(t))throw new Error("Invalid QR Code version");void 0===n&&(n=o.BYTE);const s=8*(r.getSymbolTotalCodewords(t)-i.getTotalCodewordsCount(t,e));if(n===o.MIXED)return s;const c=s-h(n,t);switch(n){case o.NUMERIC:return Math.floor(c/10*3);case o.ALPHANUMERIC:return Math.floor(c/11*2);case o.KANJI:return Math.floor(c/13);case o.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(t,n){let r;const i=s.from(n,s.M);if(Array.isArray(t)){if(t.length>1)return function(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,o.MIXED))return r}(t,i);if(0===t.length)return 1;r=t[0]}else r=t;return function(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}(r.mode,r.getLength(),i)},e.getEncodedBits=function(t){if(!a.isValid(t)||t<7)throw new Error("Invalid QR Code version");let e=t<<12;for(;r.getBCHDigit(e)-c>=0;)e^=7973<{const r=n(653);e.render=function(t,e,n){let i=n,s=e;void 0!==i||e&&e.getContext||(i=e,e=void 0),e||(s=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),i=r.getOptions(i);const o=r.getImageWidth(t.modules.size,i),a=s.getContext("2d"),c=a.createImageData(o,o);return r.qrToImageData(c.data,t,i),function(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+"px",e.style.width=n+"px"}(a,s,o),a.putImageData(c,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;void 0!==i||n&&n.getContext||(i=n,n=void 0),i||(i={});const s=e.render(t,n,i),o=i.type||"image/png",a=i.rendererOpts||{};return s.toDataURL(o,a.quality)}},776:(t,e,n)=>{const r=n(653);function i(t,e){const n=t.a/255,r=e+'="'+t.hex+'"';return n<1?r+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function s(t,e,n){let r=t+e;return void 0!==n&&(r+=" "+n),r}e.render=function(t,e,n){const o=r.getOptions(e),a=t.modules.size,c=t.modules.data,h=a+2*o.margin,u=o.color.light.a?"':"",l="0&&h>0&&t[c-1]||(r+=o?s("M",h+n,.5+u+n):s("m",i,0),i=0,o=!1),h+1',d='viewBox="0 0 '+h+" "+h+'"',p=''+u+l+"\n";return"function"==typeof n&&n(null,p),p}},653:(t,e)=>{function n(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map((function(t){return[t,t]})))),6===e.length&&e.push("F","F");const n=parseInt(e.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+e.slice(0,6).join("")}}e.getOptions=function(t){t||(t={}),t.color||(t.color={});const e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:r,scale:r?4:i,margin:e,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},e.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},e.getImageWidth=function(t,n){const r=e.getScale(t,n);return Math.floor((t+2*n.margin)*r)},e.qrToImageData=function(t,n,r){const i=n.modules.size,s=n.modules.data,o=e.getScale(i,r),a=Math.floor((i+2*r.margin)*o),c=r.margin*o,h=[r.color.light,r.color.dark];for(let e=0;e=c&&n>=c&&e{"use strict";var r;n.r(e),n.d(e,{NIL:()=>I,parse:()=>m,stringify:()=>u,v1:()=>g,v3:()=>k,v4:()=>E,v5:()=>x,validate:()=>a,version:()=>R});var i=new Uint8Array(16);function s(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,a=function(t){return"string"==typeof t&&o.test(t)};for(var c=[],h=0;h<256;++h)c.push((h+256).toString(16).substr(1));const u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(c[t[e+0]]+c[t[e+1]]+c[t[e+2]]+c[t[e+3]]+"-"+c[t[e+4]]+c[t[e+5]]+"-"+c[t[e+6]]+c[t[e+7]]+"-"+c[t[e+8]]+c[t[e+9]]+"-"+c[t[e+10]]+c[t[e+11]]+c[t[e+12]]+c[t[e+13]]+c[t[e+14]]+c[t[e+15]]).toLowerCase();if(!a(n))throw TypeError("Stringified UUID is invalid");return n};var l,d,p=0,f=0;const g=function(t,e,n){var r=e&&n||0,i=e||new Array(16),o=(t=t||{}).node||l,a=void 0!==t.clockseq?t.clockseq:d;if(null==o||null==a){var c=t.random||(t.rng||s)();null==o&&(o=l=[1|c[0],c[1],c[2],c[3],c[4],c[5]]),null==a&&(a=d=16383&(c[6]<<8|c[7]))}var h=void 0!==t.msecs?t.msecs:Date.now(),g=void 0!==t.nsecs?t.nsecs:f+1,m=h-p+(g-f)/1e4;if(m<0&&void 0===t.clockseq&&(a=a+1&16383),(m<0||h>p)&&void 0===t.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");p=h,f=g,d=a;var v=(1e4*(268435455&(h+=122192928e5))+g)%4294967296;i[r++]=v>>>24&255,i[r++]=v>>>16&255,i[r++]=v>>>8&255,i[r++]=255&v;var b=h/4294967296*1e4&268435455;i[r++]=b>>>8&255,i[r++]=255&b,i[r++]=b>>>24&15|16,i[r++]=b>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(var y=0;y<6;++y)i[r+y]=o[y];return e||u(i)},m=function(t){if(!a(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n};function v(t,e,n){function r(t,r,i,s){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n>>9<<4)+1}function y(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function w(t,e,n,r,i,s){return y((o=y(y(e,t),y(r,s)))<<(a=i)|o>>>32-a,n);var o,a}function C(t,e,n,r,i,s,o){return w(e&n|~e&r,t,e,i,s,o)}function S(t,e,n,r,i,s,o){return w(e&r|n&~r,t,e,i,s,o)}function _(t,e,n,r,i,s,o){return w(e^n^r,t,e,i,s,o)}function T(t,e,n,r,i,s,o){return w(n^(e|~r),t,e,i,s,o)}const k=v("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var n=0;n>5]>>>i%32&255,o=parseInt(r.charAt(s>>>4&15)+r.charAt(15&s),16);e.push(o)}return e}(function(t,e){t[e>>5]|=128<>5]|=(255&t[r/8])<>>32-e}const x=v("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var r=unescape(encodeURIComponent(t));t=[];for(var i=0;i>>0;y=b,b=v,v=A(m,30)>>>0,m=g,g=S}n[0]=n[0]+g>>>0,n[1]=n[1]+m>>>0,n[2]=n[2]+v>>>0,n[3]=n[3]+b>>>0,n[4]=n[4]+y>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),I="00000000-0000-0000-0000-000000000000",R=function(t){if(!a(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{const t=n(592),{v4:e}=n(614),r=new(n(606))("a29a22e46d485f5f2038",{cluster:"ap3"});r.connection.bind("error",(t=>{console.error("Pusher connection error:",t)})),jQuery(document).ready((n=>{function i(){if("esprit_pay"===n("input[name='payment_method']:checked").val()){const i=e();n(document).ajaxComplete((async()=>{n("#place_order").hide();const e=await t.toDataURL(`paymentId=${i}&amount=0.009678&address=${data.address}&amountUSD=${data.amount}`);n(".esprit-qrcode").length||(n(".esprit-container").append(``),n(".esprit-container").append('
Pay with Esprit and earn an instant 2% cashback!
To pay, scan the QR code with your Esprit App and confirm the payment. Leave this window open during payment.
')),r.allChannels().includes(data.paymentId)||r.subscribe("my-channel").bind("my-event",(async t=>{alert(JSON.stringify(t)),r.unsubscribe("my-channel"),n("#place_order").show(),await new Promise((t=>setTimeout(t,1e3))),n("#place_order").click()}))}))}else n(document).unbind("ajaxComplete"),n("#place_order").show()}i(),n("form.checkout").on("change",'input[name="payment_method"]',(function(){selectedPayment=n(this).val(),"esprit_pay"===selectedPayment?i():(n(document).unbind("ajaxComplete"),n("#place_order").show()),n(document.body).trigger("update_checkout")}))}))})()})(); \ No newline at end of file +(()=>{var e={8159:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ZKSYNC_ADDRESS=t.GELATO_RELAY_CONCURRENT_ERC2771_ZKSYNC_ADDRESS=t.GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ADDRESS=t.GELATO_RELAY_CONCURRENT_ERC2771_ADDRESS=t.GELATO_RELAY_1BALANCE_ERC2771_ZKSYNC_ADDRESS=t.GELATO_RELAY_ERC2771_ZKSYNC_ADDRESS=t.GELATO_RELAY_1BALANCE_ERC2771_ADDRESS=t.GELATO_RELAY_ERC2771_ADDRESS=t.USER_NONCE_ABI=t.DEFAULT_DEADLINE_GAP=t.DEFAULT_INTERNAL_ERROR_MESSAGE=t.SIGN_TYPED_DATA_V4=t.GELATO_RELAY_URL=void 0,t.GELATO_RELAY_URL="https://api.gelato.digital",t.SIGN_TYPED_DATA_V4="eth_signTypedData_v4",t.DEFAULT_INTERNAL_ERROR_MESSAGE="Internal Error",t.DEFAULT_DEADLINE_GAP=86400,t.USER_NONCE_ABI=["function userNonce(address account) external view returns (uint256)"],t.GELATO_RELAY_ERC2771_ADDRESS="0xb539068872230f20456CF38EC52EF2f91AF4AE49",t.GELATO_RELAY_1BALANCE_ERC2771_ADDRESS="0xd8253782c45a12053594b9deB72d8e8aB2Fca54c",t.GELATO_RELAY_ERC2771_ZKSYNC_ADDRESS="0x22DCC39b2AC376862183dd35A1664798dafC7Da6",t.GELATO_RELAY_1BALANCE_ERC2771_ZKSYNC_ADDRESS="0x97015cD4C3d456997DD1C40e2a18c79108FCc412",t.GELATO_RELAY_CONCURRENT_ERC2771_ADDRESS="0x8598806401A63Ddf52473F1B3C55bC9E33e2d73b",t.GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ADDRESS="0xc65d82ECE367EF06bf2AB791B3f3CF037Dc0e816",t.GELATO_RELAY_CONCURRENT_ERC2771_ZKSYNC_ADDRESS="0xBa4082F4961c8Fb76231995C967CD9aa40f321b5",t.GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ZKSYNC_ADDRESS="0xB8828e4c662D1a7e4f3d1f622EfAE6B63D852ED8"},3352:function(e,t,r){"use strict";var n,s,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},c=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},u=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},l=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.GelatoRelay=t.TaskState=t.ERC2771Type=void 0;const d=a(r(7187)),h=r(2219);Object.defineProperty(t,"ERC2771Type",{enumerable:!0,get:function(){return h.ERC2771Type}});const f=r(8530);Object.defineProperty(t,"TaskState",{enumerable:!0,get:function(){return f.TaskState}});const p=r(8159),g=r(2756);t.GelatoRelay=class{constructor(e){n.set(this,void 0),s.set(this,void 0),this.configure=e=>{u(this,n,this._getConfiguration(e),"f")},this._getConfiguration=e=>{var t,r,n,s,i,o,a,c,u,l,d,h,f,g,y,m,b;const v=null!==(t=null==e?void 0:e.url)&&void 0!==t?t:p.GELATO_RELAY_URL;return{url:v,websocketUrl:v.replace(/^http/,"ws"),contract:{relayERC2771:null!==(n=null===(r=null==e?void 0:e.contract)||void 0===r?void 0:r.relayERC2771)&&void 0!==n?n:p.GELATO_RELAY_ERC2771_ADDRESS,relay1BalanceERC2771:null!==(i=null===(s=null==e?void 0:e.contract)||void 0===s?void 0:s.relay1BalanceERC2771)&&void 0!==i?i:p.GELATO_RELAY_1BALANCE_ERC2771_ADDRESS,relayERC2771zkSync:null!==(a=null===(o=null==e?void 0:e.contract)||void 0===o?void 0:o.relayERC2771zkSync)&&void 0!==a?a:p.GELATO_RELAY_ERC2771_ZKSYNC_ADDRESS,relay1BalanceERC2771zkSync:null!==(u=null===(c=null==e?void 0:e.contract)||void 0===c?void 0:c.relay1BalanceERC2771zkSync)&&void 0!==u?u:p.GELATO_RELAY_1BALANCE_ERC2771_ZKSYNC_ADDRESS,relayConcurrentERC2771:null!==(d=null===(l=null==e?void 0:e.contract)||void 0===l?void 0:l.relayConcurrentERC2771)&&void 0!==d?d:p.GELATO_RELAY_CONCURRENT_ERC2771_ADDRESS,relay1BalanceConcurrentERC2771:null!==(f=null===(h=null==e?void 0:e.contract)||void 0===h?void 0:h.relay1BalanceConcurrentERC2771)&&void 0!==f?f:p.GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ADDRESS,relayConcurrentERC2771zkSync:null!==(y=null===(g=null==e?void 0:e.contract)||void 0===g?void 0:g.relayConcurrentERC2771zkSync)&&void 0!==y?y:p.GELATO_RELAY_CONCURRENT_ERC2771_ZKSYNC_ADDRESS,relay1BalanceConcurrentERC2771zkSync:null!==(b=null===(m=null==e?void 0:e.contract)||void 0===m?void 0:m.relay1BalanceConcurrentERC2771zkSync)&&void 0!==b?b:p.GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ZKSYNC_ADDRESS}}},this.callWithSyncFee=(e,t,r)=>c(this,void 0,void 0,(function*(){const i=yield d.relayWithSyncFee({request:e,sponsorApiKey:r,options:t},l(this,n,"f"));return l(this,s,"f").hasHandlers()&&(yield l(this,s,"f").subscribe(i.taskId)),i})),this.callWithSyncFeeERC2771=(e,t,r,i)=>c(this,void 0,void 0,(function*(){const o=yield d.relayWithCallWithSyncFeeERC2771({request:e,signerOrProvider:t,sponsorApiKey:i,options:r},l(this,n,"f"));return l(this,s,"f").hasHandlers()&&(yield l(this,s,"f").subscribe(o.taskId)),o})),this.sponsoredCall=(e,t,r)=>c(this,void 0,void 0,(function*(){const i=yield d.relayWithSponsoredCall({request:e,sponsorApiKey:t,options:r},l(this,n,"f"));return l(this,s,"f").hasHandlers()&&(yield l(this,s,"f").subscribe(i.taskId)),i})),this.sponsoredCallERC2771=(e,t,r,i)=>c(this,void 0,void 0,(function*(){const o=yield d.relayWithSponsoredCallERC2771({request:e,signerOrProvider:t,sponsorApiKey:r,options:i},l(this,n,"f"));return l(this,s,"f").hasHandlers()&&(yield l(this,s,"f").subscribe(o.taskId)),o})),this.getSignatureDataERC2771=(e,t,r)=>d.getSignatureDataERC2771({request:e,signerOrProvider:t,type:r},l(this,n,"f")),this.getDataToSignERC2771=(e,t,r)=>d.getDataToSignERC2771({request:e,signerOrProvider:r,type:t},l(this,n,"f")),this.sponsoredCallERC2771WithSignature=(e,t,r,i)=>c(this,void 0,void 0,(function*(){const o=yield d.sponsoredCallERC2771WithSignature({struct:e,signature:t,sponsorApiKey:r,options:i},l(this,n,"f"));return l(this,s,"f").hasHandlers()&&(yield l(this,s,"f").subscribe(o.taskId)),o})),this.callWithSyncFeeERC2771WithSignature=(e,t,r,i,o)=>c(this,void 0,void 0,(function*(){const a=yield d.callWithSyncFeeERC2771WithSignature({struct:e,syncFeeParams:t,signature:r,options:i,sponsorApiKey:o},l(this,n,"f"));return l(this,s,"f").hasHandlers()&&(yield l(this,s,"f").subscribe(a.taskId)),a})),this.isNetworkSupported=e=>d.isNetworkSupported({chainId:e},l(this,n,"f")),this.getSupportedNetworks=()=>d.getSupportedNetworks(l(this,n,"f")),this.isOracleActive=e=>d.isOracleActive({chainId:e},l(this,n,"f")),this.getGelatoOracles=()=>d.getGelatoOracles(l(this,n,"f")),this.getPaymentTokens=e=>d.getPaymentTokens({chainId:e},l(this,n,"f")),this.getEstimatedFee=(e,t,r,s,i=BigInt(0))=>d.getEstimatedFee({chainId:e,paymentToken:t,gasLimit:r,isHighPriority:s,gasLimitL1:i},l(this,n,"f")),this.getTaskStatus=e=>d.getTaskStatus({taskId:e},l(this,n,"f")),this.onTaskStatusUpdate=e=>{l(this,s,"f").onUpdate(e)},this.offTaskStatusUpdate=e=>{l(this,s,"f").offUpdate(e)},this.onError=e=>{l(this,s,"f").onError(e)},this.offError=e=>{l(this,s,"f").offError(e)},this.subscribeTaskStatusUpdate=e=>c(this,void 0,void 0,(function*(){yield l(this,s,"f").subscribe(e)})),this.unsubscribeTaskStatusUpdate=e=>c(this,void 0,void 0,(function*(){yield l(this,s,"f").unsubscribe(e)})),u(this,n,this._getConfiguration(e),"f"),u(this,s,new g.WebsocketHandler(l(this,n,"f").websocketUrl),"f")}},n=new WeakMap,s=new WeakMap},919:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.relayWithSyncFee=void 0;const s=r(2756),i=r(5538),o=r(8320);t.relayWithSyncFee=(e,t)=>n(void 0,void 0,void 0,(function*(){var r;try{const{request:n,options:a,sponsorApiKey:c}=e;if(!(yield(0,i.isNetworkSupported)({chainId:n.chainId},t)))throw new Error(`Chain id [${n.chainId}] is not supported`);return yield(0,s.post)({relayCall:o.RelayCall.CallWithSyncFee,request:Object.assign(Object.assign({},n),{isRelayContext:null===(r=n.isRelayContext)||void 0===r||r,sponsorApiKey:c,chainId:n.chainId.toString(),gasLimit:(null==a?void 0:a.gasLimit)?a.gasLimit.toString():void 0,retries:null==a?void 0:a.retries})},t)}catch(e){throw new Error(`GelatoRelaySDK/relayWithSyncFee: Failed with error: ${(0,s.getHttpErrorMessage)(e)}`)}}))},8932:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.callWithSyncFeeERC2771WithSignature=void 0;const s=r(2756),i=r(5538),o=r(8320),a=r(3134);t.callWithSyncFeeERC2771WithSignature=(e,t)=>n(void 0,void 0,void 0,(function*(){var r,n;try{const{signature:c,struct:u,syncFeeParams:l,options:d,sponsorApiKey:h}=e;if(!(yield(0,i.isNetworkSupported)({chainId:u.chainId},t)))throw new Error(`Chain id [${u.chainId}] is not supported`);if((0,s.isConcurrentStruct)(u)){const e=!0;return yield(0,s.post)({relayCall:o.RelayCall.CallWithSyncFeeERC2771,request:Object.assign(Object.assign(Object.assign({},(0,a.safeTransformStruct)(u)),l),{isRelayContext:null===(r=l.isRelayContext)||void 0===r||r,userSignature:c,isConcurrent:e,sponsorApiKey:h,gasLimit:(null==d?void 0:d.gasLimit)?d.gasLimit.toString():void 0,retries:null==d?void 0:d.retries})},t)}{const e=!1;return yield(0,s.post)({relayCall:o.RelayCall.CallWithSyncFeeERC2771,request:Object.assign(Object.assign(Object.assign({},(0,a.safeTransformStruct)(u)),l),{isRelayContext:null===(n=l.isRelayContext)||void 0===n||n,userSignature:c,isConcurrent:e,sponsorApiKey:h,gasLimit:(null==d?void 0:d.gasLimit)?d.gasLimit.toString():void 0,retries:null==d?void 0:d.retries})},t)}}catch(e){const t=e.message;throw new Error(`GelatoRelaySDK/callWithSyncFeeERC2771WithSignature: Failed with error: ${t}`)}}))},871:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.relayWithCallWithSyncFeeERC2771=void 0;const s=r(2756),i=r(8320),o=r(2219),a=r(1331),c=r(3134);t.relayWithCallWithSyncFeeERC2771=(e,t)=>n(void 0,void 0,void 0,(function*(){try{const{request:r,signerOrProvider:n,options:u,sponsorApiKey:l}=e;if(r.isConcurrent){const e=!0,{isRelayContext:d,feeToken:h}=r,f=o.ERC2771Type.ConcurrentCallWithSyncFee,{struct:p,signature:g}=yield(0,a.getSignatureDataERC2771)({request:r,signerOrProvider:n,type:f},t);return yield(0,s.post)({relayCall:i.RelayCall.CallWithSyncFeeERC2771,request:Object.assign(Object.assign({},(0,c.safeTransformStruct)(p)),{feeToken:h,isRelayContext:null==d||d,userSignature:g,isConcurrent:e,sponsorApiKey:l,gasLimit:(null==u?void 0:u.gasLimit)?u.gasLimit.toString():void 0,retries:null==u?void 0:u.retries})},t)}{const e=!1,{isRelayContext:d,feeToken:h}=r,f=o.ERC2771Type.CallWithSyncFee,{struct:p,signature:g}=yield(0,a.getSignatureDataERC2771)({request:r,signerOrProvider:n,type:f},t);return yield(0,s.post)({relayCall:i.RelayCall.CallWithSyncFeeERC2771,request:Object.assign(Object.assign({},(0,c.safeTransformStruct)(p)),{feeToken:h,isRelayContext:null==d||d,userSignature:g,isConcurrent:e,sponsorApiKey:l,gasLimit:(null==u?void 0:u.gasLimit)?u.gasLimit.toString():void 0,retries:null==u?void 0:u.retries})},t)}}catch(e){const t=e.message;throw new Error(`GelatoRelaySDK/callWithSyncFeeERC2771: Failed with error: ${t}`)}}))},1046:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getDataToSignERC2771=void 0;const s=r(2756),i=r(5538),o=r(5630);t.getDataToSignERC2771=function(e,t){return n(this,void 0,void 0,(function*(){try{const{request:r,signerOrProvider:n}=e,{chainId:a}=r;if(!(yield(0,i.isNetworkSupported)({chainId:a},t)))throw new Error(`Chain id [${a.toString()}] is not supported`);if((0,s.isConcurrentRequest)(r)){const s=e.type,{struct:i,typedData:a}=yield(0,o.populatePayloadToSign)({request:r,type:s,signerOrProvider:n},t);return{struct:i,typedData:a}}{const s=e.type,{struct:i,typedData:a}=yield(0,o.populatePayloadToSign)({request:r,type:s,signerOrProvider:n},t);return{struct:i,typedData:a}}}catch(e){const t=e.message;throw new Error(`GelatoRelaySDK/getDataToSignERC2771: Failed with error: ${t}`)}}))}},1331:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getSignatureDataERC2771=void 0;const s=r(2756),i=r(1046);t.getSignatureDataERC2771=function(e,t){return n(this,void 0,void 0,(function*(){try{const{request:r,signerOrProvider:n}=e;if((0,s.isConcurrentRequest)(r)){const o=e.type,{struct:a,typedData:c}=yield(0,i.getDataToSignERC2771)({request:r,signerOrProvider:n,type:o},t);return{struct:a,signature:yield(0,s.signTypedDataV4)(n,r.user,c)}}{const o=e.type,{struct:a,typedData:c}=yield(0,i.getDataToSignERC2771)({request:r,signerOrProvider:n,type:o},t);return{struct:a,signature:yield(0,s.signTypedDataV4)(n,r.user,c)}}}catch(e){const t=e.message;throw new Error(`GelatoRelaySDK/getSignatureDataERC2771: Failed with error: ${t}`)}}))}},698:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callWithSyncFeeERC2771WithSignature=t.relayWithCallWithSyncFeeERC2771=t.sponsoredCallERC2771WithSignature=t.relayWithSponsoredCallERC2771=t.getDataToSignERC2771=t.getSignatureDataERC2771=void 0;var n=r(1331);Object.defineProperty(t,"getSignatureDataERC2771",{enumerable:!0,get:function(){return n.getSignatureDataERC2771}});var s=r(1046);Object.defineProperty(t,"getDataToSignERC2771",{enumerable:!0,get:function(){return s.getDataToSignERC2771}});var i=r(7502);Object.defineProperty(t,"relayWithSponsoredCallERC2771",{enumerable:!0,get:function(){return i.relayWithSponsoredCallERC2771}});var o=r(6497);Object.defineProperty(t,"sponsoredCallERC2771WithSignature",{enumerable:!0,get:function(){return o.sponsoredCallERC2771WithSignature}});var a=r(871);Object.defineProperty(t,"relayWithCallWithSyncFeeERC2771",{enumerable:!0,get:function(){return a.relayWithCallWithSyncFeeERC2771}});var c=r(8932);Object.defineProperty(t,"callWithSyncFeeERC2771WithSignature",{enumerable:!0,get:function(){return c.callWithSyncFeeERC2771WithSignature}})},6497:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sponsoredCallERC2771WithSignature=void 0;const s=r(2756),i=r(5538),o=r(8320),a=r(3134);t.sponsoredCallERC2771WithSignature=(e,t)=>n(void 0,void 0,void 0,(function*(){try{const{signature:r,sponsorApiKey:n,struct:c,options:u}=e;if(!(yield(0,i.isNetworkSupported)({chainId:c.chainId},t)))throw new Error(`Chain id [${c.chainId}] is not supported`);if((0,s.isConcurrentStruct)(c)){const e=!0;return yield(0,s.post)({relayCall:o.RelayCall.SponsoredCallERC2771,request:Object.assign(Object.assign({},(0,a.safeTransformStruct)(c)),{userSignature:r,sponsorApiKey:n,isConcurrent:e,gasLimit:(null==u?void 0:u.gasLimit)?u.gasLimit.toString():void 0,retries:null==u?void 0:u.retries})},t)}{const e=!1;return yield(0,s.post)({relayCall:o.RelayCall.SponsoredCallERC2771,request:Object.assign(Object.assign({},(0,a.safeTransformStruct)(c)),{userSignature:r,sponsorApiKey:n,isConcurrent:e,gasLimit:(null==u?void 0:u.gasLimit)?u.gasLimit.toString():void 0,retries:null==u?void 0:u.retries})},t)}}catch(e){const t=e.message;throw new Error(`GelatoRelaySDK/sponsoredCallERC2771WithSignature: Failed with error: ${t}`)}}))},7502:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.relayWithSponsoredCallERC2771=void 0;const s=r(2756),i=r(8320),o=r(2219),a=r(1331),c=r(3134);t.relayWithSponsoredCallERC2771=(e,t)=>n(void 0,void 0,void 0,(function*(){return yield u(e,t)}));const u=(e,t)=>n(void 0,void 0,void 0,(function*(){try{const{request:r,sponsorApiKey:n,signerOrProvider:u,options:l}=e;if((0,s.isConcurrentRequest)(r)){const e=!0,d=o.ERC2771Type.ConcurrentSponsoredCall,{struct:h,signature:f}=yield(0,a.getSignatureDataERC2771)({request:r,signerOrProvider:u,type:d},t);return yield(0,s.post)({relayCall:i.RelayCall.SponsoredCallERC2771,request:Object.assign(Object.assign({},(0,c.safeTransformStruct)(h)),{userSignature:f,sponsorApiKey:n,isConcurrent:e,gasLimit:(null==l?void 0:l.gasLimit)?l.gasLimit.toString():void 0,retries:null==l?void 0:l.retries})},t)}{const e=!1,d=o.ERC2771Type.SponsoredCall,{struct:h,signature:f}=yield(0,a.getSignatureDataERC2771)({request:r,signerOrProvider:u,type:d},t);return yield(0,s.post)({relayCall:i.RelayCall.SponsoredCallERC2771,request:Object.assign(Object.assign({},(0,c.safeTransformStruct)(h)),{userSignature:f,sponsorApiKey:n,isConcurrent:e,gasLimit:(null==l?void 0:l.gasLimit)?l.gasLimit.toString():void 0,retries:null==l?void 0:l.retries})},t)}}catch(e){const t=e.message;throw new Error(`GelatoRelaySDK/sponsoredCallERC2771: Failed with error: ${t}`)}}))},2219:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ERC2771Type=t.EIP712_CALL_WITH_SYNC_FEE_CONCURRENT_ERC2771_TYPE_DATA=t.EIP712_SPONSORED_CALL_CONCURRENT_ERC2771_TYPE_DATA=t.EIP712_CALL_WITH_SYNC_FEE_ERC2771_TYPE_DATA=t.EIP712_SPONSORED_CALL_ERC2771_TYPE_DATA=void 0,t.EIP712_SPONSORED_CALL_ERC2771_TYPE_DATA={SponsoredCallERC2771:[{name:"chainId",type:"uint256"},{name:"target",type:"address"},{name:"data",type:"bytes"},{name:"user",type:"address"},{name:"userNonce",type:"uint256"},{name:"userDeadline",type:"uint256"}]},t.EIP712_CALL_WITH_SYNC_FEE_ERC2771_TYPE_DATA={CallWithSyncFeeERC2771:[{name:"chainId",type:"uint256"},{name:"target",type:"address"},{name:"data",type:"bytes"},{name:"user",type:"address"},{name:"userNonce",type:"uint256"},{name:"userDeadline",type:"uint256"}]},t.EIP712_SPONSORED_CALL_CONCURRENT_ERC2771_TYPE_DATA={SponsoredCallConcurrentERC2771:[{name:"chainId",type:"uint256"},{name:"target",type:"address"},{name:"data",type:"bytes"},{name:"user",type:"address"},{name:"userSalt",type:"bytes32"},{name:"userDeadline",type:"uint256"}]},t.EIP712_CALL_WITH_SYNC_FEE_CONCURRENT_ERC2771_TYPE_DATA={CallWithSyncFeeConcurrentERC2771:[{name:"chainId",type:"uint256"},{name:"target",type:"address"},{name:"data",type:"bytes"},{name:"user",type:"address"},{name:"userSalt",type:"bytes32"},{name:"userDeadline",type:"uint256"}]},(r=t.ERC2771Type||(t.ERC2771Type={})).CallWithSyncFee="CallWithSyncFee",r.SponsoredCall="SponsoredCall",r.ConcurrentCallWithSyncFee="ConcurrentCallWithSyncFee",r.ConcurrentSponsoredCall="ConcurrentSponsoredCall"},8946:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPayloadToSign=void 0;const n=r(2756),s=r(8320),i=r(2219);t.getPayloadToSign=function(e,t){const{isSigner:r,struct:o,type:a}=e,c=(0,n.getEIP712Domain)({chainId:BigInt(o.chainId),type:a},t);switch(a){case i.ERC2771Type.SponsoredCall:return r?{domain:c,types:Object.assign({},i.EIP712_SPONSORED_CALL_ERC2771_TYPE_DATA),message:o}:{domain:c,types:Object.assign(Object.assign({},i.EIP712_SPONSORED_CALL_ERC2771_TYPE_DATA),s.EIP712_DOMAIN_TYPE_DATA),primaryType:"SponsoredCallERC2771",message:o};case i.ERC2771Type.CallWithSyncFee:return r?{domain:c,types:Object.assign({},i.EIP712_CALL_WITH_SYNC_FEE_ERC2771_TYPE_DATA),message:o}:{domain:c,types:Object.assign(Object.assign({},i.EIP712_CALL_WITH_SYNC_FEE_ERC2771_TYPE_DATA),s.EIP712_DOMAIN_TYPE_DATA),primaryType:"CallWithSyncFeeERC2771",message:o};case i.ERC2771Type.ConcurrentSponsoredCall:return r?{domain:c,types:Object.assign({},i.EIP712_SPONSORED_CALL_CONCURRENT_ERC2771_TYPE_DATA),message:o}:{domain:c,types:Object.assign(Object.assign({},i.EIP712_SPONSORED_CALL_CONCURRENT_ERC2771_TYPE_DATA),s.EIP712_DOMAIN_TYPE_DATA),primaryType:"SponsoredCallConcurrentERC2771",message:o};case i.ERC2771Type.ConcurrentCallWithSyncFee:return r?{domain:c,types:Object.assign({},i.EIP712_CALL_WITH_SYNC_FEE_CONCURRENT_ERC2771_TYPE_DATA),message:o}:{domain:c,types:Object.assign(Object.assign({},i.EIP712_CALL_WITH_SYNC_FEE_CONCURRENT_ERC2771_TYPE_DATA),s.EIP712_DOMAIN_TYPE_DATA),primaryType:"CallWithSyncFeeConcurrentERC2771",message:o};default:return a}}},5630:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.populatePayloadToSign=void 0;var n=r(8048);Object.defineProperty(t,"populatePayloadToSign",{enumerable:!0,get:function(){return n.populatePayloadToSign}})},7244:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.mapRequestToStruct=void 0;const s=r(9237),i=r(2756);t.mapRequestToStruct=function(e,t){var r,o,a;return n(this,void 0,void 0,(function*(){if(!t.userDeadline&&!e.userDeadline)throw new Error("userDeadline is not found in the request, nor fetched");if((0,i.isConcurrentRequest)(e)){const n=t;return{userDeadline:null!==(r=n.userDeadline)&&void 0!==r?r:e.userDeadline,chainId:e.chainId,target:(0,s.getAddress)(e.target),data:e.data,user:(0,s.getAddress)(e.user),userSalt:null!==(o=n.userSalt)&&void 0!==o?o:e.userSalt}}{const r=t;if(void 0===r.userNonce&&void 0===e.userNonce)throw new Error("userNonce is not found in the request, nor fetched");return{userDeadline:null!==(a=r.userDeadline)&&void 0!==a?a:e.userDeadline,chainId:e.chainId,target:(0,s.getAddress)(e.target),data:e.data,user:(0,s.getAddress)(e.user),userNonce:void 0!==r.userNonce?r.userNonce:e.userNonce}}}))}},8048:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.populatePayloadToSign=void 0;const s=r(2756),i=r(7244),o=r(8946),a=r(3134);t.populatePayloadToSign=function(e,t){return n(this,void 0,void 0,(function*(){const{request:r,signerOrProvider:n}=e;if((0,s.isConcurrentRequest)(r)){const c=e.type,u=yield(0,s.populateOptionalUserParameters)({request:r,type:c,signerOrProvider:n},t),l=yield(0,i.mapRequestToStruct)(r,u),d=(0,a.safeTransformStruct)(l);return{struct:l,typedData:(0,o.getPayloadToSign)({struct:d,type:c,isSigner:n?(0,s.isSigner)(n):void 0},t)}}{const c=e.type,u=yield(0,s.populateOptionalUserParameters)({request:r,type:c,signerOrProvider:n},t),l=yield(0,i.mapRequestToStruct)(r,u),d=(0,a.safeTransformStruct)(l);return{struct:l,typedData:(0,o.getPayloadToSign)({struct:d,type:c,isSigner:n?(0,s.isSigner)(n):void 0},t)}}}))}},3134:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeTransformStruct=void 0;const n=r(2756);t.safeTransformStruct=function(e){return(0,n.isConcurrentStruct)(e)?Object.assign(Object.assign({},e),{chainId:e.chainId.toString()}):Object.assign(Object.assign({},e),{chainId:e.chainId.toString(),userNonce:e.userNonce.toString()})}},7187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTaskStatus=t.isNetworkSupported=t.getSupportedNetworks=t.isOracleActive=t.getPaymentTokens=t.getGelatoOracles=t.getEstimatedFee=t.relayWithCallWithSyncFeeERC2771=t.callWithSyncFeeERC2771WithSignature=t.sponsoredCallERC2771WithSignature=t.getDataToSignERC2771=t.getSignatureDataERC2771=t.relayWithSponsoredCallERC2771=t.relayWithSponsoredCall=t.relayWithSyncFee=void 0;var n=r(919);Object.defineProperty(t,"relayWithSyncFee",{enumerable:!0,get:function(){return n.relayWithSyncFee}});var s=r(8928);Object.defineProperty(t,"relayWithSponsoredCall",{enumerable:!0,get:function(){return s.relayWithSponsoredCall}});var i=r(698);Object.defineProperty(t,"relayWithSponsoredCallERC2771",{enumerable:!0,get:function(){return i.relayWithSponsoredCallERC2771}}),Object.defineProperty(t,"getSignatureDataERC2771",{enumerable:!0,get:function(){return i.getSignatureDataERC2771}}),Object.defineProperty(t,"getDataToSignERC2771",{enumerable:!0,get:function(){return i.getDataToSignERC2771}}),Object.defineProperty(t,"sponsoredCallERC2771WithSignature",{enumerable:!0,get:function(){return i.sponsoredCallERC2771WithSignature}}),Object.defineProperty(t,"callWithSyncFeeERC2771WithSignature",{enumerable:!0,get:function(){return i.callWithSyncFeeERC2771WithSignature}}),Object.defineProperty(t,"relayWithCallWithSyncFeeERC2771",{enumerable:!0,get:function(){return i.relayWithCallWithSyncFeeERC2771}});var o=r(6229);Object.defineProperty(t,"getEstimatedFee",{enumerable:!0,get:function(){return o.getEstimatedFee}}),Object.defineProperty(t,"getGelatoOracles",{enumerable:!0,get:function(){return o.getGelatoOracles}}),Object.defineProperty(t,"getPaymentTokens",{enumerable:!0,get:function(){return o.getPaymentTokens}}),Object.defineProperty(t,"isOracleActive",{enumerable:!0,get:function(){return o.isOracleActive}});var a=r(5538);Object.defineProperty(t,"getSupportedNetworks",{enumerable:!0,get:function(){return a.getSupportedNetworks}}),Object.defineProperty(t,"isNetworkSupported",{enumerable:!0,get:function(){return a.isNetworkSupported}});var c=r(9644);Object.defineProperty(t,"getTaskStatus",{enumerable:!0,get:function(){return c.getTaskStatus}})},5538:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getSupportedNetworks=t.isNetworkSupported=void 0;const s=r(2756);t.isNetworkSupported=(e,r)=>n(void 0,void 0,void 0,(function*(){return(yield(0,t.getSupportedNetworks)(r)).includes(e.chainId.toString())})),t.getSupportedNetworks=e=>n(void 0,void 0,void 0,(function*(){try{return(yield s.axiosInstance.get(`${e.url}/relays/v2`)).data.relays}catch(e){throw new Error(`GelatoRelaySDK/getSupportedNetworks: Failed with error: ${(0,s.getHttpErrorMessage)(e)}`)}}))},6229:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getEstimatedFee=t.getPaymentTokens=t.getGelatoOracles=t.isOracleActive=void 0;const s=r(2756);t.isOracleActive=(e,r)=>n(void 0,void 0,void 0,(function*(){return(yield(0,t.getGelatoOracles)(r)).includes(e.chainId.toString())})),t.getGelatoOracles=e=>n(void 0,void 0,void 0,(function*(){try{return(yield s.axiosInstance.get(`${e.url}/oracles/`)).data.oracles}catch(e){throw new Error(`GelatoRelaySDK/getGelatoOracles: Failed with error: ${(0,s.getHttpErrorMessage)(e)}`)}})),t.getPaymentTokens=(e,t)=>n(void 0,void 0,void 0,(function*(){try{return(yield s.axiosInstance.get(`${t.url}/oracles/${e.chainId.toString()}/paymentTokens/`)).data.paymentTokens}catch(e){throw new Error(`GelatoRelaySDK/getPaymentTokens: Failed with error: ${(0,s.getHttpErrorMessage)(e)}`)}})),t.getEstimatedFee=(e,t)=>n(void 0,void 0,void 0,(function*(){const{chainId:r,gasLimit:n,gasLimitL1:i,isHighPriority:o,paymentToken:a}=e,c={paymentToken:a,gasLimit:n.toString(),isHighPriority:o,gasLimitL1:i.toString()};try{const e=yield s.axiosInstance.get(`${t.url}/oracles/${r.toString()}/estimate`,{params:c});return BigInt(e.data.estimatedFee)}catch(e){throw new Error(`GelatoRelaySDK/getEstimatedFee: Failed with error: ${(0,s.getHttpErrorMessage)(e)}`)}}))},8928:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.relayWithSponsoredCall=void 0;const s=r(9237),i=r(2756),o=r(5538),a=r(8320);t.relayWithSponsoredCall=(e,t)=>n(void 0,void 0,void 0,(function*(){return yield c(e,t)}));const c=(e,t)=>n(void 0,void 0,void 0,(function*(){try{const{request:r,sponsorApiKey:n,options:c}=e;if(!(yield(0,o.isNetworkSupported)({chainId:r.chainId},t)))throw new Error(`Chain id [${r.chainId}] is not supported`);const u=yield(e=>({chainId:e.chainId.toString(),target:(0,s.getAddress)(e.target),data:e.data}))(r);return yield(0,i.post)({relayCall:a.RelayCall.SponsoredCall,request:Object.assign(Object.assign({},u),{sponsorApiKey:n,gasLimit:(null==c?void 0:c.gasLimit)?c.gasLimit.toString():void 0,retries:null==c?void 0:c.retries})},t)}catch(e){const t=e.message;throw new Error(`GelatoRelaySDK/sponsoredCall: Failed with error: ${t}`)}}))},9644:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getTaskStatus=void 0;const s=r(2756);t.getTaskStatus=(e,t)=>n(void 0,void 0,void 0,(function*(){try{return(yield s.axiosInstance.get(`${t.url}/tasks/status/${e.taskId}`)).data.task}catch(e){throw new Error(`GelatoRelaySDK/getTaskStatus: Failed with error: ${(0,s.getHttpErrorMessage)(e)}`)}}))},8530:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TaskState=void 0,(r=t.TaskState||(t.TaskState={})).CheckPending="CheckPending",r.ExecPending="ExecPending",r.WaitingForConfirmation="WaitingForConfirmation",r.ExecSuccess="ExecSuccess",r.ExecReverted="ExecReverted",r.Cancelled="Cancelled"},8320:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.EIP712_DOMAIN_TYPE_DATA=t.RelayCall=void 0,(r=t.RelayCall||(t.RelayCall={}))[r.CallWithSyncFee=0]="CallWithSyncFee",r[r.CallWithSyncFeeERC2771=1]="CallWithSyncFeeERC2771",r[r.SponsoredCall=2]="SponsoredCall",r[r.SponsoredCallERC2771=3]="SponsoredCallERC2771",t.EIP712_DOMAIN_TYPE_DATA={EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}]}},8791:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.axiosInstance=void 0;const s=n(r(1497));t.axiosInstance=s.default.create()},7839:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateDeadline=void 0,t.calculateDeadline=e=>Math.floor(Date.now()/1e3)+e},1309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEIP712Domain=void 0;const n=r(2219),s=r(1561);t.getEIP712Domain=(e,t)=>{const{chainId:r,type:i}=e;switch(i){case n.ERC2771Type.CallWithSyncFee:return{name:"GelatoRelayERC2771",version:"1",chainId:r.toString(),verifyingContract:(0,s.getGelatoRelayERC2771Address)({chainId:r,type:i},t)};case n.ERC2771Type.SponsoredCall:return{name:"GelatoRelay1BalanceERC2771",version:"1",chainId:r.toString(),verifyingContract:(0,s.getGelatoRelayERC2771Address)({chainId:r,type:i},t)};case n.ERC2771Type.ConcurrentCallWithSyncFee:return{name:"GelatoRelayConcurrentERC2771",version:"1",chainId:r.toString(),verifyingContract:(0,s.getGelatoRelayERC2771Address)({chainId:r,type:i},t)};case n.ERC2771Type.ConcurrentSponsoredCall:return{name:"GelatoRelay1BalanceConcurrentERC2771",version:"1",chainId:r.toString(),verifyingContract:(0,s.getGelatoRelayERC2771Address)({chainId:r,type:i},t)};default:return i}}},5124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateSalt=void 0;const n=r(9237);t.generateSalt=()=>{const e=Math.floor(1e6*Math.random()),t=n.ethers.AbiCoder.defaultAbiCoder().encode(["uint256","uint256"],[e,(new Date).getMilliseconds()]);return n.ethers.keccak256(t)}},6522:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getHttpErrorMessage=void 0;const n=r(8159);t.getHttpErrorMessage=e=>{var t,r,s,i;return null!==(i=null!==(s=null===(r=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===r?void 0:r.message)&&void 0!==s?s:e.message)&&void 0!==i?i:n.DEFAULT_INTERNAL_ERROR_MESSAGE}},2417:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getProviderChainId=void 0;const s=r(3339);t.getProviderChainId=e=>n(void 0,void 0,void 0,(function*(){let t;if((0,s.isSigner)(e)){if(!e.provider)throw new Error("Missing provider");t=e.provider}else t=e;const{chainId:r}=yield t.getNetwork();return r}))},6812:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getUserNonce=void 0;const s=r(9237),i=r(8159),o=r(1561),a=r(2417);t.getUserNonce=(e,t)=>n(void 0,void 0,void 0,(function*(){const{account:r,type:n,signerOrProvider:c}=e;if(!c.provider)throw new Error("Missing provider");const u=yield(0,a.getProviderChainId)(c),l=new s.ethers.Contract((0,o.getGelatoRelayERC2771Address)({chainId:u,type:n},t),i.USER_NONCE_ABI,c);return yield l.userNonce(r)}))},2756:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(9655),t),s(r(7839),t),s(r(6812),t),s(r(1309),t),s(r(6522),t),s(r(2797),t),s(r(6071),t),s(r(3339),t),s(r(1561),t),s(r(4156),t),s(r(2417),t),s(r(8791),t),s(r(1173),t),s(r(6426),t),s(r(5124),t),s(r(4125),t),s(r(3013),t)},6426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isConcurrentRequest=void 0,t.isConcurrentRequest=e=>!!e.isConcurrent},1173:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isConcurrentStruct=void 0,t.isConcurrentStruct=e=>!!e.userSalt},4125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFinalTaskState=void 0;const n=r(8530);t.isFinalTaskState=e=>{switch(e){case n.TaskState.ExecSuccess:case n.TaskState.ExecReverted:case n.TaskState.Cancelled:return!0;default:return!1}}},3339:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSigner=void 0,t.isSigner=e=>"signTransaction"in e},4156:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isZkSync=void 0,t.isZkSync=e=>e===BigInt(324)||e===BigInt(280)},2797:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.populateOptionalUserParameters=void 0;const s=r(8159),i=r(7839),o=r(6812),a=r(6426),c=r(5124),u=r(2417);t.populateOptionalUserParameters=function(e,t){return n(this,void 0,void 0,(function*(){if((0,a.isConcurrentRequest)(e.request)){const{request:t}=e,r={};return t.userDeadline||(r.userDeadline=(0,i.calculateDeadline)(s.DEFAULT_DEADLINE_GAP)),t.userSalt||(r.userSalt=(0,c.generateSalt)()),r}{const{type:r,signerOrProvider:n,request:a}=e,c={};if(a.userDeadline||(c.userDeadline=(0,i.calculateDeadline)(s.DEFAULT_DEADLINE_GAP)),void 0===a.userNonce){if(!n||!n.provider)throw new Error("Missing provider.");const e=yield(0,u.getProviderChainId)(n);if(a.chainId!==e)throw new Error(`Request and provider chain id mismatch. Request: [${a.chainId.toString()}], provider: [${e.toString()}]`);c.userNonce=yield(0,o.getUserNonce)({account:a.user,type:r,signerOrProvider:n},t)}return c}}))}},6071:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.post=void 0;const s=r(8320),i=r(8791),o=r(6522);t.post=(e,t)=>n(void 0,void 0,void 0,(function*(){try{const{relayCall:r,request:n}=e;let o;switch(r){case s.RelayCall.CallWithSyncFee:o=`${t.url}/relays/v2/call-with-sync-fee`;break;case s.RelayCall.CallWithSyncFeeERC2771:o=`${t.url}/relays/v2/call-with-sync-fee-erc2771`;break;case s.RelayCall.SponsoredCall:o=`${t.url}/relays/v2/sponsored-call`;break;case s.RelayCall.SponsoredCallERC2771:o=`${t.url}/relays/v2/sponsored-call-erc2771`;break;default:return r}return(yield i.axiosInstance.post(o,n)).data}catch(e){throw new Error((0,o.getHttpErrorMessage)(e))}}))},1561:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGelatoRelayERC2771Address=void 0;const n=r(9237),s=r(2219),i=r(4156);t.getGelatoRelayERC2771Address=(e,t)=>{const{chainId:r,type:o}=e;switch(o){case s.ERC2771Type.CallWithSyncFee:return(0,i.isZkSync)(r)?(0,n.getAddress)(t.contract.relayERC2771zkSync):(0,n.getAddress)(t.contract.relayERC2771);case s.ERC2771Type.SponsoredCall:return(0,i.isZkSync)(r)?(0,n.getAddress)(t.contract.relay1BalanceERC2771zkSync):(0,n.getAddress)(t.contract.relay1BalanceERC2771);case s.ERC2771Type.ConcurrentCallWithSyncFee:return(0,i.isZkSync)(r)?(0,n.getAddress)(t.contract.relayConcurrentERC2771zkSync):(0,n.getAddress)(t.contract.relayConcurrentERC2771);case s.ERC2771Type.ConcurrentSponsoredCall:return(0,i.isZkSync)(r)?(0,n.getAddress)(t.contract.relay1BalanceConcurrentERC2771zkSync):(0,n.getAddress)(t.contract.relay1BalanceConcurrentERC2771);default:return o}}},9655:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.signTypedDataV4=void 0;const s=r(8159),i=r(3339);t.signTypedDataV4=(e,t,r)=>n(void 0,void 0,void 0,(function*(){return(0,i.isSigner)(e)?yield e.signTypedData(r.domain,r.types,r.message):e.provider.isMagic?yield e.send(s.SIGN_TYPED_DATA_V4,[t,r]):(yield e.send(s.SIGN_TYPED_DATA_V4,[t,JSON.stringify(r)])).replace(/00$/,"1b").replace(/01$/,"1c")}))},3013:function(e,t,r){"use strict";var n,s,i,o,a,c,u,l=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},d=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},h=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketHandler=void 0;const p=f(r(6792)),g=r(4125),y=r(5344);t.WebsocketHandler=class{constructor(e){n.set(this,void 0),s.set(this,new Set),i.set(this,[]),o.set(this,[]),a.set(this,void 0),c.set(this,1e3),u.set(this,1e4),d(this,n,`${e}/tasks/ws/status`,"f")}onUpdate(e){if(!e)throw new Error("Callback handler is not provided");h(this,i,"f").push(e),this._connect()}offUpdate(e){if(!e)throw new Error("Callback handler is not provided");d(this,i,h(this,i,"f").filter((t=>t!==e)),"f"),this._disconnectIfUnused()}onError(e){if(!e)throw new Error("Callback handler is not provided");h(this,o,"f").push(e),this._connect()}offError(e){if(!e)throw new Error("Callback handler is not provided");d(this,o,h(this,o,"f").filter((t=>t!==e)),"f"),this._disconnectIfUnused()}subscribe(e){return l(this,void 0,void 0,(function*(){h(this,s,"f").has(e)||(h(this,s,"f").add(e),yield this._sendWebsocketMessage({action:"subscribe",taskId:e}))}))}unsubscribe(e){return l(this,void 0,void 0,(function*(){h(this,s,"f").has(e)&&(h(this,s,"f").delete(e),yield this._sendWebsocketMessage({action:"unsubscribe",taskId:e}))}))}hasHandlers(){return h(this,i,"f").length>0||h(this,o,"f").length>0}_connect(){h(this,a,"f")||(d(this,a,new p.default(h(this,n,"f")),"f"),h(this,a,"f").onopen=()=>l(this,void 0,void 0,(function*(){h(this,s,"f").forEach((e=>{this._sendWebsocketMessage({action:"subscribe",taskId:e})}))})),h(this,a,"f").onclose=()=>{setTimeout((()=>{this._reconnect()}),h(this,c,"f"))},h(this,a,"f").onerror=e=>{this._handleError(e)},h(this,a,"f").onmessage=e=>l(this,void 0,void 0,(function*(){const t=JSON.parse(e.data.toString());switch(t.event){case y.WebsocketEvent.ERROR:{const e=t.payload;this._handleError(e);break}case y.WebsocketEvent.UPDATE:{const e=t.payload;h(this,i,"f").forEach((t=>{t(e)})),(0,g.isFinalTaskState)(e.taskState)&&(yield this.unsubscribe(e.taskId));break}}})))}_sendWebsocketMessage(e){return l(this,void 0,void 0,(function*(){(yield this._ensureIsConnected())&&h(this,a,"f").send(JSON.stringify(e))}))}_disconnectIfUnused(){0===h(this,i,"f").length&&0===h(this,o,"f").length&&h(this,a,"f")&&this._disconnect()}_disconnect(){h(this,a,"f")&&(h(this,a,"f").close(),d(this,a,void 0,"f"))}_reconnect(){this._disconnect(),this._connect()}_ensureIsConnected(){return l(this,void 0,void 0,(function*(){return h(this,a,"f")?h(this,a,"f").readyState!==p.default.CONNECTING&&h(this,a,"f").readyState!==p.default.OPEN&&this._reconnect():this._connect(),yield this._awaitConnection()}))}_awaitConnection(){return l(this,void 0,void 0,(function*(){const e=Date.now();for(;!h(this,a,"f")||h(this,a,"f").readyState!==p.default.OPEN;){const t=Date.now()-e;if(t>h(this,u,"f"))return this._handleError(new Error(`Timeout connecting to ${h(this,n,"f")} after ${t}ms`)),!1;yield new Promise((e=>setTimeout(e,10)))}return!0}))}_handleError(e){h(this,o,"f").forEach((t=>{t(e)}))}},n=new WeakMap,s=new WeakMap,i=new WeakMap,o=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap},5344:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketEvent=void 0,(r=t.WebsocketEvent||(t.WebsocketEvent={})).ERROR="error",r.UPDATE="update"},1497:(e,t,r)=>{e.exports=r(2573)},5944:(e,t,r)=>{"use strict";var n=r(7702),s=r(6090),i=r(1412),o=r(5783),a=r(5166),c=r(115),u=r(8393),l=r(2914),d=r(9778),h=r(4577),f=r(7526);e.exports=function(e){return new Promise((function(t,r){var p,g=e.data,y=e.headers,m=e.responseType;function b(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}n.isFormData(g)&&n.isStandardBrowserEnv()&&delete y["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",A=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";y.Authorization="Basic "+btoa(w+":"+A)}var P=a(e.baseURL,e.url);function E(){if(v){var n="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,i={data:m&&"text"!==m&&"json"!==m?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};s((function(e){t(e),b()}),(function(e){r(e),b()}),i),v=null}}if(v.open(e.method.toUpperCase(),o(P,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=E:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(E)},v.onabort=function(){v&&(r(new d("Request aborted",d.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new d("Network Error",d.ERR_NETWORK,e,v,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||l;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new d(t,n.clarifyTimeoutError?d.ETIMEDOUT:d.ECONNABORTED,e,v)),v=null},n.isStandardBrowserEnv()){var C=(e.withCredentials||u(P))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;C&&(y[e.xsrfHeaderName]=C)}"setRequestHeader"in v&&n.forEach(y,(function(e,t){void 0===g&&"content-type"===t.toLowerCase()?delete y[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),m&&"json"!==m&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){v&&(r(!e||e&&e.type?new h:e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),g||(g=null);var S=f(P);S&&-1===["http","https","file"].indexOf(S)?r(new d("Unsupported protocol "+S+":",d.ERR_BAD_REQUEST,e)):v.send(g)}))}},2573:(e,t,r)=>{"use strict";var n=r(7702),s=r(3889),i=r(2322),o=r(8697),a=function e(t){var r=new i(t),a=s(i.prototype.request,r);return n.extend(a,i.prototype,r),n.extend(a,r),a.create=function(r){return e(o(t,r))},a}(r(9814));a.Axios=i,a.CanceledError=r(4577),a.CancelToken=r(4667),a.isCancel=r(4901),a.VERSION=r(4007).version,a.toFormData=r(4548),a.AxiosError=r(9778),a.Cancel=a.CanceledError,a.all=function(e){return Promise.all(e)},a.spread=r(5578),a.isAxiosError=r(7993),e.exports=a,e.exports.default=a},4667:(e,t,r)=>{"use strict";var n=r(4577);function s(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t{"use strict";var n=r(9778);function s(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}r(7702).inherits(s,n,{__CANCEL__:!0}),e.exports=s},4901:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},2322:(e,t,r)=>{"use strict";var n=r(7702),s=r(5783),i=r(7634),o=r(2956),a=r(8697),c=r(5166),u=r(5976),l=u.validators;function d(e){this.defaults=e,this.interceptors={request:new i,response:new i}}d.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&u.assertOptions(r,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1);var n=[],s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var i,c=[];if(this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)})),!s){var d=[o,void 0];for(Array.prototype.unshift.apply(d,n),d=d.concat(c),i=Promise.resolve(t);d.length;)i=i.then(d.shift(),d.shift());return i}for(var h=t;n.length;){var f=n.shift(),p=n.shift();try{h=f(h)}catch(e){p(e);break}}try{i=o(h)}catch(e){return Promise.reject(e)}for(;c.length;)i=i.then(c.shift(),c.shift());return i},d.prototype.getUri=function(e){e=a(this.defaults,e);var t=c(e.baseURL,e.url);return s(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],(function(e){d.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,s){return this.request(a(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}d.prototype[e]=t(),d.prototype[e+"Form"]=t(!0)})),e.exports=d},9778:(e,t,r)=>{"use strict";var n=r(7702);function s(e,t,r,n,s){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s)}n.inherits(s,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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var i=s.prototype,o={};["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"].forEach((function(e){o[e]={value:e}})),Object.defineProperties(s,o),Object.defineProperty(i,"isAxiosError",{value:!0}),s.from=function(e,t,r,o,a,c){var u=Object.create(i);return n.toFlatObject(e,u,(function(e){return e!==Error.prototype})),s.call(u,e.message,t,r,o,a),u.name=e.name,c&&Object.assign(u,c),u},e.exports=s},7634:(e,t,r)=>{"use strict";var n=r(7702);function s(){this.handlers=[]}s.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},s.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},s.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=s},5166:(e,t,r)=>{"use strict";var n=r(85),s=r(9016);e.exports=function(e,t){return e&&!n(t)?s(e,t):t}},2956:(e,t,r)=>{"use strict";var n=r(7702),s=r(866),i=r(4901),o=r(9814),a=r(4577);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=s.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return c(e),t.data=s.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(c(e),t&&t.response&&(t.response.data=s.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},8697:(e,t,r)=>{"use strict";var n=r(7702);e.exports=function(e,t){t=t||{};var r={};function s(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function i(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:s(void 0,e[r]):s(e[r],t[r])}function o(e){if(!n.isUndefined(t[e]))return s(void 0,t[e])}function a(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:s(void 0,e[r]):s(void 0,t[r])}function c(r){return r in t?s(e[r],t[r]):r in e?s(void 0,e[r]):void 0}var u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials: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:c};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||i,s=t(e);n.isUndefined(s)&&t!==c||(r[e]=s)})),r}},6090:(e,t,r)=>{"use strict";var n=r(9778);e.exports=function(e,t,r){var s=r.config.validateStatus;r.status&&s&&!s(r.status)?t(new n("Request failed with status code "+r.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}},866:(e,t,r)=>{"use strict";var n=r(7702),s=r(9814);e.exports=function(e,t,r){var i=this||s;return n.forEach(r,(function(r){e=r.call(i,e,t)})),e}},9814:(e,t,r)=>{"use strict";var n=r(7702),s=r(1255),i=r(9778),o=r(2914),a=r(4548),c={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var l,d={transitional:o,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(l=r(5944)),l),transformRequest:[function(e,t){if(s(t,"Accept"),s(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e))return e;if(n.isArrayBufferView(e))return e.buffer;if(n.isURLSearchParams(e))return u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,i=n.isObject(e),o=t&&t["Content-Type"];if((r=n.isFileList(e))||i&&"multipart/form-data"===o){var c=this.env&&this.env.FormData;return a(r?{"files[]":e}:e,c&&new c)}return i||"application/json"===o?(u(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(0,JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||d.transitional,r=t&&t.silentJSONParsing,s=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||s&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw i.from(e,i.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:r(6404)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){d.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){d.headers[e]=n.merge(c)})),e.exports=d},2914:e=>{"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},4007:e=>{e.exports={version:"0.27.2"}},3889:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n{"use strict";var n=r(7702);function s(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var o=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),o.push(s(t)+"="+s(e))})))})),i=o.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},9016:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},1412:(e,t,r)=>{"use strict";var n=r(7702);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,s,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(s)&&a.push("path="+s),n.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},85:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},7993:(e,t,r)=>{"use strict";var n=r(7702);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},8393:(e,t,r)=>{"use strict";var n=r(7702);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function s(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=s(window.location.href),function(t){var r=n.isString(t)?s(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},1255:(e,t,r)=>{"use strict";var n=r(7702);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},6404:e=>{e.exports=null},115:(e,t,r)=>{"use strict";var n=r(7702),s=["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"];e.exports=function(e){var t,r,i,o={};return e?(n.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(o[t]&&s.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o}},7526:e=>{"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},5578:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4548:(e,t,r)=>{"use strict";var n=r(7702);e.exports=function(e,t){t=t||new FormData;var r=[];function s(e){return null===e?"":n.isDate(e)?e.toISOString():n.isArrayBuffer(e)||n.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}return function e(i,o){if(n.isPlainObject(i)||n.isArray(i)){if(-1!==r.indexOf(i))throw Error("Circular reference detected in "+o);r.push(i),n.forEach(i,(function(r,i){if(!n.isUndefined(r)){var a,c=o?o+"."+i:i;if(r&&!o&&"object"==typeof r)if(n.endsWith(i,"{}"))r=JSON.stringify(r);else if(n.endsWith(i,"[]")&&(a=n.toArray(r)))return void a.forEach((function(e){!n.isUndefined(e)&&t.append(c,s(e))}));e(r,c)}})),r.pop()}else t.append(o,s(i))}(e),t}},5976:(e,t,r)=>{"use strict";var n=r(4007).version,s=r(9778),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var o={};i.transitional=function(e,t,r){function i(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,a){if(!1===e)throw new s(i(n," has been removed"+(t?" in "+t:"")),s.ERR_DEPRECATED);return t&&!o[n]&&(o[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,a)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new s("options must be an object",s.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),i=n.length;i-- >0;){var o=n[i],a=t[o];if(a){var c=e[o],u=void 0===c||a(c,o,e);if(!0!==u)throw new s("option "+o+" must be "+u,s.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new s("Unknown option "+o,s.ERR_BAD_OPTION)}},validators:i}},7702:(e,t,r)=>{"use strict";var n,s=r(3889),i=Object.prototype.toString,o=(n=Object.create(null),function(e){var t=i.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())});function a(e){return e=e.toLowerCase(),function(t){return o(t)===e}}function c(e){return Array.isArray(e)}function u(e){return void 0===e}var l=a("ArrayBuffer");function d(e){return null!==e&&"object"==typeof e}function h(e){if("object"!==o(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var f=a("Date"),p=a("File"),g=a("Blob"),y=a("FileList");function m(e){return"[object Function]"===i.call(e)}var b=a("URLSearchParams");function v(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),c(e))for(var r=0,n=e.length;r0;)o[i=n[s]]||(t[i]=e[i],o[i]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:a,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;var t=e.length;if(u(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:A,isFileList:y}},7320:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function s(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function i(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function o(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 a(e,t){s(e);const r=t.outputLen;if(e.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(7320),s=r(8089);class i extends s.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,s.createView)(this.buffer)}update(e){n.default.exists(this);const{view:t,buffer:r,blockLen:i}=this,o=(e=(0,s.toBytes)(e)).length;for(let n=0;ni-a&&(this.process(r,0),a=0);for(let e=a;e>s&i),a=Number(r&i),c=n?4:0,u=n?0:4;e.setUint32(t+c,o,n),e.setUint32(t+u,a,n)}(r,i-8,BigInt(8*this.length),o),this.process(r,0);const c=(0,s.createView)(e);this.get().forEach(((e,t)=>c.setUint32(4*t,e,o)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:s,destroyed:i,pos:o}=this;return e.length=n,e.pos=o,e.finished=s,e.destroyed=i,n%t&&e.buffer.set(r),e}}t.SHA2=i},6873:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function s(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function i(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i>>0)+(n>>>0);return{h:e+r+(s/2**32|0)|0,l:0|s}}t.fromBig=s,t.split=i,t.toBig=(e,t)=>BigInt(e>>>0)<>>0),t.add=o;const a={fromBig:s,split:i,toBig:t.toBig,shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<>>32-r,rotlSL:(e,t,r)=>t<>>32-r,rotlBH:(e,t,r)=>t<>>64-r,rotlBL:(e,t,r)=>e<>>64-r,add:o,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,s)=>t+r+n+s+(e/2**32|0)|0,add5H:(e,t,r,n,s,i)=>t+r+n+s+i+(e/2**32|0)|0,add5L:(e,t,r,n,s)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(s>>>0)};t.default=a},4421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto={node:void 0,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0}},9569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=void 0;const n=r(7320),s=r(8089);class i extends s.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,n.default.hash(e);const r=(0,s.toBytes)(t);if(this.iHash=e.create(),!(this.iHash instanceof s.Hash))throw new TypeError("Expected instance of class which extends utils.Hash");const i=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const o=new Uint8Array(i);o.set(r.length>this.iHash.blockLen?e.create().update(r).digest():r);for(let e=0;enew i(e,t).update(r).digest(),t.hmac.create=(e,t)=>new i(e,t)},9023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2Async=t.pbkdf2=void 0;const n=r(7320),s=r(9569),i=r(8089);function o(e,t,r,o){n.default.hash(e);const a=(0,i.checkOpts)({dkLen:32,asyncTick:10},o),{c,dkLen:u,asyncTick:l}=a;if(n.default.number(c),n.default.number(u),n.default.number(l),c<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const d=(0,i.toBytes)(t),h=(0,i.toBytes)(r),f=new Uint8Array(u),p=s.hmac.create(e,d),g=p._cloneInto().update(h);return{c,dkLen:u,asyncTick:l,DK:f,PRF:p,PRFSalt:g}}function a(e,t,r,n,s){return e.destroy(),t.destroy(),n&&n.destroy(),s.fill(0),r}t.pbkdf2=function(e,t,r,n){const{c:s,dkLen:c,DK:u,PRF:l,PRFSalt:d}=o(e,t,r,n);let h;const f=new Uint8Array(4),p=(0,i.createView)(f),g=new Uint8Array(l.outputLen);for(let e=1,t=0;t{d._cloneInto(f).update(y).digestInto(y);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const n=r(7505),s=r(8089),i=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),o=Uint8Array.from({length:16},((e,t)=>t)),a=o.map((e=>(9*e+5)%16));let c=[o],u=[a];for(let e=0;e<4;e++)for(let t of[c,u])t.push(t[e].map((e=>i[e])));const l=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),d=c.map(((e,t)=>e.map((e=>l[t][e])))),h=u.map(((e,t)=>e.map((e=>l[t][e])))),f=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),p=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),g=(e,t)=>e<>>32-t;function y(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const m=new Uint32Array(16);class b extends n.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:s}=this;return[e,t,r,n,s]}set(e,t,r,n,s){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)m[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,s=0|this.h1,i=s,o=0|this.h2,a=o,l=0|this.h3,b=l,v=0|this.h4,w=v;for(let e=0;e<5;e++){const t=4-e,A=f[e],P=p[e],E=c[e],C=u[e],S=d[e],k=h[e];for(let t=0;t<16;t++){const n=g(r+y(e,s,o,l)+m[E[t]]+A,S[t])+v|0;r=v,v=l,l=0|g(o,10),o=s,s=n}for(let e=0;e<16;e++){const r=g(n+y(t,i,a,b)+m[C[e]]+P,k[e])+w|0;n=w,w=b,b=0|g(a,10),a=i,i=r}}this.set(this.h1+o+b|0,this.h2+l+w|0,this.h3+v+n|0,this.h4+r+i|0,this.h0+s+a|0)}roundClean(){m.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=b,t.ripemd160=(0,s.wrapConstructor)((()=>new b))},9514:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scryptAsync=t.scrypt=void 0;const n=r(7320),s=r(3061),i=r(9023),o=r(8089),a=(e,t)=>e<>>32-t;function c(e,t,r,n,s,i){let o=e[t++]^r[n++],c=e[t++]^r[n++],u=e[t++]^r[n++],l=e[t++]^r[n++],d=e[t++]^r[n++],h=e[t++]^r[n++],f=e[t++]^r[n++],p=e[t++]^r[n++],g=e[t++]^r[n++],y=e[t++]^r[n++],m=e[t++]^r[n++],b=e[t++]^r[n++],v=e[t++]^r[n++],w=e[t++]^r[n++],A=e[t++]^r[n++],P=e[t++]^r[n++],E=o,C=c,S=u,k=l,O=d,R=h,T=f,N=p,x=g,I=y,_=m,B=b,j=v,L=w,U=A,D=P;for(let e=0;e<8;e+=2)O^=a(E+j|0,7),x^=a(O+E|0,9),j^=a(x+O|0,13),E^=a(j+x|0,18),I^=a(R+C|0,7),L^=a(I+R|0,9),C^=a(L+I|0,13),R^=a(C+L|0,18),U^=a(_+T|0,7),S^=a(U+_|0,9),T^=a(S+U|0,13),_^=a(T+S|0,18),k^=a(D+B|0,7),N^=a(k+D|0,9),B^=a(N+k|0,13),D^=a(B+N|0,18),C^=a(E+k|0,7),S^=a(C+E|0,9),k^=a(S+C|0,13),E^=a(k+S|0,18),T^=a(R+O|0,7),N^=a(T+R|0,9),O^=a(N+T|0,13),R^=a(O+N|0,18),B^=a(_+I|0,7),x^=a(B+_|0,9),I^=a(x+B|0,13),_^=a(I+x|0,18),j^=a(D+U|0,7),L^=a(j+D|0,9),U^=a(L+j|0,13),D^=a(U+L|0,18);s[i++]=o+E|0,s[i++]=c+C|0,s[i++]=u+S|0,s[i++]=l+k|0,s[i++]=d+O|0,s[i++]=h+R|0,s[i++]=f+T|0,s[i++]=p+N|0,s[i++]=g+x|0,s[i++]=y+I|0,s[i++]=m+_|0,s[i++]=b+B|0,s[i++]=v+j|0,s[i++]=w+L|0,s[i++]=A+U|0,s[i++]=P+D|0}function u(e,t,r,n,s){let i=n+0,o=n+16*s;for(let n=0;n<16;n++)r[o+n]=e[t+16*(2*s-1)+n];for(let n=0;n0&&(o+=16),c(r,i,e,t+=16,r,o)}function l(e,t,r){const a=(0,o.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:c,r:u,p:l,dkLen:d,asyncTick:h,maxmem:f,onProgress:p}=a;if(n.default.number(c),n.default.number(u),n.default.number(l),n.default.number(d),n.default.number(h),n.default.number(f),void 0!==p&&"function"!=typeof p)throw new Error("progressCb should be function");const g=128*u,y=g/4;if(c<=1||0!=(c&c-1)||c>=2**(g/8)||c>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(l<0||l>137438953440/g)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(d<0||d>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const m=g*(c+l);if(m>f)throw new Error(`Scrypt: parameters too large, ${m} (128 * r * (N + p)) > ${f} (maxmem)`);const b=(0,i.pbkdf2)(s.sha256,e,t,{c:1,dkLen:g*l}),v=(0,o.u32)(b),w=(0,o.u32)(new Uint8Array(g*c)),A=(0,o.u32)(new Uint8Array(g));let P=()=>{};if(p){const e=2*c*l,t=Math.max(Math.floor(e/1e4),1);let r=0;P=()=>{r++,!p||r%t&&r!==e||p(r/e)}}return{N:c,r:u,p:l,dkLen:d,blockSize32:y,V:w,B32:v,B:b,tmp:A,blockMixCb:P,asyncTick:h}}function d(e,t,r,n,o){const a=(0,i.pbkdf2)(s.sha256,e,r,{c:1,dkLen:t});return r.fill(0),n.fill(0),o.fill(0),a}t.scrypt=function(e,t,r){const{N:n,r:s,p:i,dkLen:o,blockSize32:a,V:c,B32:h,B:f,tmp:p,blockMixCb:g}=l(e,t,r);for(let e=0;e{u(h,r,h,r+=c,s),y()})),u(h,(n-1)*c,f,t,s),y(),await(0,o.asyncLoop)(n,m,(e=>{const r=f[t+c-16]%n;for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const n=r(7505),s=r(8089),i=(e,t,r)=>e&t^e&r^t&r,o=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]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class u extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:r,D:n,E:s,F:i,G:o,H:a}=this;return[e,t,r,n,s,i,o,a]}set(e,t,r,n,s,i,o,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|s,this.F=0|i,this.G=0|o,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=c[e-15],r=c[e-2],n=(0,s.rotr)(t,7)^(0,s.rotr)(t,18)^t>>>3,i=(0,s.rotr)(r,17)^(0,s.rotr)(r,19)^r>>>10;c[e]=i+c[e-7]+n+c[e-16]|0}let{A:r,B:n,C:a,D:u,E:l,F:d,G:h,H:f}=this;for(let e=0;e<64;e++){const t=f+((0,s.rotr)(l,6)^(0,s.rotr)(l,11)^(0,s.rotr)(l,25))+((p=l)&d^~p&h)+o[e]+c[e]|0,g=((0,s.rotr)(r,2)^(0,s.rotr)(r,13)^(0,s.rotr)(r,22))+i(r,n,a)|0;f=h,h=d,d=l,l=u+t|0,u=a,a=n,n=r,r=t+g|0}var p;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,u=u+this.D|0,l=l+this.E|0,d=d+this.F|0,h=h+this.G|0,f=f+this.H|0,this.set(r,n,a,u,l,d,h,f)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.sha256=(0,s.wrapConstructor)((()=>new u))},5426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=t.keccakP=void 0;const n=r(7320),s=r(6873),i=r(8089),[o,a,c]=[[],[],[]],u=BigInt(0),l=BigInt(1),d=BigInt(2),h=BigInt(7),f=BigInt(256),p=BigInt(113);for(let e=0,t=l,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],o.push(2*(5*n+r)),a.push((e+1)*(e+2)/2%64);let s=u;for(let e=0;e<7;e++)t=(t<>h)*p)%f,t&d&&(s^=l<<(l<r>32?s.default.rotlBH(e,t,r):s.default.rotlSH(e,t,r),b=(e,t,r)=>r>32?s.default.rotlBL(e,t,r):s.default.rotlSL(e,t,r);function v(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,s=(t+2)%10,i=r[s],o=r[s+1],a=m(i,o,1)^r[n],c=b(i,o,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],s=e[3];for(let r=0;r<24;r++){const n=a[r],i=m(t,s,n),c=b(t,s,n),u=o[r];t=e[u],s=e[u+1],e[u]=i,e[u+1]=c}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=g[n],e[1]^=y[n]}r.fill(0)}t.keccakP=v;class w extends i.Hash{constructor(e,t,r,s=!1,o=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=s,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.default.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}keccak(){v(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){n.default.exists(this);const{blockLen:t,state:r}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n=r&&this.keccak();const i=Math.min(r-this.posOut,s-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=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 n.default.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(n.default.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:s,enableXOF:i}=this;return e||(e=new w(t,r,n,i,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}t.Keccak=w;const A=(e,t,r)=>(0,i.wrapConstructor)((()=>new w(t,e,r)));t.sha3_224=A(6,144,28),t.sha3_256=A(6,136,32),t.sha3_384=A(6,104,48),t.sha3_512=A(6,72,64),t.keccak_224=A(1,144,28),t.keccak_256=A(1,136,32),t.keccak_384=A(1,104,48),t.keccak_512=A(1,72,64);const P=(e,t,r)=>(0,i.wrapConstructorWithOpts)(((n={})=>new w(t,e,void 0===n.dkLen?r:n.dkLen,!0)));t.shake128=P(31,168,16),t.shake256=P(31,136,32)},6262:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512=t.SHA512=void 0;const n=r(7505),s=r(6873),i=r(8089),[o,a]=s.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))),c=new Uint32Array(80),u=new Uint32Array(80);class l extends n.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:s,Cl:i,Dh:o,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:h,Gl:f,Hh:p,Hl:g}=this;return[e,t,r,n,s,i,o,a,c,u,l,d,h,f,p,g]}set(e,t,r,n,s,i,o,a,c,u,l,d,h,f,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|s,this.Cl=0|i,this.Dh=0|o,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|h,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t),u[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|c[e-15],r=0|u[e-15],n=s.default.rotrSH(t,r,1)^s.default.rotrSH(t,r,8)^s.default.shrSH(t,r,7),i=s.default.rotrSL(t,r,1)^s.default.rotrSL(t,r,8)^s.default.shrSL(t,r,7),o=0|c[e-2],a=0|u[e-2],l=s.default.rotrSH(o,a,19)^s.default.rotrBH(o,a,61)^s.default.shrSH(o,a,6),d=s.default.rotrSL(o,a,19)^s.default.rotrBL(o,a,61)^s.default.shrSL(o,a,6),h=s.default.add4L(i,d,u[e-7],u[e-16]),f=s.default.add4H(h,n,l,c[e-7],c[e-16]);c[e]=0|f,u[e]=0|h}let{Ah:r,Al:n,Bh:i,Bl:l,Ch:d,Cl:h,Dh:f,Dl:p,Eh:g,El:y,Fh:m,Fl:b,Gh:v,Gl:w,Hh:A,Hl:P}=this;for(let e=0;e<80;e++){const t=s.default.rotrSH(g,y,14)^s.default.rotrSH(g,y,18)^s.default.rotrBH(g,y,41),E=s.default.rotrSL(g,y,14)^s.default.rotrSL(g,y,18)^s.default.rotrBL(g,y,41),C=g&m^~g&v,S=y&b^~y&w,k=s.default.add5L(P,E,S,a[e],u[e]),O=s.default.add5H(k,A,t,C,o[e],c[e]),R=0|k,T=s.default.rotrSH(r,n,28)^s.default.rotrBH(r,n,34)^s.default.rotrBH(r,n,39),N=s.default.rotrSL(r,n,28)^s.default.rotrBL(r,n,34)^s.default.rotrBL(r,n,39),x=r&i^r&d^i&d,I=n&l^n&h^l&h;A=0|v,P=0|w,v=0|m,w=0|b,m=0|g,b=0|y,({h:g,l:y}=s.default.add(0|f,0|p,0|O,0|R)),f=0|d,p=0|h,d=0|i,h=0|l,i=0|r,l=0|n;const _=s.default.add3L(R,N,I);r=s.default.add3H(_,O,T,x),n=0|_}({h:r,l:n}=s.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l}=s.default.add(0|this.Bh,0|this.Bl,0|i,0|l)),({h:d,l:h}=s.default.add(0|this.Ch,0|this.Cl,0|d,0|h)),({h:f,l:p}=s.default.add(0|this.Dh,0|this.Dl,0|f,0|p)),({h:g,l:y}=s.default.add(0|this.Eh,0|this.El,0|g,0|y)),({h:m,l:b}=s.default.add(0|this.Fh,0|this.Fl,0|m,0|b)),({h:v,l:w}=s.default.add(0|this.Gh,0|this.Gl,0|v,0|w)),({h:A,l:P}=s.default.add(0|this.Hh,0|this.Hl,0|A,0|P)),this.set(r,n,i,l,d,h,f,p,g,y,m,b,v,w,A,P)}roundClean(){c.fill(0),u.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=l;class d extends l{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class h extends l{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,i.wrapConstructor)((()=>new l)),t.sha512_256=(0,i.wrapConstructor)((()=>new d)),t.sha384=(0,i.wrapConstructor)((()=>new h))},8089:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(4421);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const s=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function i(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}function o(e){if("string"==typeof e&&(e=i(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r{},t.asyncLoop=async function(e,r,n){let s=Date.now();for(let i=0;i=0&&ee instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;te().update(o(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(o(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto.web)return n.crypto.web.getRandomValues(new Uint8Array(e));if(n.crypto.node)return new Uint8Array(n.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}},9656:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.schnorr=t.verify=t.signSync=t.sign=t.getSharedSecret=t.recoverPublicKey=t.getPublicKey=t.Signature=t.Point=t.CURVE=void 0;const n=r(9159),s=BigInt(0),i=BigInt(1),o=BigInt(2),a=BigInt(3),c=BigInt(8),u=Object.freeze({a:s,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:i,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")});t.CURVE=u;const l=(e,t)=>(e+t/o)/t,d={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(e){const{n:t}=u,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-i*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=l(o*e,t),d=l(-n*e,t);let h=F(e-c*r-d*s,t),f=F(-c*n-d*o,t);const p=h>a,g=f>a;if(p&&(h=t-h),g&&(f=t-f),h>a||f>a)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:p,k1:h,k2neg:g,k2:f}}},h=32,f=32,p=h+1,g=2*h+1;function y(e){const{a:t,b:r}=u,n=F(e*e),s=F(n*e);return F(s+t*e+r)}const m=u.a===s;class b extends Error{constructor(e){super(e)}}function v(e){if(!(e instanceof w))throw new TypeError("JacobianPoint expected")}class w{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof E))throw new TypeError("JacobianPoint#fromAffine: expected Point");return e.equals(E.ZERO)?w.ZERO:new w(e.x,e.y,i)}static toAffineBatch(e){const t=function(e,t=u.P){const r=new Array(e.length),n=H(e.reduce(((e,n,i)=>n===s?e:(r[i]=e,F(e*n,t))),i),t);return e.reduceRight(((e,n,i)=>n===s?e:(r[i]=F(e*r[i],t),F(e*n,t))),n),r}(e.map((e=>e.z)));return e.map(((e,r)=>e.toAffine(t[r])))}static normalizeZ(e){return w.toAffineBatch(e).map(w.fromAffine)}equals(e){v(e);const{x:t,y:r,z:n}=this,{x:s,y:i,z:o}=e,a=F(n*n),c=F(o*o),u=F(t*c),l=F(s*a),d=F(F(r*o)*c),h=F(F(i*n)*a);return u===l&&d===h}negate(){return new w(this.x,F(-this.y),this.z)}double(){const{x:e,y:t,z:r}=this,n=F(e*e),s=F(t*t),i=F(s*s),u=e+s,l=F(o*(F(u*u)-n-i)),d=F(a*n),h=F(d*d),f=F(h-o*l),p=F(d*(l-f)-c*i),g=F(o*t*r);return new w(f,p,g)}add(e){v(e);const{x:t,y:r,z:n}=this,{x:i,y:a,z:c}=e;if(i===s||a===s)return this;if(t===s||r===s)return e;const u=F(n*n),l=F(c*c),d=F(t*l),h=F(i*u),f=F(F(r*c)*l),p=F(F(a*n)*u),g=F(h-d),y=F(p-f);if(g===s)return y===s?this.double():w.ZERO;const m=F(g*g),b=F(g*m),A=F(d*m),P=F(y*y-b-o*A),E=F(y*(A-P)-f*b),C=F(n*c*g);return new w(P,E,C)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){const t=w.ZERO;if("bigint"==typeof e&&e===s)return t;let r=D(e);if(r===i)return this;if(!m){let e=t,n=this;for(;r>s;)r&i&&(e=e.add(n)),n=n.double(),r>>=i;return e}let{k1neg:n,k1:o,k2neg:a,k2:c}=d.splitScalar(r),u=t,l=t,h=this;for(;o>s||c>s;)o&i&&(u=u.add(h)),c&i&&(l=l.add(h)),h=h.double(),o>>=i,c>>=i;return n&&(u=u.negate()),a&&(l=l.negate()),l=new w(F(l.x*d.beta),l.y,l.z),u.add(l)}precomputeWindow(e){const t=m?128/e+1:256/e+1,r=[];let n=this,s=n;for(let i=0;i>=d,a>c&&(a-=l,e+=i);const h=r,f=r+Math.abs(a)-1,p=t%2!=0,g=a<0;0===a?o=o.add(A(p,n[h])):s=s.add(A(g,n[f]))}return{p:s,f:o}}multiply(e,t){let r,n,s=D(e);if(m){const{k1neg:e,k1:i,k2neg:o,k2:a}=d.splitScalar(s);let{p:c,f:u}=this.wNAF(i,t),{p:l,f:h}=this.wNAF(a,t);c=A(e,c),l=A(o,l),l=new w(F(l.x*d.beta),l.y,l.z),r=c.add(l),n=u.add(h)}else{const{p:e,f:i}=this.wNAF(s,t);r=e,n=i}return w.normalizeZ([r,n])[0]}toAffine(e){const{x:t,y:r,z:n}=this,s=this.equals(w.ZERO);null==e&&(e=s?c:H(n));const o=e,a=F(o*o),u=F(a*o),l=F(t*a),d=F(r*u),h=F(n*o);if(s)return E.ZERO;if(h!==i)throw new Error("invZ was invalid");return new E(l,d)}}function A(e,t){const r=t.negate();return e?r:t}w.BASE=new w(u.Gx,u.Gy,i),w.ZERO=new w(s,i,s);const P=new WeakMap;class E{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,P.delete(this)}hasEvenY(){return this.y%o===s}static fromCompressedHex(e){const t=32===e.length,r=L(t?e:e.subarray(1));if(!V(r))throw new Error("Point is not on curve");let n=function(e){const{P:t}=u,r=BigInt(6),n=BigInt(11),s=BigInt(22),i=BigInt(23),c=BigInt(44),l=BigInt(88),d=e*e*e%t,h=d*d*e%t,f=M(h,a)*h%t,p=M(f,a)*h%t,g=M(p,o)*d%t,y=M(g,n)*g%t,m=M(y,s)*y%t,b=M(m,c)*m%t,v=M(b,l)*b%t,w=M(v,c)*m%t,A=M(w,a)*h%t,P=M(A,i)*y%t,E=M(P,r)*d%t,C=M(E,o);if(C*C%t!==e)throw new Error("Cannot find square root");return C}(y(r));const s=(n&i)===i;t?s&&(n=F(-n)):1==(1&e[0])!==s&&(n=F(-n));const c=new E(r,n);return c.assertValidity(),c}static fromUncompressedHex(e){const t=L(e.subarray(1,h+1)),r=L(e.subarray(h+1,2*h+1)),n=new E(t,r);return n.assertValidity(),n}static fromHex(e){const t=U(e),r=t.length,n=t[0];if(r===h)return this.fromCompressedHex(t);if(r===p&&(2===n||3===n))return this.fromCompressedHex(t);if(r===g&&4===n)return this.fromUncompressedHex(t);throw new Error(`Point.fromHex: received invalid point. Expected 32-${p} compressed bytes or ${g} uncompressed bytes, not ${r}`)}static fromPrivateKey(e){return E.BASE.multiply(Q(e))}static fromSignature(e,t,r){const{r:n,s}=Z(t);if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");const i=G(U(e)),{n:o}=u,a=2===r||3===r?n+o:n,c=H(a,o),l=F(-i*c,o),d=F(s*c,o),h=1&r?"03":"02",f=E.fromHex(h+x(a)),p=E.BASE.multiplyAndAddUnsafe(f,l,d);if(!p)throw new Error("Cannot recover signature: point at infinify");return p.assertValidity(),p}toRawBytes(e=!1){return j(this.toHex(e))}toHex(e=!1){const t=x(this.x);return e?`${this.hasEvenY()?"02":"03"}${t}`:`04${t}${x(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{x:t,y:r}=this;if(!V(t)||!V(r))throw new Error(e);const n=F(r*r);if(F(n-y(t))!==s)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new E(this.x,F(-this.y))}double(){return w.fromAffine(this).double().toAffine()}add(e){return w.fromAffine(this).add(w.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return w.fromAffine(this).multiply(e,this).toAffine()}multiplyAndAddUnsafe(e,t,r){const n=w.fromAffine(this),o=t===s||t===i||this!==E.BASE?n.multiplyUnsafe(t):n.multiply(t),a=w.fromAffine(e).multiplyUnsafe(r),c=o.add(a);return c.equals(w.ZERO)?void 0:c.toAffine()}}function C(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function S(e){if(e.length<2||2!==e[0])throw new Error(`Invalid signature integer tag: ${T(e)}`);const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:L(r),left:e.subarray(t+2)}}t.Point=E,E.BASE=new E(u.Gx,u.Gy),E.ZERO=new E(s,s);class k{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromCompact(e){const t=e instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof e&&!t)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=t?T(e):e;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new k(B(n.slice(0,64)),B(n.slice(64,128)))}static fromDER(e){const t=e instanceof Uint8Array;if("string"!=typeof e&&!t)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r,s:n}=function(e){if(e.length<2||48!=e[0])throw new Error(`Invalid signature tag: ${T(e)}`);if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");const{data:t,left:r}=S(e.subarray(2)),{data:n,left:s}=S(r);if(s.length)throw new Error(`Invalid signature: left bytes after parsing: ${T(s)}`);return{r:t,s:n}}(t?e:j(e));return new k(r,n)}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!J(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!J(t))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const e=u.n>>i;return this.s>e}normalizeS(){return this.hasHighS()?new k(this.r,F(-this.s,u.n)):this}toDERRawBytes(){return j(this.toDERHex())}toDERHex(){const e=C(_(this.s)),t=C(_(this.r)),r=e.length/2,n=t.length/2,s=_(r),i=_(n);return`30${_(n+r+4)}02${i}${t}02${s}${e}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return j(this.toCompactHex())}toCompactHex(){return x(this.r)+x(this.s)}}function O(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;tt.toString(16).padStart(2,"0")));function T(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");let t="";for(let r=0;r0)return BigInt(e);if("bigint"==typeof e&&J(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function F(e,t=u.P){const r=e%t;return r>=s?r:t+r}function M(e,t){const{P:r}=u;let n=e;for(;t-- >s;)n*=n,n%=r;return n}function H(e,t=u.P){if(e===s||t<=s)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=F(e,t),n=t,o=s,a=i,c=i,l=s;for(;r!==s;){const e=n/r,t=n%r,s=o-c*e,i=a-l*e;n=r,r=t,o=c,a=l,c=s,l=i}if(n!==i)throw new Error("invert: does not exist");return F(o,t)}function G(e,t=!1){const r=function(e){const t=8*e.length-8*f,r=L(e);return t>0?r>>BigInt(t):r}(e);if(t)return r;const{n}=u;return r>=n?r-n:r}let W,z;class K{constructor(e,t){if(this.hashLen=e,this.qByteLen=t,"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");this.v=new Uint8Array(e).fill(1),this.k=new Uint8Array(e).fill(0),this.counter=0}hmac(...e){return t.utils.hmacSha256(this.k,...e)}hmacSync(...e){return z(this.k,...e)}checkSync(){if("function"!=typeof z)throw new b("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(e=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),e),this.v=await this.hmac(this.v),0!==e.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),e),this.v=await this.hmac(this.v))}reseedSync(e=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}async generate(){this.incr();let e=0;const t=[];for(;e0)t=BigInt(e);else if("string"==typeof e){if(e.length!==2*f)throw new Error("Expected 32 bytes of private key");t=B(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(e.length!==f)throw new Error("Expected 32 bytes of private key");t=L(e)}if(!J(t))throw new Error("Expected private key: 0 < key < n");return t}function Y(e){return e instanceof E?(e.assertValidity(),e):E.fromHex(e)}function Z(e){if(e instanceof k)return e.assertValidity(),e;try{return k.fromDER(e)}catch(t){return k.fromCompact(e)}}function $(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?n===p||n===g:r?n===2*p||n===2*g:e instanceof E}function X(e){return L(e.length>h?e.slice(0,h):e)}function ee(e){const t=X(e),r=F(t,u.n);return te(r{e=U(e);const t=f+8;if(e.length1024)throw new Error("Expected valid bytes of private key as per FIPS 186");return I(F(L(e),u.n-i)+i)},randomBytes:(e=32)=>{if(he.web)return he.web.getRandomValues(new Uint8Array(e));if(he.node){const{randomBytes:t}=he.node;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>t.utils.hashToPrivateKey(t.utils.randomBytes(f+8)),precompute(e=8,t=E.BASE){const r=t===E.BASE?t:new E(t.x,t.y);return r._setWindowSize(e),r.multiply(a),r},sha256:async(...e)=>{if(he.web){const t=await he.web.subtle.digest("SHA-256",O(...e));return new Uint8Array(t)}if(he.node){const{createHash:t}=he.node,r=t("sha256");return e.forEach((e=>r.update(e))),Uint8Array.from(r.digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(he.web){const r=await he.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=O(...t),s=await he.web.subtle.sign("HMAC",r,n);return new Uint8Array(s)}if(he.node){const{createHmac:r}=he.node,n=r("sha256",e);return t.forEach((e=>n.update(e))),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(e,...r)=>{let n=pe[e];if(void 0===n){const r=await t.utils.sha256(Uint8Array.from(e,(e=>e.charCodeAt(0))));n=O(r,r),pe[e]=n}return t.utils.sha256(n,...r)},taggedHashSync:(e,...t)=>{if("function"!=typeof W)throw new b("sha256Sync is undefined, you need to set it");let r=pe[e];if(void 0===r){const t=W(Uint8Array.from(e,(e=>e.charCodeAt(0))));r=O(t,t),pe[e]=r}return W(r,...t)},_JacobianPoint:w},Object.defineProperties(t.utils,{sha256Sync:{configurable:!1,get:()=>W,set(e){W||(W=e)}},hmacSha256Sync:{configurable:!1,get:()=>z,set(e){z||(z=e)}}})},5987:e=>{"use strict";var t={single_source_shortest_paths:function(e,r,n){var s={},i={};i[r]=0;var o,a,c,u,l,d,h,f=t.PriorityQueue.make();for(f.push(r,0);!f.empty();)for(c in a=(o=f.pop()).value,u=o.cost,l=e[a]||{})l.hasOwnProperty(c)&&(d=u+l[c],h=i[c],(void 0===i[c]||h>d)&&(i[c]=d,f.push(c,d),s[c]=a));if(void 0!==n&&void 0===i[n]){var p=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(p)}return s},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,r,n){var s=t.single_source_shortest_paths(e,r,n);return t.extract_shortest_path_from_predecessor_list(s,n)},PriorityQueue:{make:function(e){var r,n=t.PriorityQueue,s={};for(r in e=e||{},n)n.hasOwnProperty(r)&&(s[r]=n[r]);return s.queue=[],s.sorter=e.sorter||n.default_sorter,s},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},2378:e=>{"use strict";e.exports=function(e){for(var t=[],r=e.length,n=0;n=55296&&s<=56319&&r>n+1){var i=e.charCodeAt(n+1);i>=56320&&i<=57343&&(s=1024*(s-55296)+i-56320+65536,n+=1)}s<128?t.push(s):s<2048?(t.push(s>>6|192),t.push(63&s|128)):s<55296||s>=57344&&s<65536?(t.push(s>>12|224),t.push(s>>6&63|128),t.push(63&s|128)):s>=65536&&s<=1114111?(t.push(s>>18|240),t.push(s>>12&63|128),t.push(s>>6&63|128),t.push(63&s|128)):t.push(239,191,189)}return new Uint8Array(t).buffer}},8415:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>i,__asyncDelegator:()=>A,__asyncGenerator:()=>w,__asyncValues:()=>P,__await:()=>v,__awaiter:()=>l,__classPrivateFieldGet:()=>O,__classPrivateFieldIn:()=>T,__classPrivateFieldSet:()=>R,__createBinding:()=>h,__decorate:()=>a,__exportStar:()=>f,__extends:()=>s,__generator:()=>d,__importDefault:()=>k,__importStar:()=>S,__makeTemplateObject:()=>E,__metadata:()=>u,__param:()=>c,__read:()=>g,__rest:()=>o,__spread:()=>y,__spreadArray:()=>b,__spreadArrays:()=>m,__values:()=>p});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function c(e,t){return function(r,n){t(r,n,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))}function d(e,t){var r,n,s,i,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(s=2&i[0]?n.return:i[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,i[1])).done)return s;switch(n=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:case 1:s=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function y(){for(var e=[],t=0;t1||a(e,t)}))})}function a(e,t){try{(r=s[e](t)).value instanceof v?Promise.resolve(r.value.v).then(c,u):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function c(e){a("next",e)}function u(e){a("throw",e)}function l(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function A(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,s){t[n]=e[n]?function(t){return(r=!r)?{value:v(e[n](t)),done:"return"===n}:s?s(t):t}:s}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,s){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,s,(t=e[r](t)).done,t.value)}))}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var C=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&h(t,e,r);return C(t,e),t}function k(e){return e&&e.__esModule?e:{default:e}}function O(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function R(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r}function T(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},6792:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var n=null;"undefined"!=typeof WebSocket?n=WebSocket:"undefined"!=typeof MozWebSocket?n=MozWebSocket:void 0!==r.g?n=r.g.WebSocket||r.g.MozWebSocket:"undefined"!=typeof window?n=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(n=self.WebSocket||self.MozWebSocket);const s=n},6606:e=>{var t;window,t=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)r.d(n,s,function(t){return e[t]}.bind(null,s));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=256,o=function(){function e(e){void 0===e&&(e="="),this._paddingCharacter=e}return e.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(8*e+5)/6|0},e.prototype.encode=function(e){for(var t="",r=0;r>>18&63),t+=this._encodeByte(n>>>12&63),t+=this._encodeByte(n>>>6&63),t+=this._encodeByte(n>>>0&63)}var s=e.length-r;return s>0&&(n=e[r]<<16|(2===s?e[r+1]<<8:0),t+=this._encodeByte(n>>>18&63),t+=this._encodeByte(n>>>12&63),t+=2===s?this._encodeByte(n>>>6&63):this._paddingCharacter||"",t+=this._paddingCharacter||""),t},e.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(6*e+7)/8|0},e.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},e.prototype.decode=function(e){if(0===e.length)return new Uint8Array(0);for(var t=this._getPaddingLength(e),r=e.length-t,n=new Uint8Array(this.maxDecodedLength(r)),s=0,o=0,a=0,c=0,u=0,l=0,d=0;o>>4,n[s++]=u<<4|l>>>2,n[s++]=l<<6|d,a|=c&i,a|=u&i,a|=l&i,a|=d&i;if(o>>4,a|=c&i,a|=u&i),o>>2,a|=l&i),o>>8&6,t+=51-e>>>8&-75,t+=61-e>>>8&-15,t+=62-e>>>8&3,String.fromCharCode(t)},e.prototype._decodeChar=function(e){var t=i;return t+=(42-e&e-44)>>>8&-256+e-43+62,t+=(46-e&e-48)>>>8&-256+e-47+63,t+=(47-e&e-58)>>>8&-256+e-48+52,(t+=(64-e&e-91)>>>8&-256+e-65+0)+((96-e&e-123)>>>8&-256+e-97+26)},e.prototype._getPaddingLength=function(e){var t=0;if(this._paddingCharacter){for(var r=e.length-1;r>=0&&e[r]===this._paddingCharacter;r--)t++;if(e.length<4||t>2)throw new Error("Base64Coder: incorrect padding")}return t},e}();t.Coder=o;var a=new o;t.encode=function(e){return a.encode(e)},t.decode=function(e){return a.decode(e)};var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype._encodeByte=function(e){var t=e;return t+=65,t+=25-e>>>8&6,t+=51-e>>>8&-75,t+=61-e>>>8&-13,t+=62-e>>>8&49,String.fromCharCode(t)},t.prototype._decodeChar=function(e){var t=i;return t+=(44-e&e-46)>>>8&-256+e-45+62,t+=(94-e&e-96)>>>8&-256+e-95+63,t+=(47-e&e-58)>>>8&-256+e-48+52,(t+=(64-e&e-91)>>>8&-256+e-65+0)+((96-e&e-123)>>>8&-256+e-97+26)},t}(o);t.URLSafeCoder=c;var u=new c;t.encodeURLSafe=function(e){return u.encode(e)},t.decodeURLSafe=function(e){return u.decode(e)},t.encodedLength=function(e){return a.encodedLength(e)},t.maxDecodedLength=function(e){return a.maxDecodedLength(e)},t.decodedLength=function(e){return a.decodedLength(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="utf8: invalid string",s="utf8: invalid source encoding";function i(e){for(var t=0,r=0;r=e.length-1)throw new Error(n);r++,t+=4}}return t}t.encode=function(e){for(var t=new Uint8Array(i(e)),r=0,n=0;n>6,t[r++]=128|63&s):s<55296?(t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s):(n++,s=(1023&s)<<10,s|=1023&e.charCodeAt(n),s+=65536,t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s)}return t},t.encodedLength=i,t.decode=function(e){for(var t=[],r=0;r=e.length)throw new Error(s);if(128!=(192&(o=e[++r])))throw new Error(s);n=(31&n)<<6|63&o,i=128}else if(n<240){if(r>=e.length-1)throw new Error(s);var o=e[++r],a=e[++r];if(128!=(192&o)||128!=(192&a))throw new Error(s);n=(15&n)<<12|(63&o)<<6|63&a,i=2048}else{if(!(n<248))throw new Error(s);if(r>=e.length-2)throw new Error(s);o=e[++r],a=e[++r];var c=e[++r];if(128!=(192&o)||128!=(192&a)||128!=(192&c))throw new Error(s);n=(15&n)<<18|(63&o)<<12|(63&a)<<6|63&c,i=65536}if(n=55296&&n<=57343)throw new Error(s);if(n>=65536){if(n>1114111)throw new Error(s);n-=65536,t.push(String.fromCharCode(55296|n>>10)),n=56320|1023&n}}t.push(String.fromCharCode(n))}return t.join("")}},function(e,t,r){e.exports=r(3).default},function(e,t,r){"use strict";r.r(t);class n{constructor(e,t){this.lastId=0,this.prefix=e,this.name=t}create(e){this.lastId++;var t=this.lastId,r=this.prefix+t,n=this.name+"["+t+"]",s=!1,i=function(){s||(e.apply(null,arguments),s=!0)};return this[t]=i,{number:t,id:r,name:n,callback:i}}remove(e){delete this[e.number]}}var s=new n("_pusher_script_","Pusher.ScriptReceivers"),i={VERSION:"8.4.0-rc2",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},o=new n("_pusher_dependencies","Pusher.DependenciesReceivers"),a=new class{constructor(e){this.options=e,this.receivers=e.receivers||s,this.loading={}}load(e,t,r){var n=this;if(n.loading[e]&&n.loading[e].length>0)n.loading[e].push(r);else{n.loading[e]=[r];var s=ot.createScriptRequest(n.getPath(e,t)),i=n.receivers.create((function(t){if(n.receivers.remove(i),n.loading[e]){var r=n.loading[e];delete n.loading[e];for(var o=function(e){e||s.cleanup()},a=0;a>>6)+A(128|63&t):A(224|t>>>12&15)+A(128|t>>>6&63)+A(128|63&t)},k=function(e){return e.replace(/[^\x00-\x7F]/g,S)},O=function(e){var t=[0,2,1][e.length%3],r=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[P.charAt(r>>>18),P.charAt(r>>>12&63),t>=2?"=":P.charAt(r>>>6&63),t>=1?"=":P.charAt(63&r)].join("")},R=window.btoa||function(e){return e.replace(/[\s\S]{1,3}/g,O)},T=class{constructor(e,t,r,n){this.clear=t,this.timer=e((()=>{this.timer&&(this.timer=n(this.timer))}),r)}isRunning(){return null!==this.timer}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}};function N(e){window.clearTimeout(e)}function x(e){window.clearInterval(e)}class I extends T{constructor(e,t){super(setTimeout,N,e,(function(e){return t(),null}))}}class _ extends T{constructor(e,t){super(setInterval,x,e,(function(e){return t(),e}))}}var B={now:()=>Date.now?Date.now():(new Date).valueOf(),defer:e=>new I(0,e),method(e,...t){var r=Array.prototype.slice.call(arguments,1);return function(t){return t[e].apply(t,r.concat(arguments))}}},j=B;function L(e,...t){for(var r=0;r{window.console&&window.console.log&&window.console.log(e)}}debug(...e){this.log(this.globalLog,e)}warn(...e){this.log(this.globalLogWarn,e)}error(...e){this.log(this.globalLogError,e)}globalLogWarn(e){window.console&&window.console.warn?window.console.warn(e):this.globalLog(e)}globalLogError(e){window.console&&window.console.error?window.console.error(e):this.globalLogWarn(e)}log(e,...t){var r=U.apply(this,arguments);Rt.log?Rt.log(r):Rt.logToConsole&&e.bind(this)(r)}},Q=function(e,t,r,n,s){void 0===r.headers&&null==r.headersProvider||q.warn(`To send headers with the ${n.toString()} request, you must use AJAX, rather than JSONP.`);var i=e.nextAuthCallbackID.toString();e.nextAuthCallbackID++;var o=e.getDocument(),a=o.createElement("script");e.auth_callbacks[i]=function(e){s(null,e)};var c="Pusher.auth_callbacks['"+i+"']";a.src=r.endpoint+"?callback="+encodeURIComponent(c)+"&"+t;var u=o.getElementsByTagName("head")[0]||o.documentElement;u.insertBefore(a,u.firstChild)};class Y{constructor(e){this.src=e}send(e){var t=this,r="Error loading "+t.src;t.script=document.createElement("script"),t.script.id=e.id,t.script.src=t.src,t.script.type="text/javascript",t.script.charset="UTF-8",t.script.addEventListener?(t.script.onerror=function(){e.callback(r)},t.script.onload=function(){e.callback(null)}):t.script.onreadystatechange=function(){"loaded"!==t.script.readyState&&"complete"!==t.script.readyState||e.callback(null)},void 0===t.script.async&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(t.errorScript=document.createElement("script"),t.errorScript.id=e.id+"_error",t.errorScript.text=e.name+"('"+r+"');",t.script.async=t.errorScript.async=!1):t.script.async=!0;var n=document.getElementsByTagName("head")[0];n.insertBefore(t.script,n.firstChild),t.errorScript&&n.insertBefore(t.errorScript,t.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class Z{constructor(e,t){this.url=e,this.data=t}send(e){if(!this.request){var t=J(this.data),r=this.url+"/"+e.number+"?"+t;this.request=ot.createScriptRequest(r),this.request.send(e)}}cleanup(){this.request&&this.request.cleanup()}}var $={name:"jsonp",getAgent:function(e,t){return function(r,n){var i="http"+(t?"s":"")+"://"+(e.host||e.options.host)+e.options.path,o=ot.createJSONPRequest(i,r),a=ot.ScriptReceivers.create((function(t,r){s.remove(a),o.cleanup(),r&&r.host&&(e.host=r.host),n&&n(t,r)}));o.send(a)}}};function X(e,t,r){return e+(t.useTLS?"s":"")+"://"+(t.useTLS?t.hostTLS:t.hostNonTLS)+r}function ee(e,t){return"/app/"+e+"?protocol="+i.PROTOCOL+"&client=js&version="+i.VERSION+(t?"&"+t:"")}var te={getInitial:function(e,t){return X("ws",t,(t.httpPath||"")+ee(e,"flash=false"))}},re={getInitial:function(e,t){return X("http",t,(t.httpPath||"/pusher")+ee(e))}},ne={getInitial:function(e,t){return X("http",t,t.httpPath||"/pusher")},getPath:function(e,t){return ee(e)}};class se{constructor(){this._callbacks={}}get(e){return this._callbacks[ie(e)]}add(e,t,r){var n=ie(e);this._callbacks[n]=this._callbacks[n]||[],this._callbacks[n].push({fn:t,context:r})}remove(e,t,r){if(e||t||r){var n=e?[ie(e)]:M(this._callbacks);t||r?this.removeCallback(n,t,r):this.removeAllCallbacks(n)}else this._callbacks={}}removeCallback(e,t,r){H(e,(function(e){this._callbacks[e]=W(this._callbacks[e]||[],(function(e){return t&&t!==e.fn||r&&r!==e.context})),0===this._callbacks[e].length&&delete this._callbacks[e]}),this)}removeAllCallbacks(e){H(e,(function(e){delete this._callbacks[e]}),this)}}function ie(e){return"_"+e}class oe{constructor(e){this.callbacks=new se,this.global_callbacks=[],this.failThrough=e}bind(e,t,r){return this.callbacks.add(e,t,r),this}bind_global(e){return this.global_callbacks.push(e),this}unbind(e,t,r){return this.callbacks.remove(e,t,r),this}unbind_global(e){return e?(this.global_callbacks=W(this.global_callbacks||[],(t=>t!==e)),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(e,t,r){for(var n=0;n0)for(n=0;n{this.onError(e),this.changeState("closed")})),!1}return this.bindListeners(),q.debug("Connecting",{transport:this.name,url:e}),this.changeState("connecting"),!0}close(){return!!this.socket&&(this.socket.close(),!0)}send(e){return"open"===this.state&&(j.defer((()=>{this.socket&&this.socket.send(e)})),!0)}ping(){"open"===this.state&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(e){this.emit("error",{type:"WebSocketError",error:e}),this.timeline.error(this.buildTimelineMessage({error:e.toString()}))}onClose(e){e?this.changeState("closed",{code:e.code,reason:e.reason,wasClean:e.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(e){this.emit("message",e)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=e=>{this.onError(e)},this.socket.onclose=e=>{this.onClose(e)},this.socket.onmessage=e=>{this.onMessage(e)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(e,t){this.state=e,this.timeline.info(this.buildTimelineMessage({state:e,params:t})),this.emit(e,t)}buildTimelineMessage(e){return L({cid:this.id},e)}}class ce{constructor(e){this.hooks=e}isSupported(e){return this.hooks.isSupported(e)}createConnection(e,t,r,n){return new ae(this.hooks,e,t,r,n)}}var ue=new ce({urls:te,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return Boolean(ot.getWebSocketAPI())},isSupported:function(){return Boolean(ot.getWebSocketAPI())},getSocket:function(e){return ot.createWebSocket(e)}}),le={urls:re,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},de=L({getSocket:function(e){return ot.HTTPFactory.createStreamingSocket(e)}},le),he=L({getSocket:function(e){return ot.HTTPFactory.createPollingSocket(e)}},le),fe={isSupported:function(){return ot.isXHRSupported()}},pe={ws:ue,xhr_streaming:new ce(L({},de,fe)),xhr_polling:new ce(L({},he,fe))},ge=new ce({file:"sockjs",urls:ne,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return void 0!==window.SockJS},getSocket:function(e,t){return new window.SockJS(e,null,{js_path:a.getPath("sockjs",{useTLS:t.useTLS}),ignore_null_origin:t.ignoreNullOrigin})},beforeOpen:function(e,t){e.send(JSON.stringify({path:t}))}}),ye={isSupported:function(e){return ot.isXDRSupported(e.useTLS)}},me=new ce(L({},de,ye)),be=new ce(L({},he,ye));pe.xdr_streaming=me,pe.xdr_polling=be,pe.sockjs=ge;var ve=pe,we=new class extends oe{constructor(){super();var e=this;void 0!==window.addEventListener&&(window.addEventListener("online",(function(){e.emit("online")}),!1),window.addEventListener("offline",(function(){e.emit("offline")}),!1))}isOnline(){return void 0===window.navigator.onLine||window.navigator.onLine}};class Ae{constructor(e,t,r){this.manager=e,this.transport=t,this.minPingDelay=r.minPingDelay,this.maxPingDelay=r.maxPingDelay,this.pingDelay=void 0}createConnection(e,t,r,n){n=L({},n,{activityTimeout:this.pingDelay});var s=this.transport.createConnection(e,t,r,n),i=null,o=function(){s.unbind("open",o),s.bind("closed",a),i=j.now()},a=e=>{if(s.unbind("closed",a),1002===e.code||1003===e.code)this.manager.reportDeath();else if(!e.wasClean&&i){var t=j.now()-i;t<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(t/2,this.minPingDelay))}};return s.bind("open",o),s}isSupported(e){return this.manager.isAlive()&&this.transport.isSupported(e)}}const Pe={decodeMessage:function(e){try{var t=JSON.parse(e.data),r=t.data;if("string"==typeof r)try{r=JSON.parse(t.data)}catch(e){}var n={event:t.event,channel:t.channel,data:r};return t.user_id&&(n.user_id=t.user_id),n}catch(t){throw{type:"MessageParseError",error:t,data:e.data}}},encodeMessage:function(e){return JSON.stringify(e)},processHandshake:function(e){var t=Pe.decodeMessage(e);if("pusher:connection_established"===t.event){if(!t.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:t.data.socket_id,activityTimeout:1e3*t.data.activity_timeout}}if("pusher:error"===t.event)return{action:this.getCloseAction(t.data),error:this.getCloseError(t.data)};throw"Invalid handshake"},getCloseAction:function(e){return e.code<4e3?e.code>=1002&&e.code<=1004?"backoff":null:4e3===e.code?"tls_only":e.code<4100?"refused":e.code<4200?"backoff":e.code<4300?"retry":"refused"},getCloseError:function(e){return 1e3!==e.code&&1001!==e.code?{type:"PusherError",data:{code:e.code,message:e.reason||e.message}}:null}};var Ee=Pe;class Ce extends oe{constructor(e,t){super(),this.id=e,this.transport=t,this.activityTimeout=t.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(e){return this.transport.send(e)}send_event(e,t,r){var n={event:e,data:t};return r&&(n.channel=r),q.debug("Event sent",n),this.send(Ee.encodeMessage(n))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var e={message:e=>{var t;try{t=Ee.decodeMessage(e)}catch(t){this.emit("error",{type:"MessageParseError",error:t,data:e.data})}if(void 0!==t){switch(q.debug("Event recd",t),t.event){case"pusher:error":this.emit("error",{type:"PusherError",data:t.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong")}this.emit("message",t)}},activity:()=>{this.emit("activity")},error:e=>{this.emit("error",e)},closed:e=>{t(),e&&e.code&&this.handleCloseEvent(e),this.transport=null,this.emit("closed")}},t=()=>{F(e,((e,t)=>{this.transport.unbind(t,e)}))};F(e,((e,t)=>{this.transport.bind(t,e)}))}handleCloseEvent(e){var t=Ee.getCloseAction(e),r=Ee.getCloseError(e);r&&this.emit("error",r),t&&this.emit(t,{action:t,error:r})}}class Se{constructor(e,t){this.transport=e,this.callback=t,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=e=>{var t;this.unbindListeners();try{t=Ee.processHandshake(e)}catch(e){return this.finish("error",{error:e}),void this.transport.close()}"connected"===t.action?this.finish("connected",{connection:new Ce(t.id,this.transport),activityTimeout:t.activityTimeout}):(this.finish(t.action,{error:t.error}),this.transport.close())},this.onClosed=e=>{this.unbindListeners();var t=Ee.getCloseAction(e)||"backoff",r=Ee.getCloseError(e);this.finish(t,{error:r})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(e,t){this.callback(L({transport:this.transport,action:e},t))}}class ke{constructor(e,t){this.timeline=e,this.options=t||{}}send(e,t){this.timeline.isEmpty()||this.timeline.send(ot.TimelineTransport.getAgent(this,e),t)}}class Oe extends oe{constructor(e,t){super((function(t,r){q.debug("No callbacks on "+e+" for "+t)})),this.name=e,this.pusher=t,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(e,t){return t(null,{auth:""})}trigger(e,t){if(0!==e.indexOf("client-"))throw new d("Event '"+e+"' does not start with 'client-'");if(!this.subscribed){var r=l("triggeringClientEvents");q.warn(`Client event triggered before channel 'subscription_succeeded' event . ${r}`)}return this.pusher.send_event(e,t,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(e){var t=e.event,r=e.data;"pusher_internal:subscription_succeeded"===t?this.handleSubscriptionSucceededEvent(e):"pusher_internal:subscription_count"===t?this.handleSubscriptionCountEvent(e):0!==t.indexOf("pusher_internal:")&&this.emit(t,r,{})}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",e.data)}handleSubscriptionCountEvent(e){e.data.subscription_count&&(this.subscriptionCount=e.data.subscription_count),this.emit("pusher:subscription_count",e.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,((e,t)=>{e?(this.subscriptionPending=!1,q.error(e.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof v?{status:e.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:t.auth,channel_data:t.channel_data,channel:this.name})})))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class Re extends Oe{authorize(e,t){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:e},t)}}class Te{constructor(){this.reset()}get(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null}each(e){F(this.members,((t,r)=>{e(this.get(r))}))}setMyID(e){this.myID=e}onSubscription(e){this.members=e.presence.hash,this.count=e.presence.count,this.me=this.get(this.myID)}addMember(e){return null===this.get(e.user_id)&&this.count++,this.members[e.user_id]=e.user_info,this.get(e.user_id)}removeMember(e){var t=this.get(e.user_id);return t&&(delete this.members[e.user_id],this.count--),t}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}class Ne extends Re{constructor(e,t){super(e,t),this.members=new Te}authorize(e,t){super.authorize(e,((e,r)=>{return n=this,s=void 0,o=function*(){if(!e)if(null!=r.channel_data){var n=JSON.parse(r.channel_data);this.members.setMyID(n.user_id)}else{if(yield this.pusher.user.signinDonePromise,null==this.pusher.user.user_data){let e=l("authorizationEndpoint");return q.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${e}, or the user should be signed in.`),void t("Invalid auth response")}this.members.setMyID(this.pusher.user.user_data.id)}t(e,r)},new((i=void 0)||(i=Promise))((function(e,t){function r(e){try{c(o.next(e))}catch(e){t(e)}}function a(e){try{c(o.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(r,a)}c((o=o.apply(n,s||[])).next())}));var n,s,i,o}))}handleEvent(e){var t=e.event;if(0===t.indexOf("pusher_internal:"))this.handleInternalEvent(e);else{var r=e.data,n={};e.user_id&&(n.user_id=e.user_id),this.emit(t,r,n)}}handleInternalEvent(e){var t=e.event,r=e.data;switch(t){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(e);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(e);break;case"pusher_internal:member_added":var n=this.members.addMember(r);this.emit("pusher:member_added",n);break;case"pusher_internal:member_removed":var s=this.members.removeMember(r);s&&this.emit("pusher:member_removed",s)}}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(e.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var xe=r(1),Ie=r(0);class _e extends Re{constructor(e,t,r){super(e,t),this.key=null,this.nacl=r}authorize(e,t){super.authorize(e,((e,r)=>{if(e)return void t(e,r);let n=r.shared_secret;n?(this.key=Object(Ie.decode)(n),delete r.shared_secret,t(null,r)):t(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null)}))}trigger(e,t){throw new y("Client events are not currently supported for encrypted channels")}handleEvent(e){var t=e.event,r=e.data;0!==t.indexOf("pusher_internal:")&&0!==t.indexOf("pusher:")?this.handleEncryptedEvent(t,r):super.handleEvent(e)}handleEncryptedEvent(e,t){if(!this.key)return void q.debug("Received encrypted event before key has been retrieved from the authEndpoint");if(!t.ciphertext||!t.nonce)return void q.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+t);let r=Object(Ie.decode)(t.ciphertext);if(r.length{t?q.error(`Failed to make a request to the authEndpoint: ${i}. Unable to fetch new key, so dropping encrypted event`):(s=this.nacl.secretbox.open(r,n,this.key),null!==s?this.emit(e,this.getDataToEmit(s)):q.error("Failed to decrypt event with new key. Dropping encrypted event"))}));this.emit(e,this.getDataToEmit(s))}getDataToEmit(e){let t=Object(xe.decode)(e);try{return JSON.parse(t)}catch(e){return t}}}class Be extends oe{constructor(e,t){super(),this.state="initialized",this.connection=null,this.key=e,this.options=t,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var r=ot.getNetwork();r.bind("online",(()=>{this.timeline.info({netinfo:"online"}),"connecting"!==this.state&&"unavailable"!==this.state||this.retryIn(0)})),r.bind("offline",(()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()})),this.updateStrategy()}switchCluster(e){this.key=e,this.updateStrategy(),this.retryIn(0)}connect(){this.connection||this.runner||(this.strategy.isSupported()?(this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()):this.updateState("failed"))}send(e){return!!this.connection&&this.connection.send(e)}send_event(e,t,r){return!!this.connection&&this.connection.send_event(e,t,r)}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var e=(t,r)=>{t?this.runner=this.strategy.connect(0,e):"error"===r.action?(this.emit("error",{type:"HandshakeError",error:r.error}),this.timeline.error({handshakeError:r.error})):(this.abortConnecting(),this.handshakeCallbacks[r.action](r))};this.runner=this.strategy.connect(0,e)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection&&this.abandonConnection().close()}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(e){this.timeline.info({action:"retry",delay:e}),e>0&&this.emit("connecting_in",Math.round(e/1e3)),this.retryTimer=new I(e||0,(()=>{this.disconnectInternally(),this.connect()}))}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new I(this.options.unavailableTimeout,(()=>{this.updateState("unavailable")}))}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new I(this.options.pongTimeout,(()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)}))}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new I(this.activityTimeout,(()=>{this.sendActivityCheck()})))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(e){return L({},e,{message:e=>{this.resetActivityCheck(),this.emit("message",e)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:e=>{this.emit("error",e)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(e){return L({},e,{connected:e=>{this.activityTimeout=Math.min(this.options.activityTimeout,e.activityTimeout,e.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(e.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let e=e=>t=>{t.error&&this.emit("error",{type:"WebSocketError",error:t.error}),e(t)};return{tls_only:e((()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)})),refused:e((()=>{this.disconnect()})),backoff:e((()=>{this.retryIn(1e3)})),retry:e((()=>{this.retryIn(0)}))}}setConnection(e){for(var t in this.connection=e,this.connectionCallbacks)this.connection.bind(t,this.connectionCallbacks[t]);this.resetActivityCheck()}abandonConnection(){if(this.connection){for(var e in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(e,this.connectionCallbacks[e]);var t=this.connection;return this.connection=null,t}}updateState(e,t){var r=this.state;if(this.state=e,r!==e){var n=e;"connected"===n&&(n+=" with new socket ID "+t.socket_id),q.debug("State changed",r+" -> "+n),this.timeline.info({state:e,params:t}),this.emit("state_change",{previous:r,current:e}),this.emit(e,t)}}shouldRetry(){return"connecting"===this.state||"connected"===this.state}}class je{constructor(){this.channels={}}add(e,t){return this.channels[e]||(this.channels[e]=function(e,t){if(0===e.indexOf("private-encrypted-")){if(t.config.nacl)return Le.createEncryptedChannel(e,t,t.config.nacl);let r="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",n=l("encryptedChannelSupport");throw new y(`${r}. ${n}`)}if(0===e.indexOf("private-"))return Le.createPrivateChannel(e,t);if(0===e.indexOf("presence-"))return Le.createPresenceChannel(e,t);if(0===e.indexOf("#"))throw new h('Cannot create a channel with name "'+e+'".');return Le.createChannel(e,t)}(e,t)),this.channels[e]}all(){return e=this.channels,t=[],F(e,(function(e){t.push(e)})),t;var e,t}find(e){return this.channels[e]}remove(e){var t=this.channels[e];return delete this.channels[e],t}disconnect(){F(this.channels,(function(e){e.disconnect()}))}}var Le={createChannels:()=>new je,createConnectionManager:(e,t)=>new Be(e,t),createChannel:(e,t)=>new Oe(e,t),createPrivateChannel:(e,t)=>new Re(e,t),createPresenceChannel:(e,t)=>new Ne(e,t),createEncryptedChannel:(e,t,r)=>new _e(e,t,r),createTimelineSender:(e,t)=>new ke(e,t),createHandshake:(e,t)=>new Se(e,t),createAssistantToTheTransportManager:(e,t,r)=>new Ae(e,t,r)};class Ue{constructor(e){this.options=e||{},this.livesLeft=this.options.lives||1/0}getAssistant(e){return Le.createAssistantToTheTransportManager(this,e,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class De{constructor(e,t){this.strategies=e,this.loop=Boolean(t.loop),this.failFast=Boolean(t.failFast),this.timeout=t.timeout,this.timeoutLimit=t.timeoutLimit}isSupported(){return K(this.strategies,j.method("isSupported"))}connect(e,t){var r=this.strategies,n=0,s=this.timeout,i=null,o=(a,c)=>{c?t(null,c):(n+=1,this.loop&&(n%=r.length),n0&&(s=new I(r.timeout,(function(){i.abort(),n(!0)}))),i=e.connect(t,(function(e,t){e&&s&&s.isRunning()&&!r.failFast||(s&&s.ensureAborted(),n(e,t))})),{abort:function(){s&&s.ensureAborted(),i.abort()},forceMinPriority:function(e){i.forceMinPriority(e)}}}}class Fe{constructor(e){this.strategies=e}isSupported(){return K(this.strategies,j.method("isSupported"))}connect(e,t){return function(e,r,n){var s=G(e,(function(e,n,s,i){return e.connect(r,function(e,r){return function(n,s){r[e].error=n,n?function(e){return function(e,t){for(var r=0;r=j.now()){var o=this.transports[n.transport];o&&(["ws","wss"].includes(n.transport)||s>3?(this.timeline.info({cached:!0,transport:n.transport,latency:n.latency}),i.push(new De([o],{timeout:2*n.latency+1e3,failFast:!0}))):s++)}var a=j.now(),c=i.pop().connect(e,(function n(o,u){o?(We(r),i.length>0?(a=j.now(),c=i.pop().connect(e,n)):t(o)):(function(e,t,r,n){var s=ot.getLocalStorage();if(s)try{s[Ge(e)]=V({timestamp:j.now(),transport:t,latency:r,cacheSkipCount:n})}catch(e){}}(r,u.transport.name,j.now()-a,s),t(null,u))}));return{abort:function(){c.abort()},forceMinPriority:function(t){e=t,c&&c.forceMinPriority(t)}}}}function Ge(e){return"pusherTransport"+(e?"TLS":"NonTLS")}function We(e){var t=ot.getLocalStorage();if(t)try{delete t[Ge(e)]}catch(e){}}class ze{constructor(e,{delay:t}){this.strategy=e,this.options={delay:t}}isSupported(){return this.strategy.isSupported()}connect(e,t){var r,n=this.strategy,s=new I(this.options.delay,(function(){r=n.connect(e,t)}));return{abort:function(){s.ensureAborted(),r&&r.abort()},forceMinPriority:function(t){e=t,r&&r.forceMinPriority(t)}}}}class Ke{constructor(e,t,r){this.test=e,this.trueBranch=t,this.falseBranch=r}isSupported(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()}connect(e,t){return(this.test()?this.trueBranch:this.falseBranch).connect(e,t)}}class Je{constructor(e){this.strategy=e}isSupported(){return this.strategy.isSupported()}connect(e,t){var r=this.strategy.connect(e,(function(e,n){n&&r.abort(),t(e,n)}));return r}}function Ve(e){return function(){return e.isSupported()}}var qe,Qe={getRequest:function(e){var t=new window.XDomainRequest;return t.ontimeout=function(){e.emit("error",new f),e.close()},t.onerror=function(t){e.emit("error",t),e.close()},t.onprogress=function(){t.responseText&&t.responseText.length>0&&e.onChunk(200,t.responseText)},t.onload=function(){t.responseText&&t.responseText.length>0&&e.onChunk(200,t.responseText),e.emit("finished",200),e.close()},t},abortRequest:function(e){e.ontimeout=e.onerror=e.onprogress=e.onload=null,e.abort()}};class Ye extends oe{constructor(e,t,r){super(),this.hooks=e,this.method=t,this.url=r}start(e){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},ot.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(e)}close(){this.unloader&&(ot.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(e,t){for(;;){var r=this.advanceBuffer(t);if(!r)break;this.emit("chunk",{status:e,data:r})}this.isBufferTooLong(t)&&this.emit("buffer_too_long")}advanceBuffer(e){var t=e.slice(this.position),r=t.indexOf("\n");return-1!==r?(this.position+=r+1,t.slice(0,r)):null}isBufferTooLong(e){return this.position===e.length&&e.length>262144}}!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSED=3]="CLOSED"}(qe||(qe={}));var Ze=qe,$e=1;function Xe(e){var t=-1===e.indexOf("?")?"?":"&";return e+t+"t="+ +new Date+"&n="+$e++}function et(e){return ot.randomInt(e)}var tt,rt=class{constructor(e,t){this.hooks=e,this.session=et(1e3)+"/"+function(e){for(var t=[],r=0;r<8;r++)t.push(et(32).toString(32));return t.join("")}(),this.location=function(e){var t=/([^\?]*)\/*(\??.*)/.exec(e);return{base:t[1],queryString:t[2]}}(t),this.readyState=Ze.CONNECTING,this.openStream()}send(e){return this.sendRaw(JSON.stringify([e]))}ping(){this.hooks.sendHeartbeat(this)}close(e,t){this.onClose(e,t,!0)}sendRaw(e){if(this.readyState!==Ze.OPEN)return!1;try{return ot.createSocketRequest("POST",Xe((t=this.location,r=this.session,t.base+"/"+r+"/xhr_send"))).start(e),!0}catch(e){return!1}var t,r}reconnect(){this.closeStream(),this.openStream()}onClose(e,t,r){this.closeStream(),this.readyState=Ze.CLOSED,this.onclose&&this.onclose({code:e,reason:t,wasClean:r})}onChunk(e){var t;if(200===e.status)switch(this.readyState===Ze.OPEN&&this.onActivity(),e.data.slice(0,1)){case"o":t=JSON.parse(e.data.slice(1)||"{}"),this.onOpen(t);break;case"a":t=JSON.parse(e.data.slice(1)||"[]");for(var r=0;r{this.onChunk(e)})),this.stream.bind("finished",(e=>{this.hooks.onFinished(this,e)})),this.stream.bind("buffer_too_long",(()=>{this.reconnect()}));try{this.stream.start()}catch(e){j.defer((()=>{this.onError(e),this.onClose(1006,"Could not start streaming",!1)}))}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}},nt={getReceiveURL:function(e,t){return e.base+"/"+t+"/xhr_streaming"+e.queryString},onHeartbeat:function(e){e.sendRaw("[]")},sendHeartbeat:function(e){e.sendRaw("[]")},onFinished:function(e,t){e.onClose(1006,"Connection interrupted ("+t+")",!1)}},st={getReceiveURL:function(e,t){return e.base+"/"+t+"/xhr"+e.queryString},onHeartbeat:function(){},sendHeartbeat:function(e){e.sendRaw("[]")},onFinished:function(e,t){200===t?e.reconnect():e.onClose(1006,"Connection interrupted ("+t+")",!1)}},it={getRequest:function(e){var t=new(ot.getXHRAPI());return t.onreadystatechange=t.onprogress=function(){switch(t.readyState){case 3:t.responseText&&t.responseText.length>0&&e.onChunk(t.status,t.responseText);break;case 4:t.responseText&&t.responseText.length>0&&e.onChunk(t.status,t.responseText),e.emit("finished",t.status),e.close()}},t},abortRequest:function(e){e.onreadystatechange=null,e.abort()}},ot={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:s,DependenciesReceivers:o,getDefaultStrategy:function(e,t,r){var n={};function s(t,s,i,o,a){var c=r(e,t,s,i,o,a);return n[t]=c,c}var i,o=Object.assign({},t,{hostNonTLS:e.wsHost+":"+e.wsPort,hostTLS:e.wsHost+":"+e.wssPort,httpPath:e.wsPath}),a=Object.assign({},o,{useTLS:!0}),c=Object.assign({},t,{hostNonTLS:e.httpHost+":"+e.httpPort,hostTLS:e.httpHost+":"+e.httpsPort,httpPath:e.httpPath}),u={loop:!0,timeout:15e3,timeoutLimit:6e4},l=new Ue({minPingDelay:1e4,maxPingDelay:e.activityTimeout}),d=new Ue({lives:2,minPingDelay:1e4,maxPingDelay:e.activityTimeout}),h=s("ws","ws",3,o,l),f=s("wss","ws",3,a,l),p=s("sockjs","sockjs",1,c),g=s("xhr_streaming","xhr_streaming",1,c,d),y=s("xdr_streaming","xdr_streaming",1,c,d),m=s("xhr_polling","xhr_polling",1,c),b=s("xdr_polling","xdr_polling",1,c),v=new De([h],u),w=new De([f],u),A=new De([p],u),P=new De([new Ke(Ve(g),g,y)],u),E=new De([new Ke(Ve(m),m,b)],u),C=new De([new Ke(Ve(P),new Fe([P,new ze(E,{delay:4e3})]),E)],u),S=new Ke(Ve(C),C,A);return i=t.useTLS?new Fe([v,new ze(S,{delay:2e3})]):new Fe([v,new ze(w,{delay:2e3}),new ze(S,{delay:5e3})]),new He(new Je(new Ke(Ve(h),i,S)),n,{ttl:18e5,timeline:t.timeline,useTLS:t.useTLS})},Transports:ve,transportConnectionInitializer:function(){var e=this;e.timeline.info(e.buildTimelineMessage({transport:e.name+(e.options.useTLS?"s":"")})),e.hooks.isInitialized()?e.changeState("initialized"):e.hooks.file?(e.changeState("initializing"),a.load(e.hooks.file,{useTLS:e.options.useTLS},(function(t,r){e.hooks.isInitialized()?(e.changeState("initialized"),r(!0)):(t&&e.onError(t),e.onClose(),r(!1))}))):e.onClose()},HTTPFactory:{createStreamingSocket(e){return this.createSocket(nt,e)},createPollingSocket(e){return this.createSocket(st,e)},createSocket:(e,t)=>new rt(e,t),createXHR(e,t){return this.createRequest(it,e,t)},createRequest:(e,t,r)=>new Ye(e,t,r),createXDR:function(e,t){return this.createRequest(Qe,e,t)}},TimelineTransport:$,getXHRAPI:()=>window.XMLHttpRequest,getWebSocketAPI:()=>window.WebSocket||window.MozWebSocket,setup(e){window.Pusher=e;var t=()=>{this.onDocumentBody(e.ready)};window.JSON?t():a.load("json2",{},t)},getDocument:()=>document,getProtocol(){return this.getDocument().location.protocol},getAuthorizers:()=>({ajax:w,jsonp:Q}),onDocumentBody(e){document.body?e():setTimeout((()=>{this.onDocumentBody(e)}),0)},createJSONPRequest:(e,t)=>new Z(e,t),createScriptRequest:e=>new Y(e),getLocalStorage(){try{return window.localStorage}catch(e){return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){return new(this.getXHRAPI())},createMicrosoftXHR:()=>new ActiveXObject("Microsoft.XMLHTTP"),getNetwork:()=>we,createWebSocket(e){return new(this.getWebSocketAPI())(e)},createSocketRequest(e,t){if(this.isXHRSupported())return this.HTTPFactory.createXHR(e,t);if(this.isXDRSupported(0===t.indexOf("https:")))return this.HTTPFactory.createXDR(e,t);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var e=this.getXHRAPI();return Boolean(e)&&void 0!==(new e).withCredentials},isXDRSupported(e){var t=e?"https:":"http:",r=this.getProtocol();return Boolean(window.XDomainRequest)&&r===t},addUnloadListener(e){void 0!==window.addEventListener?window.addEventListener("unload",e,!1):void 0!==window.attachEvent&&window.attachEvent("onunload",e)},removeUnloadListener(e){void 0!==window.addEventListener?window.removeEventListener("unload",e,!1):void 0!==window.detachEvent&&window.detachEvent("onunload",e)},randomInt:e=>Math.floor((window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)*e)};!function(e){e[e.ERROR=3]="ERROR",e[e.INFO=6]="INFO",e[e.DEBUG=7]="DEBUG"}(tt||(tt={}));var at=tt;class ct{constructor(e,t,r){this.key=e,this.session=t,this.events=[],this.options=r||{},this.sent=0,this.uniqueID=0}log(e,t){e<=this.options.level&&(this.events.push(L({},t,{timestamp:j.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(e){this.log(at.ERROR,e)}info(e){this.log(at.INFO,e)}debug(e){this.log(at.DEBUG,e)}isEmpty(){return 0===this.events.length}send(e,t){var r=L({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],e(r,((e,r)=>{e||this.sent++,t&&t(e,r)})),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class ut{constructor(e,t,r,n){this.name=e,this.priority=t,this.transport=r,this.options=n||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(e,t){if(!this.isSupported())return lt(new b,t);if(this.priority{r||(u(),s?s.close():n.close())},forceMinPriority:e=>{r||this.priority{if(void 0===ot.getAuthorizers()[e.transport])throw`'${e.transport}' is not a recognized auth transport`;return(t,r)=>{const n=((e,t)=>{var r="socket_id="+encodeURIComponent(e.socketId);for(var n in t.params)r+="&"+encodeURIComponent(n)+"="+encodeURIComponent(t.params[n]);if(null!=t.paramsProvider){let e=t.paramsProvider();for(var n in e)r+="&"+encodeURIComponent(n)+"="+encodeURIComponent(e[n])}return r})(t,e);ot.getAuthorizers()[e.transport](ot,n,e,u.UserAuthentication,r)}},gt=e=>{if(void 0===ot.getAuthorizers()[e.transport])throw`'${e.transport}' is not a recognized auth transport`;return(t,r)=>{const n=((e,t)=>{var r="socket_id="+encodeURIComponent(e.socketId);for(var n in r+="&channel_name="+encodeURIComponent(e.channelName),t.params)r+="&"+encodeURIComponent(n)+"="+encodeURIComponent(t.params[n]);if(null!=t.paramsProvider){let e=t.paramsProvider();for(var n in e)r+="&"+encodeURIComponent(n)+"="+encodeURIComponent(e[n])}return r})(t,e);ot.getAuthorizers()[e.transport](ot,n,e,u.ChannelAuthorization,r)}};const yt=(e,t,r)=>{const n={authTransport:t.transport,authEndpoint:t.endpoint,auth:{params:t.params,headers:t.headers}};return(t,s)=>{const i=e.channel(t.channelName);r(i,n).authorize(t.socketId,s)}};function mt(e,t){let r={activityTimeout:e.activityTimeout||i.activityTimeout,cluster:e.cluster,httpPath:e.httpPath||i.httpPath,httpPort:e.httpPort||i.httpPort,httpsPort:e.httpsPort||i.httpsPort,pongTimeout:e.pongTimeout||i.pongTimeout,statsHost:e.statsHost||i.stats_host,unavailableTimeout:e.unavailableTimeout||i.unavailableTimeout,wsPath:e.wsPath||i.wsPath,wsPort:e.wsPort||i.wsPort,wssPort:e.wssPort||i.wssPort,enableStats:At(e),httpHost:bt(e),useTLS:wt(e),wsHost:vt(e),userAuthenticator:Et(e),channelAuthorizer:Ct(e,t)};return"disabledTransports"in e&&(r.disabledTransports=e.disabledTransports),"enabledTransports"in e&&(r.enabledTransports=e.enabledTransports),"ignoreNullOrigin"in e&&(r.ignoreNullOrigin=e.ignoreNullOrigin),"timelineParams"in e&&(r.timelineParams=e.timelineParams),"nacl"in e&&(r.nacl=e.nacl),r}function bt(e){return e.httpHost?e.httpHost:e.cluster?`sockjs-${e.cluster}.pusher.com`:i.httpHost}function vt(e){return e.wsHost?e.wsHost:`ws-${e.cluster}.pusher.com`}function wt(e){return"https:"===ot.getProtocol()||!1!==e.forceTLS}function At(e){return"enableStats"in e?e.enableStats:"disableStats"in e&&!e.disableStats}const Pt=e=>"customHandler"in e&&null!=e.customHandler;function Et(e){const t=Object.assign(Object.assign({},i.userAuthentication),e.userAuthentication);return Pt(t)?t.customHandler:pt(t)}function Ct(e,t){const r=function(e,t){let r;if("channelAuthorization"in e)r=Object.assign(Object.assign({},i.channelAuthorization),e.channelAuthorization);else if(r={transport:e.authTransport||i.authTransport,endpoint:e.authEndpoint||i.authEndpoint},"auth"in e&&("params"in e.auth&&(r.params=e.auth.params),"headers"in e.auth&&(r.headers=e.auth.headers)),"authorizer"in e)return{customHandler:yt(t,r,e.authorizer)};return r}(e,t);return Pt(r)?r.customHandler:gt(r)}class St extends oe{constructor(e){super((function(e,t){q.debug(`No callbacks on watchlist events for ${e}`)})),this.pusher=e,this.bindWatchlistInternalEvent()}handleEvent(e){e.data.events.forEach((e=>{this.emit(e.name,e)}))}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",(e=>{"pusher_internal:watchlist_events"===e.event&&this.handleEvent(e)}))}}class kt extends oe{constructor(e){super((function(e,t){q.debug("No callbacks on user for "+e)})),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(e,t)=>{if(e)return q.warn(`Error during signin: ${e}`),void this._cleanup();this.pusher.send_event("pusher:signin",{auth:t.auth,user_data:t.user_data})},this.pusher=e,this.pusher.connection.bind("state_change",(({previous:e,current:t})=>{"connected"!==e&&"connected"===t&&this._signin(),"connected"===e&&"connected"!==t&&(this._cleanup(),this._newSigninPromiseIfNeeded())})),this.watchlist=new St(e),this.pusher.connection.bind("message",(e=>{"pusher:signin_success"===e.event&&this._onSigninSuccess(e.data),this.serverToUserChannel&&this.serverToUserChannel.name===e.channel&&this.serverToUserChannel.handleEvent(e)}))}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),"connected"===this.pusher.connection.state&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(e){try{this.user_data=JSON.parse(e.user_data)}catch(t){return q.error(`Failed parsing user data after signin: ${e.user_data}`),void this._cleanup()}if("string"!=typeof this.user_data.id||""===this.user_data.id)return q.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),void this._cleanup();this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){this.serverToUserChannel=new Oe(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global(((e,t)=>{0!==e.indexOf("pusher_internal:")&&0!==e.indexOf("pusher:")&&this.emit(e,t)})),(e=>{e.subscriptionPending&&e.subscriptionCancelled?e.reinstateSubscription():e.subscriptionPending||"connected"!==this.pusher.connection.state||e.subscribe()})(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested)return;if(this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:e,resolve:t,reject:r}=function(){let e,t;return{promise:new Promise(((r,n)=>{e=r,t=n})),resolve:e,reject:t}}();e.done=!1;const n=()=>{e.done=!0};e.then(n).catch(n),this.signinDonePromise=e,this._signinDoneResolve=t}}class Ot{static ready(){Ot.isReady=!0;for(var e=0,t=Ot.instances.length;eot.getDefaultStrategy(this.config,e,ht),timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:Boolean(this.config.useTLS)}),this.connection.bind("connected",(()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())})),this.connection.bind("message",(e=>{var t=0===e.event.indexOf("pusher_internal:");if(e.channel){var r=this.channel(e.channel);r&&r.handleEvent(e)}t||this.global_emitter.emit(e.event,e.data)})),this.connection.bind("connecting",(()=>{this.channels.disconnect()})),this.connection.bind("disconnected",(()=>{this.channels.disconnect()})),this.connection.bind("error",(e=>{q.warn(e)})),Ot.instances.push(this),this.timeline.info({instances:Ot.instances.length}),this.user=new kt(this),Ot.isReady&&this.connect()}switchCluster(e){const{appKey:t,cluster:r}=e;this.key=t,this.options=Object.assign(Object.assign({},this.options),{cluster:r}),this.config=mt(this.options,this),this.connection.switchCluster(this.key)}channel(e){return this.channels.find(e)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var e=this.connection.isUsingTLS(),t=this.timelineSender;this.timelineSenderTimer=new _(6e4,(function(){t.send(e)}))}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(e,t,r){return this.global_emitter.bind(e,t,r),this}unbind(e,t,r){return this.global_emitter.unbind(e,t,r),this}bind_global(e){return this.global_emitter.bind_global(e),this}unbind_global(e){return this.global_emitter.unbind_global(e),this}unbind_all(e){return this.global_emitter.unbind_all(),this}subscribeAll(){var e;for(e in this.channels.channels)this.channels.channels.hasOwnProperty(e)&&this.subscribe(e)}subscribe(e){var t=this.channels.add(e,this);return t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():t.subscriptionPending||"connected"!==this.connection.state||t.subscribe(),t}unsubscribe(e){var t=this.channels.find(e);t&&t.subscriptionPending?t.cancelSubscription():(t=this.channels.remove(e))&&t.subscribed&&t.unsubscribe()}send_event(e,t,r){return this.connection.send_event(e,t,r)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}Ot.instances=[],Ot.isReady=!1,Ot.logToConsole=!1,Ot.Runtime=ot,Ot.ScriptReceivers=ot.ScriptReceivers,Ot.DependenciesReceivers=ot.DependenciesReceivers,Ot.auth_callbacks=ot.auth_callbacks;var Rt=t.default=Ot;ot.setup(Ot)}])},e.exports=t()},2592:(e,t,r)=>{const n=r(7138),s=r(5115),i=r(6907),o=r(3776);function a(e,t,r,i,o){const a=[].slice.call(arguments,1),c=a.length,u="function"==typeof a[c-1];if(!u&&!n())throw new Error("Callback required as last argument");if(!u){if(c<1)throw new Error("Too few arguments provided");return 1===c?(r=t,t=i=void 0):2!==c||t.getContext||(i=r,r=t,t=void 0),new Promise((function(n,o){try{const o=s.create(r,i);n(e(o,t,i))}catch(e){o(e)}}))}if(c<2)throw new Error("Too few arguments provided");2===c?(o=r,r=t,t=i=void 0):3===c&&(t.getContext&&void 0===o?(o=i,i=void 0):(o=i,i=r,r=t,t=void 0));try{const n=s.create(r,i);o(null,e(n,t,i))}catch(e){o(e)}}t.create=s.create,t.toCanvas=a.bind(null,i.render),t.toDataURL=a.bind(null,i.renderToDataURL),t.toString=a.bind(null,(function(e,t,r){return o.render(e,r)}))},7138:e=>{e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},1845:(e,t,r)=>{const n=r(242).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=n(e),s=145===r?26:2*Math.ceil((r-13)/(2*t-2)),i=[r-7];for(let e=1;e{const n=r(6910),s=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*s.indexOf(this.data[t]);r+=s.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(s.indexOf(this.data[t]),6)},e.exports=i},7245:e=>{function t(){this.buffer=[],this.length=0}t.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let r=0;r>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},3280:e=>{function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,r,n){const s=e*this.size+t;this.data[s]=r,n&&(this.reservedBit[s]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},3424:(e,t,r)=>{const n=r(2378),s=r(6910);function i(e){this.mode=s.BYTE,"string"==typeof e&&(e=n(e)),this.data=new Uint8Array(e)}i.getBitsLength=function(e){return 8*e},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){for(let t=0,r=this.data.length;t{const n=r(4908),s=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];t.getBlocksCount=function(e,t){switch(t){case n.L:return s[4*(e-1)+0];case n.M:return s[4*(e-1)+1];case n.Q:return s[4*(e-1)+2];case n.H:return s[4*(e-1)+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case n.L:return i[4*(e-1)+0];case n.M:return i[4*(e-1)+1];case n.Q:return i[4*(e-1)+2];case n.H:return i[4*(e-1)+3];default:return}}},4908:(e,t)=>{t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return r}}},6526:(e,t,r)=>{const n=r(242).getSymbolSize;t.getPositions=function(e){const t=n(e);return[[0,0],[t-7,0],[0,t-7]]}},1642:(e,t,r)=>{const n=r(242),s=n.getBCHDigit(1335);t.getEncodedBits=function(e,t){const r=e.bit<<3|t;let i=r<<10;for(;n.getBCHDigit(i)-s>=0;)i^=1335<{const r=new Uint8Array(512),n=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)r[t]=e,n[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)r[e]=r[e-255]}(),t.log=function(e){if(e<1)throw new Error("log("+e+")");return n[e]},t.exp=function(e){return r[e]},t.mul=function(e,t){return 0===e||0===t?0:r[n[e]+n[t]]}},5442:(e,t,r)=>{const n=r(6910),s=r(242);function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return 13*e},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},e.exports=i},7126:(e,t)=>{t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function r(e,r,n){switch(e){case t.Patterns.PATTERN000:return(r+n)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return n%3==0;case t.Patterns.PATTERN011:return(r+n)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case t.Patterns.PATTERN101:return r*n%2+r*n%3==0;case t.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case t.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let r=0,n=0,s=0,i=null,o=null;for(let a=0;a=5&&(r+=n-5+3),i=t,n=1),t=e.get(c,a),t===o?s++:(s>=5&&(r+=s-5+3),o=t,s=1)}n>=5&&(r+=n-5+3),s>=5&&(r+=s-5+3)}return r},t.getPenaltyN2=function(e){const t=e.size;let r=0;for(let n=0;n=10&&(1488===n||93===n)&&r++,s=s<<1&2047|e.get(o,i),o>=10&&(1488===s||93===s)&&r++}return 40*r},t.getPenaltyN4=function(e){let t=0;const r=e.data.length;for(let n=0;n{const n=r(3114),s=r(7007);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!n.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return s.testNumeric(e)?t.NUMERIC:s.testAlphanumeric(e)?t.ALPHANUMERIC:s.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return r}}},1085:(e,t,r)=>{const n=r(6910);function s(e){this.mode=n.NUMERIC,this.data=e.toString()}s.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);const s=this.data.length-t;s>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*s+1))},e.exports=s},6143:(e,t,r)=>{const n=r(9729);t.mul=function(e,t){const r=new Uint8Array(e.length+t.length-1);for(let s=0;s=0;){const e=r[0];for(let s=0;s{const n=r(242),s=r(4908),i=r(7245),o=r(3280),a=r(1845),c=r(6526),u=r(7126),l=r(5393),d=r(2882),h=r(3103),f=r(1642),p=r(6910),g=r(6130);function y(e,t,r){const n=e.size,s=f.getEncodedBits(t,r);let i,o;for(i=0;i<15;i++)o=1==(s>>i&1),i<6?e.set(i,8,o,!0):i<8?e.set(i+1,8,o,!0):e.set(n-15+i,8,o,!0),i<8?e.set(8,n-i-1,o,!0):i<9?e.set(8,15-i-1+1,o,!0):e.set(8,15-i-1,o,!0);e.set(n-8,8,1,!0)}function m(e,t,r,s){let f;if(Array.isArray(e))f=g.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let n=t;if(!n){const t=g.rawSplit(e);n=h.getBestVersionForData(t,r)}f=g.fromString(e,n||40)}}const m=h.getBestVersionForData(f,r);if(!m)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(s+t,i+n,!0,!0):e.set(s+t,i+n,!1,!0))}}(w,t),function(e){const t=e.size;for(let r=8;r=7&&function(e,t){const r=e.size,n=h.getEncodedBits(t);let s,i,o;for(let t=0;t<18;t++)s=Math.floor(t/3),i=t%3+r-8-3,o=1==(n>>t&1),e.set(s,i,o,!0),e.set(i,s,o,!0)}(w,t),function(e,t){const r=e.size;let n=-1,s=r-1,i=7,o=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!e.isReserved(s,a-r)){let n=!1;o>>i&1)),e.set(s,a-r,n),i--,-1===i&&(o++,i=7)}if(s+=n,s<0||r<=s){s-=n,n=-n;break}}}(w,b),isNaN(s)&&(s=u.getBestMask(w,y.bind(null,w,r))),u.applyMask(s,w),y(w,r,s),{modules:w,version:t,errorCorrectionLevel:r,maskPattern:s,segments:f}}t.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let r,i,o=s.M;return void 0!==t&&(o=s.from(t.errorCorrectionLevel,s.M),r=h.from(t.version),i=u.from(t.maskPattern),t.toSJISFunc&&n.setToSJISFunction(t.toSJISFunc)),m(e,r,o,i)}},2882:(e,t,r)=>{const n=r(6143);function s(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}s.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},s.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const r=n.mod(t,this.genPoly),s=this.degree-r.length;if(s>0){const e=new Uint8Array(this.degree);return e.set(r,s),e}return r},e.exports=s},7007:(e,t)=>{const r="[0-9]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const s="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";t.KANJI=new RegExp(n,"g"),t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=new RegExp(s,"g"),t.NUMERIC=new RegExp(r,"g"),t.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const i=new RegExp("^"+n+"$"),o=new RegExp("^"+r+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return i.test(e)},t.testNumeric=function(e){return o.test(e)},t.testAlphanumeric=function(e){return a.test(e)}},6130:(e,t,r)=>{const n=r(6910),s=r(1085),i=r(8260),o=r(3424),a=r(5442),c=r(7007),u=r(242),l=r(5987);function d(e){return unescape(encodeURIComponent(e)).length}function h(e,t,r){const n=[];let s;for(;null!==(s=e.exec(r));)n.push({data:s[0],index:s.index,mode:t,length:s[0].length});return n}function f(e){const t=h(c.NUMERIC,n.NUMERIC,e),r=h(c.ALPHANUMERIC,n.ALPHANUMERIC,e);let s,i;return u.isKanjiModeEnabled()?(s=h(c.BYTE,n.BYTE,e),i=h(c.KANJI,n.KANJI,e)):(s=h(c.BYTE_KANJI,n.BYTE,e),i=[]),t.concat(r,s,i).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function p(e,t){switch(t){case n.NUMERIC:return s.getBitsLength(e);case n.ALPHANUMERIC:return i.getBitsLength(e);case n.KANJI:return a.getBitsLength(e);case n.BYTE:return o.getBitsLength(e)}}function g(e,t){let r;const c=n.getBestModeForData(e);if(r=n.from(t,c),r!==n.BYTE&&r.bit=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[]))},t.rawSplit=function(e){return t.fromArray(f(e,u.isKanjiModeEnabled()))}},242:(e,t)=>{let r;const n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return n[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');r=e},t.isKanjiModeEnabled=function(){return void 0!==r},t.toSJIS=function(e){return r(e)}},3114:(e,t)=>{t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},3103:(e,t,r)=>{const n=r(242),s=r(5393),i=r(4908),o=r(6910),a=r(3114),c=n.getBCHDigit(7973);function u(e,t){return o.getCharCountIndicator(e,t)+4}function l(e,t){let r=0;return e.forEach((function(e){const n=u(e.mode,t);r+=n+e.getBitsLength()})),r}t.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!a.isValid(e))throw new Error("Invalid QR Code version");void 0===r&&(r=o.BYTE);const i=8*(n.getSymbolTotalCodewords(e)-s.getTotalCodewordsCount(e,t));if(r===o.MIXED)return i;const c=i-u(r,e);switch(r){case o.NUMERIC:return Math.floor(c/10*3);case o.ALPHANUMERIC:return Math.floor(c/11*2);case o.KANJI:return Math.floor(c/13);case o.BYTE:default:return Math.floor(c/8)}},t.getBestVersionForData=function(e,r){let n;const s=i.from(r,i.M);if(Array.isArray(e)){if(e.length>1)return function(e,r){for(let n=1;n<=40;n++)if(l(e,n)<=t.getCapacity(n,r,o.MIXED))return n}(e,s);if(0===e.length)return 1;n=e[0]}else n=e;return function(e,r,n){for(let s=1;s<=40;s++)if(r<=t.getCapacity(s,n,e))return s}(n.mode,n.getLength(),s)},t.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;n.getBCHDigit(t)-c>=0;)t^=7973<{const n=r(9653);t.render=function(e,t,r){let s=r,i=t;void 0!==s||t&&t.getContext||(s=t,t=void 0),t||(i=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),s=n.getOptions(s);const o=n.getImageWidth(e.modules.size,s),a=i.getContext("2d"),c=a.createImageData(o,o);return n.qrToImageData(c.data,e,s),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(a,i,o),a.putImageData(c,0,0),i},t.renderToDataURL=function(e,r,n){let s=n;void 0!==s||r&&r.getContext||(s=r,r=void 0),s||(s={});const i=t.render(e,r,s),o=s.type||"image/png",a=s.rendererOpts||{};return i.toDataURL(o,a.quality)}},3776:(e,t,r)=>{const n=r(9653);function s(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function i(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}t.render=function(e,t,r){const o=n.getOptions(t),a=e.modules.size,c=e.modules.data,u=a+2*o.margin,l=o.color.light.a?"':"",d="0&&u>0&&e[c-1]||(n+=o?i("M",u+r,.5+l+r):i("m",s,0),s=0,o=!1),u+1',h='viewBox="0 0 '+u+" "+u+'"',f=''+l+d+"\n";return"function"==typeof r&&r(null,f),f}},9653:(e,t)=>{function r(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,s=e.scale||4;return{width:n,scale:n?4:s,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,r){const n=t.getScale(e,r);return Math.floor((e+2*r.margin)*n)},t.qrToImageData=function(e,r,n){const s=r.modules.size,i=r.modules.data,o=t.getScale(s,n),a=Math.floor((s+2*n.margin)*o),c=n.margin*o,u=[n.color.light,n.color.dark];for(let t=0;t=c&&r>=c&&t{"use strict";var n;r.r(t),r.d(t,{NIL:()=>N,parse:()=>y,stringify:()=>l,v1:()=>g,v3:()=>S,v4:()=>k,v5:()=>T,validate:()=>a,version:()=>x});var s=new Uint8Array(16);function i(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(s)}const o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,a=function(e){return"string"==typeof e&&o.test(e)};for(var c=[],u=0;u<256;++u)c.push((u+256).toString(16).substr(1));const l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase();if(!a(r))throw TypeError("Stringified UUID is invalid");return r};var d,h,f=0,p=0;const g=function(e,t,r){var n=t&&r||0,s=t||new Array(16),o=(e=e||{}).node||d,a=void 0!==e.clockseq?e.clockseq:h;if(null==o||null==a){var c=e.random||(e.rng||i)();null==o&&(o=d=[1|c[0],c[1],c[2],c[3],c[4],c[5]]),null==a&&(a=h=16383&(c[6]<<8|c[7]))}var u=void 0!==e.msecs?e.msecs:Date.now(),g=void 0!==e.nsecs?e.nsecs:p+1,y=u-f+(g-p)/1e4;if(y<0&&void 0===e.clockseq&&(a=a+1&16383),(y<0||u>f)&&void 0===e.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=u,p=g,h=a;var m=(1e4*(268435455&(u+=122192928e5))+g)%4294967296;s[n++]=m>>>24&255,s[n++]=m>>>16&255,s[n++]=m>>>8&255,s[n++]=255&m;var b=u/4294967296*1e4&268435455;s[n++]=b>>>8&255,s[n++]=255&b,s[n++]=b>>>24&15|16,s[n++]=b>>>16&255,s[n++]=a>>>8|128,s[n++]=255&a;for(var v=0;v<6;++v)s[n+v]=o[v];return t||l(s)},y=function(e){if(!a(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};function m(e,t,r){function n(e,n,s,i){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r>>9<<4)+1}function v(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function w(e,t,r,n,s,i){return v((o=v(v(t,e),v(n,i)))<<(a=s)|o>>>32-a,r);var o,a}function A(e,t,r,n,s,i,o){return w(t&r|~t&n,e,t,s,i,o)}function P(e,t,r,n,s,i,o){return w(t&n|r&~n,e,t,s,i,o)}function E(e,t,r,n,s,i,o){return w(t^r^n,e,t,s,i,o)}function C(e,t,r,n,s,i,o){return w(r^(t|~n),e,t,s,i,o)}const S=m("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r>5]>>>s%32&255,o=parseInt(n.charAt(i>>>4&15)+n.charAt(15&i),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[n/8])<>>32-t}const T=m("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var s=0;s>>0;v=b,b=m,m=R(y,30)>>>0,y=g,g=P}r[0]=r[0]+g>>>0,r[1]=r[1]+y>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+b>>>0,r[4]=r[4]+v>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),N="00000000-0000-0000-0000-000000000000",x=function(e){if(!a(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},9159:()=>{},30:(e,t)=>{"use strict";function r(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),s=1,i=[0,1];for(let e=1;e>--c&1}const d=2**31,h=d>>>1,f=d-1;let p=0;for(let e=0;e<31;e++)p=p<<1|l();let g=[],y=0,m=d;for(;;){let e=Math.floor(((p-y+1)*s-1)/m),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e>>1|l(),o=o<<1^h,a=(a^h)<<1|h|1;y=o,m=1+a-o}let b=n-4;return g.map((t=>{switch(t-b){case 3:return b+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return b+256+(e[a++]<<8|e[a++]);case 1:return b+e[a++];default:return t-1}}))}(function(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((e,r)=>t[e.charCodeAt(0)]=r));let r=e.length,n=new Uint8Array(6*r>>3);for(let s=0,i=0,o=0,a=0;s=8&&(n[i++]=a>>(o-=8));return n}(e)))}function n(e){return 1&e?~e>>1:e>>1}function s(e,t){let r=Array(e);for(let s=0,i=0;s{let t=i(e);if(t.length)return t}))}function a(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(l(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(d(r,e))}return t.flat()}function c(e){let t=[];for(;;){let r=e(t.length);if(!r)break;t.push(r)}return t}function u(e,t,r){let n=Array(e).fill().map((()=>[]));for(let i=0;in[t].push(e)));return n}function l(e,t){let r=1+t(),n=t(),s=c(t);return u(s.length,1+e,t).flatMap(((e,t)=>{let[i,...o]=e;return Array(s[t]).fill().map(((e,t)=>{let s=t*n;return[i+t*r,o.map((e=>e+s))]}))}))}function d(e,t){return u(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}var h=r("AEgSbwjEDVYByQKaAQsBOQDpATQAngDUAHsAoABoANQAagCNAEQAhABMAHIAOwA9ACsANgAmAGIAHgAvACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGAAeABMAFwAXAA0ADgAWAA8AFAAVBFsF1QEXE0o3xAXUALIArkABaACmAgPGAK6AMDAwMAE/qAYK7P4HQAblMgVYBVkAPSw5Afa3EgfJwgAPA8meNALGCjACjqIChtk/j2+KAsXMAoPzASDgCgDyrgFCAi6OCkCQAOQA4woWABjVuskNDD6eBBx4AP4COhi+D+wKBirqBgSCaA0cBy4ArABqku+mnIAAXAaUJAbqABwAPAyUFvyp/Mo8INAIvCoDshQ8APcubKQAon4ZABgEJtgXAR4AuhnOBPsKIE04CZgJiR8cVlpM5INDABQADQAWAA9sVQAiAA8ASO8W2T30OVnKluYvChEeX05ZPe0AFAANABYAD2wgXUCYAMPsABwAOgzGFryp/AHauQVcBeMC0KACxLEKTR2kZhR0Gm5M9gC8DmgC4gAMLjSKF8qSAoF8ARMcAL4OaALiAAwuAUlQJpJMCwMt/AUpCthqGK4B2EQAciwSeAIyFiIDKCi6OGwAOuIB9iYAyA7MtgEcZIIAsgYABgCK1EoFHNZsGACoKNIBogAAAAAAKy4DnABoAQoaPu43dQQZGACrAcgCIgDgLBJ0OvRQsTOiKDVJBfsoBVoFWbC5BWo7XkITO1hCmHuUZmCh+QwUA8YIJvJ4JASkTAJUVAJ2HKwoAZCkpjZcA0YYBIRiCgDSBqxAMCQHKgI6XgBsAWIgcgCEHhoAlgFKuAAoahgBsMYDOC4iRFQBcFoGZgJmAPJKGAMqAgYASkIArABeAHQALLYGCPTwGo6AAAAKIgAqALQcSAHSAdwIDDKXeYHpAAsAEgA1AD4AOTR3etTBEGAQXQJNCkxtOxUMAq0PpwvmERYM0irM09kANKoH7ANUB+wDVANUB+wH7ANUB+wDVANUA1QDVBwL8BvUwRBgD0kEbgWPBYwE1wiEJkoRggcpCNNUDnQfHEgDRgD9IyZJHTuUMwwlQ0wNTQQH/TZDbKh9OQNIMaxU9pCjA8wyUDltAh5yEqEAKw90HTW2Tn96SHGhCkxPr7WASWNOaAK/Oqk/+QoiCZRvvHdPBj4QGCeiEPQMMAGyATgN6kvVBO4GOATGH3oZFg/KlZkIoi3aDOom4C6egFcj8iqABepL8TzaC0pRZQ9WC2IJ4DpggUsDHgEKIogK2g02CGoQ8ArGaA3iEUIHNgPSSZcAogb+Cw4dMhWyJg1iqQsGOXQG+BrzC4wmrBMmevkF0BoeBkoBJhr8AMwu5IWtWi5cGU9cBgALIiPEFKVQHQ0iQLR4RRoYBxIlpgKOQ21KhFEzHpAh8zw6DWMuEFF5B/I8AhlMC348m0aoRQsRzz6KPUUiRkwpBDJ8LCwniAnMD4IMtnxvAVYJHgmuDG4TLhEUN8IINgcWKpchJxIIHkaSYJcE9JwD8BPOAwgFPAk+BxADshwqEysVJgUKgSHUAvA20i6wAoxWfQEUBcgPIh/cEE1H3Q7mCJgCYgOAJegAKhUeABQimAhAYABcj9VTAi7ICMRqaSNxA2QU5F4RcAeODlQHpBwwFbwc3nDFXgiGBSigrAlYAXIJlgFcBOAIBjVYjJ0gPmdQi1UYmCBeQTxd+QIuDGIVnES6h3UCiA9oEhgBMgFwBzYM/gJ0EeoRaBCSCOiGATWyM/U6IgRMIYAgDgokA0xsywskJvYM9WYBoBJfAwk0OnfrZ6hgsyEX+gcWMsJBXSHuC49PygyZGr4YP1QrGeEHvAPwGvAn50FUBfwDoAAQOkoz6wS6C2YIiAk8AEYOoBQH1BhnCm6MzQEuiAG0lgNUjoACbIwGNAcIAGQIhAV24gAaAqQIoAACAMwDVAA2AqoHmgAWAII+AToDJCwBHuICjAOQCC7IAZIsAfAmBBjADBIA9DRuRwLDrgKAZ2afBdpVAosCRjIBSiIEAktETgOsbt4A2ABIBhDcRAESqEfIF+BAAdxsKADEAPgAAjIHAj4BygHwagC0AVwLLgmfsLIBSuYmAIAAEmgB1AKGANoAMgB87gFQAEoFVvYF0AJMRgEOLhUoVF4BuAMcATABCgB2BsiKosYEHARqB9ACEBgV3gLvKweyAyLcE8pCwgK921IAMhMKNQqkCqNgWF0wAy5vPU0ACx+lPsQ/SwVOO1A7VTtQO1U7UDtVO1A7VTtQO1UDlLzfvN8KaV9CYegMow3RRMU6RhPYYE5gLxPFLbQUvhXLJVMZOhq5JwIl4VUGDwEt0GYtCCk0che5ADwpZYM+Y4MeLQpIHORTjlT1LRgArkufM6wNqRsSRD0FRHXqYicWCwofAmR+AmI/WEqsWDcdAqH0AmiVAmYGAp+BOBgIAmY4AmYjBGsEfAN/EAN+jzkDOXQUOX86ICACbBoCMjM4BwJtxAJtq+yHMGRCKAFkANsA3gBHAgeVDIoA+wi/AAqyAncsAnafPAJ5SEACeLcaWdhFq0bwAnw8AnrFAn0GAnztR/1IemAhACgSSVVKWBIUSskC0P4C0MlLJAOITAOH40TCkS8C8p5dAAMDq0vLTCoiAMxNSU2sAos8AorVvhgEGkBkArQCjjQCjlk9lH4CjtYCjll1UbFTMgdS0VSCApP4ApMJAOYAGVUbVaxVzQMsGCmSgzLeeGNFODYCl5wC769YHqUAViIClowClnmZAKZZqVoGfkoAOAKWsgKWS1xBXM4CmcgCmWFcx10EFgKcmDm/OpoCnBMCn5gCnrWHABoMLicMAp3uAp6PALI6YTFh7AKe0AKgawGmAp6cHAKeS6JjxWQkIigCJ6wCJnsCoPgCoEnUAqYsAqXLAqf8AHoCp+9oeWiuAABGahlqzgKs4AKsqwKtZAKs/wJXGgJV2QKx3tQDH0tslAKyugoCsuUUbN1tYG1FXAMlygK2WTg8bo0DKUICuFsCuUQSArkndHAzcN4CvRYDLa8DMg4CvoVx/wMzbgK+F3Mfc0wCw8gCwwFzf3RIMkJ03QM8pAM8lwM9vALFeQLGRALGDYYCyGZOAshBAslMAskrAmSaAt3PeHZeeKt5IkvNAxigZv8CYfEZ8JUhewhej164DgLPaALPaSxIUM/wEJwAw6oCz3ABJucDTg9+SAIC3CQC24cC0kwDUlkDU1wA/gNViYCGPMgT6l1CcoLLg4oC2sQC2duEDYRGpzkDhqIALANkC4ZuVvYAUgLfYgLetXB0AuIs7REB8y0kAfSYAfLPhALr8ALpbXYC6vYC6uEA9kQBtgLuhgLrmZanlwAC7jwDhd2YdnDdcZ4C8wAAZgOOE5mQAvcQA5FrA5KEAveVAvnWAvhjmhmaqLg0mxsDnYAC/vcBGAA2nxmfsAMFigOmZwOm1gDOwgMGZ6GFogIGAwxGAQwBHAdqBl62ZAIAuARovA6IHrAKABRyNgAgAzASSgOGfAFgJB4AjOwAHgDmoAScjgi0BhygwgCoBRK86h4+PxZ5BWk4P0EsQiJCtV9yEl+9AJbGBTMAkE0am7o7J2AzErrQDjAYxxiKyfcFWAVZBVgFWQVkBVkFWAVZBVgFWQVYBVkFWAVZRxYI2IZoAwMDCmVe6iwEygOyBjC8vAC8BKi8AOhBKhazBUc+aj5xQkBCt192OF/pAFgSM6wAjP/MbMv9puhGez4nJAUsFyg3Nn5u32vB8hnDLGoBbNdvMRgFYAVrycLJuQjQSlwBAQEKfV5+jL8AND+CAAQW0gbmriQGAIzEDAMCDgDlZh4+JSBLQrJCvUI5JF8oYDcoOSQJwj4KRT9EPnk+gj5xPnICikK9SkM8X8xPUGtOCy1sVTBrDG8gX+E0OxwJaJwKYyQsPR4nQqxCvSzMAsv9X8oPIC8KCQoAACN+nt9rOy5LGMmsya0JZsLMzQphQWAP5hCkEgCTjh5GQiYbqm06zjkKND9EPnFCQBwICx5NSG1cLS5a4rwTCn7uHixCQBxeCUsKDzRVREM4BTtEnC0KghwuQkAb9glUIyQZMTIBBo9i8F8KcmTKYAxgLiRvAERgGjoDHB9gtAcDbBFmT2BOEgIAZOhgFmCWYH5gtGBMYJJpFhgGtg/cVqq8WwtDF6wBvCzOwgMgFgEdBB8BegJtMDGWU4EBiwq5SBsA5SR0jwvLDqdN6wGcAoidUAVBYAD4AD4LATUXWHsMpg0lILuwSABQDTUAFhO4NVUC0wxLZhEcANlPBnYECx9bADIAtwKbKAsWcKwzOaAaAVwBhwn9A9ruEAarBksGugAey1aqWwq7YhOKCy1ADrwBvAEjA0hbKSkpIR8gIi0TJwciDY4AVQJvWJFKlgJvIA9ySAHUdRDPUiEaqrFN6wcSBU1gAPgAPgsBewAHJW0LiAymOTEuyLBXDgwAYL0MAGRKaFAiIhzAADIAtwKbKC08D88CkRh8ULxYyXRzjtilnA72mhU+G+0S2hIHDxwByAk7EJQGESwNNwwAPAC0zwEDAKUA4gCbizAAFQBcG8cvbXcrDsIRAzwlRNTiHR8MG34CfATCC6vxbQA4Oi4Opzkuz6IdB7wKABA7Ls8SGgB9rNsdD7wbSBzOoncfAT4qYB0C7KAJBE3z5R9mDL0M+wg9Cj8ABcELPgJMDbwIvQ09CT0KvS7PoisOvAaYAhwPjBriBBwLvBY8AKELPBC8BRihe90AO2wMPQACpwm9BRzR9QYFB2/LBnwAB7wSXBISvQECAOsCAAB1FVwHFswV/HAXvBg8AC68AuyovAAevAJWISuAAAG8AALkFT0VvCvso7zJqDwEAp8nTAACXADn3hm8CaVcD7/FAPUafAiiBQv/cQDfvKe8GNwavKOMeXMG/KmchAASvAcbDAADlABtvAcAC7ynPAIaPLsIopzLDvwHwak8AOF8L7dtvwNJAAPsABW8AAb8AAm8AGmMABq8AA68Axi8jmoV/AABXAAObAAuTB8ABrwAF7wIIgANSwC6vCcAA7wADpwq7ACyWwAcHAAbvAAB7AqiAAXHCxYV3AAHnABCvAEDAGm8AAt8AB28AAi8CaIABcsAbqAZ1gCSCCIABcsAATwAB9wAHZwIIgAGmwAJfAAbLABtHADmvIEACFwACDwAFLwAaPwJIgAGywDjjAAJPAuiDsX7YAAHPABunUBJAEgACrwFAAM8AAmuAzgABxwAGXwAAgym/AAKHAAKPAAJ/KfsBrwACRwAAwwAEDwBABQ8ABFsAA+MAA3sAA28ABkMBxYcABU8AG6cFrQBvAC7ABM8BABpLAsA4UwAAjwABFMAF3wFHAAG0QAYvB8BfClTADpGALAJBw4McwApK3EBpQYIXwJtJA0ACghwTG1gK4oggRVjLjcDogq1AALZABcC/ARvAXdzSFMVIgNQAhY/AS0GBHRHvnxTe0EAKgAyAvwAVAvcAHyRLQEsAHfmDhIzRwJLAFgGAAJRAQiLzQB5PAQhpgBbANcWAJZpOCCMAM5ssgDQ1RcJw3Z0HBlXHgrSAYmRrCNUVE5JEz3DivoAgB04QSos4RKYUABzASosMSlDGhADMVYE+MbvAExm3QBrAnICQBF7Osh4LzXWBhETIAUVCK6v/xPNACYAAQIbAIYAiQCONgDjALQA1QCdPQC7AKsApgChAOcAnwDTAJwA4AEBAPwAwAB6AFsAywDNAPwA1wDrAIkAogEqAOMA2ADVBAIIKzTT09PTtb/bzM/NQjEWAUsBVS5GAVMBYgFhAVQBRUpCRGcMAUwUBgkEMzcMBwAgDSQmKCs3OTk8PDw9Pg0/HVBQUFBSUlFSKFNUVlVVHFxgYF9hYCNlZ29ucXFxcXFxc3Nzc3Nzc3Nzc3N1dXZ1dFsAPesAQgCTAHEAKwBf8QCHAFAAUAAwAm/oAIT+8fEAXQCM6wCYAEgAWwBd+PipAH4AfgBiAE8AqgAdAK8AfAI5AjwA9QDgAPcA9wDhAPgA4gDiAOEA3wAoAnQBSgE5ATcBTQE3ATcBNwEyATEBMQExARUBURAAKgkBAEwYCxcEFhcPAIcAjwCfAEoAYxkCKgBvAGgAkAMOAyArAxpCP0gqAIoCSADAAlACnQC5Ao8CjwKPAo8CjwKPAoQCjwKPAo8CjwKPAo8CjgKOApECmQKQAo8CjwKNAo0CjQKNAosCjgJuAc0CkAKYAo8CjwKOF3oMAPcGA5gCWgIzGAFNETYC2xILLBQBRzgUTpIBdKU9AWJaAP4DOkgA/wCSKh4ZkGsAKmEAagAvAIoDlcyM8K+FWwa7LA/DEgKe1nUrCwQkWwGzAN5/gYB/gX+Cg4N/hIeFf4aJh4GIg4mDin+Lf4x/jYuOf49/kIORf5J/k3+Uf5WElomXg5h/AIMloQCEBDwEOQQ7BD4EPARCBD8EOgRABEIEQQQ9BD8EQgCkA4gAylIA0AINAPdbAPcBGgD3APUA9QD2APXVhSRmvwD3APUA9QD2APUdAIpbAPcAigEaAPcAigLtAPcAitWFJGa/HQD4WwEaAPcA9wD1APUA9gD1APgA9QD1APYA9dWFJGa/HQCKWwEaAPcAigD3AIoC7QD3AIrVhSRmvx0CRAE3AksBOgJMwgOfAu0Dn9WFJGa/HQCKWwEaA58AigOfAIoC7QOfAIrVhSRmvx0EMQCKBDIAigeOMm4hLQCKAT9vBCQA/gDHWwMAVVv/FDMDAIoDPtkASgMAigMAl2dBtv/TrfLzakaPh3aztmIuZQrR3ER2n5Yo+qNR2jK/aP/V04UK1njIJXLgkab9PjOxyJDVbIN3R/FZLoZVl2kYFQIZ7V6LpRqGDt9OdDohnJKp5yX/HLj0voPpLrneDaN11t5W3sSM4ALscgSw8fyWLVkKa/cNcQmjYOgTLZUgOLi2F05g4TR0RfgZ4PBdntxdV3qvdxQt8DeaMMgjJMgwUxYN3tUNpUNx21AvwADDAIa0+raTWaoBXmShAl5AThpMi282o+WzOKMlxjHj7a+DI6AM6VI9w+xyh3Eyg/1XvPmbqjeg2MGXugHt8wW03DQMRTd5iqqOhjLvyOCcKtViGwAHVLyl86KqvxVX7MxSW8HLq6KCrLpB8SspAOHO9IuOwCh9poLoMEha9CHCxlRAXJNDobducWjqhFHqCkzjTM2V9CHslwq4iU19IxqhIFZMve15lDTiMVZIPdADXGxTqzSTv0dDWyk1ht430yvaYCy9qY0MQ3cC5c1uw4mHcTGkMHTAGC99TkNXFAiLQgw9ZWhwKJjGCe+J5FIaMpYhhyUnEgfrF3zEtzn40DdgCIJUJfZ0mo3eXsDwneJ8AYCr7Vx2eHFnt2H6ZEyAHs9JoQ4Lzh5zBoGOGwAz37NOPuqSNmZf51hBEovtpm2T1wI79OBWDyvCFYkONqAKGVYgIL0F+uxTcMLSPtFbiNDbBPFgip8MGDmLLHbSyGXdCMO6f7teiW9EEmorZ+75KzanZwvUySgjoUQBTfHlOIerJs6Y9wLlgDw18AB1ne0tZRNgGjcrqHbtubSUooEpy4hWpDzTSrmvqw0H9AoXQLolMt9eOM+l9RitBB1OBnrdC1XL4yLFyXqZSgZhv7FnnDEXLUeffb4nVDqYTLY6X7gHVaK4ZZlepja2Oe6OhLDI/Ve5SQTCmJdH3HJeb14cw99XsBQAlDy5s5kil2sGezZA3tFok2IsNja7QuFgM30Hff3NGSsSVFYZLOcTBOvlPx8vLhjJrSI7xrNMA/BOzpBIJrdR1+v+zw4RZ7ry6aq4/tFfvPQxQCPDsXlcRvIZYl+E5g3kJ+zLMZon0yElBvEOQTh6SaAdIO6BwdqJqfvgU+e8Y65FQhdiHkZMVt9/39N2jGd26J6cNjq8cQIyp6RonRPgVn2fl89uRDcQ27GacaN0MPrcNyRlbUWelKfDfyrNVVGBG5sjd3jXzTx06ywyzuWn5jbvEfPPCTbpClkgEu9oPLKICxU5HuDe3jA1XnvU85IYYhaEtOU1YVWYhEFsa4/TQj3rHdsU2da2eVbF8YjSI0m619/8bLMZu3xildwqM7zf1cjn4Whx0PSYXcY5bR7wEQfGC7CTOXwZdmsdTO8q3uGm7Rh/RfCWwpzBHCAaVfjxgibL5vUeL0pH6bzDmI9yCXKC/okkmbc28OJvI87L/bjFzpq0DHepw4kT1Od+fL7cyuFaRgfaUWB2++TCFvz11J0leEtrGkpccfX9z2LY39sph4PBHCjNOOkd0ybUm+ZzS8GkFbqMpq8uiX2yHpa0jllTLfGTDBMYR6FT5FWLLDPMkYxt1Q0eyMvxJWztDjy0m6VvZPvamrFXjHmPpU6WxrZqH6WW//I37RwvqPQhPz8I3RPuXAk1C94ZprQWm9iGM/KgiGDO6SV9sjp+Jmk4TBajMNJ5zzWZ1k1jrteQQBp9C2dOvmbIeeEME8y573Q8TgGe+ZCzutM45gYLBzYm2LNvgq2kebAbMpHRDSyh6dQ27GbsAAdCqQVVXWC1C+zpwBM2Lr4eqtobmmu1vJEDlIQR1iN8CUWpztq50z7FFQBn3SKViX6wSqzVQCoYvAjByjeSa+h1PRnYWvBinTDB9cHt4eqDsPS4jcD3FwXJKT0RQsl8EvslI2SFaz2OtmYLFV8FwgvWroZ3fKmh7btewX9tfL2upXsrsqpLJzpzNGyNlnuZyetg7DIOxQTMBR7dqlrTlZ6FWi1g4j1NSjA2j1Yd7fzTH6k9LxCyUCneAKYCU581bnvKih6KJTeTeCX4Zhme/QIz7w2o+AdSgtLAkdrLS9nfweYEqrMLsrGGSWXtgWamAWp6+x6GM/Z8jNw3BqPNQ39hrzYLECn3tPvh/LqKbRSCiDGauDKBBj/kGbpnM1Bb/my8hv4NWStclkwjfl57y4oNDgw1JAG9VOti3QVVoSziMEsSdfEjaCPIDb7SgpLXykQsM+nbqbt97I0mIlzWv0uqFobLMAq8Rd9pszUBKxFhBPwOjf//gVOz2r7URJ2OnpviCXv9iz3a4X/YLBYbXoYwxBv/Kq0a5s4utQHzoTerJ7PmFW/no/ZAsid/hRIV82tD+Qabh5F1ssIM8Ri3chu0PuPD3sSJRMjDoxLAbwUbroiPAz/V52e8s3DIixxlO7OrvhMj3qfzA0kKxzwicr5wJmZwJxTXgrwYsqhRvpgC2Nfdyd+TYYxJSZgk+gk2g9KyHSlwQVAyPtWWgvVGyVBqsU2LpDlLNosSAtolC1uBKt5pQZLhAxTjeGCWIC/HVpagc5rRwkgpCHKEsjA8d+scp8aiMewwQBhp5dYTV5t/Nvl+HbDMu8F3S0psPyZb1bSnqlHPFUnMQeQqSqwDBT23fJO9gO3aVaa1icrXU0PKwlMM5K+iL3ATcVq2fFWKk0irCTF4LDVDG4gUpkyplq6efcZS+WDR1woApjD18x+2JQR9oOXzuA7uy4b+/91WsJd/tSd1QcAH8PVPXApieA37B7YXPhDPH1azP3PKR+HfHmOoDYLeuKsIi/ssSsdYs62qJo14Hw1P2N/6zpr8F3FTWmJ4ysAVcl84Iv/tl///Z8FaAWbBQbyMNDZjrZ2JwdRjtd1jOeNumSodFtr4/Zf45iRJf/8HSW+KIB/+GlKu8Rv1BPLr/4duoL+kFPRqrstEr41gfJupoJRf4hcYDWX93FOcfEBiIivxtjtV8g7mvOReiamYWKE7vfPbv3v2L9Kwq3cIDFGLyhyfOGuf/9vA5muH6Pjg7B4SUj2ydDXra9fSBI+DrsNHA6l51wfHssJb+11TfNk7B8OleUe3Y+ZmHboMFHdv7FFP2cfISFyeAQR0sk/Xv62HBTdW4HmnGSLFk/cqyWVVFJkdIIa+4hos3JRHcqLoRKM5h2Qtk1RZtzISMtlXTfTqIc77YsCCgQD0r61jtxskCctwJOtjE/pL8wC4LBD4AZFjh2wzzFCrT/PNqW0/DeBbkfMfzVm9yy06WiF+1mTdNNEAytVtohBKg3brWd2VQa+aF+cQ0mW5CvbwOlWCT07liX226PjiVLwFCRs/Ax2/u+ZNPjrNFIWIPf5GjHyUKp60OeXe9F01f7IaPf/SDTvyDAf7LSWWejtiZcsqtWZjrdn6A2MqBwnSeKhrZOlUMmgMionmiCIvXqKZfmhGZ1MwD3uMF4n9KJcfWLA3cL5pq48tm5NDYNh3SS/TKUtmFSlQR89MR4+kxcqJgpGbhm9gXneDELkyqAN5nitmIzTscKeJRXqd64RiaOALR2d295NWwbjHRNG2AU5oR9OS2oJg/5CY6BFPc1JvD2Mxdhp2/MZdI8dLePxiP4KRIp8VXmqfg+jqd/RNG7GNuq1U2SiI4735Bdc0MVFx6mH5UOWEa5HuhYykd6t4M1gYLVS8m1B+9bUqi5DziQq7qT8d94cxB6AB4WqMCOF/zPPtRSZUUaMSsvHOWxGASufywTX8ogy6HgUf9p+Z30wUEosl8qgmwm6o2AV6nO9HKQjRHpN6SUegI5pvR61RLnUJ1lqCtmfcsRQutEizVpAaPXN7xMp5UQ5OSZK6tniCK9CpyMd7LjR6+MxfoMEDPpWdf2p2m5N3KO4QMxf+V7vGdYjemQczQ+m2MGIkFNYDMf0Yop2eSx81sP36WHUczqEhKysp2iJSYAvfgJjinKwToPvRKb+HBi+7cJ96S5ngfLOXaHAFRLkulo4TnXTFO51gX0TCCo4ZUHdbpdgkMEwUZAPjh6M+hA8DzycbtxAgH3uD6i0nN1aTiIuQ4BYCE9dEHHwAmINU+4YEWx4EC3OZwFGfYZMPLScVlb+BAAJeARUh+gdWA3/gRqCrf1jecgqeFf1MdzrrP4SVlGm5mMihSP+zYYksAB7O+SBPwNQqSNMiLnkviY/klwgcRmvqtCqeWeA0gjuir4CMZqmw/ntP6M+l0pdN8/P9xI53aP7x/zavJbbKOz8VzO/nXxIr1tjparMnqd6iWdByHKw4lF4p/u57Yv07WeZPDnRl7wgmDVZZ44fQsjdYO/gmXQ+940PRGst8UMQApFC4OOV22e4N+lVOPyFLAOj4t8R3PFw/FjbSWy0ELuAFReNkee8ORcBOT2NPDcs7OfpUmzvn/F9Czk9o9naMyVYy/j8I5qVFmQDFcptBp65J/+sJA3w/j6y/eqUkKxTsf0CZjtNdRSBEmJ2tmfgmJbqpcsSagk+Ul9qdyV+NnqFBIJZFCB1XwPvWGDBOjVUmpWGHsWA5uDuMgLUNKZ4vlq5qfzY1LnRhCc/mh5/EX+hzuGdDy5aYYx4BAdwTTeZHcZpl3X0YyuxZFWNE6wFNppYs3LcFJePOyfKZ8KYb7dmRyvDOcORLPH0sytC6mH1US3JVj6paYM1GEr+CUmyHRnabHPqLlh6Kl0/BWd3ebziDfvpRQpPoR7N+LkUeYWtQ6Rn5v5+NtNeBPs2+DKDlzEVR5aYbTVPrZekJsZ9UC9qtVcP99thVIt1GREnN8zXP8mBfzS+wKYym8fcW6KqrE702Zco+hFQAEIR7qimo7dd7wO8B7R+QZPTuCWm1UAwblDTyURSbd85P4Pz+wBpQyGPeEpsEvxxIZkKsyfSOUcfE3UqzMFwZKYijb7sOkzpou+tC4bPXey5GI1GUAg9c3vLwIwAhcdPHRsYvpAfzkZHWY20vWxxJO0lvKfj6sG2g/pJ1vd/X2EBZkyEjLN4nUZOpOO7MewyHCrxQK8d5aF7rCeQlFX+XksK6l6z971BPuJqwdjj68ULOj9ZTDdOLopMdOLL0PFSS792SXE/EC9EDnIXZGYhr52aQb+9b2zEdBSnpkxAdBUkwJDqGCpZk/HkRidjdp0zKv/Cm52EenmfeKX6HkLUJgMbTTxxIZkIeL/6xuAaAAHbA7mONVduTHNX/UJj1nJEaI7f3HlUyiqKn7VfBE+bdb4HWln1HPJx001Ulq1tOxFf8WZEARvq5Da1+pE7fPVxLntGACz3nkoLsKcPdUqdCwwiyWkmXTd5+bv3j7HaReRt3ESn783Ew3SWsvkEjKtbocNksbrLmV+GVZn1+Uneo35MT1/4r8fngQX5/ptORfgmWfF6KSB/ssJmUSijXxQqUpzkANEkSkYgYj560OOjJr6uqckFuO15TRNgABEwNDjus1V3q2huLPYERMCLXUNmJJpbMrUQsSO7Qnxta55TvPWL6gWmMOvFknqETzqzFVO8SVkovEdYatypLGmDy9VWfgAc0KyIChiOhbd7UlbAeVLPZyEDp4POXKBwN/KP5pT6Cyqs6yaI00vXMn1ubk9OWT9Q/O2t/C25qlnO/zO0xcBzpMBCAB8vsdsh3U8fnPX1XlPEWfaYJxKVaTUgfCESWl4CCkIyjE6iQ5JFcwU6S4/IH0/Agacp8d5Gzq2+GzPnJ7+sqk40mfFQpKrDbAKwLlr3ONEati2k/ycLMSUu7V/7BBkDlNyXoN9tvqXCbbMc4SSQXgC/DBUY9QjtrCtQ+susEomCq8xcNJNNMWCH31GtlTw2BdCXkJBjT+/QNWlBWwQ5SWCh1LdQ99QVii/DyTxjSR6rmdap3l3L3aiplQpPYlrzNm9er88fXd2+ao+YdUNjtqmxiVxmyYPzJxl67OokDcTezEGqldkGgPbRdXA+fGcuZVkembZByo7J1dMnkGNjwwCny+FNcVcWvWYL9mg8oF7jACVWI3bA64EXpdM8bSIEVIAs5JJH+LHXgnCsgcMGPZyAAVBncvbLiexzg9YozcytjPXVlAbQAC7Tc4S0C8QN4LlAGjj4pQAVWrwkaDoUYGxxvkCWKRRHkdzJB5zpREleBDL1oDKEvAqmkDibVC4kTqF89YO6laUjgtJPebBfzr16tg4t10GmN1sJ5vezk2sUOq8blCn5mPZyT3ltaDcddKupQjqusNM9wtFVD0ABzv17fZDn7GPT1nkCtdcgYejcK1qOcTGtPxnCX1rErEjVWCnEJv5HaOAUjgpiKQjUKkQi64D5g2COgwas8FcgIl0Pw95H9dWxE3QG0VbMNffh6BPlAojLDf4es2/5Xfq7hw5NGcON2g8Qsy2UQm94KddKyy3kdJxWgpNaEc15xcylbLC3vnT26u8qS90qc2MU8LdOJc5VPF5KnSpXIhnj1eJJ/jszjZ01oR6JDFJRoeTPO/wh4IPFbdG9KljuSzeuI92p8JF/bpgDE8wG86/W2EBKgPrmzdLijxssQn8mM44ky/KLGOJcrSwXIpZa/Z3v7W6HCRk7ewds99LTsUW1LbeJytw8Q/BFZVZyfO9BUHOCe2suuEkO8DU4fLX0IQSQ2TdOkKXDtPf3sNV9tYhYFueuPRhfQlEEy+aYM/MCz7diDNmFSswYYlZZPmKr2Q5AxLsSVEqqBtn6hVl1BCFOFExnqnIsmyY/NA8jXnDaNzr7Zv3hu+I1Mf/PJjk0gALN2G8ABzdf9FNvWHvZHhv6xIoDCXf964MxG92vGZtx/LYU5PeZqgly8tT5tGeQGeJzMMsJc5p+a5Rn2PtEhiRzo/5Owjy1n0Lzx3ev8GHQmeWb8vagG6O5Qk5nrZuQTiKODI4UqL0LLAusS2Ve7j1Ivdxquu1BR9Rc4QkOiUPwQXJv6du2E8i5pDhVoQpUhyMWGUT2O2YODIhjAfI71gxep5r5zAY7GBUZpy51hAw0pcCCrhOmU8Wp6ujQTdZQsCjtq6SHX8QAMNiPCIIkoxhHEZPgsBcOlP4aErJZPhF7qvx6gHrn8hEwPwYbx8YmT/n7lbcmTip1v8kgsrIjFTAlvLY4Nuil0KDmgz3svYs0ZJ3O3Is/vSx4xpxF1e2VAtZE8dJxGYEIhCSuPvCjP54l/NSNDnwlKvAW8mG+AQkgp7a87Igh26uKMFGD0PoPHTSvoWxiHuk+su8XkQiHIjeYKl/RdcOHpxhQH3zHCNE3aARm83Bl6zGxU/vMltlVPQhubcqhW4RYkl6uXk5JdP/QpzaKFpw2M8zvysv2qj7xaQECuu2akM0Cssj/uB9+wDR7uA6XOnLNaoczalHoMj33eiiu+DRaFsUmlmUZuh9bjDY4INMNSSAivSh03uJvny4Gj+D+neudoa7iJi7c4VFlZ/J5gUR82308zSNAt/ZroBXDWw0fV3eVPAn3aX0mtJabF6RsUZmL+Ehn+wn51/4QipMjD+6y64t7bjL6bjENan2prQ4h7++hBJ9NXvX8CUocJqMC937IasLzm5K0qwXeFMAimMHkEIQIQI2LrQ9sLBfXuyp66zWvlsh74GPv7Xpabj993pRNNDuFud5oIcn/92isbADXdpRPbjmbCNOrwRbxGZx2XmYNGMiV5kjF4IKyxCBvKier9U4uVoheCdmk83rp5G0PihAm2fAtczI4b9BWqX+nrZTrJX5kSwQddi93NQrXG+Cl3eBGNkM77VBsMpEolhXex1MVvMkZN9fG59GGbciH11FEXaY1MxrArovaSjE/lUUqBg2cZBNmiWbvzCHCPJ4RVGFK2dTbObM1m+gJyEX53fa7u3+TZpm74mNEzWbkVL4vjNwfL9uzRCu1cgbrNx5Yv5dDruNrIOgwIk+UZWwJfdbu/WHul6PMmRflVCIzd7B37Pgm/Up/NuCiQW7RXyafevN3AL6ycciCc4ZPlTRzEu+aURGlUBOJbUEsheX7PPyrrhdUt5JAG12EEEZpY/N3Vhbl5uLAfT0CbC2XmpnryFkxZmBTs5prvEeuf0bn73i3O82WTiQtJWEPLsBXnQmdnKhB06NbbhLtlTZYJMxDMJpFeajSNRDB2v61BMUHqXggUwRJ19m6p5zl51v11q34T74lTXdJURuV6+bg2D6qpfGnLy7KGLuLZngobM4pIouz4+n0/UzFKxDgLM4h+fUwKZozQ9UGrHjcif51Ruonz7oIVZ56xWtZS8z7u5zay6J2LD4gCYh2RXoBRLDKsUlZ80R8kmoxlJiL8aZCy2wCAonnucFxCLT1HKoMhbPKt34D97EXPPh0joO93iJVF1Uruew61Qoy3ZUVNX9uIJDt9AQWKLLo+mSzmTibyLHq0D6hhzpvgUgI6ekyVEL3FD+Fi5R3A8MRHPXspN1VyKkfRlC+OGiNgPC4NREZpFETgVmdXrQ2TxChuS3aY+Ndc7CiYv5+CmzfiqeZrWIQJW/C4RvjbGUoJFf1K6ZdR2xL/bG4kVq1+I4jQWX+26YUijpp+lpN7o5c6ZodXJCF56UkFGsqz44sIg8jrdWvbjRCxi2Bk0iyM3a7ecAV93zB6h1Ei38c0s6+8nrbkopArccGP8vntQe1bFeEh2nJIFOHX/k3/UHb5PtKGpnzbkmnRETMX+9X/QduLZWw/feklW/kH/JnzToJe9Kgu9Hct1UGbH5BPCLo4OOtQnZonW0xnyCcdtKyPQ/sbLiSTYJdSx4sJqWLMnfn6fIqPB3WAgk00J+fCOkomPHqtS67pf0mFmKoItYZUlJu6BihSZ8qve8+/X+LX1MhQXF95AshfUleCtmdn6l6QFXzLg2sgLn1oyVFuZecv7fzsIHzoRlAGp0gwYDOn1S4qabWvB5xUaE+Svw4KmjWtxdnuQbI32dw87D4N95u8qQRJTSQg0wLxOLkxSrPMLEn1UIhNKjAa9VLs3WLaXGrtCIt8bKY2AQP/ZdyRU6zT/E8qP2ltyBE2CCZPgWgEYDoJJO4n92y61ylNaSFXKohJhLjkfvYWm592539sIpmBNLlDo1bExFBfmHJJ0lFEiC/fj8v42OoMC9Mo3whIoWvyHfq6Uacqq55mzFf/EGC+NP/gHjhd6urc6R0hES27VXux7UY8CGKPohplWIZtTrFSaPWslCWy78E22Pw8fvReSUZx/txqLtHrFqg1DY/Eus6Iq1heZdrdcqE0/c971Bz1HW/XNXHsXpUIbI4kHdOfCc6T5zHZzvzQJB0ggMFL6IGPAilU9bj/ASdPk6fNvNtZqPuwEDhMBtBnhCexo6D6VAGIOPvJPPV523Y8R8a9vCqZbswSZKzOT1291BsUbmUWehtbb1fdRX9hiJKXvwr1QX6GjnZMgyMvnwOo2Dr24amr7FqEAbVeJAjRNOceM2EQ1Mna9fInqPJ5mh5X8CzT1aDOv08An0blz0fF5Gq4mS2cwq5glwIOlY5nznE8X4j/UdZ3FJsVIXte1JH0A7iibuPfazStM5O/Vo3KXIpXBeGORV0M9XDXFvsYZUHGvFCUubWzTw248EHE0cpQM2zNg6rjavreq3NHCAWsoZ7wvVy7l5gvtKRmIj1MnvfWEm0yFnGcuOq192350a5WefpfKCcX3Sn+AgHU+qnpstNtddbdVebagJU390lq9ko4aI9rqdaWXYG8tv5O/ZQHSqDRYHC6zfH10l5z++opso7aOSaIczlQ13iAzXvLdEu0V7kwNUZ1c8Y8aq7SeIEe5p902FlNkW8DnwHyueHchbK8vVFJfmr9mz7P8nUSccl1ULaoWMRSI1ls32kvlK0h46h3J25Yd9AzfcJbp9qYF/SEt3H5j69mMdcsNxZcAzT/A89ov3tglTX54y/EwjMfuoDoxPwLJDm5I7q6F9Kp469yNy1zSxz0N4HbRRBj9xFFuogvBspv7DXUNIsGxTINEQfmctb42XImWAODgARNo7dfcTqFKq6aTfivmvunLmzP9f8yLsJvXD3JbcPcDGNriMAcjzeDTNr65t8YB5tsnFDFLa0Uwmd2OvUdkLMX9TsAUYUfooSv47sw5J88j7CpahRjjO3/UhOXjTS39W5YZAel2KTbQd1h7INOw9P23GW7GDAe4agIUFHP48MZr7ubq0efFmmtwYMyk7D0r1oeG/CGOODgb9Ur+JMHxkwzPbtCX2ZnENQuI0RN5SyTIZuoY4XS9Rd/tPe3vNAZGSHM/YYwqs9xkkENx0O+eC2YVW1cwOJ3ckE890nbQeHLKlW15L0P0W2VliyYrfNr0nrIYddoRyGaCtj4OYd2MT7ebApqZOAQIaSHJM4mphhfjNjtnjg6YRyx9qM2FT3xOiYIMqXPFWdzhSgFF8ItocqVV09CmIoO8k6U/oJB7++wSX/YksxfPXHyjSgAGZOj1aKEq9fSvXBqtp2wu8/FxEf5AxapAD06pPGuLVUYLdgEzHR8wqRGYEwiUO9MyYbgswstuLYhwYFpSVKOdzAihZ9LuHtD598EGhINU9xc9xhL+QgTLAstmPIvvm2xyRw/WTUPXkP3ZHu6GyPmj5xFH9/QGpkglKXRVUBgVmLOJx8uZO2AstxQYocZH2JhORlxawj66BAXUEs7K/gPxINIRAFyK3WLuyq9oBTF9wEbnmCot82WjIg7CPNwYK3KrZMrKAz5yFszg4wCVLJVnIL8+OYA0xRDH8cHQjQUiQ2i1mr/be32k/3Xej9sdf3iuGvZHyLFSJvPSqz/wltnxumTJYKZsrWXtx/Rmu39jjV9lFaJttfFn57/No2h/unsJmMHbrnZ8csxkp5HQ4xR1s0HH+t3Iz82a3iQWTUDGq/+l2W3TUYLE8zNdL8Y+5oXaIH/Y2UUcX67cXeN4WvENZjz4+8q7vjhowOI3rSjFhGZ6KzwmU7+5nFV+kGWAZ5z2UWvzq0TK0pk1hPwAN4jbw//1CApRvIaIjhSGhioY6TUmsToek9cF9XjJdHvLPcyyCV3lbR5Jiz/ts46ay2F820VjTXvllElwrGzKcNSyvQlWDXdwrUINXmHorAM3fE19ngLZmgeUaCJLsSITf2VcfAOuWwX7mTPdP8Zb/04KqRniufCpwnDUk7sP0RX6cud/sanFMagnzKInSRVey0YzlVSOtA/AjrofmSH6RYbJQ8b4NDeTkIGc6247+Mnbez/qhJ9GAv9fGNFercPnnrf285Qgs+UqThLRgflcAKFuqWhLzZaR4QqvSwa3xe0LPkqj9xJWub195r7NrrR0e78FR+0mRBNMPsraqZctAUVAJfYKehTDV1MGGQSeDsOK9J3sbUuKRIS/WilX/64CBms9jCZocBlsBSZaIAjWm/SUZ8daWL2a/cJFyUOFqE3Epc2RWbtjNyPwOGpWtzu32kUooUqsJud7IV4E8rstUBXM7tGEtBx99x60g1duhyvxeKJSl8s5E34HTMmADT0836aEdg5Dv9rVyCz8i2REOmiz6wtIVFN0HsjAoN37SrY0bV1Ms8CRUILhvZvvRaDzoVCaSI0u8EPuTe4b7OPowgRGODl22UBBmHSTUY8e4DyL+Bc7bngo+2T8HtNvzyATSL5iJZgFPKpmUyZv54vVL90+/RQGATUmNKnrIvcJMYON9fl83naW5sf6hRkbbTC9RUEE6XADwjgA46wWfUQ+QWZl0J4PVTWAln/YfAz/SV3q3J9+yCYDleruoN5uoc/wT2f4YONGTb6zTGq3V+3JqzmCOjwebKln+fExVLN7sqtqfMnsKVXWbb2Ai5m3D/fCTgX7oKYzTZvj+m28XnDqPbXuP4MyWdmPezcesdrh7rCzA7BWdObiuyDEKjjzBbQ0qnuwjliz+b+j7aPMKlkXyIznV3tGzAfYwIbzGGt098oh4eq3ruDjdgHtjxfFCjHrjjRbHajoz/YOY4raojPFQ910GIlBV7hq47UDgpyajBxQUmD8NctiLV1rTSLAEsQDLTeRKcmPBMVMFF0SPBBhZ5oXoxtD3lMhuAQXmA+57OcciczVW9e9zwSIAHS+FJmvfXMJGF1dMBsIUMaPjvgaVqUc3p32qVCMQYFEiRLzlVSOGMCmv/HJIxAHe3mL/XnoZ1IkWLeRZfgyByjnDbbeRK5KL7bYHSVJZ9UFq+yCiNKeRUaYjgbC3hVUvfJAhy/QNl/JqLKVvGMk9ZcfyGidNeo/VTxK9vUpodzfQI9Z2eAre4nmrkzgxKSnT5IJ1D69oHuUS5hp7pK9IAWuNrAOtOH0mAuwCrY8mXAtVXUeaNK3OXr6PRvmWg4VQqFSy+a1GZfFYgdsJELG8N0kvqmzvwZ02Plf5fH9QTy6br0oY/IDsEA+GBf9pEVWCIuBCjsup3LDSDqI+5+0IKSUFr7A96A2f0FbcU9fqljdqvsd8sG55KcKloHIFZem2Wb6pCLXybnVSB0sjCXzdS8IKvE");const f=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]);function p(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function g(e){let t=[];for(let r=0,n=e.length;r>24&255}function w(e){return 16777215&e}const A=new Map(o(b).flatMap(((e,t)=>e.map((e=>[e,t+1<<24]))))),P=new Set(i(b)),E=new Map,C=new Map;for(let[e,t]of a(b)){if(!P.has(e)&&2==t.length){let[r,n]=t,s=C.get(r);s||(s=new Map,C.set(r,s)),s.set(n,e)}E.set(e,t.reverse())}const S=44032,k=4352,O=4449,R=4519,T=28,N=21*T,x=S+19*N,I=k+19,_=O+21,B=R+T;function j(e){return e>=S&&e=k&&e=O&&t<_)return S+(e-k)*N+(t-O)*T;if(j(e)&&t>R&&t0&&s(R+r)}else{let e=E.get(n);e?r.push(...e):s(n)}if(!r.length)break;n=r.pop()}if(n&&t.length>1){let e=v(t[0]);for(let r=1;r0&&s>=e)0==e?(t.push(n,...r),r.length=0,n=o):r.push(o),s=e;else{let i=L(n,o);i>=0?n=i:0==s&&0==e?(t.push(n),n=o):(r.push(o),s=e)}}return n>=0&&t.push(n,...r),t}(U(e))}const M=65039,H=".";function G(){return new Set(i(h))}const W=new Map(a(h)),z=G(),K=G(),J=new Set(i(h).map((function(e){return this[e]}),[...K])),V=G(),q=G(),Q=o(h);function Y(){return new Set([i(h).map((e=>Q[e])),i(h)].flat(2))}const Z=h(),$=c((e=>{let t=c(h).map((e=>e+96));if(t.length){let r=e>=Z;t[0]-=32,t=y(t),r&&(t=`Restricted[${t}]`);let n=Y(),s=Y(),i=[...n,...s].sort(((e,t)=>e-t));return{N:t,P:n,M:!h(),R:r,V:new Set(i)}}})),X=G(),ee=new Map;[...X,...G()].sort(((e,t)=>e-t)).map(((e,t,r)=>{let n=h(),s=r[t]=n?r[t-n]:{V:[],M:new Map};s.V.push(e),X.has(e)||ee.set(e,s)}));for(let{V:e,M:t}of new Set(ee.values())){let r=[];for(let t of e){let e=$.filter((e=>e.V.has(t))),n=r.find((({G:t})=>e.some((e=>t.has(e)))));n||(n={G:new Set,V:[]},r.push(n)),n.V.push(t),e.forEach((e=>n.G.add(e)))}let n=r.flatMap((({G:e})=>[...e]));for(let{G:e,V:s}of r){let r=new Set(n.filter((t=>!e.has(t))));for(let e of s)t.set(e,r)}}let te=new Set,re=new Set;for(let e of $)for(let t of e.V)(te.has(t)?re:te).add(t);for(let e of te)ee.has(e)||re.has(e)||ee.set(e,1);const ne=new Set([...te,...D(te)]),se=i(h),ie=function e(t){let r=c((()=>{let t=i(h).map((e=>se[e]));if(t.length)return e(t)})).sort(((e,t)=>t.Q.size-e.Q.size)),n=h(),s=n%3;n=n/3|0;let o=1&n;return n>>=1,{B:r,V:s,F:o,S:1&n,C:2&n,Q:new Set(t)}}([]);class oe extends Array{get is_emoji(){return!0}}function ae(e,t=p){let r=[];de(e[0])&&r.push("◌");let n=0,s=e.length;for(let i=0;i0;)if(95!==e[--t])throw new Error("underscore allowed only at start")}function de(e){return K.has(e)}function he(e){return V.has(e)}function fe(e,t){let r=0;return e.split(H).map((e=>{let n,s=g(e),i={input:s,offset:r};r+=s.length+1;try{let e,r=i.tokens=be(s,F),o=r.length;if(!o)throw new Error("empty label");{let s=r[0],a=o>1||s.is_emoji;if(!a&&s.every((e=>e<128)))n=s,le(n),function(e){if(e.length>=4&&45==e[2]&&45==e[3])throw new Error("invalid label extension")}(n),e="ASCII";else if(a&&(i.emoji=!0,s=r.flatMap((e=>e.is_emoji?[]:e))),n=r.flatMap((e=>!t&&e.is_emoji?ve(e):e)),le(n),s.length){if(K.has(n[0]))throw me("leading combining mark");for(let e=1;ee.V.has(r)));if(!e.length)throw t===$?ge(r):ye(t[0],r);if(t=e,1==e.length)break}return t}(t);!function(e,t){let{V:r,M:n}=e;for(let n of t)if(!r.has(n))throw ye(e,n);if(n){let e=D(t);for(let t=1,r=e.length;t4)throw new Error(`non-spacing marks: too many ${ue(ae(e.slice(t-1,n)))} (${n-t}/4)`);t=n}}}(i,s),function(e,t){let r,n=[];for(let e of t){let t=ee.get(e);if(1===t)return;if(t){let n=t.M.get(e);if(r=r?r.filter((e=>n.has(e))):[...n],!r.length)return}else n.push(e)}if(r)for(let t of r)if(n.every((e=>t.V.has(e))))throw new Error(`whole-script confusable: ${e.N}/${t.N}`)}(i,t),e=i.N}else e="Emoji"}i.type=e}catch(e){i.error=e}return i.output=n,i}))}function pe(e){return e.map((({input:t,error:r,output:n})=>{if(r){let n=r.message;throw new Error(1==e.length?n:`Invalid label ${ue(ae(t))}: ${n}`)}return y(n)})).join(H)}function ge(e){return new Error(`disallowed character: ${ce(e)}`)}function ye(e,t){let r=ce(t),n=$.find((e=>e.P.has(t)));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${e.N} + ${r}`)}function me(e){return new Error(`illegal placement: ${e}`)}function be(e,t){let r=[],n=[];for(e=e.slice().reverse();e.length;){let s=we(e);if(s)n.length&&(r.push(t(n)),n=[]),r.push(s);else{let t=e.pop();if(ne.has(t))n.push(t);else{let e=W.get(t);if(e)n.push(...e);else if(!z.has(t))throw ge(t)}}}return n.length&&r.push(t(n)),r}function ve(e){return e.filter((e=>e!=M))}function we(e,t){let r,n,s=ie,i=[],o=e.length;for(t&&(t.length=0);o;){let a=e[--o];if(s=s.B.find((e=>e.Q.has(a))),!s)break;if(s.S)n=a;else if(s.C&&a===n)break;i.push(a),s.F&&(i.push(M),o>0&&e[o-1]==M&&o--),s.V&&(r=Ae(i,s),t&&t.push(...e.slice(o).reverse()),e.length=o)}return r}function Ae(e,t){let r=oe.from(e);return 2==t.V&&r.splice(1,1),r}const Pe="valid",Ee="mapped",Ce="ignored";function Se(e){return e==Pe||e==Ee}function ke(e){return e.some((e=>q.has(e)))}function Oe(e){for(let t=0;te.cps))})}return e}t.ens_beautify=function(e){let t=fe(e,!0);for(let{type:e,output:r,error:n}of t)if(!n&&"Greek"!==e){let e=0;for(;;){let t=r.indexOf(958,e);if(t<0)break;r[t]=926,e=t+1}}return pe(t)},t.ens_emoji=function(){let e=[];return function t(r,n,s){if(r.S)s=n[n.length-1];else if(r.C&&s===n[n.length-1])return;r.F&&n.push(M),r.V&&e.push(Ae(n,r));for(let e of r.B)for(let r of e.Q)t(e,[...n,r],s)}(ie,[]),e.sort(m)},t.ens_normalize=function(e){return pe(fe(e))},t.ens_normalize_fragment=function(e,t){let r=t?D:F;return e.split(H).map((e=>y(be(g(e),r).flatMap((e=>e.is_emoji?ve(e):e))))).join(H)},t.ens_split=fe,t.ens_tokenize=function e(t,{nf:r=!0}={}){let n=g(t).reverse(),s=[],i=[];for(;n.length;){let e=we(n,s);if(e)i.push({type:"emoji",emoji:e,input:s.slice(),cps:ve(e)});else{let e=n.pop();if(46==e)i.push({type:"stop",cp:e});else if(ne.has(e))i.push({type:Pe,cps:[e]});else if(z.has(e))i.push({type:Ce,cp:e});else{let t=W.get(e);t?i.push({type:Ee,cp:e,cps:t.slice()}):i.push({type:"disallowed",cp:e})}}}if(r)for(let t=0,r=-1;tSe(e.type)?e.cps:[])),a=F(o);m(a,o)?(i.splice(r,n-r,{type:"nfc",input:o,cps:a,tokens0:Oe(s),tokens:e(y(a),{nf:!1})}),t=r):t=n-1,r=-1}else r=t;else n.type!==Ce&&(r=-1)}return Oe(i)},t.is_combining_mark=de,t.nfc=F,t.nfd=D,t.safe_str_from_cps=ae,t.should_escape=he},517:function(e,t){"use strict";var r,n,s,i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},o=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r};Object.defineProperty(t,"__esModule",{value:!0}),t.AES=void 0;const a={16:10,24:12,32:14},c=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],u=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],l=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],h=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],f=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],p=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],y=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],m=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],b=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],v=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],w=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],A=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],P=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function E(e){const t=[];for(let r=0;r>2,i(this,s,"f")[f][e%4]=h[e],i(this,n,"f")[t-f][e%4]=h[e];let p,g=0,y=d;for(;y>16&255]<<24^u[p>>8&255]<<16^u[255&p]<<8^u[p>>24&255]^c[g]<<24,g+=1,8!=d)for(let e=1;e>8&255]<<8^u[p>>16&255]<<16^u[p>>24&255]<<24;for(let e=d/2+1;e>2,r=y%4,i(this,s,"f")[e][r]=h[o],i(this,n,"f")[t-e][r]=h[o++],y++}for(let e=1;e>24&255]^w[p>>16&255]^A[p>>8&255]^P[255&p]}encrypt(e){if(16!=e.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const t=i(this,s,"f").length-1,r=[0,0,0,0];let n=E(e);for(let e=0;e<4;e++)n[e]^=i(this,s,"f")[0][e];for(let e=1;e>24&255]^h[n[(t+1)%4]>>16&255]^f[n[(t+2)%4]>>8&255]^p[255&n[(t+3)%4]]^i(this,s,"f")[e][t];n=r.slice()}const o=new Uint8Array(16);let a=0;for(let e=0;e<4;e++)a=i(this,s,"f")[t][e],o[4*e]=255&(u[n[e]>>24&255]^a>>24),o[4*e+1]=255&(u[n[(e+1)%4]>>16&255]^a>>16),o[4*e+2]=255&(u[n[(e+2)%4]>>8&255]^a>>8),o[4*e+3]=255&(u[255&n[(e+3)%4]]^a);return o}decrypt(e){if(16!=e.length)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const t=i(this,n,"f").length-1,r=[0,0,0,0];let s=E(e);for(let e=0;e<4;e++)s[e]^=i(this,n,"f")[0][e];for(let e=1;e>24&255]^y[s[(t+3)%4]>>16&255]^m[s[(t+2)%4]>>8&255]^b[255&s[(t+1)%4]]^i(this,n,"f")[e][t];s=r.slice()}const o=new Uint8Array(16);let a=0;for(let e=0;e<4;e++)a=i(this,n,"f")[t][e],o[4*e]=255&(l[s[e]>>24&255]^a>>24),o[4*e+1]=255&(l[s[(e+3)%4]>>16&255]^a>>16),o[4*e+2]=255&(l[s[(e+2)%4]>>8&255]^a>>8),o[4*e+3]=255&(l[255&s[(e+1)%4]]^a);return o}}t.AES=C,r=new WeakMap,n=new WeakMap,s=new WeakMap},3260:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pkcs7Strip=t.pkcs7Pad=t.OFB=t.ECB=t.CTR=t.CFB=t.CBC=t.ModeOfOperation=t.AES=void 0;var n=r(517);Object.defineProperty(t,"AES",{enumerable:!0,get:function(){return n.AES}});var s=r(2868);Object.defineProperty(t,"ModeOfOperation",{enumerable:!0,get:function(){return s.ModeOfOperation}});var i=r(2805);Object.defineProperty(t,"CBC",{enumerable:!0,get:function(){return i.CBC}});var o=r(3169);Object.defineProperty(t,"CFB",{enumerable:!0,get:function(){return o.CFB}});var a=r(3310);Object.defineProperty(t,"CTR",{enumerable:!0,get:function(){return a.CTR}});var c=r(9915);Object.defineProperty(t,"ECB",{enumerable:!0,get:function(){return c.ECB}});var u=r(2023);Object.defineProperty(t,"OFB",{enumerable:!0,get:function(){return u.OFB}});var l=r(9533);Object.defineProperty(t,"pkcs7Pad",{enumerable:!0,get:function(){return l.pkcs7Pad}}),Object.defineProperty(t,"pkcs7Strip",{enumerable:!0,get:function(){return l.pkcs7Strip}})},2805:function(e,t,r){"use strict";var n,s,i=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.CBC=void 0;const a=r(2868);class c extends a.ModeOfOperation{constructor(e,t){if(super("ECC",e,c),n.set(this,void 0),s.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");i(this,n,new Uint8Array(t),"f")}else i(this,n,new Uint8Array(16),"f");i(this,s,this.iv,"f")}get iv(){return new Uint8Array(o(this,n,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let r=0;rNumber.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let t=15;t>=0;--t)a(this,i,"f")[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(16!==e.length)throw new TypeError("invalid counter initial Uint8Array value length");a(this,i,"f").set(e)}increment(){for(let e=15;e>=0;e--){if(255!==a(this,i,"f")[e]){a(this,i,"f")[e]++;break}a(this,i,"f")[e]=0}}encrypt(e){var t,r;const c=new Uint8Array(e);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ECB=void 0;const n=r(2868);class s extends n.ModeOfOperation{constructor(e){super("ECB",e,s)}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModeOfOperation=void 0;const n=r(517);t.ModeOfOperation=class{constructor(e,t,r){if(r&&!(this instanceof r))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new n.AES(t)},name:{enumerable:!0,value:e}})}}},9533:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pkcs7Strip=t.pkcs7Pad=void 0,t.pkcs7Pad=function(e){const t=16-e.length%16,r=new Uint8Array(e.length+t);r.set(e);for(let n=e.length;n16)throw new TypeError("PKCS#7 padding byte out of range");const r=e.length-t;for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="6.7.0"},4760:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbiCoder=void 0;const n=r(2120),s=r(2900),i=r(2063),o=r(8151),a=r(8583),c=r(5949),u=r(4148),l=r(6341),d=r(6893),h=r(3524),f=r(6701),p=r(6711),g=r(5475),y=r(2120),m=new Map;m.set(0,"GENERIC_PANIC"),m.set(1,"ASSERT_FALSE"),m.set(17,"OVERFLOW"),m.set(18,"DIVIDE_BY_ZERO"),m.set(33,"ENUM_RANGE_ERROR"),m.set(34,"BAD_STORAGE_DATA"),m.set(49,"STACK_UNDERFLOW"),m.set(50,"ARRAY_RANGE_ERROR"),m.set(65,"OUT_OF_MEMORY"),m.set(81,"UNINITIALIZED_FUNCTION_CALL");const b=new RegExp(/^bytes([0-9]*)$/),v=new RegExp(/^(u?int)([0-9]*)$/);let w=null;class A{#e(e){if(e.isArray())return new o.ArrayCoder(this.#e(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new f.TupleCoder(e.components.map((e=>this.#e(e))),e.name);switch(e.baseType){case"address":return new i.AddressCoder(e.name);case"bool":return new a.BooleanCoder(e.name);case"string":return new h.StringCoder(e.name);case"bytes":return new c.BytesCoder(e.name);case"":return new l.NullCoder(e.name)}let t=e.type.match(v);if(t){let r=parseInt(t[2]||"256");return(0,n.assertArgument)(0!==r&&r<=256&&r%8==0,"invalid "+t[1]+" bit length","param",e),new d.NumberCoder(r/8,"int"===t[1],e.name)}if(t=e.type.match(b),t){let r=parseInt(t[1]);return(0,n.assertArgument)(0!==r&&r<=32,"invalid bytes length","param",e),new u.FixedBytesCoder(r,e.name)}(0,n.assertArgument)(!1,"invalid type","type",e.type)}getDefaultValue(e){const t=e.map((e=>this.#e(p.ParamType.from(e))));return new f.TupleCoder(t,"_").defaultValue()}encode(e,t){(0,n.assertArgumentCount)(t.length,e.length,"types/values length mismatch");const r=e.map((e=>this.#e(p.ParamType.from(e)))),i=new f.TupleCoder(r,"_"),o=new s.Writer;return i.encode(o,t),o.data}decode(e,t,r){const n=e.map((e=>this.#e(p.ParamType.from(e))));return new f.TupleCoder(n,"_").decode(new s.Reader(t,r))}static defaultAbiCoder(){return null==w&&(w=new A),w}static getBuiltinCallException(e,t,r){return function(e,t,r,n){let s="missing revert data",i=null,o=null;if(r){s="execution reverted";const e=(0,y.getBytes)(r);if(r=(0,y.hexlify)(r),0===e.length)s+=" (no data present; likely require(false) occurred",i="require(false)";else if(e.length%32!=4)s+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===(0,y.hexlify)(e.slice(0,4)))try{i=n.decode(["string"],e.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[i]},s+=`: ${JSON.stringify(i)}`}catch(e){s+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===(0,y.hexlify)(e.slice(0,4)))try{const t=Number(n.decode(["uint256"],e.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[t]},i=`Panic due to ${m.get(t)||"UNKNOWN"}(${t})`,s+=`: ${i}`}catch(e){s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const a={to:t.to?(0,g.getAddress)(t.to):null,data:t.data||"0x"};return t.from&&(a.from=(0,g.getAddress)(t.from)),(0,y.makeError)(s,"CALL_EXCEPTION",{action:e,data:r,reason:i,transaction:a,invocation:null,revert:o})}(e,t,r,A.defaultAbiCoder())}}t.AbiCoder=A},2472:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBytes32String=t.encodeBytes32String=void 0;const n=r(2120);t.encodeBytes32String=function(e){const t=(0,n.toUtf8Bytes)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,n.zeroPadBytes)(t,32)},t.decodeBytes32String=function(e){const t=(0,n.getBytes)(e,"bytes");if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return(0,n.toUtf8String)(t.slice(0,r))}},2900:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Reader=t.Writer=t.Coder=t.checkResultErrors=t.Result=t.WordSize=void 0;const n=r(2120);t.WordSize=32;const s=new Uint8Array(t.WordSize),i=["then"],o={};function a(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw r.error=t,r}class c extends Array{#t;constructor(...e){const t=e[0];let r=e[1],s=(e[2]||[]).slice(),c=!0;t!==o&&(r=e,s=[],c=!1),super(r.length),r.forEach(((e,t)=>{this[t]=e}));const u=s.reduce(((e,t)=>("string"==typeof t&&e.set(t,(e.get(t)||0)+1),e)),new Map);if(this.#t=Object.freeze(r.map(((e,t)=>{const r=s[t];return null!=r&&1===u.get(r)?r:null}))),c)return Object.freeze(this),new Proxy(this,{get:(e,t,r)=>{if("string"==typeof t){if(t.match(/^[0-9]+$/)){const r=(0,n.getNumber)(t,"%index");if(r<0||r>=this.length)throw new RangeError("out of result range");const s=e[r];return s instanceof Error&&a(`index ${r}`,s),s}if(i.indexOf(t)>=0)return Reflect.get(e,t,r);const s=e[t];if(s instanceof Function)return function(...t){return s.apply(this===r?e:this,t)};if(!(t in e))return e.getValue.apply(this===r?e:this,[t])}return Reflect.get(e,t,r)}})}toArray(){const e=[];return this.forEach(((t,r)=>{t instanceof Error&&a(`index ${r}`,t),e.push(t)})),e}toObject(){return this.#t.reduce(((e,t,r)=>((0,n.assert)(null!=t,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),t in e||(e[t]=this.getValue(t)),e)),{})}slice(e,t){null==e&&(e=0),e<0&&(e+=this.length)<0&&(e=0),null==t&&(t=this.length),t<0&&(t+=this.length)<0&&(t=0),t>this.length&&(t=this.length);const r=[],n=[];for(let s=e;s{this.#r[e]=u(t)}}};class l{allowLoose;#r;#i;constructor(e,t){(0,n.defineProperties)(this,{allowLoose:!!t}),this.#r=(0,n.getBytesCopy)(e),this.#i=0}get data(){return(0,n.hexlify)(this.#r)}get dataLength(){return this.#r.length}get consumed(){return this.#i}get bytes(){return new Uint8Array(this.#r)}#o(e,r,s){let i=Math.ceil(r/t.WordSize)*t.WordSize;return this.#i+i>this.#r.length&&(this.allowLoose&&s&&this.#i+r<=this.#r.length?i=r:(0,n.assert)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,n.getBytesCopy)(this.#r),length:this.#r.length,offset:this.#i+i})),this.#r.slice(this.#i,this.#i+i)}subReader(e){return new l(this.#r.slice(this.#i+e),this.allowLoose)}readBytes(e,t){let r=this.#o(0,e,!!t);return this.#i+=r.length,r.slice(0,e)}readValue(){return(0,n.toBigInt)(this.readBytes(t.WordSize))}readIndex(){return(0,n.toNumber)(this.readBytes(t.WordSize))}}t.Reader=l},2063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddressCoder=void 0;const n=r(5475),s=r(358),i=r(3762),o=r(2900);class a extends o.Coder{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let r=i.Typed.dereference(t,"string");try{r=(0,n.getAddress)(r)}catch(e){return this._throwError(e.message,t)}return e.writeValue(r)}decode(e){return(0,n.getAddress)((0,s.toBeHex)(e.readValue(),20))}}t.AddressCoder=a},6347:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousCoder=void 0;const n=r(2900);class s extends n.Coder{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}t.AnonymousCoder=s},8151:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayCoder=t.unpack=t.pack=void 0;const n=r(2120),s=r(3762),i=r(2900),o=r(6347);function a(e,t,r){let s=[];if(Array.isArray(r))s=r;else if(r&&"object"==typeof r){let e={};s=t.map((t=>{const s=t.localName;return(0,n.assert)(s,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:r}),(0,n.assert)(!e[s],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:r}),e[s]=!0,r[s]}))}else(0,n.assertArgument)(!1,"invalid tuple value","tuple",r);(0,n.assertArgument)(t.length===s.length,"types/value length mismatch","tuple",r);let o=new i.Writer,a=new i.Writer,c=[];t.forEach(((e,t)=>{let r=s[t];if(e.dynamic){let t=a.length;e.encode(a,r);let n=o.writeUpdatableValue();c.push((e=>{n(e+t)}))}else e.encode(o,r)})),c.forEach((e=>{e(o.length)}));let u=e.appendWriter(o);return u+=e.appendWriter(a),u}function c(e,t){let r=[],s=[],o=e.subReader(0);return t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readIndex(),s=o.subReader(r);try{i=t.decode(s)}catch(e){if((0,n.isError)(e,"BUFFER_OVERRUN"))throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if((0,n.isError)(e,"BUFFER_OVERRUN"))throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}if(null==i)throw new Error("investigate");r.push(i),s.push(t.localName||null)})),i.Result.fromItems(r,s)}t.pack=a,t.unpack=c;class u extends i.Coder{coder;length;constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),(0,n.defineProperties)(this,{coder:e,length:t})}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanCoder=void 0;const n=r(3762),s=r(2900);class i extends s.Coder{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){const r=n.Typed.dereference(t,"bool");return e.writeValue(r?1:0)}decode(e){return!!e.readValue()}}t.BooleanCoder=i},5949:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BytesCoder=t.DynamicBytesCoder=void 0;const n=r(2120),s=r(2900);class i extends s.Coder{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=(0,n.getBytesCopy)(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readIndex(),!0)}}t.DynamicBytesCoder=i,t.BytesCoder=class extends i{constructor(e){super("bytes",e)}decode(e){return(0,n.hexlify)(super.decode(e))}}},4148:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FixedBytesCoder=void 0;const n=r(2120),s=r(3762),i=r(2900);class o extends i.Coder{size;constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),(0,n.defineProperties)(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=(0,n.getBytesCopy)(s.Typed.dereference(t,this.type));return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return(0,n.hexlify)(e.readBytes(this.size))}}t.FixedBytesCoder=o},6341:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NullCoder=void 0;const n=r(2900),s=new Uint8Array([]);class i extends n.Coder{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes(s)}decode(e){return e.readBytes(0),null}}t.NullCoder=i},6893:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NumberCoder=void 0;const n=r(2120),s=r(3762),i=r(2900),o=BigInt(0),a=BigInt(1),c=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class u extends i.Coder{size;signed;constructor(e,t,r){const s=(t?"int":"uint")+8*e;super(s,s,r,!1),(0,n.defineProperties)(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let r=(0,n.getBigInt)(s.Typed.dereference(t,this.type)),u=(0,n.mask)(c,8*i.WordSize);if(this.signed){let e=(0,n.mask)(u,8*this.size-1);(r>e||r<-(e+a))&&this._throwError("value out-of-bounds",t),r=(0,n.toTwos)(r,8*i.WordSize)}else(r(0,n.mask)(u,8*this.size))&&this._throwError("value out-of-bounds",t);return e.writeValue(r)}decode(e){let t=(0,n.mask)(e.readValue(),8*this.size);return this.signed&&(t=(0,n.fromTwos)(t,8*this.size)),t}}t.NumberCoder=u},3524:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringCoder=void 0;const n=r(2119),s=r(3762),i=r(5949);class o extends i.DynamicBytesCoder{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,(0,n.toUtf8Bytes)(s.Typed.dereference(t,"string")))}decode(e){return(0,n.toUtf8String)(super.decode(e))}}t.StringCoder=o},6701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TupleCoder=void 0;const n=r(9290),s=r(3762),i=r(2900),o=r(8151);class a extends i.Coder{coders;constructor(e,t){let r=!1;const s=[];e.forEach((e=>{e.dynamic&&(r=!0),s.push(e.type)})),super("tuple","tuple("+s.join(",")+")",t,r),(0,n.defineProperties)(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let s=r.localName;s&&1===t[s]&&("length"===s&&(s="_length"),null==e[s]&&(e[s]=e[n]))})),Object.freeze(e)}encode(e,t){const r=s.Typed.dereference(t,"tuple");return(0,o.pack)(e,this.coders,r)}decode(e){return(0,o.unpack)(e,this.coders)}}t.TupleCoder=a},6711:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StructFragment=t.FunctionFragment=t.FallbackFragment=t.ConstructorFragment=t.EventFragment=t.ErrorFragment=t.NamedFragment=t.Fragment=t.ParamType=void 0;const n=r(2120),s=r(8336);function i(e){const t=new Set;return e.forEach((e=>t.add(e))),Object.freeze(t)}const o=i("external public payable".split(" ")),a="constant external internal payable private public pure view",c=i(a.split(" ")),u="constructor error event fallback function receive struct",l=i(u.split(" ")),d="calldata memory storage payable indexed",h=i(d.split(" ")),f=i([u,d,"tuple returns",a].join(" ").split(" ")),p={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},g=new RegExp("^(\\s*)"),y=new RegExp("^([0-9]+)"),m=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),b=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),v=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class w{#i;#a;get offset(){return this.#i}get length(){return this.#a.length-this.#i}constructor(e){this.#i=0,this.#a=e.slice()}clone(){return new w(this.#a)}reset(){this.#i=0}#c(e=0,t=0){return new w(this.#a.slice(e,t).map((t=>Object.freeze(Object.assign({},t,{match:t.match-e,linkBack:t.linkBack-e,linkNext:t.linkNext-e})))))}popKeyword(e){const t=this.peek();if("KEYWORD"!==t.type||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=this.#c(this.#i+1,e.match+1);return this.#i=e.match+1,t}popParams(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=[];for(;this.#i=this.#a.length)throw new Error("out-of-bounds");return this.#a[this.#i]}peekKeyword(e){const t=this.peekType("KEYWORD");return null!=t&&e.has(t)?t:null}peekType(e){if(0===this.length)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return this.#i++,e}toString(){const e=[];for(let t=this.#i;t`}}function A(e){const t=[],r=t=>{const r=o0&&"NUMBER"===t[t.length-1].type){const r=t.pop().text;e=r+e,t[t.length-1].value=(0,n.getNumber)(r)}if(0===t.length||"BRACKET"!==t[t.length-1].type)throw new Error("missing opening bracket");t[t.length-1].text+=e}}else if(c=a.match(m),c){if(u.text=c[1],o+=u.text.length,f.has(u.text)){u.type="KEYWORD";continue}if(u.text.match(v)){u.type="TYPE";continue}u.type="ID"}else{if(c=a.match(y),!c)throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${o}`);u.text=c[1],u.type="NUMBER",o+=u.text.length}}return new w(t.map((e=>Object.freeze(e))))}function P(e,t){let r=[];for(const n in t.keys())e.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function E(e,t){if(t.peekKeyword(l)){const r=t.pop().text;if(r!==e)throw new Error(`expected ${e}, got ${r}`)}return t.popType("ID")}function C(e,t){const r=new Set;for(;;){const n=e.peekType("KEYWORD");if(null==n||t&&!t.has(n))break;if(e.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function S(e){let t=C(e,c);return P(t,i("constant payable nonpayable".split(" "))),P(t,i("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function k(e,t){return e.popParams().map((e=>M.from(e,t)))}function O(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return(0,n.getBigInt)(e.pop().text);throw new Error("invalid gas")}return null}function R(e){if(e.length)throw new Error(`unexpected tokens: ${e.toString()}`)}const T=new RegExp(/^(.*)\[([0-9]*)\]$/);function N(e){const t=e.match(v);if((0,n.assertArgument)(t,"invalid type","type",e),"uint"===e)return"uint256";if("int"===e)return"int256";if(t[2]){const r=parseInt(t[2]);(0,n.assertArgument)(0!==r&&r<=32,"invalid bytes length","type",e)}else if(t[3]){const r=parseInt(t[3]);(0,n.assertArgument)(0!==r&&r<=256&&r%8==0,"invalid numeric width","type",e)}return e}const x={},I=Symbol.for("_ethers_internal"),_="_ParamTypeInternal",B="_ErrorInternal",j="_EventInternal",L="_ConstructorInternal",U="_FallbackInternal",D="_FunctionInternal",F="_StructInternal";class M{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,r,s,i,o,a,c){if((0,n.assertPrivate)(e,x,"ParamType"),Object.defineProperty(this,I,{value:_}),o&&(o=Object.freeze(o.slice())),"array"===s){if(null==a||null==c)throw new Error("")}else if(null!=a||null!=c)throw new Error("");if("tuple"===s){if(null==o)throw new Error("")}else if(null!=o)throw new Error("");(0,n.defineProperties)(this,{name:t,type:r,baseType:s,indexed:i,components:o,arrayLength:a,arrayChildren:c})}format(e){if(null==e&&(e="sighash"),"json"===e){const t=this.name||"";if(this.isArray()){const e=JSON.parse(this.arrayChildren.format("json"));return e.name=t,e.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(e)}const r={type:"tuple"===this.baseType?"tuple":this.type,name:t};return"boolean"==typeof this.indexed&&(r.indexed=this.indexed),this.isTuple()&&(r.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(r)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?("sighash"!==e&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join("full"===e?", ":",")+")"):t+=this.type,"sighash"!==e&&(!0===this.indexed&&(t+=" indexed"),"full"===e&&this.name&&(t+=" "+this.name)),t}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map((e=>r.arrayChildren.walk(e,t)))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map(((e,n)=>r.components[n].walk(e,t)))}return t(this.type,e)}#u(e,t,r,n){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(-1!==this.arrayLength&&t.length!==this.arrayLength)throw new Error("array is wrong length");const s=this.arrayChildren,i=t.slice();return i.forEach(((t,n)=>{s.#u(e,t,r,(e=>{i[n]=e}))})),void n(i)}if(this.isTuple()){const s=this.components;let i;if(Array.isArray(t))i=t.slice();else{if(null==t||"object"!=typeof t)throw new Error("invalid tuple value");i=s.map((e=>{if(!e.name)throw new Error("cannot use object value with unnamed components");if(!(e.name in t))throw new Error(`missing value for component ${e.name}`);return t[e.name]}))}if(i.length!==this.components.length)throw new Error("array is wrong length");return i.forEach(((t,n)=>{s[n].#u(e,t,r,(e=>{i[n]=e}))})),void n(i)}const s=r(this.type,t);s.then?e.push(async function(){n(await s)}()):n(s)}async walkAsync(e,t){const r=[],n=[e];return this.#u(r,e,t,(e=>{n[0]=e})),r.length&&await Promise.all(r),n[0]}static from(e,t){if(M.isParamType(e))return e;if("string"==typeof e)try{return M.from(A(e),t)}catch(t){(0,n.assertArgument)(!1,"invalid param type","obj",e)}else if(e instanceof w){let r="",n="",s=null;C(e,i(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(n="tuple",s=e.popParams().map((e=>M.from(e))),r=`tuple(${s.map((e=>e.format())).join(",")})`):(r=N(e.popType("TYPE")),n=r);let o=null,a=null;for(;e.length&&e.peekType("BRACKET");){const t=e.pop();o=new M(x,"",r,n,null,s,a,o),a=t.value,r+=t.text,n="array",s=null}let c=null;if(C(e,h).has("indexed")){if(!t)throw new Error("");c=!0}const u=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new M(x,u,r,n,c,s,a,o)}const r=e.name;(0,n.assertArgument)(!r||"string"==typeof r&&r.match(b),"invalid name","obj.name",r);let s=e.indexed;null!=s&&((0,n.assertArgument)(t,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let o=e.type,a=o.match(T);if(a){const t=parseInt(a[2]||"-1"),n=M.from({type:a[1],components:e.components});return new M(x,r||"",o,"array",s,null,t,n)}if("tuple"===o||o.startsWith("tuple(")||o.startsWith("(")){const t=null!=e.components?e.components.map((e=>M.from(e))):null;return new M(x,r||"",o,"tuple",s,t,null,null)}return o=N(e.type),new M(x,r||"",o,o,s,null,null,null)}static isParamType(e){return e&&e[I]===_}}t.ParamType=M;class H{type;inputs;constructor(e,t,r){(0,n.assertPrivate)(e,x,"Fragment"),r=Object.freeze(r.slice()),(0,n.defineProperties)(this,{type:t,inputs:r})}static from(e){if("string"==typeof e){try{H.from(JSON.parse(e))}catch(e){}return H.from(A(e))}if(e instanceof w)switch(e.peekKeyword(l)){case"constructor":return J.from(e);case"error":return z.from(e);case"event":return K.from(e);case"fallback":case"receive":return V.from(e);case"function":return q.from(e);case"struct":return Q.from(e)}else if("object"==typeof e){switch(e.type){case"constructor":return J.from(e);case"error":return z.from(e);case"event":return K.from(e);case"fallback":case"receive":return V.from(e);case"function":return q.from(e);case"struct":return Q.from(e)}(0,n.assert)(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,n.assertArgument)(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return J.isFragment(e)}static isError(e){return z.isFragment(e)}static isEvent(e){return K.isFragment(e)}static isFunction(e){return q.isFragment(e)}static isStruct(e){return Q.isFragment(e)}}t.Fragment=H;class G extends H{name;constructor(e,t,r,s){super(e,t,s),(0,n.assertArgument)("string"==typeof r&&r.match(b),"invalid identifier","name",r),s=Object.freeze(s.slice()),(0,n.defineProperties)(this,{name:r})}}function W(e,t){return"("+t.map((t=>t.format(e))).join("full"===e?", ":",")+")"}t.NamedFragment=G;class z extends G{constructor(e,t,r){super(e,"error",t,r),Object.defineProperty(this,I,{value:B})}get selector(){return(0,s.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});const t=[];return"sighash"!==e&&t.push("error"),t.push(this.name+W(e,this.inputs)),t.join(" ")}static from(e){if(z.isFragment(e))return e;if("string"==typeof e)return z.from(A(e));if(e instanceof w){const t=E("error",e),r=k(e);return R(e),new z(x,t,r)}return new z(x,e.name,e.inputs?e.inputs.map(M.from):[])}static isFragment(e){return e&&e[I]===B}}t.ErrorFragment=z;class K extends G{anonymous;constructor(e,t,r,s){super(e,"event",t,r),Object.defineProperty(this,I,{value:j}),(0,n.defineProperties)(this,{anonymous:s})}get topicHash(){return(0,s.id)(this.format("sighash"))}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});const t=[];return"sighash"!==e&&t.push("event"),t.push(this.name+W(e,this.inputs)),"sighash"!==e&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){return t=(t||[]).map((e=>M.from(e))),new K(x,e,t,!1).topicHash}static from(e){if(K.isFragment(e))return e;if("string"==typeof e)try{return K.from(A(e))}catch(t){(0,n.assertArgument)(!1,"invalid event fragment","obj",e)}else if(e instanceof w){const t=E("event",e),r=k(e,!0),n=!!C(e,i(["anonymous"])).has("anonymous");return R(e),new K(x,t,r,n)}return new K(x,e.name,e.inputs?e.inputs.map((e=>M.from(e,!0))):[],!!e.anonymous)}static isFragment(e){return e&&e[I]===j}}t.EventFragment=K;class J extends H{payable;gas;constructor(e,t,r,s,i){super(e,t,r),Object.defineProperty(this,I,{value:L}),(0,n.defineProperties)(this,{payable:s,gas:i})}format(e){if((0,n.assert)(null!=e&&"sighash"!==e,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===e)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});const t=[`constructor${W(e,this.inputs)}`];return t.push(this.payable?"payable":"nonpayable"),null!=this.gas&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(J.isFragment(e))return e;if("string"==typeof e)try{return J.from(A(e))}catch(t){(0,n.assertArgument)(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof w){C(e,i(["constructor"]));const t=k(e),r=!!C(e,o).has("payable"),n=O(e);return R(e),new J(x,"constructor",t,r,n)}return new J(x,"constructor",e.inputs?e.inputs.map(M.from):[],!!e.payable,null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[I]===L}}t.ConstructorFragment=J;class V extends H{payable;constructor(e,t,r){super(e,"fallback",t),Object.defineProperty(this,I,{value:U}),(0,n.defineProperties)(this,{payable:r})}format(e){const t=0===this.inputs.length?"receive":"fallback";if("json"===e){const e=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:e})}return`${t}()${this.payable?" payable":""}`}static from(e){if(V.isFragment(e))return e;if("string"==typeof e)try{return V.from(A(e))}catch(t){(0,n.assertArgument)(!1,"invalid fallback fragment","obj",e)}else if(e instanceof w){const t=e.toString(),r=e.peekKeyword(i(["fallback","receive"]));if((0,n.assertArgument)(r,"type must be fallback or receive","obj",t),"receive"===e.popKeyword(i(["fallback","receive"]))){const t=k(e);return(0,n.assertArgument)(0===t.length,"receive cannot have arguments","obj.inputs",t),C(e,i(["payable"])),R(e),new V(x,[],!0)}let s=k(e);s.length?(0,n.assertArgument)(1===s.length&&"bytes"===s[0].type,"invalid fallback inputs","obj.inputs",s.map((e=>e.format("minimal"))).join(", ")):s=[M.from("bytes")];const o=S(e);if((0,n.assertArgument)("nonpayable"===o||"payable"===o,"fallback cannot be constants","obj.stateMutability",o),C(e,i(["returns"])).has("returns")){const t=k(e);(0,n.assertArgument)(1===t.length&&"bytes"===t[0].type,"invalid fallback outputs","obj.outputs",t.map((e=>e.format("minimal"))).join(", "))}return R(e),new V(x,s,"payable"===o)}if("receive"===e.type)return new V(x,[],!0);if("fallback"===e.type){const t=[M.from("bytes")],r="payable"===e.stateMutability;return new V(x,t,r)}(0,n.assertArgument)(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[I]===U}}t.FallbackFragment=V;class q extends G{constant;outputs;stateMutability;payable;gas;constructor(e,t,r,s,i,o){super(e,"function",t,s),Object.defineProperty(this,I,{value:D}),i=Object.freeze(i.slice());const a="view"===r||"pure"===r,c="payable"===r;(0,n.defineProperties)(this,{constant:a,gas:o,outputs:i,payable:c,stateMutability:r})}get selector(){return(0,s.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});const t=[];return"sighash"!==e&&t.push("function"),t.push(this.name+W(e,this.inputs)),"sighash"!==e&&("nonpayable"!==this.stateMutability&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(W(e,this.outputs))),null!=this.gas&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){return t=(t||[]).map((e=>M.from(e))),new q(x,e,"view",t,[],null).selector}static from(e){if(q.isFragment(e))return e;if("string"==typeof e)try{return q.from(A(e))}catch(t){(0,n.assertArgument)(!1,"invalid function fragment","obj",e)}else if(e instanceof w){const t=E("function",e),r=k(e),n=S(e);let s=[];C(e,i(["returns"])).has("returns")&&(s=k(e));const o=O(e);return R(e),new q(x,t,n,r,s,o)}let t=e.stateMutability;return null==t&&(t="payable","boolean"==typeof e.constant?(t="view",e.constant||(t="payable","boolean"!=typeof e.payable||e.payable||(t="nonpayable"))):"boolean"!=typeof e.payable||e.payable||(t="nonpayable")),new q(x,e.name,t,e.inputs?e.inputs.map(M.from):[],e.outputs?e.outputs.map(M.from):[],null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[I]===D}}t.FunctionFragment=q;class Q extends G{constructor(e,t,r){super(e,"struct",t,r),Object.defineProperty(this,I,{value:F})}format(){throw new Error("@TODO")}static from(e){if("string"==typeof e)try{return Q.from(A(e))}catch(t){(0,n.assertArgument)(!1,"invalid struct fragment","obj",e)}else if(e instanceof w){const t=E("struct",e),r=k(e);return R(e),new Q(x,t,r)}return new Q(x,e.name,e.inputs?e.inputs.map(M.from):[])}static isFragment(e){return e&&e[I]===F}}t.StructFragment=Q},3707:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Typed=t.Result=t.TransactionDescription=t.LogDescription=t.ErrorDescription=t.Interface=t.Indexed=t.checkResultErrors=t.StructFragment=t.ParamType=t.NamedFragment=t.FunctionFragment=t.Fragment=t.FallbackFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.encodeBytes32String=t.decodeBytes32String=t.AbiCoder=void 0;var n=r(4760);Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return n.AbiCoder}});var s=r(2472);Object.defineProperty(t,"decodeBytes32String",{enumerable:!0,get:function(){return s.decodeBytes32String}}),Object.defineProperty(t,"encodeBytes32String",{enumerable:!0,get:function(){return s.encodeBytes32String}});var i=r(6711);Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(t,"FallbackFragment",{enumerable:!0,get:function(){return i.FallbackFragment}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(t,"NamedFragment",{enumerable:!0,get:function(){return i.NamedFragment}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(t,"StructFragment",{enumerable:!0,get:function(){return i.StructFragment}});var o=r(6401);Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return o.checkResultErrors}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return o.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return o.Interface}}),Object.defineProperty(t,"ErrorDescription",{enumerable:!0,get:function(){return o.ErrorDescription}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return o.LogDescription}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return o.TransactionDescription}}),Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return o.Result}});var a=r(3762);Object.defineProperty(t,"Typed",{enumerable:!0,get:function(){return a.Typed}})},6401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Interface=t.Indexed=t.ErrorDescription=t.TransactionDescription=t.LogDescription=t.Result=t.checkResultErrors=void 0;const n=r(6965),s=r(8336),i=r(2120),o=r(4760),a=r(2900);Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return a.checkResultErrors}}),Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return a.Result}});const c=r(6711),u=r(3762);class l{fragment;name;signature;topic;args;constructor(e,t,r){const n=e.name,s=e.format();(0,i.defineProperties)(this,{fragment:e,name:n,signature:s,topic:t,args:r})}}t.LogDescription=l;class d{fragment;name;args;signature;selector;value;constructor(e,t,r,n){const s=e.name,o=e.format();(0,i.defineProperties)(this,{fragment:e,name:s,args:r,signature:o,selector:t,value:n})}}t.TransactionDescription=d;class h{fragment;name;args;signature;selector;constructor(e,t,r){const n=e.name,s=e.format();(0,i.defineProperties)(this,{fragment:e,name:n,args:r,signature:s,selector:t})}}t.ErrorDescription=h;class f{hash;_isIndexed;static isIndexed(e){return!(!e||!e._isIndexed)}constructor(e){(0,i.defineProperties)(this,{hash:e,_isIndexed:!0})}}t.Indexed=f;const p={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},g={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let t="unknown panic code";return e>=0&&e<=255&&p[e.toString()]&&(t=p[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${t})`}}};class y{fragments;deploy;fallback;receive;#l;#d;#h;#f;constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,this.#h=new Map,this.#l=new Map,this.#d=new Map;const r=[];for(const e of t)try{r.push(c.Fragment.from(e))}catch(e){console.log("EE",e)}(0,i.defineProperties)(this,{fragments:Object.freeze(r)});let n=null,s=!1;this.#f=this.getAbiCoder(),this.fragments.forEach(((e,t)=>{let r;switch(e.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void(0,i.defineProperties)(this,{deploy:e});case"fallback":return void(0===e.inputs.length?s=!0:((0,i.assertArgument)(!n||e.payable!==n.payable,"conflicting fallback fragments",`fragments[${t}]`,e),n=e,s=n.payable));case"function":r=this.#h;break;case"event":r=this.#d;break;case"error":r=this.#l;break;default:return}const o=e.format();r.has(o)||r.set(o,e)})),this.deploy||(0,i.defineProperties)(this,{deploy:c.ConstructorFragment.from("constructor()")}),(0,i.defineProperties)(this,{fallback:n,receive:s})}format(e){const t=e?"minimal":"full";return this.fragments.map((e=>e.format(t)))}formatJson(){const e=this.fragments.map((e=>e.format("json")));return JSON.stringify(e.map((e=>JSON.parse(e))))}getAbiCoder(){return o.AbiCoder.defaultAbiCoder()}#p(e,t,r){if((0,i.isHexString)(e)){const t=e.toLowerCase();for(const e of this.#h.values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const n=[];for(const[t,r]of this.#h)t.split("(")[0]===e&&n.push(r);if(t){const e=t.length>0?t[t.length-1]:null;let r=t.length,s=!0;u.Typed.isTyped(e)&&"overrides"===e.type&&(s=!1,r--);for(let e=n.length-1;e>=0;e--){const t=n[e].inputs.length;t===r||s&&t===r-1||n.splice(e,1)}for(let e=n.length-1;e>=0;e--){const r=n[e].inputs;for(let s=0;s=r.length){if("overrides"===t[s].type)continue;n.splice(e,1);break}if(t[s].type!==r[s].baseType){n.splice(e,1);break}}}}if(1===n.length&&t&&t.length!==n[0].inputs.length){const e=t[t.length-1];(null==e||Array.isArray(e)||"object"!=typeof e)&&n.splice(0,1)}if(0===n.length)return null;if(n.length>1&&r){const t=n.map((e=>JSON.stringify(e.format()))).join(", ");(0,i.assertArgument)(!1,`ambiguous function description (i.e. matches ${t})`,"key",e)}return n[0]}return this.#h.get(c.FunctionFragment.from(e).format())||null}getFunctionName(e){const t=this.#p(e,null,!1);return(0,i.assertArgument)(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#p(e,null,!1)}getFunction(e,t){return this.#p(e,t||null,!0)}forEachFunction(e){const t=Array.from(this.#h.keys());t.sort(((e,t)=>e.localeCompare(t)));for(let r=0;r=0;e--)n[e].inputs.length=0;e--){const r=n[e].inputs;for(let s=0;s1&&r){const t=n.map((e=>JSON.stringify(e.format()))).join(", ");(0,i.assertArgument)(!1,`ambiguous event description (i.e. matches ${t})`,"key",e)}return n[0]}return this.#d.get(c.EventFragment.from(e).format())||null}getEventName(e){const t=this.#g(e,null,!1);return(0,i.assertArgument)(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#g(e,null,!1)}getEvent(e,t){return this.#g(e,t||null,!0)}forEachEvent(e){const t=Array.from(this.#d.keys());t.sort(((e,t)=>e.localeCompare(t)));for(let r=0;r1){const r=t.map((e=>JSON.stringify(e.format()))).join(", ");(0,i.assertArgument)(!1,`ambiguous error description (i.e. ${r})`,"name",e)}return t[0]}if("Error(string)"===(e=c.ErrorFragment.from(e).format()))return c.ErrorFragment.from("error Error(string)");if("Panic(uint256)"===e)return c.ErrorFragment.from("error Panic(uint256)");return this.#l.get(e)||null}forEachError(e){const t=Array.from(this.#l.keys());t.sort(((e,t)=>e.localeCompare(t)));for(let r=0;r"string"===e.type?(0,s.id)(t):"bytes"===e.type?(0,n.keccak256)((0,i.hexlify)(t)):("bool"===e.type&&"boolean"==typeof t?t=t?"0x01":"0x00":e.type.match(/^u?int/)?t=(0,i.toBeHex)(t):e.type.match(/^bytes/)?t=(0,i.zeroPadBytes)(t,32):"address"===e.type&&this.#f.encode(["address"],[t]),(0,i.zeroPadValue)((0,i.hexlify)(t),32));for(t.forEach(((t,n)=>{const s=e.inputs[n];s.indexed?null==t?r.push(null):"array"===s.baseType||"tuple"===s.baseType?(0,i.assertArgument)(!1,"filtering with tuples or arrays not supported","contract."+s.name,t):Array.isArray(t)?r.push(t.map((e=>o(s,e)))):r.push(o(s,t)):(0,i.assertArgument)(null==t,"cannot filter non-indexed parameters; must be null","contract."+s.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){if("string"==typeof e){const t=this.getEvent(e);(0,i.assertArgument)(t,"unknown event","eventFragment",e),e=t}const r=[],o=[],a=[];return e.anonymous||r.push(e.topicHash),(0,i.assertArgument)(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach(((e,i)=>{const c=t[i];if(e.indexed)if("string"===e.type)r.push((0,s.id)(c));else if("bytes"===e.type)r.push((0,n.keccak256)(c));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this.#f.encode([e.type],[c]))}else o.push(e),a.push(c)})),{data:this.#f.encode(o,a),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e){const t=this.getEvent(e);(0,i.assertArgument)(t,"unknown event","eventFragment",e),e=t}if(null!=r&&!e.anonymous){const t=e.topicHash;(0,i.assertArgument)((0,i.isHexString)(r[0],32)&&r[0].toLowerCase()===t,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const n=[],s=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(c.ParamType.from({type:"bytes32",name:e.name})),o.push(!0)):(n.push(e),o.push(!1)):(s.push(e),o.push(!1))}));const u=null!=r?this.#f.decode(n,(0,i.concat)(r)):null,l=this.#f.decode(s,t,!0),d=[],h=[];let p=0,g=0;return e.inputs.forEach(((e,t)=>{let r=null;if(e.indexed)if(null==u)r=new f(null);else if(o[t])r=new f(u[g++]);else try{r=u[g++]}catch(e){r=e}else try{r=l[p++]}catch(e){r=e}d.push(r),h.push(e.name||null)})),a.Result.fromItems(d,h)}parseTransaction(e){const t=(0,i.getBytes)(e.data,"tx.data"),r=(0,i.getBigInt)(null!=e.value?e.value:0,"tx.value"),n=this.getFunction((0,i.hexlify)(t.slice(0,4)));if(!n)return null;const s=this.#f.decode(n.inputs,t.slice(4));return new d(n,n.selector,s,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new l(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=(0,i.hexlify)(e),r=this.getError((0,i.dataSlice)(t,0,4));if(!r)return null;const n=this.#f.decode(r.inputs,(0,i.dataSlice)(t,4));return new h(r,r.selector,n)}static from(e){return e instanceof y?e:"string"==typeof e?new y(JSON.parse(e)):"function"==typeof e.format?new y(e.format("json")):new y(e)}}t.Interface=y},3762:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Typed=void 0;const n=r(2120),s={};function i(e,t){let r=!1;return t<0&&(r=!0,t*=-1),new c(s,`${r?"":"u"}int${t}`,e,{signed:r,width:t})}function o(e,t){return new c(s,`bytes${t||""}`,e,{size:t})}const a=Symbol.for("_ethers_typed");class c{type;value;#y;_typedSymbol;constructor(e,t,r,i){null==i&&(i=null),(0,n.assertPrivate)(s,e,"Typed"),(0,n.defineProperties)(this,{_typedSymbol:a,type:t,value:r}),this.#y=i,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map((e=>e.format())).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return this.#y}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===this.#y?-1:!1===this.#y?this.value.length:null}static from(e,t){return new c(s,e,t)}static uint8(e){return i(e,8)}static uint16(e){return i(e,16)}static uint24(e){return i(e,24)}static uint32(e){return i(e,32)}static uint40(e){return i(e,40)}static uint48(e){return i(e,48)}static uint56(e){return i(e,56)}static uint64(e){return i(e,64)}static uint72(e){return i(e,72)}static uint80(e){return i(e,80)}static uint88(e){return i(e,88)}static uint96(e){return i(e,96)}static uint104(e){return i(e,104)}static uint112(e){return i(e,112)}static uint120(e){return i(e,120)}static uint128(e){return i(e,128)}static uint136(e){return i(e,136)}static uint144(e){return i(e,144)}static uint152(e){return i(e,152)}static uint160(e){return i(e,160)}static uint168(e){return i(e,168)}static uint176(e){return i(e,176)}static uint184(e){return i(e,184)}static uint192(e){return i(e,192)}static uint200(e){return i(e,200)}static uint208(e){return i(e,208)}static uint216(e){return i(e,216)}static uint224(e){return i(e,224)}static uint232(e){return i(e,232)}static uint240(e){return i(e,240)}static uint248(e){return i(e,248)}static uint256(e){return i(e,256)}static uint(e){return i(e,256)}static int8(e){return i(e,-8)}static int16(e){return i(e,-16)}static int24(e){return i(e,-24)}static int32(e){return i(e,-32)}static int40(e){return i(e,-40)}static int48(e){return i(e,-48)}static int56(e){return i(e,-56)}static int64(e){return i(e,-64)}static int72(e){return i(e,-72)}static int80(e){return i(e,-80)}static int88(e){return i(e,-88)}static int96(e){return i(e,-96)}static int104(e){return i(e,-104)}static int112(e){return i(e,-112)}static int120(e){return i(e,-120)}static int128(e){return i(e,-128)}static int136(e){return i(e,-136)}static int144(e){return i(e,-144)}static int152(e){return i(e,-152)}static int160(e){return i(e,-160)}static int168(e){return i(e,-168)}static int176(e){return i(e,-176)}static int184(e){return i(e,-184)}static int192(e){return i(e,-192)}static int200(e){return i(e,-200)}static int208(e){return i(e,-208)}static int216(e){return i(e,-216)}static int224(e){return i(e,-224)}static int232(e){return i(e,-232)}static int240(e){return i(e,-240)}static int248(e){return i(e,-248)}static int256(e){return i(e,-256)}static int(e){return i(e,-256)}static bytes1(e){return o(e,1)}static bytes2(e){return o(e,2)}static bytes3(e){return o(e,3)}static bytes4(e){return o(e,4)}static bytes5(e){return o(e,5)}static bytes6(e){return o(e,6)}static bytes7(e){return o(e,7)}static bytes8(e){return o(e,8)}static bytes9(e){return o(e,9)}static bytes10(e){return o(e,10)}static bytes11(e){return o(e,11)}static bytes12(e){return o(e,12)}static bytes13(e){return o(e,13)}static bytes14(e){return o(e,14)}static bytes15(e){return o(e,15)}static bytes16(e){return o(e,16)}static bytes17(e){return o(e,17)}static bytes18(e){return o(e,18)}static bytes19(e){return o(e,19)}static bytes20(e){return o(e,20)}static bytes21(e){return o(e,21)}static bytes22(e){return o(e,22)}static bytes23(e){return o(e,23)}static bytes24(e){return o(e,24)}static bytes25(e){return o(e,25)}static bytes26(e){return o(e,26)}static bytes27(e){return o(e,27)}static bytes28(e){return o(e,28)}static bytes29(e){return o(e,29)}static bytes30(e){return o(e,30)}static bytes31(e){return o(e,31)}static bytes32(e){return o(e,32)}static address(e){return new c(s,"address",e)}static bool(e){return new c(s,"bool",!!e)}static bytes(e){return new c(s,"bytes",e)}static string(e){return new c(s,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new c(s,"overrides",Object.assign({},e))}static isTyped(e){return e&&"object"==typeof e&&"_typedSymbol"in e&&e._typedSymbol===a}static dereference(e,t){if(c.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}}t.Typed=c},805:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIcapAddress=t.getAddress=void 0;const n=r(6965),s=r(2120),i=BigInt(0),o=BigInt(36);function a(e){const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const i=(0,s.getBytes)((0,n.keccak256)(r));for(let e=0;e<40;e+=2)i[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&i[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const c={};for(let e=0;e<10;e++)c[String(e)]=String(e);for(let e=0;e<26;e++)c[String.fromCharCode(65+e)]=String(10+e);const u=15;function l(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>c[e])).join("");for(;t.length>=u;){let e=t.substring(0,u);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}const d=function(){const e={};for(let t=0;t<36;t++)e["0123456789abcdefghijklmnopqrstuvwxyz"[t]]=BigInt(t);return e}();function h(e){if((0,s.assertArgument)("string"==typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=a(e);return(0,s.assertArgument)(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,s.assertArgument)(e.substring(2,4)===l(e),"bad icap checksum","address",e);let t=function(e){e=e.toLowerCase();let t=i;for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveAddress=t.isAddress=t.isAddressable=void 0;const n=r(2120),s=r(805);function i(e){return e&&"function"==typeof e.getAddress}async function o(e,t){const r=await t;return null!=r&&"0x0000000000000000000000000000000000000000"!==r||((0,n.assert)("string"!=typeof e,"unconfigured name","UNCONFIGURED_NAME",{value:e}),(0,n.assertArgument)(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),(0,s.getAddress)(r)}t.isAddressable=i,t.isAddress=function(e){try{return(0,s.getAddress)(e),!0}catch(e){}return!1},t.resolveAddress=function(e,t){return"string"==typeof e?e.match(/^0x[0-9a-f]{40}$/i)?(0,s.getAddress)(e):((0,n.assert)(null!=t,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),o(e,t.resolveName(e))):i(e)?o(e,e.getAddress()):e&&"function"==typeof e.then?o(e,e):void(0,n.assertArgument)(!1,"unsupported addressable value","target",e)}},6067:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCreate2Address=t.getCreateAddress=void 0;const n=r(6965),s=r(2120),i=r(805);t.getCreateAddress=function(e){const t=(0,i.getAddress)(e.from);let r=(0,s.getBigInt)(e.nonce,"tx.nonce").toString(16);return r="0"===r?"0x":r.length%2?"0x0"+r:"0x"+r,(0,i.getAddress)((0,s.dataSlice)((0,n.keccak256)((0,s.encodeRlp)([t,r])),12))},t.getCreate2Address=function(e,t,r){const o=(0,i.getAddress)(e),a=(0,s.getBytes)(t,"salt"),c=(0,s.getBytes)(r,"initCodeHash");return(0,s.assertArgument)(32===a.length,"salt must be 32 bytes","salt",t),(0,s.assertArgument)(32===c.length,"initCodeHash must be 32 bytes","initCodeHash",r),(0,i.getAddress)((0,s.dataSlice)((0,n.keccak256)((0,s.concat)(["0xff",o,a,c])),12))}},5475:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveAddress=t.isAddress=t.isAddressable=t.getCreate2Address=t.getCreateAddress=t.getIcapAddress=t.getAddress=void 0;var n=r(805);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return n.getAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return n.getIcapAddress}});var s=r(6067);Object.defineProperty(t,"getCreateAddress",{enumerable:!0,get:function(){return s.getCreateAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return s.getCreate2Address}});var i=r(3442);Object.defineProperty(t,"isAddressable",{enumerable:!0,get:function(){return i.isAddressable}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return i.isAddress}}),Object.defineProperty(t,"resolveAddress",{enumerable:!0,get:function(){return i.resolveAddress}})},3223:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZeroAddress=void 0,t.ZeroAddress="0x0000000000000000000000000000000000000000"},688:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZeroHash=void 0,t.ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"},87:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagePrefix=t.EtherSymbol=t.MaxInt256=t.MinInt256=t.MaxUint256=t.WeiPerEther=t.N=t.ZeroHash=t.ZeroAddress=void 0;var n=r(3223);Object.defineProperty(t,"ZeroAddress",{enumerable:!0,get:function(){return n.ZeroAddress}});var s=r(688);Object.defineProperty(t,"ZeroHash",{enumerable:!0,get:function(){return s.ZeroHash}});var i=r(4456);Object.defineProperty(t,"N",{enumerable:!0,get:function(){return i.N}}),Object.defineProperty(t,"WeiPerEther",{enumerable:!0,get:function(){return i.WeiPerEther}}),Object.defineProperty(t,"MaxUint256",{enumerable:!0,get:function(){return i.MaxUint256}}),Object.defineProperty(t,"MinInt256",{enumerable:!0,get:function(){return i.MinInt256}}),Object.defineProperty(t,"MaxInt256",{enumerable:!0,get:function(){return i.MaxInt256}});var o=r(2359);Object.defineProperty(t,"EtherSymbol",{enumerable:!0,get:function(){return o.EtherSymbol}}),Object.defineProperty(t,"MessagePrefix",{enumerable:!0,get:function(){return o.MessagePrefix}})},4456:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MaxInt256=t.MinInt256=t.MaxUint256=t.WeiPerEther=t.N=void 0,t.N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),t.WeiPerEther=BigInt("1000000000000000000"),t.MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),t.MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1),t.MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},2359:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagePrefix=t.EtherSymbol=void 0,t.EtherSymbol="Ξ",t.MessagePrefix="Ethereum Signed Message:\n"},4350:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=t.BaseContract=t.resolveArgs=t.copyOverrides=void 0;const n=r(3707),s=r(5475),i=r(7143),o=r(2120),a=r(7151),c=BigInt(0);function u(e){return e&&"function"==typeof e.call}function l(e){return e&&"function"==typeof e.estimateGas}function d(e){return e&&"function"==typeof e.resolveName}function h(e){return e&&"function"==typeof e.sendTransaction}class f{#m;fragment;constructor(e,t,r){if((0,o.defineProperties)(this,{fragment:t}),t.inputs.lengthnull==r[t]?null:e.walkAsync(r[t],((e,t)=>"address"===e?Array.isArray(t)?Promise.all(t.map((e=>(0,s.resolveAddress)(e,i)))):(0,s.resolveAddress)(t,i):t)))));return e.interface.encodeFilterTopics(t,n)}()}getTopicFilter(){return this.#m}}function p(e,t){return null==e?null:"function"==typeof e[t]?e:e.provider&&"function"==typeof e.provider[t]?e.provider:null}function g(e){return null==e?null:e.provider||null}async function y(e,t){const r=n.Typed.dereference(e,"overrides");(0,o.assertArgument)("object"==typeof r,"invalid overrides parameter","overrides",e);const a=(0,i.copyRequest)(r);return(0,o.assertArgument)(null==a.to||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",a.to),(0,o.assertArgument)(null==a.data||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",a.data),a.from&&(a.from=await(0,s.resolveAddress)(a.from)),a}async function m(e,t,r){const i=p(e,"resolveName"),o=d(i)?i:null;return await Promise.all(t.map(((e,t)=>e.walkAsync(r[t],((e,t)=>(t=n.Typed.dereference(t,e),"address"===e?(0,s.resolveAddress)(t,o):t))))))}function b(e){const t=async function(t){const r=await y(t,["data"]);r.to=await e.getAddress();const n=e.interface,s=(0,o.getBigInt)(r.value||c,"overrides.value")===c,i="0x"===(r.data||"0x");!n.fallback||n.fallback.payable||!n.receive||i||s||(0,o.assertArgument)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",t),(0,o.assertArgument)(n.fallback||i,"cannot send data to receive-only contract","overrides.data",r.data);const a=n.receive||n.fallback&&n.fallback.payable;return(0,o.assertArgument)(a||s,"cannot send value to non-payable fallback","overrides.value",r.value),(0,o.assertArgument)(n.fallback||i,"cannot send data to receive-only contract","overrides.data",r.data),r},r=async function(r){const n=e.runner;(0,o.assert)(h(n),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const s=await n.sendTransaction(await t(r)),i=g(e.runner);return new a.ContractTransactionResponse(e.interface,i,s)},n=async e=>await r(e);return(0,o.defineProperties)(n,{_contract:e,estimateGas:async function(r){const n=p(e.runner,"estimateGas");return(0,o.assert)(l(n),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await n.estimateGas(await t(r))},populateTransaction:t,send:r,staticCall:async function(r){const n=p(e.runner,"call");(0,o.assert)(u(n),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const s=await t(r);try{return await n.call(s)}catch(t){if((0,o.isCallException)(t)&&t.data)throw e.interface.makeError(t.data,s);throw t}}}),n}t.copyOverrides=y,t.resolveArgs=m;const v=Symbol.for("_ethersInternal_contract"),w=new WeakMap;function A(e){return w.get(e[v])}async function P(e,t){let r,n=null;if(Array.isArray(t)){const n=function(t){if((0,o.isHexString)(t,32))return t;const r=e.interface.getEvent(t);return(0,o.assertArgument)(r,"unknown fragment","name",t),r.topicHash};r=t.map((e=>null==e?null:Array.isArray(e)?e.map(n):n(e)))}else"*"===t?r=[null]:"string"==typeof t?(0,o.isHexString)(t,32)?r=[t]:(n=e.interface.getEvent(t),(0,o.assertArgument)(n,"unknown fragment","event",t),r=[n.topicHash]):(s=t)&&"object"==typeof s&&"getTopicFilter"in s&&"function"==typeof s.getTopicFilter&&s.fragment?r=await t.getTopicFilter():"fragment"in t?(n=t.fragment,r=[n.topicHash]):(0,o.assertArgument)(!1,"unknown event name","event",t);var s;return r=r.map((e=>{if(null==e)return null;if(Array.isArray(e)){const t=Array.from(new Set(e.map((e=>e.toLowerCase()))).values());return 1===t.length?t[0]:(t.sort(),t)}return e.toLowerCase()})),{fragment:n,tag:r.map((e=>null==e?"null":Array.isArray(e)?e.join("|"):e)).join("&"),topics:r}}async function E(e,t){const{subs:r}=A(e);return r.get((await P(e,t)).tag)||null}async function C(e,t,r){const n=g(e.runner);(0,o.assert)(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:s,tag:i,topics:c}=await P(e,r),{addr:u,subs:l}=A(e);let d=l.get(i);if(!d){const t={address:u||e,topics:c},o=t=>{let n=s;if(null==n)try{n=e.interface.getEvent(t.topics[0])}catch(e){}if(n){const i=n,o=s?e.interface.decodeEventLog(s,t.data,t.topics):[];k(e,r,o,(n=>new a.ContractEventPayload(e,n,r,i,t)))}else k(e,r,[],(n=>new a.ContractUnknownEventPayload(e,n,r,t)))};let h=[];d={tag:i,listeners:[],start:()=>{h.length||h.push(n.on(t,o))},stop:async()=>{if(0==h.length)return;let e=h;h=[],await Promise.all(e),n.off(t,o)}},l.set(i,d)}return d}let S=Promise.resolve();async function k(e,t,r,n){try{await S}catch(e){}const s=async function(e,t,r,n){await S;const s=await E(e,t);if(!s)return!1;const i=s.listeners.length;return s.listeners=s.listeners.filter((({listener:t,once:s})=>{const i=Array.from(r);n&&i.push(n(s?null:t));try{t.call(e,...i)}catch(e){}return!s})),0===s.listeners.length&&(s.stop(),A(e).subs.delete(s.tag)),i>0}(e,t,r,n);return S=s,await s}const O=["then"];class R{target;interface;runner;filters;[v];fallback;constructor(e,t,r,i){(0,o.assertArgument)("string"==typeof e||(0,s.isAddressable)(e),"invalid value for Contract target","target",e),null==r&&(r=null);const c=n.Interface.from(t);let u;(0,o.defineProperties)(this,{target:e,runner:r,interface:c}),Object.defineProperty(this,v,{value:{}});let l=null,h=null;if(i){const e=g(r);h=new a.ContractTransactionResponse(this.interface,e,i)}let f=new Map;if("string"==typeof e)if((0,o.isHexString)(e))l=e,u=Promise.resolve(e);else{const t=p(r,"resolveName");if(!d(t))throw(0,o.makeError)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});u=t.resolveName(e).then((t=>{if(null==t)throw(0,o.makeError)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return A(this).addr=t,t}))}else u=e.getAddress().then((e=>{if(null==e)throw new Error("TODO");return A(this).addr=e,e}));var y;y={addrPromise:u,addr:l,deployTx:h,subs:f},w.set(this[v],y);const m=new Proxy({},{get:(e,t,r)=>{if("symbol"==typeof t||O.indexOf(t)>=0)return Reflect.get(e,t,r);try{return this.getEvent(t)}catch(e){if(!(0,o.isError)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,t)=>O.indexOf(t)>=0?Reflect.has(e,t):Reflect.has(e,t)||this.interface.hasEvent(String(t))});return(0,o.defineProperties)(this,{filters:m}),(0,o.defineProperties)(this,{fallback:c.receive||c.fallback?b(this):null}),new Proxy(this,{get:(e,t,r)=>{if("symbol"==typeof t||t in e||O.indexOf(t)>=0)return Reflect.get(e,t,r);try{return e.getFunction(t)}catch(e){if(!(0,o.isError)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,t)=>"symbol"==typeof t||t in e||O.indexOf(t)>=0?Reflect.has(e,t):e.interface.hasFunction(t)})}connect(e){return new R(this.target,this.interface,e)}attach(e){return new R(e,this.interface,this.runner)}async getAddress(){return await A(this).addrPromise}async getDeployedCode(){const e=g(this.runner);(0,o.assert)(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return"0x"===t?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(null!=await this.getDeployedCode())return this;const t=g(this.runner);return(0,o.assert)(null!=t,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise(((e,r)=>{const n=async()=>{try{if(null!=await this.getDeployedCode())return e(this);t.once("block",n)}catch(e){r(e)}};n()}))}deploymentTransaction(){return A(this).deployTx}getFunction(e){"string"!=typeof e&&(e=e.format());const t=function(e,t){const r=function(...r){const n=e.interface.getFunction(t,r);return(0,o.assert)(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),n},n=async function(...t){const n=r(...t);let s={};if(n.inputs.length+1===t.length&&(s=await y(t.pop())),n.inputs.length!==t.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const i=await m(e.runner,n.inputs,t);return Object.assign({},s,await(0,o.resolveProperties)({to:e.getAddress(),data:e.interface.encodeFunctionData(n,i)}))},s=async function(...e){const t=await c(...e);return 1===t.length?t[0]:t},i=async function(...t){const r=e.runner;(0,o.assert)(h(r),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const s=await r.sendTransaction(await n(...t)),i=g(e.runner);return new a.ContractTransactionResponse(e.interface,i,s)},c=async function(...t){const s=p(e.runner,"call");(0,o.assert)(u(s),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const i=await n(...t);let a="0x";try{a=await s.call(i)}catch(t){if((0,o.isCallException)(t)&&t.data)throw e.interface.makeError(t.data,i);throw t}const c=r(...t);return e.interface.decodeFunctionResult(c,a)},d=async(...e)=>r(...e).constant?await s(...e):await i(...e);return(0,o.defineProperties)(d,{name:e.interface.getFunctionName(t),_contract:e,_key:t,getFragment:r,estimateGas:async function(...t){const r=p(e.runner,"estimateGas");return(0,o.assert)(l(r),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await r.estimateGas(await n(...t))},populateTransaction:n,send:i,staticCall:s,staticCallResult:c}),Object.defineProperty(d,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=e.interface.getFunction(t);return(0,o.assert)(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),r}}),d}(this,e);return t}getEvent(e){return"string"!=typeof e&&(e=e.format()),function(e,t){const r=function(...r){const n=e.interface.getEvent(t,r);return(0,o.assert)(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),n},n=function(...t){return new f(e,r(...t),t)};return(0,o.defineProperties)(n,{name:e.interface.getEventName(t),_contract:e,_key:t,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=e.interface.getEvent(t);return(0,o.assert)(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),r}}),n}(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,r){null==t&&(t=0),null==r&&(r="latest");const{addr:n,addrPromise:s}=A(this),c=n||await s,{fragment:u,topics:l}=await P(this,e),d={address:c,topics:l,fromBlock:t,toBlock:r},h=g(this.runner);return(0,o.assert)(h,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await h.getLogs(d)).map((e=>{let t=u;if(null==t)try{t=this.interface.getEvent(e.topics[0])}catch(e){}if(t)try{return new a.EventLog(e,this.interface,t)}catch(t){return new a.UndecodedEventLog(e,t)}return new i.Log(e,h)}))}async on(e,t){const r=await C(this,"on",e);return r.listeners.push({listener:t,once:!1}),r.start(),this}async once(e,t){const r=await C(this,"once",e);return r.listeners.push({listener:t,once:!0}),r.start(),this}async emit(e,...t){return await k(this,e,t,null)}async listenerCount(e){if(e){const t=await E(this,e);return t?t.listeners.length:0}const{subs:t}=A(this);let r=0;for(const{listeners:e}of t.values())r+=e.length;return r}async listeners(e){if(e){const t=await E(this,e);return t?t.listeners.map((({listener:e})=>e)):[]}const{subs:t}=A(this);let r=[];for(const{listeners:e}of t.values())r=r.concat(e.map((({listener:e})=>e)));return r}async off(e,t){const r=await E(this,e);if(!r)return this;if(t){const e=r.listeners.map((({listener:e})=>e)).indexOf(t);e>=0&&r.listeners.splice(e,1)}return null!=t&&0!==r.listeners.length||(r.stop(),A(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const t=await E(this,e);if(!t)return this;t.stop(),A(this).subs.delete(t.tag)}else{const{subs:e}=A(this);for(const{tag:t,stop:r}of e.values())r(),e.delete(t)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){return class extends R{constructor(t,r=null){super(t,e,r)}}}static from(e,t,r){return null==r&&(r=null),new this(e,t,r)}}t.BaseContract=R;class T extends(function(){return R}()){}t.Contract=T},1018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractFactory=void 0;const n=r(3707),s=r(5475),i=r(2120),o=r(4350);class a{interface;bytecode;runner;constructor(e,t,r){const s=n.Interface.from(e);t instanceof Uint8Array||("object"==typeof t&&(t=t.object),t.startsWith("0x")||(t="0x"+t)),t=(0,i.hexlify)((0,i.getBytes)(t)),(0,i.defineProperties)(this,{bytecode:t,interface:s,runner:r||null})}attach(e){return new o.BaseContract(e,this.interface,this.runner)}async getDeployTransaction(...e){let t={};const r=this.interface.deploy;if(r.inputs.length+1===e.length&&(t=await(0,o.copyOverrides)(e.pop())),r.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");const n=await(0,o.resolveArgs)(this.runner,r.inputs,e),s=(0,i.concat)([this.bytecode,this.interface.encodeDeploy(n)]);return Object.assign({},t,{data:s})}async deploy(...e){const t=await this.getDeployTransaction(...e);(0,i.assert)(this.runner&&"function"==typeof this.runner.sendTransaction,"factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const r=await this.runner.sendTransaction(t),n=(0,s.getCreateAddress)(r);return new o.BaseContract(n,this.interface,this.runner,r)}connect(e){return new a(this.interface,this.bytecode,e)}static fromSolidity(e,t){(0,i.assertArgument)(null!=e,"bad compiler output","output",e),"string"==typeof e&&(e=JSON.parse(e));const r=e.abi;let n="";return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}}t.ContractFactory=a},7252:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UndecodedEventLog=t.EventLog=t.ContractTransactionResponse=t.ContractTransactionReceipt=t.ContractUnknownEventPayload=t.ContractEventPayload=t.ContractFactory=t.Contract=t.BaseContract=void 0;var n=r(4350);Object.defineProperty(t,"BaseContract",{enumerable:!0,get:function(){return n.BaseContract}}),Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return n.Contract}});var s=r(1018);Object.defineProperty(t,"ContractFactory",{enumerable:!0,get:function(){return s.ContractFactory}});var i=r(7151);Object.defineProperty(t,"ContractEventPayload",{enumerable:!0,get:function(){return i.ContractEventPayload}}),Object.defineProperty(t,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return i.ContractUnknownEventPayload}}),Object.defineProperty(t,"ContractTransactionReceipt",{enumerable:!0,get:function(){return i.ContractTransactionReceipt}}),Object.defineProperty(t,"ContractTransactionResponse",{enumerable:!0,get:function(){return i.ContractTransactionResponse}}),Object.defineProperty(t,"EventLog",{enumerable:!0,get:function(){return i.EventLog}}),Object.defineProperty(t,"UndecodedEventLog",{enumerable:!0,get:function(){return i.UndecodedEventLog}})},7151:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractEventPayload=t.ContractUnknownEventPayload=t.ContractTransactionResponse=t.ContractTransactionReceipt=t.UndecodedEventLog=t.EventLog=void 0;const n=r(7143),s=r(2120);class i extends n.Log{interface;fragment;args;constructor(e,t,r){super(e,e.provider);const n=t.decodeEventLog(r,e.data,e.topics);(0,s.defineProperties)(this,{args:n,fragment:r,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}t.EventLog=i;class o extends n.Log{error;constructor(e,t){super(e,e.provider),(0,s.defineProperties)(this,{error:t})}}t.UndecodedEventLog=o;class a extends n.TransactionReceipt{#b;constructor(e,t,r){super(r,t),this.#b=e}get logs(){return super.logs.map((e=>{const t=e.topics.length?this.#b.getEvent(e.topics[0]):null;if(t)try{return new i(e,this.#b,t)}catch(t){return new o(e,t)}return e}))}}t.ContractTransactionReceipt=a;class c extends n.TransactionResponse{#b;constructor(e,t,r){super(r,t),this.#b=e}async wait(e){const t=await super.wait(e);return null==t?null:new a(this.#b,this.provider,t)}}t.ContractTransactionResponse=c;class u extends s.EventPayload{log;constructor(e,t,r,n){super(e,t,r),(0,s.defineProperties)(this,{log:n})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}t.ContractUnknownEventPayload=u,t.ContractEventPayload=class extends u{constructor(e,t,r,n,o){super(e,t,r,new i(o,e.interface,n));const a=e.interface.decodeEventLog(n,this.log.data,this.log.topics);(0,s.defineProperties)(this,{args:a,fragment:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}},3147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.pbkdf2Sync=t.createHmac=t.createHash=void 0;const n=r(9569),s=r(9023),i=r(3061),o=r(6262),a=r(2120),c=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}(),u=c.crypto||c.msCrypto;t.createHash=function(e){switch(e){case"sha256":return i.sha256.create();case"sha512":return o.sha512.create()}(0,a.assertArgument)(!1,"invalid hashing algorithm name","algorithm",e)},t.createHmac=function(e,t){const r={sha256:i.sha256,sha512:o.sha512}[e];return(0,a.assertArgument)(null!=r,"invalid hmac algorithm","algorithm",e),n.hmac.create(r,t)},t.pbkdf2Sync=function(e,t,r,n,c){const u={sha256:i.sha256,sha512:o.sha512}[c];return(0,a.assertArgument)(null!=u,"invalid pbkdf2 algorithm","algorithm",c),(0,s.pbkdf2)(u,e,t,{c:r,dkLen:n})},t.randomBytes=function(e){(0,a.assert)(null!=u,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,a.assertArgument)(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const t=new Uint8Array(e);return u.getRandomValues(t),t}},6117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeHmac=void 0;const n=r(3147),s=r(2120);let i=!1;const o=function(e,t,r){return(0,n.createHmac)(e,t).update(r).digest()};let a=o;function c(e,t,r){const n=(0,s.getBytes)(t,"key"),i=(0,s.getBytes)(r,"data");return(0,s.hexlify)(a(e,n,i))}t.computeHmac=c,c._=o,c.lock=function(){i=!0},c.register=function(e){if(i)throw new Error("computeHmac is locked");a=e},Object.freeze(c)},6965:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lock=t.Signature=t.SigningKey=t.scryptSync=t.scrypt=t.pbkdf2=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.randomBytes=t.computeHmac=void 0;const n=r(6117);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return n.computeHmac}});const s=r(3037);Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return s.keccak256}});const i=r(7990);Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return i.ripemd160}});const o=r(4989);Object.defineProperty(t,"pbkdf2",{enumerable:!0,get:function(){return o.pbkdf2}});const a=r(2385);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return a.randomBytes}});const c=r(6168);Object.defineProperty(t,"scrypt",{enumerable:!0,get:function(){return c.scrypt}}),Object.defineProperty(t,"scryptSync",{enumerable:!0,get:function(){return c.scryptSync}});const u=r(9233);Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return u.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return u.sha512}});var l=r(3106);Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return l.SigningKey}});var d=r(3295);Object.defineProperty(t,"Signature",{enumerable:!0,get:function(){return d.Signature}}),t.lock=function(){n.computeHmac.lock(),s.keccak256.lock(),o.pbkdf2.lock(),a.randomBytes.lock(),i.ripemd160.lock(),c.scrypt.lock(),c.scryptSync.lock(),u.sha256.lock(),u.sha512.lock(),a.randomBytes.lock()}},3037:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keccak256=void 0;const n=r(5426),s=r(2120);let i=!1;const o=function(e){return(0,n.keccak_256)(e)};let a=o;function c(e){const t=(0,s.getBytes)(e,"data");return(0,s.hexlify)(a(t))}t.keccak256=c,c._=o,c.lock=function(){i=!0},c.register=function(e){if(i)throw new TypeError("keccak256 is locked");a=e},Object.freeze(c)},4989:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2=void 0;const n=r(3147),s=r(2120);let i=!1;const o=function(e,t,r,s,i){return(0,n.pbkdf2Sync)(e,t,r,s,i)};let a=o;function c(e,t,r,n,i){const o=(0,s.getBytes)(e,"password"),c=(0,s.getBytes)(t,"salt");return(0,s.hexlify)(a(o,c,r,n,i))}t.pbkdf2=c,c._=o,c.lock=function(){i=!0},c.register=function(e){if(i)throw new Error("pbkdf2 is locked");a=e},Object.freeze(c)},2385:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=void 0;const n=r(3147);let s=!1;const i=function(e){return new Uint8Array((0,n.randomBytes)(e))};let o=i;function a(e){return o(e)}t.randomBytes=a,a._=i,a.lock=function(){s=!0},a.register=function(e){if(s)throw new Error("randomBytes is locked");o=e},Object.freeze(a)},7990:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=void 0;const n=r(830),s=r(2120);let i=!1;const o=function(e){return(0,n.ripemd160)(e)};let a=o;function c(e){const t=(0,s.getBytes)(e,"data");return(0,s.hexlify)(a(t))}t.ripemd160=c,c._=o,c.lock=function(){i=!0},c.register=function(e){if(i)throw new TypeError("ripemd160 is locked");a=e},Object.freeze(c)},6168:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scryptSync=t.scrypt=void 0;const n=r(9514),s=r(2120);let i=!1,o=!1;const a=async function(e,t,r,s,i,o,a){return await(0,n.scryptAsync)(e,t,{N:r,r:s,p:i,dkLen:o,onProgress:a})},c=function(e,t,r,s,i,o){return(0,n.scrypt)(e,t,{N:r,r:s,p:i,dkLen:o})};let u=a,l=c;async function d(e,t,r,n,i,o,a){const c=(0,s.getBytes)(e,"passwd"),l=(0,s.getBytes)(t,"salt");return(0,s.hexlify)(await u(c,l,r,n,i,o,a))}function h(e,t,r,n,i,o){const a=(0,s.getBytes)(e,"passwd"),c=(0,s.getBytes)(t,"salt");return(0,s.hexlify)(l(a,c,r,n,i,o))}t.scrypt=d,d._=a,d.lock=function(){o=!0},d.register=function(e){if(o)throw new Error("scrypt is locked");u=e},Object.freeze(d),t.scryptSync=h,h._=c,h.lock=function(){i=!0},h.register=function(e){if(i)throw new Error("scryptSync is locked");l=e},Object.freeze(h)},9233:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=t.sha256=void 0;const n=r(3147),s=r(2120),i=function(e){return(0,n.createHash)("sha256").update(e).digest()},o=function(e){return(0,n.createHash)("sha512").update(e).digest()};let a=i,c=o,u=!1,l=!1;function d(e){const t=(0,s.getBytes)(e,"data");return(0,s.hexlify)(a(t))}function h(e){const t=(0,s.getBytes)(e,"data");return(0,s.hexlify)(c(t))}t.sha256=d,d._=i,d.lock=function(){u=!0},d.register=function(e){if(u)throw new Error("sha256 is locked");a=e},Object.freeze(d),t.sha512=h,h._=o,h.lock=function(){l=!0},h.register=function(e){if(l)throw new Error("sha512 is locked");c=e},Object.freeze(d)},3295:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signature=void 0;const n=r(87),s=r(2120),i=BigInt(0),o=BigInt(1),a=BigInt(2),c=BigInt(27),u=BigInt(28),l=BigInt(35),d={};function h(e){return(0,s.zeroPadValue)((0,s.toBeArray)(e),32)}class f{#v;#w;#A;#P;get r(){return this.#v}set r(e){(0,s.assertArgument)(32===(0,s.dataLength)(e),"invalid r","value",e),this.#v=(0,s.hexlify)(e)}get s(){return this.#w}set s(e){(0,s.assertArgument)(32===(0,s.dataLength)(e),"invalid s","value",e);const t=(0,s.hexlify)(e);(0,s.assertArgument)(parseInt(t.substring(0,3))<8,"non-canonical s","value",t),this.#w=t}get v(){return this.#A}set v(e){const t=(0,s.getNumber)(e,"value");(0,s.assertArgument)(27===t||28===t,"invalid v","v",e),this.#A=t}get networkV(){return this.#P}get legacyChainId(){const e=this.networkV;return null==e?null:f.getChainId(e)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const e=(0,s.getBytes)(this.s);return this.yParity&&(e[0]|=128),(0,s.hexlify)(e)}get compactSerialized(){return(0,s.concat)([this.r,this.yParityAndS])}get serialized(){return(0,s.concat)([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,r,n){(0,s.assertPrivate)(e,d,"Signature"),this.#v=t,this.#w=r,this.#A=n,this.#P=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new f(d,this.r,this.s,this.v);return this.networkV&&(e.#P=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:null!=e?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const t=(0,s.getBigInt)(e,"v");return t==c||t==u?i:((0,s.assertArgument)(t>=l,"invalid EIP-155 v","v",e),(t-l)/a)}static getChainIdV(e,t){return(0,s.getBigInt)(e)*a+BigInt(35+t-27)}static getNormalizedV(e){const t=(0,s.getBigInt)(e);return t===i||t===c?27:t===o||t===u?28:((0,s.assertArgument)(t>=l,"invalid v","v",e),t&o?27:28)}static from(e){function t(t,r){(0,s.assertArgument)(t,r,"signature",e)}if(null==e)return new f(d,n.ZeroHash,n.ZeroHash,27);if("string"==typeof e){const r=(0,s.getBytes)(e,"signature");if(64===r.length){const e=(0,s.hexlify)(r.slice(0,32)),t=r.slice(32,64),n=128&t[0]?28:27;return t[0]&=127,new f(d,e,(0,s.hexlify)(t),n)}if(65===r.length){const e=(0,s.hexlify)(r.slice(0,32)),n=r.slice(32,64);t(0==(128&n[0]),"non-canonical s");const i=f.getNormalizedV(r[64]);return new f(d,e,(0,s.hexlify)(n),i)}t(!1,"invalid raw signature length")}if(e instanceof f)return e.clone();const r=e.r;t(null!=r,"missing r");const i=h(r),o=function(e,r){if(null!=e)return h(e);if(null!=r){t((0,s.isHexString)(r,32),"invalid yParityAndS");const e=(0,s.getBytes)(r);return e[0]&=127,(0,s.hexlify)(e)}t(!1,"missing s")}(e.s,e.yParityAndS);t(0==(128&(0,s.getBytes)(o)[0]),"non-canonical s");const{networkV:a,v:c}=function(e,r,n){if(null!=e){const t=(0,s.getBigInt)(e);return{networkV:t>=l?t:void 0,v:f.getNormalizedV(t)}}if(null!=r)return t((0,s.isHexString)(r,32),"invalid yParityAndS"),{v:128&(0,s.getBytes)(r)[0]?28:27};if(null!=n){switch((0,s.getNumber)(n,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),u=new f(d,i,o,c);return a&&(u.#P=a),t(null==e.yParity||(0,s.getNumber)(e.yParity,"sig.yParity")===u.yParity,"yParity mismatch"),t(null==e.yParityAndS||e.yParityAndS===u.yParityAndS,"yParityAndS mismatch"),u}}t.Signature=f},3106:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigningKey=void 0;const n=r(8415).__importStar(r(9656)),s=r(2120),i=r(6117),o=r(3295);n.utils.hmacSha256Sync=function(e,...t){return(0,s.getBytes)((0,i.computeHmac)("sha256",e,(0,s.concat)(t)))};class a{#E;constructor(e){(0,s.assertArgument)(32===(0,s.dataLength)(e),"invalid private key","privateKey","[REDACTED]"),this.#E=(0,s.hexlify)(e)}get privateKey(){return this.#E}get publicKey(){return a.computePublicKey(this.#E)}get compressedPublicKey(){return a.computePublicKey(this.#E,!0)}sign(e){(0,s.assertArgument)(32===(0,s.dataLength)(e),"invalid digest length","digest",e);const[t,r]=n.signSync((0,s.getBytesCopy)(e),(0,s.getBytesCopy)(this.#E),{recovered:!0,canonical:!0}),i=n.Signature.fromHex(t);return o.Signature.from({r:(0,s.toBeHex)("0x"+i.r.toString(16),32),s:(0,s.toBeHex)("0x"+i.s.toString(16),32),v:r?28:27})}computeSharedSecret(e){const t=a.computePublicKey(e);return(0,s.hexlify)(n.getSharedSecret((0,s.getBytesCopy)(this.#E),(0,s.getBytes)(t)))}static computePublicKey(e,t){let r=(0,s.getBytes)(e,"key");if(32===r.length){const e=n.getPublicKey(r,!!t);return(0,s.hexlify)(e)}if(64===r.length){const e=new Uint8Array(65);e[0]=4,e.set(r,1),r=e}const i=n.Point.fromHex(r);return(0,s.hexlify)(i.toRawBytes(t))}static recoverPublicKey(e,t){(0,s.assertArgument)(32===(0,s.dataLength)(e),"invalid digest length","digest",e);const r=o.Signature.from(t),i=n.Signature.fromCompact((0,s.getBytesCopy)((0,s.concat)([r.r,r.s]))).toDERRawBytes(),a=n.recoverPublicKey((0,s.getBytesCopy)(e),i,r.yParity);return(0,s.assertArgument)(null!=a,"invalid signautre for digest","signature",t),(0,s.hexlify)(a)}static addPoints(e,t,r){const s=n.Point.fromHex(a.computePublicKey(e).substring(2)),i=n.Point.fromHex(a.computePublicKey(t).substring(2));return"0x"+s.add(i).toHex(!!r)}}t.SigningKey=a},1097:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.keccak256=t.randomBytes=t.computeHmac=t.UndecodedEventLog=t.EventLog=t.ContractUnknownEventPayload=t.ContractTransactionResponse=t.ContractTransactionReceipt=t.ContractEventPayload=t.ContractFactory=t.Contract=t.BaseContract=t.MessagePrefix=t.EtherSymbol=t.ZeroHash=t.N=t.MaxInt256=t.MinInt256=t.MaxUint256=t.WeiPerEther=t.ZeroAddress=t.resolveAddress=t.isAddress=t.isAddressable=t.getCreate2Address=t.getCreateAddress=t.getIcapAddress=t.getAddress=t.Typed=t.TransactionDescription=t.Result=t.LogDescription=t.Interface=t.Indexed=t.ErrorDescription=t.checkResultErrors=t.StructFragment=t.ParamType=t.NamedFragment=t.FunctionFragment=t.FallbackFragment=t.Fragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.AbiCoder=t.encodeBytes32String=t.decodeBytes32String=t.version=void 0,t.EtherscanPlugin=t.EnsPlugin=t.Network=t.EnsResolver=t.WebSocketProvider=t.SocketProvider=t.IpcSocketProvider=t.QuickNodeProvider=t.PocketProvider=t.InfuraWebSocketProvider=t.InfuraProvider=t.EtherscanProvider=t.CloudflareProvider=t.AnkrProvider=t.AlchemyProvider=t.BrowserProvider=t.JsonRpcSigner=t.JsonRpcProvider=t.JsonRpcApiProvider=t.FallbackProvider=t.AbstractProvider=t.VoidSigner=t.NonceManager=t.AbstractSigner=t.TransactionResponse=t.TransactionReceipt=t.Log=t.FeeData=t.Block=t.getDefaultProvider=t.verifyTypedData=t.TypedDataEncoder=t.solidityPackedSha256=t.solidityPackedKeccak256=t.solidityPacked=t.verifyMessage=t.hashMessage=t.dnsEncode=t.namehash=t.isValidName=t.ensNormalize=t.id=t.SigningKey=t.Signature=t.lock=t.scryptSync=t.scrypt=t.pbkdf2=t.sha512=t.sha256=void 0,t.toBeArray=t.getUint=t.getNumber=t.getBigInt=t.FixedNumber=t.FetchCancelSignal=t.FetchResponse=t.FetchRequest=t.EventPayload=t.isError=t.isCallException=t.makeError=t.assertPrivate=t.assertNormalize=t.assertArgumentCount=t.assertArgument=t.assert=t.resolveProperties=t.defineProperties=t.zeroPadValue=t.zeroPadBytes=t.stripZerosLeft=t.isBytesLike=t.isHexString=t.hexlify=t.getBytesCopy=t.getBytes=t.dataSlice=t.dataLength=t.concat=t.encodeBase64=t.decodeBase64=t.encodeBase58=t.decodeBase58=t.Transaction=t.recoverAddress=t.computeAddress=t.accessListify=t.showThrottleMessage=t.copyRequest=t.UnmanagedSubscriber=t.SocketSubscriber=t.SocketPendingSubscriber=t.SocketEventSubscriber=t.SocketBlockSubscriber=t.MulticoinProviderPlugin=t.NetworkPlugin=t.GasCostPlugin=t.FetchUrlFeeDataNetworkPlugin=t.FeeDataNetworkPlugin=void 0,t.wordlists=t.WordlistOwlA=t.WordlistOwl=t.LangEn=t.Wordlist=t.encryptKeystoreJsonSync=t.encryptKeystoreJson=t.decryptKeystoreJson=t.decryptKeystoreJsonSync=t.decryptCrowdsaleJson=t.isKeystoreJson=t.isCrowdsaleJson=t.getIndexedAccountPath=t.getAccountPath=t.defaultPath=t.Wallet=t.HDNodeVoidWallet=t.HDNodeWallet=t.BaseWallet=t.Mnemonic=t.uuidV4=t.encodeRlp=t.decodeRlp=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.mask=t.toTwos=t.fromTwos=t.toQuantity=t.toNumber=t.toBeHex=t.toBigInt=void 0;var n=r(9406);Object.defineProperty(t,"version",{enumerable:!0,get:function(){return n.version}});var s=r(3707);Object.defineProperty(t,"decodeBytes32String",{enumerable:!0,get:function(){return s.decodeBytes32String}}),Object.defineProperty(t,"encodeBytes32String",{enumerable:!0,get:function(){return s.encodeBytes32String}}),Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return s.AbiCoder}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return s.ConstructorFragment}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return s.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return s.EventFragment}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return s.Fragment}}),Object.defineProperty(t,"FallbackFragment",{enumerable:!0,get:function(){return s.FallbackFragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return s.FunctionFragment}}),Object.defineProperty(t,"NamedFragment",{enumerable:!0,get:function(){return s.NamedFragment}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return s.ParamType}}),Object.defineProperty(t,"StructFragment",{enumerable:!0,get:function(){return s.StructFragment}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return s.checkResultErrors}}),Object.defineProperty(t,"ErrorDescription",{enumerable:!0,get:function(){return s.ErrorDescription}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return s.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return s.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return s.LogDescription}}),Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return s.Result}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return s.TransactionDescription}}),Object.defineProperty(t,"Typed",{enumerable:!0,get:function(){return s.Typed}});var i=r(5475);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return i.getAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return i.getIcapAddress}}),Object.defineProperty(t,"getCreateAddress",{enumerable:!0,get:function(){return i.getCreateAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return i.getCreate2Address}}),Object.defineProperty(t,"isAddressable",{enumerable:!0,get:function(){return i.isAddressable}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return i.isAddress}}),Object.defineProperty(t,"resolveAddress",{enumerable:!0,get:function(){return i.resolveAddress}});var o=r(87);Object.defineProperty(t,"ZeroAddress",{enumerable:!0,get:function(){return o.ZeroAddress}}),Object.defineProperty(t,"WeiPerEther",{enumerable:!0,get:function(){return o.WeiPerEther}}),Object.defineProperty(t,"MaxUint256",{enumerable:!0,get:function(){return o.MaxUint256}}),Object.defineProperty(t,"MinInt256",{enumerable:!0,get:function(){return o.MinInt256}}),Object.defineProperty(t,"MaxInt256",{enumerable:!0,get:function(){return o.MaxInt256}}),Object.defineProperty(t,"N",{enumerable:!0,get:function(){return o.N}}),Object.defineProperty(t,"ZeroHash",{enumerable:!0,get:function(){return o.ZeroHash}}),Object.defineProperty(t,"EtherSymbol",{enumerable:!0,get:function(){return o.EtherSymbol}}),Object.defineProperty(t,"MessagePrefix",{enumerable:!0,get:function(){return o.MessagePrefix}});var a=r(7252);Object.defineProperty(t,"BaseContract",{enumerable:!0,get:function(){return a.BaseContract}}),Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return a.Contract}}),Object.defineProperty(t,"ContractFactory",{enumerable:!0,get:function(){return a.ContractFactory}}),Object.defineProperty(t,"ContractEventPayload",{enumerable:!0,get:function(){return a.ContractEventPayload}}),Object.defineProperty(t,"ContractTransactionReceipt",{enumerable:!0,get:function(){return a.ContractTransactionReceipt}}),Object.defineProperty(t,"ContractTransactionResponse",{enumerable:!0,get:function(){return a.ContractTransactionResponse}}),Object.defineProperty(t,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return a.ContractUnknownEventPayload}}),Object.defineProperty(t,"EventLog",{enumerable:!0,get:function(){return a.EventLog}}),Object.defineProperty(t,"UndecodedEventLog",{enumerable:!0,get:function(){return a.UndecodedEventLog}});var c=r(6965);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return c.computeHmac}}),Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return c.randomBytes}}),Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return c.keccak256}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return c.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return c.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return c.sha512}}),Object.defineProperty(t,"pbkdf2",{enumerable:!0,get:function(){return c.pbkdf2}}),Object.defineProperty(t,"scrypt",{enumerable:!0,get:function(){return c.scrypt}}),Object.defineProperty(t,"scryptSync",{enumerable:!0,get:function(){return c.scryptSync}}),Object.defineProperty(t,"lock",{enumerable:!0,get:function(){return c.lock}}),Object.defineProperty(t,"Signature",{enumerable:!0,get:function(){return c.Signature}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return c.SigningKey}});var u=r(8336);Object.defineProperty(t,"id",{enumerable:!0,get:function(){return u.id}}),Object.defineProperty(t,"ensNormalize",{enumerable:!0,get:function(){return u.ensNormalize}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return u.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return u.namehash}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return u.dnsEncode}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return u.hashMessage}}),Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return u.verifyMessage}}),Object.defineProperty(t,"solidityPacked",{enumerable:!0,get:function(){return u.solidityPacked}}),Object.defineProperty(t,"solidityPackedKeccak256",{enumerable:!0,get:function(){return u.solidityPackedKeccak256}}),Object.defineProperty(t,"solidityPackedSha256",{enumerable:!0,get:function(){return u.solidityPackedSha256}}),Object.defineProperty(t,"TypedDataEncoder",{enumerable:!0,get:function(){return u.TypedDataEncoder}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return u.verifyTypedData}});var l=r(4878);Object.defineProperty(t,"getDefaultProvider",{enumerable:!0,get:function(){return l.getDefaultProvider}}),Object.defineProperty(t,"Block",{enumerable:!0,get:function(){return l.Block}}),Object.defineProperty(t,"FeeData",{enumerable:!0,get:function(){return l.FeeData}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return l.Log}}),Object.defineProperty(t,"TransactionReceipt",{enumerable:!0,get:function(){return l.TransactionReceipt}}),Object.defineProperty(t,"TransactionResponse",{enumerable:!0,get:function(){return l.TransactionResponse}}),Object.defineProperty(t,"AbstractSigner",{enumerable:!0,get:function(){return l.AbstractSigner}}),Object.defineProperty(t,"NonceManager",{enumerable:!0,get:function(){return l.NonceManager}}),Object.defineProperty(t,"VoidSigner",{enumerable:!0,get:function(){return l.VoidSigner}}),Object.defineProperty(t,"AbstractProvider",{enumerable:!0,get:function(){return l.AbstractProvider}}),Object.defineProperty(t,"FallbackProvider",{enumerable:!0,get:function(){return l.FallbackProvider}}),Object.defineProperty(t,"JsonRpcApiProvider",{enumerable:!0,get:function(){return l.JsonRpcApiProvider}}),Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return l.JsonRpcProvider}}),Object.defineProperty(t,"JsonRpcSigner",{enumerable:!0,get:function(){return l.JsonRpcSigner}}),Object.defineProperty(t,"BrowserProvider",{enumerable:!0,get:function(){return l.BrowserProvider}}),Object.defineProperty(t,"AlchemyProvider",{enumerable:!0,get:function(){return l.AlchemyProvider}}),Object.defineProperty(t,"AnkrProvider",{enumerable:!0,get:function(){return l.AnkrProvider}}),Object.defineProperty(t,"CloudflareProvider",{enumerable:!0,get:function(){return l.CloudflareProvider}}),Object.defineProperty(t,"EtherscanProvider",{enumerable:!0,get:function(){return l.EtherscanProvider}}),Object.defineProperty(t,"InfuraProvider",{enumerable:!0,get:function(){return l.InfuraProvider}}),Object.defineProperty(t,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return l.InfuraWebSocketProvider}}),Object.defineProperty(t,"PocketProvider",{enumerable:!0,get:function(){return l.PocketProvider}}),Object.defineProperty(t,"QuickNodeProvider",{enumerable:!0,get:function(){return l.QuickNodeProvider}}),Object.defineProperty(t,"IpcSocketProvider",{enumerable:!0,get:function(){return l.IpcSocketProvider}}),Object.defineProperty(t,"SocketProvider",{enumerable:!0,get:function(){return l.SocketProvider}}),Object.defineProperty(t,"WebSocketProvider",{enumerable:!0,get:function(){return l.WebSocketProvider}}),Object.defineProperty(t,"EnsResolver",{enumerable:!0,get:function(){return l.EnsResolver}}),Object.defineProperty(t,"Network",{enumerable:!0,get:function(){return l.Network}}),Object.defineProperty(t,"EnsPlugin",{enumerable:!0,get:function(){return l.EnsPlugin}}),Object.defineProperty(t,"EtherscanPlugin",{enumerable:!0,get:function(){return l.EtherscanPlugin}}),Object.defineProperty(t,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return l.FeeDataNetworkPlugin}}),Object.defineProperty(t,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return l.FetchUrlFeeDataNetworkPlugin}}),Object.defineProperty(t,"GasCostPlugin",{enumerable:!0,get:function(){return l.GasCostPlugin}}),Object.defineProperty(t,"NetworkPlugin",{enumerable:!0,get:function(){return l.NetworkPlugin}}),Object.defineProperty(t,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return l.MulticoinProviderPlugin}}),Object.defineProperty(t,"SocketBlockSubscriber",{enumerable:!0,get:function(){return l.SocketBlockSubscriber}}),Object.defineProperty(t,"SocketEventSubscriber",{enumerable:!0,get:function(){return l.SocketEventSubscriber}}),Object.defineProperty(t,"SocketPendingSubscriber",{enumerable:!0,get:function(){return l.SocketPendingSubscriber}}),Object.defineProperty(t,"SocketSubscriber",{enumerable:!0,get:function(){return l.SocketSubscriber}}),Object.defineProperty(t,"UnmanagedSubscriber",{enumerable:!0,get:function(){return l.UnmanagedSubscriber}}),Object.defineProperty(t,"copyRequest",{enumerable:!0,get:function(){return l.copyRequest}}),Object.defineProperty(t,"showThrottleMessage",{enumerable:!0,get:function(){return l.showThrottleMessage}});var d=r(2290);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return d.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return d.computeAddress}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return d.recoverAddress}}),Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return d.Transaction}});var h=r(2120);Object.defineProperty(t,"decodeBase58",{enumerable:!0,get:function(){return h.decodeBase58}}),Object.defineProperty(t,"encodeBase58",{enumerable:!0,get:function(){return h.encodeBase58}}),Object.defineProperty(t,"decodeBase64",{enumerable:!0,get:function(){return h.decodeBase64}}),Object.defineProperty(t,"encodeBase64",{enumerable:!0,get:function(){return h.encodeBase64}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return h.concat}}),Object.defineProperty(t,"dataLength",{enumerable:!0,get:function(){return h.dataLength}}),Object.defineProperty(t,"dataSlice",{enumerable:!0,get:function(){return h.dataSlice}}),Object.defineProperty(t,"getBytes",{enumerable:!0,get:function(){return h.getBytes}}),Object.defineProperty(t,"getBytesCopy",{enumerable:!0,get:function(){return h.getBytesCopy}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return h.hexlify}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return h.isHexString}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return h.isBytesLike}}),Object.defineProperty(t,"stripZerosLeft",{enumerable:!0,get:function(){return h.stripZerosLeft}}),Object.defineProperty(t,"zeroPadBytes",{enumerable:!0,get:function(){return h.zeroPadBytes}}),Object.defineProperty(t,"zeroPadValue",{enumerable:!0,get:function(){return h.zeroPadValue}}),Object.defineProperty(t,"defineProperties",{enumerable:!0,get:function(){return h.defineProperties}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return h.resolveProperties}}),Object.defineProperty(t,"assert",{enumerable:!0,get:function(){return h.assert}}),Object.defineProperty(t,"assertArgument",{enumerable:!0,get:function(){return h.assertArgument}}),Object.defineProperty(t,"assertArgumentCount",{enumerable:!0,get:function(){return h.assertArgumentCount}}),Object.defineProperty(t,"assertNormalize",{enumerable:!0,get:function(){return h.assertNormalize}}),Object.defineProperty(t,"assertPrivate",{enumerable:!0,get:function(){return h.assertPrivate}}),Object.defineProperty(t,"makeError",{enumerable:!0,get:function(){return h.makeError}}),Object.defineProperty(t,"isCallException",{enumerable:!0,get:function(){return h.isCallException}}),Object.defineProperty(t,"isError",{enumerable:!0,get:function(){return h.isError}}),Object.defineProperty(t,"EventPayload",{enumerable:!0,get:function(){return h.EventPayload}}),Object.defineProperty(t,"FetchRequest",{enumerable:!0,get:function(){return h.FetchRequest}}),Object.defineProperty(t,"FetchResponse",{enumerable:!0,get:function(){return h.FetchResponse}}),Object.defineProperty(t,"FetchCancelSignal",{enumerable:!0,get:function(){return h.FetchCancelSignal}}),Object.defineProperty(t,"FixedNumber",{enumerable:!0,get:function(){return h.FixedNumber}}),Object.defineProperty(t,"getBigInt",{enumerable:!0,get:function(){return h.getBigInt}}),Object.defineProperty(t,"getNumber",{enumerable:!0,get:function(){return h.getNumber}}),Object.defineProperty(t,"getUint",{enumerable:!0,get:function(){return h.getUint}}),Object.defineProperty(t,"toBeArray",{enumerable:!0,get:function(){return h.toBeArray}}),Object.defineProperty(t,"toBigInt",{enumerable:!0,get:function(){return h.toBigInt}}),Object.defineProperty(t,"toBeHex",{enumerable:!0,get:function(){return h.toBeHex}}),Object.defineProperty(t,"toNumber",{enumerable:!0,get:function(){return h.toNumber}}),Object.defineProperty(t,"toQuantity",{enumerable:!0,get:function(){return h.toQuantity}}),Object.defineProperty(t,"fromTwos",{enumerable:!0,get:function(){return h.fromTwos}}),Object.defineProperty(t,"toTwos",{enumerable:!0,get:function(){return h.toTwos}}),Object.defineProperty(t,"mask",{enumerable:!0,get:function(){return h.mask}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return h.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return h.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return h.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return h.parseUnits}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return h.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return h.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return h.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return h.Utf8ErrorFuncs}}),Object.defineProperty(t,"decodeRlp",{enumerable:!0,get:function(){return h.decodeRlp}}),Object.defineProperty(t,"encodeRlp",{enumerable:!0,get:function(){return h.encodeRlp}}),Object.defineProperty(t,"uuidV4",{enumerable:!0,get:function(){return h.uuidV4}});var f=r(1602);Object.defineProperty(t,"Mnemonic",{enumerable:!0,get:function(){return f.Mnemonic}}),Object.defineProperty(t,"BaseWallet",{enumerable:!0,get:function(){return f.BaseWallet}}),Object.defineProperty(t,"HDNodeWallet",{enumerable:!0,get:function(){return f.HDNodeWallet}}),Object.defineProperty(t,"HDNodeVoidWallet",{enumerable:!0,get:function(){return f.HDNodeVoidWallet}}),Object.defineProperty(t,"Wallet",{enumerable:!0,get:function(){return f.Wallet}}),Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return f.defaultPath}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return f.getAccountPath}}),Object.defineProperty(t,"getIndexedAccountPath",{enumerable:!0,get:function(){return f.getIndexedAccountPath}}),Object.defineProperty(t,"isCrowdsaleJson",{enumerable:!0,get:function(){return f.isCrowdsaleJson}}),Object.defineProperty(t,"isKeystoreJson",{enumerable:!0,get:function(){return f.isKeystoreJson}}),Object.defineProperty(t,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return f.decryptCrowdsaleJson}}),Object.defineProperty(t,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return f.decryptKeystoreJsonSync}}),Object.defineProperty(t,"decryptKeystoreJson",{enumerable:!0,get:function(){return f.decryptKeystoreJson}}),Object.defineProperty(t,"encryptKeystoreJson",{enumerable:!0,get:function(){return f.encryptKeystoreJson}}),Object.defineProperty(t,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return f.encryptKeystoreJsonSync}});var p=r(659);Object.defineProperty(t,"Wordlist",{enumerable:!0,get:function(){return p.Wordlist}}),Object.defineProperty(t,"LangEn",{enumerable:!0,get:function(){return p.LangEn}}),Object.defineProperty(t,"WordlistOwl",{enumerable:!0,get:function(){return p.WordlistOwl}}),Object.defineProperty(t,"WordlistOwlA",{enumerable:!0,get:function(){return p.WordlistOwlA}}),Object.defineProperty(t,"wordlists",{enumerable:!0,get:function(){return p.wordlists}})},2625:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.id=void 0;const n=r(6965),s=r(2120);t.id=function(e){return(0,n.keccak256)((0,s.toUtf8Bytes)(e))}},8336:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyTypedData=t.TypedDataEncoder=t.solidityPackedSha256=t.solidityPackedKeccak256=t.solidityPacked=t.verifyMessage=t.hashMessage=t.dnsEncode=t.namehash=t.isValidName=t.ensNormalize=t.id=void 0;var n=r(2625);Object.defineProperty(t,"id",{enumerable:!0,get:function(){return n.id}});var s=r(5420);Object.defineProperty(t,"ensNormalize",{enumerable:!0,get:function(){return s.ensNormalize}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return s.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return s.namehash}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return s.dnsEncode}});var i=r(8043);Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return i.hashMessage}}),Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return i.verifyMessage}});var o=r(8191);Object.defineProperty(t,"solidityPacked",{enumerable:!0,get:function(){return o.solidityPacked}}),Object.defineProperty(t,"solidityPackedKeccak256",{enumerable:!0,get:function(){return o.solidityPackedKeccak256}}),Object.defineProperty(t,"solidityPackedSha256",{enumerable:!0,get:function(){return o.solidityPackedSha256}});var a=r(8993);Object.defineProperty(t,"TypedDataEncoder",{enumerable:!0,get:function(){return a.TypedDataEncoder}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return a.verifyTypedData}})},8043:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyMessage=t.hashMessage=void 0;const n=r(6965),s=r(87),i=r(2290),o=r(2120);function a(e){return"string"==typeof e&&(e=(0,o.toUtf8Bytes)(e)),(0,n.keccak256)((0,o.concat)([(0,o.toUtf8Bytes)(s.MessagePrefix),(0,o.toUtf8Bytes)(String(e.length)),e]))}t.hashMessage=a,t.verifyMessage=function(e,t){const r=a(e);return(0,i.recoverAddress)(r,t)}},5420:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dnsEncode=t.namehash=t.isValidName=t.ensNormalize=void 0;const n=r(6965),s=r(2120),i=r(30),o=new Uint8Array(32);function a(e){return(0,s.assertArgument)(0!==e.length,"invalid ENS name; empty component","comp",e),e}function c(e){const t=(0,s.toUtf8Bytes)(u(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;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"}},8191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.solidityPackedSha256=t.solidityPackedKeccak256=t.solidityPacked=void 0;const n=r(5475),s=r(6965),i=r(2120),o=new RegExp("^bytes([0-9]+)$"),a=new RegExp("^(u?int)([0-9]*)$"),c=new RegExp("^(.*)\\[([0-9]*)\\]$");function u(e,t,r){switch(e){case"address":return r?(0,i.getBytes)((0,i.zeroPadValue)(t,32)):(0,i.getBytes)((0,n.getAddress)(t));case"string":return(0,i.toUtf8Bytes)(t);case"bytes":return(0,i.getBytes)(t);case"bool":return t=t?"0x01":"0x00",r?(0,i.getBytes)((0,i.zeroPadValue)(t,32)):(0,i.getBytes)(t)}let s=e.match(a);if(s){let n="int"===s[1],o=parseInt(s[2]||"256");return(0,i.assertArgument)((!s[2]||s[2]===String(o))&&o%8==0&&0!==o&&o<=256,"invalid number type","type",e),r&&(o=256),n&&(t=(0,i.toTwos)(t,o)),(0,i.getBytes)((0,i.zeroPadValue)((0,i.toBeArray)(t),o/8))}if(s=e.match(o),s){const n=parseInt(s[1]);return(0,i.assertArgument)(String(n)===s[1]&&0!==n&&n<=32,"invalid bytes type","type",e),(0,i.assertArgument)((0,i.dataLength)(t)===n,`invalid value for ${e}`,"value",t),r?(0,i.getBytes)((0,i.zeroPadBytes)(t,32)):t}if(s=e.match(c),s&&Array.isArray(t)){const r=s[1],n=parseInt(s[2]||String(t.length));(0,i.assertArgument)(n===t.length,`invalid array length for ${e}`,"value",t);const o=[];return t.forEach((function(e){o.push(u(r,e,!0))})),(0,i.getBytes)((0,i.concat)(o))}(0,i.assertArgument)(!1,"invalid type","type",e)}function l(e,t){(0,i.assertArgument)(e.length===t.length,"wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(u(e,t[n]))})),(0,i.hexlify)((0,i.concat)(r))}t.solidityPacked=l,t.solidityPackedKeccak256=function(e,t){return(0,s.keccak256)(l(e,t))},t.solidityPackedSha256=function(e,t){return(0,s.sha256)(l(e,t))}},8993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyTypedData=t.TypedDataEncoder=void 0;const n=r(5475),s=r(6965),i=r(2290),o=r(2120),a=r(2625),c=new Uint8Array(32);c.fill(0);const u=BigInt(-1),l=BigInt(0),d=BigInt(1),h=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),f=(0,o.toBeHex)(d,32),p=(0,o.toBeHex)(l,32),g={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},y=["name","version","chainId","verifyingContract","salt"];function m(e){return function(t){return(0,o.assertArgument)("string"==typeof t,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const b={name:m("name"),version:m("version"),chainId:function(e){const t=(0,o.getBigInt)(e,"domain.chainId");return(0,o.assertArgument)(t>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(t)?Number(t):(0,o.toQuantity)(t)},verifyingContract:function(e){try{return(0,n.getAddress)(e).toLowerCase()}catch(e){}(0,o.assertArgument)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const t=(0,o.getBytes)(e,"domain.salt");return(0,o.assertArgument)(32===t.length,'invalid domain value "salt"',"domain.salt",e),(0,o.hexlify)(t)}};function v(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(0,o.assertArgument)(n%8==0&&0!==n&&n<=256&&(null==t[2]||t[2]===String(n)),"invalid numeric width","type",e);const s=(0,o.mask)(h,r?n-1:n),i=r?(s+d)*u:l;return function(t){const n=(0,o.getBigInt)(t,"value");return(0,o.assertArgument)(n>=i&&n<=s,`value out-of-bounds for ${e}`,"value",n),(0,o.toBeHex)(r?(0,o.toTwos)(n,256):n,32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0,o.assertArgument)(0!==r&&r<=32&&t[1]===String(r),"invalid bytes width","type",e),function(t){const n=(0,o.getBytes)(t);return(0,o.assertArgument)(n.length===r,`invalid length for ${e}`,"value",t),function(e){const t=(0,o.getBytes)(e),r=t.length%32;return r?(0,o.concat)([t,c.slice(r)]):(0,o.hexlify)(t)}(t)}}}switch(e){case"address":return function(e){return(0,o.zeroPadValue)((0,n.getAddress)(e),32)};case"bool":return function(e){return e?f:p};case"bytes":return function(e){return(0,s.keccak256)(e)};case"string":return function(e){return(0,a.id)(e)}}return null}function w(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class A{primaryType;#C;get types(){return JSON.parse(this.#C)}#S;#k;constructor(e){this.#C=JSON.stringify(e),this.#S=new Map,this.#k=new Map;const t=new Map,r=new Map,n=new Map;Object.keys(e).forEach((e=>{t.set(e,new Set),r.set(e,[]),n.set(e,new Set)}));for(const n in e){const s=new Set;for(const i of e[n]){(0,o.assertArgument)(!s.has(i.name),`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(n)}`,"types",e),s.add(i.name);const a=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;(0,o.assertArgument)(a!==n,`circular type reference to ${JSON.stringify(a)}`,"types",e),v(a)||((0,o.assertArgument)(r.has(a),`unknown type ${JSON.stringify(a)}`,"types",e),r.get(a).push(n),t.get(n).add(a))}}const s=Array.from(r.keys()).filter((e=>0===r.get(e).length));(0,o.assertArgument)(0!==s.length,"missing primary type","types",e),(0,o.assertArgument)(1===s.length,`ambiguous primary types or unused types: ${s.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),(0,o.defineProperties)(this,{primaryType:s[0]}),function s(i,a){(0,o.assertArgument)(!a.has(i),`circular type reference to ${JSON.stringify(i)}`,"types",e),a.add(i);for(const e of t.get(i))if(r.has(e)){s(e,a);for(const t of a)n.get(t).add(e)}a.delete(i)}(this.primaryType,new Set);for(const[t,r]of n){const n=Array.from(r);n.sort(),this.#S.set(t,w(t,e[t])+n.map((t=>w(t,e[t]))).join(""))}}getEncoder(e){let t=this.#k.get(e);return t||(t=this.#O(e),this.#k.set(e,t)),t}#O(e){{const t=v(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e);return n=>{(0,o.assertArgument)(!t[3]||parseInt(t[3])===n.length,`array length mismatch; expected length ${parseInt(t[3])}`,"value",n);let i=n.map(r);return this.#S.has(e)&&(i=i.map(s.keccak256)),(0,s.keccak256)((0,o.concat)(i))}}const r=this.types[e];if(r){const t=(0,a.id)(this.#S.get(e));return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this.#S.has(r)?(0,s.keccak256)(n):n}));return n.unshift(t),(0,o.concat)(n)}}(0,o.assertArgument)(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const t=this.#S.get(e);return(0,o.assertArgument)(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,s.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(v(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n)return(0,o.assertArgument)(!n[3]||parseInt(n[3])===t.length,`array length mismatch; expected length ${parseInt(n[3])}`,"value",t),t.map((e=>this._visit(n[1],e,r)));const s=this.types[e];if(s)return s.reduce(((e,{name:n,type:s})=>(e[n]=this._visit(s,t[n],r),e)),{});(0,o.assertArgument)(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new A(e)}static getPrimaryType(e){return A.from(e).primaryType}static hashStruct(e,t,r){return A.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){if(null==e[r])continue;const n=g[r];(0,o.assertArgument)(n,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>y.indexOf(e.name)-y.indexOf(t.name))),A.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return(0,o.concat)(["0x1901",A.hashDomain(e),A.from(t).hash(r)])}static hash(e,t,r){return(0,s.keccak256)(A.encode(e,t,r))}static async resolveNames(e,t,r,n){e=Object.assign({},e);for(const t in e)null==e[t]&&delete e[t];const s={};e.verifyingContract&&!(0,o.isHexString)(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const i=A.from(t);i.visit(r,((e,t)=>("address"!==e||(0,o.isHexString)(t,20)||(s[t]="0x"),t)));for(const e in s)s[e]=await n(e);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),{domain:e,value:r=i.visit(r,((e,t)=>"address"===e&&s[t]?s[t]:t))}}static getPayload(e,t,r){A.hashDomain(e);const n={},s=[];y.forEach((t=>{const r=e[t];null!=r&&(n[t]=b[t](r),s.push({name:t,type:g[t]}))}));const i=A.from(t),a=Object.assign({},t);return(0,o.assertArgument)(null==a.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",t),a.EIP712Domain=s,i.encode(r),{types:a,domain:n,primaryType:i.primaryType,message:i.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return(0,o.hexlify)((0,o.getBytes)(t));if(e.match(/^u?int/))return(0,o.getBigInt)(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return(0,o.assertArgument)("string"==typeof t,"invalid string","value",t),t}(0,o.assertArgument)(!1,"unsupported type","type",e)}))}}}t.TypedDataEncoder=A,t.verifyTypedData=function(e,t,r,n){return(0,i.recoverAddress)(A.hash(e,t,r),n)}},9237:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ethers=void 0;const n=r(8415),s=n.__importStar(r(1097));t.ethers=s,n.__exportStar(r(1097),t)},5142:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractProvider=t.UnmanagedSubscriber=void 0;const n=r(5475),s=r(87),i=r(7252),o=r(8336),a=r(2290),c=r(2120),u=r(4087),l=r(3080),d=r(4837),h=r(7143),f=r(3292),p=BigInt(2);function g(e){return e&&"function"==typeof e.then}function y(e,t){return e+":"+JSON.stringify(t,((e,t)=>{if(null==t)return"null";if("bigint"==typeof t)return`bigint:${t.toString()}`;if("string"==typeof t)return t.toLowerCase();if("object"==typeof t&&!Array.isArray(t)){const e=Object.keys(t);return e.sort(),e.reduce(((e,r)=>(e[r]=t[r],e)),{})}return t}))}class m{name;constructor(e){(0,c.defineProperties)(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function b(e){return(e=Array.from(new Set(e).values())).sort(),e}async function v(e,t){if(null==e)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),"string"==typeof e)switch(e){case"block":case"pending":case"debug":case"error":case"network":return{type:e,tag:e}}if((0,c.isHexString)(e,32)){const t=e.toLowerCase();return{type:"transaction",tag:y("tx",{hash:t}),hash:t}}if(e.orphan){const t=e;return{type:"orphan",tag:y("orphan",t),filter:(r=t,JSON.parse(JSON.stringify(r)))}}var r;if(e.address||e.topics){const r=e,s={topics:(r.topics||[]).map((e=>null==e?null:Array.isArray(e)?b(e.map((e=>e.toLowerCase()))):e.toLowerCase()))};if(r.address){const e=[],i=[],o=r=>{(0,c.isHexString)(r)?e.push(r):i.push((async()=>{e.push(await(0,n.resolveAddress)(r,t))})())};Array.isArray(r.address)?r.address.forEach(o):o(r.address),i.length&&await Promise.all(i),s.address=b(e.map((e=>e.toLowerCase())))}return{filter:s,tag:y("event",s),type:"event"}}(0,c.assertArgument)(!1,"unknown ProviderEvent","event",e)}function w(){return(new Date).getTime()}t.UnmanagedSubscriber=m;const A={cacheTimeout:250,pollingInterval:4e3};function P(e,t){try{const r=E(e,t);if(r)return(0,c.toUtf8String)(r)}catch(e){}return null}function E(e,t){if("0x"===e)return null;try{const r=(0,c.getNumber)((0,c.dataSlice)(e,t,t+32)),n=(0,c.getNumber)((0,c.dataSlice)(e,r,r+32));return(0,c.dataSlice)(e,r+32,r+32+n)}catch(e){}return null}function C(e){const t=(0,c.toBeArray)(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function S(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}t.AbstractProvider=class{#R;#T;#N;#x;#I;#_;#B;#j;#L;#U;#D;#y;constructor(e,t){if(this.#y=Object.assign({},A,t||{}),"any"===e)this.#_=!0,this.#I=null;else if(e){const t=d.Network.from(e);this.#_=!1,this.#I=Promise.resolve(t),setTimeout((()=>{this.emit("network",t,null)}),0)}else this.#_=!1,this.#I=null;this.#j=-1,this.#B=new Map,this.#R=new Map,this.#T=new Map,this.#N=null,this.#x=!1,this.#L=1,this.#U=new Map,this.#D=!1}get pollingInterval(){return this.#y.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#T.values())}attachPlugin(e){if(this.#T.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#T.set(e.name,e.connect(this)),this}getPlugin(e){return this.#T.get(e)||null}get disableCcipRead(){return this.#D}set disableCcipRead(e){this.#D=!!e}async#F(e){const t=this.#y.cacheTimeout;if(t<0)return await this._perform(e);const r=y(e.method,e);let n=this.#B.get(r);return n||(n=this._perform(e),this.#B.set(r,n),setTimeout((()=>{this.#B.get(r)===n&&this.#B.delete(r)}),t)),await n}async ccipReadFetch(e,t,r){if(this.disableCcipRead||0===r.length||null==e.to)return null;const n=e.to.toLowerCase(),s=t.toLowerCase(),i=[];for(let t=0;t=500,`response not found during CCIP fetch: ${l}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:o,errorMessage:l}}),i.push(l)}(0,c.assert)(!1,`error encountered during CCIP fetch: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:i}})}_wrapBlock(e,t){return new h.Block((0,l.formatBlock)(e),this)}_wrapLog(e,t){return new h.Log((0,l.formatLog)(e),this)}_wrapTransactionReceipt(e,t){return new h.TransactionReceipt((0,l.formatTransactionReceipt)(e),this)}_wrapTransactionResponse(e,t){return new h.TransactionResponse((0,l.formatTransactionResponse)(e),this)}_detectNetwork(){(0,c.assert)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){(0,c.assert)(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=(0,c.getNumber)(await this.#F({method:"getBlockNumber"}),"%response");return this.#j>=0&&(this.#j=e),e}_getAddress(e){return(0,n.resolveAddress)(e,this)}_getBlockTag(e){if(null==e)return"latest";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}return(0,c.isHexString)(e)?(0,c.isHexString)(e,32)?e:(0,c.toQuantity)(e):("bigint"==typeof e&&(e=(0,c.getNumber)(e,"blockTag")),"number"==typeof e?e>=0?(0,c.toQuantity)(e):this.#j>=0?(0,c.toQuantity)(this.#j+e):this.getBlockNumber().then((t=>(0,c.toQuantity)(t+e))):void(0,c.assertArgument)(!1,"invalid blockTag","blockTag",e))}_getFilter(e){const t=(e.topics||[]).map((e=>null==e?null:Array.isArray(e)?b(e.map((e=>e.toLowerCase()))):e.toLowerCase())),r="blockHash"in e?e.blockHash:void 0,n=(e,n,s)=>{let i;switch(e.length){case 0:break;case 1:i=e[0];break;default:e.sort(),i=e}if(r&&(null!=n||null!=s))throw new Error("invalid filter");const o={};return i&&(o.address=i),t.length&&(o.topics=t),n&&(o.fromBlock=n),s&&(o.toBlock=s),r&&(o.blockHash=r),o};let s,i,o=[];if(e.address)if(Array.isArray(e.address))for(const t of e.address)o.push(this._getAddress(t));else o.push(this._getAddress(e.address));return"fromBlock"in e&&(s=this._getBlockTag(e.fromBlock)),"toBlock"in e&&(i=this._getBlockTag(e.toBlock)),o.filter((e=>"string"!=typeof e)).length||null!=s&&"string"!=typeof s||null!=i&&"string"!=typeof i?Promise.all([Promise.all(o),s,i]).then((e=>n(e[0],e[1],e[2]))):n(o,s,i)}_getTransactionRequest(e){const t=(0,h.copyRequest)(e),r=[];if(["to","from"].forEach((e=>{if(null==t[e])return;const s=(0,n.resolveAddress)(t[e]);g(s)?r.push(async function(){t[e]=await s}()):t[e]=s})),null!=t.blockTag){const e=this._getBlockTag(t.blockTag);g(e)?r.push(async function(){t.blockTag=await e}()):t.blockTag=e}return r.length?async function(){return await Promise.all(r),t}():t}async getNetwork(){if(null==this.#I){const e=this._detectNetwork().then((e=>(this.emit("network",e,null),e)),(t=>{throw this.#I===e&&(this.#I=null),t}));return this.#I=e,(await e).clone()}const e=this.#I,[t,r]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==r.chainId&&(this.#_?(this.emit("network",r,t),this.#I===e&&(this.#I=Promise.resolve(r))):(0,c.assert)(!1,`network changed: ${t.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:t,gasPrice:r}=await(0,c.resolveProperties)({_block:this.#M("latest",!1),gasPrice:(async()=>{try{const e=await this.#F({method:"getGasPrice"});return(0,c.getBigInt)(e,"%response")}catch(e){}return null})()});let n=null,s=null;const i=this._wrapBlock(t,e);return i&&i.baseFeePerGas&&(s=BigInt("1000000000"),n=i.baseFeePerGas*p+s),new h.FeeData(r,n,s)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const e=new c.FetchRequest(r.url),n=await r.processFunc(t,this,e);return new h.FeeData(n.gasPrice,n.maxFeePerGas,n.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return g(t)&&(t=await t),(0,c.getBigInt)(await this.#F({method:"estimateGas",transaction:t}),"%response")}async#H(e,t,r){(0,c.assert)(r<10,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});const s=(0,h.copyRequest)(e);try{return(0,c.hexlify)(await this._perform({method:"call",transaction:s,blockTag:t}))}catch(e){if(!this.disableCcipRead&&(0,c.isCallException)(e)&&e.data&&r>=0&&"latest"===t&&null!=s.to&&"0x556f1830"===(0,c.dataSlice)(e.data,0,4)){const i=e.data,o=await(0,n.resolveAddress)(s.to,this);let a;try{a=function(e){const t={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};(0,c.assert)((0,c.dataLength)(e)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=(0,c.dataSlice)(e,0,32);(0,c.assert)((0,c.dataSlice)(r,0,12)===(0,c.dataSlice)(R,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),t.sender=(0,c.dataSlice)(r,12);try{const r=[],n=(0,c.getNumber)((0,c.dataSlice)(e,32,64)),s=(0,c.getNumber)((0,c.dataSlice)(e,n,n+32)),i=(0,c.dataSlice)(e,n+32);for(let e=0;et[e])),t}((0,c.dataSlice)(e.data,4))}catch(e){(0,c.assert)(!1,e.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:i}})}(0,c.assert)(a.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:i,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:a.errorArgs}});const u=await this.ccipReadFetch(s,a.calldata,a.urls);(0,c.assert)(null!=u,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:e.data,errorArgs:a.errorArgs}});const l={to:o,data:(0,c.concat)([a.selector,O([u,a.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:l});try{const e=await this.#H(l,t,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},l),result:e}),e}catch(e){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},l),error:e}),e}}throw e}}async#G(e){const{value:t}=await(0,c.resolveProperties)({network:this.getNetwork(),value:e});return t}async call(e){const{tx:t,blockTag:r}=await(0,c.resolveProperties)({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#G(this.#H(t,r,e.enableCcipRead?0:-1))}async#W(e,t,r){let n=this._getAddress(t),s=this._getBlockTag(r);return"string"==typeof n&&"string"==typeof s||([n,s]=await Promise.all([n,s])),await this.#G(this.#F(Object.assign(e,{address:n,blockTag:s})))}async getBalance(e,t){return(0,c.getBigInt)(await this.#W({method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return(0,c.getNumber)(await this.#W({method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return(0,c.hexlify)(await this.#W({method:"getCode"},e,t))}async getStorage(e,t,r){const n=(0,c.getBigInt)(t,"position");return(0,c.hexlify)(await this.#W({method:"getStorage",position:n},e,r))}async broadcastTransaction(e){const{blockNumber:t,hash:r,network:n}=await(0,c.resolveProperties)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=a.Transaction.from(e);if(s.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,n).replaceableTransaction(t)}async#M(e,t){if((0,c.isHexString)(e,32))return await this.#F({method:"getBlock",blockHash:e,includeTransactions:t});let r=this._getBlockTag(e);return"string"!=typeof r&&(r=await r),await this.#F({method:"getBlock",blockTag:r,includeTransactions:t})}async getBlock(e,t){const{network:r,params:n}=await(0,c.resolveProperties)({network:this.getNetwork(),params:this.#M(e,!!t)});return null==n?null:this._wrapBlock(n,r)}async getTransaction(e){const{network:t,params:r}=await(0,c.resolveProperties)({network:this.getNetwork(),params:this.#F({method:"getTransaction",hash:e})});return null==r?null:this._wrapTransactionResponse(r,t)}async getTransactionReceipt(e){const{network:t,params:r}=await(0,c.resolveProperties)({network:this.getNetwork(),params:this.#F({method:"getTransactionReceipt",hash:e})});if(null==r)return null;if(null==r.gasPrice&&null==r.effectiveGasPrice){const t=await this.#F({method:"getTransaction",hash:e});if(null==t)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=t.gasPrice}return this._wrapTransactionReceipt(r,t)}async getTransactionResult(e){const{result:t}=await(0,c.resolveProperties)({network:this.getNetwork(),result:this.#F({method:"getTransactionResult",hash:e})});return null==t?null:(0,c.hexlify)(t)}async getLogs(e){let t=this._getFilter(e);g(t)&&(t=await t);const{network:r,params:n}=await(0,c.resolveProperties)({network:this.getNetwork(),params:this.#F({method:"getLogs",filter:t})});return n.map((e=>this._wrapLog(e,r)))}_getProvider(e){(0,c.assert)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await u.EnsResolver.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){const t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=(0,n.getAddress)(e);const t=(0,o.namehash)(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await u.EnsResolver.getEnsAddress(this),n=new i.Contract(r,["function resolver(bytes32) view returns (address)"],this),o=await n.resolver(t);if(null==o||o===s.ZeroAddress)return null;const a=new i.Contract(o,["function name(bytes32) view returns (string)"],this),c=await a.name(t);return await this.resolveName(c)!==e?null:c}catch(e){if((0,c.isError)(e,"BAD_DATA")&&"0x"===e.value)return null;if((0,c.isError)(e,"CALL_EXCEPTION"))return null;throw e}return null}async waitForTransaction(e,t,r){const n=null!=t?t:1;return 0===n?this.getTransactionReceipt(e):new Promise((async(t,s)=>{let i=null;const o=async r=>{try{const s=await this.getTransactionReceipt(e);if(null!=s&&r-s.blockNumber+1>=n)return t(s),void(i&&(clearTimeout(i),i=null))}catch(e){console.log("EEE",e)}this.once("block",o)};null!=r&&(i=setTimeout((()=>{null!=i&&(i=null,this.off("block",o),s((0,c.makeError)("timeout","TIMEOUT",{reason:"timeout"})))}),r)),o(await this.getBlockNumber())}))}async waitForBlock(e){(0,c.assert)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=this.#U.get(e);t&&(t.timer&&clearTimeout(t.timer),this.#U.delete(e))}_setTimeout(e,t){null==t&&(t=0);const r=this.#L++,n=()=>{this.#U.delete(r),e()};if(this.paused)this.#U.set(r,{timer:null,func:n,time:t});else{const e=setTimeout(n,t);this.#U.set(r,{timer:e,func:n,time:w()})}return r}_forEachSubscriber(e){for(const t of this.#R.values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new m(e.type);case"block":{const e=new f.PollingBlockSubscriber(this);return e.pollingInterval=this.pollingInterval,e}case"event":return new f.PollingEventSubscriber(this,e.filter);case"transaction":return new f.PollingTransactionSubscriber(this,e.hash);case"orphan":return new f.PollingOrphanSubscriber(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(const r of this.#R.values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=t,r.started&&t.start(),null!=this.#N&&t.pause(this.#N);break}}async#z(e,t){let r=await v(e,this);return"event"===r.type&&t&&t.length>0&&!0===t[0].removed&&(r=await v({orphan:"drop-log",log:t[0]},this)),this.#R.get(r.tag)||null}async#K(e){const t=await v(e,this),r=t.tag;let n=this.#R.get(r);return n||(n={subscriber:this._getSubscriber(t),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#R.set(r,n)),n}async on(e,t){const r=await this.#K(e);return r.listeners.push({listener:t,once:!1}),r.started||(r.subscriber.start(),r.started=!0,null!=this.#N&&r.subscriber.pause(this.#N)),this}async once(e,t){const r=await this.#K(e);return r.listeners.push({listener:t,once:!0}),r.started||(r.subscriber.start(),r.started=!0,null!=this.#N&&r.subscriber.pause(this.#N)),this}async emit(e,...t){const r=await this.#z(e,t);if(!r||0===r.listeners.length)return!1;const n=r.listeners.length;return r.listeners=r.listeners.filter((({listener:r,once:n})=>{const s=new c.EventPayload(this,n?null:r,e);try{r.call(this,...t,s)}catch(e){}return!n})),0===r.listeners.length&&(r.started&&r.subscriber.stop(),this.#R.delete(r.tag)),n>0}async listenerCount(e){if(e){const t=await this.#z(e);return t?t.listeners.length:0}let t=0;for(const{listeners:e}of this.#R.values())t+=e.length;return t}async listeners(e){if(e){const t=await this.#z(e);return t?t.listeners.map((({listener:e})=>e)):[]}let t=[];for(const{listeners:e}of this.#R.values())t=t.concat(e.map((({listener:e})=>e)));return t}async off(e,t){const r=await this.#z(e);if(!r)return this;if(t){const e=r.listeners.map((({listener:e})=>e)).indexOf(t);e>=0&&r.listeners.splice(e,1)}return t&&0!==r.listeners.length||(r.started&&r.subscriber.stop(),this.#R.delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:r,subscriber:n}=await this.#K(e);r&&n.stop(),this.#R.delete(t)}else for(const[e,{started:t,subscriber:r}]of this.#R)t&&r.stop(),this.#R.delete(e);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return this.#x}destroy(){this.removeAllListeners();for(const e of this.#U.keys())this._clearTimeout(e);this.#x=!0}get paused(){return null!=this.#N}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#j=-1,null!=this.#N){if(this.#N==!!e)return;(0,c.assert)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber((t=>t.pause(e))),this.#N=!!e;for(const e of this.#U.values())e.timer&&clearTimeout(e.timer),e.time=w()-e.time}resume(){if(null!=this.#N){this._forEachSubscriber((e=>e.resume())),this.#N=null;for(const e of this.#U.values()){let t=e.time;t<0&&(t=0),e.time=w(),setTimeout(e.func,t)}}}};const k=new Uint8Array([]);function O(e){const t=[];let r=0;for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoidSigner=t.AbstractSigner=void 0;const n=r(5475),s=r(2290),i=r(2120),o=r(7143);function a(e,t){if(e.provider)return e.provider;(0,i.assert)(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:t})}async function c(e,t){let r=(0,o.copyRequest)(t);if(null!=r.to&&(r.to=(0,n.resolveAddress)(r.to,e)),null!=r.from){const t=r.from;r.from=Promise.all([e.getAddress(),(0,n.resolveAddress)(t,e)]).then((([e,t])=>((0,i.assertArgument)(e.toLowerCase()===t.toLowerCase(),"transaction from mismatch","tx.from",t),e)))}else r.from=e.getAddress();return await(0,i.resolveProperties)(r)}class u{provider;constructor(e){(0,i.defineProperties)(this,{provider:e||null})}async getNonce(e){return a(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await c(this,e)}async populateTransaction(e){const t=a(this,"populateTransaction"),r=await c(this,e);null==r.nonce&&(r.nonce=await this.getNonce("pending")),null==r.gasLimit&&(r.gasLimit=await this.estimateGas(r));const n=await this.provider.getNetwork();if(null!=r.chainId){const t=(0,i.getBigInt)(r.chainId);(0,i.assertArgument)(t===n.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=n.chainId;const s=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas;if(null==r.gasPrice||2!==r.type&&!s?0!==r.type&&1!==r.type||!s||(0,i.assertArgument)(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e):(0,i.assertArgument)(!1,"eip-1559 transaction do not support gasPrice","tx",e),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas)if(0===r.type||1===r.type){const e=await t.getFeeData();(0,i.assert)(null!=e.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==r.gasPrice&&(r.gasPrice=e.gasPrice)}else{const e=await t.getFeeData();if(null==r.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(r.type=2,null!=r.gasPrice){const e=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=e,r.maxPriorityFeePerGas=e}else null==r.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?((0,i.assert)(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=e.gasPrice),r.type=0):(0,i.assert)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2===r.type&&(null==r.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else r.type=2;return await(0,i.resolveProperties)(r)}async estimateGas(e){return a(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return a(this,"call").call(await this.populateCall(e))}async resolveName(e){const t=a(this,"resolveName");return await t.resolveName(e)}async sendTransaction(e){const t=a(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const n=s.Transaction.from(r);return await t.broadcastTransaction(await this.signTransaction(n))}}t.AbstractSigner=u;class l extends u{address;constructor(e,t){super(t),(0,i.defineProperties)(this,{address:e})}async getAddress(){return this.address}connect(e){return new l(this.address,e)}#J(e,t){(0,i.assert)(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:t})}async signTransaction(e){this.#J("transactions","signTransaction")}async signMessage(e){this.#J("messages","signMessage")}async signTypedData(e,t,r){this.#J("typed-data","signTypedData")}}t.VoidSigner=l},2813:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.showThrottleMessage=void 0;const r=new Set;t.showThrottleMessage=function(e){r.has(e)||(r.add(e),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${e} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}},7994:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultProvider=void 0;const n=r(2120),s=r(6791),i=r(3815),o=r(3377),a=r(2880),c=r(5012),u=r(1333),l=r(4129),d=r(2013),h=r(4837),f=r(2196),p="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");t.getDefaultProvider=function(e,t){null==t&&(t={});const r=e=>"-"!==t[e]&&("string"==typeof t.exclusive?e===t.exclusive:!Array.isArray(t.exclusive)||-1!==t.exclusive.indexOf(e));if("string"==typeof e&&e.match(/^https?:/))return new d.JsonRpcProvider(e);if("string"==typeof e&&e.match(/^wss?:/)||(g=e)&&"function"==typeof g.send&&"function"==typeof g.close)return new f.WebSocketProvider(e);var g;let y=null;try{y=h.Network.from(e)}catch(e){}const m=[];if(r("publicPolygon")&&y&&"matic"===y.name&&m.push(new d.JsonRpcProvider("https://polygon-rpc.com/",y,{staticNetwork:y})),r("alchemy"))try{m.push(new i.AlchemyProvider(e,t.alchemy))}catch(e){}if(r("ankr")&&null!=t.ankr)try{m.push(new s.AnkrProvider(e,t.ankr))}catch(e){}if(r("cloudflare"))try{m.push(new o.CloudflareProvider(e))}catch(e){}if(r("etherscan"))try{m.push(new a.EtherscanProvider(e,t.etherscan))}catch(e){}if(r("infura"))try{let r,n=t.infura;"object"==typeof n&&(r=n.projectSecret,n=n.projectId),m.push(new c.InfuraProvider(e,n,r))}catch(e){}if(r("quicknode"))try{let r=t.quicknode;m.push(new u.QuickNodeProvider(e,r))}catch(e){}if((0,n.assert)(m.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),1===m.length)return m[0];let b=Math.floor(m.length/2);return b>2&&(b=2),y&&-1!==p.indexOf(y.name)&&(b=1),t&&t.quorum&&(b=t.quorum),new l.FallbackProvider(m,void 0,{quorum:b})}},4087:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnsResolver=t.BasicMulticoinProviderPlugin=t.MulticoinProviderPlugin=void 0;const n=r(5475),s=r(87),i=r(7252),o=r(8336),a=r(2120);function c(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):(0,a.assertArgument)(!1,"unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}class u{name;constructor(e){(0,a.defineProperties)(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}t.MulticoinProviderPlugin=u,t.BasicMulticoinProviderPlugin=class extends u{constructor(){super("org.ethers.plugins.provider.BasicMulticoin")}};const l=new RegExp("^(ipfs)://(.*)$","i"),d=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),l,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class h{provider;address;name;#V;#q;constructor(e,t,r){(0,a.defineProperties)(this,{provider:e,address:t,name:r}),this.#V=null,this.#q=new i.Contract(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e)}async supportsWildcard(){return null==this.#V&&(this.#V=(async()=>{try{return await this.#q.supportsInterface("0x9061b923")}catch(e){if((0,a.isError)(e,"CALL_EXCEPTION"))return!1;throw this.#V=null,e}})()),await this.#V}async#Q(e,t){t=(t||[]).slice();const r=this.#q.interface;t.unshift((0,o.namehash)(this.name));let n=null;await this.supportsWildcard()&&(n=r.getFunction(e),(0,a.assert)(n,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[(0,o.dnsEncode)(this.name),r.encodeFunctionData(n,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{const s=await this.#q[e](...t);return n?r.decodeFunctionResult(n,s)[0]:s}catch(e){if(!(0,a.isError)(e,"CALL_EXCEPTION"))throw e}return null}async getAddress(e){if(null==e&&(e=60),60===e)try{const e=await this.#Q("addr(bytes32)");return null==e||e===s.ZeroAddress?null:e}catch(e){if((0,a.isError)(e,"CALL_EXCEPTION"))return null;throw e}if(e>=0&&e<2147483648){let t=e+2147483648;const r=await this.#Q("addr(bytes32,uint)",[t]);if((0,a.isHexString)(r,20))return(0,n.getAddress)(r)}let t=null;for(const r of this.provider.plugins)if(r instanceof u&&r.supportsCoinType(e)){t=r;break}if(null==t)return null;const r=await this.#Q("addr(bytes32,uint)",[e]);if(null==r||"0x"===r)return null;const i=await t.decodeAddress(e,r);if(null!=i)return i;(0,a.assert)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const t=await this.#Q("text(bytes32,string)",[e]);return null==t||"0x"===t?null:t}async getContentHash(){const e=await this.#Q("contenthash(bytes32)");if(null==e||"0x"===e)return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e="e3010170"===t[1]?"ipfs":"ipns",r=parseInt(t[4],16);if(t[5].length===2*r)return`${e}://${(0,a.encodeBase58)("0x"+t[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&64===r[1].length)return`bzz://${r[1]}`;(0,a.assert)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const t=await this.getText("avatar");if(null==t)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatTransactionResponse=t.formatTransactionReceipt=t.formatReceiptLog=t.formatBlock=t.formatLog=t.formatUint256=t.formatHash=t.formatData=t.formatBoolean=t.object=t.arrayOf=t.allowNull=void 0;const n=r(5475),s=r(6965),i=r(2290),o=r(2120),a=BigInt(0);function c(e,t){return function(r){return null==r?t:e(r)}}function u(e){return t=>{if(!Array.isArray(t))throw new Error("not an array");return t.map((t=>e(t)))}}function l(e,t){return r=>{const n={};for(const s in e){let i=s;if(t&&s in t&&!(i in r))for(const e of t[s])if(e in r){i=e;break}try{const t=e[s](r[i]);void 0!==t&&(n[s]=t)}catch(e){const t=e instanceof Error?e.message:"not-an-error";(0,o.assert)(!1,`invalid value for value.${s} (${t})`,"BAD_DATA",{value:r})}}return n}}function d(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}(0,o.assertArgument)(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)}function h(e){return(0,o.assertArgument)((0,o.isHexString)(e,!0),"invalid data","value",e),e}function f(e){return(0,o.assertArgument)((0,o.isHexString)(e,32),"invalid hash","value",e),e}t.allowNull=c,t.arrayOf=u,t.object=l,t.formatBoolean=d,t.formatData=h,t.formatHash=f,t.formatUint256=function(e){if(!(0,o.isHexString)(e))throw new Error("invalid uint256");return(0,o.zeroPadValue)(e,32)};const p=l({address:n.getAddress,blockHash:f,blockNumber:o.getNumber,data:h,index:o.getNumber,removed:c(d,!1),topics:u(f),transactionHash:f,transactionIndex:o.getNumber},{index:["logIndex"]});t.formatLog=function(e){return p(e)};const g=l({hash:c(f),parentHash:f,number:o.getNumber,timestamp:o.getNumber,nonce:c(h),difficulty:o.getBigInt,gasLimit:o.getBigInt,gasUsed:o.getBigInt,miner:c(n.getAddress),extraData:h,baseFeePerGas:c(o.getBigInt)});t.formatBlock=function(e){const t=g(e);return t.transactions=e.transactions.map((e=>"string"==typeof e?e:v(e))),t};const y=l({transactionIndex:o.getNumber,blockNumber:o.getNumber,transactionHash:f,address:n.getAddress,topics:u(f),data:h,index:o.getNumber,blockHash:f},{index:["logIndex"]});function m(e){return y(e)}t.formatReceiptLog=m;const b=l({to:c(n.getAddress,null),from:c(n.getAddress,null),contractAddress:c(n.getAddress,null),index:o.getNumber,root:c(o.hexlify),gasUsed:o.getBigInt,logsBloom:c(h),blockHash:f,hash:f,logs:u(m),blockNumber:o.getNumber,cumulativeGasUsed:o.getBigInt,effectiveGasPrice:c(o.getBigInt),status:c(o.getNumber),type:c(o.getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function v(e){e.to&&(0,o.getBigInt)(e.to)===a&&(e.to="0x0000000000000000000000000000000000000000");const t=l({hash:f,type:e=>"0x"===e||null==e?0:(0,o.getNumber)(e),accessList:c(i.accessListify,null),blockHash:c(f,null),blockNumber:c(o.getNumber,null),transactionIndex:c(o.getNumber,null),from:n.getAddress,gasPrice:c(o.getBigInt),maxPriorityFeePerGas:c(o.getBigInt),maxFeePerGas:c(o.getBigInt),gasLimit:o.getBigInt,to:c(n.getAddress,null),value:o.getBigInt,nonce:o.getNumber,data:h,creates:c(n.getAddress,null),chainId:c(o.getBigInt,null)},{data:["input"],gasLimit:["gas"]})(e);if(null==t.to&&null==t.creates&&(t.creates=(0,n.getCreateAddress)(t)),1!==e.type&&2!==e.type||null!=e.accessList||(t.accessList=[]),e.signature?t.signature=s.Signature.from(e.signature):t.signature=s.Signature.from(e),null==t.chainId){const e=t.signature.legacyChainId;null!=e&&(t.chainId=e)}return t.blockHash&&(0,o.getBigInt)(t.blockHash)===a&&(t.blockHash=null),t}t.formatTransactionReceipt=function(e){return b(e)},t.formatTransactionResponse=v},4878:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SocketEventSubscriber=t.SocketPendingSubscriber=t.SocketBlockSubscriber=t.SocketSubscriber=t.WebSocketProvider=t.SocketProvider=t.IpcSocketProvider=t.QuickNodeProvider=t.PocketProvider=t.InfuraWebSocketProvider=t.InfuraProvider=t.EtherscanPlugin=t.EtherscanProvider=t.CloudflareProvider=t.AnkrProvider=t.AlchemyProvider=t.BrowserProvider=t.JsonRpcSigner=t.JsonRpcProvider=t.JsonRpcApiProvider=t.FallbackProvider=t.copyRequest=t.TransactionResponse=t.TransactionReceipt=t.Log=t.FeeData=t.Block=t.FetchUrlFeeDataNetworkPlugin=t.FeeDataNetworkPlugin=t.EnsPlugin=t.GasCostPlugin=t.NetworkPlugin=t.NonceManager=t.Network=t.MulticoinProviderPlugin=t.EnsResolver=t.getDefaultProvider=t.showThrottleMessage=t.VoidSigner=t.AbstractSigner=t.UnmanagedSubscriber=t.AbstractProvider=void 0;var n=r(5142);Object.defineProperty(t,"AbstractProvider",{enumerable:!0,get:function(){return n.AbstractProvider}}),Object.defineProperty(t,"UnmanagedSubscriber",{enumerable:!0,get:function(){return n.UnmanagedSubscriber}});var s=r(5649);Object.defineProperty(t,"AbstractSigner",{enumerable:!0,get:function(){return s.AbstractSigner}}),Object.defineProperty(t,"VoidSigner",{enumerable:!0,get:function(){return s.VoidSigner}});var i=r(2813);Object.defineProperty(t,"showThrottleMessage",{enumerable:!0,get:function(){return i.showThrottleMessage}});var o=r(7994);Object.defineProperty(t,"getDefaultProvider",{enumerable:!0,get:function(){return o.getDefaultProvider}});var a=r(4087);Object.defineProperty(t,"EnsResolver",{enumerable:!0,get:function(){return a.EnsResolver}}),Object.defineProperty(t,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return a.MulticoinProviderPlugin}});var c=r(4837);Object.defineProperty(t,"Network",{enumerable:!0,get:function(){return c.Network}});var u=r(2992);Object.defineProperty(t,"NonceManager",{enumerable:!0,get:function(){return u.NonceManager}});var l=r(7004);Object.defineProperty(t,"NetworkPlugin",{enumerable:!0,get:function(){return l.NetworkPlugin}}),Object.defineProperty(t,"GasCostPlugin",{enumerable:!0,get:function(){return l.GasCostPlugin}}),Object.defineProperty(t,"EnsPlugin",{enumerable:!0,get:function(){return l.EnsPlugin}}),Object.defineProperty(t,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return l.FeeDataNetworkPlugin}}),Object.defineProperty(t,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return l.FetchUrlFeeDataNetworkPlugin}});var d=r(7143);Object.defineProperty(t,"Block",{enumerable:!0,get:function(){return d.Block}}),Object.defineProperty(t,"FeeData",{enumerable:!0,get:function(){return d.FeeData}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return d.Log}}),Object.defineProperty(t,"TransactionReceipt",{enumerable:!0,get:function(){return d.TransactionReceipt}}),Object.defineProperty(t,"TransactionResponse",{enumerable:!0,get:function(){return d.TransactionResponse}}),Object.defineProperty(t,"copyRequest",{enumerable:!0,get:function(){return d.copyRequest}});var h=r(4129);Object.defineProperty(t,"FallbackProvider",{enumerable:!0,get:function(){return h.FallbackProvider}});var f=r(2013);Object.defineProperty(t,"JsonRpcApiProvider",{enumerable:!0,get:function(){return f.JsonRpcApiProvider}}),Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return f.JsonRpcProvider}}),Object.defineProperty(t,"JsonRpcSigner",{enumerable:!0,get:function(){return f.JsonRpcSigner}});var p=r(292);Object.defineProperty(t,"BrowserProvider",{enumerable:!0,get:function(){return p.BrowserProvider}});var g=r(3815);Object.defineProperty(t,"AlchemyProvider",{enumerable:!0,get:function(){return g.AlchemyProvider}});var y=r(6791);Object.defineProperty(t,"AnkrProvider",{enumerable:!0,get:function(){return y.AnkrProvider}});var m=r(3377);Object.defineProperty(t,"CloudflareProvider",{enumerable:!0,get:function(){return m.CloudflareProvider}});var b=r(2880);Object.defineProperty(t,"EtherscanProvider",{enumerable:!0,get:function(){return b.EtherscanProvider}}),Object.defineProperty(t,"EtherscanPlugin",{enumerable:!0,get:function(){return b.EtherscanPlugin}});var v=r(5012);Object.defineProperty(t,"InfuraProvider",{enumerable:!0,get:function(){return v.InfuraProvider}}),Object.defineProperty(t,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return v.InfuraWebSocketProvider}});var w=r(2751);Object.defineProperty(t,"PocketProvider",{enumerable:!0,get:function(){return w.PocketProvider}});var A=r(1333);Object.defineProperty(t,"QuickNodeProvider",{enumerable:!0,get:function(){return A.QuickNodeProvider}});const P=r(8306);Object.defineProperty(t,"IpcSocketProvider",{enumerable:!0,get:function(){return P.IpcSocketProvider}});var E=r(2394);Object.defineProperty(t,"SocketProvider",{enumerable:!0,get:function(){return E.SocketProvider}});var C=r(2196);Object.defineProperty(t,"WebSocketProvider",{enumerable:!0,get:function(){return C.WebSocketProvider}});var S=r(2394);Object.defineProperty(t,"SocketSubscriber",{enumerable:!0,get:function(){return S.SocketSubscriber}}),Object.defineProperty(t,"SocketBlockSubscriber",{enumerable:!0,get:function(){return S.SocketBlockSubscriber}}),Object.defineProperty(t,"SocketPendingSubscriber",{enumerable:!0,get:function(){return S.SocketPendingSubscriber}}),Object.defineProperty(t,"SocketEventSubscriber",{enumerable:!0,get:function(){return S.SocketEventSubscriber}})},4837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Network=void 0;const n=r(2290),s=r(2120),i=r(7004),o=new Map;class a{#Z;#$;#T;constructor(e,t){this.#Z=e,this.#$=(0,s.getBigInt)(t),this.#T=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#Z}set name(e){this.#Z=e}get chainId(){return this.#$}set chainId(e){this.#$=(0,s.getBigInt)(e,"chainId")}matches(e){if(null==e)return!1;if("string"==typeof e){try{return this.chainId===(0,s.getBigInt)(e)}catch(e){}return this.name===e}if("number"==typeof e||"bigint"==typeof e){try{return this.chainId===(0,s.getBigInt)(e)}catch(e){}return!1}if("object"==typeof e){if(null!=e.chainId){try{return this.chainId===(0,s.getBigInt)(e.chainId)}catch(e){}return!1}return null!=e.name&&this.name===e.name}return!1}get plugins(){return Array.from(this.#T.values())}attachPlugin(e){if(this.#T.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#T.set(e.name,e.clone()),this}getPlugin(e){return this.#T.get(e)||null}getPlugins(e){return this.plugins.filter((t=>t.name.split("#")[0]===e))}clone(){const e=new a(this.name,this.chainId);return this.plugins.forEach((t=>{e.attachPlugin(t.clone())})),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new i.GasCostPlugin;let r=t.txBase;if(null==e.to&&(r+=t.txCreate),e.data)for(let n=2;n{const s=await t();if(null==s.maxFeePerGas||null==s.maxPriorityFeePerGas)return s;const i=s.maxFeePerGas-s.maxPriorityFeePerGas;return{gasPrice:s.gasPrice,maxFeePerGas:i+e,maxPriorityFeePerGas:e}})))]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1}));function t(e,t,r){const n=function(){const n=new a(e,t);return null!=r.ensNetwork&&n.attachPlugin(new i.EnsPlugin(null,r.ensNetwork)),n.attachPlugin(new i.GasCostPlugin),(r.plugins||[]).forEach((e=>{n.attachPlugin(e)})),n};a.register(e,n),a.register(t,n),r.altNames&&r.altNames.forEach((e=>{a.register(e,n)}))}}(),null==e)return a.from("mainnet");if("number"==typeof e&&(e=BigInt(e)),"string"==typeof e||"bigint"==typeof e){const t=o.get(e);if(t)return t();if("bigint"==typeof e)return new a("unknown",e);(0,s.assertArgument)(!1,"unknown network","network",e)}if("function"==typeof e.clone)return e.clone();if("object"==typeof e){(0,s.assertArgument)("string"==typeof e.name&&"number"==typeof e.chainId,"invalid network object name or chainId","network",e);const t=new a(e.name,e.chainId);return(e.ensAddress||null!=e.ensNetwork)&&t.attachPlugin(new i.EnsPlugin(e.ensAddress,e.ensNetwork)),t}(0,s.assertArgument)(!1,"invalid network","network",e)}static register(e,t){"number"==typeof e&&(e=BigInt(e));const r=o.get(e);r&&(0,s.assertArgument)(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",e),o.set(e,t)}}function c(e,t){const r=String(e);if(!r.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${e}`);const n=r.split(".");if(1===n.length&&n.push(""),2!==n.length)throw new Error(`invalid gwei value: ${e}`);for(;n[1].length9){let e=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||e++,n[1]=e.toString()}return BigInt(n[0]+n[1])}function u(e){return new i.FetchUrlFeeDataNetworkPlugin(e,(async(e,t,r)=>{let n;r.setHeader("User-Agent","ethers");try{n=await r.send();const e=n.bodyJson.standard;return{maxFeePerGas:c(e.maxFee,9),maxPriorityFeePerGas:c(e.maxPriorityFee,9)}}catch(e){(0,s.assert)(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:n,error:e})}}))}t.Network=a;let l=!1},7004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FetchUrlFeeDataNetworkPlugin=t.FeeDataNetworkPlugin=t.EnsPlugin=t.GasCostPlugin=t.NetworkPlugin=void 0;const n=r(9290),s=r(2120);class i{name;constructor(e){(0,n.defineProperties)(this,{name:e})}clone(){return new i(this.name)}}t.NetworkPlugin=i;class o extends i{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,t){null==e&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const r={effectiveBlock:e};function i(e,n){let i=(t||{})[e];null==i&&(i=n),(0,s.assertArgument)("number"==typeof i,`invalud value for ${e}`,"costs",t),r[e]=i}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),(0,n.defineProperties)(this,r)}clone(){return new o(this.effectiveBlock,this)}}t.GasCostPlugin=o;class a extends i{address;targetNetwork;constructor(e,t){super("org.ethers.plugins.network.Ens"),(0,n.defineProperties)(this,{address:e||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==t?1:t})}clone(){return new a(this.address,this.targetNetwork)}}t.EnsPlugin=a;class c extends i{#X;get feeDataFunc(){return this.#X}constructor(e){super("org.ethers.plugins.network.FeeData"),this.#X=e}async getFeeData(e){return await this.#X(e)}clone(){return new c(this.#X)}}t.FeeDataNetworkPlugin=c,t.FetchUrlFeeDataNetworkPlugin=class extends i{#ee;#te;get url(){return this.#ee}get processFunc(){return this.#te}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#ee=e,this.#te=t}clone(){return this}}},3815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlchemyProvider=void 0;const n=r(2120),s=r(2813),i=r(4837),o=r(2013),a="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class c extends o.JsonRpcProvider{apiKey;constructor(e,t){null==e&&(e="mainnet");const r=i.Network.from(e);null==t&&(t=a),super(c.getRequest(r,t),r,{staticNetwork:r}),(0,n.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new c(e,this.apiKey)}catch(e){}return super._getProvider(e)}async _perform(e){if("getTransactionResult"===e.method){const{trace:t,tx:r}=await(0,n.resolveProperties)({trace:this.send("trace_transaction",[e.hash]),tx:this.getTransaction(e.hash)});if(null==t||null==r)return null;let s,i=!1;try{s=t[0].result.output,i="Reverted"===t[0].error}catch(e){}if(s)return(0,n.assert)(!i,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:s,reason:null,transaction:r,invocation:null,revert:null}),s;(0,n.assert)(!1,"could not parse trace result","BAD_DATA",{value:t})}return await super._perform(e)}isCommunityResource(){return this.apiKey===a}static getRequest(e,t){null==t&&(t=a);const r=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/v2/${t}`);return r.allowGzip=!0,t===a&&(r.retryFunc=async(e,t,r)=>((0,s.showThrottleMessage)("alchemy"),!0)),r}}t.AlchemyProvider=c},6791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnkrProvider=void 0;const n=r(2120),s=r(2813),i=r(4837),o=r(2013),a="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";class c extends o.JsonRpcProvider{apiKey;constructor(e,t){null==e&&(e="mainnet");const r=i.Network.from(e);null==t&&(t=a);const s={polling:!0,staticNetwork:r};super(c.getRequest(r,t),r,s),(0,n.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new c(e,this.apiKey)}catch(e){}return super._getProvider(e)}static getRequest(e,t){null==t&&(t=a);const r=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"matic":return"rpc.ankr.com/polygon";case"arbitrum":return"rpc.ankr.com/arbitrum"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/${t}`);return r.allowGzip=!0,t===a&&(r.retryFunc=async(e,t,r)=>((0,s.showThrottleMessage)("AnkrProvider"),!0)),r}getRpcError(e,t){return"eth_sendRawTransaction"===e.method&&t&&t.error&&"INTERNAL_ERROR: could not replace existing tx"===t.error.message&&(t.error.message="replacement transaction underpriced"),super.getRpcError(e,t)}isCommunityResource(){return this.apiKey===a}}t.AnkrProvider=c},292:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserProvider=void 0;const n=r(2120),s=r(2013);class i extends s.JsonRpcApiPollingProvider{#re;constructor(e,t){super(t,{batchMaxCount:1}),this.#re=async(t,r)=>{const n={method:t,params:r};this.emit("debug",{action:"sendEip1193Request",payload:n});try{const t=await e.request(n);return this.emit("debug",{action:"receiveEip1193Result",result:t}),t}catch(e){const t=new Error(e.message);throw t.code=e.code,t.data=e.data,t.payload=n,this.emit("debug",{action:"receiveEip1193Error",error:t}),t}}}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){(0,n.assertArgument)(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{const t=await this.#re(e.method,e.params||[]);return[{id:e.id,result:t}]}catch(t){return[{id:e.id,error:{code:t.code,data:t.data,message:t.message}}]}}getRpcError(e,t){switch((t=JSON.parse(JSON.stringify(t))).error.code||-1){case 4001:t.error.message=`ethers-user-denied: ${t.error.message}`;break;case 4200:t.error.message=`ethers-unsupported: ${t.error.message}`}return super.getRpcError(e,t)}async hasSigner(e){null==e&&(e=0);const t=await this.send("eth_accounts",[]);return"number"==typeof e?t.length>e:(e=e.toLowerCase(),0!==t.filter((t=>t.toLowerCase()===e)).length)}async getSigner(e){if(null==e&&(e=0),!await this.hasSigner(e))try{await this.#re("eth_requestAccounts",[])}catch(e){const t=e.payload;throw this.getRpcError(t,{id:t.id,error:e})}return await super.getSigner(e)}}t.BrowserProvider=i},3377:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CloudflareProvider=void 0;const n=r(2120),s=r(4837),i=r(2013);class o extends i.JsonRpcProvider{constructor(e){null==e&&(e="mainnet");const t=s.Network.from(e);(0,n.assertArgument)("mainnet"===t.name,"unsupported network","network",e),super("https://cloudflare-eth.com/",t,{staticNetwork:t})}}t.CloudflareProvider=o},2880:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EtherscanProvider=t.EtherscanPlugin=void 0;const n=r(3707),s=r(7252),i=r(2290),o=r(2120),a=r(5142),c=r(4837),u=r(7004),l=r(2813),d="org.ethers.plugins.provider.Etherscan";class h extends u.NetworkPlugin{baseUrl;constructor(e){super(d),(0,o.defineProperties)(this,{baseUrl:e})}clone(){return new h(this.baseUrl)}}t.EtherscanPlugin=h;const f=["enableCcipRead"];let p=1;class g extends a.AbstractProvider{network;apiKey;#ne;constructor(e,t){const r=null!=t?t:null;super();const n=c.Network.from(e);this.#ne=n.getPlugin(d),(0,o.defineProperties)(this,{apiKey:r,network:n}),this.getBaseUrl()}getBaseUrl(){if(this.#ne)return this.#ne.baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"matic":return"https://api.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io";case"bnb":return"http://api.bscscan.com";case"bnbt":return"http://api-testnet.bscscan.com"}(0,o.assertArgument)(!1,"unsupported network","network",this.network)}getUrl(e,t){const r=Object.keys(t).reduce(((e,r)=>{const n=t[r];return null!=n&&(e+=`&${r}=${n}`),e}),""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${e}${r}${n}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}async detectNetwork(){return this.network}async fetch(e,t,r){const n=p++,s=r?this.getPostUrl():this.getUrl(e,t),i=r?this.getPostData(e,t):null;this.emit("debug",{action:"sendRequest",id:n,url:s,payload:i});const a=new o.FetchRequest(s);a.setThrottleParams({slotInterval:1e3}),a.retryFunc=(e,t,r)=>(this.isCommunityResource()&&(0,l.showThrottleMessage)("Etherscan"),Promise.resolve(!0)),a.processFunc=async(t,r)=>{const s=r.hasBody()?JSON.parse((0,o.toUtf8String)(r.body)):{},i=("string"==typeof s.result?s.result:"").toLowerCase().indexOf("rate limit")>=0;return"proxy"===e?s&&0==s.status&&"NOTOK"==s.message&&i&&(this.emit("debug",{action:"receiveError",id:n,reason:"proxy-NOTOK",error:s}),r.throwThrottleError(s.result,2e3)):i&&(this.emit("debug",{action:"receiveError",id:n,reason:"null result",error:s.result}),r.throwThrottleError(s.result,2e3)),r},i&&(a.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),a.body=Object.keys(i).map((e=>`${e}=${i[e]}`)).join("&"));const c=await a.send();try{c.assertOk()}catch(e){this.emit("debug",{action:"receiveError",id:n,error:e,reason:"assertOk"}),(0,o.assert)(!1,"response error","SERVER_ERROR",{request:a,response:c})}c.hasBody()||(this.emit("debug",{action:"receiveError",id:n,error:"missing body",reason:"null body"}),(0,o.assert)(!1,"missing response","SERVER_ERROR",{request:a,response:c}));const u=JSON.parse((0,o.toUtf8String)(c.body));return"proxy"===e?("2.0"!=u.jsonrpc&&(this.emit("debug",{action:"receiveError",id:n,result:u,reason:"invalid JSON-RPC"}),(0,o.assert)(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:a,response:c,info:{result:u}})),u.error&&(this.emit("debug",{action:"receiveError",id:n,result:u,reason:"JSON-RPC error"}),(0,o.assert)(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:n,result:u}),u.result):0!=u.status||"No records found"!==u.message&&"No transactions found"!==u.message?((1!=u.status||"string"==typeof u.message&&!u.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:n,result:u}),(0,o.assert)(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:n,result:u}),u.result):(this.emit("debug",{action:"receiveRequest",id:n,result:u}),u.result)}_getTransactionPostData(e){const t={};for(let r in e){if(f.indexOf(r)>=0)continue;if(null==e[r])continue;let n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?(0,o.toQuantity)(n):"accessList"===r?"["+(0,i.accessListify)(n).map((e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`)).join(",")+"]":(0,o.hexlify)(n),t[r]=n)}return t}_checkError(e,t,r){let s="";if((0,o.isError)(t,"SERVER_ERROR")){try{s=t.info.result.error.message}catch(e){}if(!s)try{s=t.info.message}catch(e){}}if("estimateGas"===e.method&&!s.match(/revert/i)&&s.match(/insufficient funds/i)&&(0,o.assert)(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.transaction}),("call"===e.method||"estimateGas"===e.method)&&s.match(/execution reverted/i)){let r="";try{r=t.info.result.error.data}catch(t){}const s=n.AbiCoder.getBuiltinCallException(e.method,e.transaction,r);throw s.info={request:e,error:t},s}if(s&&"broadcastTransaction"===e.method){const t=i.Transaction.from(e.signedTransaction);s.match(/replacement/i)&&s.match(/underpriced/i)&&(0,o.assert)(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:t}),s.match(/insufficient funds/)&&(0,o.assert)(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:t}),s.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&(0,o.assert)(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:t})}throw t}async _detectNetwork(){return this.network}async _perform(e){switch(e.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch((t=>this._checkError(e,t,e.signedTransaction)));case"getBlock":if("blockTag"in e)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});(0,o.assert)(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.hash});case"call":{if("latest"!==e.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_call";try{return await this.fetch("proxy",t,!0)}catch(t){return this._checkError(e,t,e.transaction)}}case"estimateGas":{const t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_estimateGas";try{return await this.fetch("proxy",t,!0)}catch(t){return this._checkError(e,t,e.transaction)}}}return super._perform(e)}async getNetwork(){return this.network}async getEtherPrice(){return"mainnet"!==this.network.name?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(e){let t=this._getAddress(e);var r;(r=t)&&"function"==typeof r.then&&(t=await t);try{const e=await this.fetch("contract",{action:"getabi",address:t}),r=JSON.parse(e);return new s.Contract(t,r,this)}catch(e){return null}}isCommunityResource(){return null==this.apiKey}}t.EtherscanProvider=g},4129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FallbackProvider=void 0;const n=r(2120),s=r(5142),i=r(4837),o=BigInt("1"),a=BigInt("2");function c(){return(new Date).getTime()}function u(e){return JSON.stringify(e,((e,t)=>"bigint"==typeof t?{type:"bigint",value:t.toString()}:t))}const l={stallTimeout:400,priority:1,weight:1},d={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};function h(e){if(null==e)return"null";if(Array.isArray(e))return"["+e.map(h).join(",")+"]";if("object"==typeof e&&"function"==typeof e.toJSON)return h(e.toJSON());switch(typeof e){case"boolean":case"symbol":return e.toString();case"bigint":case"number":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const t=Object.keys(e);return t.sort(),"{"+t.map((t=>`${JSON.stringify(t)}:${h(e[t])}`)).join(",")+"}"}}throw console.log("Could not serialize",e),new Error("Hmm...")}function f(e){if("error"in e){const t=e.error;return{tag:h(t),value:t}}const t=e.result;return{tag:h(t),value:t}}function p(e,t){const r=new Map;for(const{value:e,tag:n,weight:s}of t){const t=r.get(n)||{value:e,weight:0};t.weight+=s,r.set(n,t)}let n=null;for(const t of r.values())t.weight>=e&&(!n||t.weight>n.weight)&&(n=t);if(n)return n.value}function g(e,t){let r=0;const n=new Map;let s=null;const i=[];for(const{value:e,tag:o,weight:a}of t)if(e instanceof Error){const t=n.get(o)||{value:e,weight:0};t.weight+=a,n.set(o,t),(null==s||t.weight>s.weight)&&(s=t)}else i.push(BigInt(e)),r+=a;if(r=e?s.value:void 0;i.sort(((e,t)=>ee?1:0));const c=Math.floor(i.length/2);return i.length%2?i[c]:(i[c-1]+i[c]+o)/a}function y(e,t){const r=p(e,t);if(void 0!==r)return r;for(const e of t)if(e.value)return e.value}class m extends s.AbstractProvider{quorum;eventQuorum;eventWorkers;#se;#ie;#oe;constructor(e,t,r){super(t,r),this.#se=e.map((e=>e instanceof s.AbstractProvider?Object.assign({provider:e},l,d):Object.assign({},l,e,d))),this.#ie=-2,this.#oe=null,r&&null!=r.quorum?this.quorum=r.quorum:this.quorum=Math.ceil(this.#se.reduce(((e,t)=>e+t.weight),0)/2),this.eventQuorum=1,this.eventWorkers=1,(0,n.assertArgument)(this.quorum<=this.#se.reduce(((e,t)=>e+t.weight),0),"quorum exceed provider wieght","quorum",this.quorum)}get providerConfigs(){return this.#se.map((e=>{const t=Object.assign({},e);for(const e in t)"_"===e[0]&&delete t[e];return t}))}async _detectNetwork(){return i.Network.from((0,n.getBigInt)(await this._perform({method:"chainId"})))}async _translatePerform(e,t){switch(t.method){case"broadcastTransaction":return await e.broadcastTransaction(t.signedTransaction);case"call":return await e.call(Object.assign({},t.transaction,{blockTag:t.blockTag}));case"chainId":return(await e.getNetwork()).chainId;case"estimateGas":return await e.estimateGas(t.transaction);case"getBalance":return await e.getBalance(t.address,t.blockTag);case"getBlock":{const r="blockHash"in t?t.blockHash:t.blockTag;return await e.getBlock(r,t.includeTransactions)}case"getBlockNumber":return await e.getBlockNumber();case"getCode":return await e.getCode(t.address,t.blockTag);case"getGasPrice":return(await e.getFeeData()).gasPrice;case"getLogs":return await e.getLogs(t.filter);case"getStorage":return await e.getStorage(t.address,t.position,t.blockTag);case"getTransaction":return await e.getTransaction(t.hash);case"getTransactionCount":return await e.getTransactionCount(t.address,t.blockTag);case"getTransactionReceipt":return await e.getTransactionReceipt(t.hash);case"getTransactionResult":return await e.getTransactionResult(t.hash)}}#ae(e){const t=Array.from(e).map((e=>e.config)),r=this.#se.slice();!function(e){for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}}(r),r.sort(((e,t)=>e.priority-t.priority));for(const e of r)if(!e._lastFatalError&&-1===t.indexOf(e))return e;return null}#ce(e,t){const r=this.#ae(e);if(null==r)return null;const n={config:r,result:null,didBump:!1,perform:null,staller:null},s=c();return n.perform=(async()=>{try{r.requests++;const e=await this._translatePerform(r.provider,t);n.result={result:e}}catch(e){r.errorResponses++,n.result={error:e}}const e=c()-s;r._totalTime+=e,r.rollingDuration=.95*r.rollingDuration+.05*e,n.perform=null})(),n.staller=(async()=>{var e;await(e=r.stallTimeout,new Promise((t=>{setTimeout(t,e)}))),n.staller=null})(),e.add(n),n}async#ue(){let e=this.#oe;if(!e){const t=[];this.#se.forEach((e=>{t.push((async()=>{await async function(e,t){for(;(e.blockNumber<0||e.blockNumber<0)&&(e._updateNumber||(e._updateNumber=(async()=>{try{const t=await e.provider.getBlockNumber();t>e.blockNumber&&(e.blockNumber=t)}catch(t){e.blockNumber=-2,e._lastFatalError=t,e._lastFatalErrorTimestamp=c()}e._updateNumber=null})()),await e._updateNumber,e.outOfSync++,!e._lastFatalError););}(e),e._lastFatalError||(e._network=await e.provider.getNetwork())})())})),this.#oe=e=(async()=>{await Promise.all(t);let e=null;for(const t of this.#se){if(t._lastFatalError)continue;const r=t._network;null==e?e=r.chainId:r.chainId!==e&&(0,n.assert)(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})()}await e}async#le(e,t){const r=[];for(const t of e)if(null!=t.result){const{tag:e,value:n}=f(t.result);r.push({tag:e,value:n,weight:t.config.weight})}if(!(r.reduce(((e,t)=>e+t.weight),0)!e._lastFatalError)).map((e=>({value:e.blockNumber,tag:(0,n.getNumber)(e.blockNumber).toString(),weight:e.weight})))))));const e=function(e,t){if(1===e)return(0,n.getNumber)(g(e,t),"%internal");const r=new Map,s=(e,t)=>{const n=r.get(e)||{result:e,weight:0};n.weight+=t,r.set(e,n)};for(const{weight:e,value:r}of t){const t=(0,n.getNumber)(r);s(t-1,e),s(t,e),s(t+1,e)}let i,o=0;for(const{weight:t,result:n}of r.values())t>=e&&(t>o||null!=i&&t===o&&n>i)&&(o=t,i=n);return i}(this.quorum,r);if(void 0===e)return;return e>this.#ie&&(this.#ie=e),this.#ie}case"getGasPrice":case"estimateGas":return g(this.quorum,r);case"getBlock":return"blockTag"in t&&"pending"===t.blockTag?y(this.quorum,r):p(this.quorum,r);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return p(this.quorum,r);case"broadcastTransaction":return y(this.quorum,r)}(0,n.assert)(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${u(t.method)})`})}}async#de(e,t){if(0===e.size)throw new Error("no runners?!");const r=[];let s=0;for(const t of e)t.perform&&r.push(t.perform),t.staller?r.push(t.staller):t.didBump||(t.didBump=!0,s++);const i=await this.#le(e,t);if(void 0!==i){if(i instanceof Error)throw i;return i}for(let r=0;r0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:t,results:Array.from(e).map((e=>u(e.result)))}}),await Promise.race(r),await this.#de(e,t)}async _perform(e){if("broadcastTransaction"===e.method){const t=await Promise.all(this.#se.map((async({provider:t,weight:r})=>{try{const n=await t._perform(e);return Object.assign(f({result:n}),{weight:r})}catch(e){return Object.assign(f({error:e}),{weight:r})}}))),r=y(this.quorum,t);if((0,n.assert)(void 0!==r,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:e,results:t.map(u)}}),r instanceof Error)throw r;return r}await this.#ue();const t=new Set;for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfuraProvider=t.InfuraWebSocketProvider=void 0;const n=r(2120),s=r(2813),i=r(4837),o=r(2013),a=r(2196),c="84842078b09946638c03157f83405213";class u extends a.WebSocketProvider{projectId;projectSecret;constructor(e,t){const r=new l(e,t),s=r._getConnection();(0,n.assert)(!s.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"}),super(s.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),e),(0,n.defineProperties)(this,{projectId:r.projectId,projectSecret:r.projectSecret})}isCommunityResource(){return this.projectId===c}}t.InfuraWebSocketProvider=u;class l extends o.JsonRpcProvider{projectId;projectSecret;constructor(e,t,r){null==e&&(e="mainnet");const s=i.Network.from(e);null==t&&(t=c),null==r&&(r=null),super(l.getRequest(s,t,r),s,{staticNetwork:s}),(0,n.defineProperties)(this,{projectId:t,projectSecret:r})}_getProvider(e){try{return new l(e,this.projectId,this.projectSecret)}catch(e){}return super._getProvider(e)}isCommunityResource(){return this.projectId===c}static getWebSocketProvider(e,t){return new u(e,t)}static getRequest(e,t,r){null==t&&(t=c),null==r&&(r=null);const i=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/v3/${t}`);return i.allowGzip=!0,r&&i.setCredentials("",r),t===c&&(i.retryFunc=async(e,t,r)=>((0,s.showThrottleMessage)("InfuraProvider"),!0)),i}}t.InfuraProvider=l},8306:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IpcSocketProvider=void 0,t.IpcSocketProvider=void 0},2013:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcProvider=t.JsonRpcApiPollingProvider=t.JsonRpcApiProvider=t.JsonRpcSigner=void 0;const n=r(3707),s=r(5475),i=r(8336),o=r(2290),a=r(2120),c=r(5142),u=r(5649),l=r(4837),d=r(1570),h=r(3292),f="bigint,boolean,function,number,string,symbol".split(/,/g);function p(e){if(null==e||f.indexOf(typeof e)>=0)return e;if("function"==typeof e.getAddress)return e;if(Array.isArray(e))return e.map(p);if("object"==typeof e)return Object.keys(e).reduce(((t,r)=>(t[r]=e[r],t)),{});throw new Error(`should not happen: ${e} (${typeof e})`)}function g(e){return new Promise((t=>{setTimeout(t,e)}))}function y(e){return e?e.toLowerCase():e}function m(e){return e&&"number"==typeof e.pollingInterval}const b={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class v extends u.AbstractSigner{address;constructor(e,t){super(e),t=(0,s.getAddress)(t),(0,a.defineProperties)(this,{address:t})}connect(e){(0,a.assert)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const t=p(e),r=[];if(t.from){const n=t.from;r.push((async()=>{const r=await(0,s.resolveAddress)(n,this.provider);(0,a.assertArgument)(null!=r&&r.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=r})())}else t.from=this.address;if(null==t.gasLimit&&r.push((async()=>{t.gasLimit=await this.provider.estimateGas({...t,from:this.address})})()),null!=t.to){const e=t.to;r.push((async()=>{t.to=await(0,s.resolveAddress)(e,this.provider)})())}r.length&&await Promise.all(r);const n=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[n])}async sendTransaction(e){const t=await this.provider.getBlockNumber(),r=await this.sendUncheckedTransaction(e);return await new Promise(((e,n)=>{const s=[1e3,100],i=async()=>{const n=await this.provider.getTransaction(r);null==n?this.provider._setTimeout((()=>{i()}),s.pop()||4e3):e(n.replaceableTransaction(t))};i()}))}async signTransaction(e){const t=p(e);if(t.from){const r=await(0,s.resolveAddress)(t.from,this.provider);(0,a.assertArgument)(null!=r&&r.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=r}else t.from=this.address;const r=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[r])}async signMessage(e){const t="string"==typeof e?(0,a.toUtf8Bytes)(e):e;return await this.provider.send("personal_sign",[(0,a.hexlify)(t),this.address.toLowerCase()])}async signTypedData(e,t,r){const n=p(r),o=await i.TypedDataEncoder.resolveNames(e,t,n,(async e=>{const t=await(0,s.resolveAddress)(e);return(0,a.assertArgument)(null!=t,"TypedData does not support null address","value",e),t}));return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(i.TypedDataEncoder.getPayload(o.domain,t,o.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const t="string"==typeof e?(0,a.toUtf8Bytes)(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,a.hexlify)(t)])}}t.JsonRpcSigner=v;class w extends c.AbstractProvider{#y;#he;#fe;#pe;#ge;#ye;#me(){if(this.#pe)return;const e=1===this._getOption("batchMaxCount")?0:this._getOption("batchStallTime");this.#pe=setTimeout((()=>{this.#pe=null;const e=this.#fe;for(this.#fe=[];e.length;){const t=[e.shift()];for(;e.length&&t.length!==this.#y.batchMaxCount;)if(t.push(e.shift()),JSON.stringify(t.map((e=>e.payload))).length>this.#y.batchMaxSize){e.unshift(t.pop());break}(async()=>{const e=1===t.length?t[0].payload:t.map((e=>e.payload));this.emit("debug",{action:"sendRpcPayload",payload:e});try{const r=await this._send(e);this.emit("debug",{action:"receiveRpcResult",result:r});for(const{resolve:e,reject:n,payload:s}of t){if(this.destroyed){n((0,a.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:s.method}));continue}const t=r.filter((e=>e.id===s.id))[0];if(null!=t)"error"in t?n(this.getRpcError(s,t)):e(t.result);else{const e=(0,a.makeError)("missing response for request","BAD_DATA",{value:r,info:{payload:s}});this.emit("error",e),n(e)}}}catch(e){this.emit("debug",{action:"receiveRpcError",error:e});for(const{reject:r}of t)r(e)}})()}}),e)}constructor(e,t){super(e,t),this.#he=1,this.#y=Object.assign({},b,t||{}),this.#fe=[],this.#pe=null,this.#ye=null;{let e=null;const t=new Promise((t=>{e=t}));this.#ge={promise:t,resolve:e}}const r=this._getOption("staticNetwork");r&&((0,a.assertArgument)(null==e||r.matches(e),"staticNetwork MUST match network object","options",t),this.#ye=r)}_getOption(e){return this.#y[e]}get _network(){return(0,a.assert)(this.#ye,"network is not available yet","NETWORK_ERROR"),this.#ye}async _perform(e){if("call"===e.method||"estimateGas"===e.method){let t=e.transaction;if(t&&null!=t.type&&(0,a.getBigInt)(t.type)&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=await this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&(e=Object.assign({},e,{transaction:Object.assign({},t,{type:void 0})}))}}const t=this.getRpcRequest(e);return null!=t?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e)return e;if(this.ready)return l.Network.from((0,a.getBigInt)(await this.send("eth_chainId",[])));const t={id:this.#he++,method:"eth_chainId",params:[],jsonrpc:"2.0"};let r;this.emit("debug",{action:"sendRpcPayload",payload:t});try{r=(await this._send(t))[0]}catch(e){throw this.emit("debug",{action:"receiveRpcError",error:e}),e}if(this.emit("debug",{action:"receiveRpcResult",result:r}),"result"in r)return l.Network.from((0,a.getBigInt)(r.result));throw this.getRpcError(t,r)}_start(){null!=this.#ge&&null!=this.#ge.resolve&&(this.#ge.resolve(),this.#ge=null,(async()=>{for(;null==this.#ye&&!this.destroyed;)try{this.#ye=await this._detectNetwork()}catch(e){console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",(0,a.makeError)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await g(1e3)}this.#me()})())}async _waitUntilReady(){if(null!=this.#ge)return await this.#ge.promise}_getSubscriber(e){return"pending"===e.type?new d.FilterIdPendingSubscriber(this):"event"===e.type?this._getOption("polling")?new h.PollingEventSubscriber(this,e.filter):new d.FilterIdEventSubscriber(this,e.filter):"orphan"===e.type&&"drop-log"===e.filter.orphan?new c.UnmanagedSubscriber("orphan"):super._getSubscriber(e)}get ready(){return null==this.#ge}getRpcTransaction(e){const t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((r=>{if(null==e[r])return;let n=r;"gasLimit"===r&&(n="gas"),t[n]=(0,a.toQuantity)((0,a.getBigInt)(e[r],`tx.${r}`))})),["from","to","data"].forEach((r=>{null!=e[r]&&(t[r]=(0,a.hexlify)(e[r]))})),e.accessList&&(t.accessList=(0,o.accessListify)(e.accessList)),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getBalance":return{method:"eth_getBalance",args:[y(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[y(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[y(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[y(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&null!=e.filter.address&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(y):e.filter.address=y(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){const{method:r}=e,{error:s}=t;if("eth_estimateGas"===r&&s.message){const t=s.message;if(!t.match(/revert/i)&&t.match(/insufficient funds/i))return(0,a.makeError)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:s}})}if("eth_call"===r||"eth_estimateGas"===r){const t=P(s),i=n.AbiCoder.getBuiltinCallException("eth_call"===r?"call":"estimateGas",e.params[0],t?t.data:null);return i.info={error:s,payload:e},i}const i=JSON.stringify(function(e){const t=[];return E(e,t),t}(s));if("string"==typeof s.message&&s.message.match(/user denied|ethers-user-denied/i)){const t={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,a.makeError)("user rejected action","ACTION_REJECTED",{action:t[r]||"unknown",reason:"rejected",info:{payload:e,error:s}})}if("eth_sendRawTransaction"===r||"eth_sendTransaction"===r){const t=e.params[0];if(i.match(/insufficient funds|base fee exceeds gas limit/i))return(0,a.makeError)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:t,info:{error:s}});if(i.match(/nonce/i)&&i.match(/too low/i))return(0,a.makeError)("nonce has already been used","NONCE_EXPIRED",{transaction:t,info:{error:s}});if(i.match(/replacement transaction/i)&&i.match(/underpriced/i))return(0,a.makeError)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:t,info:{error:s}});if(i.match(/only replay-protected/i))return(0,a.makeError)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:r,info:{transaction:t,info:{error:s}}})}let o=!!i.match(/the method .* does not exist/i);return o||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(o=!0),o?(0,a.makeError)("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:s,payload:e}}):(0,a.makeError)("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:e})}send(e,t){if(this.destroyed)return Promise.reject((0,a.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const r=this.#he++,n=new Promise(((n,s)=>{this.#fe.push({resolve:n,reject:s,payload:{method:e,params:t,id:r,jsonrpc:"2.0"}})}));return this.#me(),n}async getSigner(e){null==e&&(e=0);const t=this.send("eth_accounts",[]);if("number"==typeof e){const r=await t;if(e>=r.length)throw new Error("no such account");return new v(this,r[e])}const{accounts:r}=await(0,a.resolveProperties)({network:this.getNetwork(),accounts:t});e=(0,s.getAddress)(e);for(const t of r)if((0,s.getAddress)(t)===e)return new v(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map((e=>new v(this,e)))}destroy(){this.#pe&&(clearTimeout(this.#pe),this.#pe=null);for(const{payload:e,reject:t}of this.#fe)t((0,a.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#fe=[],super.destroy()}}t.JsonRpcApiProvider=w;class A extends w{#be;constructor(e,t){super(e,t),this.#be=4e3}_getSubscriber(e){const t=super._getSubscriber(e);return m(t)&&(t.pollingInterval=this.#be),t}get pollingInterval(){return this.#be}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#be=e,this._forEachSubscriber((e=>{m(e)&&(e.pollingInterval=this.#be)}))}}function P(e){if(null==e)return null;if("string"==typeof e.message&&e.message.match(/revert/i)&&(0,a.isHexString)(e.data))return{message:e.message,data:e.data};if("object"==typeof e){for(const t in e){const r=P(e[t]);if(r)return r}return null}if("string"==typeof e)try{return P(JSON.parse(e))}catch(e){}return null}function E(e,t){if(null!=e){if("string"==typeof e.message&&t.push(e.message),"object"==typeof e)for(const r in e)E(e[r],t);if("string"==typeof e)try{return E(JSON.parse(e),t)}catch(e){}}}t.JsonRpcApiPollingProvider=A,t.JsonRpcProvider=class extends A{#ve;constructor(e,t,r){null==e&&(e="http://localhost:8545"),super(t,r),this.#ve="string"==typeof e?new a.FetchRequest(e):e.clone()}_getConnection(){return this.#ve.clone()}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){const t=this._getConnection();t.body=JSON.stringify(e),t.setHeader("content-type","application/json");const r=await t.send();r.assertOk();let n=r.bodyJson;return Array.isArray(n)||(n=[n]),n}}},2751:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PocketProvider=void 0;const n=r(2120),s=r(2813),i=r(4837),o=r(2013),a="62e1ad51b37b8e00394bda3b";class c extends o.JsonRpcProvider{applicationId;applicationSecret;constructor(e,t,r){null==e&&(e="mainnet");const s=i.Network.from(e);null==t&&(t=a),null==r&&(r=null);const o={staticNetwork:s};super(c.getRequest(s,t,r),s,o),(0,n.defineProperties)(this,{applicationId:t,applicationSecret:r})}_getProvider(e){try{return new c(e,this.applicationId,this.applicationSecret)}catch(e){}return super._getProvider(e)}static getRequest(e,t,r){null==t&&(t=a);const i=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/v1/lb/${t}`);return i.allowGzip=!0,r&&i.setCredentials("",r),t===a&&(i.retryFunc=async(e,t,r)=>((0,s.showThrottleMessage)("PocketProvider"),!0)),i}isCommunityResource(){return this.applicationId===a}}t.PocketProvider=c},1333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickNodeProvider=void 0;const n=r(2120),s=r(2813),i=r(4837),o=r(2013),a="919b412a057b5e9c9b6dce193c5a60242d6efadb";class c extends o.JsonRpcProvider{token;constructor(e,t){null==e&&(e="mainnet");const r=i.Network.from(e);null==t&&(t=a),super(c.getRequest(r,t),r,{staticNetwork:r}),(0,n.defineProperties)(this,{token:t})}_getProvider(e){try{return new c(e,this.token)}catch(e){}return super._getProvider(e)}isCommunityResource(){return this.token===a}static getRequest(e,t){null==t&&(t=a);const r=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/${t}`);return r.allowGzip=!0,t===a&&(r.retryFunc=async(e,t,r)=>((0,s.showThrottleMessage)("QuickNodeProvider"),!0)),r}}t.QuickNodeProvider=c},2394:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SocketProvider=t.SocketEventSubscriber=t.SocketPendingSubscriber=t.SocketBlockSubscriber=t.SocketSubscriber=void 0;const n=r(5142),s=r(2120),i=r(2013);class o{#we;#m;get filter(){return JSON.parse(this.#m)}#Ae;#Pe;#Ee;constructor(e,t){this.#we=e,this.#m=JSON.stringify(t),this.#Ae=null,this.#Pe=null,this.#Ee=null}start(){this.#Ae=this.#we.send("eth_subscribe",this.filter).then((e=>(this.#we._register(e,this),e)))}stop(){this.#Ae.then((e=>{this.#we.send("eth_unsubscribe",[e])})),this.#Ae=null}pause(e){(0,s.assert)(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),this.#Pe=!!e}resume(){this.#Pe=null}_handleMessage(e){if(null!=this.#Ae&&null===this.#Pe){let t=this.#Ee;t=null==t?this._emit(this.#we,e):t.then((async()=>{await this._emit(this.#we,e)})),this.#Ee=t.then((()=>{this.#Ee===t&&(this.#Ee=null)}))}}async _emit(e,t){throw new Error("sub-classes must implemente this; _emit")}}t.SocketSubscriber=o;class a extends o{constructor(e){super(e,["newHeads"])}async _emit(e,t){e.emit("block",parseInt(t.number))}}t.SocketBlockSubscriber=a;class c extends o{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,t){e.emit("pending",t)}}t.SocketPendingSubscriber=c;class u extends o{#Ce;get logFilter(){return JSON.parse(this.#Ce)}constructor(e,t){super(e,["logs",t]),this.#Ce=JSON.stringify(t)}async _emit(e,t){e.emit(this.logFilter,e._wrapLog(t,e._network))}}t.SocketEventSubscriber=u;class l extends i.JsonRpcApiProvider{#Se;#R;#ke;constructor(e){super(e,{batchMaxCount:1}),this.#Se=new Map,this.#R=new Map,this.#ke=new Map}_getSubscriber(e){switch(e.type){case"close":return new n.UnmanagedSubscriber("close");case"block":return new a(this);case"pending":return new c(this);case"event":return new u(this,e.filter);case"orphan":if("drop-log"===e.filter.orphan)return new n.UnmanagedSubscriber("drop-log")}return super._getSubscriber(e)}_register(e,t){this.#R.set(e,t);const r=this.#ke.get(e);if(r){for(const e of r)t._handleMessage(e);this.#ke.delete(e)}}async _send(e){(0,s.assertArgument)(!Array.isArray(e),"WebSocket does not support batch send","payload",e);const t=new Promise(((t,r)=>{this.#Se.set(e.id,{payload:e,resolve:t,reject:r})}));return await this._waitUntilReady(),await this._write(JSON.stringify(e)),[await t]}async _processMessage(e){const t=JSON.parse(e);if(t&&"object"==typeof t&&"id"in t){const e=this.#Se.get(t.id);if(null==e)return void this.emit("error",(0,s.makeError)("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:t}));this.#Se.delete(t.id),e.resolve(t)}else{if(!t||"eth_subscription"!==t.method)return void this.emit("error",(0,s.makeError)("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:t}));{const e=t.params.subscription,r=this.#R.get(e);if(r)r._handleMessage(t.params.result);else{let r=this.#ke.get(e);null==r&&(r=[],this.#ke.set(e,r)),r.push(t.params.result)}}}}async _write(e){throw new Error("sub-classes must override this")}}t.SocketProvider=l},2196:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketProvider=void 0;const n=r(9817),s=r(2394);class i extends s.SocketProvider{#ve;#Oe;get websocket(){if(null==this.#Oe)throw new Error("websocket closed");return this.#Oe}constructor(e,t){super(t),"string"==typeof e?(this.#ve=()=>new n.WebSocket(e),this.#Oe=this.#ve()):"function"==typeof e?(this.#ve=e,this.#Oe=e()):(this.#ve=null,this.#Oe=e),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(e){console.log("failed to start WebsocketProvider",e)}},this.websocket.onmessage=e=>{this._processMessage(e.data)}}async _write(e){this.websocket.send(e)}async destroy(){null!=this.#Oe&&(this.#Oe.close(),this.#Oe=null),super.destroy()}}t.WebSocketProvider=i},7143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionResponse=t.TransactionReceipt=t.Log=t.Block=t.copyRequest=t.FeeData=void 0;const n=r(2120),s=r(2290),i=BigInt(0);function o(e){return null==e?null:e}function a(e){return null==e?null:e.toString()}t.FeeData=class{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,t,r){(0,n.defineProperties)(this,{gasPrice:o(e),maxFeePerGas:o(t),maxPriorityFeePerGas:o(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:a(e),maxFeePerGas:a(t),maxPriorityFeePerGas:a(r)}}},t.copyRequest=function(e){const t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=(0,n.hexlify)(e.data));const r="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of r)s in e&&null!=e[s]&&(t[s]=(0,n.getBigInt)(e[s],`request.${s}`));const i="type,nonce".split(/,/);for(const r of i)r in e&&null!=e[r]&&(t[r]=(0,n.getNumber)(e[r],`request.${r}`));return e.accessList&&(t.accessList=(0,s.accessListify)(e.accessList)),"blockTag"in e&&(t.blockTag=e.blockTag),"enableCcipRead"in e&&(t.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(t.customData=e.customData),t};class c{provider;number;hash;timestamp;parentHash;nonce;difficulty;gasLimit;gasUsed;miner;extraData;baseFeePerGas;#Re;constructor(e,t){this.#Re=e.transactions.map((e=>"string"!=typeof e?new d(e,t):e)),(0,n.defineProperties)(this,{provider:t,hash:o(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:o(e.baseFeePerGas)})}get transactions(){return this.#Re.map((e=>"string"==typeof e?e:e.hash))}get prefetchedTransactions(){const e=this.#Re.slice();return 0===e.length?[]:((0,n.assert)("object"==typeof e[0],"transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:r,gasLimit:n,gasUsed:s,hash:i,miner:o,nonce:c,number:u,parentHash:l,timestamp:d,transactions:h}=this;return{_type:"Block",baseFeePerGas:a(e),difficulty:a(t),extraData:r,gasLimit:a(n),gasUsed:a(s),hash:i,miner:o,nonce:c,number:u,parentHash:l,timestamp:d,transactions:h}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>enew u(e,t))));let r=i;null!=e.effectiveGasPrice?r=e.effectiveGasPrice:null!=e.gasPrice&&(r=e.gasPrice),(0,n.defineProperties)(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:r,type:e.type,status:e.status,root:e.root})}get logs(){return this.#Te}toJSON(){const{to:e,from:t,contractAddress:r,hash:n,index:s,blockHash:i,blockNumber:o,logsBloom:c,logs:u,status:l,root:d}=this;return{_type:"TransactionReceipt",blockHash:i,blockNumber:o,contractAddress:r,cumulativeGasUsed:a(this.cumulativeGasUsed),from:t,gasPrice:a(this.gasPrice),gasUsed:a(this.gasUsed),hash:n,index:s,logs:u,logsBloom:c,root:d,status:l,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(c)return null;const{blockNumber:e,nonce:t}=await(0,n.resolveProperties)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(t{if(null==e||0!==e.status)return e;(0,n.assert)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:e.to,from:e.from,data:""},receipt:e})},d=await this.provider.getTransactionReceipt(this.hash);if(0===r)return l(d);if(d){if(await d.confirmations()>=r)return l(d)}else if(await u(),0===r)return null;const h=new Promise(((e,t)=>{const i=[],a=()=>{i.forEach((e=>e()))};if(i.push((()=>{c=!0})),s>0){const e=setTimeout((()=>{a(),t((0,n.makeError)("wait for transaction timeout","TIMEOUT"))}),s);i.push((()=>{clearTimeout(e)}))}const d=async n=>{if(await n.confirmations()>=r){a();try{e(l(n))}catch(e){t(e)}}};if(i.push((()=>{this.provider.off(this.hash,d)})),this.provider.on(this.hash,d),o>=0){const e=async()=>{try{await u()}catch(e){if((0,n.isError)(e,"TRANSACTION_REPLACED"))return a(),void t(e)}c||this.provider.once("block",e)};i.push((()=>{this.provider.off("block",e)})),this.provider.once("block",e)}}));return await h}isMined(){return null!=this.blockHash}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}removedEvent(){return(0,n.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),f(this)}reorderedEvent(e){return(0,n.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,n.assert)(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),h(this,e)}replaceableTransaction(e){(0,n.assertArgument)(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new d(this,this.provider);return t.#Ne=e,t}}function h(e,t){return{orphan:"reorder-transaction",tx:e,other:t}}function f(e){return{orphan:"drop-transaction",tx:e}}t.TransactionResponse=d},2992:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NonceManager=void 0;const n=r(2120),s=r(5649);class i extends s.AbstractSigner{signer;#xe;#Ie;constructor(e){super(e.provider),(0,n.defineProperties)(this,{signer:e}),this.#xe=null,this.#Ie=0}async getAddress(){return this.signer.getAddress()}connect(e){return new i(this.signer.connect(e))}async getNonce(e){if("pending"===e){null==this.#xe&&(this.#xe=super.getNonce("pending"));const e=this.#Ie;return await this.#xe+e}return super.getNonce(e)}increment(){this.#Ie++}reset(){this.#Ie=0,this.#xe=null}async sendTransaction(e){const t=this.getNonce("pending");return this.increment(),(e=await this.signer.populateTransaction(e)).nonce=await t,await this.signer.sendTransaction(e)}signTransaction(e){return this.signer.signTransaction(e)}signMessage(e){return this.signer.signMessage(e)}signTypedData(e,t,r){return this.signer.signTypedData(e,t,r)}}t.NonceManager=i},1570:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FilterIdPendingSubscriber=t.FilterIdEventSubscriber=t.FilterIdSubscriber=void 0;const n=r(2120),s=r(3292);class i{#we;#_e;#Be;#je;#ye;#Le;constructor(e){this.#we=e,this.#_e=null,this.#Be=this.#Ue.bind(this),this.#je=!1,this.#ye=null,this.#Le=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#Ue(e){try{null==this.#_e&&(this.#_e=this._subscribe(this.#we));let e=null;try{e=await this.#_e}catch(e){if(!(0,n.isError)(e,"UNSUPPORTED_OPERATION")||"eth_newFilter"!==e.operation)throw e}if(null==e)return this.#_e=null,void this.#we._recoverSubscriber(this,this._recover(this.#we));const t=await this.#we.getNetwork();if(this.#ye||(this.#ye=t),this.#ye.chainId!==t.chainId)throw new Error("chaid changed");if(this.#Le)return;const r=await this.#we.send("eth_getFilterChanges",[e]);await this._emitResults(this.#we,r)}catch(e){console.log("@TODO",e)}this.#we.once("block",this.#Be)}#De(){const e=this.#_e;e&&(this.#_e=null,e.then((e=>{this.#we.send("eth_uninstallFilter",[e])})))}start(){this.#je||(this.#je=!0,this.#Ue(-2))}stop(){this.#je&&(this.#je=!1,this.#Le=!0,this.#De(),this.#we.off("block",this.#Be))}pause(e){e&&this.#De(),this.#we.off("block",this.#Be)}resume(){this.start()}}t.FilterIdSubscriber=i,t.FilterIdEventSubscriber=class extends i{#Fe;constructor(e,t){var r;super(e),this.#Fe=(r=t,JSON.parse(JSON.stringify(r)))}_recover(e){return new s.PollingEventSubscriber(e,this.#Fe)}async _subscribe(e){return await e.send("eth_newFilter",[this.#Fe])}async _emitResults(e,t){for(const r of t)e.emit(this.#Fe,e._wrapLog(r,e._network))}},t.FilterIdPendingSubscriber=class extends i{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const r of t)e.emit("pending",r)}}},3292:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PollingEventSubscriber=t.PollingTransactionSubscriber=t.PollingOrphanSubscriber=t.OnBlockSubscriber=t.PollingBlockSubscriber=t.getPollingSubscriber=void 0;const n=r(2120);function s(e){return JSON.parse(JSON.stringify(e))}t.getPollingSubscriber=function(e,t){return"block"===t?new i(e):(0,n.isHexString)(t,32)?new a(e,t):void(0,n.assert)(!1,"unsupported polling event","UNSUPPORTED_OPERATION",{operation:"getPollingSubscriber",info:{event:t}})};class i{#we;#Be;#Me;#He;constructor(e){this.#we=e,this.#Be=null,this.#Me=4e3,this.#He=-2}get pollingInterval(){return this.#Me}set pollingInterval(e){this.#Me=e}async#Ue(){try{const e=await this.#we.getBlockNumber();if(-2===this.#He)return void(this.#He=e);if(e!==this.#He){for(let t=this.#He+1;t<=e;t++){if(null==this.#Be)return;await this.#we.emit("block",t)}this.#He=e}}catch(e){}null!=this.#Be&&(this.#Be=this.#we._setTimeout(this.#Ue.bind(this),this.#Me))}start(){this.#Be||(this.#Be=this.#we._setTimeout(this.#Ue.bind(this),this.#Me),this.#Ue())}stop(){this.#Be&&(this.#we._clearTimeout(this.#Be),this.#Be=null)}pause(e){this.stop(),e&&(this.#He=-2)}resume(){this.start()}}t.PollingBlockSubscriber=i;class o{#we;#Ue;#je;constructor(e){this.#we=e,this.#je=!1,this.#Ue=e=>{this._poll(e,this.#we)}}async _poll(e,t){throw new Error("sub-classes must override this")}start(){this.#je||(this.#je=!0,this.#Ue(-2),this.#we.on("block",this.#Ue))}stop(){this.#je&&(this.#je=!1,this.#we.off("block",this.#Ue))}pause(e){this.stop()}resume(){this.start()}}t.OnBlockSubscriber=o,t.PollingOrphanSubscriber=class extends o{#m;constructor(e,t){super(e),this.#m=s(t)}async _poll(e,t){throw new Error("@TODO")}};class a extends o{#Ge;constructor(e,t){super(e),this.#Ge=t}async _poll(e,t){const r=await t.getTransactionReceipt(this.#Ge);r&&t.emit(this.#Ge,r)}}t.PollingTransactionSubscriber=a,t.PollingEventSubscriber=class{#we;#m;#Be;#je;#He;constructor(e,t){this.#we=e,this.#m=s(t),this.#Be=this.#Ue.bind(this),this.#je=!1,this.#He=-2}async#Ue(e){if(-2===this.#He)return;const t=s(this.#m);t.fromBlock=this.#He+1,t.toBlock=e;const r=await this.#we.getLogs(t);if(0!==r.length)for(const e of r)this.#we.emit(this.#m,e),this.#He=e.blockNumber;else this.#He{this.#He=e})),this.#we.on("block",this.#Be))}stop(){this.#je&&(this.#je=!1,this.#we.off("block",this.#Be))}pause(e){this.stop(),e&&(this.#He=-2)}resume(){this.start()}}},9817:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocket=void 0;const n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}().WebSocket;t.WebSocket=n},484:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.accessListify=void 0;const n=r(5475),s=r(2120);function i(e,t){return{address:(0,n.getAddress)(e),storageKeys:t.map(((e,t)=>((0,s.assertArgument)((0,s.isHexString)(e,32),"invalid slot",`storageKeys[${t}]`,e),e.toLowerCase())))}}t.accessListify=function(e){if(Array.isArray(e))return e.map(((t,r)=>Array.isArray(t)?((0,s.assertArgument)(2===t.length,"invalid slot set",`value[${r}]`,t),i(t[0],t[1])):((0,s.assertArgument)(null!=t&&"object"==typeof t,"invalid address-slot set","value",e),i(t.address,t.storageKeys))));(0,s.assertArgument)(null!=e&&"object"==typeof e,"invalid access list","value",e);const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return i(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}},7782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.recoverAddress=t.computeAddress=void 0;const n=r(5475),s=r(6965);function i(e){let t;return t="string"==typeof e?s.SigningKey.computePublicKey(e,!1):e.publicKey,(0,n.getAddress)((0,s.keccak256)("0x"+t.substring(4)).substring(26))}t.computeAddress=i,t.recoverAddress=function(e,t){return i(s.SigningKey.recoverPublicKey(e,t))}},2290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=t.recoverAddress=t.computeAddress=t.accessListify=void 0;var n=r(484);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return n.accessListify}});var s=r(7782);Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return s.computeAddress}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return s.recoverAddress}});var i=r(1541);Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return i.Transaction}})},1541:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;const n=r(5475),s=r(6965),i=r(2120),o=r(484),a=r(7782),c=BigInt(0),u=BigInt(2),l=BigInt(27),d=BigInt(28),h=BigInt(35),f=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function p(e){return"0x"===e?null:(0,n.getAddress)(e)}function g(e,t){try{return(0,o.accessListify)(e)}catch(r){(0,i.assertArgument)(!1,r.message,t,e)}}function y(e,t){return"0x"===e?0:(0,i.getNumber)(e,t)}function m(e,t){if("0x"===e)return c;const r=(0,i.getBigInt)(e,t);return(0,i.assertArgument)(r<=f,"value exceeds uint size",t,r),r}function b(e,t){const r=(0,i.getBigInt)(e,"value"),n=(0,i.toBeArray)(r);return(0,i.assertArgument)(n.length<=32,"value too large",`tx.${t}`,r),n}function v(e){return(0,o.accessListify)(e).map((e=>[e.address,e.storageKeys]))}function w(e,t){const r=[b(e.nonce||0,"nonce"),b(e.gasPrice||0,"gasPrice"),b(e.gasLimit||0,"gasLimit"),null!=e.to?(0,n.getAddress)(e.to):"0x",b(e.value||0,"value"),e.data||"0x"];let o=c;if(e.chainId!=c)o=(0,i.getBigInt)(e.chainId,"tx.chainId"),(0,i.assertArgument)(!t||null==t.networkV||t.legacyChainId===o,"tx.chainId/sig.v mismatch","sig",t);else if(e.signature){const t=e.signature.legacyChainId;null!=t&&(o=t)}if(!t)return o!==c&&(r.push((0,i.toBeArray)(o)),r.push("0x"),r.push("0x")),(0,i.encodeRlp)(r);let a=BigInt(27+t.yParity);return o!==c?a=s.Signature.getChainIdV(o,t.v):BigInt(t.v)!==a&&(0,i.assertArgument)(!1,"tx.chainId/sig.v mismatch","sig",t),r.push((0,i.toBeArray)(a)),r.push((0,i.toBeArray)(t.r)),r.push((0,i.toBeArray)(t.s)),(0,i.encodeRlp)(r)}function A(e,t){let r;try{if(r=y(t[0],"yParity"),0!==r&&1!==r)throw new Error("bad yParity")}catch(e){(0,i.assertArgument)(!1,"invalid yParity","yParity",t[0])}const n=(0,i.zeroPadValue)(t[1],32),o=(0,i.zeroPadValue)(t[2],32),a=s.Signature.from({r:n,s:o,yParity:r});e.signature=a}function P(e,t){const r=[b(e.chainId||0,"chainId"),b(e.nonce||0,"nonce"),b(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),b(e.maxFeePerGas||0,"maxFeePerGas"),b(e.gasLimit||0,"gasLimit"),null!=e.to?(0,n.getAddress)(e.to):"0x",b(e.value||0,"value"),e.data||"0x",v(e.accessList||[])];return t&&(r.push(b(t.yParity,"yParity")),r.push((0,i.toBeArray)(t.r)),r.push((0,i.toBeArray)(t.s))),(0,i.concat)(["0x02",(0,i.encodeRlp)(r)])}function E(e,t){const r=[b(e.chainId||0,"chainId"),b(e.nonce||0,"nonce"),b(e.gasPrice||0,"gasPrice"),b(e.gasLimit||0,"gasLimit"),null!=e.to?(0,n.getAddress)(e.to):"0x",b(e.value||0,"value"),e.data||"0x",v(e.accessList||[])];return t&&(r.push(b(t.yParity,"recoveryParam")),r.push((0,i.toBeArray)(t.r)),r.push((0,i.toBeArray)(t.s))),(0,i.concat)(["0x01",(0,i.encodeRlp)(r)])}class C{#We;#ze;#r;#Ke;#Je;#Ve;#qe;#Qe;#Ye;#$;#Ze;#$e;get type(){return this.#We}set type(e){switch(e){case null:this.#We=null;break;case 0:case"legacy":this.#We=0;break;case 1:case"berlin":case"eip-2930":this.#We=1;break;case 2:case"london":case"eip-1559":this.#We=2;break;default:(0,i.assertArgument)(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559"}return null}get to(){return this.#ze}set to(e){this.#ze=null==e?null:(0,n.getAddress)(e)}get nonce(){return this.#Ke}set nonce(e){this.#Ke=(0,i.getNumber)(e,"value")}get gasLimit(){return this.#Je}set gasLimit(e){this.#Je=(0,i.getBigInt)(e)}get gasPrice(){const e=this.#Ve;return null!=e||0!==this.type&&1!==this.type?e:c}set gasPrice(e){this.#Ve=null==e?null:(0,i.getBigInt)(e,"gasPrice")}get maxPriorityFeePerGas(){const e=this.#qe;return null==e?2===this.type?c:null:e}set maxPriorityFeePerGas(e){this.#qe=null==e?null:(0,i.getBigInt)(e,"maxPriorityFeePerGas")}get maxFeePerGas(){const e=this.#Qe;return null==e?2===this.type?c:null:e}set maxFeePerGas(e){this.#Qe=null==e?null:(0,i.getBigInt)(e,"maxFeePerGas")}get data(){return this.#r}set data(e){this.#r=(0,i.hexlify)(e)}get value(){return this.#Ye}set value(e){this.#Ye=(0,i.getBigInt)(e,"value")}get chainId(){return this.#$}set chainId(e){this.#$=(0,i.getBigInt)(e)}get signature(){return this.#Ze||null}set signature(e){this.#Ze=null==e?null:s.Signature.from(e)}get accessList(){const e=this.#$e||null;return null==e?1===this.type||2===this.type?[]:null:e}set accessList(e){this.#$e=null==e?null:(0,o.accessListify)(e)}constructor(){this.#We=null,this.#ze=null,this.#Ke=0,this.#Je=BigInt(0),this.#Ve=null,this.#qe=null,this.#Qe=null,this.#r="0x",this.#Ye=BigInt(0),this.#$=BigInt(0),this.#Ze=null,this.#$e=null}get hash(){return null==this.signature?null:(0,s.keccak256)(this.serialized)}get unsignedHash(){return(0,s.keccak256)(this.unsignedSerialized)}get from(){return null==this.signature?null:(0,a.recoverAddress)(this.unsignedHash,this.signature)}get fromPublicKey(){return null==this.signature?null:s.SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return null!=this.signature}get serialized(){switch((0,i.assert)(null!=this.signature,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"}),this.inferType()){case 0:return w(this,this.signature);case 1:return E(this,this.signature);case 2:return P(this,this.signature)}(0,i.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get unsignedSerialized(){switch(this.inferType()){case 0:return w(this);case 1:return E(this);case 2:return P(this)}(0,i.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".unsignedSerialized"})}inferType(){return this.inferTypes().pop()}inferTypes(){const e=null!=this.gasPrice,t=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,r=null!=this.accessList;null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&(0,i.assert)(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,i.assert)(!t||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,i.assert)(0!==this.type||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const n=[];return null!=this.type?n.push(this.type):t?n.push(2):e?(n.push(1),r||n.push(0)):r?(n.push(1),n.push(2)):(n.push(0),n.push(1),n.push(2)),n.sort(),n}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}clone(){return C.from(this)}toJSON(){const e=e=>null==e?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(null==e)return new C;if("string"==typeof e){const t=(0,i.getBytes)(e);if(t[0]>=127)return C.from(function(e){const t=(0,i.decodeRlp)(e);(0,i.assertArgument)(Array.isArray(t)&&(9===t.length||6===t.length),"invalid field count for legacy transaction","data",e);const r={type:0,nonce:y(t[0],"nonce"),gasPrice:m(t[1],"gasPrice"),gasLimit:m(t[2],"gasLimit"),to:p(t[3]),value:m(t[4],"value"),data:(0,i.hexlify)(t[5]),chainId:c};if(6===t.length)return r;const n=m(t[6],"v"),o=m(t[7],"r"),a=m(t[8],"s");if(o===c&&a===c)r.chainId=n;else{let o=(n-h)/u;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBase58=t.encodeBase58=void 0;const n=r(6239),s=r(1766),i=r(358),o="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let a=null;function c(e){if(null==a){a={};for(let e=0;e<58;e++)a[o[e]]=BigInt(e)}const t=a[e];return(0,s.assertArgument)(null!=t,"invalid base58 value","letter",e),t}const u=BigInt(0),l=BigInt(58);t.encodeBase58=function(e){let t=(0,i.toBigInt)((0,n.getBytes)(e)),r="";for(;t;)r=o[Number(t%l)]+r,t/=l;return r},t.decodeBase58=function(e){let t=u;for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeBase64=t.decodeBase64=void 0;const n=r(6239);t.decodeBase64=function(e){e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zeroPadBytes=t.zeroPadValue=t.stripZerosLeft=t.dataSlice=t.dataLength=t.concat=t.hexlify=t.isBytesLike=t.isHexString=t.getBytesCopy=t.getBytes=void 0;const n=r(1766);function s(e,t,r){if(e instanceof Uint8Array)return r?new Uint8Array(e):e;if("string"==typeof e&&e.match(/^0x([0-9a-f][0-9a-f])*$/i)){const t=new Uint8Array((e.length-2)/2);let r=2;for(let n=0;n>4]+a[15&n]}return r}function u(e,t,r){const s=i(e);(0,n.assert)(t>=s.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(s),length:t,offset:t+1});const o=new Uint8Array(t);return o.fill(0),r?o.set(s,t-s.length):o.set(s,0),c(o)}t.hexlify=c,t.concat=function(e){return"0x"+e.map((e=>c(e).substring(2))).join("")},t.dataLength=function(e){return o(e,!0)?(e.length-2)/2:i(e).length},t.dataSlice=function(e,t,r){const s=i(e);return null!=r&&r>s.length&&(0,n.assert)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:s,length:s.length,offset:r}),c(s.slice(null==t?0:t,null==r?s.length:r))},t.stripZerosLeft=function(e){let t=c(e).substring(2);for(;t.startsWith("00");)t=t.substring(2);return"0x"+t},t.zeroPadValue=function(e,t){return u(e,t,!0)},t.zeroPadBytes=function(e,t){return u(e,t,!1)}},1766:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertPrivate=t.assertNormalize=t.assertArgumentCount=t.assertArgument=t.assert=t.makeError=t.isCallException=t.isError=void 0;const n=r(9406),s=r(9290);function i(e){if(null==e)return"null";if(Array.isArray(e))return"[ "+e.map(i).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let r="0x";for(let n=0;n>4],r+=t[15&e[n]];return r}if("object"==typeof e&&"function"==typeof e.toJSON)return i(e.toJSON());switch(typeof e){case"boolean":case"symbol":case"number":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const t=Object.keys(e);return t.sort(),"{ "+t.map((t=>`${i(t)}: ${i(e[t])}`)).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function o(e,t){return e&&e.code===t}function a(e,t,r){{const s=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${i(r)}`);for(const e in r){const t=r[e];s.push(e+"="+i(t))}}s.push(`code=${t}`),s.push(`version=${n.version}`),s.length&&(e+=" ("+s.join(", ")+")")}let o;switch(t){case"INVALID_ARGUMENT":o=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":o=new RangeError(e);break;default:o=new Error(e)}return(0,s.defineProperties)(o,{code:t}),r&&Object.assign(o,r),o}function c(e,t,r,n){if(!e)throw a(t,r,n)}t.isError=o,t.isCallException=function(e){return o(e,"CALL_EXCEPTION")},t.makeError=a,t.assert=c,t.assertArgument=function(e,t,r,n){c(e,t,"INVALID_ARGUMENT",{argument:r,value:n})},t.assertArgumentCount=function(e,t,r){null==r&&(r=""),r&&(r=": "+r),c(e>=t,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:e,expectedCount:t}),c(e<=t,"too many arguemnts"+r,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})};const u=["NFD","NFC","NFKD","NFKC"].reduce(((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(e){}return e}),[]);t.assertNormalize=function(e){c(u.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})},t.assertPrivate=function(e,t,r){if(null==r&&(r=""),e!==t){let e=r,t="new";r&&(e+=".",t+=" "+r),c(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}},2203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventPayload=void 0;const n=r(9290);t.EventPayload=class{filter;emitter;#Xe;constructor(e,t,r){this.#Xe=t,(0,n.defineProperties)(this,{emitter:e,filter:r})}async removeListener(){null!=this.#Xe&&await this.emitter.off(this.filter,this.#Xe)}}},3654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FetchResponse=t.FetchRequest=t.FetchCancelSignal=void 0;const n=r(6446),s=r(6239),i=r(1766),o=r(9290),a=r(2119);let c=r(3040).getUrl;const u=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),l=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let d=!1;async function h(e,t){try{const t=e.match(u);if(!t)throw new Error("invalid data");return new v(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?(0,n.decodeBase64)(t[3]):(r=t[3],(0,a.toUtf8Bytes)(r.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))))))}catch(t){return new v(599,"BAD REQUEST (invalid data: URI)",{},null,new b(e))}var r}function f(e){return async function(t,r){try{const r=t.match(l);if(!r)throw new Error("invalid link");return new b(`${e}${r[2]}`)}catch(e){return new v(599,"BAD REQUEST (invalid IPFS URI)",{},null,new b(t))}}}const p={data:h,ipfs:f("https://gateway.ipfs.io/ipfs/")},g=new WeakMap;class y{#et;#tt;constructor(e){this.#et=[],this.#tt=!1,g.set(e,(()=>{if(!this.#tt){this.#tt=!0;for(const e of this.#et)setTimeout((()=>{e()}),0);this.#et=[]}}))}addListener(e){(0,i.assert)(!this.#tt,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#et.push(e)}get cancelled(){return this.#tt}checkSignal(){(0,i.assert)(!this.cancelled,"cancelled","CANCELLED",{})}}function m(e){if(null==e)throw new Error("missing signal; should not happen");return e.checkSignal(),e}t.FetchCancelSignal=y;class b{#rt;#nt;#st;#it;#ot;#ee;#at;#ct;#ut;#lt;#dt;#ht;#ft;#pt;get url(){return this.#ee}set url(e){this.#ee=String(e)}get body(){return null==this.#at?null:new Uint8Array(this.#at)}set body(e){if(null==e)this.#at=void 0,this.#ct=void 0;else if("string"==typeof e)this.#at=(0,a.toUtf8Bytes)(e),this.#ct="text/plain";else if(e instanceof Uint8Array)this.#at=e,this.#ct="application/octet-stream";else{if("object"!=typeof e)throw new Error("invalid body");this.#at=(0,a.toUtf8Bytes)(JSON.stringify(e)),this.#ct="application/json"}}hasBody(){return null!=this.#at}get method(){return this.#it?this.#it:this.hasBody()?"POST":"GET"}set method(e){null==e&&(e=""),this.#it=String(e).toUpperCase()}get headers(){const e=Object.assign({},this.#st);return this.#ut&&(e.authorization=`Basic ${(0,n.encodeBase64)((0,a.toUtf8Bytes)(this.#ut))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),null==e["content-type"]&&this.#ct&&(e["content-type"]=this.#ct),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){this.#st[String(e).toLowerCase()]=String(t)}clearHeaders(){this.#st={}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let r=0;return{next:()=>{if(r=0,"timeout must be non-zero","timeout",e),this.#ot=e}get preflightFunc(){return this.#lt||null}set preflightFunc(e){this.#lt=e}get processFunc(){return this.#dt||null}set processFunc(e){this.#dt=e}get retryFunc(){return this.#ht||null}set retryFunc(e){this.#ht=e}constructor(e){this.#ee=String(e),this.#rt=!1,this.#nt=!0,this.#st={},this.#it="",this.#ot=3e5,this.#pt={slotInterval:250,maxAttempts:12}}toString(){return``}setThrottleParams(e){null!=e.slotInterval&&(this.#pt.slotInterval=e.slotInterval),null!=e.maxAttempts&&(this.#pt.maxAttempts=e.maxAttempts)}async#gt(e,t,r,n,s){if(e>=this.#pt.maxAttempts)return s.makeServerError("exceeded maximum retry limit");(0,i.assert)(w()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:n}),r>0&&await function(e){return new Promise((t=>setTimeout(t,e)))}(r);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in p){const e=await p[a](o.url,m(n.#ft));if(e instanceof v){let t=e;if(this.processFunc){m(n.#ft);try{t=await this.processFunc(o,t)}catch(e){null!=e.throttle&&"number"==typeof e.stall||t.makeServerError("error in post-processing function",e).assertOk()}}return t}o=e}this.preflightFunc&&(o=await this.preflightFunc(o));const u=await c(o,m(n.#ft));let l=new v(u.statusCode,u.statusMessage,u.headers,u.body,n);if(301===l.statusCode||302===l.statusCode){try{const r=l.headers.location||"";return o.redirect(r).#gt(e+1,t,0,n,l)}catch(e){}return l}if(429===l.statusCode&&(null==this.retryFunc||await this.retryFunc(o,l,e))){const r=l.headers["retry-after"];let s=this.#pt.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return"string"==typeof r&&r.match(/^[1-9][0-9]*$/)&&(s=parseInt(r)),o.clone().#gt(e+1,t,s,n,l)}if(this.processFunc){m(n.#ft);try{l=await this.processFunc(o,l)}catch(r){null!=r.throttle&&"number"==typeof r.stall||l.makeServerError("error in post-processing function",r).assertOk();let s=this.#pt.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return r.stall>=0&&(s=r.stall),o.clone().#gt(e+1,t,s,n,l)}}return l}send(){return(0,i.assert)(null==this.#ft,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#ft=new y(this),this.#gt(0,w()+this.timeout,0,this,new v(0,"",{},null,this))}cancel(){(0,i.assert)(null!=this.#ft,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=g.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();(0,i.assert)("GET"===this.method&&("https"!==t||"http"!==r)&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const n=new b(e);return n.method="GET",n.allowGzip=this.allowGzip,n.timeout=this.timeout,n.#st=Object.assign({},this.#st),this.#at&&(n.#at=new Uint8Array(this.#at)),n.#ct=this.#ct,n}clone(){const e=new b(this.url);return e.#it=this.#it,this.#at&&(e.#at=this.#at),e.#ct=this.#ct,e.#st=Object.assign({},this.#st),e.#ut=this.#ut,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#lt=this.#lt,e.#dt=this.#dt,e.#ht=this.#ht,e}static lockConfig(){d=!0}static getGateway(e){return p[e.toLowerCase()]||null}static registerGateway(e,t){if("http"===(e=e.toLowerCase())||"https"===e)throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(d)throw new Error("gateways locked");p[e]=t}static registerGetUrl(e){if(d)throw new Error("gateways locked");c=e}static createDataGateway(){return h}static createIpfsGatewayFunc(e){return f(e)}}t.FetchRequest=b;class v{#yt;#mt;#st;#at;#re;#bt;toString(){return``}get statusCode(){return this.#yt}get statusMessage(){return this.#mt}get headers(){return Object.assign({},this.#st)}get body(){return null==this.#at?null:new Uint8Array(this.#at)}get bodyText(){try{return null==this.#at?"":(0,a.toUtf8String)(this.#at)}catch(e){(0,i.assert)(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(e){(0,i.assert)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let r=0;return{next:()=>{if(r(e[t.toLowerCase()]=String(r[t]),e)),{}),this.#at=null==n?null:new Uint8Array(n),this.#re=s||null,this.#bt={message:""}}makeServerError(e,t){let r;r=e?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:`CLIENT ESCALATED SERVER ERROR (${e=`${this.statusCode} ${this.statusMessage}`})`;const n=new v(599,r,this.headers,this.body,this.#re||void 0);return n.#bt={message:e,error:t},n}throwThrottleError(e,t){null==t?t=-1:(0,i.assertArgument)(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);const r=new Error(e||"throttling requests");throw(0,o.defineProperties)(r,{stall:t,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return null!=this.#at}get request(){return this.#re}ok(){return""===this.#bt.message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=this.#bt;""===e&&(e=`server response ${this.statusCode} ${this.statusMessage}`),(0,i.assert)(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t})}}function w(){return(new Date).getTime()}t.FetchResponse=v},6539:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FixedNumber=void 0;const n=r(6239),s=r(1766),i=r(358),o=r(9290),a=BigInt(-1),c=BigInt(0),u=BigInt(1),l=BigInt(5),d={};let h="0000";for(;h.length<80;)h+=h;function f(e){let t=h;for(;t.length=-t&&ec?(0,i.fromTwos)((0,i.mask)(e,n),n):-(0,i.fromTwos)((0,i.mask)(-e,n),n)}else{const t=u<=0&&enull==i[e]?r:((0,s.assertArgument)(typeof i[e]===t,"invalid fixed format ("+e+" not "+t+")","format."+e,i[e]),i[e]);t=o("signed","boolean",t),r=o("width","number",r),n=o("decimals","number",n)}return(0,s.assertArgument)(r%8==0,"invalid FixedNumber width (not byte aligned)","format.width",r),(0,s.assertArgument)(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n),{signed:t,width:r,decimals:n,name:(t?"":"u")+"fixed"+String(r)+"x"+String(n)}}class y{format;#vt;#wt;#At;_value;constructor(e,t,r){(0,s.assertPrivate)(e,d,"FixedNumber"),this.#wt=t,this.#vt=r;const n=function(e,t){let r="";e0?r*=f(n):n<0&&(t*=f(-n)),tr?1:0}eq(e){return 0===this.cmp(e)}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#wt;return this.#wtc&&(e+=this.#At-u),e=this.#wt/this.#At*this.#At,this.#Et(e,"ceiling")}round(e){if(null==e&&(e=0),e>=this.decimals)return this;const t=this.decimals-e,r=l*f(t-1);let n=this.value+r;const s=f(t);return n=n/s*s,p(n,this.#vt,"round"),new y(d,n,this.#vt)}isZero(){return this.#wt===c}isNegative(){return this.#wt0){const t=f(u);(0,s.assert)(a%t===c,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),a/=t}else u<0&&(a*=f(-u));return p(a,o,"fromValue"),new y(d,a,o)}static fromString(e,t){const r=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,s.assertArgument)(r&&r[2].length+r[3].length>0,"invalid FixedNumber string value","value",e);const n=g(t);let i=r[2]||"0",o=r[3]||"";for(;o.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUrl=void 0;const n=r(1766);t.getUrl=async function(e,t){const r=e.url.split(":")[0].toLowerCase();let s;if((0,n.assert)("http"===r||"https"===r,`unsupported protocol ${r}`,"UNSUPPORTED_OPERATION",{info:{protocol:r},operation:"request"}),(0,n.assert)("https"===r||!e.credentials||e.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"}),t){const e=new AbortController;s=e.signal,t.addListener((()=>{e.abort()}))}const i={method:e.method,headers:new Headers(Array.from(e)),body:e.body||void 0,signal:s},o=await fetch(e.url,i),a={};o.headers.forEach(((e,t)=>{a[t.toLowerCase()]=e}));const c=await o.arrayBuffer(),u=null==c?null:new Uint8Array(c);return{statusCode:o.status,statusMessage:o.statusText,headers:a,body:u}}},2120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.encodeRlp=t.decodeRlp=t.defineProperties=t.resolveProperties=t.toQuantity=t.toBeArray=t.toBeHex=t.toNumber=t.toBigInt=t.getUint=t.getNumber=t.getBigInt=t.mask=t.toTwos=t.fromTwos=t.FixedNumber=t.FetchCancelSignal=t.FetchResponse=t.FetchRequest=t.EventPayload=t.makeError=t.assertNormalize=t.assertPrivate=t.assertArgumentCount=t.assertArgument=t.assert=t.isError=t.isCallException=t.zeroPadBytes=t.zeroPadValue=t.stripZerosLeft=t.dataSlice=t.dataLength=t.concat=t.hexlify=t.isBytesLike=t.isHexString=t.getBytesCopy=t.getBytes=t.encodeBase64=t.decodeBase64=t.encodeBase58=t.decodeBase58=void 0,t.uuidV4=t.Utf8ErrorFuncs=void 0;var n=r(349);Object.defineProperty(t,"decodeBase58",{enumerable:!0,get:function(){return n.decodeBase58}}),Object.defineProperty(t,"encodeBase58",{enumerable:!0,get:function(){return n.encodeBase58}});var s=r(6446);Object.defineProperty(t,"decodeBase64",{enumerable:!0,get:function(){return s.decodeBase64}}),Object.defineProperty(t,"encodeBase64",{enumerable:!0,get:function(){return s.encodeBase64}});var i=r(6239);Object.defineProperty(t,"getBytes",{enumerable:!0,get:function(){return i.getBytes}}),Object.defineProperty(t,"getBytesCopy",{enumerable:!0,get:function(){return i.getBytesCopy}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return i.isBytesLike}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return i.hexlify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return i.concat}}),Object.defineProperty(t,"dataLength",{enumerable:!0,get:function(){return i.dataLength}}),Object.defineProperty(t,"dataSlice",{enumerable:!0,get:function(){return i.dataSlice}}),Object.defineProperty(t,"stripZerosLeft",{enumerable:!0,get:function(){return i.stripZerosLeft}}),Object.defineProperty(t,"zeroPadValue",{enumerable:!0,get:function(){return i.zeroPadValue}}),Object.defineProperty(t,"zeroPadBytes",{enumerable:!0,get:function(){return i.zeroPadBytes}});var o=r(1766);Object.defineProperty(t,"isCallException",{enumerable:!0,get:function(){return o.isCallException}}),Object.defineProperty(t,"isError",{enumerable:!0,get:function(){return o.isError}}),Object.defineProperty(t,"assert",{enumerable:!0,get:function(){return o.assert}}),Object.defineProperty(t,"assertArgument",{enumerable:!0,get:function(){return o.assertArgument}}),Object.defineProperty(t,"assertArgumentCount",{enumerable:!0,get:function(){return o.assertArgumentCount}}),Object.defineProperty(t,"assertPrivate",{enumerable:!0,get:function(){return o.assertPrivate}}),Object.defineProperty(t,"assertNormalize",{enumerable:!0,get:function(){return o.assertNormalize}}),Object.defineProperty(t,"makeError",{enumerable:!0,get:function(){return o.makeError}});var a=r(2203);Object.defineProperty(t,"EventPayload",{enumerable:!0,get:function(){return a.EventPayload}});var c=r(3654);Object.defineProperty(t,"FetchRequest",{enumerable:!0,get:function(){return c.FetchRequest}}),Object.defineProperty(t,"FetchResponse",{enumerable:!0,get:function(){return c.FetchResponse}}),Object.defineProperty(t,"FetchCancelSignal",{enumerable:!0,get:function(){return c.FetchCancelSignal}});var u=r(6539);Object.defineProperty(t,"FixedNumber",{enumerable:!0,get:function(){return u.FixedNumber}});var l=r(358);Object.defineProperty(t,"fromTwos",{enumerable:!0,get:function(){return l.fromTwos}}),Object.defineProperty(t,"toTwos",{enumerable:!0,get:function(){return l.toTwos}}),Object.defineProperty(t,"mask",{enumerable:!0,get:function(){return l.mask}}),Object.defineProperty(t,"getBigInt",{enumerable:!0,get:function(){return l.getBigInt}}),Object.defineProperty(t,"getNumber",{enumerable:!0,get:function(){return l.getNumber}}),Object.defineProperty(t,"getUint",{enumerable:!0,get:function(){return l.getUint}}),Object.defineProperty(t,"toBigInt",{enumerable:!0,get:function(){return l.toBigInt}}),Object.defineProperty(t,"toNumber",{enumerable:!0,get:function(){return l.toNumber}}),Object.defineProperty(t,"toBeHex",{enumerable:!0,get:function(){return l.toBeHex}}),Object.defineProperty(t,"toBeArray",{enumerable:!0,get:function(){return l.toBeArray}}),Object.defineProperty(t,"toQuantity",{enumerable:!0,get:function(){return l.toQuantity}});var d=r(9290);Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return d.resolveProperties}}),Object.defineProperty(t,"defineProperties",{enumerable:!0,get:function(){return d.defineProperties}});var h=r(4978);Object.defineProperty(t,"decodeRlp",{enumerable:!0,get:function(){return h.decodeRlp}});var f=r(9122);Object.defineProperty(t,"encodeRlp",{enumerable:!0,get:function(){return f.encodeRlp}});var p=r(8680);Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return p.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return p.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return p.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return p.parseUnits}});var g=r(2119);Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return g.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return g.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return g.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return g.Utf8ErrorFuncs}});var y=r(4824);Object.defineProperty(t,"uuidV4",{enumerable:!0,get:function(){return y.uuidV4}})},358:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toQuantity=t.toBeArray=t.toBeHex=t.toNumber=t.getNumber=t.toBigInt=t.getUint=t.getBigInt=t.mask=t.toTwos=t.fromTwos=void 0;const n=r(6239),s=r(1766),i=BigInt(0),o=BigInt(1),a=9007199254740991;function c(e,t){switch(typeof e){case"bigint":return e;case"number":return(0,s.assertArgument)(Number.isInteger(e),"underflow",t||"value",e),(0,s.assertArgument)(e>=-a&&e<=a,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(r){(0,s.assertArgument)(!1,`invalid BigNumberish string: ${r.message}`,t||"value",e)}}(0,s.assertArgument)(!1,"invalid BigNumberish value",t||"value",e)}function u(e,t){const r=c(e,t);return(0,s.assert)(r>=i,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),r}t.fromTwos=function(e,t){const r=u(e,"value"),n=BigInt(h(t,"width"));return(0,s.assert)(r>>n===i,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),r>>n-o?-((~r&(o<>4],t+=l[15&r];return BigInt(t)}return c(e)}function h(e,t){switch(typeof e){case"bigint":return(0,s.assertArgument)(e>=-a&&e<=a,"overflow",t||"value",e),Number(e);case"number":return(0,s.assertArgument)(Number.isInteger(e),"underflow",t||"value",e),(0,s.assertArgument)(e>=-a&&e<=a,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return h(BigInt(e),t)}catch(r){(0,s.assertArgument)(!1,`invalid numeric string: ${r.message}`,t||"value",e)}}(0,s.assertArgument)(!1,"invalid numeric value",t||"value",e)}function f(e){const t=u(e,"value");if(t===i)return new Uint8Array([]);let r=t.toString(16);r.length%2&&(r="0"+r);const n=new Uint8Array(r.length/2);for(let e=0;e=r.length,`value exceeds width (${n} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});r.length<2*n;)r="0"+r}return"0x"+r},t.toBeArray=f,t.toQuantity=function(e){let t=(0,n.hexlify)((0,n.isBytesLike)(e)?e:f(e)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return""===t&&(t="0"),"0x"+t}},9290:(e,t)=>{"use strict";function r(e,t,r){const n=t.split("|").map((e=>e.trim()));for(let r=0;rPromise.resolve(e[t]))))).reduce(((e,r,n)=>(e[t[n]]=r,e)),{})},t.defineProperties=function(e,t,n){for(let s in t){let i=t[s];const o=n?n[s]:null;o&&r(i,o,s),Object.defineProperty(e,s,{enumerable:!0,value:i,writable:!1})}}},4978:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeRlp=void 0;const n=r(6239),s=r(1766),i=r(6239);function o(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function a(e,t,r){let n=0;for(let s=0;s{(0,s.assert)(t<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:t})};if(e[t]>=248){const n=e[t]-247;r(t+1+n);const s=a(e,t+1,n);return r(t+1+n+s),c(e,t,t+1+n,n+s)}if(e[t]>=192){const n=e[t]-192;return r(t+1+n),c(e,t,t+1,n)}if(e[t]>=184){const s=e[t]-183;r(t+1+s);const i=a(e,t+1,s);return r(t+1+s+i),{consumed:1+s+i,result:(0,n.hexlify)(e.slice(t+1+s,t+1+s+i))}}if(e[t]>=128){const s=e[t]-128;return r(t+1+s),{consumed:1+s,result:(0,n.hexlify)(e.slice(t+1,t+1+s))}}return{consumed:1,result:o(e[t])}}t.decodeRlp=function(e){const t=(0,i.getBytes)(e,"data"),r=u(t,0);return(0,s.assertArgument)(r.consumed===t.length,"unexpected junk after rlp payload","data",e),r.result}},9122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeRlp=void 0;const n=r(6239);function s(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function i(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(i(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=s(t.length);return r.unshift(247+r.length),r.concat(t)}const t=Array.prototype.slice.call((0,n.getBytes)(e,"object"));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=s(t.length);return r.unshift(183+r.length),r.concat(t)}const o="0123456789abcdef";t.encodeRlp=function(e){let t="0x";for(const r of i(e))t+=o[r>>4],t+=o[15&r];return t}},8680:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseEther=t.formatEther=t.parseUnits=t.formatUnits=void 0;const n=r(1766),s=r(6539),i=r(358),o=["wei","kwei","mwei","gwei","szabo","finney","ether"];function a(e,t){let r=18;if("string"==typeof t){const e=o.indexOf(t);(0,n.assertArgument)(e>=0,"invalid unit","unit",t),r=3*e}else null!=t&&(r=(0,i.getNumber)(t,"unit"));return s.FixedNumber.fromValue(e,r,{decimals:r,width:512}).toString()}function c(e,t){(0,n.assertArgument)("string"==typeof e,"value must be a string","value",e);let r=18;if("string"==typeof t){const e=o.indexOf(t);(0,n.assertArgument)(e>=0,"invalid unit","unit",t),r=3*e}else null!=t&&(r=(0,i.getNumber)(t,"unit"));return s.FixedNumber.fromString(e,{decimals:r,width:512}).value}t.formatUnits=a,t.parseUnits=c,t.formatEther=function(e){return a(e,18)},t.parseEther=function(e){return c(e,18)}},2119:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUtf8CodePoints=t.toUtf8String=t.toUtf8Bytes=t.Utf8ErrorFuncs=void 0;const n=r(6239),s=r(1766);function i(e,t,r,n,s){if("BAD_PREFIX"===e||"UNEXPECTED_CONTINUE"===e){let e=0;for(let n=t+1;n>6==2;n++)e++;return e}return"OVERRUN"===e?r.length-t-1:0}function o(e,r){null==r&&(r=t.Utf8ErrorFuncs.error);const s=(0,n.getBytes)(e,"bytes"),i=[];let o=0;for(;o>7==0){i.push(e);continue}let t=null,n=null;if(192==(224&e))t=1,n=127;else if(224==(240&e))t=2,n=2047;else{if(240!=(248&e)){o+=r(128==(192&e)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",o-1,s,i);continue}t=3,n=65535}if(o-1+t>=s.length){o+=r("OVERRUN",o-1,s,i);continue}let a=e&(1<<8-t-1)-1;for(let e=0;e1114111?o+=r("OUT_OF_RANGE",o-1-t,s,i,a):a>=55296&&a<=57343?o+=r("UTF16_SURROGATE",o-1-t,s,i,a):a<=n?o+=r("OVERLONG",o-1-t,s,i,a):i.push(a))}return i}function a(e,t){null!=t&&((0,s.assertNormalize)(t),e=e.normalize(t));let r=[];for(let t=0;t>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);(0,s.assertArgument)(t>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return new Uint8Array(r)}t.Utf8ErrorFuncs=Object.freeze({error:function(e,t,r,n,i){(0,s.assertArgument)(!1,`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:i,replace:function(e,t,r,n,o){return"OVERLONG"===e?((0,s.assertArgument)("number"==typeof o,"invalid bad code point for replacement","badCodepoint",o),n.push(o),0):(n.push(65533),i(e,t,r))}}),t.toUtf8Bytes=a,t.toUtf8String=function(e,t){return o(e,t).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")},t.toUtf8CodePoints=function(e,t){return o(a(e,t))}},4824:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuidV4=void 0;const n=r(6239);t.uuidV4=function(e){const t=(0,n.getBytes)(e,"randomBytes");t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=(0,n.hexlify)(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}},5662:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseWallet=void 0;const n=r(5475),s=r(8336),i=r(4878),o=r(2290),a=r(2120);class c extends i.AbstractSigner{address;#Rt;constructor(e,t){super(t),(0,a.assertArgument)(e&&"function"==typeof e.sign,"invalid private key","privateKey","[ REDACTED ]"),this.#Rt=e;const r=(0,o.computeAddress)(this.signingKey.publicKey);(0,a.defineProperties)(this,{address:r})}get signingKey(){return this.#Rt}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new c(this.#Rt,e)}async signTransaction(e){const{to:t,from:r}=await(0,a.resolveProperties)({to:e.to?(0,n.resolveAddress)(e.to,this.provider):void 0,from:e.from?(0,n.resolveAddress)(e.from,this.provider):void 0});null!=t&&(e.to=t),null!=r&&(e.from=r),null!=e.from&&((0,a.assertArgument)((0,n.getAddress)(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const s=o.Transaction.from(e);return s.signature=this.signingKey.sign(s.unsignedHash),s.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign((0,s.hashMessage)(e)).serialized}async signTypedData(e,t,r){const n=await s.TypedDataEncoder.resolveNames(e,t,r,(async e=>{(0,a.assert)(null!=this.provider,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:e}});const t=await this.provider.resolveName(e);return(0,a.assert)(null!=t,"unconfigured ENS name","UNCONFIGURED_NAME",{value:e}),t}));return this.signingKey.sign(s.TypedDataEncoder.hash(n.domain,t,n.value)).serialized}}t.BaseWallet=c},483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIndexedAccountPath=t.getAccountPath=t.HDNodeVoidWallet=t.HDNodeWallet=t.defaultPath=void 0;const n=r(6965),s=r(4878),i=r(2290),o=r(2120),a=r(847),c=r(5662),u=r(75),l=r(630);t.defaultPath="m/44'/60'/0'/0/0";const d=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),h=2147483648,f=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function p(e,t){let r="";for(;e;)r="0123456789abcdef"[e%16]+r,e=Math.trunc(e/16);for(;r.length<2*t;)r="0"+r;return"0x"+r}function g(e){const t=(0,o.getBytes)(e),r=(0,o.dataSlice)((0,n.sha256)((0,n.sha256)(t)),0,4),s=(0,o.concat)([t,r]);return(0,o.encodeBase58)(s)}const y={};function m(e,t,r,s){const i=new Uint8Array(37);e&h?((0,o.assert)(null!=s,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),i.set((0,o.getBytes)(s),1)):i.set((0,o.getBytes)(r));for(let t=24;t>=0;t-=8)i[33+(t>>3)]=e>>24-t&255;const a=(0,o.getBytes)((0,n.computeHmac)("sha512",t,i));return{IL:a.slice(0,32),IR:a.slice(32)}}function b(e,t){const r=t.split("/");(0,o.assertArgument)(r.length>0&&("m"===r[0]||e.depth>0),"invalid path","path",t),"m"===r[0]&&r.shift();let n=e;for(let e=0;e=16&&r.length<=64,"invalid seed","seed","[REDACTED]");const s=(0,o.getBytes)((0,n.computeHmac)("sha512",d,r)),i=new n.SigningKey((0,o.hexlify)(s.slice(0,32)));return new v(y,i,"0x00000000",(0,o.hexlify)(s.slice(32)),"m",0,0,t,null)}static fromExtendedKey(e){const t=(0,o.toBeArray)((0,o.decodeBase58)(e));(0,o.assertArgument)(82===t.length||g(t.slice(0,78))===e,"invalid extended key","extendedKey","[ REDACTED ]");const r=t[4],s=(0,o.hexlify)(t.slice(5,9)),a=parseInt((0,o.hexlify)(t.slice(9,13)).substring(2),16),c=(0,o.hexlify)(t.slice(13,45)),u=t.slice(45,78);switch((0,o.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const e=(0,o.hexlify)(u);return new w(y,(0,i.computeAddress)(e),e,s,c,null,a,r,null)}case"0x0488ade4":case"0x04358394 ":if(0!==u[0])break;return new v(y,new n.SigningKey(u.slice(1)),s,c,null,a,r,null,null)}(0,o.assertArgument)(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(e,r,s){null==e&&(e=""),null==r&&(r=t.defaultPath),null==s&&(s=a.LangEn.wordlist());const i=u.Mnemonic.fromEntropy((0,n.randomBytes)(16),e,s);return v.#Nt(i.computeSeed(),i).derivePath(r)}static fromMnemonic(e,r){return r||(r=t.defaultPath),v.#Nt(e.computeSeed(),e).derivePath(r)}static fromPhrase(e,r,n,s){null==r&&(r=""),null==n&&(n=t.defaultPath),null==s&&(s=a.LangEn.wordlist());const i=u.Mnemonic.fromPhrase(e,r,s);return v.#Nt(i.computeSeed(),i).derivePath(n)}static fromSeed(e){return v.#Nt(e,null)}}t.HDNodeWallet=v;class w extends s.VoidSigner{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,r,s,i,a,c,u,l){super(t,l),(0,o.assertPrivate)(e,y,"HDNodeVoidWallet"),(0,o.defineProperties)(this,{publicKey:r});const d=(0,o.dataSlice)((0,n.ripemd160)((0,n.sha256)(r)),0,4);(0,o.defineProperties)(this,{publicKey:r,fingerprint:d,parentFingerprint:s,chainCode:i,path:a,index:c,depth:u})}connect(e){return new w(y,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return(0,o.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),g((0,o.concat)(["0x0488B21E",p(this.depth,1),this.parentFingerprint,p(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return null!=this.path}deriveChild(e){const t=(0,o.getNumber)(e,"index");(0,o.assertArgument)(t<=4294967295,"invalid index","index",t);let r=this.path;r&&(r+="/"+(2147483647&t),t&h&&(r+="'"));const{IR:s,IL:a}=m(t,this.chainCode,this.publicKey,null),c=n.SigningKey.addPoints(a,this.publicKey,!0),u=(0,i.computeAddress)(c);return new w(y,u,c,this.fingerprint,(0,o.hexlify)(s),r,t,this.depth+1,this.provider)}derivePath(e){return b(this,e)}}t.HDNodeVoidWallet=w,t.getAccountPath=function(e){const t=(0,o.getNumber)(e,"index");return(0,o.assertArgument)(t>=0&&t=0&&t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=t.Mnemonic=t.encryptKeystoreJsonSync=t.encryptKeystoreJson=t.decryptKeystoreJson=t.decryptKeystoreJsonSync=t.isKeystoreJson=t.decryptCrowdsaleJson=t.isCrowdsaleJson=t.HDNodeVoidWallet=t.HDNodeWallet=t.getIndexedAccountPath=t.getAccountPath=t.defaultPath=t.BaseWallet=void 0;var n=r(5662);Object.defineProperty(t,"BaseWallet",{enumerable:!0,get:function(){return n.BaseWallet}});var s=r(483);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return s.defaultPath}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return s.getAccountPath}}),Object.defineProperty(t,"getIndexedAccountPath",{enumerable:!0,get:function(){return s.getIndexedAccountPath}}),Object.defineProperty(t,"HDNodeWallet",{enumerable:!0,get:function(){return s.HDNodeWallet}}),Object.defineProperty(t,"HDNodeVoidWallet",{enumerable:!0,get:function(){return s.HDNodeVoidWallet}});var i=r(8668);Object.defineProperty(t,"isCrowdsaleJson",{enumerable:!0,get:function(){return i.isCrowdsaleJson}}),Object.defineProperty(t,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return i.decryptCrowdsaleJson}});var o=r(630);Object.defineProperty(t,"isKeystoreJson",{enumerable:!0,get:function(){return o.isKeystoreJson}}),Object.defineProperty(t,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return o.decryptKeystoreJsonSync}}),Object.defineProperty(t,"decryptKeystoreJson",{enumerable:!0,get:function(){return o.decryptKeystoreJson}}),Object.defineProperty(t,"encryptKeystoreJson",{enumerable:!0,get:function(){return o.encryptKeystoreJson}}),Object.defineProperty(t,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return o.encryptKeystoreJsonSync}});var a=r(75);Object.defineProperty(t,"Mnemonic",{enumerable:!0,get:function(){return a.Mnemonic}});var c=r(6389);Object.defineProperty(t,"Wallet",{enumerable:!0,get:function(){return c.Wallet}})},8668:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decryptCrowdsaleJson=t.isCrowdsaleJson=void 0;const n=r(3260),s=r(5475),i=r(6965),o=r(8336),a=r(2120),c=r(7668);t.isCrowdsaleJson=function(e){try{if(JSON.parse(e).encseed)return!0}catch(e){}return!1},t.decryptCrowdsaleJson=function(e,t){const r=JSON.parse(e),u=(0,c.getPassword)(t),l=(0,s.getAddress)((0,c.spelunk)(r,"ethaddr:string!")),d=(0,c.looseArrayify)((0,c.spelunk)(r,"encseed:string!"));(0,a.assertArgument)(d&&d.length%16==0,"invalid encseed","json",e);const h=(0,a.getBytes)((0,i.pbkdf2)(u,u,2e3,32,"sha256")).slice(0,16),f=d.slice(0,16),p=d.slice(16),g=new n.CBC(h,f),y=(0,n.pkcs7Strip)((0,a.getBytes)(g.decrypt(p)));let m="";for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encryptKeystoreJson=t.encryptKeystoreJsonSync=t.decryptKeystoreJson=t.decryptKeystoreJsonSync=t.isKeystoreJson=void 0;const n=r(3260),s=r(5475),i=r(6965),o=r(2290),a=r(2120),c=r(7668),u=r(9406),l="m/44'/60'/0'/0/0";function d(e,t){const r=(0,a.getBytes)(t),u=(0,c.spelunk)(e,"crypto.ciphertext:data!"),d=(0,a.hexlify)((0,i.keccak256)((0,a.concat)([r.slice(16,32),u]))).substring(2);(0,a.assertArgument)(d===(0,c.spelunk)(e,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const h=function(e,t,r){if("aes-128-ctr"===(0,c.spelunk)(e,"crypto.cipher:string")){const s=(0,c.spelunk)(e,"crypto.cipherparams.iv:data!"),i=new n.CTR(t,s);return(0,a.hexlify)(i.decrypt(r))}(0,a.assert)(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}(e,r.slice(0,16),u),f=(0,o.computeAddress)(h);if(e.address){let t=e.address.toLowerCase();t.startsWith("0x")||(t="0x"+t),(0,a.assertArgument)((0,s.getAddress)(t)===f,"keystore address/privateKey mismatch","address",e.address)}const p={address:f,privateKey:h};if("0.1"===(0,c.spelunk)(e,"x-ethers.version:string")){const t=r.slice(32,64),s=(0,c.spelunk)(e,"x-ethers.mnemonicCiphertext:data!"),i=(0,c.spelunk)(e,"x-ethers.mnemonicCounter:data!"),o=new n.CTR(t,i);p.mnemonic={path:(0,c.spelunk)(e,"x-ethers.path:string")||l,locale:(0,c.spelunk)(e,"x-ethers.locale:string")||"en",entropy:(0,a.hexlify)((0,a.getBytes)(o.decrypt(s)))}}return p}function h(e){const t=(0,c.spelunk)(e,"crypto.kdf:string");if(t&&"string"==typeof t){if("scrypt"===t.toLowerCase()){const r=(0,c.spelunk)(e,"crypto.kdfparams.salt:data!"),n=(0,c.spelunk)(e,"crypto.kdfparams.n:int!"),s=(0,c.spelunk)(e,"crypto.kdfparams.r:int!"),i=(0,c.spelunk)(e,"crypto.kdfparams.p:int!");(0,a.assertArgument)(n>0&&0==(n&n-1),"invalid kdf.N","kdf.N",n),(0,a.assertArgument)(s>0&&i>0,"invalid kdf","kdf",t);const o=(0,c.spelunk)(e,"crypto.kdfparams.dklen:int!");return(0,a.assertArgument)(32===o,"invalid kdf.dklen","kdf.dflen",o),{name:"scrypt",salt:r,N:n,r:s,p:i,dkLen:64}}if("pbkdf2"===t.toLowerCase()){const t=(0,c.spelunk)(e,"crypto.kdfparams.salt:data!"),r=(0,c.spelunk)(e,"crypto.kdfparams.prf:string!"),n=r.split("-").pop();(0,a.assertArgument)("sha256"===n||"sha512"===n,"invalid kdf.pdf","kdf.pdf",r);const s=(0,c.spelunk)(e,"crypto.kdfparams.c:int!"),i=(0,c.spelunk)(e,"crypto.kdfparams.dklen:int!");return(0,a.assertArgument)(32===i,"invalid kdf.dklen","kdf.dklen",i),{name:"pbkdf2",salt:t,count:s,dkLen:i,algorithm:n}}}(0,a.assertArgument)(!1,"unsupported key-derivation function","kdf",t)}function f(e){return new Promise((t=>{setTimeout((()=>{t()}),e)}))}function p(e){const t=null!=e.salt?(0,a.getBytes)(e.salt,"options.salt"):(0,i.randomBytes)(32);let r=1<<17,n=8,s=1;return e.scrypt&&(e.scrypt.N&&(r=e.scrypt.N),e.scrypt.r&&(n=e.scrypt.r),e.scrypt.p&&(s=e.scrypt.p)),(0,a.assertArgument)("number"==typeof r&&r>0&&Number.isSafeInteger(r)&&(BigInt(r)&BigInt(r-1))===BigInt(0),"invalid scrypt N parameter","options.N",r),(0,a.assertArgument)("number"==typeof n&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),(0,a.assertArgument)("number"==typeof s&&s>0&&Number.isSafeInteger(s),"invalid scrypt p parameter","options.p",s),{name:"scrypt",dkLen:32,salt:t,N:r,r:n,p:s}}function g(e,t,r,s){const o=(0,a.getBytes)(r.privateKey,"privateKey"),d=null!=s.iv?(0,a.getBytes)(s.iv,"options.iv"):(0,i.randomBytes)(16);(0,a.assertArgument)(16===d.length,"invalid options.iv length","options.iv",s.iv);const h=null!=s.uuid?(0,a.getBytes)(s.uuid,"options.uuid"):(0,i.randomBytes)(16);(0,a.assertArgument)(16===h.length,"invalid options.uuid length","options.uuid",s.iv);const f=e.slice(0,16),p=e.slice(16,32),g=new n.CTR(f,d),y=(0,a.getBytes)(g.encrypt(o)),m=(0,i.keccak256)((0,a.concat)([p,y])),b={address:r.address.substring(2).toLowerCase(),id:(0,a.uuidV4)(h),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,a.hexlify)(d).substring(2)},ciphertext:(0,a.hexlify)(y).substring(2),kdf:"scrypt",kdfparams:{salt:(0,a.hexlify)(t.salt).substring(2),n:t.N,dklen:32,p:t.p,r:t.r},mac:m.substring(2)}};if(r.mnemonic){const t=null!=s.client?s.client:`ethers/${u.version}`,o=r.mnemonic.path||l,d=r.mnemonic.locale||"en",h=e.slice(32,64),f=(0,a.getBytes)(r.mnemonic.entropy,"account.mnemonic.entropy"),p=(0,i.randomBytes)(16),g=new n.CTR(h,p),y=(0,a.getBytes)(g.encrypt(f)),m=new Date,v="UTC--"+m.getUTCFullYear()+"-"+(0,c.zpad)(m.getUTCMonth()+1,2)+"-"+(0,c.zpad)(m.getUTCDate(),2)+"T"+(0,c.zpad)(m.getUTCHours(),2)+"-"+(0,c.zpad)(m.getUTCMinutes(),2)+"-"+(0,c.zpad)(m.getUTCSeconds(),2)+".0Z--"+b.address;b["x-ethers"]={client:t,gethFilename:v,path:o,locale:d,mnemonicCounter:(0,a.hexlify)(p).substring(2),mnemonicCiphertext:(0,a.hexlify)(y).substring(2),version:"0.1"}}return JSON.stringify(b)}t.isKeystoreJson=function(e){try{const t=JSON.parse(e);if(3===(null!=t.version?parseInt(t.version):0))return!0}catch(e){}return!1},t.decryptKeystoreJsonSync=function(e,t){const r=JSON.parse(e),n=(0,c.getPassword)(t),s=h(r);if("pbkdf2"===s.name){const{salt:e,count:t,dkLen:o,algorithm:a}=s;return d(r,(0,i.pbkdf2)(n,e,t,o,a))}(0,a.assert)("scrypt"===s.name,"cannot be reached","UNKNOWN_ERROR",{params:s});const{salt:o,N:u,r:l,p:f,dkLen:p}=s;return d(r,(0,i.scryptSync)(n,o,u,l,f,p))},t.decryptKeystoreJson=async function(e,t,r){const n=JSON.parse(e),s=(0,c.getPassword)(t),o=h(n);if("pbkdf2"===o.name){r&&(r(0),await f(0));const{salt:e,count:t,dkLen:a,algorithm:c}=o,u=(0,i.pbkdf2)(s,e,t,a,c);return r&&(r(1),await f(0)),d(n,u)}(0,a.assert)("scrypt"===o.name,"cannot be reached","UNKNOWN_ERROR",{params:o});const{salt:u,N:l,r:p,p:g,dkLen:y}=o;return d(n,await(0,i.scrypt)(s,u,l,p,g,y,r))},t.encryptKeystoreJsonSync=function(e,t,r){null==r&&(r={});const n=(0,c.getPassword)(t),s=p(r),o=(0,i.scryptSync)(n,s.salt,s.N,s.r,s.p,64);return g((0,a.getBytes)(o),s,e,r)},t.encryptKeystoreJson=async function(e,t,r){null==r&&(r={});const n=(0,c.getPassword)(t),s=p(r),o=await(0,i.scrypt)(n,s.salt,s.N,s.r,s.p,64,r.progressCallback);return g((0,a.getBytes)(o),s,e,r)}},75:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Mnemonic=void 0;const n=r(6965),s=r(2120),i=r(847);function o(e){return(1<=12&&r.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const a=new Uint8Array(Math.ceil(11*r.length/8));let c=0;for(let e=0;e=0,`invalid mnemonic word at index ${e}`,"mnemonic","[ REDACTED ]");for(let e=0;e<11;e++)n&1<<10-e&&(a[c>>3]|=1<<7-c%8),c++}const u=32*r.length/3,l=o(r.length/3),d=(0,s.getBytes)((0,n.sha256)(a.slice(0,u/8)))[0]&l;return(0,s.assertArgument)(d===(a[a.length-1]&l),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,s.hexlify)(a.slice(0,u/8))}function c(e,t){(0,s.assertArgument)(e.length%4==0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),null==t&&(t=i.LangEn.wordlist());const r=[0];let a=11;for(let t=0;t8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],a-=8):(r[r.length-1]<<=a,r[r.length-1]|=e[t]>>8-a,r.push(e[t]&(1<<8-a)-1&255),a+=3);const c=e.length/4,u=parseInt((0,n.sha256)(e).substring(2,4),16)&o(c);return r[r.length-1]<<=c,r[r.length-1]|=u>>8-c,t.join(r.map((e=>t.getWord(e))))}const u={};class l{phrase;password;wordlist;entropy;constructor(e,t,r,n,o){null==n&&(n=""),null==o&&(o=i.LangEn.wordlist()),(0,s.assertPrivate)(e,u,"Mnemonic"),(0,s.defineProperties)(this,{phrase:r,password:n,wordlist:o,entropy:t})}computeSeed(){const e=(0,s.toUtf8Bytes)("mnemonic"+this.password,"NFKD");return(0,n.pbkdf2)((0,s.toUtf8Bytes)(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,t,r){const n=a(e,r);return e=c((0,s.getBytes)(n),r),new l(u,n,e,t,r)}static fromEntropy(e,t,r){const n=(0,s.getBytes)(e,"entropy"),i=c(n,r);return new l(u,(0,s.hexlify)(n),i,t,r)}static entropyToPhrase(e,t){return c((0,s.getBytes)(e,"entropy"),t)}static phraseToEntropy(e,t){return a(e,t)}static isValidMnemonic(e,t){try{return a(e,t),!0}catch(e){}return!1}}t.Mnemonic=l},7668:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.spelunk=t.getPassword=t.zpad=t.looseArrayify=void 0;const n=r(2120);function s(e){return"string"!=typeof e||e.startsWith("0x")||(e="0x"+e),(0,n.getBytesCopy)(e)}t.looseArrayify=s,t.zpad=function(e,t){for(e=String(e);e.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=void 0;const n=r(6965),s=r(2120),i=r(5662),o=r(483),a=r(8668),c=r(630),u=r(75);function l(e){return new Promise((t=>{setTimeout((()=>{t()}),e)}))}class d extends i.BaseWallet{constructor(e,t){"string"!=typeof e||e.startsWith("0x")||(e="0x"+e),super("string"==typeof e?new n.SigningKey(e):e,t)}connect(e){return new d(this.signingKey,e)}async encrypt(e,t){const r={address:this.address,privateKey:this.privateKey};return await(0,c.encryptKeystoreJson)(r,e,{progressCallback:t})}encryptSync(e){const t={address:this.address,privateKey:this.privateKey};return(0,c.encryptKeystoreJsonSync)(t,e)}static#xt(e){if((0,s.assertArgument)(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&"en"===e.mnemonic.locale){const t=u.Mnemonic.fromEntropy(e.mnemonic.entropy),r=o.HDNodeWallet.fromMnemonic(t,e.mnemonic.path);if(r.address===e.address&&r.privateKey===e.privateKey)return r;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const t=new d(e.privateKey);return(0,s.assertArgument)(t.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),t}static async fromEncryptedJson(e,t,r){let n=null;return(0,c.isKeystoreJson)(e)?n=await(0,c.decryptKeystoreJson)(e,t,r):(0,a.isCrowdsaleJson)(e)&&(r&&(r(0),await l(0)),n=(0,a.decryptCrowdsaleJson)(e,t),r&&(r(1),await l(0))),d.#xt(n)}static fromEncryptedJsonSync(e,t){let r=null;return(0,c.isKeystoreJson)(e)?r=(0,c.decryptKeystoreJsonSync)(e,t):(0,a.isCrowdsaleJson)(e)?r=(0,a.decryptCrowdsaleJson)(e,t):(0,s.assertArgument)(!1,"invalid JSON wallet","json","[ REDACTED ]"),d.#xt(r)}static createRandom(e){const t=o.HDNodeWallet.createRandom();return e?t.connect(e):t}static fromPhrase(e,t){const r=o.HDNodeWallet.fromPhrase(e);return t?r.connect(t):r}}t.Wallet=d},5033:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBits=void 0,t.decodeBits=function(e,t){const r=(1<=e;){const t=s>>i-e;s&=(1<{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeOwl=t.decode=void 0;const n=r(2120),s=" !#$%&'()*+,-./<=>?@[]^_`{|}~",i=/^[a-z]*$/i;function o(e,t){let r=97;return e.reduce(((e,n)=>(n===t?r++:n.match(i)?e.push(String.fromCharCode(r)+n):(r=97,e.push(n)),e)),[])}function a(e,t){for(let r=28;r>=0;r--)e=e.split(s[r]).join(t.substring(2*r,2*r+2));const r=[],n=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,((e,t,n,s)=>{if(n)for(let e=parseInt(n);e>=0;e--)r.push(";");else r.push(t.toLowerCase());return""}));if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return o(o(r,";"),":")}t.decode=a,t.decodeOwl=function(e){return(0,n.assertArgument)("0"===e[0],"unsupported auwl data","data",e),a(e.substring(59),e.substring(1,59))}},4603:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeOwlA=void 0;const n=r(2120),s=r(5033),i=r(2629);t.decodeOwlA=function(e,t){let r=(0,i.decodeOwl)(e).join(",");return t.split(/,/g).forEach((e=>{const i=e.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);(0,n.assertArgument)(null!==i,"internal error parsing accents","accents",t);let o=0;const a=(0,s.decodeBits)(parseInt(i[3]),i[4]),c=parseInt(i[2]),u=new RegExp(`([${i[1]}])`,"g");r=r.replace(u,((e,t)=>(0==--a[o]&&(t=String.fromCharCode(t.charCodeAt(0),c),o++),t)))})),r.split(",")}},659:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordlists=t.WordlistOwlA=t.WordlistOwl=t.LangEn=t.Wordlist=void 0;var n=r(1208);Object.defineProperty(t,"Wordlist",{enumerable:!0,get:function(){return n.Wordlist}});var s=r(847);Object.defineProperty(t,"LangEn",{enumerable:!0,get:function(){return s.LangEn}});var i=r(1978);Object.defineProperty(t,"WordlistOwl",{enumerable:!0,get:function(){return i.WordlistOwl}});var o=r(9766);Object.defineProperty(t,"WordlistOwlA",{enumerable:!0,get:function(){return o.WordlistOwlA}});var a=r(9669);Object.defineProperty(t,"wordlists",{enumerable:!0,get:function(){return a.wordlists}})},847:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LangEn=void 0;const n=r(1978);let s=null;class i extends n.WordlistOwl{constructor(){super("en","0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-PM&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryFN Noc|PutQuirySSue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO","0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60")}static wordlist(){return null==s&&(s=new i),s}}t.LangEn=i},1978:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WordlistOwl=void 0;const n=r(8336),s=r(2120),i=r(2629),o=r(1208);class a extends o.Wordlist{#r;#It;constructor(e,t,r){super(e),this.#r=t,this.#It=r,this.#_t=null}get _data(){return this.#r}_decodeWords(){return(0,i.decodeOwl)(this.#r)}#_t;#Bt(){if(null==this.#_t){const e=this._decodeWords();if((0,n.id)(e.join("\n")+"\n")!==this.#It)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#_t=e}return this.#_t}getWord(e){const t=this.#Bt();return(0,s.assertArgument)(e>=0&&e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WordlistOwlA=void 0;const n=r(1978),s=r(4603);class i extends n.WordlistOwl{#jt;constructor(e,t,r,n){super(e,t,n),this.#jt=r}get _accent(){return this.#jt}_decodeWords(){return(0,s.decodeOwlA)(this._data,this._accent)}}t.WordlistOwlA=i},1208:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Wordlist=void 0;const n=r(2120);t.Wordlist=class{locale;constructor(e){(0,n.defineProperties)(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}},9669:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordlists=void 0;const n=r(847);t.wordlists={en:n.LangEn.wordlist()}}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{const e=r(2592),{v4:t}=r(1614),n=r(6606),{GelatoRelay:s}=r(3352),i=new n("56bc83149af81d0da2d4",{cluster:"ap1"});i.connection.bind("error",(e=>{console.error("Pusher connection error:",e)})),jQuery(document).ready((r=>{function n(){if("esprit_pay"===r("input[name='payment_method']:checked").val()){const n=t();r(document).ajaxComplete((async()=>{r("#place_order").hide();const t=await e.toDataURL(`paymentId=${n}&address=${data.address}&amount=${data.amount}`,{margin:0});r(".esprit-container-container").length||r(".esprit-container").append(`
Pay with Esprit and earn an instant 2% cashback!
To pay, scan the QR code with your Esprit App and confirm the payment. Leave this window open during payment.
`),(await i.allChannels()).map((e=>e.name)).includes(n)||(console.log("pusher channel:",n),i.subscribe(n).bind("payment-submitted",(async e=>{let t=e.message;console.log("pusher taskId:",t),await i.unsubscribe(n),r(".esprit-container-container").hide(),r(".esprit-container").append('
Payment is processing...
(Please do not close this window)
');const o=new s,a=new Promise(((e,r)=>{let n=0;const s=setInterval((async()=>{n++,n>100&&(clearInterval(s),r("Max retry reached"));const i=await o.getTaskStatus(t);console.log("Task Status",i),"ExecSuccess"==i?.taskState&&(clearInterval(s),e(i))}),500)})),c=await a;console.log("taskStatus.taskState:",c.taskState),"ExecSuccess"==c.taskState&&(r("#place_order").show(),await new Promise((e=>setTimeout(e,1e3))),r("#place_order").click())})))}))}else r(document).unbind("ajaxComplete"),r("#place_order").show()}n(),r("form.checkout").on("change",'input[name="payment_method"]',(function(){selectedPayment=r(this).val(),"esprit_pay"===selectedPayment?n():(r(document).unbind("ajaxComplete"),r("#place_order").show()),r(document.body).trigger("update_checkout")}))}))})()})(); \ No newline at end of file diff --git a/esprit-woo/esprit-pay.php b/esprit-woo/esprit-pay.php index 929fdb5..fa38b4c 100644 --- a/esprit-woo/esprit-pay.php +++ b/esprit-woo/esprit-pay.php @@ -30,7 +30,7 @@ function my_gateway_init() { class WC_My_Gateway extends WC_Payment_Gateway { public function __construct() { $this->id = 'esprit_pay'; - $this->icon = apply_filters( 'esprit_pay_icon', plugins_url('/assets/icon.png', __FILE__ ) ); + $this->icon = apply_filters( 'esprit_pay_icon', plugins_url('/assets/logosmall.svg', __FILE__ ) ); $this->has_fields = false; $this->method_title = 'Esprit Pay'; $this->method_description = 'Accept payment from anyone with a Web3 wallet. Supports bank deposits in USD, EUR, GBP, AUD, CAD, and TWD'; @@ -44,15 +44,15 @@ public function __construct() { add_action( 'wp_enqueue_scripts', function() { global $woocommerce; $cart_order_total = $woocommerce->cart->total; - wp_enqueue_style('style', plugin_dir_url(__FILE__)."src/style.css"); + wp_enqueue_style('style', plugin_dir_url(__FILE__)."src/style.css", [], "1.6"); // $script_path = plugin_dir_url(__FILE__)."src/index.js"; $script_path = plugin_dir_url(__FILE__)."build/index.js"; - wp_register_script('script_handler', $script_path, [], "1.2", true); + wp_register_script('script_handler', $script_path, [], "1.6", true); // change version if script cached and loading old script wp_localize_script('script_handler', 'data', [ 'amount' => $cart_order_total, 'address' => $this->evmaddress, ]); - wp_enqueue_script('script_handler', plugin_dir_url(__FILE__)."build/index.js", [], "1.2", true); + wp_enqueue_script('script_handler', plugin_dir_url(__FILE__)."build/index.js", [], "1.6", true); }); add_filter('woocommerce_gateway_description', function($description, $payment_id) { diff --git a/esprit-woo/package-lock.json b/esprit-woo/package-lock.json index f013251..b1614a0 100644 --- a/esprit-woo/package-lock.json +++ b/esprit-woo/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@gelatonetwork/relay-sdk": "^5.5.5", "pusher-js": "^8.4.0-rc2", "qrcode": "^1.5.3" }, @@ -25,6 +26,11 @@ "node": ">=0.10.0" } }, + "node_modules/@adraffy/ens-normalize": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.9.2.tgz", + "integrity": "sha512-0h+FrQDqe2Wn+IIGFkTCd4aAwTJ+7834Ek1COohCyV26AXhwQ7WQaz+4F/nLOeVl/3BtWHOHLPsq46V8YB46Eg==" + }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", @@ -2231,6 +2237,29 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@gelatonetwork/relay-sdk": { + "version": "5.5.5", + "resolved": "https://registry.npmjs.org/@gelatonetwork/relay-sdk/-/relay-sdk-5.5.5.tgz", + "integrity": "sha512-aLiN8CmWBTei5JMoSg3LHX3MmB+IoaM+Rw1kkm9x/ECrS6FhWZH1WU76+xvmeIVnbncEUc3xNOQfz7UAwUZI0w==", + "dependencies": { + "axios": "0.27.2", + "ethers": "6.7.0", + "isomorphic-ws": "^5.0.0", + "ws": "^8.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@gelatonetwork/relay-sdk/node_modules/axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "dependencies": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, "node_modules/@hapi/hoek": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", @@ -2726,6 +2755,28 @@ "eslint-scope": "5.1.1" } }, + "node_modules/@noble/hashes": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.2.tgz", + "integrity": "sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, + "node_modules/@noble/secp256k1": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz", + "integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -4949,6 +5000,11 @@ "node": ">=6.0" } }, + "node_modules/aes-js": { + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==" + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -5340,8 +5396,7 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/autoprefixer": { "version": "10.4.16", @@ -6266,7 +6321,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -7262,7 +7316,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, "engines": { "node": ">=0.4.0" } @@ -8718,6 +8771,63 @@ "node": ">= 0.6" } }, + "node_modules/ethers": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.7.0.tgz", + "integrity": "sha512-pxt5hK82RNwcTX2gOZP81t6qVPVspnkpeivwEgQuK9XUvbNtghBnT8GNIb/gPh+WnVSfi8cXC9XlfT8sqc6D6w==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/ethers-io/" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@adraffy/ens-normalize": "1.9.2", + "@noble/hashes": "1.1.2", + "@noble/secp256k1": "1.7.1", + "@types/node": "18.15.13", + "aes-js": "4.0.0-beta.5", + "tslib": "2.4.0", + "ws": "8.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ethers/node_modules/@types/node": { + "version": "18.15.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", + "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" + }, + "node_modules/ethers/node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + }, + "node_modules/ethers/node_modules/ws": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", @@ -9261,7 +9371,6 @@ "version": "1.15.5", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", - "dev": true, "funding": [ { "type": "individual", @@ -9311,7 +9420,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -10893,6 +11001,14 @@ "node": ">=0.10.0" } }, + "node_modules/isomorphic-ws": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz", + "integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==", + "peerDependencies": { + "ws": "*" + } + }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", @@ -12864,7 +12980,6 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, "engines": { "node": ">= 0.6" } @@ -12873,7 +12988,6 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, "dependencies": { "mime-db": "1.52.0" }, @@ -18561,7 +18675,6 @@ "version": "8.16.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", - "dev": true, "engines": { "node": ">=10.0.0" }, diff --git a/esprit-woo/package.json b/esprit-woo/package.json index 1ceff85..3117530 100644 --- a/esprit-woo/package.json +++ b/esprit-woo/package.json @@ -22,6 +22,7 @@ "author": "", "license": "ISC", "dependencies": { + "@gelatonetwork/relay-sdk": "^5.5.5", "pusher-js": "^8.4.0-rc2", "qrcode": "^1.5.3" }, diff --git a/esprit-woo/src/index.js b/esprit-woo/src/index.js index fb80115..01e2475 100644 --- a/esprit-woo/src/index.js +++ b/esprit-woo/src/index.js @@ -1,8 +1,9 @@ const QRCode = require("qrcode"); const { v4: uuidv4 } = require("uuid"); const Pusher = require("pusher-js"); +const { GelatoRelay } = require("@gelatonetwork/relay-sdk"); -const pusher = new Pusher("a29a22e46d485f5f2038", { cluster: "ap3" }); +const pusher = new Pusher("56bc83149af81d0da2d4", { cluster: "ap1" }); pusher.connection.bind("error", (e) => { console.error("Pusher connection error:", e); }); @@ -15,25 +16,62 @@ jQuery(document).ready(($) => { $(document).ajaxComplete(async () => { $("#place_order").hide(); - const dataURL = await QRCode.toDataURL(`paymentId=${paymentId}&amount=0.009678&address=${data.address}&amountUSD=${data.amount}`); + const opts = { + margin: 0, + }; + // example: paymentId=e6844694-b556-4133-a501-dafb915beee9&address=0x0ad11e8600b488aeF8F5E591edf32927c586883b&amount=200 + const dataURL = await QRCode.toDataURL(`paymentId=${paymentId}&address=${data.address}&amount=${data.amount}`, opts); // If the qrcode element exists, then don't append it. Needed or multiple qrcodes will get appended. - if (!$(".esprit-qrcode").length) { - $(".esprit-container").append(``); + if (!$(".esprit-container-container").length) { $(".esprit-container").append( - `
Pay with Esprit and earn an instant 2% cashback!
To pay, scan the QR code with your Esprit App and confirm the payment. Leave this window open during payment.
` + `
Pay with Esprit and earn an instant 2% cashback!
To pay, scan the QR code with your Esprit App and confirm the payment. Leave this window open during payment.
` ); } // If not subscribed, then subcribe. Needed or will execute multiple subscriptions and callback will be executed multiple times. - // subscribe to Pusher - let channels = pusher.allChannels(); - if (!channels.includes(data.paymentId)) { - const channel = pusher.subscribe("my-channel"); //data.paymentId - channel.bind("my-event", async (message) => { - alert(JSON.stringify(message)); - pusher.unsubscribe("my-channel"); //data.paymentId - $("#place_order").show(); - await new Promise((resolve) => setTimeout(resolve, 1000)); - $("#place_order").click(); + let channels = await pusher.allChannels(); + let channelNames = channels.map((i) => i.name); + if (!channelNames.includes(paymentId)) { + console.log("pusher channel:", paymentId); + const channel = pusher.subscribe(paymentId); + channel.bind("payment-submitted", async (pusherData) => { + let taskId = pusherData.message; + console.log("pusher taskId:", taskId); // indicate Pusher message received; this should appear once to indicate we only subscribed once + await pusher.unsubscribe(paymentId); + + // show process payment message + $(".esprit-container-container").hide(); + $(".esprit-container").append( + '
Payment is processing...
(Please do not close this window)
' + ); + // poll GelatoRelay for completed txn + const relay = new GelatoRelay(); + const taskStatusPromise = new Promise((resolve, reject) => { + const maxRetry = 100; + let retryNum = 0; + const interval = setInterval(async () => { + retryNum++; + if (retryNum > maxRetry) { + clearInterval(interval); + reject("Max retry reached"); + } + const taskStatus = await relay.getTaskStatus(taskId); + console.log("Task Status", taskStatus); + if (taskStatus?.taskState == "ExecSuccess") { + clearInterval(interval); + resolve(taskStatus); + } + }, 500); + }); + const taskStatus = await taskStatusPromise; + console.log("taskStatus.taskState:", taskStatus.taskState); + + // click Place Order button if success + // TODO: if taskState == "Cancelled", then display error modal + if (taskStatus.taskState == "ExecSuccess") { + $("#place_order").show(); + await new Promise((resolve) => setTimeout(resolve, 1000)); // seems neccessary + $("#place_order").click(); + } }); } }); diff --git a/esprit-woo/src/style.css b/esprit-woo/src/style.css index c5ef795..6e43bf7 100644 --- a/esprit-woo/src/style.css +++ b/esprit-woo/src/style.css @@ -1,56 +1,56 @@ -.confirmation-modal { - position: fixed; - top: 0; - left: 0; +.esprit-container { width: 100%; height: 100%; - display: flex; - justify-content: center; - align-items: center; - background-color: rgba(0, 0, 0, 0.5); - z-index: 9999; } -.modal-content { +.esprit-container-container { + width: 100%; + height: 100%; display: flex; - flex-direction: column; justify-content: center; align-items: center; - background-color: #fff; - padding: 20px; - border-radius: 4px; - box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); -} - -.confirm-button { - width: 50%; - background-color: rgb(104, 104, 255); - color: white; - border: 0px solid white; - font-size: 16px; - border-radius: 4px; - padding: 12px 16px; + padding-top: 16px; + padding-bottom: 16px; + padding-left: 12px; + padding-right: 16px; + border-radius: 12px; + background-color: #dbd2ef; } .esprit-qrcode { - width: 40%; + width: 37%; } -.esprit-container { +.esprit-text-container { + width: 63%; display: flex; + flex-direction: column; justify-content: center; align-items: center; - width: 100%; -} - -.esprit-text-container { - margin-left: 10px; + padding-left: 16px; } .esprit-text-one { font-weight: bold; font-size: 16px; + color: #595678; +} + +.esprit-text-two { + color: #595678; +} + +.esprit-processing-container { + padding: 16px; + background-color: #dbd2ef; + border-radius: 12px; } -/* .esprit-text-two { -} */ +.esprit-processing-one { + color: #595678; + font-size: 20px; + font-weight: bold; +} +.esprit-processing-two { + color: #595678; +}