@walletconnect/ethereum-provider 2.10.3 → 2.10.4-cbdb72a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(Hr,Vt){typeof exports=="object"&&typeof module<"u"?Vt(exports):typeof define=="function"&&define.amd?define(["exports"],Vt):(Hr=typeof globalThis<"u"?globalThis:Hr||self,Vt(Hr["@walletconnect/ethereum-provider"]={}))})(this,function(Hr){"use strict";var Vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qg(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Bn(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var o=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:function(){return r[i]}})}),t}var Yt={exports:{}},fi=typeof Reflect=="object"?Reflect:null,gh=fi&&typeof fi.apply=="function"?fi.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)},Hs;fi&&typeof fi.ownKeys=="function"?Hs=fi.ownKeys:Object.getOwnPropertySymbols?Hs=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Hs=function(e){return Object.getOwnPropertyNames(e)};function Hg(r){console&&console.warn&&console.warn(r)}var vh=Number.isNaN||function(e){return e!==e};function st(){st.init.call(this)}Yt.exports=st,Yt.exports.once=Vg,st.EventEmitter=st,st.prototype._events=void 0,st.prototype._eventsCount=0,st.prototype._maxListeners=void 0;var yh=10;function Bs(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(st,"defaultMaxListeners",{enumerable:!0,get:function(){return yh},set:function(r){if(typeof r!="number"||r<0||vh(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");yh=r}}),st.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},st.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||vh(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function _h(r){return r._maxListeners===void 0?st.defaultMaxListeners:r._maxListeners}st.prototype.getMaxListeners=function(){return _h(this)},st.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var o=e==="error",a=this._events;if(a!==void 0)o=o&&a.error===void 0;else if(!o)return!1;if(o){var u;if(t.length>0&&(u=t[0]),u instanceof Error)throw u;var f=new Error("Unhandled error."+(u?" ("+u.message+")":""));throw f.context=u,f}var v=a[e];if(v===void 0)return!1;if(typeof v=="function")gh(v,this,t);else for(var p=v.length,w=Dh(v,p),i=0;i<p;++i)gh(w[i],this,t);return!0};function bh(r,e,t,i){var o,a,u;if(Bs(t),a=r._events,a===void 0?(a=r._events=Object.create(null),r._eventsCount=0):(a.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),a=r._events),u=a[e]),u===void 0)u=a[e]=t,++r._eventsCount;else if(typeof u=="function"?u=a[e]=i?[t,u]:[u,t]:i?u.unshift(t):u.push(t),o=_h(r),o>0&&u.length>o&&!u.warned){u.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=r,f.type=e,f.count=u.length,Hg(f)}return r}st.prototype.addListener=function(e,t){return bh(this,e,t,!1)},st.prototype.on=st.prototype.addListener,st.prototype.prependListener=function(e,t){return bh(this,e,t,!0)};function Bg(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function mh(r,e,t){var i={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},o=Bg.bind(i);return o.listener=t,i.wrapFn=o,o}st.prototype.once=function(e,t){return Bs(t),this.on(e,mh(this,e,t)),this},st.prototype.prependOnceListener=function(e,t){return Bs(t),this.prependListener(e,mh(this,e,t)),this},st.prototype.removeListener=function(e,t){var i,o,a,u,f;if(Bs(t),o=this._events,o===void 0)return this;if(i=o[e],i===void 0)return this;if(i===t||i.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,i.listener||t));else if(typeof i!="function"){for(a=-1,u=i.length-1;u>=0;u--)if(i[u]===t||i[u].listener===t){f=i[u].listener,a=u;break}if(a<0)return this;a===0?i.shift():zg(i,a),i.length===1&&(o[e]=i[0]),o.removeListener!==void 0&&this.emit("removeListener",e,f||t)}return this},st.prototype.off=st.prototype.removeListener,st.prototype.removeAllListeners=function(e){var t,i,o;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var a=Object.keys(i),u;for(o=0;o<a.length;++o)u=a[o],u!=="removeListener"&&this.removeAllListeners(u);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=i[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(o=t.length-1;o>=0;o--)this.removeListener(e,t[o]);return this};function wh(r,e,t){var i=r._events;if(i===void 0)return[];var o=i[e];return o===void 0?[]:typeof o=="function"?t?[o.listener||o]:[o]:t?Kg(o):Dh(o,o.length)}st.prototype.listeners=function(e){return wh(this,e,!0)},st.prototype.rawListeners=function(e){return wh(this,e,!1)},st.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):Eh.call(r,e)},st.prototype.listenerCount=Eh;function Eh(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}st.prototype.eventNames=function(){return this._eventsCount>0?Hs(this._events):[]};function Dh(r,e){for(var t=new Array(e),i=0;i<e;++i)t[i]=r[i];return t}function zg(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function Kg(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function Vg(r,e){return new Promise(function(t,i){function o(u){r.removeListener(e,a),i(u)}function a(){typeof r.removeListener=="function"&&r.removeListener("error",o),t([].slice.call(arguments))}Sh(r,e,a,{once:!0}),e!=="error"&&kg(r,o,{once:!0})})}function kg(r,e,t){typeof r.on=="function"&&Sh(r,"error",e,t)}function Sh(r,e,t,i){if(typeof r.on=="function")i.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function o(a){i.once&&r.removeEventListener(e,o),t(a)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var Ea={},zs={},Ne={},xh={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});function e(f,v){var p=f>>>16&65535,w=f&65535,I=v>>>16&65535,S=v&65535;return w*S+(p*S+w*I<<16>>>0)|0}r.mul=Math.imul||e;function t(f,v){return f+v|0}r.add=t;function i(f,v){return f-v|0}r.sub=i;function o(f,v){return f<<v|f>>>32-v}r.rotl=o;function a(f,v){return f<<32-v|f>>>v}r.rotr=a;function u(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f}r.isInteger=Number.isInteger||u,r.MAX_SAFE_INTEGER=9007199254740991,r.isSafeInteger=function(f){return r.isInteger(f)&&f>=-r.MAX_SAFE_INTEGER&&f<=r.MAX_SAFE_INTEGER}})(xh),Object.defineProperty(Ne,"__esModule",{value:!0});var Oh=xh;function Gg(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}Ne.readInt16BE=Gg;function Wg(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}Ne.readUint16BE=Wg;function Yg(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}Ne.readInt16LE=Yg;function Jg(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}Ne.readUint16LE=Jg;function Ih(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}Ne.writeUint16BE=Ih,Ne.writeInt16BE=Ih;function Ph(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}Ne.writeUint16LE=Ph,Ne.writeInt16LE=Ph;function Da(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}Ne.readInt32BE=Da;function Sa(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}Ne.readUint32BE=Sa;function xa(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}Ne.readInt32LE=xa;function Oa(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}Ne.readUint32LE=Oa;function Ks(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}Ne.writeUint32BE=Ks,Ne.writeInt32BE=Ks;function Vs(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}Ne.writeUint32LE=Vs,Ne.writeInt32LE=Vs;function Qg(r,e){e===void 0&&(e=0);var t=Da(r,e),i=Da(r,e+4);return t*4294967296+i-(i>>31)*4294967296}Ne.readInt64BE=Qg;function Xg(r,e){e===void 0&&(e=0);var t=Sa(r,e),i=Sa(r,e+4);return t*4294967296+i}Ne.readUint64BE=Xg;function Zg(r,e){e===void 0&&(e=0);var t=xa(r,e),i=xa(r,e+4);return i*4294967296+t-(t>>31)*4294967296}Ne.readInt64LE=Zg;function e0(r,e){e===void 0&&(e=0);var t=Oa(r,e),i=Oa(r,e+4);return i*4294967296+t}Ne.readUint64LE=e0;function Ch(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Ks(r/4294967296>>>0,e,t),Ks(r>>>0,e,t+4),e}Ne.writeUint64BE=Ch,Ne.writeInt64BE=Ch;function Ah(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Vs(r>>>0,e,t),Vs(r/4294967296>>>0,e,t+4),e}Ne.writeUint64LE=Ah,Ne.writeInt64LE=Ah;function t0(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,o=1,a=r/8+t-1;a>=t;a--)i+=e[a]*o,o*=256;return i}Ne.readUintBE=t0;function r0(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,o=1,a=t;a<t+r/8;a++)i+=e[a]*o,o*=256;return i}Ne.readUintLE=r0;function n0(r,e,t,i){if(t===void 0&&(t=new Uint8Array(r/8)),i===void 0&&(i=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Oh.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var o=1,a=r/8+i-1;a>=i;a--)t[a]=e/o&255,o*=256;return t}Ne.writeUintBE=n0;function i0(r,e,t,i){if(t===void 0&&(t=new Uint8Array(r/8)),i===void 0&&(i=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Oh.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var o=1,a=i;a<i+r/8;a++)t[a]=e/o&255,o*=256;return t}Ne.writeUintLE=i0;function s0(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}Ne.readFloat32BE=s0;function o0(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}Ne.readFloat32LE=o0;function a0(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}Ne.readFloat64BE=a0;function c0(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}Ne.readFloat64LE=c0;function u0(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(t,r),e}Ne.writeFloat32BE=u0;function h0(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(t,r,!0),e}Ne.writeFloat32LE=h0;function l0(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(t,r),e}Ne.writeFloat64BE=l0;function f0(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(t,r,!0),e}Ne.writeFloat64LE=f0;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});function d0(r){for(var e=0;e<r.length;e++)r[e]=0;return r}Dr.wipe=d0,Object.defineProperty(zs,"__esModule",{value:!0});var Zt=Ne,Ia=Dr,p0=20;function g0(r,e,t){for(var i=1634760805,o=857760878,a=2036477234,u=1797285236,f=t[3]<<24|t[2]<<16|t[1]<<8|t[0],v=t[7]<<24|t[6]<<16|t[5]<<8|t[4],p=t[11]<<24|t[10]<<16|t[9]<<8|t[8],w=t[15]<<24|t[14]<<16|t[13]<<8|t[12],I=t[19]<<24|t[18]<<16|t[17]<<8|t[16],S=t[23]<<24|t[22]<<16|t[21]<<8|t[20],C=t[27]<<24|t[26]<<16|t[25]<<8|t[24],R=t[31]<<24|t[30]<<16|t[29]<<8|t[28],B=e[3]<<24|e[2]<<16|e[1]<<8|e[0],K=e[7]<<24|e[6]<<16|e[5]<<8|e[4],se=e[11]<<24|e[10]<<16|e[9]<<8|e[8],$=e[15]<<24|e[14]<<16|e[13]<<8|e[12],U=i,x=o,T=a,E=u,h=f,b=v,G=p,Y=w,ie=I,ce=S,de=C,m=R,P=B,ee=K,Q=se,V=$,k=0;k<p0;k+=2)U=U+h|0,P^=U,P=P>>>32-16|P<<16,ie=ie+P|0,h^=ie,h=h>>>32-12|h<<12,x=x+b|0,ee^=x,ee=ee>>>32-16|ee<<16,ce=ce+ee|0,b^=ce,b=b>>>32-12|b<<12,T=T+G|0,Q^=T,Q=Q>>>32-16|Q<<16,de=de+Q|0,G^=de,G=G>>>32-12|G<<12,E=E+Y|0,V^=E,V=V>>>32-16|V<<16,m=m+V|0,Y^=m,Y=Y>>>32-12|Y<<12,T=T+G|0,Q^=T,Q=Q>>>32-8|Q<<8,de=de+Q|0,G^=de,G=G>>>32-7|G<<7,E=E+Y|0,V^=E,V=V>>>32-8|V<<8,m=m+V|0,Y^=m,Y=Y>>>32-7|Y<<7,x=x+b|0,ee^=x,ee=ee>>>32-8|ee<<8,ce=ce+ee|0,b^=ce,b=b>>>32-7|b<<7,U=U+h|0,P^=U,P=P>>>32-8|P<<8,ie=ie+P|0,h^=ie,h=h>>>32-7|h<<7,U=U+b|0,V^=U,V=V>>>32-16|V<<16,de=de+V|0,b^=de,b=b>>>32-12|b<<12,x=x+G|0,P^=x,P=P>>>32-16|P<<16,m=m+P|0,G^=m,G=G>>>32-12|G<<12,T=T+Y|0,ee^=T,ee=ee>>>32-16|ee<<16,ie=ie+ee|0,Y^=ie,Y=Y>>>32-12|Y<<12,E=E+h|0,Q^=E,Q=Q>>>32-16|Q<<16,ce=ce+Q|0,h^=ce,h=h>>>32-12|h<<12,T=T+Y|0,ee^=T,ee=ee>>>32-8|ee<<8,ie=ie+ee|0,Y^=ie,Y=Y>>>32-7|Y<<7,E=E+h|0,Q^=E,Q=Q>>>32-8|Q<<8,ce=ce+Q|0,h^=ce,h=h>>>32-7|h<<7,x=x+G|0,P^=x,P=P>>>32-8|P<<8,m=m+P|0,G^=m,G=G>>>32-7|G<<7,U=U+b|0,V^=U,V=V>>>32-8|V<<8,de=de+V|0,b^=de,b=b>>>32-7|b<<7;Zt.writeUint32LE(U+i|0,r,0),Zt.writeUint32LE(x+o|0,r,4),Zt.writeUint32LE(T+a|0,r,8),Zt.writeUint32LE(E+u|0,r,12),Zt.writeUint32LE(h+f|0,r,16),Zt.writeUint32LE(b+v|0,r,20),Zt.writeUint32LE(G+p|0,r,24),Zt.writeUint32LE(Y+w|0,r,28),Zt.writeUint32LE(ie+I|0,r,32),Zt.writeUint32LE(ce+S|0,r,36),Zt.writeUint32LE(de+C|0,r,40),Zt.writeUint32LE(m+R|0,r,44),Zt.writeUint32LE(P+B|0,r,48),Zt.writeUint32LE(ee+K|0,r,52),Zt.writeUint32LE(Q+se|0,r,56),Zt.writeUint32LE(V+$|0,r,60)}function Th(r,e,t,i,o){if(o===void 0&&(o=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<t.length)throw new Error("ChaCha: destination is shorter than source");var a,u;if(o===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),u=a.length-e.length,a.set(e,u)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,u=o}for(var f=new Uint8Array(64),v=0;v<t.length;v+=64){g0(f,a,r);for(var p=v;p<v+64&&p<t.length;p++)i[p]=t[p]^f[p-v];y0(a,0,u)}return Ia.wipe(f),o===0&&Ia.wipe(a),i}zs.streamXOR=Th;function v0(r,e,t,i){return i===void 0&&(i=0),Ia.wipe(t),Th(r,e,t,t,i)}zs.stream=v0;function y0(r,e,t){for(var i=1;t--;)i=i+(r[e]&255)|0,r[e]=i&255,i>>>=8,e++;if(i>0)throw new Error("ChaCha: counter overflow")}var Rh={},On={};Object.defineProperty(On,"__esModule",{value:!0});function _0(r,e,t){return~(r-1)&e|r-1&t}On.select=_0;function b0(r,e){return(r|0)-(e|0)-1>>>31&1}On.lessOrEqual=b0;function Nh(r,e){if(r.length!==e.length)return 0;for(var t=0,i=0;i<r.length;i++)t|=r[i]^e[i];return 1&t-1>>>8}On.compare=Nh;function m0(r,e){return r.length===0||e.length===0?!1:Nh(r,e)!==0}On.equal=m0,function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=On,t=Dr;r.DIGEST_LENGTH=16;var i=function(){function u(f){this.digestLength=r.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var v=f[0]|f[1]<<8;this._r[0]=v&8191;var p=f[2]|f[3]<<8;this._r[1]=(v>>>13|p<<3)&8191;var w=f[4]|f[5]<<8;this._r[2]=(p>>>10|w<<6)&7939;var I=f[6]|f[7]<<8;this._r[3]=(w>>>7|I<<9)&8191;var S=f[8]|f[9]<<8;this._r[4]=(I>>>4|S<<12)&255,this._r[5]=S>>>1&8190;var C=f[10]|f[11]<<8;this._r[6]=(S>>>14|C<<2)&8191;var R=f[12]|f[13]<<8;this._r[7]=(C>>>11|R<<5)&8065;var B=f[14]|f[15]<<8;this._r[8]=(R>>>8|B<<8)&8191,this._r[9]=B>>>5&127,this._pad[0]=f[16]|f[17]<<8,this._pad[1]=f[18]|f[19]<<8,this._pad[2]=f[20]|f[21]<<8,this._pad[3]=f[22]|f[23]<<8,this._pad[4]=f[24]|f[25]<<8,this._pad[5]=f[26]|f[27]<<8,this._pad[6]=f[28]|f[29]<<8,this._pad[7]=f[30]|f[31]<<8}return u.prototype._blocks=function(f,v,p){for(var w=this._fin?0:2048,I=this._h[0],S=this._h[1],C=this._h[2],R=this._h[3],B=this._h[4],K=this._h[5],se=this._h[6],$=this._h[7],U=this._h[8],x=this._h[9],T=this._r[0],E=this._r[1],h=this._r[2],b=this._r[3],G=this._r[4],Y=this._r[5],ie=this._r[6],ce=this._r[7],de=this._r[8],m=this._r[9];p>=16;){var P=f[v+0]|f[v+1]<<8;I+=P&8191;var ee=f[v+2]|f[v+3]<<8;S+=(P>>>13|ee<<3)&8191;var Q=f[v+4]|f[v+5]<<8;C+=(ee>>>10|Q<<6)&8191;var V=f[v+6]|f[v+7]<<8;R+=(Q>>>7|V<<9)&8191;var k=f[v+8]|f[v+9]<<8;B+=(V>>>4|k<<12)&8191,K+=k>>>1&8191;var J=f[v+10]|f[v+11]<<8;se+=(k>>>14|J<<2)&8191;var re=f[v+12]|f[v+13]<<8;$+=(J>>>11|re<<5)&8191;var me=f[v+14]|f[v+15]<<8;U+=(re>>>8|me<<8)&8191,x+=me>>>5|w;var oe=0,we=oe;we+=I*T,we+=S*(5*m),we+=C*(5*de),we+=R*(5*ce),we+=B*(5*ie),oe=we>>>13,we&=8191,we+=K*(5*Y),we+=se*(5*G),we+=$*(5*b),we+=U*(5*h),we+=x*(5*E),oe+=we>>>13,we&=8191;var le=oe;le+=I*E,le+=S*T,le+=C*(5*m),le+=R*(5*de),le+=B*(5*ce),oe=le>>>13,le&=8191,le+=K*(5*ie),le+=se*(5*Y),le+=$*(5*G),le+=U*(5*b),le+=x*(5*h),oe+=le>>>13,le&=8191;var _e=oe;_e+=I*h,_e+=S*E,_e+=C*T,_e+=R*(5*m),_e+=B*(5*de),oe=_e>>>13,_e&=8191,_e+=K*(5*ce),_e+=se*(5*ie),_e+=$*(5*Y),_e+=U*(5*G),_e+=x*(5*b),oe+=_e>>>13,_e&=8191;var H=oe;H+=I*b,H+=S*h,H+=C*E,H+=R*T,H+=B*(5*m),oe=H>>>13,H&=8191,H+=K*(5*de),H+=se*(5*ce),H+=$*(5*ie),H+=U*(5*Y),H+=x*(5*G),oe+=H>>>13,H&=8191;var q=oe;q+=I*G,q+=S*b,q+=C*h,q+=R*E,q+=B*T,oe=q>>>13,q&=8191,q+=K*(5*m),q+=se*(5*de),q+=$*(5*ce),q+=U*(5*ie),q+=x*(5*Y),oe+=q>>>13,q&=8191;var F=oe;F+=I*Y,F+=S*G,F+=C*b,F+=R*h,F+=B*E,oe=F>>>13,F&=8191,F+=K*T,F+=se*(5*m),F+=$*(5*de),F+=U*(5*ce),F+=x*(5*ie),oe+=F>>>13,F&=8191;var d=oe;d+=I*ie,d+=S*Y,d+=C*G,d+=R*b,d+=B*h,oe=d>>>13,d&=8191,d+=K*E,d+=se*T,d+=$*(5*m),d+=U*(5*de),d+=x*(5*ce),oe+=d>>>13,d&=8191;var A=oe;A+=I*ce,A+=S*ie,A+=C*Y,A+=R*G,A+=B*b,oe=A>>>13,A&=8191,A+=K*h,A+=se*E,A+=$*T,A+=U*(5*m),A+=x*(5*de),oe+=A>>>13,A&=8191;var ae=oe;ae+=I*de,ae+=S*ce,ae+=C*ie,ae+=R*Y,ae+=B*G,oe=ae>>>13,ae&=8191,ae+=K*b,ae+=se*h,ae+=$*E,ae+=U*T,ae+=x*(5*m),oe+=ae>>>13,ae&=8191;var fe=oe;fe+=I*m,fe+=S*de,fe+=C*ce,fe+=R*ie,fe+=B*Y,oe=fe>>>13,fe&=8191,fe+=K*G,fe+=se*b,fe+=$*h,fe+=U*E,fe+=x*T,oe+=fe>>>13,fe&=8191,oe=(oe<<2)+oe|0,oe=oe+we|0,we=oe&8191,oe=oe>>>13,le+=oe,I=we,S=le,C=_e,R=H,B=q,K=F,se=d,$=A,U=ae,x=fe,v+=16,p-=16}this._h[0]=I,this._h[1]=S,this._h[2]=C,this._h[3]=R,this._h[4]=B,this._h[5]=K,this._h[6]=se,this._h[7]=$,this._h[8]=U,this._h[9]=x},u.prototype.finish=function(f,v){v===void 0&&(v=0);var p=new Uint16Array(10),w,I,S,C;if(this._leftover){for(C=this._leftover,this._buffer[C++]=1;C<16;C++)this._buffer[C]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(w=this._h[1]>>>13,this._h[1]&=8191,C=2;C<10;C++)this._h[C]+=w,w=this._h[C]>>>13,this._h[C]&=8191;for(this._h[0]+=w*5,w=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=w,w=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=w,p[0]=this._h[0]+5,w=p[0]>>>13,p[0]&=8191,C=1;C<10;C++)p[C]=this._h[C]+w,w=p[C]>>>13,p[C]&=8191;for(p[9]-=8192,I=(w^1)-1,C=0;C<10;C++)p[C]&=I;for(I=~I,C=0;C<10;C++)this._h[C]=this._h[C]&I|p[C];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,S=this._h[0]+this._pad[0],this._h[0]=S&65535,C=1;C<8;C++)S=(this._h[C]+this._pad[C]|0)+(S>>>16)|0,this._h[C]=S&65535;return f[v+0]=this._h[0]>>>0,f[v+1]=this._h[0]>>>8,f[v+2]=this._h[1]>>>0,f[v+3]=this._h[1]>>>8,f[v+4]=this._h[2]>>>0,f[v+5]=this._h[2]>>>8,f[v+6]=this._h[3]>>>0,f[v+7]=this._h[3]>>>8,f[v+8]=this._h[4]>>>0,f[v+9]=this._h[4]>>>8,f[v+10]=this._h[5]>>>0,f[v+11]=this._h[5]>>>8,f[v+12]=this._h[6]>>>0,f[v+13]=this._h[6]>>>8,f[v+14]=this._h[7]>>>0,f[v+15]=this._h[7]>>>8,this._finished=!0,this},u.prototype.update=function(f){var v=0,p=f.length,w;if(this._leftover){w=16-this._leftover,w>p&&(w=p);for(var I=0;I<w;I++)this._buffer[this._leftover+I]=f[v+I];if(p-=w,v+=w,this._leftover+=w,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(p>=16&&(w=p-p%16,this._blocks(f,v,w),v+=w,p-=w),p){for(var I=0;I<p;I++)this._buffer[this._leftover+I]=f[v+I];this._leftover+=p}return this},u.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var f=new Uint8Array(16);return this.finish(f),f},u.prototype.clean=function(){return t.wipe(this._buffer),t.wipe(this._r),t.wipe(this._h),t.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},u}();r.Poly1305=i;function o(u,f){var v=new i(u);v.update(f);var p=v.digest();return v.clean(),p}r.oneTimeAuth=o;function a(u,f){return u.length!==r.DIGEST_LENGTH||f.length!==r.DIGEST_LENGTH?!1:e.equal(u,f)}r.equal=a}(Rh),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=zs,t=Rh,i=Dr,o=Ne,a=On;r.KEY_LENGTH=32,r.NONCE_LENGTH=12,r.TAG_LENGTH=16;var u=new Uint8Array(16),f=function(){function v(p){if(this.nonceLength=r.NONCE_LENGTH,this.tagLength=r.TAG_LENGTH,p.length!==r.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(p)}return v.prototype.seal=function(p,w,I,S){if(p.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var C=new Uint8Array(16);C.set(p,C.length-p.length);var R=new Uint8Array(32);e.stream(this._key,C,R,4);var B=w.length+this.tagLength,K;if(S){if(S.length!==B)throw new Error("ChaCha20Poly1305: incorrect destination length");K=S}else K=new Uint8Array(B);return e.streamXOR(this._key,C,w,K,4),this._authenticate(K.subarray(K.length-this.tagLength,K.length),R,K.subarray(0,K.length-this.tagLength),I),i.wipe(C),K},v.prototype.open=function(p,w,I,S){if(p.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(w.length<this.tagLength)return null;var C=new Uint8Array(16);C.set(p,C.length-p.length);var R=new Uint8Array(32);e.stream(this._key,C,R,4);var B=new Uint8Array(this.tagLength);if(this._authenticate(B,R,w.subarray(0,w.length-this.tagLength),I),!a.equal(B,w.subarray(w.length-this.tagLength,w.length)))return null;var K=w.length-this.tagLength,se;if(S){if(S.length!==K)throw new Error("ChaCha20Poly1305: incorrect destination length");se=S}else se=new Uint8Array(K);return e.streamXOR(this._key,C,w.subarray(0,w.length-this.tagLength),se,4),i.wipe(C),se},v.prototype.clean=function(){return i.wipe(this._key),this},v.prototype._authenticate=function(p,w,I,S){var C=new t.Poly1305(w);S&&(C.update(S),S.length%16>0&&C.update(u.subarray(S.length%16))),C.update(I),I.length%16>0&&C.update(u.subarray(I.length%16));var R=new Uint8Array(8);S&&o.writeUint64LE(S.length,R),C.update(R),o.writeUint64LE(I.length,R),C.update(R);for(var B=C.digest(),K=0;K<B.length;K++)p[K]=B[K];C.clean(),i.wipe(B),i.wipe(R)},v}();r.ChaCha20Poly1305=f}(Ea);var $h={},Ki={},Pa={};Object.defineProperty(Pa,"__esModule",{value:!0});function w0(r){return typeof r.saveState<"u"&&typeof r.restoreState<"u"&&typeof r.cleanSavedState<"u"}Pa.isSerializableHash=w0,Object.defineProperty(Ki,"__esModule",{value:!0});var Qr=Pa,E0=On,D0=Dr,Fh=function(){function r(e,t){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);t.length>this.blockSize?this._inner.update(t).finish(i).clean():i.set(t);for(var o=0;o<i.length;o++)i[o]^=54;this._inner.update(i);for(var o=0;o<i.length;o++)i[o]^=106;this._outer.update(i),Qr.isSerializableHash(this._inner)&&Qr.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),D0.wipe(i)}return r.prototype.reset=function(){if(!Qr.isSerializableHash(this._inner)||!Qr.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},r.prototype.clean=function(){Qr.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Qr.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},r.prototype.update=function(e){return this._inner.update(e),this},r.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(!Qr.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},r.prototype.restoreState=function(e){if(!Qr.isSerializableHash(this._inner)||!Qr.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},r.prototype.cleanSavedState=function(e){if(!Qr.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},r}();Ki.HMAC=Fh;function S0(r,e,t){var i=new Fh(r,e);i.update(t);var o=i.digest();return i.clean(),o}Ki.hmac=S0,Ki.equal=E0.equal,Object.defineProperty($h,"__esModule",{value:!0});var Lh=Ki,Uh=Dr,x0=function(){function r(e,t,i,o){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=o;var a=Lh.hmac(this._hash,i,t);this._hmac=new Lh.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return r.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},r.prototype.expand=function(e){for(var t=new Uint8Array(e),i=0;i<t.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[i]=this._buffer[this._bufpos++];return t},r.prototype.clean=function(){this._hmac.clean(),Uh.wipe(this._buffer),Uh.wipe(this._counter),this._bufpos=0},r}(),O0=$h.HKDF=x0,di={},ks={},Gs={};Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.BrowserRandomSource=void 0;const jh=65536;class I0{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const t=new Uint8Array(e);for(let i=0;i<t.length;i+=jh)this._crypto.getRandomValues(t.subarray(i,i+Math.min(t.length-i,jh)));return t}}Gs.BrowserRandomSource=I0;function P0(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ws={},C0={},A0=Object.freeze({__proto__:null,default:C0}),T0=Bn(A0);Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.NodeRandomSource=void 0;const R0=Dr;class N0{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof P0<"u"){const e=T0;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(e);for(let o=0;o<i.length;o++)i[o]=t[o];return(0,R0.wipe)(t),i}}Ws.NodeRandomSource=N0,Object.defineProperty(ks,"__esModule",{value:!0}),ks.SystemRandomSource=void 0;const $0=Gs,F0=Ws;class L0{constructor(){if(this.isAvailable=!1,this.name="",this._source=new $0.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new F0.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}ks.SystemRandomSource=L0,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.randomStringForEntropy=r.randomString=r.randomUint32=r.randomBytes=r.defaultRandomSource=void 0;const e=ks,t=Ne,i=Dr;r.defaultRandomSource=new e.SystemRandomSource;function o(p,w=r.defaultRandomSource){return w.randomBytes(p)}r.randomBytes=o;function a(p=r.defaultRandomSource){const w=o(4,p),I=(0,t.readUint32LE)(w);return(0,i.wipe)(w),I}r.randomUint32=a;const u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function f(p,w=u,I=r.defaultRandomSource){if(w.length<2)throw new Error("randomString charset is too short");if(w.length>256)throw new Error("randomString charset is too long");let S="";const C=w.length,R=256-256%C;for(;p>0;){const B=o(Math.ceil(p*256/R),I);for(let K=0;K<B.length&&p>0;K++){const se=B[K];se<R&&(S+=w.charAt(se%C),p--)}(0,i.wipe)(B)}return S}r.randomString=f;function v(p,w=u,I=r.defaultRandomSource){const S=Math.ceil(p/(Math.log(w.length)/Math.LN2));return f(S,w,I)}r.randomStringForEntropy=v}(di);var Ys={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Ne,t=Dr;r.DIGEST_LENGTH=32,r.BLOCK_SIZE=64;var i=function(){function f(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return f.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},f.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},f.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._temp),this.reset()},f.prototype.update=function(v,p){if(p===void 0&&(p=v.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var w=0;if(this._bytesHashed+=p,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&p>0;)this._buffer[this._bufferLength++]=v[w++],p--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(p>=this.blockSize&&(w=a(this._temp,this._state,v,w,p),p%=this.blockSize);p>0;)this._buffer[this._bufferLength++]=v[w++],p--;return this},f.prototype.finish=function(v){if(!this._finished){var p=this._bytesHashed,w=this._bufferLength,I=p/536870912|0,S=p<<3,C=p%64<56?64:128;this._buffer[w]=128;for(var R=w+1;R<C-8;R++)this._buffer[R]=0;e.writeUint32BE(I,this._buffer,C-8),e.writeUint32BE(S,this._buffer,C-4),a(this._temp,this._state,this._buffer,0,C),this._finished=!0}for(var R=0;R<this.digestLength/4;R++)e.writeUint32BE(this._state[R],v,R*4);return this},f.prototype.digest=function(){var v=new Uint8Array(this.digestLength);return this.finish(v),v},f.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(v){return this._state.set(v.state),this._bufferLength=v.bufferLength,v.buffer&&this._buffer.set(v.buffer),this._bytesHashed=v.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(v){t.wipe(v.state),v.buffer&&t.wipe(v.buffer),v.bufferLength=0,v.bytesHashed=0},f}();r.SHA256=i;var o=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(f,v,p,w,I){for(;I>=64;){for(var S=v[0],C=v[1],R=v[2],B=v[3],K=v[4],se=v[5],$=v[6],U=v[7],x=0;x<16;x++){var T=w+x*4;f[x]=e.readUint32BE(p,T)}for(var x=16;x<64;x++){var E=f[x-2],h=(E>>>17|E<<32-17)^(E>>>19|E<<32-19)^E>>>10;E=f[x-15];var b=(E>>>7|E<<32-7)^(E>>>18|E<<32-18)^E>>>3;f[x]=(h+f[x-7]|0)+(b+f[x-16]|0)}for(var x=0;x<64;x++){var h=(((K>>>6|K<<26)^(K>>>11|K<<21)^(K>>>25|K<<7))+(K&se^~K&$)|0)+(U+(o[x]+f[x]|0)|0)|0,b=((S>>>2|S<<32-2)^(S>>>13|S<<32-13)^(S>>>22|S<<32-22))+(S&C^S&R^C&R)|0;U=$,$=se,se=K,K=B+h|0,B=R,R=C,C=S,S=h+b|0}v[0]+=S,v[1]+=C,v[2]+=R,v[3]+=B,v[4]+=K,v[5]+=se,v[6]+=$,v[7]+=U,w+=64,I-=64}return w}function u(f){var v=new i;v.update(f);var p=v.digest();return v.clean(),p}r.hash=u})(Ys);var Ca={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.sharedKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.scalarMultBase=r.scalarMult=r.SHARED_KEY_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=void 0;const e=di,t=Dr;r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=32,r.SHARED_KEY_LENGTH=32;function i(x){const T=new Float64Array(16);if(x)for(let E=0;E<x.length;E++)T[E]=x[E];return T}const o=new Uint8Array(32);o[0]=9;const a=i([56129,1]);function u(x){let T=1;for(let E=0;E<16;E++){let h=x[E]+T+65535;T=Math.floor(h/65536),x[E]=h-T*65536}x[0]+=T-1+37*(T-1)}function f(x,T,E){const h=~(E-1);for(let b=0;b<16;b++){const G=h&(x[b]^T[b]);x[b]^=G,T[b]^=G}}function v(x,T){const E=i(),h=i();for(let b=0;b<16;b++)h[b]=T[b];u(h),u(h),u(h);for(let b=0;b<2;b++){E[0]=h[0]-65517;for(let Y=1;Y<15;Y++)E[Y]=h[Y]-65535-(E[Y-1]>>16&1),E[Y-1]&=65535;E[15]=h[15]-32767-(E[14]>>16&1);const G=E[15]>>16&1;E[14]&=65535,f(h,E,1-G)}for(let b=0;b<16;b++)x[2*b]=h[b]&255,x[2*b+1]=h[b]>>8}function p(x,T){for(let E=0;E<16;E++)x[E]=T[2*E]+(T[2*E+1]<<8);x[15]&=32767}function w(x,T,E){for(let h=0;h<16;h++)x[h]=T[h]+E[h]}function I(x,T,E){for(let h=0;h<16;h++)x[h]=T[h]-E[h]}function S(x,T,E){let h,b,G=0,Y=0,ie=0,ce=0,de=0,m=0,P=0,ee=0,Q=0,V=0,k=0,J=0,re=0,me=0,oe=0,we=0,le=0,_e=0,H=0,q=0,F=0,d=0,A=0,ae=0,fe=0,xe=0,Be=0,Ve=0,Ue=0,vt=0,yt=0,Me=E[0],Oe=E[1],$e=E[2],Fe=E[3],qe=E[4],Pe=E[5],Le=E[6],Se=E[7],Ce=E[8],ze=E[9],Ie=E[10],ke=E[11],We=E[12],et=E[13],tt=E[14],Qe=E[15];h=T[0],G+=h*Me,Y+=h*Oe,ie+=h*$e,ce+=h*Fe,de+=h*qe,m+=h*Pe,P+=h*Le,ee+=h*Se,Q+=h*Ce,V+=h*ze,k+=h*Ie,J+=h*ke,re+=h*We,me+=h*et,oe+=h*tt,we+=h*Qe,h=T[1],Y+=h*Me,ie+=h*Oe,ce+=h*$e,de+=h*Fe,m+=h*qe,P+=h*Pe,ee+=h*Le,Q+=h*Se,V+=h*Ce,k+=h*ze,J+=h*Ie,re+=h*ke,me+=h*We,oe+=h*et,we+=h*tt,le+=h*Qe,h=T[2],ie+=h*Me,ce+=h*Oe,de+=h*$e,m+=h*Fe,P+=h*qe,ee+=h*Pe,Q+=h*Le,V+=h*Se,k+=h*Ce,J+=h*ze,re+=h*Ie,me+=h*ke,oe+=h*We,we+=h*et,le+=h*tt,_e+=h*Qe,h=T[3],ce+=h*Me,de+=h*Oe,m+=h*$e,P+=h*Fe,ee+=h*qe,Q+=h*Pe,V+=h*Le,k+=h*Se,J+=h*Ce,re+=h*ze,me+=h*Ie,oe+=h*ke,we+=h*We,le+=h*et,_e+=h*tt,H+=h*Qe,h=T[4],de+=h*Me,m+=h*Oe,P+=h*$e,ee+=h*Fe,Q+=h*qe,V+=h*Pe,k+=h*Le,J+=h*Se,re+=h*Ce,me+=h*ze,oe+=h*Ie,we+=h*ke,le+=h*We,_e+=h*et,H+=h*tt,q+=h*Qe,h=T[5],m+=h*Me,P+=h*Oe,ee+=h*$e,Q+=h*Fe,V+=h*qe,k+=h*Pe,J+=h*Le,re+=h*Se,me+=h*Ce,oe+=h*ze,we+=h*Ie,le+=h*ke,_e+=h*We,H+=h*et,q+=h*tt,F+=h*Qe,h=T[6],P+=h*Me,ee+=h*Oe,Q+=h*$e,V+=h*Fe,k+=h*qe,J+=h*Pe,re+=h*Le,me+=h*Se,oe+=h*Ce,we+=h*ze,le+=h*Ie,_e+=h*ke,H+=h*We,q+=h*et,F+=h*tt,d+=h*Qe,h=T[7],ee+=h*Me,Q+=h*Oe,V+=h*$e,k+=h*Fe,J+=h*qe,re+=h*Pe,me+=h*Le,oe+=h*Se,we+=h*Ce,le+=h*ze,_e+=h*Ie,H+=h*ke,q+=h*We,F+=h*et,d+=h*tt,A+=h*Qe,h=T[8],Q+=h*Me,V+=h*Oe,k+=h*$e,J+=h*Fe,re+=h*qe,me+=h*Pe,oe+=h*Le,we+=h*Se,le+=h*Ce,_e+=h*ze,H+=h*Ie,q+=h*ke,F+=h*We,d+=h*et,A+=h*tt,ae+=h*Qe,h=T[9],V+=h*Me,k+=h*Oe,J+=h*$e,re+=h*Fe,me+=h*qe,oe+=h*Pe,we+=h*Le,le+=h*Se,_e+=h*Ce,H+=h*ze,q+=h*Ie,F+=h*ke,d+=h*We,A+=h*et,ae+=h*tt,fe+=h*Qe,h=T[10],k+=h*Me,J+=h*Oe,re+=h*$e,me+=h*Fe,oe+=h*qe,we+=h*Pe,le+=h*Le,_e+=h*Se,H+=h*Ce,q+=h*ze,F+=h*Ie,d+=h*ke,A+=h*We,ae+=h*et,fe+=h*tt,xe+=h*Qe,h=T[11],J+=h*Me,re+=h*Oe,me+=h*$e,oe+=h*Fe,we+=h*qe,le+=h*Pe,_e+=h*Le,H+=h*Se,q+=h*Ce,F+=h*ze,d+=h*Ie,A+=h*ke,ae+=h*We,fe+=h*et,xe+=h*tt,Be+=h*Qe,h=T[12],re+=h*Me,me+=h*Oe,oe+=h*$e,we+=h*Fe,le+=h*qe,_e+=h*Pe,H+=h*Le,q+=h*Se,F+=h*Ce,d+=h*ze,A+=h*Ie,ae+=h*ke,fe+=h*We,xe+=h*et,Be+=h*tt,Ve+=h*Qe,h=T[13],me+=h*Me,oe+=h*Oe,we+=h*$e,le+=h*Fe,_e+=h*qe,H+=h*Pe,q+=h*Le,F+=h*Se,d+=h*Ce,A+=h*ze,ae+=h*Ie,fe+=h*ke,xe+=h*We,Be+=h*et,Ve+=h*tt,Ue+=h*Qe,h=T[14],oe+=h*Me,we+=h*Oe,le+=h*$e,_e+=h*Fe,H+=h*qe,q+=h*Pe,F+=h*Le,d+=h*Se,A+=h*Ce,ae+=h*ze,fe+=h*Ie,xe+=h*ke,Be+=h*We,Ve+=h*et,Ue+=h*tt,vt+=h*Qe,h=T[15],we+=h*Me,le+=h*Oe,_e+=h*$e,H+=h*Fe,q+=h*qe,F+=h*Pe,d+=h*Le,A+=h*Se,ae+=h*Ce,fe+=h*ze,xe+=h*Ie,Be+=h*ke,Ve+=h*We,Ue+=h*et,vt+=h*tt,yt+=h*Qe,G+=38*le,Y+=38*_e,ie+=38*H,ce+=38*q,de+=38*F,m+=38*d,P+=38*A,ee+=38*ae,Q+=38*fe,V+=38*xe,k+=38*Be,J+=38*Ve,re+=38*Ue,me+=38*vt,oe+=38*yt,b=1,h=G+b+65535,b=Math.floor(h/65536),G=h-b*65536,h=Y+b+65535,b=Math.floor(h/65536),Y=h-b*65536,h=ie+b+65535,b=Math.floor(h/65536),ie=h-b*65536,h=ce+b+65535,b=Math.floor(h/65536),ce=h-b*65536,h=de+b+65535,b=Math.floor(h/65536),de=h-b*65536,h=m+b+65535,b=Math.floor(h/65536),m=h-b*65536,h=P+b+65535,b=Math.floor(h/65536),P=h-b*65536,h=ee+b+65535,b=Math.floor(h/65536),ee=h-b*65536,h=Q+b+65535,b=Math.floor(h/65536),Q=h-b*65536,h=V+b+65535,b=Math.floor(h/65536),V=h-b*65536,h=k+b+65535,b=Math.floor(h/65536),k=h-b*65536,h=J+b+65535,b=Math.floor(h/65536),J=h-b*65536,h=re+b+65535,b=Math.floor(h/65536),re=h-b*65536,h=me+b+65535,b=Math.floor(h/65536),me=h-b*65536,h=oe+b+65535,b=Math.floor(h/65536),oe=h-b*65536,h=we+b+65535,b=Math.floor(h/65536),we=h-b*65536,G+=b-1+37*(b-1),b=1,h=G+b+65535,b=Math.floor(h/65536),G=h-b*65536,h=Y+b+65535,b=Math.floor(h/65536),Y=h-b*65536,h=ie+b+65535,b=Math.floor(h/65536),ie=h-b*65536,h=ce+b+65535,b=Math.floor(h/65536),ce=h-b*65536,h=de+b+65535,b=Math.floor(h/65536),de=h-b*65536,h=m+b+65535,b=Math.floor(h/65536),m=h-b*65536,h=P+b+65535,b=Math.floor(h/65536),P=h-b*65536,h=ee+b+65535,b=Math.floor(h/65536),ee=h-b*65536,h=Q+b+65535,b=Math.floor(h/65536),Q=h-b*65536,h=V+b+65535,b=Math.floor(h/65536),V=h-b*65536,h=k+b+65535,b=Math.floor(h/65536),k=h-b*65536,h=J+b+65535,b=Math.floor(h/65536),J=h-b*65536,h=re+b+65535,b=Math.floor(h/65536),re=h-b*65536,h=me+b+65535,b=Math.floor(h/65536),me=h-b*65536,h=oe+b+65535,b=Math.floor(h/65536),oe=h-b*65536,h=we+b+65535,b=Math.floor(h/65536),we=h-b*65536,G+=b-1+37*(b-1),x[0]=G,x[1]=Y,x[2]=ie,x[3]=ce,x[4]=de,x[5]=m,x[6]=P,x[7]=ee,x[8]=Q,x[9]=V,x[10]=k,x[11]=J,x[12]=re,x[13]=me,x[14]=oe,x[15]=we}function C(x,T){S(x,T,T)}function R(x,T){const E=i();for(let h=0;h<16;h++)E[h]=T[h];for(let h=253;h>=0;h--)C(E,E),h!==2&&h!==4&&S(E,E,T);for(let h=0;h<16;h++)x[h]=E[h]}function B(x,T){const E=new Uint8Array(32),h=new Float64Array(80),b=i(),G=i(),Y=i(),ie=i(),ce=i(),de=i();for(let Q=0;Q<31;Q++)E[Q]=x[Q];E[31]=x[31]&127|64,E[0]&=248,p(h,T);for(let Q=0;Q<16;Q++)G[Q]=h[Q];b[0]=ie[0]=1;for(let Q=254;Q>=0;--Q){const V=E[Q>>>3]>>>(Q&7)&1;f(b,G,V),f(Y,ie,V),w(ce,b,Y),I(b,b,Y),w(Y,G,ie),I(G,G,ie),C(ie,ce),C(de,b),S(b,Y,b),S(Y,G,ce),w(ce,b,Y),I(b,b,Y),C(G,b),I(Y,ie,de),S(b,Y,a),w(b,b,ie),S(Y,Y,b),S(b,ie,de),S(ie,G,h),C(G,ce),f(b,G,V),f(Y,ie,V)}for(let Q=0;Q<16;Q++)h[Q+16]=b[Q],h[Q+32]=Y[Q],h[Q+48]=G[Q],h[Q+64]=ie[Q];const m=h.subarray(32),P=h.subarray(16);R(m,m),S(P,P,m);const ee=new Uint8Array(32);return v(ee,P),ee}r.scalarMult=B;function K(x){return B(x,o)}r.scalarMultBase=K;function se(x){if(x.length!==r.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${r.SECRET_KEY_LENGTH} bytes`);const T=new Uint8Array(x);return{publicKey:K(T),secretKey:T}}r.generateKeyPairFromSeed=se;function $(x){const T=(0,e.randomBytes)(32,x),E=se(T);return(0,t.wipe)(T),E}r.generateKeyPair=$;function U(x,T,E=!1){if(x.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(T.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const h=B(x,T);if(E){let b=0;for(let G=0;G<h.length;G++)b|=h[G];if(b===0)throw new Error("X25519: invalid shared key")}return h}r.sharedKey=U})(Ca);function Aa(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function Mh(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Aa(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function Ta(r,e){e||(e=r.reduce((o,a)=>o+a.length,0));const t=Mh(e);let i=0;for(const o of r)t.set(o,i),i+=o.length;return Aa(t)}function U0(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i<t.length;i++)t[i]=255;for(var o=0;o<r.length;o++){var a=r.charAt(o),u=a.charCodeAt(0);if(t[u]!==255)throw new TypeError(a+" is ambiguous");t[u]=o}var f=r.length,v=r.charAt(0),p=Math.log(f)/Math.log(256),w=Math.log(256)/Math.log(f);function I(R){if(R instanceof Uint8Array||(ArrayBuffer.isView(R)?R=new Uint8Array(R.buffer,R.byteOffset,R.byteLength):Array.isArray(R)&&(R=Uint8Array.from(R))),!(R instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(R.length===0)return"";for(var B=0,K=0,se=0,$=R.length;se!==$&&R[se]===0;)se++,B++;for(var U=($-se)*w+1>>>0,x=new Uint8Array(U);se!==$;){for(var T=R[se],E=0,h=U-1;(T!==0||E<K)&&h!==-1;h--,E++)T+=256*x[h]>>>0,x[h]=T%f>>>0,T=T/f>>>0;if(T!==0)throw new Error("Non-zero carry");K=E,se++}for(var b=U-K;b!==U&&x[b]===0;)b++;for(var G=v.repeat(B);b<U;++b)G+=r.charAt(x[b]);return G}function S(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return new Uint8Array;var B=0;if(R[B]!==" "){for(var K=0,se=0;R[B]===v;)K++,B++;for(var $=(R.length-B)*p+1>>>0,U=new Uint8Array($);R[B];){var x=t[R.charCodeAt(B)];if(x===255)return;for(var T=0,E=$-1;(x!==0||T<se)&&E!==-1;E--,T++)x+=f*U[E]>>>0,U[E]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");se=T,B++}if(R[B]!==" "){for(var h=$-se;h!==$&&U[h]===0;)h++;for(var b=new Uint8Array(K+($-h)),G=K;h!==$;)b[G++]=U[h++];return b}}}function C(R){var B=S(R);if(B)return B;throw new Error(`Non-${e} character`)}return{encode:I,decodeUnsafe:S,decode:C}}var j0=U0,M0=j0;const qh=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},q0=r=>new TextEncoder().encode(r),H0=r=>new TextDecoder().decode(r);class B0{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class z0{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Hh(this,e)}}class K0{constructor(e){this.decoders=e}or(e){return Hh(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Hh=(r,e)=>new K0({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class V0{constructor(e,t,i,o){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=o,this.encoder=new B0(e,t,i),this.decoder=new z0(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Js=({name:r,prefix:e,encode:t,decode:i})=>new V0(r,e,t,i),Vi=({prefix:r,name:e,alphabet:t})=>{const{encode:i,decode:o}=M0(t,e);return Js({prefix:r,name:e,encode:i,decode:a=>qh(o(a))})},k0=(r,e,t,i)=>{const o={};for(let w=0;w<e.length;++w)o[e[w]]=w;let a=r.length;for(;r[a-1]==="=";)--a;const u=new Uint8Array(a*t/8|0);let f=0,v=0,p=0;for(let w=0;w<a;++w){const I=o[r[w]];if(I===void 0)throw new SyntaxError(`Non-${i} character`);v=v<<t|I,f+=t,f>=8&&(f-=8,u[p++]=255&v>>f)}if(f>=t||255&v<<8-f)throw new SyntaxError("Unexpected end of data");return u},G0=(r,e,t)=>{const i=e[e.length-1]==="=",o=(1<<t)-1;let a="",u=0,f=0;for(let v=0;v<r.length;++v)for(f=f<<8|r[v],u+=8;u>t;)u-=t,a+=e[o&f>>u];if(u&&(a+=e[o&f<<t-u]),i)for(;a.length*t&7;)a+="=";return a},Jt=({name:r,prefix:e,bitsPerChar:t,alphabet:i})=>Js({prefix:e,name:r,encode(o){return G0(o,i,t)},decode(o){return k0(o,i,t,r)}}),W0=Js({prefix:"\0",name:"identity",encode:r=>H0(r),decode:r=>q0(r)});var Y0=Object.freeze({__proto__:null,identity:W0});const J0=Jt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Q0=Object.freeze({__proto__:null,base2:J0});const X0=Jt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Z0=Object.freeze({__proto__:null,base8:X0});const ev=Vi({prefix:"9",name:"base10",alphabet:"0123456789"});var tv=Object.freeze({__proto__:null,base10:ev});const rv=Jt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),nv=Jt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var iv=Object.freeze({__proto__:null,base16:rv,base16upper:nv});const sv=Jt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ov=Jt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),av=Jt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),cv=Jt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),uv=Jt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),hv=Jt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),lv=Jt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),fv=Jt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),dv=Jt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var pv=Object.freeze({__proto__:null,base32:sv,base32upper:ov,base32pad:av,base32padupper:cv,base32hex:uv,base32hexupper:hv,base32hexpad:lv,base32hexpadupper:fv,base32z:dv});const gv=Vi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),vv=Vi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var yv=Object.freeze({__proto__:null,base36:gv,base36upper:vv});const _v=Vi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),bv=Vi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var mv=Object.freeze({__proto__:null,base58btc:_v,base58flickr:bv});const wv=Jt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Ev=Jt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Dv=Jt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Sv=Jt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var xv=Object.freeze({__proto__:null,base64:wv,base64pad:Ev,base64url:Dv,base64urlpad:Sv});const Bh=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Ov=Bh.reduce((r,e,t)=>(r[t]=e,r),[]),Iv=Bh.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function Pv(r){return r.reduce((e,t)=>(e+=Ov[t],e),"")}function Cv(r){const e=[];for(const t of r){const i=Iv[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const Av=Js({prefix:"\u{1F680}",name:"base256emoji",encode:Pv,decode:Cv});var Tv=Object.freeze({__proto__:null,base256emoji:Av}),Rv=Kh,zh=128,Nv=127,$v=~Nv,Fv=Math.pow(2,31);function Kh(r,e,t){e=e||[],t=t||0;for(var i=t;r>=Fv;)e[t++]=r&255|zh,r/=128;for(;r&$v;)e[t++]=r&255|zh,r>>>=7;return e[t]=r|0,Kh.bytes=t-i+1,e}var Lv=Ra,Uv=128,Vh=127;function Ra(r,i){var t=0,i=i||0,o=0,a=i,u,f=r.length;do{if(a>=f)throw Ra.bytes=0,new RangeError("Could not decode varint");u=r[a++],t+=o<28?(u&Vh)<<o:(u&Vh)*Math.pow(2,o),o+=7}while(u>=Uv);return Ra.bytes=a-i,t}var jv=Math.pow(2,7),Mv=Math.pow(2,14),qv=Math.pow(2,21),Hv=Math.pow(2,28),Bv=Math.pow(2,35),zv=Math.pow(2,42),Kv=Math.pow(2,49),Vv=Math.pow(2,56),kv=Math.pow(2,63),Gv=function(r){return r<jv?1:r<Mv?2:r<qv?3:r<Hv?4:r<Bv?5:r<zv?6:r<Kv?7:r<Vv?8:r<kv?9:10},Wv={encode:Rv,decode:Lv,encodingLength:Gv},kh=Wv;const Gh=(r,e,t=0)=>(kh.encode(r,e,t),e),Wh=r=>kh.encodingLength(r),Na=(r,e)=>{const t=e.byteLength,i=Wh(r),o=i+Wh(t),a=new Uint8Array(o+t);return Gh(r,a,0),Gh(t,a,i),a.set(e,o),new Yv(r,t,e,a)};class Yv{constructor(e,t,i,o){this.code=e,this.size=t,this.digest=i,this.bytes=o}}const Yh=({name:r,code:e,encode:t})=>new Jv(r,e,t);class Jv{constructor(e,t,i){this.name=e,this.code=t,this.encode=i}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Na(this.code,t):t.then(i=>Na(this.code,i))}else throw Error("Unknown type, must be binary type")}}const Jh=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),Qv=Yh({name:"sha2-256",code:18,encode:Jh("SHA-256")}),Xv=Yh({name:"sha2-512",code:19,encode:Jh("SHA-512")});var Zv=Object.freeze({__proto__:null,sha256:Qv,sha512:Xv});const Qh=0,ey="identity",Xh=qh;var ty=Object.freeze({__proto__:null,identity:{code:Qh,name:ey,encode:Xh,digest:r=>Na(Qh,Xh(r))}});new TextEncoder,new TextDecoder;const Zh={...Y0,...Q0,...Z0,...tv,...iv,...pv,...yv,...mv,...xv,...Tv};({...Zv,...ty});function el(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const tl=el("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),$a=el("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=Mh(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),rl={utf8:tl,"utf-8":tl,hex:Zh.base16,latin1:$a,ascii:$a,binary:$a,...Zh};function pr(r,e="utf8"){const t=rl[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Aa(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}function nr(r,e="utf8"){const t=rl[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var nl=function(r,e,t){if(t||arguments.length===2)for(var i=0,o=e.length,a;i<o;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return r.concat(a||Array.prototype.slice.call(e))},ry=function(){function r(e,t,i){this.name=e,this.version=t,this.os=i,this.type="browser"}return r}(),ny=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return r}(),iy=function(){function r(e,t,i,o){this.name=e,this.version=t,this.os=i,this.bot=o,this.type="bot-device"}return r}(),sy=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),oy=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),ay=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,cy=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,il=3,uy=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",ay]],sl=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function hy(r){return r?ol(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new oy:typeof navigator<"u"?ol(navigator.userAgent):dy()}function ly(r){return r!==""&&uy.reduce(function(e,t){var i=t[0],o=t[1];if(e)return e;var a=o.exec(r);return!!a&&[i,a]},!1)}function ol(r){var e=ly(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new sy;var o=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);o?o.length<il&&(o=nl(nl([],o,!0),py(il-o.length),!0)):o=[];var a=o.join("."),u=fy(r),f=cy.exec(r);return f&&f[1]?new iy(t,a,u,f[1]):new ry(t,a,u)}function fy(r){for(var e=0,t=sl.length;e<t;e++){var i=sl[e],o=i[0],a=i[1],u=a.exec(r);if(u)return o}return null}function dy(){var r=typeof process<"u"&&process.version;return r?new ny(process.version.slice(1)):null}function py(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}var ye={};/*! *****************************************************************************
1
+ (function(_n,dr){typeof exports=="object"&&typeof module<"u"?dr(exports):typeof define=="function"&&define.amd?define(["exports"],dr):(_n=typeof globalThis<"u"?globalThis:_n||self,dr(_n["@walletconnect/ethereum-provider"]={}))})(this,function(_n){"use strict";var dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Bi(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var yr={exports:{}},Is=typeof Reflect=="object"?Reflect:null,yd=Is&&typeof Is.apply=="function"?Is.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Ka;Is&&typeof Is.ownKeys=="function"?Ka=Is.ownKeys:Object.getOwnPropertySymbols?Ka=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ka=function(e){return Object.getOwnPropertyNames(e)};function Ow(t){console&&console.warn&&console.warn(t)}var bd=Number.isNaN||function(e){return e!==e};function _t(){_t.init.call(this)}yr.exports=_t,yr.exports.once=Pw,_t.EventEmitter=_t,_t.prototype._events=void 0,_t.prototype._eventsCount=0,_t.prototype._maxListeners=void 0;var _d=10;function Ga(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(_t,"defaultMaxListeners",{enumerable:!0,get:function(){return _d},set:function(t){if(typeof t!="number"||t<0||bd(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");_d=t}}),_t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},_t.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||bd(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Ed(t){return t._maxListeners===void 0?_t.defaultMaxListeners:t._maxListeners}_t.prototype.getMaxListeners=function(){return Ed(this)},_t.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var c;if(r.length>0&&(c=r[0]),c instanceof Error)throw c;var l=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw l.context=c,l}var h=o[e];if(h===void 0)return!1;if(typeof h=="function")yd(h,this,r);else for(var f=h.length,v=Od(h,f),n=0;n<f;++n)yd(v[n],this,r);return!0};function xd(t,e,r,n){var i,o,c;if(Ga(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),c=o[e]),c===void 0)c=o[e]=r,++t._eventsCount;else if(typeof c=="function"?c=o[e]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),i=Ed(t),i>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=c.length,Ow(l)}return t}_t.prototype.addListener=function(e,r){return xd(this,e,r,!1)},_t.prototype.on=_t.prototype.addListener,_t.prototype.prependListener=function(e,r){return xd(this,e,r,!0)};function Aw(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Cd(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=Aw.bind(n);return i.listener=r,n.wrapFn=i,i}_t.prototype.once=function(e,r){return Ga(r),this.on(e,Cd(this,e,r)),this},_t.prototype.prependOnceListener=function(e,r){return Ga(r),this.prependListener(e,Cd(this,e,r)),this},_t.prototype.removeListener=function(e,r){var n,i,o,c,l;if(Ga(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,c=n.length-1;c>=0;c--)if(n[c]===r||n[c].listener===r){l=n[c].listener,o=c;break}if(o<0)return this;o===0?n.shift():Dw(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},_t.prototype.off=_t.prototype.removeListener,_t.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),c;for(i=0;i<o.length;++i)c=o[i],c!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function Id(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?$w(i):Od(i,i.length)}_t.prototype.listeners=function(e){return Id(this,e,!0)},_t.prototype.rawListeners=function(e){return Id(this,e,!1)},_t.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Sd.call(t,e)},_t.prototype.listenerCount=Sd;function Sd(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}_t.prototype.eventNames=function(){return this._eventsCount>0?Ka(this._events):[]};function Od(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Dw(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function $w(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Pw(t,e){return new Promise(function(r,n){function i(c){t.removeListener(e,o),n(c)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}Ad(t,e,o,{once:!0}),e!=="error"&&Tw(t,i,{once:!0})})}function Tw(t,e,r){typeof t.on=="function"&&Ad(t,"error",e,r)}function Ad(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var uu={},Za={},et={},Dd={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,h){var f=l>>>16&65535,v=l&65535,E=h>>>16&65535,_=h&65535;return v*_+(f*_+v*E<<16>>>0)|0}t.mul=Math.imul||e;function r(l,h){return l+h|0}t.add=r;function n(l,h){return l-h|0}t.sub=n;function i(l,h){return l<<h|l>>>32-h}t.rotl=i;function o(l,h){return l<<32-h|l>>>h}t.rotr=o;function c(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l}t.isInteger=Number.isInteger||c,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(l){return t.isInteger(l)&&l>=-t.MAX_SAFE_INTEGER&&l<=t.MAX_SAFE_INTEGER}})(Dd),Object.defineProperty(et,"__esModule",{value:!0});var $d=Dd;function Rw(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}et.readInt16BE=Rw;function Nw(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}et.readUint16BE=Nw;function Lw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}et.readInt16LE=Lw;function Mw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}et.readUint16LE=Mw;function Pd(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}et.writeUint16BE=Pd,et.writeInt16BE=Pd;function Td(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}et.writeUint16LE=Td,et.writeInt16LE=Td;function hu(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}et.readInt32BE=hu;function fu(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}et.readUint32BE=fu;function du(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}et.readInt32LE=du;function pu(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}et.readUint32LE=pu;function Ya(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}et.writeUint32BE=Ya,et.writeInt32BE=Ya;function Ja(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}et.writeUint32LE=Ja,et.writeInt32LE=Ja;function Uw(t,e){e===void 0&&(e=0);var r=hu(t,e),n=hu(t,e+4);return r*4294967296+n-(n>>31)*4294967296}et.readInt64BE=Uw;function jw(t,e){e===void 0&&(e=0);var r=fu(t,e),n=fu(t,e+4);return r*4294967296+n}et.readUint64BE=jw;function Fw(t,e){e===void 0&&(e=0);var r=du(t,e),n=du(t,e+4);return n*4294967296+r-(r>>31)*4294967296}et.readInt64LE=Fw;function Bw(t,e){e===void 0&&(e=0);var r=pu(t,e),n=pu(t,e+4);return n*4294967296+r}et.readUint64LE=Bw;function Rd(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ya(t/4294967296>>>0,e,r),Ya(t>>>0,e,r+4),e}et.writeUint64BE=Rd,et.writeInt64BE=Rd;function Nd(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ja(t>>>0,e,r),Ja(t/4294967296>>>0,e,r+4),e}et.writeUint64LE=Nd,et.writeInt64LE=Nd;function kw(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=t/8+r-1;o>=r;o--)n+=e[o]*i,i*=256;return n}et.readUintBE=kw;function Hw(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+t/8;o++)n+=e[o]*i,i*=256;return n}et.readUintLE=Hw;function Ww(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!$d.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,o=t/8+n-1;o>=n;o--)r[o]=e/i&255,i*=256;return r}et.writeUintBE=Ww;function zw(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!$d.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,o=n;o<n+t/8;o++)r[o]=e/i&255,i*=256;return r}et.writeUintLE=zw;function qw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}et.readFloat32BE=qw;function Vw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}et.readFloat32LE=Vw;function Kw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}et.readFloat64BE=Kw;function Gw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}et.readFloat64LE=Gw;function Zw(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}et.writeFloat32BE=Zw;function Yw(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}et.writeFloat32LE=Yw;function Jw(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}et.writeFloat64BE=Jw;function Qw(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}et.writeFloat64LE=Qw;var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});function Xw(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Jr.wipe=Xw,Object.defineProperty(Za,"__esModule",{value:!0});var Cr=et,gu=Jr,ev=20;function tv(t,e,r){for(var n=1634760805,i=857760878,o=2036477234,c=1797285236,l=r[3]<<24|r[2]<<16|r[1]<<8|r[0],h=r[7]<<24|r[6]<<16|r[5]<<8|r[4],f=r[11]<<24|r[10]<<16|r[9]<<8|r[8],v=r[15]<<24|r[14]<<16|r[13]<<8|r[12],E=r[19]<<24|r[18]<<16|r[17]<<8|r[16],_=r[23]<<24|r[22]<<16|r[21]<<8|r[20],S=r[27]<<24|r[26]<<16|r[25]<<8|r[24],P=r[31]<<24|r[30]<<16|r[29]<<8|r[28],j=e[3]<<24|e[2]<<16|e[1]<<8|e[0],H=e[7]<<24|e[6]<<16|e[5]<<8|e[4],Z=e[11]<<24|e[10]<<16|e[9]<<8|e[8],N=e[15]<<24|e[14]<<16|e[13]<<8|e[12],L=n,$=i,T=o,I=c,d=l,x=h,J=f,W=v,ee=E,de=_,me=S,O=P,U=j,ce=H,le=Z,re=N,ne=0;ne<ev;ne+=2)L=L+d|0,U^=L,U=U>>>32-16|U<<16,ee=ee+U|0,d^=ee,d=d>>>32-12|d<<12,$=$+x|0,ce^=$,ce=ce>>>32-16|ce<<16,de=de+ce|0,x^=de,x=x>>>32-12|x<<12,T=T+J|0,le^=T,le=le>>>32-16|le<<16,me=me+le|0,J^=me,J=J>>>32-12|J<<12,I=I+W|0,re^=I,re=re>>>32-16|re<<16,O=O+re|0,W^=O,W=W>>>32-12|W<<12,T=T+J|0,le^=T,le=le>>>32-8|le<<8,me=me+le|0,J^=me,J=J>>>32-7|J<<7,I=I+W|0,re^=I,re=re>>>32-8|re<<8,O=O+re|0,W^=O,W=W>>>32-7|W<<7,$=$+x|0,ce^=$,ce=ce>>>32-8|ce<<8,de=de+ce|0,x^=de,x=x>>>32-7|x<<7,L=L+d|0,U^=L,U=U>>>32-8|U<<8,ee=ee+U|0,d^=ee,d=d>>>32-7|d<<7,L=L+x|0,re^=L,re=re>>>32-16|re<<16,me=me+re|0,x^=me,x=x>>>32-12|x<<12,$=$+J|0,U^=$,U=U>>>32-16|U<<16,O=O+U|0,J^=O,J=J>>>32-12|J<<12,T=T+W|0,ce^=T,ce=ce>>>32-16|ce<<16,ee=ee+ce|0,W^=ee,W=W>>>32-12|W<<12,I=I+d|0,le^=I,le=le>>>32-16|le<<16,de=de+le|0,d^=de,d=d>>>32-12|d<<12,T=T+W|0,ce^=T,ce=ce>>>32-8|ce<<8,ee=ee+ce|0,W^=ee,W=W>>>32-7|W<<7,I=I+d|0,le^=I,le=le>>>32-8|le<<8,de=de+le|0,d^=de,d=d>>>32-7|d<<7,$=$+J|0,U^=$,U=U>>>32-8|U<<8,O=O+U|0,J^=O,J=J>>>32-7|J<<7,L=L+x|0,re^=L,re=re>>>32-8|re<<8,me=me+re|0,x^=me,x=x>>>32-7|x<<7;Cr.writeUint32LE(L+n|0,t,0),Cr.writeUint32LE($+i|0,t,4),Cr.writeUint32LE(T+o|0,t,8),Cr.writeUint32LE(I+c|0,t,12),Cr.writeUint32LE(d+l|0,t,16),Cr.writeUint32LE(x+h|0,t,20),Cr.writeUint32LE(J+f|0,t,24),Cr.writeUint32LE(W+v|0,t,28),Cr.writeUint32LE(ee+E|0,t,32),Cr.writeUint32LE(de+_|0,t,36),Cr.writeUint32LE(me+S|0,t,40),Cr.writeUint32LE(O+P|0,t,44),Cr.writeUint32LE(U+j|0,t,48),Cr.writeUint32LE(ce+H|0,t,52),Cr.writeUint32LE(le+Z|0,t,56),Cr.writeUint32LE(re+N|0,t,60)}function Ld(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var o,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),c=o.length-e.length,o.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=e,c=i}for(var l=new Uint8Array(64),h=0;h<r.length;h+=64){tv(l,o,t);for(var f=h;f<h+64&&f<r.length;f++)n[f]=r[f]^l[f-h];nv(o,0,c)}return gu.wipe(l),i===0&&gu.wipe(o),n}Za.streamXOR=Ld;function rv(t,e,r,n){return n===void 0&&(n=0),gu.wipe(r),Ld(t,e,r,r,n)}Za.stream=rv;function nv(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Md={},di={};Object.defineProperty(di,"__esModule",{value:!0});function iv(t,e,r){return~(t-1)&e|t-1&r}di.select=iv;function sv(t,e){return(t|0)-(e|0)-1>>>31&1}di.lessOrEqual=sv;function Ud(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}di.compare=Ud;function ov(t,e){return t.length===0||e.length===0?!1:Ud(t,e)!==0}di.equal=ov,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=di,r=Jr;t.DIGEST_LENGTH=16;var n=function(){function c(l){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var h=l[0]|l[1]<<8;this._r[0]=h&8191;var f=l[2]|l[3]<<8;this._r[1]=(h>>>13|f<<3)&8191;var v=l[4]|l[5]<<8;this._r[2]=(f>>>10|v<<6)&7939;var E=l[6]|l[7]<<8;this._r[3]=(v>>>7|E<<9)&8191;var _=l[8]|l[9]<<8;this._r[4]=(E>>>4|_<<12)&255,this._r[5]=_>>>1&8190;var S=l[10]|l[11]<<8;this._r[6]=(_>>>14|S<<2)&8191;var P=l[12]|l[13]<<8;this._r[7]=(S>>>11|P<<5)&8065;var j=l[14]|l[15]<<8;this._r[8]=(P>>>8|j<<8)&8191,this._r[9]=j>>>5&127,this._pad[0]=l[16]|l[17]<<8,this._pad[1]=l[18]|l[19]<<8,this._pad[2]=l[20]|l[21]<<8,this._pad[3]=l[22]|l[23]<<8,this._pad[4]=l[24]|l[25]<<8,this._pad[5]=l[26]|l[27]<<8,this._pad[6]=l[28]|l[29]<<8,this._pad[7]=l[30]|l[31]<<8}return c.prototype._blocks=function(l,h,f){for(var v=this._fin?0:2048,E=this._h[0],_=this._h[1],S=this._h[2],P=this._h[3],j=this._h[4],H=this._h[5],Z=this._h[6],N=this._h[7],L=this._h[8],$=this._h[9],T=this._r[0],I=this._r[1],d=this._r[2],x=this._r[3],J=this._r[4],W=this._r[5],ee=this._r[6],de=this._r[7],me=this._r[8],O=this._r[9];f>=16;){var U=l[h+0]|l[h+1]<<8;E+=U&8191;var ce=l[h+2]|l[h+3]<<8;_+=(U>>>13|ce<<3)&8191;var le=l[h+4]|l[h+5]<<8;S+=(ce>>>10|le<<6)&8191;var re=l[h+6]|l[h+7]<<8;P+=(le>>>7|re<<9)&8191;var ne=l[h+8]|l[h+9]<<8;j+=(re>>>4|ne<<12)&8191,H+=ne>>>1&8191;var ae=l[h+10]|l[h+11]<<8;Z+=(ne>>>14|ae<<2)&8191;var ie=l[h+12]|l[h+13]<<8;N+=(ae>>>11|ie<<5)&8191;var Ae=l[h+14]|l[h+15]<<8;L+=(ie>>>8|Ae<<8)&8191,$+=Ae>>>5|v;var ge=0,Be=ge;Be+=E*T,Be+=_*(5*O),Be+=S*(5*me),Be+=P*(5*de),Be+=j*(5*ee),ge=Be>>>13,Be&=8191,Be+=H*(5*W),Be+=Z*(5*J),Be+=N*(5*x),Be+=L*(5*d),Be+=$*(5*I),ge+=Be>>>13,Be&=8191;var ye=ge;ye+=E*I,ye+=_*T,ye+=S*(5*O),ye+=P*(5*me),ye+=j*(5*de),ge=ye>>>13,ye&=8191,ye+=H*(5*ee),ye+=Z*(5*W),ye+=N*(5*J),ye+=L*(5*x),ye+=$*(5*d),ge+=ye>>>13,ye&=8191;var Me=ge;Me+=E*d,Me+=_*I,Me+=S*T,Me+=P*(5*O),Me+=j*(5*me),ge=Me>>>13,Me&=8191,Me+=H*(5*de),Me+=Z*(5*ee),Me+=N*(5*W),Me+=L*(5*J),Me+=$*(5*x),ge+=Me>>>13,Me&=8191;var Q=ge;Q+=E*x,Q+=_*d,Q+=S*I,Q+=P*T,Q+=j*(5*O),ge=Q>>>13,Q&=8191,Q+=H*(5*me),Q+=Z*(5*de),Q+=N*(5*ee),Q+=L*(5*W),Q+=$*(5*J),ge+=Q>>>13,Q&=8191;var Y=ge;Y+=E*J,Y+=_*x,Y+=S*d,Y+=P*I,Y+=j*T,ge=Y>>>13,Y&=8191,Y+=H*(5*O),Y+=Z*(5*me),Y+=N*(5*de),Y+=L*(5*ee),Y+=$*(5*W),ge+=Y>>>13,Y&=8191;var z=ge;z+=E*W,z+=_*J,z+=S*x,z+=P*d,z+=j*I,ge=z>>>13,z&=8191,z+=H*T,z+=Z*(5*O),z+=N*(5*me),z+=L*(5*de),z+=$*(5*ee),ge+=z>>>13,z&=8191;var w=ge;w+=E*ee,w+=_*W,w+=S*J,w+=P*x,w+=j*d,ge=w>>>13,w&=8191,w+=H*I,w+=Z*T,w+=N*(5*O),w+=L*(5*me),w+=$*(5*de),ge+=w>>>13,w&=8191;var F=ge;F+=E*de,F+=_*ee,F+=S*W,F+=P*J,F+=j*x,ge=F>>>13,F&=8191,F+=H*d,F+=Z*I,F+=N*T,F+=L*(5*O),F+=$*(5*me),ge+=F>>>13,F&=8191;var we=ge;we+=E*me,we+=_*de,we+=S*ee,we+=P*W,we+=j*J,ge=we>>>13,we&=8191,we+=H*x,we+=Z*d,we+=N*I,we+=L*T,we+=$*(5*O),ge+=we>>>13,we&=8191;var ve=ge;ve+=E*O,ve+=_*me,ve+=S*de,ve+=P*ee,ve+=j*W,ge=ve>>>13,ve&=8191,ve+=H*J,ve+=Z*x,ve+=N*d,ve+=L*I,ve+=$*T,ge+=ve>>>13,ve&=8191,ge=(ge<<2)+ge|0,ge=ge+Be|0,Be=ge&8191,ge=ge>>>13,ye+=ge,E=Be,_=ye,S=Me,P=Q,j=Y,H=z,Z=w,N=F,L=we,$=ve,h+=16,f-=16}this._h[0]=E,this._h[1]=_,this._h[2]=S,this._h[3]=P,this._h[4]=j,this._h[5]=H,this._h[6]=Z,this._h[7]=N,this._h[8]=L,this._h[9]=$},c.prototype.finish=function(l,h){h===void 0&&(h=0);var f=new Uint16Array(10),v,E,_,S;if(this._leftover){for(S=this._leftover,this._buffer[S++]=1;S<16;S++)this._buffer[S]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(v=this._h[1]>>>13,this._h[1]&=8191,S=2;S<10;S++)this._h[S]+=v,v=this._h[S]>>>13,this._h[S]&=8191;for(this._h[0]+=v*5,v=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=v,v=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=v,f[0]=this._h[0]+5,v=f[0]>>>13,f[0]&=8191,S=1;S<10;S++)f[S]=this._h[S]+v,v=f[S]>>>13,f[S]&=8191;for(f[9]-=8192,E=(v^1)-1,S=0;S<10;S++)f[S]&=E;for(E=~E,S=0;S<10;S++)this._h[S]=this._h[S]&E|f[S];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,_=this._h[0]+this._pad[0],this._h[0]=_&65535,S=1;S<8;S++)_=(this._h[S]+this._pad[S]|0)+(_>>>16)|0,this._h[S]=_&65535;return l[h+0]=this._h[0]>>>0,l[h+1]=this._h[0]>>>8,l[h+2]=this._h[1]>>>0,l[h+3]=this._h[1]>>>8,l[h+4]=this._h[2]>>>0,l[h+5]=this._h[2]>>>8,l[h+6]=this._h[3]>>>0,l[h+7]=this._h[3]>>>8,l[h+8]=this._h[4]>>>0,l[h+9]=this._h[4]>>>8,l[h+10]=this._h[5]>>>0,l[h+11]=this._h[5]>>>8,l[h+12]=this._h[6]>>>0,l[h+13]=this._h[6]>>>8,l[h+14]=this._h[7]>>>0,l[h+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(l){var h=0,f=l.length,v;if(this._leftover){v=16-this._leftover,v>f&&(v=f);for(var E=0;E<v;E++)this._buffer[this._leftover+E]=l[h+E];if(f-=v,h+=v,this._leftover+=v,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(f>=16&&(v=f-f%16,this._blocks(l,h,v),h+=v,f-=v),f){for(var E=0;E<f;E++)this._buffer[this._leftover+E]=l[h+E];this._leftover+=f}return this},c.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var l=new Uint8Array(16);return this.finish(l),l},c.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},c}();t.Poly1305=n;function i(c,l){var h=new n(c);h.update(l);var f=h.digest();return h.clean(),f}t.oneTimeAuth=i;function o(c,l){return c.length!==t.DIGEST_LENGTH||l.length!==t.DIGEST_LENGTH?!1:e.equal(c,l)}t.equal=o}(Md),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Za,r=Md,n=Jr,i=et,o=di;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var c=new Uint8Array(16),l=function(){function h(f){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,f.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(f)}return h.prototype.seal=function(f,v,E,_){if(f.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var S=new Uint8Array(16);S.set(f,S.length-f.length);var P=new Uint8Array(32);e.stream(this._key,S,P,4);var j=v.length+this.tagLength,H;if(_){if(_.length!==j)throw new Error("ChaCha20Poly1305: incorrect destination length");H=_}else H=new Uint8Array(j);return e.streamXOR(this._key,S,v,H,4),this._authenticate(H.subarray(H.length-this.tagLength,H.length),P,H.subarray(0,H.length-this.tagLength),E),n.wipe(S),H},h.prototype.open=function(f,v,E,_){if(f.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(v.length<this.tagLength)return null;var S=new Uint8Array(16);S.set(f,S.length-f.length);var P=new Uint8Array(32);e.stream(this._key,S,P,4);var j=new Uint8Array(this.tagLength);if(this._authenticate(j,P,v.subarray(0,v.length-this.tagLength),E),!o.equal(j,v.subarray(v.length-this.tagLength,v.length)))return null;var H=v.length-this.tagLength,Z;if(_){if(_.length!==H)throw new Error("ChaCha20Poly1305: incorrect destination length");Z=_}else Z=new Uint8Array(H);return e.streamXOR(this._key,S,v.subarray(0,v.length-this.tagLength),Z,4),n.wipe(S),Z},h.prototype.clean=function(){return n.wipe(this._key),this},h.prototype._authenticate=function(f,v,E,_){var S=new r.Poly1305(v);_&&(S.update(_),_.length%16>0&&S.update(c.subarray(_.length%16))),S.update(E),E.length%16>0&&S.update(c.subarray(E.length%16));var P=new Uint8Array(8);_&&i.writeUint64LE(_.length,P),S.update(P),i.writeUint64LE(E.length,P),S.update(P);for(var j=S.digest(),H=0;H<j.length;H++)f[H]=j[H];S.clean(),n.wipe(j),n.wipe(P)},h}();t.ChaCha20Poly1305=l}(uu);var jd={},Io={},mu={};Object.defineProperty(mu,"__esModule",{value:!0});function av(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}mu.isSerializableHash=av,Object.defineProperty(Io,"__esModule",{value:!0});var Pn=mu,cv=di,lv=Jr,Fd=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),Pn.isSerializableHash(this._inner)&&Pn.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),lv.wipe(n)}return t.prototype.reset=function(){if(!Pn.isSerializableHash(this._inner)||!Pn.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){Pn.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Pn.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!Pn.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!Pn.isSerializableHash(this._inner)||!Pn.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!Pn.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Io.HMAC=Fd;function uv(t,e,r){var n=new Fd(t,e);n.update(r);var i=n.digest();return n.clean(),i}Io.hmac=uv,Io.equal=cv.equal,Object.defineProperty(jd,"__esModule",{value:!0});var Bd=Io,kd=Jr,hv=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var o=Bd.hmac(this._hash,n,r);this._hmac=new Bd.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),kd.wipe(this._buffer),kd.wipe(this._counter),this._bufpos=0},t}(),fv=jd.HKDF=hv,Ss={},Qa={},Xa={};Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.BrowserRandomSource=void 0;const Hd=65536;class dv{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=Hd)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,Hd)));return r}}Xa.BrowserRandomSource=dv;function pv(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ec={},gv={},mv=Object.freeze({__proto__:null,default:gv}),wv=Bi(mv);Object.defineProperty(ec,"__esModule",{value:!0}),ec.NodeRandomSource=void 0;const vv=Jr;class yv{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof pv<"u"){const e=wv;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,vv.wipe)(r),n}}ec.NodeRandomSource=yv,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.SystemRandomSource=void 0;const bv=Xa,_v=ec;class Ev{constructor(){if(this.isAvailable=!1,this.name="",this._source=new bv.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new _v.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}Qa.SystemRandomSource=Ev,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Qa,r=et,n=Jr;t.defaultRandomSource=new e.SystemRandomSource;function i(f,v=t.defaultRandomSource){return v.randomBytes(f)}t.randomBytes=i;function o(f=t.defaultRandomSource){const v=i(4,f),E=(0,r.readUint32LE)(v);return(0,n.wipe)(v),E}t.randomUint32=o;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(f,v=c,E=t.defaultRandomSource){if(v.length<2)throw new Error("randomString charset is too short");if(v.length>256)throw new Error("randomString charset is too long");let _="";const S=v.length,P=256-256%S;for(;f>0;){const j=i(Math.ceil(f*256/P),E);for(let H=0;H<j.length&&f>0;H++){const Z=j[H];Z<P&&(_+=v.charAt(Z%S),f--)}(0,n.wipe)(j)}return _}t.randomString=l;function h(f,v=c,E=t.defaultRandomSource){const _=Math.ceil(f/(Math.log(v.length)/Math.LN2));return l(_,v,E)}t.randomStringForEntropy=h}(Ss);var tc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Jr;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function l(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return l.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},l.prototype.update=function(h,f){if(f===void 0&&(f=h.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var v=0;if(this._bytesHashed+=f,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&f>0;)this._buffer[this._bufferLength++]=h[v++],f--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(f>=this.blockSize&&(v=o(this._temp,this._state,h,v,f),f%=this.blockSize);f>0;)this._buffer[this._bufferLength++]=h[v++],f--;return this},l.prototype.finish=function(h){if(!this._finished){var f=this._bytesHashed,v=this._bufferLength,E=f/536870912|0,_=f<<3,S=f%64<56?64:128;this._buffer[v]=128;for(var P=v+1;P<S-8;P++)this._buffer[P]=0;e.writeUint32BE(E,this._buffer,S-8),e.writeUint32BE(_,this._buffer,S-4),o(this._temp,this._state,this._buffer,0,S),this._finished=!0}for(var P=0;P<this.digestLength/4;P++)e.writeUint32BE(this._state[P],h,P*4);return this},l.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},l.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},l.prototype.restoreState=function(h){return this._state.set(h.state),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(h){r.wipe(h.state),h.buffer&&r.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},l}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function o(l,h,f,v,E){for(;E>=64;){for(var _=h[0],S=h[1],P=h[2],j=h[3],H=h[4],Z=h[5],N=h[6],L=h[7],$=0;$<16;$++){var T=v+$*4;l[$]=e.readUint32BE(f,T)}for(var $=16;$<64;$++){var I=l[$-2],d=(I>>>17|I<<32-17)^(I>>>19|I<<32-19)^I>>>10;I=l[$-15];var x=(I>>>7|I<<32-7)^(I>>>18|I<<32-18)^I>>>3;l[$]=(d+l[$-7]|0)+(x+l[$-16]|0)}for(var $=0;$<64;$++){var d=(((H>>>6|H<<26)^(H>>>11|H<<21)^(H>>>25|H<<7))+(H&Z^~H&N)|0)+(L+(i[$]+l[$]|0)|0)|0,x=((_>>>2|_<<32-2)^(_>>>13|_<<32-13)^(_>>>22|_<<32-22))+(_&S^_&P^S&P)|0;L=N,N=Z,Z=H,H=j+d|0,j=P,P=S,S=_,_=d+x|0}h[0]+=_,h[1]+=S,h[2]+=P,h[3]+=j,h[4]+=H,h[5]+=Z,h[6]+=N,h[7]+=L,v+=64,E-=64}return v}function c(l){var h=new n;h.update(l);var f=h.digest();return h.clean(),f}t.hash=c})(tc);var wu={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=Ss,r=Jr;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n($){const T=new Float64Array(16);if($)for(let I=0;I<$.length;I++)T[I]=$[I];return T}const i=new Uint8Array(32);i[0]=9;const o=n([56129,1]);function c($){let T=1;for(let I=0;I<16;I++){let d=$[I]+T+65535;T=Math.floor(d/65536),$[I]=d-T*65536}$[0]+=T-1+37*(T-1)}function l($,T,I){const d=~(I-1);for(let x=0;x<16;x++){const J=d&($[x]^T[x]);$[x]^=J,T[x]^=J}}function h($,T){const I=n(),d=n();for(let x=0;x<16;x++)d[x]=T[x];c(d),c(d),c(d);for(let x=0;x<2;x++){I[0]=d[0]-65517;for(let W=1;W<15;W++)I[W]=d[W]-65535-(I[W-1]>>16&1),I[W-1]&=65535;I[15]=d[15]-32767-(I[14]>>16&1);const J=I[15]>>16&1;I[14]&=65535,l(d,I,1-J)}for(let x=0;x<16;x++)$[2*x]=d[x]&255,$[2*x+1]=d[x]>>8}function f($,T){for(let I=0;I<16;I++)$[I]=T[2*I]+(T[2*I+1]<<8);$[15]&=32767}function v($,T,I){for(let d=0;d<16;d++)$[d]=T[d]+I[d]}function E($,T,I){for(let d=0;d<16;d++)$[d]=T[d]-I[d]}function _($,T,I){let d,x,J=0,W=0,ee=0,de=0,me=0,O=0,U=0,ce=0,le=0,re=0,ne=0,ae=0,ie=0,Ae=0,ge=0,Be=0,ye=0,Me=0,Q=0,Y=0,z=0,w=0,F=0,we=0,ve=0,Ue=0,nt=0,at=0,Ge=0,Dt=0,$t=0,Je=I[0],He=I[1],ke=I[2],Ke=I[3],rt=I[4],je=I[5],Ze=I[6],b=I[7],p=I[8],m=I[9],D=I[10],B=I[11],K=I[12],X=I[13],Ee=I[14],Re=I[15];d=T[0],J+=d*Je,W+=d*He,ee+=d*ke,de+=d*Ke,me+=d*rt,O+=d*je,U+=d*Ze,ce+=d*b,le+=d*p,re+=d*m,ne+=d*D,ae+=d*B,ie+=d*K,Ae+=d*X,ge+=d*Ee,Be+=d*Re,d=T[1],W+=d*Je,ee+=d*He,de+=d*ke,me+=d*Ke,O+=d*rt,U+=d*je,ce+=d*Ze,le+=d*b,re+=d*p,ne+=d*m,ae+=d*D,ie+=d*B,Ae+=d*K,ge+=d*X,Be+=d*Ee,ye+=d*Re,d=T[2],ee+=d*Je,de+=d*He,me+=d*ke,O+=d*Ke,U+=d*rt,ce+=d*je,le+=d*Ze,re+=d*b,ne+=d*p,ae+=d*m,ie+=d*D,Ae+=d*B,ge+=d*K,Be+=d*X,ye+=d*Ee,Me+=d*Re,d=T[3],de+=d*Je,me+=d*He,O+=d*ke,U+=d*Ke,ce+=d*rt,le+=d*je,re+=d*Ze,ne+=d*b,ae+=d*p,ie+=d*m,Ae+=d*D,ge+=d*B,Be+=d*K,ye+=d*X,Me+=d*Ee,Q+=d*Re,d=T[4],me+=d*Je,O+=d*He,U+=d*ke,ce+=d*Ke,le+=d*rt,re+=d*je,ne+=d*Ze,ae+=d*b,ie+=d*p,Ae+=d*m,ge+=d*D,Be+=d*B,ye+=d*K,Me+=d*X,Q+=d*Ee,Y+=d*Re,d=T[5],O+=d*Je,U+=d*He,ce+=d*ke,le+=d*Ke,re+=d*rt,ne+=d*je,ae+=d*Ze,ie+=d*b,Ae+=d*p,ge+=d*m,Be+=d*D,ye+=d*B,Me+=d*K,Q+=d*X,Y+=d*Ee,z+=d*Re,d=T[6],U+=d*Je,ce+=d*He,le+=d*ke,re+=d*Ke,ne+=d*rt,ae+=d*je,ie+=d*Ze,Ae+=d*b,ge+=d*p,Be+=d*m,ye+=d*D,Me+=d*B,Q+=d*K,Y+=d*X,z+=d*Ee,w+=d*Re,d=T[7],ce+=d*Je,le+=d*He,re+=d*ke,ne+=d*Ke,ae+=d*rt,ie+=d*je,Ae+=d*Ze,ge+=d*b,Be+=d*p,ye+=d*m,Me+=d*D,Q+=d*B,Y+=d*K,z+=d*X,w+=d*Ee,F+=d*Re,d=T[8],le+=d*Je,re+=d*He,ne+=d*ke,ae+=d*Ke,ie+=d*rt,Ae+=d*je,ge+=d*Ze,Be+=d*b,ye+=d*p,Me+=d*m,Q+=d*D,Y+=d*B,z+=d*K,w+=d*X,F+=d*Ee,we+=d*Re,d=T[9],re+=d*Je,ne+=d*He,ae+=d*ke,ie+=d*Ke,Ae+=d*rt,ge+=d*je,Be+=d*Ze,ye+=d*b,Me+=d*p,Q+=d*m,Y+=d*D,z+=d*B,w+=d*K,F+=d*X,we+=d*Ee,ve+=d*Re,d=T[10],ne+=d*Je,ae+=d*He,ie+=d*ke,Ae+=d*Ke,ge+=d*rt,Be+=d*je,ye+=d*Ze,Me+=d*b,Q+=d*p,Y+=d*m,z+=d*D,w+=d*B,F+=d*K,we+=d*X,ve+=d*Ee,Ue+=d*Re,d=T[11],ae+=d*Je,ie+=d*He,Ae+=d*ke,ge+=d*Ke,Be+=d*rt,ye+=d*je,Me+=d*Ze,Q+=d*b,Y+=d*p,z+=d*m,w+=d*D,F+=d*B,we+=d*K,ve+=d*X,Ue+=d*Ee,nt+=d*Re,d=T[12],ie+=d*Je,Ae+=d*He,ge+=d*ke,Be+=d*Ke,ye+=d*rt,Me+=d*je,Q+=d*Ze,Y+=d*b,z+=d*p,w+=d*m,F+=d*D,we+=d*B,ve+=d*K,Ue+=d*X,nt+=d*Ee,at+=d*Re,d=T[13],Ae+=d*Je,ge+=d*He,Be+=d*ke,ye+=d*Ke,Me+=d*rt,Q+=d*je,Y+=d*Ze,z+=d*b,w+=d*p,F+=d*m,we+=d*D,ve+=d*B,Ue+=d*K,nt+=d*X,at+=d*Ee,Ge+=d*Re,d=T[14],ge+=d*Je,Be+=d*He,ye+=d*ke,Me+=d*Ke,Q+=d*rt,Y+=d*je,z+=d*Ze,w+=d*b,F+=d*p,we+=d*m,ve+=d*D,Ue+=d*B,nt+=d*K,at+=d*X,Ge+=d*Ee,Dt+=d*Re,d=T[15],Be+=d*Je,ye+=d*He,Me+=d*ke,Q+=d*Ke,Y+=d*rt,z+=d*je,w+=d*Ze,F+=d*b,we+=d*p,ve+=d*m,Ue+=d*D,nt+=d*B,at+=d*K,Ge+=d*X,Dt+=d*Ee,$t+=d*Re,J+=38*ye,W+=38*Me,ee+=38*Q,de+=38*Y,me+=38*z,O+=38*w,U+=38*F,ce+=38*we,le+=38*ve,re+=38*Ue,ne+=38*nt,ae+=38*at,ie+=38*Ge,Ae+=38*Dt,ge+=38*$t,x=1,d=J+x+65535,x=Math.floor(d/65536),J=d-x*65536,d=W+x+65535,x=Math.floor(d/65536),W=d-x*65536,d=ee+x+65535,x=Math.floor(d/65536),ee=d-x*65536,d=de+x+65535,x=Math.floor(d/65536),de=d-x*65536,d=me+x+65535,x=Math.floor(d/65536),me=d-x*65536,d=O+x+65535,x=Math.floor(d/65536),O=d-x*65536,d=U+x+65535,x=Math.floor(d/65536),U=d-x*65536,d=ce+x+65535,x=Math.floor(d/65536),ce=d-x*65536,d=le+x+65535,x=Math.floor(d/65536),le=d-x*65536,d=re+x+65535,x=Math.floor(d/65536),re=d-x*65536,d=ne+x+65535,x=Math.floor(d/65536),ne=d-x*65536,d=ae+x+65535,x=Math.floor(d/65536),ae=d-x*65536,d=ie+x+65535,x=Math.floor(d/65536),ie=d-x*65536,d=Ae+x+65535,x=Math.floor(d/65536),Ae=d-x*65536,d=ge+x+65535,x=Math.floor(d/65536),ge=d-x*65536,d=Be+x+65535,x=Math.floor(d/65536),Be=d-x*65536,J+=x-1+37*(x-1),x=1,d=J+x+65535,x=Math.floor(d/65536),J=d-x*65536,d=W+x+65535,x=Math.floor(d/65536),W=d-x*65536,d=ee+x+65535,x=Math.floor(d/65536),ee=d-x*65536,d=de+x+65535,x=Math.floor(d/65536),de=d-x*65536,d=me+x+65535,x=Math.floor(d/65536),me=d-x*65536,d=O+x+65535,x=Math.floor(d/65536),O=d-x*65536,d=U+x+65535,x=Math.floor(d/65536),U=d-x*65536,d=ce+x+65535,x=Math.floor(d/65536),ce=d-x*65536,d=le+x+65535,x=Math.floor(d/65536),le=d-x*65536,d=re+x+65535,x=Math.floor(d/65536),re=d-x*65536,d=ne+x+65535,x=Math.floor(d/65536),ne=d-x*65536,d=ae+x+65535,x=Math.floor(d/65536),ae=d-x*65536,d=ie+x+65535,x=Math.floor(d/65536),ie=d-x*65536,d=Ae+x+65535,x=Math.floor(d/65536),Ae=d-x*65536,d=ge+x+65535,x=Math.floor(d/65536),ge=d-x*65536,d=Be+x+65535,x=Math.floor(d/65536),Be=d-x*65536,J+=x-1+37*(x-1),$[0]=J,$[1]=W,$[2]=ee,$[3]=de,$[4]=me,$[5]=O,$[6]=U,$[7]=ce,$[8]=le,$[9]=re,$[10]=ne,$[11]=ae,$[12]=ie,$[13]=Ae,$[14]=ge,$[15]=Be}function S($,T){_($,T,T)}function P($,T){const I=n();for(let d=0;d<16;d++)I[d]=T[d];for(let d=253;d>=0;d--)S(I,I),d!==2&&d!==4&&_(I,I,T);for(let d=0;d<16;d++)$[d]=I[d]}function j($,T){const I=new Uint8Array(32),d=new Float64Array(80),x=n(),J=n(),W=n(),ee=n(),de=n(),me=n();for(let le=0;le<31;le++)I[le]=$[le];I[31]=$[31]&127|64,I[0]&=248,f(d,T);for(let le=0;le<16;le++)J[le]=d[le];x[0]=ee[0]=1;for(let le=254;le>=0;--le){const re=I[le>>>3]>>>(le&7)&1;l(x,J,re),l(W,ee,re),v(de,x,W),E(x,x,W),v(W,J,ee),E(J,J,ee),S(ee,de),S(me,x),_(x,W,x),_(W,J,de),v(de,x,W),E(x,x,W),S(J,x),E(W,ee,me),_(x,W,o),v(x,x,ee),_(W,W,x),_(x,ee,me),_(ee,J,d),S(J,de),l(x,J,re),l(W,ee,re)}for(let le=0;le<16;le++)d[le+16]=x[le],d[le+32]=W[le],d[le+48]=J[le],d[le+64]=ee[le];const O=d.subarray(32),U=d.subarray(16);P(O,O),_(U,U,O);const ce=new Uint8Array(32);return h(ce,U),ce}t.scalarMult=j;function H($){return j($,i)}t.scalarMultBase=H;function Z($){if($.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const T=new Uint8Array($);return{publicKey:H(T),secretKey:T}}t.generateKeyPairFromSeed=Z;function N($){const T=(0,e.randomBytes)(32,$),I=Z(T);return(0,r.wipe)(T),I}t.generateKeyPair=N;function L($,T,I=!1){if($.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(T.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const d=j($,T);if(I){let x=0;for(let J=0;J<d.length;J++)x|=d[J];if(x===0)throw new Error("X25519: invalid shared key")}return d}t.sharedKey=L})(wu);function vu(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Wd(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?vu(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function yu(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=Wd(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return vu(r)}function xv(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,h=t.charAt(0),f=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function E(P){if(P instanceof Uint8Array||(ArrayBuffer.isView(P)?P=new Uint8Array(P.buffer,P.byteOffset,P.byteLength):Array.isArray(P)&&(P=Uint8Array.from(P))),!(P instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(P.length===0)return"";for(var j=0,H=0,Z=0,N=P.length;Z!==N&&P[Z]===0;)Z++,j++;for(var L=(N-Z)*v+1>>>0,$=new Uint8Array(L);Z!==N;){for(var T=P[Z],I=0,d=L-1;(T!==0||I<H)&&d!==-1;d--,I++)T+=256*$[d]>>>0,$[d]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");H=I,Z++}for(var x=L-H;x!==L&&$[x]===0;)x++;for(var J=h.repeat(j);x<L;++x)J+=t.charAt($[x]);return J}function _(P){if(typeof P!="string")throw new TypeError("Expected String");if(P.length===0)return new Uint8Array;var j=0;if(P[j]!==" "){for(var H=0,Z=0;P[j]===h;)H++,j++;for(var N=(P.length-j)*f+1>>>0,L=new Uint8Array(N);P[j];){var $=r[P.charCodeAt(j)];if($===255)return;for(var T=0,I=N-1;($!==0||T<Z)&&I!==-1;I--,T++)$+=l*L[I]>>>0,L[I]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");Z=T,j++}if(P[j]!==" "){for(var d=N-Z;d!==N&&L[d]===0;)d++;for(var x=new Uint8Array(H+(N-d)),J=H;d!==N;)x[J++]=L[d++];return x}}}function S(P){var j=_(P);if(j)return j;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:_,decode:S}}var Cv=xv,Iv=Cv;const zd=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},Sv=t=>new TextEncoder().encode(t),Ov=t=>new TextDecoder().decode(t);class Av{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Dv{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return qd(this,e)}}class $v{constructor(e){this.decoders=e}or(e){return qd(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const qd=(t,e)=>new $v({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Pv{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Av(e,r,n),this.decoder=new Dv(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const rc=({name:t,prefix:e,encode:r,decode:n})=>new Pv(t,e,r,n),So=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Iv(r,e);return rc({prefix:t,name:e,encode:n,decode:o=>zd(i(o))})},Tv=(t,e,r,n)=>{const i={};for(let v=0;v<e.length;++v)i[e[v]]=v;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,h=0,f=0;for(let v=0;v<o;++v){const E=i[t[v]];if(E===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|E,l+=r,l>=8&&(l-=8,c[f++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},Rv=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let h=0;h<t.length;++h)for(l=l<<8|t[h],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},br=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>rc({prefix:e,name:t,encode(i){return Rv(i,n,r)},decode(i){return Tv(i,n,r,t)}}),Nv=rc({prefix:"\0",name:"identity",encode:t=>Ov(t),decode:t=>Sv(t)});var Lv=Object.freeze({__proto__:null,identity:Nv});const Mv=br({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Uv=Object.freeze({__proto__:null,base2:Mv});const jv=br({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Fv=Object.freeze({__proto__:null,base8:jv});const Bv=So({prefix:"9",name:"base10",alphabet:"0123456789"});var kv=Object.freeze({__proto__:null,base10:Bv});const Hv=br({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Wv=br({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var zv=Object.freeze({__proto__:null,base16:Hv,base16upper:Wv});const qv=br({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vv=br({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Kv=br({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Gv=br({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Zv=br({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Yv=br({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Jv=br({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Qv=br({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Xv=br({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ey=Object.freeze({__proto__:null,base32:qv,base32upper:Vv,base32pad:Kv,base32padupper:Gv,base32hex:Zv,base32hexupper:Yv,base32hexpad:Jv,base32hexpadupper:Qv,base32z:Xv});const ty=So({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ry=So({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ny=Object.freeze({__proto__:null,base36:ty,base36upper:ry});const iy=So({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),sy=So({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var oy=Object.freeze({__proto__:null,base58btc:iy,base58flickr:sy});const ay=br({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),cy=br({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ly=br({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),uy=br({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var hy=Object.freeze({__proto__:null,base64:ay,base64pad:cy,base64url:ly,base64urlpad:uy});const Vd=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),fy=Vd.reduce((t,e,r)=>(t[r]=e,t),[]),dy=Vd.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function py(t){return t.reduce((e,r)=>(e+=fy[r],e),"")}function gy(t){const e=[];for(const r of t){const n=dy[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const my=rc({prefix:"\u{1F680}",name:"base256emoji",encode:py,decode:gy});var wy=Object.freeze({__proto__:null,base256emoji:my}),vy=Gd,Kd=128,yy=127,by=~yy,_y=Math.pow(2,31);function Gd(t,e,r){e=e||[],r=r||0;for(var n=r;t>=_y;)e[r++]=t&255|Kd,t/=128;for(;t&by;)e[r++]=t&255|Kd,t>>>=7;return e[r]=t|0,Gd.bytes=r-n+1,e}var Ey=bu,xy=128,Zd=127;function bu(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw bu.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&Zd)<<i:(c&Zd)*Math.pow(2,i),i+=7}while(c>=xy);return bu.bytes=o-n,r}var Cy=Math.pow(2,7),Iy=Math.pow(2,14),Sy=Math.pow(2,21),Oy=Math.pow(2,28),Ay=Math.pow(2,35),Dy=Math.pow(2,42),$y=Math.pow(2,49),Py=Math.pow(2,56),Ty=Math.pow(2,63),Ry=function(t){return t<Cy?1:t<Iy?2:t<Sy?3:t<Oy?4:t<Ay?5:t<Dy?6:t<$y?7:t<Py?8:t<Ty?9:10},Ny={encode:vy,decode:Ey,encodingLength:Ry},Yd=Ny;const Jd=(t,e,r=0)=>(Yd.encode(t,e,r),e),Qd=t=>Yd.encodingLength(t),_u=(t,e)=>{const r=e.byteLength,n=Qd(t),i=n+Qd(r),o=new Uint8Array(i+r);return Jd(t,o,0),Jd(r,o,n),o.set(e,i),new Ly(t,r,e,o)};class Ly{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Xd=({name:t,code:e,encode:r})=>new My(t,e,r);class My{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?_u(this.code,r):r.then(n=>_u(this.code,n))}else throw Error("Unknown type, must be binary type")}}const e1=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Uy=Xd({name:"sha2-256",code:18,encode:e1("SHA-256")}),jy=Xd({name:"sha2-512",code:19,encode:e1("SHA-512")});var Fy=Object.freeze({__proto__:null,sha256:Uy,sha512:jy});const t1=0,By="identity",r1=zd;var ky=Object.freeze({__proto__:null,identity:{code:t1,name:By,encode:r1,digest:t=>_u(t1,r1(t))}});new TextEncoder,new TextDecoder;const n1={...Lv,...Uv,...Fv,...kv,...zv,...ey,...ny,...oy,...hy,...wy};({...Fy,...ky});function i1(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const s1=i1("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Eu=i1("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Wd(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),o1={utf8:s1,"utf-8":s1,hex:n1.base16,latin1:Eu,ascii:Eu,binary:Eu,...n1};function Hr(t,e="utf8"){const r=o1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?vu(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Dr(t,e="utf8"){const r=o1[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var a1=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},Hy=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),Wy=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),zy=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),qy=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Vy=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Ky=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Gy=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,c1=3,Zy=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Ky]],l1=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Yy(t){return t?u1(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Vy:typeof navigator<"u"?u1(navigator.userAgent):Xy()}function Jy(t){return t!==""&&Zy.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var o=i.exec(t);return!!o&&[n,o]},!1)}function u1(t){var e=Jy(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new qy;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<c1&&(i=a1(a1([],i,!0),e5(c1-i.length),!0)):i=[];var o=i.join("."),c=Qy(t),l=Gy.exec(t);return l&&l[1]?new zy(r,o,c,l[1]):new Hy(r,o,c)}function Qy(t){for(var e=0,r=l1.length;e<r;e++){var n=l1[e],i=n[0],o=n[1],c=o.exec(t);if(c)return i}return null}function Xy(){var t=typeof process<"u"&&process.version;return t?new Wy(process.version.slice(1)):null}function e5(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Te={};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -11,13 +11,13 @@
11
11
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */var Fa=function(r,e){return Fa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])},Fa(r,e)};function gy(r,e){Fa(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var La=function(){return La=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},La.apply(this,arguments)};function vy(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(r);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(r,i[o])&&(t[i[o]]=r[i[o]]);return t}function yy(r,e,t,i){var o=arguments.length,a=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,i);else for(var f=r.length-1;f>=0;f--)(u=r[f])&&(a=(o<3?u(a):o>3?u(e,t,a):u(e,t))||a);return o>3&&a&&Object.defineProperty(e,t,a),a}function _y(r,e){return function(t,i){e(t,i,r)}}function by(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function my(r,e,t,i){function o(a){return a instanceof t?a:new t(function(u){u(a)})}return new(t||(t=Promise))(function(a,u){function f(w){try{p(i.next(w))}catch(I){u(I)}}function v(w){try{p(i.throw(w))}catch(I){u(I)}}function p(w){w.done?a(w.value):o(w.value).then(f,v)}p((i=i.apply(r,e||[])).next())})}function wy(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,o,a,u;return u={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function f(p){return function(w){return v([p,w])}}function v(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,o&&(a=p[0]&2?o.return:p[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,p[1])).done)return a;switch(o=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,o=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]<a[3])){t.label=p[1];break}if(p[0]===6&&t.label<a[1]){t.label=a[1],a=p;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(p);break}a[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(r,t)}catch(w){p=[6,w],o=0}finally{i=a=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function Ey(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function Dy(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Ua(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function al(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),o,a=[],u;try{for(;(e===void 0||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(f){u={error:f}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a}function Sy(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(al(arguments[e]));return r}function xy(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),o=0,e=0;e<t;e++)for(var a=arguments[e],u=0,f=a.length;u<f;u++,o++)i[o]=a[u];return i}function ki(r){return this instanceof ki?(this.v=r,this):new ki(r)}function Oy(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),o,a=[];return o={},u("next"),u("throw"),u("return"),o[Symbol.asyncIterator]=function(){return this},o;function u(S){i[S]&&(o[S]=function(C){return new Promise(function(R,B){a.push([S,C,R,B])>1||f(S,C)})})}function f(S,C){try{v(i[S](C))}catch(R){I(a[0][3],R)}}function v(S){S.value instanceof ki?Promise.resolve(S.value.v).then(p,w):I(a[0][2],S)}function p(S){f("next",S)}function w(S){f("throw",S)}function I(S,C){S(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function Iy(r){var e,t;return e={},i("next"),i("throw",function(o){throw o}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(o,a){e[o]=r[o]?function(u){return(t=!t)?{value:ki(r[o](u)),done:o==="return"}:a?a(u):u}:a}}function Py(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Ua=="function"?Ua(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(a){t[a]=r[a]&&function(u){return new Promise(function(f,v){u=r[a](u),o(f,v,u.done,u.value)})}}function o(a,u,f,v){Promise.resolve(v).then(function(p){a({value:p,done:f})},u)}}function Cy(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function Ay(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function Ty(r){return r&&r.__esModule?r:{default:r}}function Ry(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function Ny(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var $y=Object.freeze({__proto__:null,__extends:gy,get __assign(){return La},__rest:vy,__decorate:yy,__param:_y,__metadata:by,__awaiter:my,__generator:wy,__createBinding:Ey,__exportStar:Dy,__values:Ua,__read:al,__spread:Sy,__spreadArrays:xy,__await:ki,__asyncGenerator:Oy,__asyncDelegator:Iy,__asyncValues:Py,__makeTemplateObject:Cy,__importStar:Ay,__importDefault:Ty,__classPrivateFieldGet:Ry,__classPrivateFieldSet:Ny}),Qs=Bn($y),ja={},Gi={},cl;function Fy(){if(cl)return Gi;cl=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.delay=void 0;function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return Gi.delay=r,Gi}var zn={},Ma={},Kn={},ul;function Ly(){return ul||(ul=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.ONE_THOUSAND=Kn.ONE_HUNDRED=void 0,Kn.ONE_HUNDRED=100,Kn.ONE_THOUSAND=1e3),Kn}var qa={},hl;function Uy(){return hl||(hl=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_YEAR=r.FOUR_WEEKS=r.THREE_WEEKS=r.TWO_WEEKS=r.ONE_WEEK=r.THIRTY_DAYS=r.SEVEN_DAYS=r.FIVE_DAYS=r.THREE_DAYS=r.ONE_DAY=r.TWENTY_FOUR_HOURS=r.TWELVE_HOURS=r.SIX_HOURS=r.THREE_HOURS=r.ONE_HOUR=r.SIXTY_MINUTES=r.THIRTY_MINUTES=r.TEN_MINUTES=r.FIVE_MINUTES=r.ONE_MINUTE=r.SIXTY_SECONDS=r.THIRTY_SECONDS=r.TEN_SECONDS=r.FIVE_SECONDS=r.ONE_SECOND=void 0,r.ONE_SECOND=1,r.FIVE_SECONDS=5,r.TEN_SECONDS=10,r.THIRTY_SECONDS=30,r.SIXTY_SECONDS=60,r.ONE_MINUTE=r.SIXTY_SECONDS,r.FIVE_MINUTES=r.ONE_MINUTE*5,r.TEN_MINUTES=r.ONE_MINUTE*10,r.THIRTY_MINUTES=r.ONE_MINUTE*30,r.SIXTY_MINUTES=r.ONE_MINUTE*60,r.ONE_HOUR=r.SIXTY_MINUTES,r.THREE_HOURS=r.ONE_HOUR*3,r.SIX_HOURS=r.ONE_HOUR*6,r.TWELVE_HOURS=r.ONE_HOUR*12,r.TWENTY_FOUR_HOURS=r.ONE_HOUR*24,r.ONE_DAY=r.TWENTY_FOUR_HOURS,r.THREE_DAYS=r.ONE_DAY*3,r.FIVE_DAYS=r.ONE_DAY*5,r.SEVEN_DAYS=r.ONE_DAY*7,r.THIRTY_DAYS=r.ONE_DAY*30,r.ONE_WEEK=r.SEVEN_DAYS,r.TWO_WEEKS=r.ONE_WEEK*2,r.THREE_WEEKS=r.ONE_WEEK*3,r.FOUR_WEEKS=r.ONE_WEEK*4,r.ONE_YEAR=r.ONE_DAY*365}(qa)),qa}var ll;function fl(){return ll||(ll=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Qs;e.__exportStar(Ly(),r),e.__exportStar(Uy(),r)}(Ma)),Ma}var dl;function jy(){if(dl)return zn;dl=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.fromMiliseconds=zn.toMiliseconds=void 0;const r=fl();function e(i){return i*r.ONE_THOUSAND}zn.toMiliseconds=e;function t(i){return Math.floor(i/r.ONE_THOUSAND)}return zn.fromMiliseconds=t,zn}var pl;function My(){return pl||(pl=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Qs;e.__exportStar(Fy(),r),e.__exportStar(jy(),r)}(ja)),ja}var pi={},gl;function qy(){if(gl)return pi;gl=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const i=this.get(t);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const o=Date.now()-i.started;this.timestamps.set(t,{started:i.started,elapsed:o})}get(t){const i=this.timestamps.get(t);if(typeof i>"u")throw new Error(`No timestamp found for label: ${t}`);return i}elapsed(t){const i=this.get(t);return i.elapsed||Date.now()-i.started}}return pi.Watch=r,pi.default=r,pi}var Ha={},Wi={},vl;function Hy(){if(vl)return Wi;vl=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.IWatch=void 0;class r{}return Wi.IWatch=r,Wi}var yl;function By(){return yl||(yl=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Qs.__exportStar(Hy(),r)}(Ha)),Ha}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Qs;e.__exportStar(My(),r),e.__exportStar(qy(),r),e.__exportStar(By(),r),e.__exportStar(fl(),r)})(ye);var lt={};Object.defineProperty(lt,"__esModule",{value:!0}),lt.getLocalStorage=lt.getLocalStorageOrThrow=lt.getCrypto=lt.getCryptoOrThrow=bl=lt.getLocation=lt.getLocationOrThrow=Ba=lt.getNavigator=lt.getNavigatorOrThrow=_l=lt.getDocument=lt.getDocumentOrThrow=lt.getFromWindowOrThrow=lt.getFromWindow=void 0;function Vn(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}lt.getFromWindow=Vn;function gi(r){const e=Vn(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}lt.getFromWindowOrThrow=gi;function zy(){return gi("document")}lt.getDocumentOrThrow=zy;function Ky(){return Vn("document")}var _l=lt.getDocument=Ky;function Vy(){return gi("navigator")}lt.getNavigatorOrThrow=Vy;function ky(){return Vn("navigator")}var Ba=lt.getNavigator=ky;function Gy(){return gi("location")}lt.getLocationOrThrow=Gy;function Wy(){return Vn("location")}var bl=lt.getLocation=Wy;function Yy(){return gi("crypto")}lt.getCryptoOrThrow=Yy;function Jy(){return Vn("crypto")}lt.getCrypto=Jy;function Qy(){return gi("localStorage")}lt.getLocalStorageOrThrow=Qy;function Xy(){return Vn("localStorage")}lt.getLocalStorage=Xy;var za={};Object.defineProperty(za,"__esModule",{value:!0});var ml=za.getWindowMetadata=void 0;const wl=lt;function Zy(){let r,e;try{r=wl.getDocumentOrThrow(),e=wl.getLocationOrThrow()}catch{return null}function t(){const I=r.getElementsByTagName("link"),S=[];for(let C=0;C<I.length;C++){const R=I[C],B=R.getAttribute("rel");if(B&&B.toLowerCase().indexOf("icon")>-1){const K=R.getAttribute("href");if(K)if(K.toLowerCase().indexOf("https:")===-1&&K.toLowerCase().indexOf("http:")===-1&&K.indexOf("//")!==0){let se=e.protocol+"//"+e.host;if(K.indexOf("/")===0)se+=K;else{const $=e.pathname.split("/");$.pop();const U=$.join("/");se+=U+"/"+K}S.push(se)}else if(K.indexOf("//")===0){const se=e.protocol+K;S.push(se)}else S.push(K)}}return S}function i(...I){const S=r.getElementsByTagName("meta");for(let C=0;C<S.length;C++){const R=S[C],B=["itemprop","property","name"].map(K=>R.getAttribute(K)).filter(K=>K?I.includes(K):!1);if(B.length&&B){const K=R.getAttribute("content");if(K)return K}}return""}function o(){let I=i("name","og:site_name","og:title","twitter:title");return I||(I=r.title),I}function a(){return i("description","og:description","twitter:description","keywords")}const u=o(),f=a(),v=e.origin,p=t();return{description:f,url:v,icons:p,name:u}}ml=za.getWindowMetadata=Zy;var Yi={},e_=r=>encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),El="%[a-f0-9]{2}",Dl=new RegExp("("+El+")|([^%]+?)","gi"),Sl=new RegExp("("+El+")+","gi");function Ka(r,e){try{return[decodeURIComponent(r.join(""))]}catch{}if(r.length===1)return r;e=e||1;var t=r.slice(0,e),i=r.slice(e);return Array.prototype.concat.call([],Ka(t),Ka(i))}function t_(r){try{return decodeURIComponent(r)}catch{for(var e=r.match(Dl)||[],t=1;t<e.length;t++)r=Ka(e,t).join(""),e=r.match(Dl)||[];return r}}function r_(r){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},t=Sl.exec(r);t;){try{e[t[0]]=decodeURIComponent(t[0])}catch{var i=t_(t[0]);i!==t[0]&&(e[t[0]]=i)}t=Sl.exec(r)}e["%C2"]="\uFFFD";for(var o=Object.keys(e),a=0;a<o.length;a++){var u=o[a];r=r.replace(new RegExp(u,"g"),e[u])}return r}var n_=function(r){if(typeof r!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof r+"`");try{return r=r.replace(/\+/g," "),decodeURIComponent(r)}catch{return r_(r)}},i_=(r,e)=>{if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[r];const t=r.indexOf(e);return t===-1?[r]:[r.slice(0,t),r.slice(t+e.length)]},s_=function(r,e){for(var t={},i=Object.keys(r),o=Array.isArray(e),a=0;a<i.length;a++){var u=i[a],f=r[u];(o?e.indexOf(u)!==-1:e(u,f,r))&&(t[u]=f)}return t};(function(r){const e=e_,t=n_,i=i_,o=s_,a=$=>$==null,u=Symbol("encodeFragmentIdentifier");function f($){switch($.arrayFormat){case"index":return U=>(x,T)=>{const E=x.length;return T===void 0||$.skipNull&&T===null||$.skipEmptyString&&T===""?x:T===null?[...x,[w(U,$),"[",E,"]"].join("")]:[...x,[w(U,$),"[",w(E,$),"]=",w(T,$)].join("")]};case"bracket":return U=>(x,T)=>T===void 0||$.skipNull&&T===null||$.skipEmptyString&&T===""?x:T===null?[...x,[w(U,$),"[]"].join("")]:[...x,[w(U,$),"[]=",w(T,$)].join("")];case"colon-list-separator":return U=>(x,T)=>T===void 0||$.skipNull&&T===null||$.skipEmptyString&&T===""?x:T===null?[...x,[w(U,$),":list="].join("")]:[...x,[w(U,$),":list=",w(T,$)].join("")];case"comma":case"separator":case"bracket-separator":{const U=$.arrayFormat==="bracket-separator"?"[]=":"=";return x=>(T,E)=>E===void 0||$.skipNull&&E===null||$.skipEmptyString&&E===""?T:(E=E===null?"":E,T.length===0?[[w(x,$),U,w(E,$)].join("")]:[[T,w(E,$)].join($.arrayFormatSeparator)])}default:return U=>(x,T)=>T===void 0||$.skipNull&&T===null||$.skipEmptyString&&T===""?x:T===null?[...x,w(U,$)]:[...x,[w(U,$),"=",w(T,$)].join("")]}}function v($){let U;switch($.arrayFormat){case"index":return(x,T,E)=>{if(U=/\[(\d*)\]$/.exec(x),x=x.replace(/\[\d*\]$/,""),!U){E[x]=T;return}E[x]===void 0&&(E[x]={}),E[x][U[1]]=T};case"bracket":return(x,T,E)=>{if(U=/(\[\])$/.exec(x),x=x.replace(/\[\]$/,""),!U){E[x]=T;return}if(E[x]===void 0){E[x]=[T];return}E[x]=[].concat(E[x],T)};case"colon-list-separator":return(x,T,E)=>{if(U=/(:list)$/.exec(x),x=x.replace(/:list$/,""),!U){E[x]=T;return}if(E[x]===void 0){E[x]=[T];return}E[x]=[].concat(E[x],T)};case"comma":case"separator":return(x,T,E)=>{const h=typeof T=="string"&&T.includes($.arrayFormatSeparator),b=typeof T=="string"&&!h&&I(T,$).includes($.arrayFormatSeparator);T=b?I(T,$):T;const G=h||b?T.split($.arrayFormatSeparator).map(Y=>I(Y,$)):T===null?T:I(T,$);E[x]=G};case"bracket-separator":return(x,T,E)=>{const h=/(\[\])$/.test(x);if(x=x.replace(/\[\]$/,""),!h){E[x]=T&&I(T,$);return}const b=T===null?[]:T.split($.arrayFormatSeparator).map(G=>I(G,$));if(E[x]===void 0){E[x]=b;return}E[x]=[].concat(E[x],b)};default:return(x,T,E)=>{if(E[x]===void 0){E[x]=T;return}E[x]=[].concat(E[x],T)}}}function p($){if(typeof $!="string"||$.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function w($,U){return U.encode?U.strict?e($):encodeURIComponent($):$}function I($,U){return U.decode?t($):$}function S($){return Array.isArray($)?$.sort():typeof $=="object"?S(Object.keys($)).sort((U,x)=>Number(U)-Number(x)).map(U=>$[U]):$}function C($){const U=$.indexOf("#");return U!==-1&&($=$.slice(0,U)),$}function R($){let U="";const x=$.indexOf("#");return x!==-1&&(U=$.slice(x)),U}function B($){$=C($);const U=$.indexOf("?");return U===-1?"":$.slice(U+1)}function K($,U){return U.parseNumbers&&!Number.isNaN(Number($))&&typeof $=="string"&&$.trim()!==""?$=Number($):U.parseBooleans&&$!==null&&($.toLowerCase()==="true"||$.toLowerCase()==="false")&&($=$.toLowerCase()==="true"),$}function se($,U){U=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},U),p(U.arrayFormatSeparator);const x=v(U),T=Object.create(null);if(typeof $!="string"||($=$.trim().replace(/^[?#&]/,""),!$))return T;for(const E of $.split("&")){if(E==="")continue;let[h,b]=i(U.decode?E.replace(/\+/g," "):E,"=");b=b===void 0?null:["comma","separator","bracket-separator"].includes(U.arrayFormat)?b:I(b,U),x(I(h,U),b,T)}for(const E of Object.keys(T)){const h=T[E];if(typeof h=="object"&&h!==null)for(const b of Object.keys(h))h[b]=K(h[b],U);else T[E]=K(h,U)}return U.sort===!1?T:(U.sort===!0?Object.keys(T).sort():Object.keys(T).sort(U.sort)).reduce((E,h)=>{const b=T[h];return b&&typeof b=="object"&&!Array.isArray(b)?E[h]=S(b):E[h]=b,E},Object.create(null))}r.extract=B,r.parse=se,r.stringify=($,U)=>{if(!$)return"";U=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},U),p(U.arrayFormatSeparator);const x=b=>U.skipNull&&a($[b])||U.skipEmptyString&&$[b]==="",T=f(U),E={};for(const b of Object.keys($))x(b)||(E[b]=$[b]);const h=Object.keys(E);return U.sort!==!1&&h.sort(U.sort),h.map(b=>{const G=$[b];return G===void 0?"":G===null?w(b,U):Array.isArray(G)?G.length===0&&U.arrayFormat==="bracket-separator"?w(b,U)+"[]":G.reduce(T(b),[]).join("&"):w(b,U)+"="+w(G,U)}).filter(b=>b.length>0).join("&")},r.parseUrl=($,U)=>{U=Object.assign({decode:!0},U);const[x,T]=i($,"#");return Object.assign({url:x.split("?")[0]||"",query:se(B($),U)},U&&U.parseFragmentIdentifier&&T?{fragmentIdentifier:I(T,U)}:{})},r.stringifyUrl=($,U)=>{U=Object.assign({encode:!0,strict:!0,[u]:!0},U);const x=C($.url).split("?")[0]||"",T=r.extract($.url),E=r.parse(T,{sort:!1}),h=Object.assign(E,$.query);let b=r.stringify(h,U);b&&(b=`?${b}`);let G=R($.url);return $.fragmentIdentifier&&(G=`#${U[u]?w($.fragmentIdentifier,U):$.fragmentIdentifier}`),`${x}${b}${G}`},r.pick=($,U,x)=>{x=Object.assign({parseFragmentIdentifier:!0,[u]:!1},x);const{url:T,query:E,fragmentIdentifier:h}=r.parseUrl($,x);return r.stringifyUrl({url:T,query:o(E,U),fragmentIdentifier:h},x)},r.exclude=($,U,x)=>{const T=Array.isArray(U)?E=>!U.includes(E):(E,h)=>!U(E,h);return r.pick($,T,x)}})(Yi);const o_={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}},a_=":";function c_(r){const[e,t]=r.split(a_);return{namespace:e,reference:t}}function u_(r,e=[]){const t=[];return Object.keys(r).forEach(i=>{if(e.length&&!e.includes(i))return;const o=r[i];t.push(...o.accounts)}),t}function xl(r,e){return r.includes(":")?[r]:e.chains||[]}const Ol="base10",ir="base16",Va="base64pad",ka="utf8",Il=0,kn=1,h_=0,Pl=1,Ga=12,Wa=32;function l_(){const r=Ca.generateKeyPair();return{privateKey:nr(r.secretKey,ir),publicKey:nr(r.publicKey,ir)}}function Ya(){const r=di.randomBytes(Wa);return nr(r,ir)}function f_(r,e){const t=Ca.sharedKey(pr(r,ir),pr(e,ir),!0),i=new O0(Ys.SHA256,t).expand(Wa);return nr(i,ir)}function d_(r){const e=Ys.hash(pr(r,ir));return nr(e,ir)}function vi(r){const e=Ys.hash(pr(r,ka));return nr(e,ir)}function p_(r){return pr(`${r}`,Ol)}function Ji(r){return Number(nr(r,Ol))}function g_(r){const e=p_(typeof r.type<"u"?r.type:Il);if(Ji(e)===kn&&typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof r.senderPublicKey<"u"?pr(r.senderPublicKey,ir):void 0,i=typeof r.iv<"u"?pr(r.iv,ir):di.randomBytes(Ga),o=new Ea.ChaCha20Poly1305(pr(r.symKey,ir)).seal(i,pr(r.message,ka));return y_({type:e,sealed:o,iv:i,senderPublicKey:t})}function v_(r){const e=new Ea.ChaCha20Poly1305(pr(r.symKey,ir)),{sealed:t,iv:i}=Xs(r.encoded),o=e.open(i,t);if(o===null)throw new Error("Failed to decrypt");return nr(o,ka)}function y_(r){if(Ji(r.type)===kn){if(typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return nr(Ta([r.type,r.senderPublicKey,r.iv,r.sealed]),Va)}return nr(Ta([r.type,r.iv,r.sealed]),Va)}function Xs(r){const e=pr(r,Va),t=e.slice(h_,Pl),i=Pl;if(Ji(t)===kn){const f=i+Wa,v=f+Ga,p=e.slice(i,f),w=e.slice(f,v),I=e.slice(v);return{type:t,sealed:I,iv:w,senderPublicKey:p}}const o=i+Ga,a=e.slice(i,o),u=e.slice(o);return{type:t,sealed:u,iv:a}}function __(r,e){const t=Xs(r);return Cl({type:Ji(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?nr(t.senderPublicKey,ir):void 0,receiverPublicKey:e?.receiverPublicKey})}function Cl(r){const e=r?.type||Il;if(e===kn){if(typeof r?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof r?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:r?.senderPublicKey,receiverPublicKey:r?.receiverPublicKey}}function Al(r){return r.type===kn&&typeof r.senderPublicKey=="string"&&typeof r.receiverPublicKey=="string"}var b_=Object.defineProperty,Tl=Object.getOwnPropertySymbols,m_=Object.prototype.hasOwnProperty,w_=Object.prototype.propertyIsEnumerable,Rl=(r,e,t)=>e in r?b_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Nl=(r,e)=>{for(var t in e||(e={}))m_.call(e,t)&&Rl(r,t,e[t]);if(Tl)for(var t of Tl(e))w_.call(e,t)&&Rl(r,t,e[t]);return r};const E_="ReactNative",Sr={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},D_="js";function Ja(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Qi(){return!_l()&&!!Ba()&&navigator.product===E_}function Xi(){return!Ja()&&!!Ba()}function Zi(){return Qi()?Sr.reactNative:Ja()?Sr.node:Xi()?Sr.browser:Sr.unknown}function S_(r,e){let t=Yi.parse(r);return t=Nl(Nl({},t),e),r=Yi.stringify(t),r}function x_(){return ml()||{name:"",description:"",url:"",icons:[""]}}function O_(){if(Zi()===Sr.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:t,Version:i}=global.Platform;return[t,i].join("-")}const r=hy();if(r===null)return"unknown";const e=r.os?r.os.replace(" ","").toLowerCase():"unknown";return r.type==="browser"?[e,r.name,r.version].join("-"):[e,r.version].join("-")}function I_(){var r;const e=Zi();return e===Sr.browser?[e,((r=bl())==null?void 0:r.host)||"unknown"].join(":"):e}function P_(r,e,t){const i=O_(),o=I_();return[[r,e].join("-"),[D_,t].join("-"),i,o].join("/")}function C_({protocol:r,version:e,relayUrl:t,sdkVersion:i,auth:o,projectId:a,useOnCloseEvent:u}){const f=t.split("?"),v=P_(r,e,i),p={auth:o,ua:v,projectId:a,useOnCloseEvent:u||void 0},w=S_(f[1]||"",p);return f[0]+"?"+w}function Gn(r,e){return r.filter(t=>e.includes(t)).length===r.length}function $l(r){return Object.fromEntries(r.entries())}function Fl(r){return new Map(Object.entries(r))}function yi(r=ye.FIVE_MINUTES,e){const t=ye.toMiliseconds(r||ye.FIVE_MINUTES);let i,o,a;return{resolve:u=>{a&&i&&(clearTimeout(a),i(u))},reject:u=>{a&&o&&(clearTimeout(a),o(u))},done:()=>new Promise((u,f)=>{a=setTimeout(()=>{f(new Error(e))},t),i=u,o=f})}}function es(r,e,t){return new Promise(async(i,o)=>{const a=setTimeout(()=>o(new Error(t)),e);try{const u=await r;i(u)}catch(u){o(u)}clearTimeout(a)})}function Ll(r,e){if(typeof e=="string"&&e.startsWith(`${r}:`))return e;if(r.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(r.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${r}`)}function A_(r){return Ll("topic",r)}function T_(r){return Ll("id",r)}function Ul(r){const[e,t]=r.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")i.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))i.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return i}function Br(r,e){return ye.fromMiliseconds((e||Date.now())+ye.toMiliseconds(r))}function In(r){return Date.now()>=ye.toMiliseconds(r)}function Ft(r,e){return`${r}${e?`:${e}`:""}`}function Qa(r=[],e=[]){return[...new Set([...r,...e])]}async function R_({id:r,topic:e,wcDeepLink:t}){try{if(!t)return;const i=typeof t=="string"?JSON.parse(t):t;let o=i?.href;if(typeof o!="string")return;o.endsWith("/")&&(o=o.slice(0,-1));const a=`${o}/wc?requestId=${r}&sessionTopic=${e}`,u=Zi();u===Sr.browser?a.startsWith("https://")?window.open(a,"_blank","noreferrer noopener"):window.open(a,"_self","noreferrer noopener"):u===Sr.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(a)}catch(i){console.error(i)}}const N_="irn";function Xa(r){return r?.relay||{protocol:N_}}function Zs(r){const e=o_[r];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${r}`);return e}var $_=Object.defineProperty,jl=Object.getOwnPropertySymbols,F_=Object.prototype.hasOwnProperty,L_=Object.prototype.propertyIsEnumerable,Ml=(r,e,t)=>e in r?$_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,U_=(r,e)=>{for(var t in e||(e={}))F_.call(e,t)&&Ml(r,t,e[t]);if(jl)for(var t of jl(e))L_.call(e,t)&&Ml(r,t,e[t]);return r};function j_(r,e="-"){const t={},i="relay"+e;return Object.keys(r).forEach(o=>{if(o.startsWith(i)){const a=o.replace(i,""),u=r[o];t[a]=u}}),t}function M_(r){r=r.includes("wc://")?r.replace("wc://",""):r,r=r.includes("wc:")?r.replace("wc:",""):r;const e=r.indexOf(":"),t=r.indexOf("?")!==-1?r.indexOf("?"):void 0,i=r.substring(0,e),o=r.substring(e+1,t).split("@"),a=typeof t<"u"?r.substring(t):"",u=Yi.parse(a);return{protocol:i,topic:q_(o[0]),version:parseInt(o[1],10),symKey:u.symKey,relay:j_(u)}}function q_(r){return r.startsWith("//")?r.substring(2):r}function H_(r,e="-"){const t="relay",i={};return Object.keys(r).forEach(o=>{const a=t+e+o;r[o]&&(i[a]=r[o])}),i}function B_(r){return`${r.protocol}:${r.topic}@${r.version}?`+Yi.stringify(U_({symKey:r.symKey},H_(r.relay)))}function _i(r){const e=[];return r.forEach(t=>{const[i,o]=t.split(":");e.push(`${i}:${o}`)}),e}function z_(r){const e=[];return Object.values(r).forEach(t=>{e.push(..._i(t.accounts))}),e}function K_(r,e){const t=[];return Object.values(r).forEach(i=>{_i(i.accounts).includes(e)&&t.push(...i.methods)}),t}function V_(r,e){const t=[];return Object.values(r).forEach(i=>{_i(i.accounts).includes(e)&&t.push(...i.events)}),t}function k_(r,e){const t=to(r,e);if(t)throw new Error(t.message);const i={};for(const[o,a]of Object.entries(r))i[o]={methods:a.methods,events:a.events,chains:a.accounts.map(u=>`${u.split(":")[0]}:${u.split(":")[1]}`)};return i}function Za(r){return r.includes(":")}function ts(r){return Za(r)?r.split(":")[0]:r}const G_={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},W_={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function he(r,e){const{message:t,code:i}=W_[r];return{message:e?`${t} ${e}`:t,code:i}}function At(r,e){const{message:t,code:i}=G_[r];return{message:e?`${t} ${e}`:t,code:i}}function Xr(r,e){return Array.isArray(r)?typeof e<"u"&&r.length?r.every(e):!0:!1}function bi(r){return Object.getPrototypeOf(r)===Object.prototype&&Object.keys(r).length}function sr(r){return typeof r>"u"}function kt(r,e){return e&&sr(r)?!0:typeof r=="string"&&!!r.trim().length}function ec(r,e){return e&&sr(r)?!0:typeof r=="number"&&!isNaN(r)}function Y_(r,e){const{requiredNamespaces:t}=e,i=Object.keys(r.namespaces),o=Object.keys(t);let a=!0;return Gn(o,i)?(i.forEach(u=>{const{accounts:f,methods:v,events:p}=r.namespaces[u],w=_i(f),I=t[u];(!Gn(xl(u,I),w)||!Gn(I.methods,v)||!Gn(I.events,p))&&(a=!1)}),a):!1}function eo(r){return kt(r,!1)&&r.includes(":")?r.split(":").length===2:!1}function J_(r){if(kt(r,!1)&&r.includes(":")){const e=r.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&eo(t)}}return!1}function Q_(r){if(kt(r,!1))try{return typeof new URL(r)<"u"}catch{return!1}return!1}function X_(r){var e;return(e=r?.proposer)==null?void 0:e.publicKey}function Z_(r){return r?.topic}function e1(r,e){let t=null;return kt(r?.publicKey,!1)||(t=he("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function ql(r){let e=!0;return Xr(r)?r.length&&(e=r.every(t=>kt(t,!1))):e=!1,e}function t1(r,e,t){let i=null;return Xr(e)&&e.length?e.forEach(o=>{i||eo(o)||(i=At("UNSUPPORTED_CHAINS",`${t}, chain ${o} should be a string and conform to "namespace:chainId" format`))}):eo(r)||(i=At("UNSUPPORTED_CHAINS",`${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),i}function r1(r,e,t){let i=null;return Object.entries(r).forEach(([o,a])=>{if(i)return;const u=t1(o,xl(o,a),`${e} ${t}`);u&&(i=u)}),i}function n1(r,e){let t=null;return Xr(r)?r.forEach(i=>{t||J_(i)||(t=At("UNSUPPORTED_ACCOUNTS",`${e}, account ${i} should be a string and conform to "namespace:chainId:address" format`))}):t=At("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function i1(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const o=n1(i?.accounts,`${e} namespace`);o&&(t=o)}),t}function s1(r,e){let t=null;return ql(r?.methods)?ql(r?.events)||(t=At("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=At("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function Hl(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const o=s1(i,`${e}, namespace`);o&&(t=o)}),t}function o1(r,e,t){let i=null;if(r&&bi(r)){const o=Hl(r,e);o&&(i=o);const a=r1(r,e,t);a&&(i=a)}else i=he("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return i}function to(r,e){let t=null;if(r&&bi(r)){const i=Hl(r,e);i&&(t=i);const o=i1(r,e);o&&(t=o)}else t=he("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function Bl(r){return kt(r.protocol,!0)}function a1(r,e){let t=!1;return e&&!r?t=!0:r&&Xr(r)&&r.length&&r.forEach(i=>{t=Bl(i)}),t}function c1(r){return typeof r=="number"}function gr(r){return typeof r<"u"&&typeof r!==null}function u1(r){return!(!r||typeof r!="object"||!r.code||!ec(r.code,!1)||!r.message||!kt(r.message,!1))}function h1(r){return!(sr(r)||!kt(r.method,!1))}function l1(r){return!(sr(r)||sr(r.result)&&sr(r.error)||!ec(r.id,!1)||!kt(r.jsonrpc,!1))}function f1(r){return!(sr(r)||!kt(r.name,!1))}function zl(r,e){return!(!eo(e)||!z_(r).includes(e))}function d1(r,e,t){return kt(t,!1)?K_(r,e).includes(t):!1}function p1(r,e,t){return kt(t,!1)?V_(r,e).includes(t):!1}function Kl(r,e,t){let i=null;const o=g1(r),a=v1(e),u=Object.keys(o),f=Object.keys(a),v=Vl(Object.keys(r)),p=Vl(Object.keys(e)),w=v.filter(I=>!p.includes(I));return w.length&&(i=he("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces.
15
- Required: ${w.toString()}
16
- Received: ${Object.keys(e).toString()}`)),Gn(u,f)||(i=he("NON_CONFORMING_NAMESPACES",`${t} namespaces chains don't satisfy required namespaces.
17
- Required: ${u.toString()}
18
- Approved: ${f.toString()}`)),Object.keys(e).forEach(I=>{if(!I.includes(":")||i)return;const S=_i(e[I].accounts);S.includes(I)||(i=he("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${I}
19
- Required: ${I}
20
- Approved: ${S.toString()}`))}),u.forEach(I=>{i||(Gn(o[I].methods,a[I].methods)?Gn(o[I].events,a[I].events)||(i=he("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${I}`)):i=he("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${I}`))}),i}function g1(r){const e={};return Object.keys(r).forEach(t=>{var i;t.includes(":")?e[t]=r[t]:(i=r[t].chains)==null||i.forEach(o=>{e[o]={methods:r[t].methods,events:r[t].events}})}),e}function Vl(r){return[...new Set(r.map(e=>e.includes(":")?e.split(":")[0]:e))]}function v1(r){const e={};return Object.keys(r).forEach(t=>{if(t.includes(":"))e[t]=r[t];else{const i=_i(r[t].accounts);i?.forEach(o=>{e[o]={accounts:r[t].accounts.filter(a=>a.includes(`${o}:`)),methods:r[t].methods,events:r[t].events}})}}),e}function y1(r,e){return ec(r,!1)&&r<=e.max&&r>=e.min}function kl(){const r=Zi();return new Promise(e=>{switch(r){case Sr.browser:e(_1());break;case Sr.reactNative:e(b1());break;case Sr.node:e(m1());break;default:e(!0)}})}function _1(){return Xi()&&navigator?.onLine}async function b1(){if(Qi()&&typeof global<"u"&&global!=null&&global.NetInfo){const r=await(global==null?void 0:global.NetInfo.fetch());return r?.isConnected}return!0}function m1(){return!0}function w1(r){switch(Zi()){case Sr.browser:E1(r);break;case Sr.reactNative:D1(r);break}}function E1(r){!Qi()&&Xi()&&(window.addEventListener("online",()=>r(!0)),window.addEventListener("offline",()=>r(!1)))}function D1(r){Qi()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(e=>r(e?.isConnected))}const tc={};class ro{static get(e){return tc[e]}static set(e,t){tc[e]=t}static delete(e){delete tc[e]}}var no={};/*! *****************************************************************************
14
+ ***************************************************************************** */var xu=function(t,e){return xu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},xu(t,e)};function t5(t,e){xu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Cu=function(){return Cu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Cu.apply(this,arguments)};function r5(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function n5(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function i5(t,e){return function(r,n){e(r,n,t)}}function s5(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function o5(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function a5(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function c5(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function l5(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Iu(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function h1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function u5(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(h1(arguments[e]));return t}function h5(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Oo(t){return this instanceof Oo?(this.v=t,this):new Oo(t)}function f5(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Oo?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function d5(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:Oo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function p5(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Iu=="function"?Iu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(f){o({value:f,done:l})},c)}}function g5(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function m5(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function w5(t){return t&&t.__esModule?t:{default:t}}function v5(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function y5(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var b5=Object.freeze({__proto__:null,__extends:t5,get __assign(){return Cu},__rest:r5,__decorate:n5,__param:i5,__metadata:s5,__awaiter:o5,__generator:a5,__createBinding:c5,__exportStar:l5,__values:Iu,__read:h1,__spread:u5,__spreadArrays:h5,__await:Oo,__asyncGenerator:f5,__asyncDelegator:d5,__asyncValues:p5,__makeTemplateObject:g5,__importStar:m5,__importDefault:w5,__classPrivateFieldGet:v5,__classPrivateFieldSet:y5}),nc=Bi(b5),Su={},Ao={},f1;function _5(){if(f1)return Ao;f1=1,Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Ao.delay=t,Ao}var ki={},Ou={},Hi={},d1;function E5(){return d1||(d1=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.ONE_THOUSAND=Hi.ONE_HUNDRED=void 0,Hi.ONE_HUNDRED=100,Hi.ONE_THOUSAND=1e3),Hi}var Au={},p1;function x5(){return p1||(p1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(Au)),Au}var g1;function m1(){return g1||(g1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=nc;e.__exportStar(E5(),t),e.__exportStar(x5(),t)}(Ou)),Ou}var w1;function C5(){if(w1)return ki;w1=1,Object.defineProperty(ki,"__esModule",{value:!0}),ki.fromMiliseconds=ki.toMiliseconds=void 0;const t=m1();function e(n){return n*t.ONE_THOUSAND}ki.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return ki.fromMiliseconds=r,ki}var v1;function I5(){return v1||(v1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=nc;e.__exportStar(_5(),t),e.__exportStar(C5(),t)}(Su)),Su}var Os={},y1;function S5(){if(y1)return Os;y1=1,Object.defineProperty(Os,"__esModule",{value:!0}),Os.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return Os.Watch=t,Os.default=t,Os}var Du={},Do={},b1;function O5(){if(b1)return Do;b1=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.IWatch=void 0;class t{}return Do.IWatch=t,Do}var _1;function A5(){return _1||(_1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),nc.__exportStar(O5(),t)}(Du)),Du}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=nc;e.__exportStar(I5(),t),e.__exportStar(S5(),t),e.__exportStar(A5(),t),e.__exportStar(m1(),t)})(Te);var At={};Object.defineProperty(At,"__esModule",{value:!0}),At.getLocalStorage=At.getLocalStorageOrThrow=At.getCrypto=At.getCryptoOrThrow=x1=At.getLocation=At.getLocationOrThrow=$u=At.getNavigator=At.getNavigatorOrThrow=E1=At.getDocument=At.getDocumentOrThrow=At.getFromWindowOrThrow=At.getFromWindow=void 0;function Wi(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}At.getFromWindow=Wi;function As(t){const e=Wi(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}At.getFromWindowOrThrow=As;function D5(){return As("document")}At.getDocumentOrThrow=D5;function $5(){return Wi("document")}var E1=At.getDocument=$5;function P5(){return As("navigator")}At.getNavigatorOrThrow=P5;function T5(){return Wi("navigator")}var $u=At.getNavigator=T5;function R5(){return As("location")}At.getLocationOrThrow=R5;function N5(){return Wi("location")}var x1=At.getLocation=N5;function L5(){return As("crypto")}At.getCryptoOrThrow=L5;function M5(){return Wi("crypto")}At.getCrypto=M5;function U5(){return As("localStorage")}At.getLocalStorageOrThrow=U5;function j5(){return Wi("localStorage")}At.getLocalStorage=j5;var Pu={};Object.defineProperty(Pu,"__esModule",{value:!0});var C1=Pu.getWindowMetadata=void 0;const I1=At;function F5(){let t,e;try{t=I1.getDocumentOrThrow(),e=I1.getLocationOrThrow()}catch{return null}function r(){const E=t.getElementsByTagName("link"),_=[];for(let S=0;S<E.length;S++){const P=E[S],j=P.getAttribute("rel");if(j&&j.toLowerCase().indexOf("icon")>-1){const H=P.getAttribute("href");if(H)if(H.toLowerCase().indexOf("https:")===-1&&H.toLowerCase().indexOf("http:")===-1&&H.indexOf("//")!==0){let Z=e.protocol+"//"+e.host;if(H.indexOf("/")===0)Z+=H;else{const N=e.pathname.split("/");N.pop();const L=N.join("/");Z+=L+"/"+H}_.push(Z)}else if(H.indexOf("//")===0){const Z=e.protocol+H;_.push(Z)}else _.push(H)}}return _}function n(...E){const _=t.getElementsByTagName("meta");for(let S=0;S<_.length;S++){const P=_[S],j=["itemprop","property","name"].map(H=>P.getAttribute(H)).filter(H=>H?E.includes(H):!1);if(j.length&&j){const H=P.getAttribute("content");if(H)return H}}return""}function i(){let E=n("name","og:site_name","og:title","twitter:title");return E||(E=t.title),E}function o(){return n("description","og:description","twitter:description","keywords")}const c=i(),l=o(),h=e.origin,f=r();return{description:l,url:h,icons:f,name:c}}C1=Pu.getWindowMetadata=F5;var $o={},B5=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),S1="%[a-f0-9]{2}",O1=new RegExp("("+S1+")|([^%]+?)","gi"),A1=new RegExp("("+S1+")+","gi");function Tu(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],Tu(r),Tu(n))}function k5(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(O1)||[],r=1;r<e.length;r++)t=Tu(e,r).join(""),e=t.match(O1)||[];return t}}function H5(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=A1.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=k5(r[0]);n!==r[0]&&(e[r[0]]=n)}r=A1.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),o=0;o<i.length;o++){var c=i[o];t=t.replace(new RegExp(c,"g"),e[c])}return t}var W5=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return H5(t)}},z5=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},q5=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),o=0;o<n.length;o++){var c=n[o],l=t[c];(i?e.indexOf(c)!==-1:e(c,l,t))&&(r[c]=l)}return r};(function(t){const e=B5,r=W5,n=z5,i=q5,o=N=>N==null,c=Symbol("encodeFragmentIdentifier");function l(N){switch(N.arrayFormat){case"index":return L=>($,T)=>{const I=$.length;return T===void 0||N.skipNull&&T===null||N.skipEmptyString&&T===""?$:T===null?[...$,[v(L,N),"[",I,"]"].join("")]:[...$,[v(L,N),"[",v(I,N),"]=",v(T,N)].join("")]};case"bracket":return L=>($,T)=>T===void 0||N.skipNull&&T===null||N.skipEmptyString&&T===""?$:T===null?[...$,[v(L,N),"[]"].join("")]:[...$,[v(L,N),"[]=",v(T,N)].join("")];case"colon-list-separator":return L=>($,T)=>T===void 0||N.skipNull&&T===null||N.skipEmptyString&&T===""?$:T===null?[...$,[v(L,N),":list="].join("")]:[...$,[v(L,N),":list=",v(T,N)].join("")];case"comma":case"separator":case"bracket-separator":{const L=N.arrayFormat==="bracket-separator"?"[]=":"=";return $=>(T,I)=>I===void 0||N.skipNull&&I===null||N.skipEmptyString&&I===""?T:(I=I===null?"":I,T.length===0?[[v($,N),L,v(I,N)].join("")]:[[T,v(I,N)].join(N.arrayFormatSeparator)])}default:return L=>($,T)=>T===void 0||N.skipNull&&T===null||N.skipEmptyString&&T===""?$:T===null?[...$,v(L,N)]:[...$,[v(L,N),"=",v(T,N)].join("")]}}function h(N){let L;switch(N.arrayFormat){case"index":return($,T,I)=>{if(L=/\[(\d*)\]$/.exec($),$=$.replace(/\[\d*\]$/,""),!L){I[$]=T;return}I[$]===void 0&&(I[$]={}),I[$][L[1]]=T};case"bracket":return($,T,I)=>{if(L=/(\[\])$/.exec($),$=$.replace(/\[\]$/,""),!L){I[$]=T;return}if(I[$]===void 0){I[$]=[T];return}I[$]=[].concat(I[$],T)};case"colon-list-separator":return($,T,I)=>{if(L=/(:list)$/.exec($),$=$.replace(/:list$/,""),!L){I[$]=T;return}if(I[$]===void 0){I[$]=[T];return}I[$]=[].concat(I[$],T)};case"comma":case"separator":return($,T,I)=>{const d=typeof T=="string"&&T.includes(N.arrayFormatSeparator),x=typeof T=="string"&&!d&&E(T,N).includes(N.arrayFormatSeparator);T=x?E(T,N):T;const J=d||x?T.split(N.arrayFormatSeparator).map(W=>E(W,N)):T===null?T:E(T,N);I[$]=J};case"bracket-separator":return($,T,I)=>{const d=/(\[\])$/.test($);if($=$.replace(/\[\]$/,""),!d){I[$]=T&&E(T,N);return}const x=T===null?[]:T.split(N.arrayFormatSeparator).map(J=>E(J,N));if(I[$]===void 0){I[$]=x;return}I[$]=[].concat(I[$],x)};default:return($,T,I)=>{if(I[$]===void 0){I[$]=T;return}I[$]=[].concat(I[$],T)}}}function f(N){if(typeof N!="string"||N.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function v(N,L){return L.encode?L.strict?e(N):encodeURIComponent(N):N}function E(N,L){return L.decode?r(N):N}function _(N){return Array.isArray(N)?N.sort():typeof N=="object"?_(Object.keys(N)).sort((L,$)=>Number(L)-Number($)).map(L=>N[L]):N}function S(N){const L=N.indexOf("#");return L!==-1&&(N=N.slice(0,L)),N}function P(N){let L="";const $=N.indexOf("#");return $!==-1&&(L=N.slice($)),L}function j(N){N=S(N);const L=N.indexOf("?");return L===-1?"":N.slice(L+1)}function H(N,L){return L.parseNumbers&&!Number.isNaN(Number(N))&&typeof N=="string"&&N.trim()!==""?N=Number(N):L.parseBooleans&&N!==null&&(N.toLowerCase()==="true"||N.toLowerCase()==="false")&&(N=N.toLowerCase()==="true"),N}function Z(N,L){L=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},L),f(L.arrayFormatSeparator);const $=h(L),T=Object.create(null);if(typeof N!="string"||(N=N.trim().replace(/^[?#&]/,""),!N))return T;for(const I of N.split("&")){if(I==="")continue;let[d,x]=n(L.decode?I.replace(/\+/g," "):I,"=");x=x===void 0?null:["comma","separator","bracket-separator"].includes(L.arrayFormat)?x:E(x,L),$(E(d,L),x,T)}for(const I of Object.keys(T)){const d=T[I];if(typeof d=="object"&&d!==null)for(const x of Object.keys(d))d[x]=H(d[x],L);else T[I]=H(d,L)}return L.sort===!1?T:(L.sort===!0?Object.keys(T).sort():Object.keys(T).sort(L.sort)).reduce((I,d)=>{const x=T[d];return x&&typeof x=="object"&&!Array.isArray(x)?I[d]=_(x):I[d]=x,I},Object.create(null))}t.extract=j,t.parse=Z,t.stringify=(N,L)=>{if(!N)return"";L=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},L),f(L.arrayFormatSeparator);const $=x=>L.skipNull&&o(N[x])||L.skipEmptyString&&N[x]==="",T=l(L),I={};for(const x of Object.keys(N))$(x)||(I[x]=N[x]);const d=Object.keys(I);return L.sort!==!1&&d.sort(L.sort),d.map(x=>{const J=N[x];return J===void 0?"":J===null?v(x,L):Array.isArray(J)?J.length===0&&L.arrayFormat==="bracket-separator"?v(x,L)+"[]":J.reduce(T(x),[]).join("&"):v(x,L)+"="+v(J,L)}).filter(x=>x.length>0).join("&")},t.parseUrl=(N,L)=>{L=Object.assign({decode:!0},L);const[$,T]=n(N,"#");return Object.assign({url:$.split("?")[0]||"",query:Z(j(N),L)},L&&L.parseFragmentIdentifier&&T?{fragmentIdentifier:E(T,L)}:{})},t.stringifyUrl=(N,L)=>{L=Object.assign({encode:!0,strict:!0,[c]:!0},L);const $=S(N.url).split("?")[0]||"",T=t.extract(N.url),I=t.parse(T,{sort:!1}),d=Object.assign(I,N.query);let x=t.stringify(d,L);x&&(x=`?${x}`);let J=P(N.url);return N.fragmentIdentifier&&(J=`#${L[c]?v(N.fragmentIdentifier,L):N.fragmentIdentifier}`),`${$}${x}${J}`},t.pick=(N,L,$)=>{$=Object.assign({parseFragmentIdentifier:!0,[c]:!1},$);const{url:T,query:I,fragmentIdentifier:d}=t.parseUrl(N,$);return t.stringifyUrl({url:T,query:i(I,L),fragmentIdentifier:d},$)},t.exclude=(N,L,$)=>{const T=Array.isArray(L)?I=>!L.includes(I):(I,d)=>!L(I,d);return t.pick(N,T,$)}})($o);const V5={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}},K5=":";function G5(t){const[e,r]=t.split(K5);return{namespace:e,reference:r}}function Z5(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function D1(t,e){return t.includes(":")?[t]:e.chains||[]}const $1="base10",$r="base16",Ru="base64pad",Nu="utf8",P1=0,zi=1,Y5=0,T1=1,Lu=12,Mu=32;function J5(){const t=wu.generateKeyPair();return{privateKey:Dr(t.secretKey,$r),publicKey:Dr(t.publicKey,$r)}}function Uu(){const t=Ss.randomBytes(Mu);return Dr(t,$r)}function Q5(t,e){const r=wu.sharedKey(Hr(t,$r),Hr(e,$r),!0),n=new fv(tc.SHA256,r).expand(Mu);return Dr(n,$r)}function X5(t){const e=tc.hash(Hr(t,$r));return Dr(e,$r)}function Ds(t){const e=tc.hash(Hr(t,Nu));return Dr(e,$r)}function eb(t){return Hr(`${t}`,$1)}function Po(t){return Number(Dr(t,$1))}function tb(t){const e=eb(typeof t.type<"u"?t.type:P1);if(Po(e)===zi&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Hr(t.senderPublicKey,$r):void 0,n=typeof t.iv<"u"?Hr(t.iv,$r):Ss.randomBytes(Lu),i=new uu.ChaCha20Poly1305(Hr(t.symKey,$r)).seal(n,Hr(t.message,Nu));return nb({type:e,sealed:i,iv:n,senderPublicKey:r})}function rb(t){const e=new uu.ChaCha20Poly1305(Hr(t.symKey,$r)),{sealed:r,iv:n}=ic(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Dr(i,Nu)}function nb(t){if(Po(t.type)===zi){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Dr(yu([t.type,t.senderPublicKey,t.iv,t.sealed]),Ru)}return Dr(yu([t.type,t.iv,t.sealed]),Ru)}function ic(t){const e=Hr(t,Ru),r=e.slice(Y5,T1),n=T1;if(Po(r)===zi){const l=n+Mu,h=l+Lu,f=e.slice(n,l),v=e.slice(l,h),E=e.slice(h);return{type:r,sealed:E,iv:v,senderPublicKey:f}}const i=n+Lu,o=e.slice(n,i),c=e.slice(i);return{type:r,sealed:c,iv:o}}function ib(t,e){const r=ic(t);return R1({type:Po(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Dr(r.senderPublicKey,$r):void 0,receiverPublicKey:e?.receiverPublicKey})}function R1(t){const e=t?.type||P1;if(e===zi){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function N1(t){return t.type===zi&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var sb=Object.defineProperty,L1=Object.getOwnPropertySymbols,ob=Object.prototype.hasOwnProperty,ab=Object.prototype.propertyIsEnumerable,M1=(t,e,r)=>e in t?sb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,U1=(t,e)=>{for(var r in e||(e={}))ob.call(e,r)&&M1(t,r,e[r]);if(L1)for(var r of L1(e))ab.call(e,r)&&M1(t,r,e[r]);return t};const cb="ReactNative",Qr={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},lb="js";function ju(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function To(){return!E1()&&!!$u()&&navigator.product===cb}function Ro(){return!ju()&&!!$u()}function No(){return To()?Qr.reactNative:ju()?Qr.node:Ro()?Qr.browser:Qr.unknown}function ub(t,e){let r=$o.parse(t);return r=U1(U1({},r),e),t=$o.stringify(r),t}function hb(){return C1()||{name:"",description:"",url:"",icons:[""]}}function fb(){if(No()===Qr.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=Yy();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function db(){var t;const e=No();return e===Qr.browser?[e,((t=x1())==null?void 0:t.host)||"unknown"].join(":"):e}function pb(t,e,r){const n=fb(),i=db();return[[t,e].join("-"),[lb,r].join("-"),n,i].join("/")}function gb({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:c}){const l=r.split("?"),h=pb(t,e,n),f={auth:i,ua:h,projectId:o,useOnCloseEvent:c||void 0},v=ub(l[1]||"",f);return l[0]+"?"+v}function qi(t,e){return t.filter(r=>e.includes(r)).length===t.length}function j1(t){return Object.fromEntries(t.entries())}function F1(t){return new Map(Object.entries(t))}function $s(t=Te.FIVE_MINUTES,e){const r=Te.toMiliseconds(t||Te.FIVE_MINUTES);let n,i,o;return{resolve:c=>{o&&n&&(clearTimeout(o),n(c))},reject:c=>{o&&i&&(clearTimeout(o),i(c))},done:()=>new Promise((c,l)=>{o=setTimeout(()=>{l(new Error(e))},r),n=c,i=l})}}function Lo(t,e,r){return new Promise(async(n,i)=>{const o=setTimeout(()=>i(new Error(r)),e);try{const c=await t;n(c)}catch(c){i(c)}clearTimeout(o)})}function B1(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function mb(t){return B1("topic",t)}function wb(t){return B1("id",t)}function k1(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function En(t,e){return Te.fromMiliseconds((e||Date.now())+Te.toMiliseconds(t))}function pi(t){return Date.now()>=Te.toMiliseconds(t)}function tr(t,e){return`${t}${e?`:${e}`:""}`}function Fu(t=[],e=[]){return[...new Set([...t,...e])]}async function vb({id:t,topic:e,wcDeepLink:r}){try{if(!r)return;const n=typeof r=="string"?JSON.parse(r):r;let i=n?.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const o=`${i}/wc?requestId=${t}&sessionTopic=${e}`,c=No();c===Qr.browser?o.startsWith("https://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,"_self","noreferrer noopener"):c===Qr.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(n){console.error(n)}}const yb="irn";function Bu(t){return t?.relay||{protocol:yb}}function sc(t){const e=V5[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var bb=Object.defineProperty,H1=Object.getOwnPropertySymbols,_b=Object.prototype.hasOwnProperty,Eb=Object.prototype.propertyIsEnumerable,W1=(t,e,r)=>e in t?bb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xb=(t,e)=>{for(var r in e||(e={}))_b.call(e,r)&&W1(t,r,e[r]);if(H1)for(var r of H1(e))Eb.call(e,r)&&W1(t,r,e[r]);return t};function Cb(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const o=i.replace(n,""),c=t[i];r[o]=c}}),r}function Ib(t){t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),o=typeof r<"u"?t.substring(r):"",c=$o.parse(o);return{protocol:n,topic:Sb(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:Cb(c)}}function Sb(t){return t.startsWith("//")?t.substring(2):t}function Ob(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const o=r+e+i;t[i]&&(n[o]=t[i])}),n}function Ab(t){return`${t.protocol}:${t.topic}@${t.version}?`+$o.stringify(xb({symKey:t.symKey},Ob(t.relay)))}function Ps(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Db(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Ps(r.accounts))}),e}function $b(t,e){const r=[];return Object.values(t).forEach(n=>{Ps(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Pb(t,e){const r=[];return Object.values(t).forEach(n=>{Ps(n.accounts).includes(e)&&r.push(...n.events)}),r}function Tb(t,e){const r=ac(t,e);if(r)throw new Error(r.message);const n={};for(const[i,o]of Object.entries(t))n[i]={methods:o.methods,events:o.events,chains:o.accounts.map(c=>`${c.split(":")[0]}:${c.split(":")[1]}`)};return n}function ku(t){return t.includes(":")}function Mo(t){return ku(t)?t.split(":")[0]:t}const Rb={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},Nb={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function _e(t,e){const{message:r,code:n}=Nb[t];return{message:e?`${r} ${e}`:r,code:n}}function Yt(t,e){const{message:r,code:n}=Rb[t];return{message:e?`${r} ${e}`:r,code:n}}function Tn(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Ts(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Pr(t){return typeof t>"u"}function pr(t,e){return e&&Pr(t)?!0:typeof t=="string"&&!!t.trim().length}function Hu(t,e){return e&&Pr(t)?!0:typeof t=="number"&&!isNaN(t)}function Lb(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let o=!0;return qi(i,n)?(n.forEach(c=>{const{accounts:l,methods:h,events:f}=t.namespaces[c],v=Ps(l),E=r[c];(!qi(D1(c,E),v)||!qi(E.methods,h)||!qi(E.events,f))&&(o=!1)}),o):!1}function oc(t){return pr(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Mb(t){if(pr(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&oc(r)}}return!1}function Ub(t){if(pr(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function jb(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function Fb(t){return t?.topic}function Bb(t,e){let r=null;return pr(t?.publicKey,!1)||(r=_e("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function z1(t){let e=!0;return Tn(t)?t.length&&(e=t.every(r=>pr(r,!1))):e=!1,e}function kb(t,e,r){let n=null;return Tn(e)&&e.length?e.forEach(i=>{n||oc(i)||(n=Yt("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):oc(t)||(n=Yt("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function Hb(t,e,r){let n=null;return Object.entries(t).forEach(([i,o])=>{if(n)return;const c=kb(i,D1(i,o),`${e} ${r}`);c&&(n=c)}),n}function Wb(t,e){let r=null;return Tn(t)?t.forEach(n=>{r||Mb(n)||(r=Yt("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Yt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function zb(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Wb(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function qb(t,e){let r=null;return z1(t?.methods)?z1(t?.events)||(r=Yt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Yt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function q1(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=qb(n,`${e}, namespace`);i&&(r=i)}),r}function Vb(t,e,r){let n=null;if(t&&Ts(t)){const i=q1(t,e);i&&(n=i);const o=Hb(t,e,r);o&&(n=o)}else n=_e("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function ac(t,e){let r=null;if(t&&Ts(t)){const n=q1(t,e);n&&(r=n);const i=zb(t,e);i&&(r=i)}else r=_e("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function V1(t){return pr(t.protocol,!0)}function Kb(t,e){let r=!1;return e&&!t?r=!0:t&&Tn(t)&&t.length&&t.forEach(n=>{r=V1(n)}),r}function Gb(t){return typeof t=="number"}function Wr(t){return typeof t<"u"&&typeof t!==null}function Zb(t){return!(!t||typeof t!="object"||!t.code||!Hu(t.code,!1)||!t.message||!pr(t.message,!1))}function Yb(t){return!(Pr(t)||!pr(t.method,!1))}function Jb(t){return!(Pr(t)||Pr(t.result)&&Pr(t.error)||!Hu(t.id,!1)||!pr(t.jsonrpc,!1))}function Qb(t){return!(Pr(t)||!pr(t.name,!1))}function K1(t,e){return!(!oc(e)||!Db(t).includes(e))}function Xb(t,e,r){return pr(r,!1)?$b(t,e).includes(r):!1}function e6(t,e,r){return pr(r,!1)?Pb(t,e).includes(r):!1}function G1(t,e,r){let n=null;const i=t6(t),o=r6(e),c=Object.keys(i),l=Object.keys(o),h=Z1(Object.keys(t)),f=Z1(Object.keys(e)),v=h.filter(E=>!f.includes(E));return v.length&&(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
15
+ Required: ${v.toString()}
16
+ Received: ${Object.keys(e).toString()}`)),qi(c,l)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
17
+ Required: ${c.toString()}
18
+ Approved: ${l.toString()}`)),Object.keys(e).forEach(E=>{if(!E.includes(":")||n)return;const _=Ps(e[E].accounts);_.includes(E)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${E}
19
+ Required: ${E}
20
+ Approved: ${_.toString()}`))}),c.forEach(E=>{n||(qi(i[E].methods,o[E].methods)?qi(i[E].events,o[E].events)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${E}`)):n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${E}`))}),n}function t6(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function Z1(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function r6(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Ps(t[r].accounts);n?.forEach(i=>{e[i]={accounts:t[r].accounts.filter(o=>o.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function n6(t,e){return Hu(t,!1)&&t<=e.max&&t>=e.min}function Y1(){const t=No();return new Promise(e=>{switch(t){case Qr.browser:e(i6());break;case Qr.reactNative:e(s6());break;case Qr.node:e(o6());break;default:e(!0)}})}function i6(){return Ro()&&navigator?.onLine}async function s6(){if(To()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t?.isConnected}return!0}function o6(){return!0}function a6(t){switch(No()){case Qr.browser:c6(t);break;case Qr.reactNative:l6(t);break}}function c6(t){!To()&&Ro()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function l6(t){To()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(e=>t(e?.isConnected))}const Wu={};class cc{static get(e){return Wu[e]}static set(e,r){Wu[e]=r}static delete(e){delete Wu[e]}}var lc={};/*! *****************************************************************************
21
21
  Copyright (c) Microsoft Corporation.
22
22
 
23
23
  Permission to use, copy, modify, and/or distribute this software for any
@@ -30,7 +30,7 @@
30
30
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
31
31
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
32
32
  PERFORMANCE OF THIS SOFTWARE.
33
- ***************************************************************************** */var rc=function(r,e){return rc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])},rc(r,e)};function S1(r,e){rc(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var nc=function(){return nc=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},nc.apply(this,arguments)};function x1(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(r);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(r,i[o])&&(t[i[o]]=r[i[o]]);return t}function O1(r,e,t,i){var o=arguments.length,a=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,i);else for(var f=r.length-1;f>=0;f--)(u=r[f])&&(a=(o<3?u(a):o>3?u(e,t,a):u(e,t))||a);return o>3&&a&&Object.defineProperty(e,t,a),a}function I1(r,e){return function(t,i){e(t,i,r)}}function P1(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function C1(r,e,t,i){function o(a){return a instanceof t?a:new t(function(u){u(a)})}return new(t||(t=Promise))(function(a,u){function f(w){try{p(i.next(w))}catch(I){u(I)}}function v(w){try{p(i.throw(w))}catch(I){u(I)}}function p(w){w.done?a(w.value):o(w.value).then(f,v)}p((i=i.apply(r,e||[])).next())})}function A1(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,o,a,u;return u={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function f(p){return function(w){return v([p,w])}}function v(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,o&&(a=p[0]&2?o.return:p[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,p[1])).done)return a;switch(o=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,o=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]<a[3])){t.label=p[1];break}if(p[0]===6&&t.label<a[1]){t.label=a[1],a=p;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(p);break}a[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(r,t)}catch(w){p=[6,w],o=0}finally{i=a=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function T1(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function R1(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function ic(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Gl(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),o,a=[],u;try{for(;(e===void 0||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(f){u={error:f}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a}function N1(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Gl(arguments[e]));return r}function $1(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),o=0,e=0;e<t;e++)for(var a=arguments[e],u=0,f=a.length;u<f;u++,o++)i[o]=a[u];return i}function rs(r){return this instanceof rs?(this.v=r,this):new rs(r)}function F1(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),o,a=[];return o={},u("next"),u("throw"),u("return"),o[Symbol.asyncIterator]=function(){return this},o;function u(S){i[S]&&(o[S]=function(C){return new Promise(function(R,B){a.push([S,C,R,B])>1||f(S,C)})})}function f(S,C){try{v(i[S](C))}catch(R){I(a[0][3],R)}}function v(S){S.value instanceof rs?Promise.resolve(S.value.v).then(p,w):I(a[0][2],S)}function p(S){f("next",S)}function w(S){f("throw",S)}function I(S,C){S(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function L1(r){var e,t;return e={},i("next"),i("throw",function(o){throw o}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(o,a){e[o]=r[o]?function(u){return(t=!t)?{value:rs(r[o](u)),done:o==="return"}:a?a(u):u}:a}}function U1(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof ic=="function"?ic(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(a){t[a]=r[a]&&function(u){return new Promise(function(f,v){u=r[a](u),o(f,v,u.done,u.value)})}}function o(a,u,f,v){Promise.resolve(v).then(function(p){a({value:p,done:f})},u)}}function j1(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function M1(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function q1(r){return r&&r.__esModule?r:{default:r}}function H1(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function B1(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var z1=Object.freeze({__proto__:null,__extends:S1,get __assign(){return nc},__rest:x1,__decorate:O1,__param:I1,__metadata:P1,__awaiter:C1,__generator:A1,__createBinding:T1,__exportStar:R1,__values:ic,__read:Gl,__spread:N1,__spreadArrays:$1,__await:rs,__asyncGenerator:F1,__asyncDelegator:L1,__asyncValues:U1,__makeTemplateObject:j1,__importStar:M1,__importDefault:q1,__classPrivateFieldGet:H1,__classPrivateFieldSet:B1}),Wl=Bn(z1),ns={};Object.defineProperty(ns,"__esModule",{value:!0});function K1(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return JSON.parse(r)}catch{return r}}ns.safeJsonParse=K1;function V1(r){return typeof r=="string"?r:JSON.stringify(r,(e,t)=>typeof t>"u"?null:t)}ns.safeJsonStringify=V1;var is={exports:{}},Yl;function k1(){return Yl||(Yl=1,function(){let r;function e(){}r=e,r.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},r.prototype.setItem=function(t,i){this[t]=String(i)},r.prototype.removeItem=function(t){delete this[t]},r.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(i){t[i]=void 0,delete t[i]})},r.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},r.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Vt<"u"&&Vt.localStorage?is.exports=Vt.localStorage:typeof window<"u"&&window.localStorage?is.exports=window.localStorage:is.exports=new e}()),is.exports}var sc={},ss={},Jl;function G1(){if(Jl)return ss;Jl=1,Object.defineProperty(ss,"__esModule",{value:!0}),ss.IKeyValueStorage=void 0;class r{}return ss.IKeyValueStorage=r,ss}var os={},Ql;function W1(){if(Ql)return os;Ql=1,Object.defineProperty(os,"__esModule",{value:!0}),os.parseEntry=void 0;const r=ns;function e(t){var i;return[t[0],r.safeJsonParse((i=t[1])!==null&&i!==void 0?i:"")]}return os.parseEntry=e,os}var Xl;function Y1(){return Xl||(Xl=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Wl;e.__exportStar(G1(),r),e.__exportStar(W1(),r)}(sc)),sc}Object.defineProperty(no,"__esModule",{value:!0}),no.KeyValueStorage=void 0;const mi=Wl,Zl=ns,J1=mi.__importDefault(k1()),Q1=Y1();class ef{constructor(){this.localStorage=J1.default}getKeys(){return mi.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return mi.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(Q1.parseEntry)})}getItem(e){return mi.__awaiter(this,void 0,void 0,function*(){const t=this.localStorage.getItem(e);if(t!==null)return Zl.safeJsonParse(t)})}setItem(e,t){return mi.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,Zl.safeJsonStringify(t))})}removeItem(e){return mi.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}no.KeyValueStorage=ef;var X1=no.default=ef,wi={};/*! *****************************************************************************
33
+ ***************************************************************************** */var zu=function(t,e){return zu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},zu(t,e)};function u6(t,e){zu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var qu=function(){return qu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},qu.apply(this,arguments)};function h6(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function f6(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function d6(t,e){return function(r,n){e(r,n,t)}}function p6(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function g6(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function m6(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function w6(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function v6(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Vu(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function J1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function y6(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(J1(arguments[e]));return t}function b6(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Uo(t){return this instanceof Uo?(this.v=t,this):new Uo(t)}function _6(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Uo?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function E6(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:Uo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function x6(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Vu=="function"?Vu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(f){o({value:f,done:l})},c)}}function C6(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function I6(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function S6(t){return t&&t.__esModule?t:{default:t}}function O6(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function A6(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var D6=Object.freeze({__proto__:null,__extends:u6,get __assign(){return qu},__rest:h6,__decorate:f6,__param:d6,__metadata:p6,__awaiter:g6,__generator:m6,__createBinding:w6,__exportStar:v6,__values:Vu,__read:J1,__spread:y6,__spreadArrays:b6,__await:Uo,__asyncGenerator:_6,__asyncDelegator:E6,__asyncValues:x6,__makeTemplateObject:C6,__importStar:I6,__importDefault:S6,__classPrivateFieldGet:O6,__classPrivateFieldSet:A6}),Q1=Bi(D6),jo={};Object.defineProperty(jo,"__esModule",{value:!0});function $6(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}jo.safeJsonParse=$6;function P6(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}jo.safeJsonStringify=P6;var Fo={exports:{}},X1;function T6(){return X1||(X1=1,function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof dr<"u"&&dr.localStorage?Fo.exports=dr.localStorage:typeof window<"u"&&window.localStorage?Fo.exports=window.localStorage:Fo.exports=new e}()),Fo.exports}var Ku={},Bo={},ep;function R6(){if(ep)return Bo;ep=1,Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.IKeyValueStorage=void 0;class t{}return Bo.IKeyValueStorage=t,Bo}var ko={},tp;function N6(){if(tp)return ko;tp=1,Object.defineProperty(ko,"__esModule",{value:!0}),ko.parseEntry=void 0;const t=jo;function e(r){var n;return[r[0],t.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return ko.parseEntry=e,ko}var rp;function L6(){return rp||(rp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Q1;e.__exportStar(R6(),t),e.__exportStar(N6(),t)}(Ku)),Ku}Object.defineProperty(lc,"__esModule",{value:!0}),lc.KeyValueStorage=void 0;const Rs=Q1,np=jo,M6=Rs.__importDefault(T6()),U6=L6();class ip{constructor(){this.localStorage=M6.default}getKeys(){return Rs.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return Rs.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(U6.parseEntry)})}getItem(e){return Rs.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(e);if(r!==null)return np.safeJsonParse(r)})}setItem(e,r){return Rs.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,np.safeJsonStringify(r))})}removeItem(e){return Rs.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}lc.KeyValueStorage=ip;var j6=lc.default=ip,Ns={};/*! *****************************************************************************
34
34
  Copyright (c) Microsoft Corporation.
35
35
 
36
36
  Permission to use, copy, modify, and/or distribute this software for any
@@ -43,7 +43,7 @@
43
43
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
44
44
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45
45
  PERFORMANCE OF THIS SOFTWARE.
46
- ***************************************************************************** */var oc=function(r,e){return oc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])},oc(r,e)};function Z1(r,e){oc(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ac=function(){return ac=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},ac.apply(this,arguments)};function eb(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(r);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(r,i[o])&&(t[i[o]]=r[i[o]]);return t}function tb(r,e,t,i){var o=arguments.length,a=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,i);else for(var f=r.length-1;f>=0;f--)(u=r[f])&&(a=(o<3?u(a):o>3?u(e,t,a):u(e,t))||a);return o>3&&a&&Object.defineProperty(e,t,a),a}function rb(r,e){return function(t,i){e(t,i,r)}}function nb(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function ib(r,e,t,i){function o(a){return a instanceof t?a:new t(function(u){u(a)})}return new(t||(t=Promise))(function(a,u){function f(w){try{p(i.next(w))}catch(I){u(I)}}function v(w){try{p(i.throw(w))}catch(I){u(I)}}function p(w){w.done?a(w.value):o(w.value).then(f,v)}p((i=i.apply(r,e||[])).next())})}function sb(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,o,a,u;return u={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function f(p){return function(w){return v([p,w])}}function v(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,o&&(a=p[0]&2?o.return:p[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,p[1])).done)return a;switch(o=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,o=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]<a[3])){t.label=p[1];break}if(p[0]===6&&t.label<a[1]){t.label=a[1],a=p;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(p);break}a[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(r,t)}catch(w){p=[6,w],o=0}finally{i=a=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function ob(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function ab(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function cc(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function tf(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),o,a=[],u;try{for(;(e===void 0||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(f){u={error:f}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a}function cb(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(tf(arguments[e]));return r}function ub(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),o=0,e=0;e<t;e++)for(var a=arguments[e],u=0,f=a.length;u<f;u++,o++)i[o]=a[u];return i}function as(r){return this instanceof as?(this.v=r,this):new as(r)}function hb(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),o,a=[];return o={},u("next"),u("throw"),u("return"),o[Symbol.asyncIterator]=function(){return this},o;function u(S){i[S]&&(o[S]=function(C){return new Promise(function(R,B){a.push([S,C,R,B])>1||f(S,C)})})}function f(S,C){try{v(i[S](C))}catch(R){I(a[0][3],R)}}function v(S){S.value instanceof as?Promise.resolve(S.value.v).then(p,w):I(a[0][2],S)}function p(S){f("next",S)}function w(S){f("throw",S)}function I(S,C){S(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function lb(r){var e,t;return e={},i("next"),i("throw",function(o){throw o}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(o,a){e[o]=r[o]?function(u){return(t=!t)?{value:as(r[o](u)),done:o==="return"}:a?a(u):u}:a}}function fb(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof cc=="function"?cc(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(a){t[a]=r[a]&&function(u){return new Promise(function(f,v){u=r[a](u),o(f,v,u.done,u.value)})}}function o(a,u,f,v){Promise.resolve(v).then(function(p){a({value:p,done:f})},u)}}function db(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function pb(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function gb(r){return r&&r.__esModule?r:{default:r}}function vb(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function yb(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var _b=Object.freeze({__proto__:null,__extends:Z1,get __assign(){return ac},__rest:eb,__decorate:tb,__param:rb,__metadata:nb,__awaiter:ib,__generator:sb,__createBinding:ob,__exportStar:ab,__values:cc,__read:tf,__spread:cb,__spreadArrays:ub,__await:as,__asyncGenerator:hb,__asyncDelegator:lb,__asyncValues:fb,__makeTemplateObject:db,__importStar:pb,__importDefault:gb,__classPrivateFieldGet:vb,__classPrivateFieldSet:yb}),io=Bn(_b),cs={},uc={},us={};class Wn{}var bb=Object.freeze({__proto__:null,IEvents:Wn}),mb=Bn(bb),rf;function wb(){if(rf)return us;rf=1,Object.defineProperty(us,"__esModule",{value:!0}),us.IHeartBeat=void 0;const r=mb;class e extends r.IEvents{constructor(i){super()}}return us.IHeartBeat=e,us}var nf;function sf(){return nf||(nf=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),io.__exportStar(wb(),r)}(uc)),uc}var hc={},Yn={},of;function Eb(){if(of)return Yn;of=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.HEARTBEAT_EVENTS=Yn.HEARTBEAT_INTERVAL=void 0;const r=ye;return Yn.HEARTBEAT_INTERVAL=r.FIVE_SECONDS,Yn.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Yn}var af;function cf(){return af||(af=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),io.__exportStar(Eb(),r)}(hc)),hc}var uf;function Db(){if(uf)return cs;uf=1,Object.defineProperty(cs,"__esModule",{value:!0}),cs.HeartBeat=void 0;const r=io,e=Yt.exports,t=ye,i=sf(),o=cf();class a extends i.IHeartBeat{constructor(f){super(f),this.events=new e.EventEmitter,this.interval=o.HEARTBEAT_INTERVAL,this.interval=f?.interval||o.HEARTBEAT_INTERVAL}static init(f){return r.__awaiter(this,void 0,void 0,function*(){const v=new a(f);return yield v.init(),v})}init(){return r.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(f,v){this.events.on(f,v)}once(f,v){this.events.once(f,v)}off(f,v){this.events.off(f,v)}removeListener(f,v){this.events.removeListener(f,v)}initialize(){return r.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),t.toMiliseconds(this.interval))})}pulse(){this.events.emit(o.HEARTBEAT_EVENTS.pulse)}}return cs.HeartBeat=a,cs}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=io;e.__exportStar(Db(),r),e.__exportStar(sf(),r),e.__exportStar(cf(),r)})(wi);var Je={};/*! *****************************************************************************
46
+ ***************************************************************************** */var Gu=function(t,e){return Gu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Gu(t,e)};function F6(t,e){Gu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Zu=function(){return Zu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Zu.apply(this,arguments)};function B6(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function k6(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function H6(t,e){return function(r,n){e(r,n,t)}}function W6(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function z6(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function q6(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function V6(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function K6(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Yu(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function sp(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function G6(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(sp(arguments[e]));return t}function Z6(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Ho(t){return this instanceof Ho?(this.v=t,this):new Ho(t)}function Y6(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Ho?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function J6(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:Ho(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function Q6(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Yu=="function"?Yu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(f){o({value:f,done:l})},c)}}function X6(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function e4(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function t4(t){return t&&t.__esModule?t:{default:t}}function r4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function n4(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var i4=Object.freeze({__proto__:null,__extends:F6,get __assign(){return Zu},__rest:B6,__decorate:k6,__param:H6,__metadata:W6,__awaiter:z6,__generator:q6,__createBinding:V6,__exportStar:K6,__values:Yu,__read:sp,__spread:G6,__spreadArrays:Z6,__await:Ho,__asyncGenerator:Y6,__asyncDelegator:J6,__asyncValues:Q6,__makeTemplateObject:X6,__importStar:e4,__importDefault:t4,__classPrivateFieldGet:r4,__classPrivateFieldSet:n4}),uc=Bi(i4),Wo={},Ju={},zo={};class Vi{}var s4=Object.freeze({__proto__:null,IEvents:Vi}),o4=Bi(s4),op;function a4(){if(op)return zo;op=1,Object.defineProperty(zo,"__esModule",{value:!0}),zo.IHeartBeat=void 0;const t=o4;class e extends t.IEvents{constructor(n){super()}}return zo.IHeartBeat=e,zo}var ap;function cp(){return ap||(ap=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),uc.__exportStar(a4(),t)}(Ju)),Ju}var Qu={},Ki={},lp;function c4(){if(lp)return Ki;lp=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.HEARTBEAT_EVENTS=Ki.HEARTBEAT_INTERVAL=void 0;const t=Te;return Ki.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,Ki.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Ki}var up;function hp(){return up||(up=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),uc.__exportStar(c4(),t)}(Qu)),Qu}var fp;function l4(){if(fp)return Wo;fp=1,Object.defineProperty(Wo,"__esModule",{value:!0}),Wo.HeartBeat=void 0;const t=uc,e=yr.exports,r=Te,n=cp(),i=hp();class o extends n.IHeartBeat{constructor(l){super(l),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=l?.interval||i.HEARTBEAT_INTERVAL}static init(l){return t.__awaiter(this,void 0,void 0,function*(){const h=new o(l);return yield h.init(),h})}init(){return t.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(l,h){this.events.on(l,h)}once(l,h){this.events.once(l,h)}off(l,h){this.events.off(l,h)}removeListener(l,h){this.events.removeListener(l,h)}initialize(){return t.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),r.toMiliseconds(this.interval))})}pulse(){this.events.emit(i.HEARTBEAT_EVENTS.pulse)}}return Wo.HeartBeat=o,Wo}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=uc;e.__exportStar(l4(),t),e.__exportStar(cp(),t),e.__exportStar(hp(),t)})(Ns);var pt={};/*! *****************************************************************************
47
47
  Copyright (c) Microsoft Corporation.
48
48
 
49
49
  Permission to use, copy, modify, and/or distribute this software for any
@@ -56,7 +56,7 @@
56
56
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
57
57
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
58
58
  PERFORMANCE OF THIS SOFTWARE.
59
- ***************************************************************************** */var lc=function(r,e){return lc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])},lc(r,e)};function Sb(r,e){lc(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var fc=function(){return fc=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},fc.apply(this,arguments)};function xb(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(r);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(r,i[o])&&(t[i[o]]=r[i[o]]);return t}function Ob(r,e,t,i){var o=arguments.length,a=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,i);else for(var f=r.length-1;f>=0;f--)(u=r[f])&&(a=(o<3?u(a):o>3?u(e,t,a):u(e,t))||a);return o>3&&a&&Object.defineProperty(e,t,a),a}function Ib(r,e){return function(t,i){e(t,i,r)}}function Pb(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Cb(r,e,t,i){function o(a){return a instanceof t?a:new t(function(u){u(a)})}return new(t||(t=Promise))(function(a,u){function f(w){try{p(i.next(w))}catch(I){u(I)}}function v(w){try{p(i.throw(w))}catch(I){u(I)}}function p(w){w.done?a(w.value):o(w.value).then(f,v)}p((i=i.apply(r,e||[])).next())})}function Ab(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,o,a,u;return u={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function f(p){return function(w){return v([p,w])}}function v(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,o&&(a=p[0]&2?o.return:p[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,p[1])).done)return a;switch(o=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,o=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]<a[3])){t.label=p[1];break}if(p[0]===6&&t.label<a[1]){t.label=a[1],a=p;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(p);break}a[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(r,t)}catch(w){p=[6,w],o=0}finally{i=a=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function Tb(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function Rb(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function dc(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function hf(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),o,a=[],u;try{for(;(e===void 0||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(f){u={error:f}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a}function Nb(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(hf(arguments[e]));return r}function $b(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),o=0,e=0;e<t;e++)for(var a=arguments[e],u=0,f=a.length;u<f;u++,o++)i[o]=a[u];return i}function hs(r){return this instanceof hs?(this.v=r,this):new hs(r)}function Fb(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),o,a=[];return o={},u("next"),u("throw"),u("return"),o[Symbol.asyncIterator]=function(){return this},o;function u(S){i[S]&&(o[S]=function(C){return new Promise(function(R,B){a.push([S,C,R,B])>1||f(S,C)})})}function f(S,C){try{v(i[S](C))}catch(R){I(a[0][3],R)}}function v(S){S.value instanceof hs?Promise.resolve(S.value.v).then(p,w):I(a[0][2],S)}function p(S){f("next",S)}function w(S){f("throw",S)}function I(S,C){S(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function Lb(r){var e,t;return e={},i("next"),i("throw",function(o){throw o}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(o,a){e[o]=r[o]?function(u){return(t=!t)?{value:hs(r[o](u)),done:o==="return"}:a?a(u):u}:a}}function Ub(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof dc=="function"?dc(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(a){t[a]=r[a]&&function(u){return new Promise(function(f,v){u=r[a](u),o(f,v,u.done,u.value)})}}function o(a,u,f,v){Promise.resolve(v).then(function(p){a({value:p,done:f})},u)}}function jb(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function Mb(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function qb(r){return r&&r.__esModule?r:{default:r}}function Hb(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function Bb(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var zb=Object.freeze({__proto__:null,__extends:Sb,get __assign(){return fc},__rest:xb,__decorate:Ob,__param:Ib,__metadata:Pb,__awaiter:Cb,__generator:Ab,__createBinding:Tb,__exportStar:Rb,__values:dc,__read:hf,__spread:Nb,__spreadArrays:$b,__await:hs,__asyncGenerator:Fb,__asyncDelegator:Lb,__asyncValues:Ub,__makeTemplateObject:jb,__importStar:Mb,__importDefault:qb,__classPrivateFieldGet:Hb,__classPrivateFieldSet:Bb}),Kb=Bn(zb),pc,lf;function Vb(){if(lf)return pc;lf=1;function r(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}pc=e;function e(t,i,o){var a=o&&o.stringify||r,u=1;if(typeof t=="object"&&t!==null){var f=i.length+u;if(f===1)return t;var v=new Array(f);v[0]=a(t);for(var p=1;p<f;p++)v[p]=a(i[p]);return v.join(" ")}if(typeof t!="string")return t;var w=i.length;if(w===0)return t;for(var I="",S=1-u,C=-1,R=t&&t.length||0,B=0;B<R;){if(t.charCodeAt(B)===37&&B+1<R){switch(C=C>-1?C:0,t.charCodeAt(B+1)){case 100:case 102:if(S>=w||i[S]==null)break;C<B&&(I+=t.slice(C,B)),I+=Number(i[S]),C=B+2,B++;break;case 105:if(S>=w||i[S]==null)break;C<B&&(I+=t.slice(C,B)),I+=Math.floor(Number(i[S])),C=B+2,B++;break;case 79:case 111:case 106:if(S>=w||i[S]===void 0)break;C<B&&(I+=t.slice(C,B));var K=typeof i[S];if(K==="string"){I+="'"+i[S]+"'",C=B+2,B++;break}if(K==="function"){I+=i[S].name||"<anonymous>",C=B+2,B++;break}I+=a(i[S]),C=B+2,B++;break;case 115:if(S>=w)break;C<B&&(I+=t.slice(C,B)),I+=String(i[S]),C=B+2,B++;break;case 37:C<B&&(I+=t.slice(C,B)),I+="%",C=B+2,B++,S--;break}++S}++B}return C===-1?t:(C<R&&(I+=t.slice(C)),I)}return pc}var gc,ff;function kb(){if(ff)return gc;ff=1;const r=Vb();gc=o;const e=T().console||{},t={mapHttpRequest:R,mapHttpResponse:R,wrapRequestSerializer:B,wrapResponseSerializer:B,wrapErrorSerializer:B,req:R,res:R,err:S};function i(E,h){return Array.isArray(E)?E.filter(function(G){return G!=="!stdSerializers.err"}):E===!0?Object.keys(h):!1}function o(E){E=E||{},E.browser=E.browser||{};const h=E.browser.transmit;if(h&&typeof h.send!="function")throw Error("pino: transmit option must have a send function");const b=E.browser.write||e;E.browser.write&&(E.browser.asObject=!0);const G=E.serializers||{},Y=i(E.browser.serialize,G);let ie=E.browser.serialize;Array.isArray(E.browser.serialize)&&E.browser.serialize.indexOf("!stdSerializers.err")>-1&&(ie=!1);const ce=["error","fatal","warn","info","debug","trace"];typeof b=="function"&&(b.error=b.fatal=b.warn=b.info=b.debug=b.trace=b),E.enabled===!1&&(E.level="silent");const de=E.level||"info",m=Object.create(b);m.log||(m.log=K),Object.defineProperty(m,"levelVal",{get:ee}),Object.defineProperty(m,"level",{get:Q,set:V});const P={transmit:h,serialize:Y,asObject:E.browser.asObject,levels:ce,timestamp:C(E)};m.levels=o.levels,m.level=de,m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=K,m.serializers=G,m._serialize=Y,m._stdErrSerialize=ie,m.child=k,h&&(m._logEvent=I());function ee(){return this.level==="silent"?1/0:this.levels.values[this.level]}function Q(){return this._level}function V(J){if(J!=="silent"&&!this.levels.values[J])throw Error("unknown level "+J);this._level=J,a(P,m,"error","log"),a(P,m,"fatal","error"),a(P,m,"warn","error"),a(P,m,"info","log"),a(P,m,"debug","log"),a(P,m,"trace","log")}function k(J,re){if(!J)throw new Error("missing bindings for child Pino");re=re||{},Y&&J.serializers&&(re.serializers=J.serializers);const me=re.serializers;if(Y&&me){var oe=Object.assign({},G,me),we=E.browser.serialize===!0?Object.keys(oe):Y;delete J.serializers,v([J],we,oe,this._stdErrSerialize)}function le(_e){this._childLevel=(_e._childLevel|0)+1,this.error=p(_e,J,"error"),this.fatal=p(_e,J,"fatal"),this.warn=p(_e,J,"warn"),this.info=p(_e,J,"info"),this.debug=p(_e,J,"debug"),this.trace=p(_e,J,"trace"),oe&&(this.serializers=oe,this._serialize=we),h&&(this._logEvent=I([].concat(_e._logEvent.bindings,J)))}return le.prototype=this,new le(this)}return m}o.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},o.stdSerializers=t,o.stdTimeFunctions=Object.assign({},{nullTime:se,epochTime:$,unixTime:U,isoTime:x});function a(E,h,b,G){const Y=Object.getPrototypeOf(h);h[b]=h.levelVal>h.levels.values[b]?K:Y[b]?Y[b]:e[b]||e[G]||K,u(E,h,b)}function u(E,h,b){!E.transmit&&h[b]===K||(h[b]=function(G){return function(){const ie=E.timestamp(),ce=new Array(arguments.length),de=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var m=0;m<ce.length;m++)ce[m]=arguments[m];if(E.serialize&&!E.asObject&&v(ce,this._serialize,this.serializers,this._stdErrSerialize),E.asObject?G.call(de,f(this,b,ce,ie)):G.apply(de,ce),E.transmit){const P=E.transmit.level||h.level,ee=o.levels.values[P],Q=o.levels.values[b];if(Q<ee)return;w(this,{ts:ie,methodLevel:b,methodValue:Q,transmitLevel:P,transmitValue:o.levels.values[E.transmit.level||h.level],send:E.transmit.send,val:h.levelVal},ce)}}}(h[b]))}function f(E,h,b,G){E._serialize&&v(b,E._serialize,E.serializers,E._stdErrSerialize);const Y=b.slice();let ie=Y[0];const ce={};G&&(ce.time=G),ce.level=o.levels.values[h];let de=(E._childLevel|0)+1;if(de<1&&(de=1),ie!==null&&typeof ie=="object"){for(;de--&&typeof Y[0]=="object";)Object.assign(ce,Y.shift());ie=Y.length?r(Y.shift(),Y):void 0}else typeof ie=="string"&&(ie=r(Y.shift(),Y));return ie!==void 0&&(ce.msg=ie),ce}function v(E,h,b,G){for(const Y in E)if(G&&E[Y]instanceof Error)E[Y]=o.stdSerializers.err(E[Y]);else if(typeof E[Y]=="object"&&!Array.isArray(E[Y]))for(const ie in E[Y])h&&h.indexOf(ie)>-1&&ie in b&&(E[Y][ie]=b[ie](E[Y][ie]))}function p(E,h,b){return function(){const G=new Array(1+arguments.length);G[0]=h;for(var Y=1;Y<G.length;Y++)G[Y]=arguments[Y-1];return E[b].apply(this,G)}}function w(E,h,b){const G=h.send,Y=h.ts,ie=h.methodLevel,ce=h.methodValue,de=h.val,m=E._logEvent.bindings;v(b,E._serialize||Object.keys(E.serializers),E.serializers,E._stdErrSerialize===void 0?!0:E._stdErrSerialize),E._logEvent.ts=Y,E._logEvent.messages=b.filter(function(P){return m.indexOf(P)===-1}),E._logEvent.level.label=ie,E._logEvent.level.value=ce,G(ie,E._logEvent,de),E._logEvent=I(m)}function I(E){return{ts:0,messages:[],bindings:E||[],level:{label:"",value:0}}}function S(E){const h={type:E.constructor.name,msg:E.message,stack:E.stack};for(const b in E)h[b]===void 0&&(h[b]=E[b]);return h}function C(E){return typeof E.timestamp=="function"?E.timestamp:E.timestamp===!1?se:$}function R(){return{}}function B(E){return E}function K(){}function se(){return!1}function $(){return Date.now()}function U(){return Math.round(Date.now()/1e3)}function x(){return new Date(Date.now()).toISOString()}function T(){function E(h){return typeof h<"u"&&h}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return E(self)||E(window)||E(this)||{}}}return gc}var Jn={},df;function pf(){return df||(df=1,Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.PINO_CUSTOM_CONTEXT_KEY=Jn.PINO_LOGGER_DEFAULTS=void 0,Jn.PINO_LOGGER_DEFAULTS={level:"info"},Jn.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Jn}var or={},gf;function Gb(){if(gf)return or;gf=1,Object.defineProperty(or,"__esModule",{value:!0}),or.generateChildLogger=or.formatChildLoggerContext=or.getLoggerContext=or.setBrowserLoggerContext=or.getBrowserLoggerContext=or.getDefaultLoggerOptions=void 0;const r=pf();function e(f){return Object.assign(Object.assign({},f),{level:f?.level||r.PINO_LOGGER_DEFAULTS.level})}or.getDefaultLoggerOptions=e;function t(f,v=r.PINO_CUSTOM_CONTEXT_KEY){return f[v]||""}or.getBrowserLoggerContext=t;function i(f,v,p=r.PINO_CUSTOM_CONTEXT_KEY){return f[p]=v,f}or.setBrowserLoggerContext=i;function o(f,v=r.PINO_CUSTOM_CONTEXT_KEY){let p="";return typeof f.bindings>"u"?p=t(f,v):p=f.bindings().context||"",p}or.getLoggerContext=o;function a(f,v,p=r.PINO_CUSTOM_CONTEXT_KEY){const w=o(f,p);return w.trim()?`${w}/${v}`:v}or.formatChildLoggerContext=a;function u(f,v,p=r.PINO_CUSTOM_CONTEXT_KEY){const w=a(f,v,p),I=f.child({context:w});return i(I,w,p)}return or.generateChildLogger=u,or}(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.pino=void 0;const e=Kb,t=e.__importDefault(kb());Object.defineProperty(r,"pino",{enumerable:!0,get:function(){return t.default}}),e.__exportStar(pf(),r),e.__exportStar(Gb(),r)})(Je);class Wb extends Wn{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class Yb extends Wn{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class Jb{constructor(e,t){this.logger=e,this.core=t}}class Qb extends Wn{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Xb extends Wn{constructor(e){super()}}class Zb{constructor(e,t,i,o){this.core=e,this.logger=t,this.name=i}}class em extends Wn{constructor(e,t){super(),this.relayer=e,this.logger=t}}class tm extends Wn{constructor(e,t){super(),this.core=e,this.logger=t}}class rm{constructor(e,t){this.projectId=e,this.logger=t}}class nm{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class im{constructor(e){this.client=e}}const sm=r=>JSON.stringify(r,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),om=r=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,t=r.replace(e,'$1"$2n"$3');return JSON.parse(t,(i,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function vc(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return om(r)}catch{return r}}function ls(r){return typeof r=="string"?r:sm(r)||""}var yc={},vf={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Ne,t=Dr;r.DIGEST_LENGTH=64,r.BLOCK_SIZE=128;var i=function(){function f(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return f.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},f.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},f.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._tempHi),t.wipe(this._tempLo),this.reset()},f.prototype.update=function(v,p){if(p===void 0&&(p=v.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var w=0;if(this._bytesHashed+=p,this._bufferLength>0){for(;this._bufferLength<r.BLOCK_SIZE&&p>0;)this._buffer[this._bufferLength++]=v[w++],p--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(p>=this.blockSize&&(w=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,v,w,p),p%=this.blockSize);p>0;)this._buffer[this._bufferLength++]=v[w++],p--;return this},f.prototype.finish=function(v){if(!this._finished){var p=this._bytesHashed,w=this._bufferLength,I=p/536870912|0,S=p<<3,C=p%128<112?128:256;this._buffer[w]=128;for(var R=w+1;R<C-8;R++)this._buffer[R]=0;e.writeUint32BE(I,this._buffer,C-8),e.writeUint32BE(S,this._buffer,C-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,C),this._finished=!0}for(var R=0;R<this.digestLength/8;R++)e.writeUint32BE(this._stateHi[R],v,R*8),e.writeUint32BE(this._stateLo[R],v,R*8+4);return this},f.prototype.digest=function(){var v=new Uint8Array(this.digestLength);return this.finish(v),v},f.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(v){return this._stateHi.set(v.stateHi),this._stateLo.set(v.stateLo),this._bufferLength=v.bufferLength,v.buffer&&this._buffer.set(v.buffer),this._bytesHashed=v.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(v){t.wipe(v.stateHi),t.wipe(v.stateLo),v.buffer&&t.wipe(v.buffer),v.bufferLength=0,v.bytesHashed=0},f}();r.SHA512=i;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(f,v,p,w,I,S,C){for(var R=p[0],B=p[1],K=p[2],se=p[3],$=p[4],U=p[5],x=p[6],T=p[7],E=w[0],h=w[1],b=w[2],G=w[3],Y=w[4],ie=w[5],ce=w[6],de=w[7],m,P,ee,Q,V,k,J,re;C>=128;){for(var me=0;me<16;me++){var oe=8*me+S;f[me]=e.readUint32BE(I,oe),v[me]=e.readUint32BE(I,oe+4)}for(var me=0;me<80;me++){var we=R,le=B,_e=K,H=se,q=$,F=U,d=x,A=T,ae=E,fe=h,xe=b,Be=G,Ve=Y,Ue=ie,vt=ce,yt=de;if(m=T,P=de,V=P&65535,k=P>>>16,J=m&65535,re=m>>>16,m=($>>>14|Y<<32-14)^($>>>18|Y<<32-18)^(Y>>>41-32|$<<32-(41-32)),P=(Y>>>14|$<<32-14)^(Y>>>18|$<<32-18)^($>>>41-32|Y<<32-(41-32)),V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,m=$&U^~$&x,P=Y&ie^~Y&ce,V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,m=o[me*2],P=o[me*2+1],V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,m=f[me%16],P=v[me%16],V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,k+=V>>>16,J+=k>>>16,re+=J>>>16,ee=J&65535|re<<16,Q=V&65535|k<<16,m=ee,P=Q,V=P&65535,k=P>>>16,J=m&65535,re=m>>>16,m=(R>>>28|E<<32-28)^(E>>>34-32|R<<32-(34-32))^(E>>>39-32|R<<32-(39-32)),P=(E>>>28|R<<32-28)^(R>>>34-32|E<<32-(34-32))^(R>>>39-32|E<<32-(39-32)),V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,m=R&B^R&K^B&K,P=E&h^E&b^h&b,V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,k+=V>>>16,J+=k>>>16,re+=J>>>16,A=J&65535|re<<16,yt=V&65535|k<<16,m=H,P=Be,V=P&65535,k=P>>>16,J=m&65535,re=m>>>16,m=ee,P=Q,V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,k+=V>>>16,J+=k>>>16,re+=J>>>16,H=J&65535|re<<16,Be=V&65535|k<<16,B=we,K=le,se=_e,$=H,U=q,x=F,T=d,R=A,h=ae,b=fe,G=xe,Y=Be,ie=Ve,ce=Ue,de=vt,E=yt,me%16===15)for(var oe=0;oe<16;oe++)m=f[oe],P=v[oe],V=P&65535,k=P>>>16,J=m&65535,re=m>>>16,m=f[(oe+9)%16],P=v[(oe+9)%16],V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,ee=f[(oe+1)%16],Q=v[(oe+1)%16],m=(ee>>>1|Q<<32-1)^(ee>>>8|Q<<32-8)^ee>>>7,P=(Q>>>1|ee<<32-1)^(Q>>>8|ee<<32-8)^(Q>>>7|ee<<32-7),V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,ee=f[(oe+14)%16],Q=v[(oe+14)%16],m=(ee>>>19|Q<<32-19)^(Q>>>61-32|ee<<32-(61-32))^ee>>>6,P=(Q>>>19|ee<<32-19)^(ee>>>61-32|Q<<32-(61-32))^(Q>>>6|ee<<32-6),V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,k+=V>>>16,J+=k>>>16,re+=J>>>16,f[oe]=J&65535|re<<16,v[oe]=V&65535|k<<16}m=R,P=E,V=P&65535,k=P>>>16,J=m&65535,re=m>>>16,m=p[0],P=w[0],V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,k+=V>>>16,J+=k>>>16,re+=J>>>16,p[0]=R=J&65535|re<<16,w[0]=E=V&65535|k<<16,m=B,P=h,V=P&65535,k=P>>>16,J=m&65535,re=m>>>16,m=p[1],P=w[1],V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,k+=V>>>16,J+=k>>>16,re+=J>>>16,p[1]=B=J&65535|re<<16,w[1]=h=V&65535|k<<16,m=K,P=b,V=P&65535,k=P>>>16,J=m&65535,re=m>>>16,m=p[2],P=w[2],V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,k+=V>>>16,J+=k>>>16,re+=J>>>16,p[2]=K=J&65535|re<<16,w[2]=b=V&65535|k<<16,m=se,P=G,V=P&65535,k=P>>>16,J=m&65535,re=m>>>16,m=p[3],P=w[3],V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,k+=V>>>16,J+=k>>>16,re+=J>>>16,p[3]=se=J&65535|re<<16,w[3]=G=V&65535|k<<16,m=$,P=Y,V=P&65535,k=P>>>16,J=m&65535,re=m>>>16,m=p[4],P=w[4],V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,k+=V>>>16,J+=k>>>16,re+=J>>>16,p[4]=$=J&65535|re<<16,w[4]=Y=V&65535|k<<16,m=U,P=ie,V=P&65535,k=P>>>16,J=m&65535,re=m>>>16,m=p[5],P=w[5],V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,k+=V>>>16,J+=k>>>16,re+=J>>>16,p[5]=U=J&65535|re<<16,w[5]=ie=V&65535|k<<16,m=x,P=ce,V=P&65535,k=P>>>16,J=m&65535,re=m>>>16,m=p[6],P=w[6],V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,k+=V>>>16,J+=k>>>16,re+=J>>>16,p[6]=x=J&65535|re<<16,w[6]=ce=V&65535|k<<16,m=T,P=de,V=P&65535,k=P>>>16,J=m&65535,re=m>>>16,m=p[7],P=w[7],V+=P&65535,k+=P>>>16,J+=m&65535,re+=m>>>16,k+=V>>>16,J+=k>>>16,re+=J>>>16,p[7]=T=J&65535|re<<16,w[7]=de=V&65535|k<<16,S+=128,C-=128}return S}function u(f){var v=new i;v.update(f);var p=v.digest();return v.clean(),p}r.hash=u})(vf),function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.convertSecretKeyToX25519=r.convertPublicKeyToX25519=r.verify=r.sign=r.extractPublicKeyFromSecretKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.SEED_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=r.SIGNATURE_LENGTH=void 0;const e=di,t=vf,i=Dr;r.SIGNATURE_LENGTH=64,r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=64,r.SEED_LENGTH=32;function o(H){const q=new Float64Array(16);if(H)for(let F=0;F<H.length;F++)q[F]=H[F];return q}const a=new Uint8Array(32);a[0]=9;const u=o(),f=o([1]),v=o([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),p=o([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),w=o([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),I=o([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),S=o([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function C(H,q){for(let F=0;F<16;F++)H[F]=q[F]|0}function R(H){let q=1;for(let F=0;F<16;F++){let d=H[F]+q+65535;q=Math.floor(d/65536),H[F]=d-q*65536}H[0]+=q-1+37*(q-1)}function B(H,q,F){const d=~(F-1);for(let A=0;A<16;A++){const ae=d&(H[A]^q[A]);H[A]^=ae,q[A]^=ae}}function K(H,q){const F=o(),d=o();for(let A=0;A<16;A++)d[A]=q[A];R(d),R(d),R(d);for(let A=0;A<2;A++){F[0]=d[0]-65517;for(let fe=1;fe<15;fe++)F[fe]=d[fe]-65535-(F[fe-1]>>16&1),F[fe-1]&=65535;F[15]=d[15]-32767-(F[14]>>16&1);const ae=F[15]>>16&1;F[14]&=65535,B(d,F,1-ae)}for(let A=0;A<16;A++)H[2*A]=d[A]&255,H[2*A+1]=d[A]>>8}function se(H,q){let F=0;for(let d=0;d<32;d++)F|=H[d]^q[d];return(1&F-1>>>8)-1}function $(H,q){const F=new Uint8Array(32),d=new Uint8Array(32);return K(F,H),K(d,q),se(F,d)}function U(H){const q=new Uint8Array(32);return K(q,H),q[0]&1}function x(H,q){for(let F=0;F<16;F++)H[F]=q[2*F]+(q[2*F+1]<<8);H[15]&=32767}function T(H,q,F){for(let d=0;d<16;d++)H[d]=q[d]+F[d]}function E(H,q,F){for(let d=0;d<16;d++)H[d]=q[d]-F[d]}function h(H,q,F){let d,A,ae=0,fe=0,xe=0,Be=0,Ve=0,Ue=0,vt=0,yt=0,Me=0,Oe=0,$e=0,Fe=0,qe=0,Pe=0,Le=0,Se=0,Ce=0,ze=0,Ie=0,ke=0,We=0,et=0,tt=0,Qe=0,cr=0,yr=0,en=0,ur=0,pn=0,Tn=0,Xn=0,Dt=F[0],_t=F[1],St=F[2],xt=F[3],wt=F[4],bt=F[5],Lt=F[6],Ut=F[7],Ot=F[8],jt=F[9],It=F[10],Tt=F[11],Pt=F[12],ft=F[13],Mt=F[14],qt=F[15];d=q[0],ae+=d*Dt,fe+=d*_t,xe+=d*St,Be+=d*xt,Ve+=d*wt,Ue+=d*bt,vt+=d*Lt,yt+=d*Ut,Me+=d*Ot,Oe+=d*jt,$e+=d*It,Fe+=d*Tt,qe+=d*Pt,Pe+=d*ft,Le+=d*Mt,Se+=d*qt,d=q[1],fe+=d*Dt,xe+=d*_t,Be+=d*St,Ve+=d*xt,Ue+=d*wt,vt+=d*bt,yt+=d*Lt,Me+=d*Ut,Oe+=d*Ot,$e+=d*jt,Fe+=d*It,qe+=d*Tt,Pe+=d*Pt,Le+=d*ft,Se+=d*Mt,Ce+=d*qt,d=q[2],xe+=d*Dt,Be+=d*_t,Ve+=d*St,Ue+=d*xt,vt+=d*wt,yt+=d*bt,Me+=d*Lt,Oe+=d*Ut,$e+=d*Ot,Fe+=d*jt,qe+=d*It,Pe+=d*Tt,Le+=d*Pt,Se+=d*ft,Ce+=d*Mt,ze+=d*qt,d=q[3],Be+=d*Dt,Ve+=d*_t,Ue+=d*St,vt+=d*xt,yt+=d*wt,Me+=d*bt,Oe+=d*Lt,$e+=d*Ut,Fe+=d*Ot,qe+=d*jt,Pe+=d*It,Le+=d*Tt,Se+=d*Pt,Ce+=d*ft,ze+=d*Mt,Ie+=d*qt,d=q[4],Ve+=d*Dt,Ue+=d*_t,vt+=d*St,yt+=d*xt,Me+=d*wt,Oe+=d*bt,$e+=d*Lt,Fe+=d*Ut,qe+=d*Ot,Pe+=d*jt,Le+=d*It,Se+=d*Tt,Ce+=d*Pt,ze+=d*ft,Ie+=d*Mt,ke+=d*qt,d=q[5],Ue+=d*Dt,vt+=d*_t,yt+=d*St,Me+=d*xt,Oe+=d*wt,$e+=d*bt,Fe+=d*Lt,qe+=d*Ut,Pe+=d*Ot,Le+=d*jt,Se+=d*It,Ce+=d*Tt,ze+=d*Pt,Ie+=d*ft,ke+=d*Mt,We+=d*qt,d=q[6],vt+=d*Dt,yt+=d*_t,Me+=d*St,Oe+=d*xt,$e+=d*wt,Fe+=d*bt,qe+=d*Lt,Pe+=d*Ut,Le+=d*Ot,Se+=d*jt,Ce+=d*It,ze+=d*Tt,Ie+=d*Pt,ke+=d*ft,We+=d*Mt,et+=d*qt,d=q[7],yt+=d*Dt,Me+=d*_t,Oe+=d*St,$e+=d*xt,Fe+=d*wt,qe+=d*bt,Pe+=d*Lt,Le+=d*Ut,Se+=d*Ot,Ce+=d*jt,ze+=d*It,Ie+=d*Tt,ke+=d*Pt,We+=d*ft,et+=d*Mt,tt+=d*qt,d=q[8],Me+=d*Dt,Oe+=d*_t,$e+=d*St,Fe+=d*xt,qe+=d*wt,Pe+=d*bt,Le+=d*Lt,Se+=d*Ut,Ce+=d*Ot,ze+=d*jt,Ie+=d*It,ke+=d*Tt,We+=d*Pt,et+=d*ft,tt+=d*Mt,Qe+=d*qt,d=q[9],Oe+=d*Dt,$e+=d*_t,Fe+=d*St,qe+=d*xt,Pe+=d*wt,Le+=d*bt,Se+=d*Lt,Ce+=d*Ut,ze+=d*Ot,Ie+=d*jt,ke+=d*It,We+=d*Tt,et+=d*Pt,tt+=d*ft,Qe+=d*Mt,cr+=d*qt,d=q[10],$e+=d*Dt,Fe+=d*_t,qe+=d*St,Pe+=d*xt,Le+=d*wt,Se+=d*bt,Ce+=d*Lt,ze+=d*Ut,Ie+=d*Ot,ke+=d*jt,We+=d*It,et+=d*Tt,tt+=d*Pt,Qe+=d*ft,cr+=d*Mt,yr+=d*qt,d=q[11],Fe+=d*Dt,qe+=d*_t,Pe+=d*St,Le+=d*xt,Se+=d*wt,Ce+=d*bt,ze+=d*Lt,Ie+=d*Ut,ke+=d*Ot,We+=d*jt,et+=d*It,tt+=d*Tt,Qe+=d*Pt,cr+=d*ft,yr+=d*Mt,en+=d*qt,d=q[12],qe+=d*Dt,Pe+=d*_t,Le+=d*St,Se+=d*xt,Ce+=d*wt,ze+=d*bt,Ie+=d*Lt,ke+=d*Ut,We+=d*Ot,et+=d*jt,tt+=d*It,Qe+=d*Tt,cr+=d*Pt,yr+=d*ft,en+=d*Mt,ur+=d*qt,d=q[13],Pe+=d*Dt,Le+=d*_t,Se+=d*St,Ce+=d*xt,ze+=d*wt,Ie+=d*bt,ke+=d*Lt,We+=d*Ut,et+=d*Ot,tt+=d*jt,Qe+=d*It,cr+=d*Tt,yr+=d*Pt,en+=d*ft,ur+=d*Mt,pn+=d*qt,d=q[14],Le+=d*Dt,Se+=d*_t,Ce+=d*St,ze+=d*xt,Ie+=d*wt,ke+=d*bt,We+=d*Lt,et+=d*Ut,tt+=d*Ot,Qe+=d*jt,cr+=d*It,yr+=d*Tt,en+=d*Pt,ur+=d*ft,pn+=d*Mt,Tn+=d*qt,d=q[15],Se+=d*Dt,Ce+=d*_t,ze+=d*St,Ie+=d*xt,ke+=d*wt,We+=d*bt,et+=d*Lt,tt+=d*Ut,Qe+=d*Ot,cr+=d*jt,yr+=d*It,en+=d*Tt,ur+=d*Pt,pn+=d*ft,Tn+=d*Mt,Xn+=d*qt,ae+=38*Ce,fe+=38*ze,xe+=38*Ie,Be+=38*ke,Ve+=38*We,Ue+=38*et,vt+=38*tt,yt+=38*Qe,Me+=38*cr,Oe+=38*yr,$e+=38*en,Fe+=38*ur,qe+=38*pn,Pe+=38*Tn,Le+=38*Xn,A=1,d=ae+A+65535,A=Math.floor(d/65536),ae=d-A*65536,d=fe+A+65535,A=Math.floor(d/65536),fe=d-A*65536,d=xe+A+65535,A=Math.floor(d/65536),xe=d-A*65536,d=Be+A+65535,A=Math.floor(d/65536),Be=d-A*65536,d=Ve+A+65535,A=Math.floor(d/65536),Ve=d-A*65536,d=Ue+A+65535,A=Math.floor(d/65536),Ue=d-A*65536,d=vt+A+65535,A=Math.floor(d/65536),vt=d-A*65536,d=yt+A+65535,A=Math.floor(d/65536),yt=d-A*65536,d=Me+A+65535,A=Math.floor(d/65536),Me=d-A*65536,d=Oe+A+65535,A=Math.floor(d/65536),Oe=d-A*65536,d=$e+A+65535,A=Math.floor(d/65536),$e=d-A*65536,d=Fe+A+65535,A=Math.floor(d/65536),Fe=d-A*65536,d=qe+A+65535,A=Math.floor(d/65536),qe=d-A*65536,d=Pe+A+65535,A=Math.floor(d/65536),Pe=d-A*65536,d=Le+A+65535,A=Math.floor(d/65536),Le=d-A*65536,d=Se+A+65535,A=Math.floor(d/65536),Se=d-A*65536,ae+=A-1+37*(A-1),A=1,d=ae+A+65535,A=Math.floor(d/65536),ae=d-A*65536,d=fe+A+65535,A=Math.floor(d/65536),fe=d-A*65536,d=xe+A+65535,A=Math.floor(d/65536),xe=d-A*65536,d=Be+A+65535,A=Math.floor(d/65536),Be=d-A*65536,d=Ve+A+65535,A=Math.floor(d/65536),Ve=d-A*65536,d=Ue+A+65535,A=Math.floor(d/65536),Ue=d-A*65536,d=vt+A+65535,A=Math.floor(d/65536),vt=d-A*65536,d=yt+A+65535,A=Math.floor(d/65536),yt=d-A*65536,d=Me+A+65535,A=Math.floor(d/65536),Me=d-A*65536,d=Oe+A+65535,A=Math.floor(d/65536),Oe=d-A*65536,d=$e+A+65535,A=Math.floor(d/65536),$e=d-A*65536,d=Fe+A+65535,A=Math.floor(d/65536),Fe=d-A*65536,d=qe+A+65535,A=Math.floor(d/65536),qe=d-A*65536,d=Pe+A+65535,A=Math.floor(d/65536),Pe=d-A*65536,d=Le+A+65535,A=Math.floor(d/65536),Le=d-A*65536,d=Se+A+65535,A=Math.floor(d/65536),Se=d-A*65536,ae+=A-1+37*(A-1),H[0]=ae,H[1]=fe,H[2]=xe,H[3]=Be,H[4]=Ve,H[5]=Ue,H[6]=vt,H[7]=yt,H[8]=Me,H[9]=Oe,H[10]=$e,H[11]=Fe,H[12]=qe,H[13]=Pe,H[14]=Le,H[15]=Se}function b(H,q){h(H,q,q)}function G(H,q){const F=o();let d;for(d=0;d<16;d++)F[d]=q[d];for(d=253;d>=0;d--)b(F,F),d!==2&&d!==4&&h(F,F,q);for(d=0;d<16;d++)H[d]=F[d]}function Y(H,q){const F=o();let d;for(d=0;d<16;d++)F[d]=q[d];for(d=250;d>=0;d--)b(F,F),d!==1&&h(F,F,q);for(d=0;d<16;d++)H[d]=F[d]}function ie(H,q){const F=o(),d=o(),A=o(),ae=o(),fe=o(),xe=o(),Be=o(),Ve=o(),Ue=o();E(F,H[1],H[0]),E(Ue,q[1],q[0]),h(F,F,Ue),T(d,H[0],H[1]),T(Ue,q[0],q[1]),h(d,d,Ue),h(A,H[3],q[3]),h(A,A,p),h(ae,H[2],q[2]),T(ae,ae,ae),E(fe,d,F),E(xe,ae,A),T(Be,ae,A),T(Ve,d,F),h(H[0],fe,xe),h(H[1],Ve,Be),h(H[2],Be,xe),h(H[3],fe,Ve)}function ce(H,q,F){for(let d=0;d<4;d++)B(H[d],q[d],F)}function de(H,q){const F=o(),d=o(),A=o();G(A,q[2]),h(F,q[0],A),h(d,q[1],A),K(H,d),H[31]^=U(F)<<7}function m(H,q,F){C(H[0],u),C(H[1],f),C(H[2],f),C(H[3],u);for(let d=255;d>=0;--d){const A=F[d/8|0]>>(d&7)&1;ce(H,q,A),ie(q,H),ie(H,H),ce(H,q,A)}}function P(H,q){const F=[o(),o(),o(),o()];C(F[0],w),C(F[1],I),C(F[2],f),h(F[3],w,I),m(H,F,q)}function ee(H){if(H.length!==r.SEED_LENGTH)throw new Error(`ed25519: seed must be ${r.SEED_LENGTH} bytes`);const q=(0,t.hash)(H);q[0]&=248,q[31]&=127,q[31]|=64;const F=new Uint8Array(32),d=[o(),o(),o(),o()];P(d,q),de(F,d);const A=new Uint8Array(64);return A.set(H),A.set(F,32),{publicKey:F,secretKey:A}}r.generateKeyPairFromSeed=ee;function Q(H){const q=(0,e.randomBytes)(32,H),F=ee(q);return(0,i.wipe)(q),F}r.generateKeyPair=Q;function V(H){if(H.length!==r.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${r.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(H.subarray(32))}r.extractPublicKeyFromSecretKey=V;const k=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function J(H,q){let F,d,A,ae;for(d=63;d>=32;--d){for(F=0,A=d-32,ae=d-12;A<ae;++A)q[A]+=F-16*q[d]*k[A-(d-32)],F=Math.floor((q[A]+128)/256),q[A]-=F*256;q[A]+=F,q[d]=0}for(F=0,A=0;A<32;A++)q[A]+=F-(q[31]>>4)*k[A],F=q[A]>>8,q[A]&=255;for(A=0;A<32;A++)q[A]-=F*k[A];for(d=0;d<32;d++)q[d+1]+=q[d]>>8,H[d]=q[d]&255}function re(H){const q=new Float64Array(64);for(let F=0;F<64;F++)q[F]=H[F];for(let F=0;F<64;F++)H[F]=0;J(H,q)}function me(H,q){const F=new Float64Array(64),d=[o(),o(),o(),o()],A=(0,t.hash)(H.subarray(0,32));A[0]&=248,A[31]&=127,A[31]|=64;const ae=new Uint8Array(64);ae.set(A.subarray(32),32);const fe=new t.SHA512;fe.update(ae.subarray(32)),fe.update(q);const xe=fe.digest();fe.clean(),re(xe),P(d,xe),de(ae,d),fe.reset(),fe.update(ae.subarray(0,32)),fe.update(H.subarray(32)),fe.update(q);const Be=fe.digest();re(Be);for(let Ve=0;Ve<32;Ve++)F[Ve]=xe[Ve];for(let Ve=0;Ve<32;Ve++)for(let Ue=0;Ue<32;Ue++)F[Ve+Ue]+=Be[Ve]*A[Ue];return J(ae.subarray(32),F),ae}r.sign=me;function oe(H,q){const F=o(),d=o(),A=o(),ae=o(),fe=o(),xe=o(),Be=o();return C(H[2],f),x(H[1],q),b(A,H[1]),h(ae,A,v),E(A,A,H[2]),T(ae,H[2],ae),b(fe,ae),b(xe,fe),h(Be,xe,fe),h(F,Be,A),h(F,F,ae),Y(F,F),h(F,F,A),h(F,F,ae),h(F,F,ae),h(H[0],F,ae),b(d,H[0]),h(d,d,ae),$(d,A)&&h(H[0],H[0],S),b(d,H[0]),h(d,d,ae),$(d,A)?-1:(U(H[0])===q[31]>>7&&E(H[0],u,H[0]),h(H[3],H[0],H[1]),0)}function we(H,q,F){const d=new Uint8Array(32),A=[o(),o(),o(),o()],ae=[o(),o(),o(),o()];if(F.length!==r.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${r.SIGNATURE_LENGTH} bytes`);if(oe(ae,H))return!1;const fe=new t.SHA512;fe.update(F.subarray(0,32)),fe.update(H),fe.update(q);const xe=fe.digest();return re(xe),m(A,ae,xe),P(ae,F.subarray(32)),ie(A,ae),de(d,A),!se(F,d)}r.verify=we;function le(H){let q=[o(),o(),o(),o()];if(oe(q,H))throw new Error("Ed25519: invalid public key");let F=o(),d=o(),A=q[1];T(F,f,A),E(d,f,A),G(d,d),h(F,F,d);let ae=new Uint8Array(32);return K(ae,F),ae}r.convertPublicKeyToX25519=le;function _e(H){const q=(0,t.hash)(H.subarray(0,32));q[0]&=248,q[31]&=127,q[31]|=64;const F=new Uint8Array(q.subarray(0,32));return(0,i.wipe)(q),F}r.convertSecretKeyToX25519=_e}(yc);const am="EdDSA",cm="JWT",yf=".",_f="base64url",um="utf8",hm="utf8",lm=":",fm="did",dm="key",bf="base58btc",pm="z",gm="K36",vm=32;function so(r){return nr(pr(ls(r),um),_f)}function mf(r){const e=pr(gm,bf),t=pm+nr(Ta([e,r]),bf);return[fm,dm,t].join(lm)}function ym(r){return nr(r,_f)}function _m(r){return pr([so(r.header),so(r.payload)].join(yf),hm)}function bm(r){return[so(r.header),so(r.payload),ym(r.signature)].join(yf)}function wf(r=di.randomBytes(vm)){return yc.generateKeyPairFromSeed(r)}async function mm(r,e,t,i,o=ye.fromMiliseconds(Date.now())){const a={alg:am,typ:cm},u=mf(i.publicKey),f=o+t,v={iss:u,sub:r,aud:e,iat:o,exp:f},p=_m({header:a,payload:v}),w=yc.sign(i.secretKey,p);return bm({header:a,payload:v,signature:w})}const wm="PARSE_ERROR",Em="INVALID_REQUEST",Dm="METHOD_NOT_FOUND",Sm="INVALID_PARAMS",Ef="INTERNAL_ERROR",_c="SERVER_ERROR",xm=[-32700,-32600,-32601,-32602,-32603],fs={[wm]:{code:-32700,message:"Parse error"},[Em]:{code:-32600,message:"Invalid Request"},[Dm]:{code:-32601,message:"Method not found"},[Sm]:{code:-32602,message:"Invalid params"},[Ef]:{code:-32603,message:"Internal error"},[_c]:{code:-32e3,message:"Server error"}},Df=_c;function Om(r){return xm.includes(r)}function Sf(r){return Object.keys(fs).includes(r)?fs[r]:fs[Df]}function Im(r){const e=Object.values(fs).find(t=>t.code===r);return e||fs[Df]}function xf(r,e,t){return r.message.includes("getaddrinfo ENOTFOUND")||r.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${t} RPC url at ${e}`):r}var Of={};/*! *****************************************************************************
59
+ ***************************************************************************** */var Xu=function(t,e){return Xu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Xu(t,e)};function u4(t,e){Xu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var eh=function(){return eh=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},eh.apply(this,arguments)};function h4(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function f4(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function d4(t,e){return function(r,n){e(r,n,t)}}function p4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function g4(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function m4(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function w4(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function v4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function th(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function dp(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function y4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(dp(arguments[e]));return t}function b4(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function qo(t){return this instanceof qo?(this.v=t,this):new qo(t)}function _4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof qo?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function E4(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:qo(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function x4(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof th=="function"?th(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(f){o({value:f,done:l})},c)}}function C4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function I4(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function S4(t){return t&&t.__esModule?t:{default:t}}function O4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function A4(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var D4=Object.freeze({__proto__:null,__extends:u4,get __assign(){return eh},__rest:h4,__decorate:f4,__param:d4,__metadata:p4,__awaiter:g4,__generator:m4,__createBinding:w4,__exportStar:v4,__values:th,__read:dp,__spread:y4,__spreadArrays:b4,__await:qo,__asyncGenerator:_4,__asyncDelegator:E4,__asyncValues:x4,__makeTemplateObject:C4,__importStar:I4,__importDefault:S4,__classPrivateFieldGet:O4,__classPrivateFieldSet:A4}),$4=Bi(D4),rh,pp;function P4(){if(pp)return rh;pp=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}rh=e;function e(r,n,i){var o=i&&i.stringify||t,c=1;if(typeof r=="object"&&r!==null){var l=n.length+c;if(l===1)return r;var h=new Array(l);h[0]=o(r);for(var f=1;f<l;f++)h[f]=o(n[f]);return h.join(" ")}if(typeof r!="string")return r;var v=n.length;if(v===0)return r;for(var E="",_=1-c,S=-1,P=r&&r.length||0,j=0;j<P;){if(r.charCodeAt(j)===37&&j+1<P){switch(S=S>-1?S:0,r.charCodeAt(j+1)){case 100:case 102:if(_>=v||n[_]==null)break;S<j&&(E+=r.slice(S,j)),E+=Number(n[_]),S=j+2,j++;break;case 105:if(_>=v||n[_]==null)break;S<j&&(E+=r.slice(S,j)),E+=Math.floor(Number(n[_])),S=j+2,j++;break;case 79:case 111:case 106:if(_>=v||n[_]===void 0)break;S<j&&(E+=r.slice(S,j));var H=typeof n[_];if(H==="string"){E+="'"+n[_]+"'",S=j+2,j++;break}if(H==="function"){E+=n[_].name||"<anonymous>",S=j+2,j++;break}E+=o(n[_]),S=j+2,j++;break;case 115:if(_>=v)break;S<j&&(E+=r.slice(S,j)),E+=String(n[_]),S=j+2,j++;break;case 37:S<j&&(E+=r.slice(S,j)),E+="%",S=j+2,j++,_--;break}++_}++j}return S===-1?r:(S<P&&(E+=r.slice(S)),E)}return rh}var nh,gp;function T4(){if(gp)return nh;gp=1;const t=P4();nh=i;const e=T().console||{},r={mapHttpRequest:P,mapHttpResponse:P,wrapRequestSerializer:j,wrapResponseSerializer:j,wrapErrorSerializer:j,req:P,res:P,err:_};function n(I,d){return Array.isArray(I)?I.filter(function(J){return J!=="!stdSerializers.err"}):I===!0?Object.keys(d):!1}function i(I){I=I||{},I.browser=I.browser||{};const d=I.browser.transmit;if(d&&typeof d.send!="function")throw Error("pino: transmit option must have a send function");const x=I.browser.write||e;I.browser.write&&(I.browser.asObject=!0);const J=I.serializers||{},W=n(I.browser.serialize,J);let ee=I.browser.serialize;Array.isArray(I.browser.serialize)&&I.browser.serialize.indexOf("!stdSerializers.err")>-1&&(ee=!1);const de=["error","fatal","warn","info","debug","trace"];typeof x=="function"&&(x.error=x.fatal=x.warn=x.info=x.debug=x.trace=x),I.enabled===!1&&(I.level="silent");const me=I.level||"info",O=Object.create(x);O.log||(O.log=H),Object.defineProperty(O,"levelVal",{get:ce}),Object.defineProperty(O,"level",{get:le,set:re});const U={transmit:d,serialize:W,asObject:I.browser.asObject,levels:de,timestamp:S(I)};O.levels=i.levels,O.level=me,O.setMaxListeners=O.getMaxListeners=O.emit=O.addListener=O.on=O.prependListener=O.once=O.prependOnceListener=O.removeListener=O.removeAllListeners=O.listeners=O.listenerCount=O.eventNames=O.write=O.flush=H,O.serializers=J,O._serialize=W,O._stdErrSerialize=ee,O.child=ne,d&&(O._logEvent=E());function ce(){return this.level==="silent"?1/0:this.levels.values[this.level]}function le(){return this._level}function re(ae){if(ae!=="silent"&&!this.levels.values[ae])throw Error("unknown level "+ae);this._level=ae,o(U,O,"error","log"),o(U,O,"fatal","error"),o(U,O,"warn","error"),o(U,O,"info","log"),o(U,O,"debug","log"),o(U,O,"trace","log")}function ne(ae,ie){if(!ae)throw new Error("missing bindings for child Pino");ie=ie||{},W&&ae.serializers&&(ie.serializers=ae.serializers);const Ae=ie.serializers;if(W&&Ae){var ge=Object.assign({},J,Ae),Be=I.browser.serialize===!0?Object.keys(ge):W;delete ae.serializers,h([ae],Be,ge,this._stdErrSerialize)}function ye(Me){this._childLevel=(Me._childLevel|0)+1,this.error=f(Me,ae,"error"),this.fatal=f(Me,ae,"fatal"),this.warn=f(Me,ae,"warn"),this.info=f(Me,ae,"info"),this.debug=f(Me,ae,"debug"),this.trace=f(Me,ae,"trace"),ge&&(this.serializers=ge,this._serialize=Be),d&&(this._logEvent=E([].concat(Me._logEvent.bindings,ae)))}return ye.prototype=this,new ye(this)}return O}i.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},i.stdSerializers=r,i.stdTimeFunctions=Object.assign({},{nullTime:Z,epochTime:N,unixTime:L,isoTime:$});function o(I,d,x,J){const W=Object.getPrototypeOf(d);d[x]=d.levelVal>d.levels.values[x]?H:W[x]?W[x]:e[x]||e[J]||H,c(I,d,x)}function c(I,d,x){!I.transmit&&d[x]===H||(d[x]=function(J){return function(){const ee=I.timestamp(),de=new Array(arguments.length),me=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var O=0;O<de.length;O++)de[O]=arguments[O];if(I.serialize&&!I.asObject&&h(de,this._serialize,this.serializers,this._stdErrSerialize),I.asObject?J.call(me,l(this,x,de,ee)):J.apply(me,de),I.transmit){const U=I.transmit.level||d.level,ce=i.levels.values[U],le=i.levels.values[x];if(le<ce)return;v(this,{ts:ee,methodLevel:x,methodValue:le,transmitLevel:U,transmitValue:i.levels.values[I.transmit.level||d.level],send:I.transmit.send,val:d.levelVal},de)}}}(d[x]))}function l(I,d,x,J){I._serialize&&h(x,I._serialize,I.serializers,I._stdErrSerialize);const W=x.slice();let ee=W[0];const de={};J&&(de.time=J),de.level=i.levels.values[d];let me=(I._childLevel|0)+1;if(me<1&&(me=1),ee!==null&&typeof ee=="object"){for(;me--&&typeof W[0]=="object";)Object.assign(de,W.shift());ee=W.length?t(W.shift(),W):void 0}else typeof ee=="string"&&(ee=t(W.shift(),W));return ee!==void 0&&(de.msg=ee),de}function h(I,d,x,J){for(const W in I)if(J&&I[W]instanceof Error)I[W]=i.stdSerializers.err(I[W]);else if(typeof I[W]=="object"&&!Array.isArray(I[W]))for(const ee in I[W])d&&d.indexOf(ee)>-1&&ee in x&&(I[W][ee]=x[ee](I[W][ee]))}function f(I,d,x){return function(){const J=new Array(1+arguments.length);J[0]=d;for(var W=1;W<J.length;W++)J[W]=arguments[W-1];return I[x].apply(this,J)}}function v(I,d,x){const J=d.send,W=d.ts,ee=d.methodLevel,de=d.methodValue,me=d.val,O=I._logEvent.bindings;h(x,I._serialize||Object.keys(I.serializers),I.serializers,I._stdErrSerialize===void 0?!0:I._stdErrSerialize),I._logEvent.ts=W,I._logEvent.messages=x.filter(function(U){return O.indexOf(U)===-1}),I._logEvent.level.label=ee,I._logEvent.level.value=de,J(ee,I._logEvent,me),I._logEvent=E(O)}function E(I){return{ts:0,messages:[],bindings:I||[],level:{label:"",value:0}}}function _(I){const d={type:I.constructor.name,msg:I.message,stack:I.stack};for(const x in I)d[x]===void 0&&(d[x]=I[x]);return d}function S(I){return typeof I.timestamp=="function"?I.timestamp:I.timestamp===!1?Z:N}function P(){return{}}function j(I){return I}function H(){}function Z(){return!1}function N(){return Date.now()}function L(){return Math.round(Date.now()/1e3)}function $(){return new Date(Date.now()).toISOString()}function T(){function I(d){return typeof d<"u"&&d}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return I(self)||I(window)||I(this)||{}}}return nh}var Gi={},mp;function wp(){return mp||(mp=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.PINO_CUSTOM_CONTEXT_KEY=Gi.PINO_LOGGER_DEFAULTS=void 0,Gi.PINO_LOGGER_DEFAULTS={level:"info"},Gi.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Gi}var Tr={},vp;function R4(){if(vp)return Tr;vp=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.generateChildLogger=Tr.formatChildLoggerContext=Tr.getLoggerContext=Tr.setBrowserLoggerContext=Tr.getBrowserLoggerContext=Tr.getDefaultLoggerOptions=void 0;const t=wp();function e(l){return Object.assign(Object.assign({},l),{level:l?.level||t.PINO_LOGGER_DEFAULTS.level})}Tr.getDefaultLoggerOptions=e;function r(l,h=t.PINO_CUSTOM_CONTEXT_KEY){return l[h]||""}Tr.getBrowserLoggerContext=r;function n(l,h,f=t.PINO_CUSTOM_CONTEXT_KEY){return l[f]=h,l}Tr.setBrowserLoggerContext=n;function i(l,h=t.PINO_CUSTOM_CONTEXT_KEY){let f="";return typeof l.bindings>"u"?f=r(l,h):f=l.bindings().context||"",f}Tr.getLoggerContext=i;function o(l,h,f=t.PINO_CUSTOM_CONTEXT_KEY){const v=i(l,f);return v.trim()?`${v}/${h}`:h}Tr.formatChildLoggerContext=o;function c(l,h,f=t.PINO_CUSTOM_CONTEXT_KEY){const v=o(l,h,f),E=l.child({context:v});return n(E,v,f)}return Tr.generateChildLogger=c,Tr}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=$4,r=e.__importDefault(T4());Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(wp(),t),e.__exportStar(R4(),t)})(pt);class N4 extends Vi{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class L4 extends Vi{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class M4{constructor(e,r){this.logger=e,this.core=r}}class U4 extends Vi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class j4 extends Vi{constructor(e){super()}}class F4{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class B4 extends Vi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class k4 extends Vi{constructor(e,r){super(),this.core=e,this.logger=r}}class H4{constructor(e,r){this.projectId=e,this.logger=r}}class W4{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class z4{constructor(e){this.client=e}}const q4=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),V4=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function ih(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return V4(t)}catch{return t}}function Vo(t){return typeof t=="string"?t:q4(t)||""}var sh={},yp={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Jr;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function l(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return l.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},l.prototype.update=function(h,f){if(f===void 0&&(f=h.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var v=0;if(this._bytesHashed+=f,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&f>0;)this._buffer[this._bufferLength++]=h[v++],f--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(f>=this.blockSize&&(v=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,h,v,f),f%=this.blockSize);f>0;)this._buffer[this._bufferLength++]=h[v++],f--;return this},l.prototype.finish=function(h){if(!this._finished){var f=this._bytesHashed,v=this._bufferLength,E=f/536870912|0,_=f<<3,S=f%128<112?128:256;this._buffer[v]=128;for(var P=v+1;P<S-8;P++)this._buffer[P]=0;e.writeUint32BE(E,this._buffer,S-8),e.writeUint32BE(_,this._buffer,S-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,S),this._finished=!0}for(var P=0;P<this.digestLength/8;P++)e.writeUint32BE(this._stateHi[P],h,P*8),e.writeUint32BE(this._stateLo[P],h,P*8+4);return this},l.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},l.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},l.prototype.restoreState=function(h){return this._stateHi.set(h.stateHi),this._stateLo.set(h.stateLo),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(h){r.wipe(h.stateHi),r.wipe(h.stateLo),h.buffer&&r.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},l}();t.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function o(l,h,f,v,E,_,S){for(var P=f[0],j=f[1],H=f[2],Z=f[3],N=f[4],L=f[5],$=f[6],T=f[7],I=v[0],d=v[1],x=v[2],J=v[3],W=v[4],ee=v[5],de=v[6],me=v[7],O,U,ce,le,re,ne,ae,ie;S>=128;){for(var Ae=0;Ae<16;Ae++){var ge=8*Ae+_;l[Ae]=e.readUint32BE(E,ge),h[Ae]=e.readUint32BE(E,ge+4)}for(var Ae=0;Ae<80;Ae++){var Be=P,ye=j,Me=H,Q=Z,Y=N,z=L,w=$,F=T,we=I,ve=d,Ue=x,nt=J,at=W,Ge=ee,Dt=de,$t=me;if(O=T,U=me,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=(N>>>14|W<<32-14)^(N>>>18|W<<32-18)^(W>>>41-32|N<<32-(41-32)),U=(W>>>14|N<<32-14)^(W>>>18|N<<32-18)^(N>>>41-32|W<<32-(41-32)),re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=N&L^~N&$,U=W&ee^~W&de,re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=i[Ae*2],U=i[Ae*2+1],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=l[Ae%16],U=h[Ae%16],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,ce=ae&65535|ie<<16,le=re&65535|ne<<16,O=ce,U=le,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=(P>>>28|I<<32-28)^(I>>>34-32|P<<32-(34-32))^(I>>>39-32|P<<32-(39-32)),U=(I>>>28|P<<32-28)^(P>>>34-32|I<<32-(34-32))^(P>>>39-32|I<<32-(39-32)),re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,O=P&j^P&H^j&H,U=I&d^I&x^d&x,re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,F=ae&65535|ie<<16,$t=re&65535|ne<<16,O=Q,U=nt,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=ce,U=le,re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,Q=ae&65535|ie<<16,nt=re&65535|ne<<16,j=Be,H=ye,Z=Me,N=Q,L=Y,$=z,T=w,P=F,d=we,x=ve,J=Ue,W=nt,ee=at,de=Ge,me=Dt,I=$t,Ae%16===15)for(var ge=0;ge<16;ge++)O=l[ge],U=h[ge],re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=l[(ge+9)%16],U=h[(ge+9)%16],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ce=l[(ge+1)%16],le=h[(ge+1)%16],O=(ce>>>1|le<<32-1)^(ce>>>8|le<<32-8)^ce>>>7,U=(le>>>1|ce<<32-1)^(le>>>8|ce<<32-8)^(le>>>7|ce<<32-7),re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ce=l[(ge+14)%16],le=h[(ge+14)%16],O=(ce>>>19|le<<32-19)^(le>>>61-32|ce<<32-(61-32))^ce>>>6,U=(le>>>19|ce<<32-19)^(ce>>>61-32|le<<32-(61-32))^(le>>>6|ce<<32-6),re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,l[ge]=ae&65535|ie<<16,h[ge]=re&65535|ne<<16}O=P,U=I,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[0],U=v[0],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[0]=P=ae&65535|ie<<16,v[0]=I=re&65535|ne<<16,O=j,U=d,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[1],U=v[1],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[1]=j=ae&65535|ie<<16,v[1]=d=re&65535|ne<<16,O=H,U=x,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[2],U=v[2],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[2]=H=ae&65535|ie<<16,v[2]=x=re&65535|ne<<16,O=Z,U=J,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[3],U=v[3],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[3]=Z=ae&65535|ie<<16,v[3]=J=re&65535|ne<<16,O=N,U=W,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[4],U=v[4],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[4]=N=ae&65535|ie<<16,v[4]=W=re&65535|ne<<16,O=L,U=ee,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[5],U=v[5],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[5]=L=ae&65535|ie<<16,v[5]=ee=re&65535|ne<<16,O=$,U=de,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[6],U=v[6],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[6]=$=ae&65535|ie<<16,v[6]=de=re&65535|ne<<16,O=T,U=me,re=U&65535,ne=U>>>16,ae=O&65535,ie=O>>>16,O=f[7],U=v[7],re+=U&65535,ne+=U>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,f[7]=T=ae&65535|ie<<16,v[7]=me=re&65535|ne<<16,_+=128,S-=128}return _}function c(l){var h=new n;h.update(l);var f=h.digest();return h.clean(),f}t.hash=c})(yp),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=Ss,r=yp,n=Jr;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(Q){const Y=new Float64Array(16);if(Q)for(let z=0;z<Q.length;z++)Y[z]=Q[z];return Y}const o=new Uint8Array(32);o[0]=9;const c=i(),l=i([1]),h=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),f=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),E=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),_=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function S(Q,Y){for(let z=0;z<16;z++)Q[z]=Y[z]|0}function P(Q){let Y=1;for(let z=0;z<16;z++){let w=Q[z]+Y+65535;Y=Math.floor(w/65536),Q[z]=w-Y*65536}Q[0]+=Y-1+37*(Y-1)}function j(Q,Y,z){const w=~(z-1);for(let F=0;F<16;F++){const we=w&(Q[F]^Y[F]);Q[F]^=we,Y[F]^=we}}function H(Q,Y){const z=i(),w=i();for(let F=0;F<16;F++)w[F]=Y[F];P(w),P(w),P(w);for(let F=0;F<2;F++){z[0]=w[0]-65517;for(let ve=1;ve<15;ve++)z[ve]=w[ve]-65535-(z[ve-1]>>16&1),z[ve-1]&=65535;z[15]=w[15]-32767-(z[14]>>16&1);const we=z[15]>>16&1;z[14]&=65535,j(w,z,1-we)}for(let F=0;F<16;F++)Q[2*F]=w[F]&255,Q[2*F+1]=w[F]>>8}function Z(Q,Y){let z=0;for(let w=0;w<32;w++)z|=Q[w]^Y[w];return(1&z-1>>>8)-1}function N(Q,Y){const z=new Uint8Array(32),w=new Uint8Array(32);return H(z,Q),H(w,Y),Z(z,w)}function L(Q){const Y=new Uint8Array(32);return H(Y,Q),Y[0]&1}function $(Q,Y){for(let z=0;z<16;z++)Q[z]=Y[2*z]+(Y[2*z+1]<<8);Q[15]&=32767}function T(Q,Y,z){for(let w=0;w<16;w++)Q[w]=Y[w]+z[w]}function I(Q,Y,z){for(let w=0;w<16;w++)Q[w]=Y[w]-z[w]}function d(Q,Y,z){let w,F,we=0,ve=0,Ue=0,nt=0,at=0,Ge=0,Dt=0,$t=0,Je=0,He=0,ke=0,Ke=0,rt=0,je=0,Ze=0,b=0,p=0,m=0,D=0,B=0,K=0,X=0,Ee=0,Re=0,st=0,ht=0,lt=0,Ur=0,ti=0,Di=0,hs=0,Wt=z[0],Mt=z[1],zt=z[2],qt=z[3],Bt=z[4],Ut=z[5],nr=z[6],ir=z[7],Vt=z[8],sr=z[9],Kt=z[10],Jt=z[11],Gt=z[12],Pt=z[13],or=z[14],ar=z[15];w=Y[0],we+=w*Wt,ve+=w*Mt,Ue+=w*zt,nt+=w*qt,at+=w*Bt,Ge+=w*Ut,Dt+=w*nr,$t+=w*ir,Je+=w*Vt,He+=w*sr,ke+=w*Kt,Ke+=w*Jt,rt+=w*Gt,je+=w*Pt,Ze+=w*or,b+=w*ar,w=Y[1],ve+=w*Wt,Ue+=w*Mt,nt+=w*zt,at+=w*qt,Ge+=w*Bt,Dt+=w*Ut,$t+=w*nr,Je+=w*ir,He+=w*Vt,ke+=w*sr,Ke+=w*Kt,rt+=w*Jt,je+=w*Gt,Ze+=w*Pt,b+=w*or,p+=w*ar,w=Y[2],Ue+=w*Wt,nt+=w*Mt,at+=w*zt,Ge+=w*qt,Dt+=w*Bt,$t+=w*Ut,Je+=w*nr,He+=w*ir,ke+=w*Vt,Ke+=w*sr,rt+=w*Kt,je+=w*Jt,Ze+=w*Gt,b+=w*Pt,p+=w*or,m+=w*ar,w=Y[3],nt+=w*Wt,at+=w*Mt,Ge+=w*zt,Dt+=w*qt,$t+=w*Bt,Je+=w*Ut,He+=w*nr,ke+=w*ir,Ke+=w*Vt,rt+=w*sr,je+=w*Kt,Ze+=w*Jt,b+=w*Gt,p+=w*Pt,m+=w*or,D+=w*ar,w=Y[4],at+=w*Wt,Ge+=w*Mt,Dt+=w*zt,$t+=w*qt,Je+=w*Bt,He+=w*Ut,ke+=w*nr,Ke+=w*ir,rt+=w*Vt,je+=w*sr,Ze+=w*Kt,b+=w*Jt,p+=w*Gt,m+=w*Pt,D+=w*or,B+=w*ar,w=Y[5],Ge+=w*Wt,Dt+=w*Mt,$t+=w*zt,Je+=w*qt,He+=w*Bt,ke+=w*Ut,Ke+=w*nr,rt+=w*ir,je+=w*Vt,Ze+=w*sr,b+=w*Kt,p+=w*Jt,m+=w*Gt,D+=w*Pt,B+=w*or,K+=w*ar,w=Y[6],Dt+=w*Wt,$t+=w*Mt,Je+=w*zt,He+=w*qt,ke+=w*Bt,Ke+=w*Ut,rt+=w*nr,je+=w*ir,Ze+=w*Vt,b+=w*sr,p+=w*Kt,m+=w*Jt,D+=w*Gt,B+=w*Pt,K+=w*or,X+=w*ar,w=Y[7],$t+=w*Wt,Je+=w*Mt,He+=w*zt,ke+=w*qt,Ke+=w*Bt,rt+=w*Ut,je+=w*nr,Ze+=w*ir,b+=w*Vt,p+=w*sr,m+=w*Kt,D+=w*Jt,B+=w*Gt,K+=w*Pt,X+=w*or,Ee+=w*ar,w=Y[8],Je+=w*Wt,He+=w*Mt,ke+=w*zt,Ke+=w*qt,rt+=w*Bt,je+=w*Ut,Ze+=w*nr,b+=w*ir,p+=w*Vt,m+=w*sr,D+=w*Kt,B+=w*Jt,K+=w*Gt,X+=w*Pt,Ee+=w*or,Re+=w*ar,w=Y[9],He+=w*Wt,ke+=w*Mt,Ke+=w*zt,rt+=w*qt,je+=w*Bt,Ze+=w*Ut,b+=w*nr,p+=w*ir,m+=w*Vt,D+=w*sr,B+=w*Kt,K+=w*Jt,X+=w*Gt,Ee+=w*Pt,Re+=w*or,st+=w*ar,w=Y[10],ke+=w*Wt,Ke+=w*Mt,rt+=w*zt,je+=w*qt,Ze+=w*Bt,b+=w*Ut,p+=w*nr,m+=w*ir,D+=w*Vt,B+=w*sr,K+=w*Kt,X+=w*Jt,Ee+=w*Gt,Re+=w*Pt,st+=w*or,ht+=w*ar,w=Y[11],Ke+=w*Wt,rt+=w*Mt,je+=w*zt,Ze+=w*qt,b+=w*Bt,p+=w*Ut,m+=w*nr,D+=w*ir,B+=w*Vt,K+=w*sr,X+=w*Kt,Ee+=w*Jt,Re+=w*Gt,st+=w*Pt,ht+=w*or,lt+=w*ar,w=Y[12],rt+=w*Wt,je+=w*Mt,Ze+=w*zt,b+=w*qt,p+=w*Bt,m+=w*Ut,D+=w*nr,B+=w*ir,K+=w*Vt,X+=w*sr,Ee+=w*Kt,Re+=w*Jt,st+=w*Gt,ht+=w*Pt,lt+=w*or,Ur+=w*ar,w=Y[13],je+=w*Wt,Ze+=w*Mt,b+=w*zt,p+=w*qt,m+=w*Bt,D+=w*Ut,B+=w*nr,K+=w*ir,X+=w*Vt,Ee+=w*sr,Re+=w*Kt,st+=w*Jt,ht+=w*Gt,lt+=w*Pt,Ur+=w*or,ti+=w*ar,w=Y[14],Ze+=w*Wt,b+=w*Mt,p+=w*zt,m+=w*qt,D+=w*Bt,B+=w*Ut,K+=w*nr,X+=w*ir,Ee+=w*Vt,Re+=w*sr,st+=w*Kt,ht+=w*Jt,lt+=w*Gt,Ur+=w*Pt,ti+=w*or,Di+=w*ar,w=Y[15],b+=w*Wt,p+=w*Mt,m+=w*zt,D+=w*qt,B+=w*Bt,K+=w*Ut,X+=w*nr,Ee+=w*ir,Re+=w*Vt,st+=w*sr,ht+=w*Kt,lt+=w*Jt,Ur+=w*Gt,ti+=w*Pt,Di+=w*or,hs+=w*ar,we+=38*p,ve+=38*m,Ue+=38*D,nt+=38*B,at+=38*K,Ge+=38*X,Dt+=38*Ee,$t+=38*Re,Je+=38*st,He+=38*ht,ke+=38*lt,Ke+=38*Ur,rt+=38*ti,je+=38*Di,Ze+=38*hs,F=1,w=we+F+65535,F=Math.floor(w/65536),we=w-F*65536,w=ve+F+65535,F=Math.floor(w/65536),ve=w-F*65536,w=Ue+F+65535,F=Math.floor(w/65536),Ue=w-F*65536,w=nt+F+65535,F=Math.floor(w/65536),nt=w-F*65536,w=at+F+65535,F=Math.floor(w/65536),at=w-F*65536,w=Ge+F+65535,F=Math.floor(w/65536),Ge=w-F*65536,w=Dt+F+65535,F=Math.floor(w/65536),Dt=w-F*65536,w=$t+F+65535,F=Math.floor(w/65536),$t=w-F*65536,w=Je+F+65535,F=Math.floor(w/65536),Je=w-F*65536,w=He+F+65535,F=Math.floor(w/65536),He=w-F*65536,w=ke+F+65535,F=Math.floor(w/65536),ke=w-F*65536,w=Ke+F+65535,F=Math.floor(w/65536),Ke=w-F*65536,w=rt+F+65535,F=Math.floor(w/65536),rt=w-F*65536,w=je+F+65535,F=Math.floor(w/65536),je=w-F*65536,w=Ze+F+65535,F=Math.floor(w/65536),Ze=w-F*65536,w=b+F+65535,F=Math.floor(w/65536),b=w-F*65536,we+=F-1+37*(F-1),F=1,w=we+F+65535,F=Math.floor(w/65536),we=w-F*65536,w=ve+F+65535,F=Math.floor(w/65536),ve=w-F*65536,w=Ue+F+65535,F=Math.floor(w/65536),Ue=w-F*65536,w=nt+F+65535,F=Math.floor(w/65536),nt=w-F*65536,w=at+F+65535,F=Math.floor(w/65536),at=w-F*65536,w=Ge+F+65535,F=Math.floor(w/65536),Ge=w-F*65536,w=Dt+F+65535,F=Math.floor(w/65536),Dt=w-F*65536,w=$t+F+65535,F=Math.floor(w/65536),$t=w-F*65536,w=Je+F+65535,F=Math.floor(w/65536),Je=w-F*65536,w=He+F+65535,F=Math.floor(w/65536),He=w-F*65536,w=ke+F+65535,F=Math.floor(w/65536),ke=w-F*65536,w=Ke+F+65535,F=Math.floor(w/65536),Ke=w-F*65536,w=rt+F+65535,F=Math.floor(w/65536),rt=w-F*65536,w=je+F+65535,F=Math.floor(w/65536),je=w-F*65536,w=Ze+F+65535,F=Math.floor(w/65536),Ze=w-F*65536,w=b+F+65535,F=Math.floor(w/65536),b=w-F*65536,we+=F-1+37*(F-1),Q[0]=we,Q[1]=ve,Q[2]=Ue,Q[3]=nt,Q[4]=at,Q[5]=Ge,Q[6]=Dt,Q[7]=$t,Q[8]=Je,Q[9]=He,Q[10]=ke,Q[11]=Ke,Q[12]=rt,Q[13]=je,Q[14]=Ze,Q[15]=b}function x(Q,Y){d(Q,Y,Y)}function J(Q,Y){const z=i();let w;for(w=0;w<16;w++)z[w]=Y[w];for(w=253;w>=0;w--)x(z,z),w!==2&&w!==4&&d(z,z,Y);for(w=0;w<16;w++)Q[w]=z[w]}function W(Q,Y){const z=i();let w;for(w=0;w<16;w++)z[w]=Y[w];for(w=250;w>=0;w--)x(z,z),w!==1&&d(z,z,Y);for(w=0;w<16;w++)Q[w]=z[w]}function ee(Q,Y){const z=i(),w=i(),F=i(),we=i(),ve=i(),Ue=i(),nt=i(),at=i(),Ge=i();I(z,Q[1],Q[0]),I(Ge,Y[1],Y[0]),d(z,z,Ge),T(w,Q[0],Q[1]),T(Ge,Y[0],Y[1]),d(w,w,Ge),d(F,Q[3],Y[3]),d(F,F,f),d(we,Q[2],Y[2]),T(we,we,we),I(ve,w,z),I(Ue,we,F),T(nt,we,F),T(at,w,z),d(Q[0],ve,Ue),d(Q[1],at,nt),d(Q[2],nt,Ue),d(Q[3],ve,at)}function de(Q,Y,z){for(let w=0;w<4;w++)j(Q[w],Y[w],z)}function me(Q,Y){const z=i(),w=i(),F=i();J(F,Y[2]),d(z,Y[0],F),d(w,Y[1],F),H(Q,w),Q[31]^=L(z)<<7}function O(Q,Y,z){S(Q[0],c),S(Q[1],l),S(Q[2],l),S(Q[3],c);for(let w=255;w>=0;--w){const F=z[w/8|0]>>(w&7)&1;de(Q,Y,F),ee(Y,Q),ee(Q,Q),de(Q,Y,F)}}function U(Q,Y){const z=[i(),i(),i(),i()];S(z[0],v),S(z[1],E),S(z[2],l),d(z[3],v,E),O(Q,z,Y)}function ce(Q){if(Q.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const Y=(0,r.hash)(Q);Y[0]&=248,Y[31]&=127,Y[31]|=64;const z=new Uint8Array(32),w=[i(),i(),i(),i()];U(w,Y),me(z,w);const F=new Uint8Array(64);return F.set(Q),F.set(z,32),{publicKey:z,secretKey:F}}t.generateKeyPairFromSeed=ce;function le(Q){const Y=(0,e.randomBytes)(32,Q),z=ce(Y);return(0,n.wipe)(Y),z}t.generateKeyPair=le;function re(Q){if(Q.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(Q.subarray(32))}t.extractPublicKeyFromSecretKey=re;const ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(Q,Y){let z,w,F,we;for(w=63;w>=32;--w){for(z=0,F=w-32,we=w-12;F<we;++F)Y[F]+=z-16*Y[w]*ne[F-(w-32)],z=Math.floor((Y[F]+128)/256),Y[F]-=z*256;Y[F]+=z,Y[w]=0}for(z=0,F=0;F<32;F++)Y[F]+=z-(Y[31]>>4)*ne[F],z=Y[F]>>8,Y[F]&=255;for(F=0;F<32;F++)Y[F]-=z*ne[F];for(w=0;w<32;w++)Y[w+1]+=Y[w]>>8,Q[w]=Y[w]&255}function ie(Q){const Y=new Float64Array(64);for(let z=0;z<64;z++)Y[z]=Q[z];for(let z=0;z<64;z++)Q[z]=0;ae(Q,Y)}function Ae(Q,Y){const z=new Float64Array(64),w=[i(),i(),i(),i()],F=(0,r.hash)(Q.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const we=new Uint8Array(64);we.set(F.subarray(32),32);const ve=new r.SHA512;ve.update(we.subarray(32)),ve.update(Y);const Ue=ve.digest();ve.clean(),ie(Ue),U(w,Ue),me(we,w),ve.reset(),ve.update(we.subarray(0,32)),ve.update(Q.subarray(32)),ve.update(Y);const nt=ve.digest();ie(nt);for(let at=0;at<32;at++)z[at]=Ue[at];for(let at=0;at<32;at++)for(let Ge=0;Ge<32;Ge++)z[at+Ge]+=nt[at]*F[Ge];return ae(we.subarray(32),z),we}t.sign=Ae;function ge(Q,Y){const z=i(),w=i(),F=i(),we=i(),ve=i(),Ue=i(),nt=i();return S(Q[2],l),$(Q[1],Y),x(F,Q[1]),d(we,F,h),I(F,F,Q[2]),T(we,Q[2],we),x(ve,we),x(Ue,ve),d(nt,Ue,ve),d(z,nt,F),d(z,z,we),W(z,z),d(z,z,F),d(z,z,we),d(z,z,we),d(Q[0],z,we),x(w,Q[0]),d(w,w,we),N(w,F)&&d(Q[0],Q[0],_),x(w,Q[0]),d(w,w,we),N(w,F)?-1:(L(Q[0])===Y[31]>>7&&I(Q[0],c,Q[0]),d(Q[3],Q[0],Q[1]),0)}function Be(Q,Y,z){const w=new Uint8Array(32),F=[i(),i(),i(),i()],we=[i(),i(),i(),i()];if(z.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ge(we,Q))return!1;const ve=new r.SHA512;ve.update(z.subarray(0,32)),ve.update(Q),ve.update(Y);const Ue=ve.digest();return ie(Ue),O(F,we,Ue),U(we,z.subarray(32)),ee(F,we),me(w,F),!Z(z,w)}t.verify=Be;function ye(Q){let Y=[i(),i(),i(),i()];if(ge(Y,Q))throw new Error("Ed25519: invalid public key");let z=i(),w=i(),F=Y[1];T(z,l,F),I(w,l,F),J(w,w),d(z,z,w);let we=new Uint8Array(32);return H(we,z),we}t.convertPublicKeyToX25519=ye;function Me(Q){const Y=(0,r.hash)(Q.subarray(0,32));Y[0]&=248,Y[31]&=127,Y[31]|=64;const z=new Uint8Array(Y.subarray(0,32));return(0,n.wipe)(Y),z}t.convertSecretKeyToX25519=Me}(sh);const K4="EdDSA",G4="JWT",bp=".",_p="base64url",Z4="utf8",Y4="utf8",J4=":",Q4="did",X4="key",Ep="base58btc",e_="z",t_="K36",r_=32;function hc(t){return Dr(Hr(Vo(t),Z4),_p)}function xp(t){const e=Hr(t_,Ep),r=e_+Dr(yu([e,t]),Ep);return[Q4,X4,r].join(J4)}function n_(t){return Dr(t,_p)}function i_(t){return Hr([hc(t.header),hc(t.payload)].join(bp),Y4)}function s_(t){return[hc(t.header),hc(t.payload),n_(t.signature)].join(bp)}function Cp(t=Ss.randomBytes(r_)){return sh.generateKeyPairFromSeed(t)}async function o_(t,e,r,n,i=Te.fromMiliseconds(Date.now())){const o={alg:K4,typ:G4},c=xp(n.publicKey),l=i+r,h={iss:c,sub:t,aud:e,iat:i,exp:l},f=i_({header:o,payload:h}),v=sh.sign(n.secretKey,f);return s_({header:o,payload:h,signature:v})}const a_="PARSE_ERROR",c_="INVALID_REQUEST",l_="METHOD_NOT_FOUND",u_="INVALID_PARAMS",Ip="INTERNAL_ERROR",oh="SERVER_ERROR",h_=[-32700,-32600,-32601,-32602,-32603],Ko={[a_]:{code:-32700,message:"Parse error"},[c_]:{code:-32600,message:"Invalid Request"},[l_]:{code:-32601,message:"Method not found"},[u_]:{code:-32602,message:"Invalid params"},[Ip]:{code:-32603,message:"Internal error"},[oh]:{code:-32e3,message:"Server error"}},Sp=oh;function f_(t){return h_.includes(t)}function Op(t){return Object.keys(Ko).includes(t)?Ko[t]:Ko[Sp]}function d_(t){const e=Object.values(Ko).find(r=>r.code===t);return e||Ko[Sp]}function Ap(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Dp={};/*! *****************************************************************************
60
60
  Copyright (c) Microsoft Corporation.
61
61
 
62
62
  Permission to use, copy, modify, and/or distribute this software for any
@@ -69,31 +69,85 @@
69
69
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
70
70
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
71
71
  PERFORMANCE OF THIS SOFTWARE.
72
- ***************************************************************************** */var bc=function(r,e){return bc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])},bc(r,e)};function Pm(r,e){bc(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var mc=function(){return mc=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},mc.apply(this,arguments)};function Cm(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(r);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(r,i[o])&&(t[i[o]]=r[i[o]]);return t}function Am(r,e,t,i){var o=arguments.length,a=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,i);else for(var f=r.length-1;f>=0;f--)(u=r[f])&&(a=(o<3?u(a):o>3?u(e,t,a):u(e,t))||a);return o>3&&a&&Object.defineProperty(e,t,a),a}function Tm(r,e){return function(t,i){e(t,i,r)}}function Rm(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Nm(r,e,t,i){function o(a){return a instanceof t?a:new t(function(u){u(a)})}return new(t||(t=Promise))(function(a,u){function f(w){try{p(i.next(w))}catch(I){u(I)}}function v(w){try{p(i.throw(w))}catch(I){u(I)}}function p(w){w.done?a(w.value):o(w.value).then(f,v)}p((i=i.apply(r,e||[])).next())})}function $m(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,o,a,u;return u={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function f(p){return function(w){return v([p,w])}}function v(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,o&&(a=p[0]&2?o.return:p[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,p[1])).done)return a;switch(o=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,o=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]<a[3])){t.label=p[1];break}if(p[0]===6&&t.label<a[1]){t.label=a[1],a=p;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(p);break}a[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(r,t)}catch(w){p=[6,w],o=0}finally{i=a=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function Fm(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function Lm(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function wc(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function If(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),o,a=[],u;try{for(;(e===void 0||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(f){u={error:f}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a}function Um(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(If(arguments[e]));return r}function jm(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),o=0,e=0;e<t;e++)for(var a=arguments[e],u=0,f=a.length;u<f;u++,o++)i[o]=a[u];return i}function ds(r){return this instanceof ds?(this.v=r,this):new ds(r)}function Mm(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),o,a=[];return o={},u("next"),u("throw"),u("return"),o[Symbol.asyncIterator]=function(){return this},o;function u(S){i[S]&&(o[S]=function(C){return new Promise(function(R,B){a.push([S,C,R,B])>1||f(S,C)})})}function f(S,C){try{v(i[S](C))}catch(R){I(a[0][3],R)}}function v(S){S.value instanceof ds?Promise.resolve(S.value.v).then(p,w):I(a[0][2],S)}function p(S){f("next",S)}function w(S){f("throw",S)}function I(S,C){S(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function qm(r){var e,t;return e={},i("next"),i("throw",function(o){throw o}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(o,a){e[o]=r[o]?function(u){return(t=!t)?{value:ds(r[o](u)),done:o==="return"}:a?a(u):u}:a}}function Hm(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof wc=="function"?wc(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(a){t[a]=r[a]&&function(u){return new Promise(function(f,v){u=r[a](u),o(f,v,u.done,u.value)})}}function o(a,u,f,v){Promise.resolve(v).then(function(p){a({value:p,done:f})},u)}}function Bm(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function zm(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function Km(r){return r&&r.__esModule?r:{default:r}}function Vm(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function km(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var Gm=Object.freeze({__proto__:null,__extends:Pm,get __assign(){return mc},__rest:Cm,__decorate:Am,__param:Tm,__metadata:Rm,__awaiter:Nm,__generator:$m,__createBinding:Fm,__exportStar:Lm,__values:wc,__read:If,__spread:Um,__spreadArrays:jm,__await:ds,__asyncGenerator:Mm,__asyncDelegator:qm,__asyncValues:Hm,__makeTemplateObject:Bm,__importStar:zm,__importDefault:Km,__classPrivateFieldGet:Vm,__classPrivateFieldSet:km}),Wm=Bn(Gm),an={},Pf;function Ym(){if(Pf)return an;Pf=1,Object.defineProperty(an,"__esModule",{value:!0}),an.isBrowserCryptoAvailable=an.getSubtleCrypto=an.getBrowerCrypto=void 0;function r(){return Vt?.crypto||Vt?.msCrypto||{}}an.getBrowerCrypto=r;function e(){const i=r();return i.subtle||i.webkitSubtle}an.getSubtleCrypto=e;function t(){return!!r()&&!!e()}return an.isBrowserCryptoAvailable=t,an}var cn={},Cf;function Jm(){if(Cf)return cn;Cf=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.isBrowser=cn.isNode=cn.isReactNative=void 0;function r(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}cn.isReactNative=r;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}cn.isNode=e;function t(){return!r()&&!e()}return cn.isBrowser=t,cn}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Wm;e.__exportStar(Ym(),r),e.__exportStar(Jm(),r)})(Of);function Ec(r=3){const e=Date.now()*Math.pow(10,r),t=Math.floor(Math.random()*Math.pow(10,r));return e+t}function Af(r=6){return BigInt(Ec(r))}function Ei(r,e,t){return{id:t||Ec(),jsonrpc:"2.0",method:r,params:e}}function Dc(r,e){return{id:r,jsonrpc:"2.0",result:e}}function oo(r,e,t){return{id:r,jsonrpc:"2.0",error:Qm(e,t)}}function Qm(r,e){return typeof r>"u"?Sf(Ef):(typeof r=="string"&&(r=Object.assign(Object.assign({},Sf(_c)),{message:r})),typeof e<"u"&&(r.data=e),Om(r.code)&&(r=Im(r.code)),r)}class Xm{}class Zm extends Xm{constructor(){super()}}class ew extends Zm{constructor(e){super()}}const tw="^https?:",rw="^wss?:";function nw(r){const e=r.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Tf(r,e){const t=nw(r);return typeof t>"u"?!1:new RegExp(e).test(t)}function Rf(r){return Tf(r,tw)}function Nf(r){return Tf(r,rw)}function iw(r){return new RegExp("wss?://localhost(:d{2,5})?").test(r)}function $f(r){return typeof r=="object"&&"id"in r&&"jsonrpc"in r&&r.jsonrpc==="2.0"}function Sc(r){return $f(r)&&"method"in r}function ao(r){return $f(r)&&(un(r)||zr(r))}function un(r){return"result"in r}function zr(r){return"error"in r}class hn extends ew{constructor(e){super(e),this.events=new Yt.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(Ei(e.method,e.params||[],e.id||Af().toString()),t)}async requestStrict(e,t){return new Promise(async(i,o)=>{if(!this.connection.connected)try{await this.open()}catch(a){o(a)}this.events.on(`${e.id}`,a=>{zr(a)?o(a.error):i(a.result)});try{await this.connection.send(e,t)}catch(a){o(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),ao(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const sw=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),ow=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Ff=r=>r.split("?")[0],Lf=10,aw=sw();class cw{constructor(e){if(this.url=e,this.events=new Yt.exports.EventEmitter,this.registering=!1,!Nf(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(new Error("Connection already closed"));return}this.socket.onclose=i=>{this.onClose(i),e()},this.socket.close()})}async send(e,t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ls(e))}catch(i){this.onError(e.id,i)}}register(e=this.url){if(!Nf(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,o)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),o(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return o(new Error("WebSocket connection is missing or invalid"));i(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,i)=>{const o=Of.isReactNative()?void 0:{rejectUnauthorized:!iw(e)},a=new aw(e,[],o);ow()?a.onerror=u=>{const f=u;i(this.emitError(f.error))}:a.on("error",u=>{i(this.emitError(u))}),a.onopen=()=>{this.onOpen(a),t(a)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?vc(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),o=i.message||i.toString(),a=oo(e,o);this.events.emit("payload",a)}parseError(e,t=this.url){return xf(e,Ff(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Lf&&this.events.setMaxListeners(Lf)}emitError(e){const t=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${Ff(this.url)}`));return this.events.emit("register_error",t),t}}var xc={exports:{}};(function(r,e){var t=200,i="__lodash_hash_undefined__",o=1,a=2,u=9007199254740991,f="[object Arguments]",v="[object Array]",p="[object AsyncFunction]",w="[object Boolean]",I="[object Date]",S="[object Error]",C="[object Function]",R="[object GeneratorFunction]",B="[object Map]",K="[object Number]",se="[object Null]",$="[object Object]",U="[object Promise]",x="[object Proxy]",T="[object RegExp]",E="[object Set]",h="[object String]",b="[object Symbol]",G="[object Undefined]",Y="[object WeakMap]",ie="[object ArrayBuffer]",ce="[object DataView]",de="[object Float32Array]",m="[object Float64Array]",P="[object Int8Array]",ee="[object Int16Array]",Q="[object Int32Array]",V="[object Uint8Array]",k="[object Uint8ClampedArray]",J="[object Uint16Array]",re="[object Uint32Array]",me=/[\\^$.*+?()[\]{}|]/g,oe=/^\[object .+?Constructor\]$/,we=/^(?:0|[1-9]\d*)$/,le={};le[de]=le[m]=le[P]=le[ee]=le[Q]=le[V]=le[k]=le[J]=le[re]=!0,le[f]=le[v]=le[ie]=le[w]=le[ce]=le[I]=le[S]=le[C]=le[B]=le[K]=le[$]=le[T]=le[E]=le[h]=le[Y]=!1;var _e=typeof Vt=="object"&&Vt&&Vt.Object===Object&&Vt,H=typeof self=="object"&&self&&self.Object===Object&&self,q=_e||H||Function("return this")(),F=e&&!e.nodeType&&e,d=F&&!0&&r&&!r.nodeType&&r,A=d&&d.exports===F,ae=A&&_e.process,fe=function(){try{return ae&&ae.binding&&ae.binding("util")}catch{}}(),xe=fe&&fe.isTypedArray;function Be(D,L){for(var te=-1,pe=D==null?0:D.length,ct=0,Te=[];++te<pe;){var dt=D[te];L(dt,te,D)&&(Te[ct++]=dt)}return Te}function Ve(D,L){for(var te=-1,pe=L.length,ct=D.length;++te<pe;)D[ct+te]=L[te];return D}function Ue(D,L){for(var te=-1,pe=D==null?0:D.length;++te<pe;)if(L(D[te],te,D))return!0;return!1}function vt(D,L){for(var te=-1,pe=Array(D);++te<D;)pe[te]=L(te);return pe}function yt(D){return function(L){return D(L)}}function Me(D,L){return D.has(L)}function Oe(D,L){return D?.[L]}function $e(D){var L=-1,te=Array(D.size);return D.forEach(function(pe,ct){te[++L]=[ct,pe]}),te}function Fe(D,L){return function(te){return D(L(te))}}function qe(D){var L=-1,te=Array(D.size);return D.forEach(function(pe){te[++L]=pe}),te}var Pe=Array.prototype,Le=Function.prototype,Se=Object.prototype,Ce=q["__core-js_shared__"],ze=Le.toString,Ie=Se.hasOwnProperty,ke=function(){var D=/[^.]+$/.exec(Ce&&Ce.keys&&Ce.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""}(),We=Se.toString,et=RegExp("^"+ze.call(Ie).replace(me,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tt=A?q.Buffer:void 0,Qe=q.Symbol,cr=q.Uint8Array,yr=Se.propertyIsEnumerable,en=Pe.splice,ur=Qe?Qe.toStringTag:void 0,pn=Object.getOwnPropertySymbols,Tn=tt?tt.isBuffer:void 0,Xn=Fe(Object.keys,Object),Dt=xr(q,"DataView"),_t=xr(q,"Map"),St=xr(q,"Promise"),xt=xr(q,"Set"),wt=xr(q,"WeakMap"),bt=xr(Object,"create"),Lt=vn(Dt),Ut=vn(_t),Ot=vn(St),jt=vn(xt),It=vn(wt),Tt=Qe?Qe.prototype:void 0,Pt=Tt?Tt.valueOf:void 0;function ft(D){var L=-1,te=D==null?0:D.length;for(this.clear();++L<te;){var pe=D[L];this.set(pe[0],pe[1])}}function Mt(){this.__data__=bt?bt(null):{},this.size=0}function qt(D){var L=this.has(D)&&delete this.__data__[D];return this.size-=L?1:0,L}function Vc(D){var L=this.__data__;if(bt){var te=L[D];return te===i?void 0:te}return Ie.call(L,D)?L[D]:void 0}function kc(D){var L=this.__data__;return bt?L[D]!==void 0:Ie.call(L,D)}function Gc(D,L){var te=this.__data__;return this.size+=this.has(D)?0:1,te[D]=bt&&L===void 0?i:L,this}ft.prototype.clear=Mt,ft.prototype.delete=qt,ft.prototype.get=Vc,ft.prototype.has=kc,ft.prototype.set=Gc;function Rr(D){var L=-1,te=D==null?0:D.length;for(this.clear();++L<te;){var pe=D[L];this.set(pe[0],pe[1])}}function Wc(){this.__data__=[],this.size=0}function Yc(D){var L=this.__data__,te=Zn(L,D);if(te<0)return!1;var pe=L.length-1;return te==pe?L.pop():en.call(L,te,1),--this.size,!0}function Jc(D){var L=this.__data__,te=Zn(L,D);return te<0?void 0:L[te][1]}function Qc(D){return Zn(this.__data__,D)>-1}function Xc(D,L){var te=this.__data__,pe=Zn(te,D);return pe<0?(++this.size,te.push([D,L])):te[pe][1]=L,this}Rr.prototype.clear=Wc,Rr.prototype.delete=Yc,Rr.prototype.get=Jc,Rr.prototype.has=Qc,Rr.prototype.set=Xc;function gn(D){var L=-1,te=D==null?0:D.length;for(this.clear();++L<te;){var pe=D[L];this.set(pe[0],pe[1])}}function Si(){this.size=0,this.__data__={hash:new ft,map:new(_t||Rr),string:new ft}}function Zc(D){var L=Rn(this,D).delete(D);return this.size-=L?1:0,L}function xi(D){return Rn(this,D).get(D)}function eu(D){return Rn(this,D).has(D)}function tu(D,L){var te=Rn(this,D),pe=te.size;return te.set(D,L),this.size+=te.size==pe?0:1,this}gn.prototype.clear=Si,gn.prototype.delete=Zc,gn.prototype.get=xi,gn.prototype.has=eu,gn.prototype.set=tu;function Oi(D){var L=-1,te=D==null?0:D.length;for(this.__data__=new gn;++L<te;)this.add(D[L])}function _o(D){return this.__data__.set(D,i),this}function bo(D){return this.__data__.has(D)}Oi.prototype.add=Oi.prototype.push=_o,Oi.prototype.has=bo;function Vr(D){var L=this.__data__=new Rr(D);this.size=L.size}function ru(){this.__data__=new Rr,this.size=0}function nu(D){var L=this.__data__,te=L.delete(D);return this.size=L.size,te}function iu(D){return this.__data__.get(D)}function su(D){return this.__data__.has(D)}function mo(D,L){var te=this.__data__;if(te instanceof Rr){var pe=te.__data__;if(!_t||pe.length<t-1)return pe.push([D,L]),this.size=++te.size,this;te=this.__data__=new gn(pe)}return te.set(D,L),this.size=te.size,this}Vr.prototype.clear=ru,Vr.prototype.delete=nu,Vr.prototype.get=iu,Vr.prototype.has=su,Vr.prototype.set=mo;function wo(D,L){var te=Ci(D),pe=!te&&No(D),ct=!te&&!pe&&Ss(D),Te=!te&&!pe&&!ct&&Lo(D),dt=te||pe||ct||Te,Ht=dt?vt(D.length,String):[],Xe=Ht.length;for(var ut in D)(L||Ie.call(D,ut))&&!(dt&&(ut=="length"||ct&&(ut=="offset"||ut=="parent")||Te&&(ut=="buffer"||ut=="byteLength"||ut=="byteOffset")||Po(ut,Xe)))&&Ht.push(ut);return Ht}function Zn(D,L){for(var te=D.length;te--;)if(Ro(D[te][0],L))return te;return-1}function Es(D,L,te){var pe=L(D);return Ci(D)?pe:Ve(pe,te(D))}function ei(D){return D==null?D===void 0?G:se:ur&&ur in Object(D)?Oo(D):cu(D)}function Ds(D){return ri(D)&&ei(D)==f}function ti(D,L,te,pe,ct){return D===L?!0:D==null||L==null||!ri(D)&&!ri(L)?D!==D&&L!==L:Eo(D,L,te,pe,ti,ct)}function Eo(D,L,te,pe,ct,Te){var dt=Ci(D),Ht=Ci(L),Xe=dt?v:tn(D),ut=Ht?v:tn(L);Xe=Xe==f?$:Xe,ut=ut==f?$:ut;var Rt=Xe==$,_r=ut==$,Bt=Xe==ut;if(Bt&&Ss(D)){if(!Ss(L))return!1;dt=!0,Rt=!1}if(Bt&&!Rt)return Te||(Te=new Vr),dt||Lo(D)?Ii(D,L,te,pe,ct,Te):au(D,L,Xe,te,pe,ct,Te);if(!(te&o)){var pt=Rt&&Ie.call(D,"__wrapped__"),hr=_r&&Ie.call(L,"__wrapped__");if(pt||hr){var kr=pt?D.value():D,Nr=hr?L.value():L;return Te||(Te=new Vr),ct(kr,Nr,te,pe,Te)}}return Bt?(Te||(Te=new Vr),xo(D,L,te,pe,ct,Te)):!1}function ou(D){if(!Fo(D)||Ao(D))return!1;var L=Ai(D)?et:oe;return L.test(vn(D))}function Do(D){return ri(D)&&$o(D.length)&&!!le[ei(D)]}function So(D){if(!To(D))return Xn(D);var L=[];for(var te in Object(D))Ie.call(D,te)&&te!="constructor"&&L.push(te);return L}function Ii(D,L,te,pe,ct,Te){var dt=te&o,Ht=D.length,Xe=L.length;if(Ht!=Xe&&!(dt&&Xe>Ht))return!1;var ut=Te.get(D);if(ut&&Te.get(L))return ut==L;var Rt=-1,_r=!0,Bt=te&a?new Oi:void 0;for(Te.set(D,L),Te.set(L,D);++Rt<Ht;){var pt=D[Rt],hr=L[Rt];if(pe)var kr=dt?pe(hr,pt,Rt,L,D,Te):pe(pt,hr,Rt,D,L,Te);if(kr!==void 0){if(kr)continue;_r=!1;break}if(Bt){if(!Ue(L,function(Nr,rn){if(!Me(Bt,rn)&&(pt===Nr||ct(pt,Nr,te,pe,Te)))return Bt.push(rn)})){_r=!1;break}}else if(!(pt===hr||ct(pt,hr,te,pe,Te))){_r=!1;break}}return Te.delete(D),Te.delete(L),_r}function au(D,L,te,pe,ct,Te,dt){switch(te){case ce:if(D.byteLength!=L.byteLength||D.byteOffset!=L.byteOffset)return!1;D=D.buffer,L=L.buffer;case ie:return!(D.byteLength!=L.byteLength||!Te(new cr(D),new cr(L)));case w:case I:case K:return Ro(+D,+L);case S:return D.name==L.name&&D.message==L.message;case T:case h:return D==L+"";case B:var Ht=$e;case E:var Xe=pe&o;if(Ht||(Ht=qe),D.size!=L.size&&!Xe)return!1;var ut=dt.get(D);if(ut)return ut==L;pe|=a,dt.set(D,L);var Rt=Ii(Ht(D),Ht(L),pe,ct,Te,dt);return dt.delete(D),Rt;case b:if(Pt)return Pt.call(D)==Pt.call(L)}return!1}function xo(D,L,te,pe,ct,Te){var dt=te&o,Ht=Pi(D),Xe=Ht.length,ut=Pi(L),Rt=ut.length;if(Xe!=Rt&&!dt)return!1;for(var _r=Xe;_r--;){var Bt=Ht[_r];if(!(dt?Bt in L:Ie.call(L,Bt)))return!1}var pt=Te.get(D);if(pt&&Te.get(L))return pt==L;var hr=!0;Te.set(D,L),Te.set(L,D);for(var kr=dt;++_r<Xe;){Bt=Ht[_r];var Nr=D[Bt],rn=L[Bt];if(pe)var xs=dt?pe(rn,Nr,Bt,L,D,Te):pe(Nr,rn,Bt,D,L,Te);if(!(xs===void 0?Nr===rn||ct(Nr,rn,te,pe,Te):xs)){hr=!1;break}kr||(kr=Bt=="constructor")}if(hr&&!kr){var ni=D.constructor,Gt=L.constructor;ni!=Gt&&"constructor"in D&&"constructor"in L&&!(typeof ni=="function"&&ni instanceof ni&&typeof Gt=="function"&&Gt instanceof Gt)&&(hr=!1)}return Te.delete(D),Te.delete(L),hr}function Pi(D){return Es(D,lu,Io)}function Rn(D,L){var te=D.__data__;return Co(L)?te[typeof L=="string"?"string":"hash"]:te.map}function xr(D,L){var te=Oe(D,L);return ou(te)?te:void 0}function Oo(D){var L=Ie.call(D,ur),te=D[ur];try{D[ur]=void 0;var pe=!0}catch{}var ct=We.call(D);return pe&&(L?D[ur]=te:delete D[ur]),ct}var Io=pn?function(D){return D==null?[]:(D=Object(D),Be(pn(D),function(L){return yr.call(D,L)}))}:at,tn=ei;(Dt&&tn(new Dt(new ArrayBuffer(1)))!=ce||_t&&tn(new _t)!=B||St&&tn(St.resolve())!=U||xt&&tn(new xt)!=E||wt&&tn(new wt)!=Y)&&(tn=function(D){var L=ei(D),te=L==$?D.constructor:void 0,pe=te?vn(te):"";if(pe)switch(pe){case Lt:return ce;case Ut:return B;case Ot:return U;case jt:return E;case It:return Y}return L});function Po(D,L){return L=L??u,!!L&&(typeof D=="number"||we.test(D))&&D>-1&&D%1==0&&D<L}function Co(D){var L=typeof D;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?D!=="__proto__":D===null}function Ao(D){return!!ke&&ke in D}function To(D){var L=D&&D.constructor,te=typeof L=="function"&&L.prototype||Se;return D===te}function cu(D){return We.call(D)}function vn(D){if(D!=null){try{return ze.call(D)}catch{}try{return D+""}catch{}}return""}function Ro(D,L){return D===L||D!==D&&L!==L}var No=Ds(function(){return arguments}())?Ds:function(D){return ri(D)&&Ie.call(D,"callee")&&!yr.call(D,"callee")},Ci=Array.isArray;function uu(D){return D!=null&&$o(D.length)&&!Ai(D)}var Ss=Tn||ot;function hu(D,L){return ti(D,L)}function Ai(D){if(!Fo(D))return!1;var L=ei(D);return L==C||L==R||L==p||L==x}function $o(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=u}function Fo(D){var L=typeof D;return D!=null&&(L=="object"||L=="function")}function ri(D){return D!=null&&typeof D=="object"}var Lo=xe?yt(xe):Do;function lu(D){return uu(D)?wo(D):So(D)}function at(){return[]}function ot(){return!1}r.exports=hu})(xc,xc.exports);var uw=xc.exports,hw=Object.defineProperty,Uf=Object.getOwnPropertySymbols,lw=Object.prototype.hasOwnProperty,fw=Object.prototype.propertyIsEnumerable,jf=(r,e,t)=>e in r?hw(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ar=(r,e)=>{for(var t in e||(e={}))lw.call(e,t)&&jf(r,t,e[t]);if(Uf)for(var t of Uf(e))fw.call(e,t)&&jf(r,t,e[t]);return r};function dw(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i<t.length;i++)t[i]=255;for(var o=0;o<r.length;o++){var a=r.charAt(o),u=a.charCodeAt(0);if(t[u]!==255)throw new TypeError(a+" is ambiguous");t[u]=o}var f=r.length,v=r.charAt(0),p=Math.log(f)/Math.log(256),w=Math.log(256)/Math.log(f);function I(R){if(R instanceof Uint8Array||(ArrayBuffer.isView(R)?R=new Uint8Array(R.buffer,R.byteOffset,R.byteLength):Array.isArray(R)&&(R=Uint8Array.from(R))),!(R instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(R.length===0)return"";for(var B=0,K=0,se=0,$=R.length;se!==$&&R[se]===0;)se++,B++;for(var U=($-se)*w+1>>>0,x=new Uint8Array(U);se!==$;){for(var T=R[se],E=0,h=U-1;(T!==0||E<K)&&h!==-1;h--,E++)T+=256*x[h]>>>0,x[h]=T%f>>>0,T=T/f>>>0;if(T!==0)throw new Error("Non-zero carry");K=E,se++}for(var b=U-K;b!==U&&x[b]===0;)b++;for(var G=v.repeat(B);b<U;++b)G+=r.charAt(x[b]);return G}function S(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return new Uint8Array;var B=0;if(R[B]!==" "){for(var K=0,se=0;R[B]===v;)K++,B++;for(var $=(R.length-B)*p+1>>>0,U=new Uint8Array($);R[B];){var x=t[R.charCodeAt(B)];if(x===255)return;for(var T=0,E=$-1;(x!==0||T<se)&&E!==-1;E--,T++)x+=f*U[E]>>>0,U[E]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");se=T,B++}if(R[B]!==" "){for(var h=$-se;h!==$&&U[h]===0;)h++;for(var b=new Uint8Array(K+($-h)),G=K;h!==$;)b[G++]=U[h++];return b}}}function C(R){var B=S(R);if(B)return B;throw new Error(`Non-${e} character`)}return{encode:I,decodeUnsafe:S,decode:C}}var pw=dw,gw=pw;const Mf=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},vw=r=>new TextEncoder().encode(r),yw=r=>new TextDecoder().decode(r);class _w{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class bw{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return qf(this,e)}}class mw{constructor(e){this.decoders=e}or(e){return qf(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const qf=(r,e)=>new mw(ar(ar({},r.decoders||{[r.prefix]:r}),e.decoders||{[e.prefix]:e}));class ww{constructor(e,t,i,o){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=o,this.encoder=new _w(e,t,i),this.decoder=new bw(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const co=({name:r,prefix:e,encode:t,decode:i})=>new ww(r,e,t,i),ps=({prefix:r,name:e,alphabet:t})=>{const{encode:i,decode:o}=gw(t,e);return co({prefix:r,name:e,encode:i,decode:a=>Mf(o(a))})},Ew=(r,e,t,i)=>{const o={};for(let w=0;w<e.length;++w)o[e[w]]=w;let a=r.length;for(;r[a-1]==="=";)--a;const u=new Uint8Array(a*t/8|0);let f=0,v=0,p=0;for(let w=0;w<a;++w){const I=o[r[w]];if(I===void 0)throw new SyntaxError(`Non-${i} character`);v=v<<t|I,f+=t,f>=8&&(f-=8,u[p++]=255&v>>f)}if(f>=t||255&v<<8-f)throw new SyntaxError("Unexpected end of data");return u},Dw=(r,e,t)=>{const i=e[e.length-1]==="=",o=(1<<t)-1;let a="",u=0,f=0;for(let v=0;v<r.length;++v)for(f=f<<8|r[v],u+=8;u>t;)u-=t,a+=e[o&f>>u];if(u&&(a+=e[o&f<<t-u]),i)for(;a.length*t&7;)a+="=";return a},Qt=({name:r,prefix:e,bitsPerChar:t,alphabet:i})=>co({prefix:e,name:r,encode(o){return Dw(o,i,t)},decode(o){return Ew(o,i,t,r)}}),Sw=co({prefix:"\0",name:"identity",encode:r=>yw(r),decode:r=>vw(r)});var xw=Object.freeze({__proto__:null,identity:Sw});const Ow=Qt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Iw=Object.freeze({__proto__:null,base2:Ow});const Pw=Qt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Cw=Object.freeze({__proto__:null,base8:Pw});const Aw=ps({prefix:"9",name:"base10",alphabet:"0123456789"});var Tw=Object.freeze({__proto__:null,base10:Aw});const Rw=Qt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Nw=Qt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var $w=Object.freeze({__proto__:null,base16:Rw,base16upper:Nw});const Fw=Qt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Lw=Qt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Uw=Qt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),jw=Qt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Mw=Qt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),qw=Qt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Hw=Qt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Bw=Qt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),zw=Qt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Kw=Object.freeze({__proto__:null,base32:Fw,base32upper:Lw,base32pad:Uw,base32padupper:jw,base32hex:Mw,base32hexupper:qw,base32hexpad:Hw,base32hexpadupper:Bw,base32z:zw});const Vw=ps({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),kw=ps({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Gw=Object.freeze({__proto__:null,base36:Vw,base36upper:kw});const Ww=ps({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Yw=ps({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Jw=Object.freeze({__proto__:null,base58btc:Ww,base58flickr:Yw});const Qw=Qt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Xw=Qt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Zw=Qt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),eE=Qt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var tE=Object.freeze({__proto__:null,base64:Qw,base64pad:Xw,base64url:Zw,base64urlpad:eE});const Hf=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),rE=Hf.reduce((r,e,t)=>(r[t]=e,r),[]),nE=Hf.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function iE(r){return r.reduce((e,t)=>(e+=rE[t],e),"")}function sE(r){const e=[];for(const t of r){const i=nE[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const oE=co({prefix:"\u{1F680}",name:"base256emoji",encode:iE,decode:sE});var aE=Object.freeze({__proto__:null,base256emoji:oE}),cE=zf,Bf=128,uE=127,hE=~uE,lE=Math.pow(2,31);function zf(r,e,t){e=e||[],t=t||0;for(var i=t;r>=lE;)e[t++]=r&255|Bf,r/=128;for(;r&hE;)e[t++]=r&255|Bf,r>>>=7;return e[t]=r|0,zf.bytes=t-i+1,e}var fE=Oc,dE=128,Kf=127;function Oc(r,i){var t=0,i=i||0,o=0,a=i,u,f=r.length;do{if(a>=f)throw Oc.bytes=0,new RangeError("Could not decode varint");u=r[a++],t+=o<28?(u&Kf)<<o:(u&Kf)*Math.pow(2,o),o+=7}while(u>=dE);return Oc.bytes=a-i,t}var pE=Math.pow(2,7),gE=Math.pow(2,14),vE=Math.pow(2,21),yE=Math.pow(2,28),_E=Math.pow(2,35),bE=Math.pow(2,42),mE=Math.pow(2,49),wE=Math.pow(2,56),EE=Math.pow(2,63),DE=function(r){return r<pE?1:r<gE?2:r<vE?3:r<yE?4:r<_E?5:r<bE?6:r<mE?7:r<wE?8:r<EE?9:10},SE={encode:cE,decode:fE,encodingLength:DE},Vf=SE;const kf=(r,e,t=0)=>(Vf.encode(r,e,t),e),Gf=r=>Vf.encodingLength(r),Ic=(r,e)=>{const t=e.byteLength,i=Gf(r),o=i+Gf(t),a=new Uint8Array(o+t);return kf(r,a,0),kf(t,a,i),a.set(e,o),new xE(r,t,e,a)};class xE{constructor(e,t,i,o){this.code=e,this.size=t,this.digest=i,this.bytes=o}}const Wf=({name:r,code:e,encode:t})=>new OE(r,e,t);class OE{constructor(e,t,i){this.name=e,this.code=t,this.encode=i}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Ic(this.code,t):t.then(i=>Ic(this.code,i))}else throw Error("Unknown type, must be binary type")}}const Yf=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),IE=Wf({name:"sha2-256",code:18,encode:Yf("SHA-256")}),PE=Wf({name:"sha2-512",code:19,encode:Yf("SHA-512")});var CE=Object.freeze({__proto__:null,sha256:IE,sha512:PE});const Jf=0,AE="identity",Qf=Mf;var TE=Object.freeze({__proto__:null,identity:{code:Jf,name:AE,encode:Qf,digest:r=>Ic(Jf,Qf(r))}});new TextEncoder,new TextDecoder;const Xf=ar(ar(ar(ar(ar(ar(ar(ar(ar(ar({},xw),Iw),Cw),Tw),$w),Kw),Gw),Jw),tE),aE);ar(ar({},CE),TE);function Zf(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function RE(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Zf(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function ed(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const td=ed("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Pc=ed("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=RE(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),NE=ar({utf8:td,"utf-8":td,hex:Xf.base16,latin1:Pc,ascii:Pc,binary:Pc},Xf);function $E(r,e="utf8"){const t=NE[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Zf(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}const rd="wc",FE=2,Cc="core",Pn=`${rd}@2:${Cc}:`,LE={name:Cc,logger:"error"},UE={database:":memory:"},jE="crypto",nd="client_ed25519_seed",ME=ye.ONE_DAY,qE="keychain",HE="0.3",BE="messages",zE="0.3",KE=ye.SIX_HOURS,VE="publisher",id="irn",kE="error",sd="wss://relay.walletconnect.com",od="wss://relay.walletconnect.org",GE="relayer",er={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},WE="_subscription",ln={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},YE=ye.ONE_SECOND,JE="2.10.3",QE=1e4,XE="0.3",ZE="WALLETCONNECT_CLIENT_ID",Kr={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},e3="subscription",t3="0.3",r3=ye.FIVE_SECONDS*1e3,n3="pairing",i3="0.3",gs={wc_pairingDelete:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:0},res:{ttl:ye.ONE_DAY,prompt:!1,tag:0}}},vs={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Zr={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},s3="history",o3="0.3",a3="expirer",Tr={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},c3="0.3",Ac="verify-api",Di="https://verify.walletconnect.com",Tc="https://verify.walletconnect.org",u3=[Di,Tc];class h3{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name=qE,this.version=HE,this.initialized=!1,this.storagePrefix=Pn,this.init=async()=>{if(!this.initialized){const i=await this.getKeyChain();typeof i<"u"&&(this.keychain=i),this.initialized=!0}},this.has=i=>(this.isInitialized(),this.keychain.has(i)),this.set=async(i,o)=>{this.isInitialized(),this.keychain.set(i,o),await this.persist()},this.get=i=>{this.isInitialized();const o=this.keychain.get(i);if(typeof o>"u"){const{message:a}=he("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(a)}return o},this.del=async i=>{this.isInitialized(),this.keychain.delete(i),await this.persist()},this.core=e,this.logger=Je.generateChildLogger(t,this.name)}get context(){return Je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,$l(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Fl(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}}class l3{constructor(e,t,i){this.core=e,this.logger=t,this.name=jE,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=o=>(this.isInitialized(),this.keychain.has(o)),this.getClientId=async()=>{this.isInitialized();const o=await this.getClientSeed(),a=wf(o);return mf(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const o=l_();return this.setPrivateKey(o.publicKey,o.privateKey)},this.signJWT=async o=>{this.isInitialized();const a=await this.getClientSeed(),u=wf(a),f=Ya();return await mm(f,o,ME,u)},this.generateSharedKey=(o,a,u)=>{this.isInitialized();const f=this.getPrivateKey(o),v=f_(f,a);return this.setSymKey(v,u)},this.setSymKey=async(o,a)=>{this.isInitialized();const u=a||d_(o);return await this.keychain.set(u,o),u},this.deleteKeyPair=async o=>{this.isInitialized(),await this.keychain.del(o)},this.deleteSymKey=async o=>{this.isInitialized(),await this.keychain.del(o)},this.encode=async(o,a,u)=>{this.isInitialized();const f=Cl(u),v=ls(a);if(Al(f)){const S=f.senderPublicKey,C=f.receiverPublicKey;o=await this.generateSharedKey(S,C)}const p=this.getSymKey(o),{type:w,senderPublicKey:I}=f;return g_({type:w,symKey:p,message:v,senderPublicKey:I})},this.decode=async(o,a,u)=>{this.isInitialized();const f=__(a,u);if(Al(f)){const v=f.receiverPublicKey,p=f.senderPublicKey;o=await this.generateSharedKey(v,p)}try{const v=this.getSymKey(o),p=v_({symKey:v,encoded:a});return vc(p)}catch(v){this.logger.error(`Failed to decode message from topic: '${o}', clientId: '${await this.getClientId()}'`),this.logger.error(v)}},this.getPayloadType=o=>{const a=Xs(o);return Ji(a.type)},this.getPayloadSenderPublicKey=o=>{const a=Xs(o);return a.senderPublicKey?nr(a.senderPublicKey,ir):void 0},this.core=e,this.logger=Je.generateChildLogger(t,this.name),this.keychain=i||new h3(this.core,this.logger)}get context(){return Je.getLoggerContext(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(nd)}catch{e=Ya(),await this.keychain.set(nd,e)}return $E(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}}class f3 extends Jb{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=BE,this.version=zE,this.initialized=!1,this.storagePrefix=Pn,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const i=await this.getRelayerMessages();typeof i<"u"&&(this.messages=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(i){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(i)}finally{this.initialized=!0}}},this.set=async(i,o)=>{this.isInitialized();const a=vi(o);let u=this.messages.get(i);return typeof u>"u"&&(u={}),typeof u[a]<"u"||(u[a]=o,this.messages.set(i,u),await this.persist()),a},this.get=i=>{this.isInitialized();let o=this.messages.get(i);return typeof o>"u"&&(o={}),o},this.has=(i,o)=>{this.isInitialized();const a=this.get(i),u=vi(o);return typeof a[u]<"u"},this.del=async i=>{this.isInitialized(),this.messages.delete(i),await this.persist()},this.logger=Je.generateChildLogger(e,this.name),this.core=t}get context(){return Je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,$l(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Fl(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}}class d3 extends Qb{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new Yt.exports.EventEmitter,this.name=VE,this.queue=new Map,this.publishTimeout=ye.toMiliseconds(ye.TEN_SECONDS),this.needsTransportRestart=!1,this.publish=async(i,o,a)=>{var u;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:i,message:o,opts:a}});try{const f=a?.ttl||KE,v=Xa(a),p=a?.prompt||!1,w=a?.tag||0,I=a?.id||Af().toString(),S={topic:i,message:o,opts:{ttl:f,relay:v,prompt:p,tag:w,id:I}},C=setTimeout(()=>this.queue.set(I,S),this.publishTimeout);try{await await es(this.rpcPublish(i,o,f,v,p,w,I),this.publishTimeout,"Failed to publish payload, please try again."),this.removeRequestFromQueue(I),this.relayer.events.emit(er.publish,S)}catch(R){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(u=a?.internal)!=null&&u.throwOnFailedPublish)throw this.removeRequestFromQueue(I),R;return}finally{clearTimeout(C)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:i,message:o,opts:a}})}catch(f){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(f),f}},this.on=(i,o)=>{this.events.on(i,o)},this.once=(i,o)=>{this.events.once(i,o)},this.off=(i,o)=>{this.events.off(i,o)},this.removeListener=(i,o)=>{this.events.removeListener(i,o)},this.relayer=e,this.logger=Je.generateChildLogger(t,this.name),this.registerEventListeners()}get context(){return Je.getLoggerContext(this.logger)}rpcPublish(e,t,i,o,a,u,f){var v,p,w,I;const S={method:Zs(o.protocol).publish,params:{topic:e,message:t,ttl:i,prompt:a,tag:u},id:f};return sr((v=S.params)==null?void 0:v.prompt)&&((p=S.params)==null||delete p.prompt),sr((w=S.params)==null?void 0:w.tag)&&((I=S.params)==null||delete I.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:S}),this.relayer.request(S)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:t,message:i,opts:o}=e;await this.publish(t,i,o)})}registerEventListeners(){this.relayer.core.heartbeat.on(wi.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(er.connection_stalled);return}this.checkQueue()}),this.relayer.on(er.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class p3{constructor(){this.map=new Map,this.set=(e,t)=>{const i=this.get(e);this.exists(e,t)||this.map.set(e,[...i,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const i=this.get(e);if(!this.exists(e,t))return;const o=i.filter(a=>a!==t);if(!o.length){this.map.delete(e);return}this.map.set(e,o)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var g3=Object.defineProperty,v3=Object.defineProperties,y3=Object.getOwnPropertyDescriptors,ad=Object.getOwnPropertySymbols,_3=Object.prototype.hasOwnProperty,b3=Object.prototype.propertyIsEnumerable,cd=(r,e,t)=>e in r?g3(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ys=(r,e)=>{for(var t in e||(e={}))_3.call(e,t)&&cd(r,t,e[t]);if(ad)for(var t of ad(e))b3.call(e,t)&&cd(r,t,e[t]);return r},Rc=(r,e)=>v3(r,y3(e));class m3 extends em{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new p3,this.events=new Yt.exports.EventEmitter,this.name=e3,this.version=t3,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Pn,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(i,o)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:o}});try{const a=Xa(o),u={topic:i,relay:a};this.pending.set(i,u);const f=await this.rpcSubscribe(i,a);return this.onSubscribe(f,u),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:o}}),f}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},this.unsubscribe=async(i,o)=>{await this.restartToComplete(),this.isInitialized(),typeof o?.id<"u"?await this.unsubscribeById(i,o.id,o):await this.unsubscribeByTopic(i,o)},this.isSubscribed=async i=>this.topics.includes(i)?!0:await new Promise((o,a)=>{const u=new ye.Watch;u.start(this.pendingSubscriptionWatchLabel);const f=setInterval(()=>{!this.pending.has(i)&&this.topics.includes(i)&&(clearInterval(f),u.stop(this.pendingSubscriptionWatchLabel),o(!0)),u.elapsed(this.pendingSubscriptionWatchLabel)>=r3&&(clearInterval(f),u.stop(this.pendingSubscriptionWatchLabel),a(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1),this.on=(i,o)=>{this.events.on(i,o)},this.once=(i,o)=>{this.events.once(i,o)},this.off=(i,o)=>{this.events.off(i,o)},this.removeListener=(i,o)=>{this.events.removeListener(i,o)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=Je.generateChildLogger(t,this.name),this.clientId=""}get context(){return Je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let i=!1;try{i=this.getSubscription(e).topic===t}catch{}return i}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const i=this.topicMap.get(e);await Promise.all(i.map(async o=>await this.unsubscribeById(e,o,t)))}async unsubscribeById(e,t,i){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}});try{const o=Xa(i);await this.rpcUnsubscribe(e,t,o);const a=At("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}})}catch(o){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(o),o}}async rpcSubscribe(e,t){const i={method:Zs(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{await await es(this.relayer.request(i),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(er.connection_stalled)}return vi(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,i={method:Zs(t.protocol).batchSubscribe,params:{topics:e.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await es(this.relayer.request(i),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(er.connection_stalled)}}rpcUnsubscribe(e,t,i){const o={method:Zs(i.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:o}),this.relayer.request(o)}onSubscribe(e,t){this.setSubscription(e,Rc(ys({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,ys({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,i){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,i),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t))}addSubscription(e,t){this.subscriptions.set(e,ys({},t)),this.topicMap.set(t.topic,e),this.events.emit(Kr.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:i}=he("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const i=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(i.topic,e),this.events.emit(Kr.deleted,Rc(ys({},i),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Kr.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t<e;t++){const i=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(i)}}this.events.emit(Kr.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:t}=he("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);Xr(t)&&this.onBatchSubscribe(t.map((i,o)=>Rc(ys({},e[o]),{id:i})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(wi.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(er.connect,async()=>{await this.onConnect()}),this.relayer.on(er.disconnect,()=>{this.onDisconnect()}),this.events.on(Kr.created,async e=>{const t=Kr.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(Kr.deleted,async e=>{const t=Kr.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var w3=Object.defineProperty,ud=Object.getOwnPropertySymbols,E3=Object.prototype.hasOwnProperty,D3=Object.prototype.propertyIsEnumerable,hd=(r,e,t)=>e in r?w3(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,S3=(r,e)=>{for(var t in e||(e={}))E3.call(e,t)&&hd(r,t,e[t]);if(ud)for(var t of ud(e))D3.call(e,t)&&hd(r,t,e[t]);return r};class x3 extends Xb{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Yt.exports.EventEmitter,this.name=GE,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,this.request=async t=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(t)}catch(i){throw this.logger.debug("Failed to Publish Request"),this.logger.error(i),i}},this.onPayloadHandler=t=>{this.onProviderPayload(t)},this.onConnectHandler=()=>{this.events.emit(er.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(er.error,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(ln.payload,this.onPayloadHandler),this.provider.on(ln.connect,this.onConnectHandler),this.provider.on(ln.disconnect,this.onDisconnectHandler),this.provider.on(ln.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?Je.generateChildLogger(e.logger,this.name):Je.pino(Je.getDefaultLoggerOptions({level:e.logger||kE})),this.messages=new f3(this.logger,e.core),this.subscriber=new m3(this,this.logger),this.publisher=new d3(this,this.logger),this.relayUrl=e?.relayUrl||sd,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${od}...`),await this.restartTransport(od)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},QE)}get context(){return Je.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,t,i){this.isInitialized(),await this.publisher.publish(e,t,i),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var i;this.isInitialized();let o=((i=this.subscriber.topicMap.get(e))==null?void 0:i[0])||"";if(o)return o;let a;const u=f=>{f.topic===e&&(this.subscriber.off(Kr.created,u),a())};return await Promise.all([new Promise(f=>{a=f,this.subscriber.on(Kr.created,u)}),new Promise(async f=>{o=await this.subscriber.subscribe(e,t),f()})]),o}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportClose(){this.transportExplicitlyClosed=!0,this.hasExperiencedNetworkDisruption&&this.connected?await es(this.provider.disconnect(),1e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.connected&&await this.provider.disconnect()}async transportOpen(e){if(this.transportExplicitlyClosed=!1,await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress){e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportClose(),await this.createProvider()),this.connectionAttemptInProgress=!0;try{await Promise.all([new Promise(t=>{if(!this.initialized)return t();this.subscriber.once(Kr.resubscribed,()=>{t()})}),new Promise(async(t,i)=>{try{await es(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(o){i(o);return}t()})])}catch(t){this.logger.error(t);const i=t;if(!this.isConnectionStalled(i.message))throw t;this.provider.events.emit(ln.disconnect)}finally{this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1}}}async restartTransport(e){await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await kl())throw new Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new hn(new cw(C_({sdkVersion:JE,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:i}=e;await this.messages.set(t,i)}async shouldIgnoreMessageEvent(e){const{topic:t,message:i}=e;if(!i||i.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${i}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const o=this.messages.has(t,i);return o&&this.logger.debug(`Ignoring duplicate message: ${i}`),o}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Sc(e)){if(!e.method.endsWith(WE))return;const t=e.params,{topic:i,message:o,publishedAt:a}=t.data,u={topic:i,message:o,publishedAt:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(S3({type:"event",event:t.id},u)),this.events.emit(t.id,u),await this.acknowledgePayload(e),await this.onMessageEvent(u)}else ao(e)&&this.events.emit(er.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(er.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=Dc(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(ln.payload,this.onPayloadHandler),this.provider.off(ln.connect,this.onConnectHandler),this.provider.off(ln.disconnect,this.onDisconnectHandler),this.provider.off(ln.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(er.connection_stalled,()=>{this.restartTransport().catch(t=>this.logger.error(t))});let e=await kl();w1(async t=>{this.initialized&&e!==t&&(e=t,t?await this.restartTransport().catch(i=>this.logger.error(i)):(this.hasExperiencedNetworkDisruption=!0,await this.transportClose().catch(i=>this.logger.error(i))))})}onProviderDisconnect(){this.events.emit(er.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(e=>this.logger.error(e))},ye.toMiliseconds(YE)))}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectionAttemptInProgress)return await new Promise(e=>{const t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var O3=Object.defineProperty,ld=Object.getOwnPropertySymbols,I3=Object.prototype.hasOwnProperty,P3=Object.prototype.propertyIsEnumerable,fd=(r,e,t)=>e in r?O3(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,dd=(r,e)=>{for(var t in e||(e={}))I3.call(e,t)&&fd(r,t,e[t]);if(ld)for(var t of ld(e))P3.call(e,t)&&fd(r,t,e[t]);return r};class uo extends Zb{constructor(e,t,i,o=Pn,a=void 0){super(e,t,i,o),this.core=e,this.logger=t,this.name=i,this.map=new Map,this.version=XE,this.cached=[],this.initialized=!1,this.storagePrefix=Pn,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(u=>{this.getKey&&u!==null&&!sr(u)?this.map.set(this.getKey(u),u):X_(u)?this.map.set(u.id,u):Z_(u)&&this.map.set(u.topic,u)}),this.cached=[],this.initialized=!0)},this.set=async(u,f)=>{this.isInitialized(),this.map.has(u)?await this.update(u,f):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:u,value:f}),this.map.set(u,f),await this.persist())},this.get=u=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:u}),this.getData(u)),this.getAll=u=>(this.isInitialized(),u?this.values.filter(f=>Object.keys(u).every(v=>uw(f[v],u[v]))):this.values),this.update=async(u,f)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:u,update:f});const v=dd(dd({},this.getData(u)),f);this.map.set(u,v),await this.persist()},this.delete=async(u,f)=>{this.isInitialized(),this.map.has(u)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:u,reason:f}),this.map.delete(u),await this.persist())},this.logger=Je.generateChildLogger(t,this.name),this.storagePrefix=o,this.getKey=a}get context(){return Je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){const{message:i}=he("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:t}=he("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}}class C3{constructor(e,t){this.core=e,this.logger=t,this.name=n3,this.version=i3,this.events=new Yt.exports,this.initialized=!1,this.storagePrefix=Pn,this.ignoredPayloadTypes=[kn],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:i})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...i])]},this.create=async()=>{this.isInitialized();const i=Ya(),o=await this.core.crypto.setSymKey(i),a=Br(ye.FIVE_MINUTES),u={protocol:id},f={topic:o,expiry:a,relay:u,active:!1},v=B_({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:i,relay:u});return await this.pairings.set(o,f),await this.core.relayer.subscribe(o),this.core.expirer.set(o,a),{topic:o,uri:v}},this.pair=async i=>{this.isInitialized(),this.isValidPair(i);const{topic:o,symKey:a,relay:u}=M_(i.uri);let f;if(this.pairings.keys.includes(o)&&(f=this.pairings.get(o),f.active))throw new Error(`Pairing already exists: ${o}. Please try again with a new connection URI.`);this.core.crypto.keychain.has(o)||(await this.core.crypto.setSymKey(a,o),await this.core.relayer.subscribe(o,{relay:u}));const v=Br(ye.FIVE_MINUTES),p={topic:o,relay:u,expiry:v,active:!1};return await this.pairings.set(o,p),this.core.expirer.set(o,v),i.activatePairing&&await this.activate({topic:o}),this.events.emit(vs.create,p),p},this.activate=async({topic:i})=>{this.isInitialized();const o=Br(ye.THIRTY_DAYS);await this.pairings.update(i,{active:!0,expiry:o}),this.core.expirer.set(i,o)},this.ping=async i=>{this.isInitialized(),await this.isValidPing(i);const{topic:o}=i;if(this.pairings.keys.includes(o)){const a=await this.sendRequest(o,"wc_pairingPing",{}),{done:u,resolve:f,reject:v}=yi();this.events.once(Ft("pairing_ping",a),({error:p})=>{p?v(p):f()}),await u()}},this.updateExpiry=async({topic:i,expiry:o})=>{this.isInitialized(),await this.pairings.update(i,{expiry:o})},this.updateMetadata=async({topic:i,metadata:o})=>{this.isInitialized(),await this.pairings.update(i,{peerMetadata:o})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:o}=i;this.pairings.keys.includes(o)&&(await this.sendRequest(o,"wc_pairingDelete",At("USER_DISCONNECTED")),await this.deletePairing(o))},this.sendRequest=async(i,o,a)=>{const u=Ei(o,a),f=await this.core.crypto.encode(i,u),v=gs[o].req;return this.core.history.set(i,u),this.core.relayer.publish(i,f,v),u.id},this.sendResult=async(i,o,a)=>{const u=Dc(i,a),f=await this.core.crypto.encode(o,u),v=await this.core.history.get(o,i),p=gs[v.request.method].res;await this.core.relayer.publish(o,f,p),await this.core.history.resolve(u)},this.sendError=async(i,o,a)=>{const u=oo(i,a),f=await this.core.crypto.encode(o,u),v=await this.core.history.get(o,i),p=gs[v.request.method]?gs[v.request.method].res:gs.unregistered_method.res;await this.core.relayer.publish(o,f,p),await this.core.history.resolve(u)},this.deletePairing=async(i,o)=>{await this.core.relayer.unsubscribe(i),await Promise.all([this.pairings.delete(i,At("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(i),o?Promise.resolve():this.core.expirer.del(i)])},this.cleanup=async()=>{const i=this.pairings.getAll().filter(o=>In(o.expiry));await Promise.all(i.map(o=>this.deletePairing(o.topic)))},this.onRelayEventRequest=i=>{const{topic:o,payload:a}=i;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(o,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(o,a);default:return this.onUnknownRpcMethodRequest(o,a)}},this.onRelayEventResponse=async i=>{const{topic:o,payload:a}=i,u=(await this.core.history.get(o,a.id)).request.method;switch(u){case"wc_pairingPing":return this.onPairingPingResponse(o,a);default:return this.onUnknownRpcMethodResponse(u)}},this.onPairingPingRequest=async(i,o)=>{const{id:a}=o;try{this.isValidPing({topic:i}),await this.sendResult(a,i,!0),this.events.emit(vs.ping,{id:a,topic:i})}catch(u){await this.sendError(a,i,u),this.logger.error(u)}},this.onPairingPingResponse=(i,o)=>{const{id:a}=o;setTimeout(()=>{un(o)?this.events.emit(Ft("pairing_ping",a),{}):zr(o)&&this.events.emit(Ft("pairing_ping",a),{error:o.error})},500)},this.onPairingDeleteRequest=async(i,o)=>{const{id:a}=o;try{this.isValidDisconnect({topic:i}),await this.deletePairing(i),this.events.emit(vs.delete,{id:a,topic:i})}catch(u){await this.sendError(a,i,u),this.logger.error(u)}},this.onUnknownRpcMethodRequest=async(i,o)=>{const{id:a,method:u}=o;try{if(this.registeredMethods.includes(u))return;const f=At("WC_METHOD_UNSUPPORTED",u);await this.sendError(a,i,f),this.logger.error(f)}catch(f){await this.sendError(a,i,f),this.logger.error(f)}},this.onUnknownRpcMethodResponse=i=>{this.registeredMethods.includes(i)||this.logger.error(At("WC_METHOD_UNSUPPORTED",i))},this.isValidPair=i=>{if(!gr(i)){const{message:o}=he("MISSING_OR_INVALID",`pair() params: ${i}`);throw new Error(o)}if(!Q_(i.uri)){const{message:o}=he("MISSING_OR_INVALID",`pair() uri: ${i.uri}`);throw new Error(o)}},this.isValidPing=async i=>{if(!gr(i)){const{message:a}=he("MISSING_OR_INVALID",`ping() params: ${i}`);throw new Error(a)}const{topic:o}=i;await this.isValidPairingTopic(o)},this.isValidDisconnect=async i=>{if(!gr(i)){const{message:a}=he("MISSING_OR_INVALID",`disconnect() params: ${i}`);throw new Error(a)}const{topic:o}=i;await this.isValidPairingTopic(o)},this.isValidPairingTopic=async i=>{if(!kt(i,!1)){const{message:o}=he("MISSING_OR_INVALID",`pairing topic should be a string: ${i}`);throw new Error(o)}if(!this.pairings.keys.includes(i)){const{message:o}=he("NO_MATCHING_KEY",`pairing topic doesn't exist: ${i}`);throw new Error(o)}if(In(this.pairings.get(i).expiry)){await this.deletePairing(i);const{message:o}=he("EXPIRED",`pairing topic: ${i}`);throw new Error(o)}},this.core=e,this.logger=Je.generateChildLogger(t,this.name),this.pairings=new uo(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Je.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(er.message,async e=>{const{topic:t,message:i}=e;if(!this.pairings.keys.includes(t)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i)))return;const o=await this.core.crypto.decode(t,i);try{Sc(o)?(this.core.history.set(t,o),this.onRelayEventRequest({topic:t,payload:o})):ao(o)&&(await this.core.history.resolve(o),await this.onRelayEventResponse({topic:t,payload:o}),this.core.history.delete(t,o.id))}catch(a){this.logger.error(a)}})}registerExpirerEvents(){this.core.expirer.on(Tr.expired,async e=>{const{topic:t}=Ul(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(vs.expire,{topic:t}))})}}class A3 extends Yb{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new Yt.exports.EventEmitter,this.name=s3,this.version=o3,this.cached=[],this.initialized=!1,this.storagePrefix=Pn,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.records.set(i.id,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(i,o,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:i,request:o,chainId:a}),this.records.has(o.id))return;const u={id:o.id,topic:i,request:{method:o.method,params:o.params||null},chainId:a,expiry:Br(ye.THIRTY_DAYS)};this.records.set(u.id,u),this.events.emit(Zr.created,u)},this.resolve=async i=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:i}),!this.records.has(i.id))return;const o=await this.getRecord(i.id);typeof o.response>"u"&&(o.response=zr(i)?{error:i.error}:{result:i.result},this.records.set(o.id,o),this.events.emit(Zr.updated,o))},this.get=async(i,o)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:i,id:o}),await this.getRecord(o)),this.delete=(i,o)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:o}),this.values.forEach(a=>{if(a.topic===i){if(typeof o<"u"&&a.id!==o)return;this.records.delete(a.id),this.events.emit(Zr.deleted,a)}})},this.exists=async(i,o)=>(this.isInitialized(),this.records.has(o)?(await this.getRecord(o)).topic===i:!1),this.on=(i,o)=>{this.events.on(i,o)},this.once=(i,o)=>{this.events.once(i,o)},this.off=(i,o)=>{this.events.off(i,o)},this.removeListener=(i,o)=>{this.events.removeListener(i,o)},this.logger=Je.generateChildLogger(t,this.name)}get context(){return Je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<"u")return;const i={topic:t.topic,request:Ei(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(i)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:i}=he("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Zr.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:t}=he("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Zr.created,e=>{const t=Zr.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(Zr.updated,e=>{const t=Zr.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(Zr.deleted,e=>{const t=Zr.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.core.heartbeat.on(wi.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{ye.toMiliseconds(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.delete(e.topic,e.id))})}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}}class T3 extends tm{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new Yt.exports.EventEmitter,this.name=a3,this.version=c3,this.cached=[],this.initialized=!1,this.storagePrefix=Pn,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.expirations.set(i.target,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=i=>{try{const o=this.formatTarget(i);return typeof this.getExpiration(o)<"u"}catch{return!1}},this.set=(i,o)=>{this.isInitialized();const a=this.formatTarget(i),u={target:a,expiry:o};this.expirations.set(a,u),this.checkExpiry(a,u),this.events.emit(Tr.created,{target:a,expiration:u})},this.get=i=>{this.isInitialized();const o=this.formatTarget(i);return this.getExpiration(o)},this.del=i=>{if(this.isInitialized(),this.has(i)){const o=this.formatTarget(i),a=this.getExpiration(o);this.expirations.delete(o),this.events.emit(Tr.deleted,{target:o,expiration:a})}},this.on=(i,o)=>{this.events.on(i,o)},this.once=(i,o)=>{this.events.once(i,o)},this.off=(i,o)=>{this.events.off(i,o)},this.removeListener=(i,o)=>{this.events.removeListener(i,o)},this.logger=Je.generateChildLogger(t,this.name)}get context(){return Je.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return A_(e);if(typeof e=="number")return T_(e);const{message:t}=he("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Tr.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:t}=he("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:i}=he("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}return t}checkExpiry(e,t){const{expiry:i}=t;ye.toMiliseconds(i)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(Tr.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(wi.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(Tr.created,e=>{const t=Tr.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Tr.expired,e=>{const t=Tr.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Tr.deleted,e=>{const t=Tr.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}}}class R3 extends rm{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=Ac,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async i=>{if(this.verifyDisabled||Qi()||!Xi())return;const o=this.getVerifyUrl(i?.verifyUrl);this.verifyUrl!==o&&this.removeIframe(),this.verifyUrl=o;try{await this.createIframe()}catch(a){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(a)}if(!this.initialized){this.removeIframe(),this.verifyUrl=Tc;try{await this.createIframe()}catch(a){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(a),this.verifyDisabled=!0}}},this.register=async i=>{this.initialized?this.sendPost(i.attestationId):(this.addToQueue(i.attestationId),await this.init())},this.resolve=async i=>{if(this.isDevEnv)return"";const o=this.getVerifyUrl(i?.verifyUrl);let a;try{a=await this.fetchAttestation(i.attestationId,o)}catch(u){this.logger.info(`failed to resolve attestation: ${i.attestationId} from url: ${o}`),this.logger.info(u),a=await this.fetchAttestation(i.attestationId,Tc)}return a},this.fetchAttestation=async(i,o)=>{this.logger.info(`resolving attestation: ${i} from url: ${o}`);const a=this.startAbortTimer(ye.ONE_SECOND*2),u=await fetch(`${o}/attestation/${i}`,{signal:this.abortController.signal});return clearTimeout(a),u.status===200?await u.json():void 0},this.addToQueue=i=>{this.queue.push(i)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(i=>this.sendPost(i)),this.queue=[])},this.sendPost=i=>{var o;try{if(!this.iframe)return;(o=this.iframe.contentWindow)==null||o.postMessage(i,"*"),this.logger.info(`postMessage sent: ${i} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let i;const o=a=>{a.data==="verify_ready"&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",o),i())};await Promise.race([new Promise(a=>{if(document.getElementById(Ac))return a();window.addEventListener("message",o);const u=document.createElement("iframe");u.id=Ac,u.src=`${this.verifyUrl}/${this.projectId}`,u.style.display="none",document.body.append(u),this.iframe=u,i=a}),new Promise((a,u)=>setTimeout(()=>{window.removeEventListener("message",o),u("verify iframe load timeout")},ye.toMiliseconds(ye.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=i=>{let o=i||Di;return u3.includes(o)||(this.logger.info(`verify url: ${o}, not included in trusted list, assigning default: ${Di}`),o=Di),o},this.logger=Je.generateChildLogger(t,this.name),this.verifyUrl=Di,this.abortController=new AbortController,this.isDevEnv=Ja()&&process.env.IS_VITEST}get context(){return Je.getLoggerContext(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),ye.toMiliseconds(e))}}var N3=Object.defineProperty,pd=Object.getOwnPropertySymbols,$3=Object.prototype.hasOwnProperty,F3=Object.prototype.propertyIsEnumerable,gd=(r,e,t)=>e in r?N3(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,vd=(r,e)=>{for(var t in e||(e={}))$3.call(e,t)&&gd(r,t,e[t]);if(pd)for(var t of pd(e))F3.call(e,t)&&gd(r,t,e[t]);return r};class Nc extends Wb{constructor(e){super(e),this.protocol=rd,this.version=FE,this.name=Cc,this.events=new Yt.exports.EventEmitter,this.initialized=!1,this.on=(i,o)=>this.events.on(i,o),this.once=(i,o)=>this.events.once(i,o),this.off=(i,o)=>this.events.off(i,o),this.removeListener=(i,o)=>this.events.removeListener(i,o),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||sd,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const t=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Je.pino(Je.getDefaultLoggerOptions({level:e?.logger||LE.logger}));this.logger=Je.generateChildLogger(t,this.name),this.heartbeat=new wi.HeartBeat,this.crypto=new l3(this,this.logger,e?.keychain),this.history=new A3(this,this.logger),this.expirer=new T3(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new X1(vd(vd({},UE),e?.storageOptions)),this.relayer=new x3({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new C3(this,this.logger),this.verify=new R3(this.projectId||"",this.logger)}static async init(e){const t=new Nc(e);await t.initialize();const i=await t.crypto.getClientId();return await t.storage.setItem(ZE,i),t}get context(){return Je.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const L3=Nc,yd="wc",_d=2,bd="client",$c=`${yd}@${_d}:${bd}:`,Fc={name:bd,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},md="WALLETCONNECT_DEEPLINK_CHOICE",U3="proposal",wd="Proposal expired",j3="session",ho=ye.SEVEN_DAYS,M3="engine",_s={wc_sessionPropose:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ye.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ye.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ye.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ye.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:ye.THIRTY_SECONDS,prompt:!1,tag:1115}}},Lc={min:ye.FIVE_MINUTES,max:ye.SEVEN_DAYS},fn={idle:"IDLE",active:"ACTIVE"},q3="request",H3=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var B3=Object.defineProperty,z3=Object.defineProperties,K3=Object.getOwnPropertyDescriptors,Ed=Object.getOwnPropertySymbols,V3=Object.prototype.hasOwnProperty,k3=Object.prototype.propertyIsEnumerable,Dd=(r,e,t)=>e in r?B3(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,vr=(r,e)=>{for(var t in e||(e={}))V3.call(e,t)&&Dd(r,t,e[t]);if(Ed)for(var t of Ed(e))k3.call(e,t)&&Dd(r,t,e[t]);return r},bs=(r,e)=>z3(r,K3(e));class G3 extends im{constructor(e){super(e),this.name=M3,this.events=new Yt.exports,this.initialized=!1,this.ignoredPayloadTypes=[kn],this.requestQueue={state:fn.idle,queue:[]},this.sessionRequestQueue={state:fn.idle,queue:[]},this.requestQueueDelay=ye.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(_s)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},ye.toMiliseconds(this.requestQueueDelay)))},this.connect=async t=>{await this.isInitialized();const i=bs(vr({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(i);const{pairingTopic:o,requiredNamespaces:a,optionalNamespaces:u,sessionProperties:f,relays:v}=i;let p=o,w,I=!1;if(p&&(I=this.client.core.pairing.pairings.get(p).active),!p||!I){const{topic:U,uri:x}=await this.client.core.pairing.create();p=U,w=x}const S=await this.client.core.crypto.generateKeyPair(),C=vr({requiredNamespaces:a,optionalNamespaces:u,relays:v??[{protocol:id}],proposer:{publicKey:S,metadata:this.client.metadata}},f&&{sessionProperties:f}),{reject:R,resolve:B,done:K}=yi(ye.FIVE_MINUTES,wd);if(this.events.once(Ft("session_connect"),async({error:U,session:x})=>{if(U)R(U);else if(x){x.self.publicKey=S;const T=bs(vr({},x),{requiredNamespaces:x.requiredNamespaces,optionalNamespaces:x.optionalNamespaces});await this.client.session.set(x.topic,T),await this.setExpiry(x.topic,x.expiry),p&&await this.client.core.pairing.updateMetadata({topic:p,metadata:x.peer.metadata}),B(T)}}),!p){const{message:U}=he("NO_MATCHING_KEY",`connect() pairing topic: ${p}`);throw new Error(U)}const se=await this.sendRequest({topic:p,method:"wc_sessionPropose",params:C}),$=Br(ye.FIVE_MINUTES);return await this.setProposal(se,vr({id:se,expiry:$},C)),{uri:w,approval:K}},this.pair=async t=>(await this.isInitialized(),await this.client.core.pairing.pair(t)),this.approve=async t=>{await this.isInitialized(),await this.isValidApprove(t);const{id:i,relayProtocol:o,namespaces:a,sessionProperties:u}=t,f=this.client.proposal.get(i);let{pairingTopic:v,proposer:p,requiredNamespaces:w,optionalNamespaces:I}=f;v=v||"",bi(w)||(w=k_(a,"approve()"));const S=await this.client.core.crypto.generateKeyPair(),C=p.publicKey,R=await this.client.core.crypto.generateSharedKey(S,C);v&&i&&(await this.client.core.pairing.updateMetadata({topic:v,metadata:p.metadata}),await this.sendResult({id:i,topic:v,result:{relay:{protocol:o??"irn"},responderPublicKey:S}}),await this.client.proposal.delete(i,At("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:v}));const B=vr({relay:{protocol:o??"irn"},namespaces:a,requiredNamespaces:w,optionalNamespaces:I,pairingTopic:v,controller:{publicKey:S,metadata:this.client.metadata},expiry:Br(ho)},u&&{sessionProperties:u});await this.client.core.relayer.subscribe(R),await this.sendRequest({topic:R,method:"wc_sessionSettle",params:B,throwOnFailedPublish:!0});const K=bs(vr({},B),{topic:R,pairingTopic:v,acknowledged:!1,self:B.controller,peer:{publicKey:p.publicKey,metadata:p.metadata},controller:S});return await this.client.session.set(R,K),await this.setExpiry(R,Br(ho)),{topic:R,acknowledged:()=>new Promise(se=>setTimeout(()=>se(this.client.session.get(R)),500))}},this.reject=async t=>{await this.isInitialized(),await this.isValidReject(t);const{id:i,reason:o}=t,{pairingTopic:a}=this.client.proposal.get(i);a&&(await this.sendError(i,a,o),await this.client.proposal.delete(i,At("USER_DISCONNECTED")))},this.update=async t=>{await this.isInitialized(),await this.isValidUpdate(t);const{topic:i,namespaces:o}=t,a=await this.sendRequest({topic:i,method:"wc_sessionUpdate",params:{namespaces:o}}),{done:u,resolve:f,reject:v}=yi();return this.events.once(Ft("session_update",a),({error:p})=>{p?v(p):f()}),await this.client.session.update(i,{namespaces:o}),{acknowledged:u}},this.extend=async t=>{await this.isInitialized(),await this.isValidExtend(t);const{topic:i}=t,o=await this.sendRequest({topic:i,method:"wc_sessionExtend",params:{}}),{done:a,resolve:u,reject:f}=yi();return this.events.once(Ft("session_extend",o),({error:v})=>{v?f(v):u()}),await this.setExpiry(i,Br(ho)),{acknowledged:a}},this.request=async t=>{await this.isInitialized(),await this.isValidRequest(t);const{chainId:i,request:o,topic:a,expiry:u}=t,f=Ec(),{done:v,resolve:p,reject:w}=yi(u,"Request expired. Please try again.");return this.events.once(Ft("session_request",f),({error:I,result:S})=>{I?w(I):p(S)}),await Promise.all([new Promise(async I=>{await this.sendRequest({clientRpcId:f,topic:a,method:"wc_sessionRequest",params:{request:o,chainId:i},expiry:u,throwOnFailedPublish:!0}).catch(S=>w(S)),this.client.events.emit("session_request_sent",{topic:a,request:o,chainId:i,id:f}),I()}),new Promise(async I=>{const S=await this.client.core.storage.getItem(md);R_({id:f,topic:a,wcDeepLink:S}),I()}),v()]).then(I=>I[2])},this.respond=async t=>{await this.isInitialized(),await this.isValidRespond(t);const{topic:i,response:o}=t,{id:a}=o;un(o)?await this.sendResult({id:a,topic:i,result:o.result,throwOnFailedPublish:!0}):zr(o)&&await this.sendError(a,i,o.error),this.cleanupAfterResponse(t)},this.ping=async t=>{await this.isInitialized(),await this.isValidPing(t);const{topic:i}=t;if(this.client.session.keys.includes(i)){const o=await this.sendRequest({topic:i,method:"wc_sessionPing",params:{}}),{done:a,resolve:u,reject:f}=yi();this.events.once(Ft("session_ping",o),({error:v})=>{v?f(v):u()}),await a()}else this.client.core.pairing.pairings.keys.includes(i)&&await this.client.core.pairing.ping({topic:i})},this.emit=async t=>{await this.isInitialized(),await this.isValidEmit(t);const{topic:i,event:o,chainId:a}=t;await this.sendRequest({topic:i,method:"wc_sessionEvent",params:{event:o,chainId:a}})},this.disconnect=async t=>{await this.isInitialized(),await this.isValidDisconnect(t);const{topic:i}=t;this.client.session.keys.includes(i)?(await this.sendRequest({topic:i,method:"wc_sessionDelete",params:At("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession(i)):await this.client.core.pairing.disconnect({topic:i})},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(i=>Y_(i,t))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const i=this.client.core.pairing.pairings.get(t.pairingTopic),o=this.client.core.pairing.pairings.getAll().filter(a=>{var u,f;return((u=a.peerMetadata)==null?void 0:u.url)&&((f=a.peerMetadata)==null?void 0:f.url)===t.peer.metadata.url&&a.topic&&a.topic!==i.topic});if(o.length===0)return;this.client.logger.info(`Cleaning up ${o.length} duplicate pairing(s)`),await Promise.all(o.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(i){this.client.logger.error(i)}},this.deleteSession=async(t,i)=>{const{self:o}=this.client.session.get(t);await this.client.core.relayer.unsubscribe(t),this.client.session.delete(t,At("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(t)&&await this.client.core.crypto.deleteSymKey(t),i||this.client.core.expirer.del(t),this.client.core.storage.removeItem(md).catch(a=>this.client.logger.warn(a))},this.deleteProposal=async(t,i)=>{await Promise.all([this.client.proposal.delete(t,At("USER_DISCONNECTED")),i?Promise.resolve():this.client.core.expirer.del(t)])},this.deletePendingSessionRequest=async(t,i,o=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,i),o?Promise.resolve():this.client.core.expirer.del(t)]),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==t),o&&(this.sessionRequestQueue.state=fn.idle)},this.setExpiry=async(t,i)=>{this.client.session.keys.includes(t)&&await this.client.session.update(t,{expiry:i}),this.client.core.expirer.set(t,i)},this.setProposal=async(t,i)=>{await this.client.proposal.set(t,i),this.client.core.expirer.set(t,i.expiry)},this.setPendingSessionRequest=async t=>{const i=_s.wc_sessionRequest.req.ttl,{id:o,topic:a,params:u,verifyContext:f}=t;await this.client.pendingRequest.set(o,{id:o,topic:a,params:u,verifyContext:f}),i&&this.client.core.expirer.set(o,Br(i))},this.sendRequest=async t=>{const{topic:i,method:o,params:a,expiry:u,relayRpcId:f,clientRpcId:v,throwOnFailedPublish:p}=t,w=Ei(o,a,v);if(Xi()&&H3.includes(o)){const C=vi(JSON.stringify(w));this.client.core.verify.register({attestationId:C})}const I=await this.client.core.crypto.encode(i,w),S=_s[o].req;return u&&(S.ttl=u),f&&(S.id=f),this.client.core.history.set(i,w),p?(S.internal=bs(vr({},S.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,I,S)):this.client.core.relayer.publish(i,I,S).catch(C=>this.client.logger.error(C)),w.id},this.sendResult=async t=>{const{id:i,topic:o,result:a,throwOnFailedPublish:u}=t,f=Dc(i,a),v=await this.client.core.crypto.encode(o,f),p=await this.client.core.history.get(o,i),w=_s[p.request.method].res;u?(w.internal=bs(vr({},w.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(o,v,w)):this.client.core.relayer.publish(o,v,w).catch(I=>this.client.logger.error(I)),await this.client.core.history.resolve(f)},this.sendError=async(t,i,o)=>{const a=oo(t,o),u=await this.client.core.crypto.encode(i,a),f=await this.client.core.history.get(i,t),v=_s[f.request.method].res;this.client.core.relayer.publish(i,u,v),await this.client.core.history.resolve(a)},this.cleanup=async()=>{const t=[],i=[];this.client.session.getAll().forEach(o=>{In(o.expiry)&&t.push(o.topic)}),this.client.proposal.getAll().forEach(o=>{In(o.expiry)&&i.push(o.id)}),await Promise.all([...t.map(o=>this.deleteSession(o)),...i.map(o=>this.deleteProposal(o))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===fn.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=fn.active;const t=this.requestQueue.queue.shift();if(t)try{this.processRequest(t),await new Promise(i=>setTimeout(i,300))}catch(i){this.client.logger.warn(i)}}this.requestQueue.state=fn.idle},this.processRequest=t=>{const{topic:i,payload:o}=t,a=o.method;switch(a){case"wc_sessionPropose":return this.onSessionProposeRequest(i,o);case"wc_sessionSettle":return this.onSessionSettleRequest(i,o);case"wc_sessionUpdate":return this.onSessionUpdateRequest(i,o);case"wc_sessionExtend":return this.onSessionExtendRequest(i,o);case"wc_sessionPing":return this.onSessionPingRequest(i,o);case"wc_sessionDelete":return this.onSessionDeleteRequest(i,o);case"wc_sessionRequest":return this.onSessionRequest(i,o);case"wc_sessionEvent":return this.onSessionEventRequest(i,o);default:return this.client.logger.info(`Unsupported request method ${a}`)}},this.onRelayEventResponse=async t=>{const{topic:i,payload:o}=t,a=(await this.client.core.history.get(i,o.id)).request.method;switch(a){case"wc_sessionPropose":return this.onSessionProposeResponse(i,o);case"wc_sessionSettle":return this.onSessionSettleResponse(i,o);case"wc_sessionUpdate":return this.onSessionUpdateResponse(i,o);case"wc_sessionExtend":return this.onSessionExtendResponse(i,o);case"wc_sessionPing":return this.onSessionPingResponse(i,o);case"wc_sessionRequest":return this.onSessionRequestResponse(i,o);default:return this.client.logger.info(`Unsupported response method ${a}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:i}=t,{message:o}=he("MISSING_OR_INVALID",`Decoded payload on topic ${i} is not identifiable as a JSON-RPC request or a response.`);throw new Error(o)},this.onSessionProposeRequest=async(t,i)=>{const{params:o,id:a}=i;try{this.isValidConnect(vr({},i.params));const u=Br(ye.FIVE_MINUTES),f=vr({id:a,pairingTopic:t,expiry:u},o);await this.setProposal(a,f);const v=vi(JSON.stringify(i)),p=await this.getVerifyContext(v,f.proposer.metadata);this.client.events.emit("session_proposal",{id:a,params:f,verifyContext:p})}catch(u){await this.sendError(a,t,u),this.client.logger.error(u)}},this.onSessionProposeResponse=async(t,i)=>{const{id:o}=i;if(un(i)){const{result:a}=i;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:a});const u=this.client.proposal.get(o);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:u});const f=u.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:f});const v=a.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:v});const p=await this.client.core.crypto.generateSharedKey(f,v);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:p});const w=await this.client.core.relayer.subscribe(p);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:w}),await this.client.core.pairing.activate({topic:t})}else zr(i)&&(await this.client.proposal.delete(o,At("USER_DISCONNECTED")),this.events.emit(Ft("session_connect"),{error:i.error}))},this.onSessionSettleRequest=async(t,i)=>{const{id:o,params:a}=i;try{this.isValidSessionSettleRequest(a);const{relay:u,controller:f,expiry:v,namespaces:p,requiredNamespaces:w,optionalNamespaces:I,sessionProperties:S,pairingTopic:C}=i.params,R=vr({topic:t,relay:u,expiry:v,namespaces:p,acknowledged:!0,pairingTopic:C,requiredNamespaces:w,optionalNamespaces:I,controller:f.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:f.publicKey,metadata:f.metadata}},S&&{sessionProperties:S});await this.sendResult({id:i.id,topic:t,result:!0}),this.events.emit(Ft("session_connect"),{session:R}),this.cleanupDuplicatePairings(R)}catch(u){await this.sendError(o,t,u),this.client.logger.error(u)}},this.onSessionSettleResponse=async(t,i)=>{const{id:o}=i;un(i)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(Ft("session_approve",o),{})):zr(i)&&(await this.client.session.delete(t,At("USER_DISCONNECTED")),this.events.emit(Ft("session_approve",o),{error:i.error}))},this.onSessionUpdateRequest=async(t,i)=>{const{params:o,id:a}=i;try{const u=`${t}_session_update`,f=ro.get(u);if(f&&this.isRequestOutOfSync(f,a)){this.client.logger.info(`Discarding out of sync request - ${a}`);return}this.isValidUpdate(vr({topic:t},o)),await this.client.session.update(t,{namespaces:o.namespaces}),await this.sendResult({id:a,topic:t,result:!0}),this.client.events.emit("session_update",{id:a,topic:t,params:o}),ro.set(u,a)}catch(u){await this.sendError(a,t,u),this.client.logger.error(u)}},this.isRequestOutOfSync=(t,i)=>parseInt(i.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,i)=>{const{id:o}=i;un(i)?this.events.emit(Ft("session_update",o),{}):zr(i)&&this.events.emit(Ft("session_update",o),{error:i.error})},this.onSessionExtendRequest=async(t,i)=>{const{id:o}=i;try{this.isValidExtend({topic:t}),await this.setExpiry(t,Br(ho)),await this.sendResult({id:o,topic:t,result:!0}),this.client.events.emit("session_extend",{id:o,topic:t})}catch(a){await this.sendError(o,t,a),this.client.logger.error(a)}},this.onSessionExtendResponse=(t,i)=>{const{id:o}=i;un(i)?this.events.emit(Ft("session_extend",o),{}):zr(i)&&this.events.emit(Ft("session_extend",o),{error:i.error})},this.onSessionPingRequest=async(t,i)=>{const{id:o}=i;try{this.isValidPing({topic:t}),await this.sendResult({id:o,topic:t,result:!0}),this.client.events.emit("session_ping",{id:o,topic:t})}catch(a){await this.sendError(o,t,a),this.client.logger.error(a)}},this.onSessionPingResponse=(t,i)=>{const{id:o}=i;setTimeout(()=>{un(i)?this.events.emit(Ft("session_ping",o),{}):zr(i)&&this.events.emit(Ft("session_ping",o),{error:i.error})},500)},this.onSessionDeleteRequest=async(t,i)=>{const{id:o}=i;try{this.isValidDisconnect({topic:t,reason:i.params}),await Promise.all([new Promise(a=>{this.client.core.relayer.once(er.publish,async()=>{a(await this.deleteSession(t))})}),this.sendResult({id:o,topic:t,result:!0})]),this.client.events.emit("session_delete",{id:o,topic:t})}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async(t,i)=>{const{id:o,params:a}=i;try{this.isValidRequest(vr({topic:t},a));const u=vi(JSON.stringify(Ei("wc_sessionRequest",a,o))),f=this.client.session.get(t),v=await this.getVerifyContext(u,f.peer.metadata),p={id:o,topic:t,params:a,verifyContext:v};await this.setPendingSessionRequest(p),this.addSessionRequestToSessionRequestQueue(p),this.processSessionRequestQueue()}catch(u){await this.sendError(o,t,u),this.client.logger.error(u)}},this.onSessionRequestResponse=(t,i)=>{const{id:o}=i;un(i)?this.events.emit(Ft("session_request",o),{result:i.result}):zr(i)&&this.events.emit(Ft("session_request",o),{error:i.error})},this.onSessionEventRequest=async(t,i)=>{const{id:o,params:a}=i;try{const u=`${t}_session_event_${a.event.name}`,f=ro.get(u);if(f&&this.isRequestOutOfSync(f,o)){this.client.logger.info(`Discarding out of sync request - ${o}`);return}this.isValidEmit(vr({topic:t},a)),this.client.events.emit("session_event",{id:o,topic:t,params:a}),ro.set(u,o)}catch(u){await this.sendError(o,t,u),this.client.logger.error(u)}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=fn.idle,this.processSessionRequestQueue()},ye.toMiliseconds(this.requestQueueDelay))},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===fn.active){this.client.logger.info("session request queue is already active.");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=fn.active,this.client.events.emit("session_request",t)}catch(i){this.client.logger.error(i)}},this.onPairingCreated=t=>{if(t.active)return;const i=this.client.proposal.getAll().find(o=>o.pairingTopic===t.topic);i&&this.onSessionProposeRequest(t.topic,Ei("wc_sessionPropose",{requiredNamespaces:i.requiredNamespaces,optionalNamespaces:i.optionalNamespaces,relays:i.relays,proposer:i.proposer},i.id))},this.isValidConnect=async t=>{if(!gr(t)){const{message:v}=he("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(v)}const{pairingTopic:i,requiredNamespaces:o,optionalNamespaces:a,sessionProperties:u,relays:f}=t;if(sr(i)||await this.isValidPairingTopic(i),!a1(f,!0)){const{message:v}=he("MISSING_OR_INVALID",`connect() relays: ${f}`);throw new Error(v)}!sr(o)&&bi(o)!==0&&this.validateNamespaces(o,"requiredNamespaces"),!sr(a)&&bi(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),sr(u)||this.validateSessionProps(u,"sessionProperties")},this.validateNamespaces=(t,i)=>{const o=o1(t,"connect()",i);if(o)throw new Error(o.message)},this.isValidApprove=async t=>{if(!gr(t))throw new Error(he("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:i,namespaces:o,relayProtocol:a,sessionProperties:u}=t;await this.isValidProposalId(i);const f=this.client.proposal.get(i),v=to(o,"approve()");if(v)throw new Error(v.message);const p=Kl(f.requiredNamespaces,o,"approve()");if(p)throw new Error(p.message);if(!kt(a,!0)){const{message:w}=he("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(w)}sr(u)||this.validateSessionProps(u,"sessionProperties")},this.isValidReject=async t=>{if(!gr(t)){const{message:a}=he("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(a)}const{id:i,reason:o}=t;if(await this.isValidProposalId(i),!u1(o)){const{message:a}=he("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(o)}`);throw new Error(a)}},this.isValidSessionSettleRequest=t=>{if(!gr(t)){const{message:p}=he("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(p)}const{relay:i,controller:o,namespaces:a,expiry:u}=t;if(!Bl(i)){const{message:p}=he("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(p)}const f=e1(o,"onSessionSettleRequest()");if(f)throw new Error(f.message);const v=to(a,"onSessionSettleRequest()");if(v)throw new Error(v.message);if(In(u)){const{message:p}=he("EXPIRED","onSessionSettleRequest()");throw new Error(p)}},this.isValidUpdate=async t=>{if(!gr(t)){const{message:v}=he("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(v)}const{topic:i,namespaces:o}=t;await this.isValidSessionTopic(i);const a=this.client.session.get(i),u=to(o,"update()");if(u)throw new Error(u.message);const f=Kl(a.requiredNamespaces,o,"update()");if(f)throw new Error(f.message)},this.isValidExtend=async t=>{if(!gr(t)){const{message:o}=he("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(o)}const{topic:i}=t;await this.isValidSessionTopic(i)},this.isValidRequest=async t=>{if(!gr(t)){const{message:v}=he("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(v)}const{topic:i,request:o,chainId:a,expiry:u}=t;await this.isValidSessionTopic(i);const{namespaces:f}=this.client.session.get(i);if(!zl(f,a)){const{message:v}=he("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(v)}if(!h1(o)){const{message:v}=he("MISSING_OR_INVALID",`request() ${JSON.stringify(o)}`);throw new Error(v)}if(!d1(f,a,o.method)){const{message:v}=he("MISSING_OR_INVALID",`request() method: ${o.method}`);throw new Error(v)}if(u&&!y1(u,Lc)){const{message:v}=he("MISSING_OR_INVALID",`request() expiry: ${u}. Expiry must be a number (in seconds) between ${Lc.min} and ${Lc.max}`);throw new Error(v)}},this.isValidRespond=async t=>{if(!gr(t)){const{message:a}=he("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(a)}const{topic:i,response:o}=t;if(await this.isValidSessionTopic(i),!l1(o)){const{message:a}=he("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(o)}`);throw new Error(a)}},this.isValidPing=async t=>{if(!gr(t)){const{message:o}=he("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(o)}const{topic:i}=t;await this.isValidSessionOrPairingTopic(i)},this.isValidEmit=async t=>{if(!gr(t)){const{message:f}=he("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(f)}const{topic:i,event:o,chainId:a}=t;await this.isValidSessionTopic(i);const{namespaces:u}=this.client.session.get(i);if(!zl(u,a)){const{message:f}=he("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(f)}if(!f1(o)){const{message:f}=he("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(f)}if(!p1(u,a,o.name)){const{message:f}=he("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(f)}},this.isValidDisconnect=async t=>{if(!gr(t)){const{message:o}=he("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(o)}const{topic:i}=t;await this.isValidSessionOrPairingTopic(i)},this.getVerifyContext=async(t,i)=>{const o={verified:{verifyUrl:i.verifyUrl||Di,validation:"UNKNOWN",origin:i.url||""}};try{const a=await this.client.core.verify.resolve({attestationId:t,verifyUrl:i.verifyUrl});a&&(o.verified.origin=a.origin,o.verified.isScam=a.isScam,o.verified.validation=a.origin===new URL(i.url).origin?"VALID":"INVALID")}catch(a){this.client.logger.info(a)}return this.client.logger.info(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(t,i)=>{Object.values(t).forEach(o=>{if(!kt(o,!1)){const{message:a}=he("MISSING_OR_INVALID",`${i} must be in Record<string, string> format. Received: ${JSON.stringify(o)}`);throw new Error(a)}})}}async isInitialized(){if(!this.initialized){const{message:e}=he("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(er.message,async e=>{const{topic:t,message:i}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(i)))return;const o=await this.client.core.crypto.decode(t,i);try{Sc(o)?(this.client.core.history.set(t,o),this.onRelayEventRequest({topic:t,payload:o})):ao(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:t,payload:o}),this.client.core.history.delete(t,o.id)):this.onRelayEventUnknownPayload({topic:t,payload:o})}catch(a){this.client.logger.error(a)}})}registerExpirerEvents(){this.client.core.expirer.on(Tr.expired,async e=>{const{topic:t,id:i}=Ul(e.target);if(i&&this.client.pendingRequest.keys.includes(i))return await this.deletePendingSessionRequest(i,he("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession(t,!0),this.client.events.emit("session_expire",{topic:t})):i&&(await this.deleteProposal(i,!0),this.client.events.emit("proposal_expire",{id:i}))})}registerPairingEvents(){this.client.core.pairing.events.on(vs.create,e=>this.onPairingCreated(e))}isValidPairingTopic(e){if(!kt(e,!1)){const{message:t}=he("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=he("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(In(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=he("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!kt(e,!1)){const{message:t}=he("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(!this.client.session.keys.includes(e)){const{message:t}=he("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(In(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:t}=he("EXPIRED",`session topic: ${e}`);throw new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(kt(e,!1)){const{message:t}=he("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}else{const{message:t}=he("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}async isValidProposalId(e){if(!c1(e)){const{message:t}=he("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=he("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(In(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:t}=he("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class W3 extends uo{constructor(e,t){super(e,t,U3,$c),this.core=e,this.logger=t}}class Y3 extends uo{constructor(e,t){super(e,t,j3,$c),this.core=e,this.logger=t}}class J3 extends uo{constructor(e,t){super(e,t,q3,$c,i=>i.id),this.core=e,this.logger=t}}class Uc extends nm{constructor(e){super(e),this.protocol=yd,this.version=_d,this.name=Fc.name,this.events=new Yt.exports.EventEmitter,this.on=(i,o)=>this.events.on(i,o),this.once=(i,o)=>this.events.once(i,o),this.off=(i,o)=>this.events.off(i,o),this.removeListener=(i,o)=>this.events.removeListener(i,o),this.removeAllListeners=i=>this.events.removeAllListeners(i),this.connect=async i=>{try{return await this.engine.connect(i)}catch(o){throw this.logger.error(o.message),o}},this.pair=async i=>{try{return await this.engine.pair(i)}catch(o){throw this.logger.error(o.message),o}},this.approve=async i=>{try{return await this.engine.approve(i)}catch(o){throw this.logger.error(o.message),o}},this.reject=async i=>{try{return await this.engine.reject(i)}catch(o){throw this.logger.error(o.message),o}},this.update=async i=>{try{return await this.engine.update(i)}catch(o){throw this.logger.error(o.message),o}},this.extend=async i=>{try{return await this.engine.extend(i)}catch(o){throw this.logger.error(o.message),o}},this.request=async i=>{try{return await this.engine.request(i)}catch(o){throw this.logger.error(o.message),o}},this.respond=async i=>{try{return await this.engine.respond(i)}catch(o){throw this.logger.error(o.message),o}},this.ping=async i=>{try{return await this.engine.ping(i)}catch(o){throw this.logger.error(o.message),o}},this.emit=async i=>{try{return await this.engine.emit(i)}catch(o){throw this.logger.error(o.message),o}},this.disconnect=async i=>{try{return await this.engine.disconnect(i)}catch(o){throw this.logger.error(o.message),o}},this.find=i=>{try{return this.engine.find(i)}catch(o){throw this.logger.error(o.message),o}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(i){throw this.logger.error(i.message),i}},this.name=e?.name||Fc.name,this.metadata=e?.metadata||x_();const t=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Je.pino(Je.getDefaultLoggerOptions({level:e?.logger||Fc.logger}));this.core=e?.core||new L3(e),this.logger=Je.generateChildLogger(t,this.name),this.session=new Y3(this.core,this.logger),this.proposal=new W3(this.core,this.logger),this.pendingRequest=new J3(this.core,this.logger),this.engine=new G3(this)}static async init(e){const t=new Uc(e);return await t.initialize(),t}get context(){return Je.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var jc={exports:{}};(function(r,e){var t=typeof self<"u"?self:Vt,i=function(){function a(){this.fetch=!1,this.DOMException=t.DOMException}return a.prototype=t,new a}();(function(a){(function(u){var f={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function v(m){return m&&DataView.prototype.isPrototypeOf(m)}if(f.arrayBuffer)var p=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],w=ArrayBuffer.isView||function(m){return m&&p.indexOf(Object.prototype.toString.call(m))>-1};function I(m){if(typeof m!="string"&&(m=String(m)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(m))throw new TypeError("Invalid character in header field name");return m.toLowerCase()}function S(m){return typeof m!="string"&&(m=String(m)),m}function C(m){var P={next:function(){var ee=m.shift();return{done:ee===void 0,value:ee}}};return f.iterable&&(P[Symbol.iterator]=function(){return P}),P}function R(m){this.map={},m instanceof R?m.forEach(function(P,ee){this.append(ee,P)},this):Array.isArray(m)?m.forEach(function(P){this.append(P[0],P[1])},this):m&&Object.getOwnPropertyNames(m).forEach(function(P){this.append(P,m[P])},this)}R.prototype.append=function(m,P){m=I(m),P=S(P);var ee=this.map[m];this.map[m]=ee?ee+", "+P:P},R.prototype.delete=function(m){delete this.map[I(m)]},R.prototype.get=function(m){return m=I(m),this.has(m)?this.map[m]:null},R.prototype.has=function(m){return this.map.hasOwnProperty(I(m))},R.prototype.set=function(m,P){this.map[I(m)]=S(P)},R.prototype.forEach=function(m,P){for(var ee in this.map)this.map.hasOwnProperty(ee)&&m.call(P,this.map[ee],ee,this)},R.prototype.keys=function(){var m=[];return this.forEach(function(P,ee){m.push(ee)}),C(m)},R.prototype.values=function(){var m=[];return this.forEach(function(P){m.push(P)}),C(m)},R.prototype.entries=function(){var m=[];return this.forEach(function(P,ee){m.push([ee,P])}),C(m)},f.iterable&&(R.prototype[Symbol.iterator]=R.prototype.entries);function B(m){if(m.bodyUsed)return Promise.reject(new TypeError("Already read"));m.bodyUsed=!0}function K(m){return new Promise(function(P,ee){m.onload=function(){P(m.result)},m.onerror=function(){ee(m.error)}})}function se(m){var P=new FileReader,ee=K(P);return P.readAsArrayBuffer(m),ee}function $(m){var P=new FileReader,ee=K(P);return P.readAsText(m),ee}function U(m){for(var P=new Uint8Array(m),ee=new Array(P.length),Q=0;Q<P.length;Q++)ee[Q]=String.fromCharCode(P[Q]);return ee.join("")}function x(m){if(m.slice)return m.slice(0);var P=new Uint8Array(m.byteLength);return P.set(new Uint8Array(m)),P.buffer}function T(){return this.bodyUsed=!1,this._initBody=function(m){this._bodyInit=m,m?typeof m=="string"?this._bodyText=m:f.blob&&Blob.prototype.isPrototypeOf(m)?this._bodyBlob=m:f.formData&&FormData.prototype.isPrototypeOf(m)?this._bodyFormData=m:f.searchParams&&URLSearchParams.prototype.isPrototypeOf(m)?this._bodyText=m.toString():f.arrayBuffer&&f.blob&&v(m)?(this._bodyArrayBuffer=x(m.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):f.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(m)||w(m))?this._bodyArrayBuffer=x(m):this._bodyText=m=Object.prototype.toString.call(m):this._bodyText="",this.headers.get("content-type")||(typeof m=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):f.searchParams&&URLSearchParams.prototype.isPrototypeOf(m)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},f.blob&&(this.blob=function(){var m=B(this);if(m)return m;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?B(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(se)}),this.text=function(){var m=B(this);if(m)return m;if(this._bodyBlob)return $(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(U(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},f.formData&&(this.formData=function(){return this.text().then(G)}),this.json=function(){return this.text().then(JSON.parse)},this}var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function h(m){var P=m.toUpperCase();return E.indexOf(P)>-1?P:m}function b(m,P){P=P||{};var ee=P.body;if(m instanceof b){if(m.bodyUsed)throw new TypeError("Already read");this.url=m.url,this.credentials=m.credentials,P.headers||(this.headers=new R(m.headers)),this.method=m.method,this.mode=m.mode,this.signal=m.signal,!ee&&m._bodyInit!=null&&(ee=m._bodyInit,m.bodyUsed=!0)}else this.url=String(m);if(this.credentials=P.credentials||this.credentials||"same-origin",(P.headers||!this.headers)&&(this.headers=new R(P.headers)),this.method=h(P.method||this.method||"GET"),this.mode=P.mode||this.mode||null,this.signal=P.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&ee)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(ee)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})};function G(m){var P=new FormData;return m.trim().split("&").forEach(function(ee){if(ee){var Q=ee.split("="),V=Q.shift().replace(/\+/g," "),k=Q.join("=").replace(/\+/g," ");P.append(decodeURIComponent(V),decodeURIComponent(k))}}),P}function Y(m){var P=new R,ee=m.replace(/\r?\n[\t ]+/g," ");return ee.split(/\r?\n/).forEach(function(Q){var V=Q.split(":"),k=V.shift().trim();if(k){var J=V.join(":").trim();P.append(k,J)}}),P}T.call(b.prototype);function ie(m,P){P||(P={}),this.type="default",this.status=P.status===void 0?200:P.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in P?P.statusText:"OK",this.headers=new R(P.headers),this.url=P.url||"",this._initBody(m)}T.call(ie.prototype),ie.prototype.clone=function(){return new ie(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new R(this.headers),url:this.url})},ie.error=function(){var m=new ie(null,{status:0,statusText:""});return m.type="error",m};var ce=[301,302,303,307,308];ie.redirect=function(m,P){if(ce.indexOf(P)===-1)throw new RangeError("Invalid status code");return new ie(null,{status:P,headers:{location:m}})},u.DOMException=a.DOMException;try{new u.DOMException}catch{u.DOMException=function(P,ee){this.message=P,this.name=ee;var Q=Error(P);this.stack=Q.stack},u.DOMException.prototype=Object.create(Error.prototype),u.DOMException.prototype.constructor=u.DOMException}function de(m,P){return new Promise(function(ee,Q){var V=new b(m,P);if(V.signal&&V.signal.aborted)return Q(new u.DOMException("Aborted","AbortError"));var k=new XMLHttpRequest;function J(){k.abort()}k.onload=function(){var re={status:k.status,statusText:k.statusText,headers:Y(k.getAllResponseHeaders()||"")};re.url="responseURL"in k?k.responseURL:re.headers.get("X-Request-URL");var me="response"in k?k.response:k.responseText;ee(new ie(me,re))},k.onerror=function(){Q(new TypeError("Network request failed"))},k.ontimeout=function(){Q(new TypeError("Network request failed"))},k.onabort=function(){Q(new u.DOMException("Aborted","AbortError"))},k.open(V.method,V.url,!0),V.credentials==="include"?k.withCredentials=!0:V.credentials==="omit"&&(k.withCredentials=!1),"responseType"in k&&f.blob&&(k.responseType="blob"),V.headers.forEach(function(re,me){k.setRequestHeader(me,re)}),V.signal&&(V.signal.addEventListener("abort",J),k.onreadystatechange=function(){k.readyState===4&&V.signal.removeEventListener("abort",J)}),k.send(typeof V._bodyInit>"u"?null:V._bodyInit)})}return de.polyfill=!0,a.fetch||(a.fetch=de,a.Headers=R,a.Request=b,a.Response=ie),u.Headers=R,u.Request=b,u.Response=ie,u.fetch=de,Object.defineProperty(u,"__esModule",{value:!0}),u})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var o=i;e=o.fetch,e.default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,r.exports=e})(jc,jc.exports);var Sd=qg(jc.exports);const xd={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Od=10;class Cn{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new Yt.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Rf(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,t){this.isAvailable||await this.register();try{const i=ls(e),a=await(await Sd(this.url,Object.assign(Object.assign({},xd),{body:i}))).json();this.onPayload({data:a})}catch(i){this.onError(e.id,i)}}async register(e=this.url){if(!Rf(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,o)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),o(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return o(new Error("HTTP connection is missing or invalid"));i()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=ls({id:1,jsonrpc:"2.0",method:"test",params:[]});await Sd(e,Object.assign(Object.assign({},xd),{body:t}))}this.onOpen()}catch(t){const i=this.parseError(t);throw this.events.emit("register_error",i),this.onClose(),i}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?vc(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),o=i.message||i.toString(),a=oo(e,o);this.events.emit("payload",a)}parseError(e,t=this.url){return xf(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Od&&this.events.setMaxListeners(Od)}}const Id="error",Q3="wss://relay.walletconnect.com",X3="wc",Z3="universal_provider",Pd=`${X3}@2:${Z3}:`,e2="https://rpc.walletconnect.com/v1/",dn={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var ms=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Mc={exports:{}};/**
72
+ ***************************************************************************** */var ah=function(t,e){return ah=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},ah(t,e)};function p_(t,e){ah(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ch=function(){return ch=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},ch.apply(this,arguments)};function g_(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function m_(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function w_(t,e){return function(r,n){e(r,n,t)}}function v_(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function y_(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{f(n.next(v))}catch(E){c(E)}}function h(v){try{f(n.throw(v))}catch(E){c(E)}}function f(v){v.done?o(v.value):i(v.value).then(l,h)}f((n=n.apply(t,e||[])).next())})}function b_(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(f){return function(v){return h([f,v])}}function h(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function __(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function E_(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function lh(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function $p(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function x_(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat($p(arguments[e]));return t}function C_(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function Go(t){return this instanceof Go?(this.v=t,this):new Go(t)}function I_(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(_){n[_]&&(i[_]=function(S){return new Promise(function(P,j){o.push([_,S,P,j])>1||l(_,S)})})}function l(_,S){try{h(n[_](S))}catch(P){E(o[0][3],P)}}function h(_){_.value instanceof Go?Promise.resolve(_.value.v).then(f,v):E(o[0][2],_)}function f(_){l("next",_)}function v(_){l("throw",_)}function E(_,S){_(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function S_(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:Go(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function O_(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof lh=="function"?lh(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(c){return new Promise(function(l,h){c=t[o](c),i(l,h,c.done,c.value)})}}function i(o,c,l,h){Promise.resolve(h).then(function(f){o({value:f,done:l})},c)}}function A_(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function D_(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function $_(t){return t&&t.__esModule?t:{default:t}}function P_(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function T_(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var R_=Object.freeze({__proto__:null,__extends:p_,get __assign(){return ch},__rest:g_,__decorate:m_,__param:w_,__metadata:v_,__awaiter:y_,__generator:b_,__createBinding:__,__exportStar:E_,__values:lh,__read:$p,__spread:x_,__spreadArrays:C_,__await:Go,__asyncGenerator:I_,__asyncDelegator:S_,__asyncValues:O_,__makeTemplateObject:A_,__importStar:D_,__importDefault:$_,__classPrivateFieldGet:P_,__classPrivateFieldSet:T_}),N_=Bi(R_),zn={},Pp;function L_(){if(Pp)return zn;Pp=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.isBrowserCryptoAvailable=zn.getSubtleCrypto=zn.getBrowerCrypto=void 0;function t(){return dr?.crypto||dr?.msCrypto||{}}zn.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}zn.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return zn.isBrowserCryptoAvailable=r,zn}var qn={},Tp;function M_(){if(Tp)return qn;Tp=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.isBrowser=qn.isNode=qn.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}qn.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}qn.isNode=e;function r(){return!t()&&!e()}return qn.isBrowser=r,qn}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=N_;e.__exportStar(L_(),t),e.__exportStar(M_(),t)})(Dp);function uh(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Rp(t=6){return BigInt(uh(t))}function Ls(t,e,r){return{id:r||uh(),jsonrpc:"2.0",method:t,params:e}}function hh(t,e){return{id:t,jsonrpc:"2.0",result:e}}function fc(t,e,r){return{id:t,jsonrpc:"2.0",error:U_(e,r)}}function U_(t,e){return typeof t>"u"?Op(Ip):(typeof t=="string"&&(t=Object.assign(Object.assign({},Op(oh)),{message:t})),typeof e<"u"&&(t.data=e),f_(t.code)&&(t=d_(t.code)),t)}class j_{}class F_ extends j_{constructor(){super()}}class B_ extends F_{constructor(e){super()}}const k_="^https?:",H_="^wss?:";function W_(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Np(t,e){const r=W_(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Lp(t){return Np(t,k_)}function Mp(t){return Np(t,H_)}function z_(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Up(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function fh(t){return Up(t)&&"method"in t}function dc(t){return Up(t)&&(Vn(t)||xn(t))}function Vn(t){return"result"in t}function xn(t){return"error"in t}class Kn extends B_{constructor(e){super(e),this.events=new yr.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(Ls(e.method,e.params||[],e.id||Rp().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(o){i(o)}this.events.on(`${e.id}`,o=>{xn(o)?i(o.error):n(o.result)});try{await this.connection.send(e,r)}catch(o){i(o)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),dc(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const q_=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),V_=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",jp=t=>t.split("?")[0],Fp=10,K_=q_();class G_{constructor(e){if(this.url=e,this.events=new yr.exports.EventEmitter,this.registering=!1,!Mp(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Vo(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!Mp(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=Dp.isReactNative()?void 0:{rejectUnauthorized:!z_(e)},o=new K_(e,[],i);V_()?o.onerror=c=>{const l=c;n(this.emitError(l.error))}:o.on("error",c=>{n(this.emitError(c))}),o.onopen=()=>{this.onOpen(o),r(o)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?ih(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=fc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return Ap(e,jp(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Fp&&this.events.setMaxListeners(Fp)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${jp(this.url)}`));return this.events.emit("register_error",r),r}}var dh={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,o=2,c=9007199254740991,l="[object Arguments]",h="[object Array]",f="[object AsyncFunction]",v="[object Boolean]",E="[object Date]",_="[object Error]",S="[object Function]",P="[object GeneratorFunction]",j="[object Map]",H="[object Number]",Z="[object Null]",N="[object Object]",L="[object Promise]",$="[object Proxy]",T="[object RegExp]",I="[object Set]",d="[object String]",x="[object Symbol]",J="[object Undefined]",W="[object WeakMap]",ee="[object ArrayBuffer]",de="[object DataView]",me="[object Float32Array]",O="[object Float64Array]",U="[object Int8Array]",ce="[object Int16Array]",le="[object Int32Array]",re="[object Uint8Array]",ne="[object Uint8ClampedArray]",ae="[object Uint16Array]",ie="[object Uint32Array]",Ae=/[\\^$.*+?()[\]{}|]/g,ge=/^\[object .+?Constructor\]$/,Be=/^(?:0|[1-9]\d*)$/,ye={};ye[me]=ye[O]=ye[U]=ye[ce]=ye[le]=ye[re]=ye[ne]=ye[ae]=ye[ie]=!0,ye[l]=ye[h]=ye[ee]=ye[v]=ye[de]=ye[E]=ye[_]=ye[S]=ye[j]=ye[H]=ye[N]=ye[T]=ye[I]=ye[d]=ye[W]=!1;var Me=typeof dr=="object"&&dr&&dr.Object===Object&&dr,Q=typeof self=="object"&&self&&self.Object===Object&&self,Y=Me||Q||Function("return this")(),z=e&&!e.nodeType&&e,w=z&&!0&&t&&!t.nodeType&&t,F=w&&w.exports===z,we=F&&Me.process,ve=function(){try{return we&&we.binding&&we.binding("util")}catch{}}(),Ue=ve&&ve.isTypedArray;function nt(R,q){for(var fe=-1,Ce=R==null?0:R.length,It=0,Qe=[];++fe<Ce;){var Tt=R[fe];q(Tt,fe,R)&&(Qe[It++]=Tt)}return Qe}function at(R,q){for(var fe=-1,Ce=q.length,It=R.length;++fe<Ce;)R[It+fe]=q[fe];return R}function Ge(R,q){for(var fe=-1,Ce=R==null?0:R.length;++fe<Ce;)if(q(R[fe],fe,R))return!0;return!1}function Dt(R,q){for(var fe=-1,Ce=Array(R);++fe<R;)Ce[fe]=q(fe);return Ce}function $t(R){return function(q){return R(q)}}function Je(R,q){return R.has(q)}function He(R,q){return R?.[q]}function ke(R){var q=-1,fe=Array(R.size);return R.forEach(function(Ce,It){fe[++q]=[It,Ce]}),fe}function Ke(R,q){return function(fe){return R(q(fe))}}function rt(R){var q=-1,fe=Array(R.size);return R.forEach(function(Ce){fe[++q]=Ce}),fe}var je=Array.prototype,Ze=Function.prototype,b=Object.prototype,p=Y["__core-js_shared__"],m=Ze.toString,D=b.hasOwnProperty,B=function(){var R=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return R?"Symbol(src)_1."+R:""}(),K=b.toString,X=RegExp("^"+m.call(D).replace(Ae,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ee=F?Y.Buffer:void 0,Re=Y.Symbol,st=Y.Uint8Array,ht=b.propertyIsEnumerable,lt=je.splice,Ur=Re?Re.toStringTag:void 0,ti=Object.getOwnPropertySymbols,Di=Ee?Ee.isBuffer:void 0,hs=Ke(Object.keys,Object),Wt=tn(Y,"DataView"),Mt=tn(Y,"Map"),zt=tn(Y,"Promise"),qt=tn(Y,"Set"),Bt=tn(Y,"WeakMap"),Ut=tn(Object,"create"),nr=ni(Wt),ir=ni(Mt),Vt=ni(zt),sr=ni(qt),Kt=ni(Bt),Jt=Re?Re.prototype:void 0,Gt=Jt?Jt.valueOf:void 0;function Pt(R){var q=-1,fe=R==null?0:R.length;for(this.clear();++q<fe;){var Ce=R[q];this.set(Ce[0],Ce[1])}}function or(){this.__data__=Ut?Ut(null):{},this.size=0}function ar(R){var q=this.has(R)&&delete this.__data__[R];return this.size-=q?1:0,q}function Zf(R){var q=this.__data__;if(Ut){var fe=q[R];return fe===n?void 0:fe}return D.call(q,R)?q[R]:void 0}function Yf(R){var q=this.__data__;return Ut?q[R]!==void 0:D.call(q,R)}function Jf(R,q){var fe=this.__data__;return this.size+=this.has(R)?0:1,fe[R]=Ut&&q===void 0?n:q,this}Pt.prototype.clear=or,Pt.prototype.delete=ar,Pt.prototype.get=Zf,Pt.prototype.has=Yf,Pt.prototype.set=Jf;function fn(R){var q=-1,fe=R==null?0:R.length;for(this.clear();++q<fe;){var Ce=R[q];this.set(Ce[0],Ce[1])}}function Qf(){this.__data__=[],this.size=0}function Xf(R){var q=this.__data__,fe=fs(q,R);if(fe<0)return!1;var Ce=q.length-1;return fe==Ce?q.pop():lt.call(q,fe,1),--this.size,!0}function e0(R){var q=this.__data__,fe=fs(q,R);return fe<0?void 0:q[fe][1]}function t0(R){return fs(this.__data__,R)>-1}function r0(R,q){var fe=this.__data__,Ce=fs(fe,R);return Ce<0?(++this.size,fe.push([R,q])):fe[Ce][1]=q,this}fn.prototype.clear=Qf,fn.prototype.delete=Xf,fn.prototype.get=e0,fn.prototype.has=t0,fn.prototype.set=r0;function ri(R){var q=-1,fe=R==null?0:R.length;for(this.clear();++q<fe;){var Ce=R[q];this.set(Ce[0],Ce[1])}}function io(){this.size=0,this.__data__={hash:new Pt,map:new(Mt||fn),string:new Pt}}function n0(R){var q=$i(this,R).delete(R);return this.size-=q?1:0,q}function so(R){return $i(this,R).get(R)}function i0(R){return $i(this,R).has(R)}function s0(R,q){var fe=$i(this,R),Ce=fe.size;return fe.set(R,q),this.size+=fe.size==Ce?0:1,this}ri.prototype.clear=io,ri.prototype.delete=n0,ri.prototype.get=so,ri.prototype.has=i0,ri.prototype.set=s0;function oo(R){var q=-1,fe=R==null?0:R.length;for(this.__data__=new ri;++q<fe;)this.add(R[q])}function ol(R){return this.__data__.set(R,n),this}function al(R){return this.__data__.has(R)}oo.prototype.add=oo.prototype.push=ol,oo.prototype.has=al;function In(R){var q=this.__data__=new fn(R);this.size=q.size}function o0(){this.__data__=new fn,this.size=0}function a0(R){var q=this.__data__,fe=q.delete(R);return this.size=q.size,fe}function c0(R){return this.__data__.get(R)}function l0(R){return this.__data__.has(R)}function cl(R,q){var fe=this.__data__;if(fe instanceof fn){var Ce=fe.__data__;if(!Mt||Ce.length<r-1)return Ce.push([R,q]),this.size=++fe.size,this;fe=this.__data__=new ri(Ce)}return fe.set(R,q),this.size=fe.size,this}In.prototype.clear=o0,In.prototype.delete=a0,In.prototype.get=c0,In.prototype.has=l0,In.prototype.set=cl;function ll(R,q){var fe=lo(R),Ce=!fe&&_l(R),It=!fe&&!Ce&&$a(R),Qe=!fe&&!Ce&&!It&&Cl(R),Tt=fe||Ce||It||Qe,cr=Tt?Dt(R.length,String):[],mt=cr.length;for(var St in R)(q||D.call(R,St))&&!(Tt&&(St=="length"||It&&(St=="offset"||St=="parent")||Qe&&(St=="buffer"||St=="byteLength"||St=="byteOffset")||ml(St,mt)))&&cr.push(St);return cr}function fs(R,q){for(var fe=R.length;fe--;)if(bl(R[fe][0],q))return fe;return-1}function Aa(R,q,fe){var Ce=q(R);return lo(R)?Ce:at(Ce,fe(R))}function ds(R){return R==null?R===void 0?J:Z:Ur&&Ur in Object(R)?pl(R):f0(R)}function Da(R){return gs(R)&&ds(R)==l}function ps(R,q,fe,Ce,It){return R===q?!0:R==null||q==null||!gs(R)&&!gs(q)?R!==R&&q!==q:ul(R,q,fe,Ce,ps,It)}function ul(R,q,fe,Ce,It,Qe){var Tt=lo(R),cr=lo(q),mt=Tt?h:Fn(R),St=cr?h:Fn(q);mt=mt==l?N:mt,St=St==l?N:St;var Qt=mt==N,Vr=St==N,lr=mt==St;if(lr&&$a(R)){if(!$a(q))return!1;Tt=!0,Qt=!1}if(lr&&!Qt)return Qe||(Qe=new In),Tt||Cl(R)?ao(R,q,fe,Ce,It,Qe):h0(R,q,mt,fe,Ce,It,Qe);if(!(fe&i)){var Rt=Qt&&D.call(R,"__wrapped__"),jr=Vr&&D.call(q,"__wrapped__");if(Rt||jr){var Sn=Rt?R.value():R,dn=jr?q.value():q;return Qe||(Qe=new In),It(Sn,dn,fe,Ce,Qe)}}return lr?(Qe||(Qe=new In),dl(R,q,fe,Ce,It,Qe)):!1}function u0(R){if(!xl(R)||vl(R))return!1;var q=uo(R)?X:ge;return q.test(ni(R))}function hl(R){return gs(R)&&El(R.length)&&!!ye[ds(R)]}function fl(R){if(!yl(R))return hs(R);var q=[];for(var fe in Object(R))D.call(R,fe)&&fe!="constructor"&&q.push(fe);return q}function ao(R,q,fe,Ce,It,Qe){var Tt=fe&i,cr=R.length,mt=q.length;if(cr!=mt&&!(Tt&&mt>cr))return!1;var St=Qe.get(R);if(St&&Qe.get(q))return St==q;var Qt=-1,Vr=!0,lr=fe&o?new oo:void 0;for(Qe.set(R,q),Qe.set(q,R);++Qt<cr;){var Rt=R[Qt],jr=q[Qt];if(Ce)var Sn=Tt?Ce(jr,Rt,Qt,q,R,Qe):Ce(Rt,jr,Qt,R,q,Qe);if(Sn!==void 0){if(Sn)continue;Vr=!1;break}if(lr){if(!Ge(q,function(dn,Bn){if(!Je(lr,Bn)&&(Rt===dn||It(Rt,dn,fe,Ce,Qe)))return lr.push(Bn)})){Vr=!1;break}}else if(!(Rt===jr||It(Rt,jr,fe,Ce,Qe))){Vr=!1;break}}return Qe.delete(R),Qe.delete(q),Vr}function h0(R,q,fe,Ce,It,Qe,Tt){switch(fe){case de:if(R.byteLength!=q.byteLength||R.byteOffset!=q.byteOffset)return!1;R=R.buffer,q=q.buffer;case ee:return!(R.byteLength!=q.byteLength||!Qe(new st(R),new st(q)));case v:case E:case H:return bl(+R,+q);case _:return R.name==q.name&&R.message==q.message;case T:case d:return R==q+"";case j:var cr=ke;case I:var mt=Ce&i;if(cr||(cr=rt),R.size!=q.size&&!mt)return!1;var St=Tt.get(R);if(St)return St==q;Ce|=o,Tt.set(R,q);var Qt=ao(cr(R),cr(q),Ce,It,Qe,Tt);return Tt.delete(R),Qt;case x:if(Gt)return Gt.call(R)==Gt.call(q)}return!1}function dl(R,q,fe,Ce,It,Qe){var Tt=fe&i,cr=co(R),mt=cr.length,St=co(q),Qt=St.length;if(mt!=Qt&&!Tt)return!1;for(var Vr=mt;Vr--;){var lr=cr[Vr];if(!(Tt?lr in q:D.call(q,lr)))return!1}var Rt=Qe.get(R);if(Rt&&Qe.get(q))return Rt==q;var jr=!0;Qe.set(R,q),Qe.set(q,R);for(var Sn=Tt;++Vr<mt;){lr=cr[Vr];var dn=R[lr],Bn=q[lr];if(Ce)var Pa=Tt?Ce(Bn,dn,lr,q,R,Qe):Ce(dn,Bn,lr,R,q,Qe);if(!(Pa===void 0?dn===Bn||It(dn,Bn,fe,Ce,Qe):Pa)){jr=!1;break}Sn||(Sn=lr=="constructor")}if(jr&&!Sn){var ms=R.constructor,wr=q.constructor;ms!=wr&&"constructor"in R&&"constructor"in q&&!(typeof ms=="function"&&ms instanceof ms&&typeof wr=="function"&&wr instanceof wr)&&(jr=!1)}return Qe.delete(R),Qe.delete(q),jr}function co(R){return Aa(R,g0,gl)}function $i(R,q){var fe=R.__data__;return wl(q)?fe[typeof q=="string"?"string":"hash"]:fe.map}function tn(R,q){var fe=He(R,q);return u0(fe)?fe:void 0}function pl(R){var q=D.call(R,Ur),fe=R[Ur];try{R[Ur]=void 0;var Ce=!0}catch{}var It=K.call(R);return Ce&&(q?R[Ur]=fe:delete R[Ur]),It}var gl=ti?function(R){return R==null?[]:(R=Object(R),nt(ti(R),function(q){return ht.call(R,q)}))}:Ct,Fn=ds;(Wt&&Fn(new Wt(new ArrayBuffer(1)))!=de||Mt&&Fn(new Mt)!=j||zt&&Fn(zt.resolve())!=L||qt&&Fn(new qt)!=I||Bt&&Fn(new Bt)!=W)&&(Fn=function(R){var q=ds(R),fe=q==N?R.constructor:void 0,Ce=fe?ni(fe):"";if(Ce)switch(Ce){case nr:return de;case ir:return j;case Vt:return L;case sr:return I;case Kt:return W}return q});function ml(R,q){return q=q??c,!!q&&(typeof R=="number"||Be.test(R))&&R>-1&&R%1==0&&R<q}function wl(R){var q=typeof R;return q=="string"||q=="number"||q=="symbol"||q=="boolean"?R!=="__proto__":R===null}function vl(R){return!!B&&B in R}function yl(R){var q=R&&R.constructor,fe=typeof q=="function"&&q.prototype||b;return R===fe}function f0(R){return K.call(R)}function ni(R){if(R!=null){try{return m.call(R)}catch{}try{return R+""}catch{}}return""}function bl(R,q){return R===q||R!==R&&q!==q}var _l=Da(function(){return arguments}())?Da:function(R){return gs(R)&&D.call(R,"callee")&&!ht.call(R,"callee")},lo=Array.isArray;function d0(R){return R!=null&&El(R.length)&&!uo(R)}var $a=Di||xt;function p0(R,q){return ps(R,q)}function uo(R){if(!xl(R))return!1;var q=ds(R);return q==S||q==P||q==f||q==$}function El(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=c}function xl(R){var q=typeof R;return R!=null&&(q=="object"||q=="function")}function gs(R){return R!=null&&typeof R=="object"}var Cl=Ue?$t(Ue):hl;function g0(R){return d0(R)?ll(R):fl(R)}function Ct(){return[]}function xt(){return!1}t.exports=p0})(dh,dh.exports);var Z_=dh.exports,Y_=Object.defineProperty,Bp=Object.getOwnPropertySymbols,J_=Object.prototype.hasOwnProperty,Q_=Object.prototype.propertyIsEnumerable,kp=(t,e,r)=>e in t?Y_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rr=(t,e)=>{for(var r in e||(e={}))J_.call(e,r)&&kp(t,r,e[r]);if(Bp)for(var r of Bp(e))Q_.call(e,r)&&kp(t,r,e[r]);return t};function X_(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,h=t.charAt(0),f=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function E(P){if(P instanceof Uint8Array||(ArrayBuffer.isView(P)?P=new Uint8Array(P.buffer,P.byteOffset,P.byteLength):Array.isArray(P)&&(P=Uint8Array.from(P))),!(P instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(P.length===0)return"";for(var j=0,H=0,Z=0,N=P.length;Z!==N&&P[Z]===0;)Z++,j++;for(var L=(N-Z)*v+1>>>0,$=new Uint8Array(L);Z!==N;){for(var T=P[Z],I=0,d=L-1;(T!==0||I<H)&&d!==-1;d--,I++)T+=256*$[d]>>>0,$[d]=T%l>>>0,T=T/l>>>0;if(T!==0)throw new Error("Non-zero carry");H=I,Z++}for(var x=L-H;x!==L&&$[x]===0;)x++;for(var J=h.repeat(j);x<L;++x)J+=t.charAt($[x]);return J}function _(P){if(typeof P!="string")throw new TypeError("Expected String");if(P.length===0)return new Uint8Array;var j=0;if(P[j]!==" "){for(var H=0,Z=0;P[j]===h;)H++,j++;for(var N=(P.length-j)*f+1>>>0,L=new Uint8Array(N);P[j];){var $=r[P.charCodeAt(j)];if($===255)return;for(var T=0,I=N-1;($!==0||T<Z)&&I!==-1;I--,T++)$+=l*L[I]>>>0,L[I]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");Z=T,j++}if(P[j]!==" "){for(var d=N-Z;d!==N&&L[d]===0;)d++;for(var x=new Uint8Array(H+(N-d)),J=H;d!==N;)x[J++]=L[d++];return x}}}function S(P){var j=_(P);if(j)return j;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:_,decode:S}}var e8=X_,t8=e8;const Hp=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},r8=t=>new TextEncoder().encode(t),n8=t=>new TextDecoder().decode(t);class i8{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class s8{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Wp(this,e)}}class o8{constructor(e){this.decoders=e}or(e){return Wp(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Wp=(t,e)=>new o8(Rr(Rr({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class a8{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new i8(e,r,n),this.decoder=new s8(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const pc=({name:t,prefix:e,encode:r,decode:n})=>new a8(t,e,r,n),Zo=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=t8(r,e);return pc({prefix:t,name:e,encode:n,decode:o=>Hp(i(o))})},c8=(t,e,r,n)=>{const i={};for(let v=0;v<e.length;++v)i[e[v]]=v;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,h=0,f=0;for(let v=0;v<o;++v){const E=i[t[v]];if(E===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|E,l+=r,l>=8&&(l-=8,c[f++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},l8=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let h=0;h<t.length;++h)for(l=l<<8|t[h],c+=8;c>r;)c-=r,o+=e[i&l>>c];if(c&&(o+=e[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},_r=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>pc({prefix:e,name:t,encode(i){return l8(i,n,r)},decode(i){return c8(i,n,r,t)}}),u8=pc({prefix:"\0",name:"identity",encode:t=>n8(t),decode:t=>r8(t)});var h8=Object.freeze({__proto__:null,identity:u8});const f8=_r({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var d8=Object.freeze({__proto__:null,base2:f8});const p8=_r({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var g8=Object.freeze({__proto__:null,base8:p8});const m8=Zo({prefix:"9",name:"base10",alphabet:"0123456789"});var w8=Object.freeze({__proto__:null,base10:m8});const v8=_r({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),y8=_r({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var b8=Object.freeze({__proto__:null,base16:v8,base16upper:y8});const _8=_r({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),E8=_r({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),x8=_r({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),C8=_r({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),I8=_r({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),S8=_r({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),O8=_r({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),A8=_r({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),D8=_r({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var $8=Object.freeze({__proto__:null,base32:_8,base32upper:E8,base32pad:x8,base32padupper:C8,base32hex:I8,base32hexupper:S8,base32hexpad:O8,base32hexpadupper:A8,base32z:D8});const P8=Zo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),T8=Zo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var R8=Object.freeze({__proto__:null,base36:P8,base36upper:T8});const N8=Zo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),L8=Zo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var M8=Object.freeze({__proto__:null,base58btc:N8,base58flickr:L8});const U8=_r({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),j8=_r({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),F8=_r({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),B8=_r({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var k8=Object.freeze({__proto__:null,base64:U8,base64pad:j8,base64url:F8,base64urlpad:B8});const zp=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),H8=zp.reduce((t,e,r)=>(t[r]=e,t),[]),W8=zp.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function z8(t){return t.reduce((e,r)=>(e+=H8[r],e),"")}function q8(t){const e=[];for(const r of t){const n=W8[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const V8=pc({prefix:"\u{1F680}",name:"base256emoji",encode:z8,decode:q8});var K8=Object.freeze({__proto__:null,base256emoji:V8}),G8=Vp,qp=128,Z8=127,Y8=~Z8,J8=Math.pow(2,31);function Vp(t,e,r){e=e||[],r=r||0;for(var n=r;t>=J8;)e[r++]=t&255|qp,t/=128;for(;t&Y8;)e[r++]=t&255|qp,t>>>=7;return e[r]=t|0,Vp.bytes=r-n+1,e}var Q8=ph,X8=128,Kp=127;function ph(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw ph.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&Kp)<<i:(c&Kp)*Math.pow(2,i),i+=7}while(c>=X8);return ph.bytes=o-n,r}var eE=Math.pow(2,7),tE=Math.pow(2,14),rE=Math.pow(2,21),nE=Math.pow(2,28),iE=Math.pow(2,35),sE=Math.pow(2,42),oE=Math.pow(2,49),aE=Math.pow(2,56),cE=Math.pow(2,63),lE=function(t){return t<eE?1:t<tE?2:t<rE?3:t<nE?4:t<iE?5:t<sE?6:t<oE?7:t<aE?8:t<cE?9:10},uE={encode:G8,decode:Q8,encodingLength:lE},Gp=uE;const Zp=(t,e,r=0)=>(Gp.encode(t,e,r),e),Yp=t=>Gp.encodingLength(t),gh=(t,e)=>{const r=e.byteLength,n=Yp(t),i=n+Yp(r),o=new Uint8Array(i+r);return Zp(t,o,0),Zp(r,o,n),o.set(e,i),new hE(t,r,e,o)};class hE{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Jp=({name:t,code:e,encode:r})=>new fE(t,e,r);class fE{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?gh(this.code,r):r.then(n=>gh(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Qp=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),dE=Jp({name:"sha2-256",code:18,encode:Qp("SHA-256")}),pE=Jp({name:"sha2-512",code:19,encode:Qp("SHA-512")});var gE=Object.freeze({__proto__:null,sha256:dE,sha512:pE});const Xp=0,mE="identity",eg=Hp;var wE=Object.freeze({__proto__:null,identity:{code:Xp,name:mE,encode:eg,digest:t=>gh(Xp,eg(t))}});new TextEncoder,new TextDecoder;const tg=Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr(Rr({},h8),d8),g8),w8),b8),$8),R8),M8),k8),K8);Rr(Rr({},gE),wE);function rg(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function vE(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?rg(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function ng(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const ig=ng("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),mh=ng("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=vE(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),yE=Rr({utf8:ig,"utf-8":ig,hex:tg.base16,latin1:mh,ascii:mh,binary:mh},tg);function bE(t,e="utf8"){const r=yE[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?rg(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}const sg="wc",_E=2,wh="core",gi=`${sg}@2:${wh}:`,EE={name:wh,logger:"error"},xE={database:":memory:"},CE="crypto",og="client_ed25519_seed",IE=Te.ONE_DAY,SE="keychain",OE="0.3",AE="messages",DE="0.3",$E=Te.SIX_HOURS,PE="publisher",ag="irn",TE="error",cg="wss://relay.walletconnect.com",lg="wss://relay.walletconnect.org",RE="relayer",Ir={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},NE="_subscription",Gn={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},LE=Te.ONE_SECOND,ME="2.10.4",UE=1e4,jE="0.3",FE="WALLETCONNECT_CLIENT_ID",Cn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},BE="subscription",kE="0.3",HE=Te.FIVE_SECONDS*1e3,WE="pairing",zE="0.3",Yo={wc_pairingDelete:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:0},res:{ttl:Te.ONE_DAY,prompt:!1,tag:0}}},Jo={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Rn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},qE="history",VE="0.3",KE="expirer",cn={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},GE="0.3",vh="verify-api",Ms="https://verify.walletconnect.com",yh="https://verify.walletconnect.org",ZE=[Ms,yh];class YE{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=SE,this.version=OE,this.initialized=!1,this.storagePrefix=gi,this.init=async()=>{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:o}=_e("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(o)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=pt.generateChildLogger(r,this.name)}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,j1(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?F1(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class JE{constructor(e,r,n){this.core=e,this.logger=r,this.name=CE,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),o=Cp(i);return xp(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=J5();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const o=await this.getClientSeed(),c=Cp(o),l=Uu();return await o_(l,i,IE,c)},this.generateSharedKey=(i,o,c)=>{this.isInitialized();const l=this.getPrivateKey(i),h=Q5(l,o);return this.setSymKey(h,c)},this.setSymKey=async(i,o)=>{this.isInitialized();const c=o||X5(i);return await this.keychain.set(c,i),c},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,o,c)=>{this.isInitialized();const l=R1(c),h=Vo(o);if(N1(l)){const _=l.senderPublicKey,S=l.receiverPublicKey;i=await this.generateSharedKey(_,S)}const f=this.getSymKey(i),{type:v,senderPublicKey:E}=l;return tb({type:v,symKey:f,message:h,senderPublicKey:E})},this.decode=async(i,o,c)=>{this.isInitialized();const l=ib(o,c);if(N1(l)){const h=l.receiverPublicKey,f=l.senderPublicKey;i=await this.generateSharedKey(h,f)}try{const h=this.getSymKey(i),f=rb({symKey:h,encoded:o});return ih(f)}catch(h){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(h)}},this.getPayloadType=i=>{const o=ic(i);return Po(o.type)},this.getPayloadSenderPublicKey=i=>{const o=ic(i);return o.senderPublicKey?Dr(o.senderPublicKey,$r):void 0},this.core=e,this.logger=pt.generateChildLogger(r,this.name),this.keychain=n||new YE(this.core,this.logger)}get context(){return pt.getLoggerContext(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(og)}catch{e=Uu(),await this.keychain.set(og,e)}return bE(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class QE extends M4{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=AE,this.version=DE,this.initialized=!1,this.storagePrefix=gi,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const o=Ds(i);let c=this.messages.get(n);return typeof c>"u"&&(c={}),typeof c[o]<"u"||(c[o]=i,this.messages.set(n,c),await this.persist()),o},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const o=this.get(n),c=Ds(i);return typeof o[c]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=pt.generateChildLogger(e,this.name),this.core=r}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,j1(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?F1(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class XE extends U4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new yr.exports.EventEmitter,this.name=PE,this.queue=new Map,this.publishTimeout=Te.toMiliseconds(Te.TEN_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,i,o)=>{var c;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}});try{const l=o?.ttl||$E,h=Bu(o),f=o?.prompt||!1,v=o?.tag||0,E=o?.id||Rp().toString(),_={topic:n,message:i,opts:{ttl:l,relay:h,prompt:f,tag:v,id:E}},S=setTimeout(()=>this.queue.set(E,_),this.publishTimeout);try{await await Lo(this.rpcPublish(n,i,l,h,f,v,E),this.publishTimeout,"Failed to publish payload, please try again."),this.removeRequestFromQueue(E),this.relayer.events.emit(Ir.publish,_)}catch(P){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(c=o?.internal)!=null&&c.throwOnFailedPublish)throw this.removeRequestFromQueue(E),P;return}finally{clearTimeout(S)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}})}catch(l){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(l),l}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=pt.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return pt.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,o,c,l){var h,f,v,E;const _={method:sc(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:o,tag:c},id:l};return Pr((h=_.params)==null?void 0:h.prompt)&&((f=_.params)==null||delete f.prompt),Pr((v=_.params)==null?void 0:v.tag)&&((E=_.params)==null||delete E.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:_}),this.relayer.request(_)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(Ns.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Ir.connection_stalled);return}this.checkQueue()}),this.relayer.on(Ir.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class e7{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(o=>o!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var t7=Object.defineProperty,r7=Object.defineProperties,n7=Object.getOwnPropertyDescriptors,ug=Object.getOwnPropertySymbols,i7=Object.prototype.hasOwnProperty,s7=Object.prototype.propertyIsEnumerable,hg=(t,e,r)=>e in t?t7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Qo=(t,e)=>{for(var r in e||(e={}))i7.call(e,r)&&hg(t,r,e[r]);if(ug)for(var r of ug(e))s7.call(e,r)&&hg(t,r,e[r]);return t},bh=(t,e)=>r7(t,n7(e));class o7 extends B4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new e7,this.events=new yr.exports.EventEmitter,this.name=BE,this.version=kE,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=gi,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const o=Bu(i),c={topic:n,relay:o};this.pending.set(n,c);const l=await this.rpcSubscribe(n,o);return this.onSubscribe(l,c),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),l}catch(o){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(o),o}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,o)=>{const c=new Te.Watch;c.start(this.pendingSubscriptionWatchLabel);const l=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(l),c.stop(this.pendingSubscriptionWatchLabel),i(!0)),c.elapsed(this.pendingSubscriptionWatchLabel)>=HE&&(clearInterval(l),c.stop(this.pendingSubscriptionWatchLabel),o(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=pt.generateChildLogger(r,this.name),this.clientId=""}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=Bu(n);await this.rpcUnsubscribe(e,r,i);const o=Yt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,o),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:sc(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Lo(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Ir.connection_stalled)}return Ds(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:sc(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await Lo(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Ir.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:sc(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,bh(Qo({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,Qo({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r))}addSubscription(e,r){this.subscriptions.set(e,Qo({},r)),this.topicMap.set(r.topic,e),this.events.emit(Cn.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(Cn.deleted,bh(Qo({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Cn.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<e;r++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(n)}}this.events.emit(Cn.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=_e("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);Tn(r)&&this.onBatchSubscribe(r.map((n,i)=>bh(Qo({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(Ns.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(Ir.connect,async()=>{await this.onConnect()}),this.relayer.on(Ir.disconnect,()=>{this.onDisconnect()}),this.events.on(Cn.created,async e=>{const r=Cn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Cn.deleted,async e=>{const r=Cn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var a7=Object.defineProperty,fg=Object.getOwnPropertySymbols,c7=Object.prototype.hasOwnProperty,l7=Object.prototype.propertyIsEnumerable,dg=(t,e,r)=>e in t?a7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u7=(t,e)=>{for(var r in e||(e={}))c7.call(e,r)&&dg(t,r,e[r]);if(fg)for(var r of fg(e))l7.call(e,r)&&dg(t,r,e[r]);return t};class h7 extends j4{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new yr.exports.EventEmitter,this.name=RE,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,this.request=async r=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(r)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.onPayloadHandler=r=>{this.onProviderPayload(r)},this.onConnectHandler=()=>{this.events.emit(Ir.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Ir.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Gn.payload,this.onPayloadHandler),this.provider.on(Gn.connect,this.onConnectHandler),this.provider.on(Gn.disconnect,this.onDisconnectHandler),this.provider.on(Gn.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?pt.generateChildLogger(e.logger,this.name):pt.pino(pt.getDefaultLoggerOptions({level:e.logger||TE})),this.messages=new QE(this.logger,e.core),this.subscriber=new o7(this,this.logger),this.publisher=new XE(this,this.logger),this.relayUrl=e?.relayUrl||cg,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${lg}...`),await this.restartTransport(lg)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},UE)}get context(){return pt.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"";if(i)return i;let o;const c=l=>{l.topic===e&&(this.subscriber.off(Cn.created,c),o())};return await Promise.all([new Promise(l=>{o=l,this.subscriber.on(Cn.created,c)}),new Promise(async l=>{i=await this.subscriber.subscribe(e,r),l()})]),i}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportClose(){this.transportExplicitlyClosed=!0,this.hasExperiencedNetworkDisruption&&this.connected?await Lo(this.provider.disconnect(),1e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.connected&&await this.provider.disconnect()}async transportOpen(e){if(this.transportExplicitlyClosed=!1,await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress){e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportClose(),await this.createProvider()),this.connectionAttemptInProgress=!0;try{await Promise.all([new Promise(r=>{if(!this.initialized)return r();this.subscriber.once(Cn.resubscribed,()=>{r()})}),new Promise(async(r,n)=>{try{await Lo(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(i){n(i);return}r()})])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.provider.events.emit(Gn.disconnect)}finally{this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1}}}async restartTransport(e){await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Y1())throw new Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Kn(new G_(gb({sdkVersion:ME,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),fh(e)){if(!e.method.endsWith(NE))return;const r=e.params,{topic:n,message:i,publishedAt:o}=r.data,c={topic:n,message:i,publishedAt:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(u7({type:"event",event:r.id},c)),this.events.emit(r.id,c),await this.acknowledgePayload(e),await this.onMessageEvent(c)}else dc(e)&&this.events.emit(Ir.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Ir.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=hh(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Gn.payload,this.onPayloadHandler),this.provider.off(Gn.connect,this.onConnectHandler),this.provider.off(Gn.disconnect,this.onDisconnectHandler),this.provider.off(Gn.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(Ir.connection_stalled,()=>{this.restartTransport().catch(r=>this.logger.error(r))});let e=await Y1();a6(async r=>{this.initialized&&e!==r&&(e=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportClose().catch(n=>this.logger.error(n))))})}onProviderDisconnect(){this.events.emit(Ir.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(e=>this.logger.error(e))},Te.toMiliseconds(LE)))}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectionAttemptInProgress)return await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var f7=Object.defineProperty,pg=Object.getOwnPropertySymbols,d7=Object.prototype.hasOwnProperty,p7=Object.prototype.propertyIsEnumerable,gg=(t,e,r)=>e in t?f7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mg=(t,e)=>{for(var r in e||(e={}))d7.call(e,r)&&gg(t,r,e[r]);if(pg)for(var r of pg(e))p7.call(e,r)&&gg(t,r,e[r]);return t};class gc extends F4{constructor(e,r,n,i=gi,o=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=jE,this.cached=[],this.initialized=!1,this.storagePrefix=gi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!Pr(c)?this.map.set(this.getKey(c),c):jb(c)?this.map.set(c.id,c):Fb(c)&&this.map.set(c.topic,c)}),this.cached=[],this.initialized=!0)},this.set=async(c,l)=>{this.isInitialized(),this.map.has(c)?await this.update(c,l):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:c,value:l}),this.map.set(c,l),await this.persist())},this.get=c=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:c}),this.getData(c)),this.getAll=c=>(this.isInitialized(),c?this.values.filter(l=>Object.keys(c).every(h=>Z_(l[h],c[h]))):this.values),this.update=async(c,l)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:c,update:l});const h=mg(mg({},this.getData(c)),l);this.map.set(c,h),await this.persist()},this.delete=async(c,l)=>{this.isInitialized(),this.map.has(c)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:c,reason:l}),this.map.delete(c),await this.persist())},this.logger=pt.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=o}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){const{message:n}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=_e("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class g7{constructor(e,r){this.core=e,this.logger=r,this.name=WE,this.version=zE,this.events=new yr.exports,this.initialized=!1,this.storagePrefix=gi,this.ignoredPayloadTypes=[zi],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();const n=Uu(),i=await this.core.crypto.setSymKey(n),o=En(Te.FIVE_MINUTES),c={protocol:ag},l={topic:i,expiry:o,relay:c,active:!1},h=Ab({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:c});return await this.pairings.set(i,l),await this.core.relayer.subscribe(i),this.core.expirer.set(i,o),{topic:i,uri:h}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:o,relay:c}=Ib(n.uri);let l;if(this.pairings.keys.includes(i)&&(l=this.pairings.get(i),l.active))throw new Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);this.core.crypto.keychain.has(i)||(await this.core.crypto.setSymKey(o,i),await this.core.relayer.subscribe(i,{relay:c}));const h=En(Te.FIVE_MINUTES),f={topic:i,relay:c,expiry:h,active:!1};return await this.pairings.set(i,f),this.core.expirer.set(i,h),n.activatePairing&&await this.activate({topic:i}),this.events.emit(Jo.create,f),f},this.activate=async({topic:n})=>{this.isInitialized();const i=En(Te.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:i}),this.core.expirer.set(n,i)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const o=await this.sendRequest(i,"wc_pairingPing",{}),{done:c,resolve:l,reject:h}=$s();this.events.once(tr("pairing_ping",o),({error:f})=>{f?h(f):l()}),await c()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",Yt("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,o)=>{const c=Ls(i,o),l=await this.core.crypto.encode(n,c),h=Yo[i].req;return this.core.history.set(n,c),this.core.relayer.publish(n,l,h),c.id},this.sendResult=async(n,i,o)=>{const c=hh(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),f=Yo[h.request.method].res;await this.core.relayer.publish(i,l,f),await this.core.history.resolve(c)},this.sendError=async(n,i,o)=>{const c=fc(n,o),l=await this.core.crypto.encode(i,c),h=await this.core.history.get(i,n),f=Yo[h.request.method]?Yo[h.request.method].res:Yo.unregistered_method.res;await this.core.relayer.publish(i,l,f),await this.core.history.resolve(c)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,Yt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>pi(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:o}=n;switch(o.method){case"wc_pairingPing":return this.onPairingPingRequest(i,o);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,o);default:return this.onUnknownRpcMethodRequest(i,o)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:o}=n,c=(await this.core.history.get(i,o.id)).request.method;switch(c){case"wc_pairingPing":return this.onPairingPingResponse(i,o);default:return this.onUnknownRpcMethodResponse(c)}},this.onPairingPingRequest=async(n,i)=>{const{id:o}=i;try{this.isValidPing({topic:n}),await this.sendResult(o,n,!0),this.events.emit(Jo.ping,{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onPairingPingResponse=(n,i)=>{const{id:o}=i;setTimeout(()=>{Vn(i)?this.events.emit(tr("pairing_ping",o),{}):xn(i)&&this.events.emit(tr("pairing_ping",o),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:o}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(Jo.delete,{id:o,topic:n})}catch(c){await this.sendError(o,n,c),this.logger.error(c)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:o,method:c}=i;try{if(this.registeredMethods.includes(c))return;const l=Yt("WC_METHOD_UNSUPPORTED",c);await this.sendError(o,n,l),this.logger.error(l)}catch(l){await this.sendError(o,n,l),this.logger.error(l)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(Yt("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!Wr(n)){const{message:i}=_e("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!Ub(n.uri)){const{message:i}=_e("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!Wr(n)){const{message:o}=_e("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Wr(n)){const{message:o}=_e("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!pr(n,!1)){const{message:i}=_e("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=_e("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(pi(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=_e("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=pt.generateChildLogger(r,this.name),this.pairings=new gc(this.core,this.logger,this.name,this.storagePrefix)}get context(){return pt.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Ir.message,async e=>{const{topic:r,message:n}=e;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);try{fh(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):dc(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.core.history.delete(r,i.id))}catch(o){this.logger.error(o)}})}registerExpirerEvents(){this.core.expirer.on(cn.expired,async e=>{const{topic:r}=k1(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(Jo.expire,{topic:r}))})}}class m7 extends L4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new yr.exports.EventEmitter,this.name=qE,this.version=VE,this.cached=[],this.initialized=!1,this.storagePrefix=gi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,o)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:o}),this.records.has(i.id))return;const c={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:o,expiry:En(Te.THIRTY_DAYS)};this.records.set(c.id,c),this.events.emit(Rn.created,c)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=xn(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(Rn.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(o=>{if(o.topic===n){if(typeof i<"u"&&o.id!==i)return;this.records.delete(o.id),this.events.emit(Rn.deleted,o)}})},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=pt.generateChildLogger(r,this.name)}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:Ls(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Rn.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=_e("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Rn.created,e=>{const r=Rn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Rn.updated,e=>{const r=Rn.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Rn.deleted,e=>{const r=Rn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.core.heartbeat.on(Ns.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{Te.toMiliseconds(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.delete(e.topic,e.id))})}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class w7 extends k4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new yr.exports.EventEmitter,this.name=KE,this.version=GE,this.cached=[],this.initialized=!1,this.storagePrefix=gi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const o=this.formatTarget(n),c={target:o,expiry:i};this.expirations.set(o,c),this.checkExpiry(o,c),this.events.emit(cn.created,{target:o,expiration:c})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),o=this.getExpiration(i);this.expirations.delete(i),this.events.emit(cn.deleted,{target:i,expiration:o})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=pt.generateChildLogger(r,this.name)}get context(){return pt.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return mb(e);if(typeof e=="number")return wb(e);const{message:r}=_e("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(cn.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=_e("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=_e("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;Te.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(cn.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Ns.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(cn.created,e=>{const r=cn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(cn.expired,e=>{const r=cn.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(cn.deleted,e=>{const r=cn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}}}class v7 extends H4{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.name=vh,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||To()||!Ro())return;const i=this.getVerifyUrl(n?.verifyUrl);this.verifyUrl!==i&&this.removeIframe(),this.verifyUrl=i;try{await this.createIframe()}catch(o){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(o)}if(!this.initialized){this.removeIframe(),this.verifyUrl=yh;try{await this.createIframe()}catch(o){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(o),this.verifyDisabled=!0}}},this.register=async n=>{this.initialized?this.sendPost(n.attestationId):(this.addToQueue(n.attestationId),await this.init())},this.resolve=async n=>{if(this.isDevEnv)return"";const i=this.getVerifyUrl(n?.verifyUrl);let o;try{o=await this.fetchAttestation(n.attestationId,i)}catch(c){this.logger.info(`failed to resolve attestation: ${n.attestationId} from url: ${i}`),this.logger.info(c),o=await this.fetchAttestation(n.attestationId,yh)}return o},this.fetchAttestation=async(n,i)=>{this.logger.info(`resolving attestation: ${n} from url: ${i}`);const o=this.startAbortTimer(Te.ONE_SECOND*2),c=await fetch(`${i}/attestation/${n}`,{signal:this.abortController.signal});return clearTimeout(o),c.status===200?await c.json():void 0},this.addToQueue=n=>{this.queue.push(n)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(n=>this.sendPost(n)),this.queue=[])},this.sendPost=n=>{var i;try{if(!this.iframe)return;(i=this.iframe.contentWindow)==null||i.postMessage(n,"*"),this.logger.info(`postMessage sent: ${n} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let n;const i=o=>{o.data==="verify_ready"&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",i),n())};await Promise.race([new Promise(o=>{if(document.getElementById(vh))return o();window.addEventListener("message",i);const c=document.createElement("iframe");c.id=vh,c.src=`${this.verifyUrl}/${this.projectId}`,c.style.display="none",document.body.append(c),this.iframe=c,n=o}),new Promise((o,c)=>setTimeout(()=>{window.removeEventListener("message",i),c("verify iframe load timeout")},Te.toMiliseconds(Te.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=n=>{let i=n||Ms;return ZE.includes(i)||(this.logger.info(`verify url: ${i}, not included in trusted list, assigning default: ${Ms}`),i=Ms),i},this.logger=pt.generateChildLogger(r,this.name),this.verifyUrl=Ms,this.abortController=new AbortController,this.isDevEnv=ju()&&process.env.IS_VITEST}get context(){return pt.getLoggerContext(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),Te.toMiliseconds(e))}}var y7=Object.defineProperty,wg=Object.getOwnPropertySymbols,b7=Object.prototype.hasOwnProperty,_7=Object.prototype.propertyIsEnumerable,vg=(t,e,r)=>e in t?y7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yg=(t,e)=>{for(var r in e||(e={}))b7.call(e,r)&&vg(t,r,e[r]);if(wg)for(var r of wg(e))_7.call(e,r)&&vg(t,r,e[r]);return t};class _h extends N4{constructor(e){super(e),this.protocol=sg,this.version=_E,this.name=wh,this.events=new yr.exports.EventEmitter,this.initialized=!1,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||cg,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||EE.logger}));this.logger=pt.generateChildLogger(r,this.name),this.heartbeat=new Ns.HeartBeat,this.crypto=new JE(this,this.logger,e?.keychain),this.history=new m7(this,this.logger),this.expirer=new w7(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new j6(yg(yg({},xE),e?.storageOptions)),this.relayer=new h7({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new g7(this,this.logger),this.verify=new v7(this.projectId||"",this.logger)}static async init(e){const r=new _h(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(FE,n),r}get context(){return pt.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const E7=_h,bg="wc",_g=2,Eg="client",Eh=`${bg}@${_g}:${Eg}:`,xh={name:Eg,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},xg="WALLETCONNECT_DEEPLINK_CHOICE",x7="proposal",Cg="Proposal expired",C7="session",mc=Te.SEVEN_DAYS,I7="engine",Xo={wc_sessionPropose:{req:{ttl:Te.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Te.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Te.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Te.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Te.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Te.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:Te.THIRTY_SECONDS,prompt:!1,tag:1115}}},Ch={min:Te.FIVE_MINUTES,max:Te.SEVEN_DAYS},Zn={idle:"IDLE",active:"ACTIVE"},S7="request",O7=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var A7=Object.defineProperty,D7=Object.defineProperties,$7=Object.getOwnPropertyDescriptors,Ig=Object.getOwnPropertySymbols,P7=Object.prototype.hasOwnProperty,T7=Object.prototype.propertyIsEnumerable,Sg=(t,e,r)=>e in t?A7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zr=(t,e)=>{for(var r in e||(e={}))P7.call(e,r)&&Sg(t,r,e[r]);if(Ig)for(var r of Ig(e))T7.call(e,r)&&Sg(t,r,e[r]);return t},ea=(t,e)=>D7(t,$7(e));class R7 extends z4{constructor(e){super(e),this.name=I7,this.events=new yr.exports,this.initialized=!1,this.ignoredPayloadTypes=[zi],this.requestQueue={state:Zn.idle,queue:[]},this.sessionRequestQueue={state:Zn.idle,queue:[]},this.requestQueueDelay=Te.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Xo)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Te.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const n=ea(zr({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:o,optionalNamespaces:c,sessionProperties:l,relays:h}=n;let f=i,v,E=!1;if(f&&(E=this.client.core.pairing.pairings.get(f).active),!f||!E){const{topic:L,uri:$}=await this.client.core.pairing.create();f=L,v=$}const _=await this.client.core.crypto.generateKeyPair(),S=zr({requiredNamespaces:o,optionalNamespaces:c,relays:h??[{protocol:ag}],proposer:{publicKey:_,metadata:this.client.metadata}},l&&{sessionProperties:l}),{reject:P,resolve:j,done:H}=$s(Te.FIVE_MINUTES,Cg);if(this.events.once(tr("session_connect"),async({error:L,session:$})=>{if(L)P(L);else if($){$.self.publicKey=_;const T=ea(zr({},$),{requiredNamespaces:$.requiredNamespaces,optionalNamespaces:$.optionalNamespaces});await this.client.session.set($.topic,T),await this.setExpiry($.topic,$.expiry),f&&await this.client.core.pairing.updateMetadata({topic:f,metadata:$.peer.metadata}),j(T)}}),!f){const{message:L}=_e("NO_MATCHING_KEY",`connect() pairing topic: ${f}`);throw new Error(L)}const Z=await this.sendRequest({topic:f,method:"wc_sessionPropose",params:S}),N=En(Te.FIVE_MINUTES);return await this.setProposal(Z,zr({id:Z,expiry:N},S)),{uri:v,approval:H}},this.pair=async r=>(await this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{await this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:i,namespaces:o,sessionProperties:c}=r,l=this.client.proposal.get(n);let{pairingTopic:h,proposer:f,requiredNamespaces:v,optionalNamespaces:E}=l;h=h||"",Ts(v)||(v=Tb(o,"approve()"));const _=await this.client.core.crypto.generateKeyPair(),S=f.publicKey,P=await this.client.core.crypto.generateSharedKey(_,S);h&&n&&(await this.client.core.pairing.updateMetadata({topic:h,metadata:f.metadata}),await this.sendResult({id:n,topic:h,result:{relay:{protocol:i??"irn"},responderPublicKey:_}}),await this.client.proposal.delete(n,Yt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:h}));const j=zr({relay:{protocol:i??"irn"},namespaces:o,requiredNamespaces:v,optionalNamespaces:E,pairingTopic:h,controller:{publicKey:_,metadata:this.client.metadata},expiry:En(mc)},c&&{sessionProperties:c});await this.client.core.relayer.subscribe(P),await this.sendRequest({topic:P,method:"wc_sessionSettle",params:j,throwOnFailedPublish:!0});const H=ea(zr({},j),{topic:P,pairingTopic:h,acknowledged:!1,self:j.controller,peer:{publicKey:f.publicKey,metadata:f.metadata},controller:_});return await this.client.session.set(P,H),await this.setExpiry(P,En(mc)),{topic:P,acknowledged:()=>new Promise(Z=>setTimeout(()=>Z(this.client.session.get(P)),500))}},this.reject=async r=>{await this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:o}=this.client.proposal.get(n);o&&(await this.sendError(n,o,i),await this.client.proposal.delete(n,Yt("USER_DISCONNECTED")))},this.update=async r=>{await this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,o=await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i}}),{done:c,resolve:l,reject:h}=$s();return this.events.once(tr("session_update",o),({error:f})=>{f?h(f):l()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:c}},this.extend=async r=>{await this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest({topic:n,method:"wc_sessionExtend",params:{}}),{done:o,resolve:c,reject:l}=$s();return this.events.once(tr("session_extend",i),({error:h})=>{h?l(h):c()}),await this.setExpiry(n,En(mc)),{acknowledged:o}},this.request=async r=>{await this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:o,expiry:c}=r,l=uh(),{done:h,resolve:f,reject:v}=$s(c,"Request expired. Please try again.");return this.events.once(tr("session_request",l),({error:E,result:_})=>{E?v(E):f(_)}),await Promise.all([new Promise(async E=>{await this.sendRequest({clientRpcId:l,topic:o,method:"wc_sessionRequest",params:{request:i,chainId:n},expiry:c,throwOnFailedPublish:!0}).catch(_=>v(_)),this.client.events.emit("session_request_sent",{topic:o,request:i,chainId:n,id:l}),E()}),new Promise(async E=>{const _=await this.client.core.storage.getItem(xg);vb({id:l,topic:o,wcDeepLink:_}),E()}),h()]).then(E=>E[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:o}=i;Vn(i)?await this.sendResult({id:o,topic:n,result:i.result,throwOnFailedPublish:!0}):xn(i)&&await this.sendError(o,n,i.error),this.cleanupAfterResponse(r)},this.ping=async r=>{await this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=await this.sendRequest({topic:n,method:"wc_sessionPing",params:{}}),{done:o,resolve:c,reject:l}=$s();this.events.once(tr("session_ping",i),({error:h})=>{h?l(h):c()}),await o()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{await this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:o}=r;await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:o}})},this.disconnect=async r=>{await this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest({topic:n,method:"wc_sessionDelete",params:Yt("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>Lb(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(o=>{var c,l;return((c=o.peerMetadata)==null?void 0:c.url)&&((l=o.peerMetadata)==null?void 0:l.url)===r.peer.metadata.url&&o.topic&&o.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(o=>this.client.core.pairing.disconnect({topic:o.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),this.client.session.delete(r,Yt("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(i.publicKey)&&await this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(xg).catch(o=>this.client.logger.warn(o))},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,Yt("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(o=>o.id!==r),i&&(this.sessionRequestQueue.state=Zn.idle)},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=Xo.wc_sessionRequest.req.ttl,{id:i,topic:o,params:c,verifyContext:l}=r;await this.client.pendingRequest.set(i,{id:i,topic:o,params:c,verifyContext:l}),n&&this.client.core.expirer.set(i,En(n))},this.sendRequest=async r=>{const{topic:n,method:i,params:o,expiry:c,relayRpcId:l,clientRpcId:h,throwOnFailedPublish:f}=r,v=Ls(i,o,h);if(Ro()&&O7.includes(i)){const S=Ds(JSON.stringify(v));this.client.core.verify.register({attestationId:S})}const E=await this.client.core.crypto.encode(n,v),_=Xo[i].req;return c&&(_.ttl=c),l&&(_.id=l),this.client.core.history.set(n,v),f?(_.internal=ea(zr({},_.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,E,_)):this.client.core.relayer.publish(n,E,_).catch(S=>this.client.logger.error(S)),v.id},this.sendResult=async r=>{const{id:n,topic:i,result:o,throwOnFailedPublish:c}=r,l=hh(n,o),h=await this.client.core.crypto.encode(i,l),f=await this.client.core.history.get(i,n),v=Xo[f.request.method].res;c?(v.internal=ea(zr({},v.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,h,v)):this.client.core.relayer.publish(i,h,v).catch(E=>this.client.logger.error(E)),await this.client.core.history.resolve(l)},this.sendError=async(r,n,i)=>{const o=fc(r,i),c=await this.client.core.crypto.encode(n,o),l=await this.client.core.history.get(n,r),h=Xo[l.request.method].res;this.client.core.relayer.publish(n,c,h),await this.client.core.history.resolve(o)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{pi(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{pi(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Zn.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Zn.active;const r=this.requestQueue.queue.shift();if(r)try{this.processRequest(r),await new Promise(n=>setTimeout(n,300))}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Zn.idle},this.processRequest=r=>{const{topic:n,payload:i}=r,o=i.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return this.onSessionExtendRequest(n,i);case"wc_sessionPing":return this.onSessionPingRequest(n,i);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return this.onSessionRequest(n,i);case"wc_sessionEvent":return this.onSessionEventRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=_e("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:o}=n;try{this.isValidConnect(zr({},n.params));const c=En(Te.FIVE_MINUTES),l=zr({id:o,pairingTopic:r,expiry:c},i);await this.setProposal(o,l);const h=Ds(JSON.stringify(n)),f=await this.getVerifyContext(h,l.proposer.metadata);this.client.events.emit("session_proposal",{id:o,params:l,verifyContext:f})}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(Vn(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const c=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:c});const l=c.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const h=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:h});const f=await this.client.core.crypto.generateSharedKey(l,h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:f});const v=await this.client.core.relayer.subscribe(f);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:v}),await this.client.core.pairing.activate({topic:r})}else xn(n)&&(await this.client.proposal.delete(i,Yt("USER_DISCONNECTED")),this.events.emit(tr("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidSessionSettleRequest(o);const{relay:c,controller:l,expiry:h,namespaces:f,requiredNamespaces:v,optionalNamespaces:E,sessionProperties:_,pairingTopic:S}=n.params,P=zr({topic:r,relay:c,expiry:h,namespaces:f,acknowledged:!0,pairingTopic:S,requiredNamespaces:v,optionalNamespaces:E,controller:l.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:l.publicKey,metadata:l.metadata}},_&&{sessionProperties:_});await this.sendResult({id:n.id,topic:r,result:!0}),this.events.emit(tr("session_connect"),{session:P}),this.cleanupDuplicatePairings(P)}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Vn(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(tr("session_approve",i),{})):xn(n)&&(await this.client.session.delete(r,Yt("USER_DISCONNECTED")),this.events.emit(tr("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:o}=n;try{const c=`${r}_session_update`,l=cc.get(c);if(l&&this.isRequestOutOfSync(l,o)){this.client.logger.info(`Discarding out of sync request - ${o}`);return}this.isValidUpdate(zr({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:o,topic:r,result:!0}),this.client.events.emit("session_update",{id:o,topic:r,params:i}),cc.set(c,o)}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;Vn(n)?this.events.emit(tr("session_update",i),{}):xn(n)&&this.events.emit(tr("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,En(mc)),await this.sendResult({id:i,topic:r,result:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n;Vn(n)?this.events.emit(tr("session_extend",i),{}):xn(n)&&this.events.emit(tr("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{Vn(n)?this.events.emit(tr("session_ping",i),{}):xn(n)&&this.events.emit(tr("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await Promise.all([new Promise(o=>{this.client.core.relayer.once(Ir.publish,async()=>{o(await this.deleteSession(r))})}),this.sendResult({id:i,topic:r,result:!0})]),this.client.events.emit("session_delete",{id:i,topic:r})}catch(o){this.client.logger.error(o)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:o}=n;try{this.isValidRequest(zr({topic:r},o));const c=Ds(JSON.stringify(Ls("wc_sessionRequest",o,i))),l=this.client.session.get(r),h=await this.getVerifyContext(c,l.peer.metadata),f={id:i,topic:r,params:o,verifyContext:h};await this.setPendingSessionRequest(f),this.addSessionRequestToSessionRequestQueue(f),this.processSessionRequestQueue()}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;Vn(n)?this.events.emit(tr("session_request",i),{result:n.result}):xn(n)&&this.events.emit(tr("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:o}=n;try{const c=`${r}_session_event_${o.event.name}`,l=cc.get(c);if(l&&this.isRequestOutOfSync(l,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(zr({topic:r},o)),this.client.events.emit("session_event",{id:i,topic:r,params:o}),cc.set(c,i)}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Zn.idle,this.processSessionRequestQueue()},Te.toMiliseconds(this.requestQueueDelay))},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Zn.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Zn.active,this.client.events.emit("session_request",r)}catch(n){this.client.logger.error(n)}},this.onPairingCreated=r=>{if(r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest(r.topic,Ls("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer},n.id))},this.isValidConnect=async r=>{if(!Wr(r)){const{message:h}=_e("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(h)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:o,sessionProperties:c,relays:l}=r;if(Pr(n)||await this.isValidPairingTopic(n),!Kb(l,!0)){const{message:h}=_e("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(h)}!Pr(i)&&Ts(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Pr(o)&&Ts(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),Pr(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=Vb(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Wr(r))throw new Error(_e("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:o,sessionProperties:c}=r;await this.isValidProposalId(n);const l=this.client.proposal.get(n),h=ac(i,"approve()");if(h)throw new Error(h.message);const f=G1(l.requiredNamespaces,i,"approve()");if(f)throw new Error(f.message);if(!pr(o,!0)){const{message:v}=_e("MISSING_OR_INVALID",`approve() relayProtocol: ${o}`);throw new Error(v)}Pr(c)||this.validateSessionProps(c,"sessionProperties")},this.isValidReject=async r=>{if(!Wr(r)){const{message:o}=_e("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(o)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!Zb(i)){const{message:o}=_e("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidSessionSettleRequest=r=>{if(!Wr(r)){const{message:f}=_e("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(f)}const{relay:n,controller:i,namespaces:o,expiry:c}=r;if(!V1(n)){const{message:f}=_e("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(f)}const l=Bb(i,"onSessionSettleRequest()");if(l)throw new Error(l.message);const h=ac(o,"onSessionSettleRequest()");if(h)throw new Error(h.message);if(pi(c)){const{message:f}=_e("EXPIRED","onSessionSettleRequest()");throw new Error(f)}},this.isValidUpdate=async r=>{if(!Wr(r)){const{message:h}=_e("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(h)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const o=this.client.session.get(n),c=ac(i,"update()");if(c)throw new Error(c.message);const l=G1(o.requiredNamespaces,i,"update()");if(l)throw new Error(l.message)},this.isValidExtend=async r=>{if(!Wr(r)){const{message:i}=_e("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!Wr(r)){const{message:h}=_e("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(h)}const{topic:n,request:i,chainId:o,expiry:c}=r;await this.isValidSessionTopic(n);const{namespaces:l}=this.client.session.get(n);if(!K1(l,o)){const{message:h}=_e("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(h)}if(!Yb(i)){const{message:h}=_e("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(h)}if(!Xb(l,o,i.method)){const{message:h}=_e("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(h)}if(c&&!n6(c,Ch)){const{message:h}=_e("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${Ch.min} and ${Ch.max}`);throw new Error(h)}},this.isValidRespond=async r=>{if(!Wr(r)){const{message:o}=_e("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!Jb(i)){const{message:o}=_e("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!Wr(r)){const{message:i}=_e("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Wr(r)){const{message:l}=_e("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(l)}const{topic:n,event:i,chainId:o}=r;await this.isValidSessionTopic(n);const{namespaces:c}=this.client.session.get(n);if(!K1(c,o)){const{message:l}=_e("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(l)}if(!Qb(i)){const{message:l}=_e("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}if(!e6(c,o,i.name)){const{message:l}=_e("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}},this.isValidDisconnect=async r=>{if(!Wr(r)){const{message:i}=_e("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(r,n)=>{const i={verified:{verifyUrl:n.verifyUrl||Ms,validation:"UNKNOWN",origin:n.url||""}};try{const o=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});o&&(i.verified.origin=o.origin,i.verified.isScam=o.isScam,i.verified.validation=o.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(o){this.client.logger.info(o)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!pr(i,!1)){const{message:o}=_e("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(o)}})}}async isInitialized(){if(!this.initialized){const{message:e}=_e("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Ir.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(r,n);try{fh(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):dc(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.client.core.history.delete(r,i.id)):this.onRelayEventUnknownPayload({topic:r,payload:i})}catch(o){this.client.logger.error(o)}})}registerExpirerEvents(){this.client.core.expirer.on(cn.expired,async e=>{const{topic:r,id:n}=k1(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,_e("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(Jo.create,e=>this.onPairingCreated(e))}isValidPairingTopic(e){if(!pr(e,!1)){const{message:r}=_e("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=_e("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(pi(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=_e("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!pr(e,!1)){const{message:r}=_e("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=_e("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(pi(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=_e("EXPIRED",`session topic: ${e}`);throw new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(pr(e,!1)){const{message:r}=_e("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=_e("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!Gb(e)){const{message:r}=_e("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=_e("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(pi(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=_e("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class N7 extends gc{constructor(e,r){super(e,r,x7,Eh),this.core=e,this.logger=r}}class L7 extends gc{constructor(e,r){super(e,r,C7,Eh),this.core=e,this.logger=r}}class M7 extends gc{constructor(e,r){super(e,r,S7,Eh,n=>n.id),this.core=e,this.logger=r}}class Ih extends W4{constructor(e){super(e),this.protocol=bg,this.version=_g,this.name=xh.name,this.events=new yr.exports.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=e?.name||xh.name,this.metadata=e?.metadata||hb();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||xh.logger}));this.core=e?.core||new E7(e),this.logger=pt.generateChildLogger(r,this.name),this.session=new L7(this.core,this.logger),this.proposal=new N7(this.core,this.logger),this.pendingRequest=new M7(this.core,this.logger),this.engine=new R7(this)}static async init(e){const r=new Ih(e);return await r.initialize(),r}get context(){return pt.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var Sh={exports:{}};(function(t,e){var r=typeof self<"u"?self:dr,n=function(){function o(){this.fetch=!1,this.DOMException=r.DOMException}return o.prototype=r,new o}();(function(o){(function(c){var l={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function h(O){return O&&DataView.prototype.isPrototypeOf(O)}if(l.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=ArrayBuffer.isView||function(O){return O&&f.indexOf(Object.prototype.toString.call(O))>-1};function E(O){if(typeof O!="string"&&(O=String(O)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(O))throw new TypeError("Invalid character in header field name");return O.toLowerCase()}function _(O){return typeof O!="string"&&(O=String(O)),O}function S(O){var U={next:function(){var ce=O.shift();return{done:ce===void 0,value:ce}}};return l.iterable&&(U[Symbol.iterator]=function(){return U}),U}function P(O){this.map={},O instanceof P?O.forEach(function(U,ce){this.append(ce,U)},this):Array.isArray(O)?O.forEach(function(U){this.append(U[0],U[1])},this):O&&Object.getOwnPropertyNames(O).forEach(function(U){this.append(U,O[U])},this)}P.prototype.append=function(O,U){O=E(O),U=_(U);var ce=this.map[O];this.map[O]=ce?ce+", "+U:U},P.prototype.delete=function(O){delete this.map[E(O)]},P.prototype.get=function(O){return O=E(O),this.has(O)?this.map[O]:null},P.prototype.has=function(O){return this.map.hasOwnProperty(E(O))},P.prototype.set=function(O,U){this.map[E(O)]=_(U)},P.prototype.forEach=function(O,U){for(var ce in this.map)this.map.hasOwnProperty(ce)&&O.call(U,this.map[ce],ce,this)},P.prototype.keys=function(){var O=[];return this.forEach(function(U,ce){O.push(ce)}),S(O)},P.prototype.values=function(){var O=[];return this.forEach(function(U){O.push(U)}),S(O)},P.prototype.entries=function(){var O=[];return this.forEach(function(U,ce){O.push([ce,U])}),S(O)},l.iterable&&(P.prototype[Symbol.iterator]=P.prototype.entries);function j(O){if(O.bodyUsed)return Promise.reject(new TypeError("Already read"));O.bodyUsed=!0}function H(O){return new Promise(function(U,ce){O.onload=function(){U(O.result)},O.onerror=function(){ce(O.error)}})}function Z(O){var U=new FileReader,ce=H(U);return U.readAsArrayBuffer(O),ce}function N(O){var U=new FileReader,ce=H(U);return U.readAsText(O),ce}function L(O){for(var U=new Uint8Array(O),ce=new Array(U.length),le=0;le<U.length;le++)ce[le]=String.fromCharCode(U[le]);return ce.join("")}function $(O){if(O.slice)return O.slice(0);var U=new Uint8Array(O.byteLength);return U.set(new Uint8Array(O)),U.buffer}function T(){return this.bodyUsed=!1,this._initBody=function(O){this._bodyInit=O,O?typeof O=="string"?this._bodyText=O:l.blob&&Blob.prototype.isPrototypeOf(O)?this._bodyBlob=O:l.formData&&FormData.prototype.isPrototypeOf(O)?this._bodyFormData=O:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(O)?this._bodyText=O.toString():l.arrayBuffer&&l.blob&&h(O)?(this._bodyArrayBuffer=$(O.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(O)||v(O))?this._bodyArrayBuffer=$(O):this._bodyText=O=Object.prototype.toString.call(O):this._bodyText="",this.headers.get("content-type")||(typeof O=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(O)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var O=j(this);if(O)return O;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?j(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Z)}),this.text=function(){var O=j(this);if(O)return O;if(this._bodyBlob)return N(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(L(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(J)}),this.json=function(){return this.text().then(JSON.parse)},this}var I=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function d(O){var U=O.toUpperCase();return I.indexOf(U)>-1?U:O}function x(O,U){U=U||{};var ce=U.body;if(O instanceof x){if(O.bodyUsed)throw new TypeError("Already read");this.url=O.url,this.credentials=O.credentials,U.headers||(this.headers=new P(O.headers)),this.method=O.method,this.mode=O.mode,this.signal=O.signal,!ce&&O._bodyInit!=null&&(ce=O._bodyInit,O.bodyUsed=!0)}else this.url=String(O);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new P(U.headers)),this.method=d(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&ce)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(ce)}x.prototype.clone=function(){return new x(this,{body:this._bodyInit})};function J(O){var U=new FormData;return O.trim().split("&").forEach(function(ce){if(ce){var le=ce.split("="),re=le.shift().replace(/\+/g," "),ne=le.join("=").replace(/\+/g," ");U.append(decodeURIComponent(re),decodeURIComponent(ne))}}),U}function W(O){var U=new P,ce=O.replace(/\r?\n[\t ]+/g," ");return ce.split(/\r?\n/).forEach(function(le){var re=le.split(":"),ne=re.shift().trim();if(ne){var ae=re.join(":").trim();U.append(ne,ae)}}),U}T.call(x.prototype);function ee(O,U){U||(U={}),this.type="default",this.status=U.status===void 0?200:U.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in U?U.statusText:"OK",this.headers=new P(U.headers),this.url=U.url||"",this._initBody(O)}T.call(ee.prototype),ee.prototype.clone=function(){return new ee(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new P(this.headers),url:this.url})},ee.error=function(){var O=new ee(null,{status:0,statusText:""});return O.type="error",O};var de=[301,302,303,307,308];ee.redirect=function(O,U){if(de.indexOf(U)===-1)throw new RangeError("Invalid status code");return new ee(null,{status:U,headers:{location:O}})},c.DOMException=o.DOMException;try{new c.DOMException}catch{c.DOMException=function(U,ce){this.message=U,this.name=ce;var le=Error(U);this.stack=le.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function me(O,U){return new Promise(function(ce,le){var re=new x(O,U);if(re.signal&&re.signal.aborted)return le(new c.DOMException("Aborted","AbortError"));var ne=new XMLHttpRequest;function ae(){ne.abort()}ne.onload=function(){var ie={status:ne.status,statusText:ne.statusText,headers:W(ne.getAllResponseHeaders()||"")};ie.url="responseURL"in ne?ne.responseURL:ie.headers.get("X-Request-URL");var Ae="response"in ne?ne.response:ne.responseText;ce(new ee(Ae,ie))},ne.onerror=function(){le(new TypeError("Network request failed"))},ne.ontimeout=function(){le(new TypeError("Network request failed"))},ne.onabort=function(){le(new c.DOMException("Aborted","AbortError"))},ne.open(re.method,re.url,!0),re.credentials==="include"?ne.withCredentials=!0:re.credentials==="omit"&&(ne.withCredentials=!1),"responseType"in ne&&l.blob&&(ne.responseType="blob"),re.headers.forEach(function(ie,Ae){ne.setRequestHeader(Ae,ie)}),re.signal&&(re.signal.addEventListener("abort",ae),ne.onreadystatechange=function(){ne.readyState===4&&re.signal.removeEventListener("abort",ae)}),ne.send(typeof re._bodyInit>"u"?null:re._bodyInit)})}return me.polyfill=!0,o.fetch||(o.fetch=me,o.Headers=P,o.Request=x,o.Response=ee),c.Headers=P,c.Request=x,c.Response=ee,c.fetch=me,Object.defineProperty(c,"__esModule",{value:!0}),c})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(Sh,Sh.exports);var Og=Sw(Sh.exports);const Ag={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Dg=10;class mi{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new yr.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Lp(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,r){this.isAvailable||await this.register();try{const n=Vo(e),o=await(await Og(this.url,Object.assign(Object.assign({},Ag),{body:n}))).json();this.onPayload({data:o})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Lp(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Vo({id:1,jsonrpc:"2.0",method:"test",params:[]});await Og(e,Object.assign(Object.assign({},Ag),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?ih(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=fc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return Ap(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Dg&&this.events.setMaxListeners(Dg)}}const $g="error",U7="wss://relay.walletconnect.com",j7="wc",F7="universal_provider",Pg=`${j7}@2:${F7}:`,B7="https://rpc.walletconnect.com/v1/",Yn={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var ta=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Oh={exports:{}};/**
73
73
  * @license
74
74
  * Lodash <https://lodash.com/>
75
75
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
76
76
  * Released under MIT license <https://lodash.com/license>
77
77
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
78
78
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
79
- */(function(r,e){(function(){var t,i="4.17.21",o=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",f="Invalid `variable` option passed into `_.template`",v="__lodash_hash_undefined__",p=500,w="__lodash_placeholder__",I=1,S=2,C=4,R=1,B=2,K=1,se=2,$=4,U=8,x=16,T=32,E=64,h=128,b=256,G=512,Y=30,ie="...",ce=800,de=16,m=1,P=2,ee=3,Q=1/0,V=9007199254740991,k=17976931348623157e292,J=0/0,re=4294967295,me=re-1,oe=re>>>1,we=[["ary",h],["bind",K],["bindKey",se],["curry",U],["curryRight",x],["flip",G],["partial",T],["partialRight",E],["rearg",b]],le="[object Arguments]",_e="[object Array]",H="[object AsyncFunction]",q="[object Boolean]",F="[object Date]",d="[object DOMException]",A="[object Error]",ae="[object Function]",fe="[object GeneratorFunction]",xe="[object Map]",Be="[object Number]",Ve="[object Null]",Ue="[object Object]",vt="[object Promise]",yt="[object Proxy]",Me="[object RegExp]",Oe="[object Set]",$e="[object String]",Fe="[object Symbol]",qe="[object Undefined]",Pe="[object WeakMap]",Le="[object WeakSet]",Se="[object ArrayBuffer]",Ce="[object DataView]",ze="[object Float32Array]",Ie="[object Float64Array]",ke="[object Int8Array]",We="[object Int16Array]",et="[object Int32Array]",tt="[object Uint8Array]",Qe="[object Uint8ClampedArray]",cr="[object Uint16Array]",yr="[object Uint32Array]",en=/\b__p \+= '';/g,ur=/\b(__p \+=) '' \+/g,pn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Tn=/&(?:amp|lt|gt|quot|#39);/g,Xn=/[&<>"']/g,Dt=RegExp(Tn.source),_t=RegExp(Xn.source),St=/<%-([\s\S]+?)%>/g,xt=/<%([\s\S]+?)%>/g,wt=/<%=([\s\S]+?)%>/g,bt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lt=/^\w*$/,Ut=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ot=/[\\^$.*+?()[\]{}|]/g,jt=RegExp(Ot.source),It=/^\s+/,Tt=/\s/,Pt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ft=/\{\n\/\* \[wrapped with (.+)\] \*/,Mt=/,? & /,qt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vc=/[()=,{}\[\]\/\s]/,kc=/\\(\\)?/g,Gc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Rr=/\w*$/,Wc=/^[-+]0x[0-9a-f]+$/i,Yc=/^0b[01]+$/i,Jc=/^\[object .+?Constructor\]$/,Qc=/^0o[0-7]+$/i,Xc=/^(?:0|[1-9]\d*)$/,gn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Si=/($^)/,Zc=/['\n\r\u2028\u2029\\]/g,xi="\\ud800-\\udfff",eu="\\u0300-\\u036f",tu="\\ufe20-\\ufe2f",Oi="\\u20d0-\\u20ff",_o=eu+tu+Oi,bo="\\u2700-\\u27bf",Vr="a-z\\xdf-\\xf6\\xf8-\\xff",ru="\\xac\\xb1\\xd7\\xf7",nu="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",iu="\\u2000-\\u206f",su=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",mo="A-Z\\xc0-\\xd6\\xd8-\\xde",wo="\\ufe0e\\ufe0f",Zn=ru+nu+iu+su,Es="['\u2019]",ei="["+xi+"]",Ds="["+Zn+"]",ti="["+_o+"]",Eo="\\d+",ou="["+bo+"]",Do="["+Vr+"]",So="[^"+xi+Zn+Eo+bo+Vr+mo+"]",Ii="\\ud83c[\\udffb-\\udfff]",au="(?:"+ti+"|"+Ii+")",xo="[^"+xi+"]",Pi="(?:\\ud83c[\\udde6-\\uddff]){2}",Rn="[\\ud800-\\udbff][\\udc00-\\udfff]",xr="["+mo+"]",Oo="\\u200d",Io="(?:"+Do+"|"+So+")",tn="(?:"+xr+"|"+So+")",Po="(?:"+Es+"(?:d|ll|m|re|s|t|ve))?",Co="(?:"+Es+"(?:D|LL|M|RE|S|T|VE))?",Ao=au+"?",To="["+wo+"]?",cu="(?:"+Oo+"(?:"+[xo,Pi,Rn].join("|")+")"+To+Ao+")*",vn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ro="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",No=To+Ao+cu,Ci="(?:"+[ou,Pi,Rn].join("|")+")"+No,uu="(?:"+[xo+ti+"?",ti,Pi,Rn,ei].join("|")+")",Ss=RegExp(Es,"g"),hu=RegExp(ti,"g"),Ai=RegExp(Ii+"(?="+Ii+")|"+uu+No,"g"),$o=RegExp([xr+"?"+Do+"+"+Po+"(?="+[Ds,xr,"$"].join("|")+")",tn+"+"+Co+"(?="+[Ds,xr+Io,"$"].join("|")+")",xr+"?"+Io+"+"+Po,xr+"+"+Co,Ro,vn,Eo,Ci].join("|"),"g"),Fo=RegExp("["+Oo+xi+_o+wo+"]"),ri=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],lu=-1,at={};at[ze]=at[Ie]=at[ke]=at[We]=at[et]=at[tt]=at[Qe]=at[cr]=at[yr]=!0,at[le]=at[_e]=at[Se]=at[q]=at[Ce]=at[F]=at[A]=at[ae]=at[xe]=at[Be]=at[Ue]=at[Me]=at[Oe]=at[$e]=at[Pe]=!1;var ot={};ot[le]=ot[_e]=ot[Se]=ot[Ce]=ot[q]=ot[F]=ot[ze]=ot[Ie]=ot[ke]=ot[We]=ot[et]=ot[xe]=ot[Be]=ot[Ue]=ot[Me]=ot[Oe]=ot[$e]=ot[Fe]=ot[tt]=ot[Qe]=ot[cr]=ot[yr]=!0,ot[A]=ot[ae]=ot[Pe]=!1;var D={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},te={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},pe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,Te=parseInt,dt=typeof ms=="object"&&ms&&ms.Object===Object&&ms,Ht=typeof self=="object"&&self&&self.Object===Object&&self,Xe=dt||Ht||Function("return this")(),ut=e&&!e.nodeType&&e,Rt=ut&&!0&&r&&!r.nodeType&&r,_r=Rt&&Rt.exports===ut,Bt=_r&&dt.process,pt=function(){try{var j=Rt&&Rt.require&&Rt.require("util").types;return j||Bt&&Bt.binding&&Bt.binding("util")}catch{}}(),hr=pt&&pt.isArrayBuffer,kr=pt&&pt.isDate,Nr=pt&&pt.isMap,rn=pt&&pt.isRegExp,xs=pt&&pt.isSet,ni=pt&&pt.isTypedArray;function Gt(j,W,z){switch(z.length){case 0:return j.call(W);case 1:return j.call(W,z[0]);case 2:return j.call(W,z[0],z[1]);case 3:return j.call(W,z[0],z[1],z[2])}return j.apply(W,z)}function L2(j,W,z,ge){for(var Ae=-1,rt=j==null?0:j.length;++Ae<rt;){var zt=j[Ae];W(ge,zt,z(zt),j)}return ge}function $r(j,W){for(var z=-1,ge=j==null?0:j.length;++z<ge&&W(j[z],z,j)!==!1;);return j}function U2(j,W){for(var z=j==null?0:j.length;z--&&W(j[z],z,j)!==!1;);return j}function Hd(j,W){for(var z=-1,ge=j==null?0:j.length;++z<ge;)if(!W(j[z],z,j))return!1;return!0}function Nn(j,W){for(var z=-1,ge=j==null?0:j.length,Ae=0,rt=[];++z<ge;){var zt=j[z];W(zt,z,j)&&(rt[Ae++]=zt)}return rt}function Uo(j,W){var z=j==null?0:j.length;return!!z&&Ti(j,W,0)>-1}function fu(j,W,z){for(var ge=-1,Ae=j==null?0:j.length;++ge<Ae;)if(z(W,j[ge]))return!0;return!1}function mt(j,W){for(var z=-1,ge=j==null?0:j.length,Ae=Array(ge);++z<ge;)Ae[z]=W(j[z],z,j);return Ae}function $n(j,W){for(var z=-1,ge=W.length,Ae=j.length;++z<ge;)j[Ae+z]=W[z];return j}function du(j,W,z,ge){var Ae=-1,rt=j==null?0:j.length;for(ge&&rt&&(z=j[++Ae]);++Ae<rt;)z=W(z,j[Ae],Ae,j);return z}function j2(j,W,z,ge){var Ae=j==null?0:j.length;for(ge&&Ae&&(z=j[--Ae]);Ae--;)z=W(z,j[Ae],Ae,j);return z}function pu(j,W){for(var z=-1,ge=j==null?0:j.length;++z<ge;)if(W(j[z],z,j))return!0;return!1}var M2=gu("length");function q2(j){return j.split("")}function H2(j){return j.match(qt)||[]}function Bd(j,W,z){var ge;return z(j,function(Ae,rt,zt){if(W(Ae,rt,zt))return ge=rt,!1}),ge}function jo(j,W,z,ge){for(var Ae=j.length,rt=z+(ge?1:-1);ge?rt--:++rt<Ae;)if(W(j[rt],rt,j))return rt;return-1}function Ti(j,W,z){return W===W?Z2(j,W,z):jo(j,zd,z)}function B2(j,W,z,ge){for(var Ae=z-1,rt=j.length;++Ae<rt;)if(ge(j[Ae],W))return Ae;return-1}function zd(j){return j!==j}function Kd(j,W){var z=j==null?0:j.length;return z?yu(j,W)/z:J}function gu(j){return function(W){return W==null?t:W[j]}}function vu(j){return function(W){return j==null?t:j[W]}}function Vd(j,W,z,ge,Ae){return Ae(j,function(rt,zt,ht){z=ge?(ge=!1,rt):W(z,rt,zt,ht)}),z}function z2(j,W){var z=j.length;for(j.sort(W);z--;)j[z]=j[z].value;return j}function yu(j,W){for(var z,ge=-1,Ae=j.length;++ge<Ae;){var rt=W(j[ge]);rt!==t&&(z=z===t?rt:z+rt)}return z}function _u(j,W){for(var z=-1,ge=Array(j);++z<j;)ge[z]=W(z);return ge}function K2(j,W){return mt(W,function(z){return[z,j[z]]})}function kd(j){return j&&j.slice(0,Jd(j)+1).replace(It,"")}function Or(j){return function(W){return j(W)}}function bu(j,W){return mt(W,function(z){return j[z]})}function Os(j,W){return j.has(W)}function Gd(j,W){for(var z=-1,ge=j.length;++z<ge&&Ti(W,j[z],0)>-1;);return z}function Wd(j,W){for(var z=j.length;z--&&Ti(W,j[z],0)>-1;);return z}function V2(j,W){for(var z=j.length,ge=0;z--;)j[z]===W&&++ge;return ge}var k2=vu(D),G2=vu(L);function W2(j){return"\\"+pe[j]}function Y2(j,W){return j==null?t:j[W]}function Ri(j){return Fo.test(j)}function J2(j){return ri.test(j)}function Q2(j){for(var W,z=[];!(W=j.next()).done;)z.push(W.value);return z}function mu(j){var W=-1,z=Array(j.size);return j.forEach(function(ge,Ae){z[++W]=[Ae,ge]}),z}function Yd(j,W){return function(z){return j(W(z))}}function Fn(j,W){for(var z=-1,ge=j.length,Ae=0,rt=[];++z<ge;){var zt=j[z];(zt===W||zt===w)&&(j[z]=w,rt[Ae++]=z)}return rt}function Mo(j){var W=-1,z=Array(j.size);return j.forEach(function(ge){z[++W]=ge}),z}function X2(j){var W=-1,z=Array(j.size);return j.forEach(function(ge){z[++W]=[ge,ge]}),z}function Z2(j,W,z){for(var ge=z-1,Ae=j.length;++ge<Ae;)if(j[ge]===W)return ge;return-1}function e6(j,W,z){for(var ge=z+1;ge--;)if(j[ge]===W)return ge;return ge}function Ni(j){return Ri(j)?r6(j):M2(j)}function Gr(j){return Ri(j)?n6(j):q2(j)}function Jd(j){for(var W=j.length;W--&&Tt.test(j.charAt(W)););return W}var t6=vu(te);function r6(j){for(var W=Ai.lastIndex=0;Ai.test(j);)++W;return W}function n6(j){return j.match(Ai)||[]}function i6(j){return j.match($o)||[]}var s6=function j(W){W=W==null?Xe:$i.defaults(Xe.Object(),W,$i.pick(Xe,Lo));var z=W.Array,ge=W.Date,Ae=W.Error,rt=W.Function,zt=W.Math,ht=W.Object,wu=W.RegExp,o6=W.String,Fr=W.TypeError,qo=z.prototype,a6=rt.prototype,Fi=ht.prototype,Ho=W["__core-js_shared__"],Bo=a6.toString,it=Fi.hasOwnProperty,c6=0,Qd=function(){var n=/[^.]+$/.exec(Ho&&Ho.keys&&Ho.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),zo=Fi.toString,u6=Bo.call(ht),h6=Xe._,l6=wu("^"+Bo.call(it).replace(Ot,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ko=_r?W.Buffer:t,Ln=W.Symbol,Vo=W.Uint8Array,Xd=Ko?Ko.allocUnsafe:t,ko=Yd(ht.getPrototypeOf,ht),Zd=ht.create,ep=Fi.propertyIsEnumerable,Go=qo.splice,tp=Ln?Ln.isConcatSpreadable:t,Is=Ln?Ln.iterator:t,ii=Ln?Ln.toStringTag:t,Wo=function(){try{var n=ui(ht,"defineProperty");return n({},"",{}),n}catch{}}(),f6=W.clearTimeout!==Xe.clearTimeout&&W.clearTimeout,d6=ge&&ge.now!==Xe.Date.now&&ge.now,p6=W.setTimeout!==Xe.setTimeout&&W.setTimeout,Yo=zt.ceil,Jo=zt.floor,Eu=ht.getOwnPropertySymbols,g6=Ko?Ko.isBuffer:t,rp=W.isFinite,v6=qo.join,y6=Yd(ht.keys,ht),Kt=zt.max,tr=zt.min,_6=ge.now,b6=W.parseInt,np=zt.random,m6=qo.reverse,Du=ui(W,"DataView"),Ps=ui(W,"Map"),Su=ui(W,"Promise"),Li=ui(W,"Set"),Cs=ui(W,"WeakMap"),As=ui(ht,"create"),Qo=Cs&&new Cs,Ui={},w6=hi(Du),E6=hi(Ps),D6=hi(Su),S6=hi(Li),x6=hi(Cs),Xo=Ln?Ln.prototype:t,Ts=Xo?Xo.valueOf:t,ip=Xo?Xo.toString:t;function y(n){if(Ct(n)&&!Re(n)&&!(n instanceof Ye)){if(n instanceof Lr)return n;if(it.call(n,"__wrapped__"))return sg(n)}return new Lr(n)}var ji=function(){function n(){}return function(s){if(!Et(s))return{};if(Zd)return Zd(s);n.prototype=s;var c=new n;return n.prototype=t,c}}();function Zo(){}function Lr(n,s){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!s,this.__index__=0,this.__values__=t}y.templateSettings={escape:St,evaluate:xt,interpolate:wt,variable:"",imports:{_:y}},y.prototype=Zo.prototype,y.prototype.constructor=y,Lr.prototype=ji(Zo.prototype),Lr.prototype.constructor=Lr;function Ye(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=re,this.__views__=[]}function O6(){var n=new Ye(this.__wrapped__);return n.__actions__=br(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=br(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=br(this.__views__),n}function I6(){if(this.__filtered__){var n=new Ye(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function P6(){var n=this.__wrapped__.value(),s=this.__dir__,c=Re(n),l=s<0,g=c?n.length:0,_=qD(0,g,this.__views__),O=_.start,N=_.end,M=N-O,X=l?N:O-1,Z=this.__iteratees__,ne=Z.length,ue=0,ve=tr(M,this.__takeCount__);if(!c||!l&&g==M&&ve==M)return Pp(n,this.__actions__);var Ee=[];e:for(;M--&&ue<ve;){X+=s;for(var He=-1,De=n[X];++He<ne;){var Ge=Z[He],Ze=Ge.iteratee,Cr=Ge.type,dr=Ze(De);if(Cr==P)De=dr;else if(!dr){if(Cr==m)continue e;break e}}Ee[ue++]=De}return Ee}Ye.prototype=ji(Zo.prototype),Ye.prototype.constructor=Ye;function si(n){var s=-1,c=n==null?0:n.length;for(this.clear();++s<c;){var l=n[s];this.set(l[0],l[1])}}function C6(){this.__data__=As?As(null):{},this.size=0}function A6(n){var s=this.has(n)&&delete this.__data__[n];return this.size-=s?1:0,s}function T6(n){var s=this.__data__;if(As){var c=s[n];return c===v?t:c}return it.call(s,n)?s[n]:t}function R6(n){var s=this.__data__;return As?s[n]!==t:it.call(s,n)}function N6(n,s){var c=this.__data__;return this.size+=this.has(n)?0:1,c[n]=As&&s===t?v:s,this}si.prototype.clear=C6,si.prototype.delete=A6,si.prototype.get=T6,si.prototype.has=R6,si.prototype.set=N6;function yn(n){var s=-1,c=n==null?0:n.length;for(this.clear();++s<c;){var l=n[s];this.set(l[0],l[1])}}function $6(){this.__data__=[],this.size=0}function F6(n){var s=this.__data__,c=ea(s,n);if(c<0)return!1;var l=s.length-1;return c==l?s.pop():Go.call(s,c,1),--this.size,!0}function L6(n){var s=this.__data__,c=ea(s,n);return c<0?t:s[c][1]}function U6(n){return ea(this.__data__,n)>-1}function j6(n,s){var c=this.__data__,l=ea(c,n);return l<0?(++this.size,c.push([n,s])):c[l][1]=s,this}yn.prototype.clear=$6,yn.prototype.delete=F6,yn.prototype.get=L6,yn.prototype.has=U6,yn.prototype.set=j6;function _n(n){var s=-1,c=n==null?0:n.length;for(this.clear();++s<c;){var l=n[s];this.set(l[0],l[1])}}function M6(){this.size=0,this.__data__={hash:new si,map:new(Ps||yn),string:new si}}function q6(n){var s=fa(this,n).delete(n);return this.size-=s?1:0,s}function H6(n){return fa(this,n).get(n)}function B6(n){return fa(this,n).has(n)}function z6(n,s){var c=fa(this,n),l=c.size;return c.set(n,s),this.size+=c.size==l?0:1,this}_n.prototype.clear=M6,_n.prototype.delete=q6,_n.prototype.get=H6,_n.prototype.has=B6,_n.prototype.set=z6;function oi(n){var s=-1,c=n==null?0:n.length;for(this.__data__=new _n;++s<c;)this.add(n[s])}function K6(n){return this.__data__.set(n,v),this}function V6(n){return this.__data__.has(n)}oi.prototype.add=oi.prototype.push=K6,oi.prototype.has=V6;function Wr(n){var s=this.__data__=new yn(n);this.size=s.size}function k6(){this.__data__=new yn,this.size=0}function G6(n){var s=this.__data__,c=s.delete(n);return this.size=s.size,c}function W6(n){return this.__data__.get(n)}function Y6(n){return this.__data__.has(n)}function J6(n,s){var c=this.__data__;if(c instanceof yn){var l=c.__data__;if(!Ps||l.length<o-1)return l.push([n,s]),this.size=++c.size,this;c=this.__data__=new _n(l)}return c.set(n,s),this.size=c.size,this}Wr.prototype.clear=k6,Wr.prototype.delete=G6,Wr.prototype.get=W6,Wr.prototype.has=Y6,Wr.prototype.set=J6;function sp(n,s){var c=Re(n),l=!c&&li(n),g=!c&&!l&&Hn(n),_=!c&&!l&&!g&&Bi(n),O=c||l||g||_,N=O?_u(n.length,o6):[],M=N.length;for(var X in n)(s||it.call(n,X))&&!(O&&(X=="length"||g&&(X=="offset"||X=="parent")||_&&(X=="buffer"||X=="byteLength"||X=="byteOffset")||En(X,M)))&&N.push(X);return N}function op(n){var s=n.length;return s?n[Fu(0,s-1)]:t}function Q6(n,s){return da(br(n),ai(s,0,n.length))}function X6(n){return da(br(n))}function xu(n,s,c){(c!==t&&!Yr(n[s],c)||c===t&&!(s in n))&&bn(n,s,c)}function Rs(n,s,c){var l=n[s];(!(it.call(n,s)&&Yr(l,c))||c===t&&!(s in n))&&bn(n,s,c)}function ea(n,s){for(var c=n.length;c--;)if(Yr(n[c][0],s))return c;return-1}function Z6(n,s,c,l){return Un(n,function(g,_,O){s(l,g,c(g),O)}),l}function ap(n,s){return n&&sn(s,Wt(s),n)}function eD(n,s){return n&&sn(s,wr(s),n)}function bn(n,s,c){s=="__proto__"&&Wo?Wo(n,s,{configurable:!0,enumerable:!0,value:c,writable:!0}):n[s]=c}function Ou(n,s){for(var c=-1,l=s.length,g=z(l),_=n==null;++c<l;)g[c]=_?t:oh(n,s[c]);return g}function ai(n,s,c){return n===n&&(c!==t&&(n=n<=c?n:c),s!==t&&(n=n>=s?n:s)),n}function Ur(n,s,c,l,g,_){var O,N=s&I,M=s&S,X=s&C;if(c&&(O=g?c(n,l,g,_):c(n)),O!==t)return O;if(!Et(n))return n;var Z=Re(n);if(Z){if(O=BD(n),!N)return br(n,O)}else{var ne=rr(n),ue=ne==ae||ne==fe;if(Hn(n))return Tp(n,N);if(ne==Ue||ne==le||ue&&!g){if(O=M||ue?{}:Jp(n),!N)return M?TD(n,eD(O,n)):AD(n,ap(O,n))}else{if(!ot[ne])return g?n:{};O=zD(n,ne,N)}}_||(_=new Wr);var ve=_.get(n);if(ve)return ve;_.set(n,O),xg(n)?n.forEach(function(De){O.add(Ur(De,s,c,De,n,_))}):Dg(n)&&n.forEach(function(De,Ge){O.set(Ge,Ur(De,s,c,Ge,n,_))});var Ee=X?M?ku:Vu:M?wr:Wt,He=Z?t:Ee(n);return $r(He||n,function(De,Ge){He&&(Ge=De,De=n[Ge]),Rs(O,Ge,Ur(De,s,c,Ge,n,_))}),O}function tD(n){var s=Wt(n);return function(c){return cp(c,n,s)}}function cp(n,s,c){var l=c.length;if(n==null)return!l;for(n=ht(n);l--;){var g=c[l],_=s[g],O=n[g];if(O===t&&!(g in n)||!_(O))return!1}return!0}function up(n,s,c){if(typeof n!="function")throw new Fr(u);return Ms(function(){n.apply(t,c)},s)}function Ns(n,s,c,l){var g=-1,_=Uo,O=!0,N=n.length,M=[],X=s.length;if(!N)return M;c&&(s=mt(s,Or(c))),l?(_=fu,O=!1):s.length>=o&&(_=Os,O=!1,s=new oi(s));e:for(;++g<N;){var Z=n[g],ne=c==null?Z:c(Z);if(Z=l||Z!==0?Z:0,O&&ne===ne){for(var ue=X;ue--;)if(s[ue]===ne)continue e;M.push(Z)}else _(s,ne,l)||M.push(Z)}return M}var Un=Lp(nn),hp=Lp(Pu,!0);function rD(n,s){var c=!0;return Un(n,function(l,g,_){return c=!!s(l,g,_),c}),c}function ta(n,s,c){for(var l=-1,g=n.length;++l<g;){var _=n[l],O=s(_);if(O!=null&&(N===t?O===O&&!Pr(O):c(O,N)))var N=O,M=_}return M}function nD(n,s,c,l){var g=n.length;for(c=je(c),c<0&&(c=-c>g?0:g+c),l=l===t||l>g?g:je(l),l<0&&(l+=g),l=c>l?0:Ig(l);c<l;)n[c++]=s;return n}function lp(n,s){var c=[];return Un(n,function(l,g,_){s(l,g,_)&&c.push(l)}),c}function Xt(n,s,c,l,g){var _=-1,O=n.length;for(c||(c=VD),g||(g=[]);++_<O;){var N=n[_];s>0&&c(N)?s>1?Xt(N,s-1,c,l,g):$n(g,N):l||(g[g.length]=N)}return g}var Iu=Up(),fp=Up(!0);function nn(n,s){return n&&Iu(n,s,Wt)}function Pu(n,s){return n&&fp(n,s,Wt)}function ra(n,s){return Nn(s,function(c){return Dn(n[c])})}function ci(n,s){s=Mn(s,n);for(var c=0,l=s.length;n!=null&&c<l;)n=n[on(s[c++])];return c&&c==l?n:t}function dp(n,s,c){var l=s(n);return Re(n)?l:$n(l,c(n))}function lr(n){return n==null?n===t?qe:Ve:ii&&ii in ht(n)?MD(n):XD(n)}function Cu(n,s){return n>s}function iD(n,s){return n!=null&&it.call(n,s)}function sD(n,s){return n!=null&&s in ht(n)}function oD(n,s,c){return n>=tr(s,c)&&n<Kt(s,c)}function Au(n,s,c){for(var l=c?fu:Uo,g=n[0].length,_=n.length,O=_,N=z(_),M=1/0,X=[];O--;){var Z=n[O];O&&s&&(Z=mt(Z,Or(s))),M=tr(Z.length,M),N[O]=!c&&(s||g>=120&&Z.length>=120)?new oi(O&&Z):t}Z=n[0];var ne=-1,ue=N[0];e:for(;++ne<g&&X.length<M;){var ve=Z[ne],Ee=s?s(ve):ve;if(ve=c||ve!==0?ve:0,!(ue?Os(ue,Ee):l(X,Ee,c))){for(O=_;--O;){var He=N[O];if(!(He?Os(He,Ee):l(n[O],Ee,c)))continue e}ue&&ue.push(Ee),X.push(ve)}}return X}function aD(n,s,c,l){return nn(n,function(g,_,O){s(l,c(g),_,O)}),l}function $s(n,s,c){s=Mn(s,n),n=eg(n,s);var l=n==null?n:n[on(Mr(s))];return l==null?t:Gt(l,n,c)}function pp(n){return Ct(n)&&lr(n)==le}function cD(n){return Ct(n)&&lr(n)==Se}function uD(n){return Ct(n)&&lr(n)==F}function Fs(n,s,c,l,g){return n===s?!0:n==null||s==null||!Ct(n)&&!Ct(s)?n!==n&&s!==s:hD(n,s,c,l,Fs,g)}function hD(n,s,c,l,g,_){var O=Re(n),N=Re(s),M=O?_e:rr(n),X=N?_e:rr(s);M=M==le?Ue:M,X=X==le?Ue:X;var Z=M==Ue,ne=X==Ue,ue=M==X;if(ue&&Hn(n)){if(!Hn(s))return!1;O=!0,Z=!1}if(ue&&!Z)return _||(_=new Wr),O||Bi(n)?Gp(n,s,c,l,g,_):UD(n,s,M,c,l,g,_);if(!(c&R)){var ve=Z&&it.call(n,"__wrapped__"),Ee=ne&&it.call(s,"__wrapped__");if(ve||Ee){var He=ve?n.value():n,De=Ee?s.value():s;return _||(_=new Wr),g(He,De,c,l,_)}}return ue?(_||(_=new Wr),jD(n,s,c,l,g,_)):!1}function lD(n){return Ct(n)&&rr(n)==xe}function Tu(n,s,c,l){var g=c.length,_=g,O=!l;if(n==null)return!_;for(n=ht(n);g--;){var N=c[g];if(O&&N[2]?N[1]!==n[N[0]]:!(N[0]in n))return!1}for(;++g<_;){N=c[g];var M=N[0],X=n[M],Z=N[1];if(O&&N[2]){if(X===t&&!(M in n))return!1}else{var ne=new Wr;if(l)var ue=l(X,Z,M,n,s,ne);if(!(ue===t?Fs(Z,X,R|B,l,ne):ue))return!1}}return!0}function gp(n){if(!Et(n)||GD(n))return!1;var s=Dn(n)?l6:Jc;return s.test(hi(n))}function fD(n){return Ct(n)&&lr(n)==Me}function dD(n){return Ct(n)&&rr(n)==Oe}function pD(n){return Ct(n)&&ba(n.length)&&!!at[lr(n)]}function vp(n){return typeof n=="function"?n:n==null?Er:typeof n=="object"?Re(n)?bp(n[0],n[1]):_p(n):jg(n)}function Ru(n){if(!js(n))return y6(n);var s=[];for(var c in ht(n))it.call(n,c)&&c!="constructor"&&s.push(c);return s}function gD(n){if(!Et(n))return QD(n);var s=js(n),c=[];for(var l in n)l=="constructor"&&(s||!it.call(n,l))||c.push(l);return c}function Nu(n,s){return n<s}function yp(n,s){var c=-1,l=mr(n)?z(n.length):[];return Un(n,function(g,_,O){l[++c]=s(g,_,O)}),l}function _p(n){var s=Wu(n);return s.length==1&&s[0][2]?Xp(s[0][0],s[0][1]):function(c){return c===n||Tu(c,n,s)}}function bp(n,s){return Ju(n)&&Qp(s)?Xp(on(n),s):function(c){var l=oh(c,n);return l===t&&l===s?ah(c,n):Fs(s,l,R|B)}}function na(n,s,c,l,g){n!==s&&Iu(s,function(_,O){if(g||(g=new Wr),Et(_))vD(n,s,O,c,na,l,g);else{var N=l?l(Xu(n,O),_,O+"",n,s,g):t;N===t&&(N=_),xu(n,O,N)}},wr)}function vD(n,s,c,l,g,_,O){var N=Xu(n,c),M=Xu(s,c),X=O.get(M);if(X){xu(n,c,X);return}var Z=_?_(N,M,c+"",n,s,O):t,ne=Z===t;if(ne){var ue=Re(M),ve=!ue&&Hn(M),Ee=!ue&&!ve&&Bi(M);Z=M,ue||ve||Ee?Re(N)?Z=N:Nt(N)?Z=br(N):ve?(ne=!1,Z=Tp(M,!0)):Ee?(ne=!1,Z=Rp(M,!0)):Z=[]:qs(M)||li(M)?(Z=N,li(N)?Z=Pg(N):(!Et(N)||Dn(N))&&(Z=Jp(M))):ne=!1}ne&&(O.set(M,Z),g(Z,M,l,_,O),O.delete(M)),xu(n,c,Z)}function mp(n,s){var c=n.length;if(c)return s+=s<0?c:0,En(s,c)?n[s]:t}function wp(n,s,c){s.length?s=mt(s,function(_){return Re(_)?function(O){return ci(O,_.length===1?_[0]:_)}:_}):s=[Er];var l=-1;s=mt(s,Or(be()));var g=yp(n,function(_,O,N){var M=mt(s,function(X){return X(_)});return{criteria:M,index:++l,value:_}});return z2(g,function(_,O){return CD(_,O,c)})}function yD(n,s){return Ep(n,s,function(c,l){return ah(n,l)})}function Ep(n,s,c){for(var l=-1,g=s.length,_={};++l<g;){var O=s[l],N=ci(n,O);c(N,O)&&Ls(_,Mn(O,n),N)}return _}function _D(n){return function(s){return ci(s,n)}}function $u(n,s,c,l){var g=l?B2:Ti,_=-1,O=s.length,N=n;for(n===s&&(s=br(s)),c&&(N=mt(n,Or(c)));++_<O;)for(var M=0,X=s[_],Z=c?c(X):X;(M=g(N,Z,M,l))>-1;)N!==n&&Go.call(N,M,1),Go.call(n,M,1);return n}function Dp(n,s){for(var c=n?s.length:0,l=c-1;c--;){var g=s[c];if(c==l||g!==_){var _=g;En(g)?Go.call(n,g,1):ju(n,g)}}return n}function Fu(n,s){return n+Jo(np()*(s-n+1))}function bD(n,s,c,l){for(var g=-1,_=Kt(Yo((s-n)/(c||1)),0),O=z(_);_--;)O[l?_:++g]=n,n+=c;return O}function Lu(n,s){var c="";if(!n||s<1||s>V)return c;do s%2&&(c+=n),s=Jo(s/2),s&&(n+=n);while(s);return c}function Ke(n,s){return Zu(Zp(n,s,Er),n+"")}function mD(n){return op(zi(n))}function wD(n,s){var c=zi(n);return da(c,ai(s,0,c.length))}function Ls(n,s,c,l){if(!Et(n))return n;s=Mn(s,n);for(var g=-1,_=s.length,O=_-1,N=n;N!=null&&++g<_;){var M=on(s[g]),X=c;if(M==="__proto__"||M==="constructor"||M==="prototype")return n;if(g!=O){var Z=N[M];X=l?l(Z,M,N):t,X===t&&(X=Et(Z)?Z:En(s[g+1])?[]:{})}Rs(N,M,X),N=N[M]}return n}var Sp=Qo?function(n,s){return Qo.set(n,s),n}:Er,ED=Wo?function(n,s){return Wo(n,"toString",{configurable:!0,enumerable:!1,value:uh(s),writable:!0})}:Er;function DD(n){return da(zi(n))}function jr(n,s,c){var l=-1,g=n.length;s<0&&(s=-s>g?0:g+s),c=c>g?g:c,c<0&&(c+=g),g=s>c?0:c-s>>>0,s>>>=0;for(var _=z(g);++l<g;)_[l]=n[l+s];return _}function SD(n,s){var c;return Un(n,function(l,g,_){return c=s(l,g,_),!c}),!!c}function ia(n,s,c){var l=0,g=n==null?l:n.length;if(typeof s=="number"&&s===s&&g<=oe){for(;l<g;){var _=l+g>>>1,O=n[_];O!==null&&!Pr(O)&&(c?O<=s:O<s)?l=_+1:g=_}return g}return Uu(n,s,Er,c)}function Uu(n,s,c,l){var g=0,_=n==null?0:n.length;if(_===0)return 0;s=c(s);for(var O=s!==s,N=s===null,M=Pr(s),X=s===t;g<_;){var Z=Jo((g+_)/2),ne=c(n[Z]),ue=ne!==t,ve=ne===null,Ee=ne===ne,He=Pr(ne);if(O)var De=l||Ee;else X?De=Ee&&(l||ue):N?De=Ee&&ue&&(l||!ve):M?De=Ee&&ue&&!ve&&(l||!He):ve||He?De=!1:De=l?ne<=s:ne<s;De?g=Z+1:_=Z}return tr(_,me)}function xp(n,s){for(var c=-1,l=n.length,g=0,_=[];++c<l;){var O=n[c],N=s?s(O):O;if(!c||!Yr(N,M)){var M=N;_[g++]=O===0?0:O}}return _}function Op(n){return typeof n=="number"?n:Pr(n)?J:+n}function Ir(n){if(typeof n=="string")return n;if(Re(n))return mt(n,Ir)+"";if(Pr(n))return ip?ip.call(n):"";var s=n+"";return s=="0"&&1/n==-Q?"-0":s}function jn(n,s,c){var l=-1,g=Uo,_=n.length,O=!0,N=[],M=N;if(c)O=!1,g=fu;else if(_>=o){var X=s?null:FD(n);if(X)return Mo(X);O=!1,g=Os,M=new oi}else M=s?[]:N;e:for(;++l<_;){var Z=n[l],ne=s?s(Z):Z;if(Z=c||Z!==0?Z:0,O&&ne===ne){for(var ue=M.length;ue--;)if(M[ue]===ne)continue e;s&&M.push(ne),N.push(Z)}else g(M,ne,c)||(M!==N&&M.push(ne),N.push(Z))}return N}function ju(n,s){return s=Mn(s,n),n=eg(n,s),n==null||delete n[on(Mr(s))]}function Ip(n,s,c,l){return Ls(n,s,c(ci(n,s)),l)}function sa(n,s,c,l){for(var g=n.length,_=l?g:-1;(l?_--:++_<g)&&s(n[_],_,n););return c?jr(n,l?0:_,l?_+1:g):jr(n,l?_+1:0,l?g:_)}function Pp(n,s){var c=n;return c instanceof Ye&&(c=c.value()),du(s,function(l,g){return g.func.apply(g.thisArg,$n([l],g.args))},c)}function Mu(n,s,c){var l=n.length;if(l<2)return l?jn(n[0]):[];for(var g=-1,_=z(l);++g<l;)for(var O=n[g],N=-1;++N<l;)N!=g&&(_[g]=Ns(_[g]||O,n[N],s,c));return jn(Xt(_,1),s,c)}function Cp(n,s,c){for(var l=-1,g=n.length,_=s.length,O={};++l<g;){var N=l<_?s[l]:t;c(O,n[l],N)}return O}function qu(n){return Nt(n)?n:[]}function Hu(n){return typeof n=="function"?n:Er}function Mn(n,s){return Re(n)?n:Ju(n,s)?[n]:ig(nt(n))}var xD=Ke;function qn(n,s,c){var l=n.length;return c=c===t?l:c,!s&&c>=l?n:jr(n,s,c)}var Ap=f6||function(n){return Xe.clearTimeout(n)};function Tp(n,s){if(s)return n.slice();var c=n.length,l=Xd?Xd(c):new n.constructor(c);return n.copy(l),l}function Bu(n){var s=new n.constructor(n.byteLength);return new Vo(s).set(new Vo(n)),s}function OD(n,s){var c=s?Bu(n.buffer):n.buffer;return new n.constructor(c,n.byteOffset,n.byteLength)}function ID(n){var s=new n.constructor(n.source,Rr.exec(n));return s.lastIndex=n.lastIndex,s}function PD(n){return Ts?ht(Ts.call(n)):{}}function Rp(n,s){var c=s?Bu(n.buffer):n.buffer;return new n.constructor(c,n.byteOffset,n.length)}function Np(n,s){if(n!==s){var c=n!==t,l=n===null,g=n===n,_=Pr(n),O=s!==t,N=s===null,M=s===s,X=Pr(s);if(!N&&!X&&!_&&n>s||_&&O&&M&&!N&&!X||l&&O&&M||!c&&M||!g)return 1;if(!l&&!_&&!X&&n<s||X&&c&&g&&!l&&!_||N&&c&&g||!O&&g||!M)return-1}return 0}function CD(n,s,c){for(var l=-1,g=n.criteria,_=s.criteria,O=g.length,N=c.length;++l<O;){var M=Np(g[l],_[l]);if(M){if(l>=N)return M;var X=c[l];return M*(X=="desc"?-1:1)}}return n.index-s.index}function $p(n,s,c,l){for(var g=-1,_=n.length,O=c.length,N=-1,M=s.length,X=Kt(_-O,0),Z=z(M+X),ne=!l;++N<M;)Z[N]=s[N];for(;++g<O;)(ne||g<_)&&(Z[c[g]]=n[g]);for(;X--;)Z[N++]=n[g++];return Z}function Fp(n,s,c,l){for(var g=-1,_=n.length,O=-1,N=c.length,M=-1,X=s.length,Z=Kt(_-N,0),ne=z(Z+X),ue=!l;++g<Z;)ne[g]=n[g];for(var ve=g;++M<X;)ne[ve+M]=s[M];for(;++O<N;)(ue||g<_)&&(ne[ve+c[O]]=n[g++]);return ne}function br(n,s){var c=-1,l=n.length;for(s||(s=z(l));++c<l;)s[c]=n[c];return s}function sn(n,s,c,l){var g=!c;c||(c={});for(var _=-1,O=s.length;++_<O;){var N=s[_],M=l?l(c[N],n[N],N,c,n):t;M===t&&(M=n[N]),g?bn(c,N,M):Rs(c,N,M)}return c}function AD(n,s){return sn(n,Yu(n),s)}function TD(n,s){return sn(n,Wp(n),s)}function oa(n,s){return function(c,l){var g=Re(c)?L2:Z6,_=s?s():{};return g(c,n,be(l,2),_)}}function Mi(n){return Ke(function(s,c){var l=-1,g=c.length,_=g>1?c[g-1]:t,O=g>2?c[2]:t;for(_=n.length>3&&typeof _=="function"?(g--,_):t,O&&fr(c[0],c[1],O)&&(_=g<3?t:_,g=1),s=ht(s);++l<g;){var N=c[l];N&&n(s,N,l,_)}return s})}function Lp(n,s){return function(c,l){if(c==null)return c;if(!mr(c))return n(c,l);for(var g=c.length,_=s?g:-1,O=ht(c);(s?_--:++_<g)&&l(O[_],_,O)!==!1;);return c}}function Up(n){return function(s,c,l){for(var g=-1,_=ht(s),O=l(s),N=O.length;N--;){var M=O[n?N:++g];if(c(_[M],M,_)===!1)break}return s}}function RD(n,s,c){var l=s&K,g=Us(n);function _(){var O=this&&this!==Xe&&this instanceof _?g:n;return O.apply(l?c:this,arguments)}return _}function jp(n){return function(s){s=nt(s);var c=Ri(s)?Gr(s):t,l=c?c[0]:s.charAt(0),g=c?qn(c,1).join(""):s.slice(1);return l[n]()+g}}function qi(n){return function(s){return du(Lg(Fg(s).replace(Ss,"")),n,"")}}function Us(n){return function(){var s=arguments;switch(s.length){case 0:return new n;case 1:return new n(s[0]);case 2:return new n(s[0],s[1]);case 3:return new n(s[0],s[1],s[2]);case 4:return new n(s[0],s[1],s[2],s[3]);case 5:return new n(s[0],s[1],s[2],s[3],s[4]);case 6:return new n(s[0],s[1],s[2],s[3],s[4],s[5]);case 7:return new n(s[0],s[1],s[2],s[3],s[4],s[5],s[6])}var c=ji(n.prototype),l=n.apply(c,s);return Et(l)?l:c}}function ND(n,s,c){var l=Us(n);function g(){for(var _=arguments.length,O=z(_),N=_,M=Hi(g);N--;)O[N]=arguments[N];var X=_<3&&O[0]!==M&&O[_-1]!==M?[]:Fn(O,M);if(_-=X.length,_<c)return zp(n,s,aa,g.placeholder,t,O,X,t,t,c-_);var Z=this&&this!==Xe&&this instanceof g?l:n;return Gt(Z,this,O)}return g}function Mp(n){return function(s,c,l){var g=ht(s);if(!mr(s)){var _=be(c,3);s=Wt(s),c=function(N){return _(g[N],N,g)}}var O=n(s,c,l);return O>-1?g[_?s[O]:O]:t}}function qp(n){return wn(function(s){var c=s.length,l=c,g=Lr.prototype.thru;for(n&&s.reverse();l--;){var _=s[l];if(typeof _!="function")throw new Fr(u);if(g&&!O&&la(_)=="wrapper")var O=new Lr([],!0)}for(l=O?l:c;++l<c;){_=s[l];var N=la(_),M=N=="wrapper"?Gu(_):t;M&&Qu(M[0])&&M[1]==(h|U|T|b)&&!M[4].length&&M[9]==1?O=O[la(M[0])].apply(O,M[3]):O=_.length==1&&Qu(_)?O[N]():O.thru(_)}return function(){var X=arguments,Z=X[0];if(O&&X.length==1&&Re(Z))return O.plant(Z).value();for(var ne=0,ue=c?s[ne].apply(this,X):Z;++ne<c;)ue=s[ne].call(this,ue);return ue}})}function aa(n,s,c,l,g,_,O,N,M,X){var Z=s&h,ne=s&K,ue=s&se,ve=s&(U|x),Ee=s&G,He=ue?t:Us(n);function De(){for(var Ge=arguments.length,Ze=z(Ge),Cr=Ge;Cr--;)Ze[Cr]=arguments[Cr];if(ve)var dr=Hi(De),Ar=V2(Ze,dr);if(l&&(Ze=$p(Ze,l,g,ve)),_&&(Ze=Fp(Ze,_,O,ve)),Ge-=Ar,ve&&Ge<X){var $t=Fn(Ze,dr);return zp(n,s,aa,De.placeholder,c,Ze,$t,N,M,X-Ge)}var Jr=ne?c:this,xn=ue?Jr[n]:n;return Ge=Ze.length,N?Ze=ZD(Ze,N):Ee&&Ge>1&&Ze.reverse(),Z&&M<Ge&&(Ze.length=M),this&&this!==Xe&&this instanceof De&&(xn=He||Us(xn)),xn.apply(Jr,Ze)}return De}function Hp(n,s){return function(c,l){return aD(c,n,s(l),{})}}function ca(n,s){return function(c,l){var g;if(c===t&&l===t)return s;if(c!==t&&(g=c),l!==t){if(g===t)return l;typeof c=="string"||typeof l=="string"?(c=Ir(c),l=Ir(l)):(c=Op(c),l=Op(l)),g=n(c,l)}return g}}function zu(n){return wn(function(s){return s=mt(s,Or(be())),Ke(function(c){var l=this;return n(s,function(g){return Gt(g,l,c)})})})}function ua(n,s){s=s===t?" ":Ir(s);var c=s.length;if(c<2)return c?Lu(s,n):s;var l=Lu(s,Yo(n/Ni(s)));return Ri(s)?qn(Gr(l),0,n).join(""):l.slice(0,n)}function $D(n,s,c,l){var g=s&K,_=Us(n);function O(){for(var N=-1,M=arguments.length,X=-1,Z=l.length,ne=z(Z+M),ue=this&&this!==Xe&&this instanceof O?_:n;++X<Z;)ne[X]=l[X];for(;M--;)ne[X++]=arguments[++N];return Gt(ue,g?c:this,ne)}return O}function Bp(n){return function(s,c,l){return l&&typeof l!="number"&&fr(s,c,l)&&(c=l=t),s=Sn(s),c===t?(c=s,s=0):c=Sn(c),l=l===t?s<c?1:-1:Sn(l),bD(s,c,l,n)}}function ha(n){return function(s,c){return typeof s=="string"&&typeof c=="string"||(s=qr(s),c=qr(c)),n(s,c)}}function zp(n,s,c,l,g,_,O,N,M,X){var Z=s&U,ne=Z?O:t,ue=Z?t:O,ve=Z?_:t,Ee=Z?t:_;s|=Z?T:E,s&=~(Z?E:T),s&$||(s&=~(K|se));var He=[n,s,g,ve,ne,Ee,ue,N,M,X],De=c.apply(t,He);return Qu(n)&&tg(De,He),De.placeholder=l,rg(De,n,s)}function Ku(n){var s=zt[n];return function(c,l){if(c=qr(c),l=l==null?0:tr(je(l),292),l&&rp(c)){var g=(nt(c)+"e").split("e"),_=s(g[0]+"e"+(+g[1]+l));return g=(nt(_)+"e").split("e"),+(g[0]+"e"+(+g[1]-l))}return s(c)}}var FD=Li&&1/Mo(new Li([,-0]))[1]==Q?function(n){return new Li(n)}:fh;function Kp(n){return function(s){var c=rr(s);return c==xe?mu(s):c==Oe?X2(s):K2(s,n(s))}}function mn(n,s,c,l,g,_,O,N){var M=s&se;if(!M&&typeof n!="function")throw new Fr(u);var X=l?l.length:0;if(X||(s&=~(T|E),l=g=t),O=O===t?O:Kt(je(O),0),N=N===t?N:je(N),X-=g?g.length:0,s&E){var Z=l,ne=g;l=g=t}var ue=M?t:Gu(n),ve=[n,s,c,l,g,Z,ne,_,O,N];if(ue&&JD(ve,ue),n=ve[0],s=ve[1],c=ve[2],l=ve[3],g=ve[4],N=ve[9]=ve[9]===t?M?0:n.length:Kt(ve[9]-X,0),!N&&s&(U|x)&&(s&=~(U|x)),!s||s==K)var Ee=RD(n,s,c);else s==U||s==x?Ee=ND(n,s,N):(s==T||s==(K|T))&&!g.length?Ee=$D(n,s,c,l):Ee=aa.apply(t,ve);var He=ue?Sp:tg;return rg(He(Ee,ve),n,s)}function Vp(n,s,c,l){return n===t||Yr(n,Fi[c])&&!it.call(l,c)?s:n}function kp(n,s,c,l,g,_){return Et(n)&&Et(s)&&(_.set(s,n),na(n,s,t,kp,_),_.delete(s)),n}function LD(n){return qs(n)?t:n}function Gp(n,s,c,l,g,_){var O=c&R,N=n.length,M=s.length;if(N!=M&&!(O&&M>N))return!1;var X=_.get(n),Z=_.get(s);if(X&&Z)return X==s&&Z==n;var ne=-1,ue=!0,ve=c&B?new oi:t;for(_.set(n,s),_.set(s,n);++ne<N;){var Ee=n[ne],He=s[ne];if(l)var De=O?l(He,Ee,ne,s,n,_):l(Ee,He,ne,n,s,_);if(De!==t){if(De)continue;ue=!1;break}if(ve){if(!pu(s,function(Ge,Ze){if(!Os(ve,Ze)&&(Ee===Ge||g(Ee,Ge,c,l,_)))return ve.push(Ze)})){ue=!1;break}}else if(!(Ee===He||g(Ee,He,c,l,_))){ue=!1;break}}return _.delete(n),_.delete(s),ue}function UD(n,s,c,l,g,_,O){switch(c){case Ce:if(n.byteLength!=s.byteLength||n.byteOffset!=s.byteOffset)return!1;n=n.buffer,s=s.buffer;case Se:return!(n.byteLength!=s.byteLength||!_(new Vo(n),new Vo(s)));case q:case F:case Be:return Yr(+n,+s);case A:return n.name==s.name&&n.message==s.message;case Me:case $e:return n==s+"";case xe:var N=mu;case Oe:var M=l&R;if(N||(N=Mo),n.size!=s.size&&!M)return!1;var X=O.get(n);if(X)return X==s;l|=B,O.set(n,s);var Z=Gp(N(n),N(s),l,g,_,O);return O.delete(n),Z;case Fe:if(Ts)return Ts.call(n)==Ts.call(s)}return!1}function jD(n,s,c,l,g,_){var O=c&R,N=Vu(n),M=N.length,X=Vu(s),Z=X.length;if(M!=Z&&!O)return!1;for(var ne=M;ne--;){var ue=N[ne];if(!(O?ue in s:it.call(s,ue)))return!1}var ve=_.get(n),Ee=_.get(s);if(ve&&Ee)return ve==s&&Ee==n;var He=!0;_.set(n,s),_.set(s,n);for(var De=O;++ne<M;){ue=N[ne];var Ge=n[ue],Ze=s[ue];if(l)var Cr=O?l(Ze,Ge,ue,s,n,_):l(Ge,Ze,ue,n,s,_);if(!(Cr===t?Ge===Ze||g(Ge,Ze,c,l,_):Cr)){He=!1;break}De||(De=ue=="constructor")}if(He&&!De){var dr=n.constructor,Ar=s.constructor;dr!=Ar&&"constructor"in n&&"constructor"in s&&!(typeof dr=="function"&&dr instanceof dr&&typeof Ar=="function"&&Ar instanceof Ar)&&(He=!1)}return _.delete(n),_.delete(s),He}function wn(n){return Zu(Zp(n,t,cg),n+"")}function Vu(n){return dp(n,Wt,Yu)}function ku(n){return dp(n,wr,Wp)}var Gu=Qo?function(n){return Qo.get(n)}:fh;function la(n){for(var s=n.name+"",c=Ui[s],l=it.call(Ui,s)?c.length:0;l--;){var g=c[l],_=g.func;if(_==null||_==n)return g.name}return s}function Hi(n){var s=it.call(y,"placeholder")?y:n;return s.placeholder}function be(){var n=y.iteratee||hh;return n=n===hh?vp:n,arguments.length?n(arguments[0],arguments[1]):n}function fa(n,s){var c=n.__data__;return kD(s)?c[typeof s=="string"?"string":"hash"]:c.map}function Wu(n){for(var s=Wt(n),c=s.length;c--;){var l=s[c],g=n[l];s[c]=[l,g,Qp(g)]}return s}function ui(n,s){var c=Y2(n,s);return gp(c)?c:t}function MD(n){var s=it.call(n,ii),c=n[ii];try{n[ii]=t;var l=!0}catch{}var g=zo.call(n);return l&&(s?n[ii]=c:delete n[ii]),g}var Yu=Eu?function(n){return n==null?[]:(n=ht(n),Nn(Eu(n),function(s){return ep.call(n,s)}))}:dh,Wp=Eu?function(n){for(var s=[];n;)$n(s,Yu(n)),n=ko(n);return s}:dh,rr=lr;(Du&&rr(new Du(new ArrayBuffer(1)))!=Ce||Ps&&rr(new Ps)!=xe||Su&&rr(Su.resolve())!=vt||Li&&rr(new Li)!=Oe||Cs&&rr(new Cs)!=Pe)&&(rr=function(n){var s=lr(n),c=s==Ue?n.constructor:t,l=c?hi(c):"";if(l)switch(l){case w6:return Ce;case E6:return xe;case D6:return vt;case S6:return Oe;case x6:return Pe}return s});function qD(n,s,c){for(var l=-1,g=c.length;++l<g;){var _=c[l],O=_.size;switch(_.type){case"drop":n+=O;break;case"dropRight":s-=O;break;case"take":s=tr(s,n+O);break;case"takeRight":n=Kt(n,s-O);break}}return{start:n,end:s}}function HD(n){var s=n.match(ft);return s?s[1].split(Mt):[]}function Yp(n,s,c){s=Mn(s,n);for(var l=-1,g=s.length,_=!1;++l<g;){var O=on(s[l]);if(!(_=n!=null&&c(n,O)))break;n=n[O]}return _||++l!=g?_:(g=n==null?0:n.length,!!g&&ba(g)&&En(O,g)&&(Re(n)||li(n)))}function BD(n){var s=n.length,c=new n.constructor(s);return s&&typeof n[0]=="string"&&it.call(n,"index")&&(c.index=n.index,c.input=n.input),c}function Jp(n){return typeof n.constructor=="function"&&!js(n)?ji(ko(n)):{}}function zD(n,s,c){var l=n.constructor;switch(s){case Se:return Bu(n);case q:case F:return new l(+n);case Ce:return OD(n,c);case ze:case Ie:case ke:case We:case et:case tt:case Qe:case cr:case yr:return Rp(n,c);case xe:return new l;case Be:case $e:return new l(n);case Me:return ID(n);case Oe:return new l;case Fe:return PD(n)}}function KD(n,s){var c=s.length;if(!c)return n;var l=c-1;return s[l]=(c>1?"& ":"")+s[l],s=s.join(c>2?", ":" "),n.replace(Pt,`{
80
- /* [wrapped with `+s+`] */
81
- `)}function VD(n){return Re(n)||li(n)||!!(tp&&n&&n[tp])}function En(n,s){var c=typeof n;return s=s??V,!!s&&(c=="number"||c!="symbol"&&Xc.test(n))&&n>-1&&n%1==0&&n<s}function fr(n,s,c){if(!Et(c))return!1;var l=typeof s;return(l=="number"?mr(c)&&En(s,c.length):l=="string"&&s in c)?Yr(c[s],n):!1}function Ju(n,s){if(Re(n))return!1;var c=typeof n;return c=="number"||c=="symbol"||c=="boolean"||n==null||Pr(n)?!0:Lt.test(n)||!bt.test(n)||s!=null&&n in ht(s)}function kD(n){var s=typeof n;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?n!=="__proto__":n===null}function Qu(n){var s=la(n),c=y[s];if(typeof c!="function"||!(s in Ye.prototype))return!1;if(n===c)return!0;var l=Gu(c);return!!l&&n===l[0]}function GD(n){return!!Qd&&Qd in n}var WD=Ho?Dn:ph;function js(n){var s=n&&n.constructor,c=typeof s=="function"&&s.prototype||Fi;return n===c}function Qp(n){return n===n&&!Et(n)}function Xp(n,s){return function(c){return c==null?!1:c[n]===s&&(s!==t||n in ht(c))}}function YD(n){var s=ya(n,function(l){return c.size===p&&c.clear(),l}),c=s.cache;return s}function JD(n,s){var c=n[1],l=s[1],g=c|l,_=g<(K|se|h),O=l==h&&c==U||l==h&&c==b&&n[7].length<=s[8]||l==(h|b)&&s[7].length<=s[8]&&c==U;if(!(_||O))return n;l&K&&(n[2]=s[2],g|=c&K?0:$);var N=s[3];if(N){var M=n[3];n[3]=M?$p(M,N,s[4]):N,n[4]=M?Fn(n[3],w):s[4]}return N=s[5],N&&(M=n[5],n[5]=M?Fp(M,N,s[6]):N,n[6]=M?Fn(n[5],w):s[6]),N=s[7],N&&(n[7]=N),l&h&&(n[8]=n[8]==null?s[8]:tr(n[8],s[8])),n[9]==null&&(n[9]=s[9]),n[0]=s[0],n[1]=g,n}function QD(n){var s=[];if(n!=null)for(var c in ht(n))s.push(c);return s}function XD(n){return zo.call(n)}function Zp(n,s,c){return s=Kt(s===t?n.length-1:s,0),function(){for(var l=arguments,g=-1,_=Kt(l.length-s,0),O=z(_);++g<_;)O[g]=l[s+g];g=-1;for(var N=z(s+1);++g<s;)N[g]=l[g];return N[s]=c(O),Gt(n,this,N)}}function eg(n,s){return s.length<2?n:ci(n,jr(s,0,-1))}function ZD(n,s){for(var c=n.length,l=tr(s.length,c),g=br(n);l--;){var _=s[l];n[l]=En(_,c)?g[_]:t}return n}function Xu(n,s){if(!(s==="constructor"&&typeof n[s]=="function")&&s!="__proto__")return n[s]}var tg=ng(Sp),Ms=p6||function(n,s){return Xe.setTimeout(n,s)},Zu=ng(ED);function rg(n,s,c){var l=s+"";return Zu(n,KD(l,eS(HD(l),c)))}function ng(n){var s=0,c=0;return function(){var l=_6(),g=de-(l-c);if(c=l,g>0){if(++s>=ce)return arguments[0]}else s=0;return n.apply(t,arguments)}}function da(n,s){var c=-1,l=n.length,g=l-1;for(s=s===t?l:s;++c<s;){var _=Fu(c,g),O=n[_];n[_]=n[c],n[c]=O}return n.length=s,n}var ig=YD(function(n){var s=[];return n.charCodeAt(0)===46&&s.push(""),n.replace(Ut,function(c,l,g,_){s.push(g?_.replace(kc,"$1"):l||c)}),s});function on(n){if(typeof n=="string"||Pr(n))return n;var s=n+"";return s=="0"&&1/n==-Q?"-0":s}function hi(n){if(n!=null){try{return Bo.call(n)}catch{}try{return n+""}catch{}}return""}function eS(n,s){return $r(we,function(c){var l="_."+c[0];s&c[1]&&!Uo(n,l)&&n.push(l)}),n.sort()}function sg(n){if(n instanceof Ye)return n.clone();var s=new Lr(n.__wrapped__,n.__chain__);return s.__actions__=br(n.__actions__),s.__index__=n.__index__,s.__values__=n.__values__,s}function tS(n,s,c){(c?fr(n,s,c):s===t)?s=1:s=Kt(je(s),0);var l=n==null?0:n.length;if(!l||s<1)return[];for(var g=0,_=0,O=z(Yo(l/s));g<l;)O[_++]=jr(n,g,g+=s);return O}function rS(n){for(var s=-1,c=n==null?0:n.length,l=0,g=[];++s<c;){var _=n[s];_&&(g[l++]=_)}return g}function nS(){var n=arguments.length;if(!n)return[];for(var s=z(n-1),c=arguments[0],l=n;l--;)s[l-1]=arguments[l];return $n(Re(c)?br(c):[c],Xt(s,1))}var iS=Ke(function(n,s){return Nt(n)?Ns(n,Xt(s,1,Nt,!0)):[]}),sS=Ke(function(n,s){var c=Mr(s);return Nt(c)&&(c=t),Nt(n)?Ns(n,Xt(s,1,Nt,!0),be(c,2)):[]}),oS=Ke(function(n,s){var c=Mr(s);return Nt(c)&&(c=t),Nt(n)?Ns(n,Xt(s,1,Nt,!0),t,c):[]});function aS(n,s,c){var l=n==null?0:n.length;return l?(s=c||s===t?1:je(s),jr(n,s<0?0:s,l)):[]}function cS(n,s,c){var l=n==null?0:n.length;return l?(s=c||s===t?1:je(s),s=l-s,jr(n,0,s<0?0:s)):[]}function uS(n,s){return n&&n.length?sa(n,be(s,3),!0,!0):[]}function hS(n,s){return n&&n.length?sa(n,be(s,3),!0):[]}function lS(n,s,c,l){var g=n==null?0:n.length;return g?(c&&typeof c!="number"&&fr(n,s,c)&&(c=0,l=g),nD(n,s,c,l)):[]}function og(n,s,c){var l=n==null?0:n.length;if(!l)return-1;var g=c==null?0:je(c);return g<0&&(g=Kt(l+g,0)),jo(n,be(s,3),g)}function ag(n,s,c){var l=n==null?0:n.length;if(!l)return-1;var g=l-1;return c!==t&&(g=je(c),g=c<0?Kt(l+g,0):tr(g,l-1)),jo(n,be(s,3),g,!0)}function cg(n){var s=n==null?0:n.length;return s?Xt(n,1):[]}function fS(n){var s=n==null?0:n.length;return s?Xt(n,Q):[]}function dS(n,s){var c=n==null?0:n.length;return c?(s=s===t?1:je(s),Xt(n,s)):[]}function pS(n){for(var s=-1,c=n==null?0:n.length,l={};++s<c;){var g=n[s];l[g[0]]=g[1]}return l}function ug(n){return n&&n.length?n[0]:t}function gS(n,s,c){var l=n==null?0:n.length;if(!l)return-1;var g=c==null?0:je(c);return g<0&&(g=Kt(l+g,0)),Ti(n,s,g)}function vS(n){var s=n==null?0:n.length;return s?jr(n,0,-1):[]}var yS=Ke(function(n){var s=mt(n,qu);return s.length&&s[0]===n[0]?Au(s):[]}),_S=Ke(function(n){var s=Mr(n),c=mt(n,qu);return s===Mr(c)?s=t:c.pop(),c.length&&c[0]===n[0]?Au(c,be(s,2)):[]}),bS=Ke(function(n){var s=Mr(n),c=mt(n,qu);return s=typeof s=="function"?s:t,s&&c.pop(),c.length&&c[0]===n[0]?Au(c,t,s):[]});function mS(n,s){return n==null?"":v6.call(n,s)}function Mr(n){var s=n==null?0:n.length;return s?n[s-1]:t}function wS(n,s,c){var l=n==null?0:n.length;if(!l)return-1;var g=l;return c!==t&&(g=je(c),g=g<0?Kt(l+g,0):tr(g,l-1)),s===s?e6(n,s,g):jo(n,zd,g,!0)}function ES(n,s){return n&&n.length?mp(n,je(s)):t}var DS=Ke(hg);function hg(n,s){return n&&n.length&&s&&s.length?$u(n,s):n}function SS(n,s,c){return n&&n.length&&s&&s.length?$u(n,s,be(c,2)):n}function xS(n,s,c){return n&&n.length&&s&&s.length?$u(n,s,t,c):n}var OS=wn(function(n,s){var c=n==null?0:n.length,l=Ou(n,s);return Dp(n,mt(s,function(g){return En(g,c)?+g:g}).sort(Np)),l});function IS(n,s){var c=[];if(!(n&&n.length))return c;var l=-1,g=[],_=n.length;for(s=be(s,3);++l<_;){var O=n[l];s(O,l,n)&&(c.push(O),g.push(l))}return Dp(n,g),c}function eh(n){return n==null?n:m6.call(n)}function PS(n,s,c){var l=n==null?0:n.length;return l?(c&&typeof c!="number"&&fr(n,s,c)?(s=0,c=l):(s=s==null?0:je(s),c=c===t?l:je(c)),jr(n,s,c)):[]}function CS(n,s){return ia(n,s)}function AS(n,s,c){return Uu(n,s,be(c,2))}function TS(n,s){var c=n==null?0:n.length;if(c){var l=ia(n,s);if(l<c&&Yr(n[l],s))return l}return-1}function RS(n,s){return ia(n,s,!0)}function NS(n,s,c){return Uu(n,s,be(c,2),!0)}function $S(n,s){var c=n==null?0:n.length;if(c){var l=ia(n,s,!0)-1;if(Yr(n[l],s))return l}return-1}function FS(n){return n&&n.length?xp(n):[]}function LS(n,s){return n&&n.length?xp(n,be(s,2)):[]}function US(n){var s=n==null?0:n.length;return s?jr(n,1,s):[]}function jS(n,s,c){return n&&n.length?(s=c||s===t?1:je(s),jr(n,0,s<0?0:s)):[]}function MS(n,s,c){var l=n==null?0:n.length;return l?(s=c||s===t?1:je(s),s=l-s,jr(n,s<0?0:s,l)):[]}function qS(n,s){return n&&n.length?sa(n,be(s,3),!1,!0):[]}function HS(n,s){return n&&n.length?sa(n,be(s,3)):[]}var BS=Ke(function(n){return jn(Xt(n,1,Nt,!0))}),zS=Ke(function(n){var s=Mr(n);return Nt(s)&&(s=t),jn(Xt(n,1,Nt,!0),be(s,2))}),KS=Ke(function(n){var s=Mr(n);return s=typeof s=="function"?s:t,jn(Xt(n,1,Nt,!0),t,s)});function VS(n){return n&&n.length?jn(n):[]}function kS(n,s){return n&&n.length?jn(n,be(s,2)):[]}function GS(n,s){return s=typeof s=="function"?s:t,n&&n.length?jn(n,t,s):[]}function th(n){if(!(n&&n.length))return[];var s=0;return n=Nn(n,function(c){if(Nt(c))return s=Kt(c.length,s),!0}),_u(s,function(c){return mt(n,gu(c))})}function lg(n,s){if(!(n&&n.length))return[];var c=th(n);return s==null?c:mt(c,function(l){return Gt(s,t,l)})}var WS=Ke(function(n,s){return Nt(n)?Ns(n,s):[]}),YS=Ke(function(n){return Mu(Nn(n,Nt))}),JS=Ke(function(n){var s=Mr(n);return Nt(s)&&(s=t),Mu(Nn(n,Nt),be(s,2))}),QS=Ke(function(n){var s=Mr(n);return s=typeof s=="function"?s:t,Mu(Nn(n,Nt),t,s)}),XS=Ke(th);function ZS(n,s){return Cp(n||[],s||[],Rs)}function e5(n,s){return Cp(n||[],s||[],Ls)}var t5=Ke(function(n){var s=n.length,c=s>1?n[s-1]:t;return c=typeof c=="function"?(n.pop(),c):t,lg(n,c)});function fg(n){var s=y(n);return s.__chain__=!0,s}function r5(n,s){return s(n),n}function pa(n,s){return s(n)}var n5=wn(function(n){var s=n.length,c=s?n[0]:0,l=this.__wrapped__,g=function(_){return Ou(_,n)};return s>1||this.__actions__.length||!(l instanceof Ye)||!En(c)?this.thru(g):(l=l.slice(c,+c+(s?1:0)),l.__actions__.push({func:pa,args:[g],thisArg:t}),new Lr(l,this.__chain__).thru(function(_){return s&&!_.length&&_.push(t),_}))});function i5(){return fg(this)}function s5(){return new Lr(this.value(),this.__chain__)}function o5(){this.__values__===t&&(this.__values__=Og(this.value()));var n=this.__index__>=this.__values__.length,s=n?t:this.__values__[this.__index__++];return{done:n,value:s}}function a5(){return this}function c5(n){for(var s,c=this;c instanceof Zo;){var l=sg(c);l.__index__=0,l.__values__=t,s?g.__wrapped__=l:s=l;var g=l;c=c.__wrapped__}return g.__wrapped__=n,s}function u5(){var n=this.__wrapped__;if(n instanceof Ye){var s=n;return this.__actions__.length&&(s=new Ye(this)),s=s.reverse(),s.__actions__.push({func:pa,args:[eh],thisArg:t}),new Lr(s,this.__chain__)}return this.thru(eh)}function h5(){return Pp(this.__wrapped__,this.__actions__)}var l5=oa(function(n,s,c){it.call(n,c)?++n[c]:bn(n,c,1)});function f5(n,s,c){var l=Re(n)?Hd:rD;return c&&fr(n,s,c)&&(s=t),l(n,be(s,3))}function d5(n,s){var c=Re(n)?Nn:lp;return c(n,be(s,3))}var p5=Mp(og),g5=Mp(ag);function v5(n,s){return Xt(ga(n,s),1)}function y5(n,s){return Xt(ga(n,s),Q)}function _5(n,s,c){return c=c===t?1:je(c),Xt(ga(n,s),c)}function dg(n,s){var c=Re(n)?$r:Un;return c(n,be(s,3))}function pg(n,s){var c=Re(n)?U2:hp;return c(n,be(s,3))}var b5=oa(function(n,s,c){it.call(n,c)?n[c].push(s):bn(n,c,[s])});function m5(n,s,c,l){n=mr(n)?n:zi(n),c=c&&!l?je(c):0;var g=n.length;return c<0&&(c=Kt(g+c,0)),ma(n)?c<=g&&n.indexOf(s,c)>-1:!!g&&Ti(n,s,c)>-1}var w5=Ke(function(n,s,c){var l=-1,g=typeof s=="function",_=mr(n)?z(n.length):[];return Un(n,function(O){_[++l]=g?Gt(s,O,c):$s(O,s,c)}),_}),E5=oa(function(n,s,c){bn(n,c,s)});function ga(n,s){var c=Re(n)?mt:yp;return c(n,be(s,3))}function D5(n,s,c,l){return n==null?[]:(Re(s)||(s=s==null?[]:[s]),c=l?t:c,Re(c)||(c=c==null?[]:[c]),wp(n,s,c))}var S5=oa(function(n,s,c){n[c?0:1].push(s)},function(){return[[],[]]});function x5(n,s,c){var l=Re(n)?du:Vd,g=arguments.length<3;return l(n,be(s,4),c,g,Un)}function O5(n,s,c){var l=Re(n)?j2:Vd,g=arguments.length<3;return l(n,be(s,4),c,g,hp)}function I5(n,s){var c=Re(n)?Nn:lp;return c(n,_a(be(s,3)))}function P5(n){var s=Re(n)?op:mD;return s(n)}function C5(n,s,c){(c?fr(n,s,c):s===t)?s=1:s=je(s);var l=Re(n)?Q6:wD;return l(n,s)}function A5(n){var s=Re(n)?X6:DD;return s(n)}function T5(n){if(n==null)return 0;if(mr(n))return ma(n)?Ni(n):n.length;var s=rr(n);return s==xe||s==Oe?n.size:Ru(n).length}function R5(n,s,c){var l=Re(n)?pu:SD;return c&&fr(n,s,c)&&(s=t),l(n,be(s,3))}var N5=Ke(function(n,s){if(n==null)return[];var c=s.length;return c>1&&fr(n,s[0],s[1])?s=[]:c>2&&fr(s[0],s[1],s[2])&&(s=[s[0]]),wp(n,Xt(s,1),[])}),va=d6||function(){return Xe.Date.now()};function $5(n,s){if(typeof s!="function")throw new Fr(u);return n=je(n),function(){if(--n<1)return s.apply(this,arguments)}}function gg(n,s,c){return s=c?t:s,s=n&&s==null?n.length:s,mn(n,h,t,t,t,t,s)}function vg(n,s){var c;if(typeof s!="function")throw new Fr(u);return n=je(n),function(){return--n>0&&(c=s.apply(this,arguments)),n<=1&&(s=t),c}}var rh=Ke(function(n,s,c){var l=K;if(c.length){var g=Fn(c,Hi(rh));l|=T}return mn(n,l,s,c,g)}),yg=Ke(function(n,s,c){var l=K|se;if(c.length){var g=Fn(c,Hi(yg));l|=T}return mn(s,l,n,c,g)});function _g(n,s,c){s=c?t:s;var l=mn(n,U,t,t,t,t,t,s);return l.placeholder=_g.placeholder,l}function bg(n,s,c){s=c?t:s;var l=mn(n,x,t,t,t,t,t,s);return l.placeholder=bg.placeholder,l}function mg(n,s,c){var l,g,_,O,N,M,X=0,Z=!1,ne=!1,ue=!0;if(typeof n!="function")throw new Fr(u);s=qr(s)||0,Et(c)&&(Z=!!c.leading,ne="maxWait"in c,_=ne?Kt(qr(c.maxWait)||0,s):_,ue="trailing"in c?!!c.trailing:ue);function ve($t){var Jr=l,xn=g;return l=g=t,X=$t,O=n.apply(xn,Jr),O}function Ee($t){return X=$t,N=Ms(Ge,s),Z?ve($t):O}function He($t){var Jr=$t-M,xn=$t-X,Mg=s-Jr;return ne?tr(Mg,_-xn):Mg}function De($t){var Jr=$t-M,xn=$t-X;return M===t||Jr>=s||Jr<0||ne&&xn>=_}function Ge(){var $t=va();if(De($t))return Ze($t);N=Ms(Ge,He($t))}function Ze($t){return N=t,ue&&l?ve($t):(l=g=t,O)}function Cr(){N!==t&&Ap(N),X=0,l=M=g=N=t}function dr(){return N===t?O:Ze(va())}function Ar(){var $t=va(),Jr=De($t);if(l=arguments,g=this,M=$t,Jr){if(N===t)return Ee(M);if(ne)return Ap(N),N=Ms(Ge,s),ve(M)}return N===t&&(N=Ms(Ge,s)),O}return Ar.cancel=Cr,Ar.flush=dr,Ar}var F5=Ke(function(n,s){return up(n,1,s)}),L5=Ke(function(n,s,c){return up(n,qr(s)||0,c)});function U5(n){return mn(n,G)}function ya(n,s){if(typeof n!="function"||s!=null&&typeof s!="function")throw new Fr(u);var c=function(){var l=arguments,g=s?s.apply(this,l):l[0],_=c.cache;if(_.has(g))return _.get(g);var O=n.apply(this,l);return c.cache=_.set(g,O)||_,O};return c.cache=new(ya.Cache||_n),c}ya.Cache=_n;function _a(n){if(typeof n!="function")throw new Fr(u);return function(){var s=arguments;switch(s.length){case 0:return!n.call(this);case 1:return!n.call(this,s[0]);case 2:return!n.call(this,s[0],s[1]);case 3:return!n.call(this,s[0],s[1],s[2])}return!n.apply(this,s)}}function j5(n){return vg(2,n)}var M5=xD(function(n,s){s=s.length==1&&Re(s[0])?mt(s[0],Or(be())):mt(Xt(s,1),Or(be()));var c=s.length;return Ke(function(l){for(var g=-1,_=tr(l.length,c);++g<_;)l[g]=s[g].call(this,l[g]);return Gt(n,this,l)})}),nh=Ke(function(n,s){var c=Fn(s,Hi(nh));return mn(n,T,t,s,c)}),wg=Ke(function(n,s){var c=Fn(s,Hi(wg));return mn(n,E,t,s,c)}),q5=wn(function(n,s){return mn(n,b,t,t,t,s)});function H5(n,s){if(typeof n!="function")throw new Fr(u);return s=s===t?s:je(s),Ke(n,s)}function B5(n,s){if(typeof n!="function")throw new Fr(u);return s=s==null?0:Kt(je(s),0),Ke(function(c){var l=c[s],g=qn(c,0,s);return l&&$n(g,l),Gt(n,this,g)})}function z5(n,s,c){var l=!0,g=!0;if(typeof n!="function")throw new Fr(u);return Et(c)&&(l="leading"in c?!!c.leading:l,g="trailing"in c?!!c.trailing:g),mg(n,s,{leading:l,maxWait:s,trailing:g})}function K5(n){return gg(n,1)}function V5(n,s){return nh(Hu(s),n)}function k5(){if(!arguments.length)return[];var n=arguments[0];return Re(n)?n:[n]}function G5(n){return Ur(n,C)}function W5(n,s){return s=typeof s=="function"?s:t,Ur(n,C,s)}function Y5(n){return Ur(n,I|C)}function J5(n,s){return s=typeof s=="function"?s:t,Ur(n,I|C,s)}function Q5(n,s){return s==null||cp(n,s,Wt(s))}function Yr(n,s){return n===s||n!==n&&s!==s}var X5=ha(Cu),Z5=ha(function(n,s){return n>=s}),li=pp(function(){return arguments}())?pp:function(n){return Ct(n)&&it.call(n,"callee")&&!ep.call(n,"callee")},Re=z.isArray,ex=hr?Or(hr):cD;function mr(n){return n!=null&&ba(n.length)&&!Dn(n)}function Nt(n){return Ct(n)&&mr(n)}function tx(n){return n===!0||n===!1||Ct(n)&&lr(n)==q}var Hn=g6||ph,rx=kr?Or(kr):uD;function nx(n){return Ct(n)&&n.nodeType===1&&!qs(n)}function ix(n){if(n==null)return!0;if(mr(n)&&(Re(n)||typeof n=="string"||typeof n.splice=="function"||Hn(n)||Bi(n)||li(n)))return!n.length;var s=rr(n);if(s==xe||s==Oe)return!n.size;if(js(n))return!Ru(n).length;for(var c in n)if(it.call(n,c))return!1;return!0}function sx(n,s){return Fs(n,s)}function ox(n,s,c){c=typeof c=="function"?c:t;var l=c?c(n,s):t;return l===t?Fs(n,s,t,c):!!l}function ih(n){if(!Ct(n))return!1;var s=lr(n);return s==A||s==d||typeof n.message=="string"&&typeof n.name=="string"&&!qs(n)}function ax(n){return typeof n=="number"&&rp(n)}function Dn(n){if(!Et(n))return!1;var s=lr(n);return s==ae||s==fe||s==H||s==yt}function Eg(n){return typeof n=="number"&&n==je(n)}function ba(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=V}function Et(n){var s=typeof n;return n!=null&&(s=="object"||s=="function")}function Ct(n){return n!=null&&typeof n=="object"}var Dg=Nr?Or(Nr):lD;function cx(n,s){return n===s||Tu(n,s,Wu(s))}function ux(n,s,c){return c=typeof c=="function"?c:t,Tu(n,s,Wu(s),c)}function hx(n){return Sg(n)&&n!=+n}function lx(n){if(WD(n))throw new Ae(a);return gp(n)}function fx(n){return n===null}function dx(n){return n==null}function Sg(n){return typeof n=="number"||Ct(n)&&lr(n)==Be}function qs(n){if(!Ct(n)||lr(n)!=Ue)return!1;var s=ko(n);if(s===null)return!0;var c=it.call(s,"constructor")&&s.constructor;return typeof c=="function"&&c instanceof c&&Bo.call(c)==u6}var sh=rn?Or(rn):fD;function px(n){return Eg(n)&&n>=-V&&n<=V}var xg=xs?Or(xs):dD;function ma(n){return typeof n=="string"||!Re(n)&&Ct(n)&&lr(n)==$e}function Pr(n){return typeof n=="symbol"||Ct(n)&&lr(n)==Fe}var Bi=ni?Or(ni):pD;function gx(n){return n===t}function vx(n){return Ct(n)&&rr(n)==Pe}function yx(n){return Ct(n)&&lr(n)==Le}var _x=ha(Nu),bx=ha(function(n,s){return n<=s});function Og(n){if(!n)return[];if(mr(n))return ma(n)?Gr(n):br(n);if(Is&&n[Is])return Q2(n[Is]());var s=rr(n),c=s==xe?mu:s==Oe?Mo:zi;return c(n)}function Sn(n){if(!n)return n===0?n:0;if(n=qr(n),n===Q||n===-Q){var s=n<0?-1:1;return s*k}return n===n?n:0}function je(n){var s=Sn(n),c=s%1;return s===s?c?s-c:s:0}function Ig(n){return n?ai(je(n),0,re):0}function qr(n){if(typeof n=="number")return n;if(Pr(n))return J;if(Et(n)){var s=typeof n.valueOf=="function"?n.valueOf():n;n=Et(s)?s+"":s}if(typeof n!="string")return n===0?n:+n;n=kd(n);var c=Yc.test(n);return c||Qc.test(n)?Te(n.slice(2),c?2:8):Wc.test(n)?J:+n}function Pg(n){return sn(n,wr(n))}function mx(n){return n?ai(je(n),-V,V):n===0?n:0}function nt(n){return n==null?"":Ir(n)}var wx=Mi(function(n,s){if(js(s)||mr(s)){sn(s,Wt(s),n);return}for(var c in s)it.call(s,c)&&Rs(n,c,s[c])}),Cg=Mi(function(n,s){sn(s,wr(s),n)}),wa=Mi(function(n,s,c,l){sn(s,wr(s),n,l)}),Ex=Mi(function(n,s,c,l){sn(s,Wt(s),n,l)}),Dx=wn(Ou);function Sx(n,s){var c=ji(n);return s==null?c:ap(c,s)}var xx=Ke(function(n,s){n=ht(n);var c=-1,l=s.length,g=l>2?s[2]:t;for(g&&fr(s[0],s[1],g)&&(l=1);++c<l;)for(var _=s[c],O=wr(_),N=-1,M=O.length;++N<M;){var X=O[N],Z=n[X];(Z===t||Yr(Z,Fi[X])&&!it.call(n,X))&&(n[X]=_[X])}return n}),Ox=Ke(function(n){return n.push(t,kp),Gt(Ag,t,n)});function Ix(n,s){return Bd(n,be(s,3),nn)}function Px(n,s){return Bd(n,be(s,3),Pu)}function Cx(n,s){return n==null?n:Iu(n,be(s,3),wr)}function Ax(n,s){return n==null?n:fp(n,be(s,3),wr)}function Tx(n,s){return n&&nn(n,be(s,3))}function Rx(n,s){return n&&Pu(n,be(s,3))}function Nx(n){return n==null?[]:ra(n,Wt(n))}function $x(n){return n==null?[]:ra(n,wr(n))}function oh(n,s,c){var l=n==null?t:ci(n,s);return l===t?c:l}function Fx(n,s){return n!=null&&Yp(n,s,iD)}function ah(n,s){return n!=null&&Yp(n,s,sD)}var Lx=Hp(function(n,s,c){s!=null&&typeof s.toString!="function"&&(s=zo.call(s)),n[s]=c},uh(Er)),Ux=Hp(function(n,s,c){s!=null&&typeof s.toString!="function"&&(s=zo.call(s)),it.call(n,s)?n[s].push(c):n[s]=[c]},be),jx=Ke($s);function Wt(n){return mr(n)?sp(n):Ru(n)}function wr(n){return mr(n)?sp(n,!0):gD(n)}function Mx(n,s){var c={};return s=be(s,3),nn(n,function(l,g,_){bn(c,s(l,g,_),l)}),c}function qx(n,s){var c={};return s=be(s,3),nn(n,function(l,g,_){bn(c,g,s(l,g,_))}),c}var Hx=Mi(function(n,s,c){na(n,s,c)}),Ag=Mi(function(n,s,c,l){na(n,s,c,l)}),Bx=wn(function(n,s){var c={};if(n==null)return c;var l=!1;s=mt(s,function(_){return _=Mn(_,n),l||(l=_.length>1),_}),sn(n,ku(n),c),l&&(c=Ur(c,I|S|C,LD));for(var g=s.length;g--;)ju(c,s[g]);return c});function zx(n,s){return Tg(n,_a(be(s)))}var Kx=wn(function(n,s){return n==null?{}:yD(n,s)});function Tg(n,s){if(n==null)return{};var c=mt(ku(n),function(l){return[l]});return s=be(s),Ep(n,c,function(l,g){return s(l,g[0])})}function Vx(n,s,c){s=Mn(s,n);var l=-1,g=s.length;for(g||(g=1,n=t);++l<g;){var _=n==null?t:n[on(s[l])];_===t&&(l=g,_=c),n=Dn(_)?_.call(n):_}return n}function kx(n,s,c){return n==null?n:Ls(n,s,c)}function Gx(n,s,c,l){return l=typeof l=="function"?l:t,n==null?n:Ls(n,s,c,l)}var Rg=Kp(Wt),Ng=Kp(wr);function Wx(n,s,c){var l=Re(n),g=l||Hn(n)||Bi(n);if(s=be(s,4),c==null){var _=n&&n.constructor;g?c=l?new _:[]:Et(n)?c=Dn(_)?ji(ko(n)):{}:c={}}return(g?$r:nn)(n,function(O,N,M){return s(c,O,N,M)}),c}function Yx(n,s){return n==null?!0:ju(n,s)}function Jx(n,s,c){return n==null?n:Ip(n,s,Hu(c))}function Qx(n,s,c,l){return l=typeof l=="function"?l:t,n==null?n:Ip(n,s,Hu(c),l)}function zi(n){return n==null?[]:bu(n,Wt(n))}function Xx(n){return n==null?[]:bu(n,wr(n))}function Zx(n,s,c){return c===t&&(c=s,s=t),c!==t&&(c=qr(c),c=c===c?c:0),s!==t&&(s=qr(s),s=s===s?s:0),ai(qr(n),s,c)}function eO(n,s,c){return s=Sn(s),c===t?(c=s,s=0):c=Sn(c),n=qr(n),oD(n,s,c)}function tO(n,s,c){if(c&&typeof c!="boolean"&&fr(n,s,c)&&(s=c=t),c===t&&(typeof s=="boolean"?(c=s,s=t):typeof n=="boolean"&&(c=n,n=t)),n===t&&s===t?(n=0,s=1):(n=Sn(n),s===t?(s=n,n=0):s=Sn(s)),n>s){var l=n;n=s,s=l}if(c||n%1||s%1){var g=np();return tr(n+g*(s-n+ct("1e-"+((g+"").length-1))),s)}return Fu(n,s)}var rO=qi(function(n,s,c){return s=s.toLowerCase(),n+(c?$g(s):s)});function $g(n){return ch(nt(n).toLowerCase())}function Fg(n){return n=nt(n),n&&n.replace(gn,k2).replace(hu,"")}function nO(n,s,c){n=nt(n),s=Ir(s);var l=n.length;c=c===t?l:ai(je(c),0,l);var g=c;return c-=s.length,c>=0&&n.slice(c,g)==s}function iO(n){return n=nt(n),n&&_t.test(n)?n.replace(Xn,G2):n}function sO(n){return n=nt(n),n&&jt.test(n)?n.replace(Ot,"\\$&"):n}var oO=qi(function(n,s,c){return n+(c?"-":"")+s.toLowerCase()}),aO=qi(function(n,s,c){return n+(c?" ":"")+s.toLowerCase()}),cO=jp("toLowerCase");function uO(n,s,c){n=nt(n),s=je(s);var l=s?Ni(n):0;if(!s||l>=s)return n;var g=(s-l)/2;return ua(Jo(g),c)+n+ua(Yo(g),c)}function hO(n,s,c){n=nt(n),s=je(s);var l=s?Ni(n):0;return s&&l<s?n+ua(s-l,c):n}function lO(n,s,c){n=nt(n),s=je(s);var l=s?Ni(n):0;return s&&l<s?ua(s-l,c)+n:n}function fO(n,s,c){return c||s==null?s=0:s&&(s=+s),b6(nt(n).replace(It,""),s||0)}function dO(n,s,c){return(c?fr(n,s,c):s===t)?s=1:s=je(s),Lu(nt(n),s)}function pO(){var n=arguments,s=nt(n[0]);return n.length<3?s:s.replace(n[1],n[2])}var gO=qi(function(n,s,c){return n+(c?"_":"")+s.toLowerCase()});function vO(n,s,c){return c&&typeof c!="number"&&fr(n,s,c)&&(s=c=t),c=c===t?re:c>>>0,c?(n=nt(n),n&&(typeof s=="string"||s!=null&&!sh(s))&&(s=Ir(s),!s&&Ri(n))?qn(Gr(n),0,c):n.split(s,c)):[]}var yO=qi(function(n,s,c){return n+(c?" ":"")+ch(s)});function _O(n,s,c){return n=nt(n),c=c==null?0:ai(je(c),0,n.length),s=Ir(s),n.slice(c,c+s.length)==s}function bO(n,s,c){var l=y.templateSettings;c&&fr(n,s,c)&&(s=t),n=nt(n),s=wa({},s,l,Vp);var g=wa({},s.imports,l.imports,Vp),_=Wt(g),O=bu(g,_),N,M,X=0,Z=s.interpolate||Si,ne="__p += '",ue=wu((s.escape||Si).source+"|"+Z.source+"|"+(Z===wt?Gc:Si).source+"|"+(s.evaluate||Si).source+"|$","g"),ve="//# sourceURL="+(it.call(s,"sourceURL")?(s.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++lu+"]")+`
82
- `;n.replace(ue,function(De,Ge,Ze,Cr,dr,Ar){return Ze||(Ze=Cr),ne+=n.slice(X,Ar).replace(Zc,W2),Ge&&(N=!0,ne+=`' +
83
- __e(`+Ge+`) +
84
- '`),dr&&(M=!0,ne+=`';
85
- `+dr+`;
86
- __p += '`),Ze&&(ne+=`' +
87
- ((__t = (`+Ze+`)) == null ? '' : __t) +
88
- '`),X=Ar+De.length,De}),ne+=`';
89
- `;var Ee=it.call(s,"variable")&&s.variable;if(!Ee)ne=`with (obj) {
90
- `+ne+`
79
+ */(function(t,e){(function(){var r,n="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",f=500,v="__lodash_placeholder__",E=1,_=2,S=4,P=1,j=2,H=1,Z=2,N=4,L=8,$=16,T=32,I=64,d=128,x=256,J=512,W=30,ee="...",de=800,me=16,O=1,U=2,ce=3,le=1/0,re=9007199254740991,ne=17976931348623157e292,ae=0/0,ie=4294967295,Ae=ie-1,ge=ie>>>1,Be=[["ary",d],["bind",H],["bindKey",Z],["curry",L],["curryRight",$],["flip",J],["partial",T],["partialRight",I],["rearg",x]],ye="[object Arguments]",Me="[object Array]",Q="[object AsyncFunction]",Y="[object Boolean]",z="[object Date]",w="[object DOMException]",F="[object Error]",we="[object Function]",ve="[object GeneratorFunction]",Ue="[object Map]",nt="[object Number]",at="[object Null]",Ge="[object Object]",Dt="[object Promise]",$t="[object Proxy]",Je="[object RegExp]",He="[object Set]",ke="[object String]",Ke="[object Symbol]",rt="[object Undefined]",je="[object WeakMap]",Ze="[object WeakSet]",b="[object ArrayBuffer]",p="[object DataView]",m="[object Float32Array]",D="[object Float64Array]",B="[object Int8Array]",K="[object Int16Array]",X="[object Int32Array]",Ee="[object Uint8Array]",Re="[object Uint8ClampedArray]",st="[object Uint16Array]",ht="[object Uint32Array]",lt=/\b__p \+= '';/g,Ur=/\b(__p \+=) '' \+/g,ti=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Di=/&(?:amp|lt|gt|quot|#39);/g,hs=/[&<>"']/g,Wt=RegExp(Di.source),Mt=RegExp(hs.source),zt=/<%-([\s\S]+?)%>/g,qt=/<%([\s\S]+?)%>/g,Bt=/<%=([\s\S]+?)%>/g,Ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nr=/^\w*$/,ir=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Vt=/[\\^$.*+?()[\]{}|]/g,sr=RegExp(Vt.source),Kt=/^\s+/,Jt=/\s/,Gt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pt=/\{\n\/\* \[wrapped with (.+)\] \*/,or=/,? & /,ar=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Zf=/[()=,{}\[\]\/\s]/,Yf=/\\(\\)?/g,Jf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fn=/\w*$/,Qf=/^[-+]0x[0-9a-f]+$/i,Xf=/^0b[01]+$/i,e0=/^\[object .+?Constructor\]$/,t0=/^0o[0-7]+$/i,r0=/^(?:0|[1-9]\d*)$/,ri=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,io=/($^)/,n0=/['\n\r\u2028\u2029\\]/g,so="\\ud800-\\udfff",i0="\\u0300-\\u036f",s0="\\ufe20-\\ufe2f",oo="\\u20d0-\\u20ff",ol=i0+s0+oo,al="\\u2700-\\u27bf",In="a-z\\xdf-\\xf6\\xf8-\\xff",o0="\\xac\\xb1\\xd7\\xf7",a0="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",c0="\\u2000-\\u206f",l0=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",cl="A-Z\\xc0-\\xd6\\xd8-\\xde",ll="\\ufe0e\\ufe0f",fs=o0+a0+c0+l0,Aa="['\u2019]",ds="["+so+"]",Da="["+fs+"]",ps="["+ol+"]",ul="\\d+",u0="["+al+"]",hl="["+In+"]",fl="[^"+so+fs+ul+al+In+cl+"]",ao="\\ud83c[\\udffb-\\udfff]",h0="(?:"+ps+"|"+ao+")",dl="[^"+so+"]",co="(?:\\ud83c[\\udde6-\\uddff]){2}",$i="[\\ud800-\\udbff][\\udc00-\\udfff]",tn="["+cl+"]",pl="\\u200d",gl="(?:"+hl+"|"+fl+")",Fn="(?:"+tn+"|"+fl+")",ml="(?:"+Aa+"(?:d|ll|m|re|s|t|ve))?",wl="(?:"+Aa+"(?:D|LL|M|RE|S|T|VE))?",vl=h0+"?",yl="["+ll+"]?",f0="(?:"+pl+"(?:"+[dl,co,$i].join("|")+")"+yl+vl+")*",ni="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",bl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",_l=yl+vl+f0,lo="(?:"+[u0,co,$i].join("|")+")"+_l,d0="(?:"+[dl+ps+"?",ps,co,$i,ds].join("|")+")",$a=RegExp(Aa,"g"),p0=RegExp(ps,"g"),uo=RegExp(ao+"(?="+ao+")|"+d0+_l,"g"),El=RegExp([tn+"?"+hl+"+"+ml+"(?="+[Da,tn,"$"].join("|")+")",Fn+"+"+wl+"(?="+[Da,tn+gl,"$"].join("|")+")",tn+"?"+gl+"+"+ml,tn+"+"+wl,bl,ni,ul,lo].join("|"),"g"),xl=RegExp("["+pl+so+ol+ll+"]"),gs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Cl=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],g0=-1,Ct={};Ct[m]=Ct[D]=Ct[B]=Ct[K]=Ct[X]=Ct[Ee]=Ct[Re]=Ct[st]=Ct[ht]=!0,Ct[ye]=Ct[Me]=Ct[b]=Ct[Y]=Ct[p]=Ct[z]=Ct[F]=Ct[we]=Ct[Ue]=Ct[nt]=Ct[Ge]=Ct[Je]=Ct[He]=Ct[ke]=Ct[je]=!1;var xt={};xt[ye]=xt[Me]=xt[b]=xt[p]=xt[Y]=xt[z]=xt[m]=xt[D]=xt[B]=xt[K]=xt[X]=xt[Ue]=xt[nt]=xt[Ge]=xt[Je]=xt[He]=xt[ke]=xt[Ke]=xt[Ee]=xt[Re]=xt[st]=xt[ht]=!0,xt[F]=xt[we]=xt[je]=!1;var R={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fe={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},It=parseFloat,Qe=parseInt,Tt=typeof ta=="object"&&ta&&ta.Object===Object&&ta,cr=typeof self=="object"&&self&&self.Object===Object&&self,mt=Tt||cr||Function("return this")(),St=e&&!e.nodeType&&e,Qt=St&&!0&&t&&!t.nodeType&&t,Vr=Qt&&Qt.exports===St,lr=Vr&&Tt.process,Rt=function(){try{var V=Qt&&Qt.require&&Qt.require("util").types;return V||lr&&lr.binding&&lr.binding("util")}catch{}}(),jr=Rt&&Rt.isArrayBuffer,Sn=Rt&&Rt.isDate,dn=Rt&&Rt.isMap,Bn=Rt&&Rt.isRegExp,Pa=Rt&&Rt.isSet,ms=Rt&&Rt.isTypedArray;function wr(V,se,te){switch(te.length){case 0:return V.call(se);case 1:return V.call(se,te[0]);case 2:return V.call(se,te[0],te[1]);case 3:return V.call(se,te[0],te[1],te[2])}return V.apply(se,te)}function OA(V,se,te,Ie){for(var Ye=-1,vt=V==null?0:V.length;++Ye<vt;){var hr=V[Ye];se(Ie,hr,te(hr),V)}return Ie}function pn(V,se){for(var te=-1,Ie=V==null?0:V.length;++te<Ie&&se(V[te],te,V)!==!1;);return V}function AA(V,se){for(var te=V==null?0:V.length;te--&&se(V[te],te,V)!==!1;);return V}function Om(V,se){for(var te=-1,Ie=V==null?0:V.length;++te<Ie;)if(!se(V[te],te,V))return!1;return!0}function Pi(V,se){for(var te=-1,Ie=V==null?0:V.length,Ye=0,vt=[];++te<Ie;){var hr=V[te];se(hr,te,V)&&(vt[Ye++]=hr)}return vt}function Il(V,se){var te=V==null?0:V.length;return!!te&&ho(V,se,0)>-1}function m0(V,se,te){for(var Ie=-1,Ye=V==null?0:V.length;++Ie<Ye;)if(te(se,V[Ie]))return!0;return!1}function jt(V,se){for(var te=-1,Ie=V==null?0:V.length,Ye=Array(Ie);++te<Ie;)Ye[te]=se(V[te],te,V);return Ye}function Ti(V,se){for(var te=-1,Ie=se.length,Ye=V.length;++te<Ie;)V[Ye+te]=se[te];return V}function w0(V,se,te,Ie){var Ye=-1,vt=V==null?0:V.length;for(Ie&&vt&&(te=V[++Ye]);++Ye<vt;)te=se(te,V[Ye],Ye,V);return te}function DA(V,se,te,Ie){var Ye=V==null?0:V.length;for(Ie&&Ye&&(te=V[--Ye]);Ye--;)te=se(te,V[Ye],Ye,V);return te}function v0(V,se){for(var te=-1,Ie=V==null?0:V.length;++te<Ie;)if(se(V[te],te,V))return!0;return!1}var $A=y0("length");function PA(V){return V.split("")}function TA(V){return V.match(ar)||[]}function Am(V,se,te){var Ie;return te(V,function(Ye,vt,hr){if(se(Ye,vt,hr))return Ie=vt,!1}),Ie}function Sl(V,se,te,Ie){for(var Ye=V.length,vt=te+(Ie?1:-1);Ie?vt--:++vt<Ye;)if(se(V[vt],vt,V))return vt;return-1}function ho(V,se,te){return se===se?zA(V,se,te):Sl(V,Dm,te)}function RA(V,se,te,Ie){for(var Ye=te-1,vt=V.length;++Ye<vt;)if(Ie(V[Ye],se))return Ye;return-1}function Dm(V){return V!==V}function $m(V,se){var te=V==null?0:V.length;return te?_0(V,se)/te:ae}function y0(V){return function(se){return se==null?r:se[V]}}function b0(V){return function(se){return V==null?r:V[se]}}function Pm(V,se,te,Ie,Ye){return Ye(V,function(vt,hr,Ot){te=Ie?(Ie=!1,vt):se(te,vt,hr,Ot)}),te}function NA(V,se){var te=V.length;for(V.sort(se);te--;)V[te]=V[te].value;return V}function _0(V,se){for(var te,Ie=-1,Ye=V.length;++Ie<Ye;){var vt=se(V[Ie]);vt!==r&&(te=te===r?vt:te+vt)}return te}function E0(V,se){for(var te=-1,Ie=Array(V);++te<V;)Ie[te]=se(te);return Ie}function LA(V,se){return jt(se,function(te){return[te,V[te]]})}function Tm(V){return V&&V.slice(0,Mm(V)+1).replace(Kt,"")}function rn(V){return function(se){return V(se)}}function x0(V,se){return jt(se,function(te){return V[te]})}function Ta(V,se){return V.has(se)}function Rm(V,se){for(var te=-1,Ie=V.length;++te<Ie&&ho(se,V[te],0)>-1;);return te}function Nm(V,se){for(var te=V.length;te--&&ho(se,V[te],0)>-1;);return te}function MA(V,se){for(var te=V.length,Ie=0;te--;)V[te]===se&&++Ie;return Ie}var UA=b0(R),jA=b0(q);function FA(V){return"\\"+Ce[V]}function BA(V,se){return V==null?r:V[se]}function fo(V){return xl.test(V)}function kA(V){return gs.test(V)}function HA(V){for(var se,te=[];!(se=V.next()).done;)te.push(se.value);return te}function C0(V){var se=-1,te=Array(V.size);return V.forEach(function(Ie,Ye){te[++se]=[Ye,Ie]}),te}function Lm(V,se){return function(te){return V(se(te))}}function Ri(V,se){for(var te=-1,Ie=V.length,Ye=0,vt=[];++te<Ie;){var hr=V[te];(hr===se||hr===v)&&(V[te]=v,vt[Ye++]=te)}return vt}function Ol(V){var se=-1,te=Array(V.size);return V.forEach(function(Ie){te[++se]=Ie}),te}function WA(V){var se=-1,te=Array(V.size);return V.forEach(function(Ie){te[++se]=[Ie,Ie]}),te}function zA(V,se,te){for(var Ie=te-1,Ye=V.length;++Ie<Ye;)if(V[Ie]===se)return Ie;return-1}function qA(V,se,te){for(var Ie=te+1;Ie--;)if(V[Ie]===se)return Ie;return Ie}function po(V){return fo(V)?KA(V):$A(V)}function On(V){return fo(V)?GA(V):PA(V)}function Mm(V){for(var se=V.length;se--&&Jt.test(V.charAt(se)););return se}var VA=b0(fe);function KA(V){for(var se=uo.lastIndex=0;uo.test(V);)++se;return se}function GA(V){return V.match(uo)||[]}function ZA(V){return V.match(El)||[]}var YA=function V(se){se=se==null?mt:go.defaults(mt.Object(),se,go.pick(mt,Cl));var te=se.Array,Ie=se.Date,Ye=se.Error,vt=se.Function,hr=se.Math,Ot=se.Object,I0=se.RegExp,JA=se.String,gn=se.TypeError,Al=te.prototype,QA=vt.prototype,mo=Ot.prototype,Dl=se["__core-js_shared__"],$l=QA.toString,bt=mo.hasOwnProperty,XA=0,Um=function(){var s=/[^.]+$/.exec(Dl&&Dl.keys&&Dl.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Pl=mo.toString,eD=$l.call(Ot),tD=mt._,rD=I0("^"+$l.call(bt).replace(Vt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tl=Vr?se.Buffer:r,Ni=se.Symbol,Rl=se.Uint8Array,jm=Tl?Tl.allocUnsafe:r,Nl=Lm(Ot.getPrototypeOf,Ot),Fm=Ot.create,Bm=mo.propertyIsEnumerable,Ll=Al.splice,km=Ni?Ni.isConcatSpreadable:r,Ra=Ni?Ni.iterator:r,ws=Ni?Ni.toStringTag:r,Ml=function(){try{var s=Es(Ot,"defineProperty");return s({},"",{}),s}catch{}}(),nD=se.clearTimeout!==mt.clearTimeout&&se.clearTimeout,iD=Ie&&Ie.now!==mt.Date.now&&Ie.now,sD=se.setTimeout!==mt.setTimeout&&se.setTimeout,Ul=hr.ceil,jl=hr.floor,S0=Ot.getOwnPropertySymbols,oD=Tl?Tl.isBuffer:r,Hm=se.isFinite,aD=Al.join,cD=Lm(Ot.keys,Ot),fr=hr.max,Or=hr.min,lD=Ie.now,uD=se.parseInt,Wm=hr.random,hD=Al.reverse,O0=Es(se,"DataView"),Na=Es(se,"Map"),A0=Es(se,"Promise"),wo=Es(se,"Set"),La=Es(se,"WeakMap"),Ma=Es(Ot,"create"),Fl=La&&new La,vo={},fD=xs(O0),dD=xs(Na),pD=xs(A0),gD=xs(wo),mD=xs(La),Bl=Ni?Ni.prototype:r,Ua=Bl?Bl.valueOf:r,zm=Bl?Bl.toString:r;function C(s){if(Zt(s)&&!Xe(s)&&!(s instanceof dt)){if(s instanceof mn)return s;if(bt.call(s,"__wrapped__"))return q2(s)}return new mn(s)}var yo=function(){function s(){}return function(a){if(!kt(a))return{};if(Fm)return Fm(a);s.prototype=a;var u=new s;return s.prototype=r,u}}();function kl(){}function mn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=r}C.templateSettings={escape:zt,evaluate:qt,interpolate:Bt,variable:"",imports:{_:C}},C.prototype=kl.prototype,C.prototype.constructor=C,mn.prototype=yo(kl.prototype),mn.prototype.constructor=mn;function dt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function wD(){var s=new dt(this.__wrapped__);return s.__actions__=Kr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Kr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Kr(this.__views__),s}function vD(){if(this.__filtered__){var s=new dt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function yD(){var s=this.__wrapped__.value(),a=this.__dir__,u=Xe(s),g=a<0,y=u?s.length:0,A=P$(0,y,this.__views__),M=A.start,k=A.end,G=k-M,ue=g?k:M-1,he=this.__iteratees__,pe=he.length,be=0,Pe=Or(G,this.__takeCount__);if(!u||!g&&y==G&&Pe==G)return p2(s,this.__actions__);var ze=[];e:for(;G--&&be<Pe;){ue+=a;for(var ot=-1,qe=s[ue];++ot<pe;){var ft=he[ot],wt=ft.iteratee,on=ft.type,kr=wt(qe);if(on==U)qe=kr;else if(!kr){if(on==O)continue e;break e}}ze[be++]=qe}return ze}dt.prototype=yo(kl.prototype),dt.prototype.constructor=dt;function vs(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function bD(){this.__data__=Ma?Ma(null):{},this.size=0}function _D(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function ED(s){var a=this.__data__;if(Ma){var u=a[s];return u===h?r:u}return bt.call(a,s)?a[s]:r}function xD(s){var a=this.__data__;return Ma?a[s]!==r:bt.call(a,s)}function CD(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Ma&&a===r?h:a,this}vs.prototype.clear=bD,vs.prototype.delete=_D,vs.prototype.get=ED,vs.prototype.has=xD,vs.prototype.set=CD;function ii(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function ID(){this.__data__=[],this.size=0}function SD(s){var a=this.__data__,u=Hl(a,s);if(u<0)return!1;var g=a.length-1;return u==g?a.pop():Ll.call(a,u,1),--this.size,!0}function OD(s){var a=this.__data__,u=Hl(a,s);return u<0?r:a[u][1]}function AD(s){return Hl(this.__data__,s)>-1}function DD(s,a){var u=this.__data__,g=Hl(u,s);return g<0?(++this.size,u.push([s,a])):u[g][1]=a,this}ii.prototype.clear=ID,ii.prototype.delete=SD,ii.prototype.get=OD,ii.prototype.has=AD,ii.prototype.set=DD;function si(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var g=s[a];this.set(g[0],g[1])}}function $D(){this.size=0,this.__data__={hash:new vs,map:new(Na||ii),string:new vs}}function PD(s){var a=eu(this,s).delete(s);return this.size-=a?1:0,a}function TD(s){return eu(this,s).get(s)}function RD(s){return eu(this,s).has(s)}function ND(s,a){var u=eu(this,s),g=u.size;return u.set(s,a),this.size+=u.size==g?0:1,this}si.prototype.clear=$D,si.prototype.delete=PD,si.prototype.get=TD,si.prototype.has=RD,si.prototype.set=ND;function ys(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new si;++a<u;)this.add(s[a])}function LD(s){return this.__data__.set(s,h),this}function MD(s){return this.__data__.has(s)}ys.prototype.add=ys.prototype.push=LD,ys.prototype.has=MD;function An(s){var a=this.__data__=new ii(s);this.size=a.size}function UD(){this.__data__=new ii,this.size=0}function jD(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function FD(s){return this.__data__.get(s)}function BD(s){return this.__data__.has(s)}function kD(s,a){var u=this.__data__;if(u instanceof ii){var g=u.__data__;if(!Na||g.length<i-1)return g.push([s,a]),this.size=++u.size,this;u=this.__data__=new si(g)}return u.set(s,a),this.size=u.size,this}An.prototype.clear=UD,An.prototype.delete=jD,An.prototype.get=FD,An.prototype.has=BD,An.prototype.set=kD;function qm(s,a){var u=Xe(s),g=!u&&Cs(s),y=!u&&!g&&Fi(s),A=!u&&!g&&!y&&xo(s),M=u||g||y||A,k=M?E0(s.length,JA):[],G=k.length;for(var ue in s)(a||bt.call(s,ue))&&!(M&&(ue=="length"||y&&(ue=="offset"||ue=="parent")||A&&(ue=="buffer"||ue=="byteLength"||ue=="byteOffset")||li(ue,G)))&&k.push(ue);return k}function Vm(s){var a=s.length;return a?s[F0(0,a-1)]:r}function HD(s,a){return tu(Kr(s),bs(a,0,s.length))}function WD(s){return tu(Kr(s))}function D0(s,a,u){(u!==r&&!Dn(s[a],u)||u===r&&!(a in s))&&oi(s,a,u)}function ja(s,a,u){var g=s[a];(!(bt.call(s,a)&&Dn(g,u))||u===r&&!(a in s))&&oi(s,a,u)}function Hl(s,a){for(var u=s.length;u--;)if(Dn(s[u][0],a))return u;return-1}function zD(s,a,u,g){return Li(s,function(y,A,M){a(g,y,u(y),M)}),g}function Km(s,a){return s&&Hn(a,vr(a),s)}function qD(s,a){return s&&Hn(a,Zr(a),s)}function oi(s,a,u){a=="__proto__"&&Ml?Ml(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function $0(s,a){for(var u=-1,g=a.length,y=te(g),A=s==null;++u<g;)y[u]=A?r:ud(s,a[u]);return y}function bs(s,a,u){return s===s&&(u!==r&&(s=s<=u?s:u),a!==r&&(s=s>=a?s:a)),s}function wn(s,a,u,g,y,A){var M,k=a&E,G=a&_,ue=a&S;if(u&&(M=y?u(s,g,y,A):u(s)),M!==r)return M;if(!kt(s))return s;var he=Xe(s);if(he){if(M=R$(s),!k)return Kr(s,M)}else{var pe=Ar(s),be=pe==we||pe==ve;if(Fi(s))return w2(s,k);if(pe==Ge||pe==ye||be&&!y){if(M=G||be?{}:M2(s),!k)return G?E$(s,qD(M,s)):_$(s,Km(M,s))}else{if(!xt[pe])return y?s:{};M=N$(s,pe,k)}}A||(A=new An);var Pe=A.get(s);if(Pe)return Pe;A.set(s,M),hw(s)?s.forEach(function(qe){M.add(wn(qe,a,u,qe,s,A))}):lw(s)&&s.forEach(function(qe,ft){M.set(ft,wn(qe,a,u,ft,s,A))});var ze=ue?G?Y0:Z0:G?Zr:vr,ot=he?r:ze(s);return pn(ot||s,function(qe,ft){ot&&(ft=qe,qe=s[ft]),ja(M,ft,wn(qe,a,u,ft,s,A))}),M}function VD(s){var a=vr(s);return function(u){return Gm(u,s,a)}}function Gm(s,a,u){var g=u.length;if(s==null)return!g;for(s=Ot(s);g--;){var y=u[g],A=a[y],M=s[y];if(M===r&&!(y in s)||!A(M))return!1}return!0}function Zm(s,a,u){if(typeof s!="function")throw new gn(c);return qa(function(){s.apply(r,u)},a)}function Fa(s,a,u,g){var y=-1,A=Il,M=!0,k=s.length,G=[],ue=a.length;if(!k)return G;u&&(a=jt(a,rn(u))),g?(A=m0,M=!1):a.length>=i&&(A=Ta,M=!1,a=new ys(a));e:for(;++y<k;){var he=s[y],pe=u==null?he:u(he);if(he=g||he!==0?he:0,M&&pe===pe){for(var be=ue;be--;)if(a[be]===pe)continue e;G.push(he)}else A(a,pe,g)||G.push(he)}return G}var Li=E2(kn),Ym=E2(T0,!0);function KD(s,a){var u=!0;return Li(s,function(g,y,A){return u=!!a(g,y,A),u}),u}function Wl(s,a,u){for(var g=-1,y=s.length;++g<y;){var A=s[g],M=a(A);if(M!=null&&(k===r?M===M&&!sn(M):u(M,k)))var k=M,G=A}return G}function GD(s,a,u,g){var y=s.length;for(u=it(u),u<0&&(u=-u>y?0:y+u),g=g===r||g>y?y:it(g),g<0&&(g+=y),g=u>g?0:dw(g);u<g;)s[u++]=a;return s}function Jm(s,a){var u=[];return Li(s,function(g,y,A){a(g,y,A)&&u.push(g)}),u}function xr(s,a,u,g,y){var A=-1,M=s.length;for(u||(u=M$),y||(y=[]);++A<M;){var k=s[A];a>0&&u(k)?a>1?xr(k,a-1,u,g,y):Ti(y,k):g||(y[y.length]=k)}return y}var P0=x2(),Qm=x2(!0);function kn(s,a){return s&&P0(s,a,vr)}function T0(s,a){return s&&Qm(s,a,vr)}function zl(s,a){return Pi(a,function(u){return ui(s[u])})}function _s(s,a){a=Ui(a,s);for(var u=0,g=a.length;s!=null&&u<g;)s=s[Wn(a[u++])];return u&&u==g?s:r}function Xm(s,a,u){var g=a(s);return Xe(s)?g:Ti(g,u(s))}function Fr(s){return s==null?s===r?rt:at:ws&&ws in Ot(s)?$$(s):W$(s)}function R0(s,a){return s>a}function ZD(s,a){return s!=null&&bt.call(s,a)}function YD(s,a){return s!=null&&a in Ot(s)}function JD(s,a,u){return s>=Or(a,u)&&s<fr(a,u)}function N0(s,a,u){for(var g=u?m0:Il,y=s[0].length,A=s.length,M=A,k=te(A),G=1/0,ue=[];M--;){var he=s[M];M&&a&&(he=jt(he,rn(a))),G=Or(he.length,G),k[M]=!u&&(a||y>=120&&he.length>=120)?new ys(M&&he):r}he=s[0];var pe=-1,be=k[0];e:for(;++pe<y&&ue.length<G;){var Pe=he[pe],ze=a?a(Pe):Pe;if(Pe=u||Pe!==0?Pe:0,!(be?Ta(be,ze):g(ue,ze,u))){for(M=A;--M;){var ot=k[M];if(!(ot?Ta(ot,ze):g(s[M],ze,u)))continue e}be&&be.push(ze),ue.push(Pe)}}return ue}function QD(s,a,u,g){return kn(s,function(y,A,M){a(g,u(y),A,M)}),g}function Ba(s,a,u){a=Ui(a,s),s=B2(s,a);var g=s==null?s:s[Wn(yn(a))];return g==null?r:wr(g,s,u)}function e2(s){return Zt(s)&&Fr(s)==ye}function XD(s){return Zt(s)&&Fr(s)==b}function e$(s){return Zt(s)&&Fr(s)==z}function ka(s,a,u,g,y){return s===a?!0:s==null||a==null||!Zt(s)&&!Zt(a)?s!==s&&a!==a:t$(s,a,u,g,ka,y)}function t$(s,a,u,g,y,A){var M=Xe(s),k=Xe(a),G=M?Me:Ar(s),ue=k?Me:Ar(a);G=G==ye?Ge:G,ue=ue==ye?Ge:ue;var he=G==Ge,pe=ue==Ge,be=G==ue;if(be&&Fi(s)){if(!Fi(a))return!1;M=!0,he=!1}if(be&&!he)return A||(A=new An),M||xo(s)?R2(s,a,u,g,y,A):A$(s,a,G,u,g,y,A);if(!(u&P)){var Pe=he&&bt.call(s,"__wrapped__"),ze=pe&&bt.call(a,"__wrapped__");if(Pe||ze){var ot=Pe?s.value():s,qe=ze?a.value():a;return A||(A=new An),y(ot,qe,u,g,A)}}return be?(A||(A=new An),D$(s,a,u,g,y,A)):!1}function r$(s){return Zt(s)&&Ar(s)==Ue}function L0(s,a,u,g){var y=u.length,A=y,M=!g;if(s==null)return!A;for(s=Ot(s);y--;){var k=u[y];if(M&&k[2]?k[1]!==s[k[0]]:!(k[0]in s))return!1}for(;++y<A;){k=u[y];var G=k[0],ue=s[G],he=k[1];if(M&&k[2]){if(ue===r&&!(G in s))return!1}else{var pe=new An;if(g)var be=g(ue,he,G,s,a,pe);if(!(be===r?ka(he,ue,P|j,g,pe):be))return!1}}return!0}function t2(s){if(!kt(s)||j$(s))return!1;var a=ui(s)?rD:e0;return a.test(xs(s))}function n$(s){return Zt(s)&&Fr(s)==Je}function i$(s){return Zt(s)&&Ar(s)==He}function s$(s){return Zt(s)&&au(s.length)&&!!Ct[Fr(s)]}function r2(s){return typeof s=="function"?s:s==null?Yr:typeof s=="object"?Xe(s)?s2(s[0],s[1]):i2(s):Cw(s)}function M0(s){if(!za(s))return cD(s);var a=[];for(var u in Ot(s))bt.call(s,u)&&u!="constructor"&&a.push(u);return a}function o$(s){if(!kt(s))return H$(s);var a=za(s),u=[];for(var g in s)g=="constructor"&&(a||!bt.call(s,g))||u.push(g);return u}function U0(s,a){return s<a}function n2(s,a){var u=-1,g=Gr(s)?te(s.length):[];return Li(s,function(y,A,M){g[++u]=a(y,A,M)}),g}function i2(s){var a=Q0(s);return a.length==1&&a[0][2]?j2(a[0][0],a[0][1]):function(u){return u===s||L0(u,s,a)}}function s2(s,a){return ed(s)&&U2(a)?j2(Wn(s),a):function(u){var g=ud(u,s);return g===r&&g===a?hd(u,s):ka(a,g,P|j)}}function ql(s,a,u,g,y){s!==a&&P0(a,function(A,M){if(y||(y=new An),kt(A))a$(s,a,M,u,ql,g,y);else{var k=g?g(rd(s,M),A,M+"",s,a,y):r;k===r&&(k=A),D0(s,M,k)}},Zr)}function a$(s,a,u,g,y,A,M){var k=rd(s,u),G=rd(a,u),ue=M.get(G);if(ue){D0(s,u,ue);return}var he=A?A(k,G,u+"",s,a,M):r,pe=he===r;if(pe){var be=Xe(G),Pe=!be&&Fi(G),ze=!be&&!Pe&&xo(G);he=G,be||Pe||ze?Xe(k)?he=k:Xt(k)?he=Kr(k):Pe?(pe=!1,he=w2(G,!0)):ze?(pe=!1,he=v2(G,!0)):he=[]:Va(G)||Cs(G)?(he=k,Cs(k)?he=pw(k):(!kt(k)||ui(k))&&(he=M2(G))):pe=!1}pe&&(M.set(G,he),y(he,G,g,A,M),M.delete(G)),D0(s,u,he)}function o2(s,a){var u=s.length;if(u)return a+=a<0?u:0,li(a,u)?s[a]:r}function a2(s,a,u){a.length?a=jt(a,function(A){return Xe(A)?function(M){return _s(M,A.length===1?A[0]:A)}:A}):a=[Yr];var g=-1;a=jt(a,rn(We()));var y=n2(s,function(A,M,k){var G=jt(a,function(ue){return ue(A)});return{criteria:G,index:++g,value:A}});return NA(y,function(A,M){return b$(A,M,u)})}function c$(s,a){return c2(s,a,function(u,g){return hd(s,g)})}function c2(s,a,u){for(var g=-1,y=a.length,A={};++g<y;){var M=a[g],k=_s(s,M);u(k,M)&&Ha(A,Ui(M,s),k)}return A}function l$(s){return function(a){return _s(a,s)}}function j0(s,a,u,g){var y=g?RA:ho,A=-1,M=a.length,k=s;for(s===a&&(a=Kr(a)),u&&(k=jt(s,rn(u)));++A<M;)for(var G=0,ue=a[A],he=u?u(ue):ue;(G=y(k,he,G,g))>-1;)k!==s&&Ll.call(k,G,1),Ll.call(s,G,1);return s}function l2(s,a){for(var u=s?a.length:0,g=u-1;u--;){var y=a[u];if(u==g||y!==A){var A=y;li(y)?Ll.call(s,y,1):H0(s,y)}}return s}function F0(s,a){return s+jl(Wm()*(a-s+1))}function u$(s,a,u,g){for(var y=-1,A=fr(Ul((a-s)/(u||1)),0),M=te(A);A--;)M[g?A:++y]=s,s+=u;return M}function B0(s,a){var u="";if(!s||a<1||a>re)return u;do a%2&&(u+=s),a=jl(a/2),a&&(s+=s);while(a);return u}function ct(s,a){return nd(F2(s,a,Yr),s+"")}function h$(s){return Vm(Co(s))}function f$(s,a){var u=Co(s);return tu(u,bs(a,0,u.length))}function Ha(s,a,u,g){if(!kt(s))return s;a=Ui(a,s);for(var y=-1,A=a.length,M=A-1,k=s;k!=null&&++y<A;){var G=Wn(a[y]),ue=u;if(G==="__proto__"||G==="constructor"||G==="prototype")return s;if(y!=M){var he=k[G];ue=g?g(he,G,k):r,ue===r&&(ue=kt(he)?he:li(a[y+1])?[]:{})}ja(k,G,ue),k=k[G]}return s}var u2=Fl?function(s,a){return Fl.set(s,a),s}:Yr,d$=Ml?function(s,a){return Ml(s,"toString",{configurable:!0,enumerable:!1,value:dd(a),writable:!0})}:Yr;function p$(s){return tu(Co(s))}function vn(s,a,u){var g=-1,y=s.length;a<0&&(a=-a>y?0:y+a),u=u>y?y:u,u<0&&(u+=y),y=a>u?0:u-a>>>0,a>>>=0;for(var A=te(y);++g<y;)A[g]=s[g+a];return A}function g$(s,a){var u;return Li(s,function(g,y,A){return u=a(g,y,A),!u}),!!u}function Vl(s,a,u){var g=0,y=s==null?g:s.length;if(typeof a=="number"&&a===a&&y<=ge){for(;g<y;){var A=g+y>>>1,M=s[A];M!==null&&!sn(M)&&(u?M<=a:M<a)?g=A+1:y=A}return y}return k0(s,a,Yr,u)}function k0(s,a,u,g){var y=0,A=s==null?0:s.length;if(A===0)return 0;a=u(a);for(var M=a!==a,k=a===null,G=sn(a),ue=a===r;y<A;){var he=jl((y+A)/2),pe=u(s[he]),be=pe!==r,Pe=pe===null,ze=pe===pe,ot=sn(pe);if(M)var qe=g||ze;else ue?qe=ze&&(g||be):k?qe=ze&&be&&(g||!Pe):G?qe=ze&&be&&!Pe&&(g||!ot):Pe||ot?qe=!1:qe=g?pe<=a:pe<a;qe?y=he+1:A=he}return Or(A,Ae)}function h2(s,a){for(var u=-1,g=s.length,y=0,A=[];++u<g;){var M=s[u],k=a?a(M):M;if(!u||!Dn(k,G)){var G=k;A[y++]=M===0?0:M}}return A}function f2(s){return typeof s=="number"?s:sn(s)?ae:+s}function nn(s){if(typeof s=="string")return s;if(Xe(s))return jt(s,nn)+"";if(sn(s))return zm?zm.call(s):"";var a=s+"";return a=="0"&&1/s==-le?"-0":a}function Mi(s,a,u){var g=-1,y=Il,A=s.length,M=!0,k=[],G=k;if(u)M=!1,y=m0;else if(A>=i){var ue=a?null:S$(s);if(ue)return Ol(ue);M=!1,y=Ta,G=new ys}else G=a?[]:k;e:for(;++g<A;){var he=s[g],pe=a?a(he):he;if(he=u||he!==0?he:0,M&&pe===pe){for(var be=G.length;be--;)if(G[be]===pe)continue e;a&&G.push(pe),k.push(he)}else y(G,pe,u)||(G!==k&&G.push(pe),k.push(he))}return k}function H0(s,a){return a=Ui(a,s),s=B2(s,a),s==null||delete s[Wn(yn(a))]}function d2(s,a,u,g){return Ha(s,a,u(_s(s,a)),g)}function Kl(s,a,u,g){for(var y=s.length,A=g?y:-1;(g?A--:++A<y)&&a(s[A],A,s););return u?vn(s,g?0:A,g?A+1:y):vn(s,g?A+1:0,g?y:A)}function p2(s,a){var u=s;return u instanceof dt&&(u=u.value()),w0(a,function(g,y){return y.func.apply(y.thisArg,Ti([g],y.args))},u)}function W0(s,a,u){var g=s.length;if(g<2)return g?Mi(s[0]):[];for(var y=-1,A=te(g);++y<g;)for(var M=s[y],k=-1;++k<g;)k!=y&&(A[y]=Fa(A[y]||M,s[k],a,u));return Mi(xr(A,1),a,u)}function g2(s,a,u){for(var g=-1,y=s.length,A=a.length,M={};++g<y;){var k=g<A?a[g]:r;u(M,s[g],k)}return M}function z0(s){return Xt(s)?s:[]}function q0(s){return typeof s=="function"?s:Yr}function Ui(s,a){return Xe(s)?s:ed(s,a)?[s]:z2(yt(s))}var m$=ct;function ji(s,a,u){var g=s.length;return u=u===r?g:u,!a&&u>=g?s:vn(s,a,u)}var m2=nD||function(s){return mt.clearTimeout(s)};function w2(s,a){if(a)return s.slice();var u=s.length,g=jm?jm(u):new s.constructor(u);return s.copy(g),g}function V0(s){var a=new s.constructor(s.byteLength);return new Rl(a).set(new Rl(s)),a}function w$(s,a){var u=a?V0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function v$(s){var a=new s.constructor(s.source,fn.exec(s));return a.lastIndex=s.lastIndex,a}function y$(s){return Ua?Ot(Ua.call(s)):{}}function v2(s,a){var u=a?V0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function y2(s,a){if(s!==a){var u=s!==r,g=s===null,y=s===s,A=sn(s),M=a!==r,k=a===null,G=a===a,ue=sn(a);if(!k&&!ue&&!A&&s>a||A&&M&&G&&!k&&!ue||g&&M&&G||!u&&G||!y)return 1;if(!g&&!A&&!ue&&s<a||ue&&u&&y&&!g&&!A||k&&u&&y||!M&&y||!G)return-1}return 0}function b$(s,a,u){for(var g=-1,y=s.criteria,A=a.criteria,M=y.length,k=u.length;++g<M;){var G=y2(y[g],A[g]);if(G){if(g>=k)return G;var ue=u[g];return G*(ue=="desc"?-1:1)}}return s.index-a.index}function b2(s,a,u,g){for(var y=-1,A=s.length,M=u.length,k=-1,G=a.length,ue=fr(A-M,0),he=te(G+ue),pe=!g;++k<G;)he[k]=a[k];for(;++y<M;)(pe||y<A)&&(he[u[y]]=s[y]);for(;ue--;)he[k++]=s[y++];return he}function _2(s,a,u,g){for(var y=-1,A=s.length,M=-1,k=u.length,G=-1,ue=a.length,he=fr(A-k,0),pe=te(he+ue),be=!g;++y<he;)pe[y]=s[y];for(var Pe=y;++G<ue;)pe[Pe+G]=a[G];for(;++M<k;)(be||y<A)&&(pe[Pe+u[M]]=s[y++]);return pe}function Kr(s,a){var u=-1,g=s.length;for(a||(a=te(g));++u<g;)a[u]=s[u];return a}function Hn(s,a,u,g){var y=!u;u||(u={});for(var A=-1,M=a.length;++A<M;){var k=a[A],G=g?g(u[k],s[k],k,u,s):r;G===r&&(G=s[k]),y?oi(u,k,G):ja(u,k,G)}return u}function _$(s,a){return Hn(s,X0(s),a)}function E$(s,a){return Hn(s,N2(s),a)}function Gl(s,a){return function(u,g){var y=Xe(u)?OA:zD,A=a?a():{};return y(u,s,We(g,2),A)}}function bo(s){return ct(function(a,u){var g=-1,y=u.length,A=y>1?u[y-1]:r,M=y>2?u[2]:r;for(A=s.length>3&&typeof A=="function"?(y--,A):r,M&&Br(u[0],u[1],M)&&(A=y<3?r:A,y=1),a=Ot(a);++g<y;){var k=u[g];k&&s(a,k,g,A)}return a})}function E2(s,a){return function(u,g){if(u==null)return u;if(!Gr(u))return s(u,g);for(var y=u.length,A=a?y:-1,M=Ot(u);(a?A--:++A<y)&&g(M[A],A,M)!==!1;);return u}}function x2(s){return function(a,u,g){for(var y=-1,A=Ot(a),M=g(a),k=M.length;k--;){var G=M[s?k:++y];if(u(A[G],G,A)===!1)break}return a}}function x$(s,a,u){var g=a&H,y=Wa(s);function A(){var M=this&&this!==mt&&this instanceof A?y:s;return M.apply(g?u:this,arguments)}return A}function C2(s){return function(a){a=yt(a);var u=fo(a)?On(a):r,g=u?u[0]:a.charAt(0),y=u?ji(u,1).join(""):a.slice(1);return g[s]()+y}}function _o(s){return function(a){return w0(Ew(_w(a).replace($a,"")),s,"")}}function Wa(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var u=yo(s.prototype),g=s.apply(u,a);return kt(g)?g:u}}function C$(s,a,u){var g=Wa(s);function y(){for(var A=arguments.length,M=te(A),k=A,G=Eo(y);k--;)M[k]=arguments[k];var ue=A<3&&M[0]!==G&&M[A-1]!==G?[]:Ri(M,G);if(A-=ue.length,A<u)return D2(s,a,Zl,y.placeholder,r,M,ue,r,r,u-A);var he=this&&this!==mt&&this instanceof y?g:s;return wr(he,this,M)}return y}function I2(s){return function(a,u,g){var y=Ot(a);if(!Gr(a)){var A=We(u,3);a=vr(a),u=function(k){return A(y[k],k,y)}}var M=s(a,u,g);return M>-1?y[A?a[M]:M]:r}}function S2(s){return ci(function(a){var u=a.length,g=u,y=mn.prototype.thru;for(s&&a.reverse();g--;){var A=a[g];if(typeof A!="function")throw new gn(c);if(y&&!M&&Xl(A)=="wrapper")var M=new mn([],!0)}for(g=M?g:u;++g<u;){A=a[g];var k=Xl(A),G=k=="wrapper"?J0(A):r;G&&td(G[0])&&G[1]==(d|L|T|x)&&!G[4].length&&G[9]==1?M=M[Xl(G[0])].apply(M,G[3]):M=A.length==1&&td(A)?M[k]():M.thru(A)}return function(){var ue=arguments,he=ue[0];if(M&&ue.length==1&&Xe(he))return M.plant(he).value();for(var pe=0,be=u?a[pe].apply(this,ue):he;++pe<u;)be=a[pe].call(this,be);return be}})}function Zl(s,a,u,g,y,A,M,k,G,ue){var he=a&d,pe=a&H,be=a&Z,Pe=a&(L|$),ze=a&J,ot=be?r:Wa(s);function qe(){for(var ft=arguments.length,wt=te(ft),on=ft;on--;)wt[on]=arguments[on];if(Pe)var kr=Eo(qe),an=MA(wt,kr);if(g&&(wt=b2(wt,g,y,Pe)),A&&(wt=_2(wt,A,M,Pe)),ft-=an,Pe&&ft<ue){var er=Ri(wt,kr);return D2(s,a,Zl,qe.placeholder,u,wt,er,k,G,ue-ft)}var $n=pe?u:this,fi=be?$n[s]:s;return ft=wt.length,k?wt=z$(wt,k):ze&&ft>1&&wt.reverse(),he&&G<ft&&(wt.length=G),this&&this!==mt&&this instanceof qe&&(fi=ot||Wa(fi)),fi.apply($n,wt)}return qe}function O2(s,a){return function(u,g){return QD(u,s,a(g),{})}}function Yl(s,a){return function(u,g){var y;if(u===r&&g===r)return a;if(u!==r&&(y=u),g!==r){if(y===r)return g;typeof u=="string"||typeof g=="string"?(u=nn(u),g=nn(g)):(u=f2(u),g=f2(g)),y=s(u,g)}return y}}function K0(s){return ci(function(a){return a=jt(a,rn(We())),ct(function(u){var g=this;return s(a,function(y){return wr(y,g,u)})})})}function Jl(s,a){a=a===r?" ":nn(a);var u=a.length;if(u<2)return u?B0(a,s):a;var g=B0(a,Ul(s/po(a)));return fo(a)?ji(On(g),0,s).join(""):g.slice(0,s)}function I$(s,a,u,g){var y=a&H,A=Wa(s);function M(){for(var k=-1,G=arguments.length,ue=-1,he=g.length,pe=te(he+G),be=this&&this!==mt&&this instanceof M?A:s;++ue<he;)pe[ue]=g[ue];for(;G--;)pe[ue++]=arguments[++k];return wr(be,y?u:this,pe)}return M}function A2(s){return function(a,u,g){return g&&typeof g!="number"&&Br(a,u,g)&&(u=g=r),a=hi(a),u===r?(u=a,a=0):u=hi(u),g=g===r?a<u?1:-1:hi(g),u$(a,u,g,s)}}function Ql(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=bn(a),u=bn(u)),s(a,u)}}function D2(s,a,u,g,y,A,M,k,G,ue){var he=a&L,pe=he?M:r,be=he?r:M,Pe=he?A:r,ze=he?r:A;a|=he?T:I,a&=~(he?I:T),a&N||(a&=~(H|Z));var ot=[s,a,y,Pe,pe,ze,be,k,G,ue],qe=u.apply(r,ot);return td(s)&&k2(qe,ot),qe.placeholder=g,H2(qe,s,a)}function G0(s){var a=hr[s];return function(u,g){if(u=bn(u),g=g==null?0:Or(it(g),292),g&&Hm(u)){var y=(yt(u)+"e").split("e"),A=a(y[0]+"e"+(+y[1]+g));return y=(yt(A)+"e").split("e"),+(y[0]+"e"+(+y[1]-g))}return a(u)}}var S$=wo&&1/Ol(new wo([,-0]))[1]==le?function(s){return new wo(s)}:md;function $2(s){return function(a){var u=Ar(a);return u==Ue?C0(a):u==He?WA(a):LA(a,s(a))}}function ai(s,a,u,g,y,A,M,k){var G=a&Z;if(!G&&typeof s!="function")throw new gn(c);var ue=g?g.length:0;if(ue||(a&=~(T|I),g=y=r),M=M===r?M:fr(it(M),0),k=k===r?k:it(k),ue-=y?y.length:0,a&I){var he=g,pe=y;g=y=r}var be=G?r:J0(s),Pe=[s,a,u,g,y,he,pe,A,M,k];if(be&&k$(Pe,be),s=Pe[0],a=Pe[1],u=Pe[2],g=Pe[3],y=Pe[4],k=Pe[9]=Pe[9]===r?G?0:s.length:fr(Pe[9]-ue,0),!k&&a&(L|$)&&(a&=~(L|$)),!a||a==H)var ze=x$(s,a,u);else a==L||a==$?ze=C$(s,a,k):(a==T||a==(H|T))&&!y.length?ze=I$(s,a,u,g):ze=Zl.apply(r,Pe);var ot=be?u2:k2;return H2(ot(ze,Pe),s,a)}function P2(s,a,u,g){return s===r||Dn(s,mo[u])&&!bt.call(g,u)?a:s}function T2(s,a,u,g,y,A){return kt(s)&&kt(a)&&(A.set(a,s),ql(s,a,r,T2,A),A.delete(a)),s}function O$(s){return Va(s)?r:s}function R2(s,a,u,g,y,A){var M=u&P,k=s.length,G=a.length;if(k!=G&&!(M&&G>k))return!1;var ue=A.get(s),he=A.get(a);if(ue&&he)return ue==a&&he==s;var pe=-1,be=!0,Pe=u&j?new ys:r;for(A.set(s,a),A.set(a,s);++pe<k;){var ze=s[pe],ot=a[pe];if(g)var qe=M?g(ot,ze,pe,a,s,A):g(ze,ot,pe,s,a,A);if(qe!==r){if(qe)continue;be=!1;break}if(Pe){if(!v0(a,function(ft,wt){if(!Ta(Pe,wt)&&(ze===ft||y(ze,ft,u,g,A)))return Pe.push(wt)})){be=!1;break}}else if(!(ze===ot||y(ze,ot,u,g,A))){be=!1;break}}return A.delete(s),A.delete(a),be}function A$(s,a,u,g,y,A,M){switch(u){case p:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case b:return!(s.byteLength!=a.byteLength||!A(new Rl(s),new Rl(a)));case Y:case z:case nt:return Dn(+s,+a);case F:return s.name==a.name&&s.message==a.message;case Je:case ke:return s==a+"";case Ue:var k=C0;case He:var G=g&P;if(k||(k=Ol),s.size!=a.size&&!G)return!1;var ue=M.get(s);if(ue)return ue==a;g|=j,M.set(s,a);var he=R2(k(s),k(a),g,y,A,M);return M.delete(s),he;case Ke:if(Ua)return Ua.call(s)==Ua.call(a)}return!1}function D$(s,a,u,g,y,A){var M=u&P,k=Z0(s),G=k.length,ue=Z0(a),he=ue.length;if(G!=he&&!M)return!1;for(var pe=G;pe--;){var be=k[pe];if(!(M?be in a:bt.call(a,be)))return!1}var Pe=A.get(s),ze=A.get(a);if(Pe&&ze)return Pe==a&&ze==s;var ot=!0;A.set(s,a),A.set(a,s);for(var qe=M;++pe<G;){be=k[pe];var ft=s[be],wt=a[be];if(g)var on=M?g(wt,ft,be,a,s,A):g(ft,wt,be,s,a,A);if(!(on===r?ft===wt||y(ft,wt,u,g,A):on)){ot=!1;break}qe||(qe=be=="constructor")}if(ot&&!qe){var kr=s.constructor,an=a.constructor;kr!=an&&"constructor"in s&&"constructor"in a&&!(typeof kr=="function"&&kr instanceof kr&&typeof an=="function"&&an instanceof an)&&(ot=!1)}return A.delete(s),A.delete(a),ot}function ci(s){return nd(F2(s,r,G2),s+"")}function Z0(s){return Xm(s,vr,X0)}function Y0(s){return Xm(s,Zr,N2)}var J0=Fl?function(s){return Fl.get(s)}:md;function Xl(s){for(var a=s.name+"",u=vo[a],g=bt.call(vo,a)?u.length:0;g--;){var y=u[g],A=y.func;if(A==null||A==s)return y.name}return a}function Eo(s){var a=bt.call(C,"placeholder")?C:s;return a.placeholder}function We(){var s=C.iteratee||pd;return s=s===pd?r2:s,arguments.length?s(arguments[0],arguments[1]):s}function eu(s,a){var u=s.__data__;return U$(a)?u[typeof a=="string"?"string":"hash"]:u.map}function Q0(s){for(var a=vr(s),u=a.length;u--;){var g=a[u],y=s[g];a[u]=[g,y,U2(y)]}return a}function Es(s,a){var u=BA(s,a);return t2(u)?u:r}function $$(s){var a=bt.call(s,ws),u=s[ws];try{s[ws]=r;var g=!0}catch{}var y=Pl.call(s);return g&&(a?s[ws]=u:delete s[ws]),y}var X0=S0?function(s){return s==null?[]:(s=Ot(s),Pi(S0(s),function(a){return Bm.call(s,a)}))}:wd,N2=S0?function(s){for(var a=[];s;)Ti(a,X0(s)),s=Nl(s);return a}:wd,Ar=Fr;(O0&&Ar(new O0(new ArrayBuffer(1)))!=p||Na&&Ar(new Na)!=Ue||A0&&Ar(A0.resolve())!=Dt||wo&&Ar(new wo)!=He||La&&Ar(new La)!=je)&&(Ar=function(s){var a=Fr(s),u=a==Ge?s.constructor:r,g=u?xs(u):"";if(g)switch(g){case fD:return p;case dD:return Ue;case pD:return Dt;case gD:return He;case mD:return je}return a});function P$(s,a,u){for(var g=-1,y=u.length;++g<y;){var A=u[g],M=A.size;switch(A.type){case"drop":s+=M;break;case"dropRight":a-=M;break;case"take":a=Or(a,s+M);break;case"takeRight":s=fr(s,a-M);break}}return{start:s,end:a}}function T$(s){var a=s.match(Pt);return a?a[1].split(or):[]}function L2(s,a,u){a=Ui(a,s);for(var g=-1,y=a.length,A=!1;++g<y;){var M=Wn(a[g]);if(!(A=s!=null&&u(s,M)))break;s=s[M]}return A||++g!=y?A:(y=s==null?0:s.length,!!y&&au(y)&&li(M,y)&&(Xe(s)||Cs(s)))}function R$(s){var a=s.length,u=new s.constructor(a);return a&&typeof s[0]=="string"&&bt.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function M2(s){return typeof s.constructor=="function"&&!za(s)?yo(Nl(s)):{}}function N$(s,a,u){var g=s.constructor;switch(a){case b:return V0(s);case Y:case z:return new g(+s);case p:return w$(s,u);case m:case D:case B:case K:case X:case Ee:case Re:case st:case ht:return v2(s,u);case Ue:return new g;case nt:case ke:return new g(s);case Je:return v$(s);case He:return new g;case Ke:return y$(s)}}function L$(s,a){var u=a.length;if(!u)return s;var g=u-1;return a[g]=(u>1?"& ":"")+a[g],a=a.join(u>2?", ":" "),s.replace(Gt,`{
80
+ /* [wrapped with `+a+`] */
81
+ `)}function M$(s){return Xe(s)||Cs(s)||!!(km&&s&&s[km])}function li(s,a){var u=typeof s;return a=a??re,!!a&&(u=="number"||u!="symbol"&&r0.test(s))&&s>-1&&s%1==0&&s<a}function Br(s,a,u){if(!kt(u))return!1;var g=typeof a;return(g=="number"?Gr(u)&&li(a,u.length):g=="string"&&a in u)?Dn(u[a],s):!1}function ed(s,a){if(Xe(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||sn(s)?!0:nr.test(s)||!Ut.test(s)||a!=null&&s in Ot(a)}function U$(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function td(s){var a=Xl(s),u=C[a];if(typeof u!="function"||!(a in dt.prototype))return!1;if(s===u)return!0;var g=J0(u);return!!g&&s===g[0]}function j$(s){return!!Um&&Um in s}var F$=Dl?ui:vd;function za(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||mo;return s===u}function U2(s){return s===s&&!kt(s)}function j2(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==r||s in Ot(u))}}function B$(s){var a=su(s,function(g){return u.size===f&&u.clear(),g}),u=a.cache;return a}function k$(s,a){var u=s[1],g=a[1],y=u|g,A=y<(H|Z|d),M=g==d&&u==L||g==d&&u==x&&s[7].length<=a[8]||g==(d|x)&&a[7].length<=a[8]&&u==L;if(!(A||M))return s;g&H&&(s[2]=a[2],y|=u&H?0:N);var k=a[3];if(k){var G=s[3];s[3]=G?b2(G,k,a[4]):k,s[4]=G?Ri(s[3],v):a[4]}return k=a[5],k&&(G=s[5],s[5]=G?_2(G,k,a[6]):k,s[6]=G?Ri(s[5],v):a[6]),k=a[7],k&&(s[7]=k),g&d&&(s[8]=s[8]==null?a[8]:Or(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=y,s}function H$(s){var a=[];if(s!=null)for(var u in Ot(s))a.push(u);return a}function W$(s){return Pl.call(s)}function F2(s,a,u){return a=fr(a===r?s.length-1:a,0),function(){for(var g=arguments,y=-1,A=fr(g.length-a,0),M=te(A);++y<A;)M[y]=g[a+y];y=-1;for(var k=te(a+1);++y<a;)k[y]=g[y];return k[a]=u(M),wr(s,this,k)}}function B2(s,a){return a.length<2?s:_s(s,vn(a,0,-1))}function z$(s,a){for(var u=s.length,g=Or(a.length,u),y=Kr(s);g--;){var A=a[g];s[g]=li(A,u)?y[A]:r}return s}function rd(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var k2=W2(u2),qa=sD||function(s,a){return mt.setTimeout(s,a)},nd=W2(d$);function H2(s,a,u){var g=a+"";return nd(s,L$(g,q$(T$(g),u)))}function W2(s){var a=0,u=0;return function(){var g=lD(),y=me-(g-u);if(u=g,y>0){if(++a>=de)return arguments[0]}else a=0;return s.apply(r,arguments)}}function tu(s,a){var u=-1,g=s.length,y=g-1;for(a=a===r?g:a;++u<a;){var A=F0(u,y),M=s[A];s[A]=s[u],s[u]=M}return s.length=a,s}var z2=B$(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(ir,function(u,g,y,A){a.push(y?A.replace(Yf,"$1"):g||u)}),a});function Wn(s){if(typeof s=="string"||sn(s))return s;var a=s+"";return a=="0"&&1/s==-le?"-0":a}function xs(s){if(s!=null){try{return $l.call(s)}catch{}try{return s+""}catch{}}return""}function q$(s,a){return pn(Be,function(u){var g="_."+u[0];a&u[1]&&!Il(s,g)&&s.push(g)}),s.sort()}function q2(s){if(s instanceof dt)return s.clone();var a=new mn(s.__wrapped__,s.__chain__);return a.__actions__=Kr(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function V$(s,a,u){(u?Br(s,a,u):a===r)?a=1:a=fr(it(a),0);var g=s==null?0:s.length;if(!g||a<1)return[];for(var y=0,A=0,M=te(Ul(g/a));y<g;)M[A++]=vn(s,y,y+=a);return M}function K$(s){for(var a=-1,u=s==null?0:s.length,g=0,y=[];++a<u;){var A=s[a];A&&(y[g++]=A)}return y}function G$(){var s=arguments.length;if(!s)return[];for(var a=te(s-1),u=arguments[0],g=s;g--;)a[g-1]=arguments[g];return Ti(Xe(u)?Kr(u):[u],xr(a,1))}var Z$=ct(function(s,a){return Xt(s)?Fa(s,xr(a,1,Xt,!0)):[]}),Y$=ct(function(s,a){var u=yn(a);return Xt(u)&&(u=r),Xt(s)?Fa(s,xr(a,1,Xt,!0),We(u,2)):[]}),J$=ct(function(s,a){var u=yn(a);return Xt(u)&&(u=r),Xt(s)?Fa(s,xr(a,1,Xt,!0),r,u):[]});function Q$(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),vn(s,a<0?0:a,g)):[]}function X$(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),a=g-a,vn(s,0,a<0?0:a)):[]}function eP(s,a){return s&&s.length?Kl(s,We(a,3),!0,!0):[]}function tP(s,a){return s&&s.length?Kl(s,We(a,3),!0):[]}function rP(s,a,u,g){var y=s==null?0:s.length;return y?(u&&typeof u!="number"&&Br(s,a,u)&&(u=0,g=y),GD(s,a,u,g)):[]}function V2(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=u==null?0:it(u);return y<0&&(y=fr(g+y,0)),Sl(s,We(a,3),y)}function K2(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=g-1;return u!==r&&(y=it(u),y=u<0?fr(g+y,0):Or(y,g-1)),Sl(s,We(a,3),y,!0)}function G2(s){var a=s==null?0:s.length;return a?xr(s,1):[]}function nP(s){var a=s==null?0:s.length;return a?xr(s,le):[]}function iP(s,a){var u=s==null?0:s.length;return u?(a=a===r?1:it(a),xr(s,a)):[]}function sP(s){for(var a=-1,u=s==null?0:s.length,g={};++a<u;){var y=s[a];g[y[0]]=y[1]}return g}function Z2(s){return s&&s.length?s[0]:r}function oP(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=u==null?0:it(u);return y<0&&(y=fr(g+y,0)),ho(s,a,y)}function aP(s){var a=s==null?0:s.length;return a?vn(s,0,-1):[]}var cP=ct(function(s){var a=jt(s,z0);return a.length&&a[0]===s[0]?N0(a):[]}),lP=ct(function(s){var a=yn(s),u=jt(s,z0);return a===yn(u)?a=r:u.pop(),u.length&&u[0]===s[0]?N0(u,We(a,2)):[]}),uP=ct(function(s){var a=yn(s),u=jt(s,z0);return a=typeof a=="function"?a:r,a&&u.pop(),u.length&&u[0]===s[0]?N0(u,r,a):[]});function hP(s,a){return s==null?"":aD.call(s,a)}function yn(s){var a=s==null?0:s.length;return a?s[a-1]:r}function fP(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var y=g;return u!==r&&(y=it(u),y=y<0?fr(g+y,0):Or(y,g-1)),a===a?qA(s,a,y):Sl(s,Dm,y,!0)}function dP(s,a){return s&&s.length?o2(s,it(a)):r}var pP=ct(Y2);function Y2(s,a){return s&&s.length&&a&&a.length?j0(s,a):s}function gP(s,a,u){return s&&s.length&&a&&a.length?j0(s,a,We(u,2)):s}function mP(s,a,u){return s&&s.length&&a&&a.length?j0(s,a,r,u):s}var wP=ci(function(s,a){var u=s==null?0:s.length,g=$0(s,a);return l2(s,jt(a,function(y){return li(y,u)?+y:y}).sort(y2)),g});function vP(s,a){var u=[];if(!(s&&s.length))return u;var g=-1,y=[],A=s.length;for(a=We(a,3);++g<A;){var M=s[g];a(M,g,s)&&(u.push(M),y.push(g))}return l2(s,y),u}function id(s){return s==null?s:hD.call(s)}function yP(s,a,u){var g=s==null?0:s.length;return g?(u&&typeof u!="number"&&Br(s,a,u)?(a=0,u=g):(a=a==null?0:it(a),u=u===r?g:it(u)),vn(s,a,u)):[]}function bP(s,a){return Vl(s,a)}function _P(s,a,u){return k0(s,a,We(u,2))}function EP(s,a){var u=s==null?0:s.length;if(u){var g=Vl(s,a);if(g<u&&Dn(s[g],a))return g}return-1}function xP(s,a){return Vl(s,a,!0)}function CP(s,a,u){return k0(s,a,We(u,2),!0)}function IP(s,a){var u=s==null?0:s.length;if(u){var g=Vl(s,a,!0)-1;if(Dn(s[g],a))return g}return-1}function SP(s){return s&&s.length?h2(s):[]}function OP(s,a){return s&&s.length?h2(s,We(a,2)):[]}function AP(s){var a=s==null?0:s.length;return a?vn(s,1,a):[]}function DP(s,a,u){return s&&s.length?(a=u||a===r?1:it(a),vn(s,0,a<0?0:a)):[]}function $P(s,a,u){var g=s==null?0:s.length;return g?(a=u||a===r?1:it(a),a=g-a,vn(s,a<0?0:a,g)):[]}function PP(s,a){return s&&s.length?Kl(s,We(a,3),!1,!0):[]}function TP(s,a){return s&&s.length?Kl(s,We(a,3)):[]}var RP=ct(function(s){return Mi(xr(s,1,Xt,!0))}),NP=ct(function(s){var a=yn(s);return Xt(a)&&(a=r),Mi(xr(s,1,Xt,!0),We(a,2))}),LP=ct(function(s){var a=yn(s);return a=typeof a=="function"?a:r,Mi(xr(s,1,Xt,!0),r,a)});function MP(s){return s&&s.length?Mi(s):[]}function UP(s,a){return s&&s.length?Mi(s,We(a,2)):[]}function jP(s,a){return a=typeof a=="function"?a:r,s&&s.length?Mi(s,r,a):[]}function sd(s){if(!(s&&s.length))return[];var a=0;return s=Pi(s,function(u){if(Xt(u))return a=fr(u.length,a),!0}),E0(a,function(u){return jt(s,y0(u))})}function J2(s,a){if(!(s&&s.length))return[];var u=sd(s);return a==null?u:jt(u,function(g){return wr(a,r,g)})}var FP=ct(function(s,a){return Xt(s)?Fa(s,a):[]}),BP=ct(function(s){return W0(Pi(s,Xt))}),kP=ct(function(s){var a=yn(s);return Xt(a)&&(a=r),W0(Pi(s,Xt),We(a,2))}),HP=ct(function(s){var a=yn(s);return a=typeof a=="function"?a:r,W0(Pi(s,Xt),r,a)}),WP=ct(sd);function zP(s,a){return g2(s||[],a||[],ja)}function qP(s,a){return g2(s||[],a||[],Ha)}var VP=ct(function(s){var a=s.length,u=a>1?s[a-1]:r;return u=typeof u=="function"?(s.pop(),u):r,J2(s,u)});function Q2(s){var a=C(s);return a.__chain__=!0,a}function KP(s,a){return a(s),s}function ru(s,a){return a(s)}var GP=ci(function(s){var a=s.length,u=a?s[0]:0,g=this.__wrapped__,y=function(A){return $0(A,s)};return a>1||this.__actions__.length||!(g instanceof dt)||!li(u)?this.thru(y):(g=g.slice(u,+u+(a?1:0)),g.__actions__.push({func:ru,args:[y],thisArg:r}),new mn(g,this.__chain__).thru(function(A){return a&&!A.length&&A.push(r),A}))});function ZP(){return Q2(this)}function YP(){return new mn(this.value(),this.__chain__)}function JP(){this.__values__===r&&(this.__values__=fw(this.value()));var s=this.__index__>=this.__values__.length,a=s?r:this.__values__[this.__index__++];return{done:s,value:a}}function QP(){return this}function XP(s){for(var a,u=this;u instanceof kl;){var g=q2(u);g.__index__=0,g.__values__=r,a?y.__wrapped__=g:a=g;var y=g;u=u.__wrapped__}return y.__wrapped__=s,a}function eT(){var s=this.__wrapped__;if(s instanceof dt){var a=s;return this.__actions__.length&&(a=new dt(this)),a=a.reverse(),a.__actions__.push({func:ru,args:[id],thisArg:r}),new mn(a,this.__chain__)}return this.thru(id)}function tT(){return p2(this.__wrapped__,this.__actions__)}var rT=Gl(function(s,a,u){bt.call(s,u)?++s[u]:oi(s,u,1)});function nT(s,a,u){var g=Xe(s)?Om:KD;return u&&Br(s,a,u)&&(a=r),g(s,We(a,3))}function iT(s,a){var u=Xe(s)?Pi:Jm;return u(s,We(a,3))}var sT=I2(V2),oT=I2(K2);function aT(s,a){return xr(nu(s,a),1)}function cT(s,a){return xr(nu(s,a),le)}function lT(s,a,u){return u=u===r?1:it(u),xr(nu(s,a),u)}function X2(s,a){var u=Xe(s)?pn:Li;return u(s,We(a,3))}function ew(s,a){var u=Xe(s)?AA:Ym;return u(s,We(a,3))}var uT=Gl(function(s,a,u){bt.call(s,u)?s[u].push(a):oi(s,u,[a])});function hT(s,a,u,g){s=Gr(s)?s:Co(s),u=u&&!g?it(u):0;var y=s.length;return u<0&&(u=fr(y+u,0)),cu(s)?u<=y&&s.indexOf(a,u)>-1:!!y&&ho(s,a,u)>-1}var fT=ct(function(s,a,u){var g=-1,y=typeof a=="function",A=Gr(s)?te(s.length):[];return Li(s,function(M){A[++g]=y?wr(a,M,u):Ba(M,a,u)}),A}),dT=Gl(function(s,a,u){oi(s,u,a)});function nu(s,a){var u=Xe(s)?jt:n2;return u(s,We(a,3))}function pT(s,a,u,g){return s==null?[]:(Xe(a)||(a=a==null?[]:[a]),u=g?r:u,Xe(u)||(u=u==null?[]:[u]),a2(s,a,u))}var gT=Gl(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function mT(s,a,u){var g=Xe(s)?w0:Pm,y=arguments.length<3;return g(s,We(a,4),u,y,Li)}function wT(s,a,u){var g=Xe(s)?DA:Pm,y=arguments.length<3;return g(s,We(a,4),u,y,Ym)}function vT(s,a){var u=Xe(s)?Pi:Jm;return u(s,ou(We(a,3)))}function yT(s){var a=Xe(s)?Vm:h$;return a(s)}function bT(s,a,u){(u?Br(s,a,u):a===r)?a=1:a=it(a);var g=Xe(s)?HD:f$;return g(s,a)}function _T(s){var a=Xe(s)?WD:p$;return a(s)}function ET(s){if(s==null)return 0;if(Gr(s))return cu(s)?po(s):s.length;var a=Ar(s);return a==Ue||a==He?s.size:M0(s).length}function xT(s,a,u){var g=Xe(s)?v0:g$;return u&&Br(s,a,u)&&(a=r),g(s,We(a,3))}var CT=ct(function(s,a){if(s==null)return[];var u=a.length;return u>1&&Br(s,a[0],a[1])?a=[]:u>2&&Br(a[0],a[1],a[2])&&(a=[a[0]]),a2(s,xr(a,1),[])}),iu=iD||function(){return mt.Date.now()};function IT(s,a){if(typeof a!="function")throw new gn(c);return s=it(s),function(){if(--s<1)return a.apply(this,arguments)}}function tw(s,a,u){return a=u?r:a,a=s&&a==null?s.length:a,ai(s,d,r,r,r,r,a)}function rw(s,a){var u;if(typeof a!="function")throw new gn(c);return s=it(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=r),u}}var od=ct(function(s,a,u){var g=H;if(u.length){var y=Ri(u,Eo(od));g|=T}return ai(s,g,a,u,y)}),nw=ct(function(s,a,u){var g=H|Z;if(u.length){var y=Ri(u,Eo(nw));g|=T}return ai(a,g,s,u,y)});function iw(s,a,u){a=u?r:a;var g=ai(s,L,r,r,r,r,r,a);return g.placeholder=iw.placeholder,g}function sw(s,a,u){a=u?r:a;var g=ai(s,$,r,r,r,r,r,a);return g.placeholder=sw.placeholder,g}function ow(s,a,u){var g,y,A,M,k,G,ue=0,he=!1,pe=!1,be=!0;if(typeof s!="function")throw new gn(c);a=bn(a)||0,kt(u)&&(he=!!u.leading,pe="maxWait"in u,A=pe?fr(bn(u.maxWait)||0,a):A,be="trailing"in u?!!u.trailing:be);function Pe(er){var $n=g,fi=y;return g=y=r,ue=er,M=s.apply(fi,$n),M}function ze(er){return ue=er,k=qa(ft,a),he?Pe(er):M}function ot(er){var $n=er-G,fi=er-ue,Iw=a-$n;return pe?Or(Iw,A-fi):Iw}function qe(er){var $n=er-G,fi=er-ue;return G===r||$n>=a||$n<0||pe&&fi>=A}function ft(){var er=iu();if(qe(er))return wt(er);k=qa(ft,ot(er))}function wt(er){return k=r,be&&g?Pe(er):(g=y=r,M)}function on(){k!==r&&m2(k),ue=0,g=G=y=k=r}function kr(){return k===r?M:wt(iu())}function an(){var er=iu(),$n=qe(er);if(g=arguments,y=this,G=er,$n){if(k===r)return ze(G);if(pe)return m2(k),k=qa(ft,a),Pe(G)}return k===r&&(k=qa(ft,a)),M}return an.cancel=on,an.flush=kr,an}var ST=ct(function(s,a){return Zm(s,1,a)}),OT=ct(function(s,a,u){return Zm(s,bn(a)||0,u)});function AT(s){return ai(s,J)}function su(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new gn(c);var u=function(){var g=arguments,y=a?a.apply(this,g):g[0],A=u.cache;if(A.has(y))return A.get(y);var M=s.apply(this,g);return u.cache=A.set(y,M)||A,M};return u.cache=new(su.Cache||si),u}su.Cache=si;function ou(s){if(typeof s!="function")throw new gn(c);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function DT(s){return rw(2,s)}var $T=m$(function(s,a){a=a.length==1&&Xe(a[0])?jt(a[0],rn(We())):jt(xr(a,1),rn(We()));var u=a.length;return ct(function(g){for(var y=-1,A=Or(g.length,u);++y<A;)g[y]=a[y].call(this,g[y]);return wr(s,this,g)})}),ad=ct(function(s,a){var u=Ri(a,Eo(ad));return ai(s,T,r,a,u)}),aw=ct(function(s,a){var u=Ri(a,Eo(aw));return ai(s,I,r,a,u)}),PT=ci(function(s,a){return ai(s,x,r,r,r,a)});function TT(s,a){if(typeof s!="function")throw new gn(c);return a=a===r?a:it(a),ct(s,a)}function RT(s,a){if(typeof s!="function")throw new gn(c);return a=a==null?0:fr(it(a),0),ct(function(u){var g=u[a],y=ji(u,0,a);return g&&Ti(y,g),wr(s,this,y)})}function NT(s,a,u){var g=!0,y=!0;if(typeof s!="function")throw new gn(c);return kt(u)&&(g="leading"in u?!!u.leading:g,y="trailing"in u?!!u.trailing:y),ow(s,a,{leading:g,maxWait:a,trailing:y})}function LT(s){return tw(s,1)}function MT(s,a){return ad(q0(a),s)}function UT(){if(!arguments.length)return[];var s=arguments[0];return Xe(s)?s:[s]}function jT(s){return wn(s,S)}function FT(s,a){return a=typeof a=="function"?a:r,wn(s,S,a)}function BT(s){return wn(s,E|S)}function kT(s,a){return a=typeof a=="function"?a:r,wn(s,E|S,a)}function HT(s,a){return a==null||Gm(s,a,vr(a))}function Dn(s,a){return s===a||s!==s&&a!==a}var WT=Ql(R0),zT=Ql(function(s,a){return s>=a}),Cs=e2(function(){return arguments}())?e2:function(s){return Zt(s)&&bt.call(s,"callee")&&!Bm.call(s,"callee")},Xe=te.isArray,qT=jr?rn(jr):XD;function Gr(s){return s!=null&&au(s.length)&&!ui(s)}function Xt(s){return Zt(s)&&Gr(s)}function VT(s){return s===!0||s===!1||Zt(s)&&Fr(s)==Y}var Fi=oD||vd,KT=Sn?rn(Sn):e$;function GT(s){return Zt(s)&&s.nodeType===1&&!Va(s)}function ZT(s){if(s==null)return!0;if(Gr(s)&&(Xe(s)||typeof s=="string"||typeof s.splice=="function"||Fi(s)||xo(s)||Cs(s)))return!s.length;var a=Ar(s);if(a==Ue||a==He)return!s.size;if(za(s))return!M0(s).length;for(var u in s)if(bt.call(s,u))return!1;return!0}function YT(s,a){return ka(s,a)}function JT(s,a,u){u=typeof u=="function"?u:r;var g=u?u(s,a):r;return g===r?ka(s,a,r,u):!!g}function cd(s){if(!Zt(s))return!1;var a=Fr(s);return a==F||a==w||typeof s.message=="string"&&typeof s.name=="string"&&!Va(s)}function QT(s){return typeof s=="number"&&Hm(s)}function ui(s){if(!kt(s))return!1;var a=Fr(s);return a==we||a==ve||a==Q||a==$t}function cw(s){return typeof s=="number"&&s==it(s)}function au(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=re}function kt(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function Zt(s){return s!=null&&typeof s=="object"}var lw=dn?rn(dn):r$;function XT(s,a){return s===a||L0(s,a,Q0(a))}function eR(s,a,u){return u=typeof u=="function"?u:r,L0(s,a,Q0(a),u)}function tR(s){return uw(s)&&s!=+s}function rR(s){if(F$(s))throw new Ye(o);return t2(s)}function nR(s){return s===null}function iR(s){return s==null}function uw(s){return typeof s=="number"||Zt(s)&&Fr(s)==nt}function Va(s){if(!Zt(s)||Fr(s)!=Ge)return!1;var a=Nl(s);if(a===null)return!0;var u=bt.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&$l.call(u)==eD}var ld=Bn?rn(Bn):n$;function sR(s){return cw(s)&&s>=-re&&s<=re}var hw=Pa?rn(Pa):i$;function cu(s){return typeof s=="string"||!Xe(s)&&Zt(s)&&Fr(s)==ke}function sn(s){return typeof s=="symbol"||Zt(s)&&Fr(s)==Ke}var xo=ms?rn(ms):s$;function oR(s){return s===r}function aR(s){return Zt(s)&&Ar(s)==je}function cR(s){return Zt(s)&&Fr(s)==Ze}var lR=Ql(U0),uR=Ql(function(s,a){return s<=a});function fw(s){if(!s)return[];if(Gr(s))return cu(s)?On(s):Kr(s);if(Ra&&s[Ra])return HA(s[Ra]());var a=Ar(s),u=a==Ue?C0:a==He?Ol:Co;return u(s)}function hi(s){if(!s)return s===0?s:0;if(s=bn(s),s===le||s===-le){var a=s<0?-1:1;return a*ne}return s===s?s:0}function it(s){var a=hi(s),u=a%1;return a===a?u?a-u:a:0}function dw(s){return s?bs(it(s),0,ie):0}function bn(s){if(typeof s=="number")return s;if(sn(s))return ae;if(kt(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=kt(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=Tm(s);var u=Xf.test(s);return u||t0.test(s)?Qe(s.slice(2),u?2:8):Qf.test(s)?ae:+s}function pw(s){return Hn(s,Zr(s))}function hR(s){return s?bs(it(s),-re,re):s===0?s:0}function yt(s){return s==null?"":nn(s)}var fR=bo(function(s,a){if(za(a)||Gr(a)){Hn(a,vr(a),s);return}for(var u in a)bt.call(a,u)&&ja(s,u,a[u])}),gw=bo(function(s,a){Hn(a,Zr(a),s)}),lu=bo(function(s,a,u,g){Hn(a,Zr(a),s,g)}),dR=bo(function(s,a,u,g){Hn(a,vr(a),s,g)}),pR=ci($0);function gR(s,a){var u=yo(s);return a==null?u:Km(u,a)}var mR=ct(function(s,a){s=Ot(s);var u=-1,g=a.length,y=g>2?a[2]:r;for(y&&Br(a[0],a[1],y)&&(g=1);++u<g;)for(var A=a[u],M=Zr(A),k=-1,G=M.length;++k<G;){var ue=M[k],he=s[ue];(he===r||Dn(he,mo[ue])&&!bt.call(s,ue))&&(s[ue]=A[ue])}return s}),wR=ct(function(s){return s.push(r,T2),wr(mw,r,s)});function vR(s,a){return Am(s,We(a,3),kn)}function yR(s,a){return Am(s,We(a,3),T0)}function bR(s,a){return s==null?s:P0(s,We(a,3),Zr)}function _R(s,a){return s==null?s:Qm(s,We(a,3),Zr)}function ER(s,a){return s&&kn(s,We(a,3))}function xR(s,a){return s&&T0(s,We(a,3))}function CR(s){return s==null?[]:zl(s,vr(s))}function IR(s){return s==null?[]:zl(s,Zr(s))}function ud(s,a,u){var g=s==null?r:_s(s,a);return g===r?u:g}function SR(s,a){return s!=null&&L2(s,a,ZD)}function hd(s,a){return s!=null&&L2(s,a,YD)}var OR=O2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=Pl.call(a)),s[a]=u},dd(Yr)),AR=O2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=Pl.call(a)),bt.call(s,a)?s[a].push(u):s[a]=[u]},We),DR=ct(Ba);function vr(s){return Gr(s)?qm(s):M0(s)}function Zr(s){return Gr(s)?qm(s,!0):o$(s)}function $R(s,a){var u={};return a=We(a,3),kn(s,function(g,y,A){oi(u,a(g,y,A),g)}),u}function PR(s,a){var u={};return a=We(a,3),kn(s,function(g,y,A){oi(u,y,a(g,y,A))}),u}var TR=bo(function(s,a,u){ql(s,a,u)}),mw=bo(function(s,a,u,g){ql(s,a,u,g)}),RR=ci(function(s,a){var u={};if(s==null)return u;var g=!1;a=jt(a,function(A){return A=Ui(A,s),g||(g=A.length>1),A}),Hn(s,Y0(s),u),g&&(u=wn(u,E|_|S,O$));for(var y=a.length;y--;)H0(u,a[y]);return u});function NR(s,a){return ww(s,ou(We(a)))}var LR=ci(function(s,a){return s==null?{}:c$(s,a)});function ww(s,a){if(s==null)return{};var u=jt(Y0(s),function(g){return[g]});return a=We(a),c2(s,u,function(g,y){return a(g,y[0])})}function MR(s,a,u){a=Ui(a,s);var g=-1,y=a.length;for(y||(y=1,s=r);++g<y;){var A=s==null?r:s[Wn(a[g])];A===r&&(g=y,A=u),s=ui(A)?A.call(s):A}return s}function UR(s,a,u){return s==null?s:Ha(s,a,u)}function jR(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:Ha(s,a,u,g)}var vw=$2(vr),yw=$2(Zr);function FR(s,a,u){var g=Xe(s),y=g||Fi(s)||xo(s);if(a=We(a,4),u==null){var A=s&&s.constructor;y?u=g?new A:[]:kt(s)?u=ui(A)?yo(Nl(s)):{}:u={}}return(y?pn:kn)(s,function(M,k,G){return a(u,M,k,G)}),u}function BR(s,a){return s==null?!0:H0(s,a)}function kR(s,a,u){return s==null?s:d2(s,a,q0(u))}function HR(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:d2(s,a,q0(u),g)}function Co(s){return s==null?[]:x0(s,vr(s))}function WR(s){return s==null?[]:x0(s,Zr(s))}function zR(s,a,u){return u===r&&(u=a,a=r),u!==r&&(u=bn(u),u=u===u?u:0),a!==r&&(a=bn(a),a=a===a?a:0),bs(bn(s),a,u)}function qR(s,a,u){return a=hi(a),u===r?(u=a,a=0):u=hi(u),s=bn(s),JD(s,a,u)}function VR(s,a,u){if(u&&typeof u!="boolean"&&Br(s,a,u)&&(a=u=r),u===r&&(typeof a=="boolean"?(u=a,a=r):typeof s=="boolean"&&(u=s,s=r)),s===r&&a===r?(s=0,a=1):(s=hi(s),a===r?(a=s,s=0):a=hi(a)),s>a){var g=s;s=a,a=g}if(u||s%1||a%1){var y=Wm();return Or(s+y*(a-s+It("1e-"+((y+"").length-1))),a)}return F0(s,a)}var KR=_o(function(s,a,u){return a=a.toLowerCase(),s+(u?bw(a):a)});function bw(s){return fd(yt(s).toLowerCase())}function _w(s){return s=yt(s),s&&s.replace(ri,UA).replace(p0,"")}function GR(s,a,u){s=yt(s),a=nn(a);var g=s.length;u=u===r?g:bs(it(u),0,g);var y=u;return u-=a.length,u>=0&&s.slice(u,y)==a}function ZR(s){return s=yt(s),s&&Mt.test(s)?s.replace(hs,jA):s}function YR(s){return s=yt(s),s&&sr.test(s)?s.replace(Vt,"\\$&"):s}var JR=_o(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),QR=_o(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),XR=C2("toLowerCase");function eN(s,a,u){s=yt(s),a=it(a);var g=a?po(s):0;if(!a||g>=a)return s;var y=(a-g)/2;return Jl(jl(y),u)+s+Jl(Ul(y),u)}function tN(s,a,u){s=yt(s),a=it(a);var g=a?po(s):0;return a&&g<a?s+Jl(a-g,u):s}function rN(s,a,u){s=yt(s),a=it(a);var g=a?po(s):0;return a&&g<a?Jl(a-g,u)+s:s}function nN(s,a,u){return u||a==null?a=0:a&&(a=+a),uD(yt(s).replace(Kt,""),a||0)}function iN(s,a,u){return(u?Br(s,a,u):a===r)?a=1:a=it(a),B0(yt(s),a)}function sN(){var s=arguments,a=yt(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var oN=_o(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function aN(s,a,u){return u&&typeof u!="number"&&Br(s,a,u)&&(a=u=r),u=u===r?ie:u>>>0,u?(s=yt(s),s&&(typeof a=="string"||a!=null&&!ld(a))&&(a=nn(a),!a&&fo(s))?ji(On(s),0,u):s.split(a,u)):[]}var cN=_o(function(s,a,u){return s+(u?" ":"")+fd(a)});function lN(s,a,u){return s=yt(s),u=u==null?0:bs(it(u),0,s.length),a=nn(a),s.slice(u,u+a.length)==a}function uN(s,a,u){var g=C.templateSettings;u&&Br(s,a,u)&&(a=r),s=yt(s),a=lu({},a,g,P2);var y=lu({},a.imports,g.imports,P2),A=vr(y),M=x0(y,A),k,G,ue=0,he=a.interpolate||io,pe="__p += '",be=I0((a.escape||io).source+"|"+he.source+"|"+(he===Bt?Jf:io).source+"|"+(a.evaluate||io).source+"|$","g"),Pe="//# sourceURL="+(bt.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++g0+"]")+`
82
+ `;s.replace(be,function(qe,ft,wt,on,kr,an){return wt||(wt=on),pe+=s.slice(ue,an).replace(n0,FA),ft&&(k=!0,pe+=`' +
83
+ __e(`+ft+`) +
84
+ '`),kr&&(G=!0,pe+=`';
85
+ `+kr+`;
86
+ __p += '`),wt&&(pe+=`' +
87
+ ((__t = (`+wt+`)) == null ? '' : __t) +
88
+ '`),ue=an+qe.length,qe}),pe+=`';
89
+ `;var ze=bt.call(a,"variable")&&a.variable;if(!ze)pe=`with (obj) {
90
+ `+pe+`
91
91
  }
92
- `;else if(Vc.test(Ee))throw new Ae(f);ne=(M?ne.replace(en,""):ne).replace(ur,"$1").replace(pn,"$1;"),ne="function("+(Ee||"obj")+`) {
93
- `+(Ee?"":`obj || (obj = {});
94
- `)+"var __t, __p = ''"+(N?", __e = _.escape":"")+(M?`, __j = Array.prototype.join;
92
+ `;else if(Zf.test(ze))throw new Ye(l);pe=(G?pe.replace(lt,""):pe).replace(Ur,"$1").replace(ti,"$1;"),pe="function("+(ze||"obj")+`) {
93
+ `+(ze?"":`obj || (obj = {});
94
+ `)+"var __t, __p = ''"+(k?", __e = _.escape":"")+(G?`, __j = Array.prototype.join;
95
95
  function print() { __p += __j.call(arguments, '') }
96
96
  `:`;
97
- `)+ne+`return __p
98
- }`;var He=Ug(function(){return rt(_,ve+"return "+ne).apply(t,O)});if(He.source=ne,ih(He))throw He;return He}function mO(n){return nt(n).toLowerCase()}function wO(n){return nt(n).toUpperCase()}function EO(n,s,c){if(n=nt(n),n&&(c||s===t))return kd(n);if(!n||!(s=Ir(s)))return n;var l=Gr(n),g=Gr(s),_=Gd(l,g),O=Wd(l,g)+1;return qn(l,_,O).join("")}function DO(n,s,c){if(n=nt(n),n&&(c||s===t))return n.slice(0,Jd(n)+1);if(!n||!(s=Ir(s)))return n;var l=Gr(n),g=Wd(l,Gr(s))+1;return qn(l,0,g).join("")}function SO(n,s,c){if(n=nt(n),n&&(c||s===t))return n.replace(It,"");if(!n||!(s=Ir(s)))return n;var l=Gr(n),g=Gd(l,Gr(s));return qn(l,g).join("")}function xO(n,s){var c=Y,l=ie;if(Et(s)){var g="separator"in s?s.separator:g;c="length"in s?je(s.length):c,l="omission"in s?Ir(s.omission):l}n=nt(n);var _=n.length;if(Ri(n)){var O=Gr(n);_=O.length}if(c>=_)return n;var N=c-Ni(l);if(N<1)return l;var M=O?qn(O,0,N).join(""):n.slice(0,N);if(g===t)return M+l;if(O&&(N+=M.length-N),sh(g)){if(n.slice(N).search(g)){var X,Z=M;for(g.global||(g=wu(g.source,nt(Rr.exec(g))+"g")),g.lastIndex=0;X=g.exec(Z);)var ne=X.index;M=M.slice(0,ne===t?N:ne)}}else if(n.indexOf(Ir(g),N)!=N){var ue=M.lastIndexOf(g);ue>-1&&(M=M.slice(0,ue))}return M+l}function OO(n){return n=nt(n),n&&Dt.test(n)?n.replace(Tn,t6):n}var IO=qi(function(n,s,c){return n+(c?" ":"")+s.toUpperCase()}),ch=jp("toUpperCase");function Lg(n,s,c){return n=nt(n),s=c?t:s,s===t?J2(n)?i6(n):H2(n):n.match(s)||[]}var Ug=Ke(function(n,s){try{return Gt(n,t,s)}catch(c){return ih(c)?c:new Ae(c)}}),PO=wn(function(n,s){return $r(s,function(c){c=on(c),bn(n,c,rh(n[c],n))}),n});function CO(n){var s=n==null?0:n.length,c=be();return n=s?mt(n,function(l){if(typeof l[1]!="function")throw new Fr(u);return[c(l[0]),l[1]]}):[],Ke(function(l){for(var g=-1;++g<s;){var _=n[g];if(Gt(_[0],this,l))return Gt(_[1],this,l)}})}function AO(n){return tD(Ur(n,I))}function uh(n){return function(){return n}}function TO(n,s){return n==null||n!==n?s:n}var RO=qp(),NO=qp(!0);function Er(n){return n}function hh(n){return vp(typeof n=="function"?n:Ur(n,I))}function $O(n){return _p(Ur(n,I))}function FO(n,s){return bp(n,Ur(s,I))}var LO=Ke(function(n,s){return function(c){return $s(c,n,s)}}),UO=Ke(function(n,s){return function(c){return $s(n,c,s)}});function lh(n,s,c){var l=Wt(s),g=ra(s,l);c==null&&!(Et(s)&&(g.length||!l.length))&&(c=s,s=n,n=this,g=ra(s,Wt(s)));var _=!(Et(c)&&"chain"in c)||!!c.chain,O=Dn(n);return $r(g,function(N){var M=s[N];n[N]=M,O&&(n.prototype[N]=function(){var X=this.__chain__;if(_||X){var Z=n(this.__wrapped__),ne=Z.__actions__=br(this.__actions__);return ne.push({func:M,args:arguments,thisArg:n}),Z.__chain__=X,Z}return M.apply(n,$n([this.value()],arguments))})}),n}function jO(){return Xe._===this&&(Xe._=h6),this}function fh(){}function MO(n){return n=je(n),Ke(function(s){return mp(s,n)})}var qO=zu(mt),HO=zu(Hd),BO=zu(pu);function jg(n){return Ju(n)?gu(on(n)):_D(n)}function zO(n){return function(s){return n==null?t:ci(n,s)}}var KO=Bp(),VO=Bp(!0);function dh(){return[]}function ph(){return!1}function kO(){return{}}function GO(){return""}function WO(){return!0}function YO(n,s){if(n=je(n),n<1||n>V)return[];var c=re,l=tr(n,re);s=be(s),n-=re;for(var g=_u(l,s);++c<n;)s(c);return g}function JO(n){return Re(n)?mt(n,on):Pr(n)?[n]:br(ig(nt(n)))}function QO(n){var s=++c6;return nt(n)+s}var XO=ca(function(n,s){return n+s},0),ZO=Ku("ceil"),eI=ca(function(n,s){return n/s},1),tI=Ku("floor");function rI(n){return n&&n.length?ta(n,Er,Cu):t}function nI(n,s){return n&&n.length?ta(n,be(s,2),Cu):t}function iI(n){return Kd(n,Er)}function sI(n,s){return Kd(n,be(s,2))}function oI(n){return n&&n.length?ta(n,Er,Nu):t}function aI(n,s){return n&&n.length?ta(n,be(s,2),Nu):t}var cI=ca(function(n,s){return n*s},1),uI=Ku("round"),hI=ca(function(n,s){return n-s},0);function lI(n){return n&&n.length?yu(n,Er):0}function fI(n,s){return n&&n.length?yu(n,be(s,2)):0}return y.after=$5,y.ary=gg,y.assign=wx,y.assignIn=Cg,y.assignInWith=wa,y.assignWith=Ex,y.at=Dx,y.before=vg,y.bind=rh,y.bindAll=PO,y.bindKey=yg,y.castArray=k5,y.chain=fg,y.chunk=tS,y.compact=rS,y.concat=nS,y.cond=CO,y.conforms=AO,y.constant=uh,y.countBy=l5,y.create=Sx,y.curry=_g,y.curryRight=bg,y.debounce=mg,y.defaults=xx,y.defaultsDeep=Ox,y.defer=F5,y.delay=L5,y.difference=iS,y.differenceBy=sS,y.differenceWith=oS,y.drop=aS,y.dropRight=cS,y.dropRightWhile=uS,y.dropWhile=hS,y.fill=lS,y.filter=d5,y.flatMap=v5,y.flatMapDeep=y5,y.flatMapDepth=_5,y.flatten=cg,y.flattenDeep=fS,y.flattenDepth=dS,y.flip=U5,y.flow=RO,y.flowRight=NO,y.fromPairs=pS,y.functions=Nx,y.functionsIn=$x,y.groupBy=b5,y.initial=vS,y.intersection=yS,y.intersectionBy=_S,y.intersectionWith=bS,y.invert=Lx,y.invertBy=Ux,y.invokeMap=w5,y.iteratee=hh,y.keyBy=E5,y.keys=Wt,y.keysIn=wr,y.map=ga,y.mapKeys=Mx,y.mapValues=qx,y.matches=$O,y.matchesProperty=FO,y.memoize=ya,y.merge=Hx,y.mergeWith=Ag,y.method=LO,y.methodOf=UO,y.mixin=lh,y.negate=_a,y.nthArg=MO,y.omit=Bx,y.omitBy=zx,y.once=j5,y.orderBy=D5,y.over=qO,y.overArgs=M5,y.overEvery=HO,y.overSome=BO,y.partial=nh,y.partialRight=wg,y.partition=S5,y.pick=Kx,y.pickBy=Tg,y.property=jg,y.propertyOf=zO,y.pull=DS,y.pullAll=hg,y.pullAllBy=SS,y.pullAllWith=xS,y.pullAt=OS,y.range=KO,y.rangeRight=VO,y.rearg=q5,y.reject=I5,y.remove=IS,y.rest=H5,y.reverse=eh,y.sampleSize=C5,y.set=kx,y.setWith=Gx,y.shuffle=A5,y.slice=PS,y.sortBy=N5,y.sortedUniq=FS,y.sortedUniqBy=LS,y.split=vO,y.spread=B5,y.tail=US,y.take=jS,y.takeRight=MS,y.takeRightWhile=qS,y.takeWhile=HS,y.tap=r5,y.throttle=z5,y.thru=pa,y.toArray=Og,y.toPairs=Rg,y.toPairsIn=Ng,y.toPath=JO,y.toPlainObject=Pg,y.transform=Wx,y.unary=K5,y.union=BS,y.unionBy=zS,y.unionWith=KS,y.uniq=VS,y.uniqBy=kS,y.uniqWith=GS,y.unset=Yx,y.unzip=th,y.unzipWith=lg,y.update=Jx,y.updateWith=Qx,y.values=zi,y.valuesIn=Xx,y.without=WS,y.words=Lg,y.wrap=V5,y.xor=YS,y.xorBy=JS,y.xorWith=QS,y.zip=XS,y.zipObject=ZS,y.zipObjectDeep=e5,y.zipWith=t5,y.entries=Rg,y.entriesIn=Ng,y.extend=Cg,y.extendWith=wa,lh(y,y),y.add=XO,y.attempt=Ug,y.camelCase=rO,y.capitalize=$g,y.ceil=ZO,y.clamp=Zx,y.clone=G5,y.cloneDeep=Y5,y.cloneDeepWith=J5,y.cloneWith=W5,y.conformsTo=Q5,y.deburr=Fg,y.defaultTo=TO,y.divide=eI,y.endsWith=nO,y.eq=Yr,y.escape=iO,y.escapeRegExp=sO,y.every=f5,y.find=p5,y.findIndex=og,y.findKey=Ix,y.findLast=g5,y.findLastIndex=ag,y.findLastKey=Px,y.floor=tI,y.forEach=dg,y.forEachRight=pg,y.forIn=Cx,y.forInRight=Ax,y.forOwn=Tx,y.forOwnRight=Rx,y.get=oh,y.gt=X5,y.gte=Z5,y.has=Fx,y.hasIn=ah,y.head=ug,y.identity=Er,y.includes=m5,y.indexOf=gS,y.inRange=eO,y.invoke=jx,y.isArguments=li,y.isArray=Re,y.isArrayBuffer=ex,y.isArrayLike=mr,y.isArrayLikeObject=Nt,y.isBoolean=tx,y.isBuffer=Hn,y.isDate=rx,y.isElement=nx,y.isEmpty=ix,y.isEqual=sx,y.isEqualWith=ox,y.isError=ih,y.isFinite=ax,y.isFunction=Dn,y.isInteger=Eg,y.isLength=ba,y.isMap=Dg,y.isMatch=cx,y.isMatchWith=ux,y.isNaN=hx,y.isNative=lx,y.isNil=dx,y.isNull=fx,y.isNumber=Sg,y.isObject=Et,y.isObjectLike=Ct,y.isPlainObject=qs,y.isRegExp=sh,y.isSafeInteger=px,y.isSet=xg,y.isString=ma,y.isSymbol=Pr,y.isTypedArray=Bi,y.isUndefined=gx,y.isWeakMap=vx,y.isWeakSet=yx,y.join=mS,y.kebabCase=oO,y.last=Mr,y.lastIndexOf=wS,y.lowerCase=aO,y.lowerFirst=cO,y.lt=_x,y.lte=bx,y.max=rI,y.maxBy=nI,y.mean=iI,y.meanBy=sI,y.min=oI,y.minBy=aI,y.stubArray=dh,y.stubFalse=ph,y.stubObject=kO,y.stubString=GO,y.stubTrue=WO,y.multiply=cI,y.nth=ES,y.noConflict=jO,y.noop=fh,y.now=va,y.pad=uO,y.padEnd=hO,y.padStart=lO,y.parseInt=fO,y.random=tO,y.reduce=x5,y.reduceRight=O5,y.repeat=dO,y.replace=pO,y.result=Vx,y.round=uI,y.runInContext=j,y.sample=P5,y.size=T5,y.snakeCase=gO,y.some=R5,y.sortedIndex=CS,y.sortedIndexBy=AS,y.sortedIndexOf=TS,y.sortedLastIndex=RS,y.sortedLastIndexBy=NS,y.sortedLastIndexOf=$S,y.startCase=yO,y.startsWith=_O,y.subtract=hI,y.sum=lI,y.sumBy=fI,y.template=bO,y.times=YO,y.toFinite=Sn,y.toInteger=je,y.toLength=Ig,y.toLower=mO,y.toNumber=qr,y.toSafeInteger=mx,y.toString=nt,y.toUpper=wO,y.trim=EO,y.trimEnd=DO,y.trimStart=SO,y.truncate=xO,y.unescape=OO,y.uniqueId=QO,y.upperCase=IO,y.upperFirst=ch,y.each=dg,y.eachRight=pg,y.first=ug,lh(y,function(){var n={};return nn(y,function(s,c){it.call(y.prototype,c)||(n[c]=s)}),n}(),{chain:!1}),y.VERSION=i,$r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){y[n].placeholder=y}),$r(["drop","take"],function(n,s){Ye.prototype[n]=function(c){c=c===t?1:Kt(je(c),0);var l=this.__filtered__&&!s?new Ye(this):this.clone();return l.__filtered__?l.__takeCount__=tr(c,l.__takeCount__):l.__views__.push({size:tr(c,re),type:n+(l.__dir__<0?"Right":"")}),l},Ye.prototype[n+"Right"]=function(c){return this.reverse()[n](c).reverse()}}),$r(["filter","map","takeWhile"],function(n,s){var c=s+1,l=c==m||c==ee;Ye.prototype[n]=function(g){var _=this.clone();return _.__iteratees__.push({iteratee:be(g,3),type:c}),_.__filtered__=_.__filtered__||l,_}}),$r(["head","last"],function(n,s){var c="take"+(s?"Right":"");Ye.prototype[n]=function(){return this[c](1).value()[0]}}),$r(["initial","tail"],function(n,s){var c="drop"+(s?"":"Right");Ye.prototype[n]=function(){return this.__filtered__?new Ye(this):this[c](1)}}),Ye.prototype.compact=function(){return this.filter(Er)},Ye.prototype.find=function(n){return this.filter(n).head()},Ye.prototype.findLast=function(n){return this.reverse().find(n)},Ye.prototype.invokeMap=Ke(function(n,s){return typeof n=="function"?new Ye(this):this.map(function(c){return $s(c,n,s)})}),Ye.prototype.reject=function(n){return this.filter(_a(be(n)))},Ye.prototype.slice=function(n,s){n=je(n);var c=this;return c.__filtered__&&(n>0||s<0)?new Ye(c):(n<0?c=c.takeRight(-n):n&&(c=c.drop(n)),s!==t&&(s=je(s),c=s<0?c.dropRight(-s):c.take(s-n)),c)},Ye.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ye.prototype.toArray=function(){return this.take(re)},nn(Ye.prototype,function(n,s){var c=/^(?:filter|find|map|reject)|While$/.test(s),l=/^(?:head|last)$/.test(s),g=y[l?"take"+(s=="last"?"Right":""):s],_=l||/^find/.test(s);g&&(y.prototype[s]=function(){var O=this.__wrapped__,N=l?[1]:arguments,M=O instanceof Ye,X=N[0],Z=M||Re(O),ne=function(Ge){var Ze=g.apply(y,$n([Ge],N));return l&&ue?Ze[0]:Ze};Z&&c&&typeof X=="function"&&X.length!=1&&(M=Z=!1);var ue=this.__chain__,ve=!!this.__actions__.length,Ee=_&&!ue,He=M&&!ve;if(!_&&Z){O=He?O:new Ye(this);var De=n.apply(O,N);return De.__actions__.push({func:pa,args:[ne],thisArg:t}),new Lr(De,ue)}return Ee&&He?n.apply(this,N):(De=this.thru(ne),Ee?l?De.value()[0]:De.value():De)})}),$r(["pop","push","shift","sort","splice","unshift"],function(n){var s=qo[n],c=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",l=/^(?:pop|shift)$/.test(n);y.prototype[n]=function(){var g=arguments;if(l&&!this.__chain__){var _=this.value();return s.apply(Re(_)?_:[],g)}return this[c](function(O){return s.apply(Re(O)?O:[],g)})}}),nn(Ye.prototype,function(n,s){var c=y[s];if(c){var l=c.name+"";it.call(Ui,l)||(Ui[l]=[]),Ui[l].push({name:s,func:c})}}),Ui[aa(t,se).name]=[{name:"wrapper",func:t}],Ye.prototype.clone=O6,Ye.prototype.reverse=I6,Ye.prototype.value=P6,y.prototype.at=n5,y.prototype.chain=i5,y.prototype.commit=s5,y.prototype.next=o5,y.prototype.plant=c5,y.prototype.reverse=u5,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=h5,y.prototype.first=y.prototype.head,Is&&(y.prototype[Is]=a5),y},$i=s6();Rt?((Rt.exports=$i)._=$i,ut._=$i):Xe._=$i}).call(ms)})(Mc,Mc.exports);var t2=Object.defineProperty,r2=Object.defineProperties,n2=Object.getOwnPropertyDescriptors,Cd=Object.getOwnPropertySymbols,i2=Object.prototype.hasOwnProperty,s2=Object.prototype.propertyIsEnumerable,Ad=(r,e,t)=>e in r?t2(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,lo=(r,e)=>{for(var t in e||(e={}))i2.call(e,t)&&Ad(r,t,e[t]);if(Cd)for(var t of Cd(e))s2.call(e,t)&&Ad(r,t,e[t]);return r},o2=(r,e)=>r2(r,n2(e));function An(r,e,t){var i;const o=c_(r);return((i=e.rpcMap)==null?void 0:i[o.reference])||`${e2}?chainId=${o.namespace}:${o.reference}&projectId=${t}`}function Qn(r){return r.includes(":")?r.split(":")[1]:r}function Td(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function a2(r,e){const t=Object.keys(e.namespaces).filter(o=>o.includes(r));if(!t.length)return[];const i=[];return t.forEach(o=>{const a=e.namespaces[o].accounts;i.push(...a)}),i}function c2(r={},e={}){const t=Rd(r),i=Rd(e);return Mc.exports.merge(t,i)}function Rd(r){var e,t,i,o;const a={};if(!bi(r))return a;for(const[u,f]of Object.entries(r)){const v=Za(u)?[u]:f.chains,p=f.methods||[],w=f.events||[],I=f.rpcMap||{},S=ts(u);a[S]=o2(lo(lo({},a[S]),f),{chains:Qa(v,(e=a[S])==null?void 0:e.chains),methods:Qa(p,(t=a[S])==null?void 0:t.methods),events:Qa(w,(i=a[S])==null?void 0:i.events),rpcMap:lo(lo({},I),(o=a[S])==null?void 0:o.rpcMap)})}return a}function u2(r){return r.includes(":")?r.split(":")[2]:r}function h2(r){const e={};for(const[t,i]of Object.entries(r)){const o=i.methods||[],a=i.events||[],u=i.accounts||[],f=Za(t)?[t]:i.chains?i.chains:Td(i.accounts);e[t]={chains:f,methods:o,events:a,accounts:u}}return e}function qc(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):r.includes(":")?Number(r.split(":")[1]):Number(r)}const Nd={},gt=r=>Nd[r],Hc=(r,e)=>{Nd[r]=e};class l2{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=gt("events"),this.client=gt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(dn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const o=Qn(t);e[o]=this.createHttpProvider(o,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||An(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new hn(new Cn(i,gt("disableProviderPing")))}}class f2{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=gt("events"),this.client=gt("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(dn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const i=t||An(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new hn(new Cn(i,gt("disableProviderPing")))}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const o=parseInt(Qn(t));e[o]=this.createHttpProvider(o,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,i;let o=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;const a=parseInt(o,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:o}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class d2{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=gt("events"),this.client=gt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(dn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const o=Qn(t);e[o]=this.createHttpProvider(o,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||An(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new hn(new Cn(i,gt("disableProviderPing")))}}class p2{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=gt("events"),this.client=gt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(dn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const o=Qn(t);e[o]=this.createHttpProvider(o,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||An(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new hn(new Cn(i,gt("disableProviderPing")))}}class g2{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=gt("events"),this.client=gt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(dn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const i=this.getCardanoRPCUrl(t),o=Qn(t);e[o]=this.createHttpProvider(o,i)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||this.getCardanoRPCUrl(e);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new hn(new Cn(i,gt("disableProviderPing")))}}class v2{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=gt("events"),this.client=gt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(dn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const o=Qn(t);e[o]=this.createHttpProvider(o,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||An(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new hn(new Cn(i,gt("disableProviderPing")))}}class y2{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=gt("events"),this.client=gt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(dn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const o=Qn(t);e[o]=this.createHttpProvider(o,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||An(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new hn(new Cn(i,gt("disableProviderPing")))}}class _2{constructor(e){this.name="near",this.namespace=e.namespace,this.events=gt("events"),this.client=gt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const i=t||An(`${this.name}:${e}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.events.emit(dn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||An(e,this.namespace);return typeof i>"u"?void 0:new hn(new Cn(i,gt("disableProviderPing")))}}var b2=Object.defineProperty,m2=Object.defineProperties,w2=Object.getOwnPropertyDescriptors,$d=Object.getOwnPropertySymbols,E2=Object.prototype.hasOwnProperty,D2=Object.prototype.propertyIsEnumerable,Fd=(r,e,t)=>e in r?b2(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,fo=(r,e)=>{for(var t in e||(e={}))E2.call(e,t)&&Fd(r,t,e[t]);if($d)for(var t of $d(e))D2.call(e,t)&&Fd(r,t,e[t]);return r},Bc=(r,e)=>m2(r,w2(e));class zc{constructor(e){this.events=new Yt.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:Je.pino(Je.getDefaultLoggerOptions({level:e?.logger||Id})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const t=new zc(e);return await t.initialize(),t}async request(e,t){const[i,o]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:fo({},e),chainId:`${i}:${o}`,topic:this.session.topic})}sendAsync(e,t,i){this.request(e,i).then(o=>t(null,o)).catch(o=>t(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:At("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:o}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await o().then(a=>{this.session=a,this.namespaces||(this.namespaces=h2(a.namespaces),this.persist("namespaces",this.namespaces))}).catch(a=>{if(a.message!==wd)throw a;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[i,o]=this.validateChain(e);this.getProvider(i).setDefaultChain(o,t)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(Xr(t)){for(const i of t)e.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Uc.init({logger:this.providerOpts.logger||Id,relayUrl:this.providerOpts.relayUrl||Q3,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>ts(t)))];Hc("client",this.client),Hc("events",this.events),Hc("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const i=a2(t,this.session),o=Td(i),a=c2(this.namespaces,this.optionalNamespaces),u=Bc(fo({},a[t]),{accounts:i,chains:o});switch(t){case"eip155":this.rpcProviders[t]=new f2({namespace:u});break;case"solana":this.rpcProviders[t]=new d2({namespace:u});break;case"cosmos":this.rpcProviders[t]=new p2({namespace:u});break;case"polkadot":this.rpcProviders[t]=new l2({namespace:u});break;case"cip34":this.rpcProviders[t]=new g2({namespace:u});break;case"elrond":this.rpcProviders[t]=new v2({namespace:u});break;case"multiversx":this.rpcProviders[t]=new y2({namespace:u});break;case"near":this.rpcProviders[t]=new _2({namespace:u});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:t}=e,{event:i}=t;if(i.name==="accountsChanged"){const o=i.data;o&&Xr(o)&&this.events.emit("accountsChanged",o.map(u2))}else if(i.name==="chainChanged"){const o=t.chainId,a=t.event.data,u=ts(o),f=qc(o)!==qc(a)?`${u}:${qc(a)}`:o;this.onChainChanged(f)}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var i;const{namespaces:o}=t,a=(i=this.client)==null?void 0:i.session.get(e);this.session=Bc(fo({},a),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Bc(fo({},At("USER_DISCONNECTED")),{data:e.topic}))}),this.on(dn.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:i,sessionProperties:o}=e;t&&Object.keys(t).length&&(this.namespaces=t),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=o,this.persist("namespaces",t),this.persist("optionalNamespaces",i)}validateChain(e){const[t,i]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,i];if(t&&!Object.keys(this.namespaces||{}).map(u=>ts(u)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&i)return[t,i];const o=ts(Object.keys(this.namespaces)[0]),a=this.rpcProviders[o].getDefaultChain();return[o,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){var i;if(!this.namespaces)return;const[o,a]=this.validateChain(e);t||this.getProvider(o).setDefaultChain(a),((i=this.namespaces[o])!=null?i:this.namespaces[`${o}:${a}`]).defaultChain=a,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",a)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Pd}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Pd}/${e}`)}}const S2=zc,x2="wc",O2="ethereum_provider",I2=`${x2}@2:${O2}:`,P2="https://rpc.walletconnect.com/v1/",po=["eth_sendTransaction","personal_sign"],Ld=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],go=["chainChanged","accountsChanged"],Ud=["chainChanged","accountsChanged","message","disconnect","connect"];var C2=Object.defineProperty,A2=Object.defineProperties,T2=Object.getOwnPropertyDescriptors,jd=Object.getOwnPropertySymbols,R2=Object.prototype.hasOwnProperty,N2=Object.prototype.propertyIsEnumerable,Md=(r,e,t)=>e in r?C2(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ws=(r,e)=>{for(var t in e||(e={}))R2.call(e,t)&&Md(r,t,e[t]);if(jd)for(var t of jd(e))N2.call(e,t)&&Md(r,t,e[t]);return r},qd=(r,e)=>A2(r,T2(e));function vo(r){return Number(r[0].split(":")[1])}function Kc(r){return`0x${r.toString(16)}`}function $2(r){const{chains:e,optionalChains:t,methods:i,optionalMethods:o,events:a,optionalEvents:u,rpcMap:f}=r;if(!Xr(e))throw new Error("Invalid chains");const v={chains:e,methods:i||po,events:a||go,rpcMap:ws({},e.length?{[vo(e)]:f[vo(e)]}:{})},p=a?.filter(C=>!go.includes(C)),w=i?.filter(C=>!po.includes(C));if(!t&&!u&&!o&&!(p!=null&&p.length)&&!(w!=null&&w.length))return{required:e.length?v:void 0};const I=p?.length&&w?.length||!t,S={chains:[...new Set(I?v.chains.concat(t||[]):t)],methods:[...new Set(v.methods.concat(o!=null&&o.length?o:Ld))],events:[...new Set(v.events.concat(u!=null&&u.length?u:Ud))],rpcMap:f};return{required:e.length?v:void 0,optional:t.length?S:void 0}}class yo{constructor(){this.events=new Yt.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=I2,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new yo;return await t.initialize(e),t}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,t){this.signer.sendAsync(e,t,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:i}=$2(this.rpc);try{const o=await new Promise(async(u,f)=>{var v;this.rpc.showQrModal&&((v=this.modal)==null||v.subscribeModal(p=>{!p.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(qd(ws({namespaces:ws({},t&&{[this.namespace]:t})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e?.pairingTopic})).then(p=>{u(p)}).catch(p=>{f(new Error(p.message))})});if(!o)return;const a=u_(o.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:Kc(this.chainId)})}catch(o){throw this.signer.logger.error(o),o}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:i}=t;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",Kc(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",qd(ws({},At("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,i;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(i=this.modal)==null||i.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",Kc(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,i,o]=e.split(":");return{chainId:`${t}:${i}`,address:o}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,i;const o=(t=e?.chains)!=null?t:[],a=(i=e?.optionalChains)!=null?i:[],u=o.concat(a);if(!u.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const f=o.length?e?.methods||po:[],v=o.length?e?.events||go:[],p=e?.optionalMethods||[],w=e?.optionalEvents||[],I=e?.rpcMap||this.buildRpcMap(u,e.projectId),S=e?.qrModalOptions||void 0;return{chains:o?.map(C=>this.formatChainId(C)),optionalChains:a.map(C=>this.formatChainId(C)),methods:f,events:v,optionalMethods:p,optionalEvents:w,rpcMap:I,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:S,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const i={};return e.forEach(o=>{i[o]=this.getRpcUrl(o,t)}),i}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?vo(this.rpc.chains):vo(this.rpc.optionalChains),this.signer=await S2.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{t=require("@walletconnect/modal")}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(ws({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:i,rpcMap:o}=e;t&&Xr(t)&&(this.rpc.chains=t.map(a=>this.formatChainId(a)),t.forEach(a=>{this.rpc.rpcMap[a]=o?.[a]||this.getRpcUrl(a)})),i&&Xr(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i?.map(a=>this.formatChainId(a)),i.forEach(a=>{this.rpc.rpcMap[a]=o?.[a]||this.getRpcUrl(a)}))}getRpcUrl(e,t){var i;return((i=this.rpc.rpcMap)==null?void 0:i[e])||`${P2}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t?.accounts),this.setAccounts(t?.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const F2=yo;Hr.EthereumProvider=F2,Hr.OPTIONAL_EVENTS=Ud,Hr.OPTIONAL_METHODS=Ld,Hr.REQUIRED_EVENTS=go,Hr.REQUIRED_METHODS=po,Hr.default=yo,Object.defineProperty(Hr,"__esModule",{value:!0})});
97
+ `)+pe+`return __p
98
+ }`;var ot=xw(function(){return vt(A,Pe+"return "+pe).apply(r,M)});if(ot.source=pe,cd(ot))throw ot;return ot}function hN(s){return yt(s).toLowerCase()}function fN(s){return yt(s).toUpperCase()}function dN(s,a,u){if(s=yt(s),s&&(u||a===r))return Tm(s);if(!s||!(a=nn(a)))return s;var g=On(s),y=On(a),A=Rm(g,y),M=Nm(g,y)+1;return ji(g,A,M).join("")}function pN(s,a,u){if(s=yt(s),s&&(u||a===r))return s.slice(0,Mm(s)+1);if(!s||!(a=nn(a)))return s;var g=On(s),y=Nm(g,On(a))+1;return ji(g,0,y).join("")}function gN(s,a,u){if(s=yt(s),s&&(u||a===r))return s.replace(Kt,"");if(!s||!(a=nn(a)))return s;var g=On(s),y=Rm(g,On(a));return ji(g,y).join("")}function mN(s,a){var u=W,g=ee;if(kt(a)){var y="separator"in a?a.separator:y;u="length"in a?it(a.length):u,g="omission"in a?nn(a.omission):g}s=yt(s);var A=s.length;if(fo(s)){var M=On(s);A=M.length}if(u>=A)return s;var k=u-po(g);if(k<1)return g;var G=M?ji(M,0,k).join(""):s.slice(0,k);if(y===r)return G+g;if(M&&(k+=G.length-k),ld(y)){if(s.slice(k).search(y)){var ue,he=G;for(y.global||(y=I0(y.source,yt(fn.exec(y))+"g")),y.lastIndex=0;ue=y.exec(he);)var pe=ue.index;G=G.slice(0,pe===r?k:pe)}}else if(s.indexOf(nn(y),k)!=k){var be=G.lastIndexOf(y);be>-1&&(G=G.slice(0,be))}return G+g}function wN(s){return s=yt(s),s&&Wt.test(s)?s.replace(Di,VA):s}var vN=_o(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),fd=C2("toUpperCase");function Ew(s,a,u){return s=yt(s),a=u?r:a,a===r?kA(s)?ZA(s):TA(s):s.match(a)||[]}var xw=ct(function(s,a){try{return wr(s,r,a)}catch(u){return cd(u)?u:new Ye(u)}}),yN=ci(function(s,a){return pn(a,function(u){u=Wn(u),oi(s,u,od(s[u],s))}),s});function bN(s){var a=s==null?0:s.length,u=We();return s=a?jt(s,function(g){if(typeof g[1]!="function")throw new gn(c);return[u(g[0]),g[1]]}):[],ct(function(g){for(var y=-1;++y<a;){var A=s[y];if(wr(A[0],this,g))return wr(A[1],this,g)}})}function _N(s){return VD(wn(s,E))}function dd(s){return function(){return s}}function EN(s,a){return s==null||s!==s?a:s}var xN=S2(),CN=S2(!0);function Yr(s){return s}function pd(s){return r2(typeof s=="function"?s:wn(s,E))}function IN(s){return i2(wn(s,E))}function SN(s,a){return s2(s,wn(a,E))}var ON=ct(function(s,a){return function(u){return Ba(u,s,a)}}),AN=ct(function(s,a){return function(u){return Ba(s,u,a)}});function gd(s,a,u){var g=vr(a),y=zl(a,g);u==null&&!(kt(a)&&(y.length||!g.length))&&(u=a,a=s,s=this,y=zl(a,vr(a)));var A=!(kt(u)&&"chain"in u)||!!u.chain,M=ui(s);return pn(y,function(k){var G=a[k];s[k]=G,M&&(s.prototype[k]=function(){var ue=this.__chain__;if(A||ue){var he=s(this.__wrapped__),pe=he.__actions__=Kr(this.__actions__);return pe.push({func:G,args:arguments,thisArg:s}),he.__chain__=ue,he}return G.apply(s,Ti([this.value()],arguments))})}),s}function DN(){return mt._===this&&(mt._=tD),this}function md(){}function $N(s){return s=it(s),ct(function(a){return o2(a,s)})}var PN=K0(jt),TN=K0(Om),RN=K0(v0);function Cw(s){return ed(s)?y0(Wn(s)):l$(s)}function NN(s){return function(a){return s==null?r:_s(s,a)}}var LN=A2(),MN=A2(!0);function wd(){return[]}function vd(){return!1}function UN(){return{}}function jN(){return""}function FN(){return!0}function BN(s,a){if(s=it(s),s<1||s>re)return[];var u=ie,g=Or(s,ie);a=We(a),s-=ie;for(var y=E0(g,a);++u<s;)a(u);return y}function kN(s){return Xe(s)?jt(s,Wn):sn(s)?[s]:Kr(z2(yt(s)))}function HN(s){var a=++XA;return yt(s)+a}var WN=Yl(function(s,a){return s+a},0),zN=G0("ceil"),qN=Yl(function(s,a){return s/a},1),VN=G0("floor");function KN(s){return s&&s.length?Wl(s,Yr,R0):r}function GN(s,a){return s&&s.length?Wl(s,We(a,2),R0):r}function ZN(s){return $m(s,Yr)}function YN(s,a){return $m(s,We(a,2))}function JN(s){return s&&s.length?Wl(s,Yr,U0):r}function QN(s,a){return s&&s.length?Wl(s,We(a,2),U0):r}var XN=Yl(function(s,a){return s*a},1),eL=G0("round"),tL=Yl(function(s,a){return s-a},0);function rL(s){return s&&s.length?_0(s,Yr):0}function nL(s,a){return s&&s.length?_0(s,We(a,2)):0}return C.after=IT,C.ary=tw,C.assign=fR,C.assignIn=gw,C.assignInWith=lu,C.assignWith=dR,C.at=pR,C.before=rw,C.bind=od,C.bindAll=yN,C.bindKey=nw,C.castArray=UT,C.chain=Q2,C.chunk=V$,C.compact=K$,C.concat=G$,C.cond=bN,C.conforms=_N,C.constant=dd,C.countBy=rT,C.create=gR,C.curry=iw,C.curryRight=sw,C.debounce=ow,C.defaults=mR,C.defaultsDeep=wR,C.defer=ST,C.delay=OT,C.difference=Z$,C.differenceBy=Y$,C.differenceWith=J$,C.drop=Q$,C.dropRight=X$,C.dropRightWhile=eP,C.dropWhile=tP,C.fill=rP,C.filter=iT,C.flatMap=aT,C.flatMapDeep=cT,C.flatMapDepth=lT,C.flatten=G2,C.flattenDeep=nP,C.flattenDepth=iP,C.flip=AT,C.flow=xN,C.flowRight=CN,C.fromPairs=sP,C.functions=CR,C.functionsIn=IR,C.groupBy=uT,C.initial=aP,C.intersection=cP,C.intersectionBy=lP,C.intersectionWith=uP,C.invert=OR,C.invertBy=AR,C.invokeMap=fT,C.iteratee=pd,C.keyBy=dT,C.keys=vr,C.keysIn=Zr,C.map=nu,C.mapKeys=$R,C.mapValues=PR,C.matches=IN,C.matchesProperty=SN,C.memoize=su,C.merge=TR,C.mergeWith=mw,C.method=ON,C.methodOf=AN,C.mixin=gd,C.negate=ou,C.nthArg=$N,C.omit=RR,C.omitBy=NR,C.once=DT,C.orderBy=pT,C.over=PN,C.overArgs=$T,C.overEvery=TN,C.overSome=RN,C.partial=ad,C.partialRight=aw,C.partition=gT,C.pick=LR,C.pickBy=ww,C.property=Cw,C.propertyOf=NN,C.pull=pP,C.pullAll=Y2,C.pullAllBy=gP,C.pullAllWith=mP,C.pullAt=wP,C.range=LN,C.rangeRight=MN,C.rearg=PT,C.reject=vT,C.remove=vP,C.rest=TT,C.reverse=id,C.sampleSize=bT,C.set=UR,C.setWith=jR,C.shuffle=_T,C.slice=yP,C.sortBy=CT,C.sortedUniq=SP,C.sortedUniqBy=OP,C.split=aN,C.spread=RT,C.tail=AP,C.take=DP,C.takeRight=$P,C.takeRightWhile=PP,C.takeWhile=TP,C.tap=KP,C.throttle=NT,C.thru=ru,C.toArray=fw,C.toPairs=vw,C.toPairsIn=yw,C.toPath=kN,C.toPlainObject=pw,C.transform=FR,C.unary=LT,C.union=RP,C.unionBy=NP,C.unionWith=LP,C.uniq=MP,C.uniqBy=UP,C.uniqWith=jP,C.unset=BR,C.unzip=sd,C.unzipWith=J2,C.update=kR,C.updateWith=HR,C.values=Co,C.valuesIn=WR,C.without=FP,C.words=Ew,C.wrap=MT,C.xor=BP,C.xorBy=kP,C.xorWith=HP,C.zip=WP,C.zipObject=zP,C.zipObjectDeep=qP,C.zipWith=VP,C.entries=vw,C.entriesIn=yw,C.extend=gw,C.extendWith=lu,gd(C,C),C.add=WN,C.attempt=xw,C.camelCase=KR,C.capitalize=bw,C.ceil=zN,C.clamp=zR,C.clone=jT,C.cloneDeep=BT,C.cloneDeepWith=kT,C.cloneWith=FT,C.conformsTo=HT,C.deburr=_w,C.defaultTo=EN,C.divide=qN,C.endsWith=GR,C.eq=Dn,C.escape=ZR,C.escapeRegExp=YR,C.every=nT,C.find=sT,C.findIndex=V2,C.findKey=vR,C.findLast=oT,C.findLastIndex=K2,C.findLastKey=yR,C.floor=VN,C.forEach=X2,C.forEachRight=ew,C.forIn=bR,C.forInRight=_R,C.forOwn=ER,C.forOwnRight=xR,C.get=ud,C.gt=WT,C.gte=zT,C.has=SR,C.hasIn=hd,C.head=Z2,C.identity=Yr,C.includes=hT,C.indexOf=oP,C.inRange=qR,C.invoke=DR,C.isArguments=Cs,C.isArray=Xe,C.isArrayBuffer=qT,C.isArrayLike=Gr,C.isArrayLikeObject=Xt,C.isBoolean=VT,C.isBuffer=Fi,C.isDate=KT,C.isElement=GT,C.isEmpty=ZT,C.isEqual=YT,C.isEqualWith=JT,C.isError=cd,C.isFinite=QT,C.isFunction=ui,C.isInteger=cw,C.isLength=au,C.isMap=lw,C.isMatch=XT,C.isMatchWith=eR,C.isNaN=tR,C.isNative=rR,C.isNil=iR,C.isNull=nR,C.isNumber=uw,C.isObject=kt,C.isObjectLike=Zt,C.isPlainObject=Va,C.isRegExp=ld,C.isSafeInteger=sR,C.isSet=hw,C.isString=cu,C.isSymbol=sn,C.isTypedArray=xo,C.isUndefined=oR,C.isWeakMap=aR,C.isWeakSet=cR,C.join=hP,C.kebabCase=JR,C.last=yn,C.lastIndexOf=fP,C.lowerCase=QR,C.lowerFirst=XR,C.lt=lR,C.lte=uR,C.max=KN,C.maxBy=GN,C.mean=ZN,C.meanBy=YN,C.min=JN,C.minBy=QN,C.stubArray=wd,C.stubFalse=vd,C.stubObject=UN,C.stubString=jN,C.stubTrue=FN,C.multiply=XN,C.nth=dP,C.noConflict=DN,C.noop=md,C.now=iu,C.pad=eN,C.padEnd=tN,C.padStart=rN,C.parseInt=nN,C.random=VR,C.reduce=mT,C.reduceRight=wT,C.repeat=iN,C.replace=sN,C.result=MR,C.round=eL,C.runInContext=V,C.sample=yT,C.size=ET,C.snakeCase=oN,C.some=xT,C.sortedIndex=bP,C.sortedIndexBy=_P,C.sortedIndexOf=EP,C.sortedLastIndex=xP,C.sortedLastIndexBy=CP,C.sortedLastIndexOf=IP,C.startCase=cN,C.startsWith=lN,C.subtract=tL,C.sum=rL,C.sumBy=nL,C.template=uN,C.times=BN,C.toFinite=hi,C.toInteger=it,C.toLength=dw,C.toLower=hN,C.toNumber=bn,C.toSafeInteger=hR,C.toString=yt,C.toUpper=fN,C.trim=dN,C.trimEnd=pN,C.trimStart=gN,C.truncate=mN,C.unescape=wN,C.uniqueId=HN,C.upperCase=vN,C.upperFirst=fd,C.each=X2,C.eachRight=ew,C.first=Z2,gd(C,function(){var s={};return kn(C,function(a,u){bt.call(C.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),C.VERSION=n,pn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){C[s].placeholder=C}),pn(["drop","take"],function(s,a){dt.prototype[s]=function(u){u=u===r?1:fr(it(u),0);var g=this.__filtered__&&!a?new dt(this):this.clone();return g.__filtered__?g.__takeCount__=Or(u,g.__takeCount__):g.__views__.push({size:Or(u,ie),type:s+(g.__dir__<0?"Right":"")}),g},dt.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),pn(["filter","map","takeWhile"],function(s,a){var u=a+1,g=u==O||u==ce;dt.prototype[s]=function(y){var A=this.clone();return A.__iteratees__.push({iteratee:We(y,3),type:u}),A.__filtered__=A.__filtered__||g,A}}),pn(["head","last"],function(s,a){var u="take"+(a?"Right":"");dt.prototype[s]=function(){return this[u](1).value()[0]}}),pn(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");dt.prototype[s]=function(){return this.__filtered__?new dt(this):this[u](1)}}),dt.prototype.compact=function(){return this.filter(Yr)},dt.prototype.find=function(s){return this.filter(s).head()},dt.prototype.findLast=function(s){return this.reverse().find(s)},dt.prototype.invokeMap=ct(function(s,a){return typeof s=="function"?new dt(this):this.map(function(u){return Ba(u,s,a)})}),dt.prototype.reject=function(s){return this.filter(ou(We(s)))},dt.prototype.slice=function(s,a){s=it(s);var u=this;return u.__filtered__&&(s>0||a<0)?new dt(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==r&&(a=it(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},dt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},dt.prototype.toArray=function(){return this.take(ie)},kn(dt.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),g=/^(?:head|last)$/.test(a),y=C[g?"take"+(a=="last"?"Right":""):a],A=g||/^find/.test(a);y&&(C.prototype[a]=function(){var M=this.__wrapped__,k=g?[1]:arguments,G=M instanceof dt,ue=k[0],he=G||Xe(M),pe=function(ft){var wt=y.apply(C,Ti([ft],k));return g&&be?wt[0]:wt};he&&u&&typeof ue=="function"&&ue.length!=1&&(G=he=!1);var be=this.__chain__,Pe=!!this.__actions__.length,ze=A&&!be,ot=G&&!Pe;if(!A&&he){M=ot?M:new dt(this);var qe=s.apply(M,k);return qe.__actions__.push({func:ru,args:[pe],thisArg:r}),new mn(qe,be)}return ze&&ot?s.apply(this,k):(qe=this.thru(pe),ze?g?qe.value()[0]:qe.value():qe)})}),pn(["pop","push","shift","sort","splice","unshift"],function(s){var a=Al[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",g=/^(?:pop|shift)$/.test(s);C.prototype[s]=function(){var y=arguments;if(g&&!this.__chain__){var A=this.value();return a.apply(Xe(A)?A:[],y)}return this[u](function(M){return a.apply(Xe(M)?M:[],y)})}}),kn(dt.prototype,function(s,a){var u=C[a];if(u){var g=u.name+"";bt.call(vo,g)||(vo[g]=[]),vo[g].push({name:a,func:u})}}),vo[Zl(r,Z).name]=[{name:"wrapper",func:r}],dt.prototype.clone=wD,dt.prototype.reverse=vD,dt.prototype.value=yD,C.prototype.at=GP,C.prototype.chain=ZP,C.prototype.commit=YP,C.prototype.next=JP,C.prototype.plant=XP,C.prototype.reverse=eT,C.prototype.toJSON=C.prototype.valueOf=C.prototype.value=tT,C.prototype.first=C.prototype.head,Ra&&(C.prototype[Ra]=QP),C},go=YA();Qt?((Qt.exports=go)._=go,St._=go):mt._=go}).call(ta)})(Oh,Oh.exports);var k7=Object.defineProperty,H7=Object.defineProperties,W7=Object.getOwnPropertyDescriptors,Tg=Object.getOwnPropertySymbols,z7=Object.prototype.hasOwnProperty,q7=Object.prototype.propertyIsEnumerable,Rg=(t,e,r)=>e in t?k7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wc=(t,e)=>{for(var r in e||(e={}))z7.call(e,r)&&Rg(t,r,e[r]);if(Tg)for(var r of Tg(e))q7.call(e,r)&&Rg(t,r,e[r]);return t},V7=(t,e)=>H7(t,W7(e));function wi(t,e,r){var n;const i=G5(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${B7}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function Zi(t){return t.includes(":")?t.split(":")[1]:t}function Ng(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function K7(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const o=e.namespaces[i].accounts;n.push(...o)}),n}function G7(t={},e={}){const r=Lg(t),n=Lg(e);return Oh.exports.merge(r,n)}function Lg(t){var e,r,n,i;const o={};if(!Ts(t))return o;for(const[c,l]of Object.entries(t)){const h=ku(c)?[c]:l.chains,f=l.methods||[],v=l.events||[],E=l.rpcMap||{},_=Mo(c);o[_]=V7(wc(wc({},o[_]),l),{chains:Fu(h,(e=o[_])==null?void 0:e.chains),methods:Fu(f,(r=o[_])==null?void 0:r.methods),events:Fu(v,(n=o[_])==null?void 0:n.events),rpcMap:wc(wc({},E),(i=o[_])==null?void 0:i.rpcMap)})}return o}function Z7(t){return t.includes(":")?t.split(":")[2]:t}function Y7(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],o=n.events||[],c=n.accounts||[],l=ku(r)?[r]:n.chains?n.chains:Ng(n.accounts);e[r]={chains:l,methods:i,events:o,accounts:c}}return e}function Ah(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):t.includes(":")?Number(t.split(":")[1]):Number(t)}const Mg={},Nt=t=>Mg[t],Dh=(t,e)=>{Mg[t]=e};class J7{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Nt("events"),this.client=Nt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Yn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zi(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||wi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Kn(new mi(n,Nt("disableProviderPing")))}}class Q7{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Nt("events"),this.client=Nt("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(Yn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||wi(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Kn(new mi(n,Nt("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(Zi(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const o=parseInt(i,16);if(this.isChainApproved(o))this.setDefaultChain(`${o}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${o}`);else throw new Error(`Failed to switch to chain 'eip155:${o}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class X7{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Nt("events"),this.client=Nt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Yn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zi(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||wi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Kn(new mi(n,Nt("disableProviderPing")))}}class ex{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Nt("events"),this.client=Nt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Yn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zi(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||wi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Kn(new mi(n,Nt("disableProviderPing")))}}class tx{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Nt("events"),this.client=Nt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Yn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=Zi(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Kn(new mi(n,Nt("disableProviderPing")))}}class rx{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Nt("events"),this.client=Nt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Yn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zi(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||wi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Kn(new mi(n,Nt("disableProviderPing")))}}class nx{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Nt("events"),this.client=Nt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Yn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Zi(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||wi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Kn(new mi(n,Nt("disableProviderPing")))}}class ix{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Nt("events"),this.client=Nt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||wi(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Yn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||wi(e,this.namespace);return typeof n>"u"?void 0:new Kn(new mi(n,Nt("disableProviderPing")))}}var sx=Object.defineProperty,ox=Object.defineProperties,ax=Object.getOwnPropertyDescriptors,Ug=Object.getOwnPropertySymbols,cx=Object.prototype.hasOwnProperty,lx=Object.prototype.propertyIsEnumerable,jg=(t,e,r)=>e in t?sx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vc=(t,e)=>{for(var r in e||(e={}))cx.call(e,r)&&jg(t,r,e[r]);if(Ug)for(var r of Ug(e))lx.call(e,r)&&jg(t,r,e[r]);return t},$h=(t,e)=>ox(t,ax(e));class Ph{constructor(e){this.events=new yr.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:pt.pino(pt.getDefaultLoggerOptions({level:e?.logger||$g})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const r=new Ph(e);return await r.initialize(),r}async request(e,r){const[n,i]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:vc({},e),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(e,r,n){this.request(e,n).then(i=>r(null,i)).catch(i=>r(i,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Yt("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(o=>{this.session=o,this.namespaces||(this.namespaces=Y7(o.namespaces),this.persist("namespaces",this.namespaces))}).catch(o=>{if(o.message!==Cg)throw o;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(Tn(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Ih.init({logger:this.providerOpts.logger||$g,relayUrl:this.providerOpts.relayUrl||U7,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>Mo(r)))];Dh("client",this.client),Dh("events",this.events),Dh("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=K7(r,this.session),i=Ng(n),o=G7(this.namespaces,this.optionalNamespaces),c=$h(vc({},o[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new Q7({namespace:c});break;case"solana":this.rpcProviders[r]=new X7({namespace:c});break;case"cosmos":this.rpcProviders[r]=new ex({namespace:c});break;case"polkadot":this.rpcProviders[r]=new J7({namespace:c});break;case"cip34":this.rpcProviders[r]=new tx({namespace:c});break;case"elrond":this.rpcProviders[r]=new rx({namespace:c});break;case"multiversx":this.rpcProviders[r]=new nx({namespace:c});break;case"near":this.rpcProviders[r]=new ix({namespace:c});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&Tn(i)&&this.events.emit("accountsChanged",i.map(Z7))}else if(n.name==="chainChanged"){const i=r.chainId,o=r.event.data,c=Mo(i),l=Ah(i)!==Ah(o)?`${c}:${Ah(o)}`:i;this.onChainChanged(l)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,o=(n=this.client)==null?void 0:n.session.get(e);this.session=$h(vc({},o),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",$h(vc({},Yt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Yn.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(c=>Mo(c)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=Mo(Object.keys(this.namespaces)[0]),o=this.rpcProviders[i].getDefaultChain();return[i,o]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){var n;if(!this.namespaces)return;const[i,o]=this.validateChain(e);r||this.getProvider(i).setDefaultChain(o),((n=this.namespaces[i])!=null?n:this.namespaces[`${i}:${o}`]).defaultChain=o,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",o)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${Pg}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${Pg}/${e}`)}}const ux=Ph,hx="wc",fx="ethereum_provider",dx=`${hx}@2:${fx}:`,px="https://rpc.walletconnect.com/v1/",yc=["eth_sendTransaction","personal_sign"],Fg=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],bc=["chainChanged","accountsChanged"],Bg=["chainChanged","accountsChanged","message","disconnect","connect"];var gx=Object.defineProperty,mx=Object.defineProperties,wx=Object.getOwnPropertyDescriptors,kg=Object.getOwnPropertySymbols,vx=Object.prototype.hasOwnProperty,yx=Object.prototype.propertyIsEnumerable,Hg=(t,e,r)=>e in t?gx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ra=(t,e)=>{for(var r in e||(e={}))vx.call(e,r)&&Hg(t,r,e[r]);if(kg)for(var r of kg(e))yx.call(e,r)&&Hg(t,r,e[r]);return t},Wg=(t,e)=>mx(t,wx(e));function _c(t){return Number(t[0].split(":")[1])}function Th(t){return`0x${t.toString(16)}`}function bx(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:o,optionalEvents:c,rpcMap:l}=t;if(!Tn(e))throw new Error("Invalid chains");const h={chains:e,methods:n||yc,events:o||bc,rpcMap:ra({},e.length?{[_c(e)]:l[_c(e)]}:{})},f=o?.filter(S=>!bc.includes(S)),v=n?.filter(S=>!yc.includes(S));if(!r&&!c&&!i&&!(f!=null&&f.length)&&!(v!=null&&v.length))return{required:e.length?h:void 0};const E=f?.length&&v?.length||!r,_={chains:[...new Set(E?h.chains.concat(r||[]):r)],methods:[...new Set(h.methods.concat(i!=null&&i.length?i:Fg))],events:[...new Set(h.events.concat(c!=null&&c.length?c:Bg))],rpcMap:l};return{required:e.length?h:void 0,optional:r.length?_:void 0}}class Ec{constructor(){this.events=new yr.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=dx,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Ec;return await r.initialize(e),r}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,r){this.signer.sendAsync(e,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=bx(this.rpc);try{const i=await new Promise(async(c,l)=>{var h;this.rpc.showQrModal&&((h=this.modal)==null||h.subscribeModal(f=>{!f.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Wg(ra({namespaces:ra({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(f=>{c(f)}).catch(f=>{l(new Error(f.message))})});if(!i)return;const o=Z5(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:Th(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",Th(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Wg(ra({},Yt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",Th(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e?.chains)!=null?r:[],o=(n=e?.optionalChains)!=null?n:[],c=i.concat(o);if(!c.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const l=i.length?e?.methods||yc:[],h=i.length?e?.events||bc:[],f=e?.optionalMethods||[],v=e?.optionalEvents||[],E=e?.rpcMap||this.buildRpcMap(c,e.projectId),_=e?.qrModalOptions||void 0;return{chains:i?.map(S=>this.formatChainId(S)),optionalChains:o.map(S=>this.formatChainId(S)),methods:l,events:h,optionalMethods:f,optionalEvents:v,rpcMap:E,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:_,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?_c(this.rpc.chains):_c(this.rpc.optionalChains),this.signer=await ux.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{r=(await Promise.resolve().then(function(){return Jx})).WalletConnectModal}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(ra({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&Tn(r)&&(this.rpc.chains=r.map(o=>this.formatChainId(o)),r.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)})),n&&Tn(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(o=>this.formatChainId(o)),n.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${px}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r?.accounts),this.setAccounts(r?.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}}const _x=Ec,Ex=Symbol(),zg=Object.getPrototypeOf,Rh=new WeakMap,xx=t=>t&&(Rh.has(t)?Rh.get(t):zg(t)===Object.prototype||zg(t)===Array.prototype),Cx=t=>xx(t)&&t[Ex]||null,qg=(t,e=!0)=>{Rh.set(t,e)},Nh=t=>typeof t=="object"&&t!==null,vi=new WeakMap,xc=new WeakSet,Ix=(t=Object.is,e=(f,v)=>new Proxy(f,v),r=f=>Nh(f)&&!xc.has(f)&&(Array.isArray(f)||!(Symbol.iterator in f))&&!(f instanceof WeakMap)&&!(f instanceof WeakSet)&&!(f instanceof Error)&&!(f instanceof Number)&&!(f instanceof Date)&&!(f instanceof String)&&!(f instanceof RegExp)&&!(f instanceof ArrayBuffer),n=f=>{switch(f.status){case"fulfilled":return f.value;case"rejected":throw f.reason;default:throw f}},i=new WeakMap,o=(f,v,E=n)=>{const _=i.get(f);if(_?.[0]===v)return _[1];const S=Array.isArray(f)?[]:Object.create(Object.getPrototypeOf(f));return qg(S,!0),i.set(f,[v,S]),Reflect.ownKeys(f).forEach(P=>{if(Object.getOwnPropertyDescriptor(S,P))return;const j=Reflect.get(f,P),H={value:j,enumerable:!0,configurable:!0};if(xc.has(j))qg(j,!1);else if(j instanceof Promise)delete H.value,H.get=()=>E(j);else if(vi.has(j)){const[Z,N]=vi.get(j);H.value=o(Z,N(),E)}Object.defineProperty(S,P,H)}),S},c=new WeakMap,l=[1,1],h=f=>{if(!Nh(f))throw new Error("object required");const v=c.get(f);if(v)return v;let E=l[0];const _=new Set,S=(J,W=++l[0])=>{E!==W&&(E=W,_.forEach(ee=>ee(J,W)))};let P=l[1];const j=(J=++l[1])=>(P!==J&&!_.size&&(P=J,Z.forEach(([W])=>{const ee=W[1](J);ee>E&&(E=ee)})),E),H=J=>(W,ee)=>{const de=[...W];de[1]=[J,...de[1]],S(de,ee)},Z=new Map,N=(J,W)=>{if(Z.has(J))throw new Error("prop listener already exists");if(_.size){const ee=W[3](H(J));Z.set(J,[W,ee])}else Z.set(J,[W])},L=J=>{var W;const ee=Z.get(J);ee&&(Z.delete(J),(W=ee[1])==null||W.call(ee))},$=J=>(_.add(J),_.size===1&&Z.forEach(([ee,de],me)=>{if(de)throw new Error("remove already exists");const O=ee[3](H(me));Z.set(me,[ee,O])}),()=>{_.delete(J),_.size===0&&Z.forEach(([ee,de],me)=>{de&&(de(),Z.set(me,[ee]))})}),T=Array.isArray(f)?[]:Object.create(Object.getPrototypeOf(f)),d=e(T,{deleteProperty(J,W){const ee=Reflect.get(J,W);L(W);const de=Reflect.deleteProperty(J,W);return de&&S(["delete",[W],ee]),de},set(J,W,ee,de){const me=Reflect.has(J,W),O=Reflect.get(J,W,de);if(me&&(t(O,ee)||c.has(ee)&&t(O,c.get(ee))))return!0;L(W),Nh(ee)&&(ee=Cx(ee)||ee);let U=ee;if(ee instanceof Promise)ee.then(ce=>{ee.status="fulfilled",ee.value=ce,S(["resolve",[W],ce])}).catch(ce=>{ee.status="rejected",ee.reason=ce,S(["reject",[W],ce])});else{!vi.has(ee)&&r(ee)&&(U=h(ee));const ce=!xc.has(U)&&vi.get(U);ce&&N(W,ce)}return Reflect.set(J,W,U,de),S(["set",[W],ee,O]),!0}});c.set(f,d);const x=[T,j,o,$];return vi.set(d,x),Reflect.ownKeys(f).forEach(J=>{const W=Object.getOwnPropertyDescriptor(f,J);"value"in W&&(d[J]=f[J],delete W.value,delete W.writable),Object.defineProperty(T,J,W)}),d})=>[h,vi,xc,t,e,r,n,i,o,c,l],[Sx]=Ix();function Nn(t={}){return Sx(t)}function Jn(t,e,r){const n=vi.get(t);n||console.warn("Please use proxy object");let i;const o=[],c=n[3];let l=!1;const f=c(v=>{if(o.push(v),r){e(o.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,l&&e(o.splice(0))}))});return l=!0,()=>{l=!1,f()}}function Ox(t,e){const r=vi.get(t);r||console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),e)}var Vg={},Cc={};Cc.byteLength=$x,Cc.toByteArray=Tx,Cc.fromByteArray=Lx;for(var Ln=[],ln=[],Ax=typeof Uint8Array<"u"?Uint8Array:Array,Lh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Us=0,Dx=Lh.length;Us<Dx;++Us)Ln[Us]=Lh[Us],ln[Lh.charCodeAt(Us)]=Us;ln["-".charCodeAt(0)]=62,ln["_".charCodeAt(0)]=63;function Kg(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function $x(t){var e=Kg(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Px(t,e,r){return(e+r)*3/4-r}function Tx(t){var e,r=Kg(t),n=r[0],i=r[1],o=new Ax(Px(t,n,i)),c=0,l=i>0?n-4:n,h;for(h=0;h<l;h+=4)e=ln[t.charCodeAt(h)]<<18|ln[t.charCodeAt(h+1)]<<12|ln[t.charCodeAt(h+2)]<<6|ln[t.charCodeAt(h+3)],o[c++]=e>>16&255,o[c++]=e>>8&255,o[c++]=e&255;return i===2&&(e=ln[t.charCodeAt(h)]<<2|ln[t.charCodeAt(h+1)]>>4,o[c++]=e&255),i===1&&(e=ln[t.charCodeAt(h)]<<10|ln[t.charCodeAt(h+1)]<<4|ln[t.charCodeAt(h+2)]>>2,o[c++]=e>>8&255,o[c++]=e&255),o}function Rx(t){return Ln[t>>18&63]+Ln[t>>12&63]+Ln[t>>6&63]+Ln[t&63]}function Nx(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(Rx(n));return i.join("")}function Lx(t){for(var e,r=t.length,n=r%3,i=[],o=16383,c=0,l=r-n;c<l;c+=o)i.push(Nx(t,c,c+o>l?l:c+o));return n===1?(e=t[r-1],i.push(Ln[e>>2]+Ln[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Ln[e>>10]+Ln[e>>4&63]+Ln[e<<2&63]+"=")),i.join("")}var Mh={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Mh.read=function(t,e,r,n,i){var o,c,l=i*8-n-1,h=(1<<l)-1,f=h>>1,v=-7,E=r?i-1:0,_=r?-1:1,S=t[e+E];for(E+=_,o=S&(1<<-v)-1,S>>=-v,v+=l;v>0;o=o*256+t[e+E],E+=_,v-=8);for(c=o&(1<<-v)-1,o>>=-v,v+=n;v>0;c=c*256+t[e+E],E+=_,v-=8);if(o===0)o=1-f;else{if(o===h)return c?NaN:(S?-1:1)*(1/0);c=c+Math.pow(2,n),o=o-f}return(S?-1:1)*c*Math.pow(2,o-n)},Mh.write=function(t,e,r,n,i,o){var c,l,h,f=o*8-i-1,v=(1<<f)-1,E=v>>1,_=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:o-1,P=n?1:-1,j=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,c=v):(c=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-c))<1&&(c--,h*=2),c+E>=1?e+=_/h:e+=_*Math.pow(2,1-E),e*h>=2&&(c++,h/=2),c+E>=v?(l=0,c=v):c+E>=1?(l=(e*h-1)*Math.pow(2,i),c=c+E):(l=e*Math.pow(2,E-1)*Math.pow(2,i),c=0));i>=8;t[r+S]=l&255,S+=P,l/=256,i-=8);for(c=c<<i|l,f+=i;f>0;t[r+S]=c&255,S+=P,c/=256,f-=8);t[r+S-P]|=j*128};/*!
99
+ * The buffer module from node.js, for the browser.
100
+ *
101
+ * @author Feross Aboukhadijeh <https://feross.org>
102
+ * @license MIT
103
+ */(function(t){const e=Cc,r=Mh,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=N,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,l.TYPED_ARRAY_SUPPORT=o(),!l.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const b=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(b,p),b.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function c(b){if(b>i)throw new RangeError('The value "'+b+'" is invalid for option "size"');const p=new Uint8Array(b);return Object.setPrototypeOf(p,l.prototype),p}function l(b,p,m){if(typeof b=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(b)}return h(b,p,m)}l.poolSize=8192;function h(b,p,m){if(typeof b=="string")return _(b,p);if(ArrayBuffer.isView(b))return P(b);if(b==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b);if(ke(b,ArrayBuffer)||b&&ke(b.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ke(b,SharedArrayBuffer)||b&&ke(b.buffer,SharedArrayBuffer)))return j(b,p,m);if(typeof b=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const D=b.valueOf&&b.valueOf();if(D!=null&&D!==b)return l.from(D,p,m);const B=H(b);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof b[Symbol.toPrimitive]=="function")return l.from(b[Symbol.toPrimitive]("string"),p,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b)}l.from=function(b,p,m){return h(b,p,m)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function f(b){if(typeof b!="number")throw new TypeError('"size" argument must be of type number');if(b<0)throw new RangeError('The value "'+b+'" is invalid for option "size"')}function v(b,p,m){return f(b),b<=0?c(b):p!==void 0?typeof m=="string"?c(b).fill(p,m):c(b).fill(p):c(b)}l.alloc=function(b,p,m){return v(b,p,m)};function E(b){return f(b),c(b<0?0:Z(b)|0)}l.allocUnsafe=function(b){return E(b)},l.allocUnsafeSlow=function(b){return E(b)};function _(b,p){if((typeof p!="string"||p==="")&&(p="utf8"),!l.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const m=L(b,p)|0;let D=c(m);const B=D.write(b,p);return B!==m&&(D=D.slice(0,B)),D}function S(b){const p=b.length<0?0:Z(b.length)|0,m=c(p);for(let D=0;D<p;D+=1)m[D]=b[D]&255;return m}function P(b){if(ke(b,Uint8Array)){const p=new Uint8Array(b);return j(p.buffer,p.byteOffset,p.byteLength)}return S(b)}function j(b,p,m){if(p<0||b.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(b.byteLength<p+(m||0))throw new RangeError('"length" is outside of buffer bounds');let D;return p===void 0&&m===void 0?D=new Uint8Array(b):m===void 0?D=new Uint8Array(b,p):D=new Uint8Array(b,p,m),Object.setPrototypeOf(D,l.prototype),D}function H(b){if(l.isBuffer(b)){const p=Z(b.length)|0,m=c(p);return m.length===0||b.copy(m,0,0,p),m}if(b.length!==void 0)return typeof b.length!="number"||Ke(b.length)?c(0):S(b);if(b.type==="Buffer"&&Array.isArray(b.data))return S(b.data)}function Z(b){if(b>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return b|0}function N(b){return+b!=b&&(b=0),l.alloc(+b)}l.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==l.prototype},l.compare=function(p,m){if(ke(p,Uint8Array)&&(p=l.from(p,p.offset,p.byteLength)),ke(m,Uint8Array)&&(m=l.from(m,m.offset,m.byteLength)),!l.isBuffer(p)||!l.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===m)return 0;let D=p.length,B=m.length;for(let K=0,X=Math.min(D,B);K<X;++K)if(p[K]!==m[K]){D=p[K],B=m[K];break}return D<B?-1:B<D?1:0},l.isEncoding=function(p){switch(String(p).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(p,m){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return l.alloc(0);let D;if(m===void 0)for(m=0,D=0;D<p.length;++D)m+=p[D].length;const B=l.allocUnsafe(m);let K=0;for(D=0;D<p.length;++D){let X=p[D];if(ke(X,Uint8Array))K+X.length>B.length?(l.isBuffer(X)||(X=l.from(X)),X.copy(B,K)):Uint8Array.prototype.set.call(B,X,K);else if(l.isBuffer(X))X.copy(B,K);else throw new TypeError('"list" argument must be an Array of Buffers');K+=X.length}return B};function L(b,p){if(l.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||ke(b,ArrayBuffer))return b.byteLength;if(typeof b!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof b);const m=b.length,D=arguments.length>2&&arguments[2]===!0;if(!D&&m===0)return 0;let B=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Ge(b).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return Je(b).length;default:if(B)return D?-1:Ge(b).length;p=(""+p).toLowerCase(),B=!0}}l.byteLength=L;function $(b,p,m){let D=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,p>>>=0,m<=p))return"";for(b||(b="utf8");;)switch(b){case"hex":return ne(this,p,m);case"utf8":case"utf-8":return O(this,p,m);case"ascii":return le(this,p,m);case"latin1":case"binary":return re(this,p,m);case"base64":return me(this,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,p,m);default:if(D)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),D=!0}}l.prototype._isBuffer=!0;function T(b,p,m){const D=b[p];b[p]=b[m],b[m]=D}l.prototype.swap16=function(){const p=this.length;if(p%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let m=0;m<p;m+=2)T(this,m,m+1);return this},l.prototype.swap32=function(){const p=this.length;if(p%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let m=0;m<p;m+=4)T(this,m,m+3),T(this,m+1,m+2);return this},l.prototype.swap64=function(){const p=this.length;if(p%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let m=0;m<p;m+=8)T(this,m,m+7),T(this,m+1,m+6),T(this,m+2,m+5),T(this,m+3,m+4);return this},l.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?O(this,0,p):$.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(p){if(!l.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:l.compare(this,p)===0},l.prototype.inspect=function(){let p="";const m=t.INSPECT_MAX_BYTES;return p=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(p+=" ... "),"<Buffer "+p+">"},n&&(l.prototype[n]=l.prototype.inspect),l.prototype.compare=function(p,m,D,B,K){if(ke(p,Uint8Array)&&(p=l.from(p,p.offset,p.byteLength)),!l.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(m===void 0&&(m=0),D===void 0&&(D=p?p.length:0),B===void 0&&(B=0),K===void 0&&(K=this.length),m<0||D>p.length||B<0||K>this.length)throw new RangeError("out of range index");if(B>=K&&m>=D)return 0;if(B>=K)return-1;if(m>=D)return 1;if(m>>>=0,D>>>=0,B>>>=0,K>>>=0,this===p)return 0;let X=K-B,Ee=D-m;const Re=Math.min(X,Ee),st=this.slice(B,K),ht=p.slice(m,D);for(let lt=0;lt<Re;++lt)if(st[lt]!==ht[lt]){X=st[lt],Ee=ht[lt];break}return X<Ee?-1:Ee<X?1:0};function I(b,p,m,D,B){if(b.length===0)return-1;if(typeof m=="string"?(D=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,Ke(m)&&(m=B?0:b.length-1),m<0&&(m=b.length+m),m>=b.length){if(B)return-1;m=b.length-1}else if(m<0)if(B)m=0;else return-1;if(typeof p=="string"&&(p=l.from(p,D)),l.isBuffer(p))return p.length===0?-1:d(b,p,m,D,B);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(b,p,m):Uint8Array.prototype.lastIndexOf.call(b,p,m):d(b,[p],m,D,B);throw new TypeError("val must be string, number or Buffer")}function d(b,p,m,D,B){let K=1,X=b.length,Ee=p.length;if(D!==void 0&&(D=String(D).toLowerCase(),D==="ucs2"||D==="ucs-2"||D==="utf16le"||D==="utf-16le")){if(b.length<2||p.length<2)return-1;K=2,X/=2,Ee/=2,m/=2}function Re(ht,lt){return K===1?ht[lt]:ht.readUInt16BE(lt*K)}let st;if(B){let ht=-1;for(st=m;st<X;st++)if(Re(b,st)===Re(p,ht===-1?0:st-ht)){if(ht===-1&&(ht=st),st-ht+1===Ee)return ht*K}else ht!==-1&&(st-=st-ht),ht=-1}else for(m+Ee>X&&(m=X-Ee),st=m;st>=0;st--){let ht=!0;for(let lt=0;lt<Ee;lt++)if(Re(b,st+lt)!==Re(p,lt)){ht=!1;break}if(ht)return st}return-1}l.prototype.includes=function(p,m,D){return this.indexOf(p,m,D)!==-1},l.prototype.indexOf=function(p,m,D){return I(this,p,m,D,!0)},l.prototype.lastIndexOf=function(p,m,D){return I(this,p,m,D,!1)};function x(b,p,m,D){m=Number(m)||0;const B=b.length-m;D?(D=Number(D),D>B&&(D=B)):D=B;const K=p.length;D>K/2&&(D=K/2);let X;for(X=0;X<D;++X){const Ee=parseInt(p.substr(X*2,2),16);if(Ke(Ee))return X;b[m+X]=Ee}return X}function J(b,p,m,D){return He(Ge(p,b.length-m),b,m,D)}function W(b,p,m,D){return He(Dt(p),b,m,D)}function ee(b,p,m,D){return He(Je(p),b,m,D)}function de(b,p,m,D){return He($t(p,b.length-m),b,m,D)}l.prototype.write=function(p,m,D,B){if(m===void 0)B="utf8",D=this.length,m=0;else if(D===void 0&&typeof m=="string")B=m,D=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(D)?(D=D>>>0,B===void 0&&(B="utf8")):(B=D,D=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const K=this.length-m;if((D===void 0||D>K)&&(D=K),p.length>0&&(D<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let X=!1;for(;;)switch(B){case"hex":return x(this,p,m,D);case"utf8":case"utf-8":return J(this,p,m,D);case"ascii":case"latin1":case"binary":return W(this,p,m,D);case"base64":return ee(this,p,m,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,p,m,D);default:if(X)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),X=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function me(b,p,m){return p===0&&m===b.length?e.fromByteArray(b):e.fromByteArray(b.slice(p,m))}function O(b,p,m){m=Math.min(b.length,m);const D=[];let B=p;for(;B<m;){const K=b[B];let X=null,Ee=K>239?4:K>223?3:K>191?2:1;if(B+Ee<=m){let Re,st,ht,lt;switch(Ee){case 1:K<128&&(X=K);break;case 2:Re=b[B+1],(Re&192)===128&&(lt=(K&31)<<6|Re&63,lt>127&&(X=lt));break;case 3:Re=b[B+1],st=b[B+2],(Re&192)===128&&(st&192)===128&&(lt=(K&15)<<12|(Re&63)<<6|st&63,lt>2047&&(lt<55296||lt>57343)&&(X=lt));break;case 4:Re=b[B+1],st=b[B+2],ht=b[B+3],(Re&192)===128&&(st&192)===128&&(ht&192)===128&&(lt=(K&15)<<18|(Re&63)<<12|(st&63)<<6|ht&63,lt>65535&&lt<1114112&&(X=lt))}}X===null?(X=65533,Ee=1):X>65535&&(X-=65536,D.push(X>>>10&1023|55296),X=56320|X&1023),D.push(X),B+=Ee}return ce(D)}const U=4096;function ce(b){const p=b.length;if(p<=U)return String.fromCharCode.apply(String,b);let m="",D=0;for(;D<p;)m+=String.fromCharCode.apply(String,b.slice(D,D+=U));return m}function le(b,p,m){let D="";m=Math.min(b.length,m);for(let B=p;B<m;++B)D+=String.fromCharCode(b[B]&127);return D}function re(b,p,m){let D="";m=Math.min(b.length,m);for(let B=p;B<m;++B)D+=String.fromCharCode(b[B]);return D}function ne(b,p,m){const D=b.length;(!p||p<0)&&(p=0),(!m||m<0||m>D)&&(m=D);let B="";for(let K=p;K<m;++K)B+=rt[b[K]];return B}function ae(b,p,m){const D=b.slice(p,m);let B="";for(let K=0;K<D.length-1;K+=2)B+=String.fromCharCode(D[K]+D[K+1]*256);return B}l.prototype.slice=function(p,m){const D=this.length;p=~~p,m=m===void 0?D:~~m,p<0?(p+=D,p<0&&(p=0)):p>D&&(p=D),m<0?(m+=D,m<0&&(m=0)):m>D&&(m=D),m<p&&(m=p);const B=this.subarray(p,m);return Object.setPrototypeOf(B,l.prototype),B};function ie(b,p,m){if(b%1!==0||b<0)throw new RangeError("offset is not uint");if(b+p>m)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p],K=1,X=0;for(;++X<m&&(K*=256);)B+=this[p+X]*K;return B},l.prototype.readUintBE=l.prototype.readUIntBE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p+--m],K=1;for(;m>0&&(K*=256);)B+=this[p+--m]*K;return B},l.prototype.readUint8=l.prototype.readUInt8=function(p,m){return p=p>>>0,m||ie(p,1,this.length),this[p]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(p,m){return p=p>>>0,m||ie(p,2,this.length),this[p]|this[p+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(p,m){return p=p>>>0,m||ie(p,2,this.length),this[p]<<8|this[p+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},l.prototype.readBigUInt64LE=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Ue(p,this.length-8);const B=m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,K=this[++p]+this[++p]*2**8+this[++p]*2**16+D*2**24;return BigInt(B)+(BigInt(K)<<BigInt(32))}),l.prototype.readBigUInt64BE=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Ue(p,this.length-8);const B=m*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],K=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+D;return(BigInt(B)<<BigInt(32))+BigInt(K)}),l.prototype.readIntLE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p],K=1,X=0;for(;++X<m&&(K*=256);)B+=this[p+X]*K;return K*=128,B>=K&&(B-=Math.pow(2,8*m)),B},l.prototype.readIntBE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=m,K=1,X=this[p+--B];for(;B>0&&(K*=256);)X+=this[p+--B]*K;return K*=128,X>=K&&(X-=Math.pow(2,8*m)),X},l.prototype.readInt8=function(p,m){return p=p>>>0,m||ie(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},l.prototype.readInt16LE=function(p,m){p=p>>>0,m||ie(p,2,this.length);const D=this[p]|this[p+1]<<8;return D&32768?D|4294901760:D},l.prototype.readInt16BE=function(p,m){p=p>>>0,m||ie(p,2,this.length);const D=this[p+1]|this[p]<<8;return D&32768?D|4294901760:D},l.prototype.readInt32LE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},l.prototype.readInt32BE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},l.prototype.readBigInt64LE=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Ue(p,this.length-8);const B=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(D<<24);return(BigInt(B)<<BigInt(32))+BigInt(m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),l.prototype.readBigInt64BE=je(function(p){p=p>>>0,ve(p,"offset");const m=this[p],D=this[p+7];(m===void 0||D===void 0)&&Ue(p,this.length-8);const B=(m<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(B)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+D)}),l.prototype.readFloatLE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),r.read(this,p,!0,23,4)},l.prototype.readFloatBE=function(p,m){return p=p>>>0,m||ie(p,4,this.length),r.read(this,p,!1,23,4)},l.prototype.readDoubleLE=function(p,m){return p=p>>>0,m||ie(p,8,this.length),r.read(this,p,!0,52,8)},l.prototype.readDoubleBE=function(p,m){return p=p>>>0,m||ie(p,8,this.length),r.read(this,p,!1,52,8)};function Ae(b,p,m,D,B,K){if(!l.isBuffer(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>B||p<K)throw new RangeError('"value" argument is out of bounds');if(m+D>b.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(p,m,D,B){if(p=+p,m=m>>>0,D=D>>>0,!B){const Ee=Math.pow(2,8*D)-1;Ae(this,p,m,D,Ee,0)}let K=1,X=0;for(this[m]=p&255;++X<D&&(K*=256);)this[m+X]=p/K&255;return m+D},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(p,m,D,B){if(p=+p,m=m>>>0,D=D>>>0,!B){const Ee=Math.pow(2,8*D)-1;Ae(this,p,m,D,Ee,0)}let K=D-1,X=1;for(this[m+K]=p&255;--K>=0&&(X*=256);)this[m+K]=p/X&255;return m+D},l.prototype.writeUint8=l.prototype.writeUInt8=function(p,m,D){return p=+p,m=m>>>0,D||Ae(this,p,m,1,255,0),this[m]=p&255,m+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(p,m,D){return p=+p,m=m>>>0,D||Ae(this,p,m,2,65535,0),this[m]=p&255,this[m+1]=p>>>8,m+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(p,m,D){return p=+p,m=m>>>0,D||Ae(this,p,m,2,65535,0),this[m]=p>>>8,this[m+1]=p&255,m+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(p,m,D){return p=+p,m=m>>>0,D||Ae(this,p,m,4,4294967295,0),this[m+3]=p>>>24,this[m+2]=p>>>16,this[m+1]=p>>>8,this[m]=p&255,m+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(p,m,D){return p=+p,m=m>>>0,D||Ae(this,p,m,4,4294967295,0),this[m]=p>>>24,this[m+1]=p>>>16,this[m+2]=p>>>8,this[m+3]=p&255,m+4};function ge(b,p,m,D,B){we(p,D,B,b,m,7);let K=Number(p&BigInt(4294967295));b[m++]=K,K=K>>8,b[m++]=K,K=K>>8,b[m++]=K,K=K>>8,b[m++]=K;let X=Number(p>>BigInt(32)&BigInt(4294967295));return b[m++]=X,X=X>>8,b[m++]=X,X=X>>8,b[m++]=X,X=X>>8,b[m++]=X,m}function Be(b,p,m,D,B){we(p,D,B,b,m,7);let K=Number(p&BigInt(4294967295));b[m+7]=K,K=K>>8,b[m+6]=K,K=K>>8,b[m+5]=K,K=K>>8,b[m+4]=K;let X=Number(p>>BigInt(32)&BigInt(4294967295));return b[m+3]=X,X=X>>8,b[m+2]=X,X=X>>8,b[m+1]=X,X=X>>8,b[m]=X,m+8}l.prototype.writeBigUInt64LE=je(function(p,m=0){return ge(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=je(function(p,m=0){return Be(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(p,m,D,B){if(p=+p,m=m>>>0,!B){const Re=Math.pow(2,8*D-1);Ae(this,p,m,D,Re-1,-Re)}let K=0,X=1,Ee=0;for(this[m]=p&255;++K<D&&(X*=256);)p<0&&Ee===0&&this[m+K-1]!==0&&(Ee=1),this[m+K]=(p/X>>0)-Ee&255;return m+D},l.prototype.writeIntBE=function(p,m,D,B){if(p=+p,m=m>>>0,!B){const Re=Math.pow(2,8*D-1);Ae(this,p,m,D,Re-1,-Re)}let K=D-1,X=1,Ee=0;for(this[m+K]=p&255;--K>=0&&(X*=256);)p<0&&Ee===0&&this[m+K+1]!==0&&(Ee=1),this[m+K]=(p/X>>0)-Ee&255;return m+D},l.prototype.writeInt8=function(p,m,D){return p=+p,m=m>>>0,D||Ae(this,p,m,1,127,-128),p<0&&(p=255+p+1),this[m]=p&255,m+1},l.prototype.writeInt16LE=function(p,m,D){return p=+p,m=m>>>0,D||Ae(this,p,m,2,32767,-32768),this[m]=p&255,this[m+1]=p>>>8,m+2},l.prototype.writeInt16BE=function(p,m,D){return p=+p,m=m>>>0,D||Ae(this,p,m,2,32767,-32768),this[m]=p>>>8,this[m+1]=p&255,m+2},l.prototype.writeInt32LE=function(p,m,D){return p=+p,m=m>>>0,D||Ae(this,p,m,4,2147483647,-2147483648),this[m]=p&255,this[m+1]=p>>>8,this[m+2]=p>>>16,this[m+3]=p>>>24,m+4},l.prototype.writeInt32BE=function(p,m,D){return p=+p,m=m>>>0,D||Ae(this,p,m,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[m]=p>>>24,this[m+1]=p>>>16,this[m+2]=p>>>8,this[m+3]=p&255,m+4},l.prototype.writeBigInt64LE=je(function(p,m=0){return ge(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=je(function(p,m=0){return Be(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(b,p,m,D,B,K){if(m+D>b.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function Me(b,p,m,D,B){return p=+p,m=m>>>0,B||ye(b,p,m,4),r.write(b,p,m,D,23,4),m+4}l.prototype.writeFloatLE=function(p,m,D){return Me(this,p,m,!0,D)},l.prototype.writeFloatBE=function(p,m,D){return Me(this,p,m,!1,D)};function Q(b,p,m,D,B){return p=+p,m=m>>>0,B||ye(b,p,m,8),r.write(b,p,m,D,52,8),m+8}l.prototype.writeDoubleLE=function(p,m,D){return Q(this,p,m,!0,D)},l.prototype.writeDoubleBE=function(p,m,D){return Q(this,p,m,!1,D)},l.prototype.copy=function(p,m,D,B){if(!l.isBuffer(p))throw new TypeError("argument should be a Buffer");if(D||(D=0),!B&&B!==0&&(B=this.length),m>=p.length&&(m=p.length),m||(m=0),B>0&&B<D&&(B=D),B===D||p.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(D<0||D>=this.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("sourceEnd out of bounds");B>this.length&&(B=this.length),p.length-m<B-D&&(B=p.length-m+D);const K=B-D;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(m,D,B):Uint8Array.prototype.set.call(p,this.subarray(D,B),m),K},l.prototype.fill=function(p,m,D,B){if(typeof p=="string"){if(typeof m=="string"?(B=m,m=0,D=this.length):typeof D=="string"&&(B=D,D=this.length),B!==void 0&&typeof B!="string")throw new TypeError("encoding must be a string");if(typeof B=="string"&&!l.isEncoding(B))throw new TypeError("Unknown encoding: "+B);if(p.length===1){const X=p.charCodeAt(0);(B==="utf8"&&X<128||B==="latin1")&&(p=X)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(m<0||this.length<m||this.length<D)throw new RangeError("Out of range index");if(D<=m)return this;m=m>>>0,D=D===void 0?this.length:D>>>0,p||(p=0);let K;if(typeof p=="number")for(K=m;K<D;++K)this[K]=p;else{const X=l.isBuffer(p)?p:l.from(p,B),Ee=X.length;if(Ee===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(K=0;K<D-m;++K)this[K+m]=X[K%Ee]}return this};const Y={};function z(b,p,m){Y[b]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${b}]`,this.stack,delete this.name}get code(){return b}set code(B){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:B,writable:!0})}toString(){return`${this.name} [${b}]: ${this.message}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(b){return b?`${b} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(b,p){return`The "${b}" argument must be of type number. Received type ${typeof p}`},TypeError),z("ERR_OUT_OF_RANGE",function(b,p,m){let D=`The value of "${b}" is out of range.`,B=m;return Number.isInteger(m)&&Math.abs(m)>2**32?B=w(String(m)):typeof m=="bigint"&&(B=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(B=w(B)),B+="n"),D+=` It must be ${p}. Received ${B}`,D},RangeError);function w(b){let p="",m=b.length;const D=b[0]==="-"?1:0;for(;m>=D+4;m-=3)p=`_${b.slice(m-3,m)}${p}`;return`${b.slice(0,m)}${p}`}function F(b,p,m){ve(p,"offset"),(b[p]===void 0||b[p+m]===void 0)&&Ue(p,b.length-(m+1))}function we(b,p,m,D,B,K){if(b>m||b<p){const X=typeof p=="bigint"?"n":"";let Ee;throw K>3?p===0||p===BigInt(0)?Ee=`>= 0${X} and < 2${X} ** ${(K+1)*8}${X}`:Ee=`>= -(2${X} ** ${(K+1)*8-1}${X}) and < 2 ** ${(K+1)*8-1}${X}`:Ee=`>= ${p}${X} and <= ${m}${X}`,new Y.ERR_OUT_OF_RANGE("value",Ee,b)}F(D,B,K)}function ve(b,p){if(typeof b!="number")throw new Y.ERR_INVALID_ARG_TYPE(p,"number",b)}function Ue(b,p,m){throw Math.floor(b)!==b?(ve(b,m),new Y.ERR_OUT_OF_RANGE(m||"offset","an integer",b)):p<0?new Y.ERR_BUFFER_OUT_OF_BOUNDS:new Y.ERR_OUT_OF_RANGE(m||"offset",`>= ${m?1:0} and <= ${p}`,b)}const nt=/[^+/0-9A-Za-z-_]/g;function at(b){if(b=b.split("=")[0],b=b.trim().replace(nt,""),b.length<2)return"";for(;b.length%4!==0;)b=b+"=";return b}function Ge(b,p){p=p||1/0;let m;const D=b.length;let B=null;const K=[];for(let X=0;X<D;++X){if(m=b.charCodeAt(X),m>55295&&m<57344){if(!B){if(m>56319){(p-=3)>-1&&K.push(239,191,189);continue}else if(X+1===D){(p-=3)>-1&&K.push(239,191,189);continue}B=m;continue}if(m<56320){(p-=3)>-1&&K.push(239,191,189),B=m;continue}m=(B-55296<<10|m-56320)+65536}else B&&(p-=3)>-1&&K.push(239,191,189);if(B=null,m<128){if((p-=1)<0)break;K.push(m)}else if(m<2048){if((p-=2)<0)break;K.push(m>>6|192,m&63|128)}else if(m<65536){if((p-=3)<0)break;K.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((p-=4)<0)break;K.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return K}function Dt(b){const p=[];for(let m=0;m<b.length;++m)p.push(b.charCodeAt(m)&255);return p}function $t(b,p){let m,D,B;const K=[];for(let X=0;X<b.length&&!((p-=2)<0);++X)m=b.charCodeAt(X),D=m>>8,B=m%256,K.push(B),K.push(D);return K}function Je(b){return e.toByteArray(at(b))}function He(b,p,m,D){let B;for(B=0;B<D&&!(B+m>=p.length||B>=b.length);++B)p[B+m]=b[B];return B}function ke(b,p){return b instanceof p||b!=null&&b.constructor!=null&&b.constructor.name!=null&&b.constructor.name===p.name}function Ke(b){return b!==b}const rt=function(){const b="0123456789abcdef",p=new Array(256);for(let m=0;m<16;++m){const D=m*16;for(let B=0;B<16;++B)p[D+B]=b[m]+b[B]}return p}();function je(b){return typeof BigInt>"u"?Ze:b}function Ze(){throw new Error("BigInt not supported")}})(Vg);let Uh;const Lt={ethereumClient:void 0,setEthereumClient(t){Uh=t},client(){if(Uh)return Uh;throw new Error("ClientCtrl has no client set")}},gr=Nn({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),tt={state:gr,subscribe(t){return Jn(gr,()=>t(gr))},push(t,e){t!==gr.view&&(gr.view=t,e&&(gr.data=e),gr.history.push(t))},reset(t){gr.view=t,gr.history=[t]},replace(t){gr.history.length>1&&(gr.history[gr.history.length-1]=t,gr.view=t)},goBack(){if(gr.history.length>1){gr.history.pop();const[t]=gr.history.slice(-1);gr.view=t}},setData(t){gr.data=t}},Se={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",W3M_VERSION:"W3M_VERSION",W3M_PREFER_INJECTED_URL_FLAG:"w3mPreferInjected",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return Se.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Se.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if(Se.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!Se.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;t.endsWith("/")&&(n=t.slice(0,-1)),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}/wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){localStorage.setItem(Se.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){const[e]=t.split("?");localStorage.setItem(Se.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(Se.WALLETCONNECT_DEEPLINK_CHOICE)},setWeb3ModalVersionInStorage(){typeof localStorage<"u"&&localStorage.setItem(Se.W3M_VERSION,"2.4.2")},getWalletRouterData(){var t;const e=(t=tt.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e},getSwitchNetworkRouterData(){var t;const e=(t=tt.state.data)==null?void 0:t.SwitchNetwork;if(!e)throw new Error('Missing "SwitchNetwork" view data');return e},isPreferInjectedFlag(){return typeof location<"u"?new URLSearchParams(location.search).has(Se.W3M_PREFER_INJECTED_URL_FLAG):!1}},Mx=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Sr=Nn({enabled:Mx,userSessionId:"",events:[],connectedWalletId:void 0}),yi={state:Sr,subscribe(t){return Jn(Sr.events,()=>t(Ox(Sr.events[Sr.events.length-1])))},initialize(){Sr.enabled&&typeof crypto<"u"&&(Sr.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Sr.connectedWalletId=t},click(t){if(Sr.enabled){const e={type:"CLICK",name:t.name,userSessionId:Sr.userSessionId,timestamp:Date.now(),data:t};Sr.events.push(e)}},track(t){if(Sr.enabled){const e={type:"TRACK",name:t.name,userSessionId:Sr.userSessionId,timestamp:Date.now(),data:t};Sr.events.push(e)}},view(t){if(Sr.enabled){const e={type:"VIEW",name:t.name,userSessionId:Sr.userSessionId,timestamp:Date.now(),data:t};Sr.events.push(e)}}},Er=Nn({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,isStandalone:!1,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1,isPreferInjected:!1,walletConnectVersion:1}),De={state:Er,subscribe(t){return Jn(Er,()=>t(Er))},setChains(t){Er.chains=t},setStandaloneChains(t){Er.standaloneChains=t},setStandaloneUri(t){Er.standaloneUri=t},getSelectedChain(){const t=Lt.client().getNetwork().chain;return t&&(Er.selectedChain=t),Er.selectedChain},setSelectedChain(t){Er.selectedChain=t},setIsStandalone(t){Er.isStandalone=t},setIsCustomDesktop(t){Er.isCustomDesktop=t},setIsCustomMobile(t){Er.isCustomMobile=t},setIsDataLoaded(t){Er.isDataLoaded=t},setIsUiLoaded(t){Er.isUiLoaded=t},setWalletConnectVersion(t){Er.walletConnectVersion=t},setIsPreferInjected(t){Er.isPreferInjected=t},setIsAuth(t){Er.isAuth=t}},Ic=Nn({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,tokenContracts:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableAuthMode:!1,enableNetworkView:!1,enableAccountView:!0,enableExplorer:!0,defaultChain:void 0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Ft={state:Ic,subscribe(t){return Jn(Ic,()=>t(Ic))},setConfig(t){var e,r,n,i;yi.initialize(),De.setStandaloneChains(t.standaloneChains),De.setIsStandalone(!!((e=t.standaloneChains)!=null&&e.length)||!!t.enableStandaloneMode),De.setIsAuth(!!t.enableAuthMode),De.setIsCustomMobile(!!((r=t.mobileWallets)!=null&&r.length)),De.setIsCustomDesktop(!!((n=t.desktopWallets)!=null&&n.length)),De.setWalletConnectVersion((i=t.walletConnectVersion)!=null?i:1),De.state.isStandalone||(De.setChains(Lt.client().chains),De.setIsPreferInjected(Lt.client().isInjectedProviderInstalled()&&Se.isPreferInjectedFlag())),t.defaultChain&&De.setSelectedChain(t.defaultChain),Se.setWeb3ModalVersionInStorage(),Object.assign(Ic,t)}},Ht=Nn({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),Et={state:Ht,subscribe(t){return Jn(Ht,()=>t(Ht))},getAccount(){const t=Lt.client().getAccount();Ht.address=t.address,Ht.isConnected=t.isConnected},async fetchProfile(t,e){var r;try{Ht.profileLoading=!0;const n=e??Ht.address,i=(r=De.state.chains)==null?void 0:r.find(o=>o.id===1);if(n&&i){const o=await Lt.client().fetchEnsName({address:n,chainId:1});if(o){const c=await Lt.client().fetchEnsAvatar({name:o,chainId:1});c&&await t(c),Ht.profileAvatar=c}Ht.profileName=o}}finally{Ht.profileLoading=!1}},async fetchBalance(t){try{const{chain:e}=Lt.client().getNetwork(),{tokenContracts:r}=Ft.state;let n;e&&r&&(n=r[e.id]),Ht.balanceLoading=!0;const i=t??Ht.address;if(i){const o=await Lt.client().fetchBalance({address:i,token:n});Ht.balance={amount:o.formatted,symbol:o.symbol}}}finally{Ht.balanceLoading=!1}},setAddress(t){Ht.address=t},setIsConnected(t){Ht.isConnected=t},resetBalance(){Ht.balance=void 0},resetAccount(){Ht.address=void 0,Ht.isConnected=!1,Ht.profileName=void 0,Ht.profileAvatar=void 0,Ht.balance=void 0}},jh="https://explorer-api.walletconnect.com";async function Sc(t,e){const r=new URL(t,jh);return r.searchParams.append("projectId",Ft.state.projectId),Object.entries(e).forEach(([n,i])=>{i&&r.searchParams.append(n,String(i))}),(await fetch(r)).json()}const bi={async getDesktopListings(t){return Sc("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return Sc("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return Sc("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return Sc("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${jh}/w3m/v1/getWalletImage/${t}?projectId=${Ft.state.projectId}`},getAssetImageUrl(t){return`${jh}/w3m/v1/getAssetImage/${t}?projectId=${Ft.state.projectId}`}};var Ux=Object.defineProperty,Gg=Object.getOwnPropertySymbols,jx=Object.prototype.hasOwnProperty,Fx=Object.prototype.propertyIsEnumerable,Zg=(t,e,r)=>e in t?Ux(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Bx=(t,e)=>{for(var r in e||(e={}))jx.call(e,r)&&Zg(t,r,e[r]);if(Gg)for(var r of Gg(e))Fx.call(e,r)&&Zg(t,r,e[r]);return t};const Yg=Se.isMobile(),un=Nn({wallets:{listings:[],total:0,page:1},injectedWallets:[],search:{listings:[],total:0,page:1},recomendedWallets:[]}),rr={state:un,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=Ft.state;if(t==="NONE"||e==="ALL"&&!t)return un.recomendedWallets;if(Se.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await bi.getAllListings(r),i=Object.values(n);i.sort((o,c)=>{const l=t.indexOf(o.id),h=t.indexOf(c.id);return l-h}),un.recomendedWallets=i}else{const{standaloneChains:r,walletConnectVersion:n,isAuth:i}=De.state,o=r?.join(","),c=Se.isArray(e),l={page:1,sdks:i?"auth_v1":void 0,entries:Se.RECOMMENDED_WALLET_AMOUNT,chains:o,version:n,excludedIds:c?e.join(","):void 0},{listings:h}=Yg?await bi.getMobileListings(l):await bi.getDesktopListings(l);un.recomendedWallets=Object.values(h)}return un.recomendedWallets},async getWallets(t){const e=Bx({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=Ft.state,{recomendedWallets:i}=un;if(n==="ALL")return un.wallets;e.search||(i.length?e.excludedIds=i.map(E=>E.id).join(","):Se.isArray(r)&&(e.excludedIds=r.join(","))),Se.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),De.state.isAuth&&(e.sdks="auth_v1");const{page:o,search:c}=t,{listings:l,total:h}=Yg?await bi.getMobileListings(e):await bi.getDesktopListings(e),f=Object.values(l),v=c?"search":"wallets";return un[v]={listings:[...un[v].listings,...f],total:h,page:o??1},{listings:f,total:h}},async getInjectedWallets(){const{listings:t}=await bi.getInjectedListings({}),e=Object.values(t);return un.injectedWallets=e,un.injectedWallets},getWalletImageUrl(t){return bi.getWalletImageUrl(t)},getAssetImageUrl(t){return bi.getAssetImageUrl(t)},resetSearch(){un.search={listings:[],total:0,page:1}}},na=Nn({pairingUri:"",pairingError:!1}),ur={state:na,subscribe(t){return Jn(na,()=>t(na))},setPairingUri(t){na.pairingUri=t},setPairingError(t){na.pairingError=t}},js=Nn({open:!1}),Nr={state:js,subscribe(t){return Jn(js,()=>t(js))},async open(t){return new Promise(e=>{const{isStandalone:r,isUiLoaded:n,isDataLoaded:i,isPreferInjected:o,selectedChain:c}=De.state,{isConnected:l}=Et.state,{enableNetworkView:h}=Ft.state;if(r)De.setStandaloneUri(t?.uri),De.setStandaloneChains(t?.standaloneChains),tt.reset("ConnectWallet");else if(t!=null&&t.route)tt.reset(t.route);else if(l)tt.reset("Account");else if(h)tt.reset("SelectNetwork");else if(o){Lt.client().connectConnector("injected",c?.id).catch(v=>console.error(v)),e();return}else tt.reset("ConnectWallet");const{pairingUri:f}=ur.state;if(n&&i&&(r||f||l))js.open=!0,e();else{const v=setInterval(()=>{const E=De.state,_=ur.state;E.isUiLoaded&&E.isDataLoaded&&(E.isStandalone||_.pairingUri||l)&&(clearInterval(v),js.open=!0,e())},200)}})},close(){js.open=!1}};var kx=Object.defineProperty,Jg=Object.getOwnPropertySymbols,Hx=Object.prototype.hasOwnProperty,Wx=Object.prototype.propertyIsEnumerable,Qg=(t,e,r)=>e in t?kx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zx=(t,e)=>{for(var r in e||(e={}))Hx.call(e,r)&&Qg(t,r,e[r]);if(Jg)for(var r of Jg(e))Wx.call(e,r)&&Qg(t,r,e[r]);return t};function qx(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const ia=Nn({themeMode:qx()?"dark":"light"}),Mn={state:ia,subscribe(t){return Jn(ia,()=>t(ia))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(ia.themeMode=e),r&&(ia.themeVariables=zx({},r))}},Yi=Nn({open:!1,message:"",variant:"success"}),qr={state:Yi,subscribe(t){return Jn(Yi,()=>t(Yi))},openToast(t,e){Yi.open=!0,Yi.message=t,Yi.variant=e},closeToast(){Yi.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=Vg.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var Vx=Object.defineProperty,Xg=Object.getOwnPropertySymbols,Kx=Object.prototype.hasOwnProperty,Gx=Object.prototype.propertyIsEnumerable,e3=(t,e,r)=>e in t?Vx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zx=(t,e)=>{for(var r in e||(e={}))Kx.call(e,r)&&e3(t,r,e[r]);if(Xg)for(var r of Xg(e))Gx.call(e,r)&&e3(t,r,e[r]);return t};class Yx{constructor(e){this.openModal=Nr.open,this.closeModal=Nr.close,this.subscribeModal=Nr.subscribe,this.setTheme=Mn.setThemeConfig,Mn.setThemeConfig(e),Ft.setConfig(Zx({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return SA});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),De.setIsUiLoaded(!0)}}}var Jx=Object.freeze({__proto__:null,WalletConnectModal:Yx});/**
104
+ * @license
105
+ * Copyright 2019 Google LLC
106
+ * SPDX-License-Identifier: BSD-3-Clause
107
+ */const Oc=window,Fh=Oc.ShadowRoot&&(Oc.ShadyCSS===void 0||Oc.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Bh=Symbol(),t3=new WeakMap;class r3{constructor(e,r,n){if(this._$cssResult$=!0,n!==Bh)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(Fh&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=t3.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&t3.set(r,e))}return e}toString(){return this.cssText}}const Qx=t=>new r3(typeof t=="string"?t:t+"",void 0,Bh),Ve=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,i,o)=>n+(c=>{if(c._$cssResult$===!0)return c.cssText;if(typeof c=="number")return c;throw Error("Value passed to 'css' function must be a 'css' function result: "+c+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1],t[0]);return new r3(r,t,Bh)},Xx=(t,e)=>{Fh?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const n=document.createElement("style"),i=Oc.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},n3=Fh?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return Qx(r)})(t):t;/**
108
+ * @license
109
+ * Copyright 2017 Google LLC
110
+ * SPDX-License-Identifier: BSD-3-Clause
111
+ */var kh;const Ac=window,i3=Ac.trustedTypes,e9=i3?i3.emptyScript:"",s3=Ac.reactiveElementPolyfillSupport,Hh={toAttribute(t,e){switch(e){case Boolean:t=t?e9:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},o3=(t,e)=>e!==t&&(e==e||t==t),Wh={attribute:!0,type:String,converter:Hh,reflect:!1,hasChanged:o3};class Fs extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,n)=>{const i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=Wh){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){const o=this[e];this[r]=i,this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Wh}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)r.unshift(n3(i))}else e!==void 0&&r.push(n3(e));return r}static _$Ep(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Xx(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=Wh){var i;const o=this.constructor._$Ep(e,n);if(o!==void 0&&n.reflect===!0){const c=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:Hh).toAttribute(r,n.type);this._$El=e,c==null?this.removeAttribute(o):this.setAttribute(o,c),this._$El=null}}_$AK(e,r){var n;const i=this.constructor,o=i._$Ev.get(e);if(o!==void 0&&this._$El!==o){const c=i.getPropertyOptions(o),l=typeof c.converter=="function"?{fromAttribute:c.converter}:((n=c.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?c.converter:Hh;this._$El=o,this[o]=l.fromAttribute(r,c.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||o3)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,o)=>this[o]=i),this._$Ei=void 0);let r=!1;const n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var o;return(o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}Fs.finalized=!0,Fs.elementProperties=new Map,Fs.elementStyles=[],Fs.shadowRootOptions={mode:"open"},s3?.({ReactiveElement:Fs}),((kh=Ac.reactiveElementVersions)!==null&&kh!==void 0?kh:Ac.reactiveElementVersions=[]).push("1.6.1");/**
112
+ * @license
113
+ * Copyright 2017 Google LLC
114
+ * SPDX-License-Identifier: BSD-3-Clause
115
+ */var zh;const Dc=window,Bs=Dc.trustedTypes,a3=Bs?Bs.createPolicy("lit-html",{createHTML:t=>t}):void 0,qh="$lit$",_i=`lit$${(Math.random()+"").slice(9)}$`,c3="?"+_i,t9=`<${c3}>`,Ji=document,sa=()=>Ji.createComment(""),oa=t=>t===null||typeof t!="object"&&typeof t!="function",l3=Array.isArray,r9=t=>l3(t)||typeof t?.[Symbol.iterator]=="function",Vh=`[
116
+ \f\r]`,aa=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,u3=/-->/g,h3=/>/g,Qi=RegExp(`>|${Vh}(?:([^\\s"'>=/]+)(${Vh}*=${Vh}*(?:[^
117
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),f3=/'/g,d3=/"/g,p3=/^(?:script|style|textarea|title)$/i,g3=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),oe=g3(1),ut=g3(2),Xi=Symbol.for("lit-noChange"),mr=Symbol.for("lit-nothing"),m3=new WeakMap,es=Ji.createTreeWalker(Ji,129,null,!1),n9=(t,e)=>{const r=t.length-1,n=[];let i,o=e===2?"<svg>":"",c=aa;for(let h=0;h<r;h++){const f=t[h];let v,E,_=-1,S=0;for(;S<f.length&&(c.lastIndex=S,E=c.exec(f),E!==null);)S=c.lastIndex,c===aa?E[1]==="!--"?c=u3:E[1]!==void 0?c=h3:E[2]!==void 0?(p3.test(E[2])&&(i=RegExp("</"+E[2],"g")),c=Qi):E[3]!==void 0&&(c=Qi):c===Qi?E[0]===">"?(c=i??aa,_=-1):E[1]===void 0?_=-2:(_=c.lastIndex-E[2].length,v=E[1],c=E[3]===void 0?Qi:E[3]==='"'?d3:f3):c===d3||c===f3?c=Qi:c===u3||c===h3?c=aa:(c=Qi,i=void 0);const P=c===Qi&&t[h+1].startsWith("/>")?" ":"";o+=c===aa?f+t9:_>=0?(n.push(v),f.slice(0,_)+qh+f.slice(_)+_i+P):f+_i+(_===-2?(n.push(void 0),h):P)}const l=o+(t[r]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[a3!==void 0?a3.createHTML(l):l,n]};class ca{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let o=0,c=0;const l=e.length-1,h=this.parts,[f,v]=n9(e,r);if(this.el=ca.createElement(f,n),es.currentNode=this.el.content,r===2){const E=this.el.content,_=E.firstChild;_.remove(),E.append(..._.childNodes)}for(;(i=es.nextNode())!==null&&h.length<l;){if(i.nodeType===1){if(i.hasAttributes()){const E=[];for(const _ of i.getAttributeNames())if(_.endsWith(qh)||_.startsWith(_i)){const S=v[c++];if(E.push(_),S!==void 0){const P=i.getAttribute(S.toLowerCase()+qh).split(_i),j=/([.?@])?(.*)/.exec(S);h.push({type:1,index:o,name:j[2],strings:P,ctor:j[1]==="."?s9:j[1]==="?"?a9:j[1]==="@"?c9:$c})}else h.push({type:6,index:o})}for(const _ of E)i.removeAttribute(_)}if(p3.test(i.tagName)){const E=i.textContent.split(_i),_=E.length-1;if(_>0){i.textContent=Bs?Bs.emptyScript:"";for(let S=0;S<_;S++)i.append(E[S],sa()),es.nextNode(),h.push({type:2,index:++o});i.append(E[_],sa())}}}else if(i.nodeType===8)if(i.data===c3)h.push({type:2,index:o});else{let E=-1;for(;(E=i.data.indexOf(_i,E+1))!==-1;)h.push({type:7,index:o}),E+=_i.length-1}o++}}static createElement(e,r){const n=Ji.createElement("template");return n.innerHTML=e,n}}function ks(t,e,r=t,n){var i,o,c,l;if(e===Xi)return e;let h=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl;const f=oa(e)?void 0:e._$litDirective$;return h?.constructor!==f&&((o=h?._$AO)===null||o===void 0||o.call(h,!1),f===void 0?h=void 0:(h=new f(t),h._$AT(t,r,n)),n!==void 0?((c=(l=r)._$Co)!==null&&c!==void 0?c:l._$Co=[])[n]=h:r._$Cl=h),h!==void 0&&(e=ks(t,h._$AS(t,e.values),h,n)),e}class i9{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;const{el:{content:n},parts:i}=this._$AD,o=((r=e?.creationScope)!==null&&r!==void 0?r:Ji).importNode(n,!0);es.currentNode=o;let c=es.nextNode(),l=0,h=0,f=i[0];for(;f!==void 0;){if(l===f.index){let v;f.type===2?v=new la(c,c.nextSibling,this,e):f.type===1?v=new f.ctor(c,f.name,f.strings,this,e):f.type===6&&(v=new l9(c,this,e)),this._$AV.push(v),f=i[++h]}l!==f?.index&&(c=es.nextNode(),l++)}return es.currentNode=Ji,o}v(e){let r=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}}class la{constructor(e,r,n,i){var o;this.type=2,this._$AH=mr,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cp=(o=i?.isConnected)===null||o===void 0||o}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=ks(this,e,r),oa(e)?e===mr||e==null||e===""?(this._$AH!==mr&&this._$AR(),this._$AH=mr):e!==this._$AH&&e!==Xi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):r9(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==mr&&oa(this._$AH)?this._$AA.nextSibling.data=e:this.$(Ji.createTextNode(e)),this._$AH=e}g(e){var r;const{values:n,_$litType$:i}=e,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=ca.createElement(i.h,this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===o)this._$AH.v(n);else{const c=new i9(o,this),l=c.u(this.options);c.v(n),this.$(l),this._$AH=c}}_$AC(e){let r=m3.get(e.strings);return r===void 0&&m3.set(e.strings,r=new ca(e)),r}T(e){l3(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let n,i=0;for(const o of e)i===r.length?r.push(n=new la(this.k(sa()),this.k(sa()),this,this.options)):n=r[i],n._$AI(o),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}}class $c{constructor(e,r,n,i,o){this.type=1,this._$AH=mr,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=mr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){const o=this.strings;let c=!1;if(o===void 0)e=ks(this,e,r,0),c=!oa(e)||e!==this._$AH&&e!==Xi,c&&(this._$AH=e);else{const l=e;let h,f;for(e=o[0],h=0;h<o.length-1;h++)f=ks(this,l[n+h],r,h),f===Xi&&(f=this._$AH[h]),c||(c=!oa(f)||f!==this._$AH[h]),f===mr?e=mr:e!==mr&&(e+=(f??"")+o[h+1]),this._$AH[h]=f}c&&!i&&this.j(e)}j(e){e===mr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class s9 extends $c{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===mr?void 0:e}}const o9=Bs?Bs.emptyScript:"";class a9 extends $c{constructor(){super(...arguments),this.type=4}j(e){e&&e!==mr?this.element.setAttribute(this.name,o9):this.element.removeAttribute(this.name)}}class c9 extends $c{constructor(e,r,n,i,o){super(e,r,n,i,o),this.type=5}_$AI(e,r=this){var n;if((e=(n=ks(this,e,r,0))!==null&&n!==void 0?n:mr)===Xi)return;const i=this._$AH,o=e===mr&&i!==mr||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,c=e!==mr&&(i===mr||o);o&&this.element.removeEventListener(this.name,this,i),c&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}class l9{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ks(this,e)}}const w3=Dc.litHtmlPolyfillSupport;w3?.(ca,la),((zh=Dc.litHtmlVersions)!==null&&zh!==void 0?zh:Dc.litHtmlVersions=[]).push("2.7.4");const u9=(t,e,r)=>{var n,i;const o=(n=r?.renderBefore)!==null&&n!==void 0?n:e;let c=o._$litPart$;if(c===void 0){const l=(i=r?.renderBefore)!==null&&i!==void 0?i:null;o._$litPart$=c=new la(e.insertBefore(sa(),l),l,void 0,r??{})}return c._$AI(t),c};/**
118
+ * @license
119
+ * Copyright 2017 Google LLC
120
+ * SPDX-License-Identifier: BSD-3-Clause
121
+ */var Kh,Gh;class $e extends Fs{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=u9(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return Xi}}$e.finalized=!0,$e._$litElement$=!0,(Kh=globalThis.litElementHydrateSupport)===null||Kh===void 0||Kh.call(globalThis,{LitElement:$e});const v3=globalThis.litElementPolyfillSupport;v3?.({LitElement:$e}),((Gh=globalThis.litElementVersions)!==null&&Gh!==void 0?Gh:globalThis.litElementVersions=[]).push("3.3.2");/**
122
+ * @license
123
+ * Copyright 2017 Google LLC
124
+ * SPDX-License-Identifier: BSD-3-Clause
125
+ */const Ne=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{const{kind:i,elements:o}=n;return{kind:i,elements:o,finisher(c){customElements.define(r,c)}}})(t,e);/**
126
+ * @license
127
+ * Copyright 2017 Google LLC
128
+ * SPDX-License-Identifier: BSD-3-Clause
129
+ */const h9=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}};function Oe(t){return(e,r)=>r!==void 0?((n,i,o)=>{i.constructor.createProperty(o,n)})(t,e,r):h9(t,e)}/**
130
+ * @license
131
+ * Copyright 2017 Google LLC
132
+ * SPDX-License-Identifier: BSD-3-Clause
133
+ */function gt(t){return Oe({...t,state:!0})}/**
134
+ * @license
135
+ * Copyright 2021 Google LLC
136
+ * SPDX-License-Identifier: BSD-3-Clause
137
+ */var Zh;((Zh=window.HTMLSlotElement)===null||Zh===void 0?void 0:Zh.prototype.assignedElements)!=null;/**
138
+ * @license
139
+ * Copyright 2017 Google LLC
140
+ * SPDX-License-Identifier: BSD-3-Clause
141
+ */const f9={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},d9=t=>(...e)=>({_$litDirective$:t,values:e});class p9{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/**
142
+ * @license
143
+ * Copyright 2018 Google LLC
144
+ * SPDX-License-Identifier: BSD-3-Clause
145
+ */const Lr=d9(class extends p9{constructor(t){var e;if(super(t),t.type!==f9.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!(!((r=this.nt)===null||r===void 0)&&r.has(o))&&this.it.add(o);return this.render(e)}const i=t.element.classList;this.it.forEach(o=>{o in e||(i.remove(o),this.it.delete(o))});for(const o in e){const c=!!e[o];c===this.it.has(o)||!((n=this.nt)===null||n===void 0)&&n.has(o)||(c?(i.add(o),this.it.add(o)):(i.remove(o),this.it.delete(o)))}return Xi}});function g9(t,e){t.indexOf(e)===-1&&t.push(e)}const y3=(t,e,r)=>Math.min(Math.max(r,t),e),hn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Pc=t=>typeof t=="number",Hs=t=>Array.isArray(t)&&!Pc(t[0]),m9=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function w9(t,e){return Hs(t)?t[m9(0,t.length,e)]:t}const b3=(t,e,r)=>-r*t+r*e+t,_3=()=>{},Ei=t=>t,Yh=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function E3(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Yh(0,e,n);t.push(b3(r,1,i))}}function v9(t){const e=[0];return E3(e,t-1),e}function y9(t,e=v9(t.length),r=Ei){const n=t.length,i=n-e.length;return i>0&&E3(e,i),o=>{let c=0;for(;c<n-2&&!(o<e[c+1]);c++);let l=y3(0,1,Yh(e[c],e[c+1],o));return l=w9(r,c)(l),b3(t[c],t[c+1],l)}}const x3=t=>Array.isArray(t)&&Pc(t[0]),Jh=t=>typeof t=="object"&&!!t.createAnimation,ts=t=>typeof t=="function",b9=t=>typeof t=="string",ua={ms:t=>t*1e3,s:t=>t/1e3},C3=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,_9=1e-7,E9=12;function x9(t,e,r,n,i){let o,c,l=0;do c=e+(r-e)/2,o=C3(c,n,i)-t,o>0?r=c:e=c;while(Math.abs(o)>_9&&++l<E9);return c}function ha(t,e,r,n){if(t===e&&r===n)return Ei;const i=o=>x9(o,0,1,t,r);return o=>o===0||o===1?o:C3(i(o),e,n)}const C9=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*t,i=e==="end"?Math.floor(n):Math.ceil(n);return y3(0,1,i/t)},I3={ease:ha(.25,.1,.25,1),"ease-in":ha(.42,0,1,1),"ease-in-out":ha(.42,0,.58,1),"ease-out":ha(0,0,.58,1)},I9=/\((.*?)\)/;function S3(t){if(ts(t))return t;if(x3(t))return ha(...t);if(I3[t])return I3[t];if(t.startsWith("steps")){const e=I9.exec(t);if(e){const r=e[1].split(",");return C9(parseFloat(r[0]),r[1].trim())}}return Ei}class O3{constructor(e,r=[0,1],{easing:n,duration:i=hn.duration,delay:o=hn.delay,endDelay:c=hn.endDelay,repeat:l=hn.repeat,offset:h,direction:f="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=Ei,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((E,_)=>{this.resolve=E,this.reject=_}),n=n||hn.easing,Jh(n)){const E=n.createAnimation(r);n=E.easing,r=E.keyframes||r,i=E.duration||i}this.repeat=l,this.easing=Hs(n)?Ei:S3(n),this.updateDuration(i);const v=y9(r,h,Hs(n)?n.map(S3):Ei);this.tick=E=>{var _;o=o;let S=0;this.pauseTime!==void 0?S=this.pauseTime:S=(E-this.startTime)*this.rate,this.t=S,S/=1e3,S=Math.max(S-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(S=this.totalDuration);const P=S/this.duration;let j=Math.floor(P),H=P%1;!H&&P>=1&&(H=1),H===1&&j--;const Z=j%2;(f==="reverse"||f==="alternate"&&Z||f==="alternate-reverse"&&!Z)&&(H=1-H);const N=S>=this.totalDuration?1:Math.min(H,1),L=v(this.easing(N));e(L),this.pauseTime===void 0&&(this.playState==="finished"||S>=this.totalDuration+c)?(this.playState="finished",(_=this.resolve)===null||_===void 0||_.call(this,L)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var Qh=function(){};process.env.NODE_ENV!=="production"&&(Qh=function(t,e){if(!t)throw new Error(e)});class S9{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Xh=new WeakMap;function A3(t){return Xh.has(t)||Xh.set(t,{transforms:[],values:new Map}),Xh.get(t)}function O9(t,e){return t.has(e)||t.set(e,new S9),t.get(e)}const A9=["","X","Y","Z"],D9=["translate","scale","rotate","skew"],Tc={x:"translateX",y:"translateY",z:"translateZ"},D3={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},$9={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:D3,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:Ei},skew:D3},fa=new Map,ef=t=>`--motion-${t}`,Rc=["x","y","z"];D9.forEach(t=>{A9.forEach(e=>{Rc.push(t+e),fa.set(ef(t+e),$9[t])})});const P9=(t,e)=>Rc.indexOf(t)-Rc.indexOf(e),T9=new Set(Rc),$3=t=>T9.has(t),R9=(t,e)=>{Tc[e]&&(e=Tc[e]);const{transforms:r}=A3(t);g9(r,e),t.style.transform=N9(r)},N9=t=>t.sort(P9).reduce(L9,"").trim(),L9=(t,e)=>`${t} ${e}(var(${ef(e)}))`,tf=t=>t.startsWith("--"),P3=new Set;function M9(t){if(!P3.has(t)){P3.add(t);try{const{syntax:e,initialValue:r}=fa.has(t)?fa.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const rf=(t,e)=>document.createElement("div").animate(t,e),T3={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{rf({opacity:[1]})}catch{return!1}return!0},finished:()=>!!rf({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{rf({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},nf={},Ws={};for(const t in T3)Ws[t]=()=>(nf[t]===void 0&&(nf[t]=T3[t]()),nf[t]);const U9=.015,j9=(t,e)=>{let r="";const n=Math.round(e/U9);for(let i=0;i<n;i++)r+=t(Yh(0,n-1,i))+", ";return r.substring(0,r.length-2)},R3=(t,e)=>ts(t)?Ws.linearEasing()?`linear(${j9(t,e)})`:hn.easing:x3(t)?F9(t):t,F9=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function B9(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const k9=t=>Array.isArray(t)?t:[t];function sf(t){return Tc[t]&&(t=Tc[t]),$3(t)?ef(t):t}const Nc={get:(t,e)=>{e=sf(e);let r=tf(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=fa.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=sf(e),tf(e)?t.style.setProperty(e,r):t.style[e]=r}};function N3(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function H9(t,e){var r;let n=e?.toDefaultUnit||Ei;const i=t[t.length-1];if(b9(i)){const o=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";o&&(n=c=>c+o)}return n}function W9(){return window.__MOTION_DEV_TOOLS_RECORD}function z9(t,e,r,n={},i){const o=W9(),c=n.record!==!1&&o;let l,{duration:h=hn.duration,delay:f=hn.delay,endDelay:v=hn.endDelay,repeat:E=hn.repeat,easing:_=hn.easing,persist:S=!1,direction:P,offset:j,allowWebkitAcceleration:H=!1}=n;const Z=A3(t),N=$3(e);let L=Ws.waapi();N&&R9(t,e);const $=sf(e),T=O9(Z.values,$),I=fa.get($);return N3(T.animation,!(Jh(_)&&T.generator)&&n.record!==!1),()=>{const d=()=>{var W,ee;return(ee=(W=Nc.get(t,$))!==null&&W!==void 0?W:I?.initialValue)!==null&&ee!==void 0?ee:0};let x=B9(k9(r),d);const J=H9(x,I);if(Jh(_)){const W=_.createAnimation(x,e!=="opacity",d,$,T);_=W.easing,x=W.keyframes||x,h=W.duration||h}if(tf($)&&(Ws.cssRegisterProperty()?M9($):L=!1),N&&!Ws.linearEasing()&&(ts(_)||Hs(_)&&_.some(ts))&&(L=!1),L){I&&(x=x.map(de=>Pc(de)?I.toDefaultUnit(de):de)),x.length===1&&(!Ws.partialKeyframes()||c)&&x.unshift(d());const W={delay:ua.ms(f),duration:ua.ms(h),endDelay:ua.ms(v),easing:Hs(_)?void 0:R3(_,h),direction:P,iterations:E+1,fill:"both"};l=t.animate({[$]:x,offset:j,easing:Hs(_)?_.map(de=>R3(de,h)):void 0},W),l.finished||(l.finished=new Promise((de,me)=>{l.onfinish=de,l.oncancel=me}));const ee=x[x.length-1];l.finished.then(()=>{S||(Nc.set(t,$,ee),l.cancel())}).catch(_3),H||(l.playbackRate=1.000001)}else if(i&&N)x=x.map(W=>typeof W=="string"?parseFloat(W):W),x.length===1&&x.unshift(parseFloat(d())),l=new i(W=>{Nc.set(t,$,J?J(W):W)},x,Object.assign(Object.assign({},n),{duration:h,easing:_}));else{const W=x[x.length-1];Nc.set(t,$,I&&Pc(W)?I.toDefaultUnit(W):W)}return c&&o(t,e,x,{duration:h,delay:f,easing:_,repeat:E,offset:j},"motion-one"),T.setAnimation(l),l}}const q9=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function L3(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const V9=t=>t(),M3=(t,e,r=hn.duration)=>new Proxy({animations:t.map(V9).filter(Boolean),duration:r,options:e},G9),K9=t=>t.animations[0],G9={get:(t,e)=>{const r=K9(t);switch(e){case"duration":return t.duration;case"currentTime":return ua.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(Z9)).catch(_3)),t.finished;case"stop":return()=>{t.animations.forEach(n=>N3(n))};case"forEachNative":return n=>{t.animations.forEach(i=>n(i,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(n=>n[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=ua.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},Z9=t=>t.finished;function Y9(t,e,r){return ts(t)?t(e,r):t}function J9(t){return function(r,n,i={}){r=L3(r);const o=r.length;Qh(!!o,"No valid element provided."),Qh(!!n,"No keyframes defined.");const c=[];for(let l=0;l<o;l++){const h=r[l];for(const f in n){const v=q9(i,f);v.delay=Y9(v.delay,l,o);const E=z9(h,f,n[f],v,t);c.push(E)}}return M3(c,i,i.duration)}}const Q9=J9(O3);function X9(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}const eC={any:0,all:1};function tC(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=L3(t),c=new WeakMap,l=f=>{f.forEach(v=>{const E=c.get(v.target);if(v.isIntersecting!==!!E)if(v.isIntersecting){const _=e(v);ts(_)?c.set(v.target,_):h.unobserve(v.target)}else E&&(E(v),c.delete(v.target))})},h=new IntersectionObserver(l,{root:r,rootMargin:n,threshold:typeof i=="number"?i:eC[i]});return o.forEach(f=>h.observe(f)),()=>h.disconnect()}function of(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function U3(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const rC={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=X9(n,["once"]);return tC(t,c=>{if(e(),U3(t,"viewenter",c),!i)return l=>{r(),U3(t,"viewleave",l)}},o)}},j3=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),of(t,e,n))};[...Object.keys({inView:rC,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const n=j3(t,"hoverstart",e),i=j3(t,"hoverend",r);return t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",i)}}},press:{isActive:t=>!!t.press,subscribe:(t,{enable:e,disable:r})=>{const n=o=>{r(),of(t,"pressend",o),window.removeEventListener("pointerup",n)},i=o=>{e(),of(t,"pressstart",o),window.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function nC(t,e={}){return M3([()=>{const r=new O3(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function rs(t,e,r){return(ts(t)?nC:Q9)(t,e,r)}var da={},iC=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},F3={},Xr={};let af;const sC=[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];Xr.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 e*4+17},Xr.getSymbolTotalCodewords=function(e){return sC[e]},Xr.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},Xr.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');af=e},Xr.isKanjiModeEnabled=function(){return typeof af<"u"},Xr.toSJIS=function(e){return af(e)};var Lc={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.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: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(Lc);function B3(){this.buffer=[],this.length=0}B3.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&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++}};var oC=B3;function pa(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)}pa.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},pa.prototype.get=function(t,e){return this.data[t*this.size+e]},pa.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},pa.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var aC=pa,k3={};(function(t){const e=Xr.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,o=e(n),c=o===145?26:Math.ceil((o-13)/(2*i-2))*2,l=[o-7];for(let h=1;h<i-1;h++)l[h]=l[h-1]-c;return l.push(6),l.reverse()},t.getPositions=function(n){const i=[],o=t.getRowColCoords(n),c=o.length;for(let l=0;l<c;l++)for(let h=0;h<c;h++)l===0&&h===0||l===0&&h===c-1||l===c-1&&h===0||i.push([o[l],o[h]]);return i}})(k3);var H3={};const cC=Xr.getSymbolSize,W3=7;H3.getPositions=function(e){const r=cC(e);return[[0,0],[r-W3,0],[0,r-W3]]};var z3={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const o=i.size;let c=0,l=0,h=0,f=null,v=null;for(let E=0;E<o;E++){l=h=0,f=v=null;for(let _=0;_<o;_++){let S=i.get(E,_);S===f?l++:(l>=5&&(c+=e.N1+(l-5)),f=S,l=1),S=i.get(_,E),S===v?h++:(h>=5&&(c+=e.N1+(h-5)),v=S,h=1)}l>=5&&(c+=e.N1+(l-5)),h>=5&&(c+=e.N1+(h-5))}return c},t.getPenaltyN2=function(i){const o=i.size;let c=0;for(let l=0;l<o-1;l++)for(let h=0;h<o-1;h++){const f=i.get(l,h)+i.get(l,h+1)+i.get(l+1,h)+i.get(l+1,h+1);(f===4||f===0)&&c++}return c*e.N2},t.getPenaltyN3=function(i){const o=i.size;let c=0,l=0,h=0;for(let f=0;f<o;f++){l=h=0;for(let v=0;v<o;v++)l=l<<1&2047|i.get(f,v),v>=10&&(l===1488||l===93)&&c++,h=h<<1&2047|i.get(v,f),v>=10&&(h===1488||h===93)&&c++}return c*e.N3},t.getPenaltyN4=function(i){let o=0;const c=i.data.length;for(let h=0;h<c;h++)o+=i.data[h];return Math.abs(Math.ceil(o*100/c/5)-10)*e.N4};function r(n,i,o){switch(n){case t.Patterns.PATTERN000:return(i+o)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(i+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return i*o%2+i*o%3===0;case t.Patterns.PATTERN110:return(i*o%2+i*o%3)%2===0;case t.Patterns.PATTERN111:return(i*o%3+(i+o)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(i,o){const c=o.size;for(let l=0;l<c;l++)for(let h=0;h<c;h++)o.isReserved(h,l)||o.xor(h,l,r(i,h,l))},t.getBestMask=function(i,o){const c=Object.keys(t.Patterns).length;let l=0,h=1/0;for(let f=0;f<c;f++){o(f),t.applyMask(f,i);const v=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(f,i),v<h&&(h=v,l=f)}return l}})(z3);var Mc={};const xi=Lc,Uc=[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],jc=[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];Mc.getBlocksCount=function(e,r){switch(r){case xi.L:return Uc[(e-1)*4+0];case xi.M:return Uc[(e-1)*4+1];case xi.Q:return Uc[(e-1)*4+2];case xi.H:return Uc[(e-1)*4+3];default:return}},Mc.getTotalCodewordsCount=function(e,r){switch(r){case xi.L:return jc[(e-1)*4+0];case xi.M:return jc[(e-1)*4+1];case xi.Q:return jc[(e-1)*4+2];case xi.H:return jc[(e-1)*4+3];default:return}};var q3={},Fc={};const ga=new Uint8Array(512),Bc=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)ga[r]=e,Bc[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)ga[r]=ga[r-255]})(),Fc.log=function(e){if(e<1)throw new Error("log("+e+")");return Bc[e]},Fc.exp=function(e){return ga[e]},Fc.mul=function(e,r){return e===0||r===0?0:ga[Bc[e]+Bc[r]]},function(t){const e=Fc;t.mul=function(n,i){const o=new Uint8Array(n.length+i.length-1);for(let c=0;c<n.length;c++)for(let l=0;l<i.length;l++)o[c+l]^=e.mul(n[c],i[l]);return o},t.mod=function(n,i){let o=new Uint8Array(n);for(;o.length-i.length>=0;){const c=o[0];for(let h=0;h<i.length;h++)o[h]^=e.mul(i[h],c);let l=0;for(;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let o=0;o<n;o++)i=t.mul(i,new Uint8Array([1,e.exp(o)]));return i}}(q3);const V3=q3;function cf(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}cf.prototype.initialize=function(e){this.degree=e,this.genPoly=V3.generateECPolynomial(this.degree)},cf.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(e.length+this.degree);r.set(e);const n=V3.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(n,i),o}return n};var lC=cf,K3={},Ci={},lf={};lf.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Un={};const G3="[0-9]+",uC="[A-Z $%*+\\-./:]+";let ma="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ma=ma.replace(/u/g,"\\u");const hC="(?:(?![A-Z0-9 $%*+\\-./:]|"+ma+`)(?:.|[\r
146
+ ]))+`;Un.KANJI=new RegExp(ma,"g"),Un.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Un.BYTE=new RegExp(hC,"g"),Un.NUMERIC=new RegExp(G3,"g"),Un.ALPHANUMERIC=new RegExp(uC,"g");const fC=new RegExp("^"+ma+"$"),dC=new RegExp("^"+G3+"$"),pC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Un.testKanji=function(e){return fC.test(e)},Un.testNumeric=function(e){return dC.test(e)},Un.testAlphanumeric=function(e){return pC.test(e)},function(t){const e=lf,r=Un;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(o,c){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(c))throw new Error("Invalid version: "+c);return c>=1&&c<10?o.ccBits[0]:c<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return r.testNumeric(o)?t.NUMERIC:r.testAlphanumeric(o)?t.ALPHANUMERIC:r.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.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: "+i)}}t.from=function(o,c){if(t.isValid(o))return o;try{return n(o)}catch{return c}}}(Ci),function(t){const e=Xr,r=Mc,n=Lc,i=Ci,o=lf,c=7973,l=e.getBCHDigit(c);function h(_,S,P){for(let j=1;j<=40;j++)if(S<=t.getCapacity(j,P,_))return j}function f(_,S){return i.getCharCountIndicator(_,S)+4}function v(_,S){let P=0;return _.forEach(function(j){const H=f(j.mode,S);P+=H+j.getBitsLength()}),P}function E(_,S){for(let P=1;P<=40;P++)if(v(_,P)<=t.getCapacity(P,S,i.MIXED))return P}t.from=function(S,P){return o.isValid(S)?parseInt(S,10):P},t.getCapacity=function(S,P,j){if(!o.isValid(S))throw new Error("Invalid QR Code version");typeof j>"u"&&(j=i.BYTE);const H=e.getSymbolTotalCodewords(S),Z=r.getTotalCodewordsCount(S,P),N=(H-Z)*8;if(j===i.MIXED)return N;const L=N-f(j,S);switch(j){case i.NUMERIC:return Math.floor(L/10*3);case i.ALPHANUMERIC:return Math.floor(L/11*2);case i.KANJI:return Math.floor(L/13);case i.BYTE:default:return Math.floor(L/8)}},t.getBestVersionForData=function(S,P){let j;const H=n.from(P,n.M);if(Array.isArray(S)){if(S.length>1)return E(S,H);if(S.length===0)return 1;j=S[0]}else j=S;return h(j.mode,j.getLength(),H)},t.getEncodedBits=function(S){if(!o.isValid(S)||S<7)throw new Error("Invalid QR Code version");let P=S<<12;for(;e.getBCHDigit(P)-l>=0;)P^=c<<e.getBCHDigit(P)-l;return S<<12|P}}(K3);var Z3={};const uf=Xr,Y3=1335,gC=21522,J3=uf.getBCHDigit(Y3);Z3.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;uf.getBCHDigit(i)-J3>=0;)i^=Y3<<uf.getBCHDigit(i)-J3;return(n<<10|i)^gC};var Q3={};const mC=Ci;function zs(t){this.mode=mC.NUMERIC,this.data=t.toString()}zs.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},zs.prototype.getLength=function(){return this.data.length},zs.prototype.getBitsLength=function(){return zs.getBitsLength(this.data.length)},zs.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);const o=this.data.length-r;o>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,o*3+1))};var wC=zs;const vC=Ci,hf=["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 qs(t){this.mode=vC.ALPHANUMERIC,this.data=t}qs.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},qs.prototype.getLength=function(){return this.data.length},qs.prototype.getBitsLength=function(){return qs.getBitsLength(this.data.length)},qs.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=hf.indexOf(this.data[r])*45;n+=hf.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(hf.indexOf(this.data[r]),6)};var yC=qs,bC=function(e){for(var r=[],n=e.length,i=0;i<n;i++){var o=e.charCodeAt(i);if(o>=55296&&o<=56319&&n>i+1){var c=e.charCodeAt(i+1);c>=56320&&c<=57343&&(o=(o-55296)*1024+c-56320+65536,i+=1)}if(o<128){r.push(o);continue}if(o<2048){r.push(o>>6|192),r.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){r.push(o>>12|224),r.push(o>>6&63|128),r.push(o&63|128);continue}if(o>=65536&&o<=1114111){r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const _C=bC,EC=Ci;function Vs(t){this.mode=EC.BYTE,typeof t=="string"&&(t=_C(t)),this.data=new Uint8Array(t)}Vs.getBitsLength=function(e){return e*8},Vs.prototype.getLength=function(){return this.data.length},Vs.prototype.getBitsLength=function(){return Vs.getBitsLength(this.data.length)},Vs.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var xC=Vs;const CC=Ci,IC=Xr;function Ks(t){this.mode=CC.KANJI,this.data=t}Ks.getBitsLength=function(e){return e*13},Ks.prototype.getLength=function(){return this.data.length},Ks.prototype.getBitsLength=function(){return Ks.getBitsLength(this.data.length)},Ks.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=IC.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
147
+ Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var SC=Ks,X3={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var o={},c={};c[n]=0;var l=e.PriorityQueue.make();l.push(n,0);for(var h,f,v,E,_,S,P,j,H;!l.empty();){h=l.pop(),f=h.value,E=h.cost,_=r[f]||{};for(v in _)_.hasOwnProperty(v)&&(S=_[v],P=E+S,j=c[v],H=typeof c[v]>"u",(H||j>P)&&(c[v]=P,l.push(v,P),o[v]=f))}if(typeof i<"u"&&typeof c[i]>"u"){var Z=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(Z)}return o},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],o=n;o;)i.push(o),r[o],o=r[o];return i.reverse(),i},find_path:function(r,n,i){var o=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(o,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},o;r=r||{};for(o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(X3),function(t){const e=Ci,r=wC,n=yC,i=xC,o=SC,c=Un,l=Xr,h=X3.exports;function f(Z){return unescape(encodeURIComponent(Z)).length}function v(Z,N,L){const $=[];let T;for(;(T=Z.exec(L))!==null;)$.push({data:T[0],index:T.index,mode:N,length:T[0].length});return $}function E(Z){const N=v(c.NUMERIC,e.NUMERIC,Z),L=v(c.ALPHANUMERIC,e.ALPHANUMERIC,Z);let $,T;return l.isKanjiModeEnabled()?($=v(c.BYTE,e.BYTE,Z),T=v(c.KANJI,e.KANJI,Z)):($=v(c.BYTE_KANJI,e.BYTE,Z),T=[]),N.concat(L,$,T).sort(function(d,x){return d.index-x.index}).map(function(d){return{data:d.data,mode:d.mode,length:d.length}})}function _(Z,N){switch(N){case e.NUMERIC:return r.getBitsLength(Z);case e.ALPHANUMERIC:return n.getBitsLength(Z);case e.KANJI:return o.getBitsLength(Z);case e.BYTE:return i.getBitsLength(Z)}}function S(Z){return Z.reduce(function(N,L){const $=N.length-1>=0?N[N.length-1]:null;return $&&$.mode===L.mode?(N[N.length-1].data+=L.data,N):(N.push(L),N)},[])}function P(Z){const N=[];for(let L=0;L<Z.length;L++){const $=Z[L];switch($.mode){case e.NUMERIC:N.push([$,{data:$.data,mode:e.ALPHANUMERIC,length:$.length},{data:$.data,mode:e.BYTE,length:$.length}]);break;case e.ALPHANUMERIC:N.push([$,{data:$.data,mode:e.BYTE,length:$.length}]);break;case e.KANJI:N.push([$,{data:$.data,mode:e.BYTE,length:f($.data)}]);break;case e.BYTE:N.push([{data:$.data,mode:e.BYTE,length:f($.data)}])}}return N}function j(Z,N){const L={},$={start:{}};let T=["start"];for(let I=0;I<Z.length;I++){const d=Z[I],x=[];for(let J=0;J<d.length;J++){const W=d[J],ee=""+I+J;x.push(ee),L[ee]={node:W,lastCount:0},$[ee]={};for(let de=0;de<T.length;de++){const me=T[de];L[me]&&L[me].node.mode===W.mode?($[me][ee]=_(L[me].lastCount+W.length,W.mode)-_(L[me].lastCount,W.mode),L[me].lastCount+=W.length):(L[me]&&(L[me].lastCount=W.length),$[me][ee]=_(W.length,W.mode)+4+e.getCharCountIndicator(W.mode,N))}}T=x}for(let I=0;I<T.length;I++)$[T[I]].end=0;return{map:$,table:L}}function H(Z,N){let L;const $=e.getBestModeForData(Z);if(L=e.from(N,$),L!==e.BYTE&&L.bit<$.bit)throw new Error('"'+Z+'" cannot be encoded with mode '+e.toString(L)+`.
148
+ Suggested mode is: `+e.toString($));switch(L===e.KANJI&&!l.isKanjiModeEnabled()&&(L=e.BYTE),L){case e.NUMERIC:return new r(Z);case e.ALPHANUMERIC:return new n(Z);case e.KANJI:return new o(Z);case e.BYTE:return new i(Z)}}t.fromArray=function(N){return N.reduce(function(L,$){return typeof $=="string"?L.push(H($,null)):$.data&&L.push(H($.data,$.mode)),L},[])},t.fromString=function(N,L){const $=E(N,l.isKanjiModeEnabled()),T=P($),I=j(T,L),d=h.find_path(I.map,"start","end"),x=[];for(let J=1;J<d.length-1;J++)x.push(I.table[d[J]].node);return t.fromArray(S(x))},t.rawSplit=function(N){return t.fromArray(E(N,l.isKanjiModeEnabled()))}}(Q3);const kc=Xr,ff=Lc,OC=oC,AC=aC,DC=k3,$C=H3,df=z3,pf=Mc,PC=lC,Hc=K3,TC=Z3,RC=Ci,gf=Q3;function NC(t,e){const r=t.size,n=$C.getPositions(e);for(let i=0;i<n.length;i++){const o=n[i][0],c=n[i][1];for(let l=-1;l<=7;l++)if(!(o+l<=-1||r<=o+l))for(let h=-1;h<=7;h++)c+h<=-1||r<=c+h||(l>=0&&l<=6&&(h===0||h===6)||h>=0&&h<=6&&(l===0||l===6)||l>=2&&l<=4&&h>=2&&h<=4?t.set(o+l,c+h,!0,!0):t.set(o+l,c+h,!1,!0))}}function LC(t){const e=t.size;for(let r=8;r<e-8;r++){const n=r%2===0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}function MC(t,e){const r=DC.getPositions(e);for(let n=0;n<r.length;n++){const i=r[n][0],o=r[n][1];for(let c=-2;c<=2;c++)for(let l=-2;l<=2;l++)c===-2||c===2||l===-2||l===2||c===0&&l===0?t.set(i+c,o+l,!0,!0):t.set(i+c,o+l,!1,!0)}}function UC(t,e){const r=t.size,n=Hc.getEncodedBits(e);let i,o,c;for(let l=0;l<18;l++)i=Math.floor(l/3),o=l%3+r-8-3,c=(n>>l&1)===1,t.set(i,o,c,!0),t.set(o,i,c,!0)}function mf(t,e,r){const n=t.size,i=TC.getEncodedBits(e,r);let o,c;for(o=0;o<15;o++)c=(i>>o&1)===1,o<6?t.set(o,8,c,!0):o<8?t.set(o+1,8,c,!0):t.set(n-15+o,8,c,!0),o<8?t.set(8,n-o-1,c,!0):o<9?t.set(8,15-o-1+1,c,!0):t.set(8,15-o-1,c,!0);t.set(n-8,8,1,!0)}function jC(t,e){const r=t.size;let n=-1,i=r-1,o=7,c=0;for(let l=r-1;l>0;l-=2)for(l===6&&l--;;){for(let h=0;h<2;h++)if(!t.isReserved(i,l-h)){let f=!1;c<e.length&&(f=(e[c]>>>o&1)===1),t.set(i,l-h,f),o--,o===-1&&(c++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function FC(t,e,r){const n=new OC;r.forEach(function(h){n.put(h.mode.bit,4),n.put(h.getLength(),RC.getCharCountIndicator(h.mode,t)),h.write(n)});const i=kc.getSymbolTotalCodewords(t),o=pf.getTotalCodewordsCount(t,e),c=(i-o)*8;for(n.getLengthInBits()+4<=c&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const l=(c-n.getLengthInBits())/8;for(let h=0;h<l;h++)n.put(h%2?17:236,8);return BC(n,t,e)}function BC(t,e,r){const n=kc.getSymbolTotalCodewords(e),i=pf.getTotalCodewordsCount(e,r),o=n-i,c=pf.getBlocksCount(e,r),l=n%c,h=c-l,f=Math.floor(n/c),v=Math.floor(o/c),E=v+1,_=f-v,S=new PC(_);let P=0;const j=new Array(c),H=new Array(c);let Z=0;const N=new Uint8Array(t.buffer);for(let d=0;d<c;d++){const x=d<h?v:E;j[d]=N.slice(P,P+x),H[d]=S.encode(j[d]),P+=x,Z=Math.max(Z,x)}const L=new Uint8Array(n);let $=0,T,I;for(T=0;T<Z;T++)for(I=0;I<c;I++)T<j[I].length&&(L[$++]=j[I][T]);for(T=0;T<_;T++)for(I=0;I<c;I++)L[$++]=H[I][T];return L}function kC(t,e,r,n){let i;if(Array.isArray(t))i=gf.fromArray(t);else if(typeof t=="string"){let f=e;if(!f){const v=gf.rawSplit(t);f=Hc.getBestVersionForData(v,r)}i=gf.fromString(t,f||40)}else throw new Error("Invalid data");const o=Hc.getBestVersionForData(i,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=o;else if(e<o)throw new Error(`
149
+ The chosen QR Code version cannot contain this amount of data.
150
+ Minimum version required to store current data is: `+o+`.
151
+ `);const c=FC(e,r,i),l=kc.getSymbolSize(e),h=new AC(l);return NC(h,e),LC(h),MC(h,e),mf(h,r,0),e>=7&&UC(h,e),jC(h,c),isNaN(n)&&(n=df.getBestMask(h,mf.bind(null,h,r))),df.applyMask(n,h),mf(h,r,n),{modules:h,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}F3.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=ff.M,i,o;return typeof r<"u"&&(n=ff.from(r.errorCorrectionLevel,ff.M),i=Hc.from(r.version),o=df.from(r.maskPattern),r.toSJISFunc&&kc.setToSJISFunction(r.toSJISFunc)),kC(e,i,n,o)};var em={},wf={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(o){return[o,o]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,o=n.width&&n.width>=21?n.width:void 0,c=n.scale||4;return{width:o,scale:o?4:c,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},t.getImageWidth=function(n,i){const o=t.getScale(n,i);return Math.floor((n+i.margin*2)*o)},t.qrToImageData=function(n,i,o){const c=i.modules.size,l=i.modules.data,h=t.getScale(c,o),f=Math.floor((c+o.margin*2)*h),v=o.margin*h,E=[o.color.light,o.color.dark];for(let _=0;_<f;_++)for(let S=0;S<f;S++){let P=(_*f+S)*4,j=o.color.light;if(_>=v&&S>=v&&_<f-v&&S<f-v){const H=Math.floor((_-v)/h),Z=Math.floor((S-v)/h);j=E[l[H*c+Z]?1:0]}n[P++]=j.r,n[P++]=j.g,n[P++]=j.b,n[P]=j.a}}})(wf),function(t){const e=wf;function r(i,o,c){i.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=c,o.width=c,o.style.height=c+"px",o.style.width=c+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(o,c,l){let h=l,f=c;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),c||(f=n()),h=e.getOptions(h);const v=e.getImageWidth(o.modules.size,h),E=f.getContext("2d"),_=E.createImageData(v,v);return e.qrToImageData(_.data,o,h),r(E,f,v),E.putImageData(_,0,0),f},t.renderToDataURL=function(o,c,l){let h=l;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),h||(h={});const f=t.render(o,c,h),v=h.type||"image/png",E=h.rendererOpts||{};return f.toDataURL(v,E.quality)}}(em);var tm={};const HC=wf;function rm(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function vf(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function WC(t,e,r){let n="",i=0,o=!1,c=0;for(let l=0;l<t.length;l++){const h=Math.floor(l%e),f=Math.floor(l/e);!h&&!o&&(o=!0),t[l]?(c++,l>0&&h>0&&t[l-1]||(n+=o?vf("M",h+r,.5+f+r):vf("m",i,0),i=0,o=!1),h+1<e&&t[l+1]||(n+=vf("h",c),c=0)):i++}return n}tm.render=function(e,r,n){const i=HC.getOptions(r),o=e.modules.size,c=e.modules.data,l=o+i.margin*2,h=i.color.light.a?"<path "+rm(i.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",f="<path "+rm(i.color.dark,"stroke")+' d="'+WC(c,o,i.margin)+'"/>',v='viewBox="0 0 '+l+" "+l+'"',_='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+v+' shape-rendering="crispEdges">'+h+f+`</svg>
152
+ `;return typeof n=="function"&&n(null,_),_};const zC=iC,yf=F3,nm=em,qC=tm;function bf(t,e,r,n,i){const o=[].slice.call(arguments,1),c=o.length,l=typeof o[c-1]=="function";if(!l&&!zC())throw new Error("Callback required as last argument");if(l){if(c<2)throw new Error("Too few arguments provided");c===2?(i=r,r=e,e=n=void 0):c===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(r=e,e=n=void 0):c===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(h,f){try{const v=yf.create(r,n);h(t(v,e,n))}catch(v){f(v)}})}try{const h=yf.create(r,n);i(null,t(h,e,n))}catch(h){i(h)}}da.create=yf.create,da.toCanvas=bf.bind(null,nm.render),da.toDataURL=bf.bind(null,nm.renderToDataURL),da.toString=bf.bind(null,function(t,e,r){return qC.render(t,r)});var VC=Object.defineProperty,im=Object.getOwnPropertySymbols,KC=Object.prototype.hasOwnProperty,GC=Object.prototype.propertyIsEnumerable,sm=(t,e,r)=>e in t?VC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wc=(t,e)=>{for(var r in e||(e={}))KC.call(e,r)&&sm(t,r,e[r]);if(im)for(var r of im(e))GC.call(e,r)&&sm(t,r,e[r]);return t};function ZC(){var t;const e=(t=Mn.state.themeMode)!=null?t:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--w3m-color-fg-1":r.foreground[1],"--w3m-color-fg-2":r.foreground[2],"--w3m-color-fg-3":r.foreground[3],"--w3m-color-bg-1":r.background[1],"--w3m-color-bg-2":r.background[2],"--w3m-color-bg-3":r.background[3],"--w3m-color-overlay":r.overlay}}function om(){return{"--w3m-accent-color":"#3396FF","--w3m-accent-fill-color":"#FFFFFF","--w3m-z-index":"89","--w3m-background-color":"#3396FF","--w3m-background-border-radius":"8px","--w3m-container-border-radius":"30px","--w3m-wallet-icon-border-radius":"15px","--w3m-wallet-icon-large-border-radius":"30px","--w3m-wallet-icon-small-border-radius":"7px","--w3m-input-border-radius":"28px","--w3m-button-border-radius":"10px","--w3m-notification-border-radius":"36px","--w3m-secondary-button-border-radius":"28px","--w3m-icon-button-border-radius":"50%","--w3m-button-hover-highlight-border-radius":"10px","--w3m-text-big-bold-size":"20px","--w3m-text-big-bold-weight":"600","--w3m-text-big-bold-line-height":"24px","--w3m-text-big-bold-letter-spacing":"-0.03em","--w3m-text-big-bold-text-transform":"none","--w3m-text-xsmall-bold-size":"10px","--w3m-text-xsmall-bold-weight":"700","--w3m-text-xsmall-bold-line-height":"12px","--w3m-text-xsmall-bold-letter-spacing":"0.02em","--w3m-text-xsmall-bold-text-transform":"uppercase","--w3m-text-xsmall-regular-size":"12px","--w3m-text-xsmall-regular-weight":"600","--w3m-text-xsmall-regular-line-height":"14px","--w3m-text-xsmall-regular-letter-spacing":"-0.03em","--w3m-text-xsmall-regular-text-transform":"none","--w3m-text-small-thin-size":"14px","--w3m-text-small-thin-weight":"500","--w3m-text-small-thin-line-height":"16px","--w3m-text-small-thin-letter-spacing":"-0.03em","--w3m-text-small-thin-text-transform":"none","--w3m-text-small-regular-size":"14px","--w3m-text-small-regular-weight":"600","--w3m-text-small-regular-line-height":"16px","--w3m-text-small-regular-letter-spacing":"-0.03em","--w3m-text-small-regular-text-transform":"none","--w3m-text-medium-regular-size":"16px","--w3m-text-medium-regular-weight":"600","--w3m-text-medium-regular-line-height":"20px","--w3m-text-medium-regular-letter-spacing":"-0.03em","--w3m-text-medium-regular-text-transform":"none","--w3m-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--w3m-success-color":"rgb(38,181,98)","--w3m-error-color":"rgb(242, 90, 103)"}}function YC(){const{themeVariables:t}=Mn.state;return{"--w3m-background-image-url":t!=null&&t["--w3m-background-image-url"]?`url(${t["--w3m-background-image-url"]})`:"none"}}const Fe={getPreset(t){return om()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=Mn.state;if(t){const r=Wc(Wc(Wc(Wc({},ZC()),om()),e),YC());Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:Ve`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--w3m-accent-fill-color);background:var(--w3m-accent-color)}`},JC=Ve`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-accent-color);border-radius:var(--w3m-icon-button-border-radius);margin-bottom:4px}button path{fill:var(--w3m-accent-fill-color)}`;var QC=Object.defineProperty,XC=Object.getOwnPropertyDescriptor,zc=(t,e,r,n)=>{for(var i=n>1?void 0:n?XC(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&QC(e,r,i),i};let Gs=class extends $e{constructor(){super(...arguments),this.icon=void 0,this.label="",this.onClick=()=>null}render(){return oe`<button @click="${this.onClick}"><div>${this.icon}</div><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};Gs.styles=[Fe.globalCss,JC],zc([Oe()],Gs.prototype,"icon",2),zc([Oe()],Gs.prototype,"label",2),zc([Oe()],Gs.prototype,"onClick",2),Gs=zc([Ne("w3m-box-button")],Gs);const eI=Ve`button{border-radius:var(--w3m-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--w3m-accent-color)}button path{fill:var(--w3m-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--w3m-color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:active::after{background-color:var(--w3m-color-overlay)}.w3m-ghost,.w3m-ghost:active::after,.w3m-outline{background-color:transparent}.w3m-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}.w3m-ghost:hover::after{background-color:transparent}.w3m-ghost:hover{opacity:.5}}button:disabled{background-color:var(--w3m-color-bg-3);pointer-events:none}.w3m-ghost::after{border-color:transparent}.w3m-ghost path{fill:var(--w3m-color-fg-2)}.w3m-outline path{fill:var(--w3m-accent-color)}.w3m-outline:disabled{background-color:transparent;opacity:.5}`;var tI=Object.defineProperty,rI=Object.getOwnPropertyDescriptor,Zs=(t,e,r,n)=>{for(var i=n>1?void 0:n?rI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&tI(e,r,i),i};let Ii=class extends $e{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"w3m-icon-left":this.iconLeft!==void 0,"w3m-icon-right":this.iconRight!==void 0,"w3m-ghost":this.variant==="ghost","w3m-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),oe`<button class="${Lr(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-regular" color="${e}"><slot></slot></w3m-text>${this.iconRight}</button>`}};Ii.styles=[Fe.globalCss,eI],Zs([Oe()],Ii.prototype,"disabled",2),Zs([Oe()],Ii.prototype,"iconLeft",2),Zs([Oe()],Ii.prototype,"iconRight",2),Zs([Oe()],Ii.prototype,"onClick",2),Zs([Oe()],Ii.prototype,"variant",2),Ii=Zs([Ne("w3m-button")],Ii);const nI=Ve`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--w3m-button-border-radius);color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:active::after{background-color:var(--w3m-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--w3m-color-bg-3);color:var(--w3m-color-fg-3)}.w3m-secondary{color:var(--w3m-accent-color);background-color:transparent}.w3m-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--w3m-color-overlay)}}`;var iI=Object.defineProperty,sI=Object.getOwnPropertyDescriptor,_f=(t,e,r,n)=>{for(var i=n>1?void 0:n?sI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&iI(e,r,i),i};let wa=class extends $e{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"w3m-secondary":this.variant==="secondary"};return oe`<button ?disabled="${this.disabled}" class="${Lr(t)}"><slot></slot></button>`}};wa.styles=[Fe.globalCss,nI],_f([Oe()],wa.prototype,"disabled",2),_f([Oe()],wa.prototype,"variant",2),wa=_f([Ne("w3m-button-big")],wa);const oI=Ve`:host{background-color:var(--w3m-color-bg-2);border-top:1px solid var(--w3m-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var aI=Object.defineProperty,cI=Object.getOwnPropertyDescriptor,lI=(t,e,r,n)=>{for(var i=n>1?void 0:n?cI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&aI(e,r,i),i};let Ef=class extends $e{render(){return oe`<div><slot></slot></div>`}};Ef.styles=[Fe.globalCss,oI],Ef=lI([Ne("w3m-info-footer")],Ef);const Le={CROSS_ICON:ut`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,WALLET_CONNECT_LOGO:ut`<svg width="178" height="29" viewBox="0 0 178 29" id="w3m-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:ut`<svg width="28" height="20" viewBox="0 0 28 20"><g clip-path="url(#a)"><path d="M7.386 6.482c3.653-3.576 9.575-3.576 13.228 0l.44.43a.451.451 0 0 1 0 .648L19.55 9.033a.237.237 0 0 1-.33 0l-.606-.592c-2.548-2.496-6.68-2.496-9.228 0l-.648.634a.237.237 0 0 1-.33 0L6.902 7.602a.451.451 0 0 1 0-.647l.483-.473Zm16.338 3.046 1.339 1.31a.451.451 0 0 1 0 .648l-6.035 5.909a.475.475 0 0 1-.662 0L14.083 13.2a.119.119 0 0 0-.166 0l-4.283 4.194a.475.475 0 0 1-.662 0l-6.035-5.91a.451.451 0 0 1 0-.647l1.338-1.31a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0Z" fill="#000000"/></g><defs><clipPath id="a"><path fill="#ffffff" d="M0 0h28v20H0z"/></clipPath></defs></svg>`,WALLET_CONNECT_ICON_COLORED:ut`<svg width="96" height="96" fill="none"><path fill="#fff" d="M25.322 33.597c12.525-12.263 32.83-12.263 45.355 0l1.507 1.476a1.547 1.547 0 0 1 0 2.22l-5.156 5.048a.814.814 0 0 1-1.134 0l-2.074-2.03c-8.737-8.555-22.903-8.555-31.64 0l-2.222 2.175a.814.814 0 0 1-1.134 0l-5.156-5.049a1.547 1.547 0 0 1 0-2.22l1.654-1.62Zm56.019 10.44 4.589 4.494a1.547 1.547 0 0 1 0 2.22l-20.693 20.26a1.628 1.628 0 0 1-2.267 0L48.283 56.632a.407.407 0 0 0-.567 0L33.03 71.012a1.628 1.628 0 0 1-2.268 0L10.07 50.75a1.547 1.547 0 0 1 0-2.22l4.59-4.494a1.628 1.628 0 0 1 2.267 0l14.687 14.38c.156.153.41.153.567 0l14.685-14.38a1.628 1.628 0 0 1 2.268 0l14.687 14.38c.156.153.41.153.567 0l14.686-14.38a1.628 1.628 0 0 1 2.268 0Z"/><path stroke="#000" d="M25.672 33.954c12.33-12.072 32.325-12.072 44.655 0l1.508 1.476a1.047 1.047 0 0 1 0 1.506l-5.157 5.048a.314.314 0 0 1-.434 0l-2.074-2.03c-8.932-8.746-23.409-8.746-32.34 0l-2.222 2.174a.314.314 0 0 1-.434 0l-5.157-5.048a1.047 1.047 0 0 1 0-1.506l1.655-1.62Zm55.319 10.44 4.59 4.494a1.047 1.047 0 0 1 0 1.506l-20.694 20.26a1.128 1.128 0 0 1-1.568 0l-14.686-14.38a.907.907 0 0 0-1.267 0L32.68 70.655a1.128 1.128 0 0 1-1.568 0L10.42 50.394a1.047 1.047 0 0 1 0-1.506l4.59-4.493a1.128 1.128 0 0 1 1.567 0l14.687 14.379a.907.907 0 0 0 1.266 0l-.35-.357.35.357 14.686-14.38a1.128 1.128 0 0 1 1.568 0l14.687 14.38a.907.907 0 0 0 1.267 0l14.686-14.38a1.128 1.128 0 0 1 1.568 0Z"/></svg>`,BACK_ICON:ut`<svg width="10" height="18" viewBox="0 0 10 18"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.735.179a.75.75 0 0 1 .087 1.057L2.92 8.192a1.25 1.25 0 0 0 0 1.617l5.902 6.956a.75.75 0 1 1-1.144.97L1.776 10.78a2.75 2.75 0 0 1 0-3.559L7.678.265A.75.75 0 0 1 8.735.18Z" fill="#fff"/></svg>`,COPY_ICON:ut`<svg width="24" height="24" fill="none"><path fill="#fff" fill-rule="evenodd" d="M7.01 7.01c.03-1.545.138-2.5.535-3.28A5 5 0 0 1 9.73 1.545C10.8 1 12.2 1 15 1c2.8 0 4.2 0 5.27.545a5 5 0 0 1 2.185 2.185C23 4.8 23 6.2 23 9c0 2.8 0 4.2-.545 5.27a5 5 0 0 1-2.185 2.185c-.78.397-1.735.505-3.28.534l-.001.01c-.03 1.54-.138 2.493-.534 3.27a5 5 0 0 1-2.185 2.186C13.2 23 11.8 23 9 23c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C1 19.2 1 17.8 1 15c0-2.8 0-4.2.545-5.27A5 5 0 0 1 3.73 7.545C4.508 7.149 5.46 7.04 7 7.01h.01ZM15 15.5c-1.425 0-2.403-.001-3.162-.063-.74-.06-1.139-.172-1.427-.319a3.5 3.5 0 0 1-1.53-1.529c-.146-.288-.257-.686-.318-1.427C8.501 11.403 8.5 10.425 8.5 9c0-1.425.001-2.403.063-3.162.06-.74.172-1.139.318-1.427a3.5 3.5 0 0 1 1.53-1.53c.288-.146.686-.257 1.427-.318.759-.062 1.737-.063 3.162-.063 1.425 0 2.403.001 3.162.063.74.06 1.139.172 1.427.318a3.5 3.5 0 0 1 1.53 1.53c.146.288.257.686.318 1.427.062.759.063 1.737.063 3.162 0 1.425-.001 2.403-.063 3.162-.06.74-.172 1.139-.319 1.427a3.5 3.5 0 0 1-1.529 1.53c-.288.146-.686.257-1.427.318-.759.062-1.737.063-3.162.063ZM7 8.511c-.444.009-.825.025-1.162.052-.74.06-1.139.172-1.427.318a3.5 3.5 0 0 0-1.53 1.53c-.146.288-.257.686-.318 1.427-.062.759-.063 1.737-.063 3.162 0 1.425.001 2.403.063 3.162.06.74.172 1.139.318 1.427a3.5 3.5 0 0 0 1.53 1.53c.288.146.686.257 1.427.318.759.062 1.737.063 3.162.063 1.425 0 2.403-.001 3.162-.063.74-.06 1.139-.172 1.427-.319a3.5 3.5 0 0 0 1.53-1.53c.146-.287.257-.685.318-1.426.027-.337.043-.718.052-1.162H15c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C7 13.2 7 11.8 7 9v-.489Z" clip-rule="evenodd"/></svg>`,RETRY_ICON:ut`<svg width="15" height="16" viewBox="0 0 15 16"><path d="M6.464 2.03A.75.75 0 0 0 5.403.97L2.08 4.293a1 1 0 0 0 0 1.414L5.403 9.03a.75.75 0 0 0 1.06-1.06L4.672 6.177a.25.25 0 0 1 .177-.427h2.085a4 4 0 1 1-3.93 4.746c-.077-.407-.405-.746-.82-.746-.414 0-.755.338-.7.748a5.501 5.501 0 1 0 5.45-6.248H4.848a.25.25 0 0 1-.177-.427L6.464 2.03Z" fill="#fff"/></svg>`,DESKTOP_ICON:ut`<svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C2.204 1 3.13 1 4.98 1h6.04c1.85 0 2.775 0 3.466.394a3 3 0 0 1 1.12 1.12C16 3.204 16 4.13 16 5.98v1.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C13.796 12 12.87 12 11.02 12H4.98c-1.85 0-2.775 0-3.466-.394a3 3 0 0 1-1.12-1.12C0 9.796 0 8.87 0 7.02V5.98ZM4.98 2.5h6.04c.953 0 1.568.001 2.034.043.446.04.608.108.69.154a1.5 1.5 0 0 1 .559.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033v1.04c0 .952-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.046-.243.114-.69.154-.466.042-1.08.043-2.033.043H4.98c-.952 0-1.568-.001-2.034-.043-.446-.04-.608-.108-.69-.154a1.5 1.5 0 0 1-.559-.56c-.046-.08-.114-.243-.154-.69-.042-.465-.043-1.08-.043-2.033V5.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.046.243-.114.69-.154.465-.042 1.08-.043 2.033-.043Z" fill="#fff"/><path d="M4 14.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,MOBILE_ICON:ut`<svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.75 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C5.204 0 6.136 0 8 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C13 2.204 13 3.13 13 4.98v6.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C10.796 16 9.864 16 8 16s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C3 13.796 3 12.87 3 11.02V4.98Zm8.5 0v6.04c0 .953-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.046-.08-.114-.243-.154-.69-.042-.466-.043-1.08-.043-2.033V4.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.045.243-.113.693-.154C6.42 1.501 7.041 1.5 8 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033Z" fill="#fff"/></svg>`,ARROW_DOWN_ICON:ut`<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2.28 7.47a.75.75 0 0 0-1.06 1.06l5.25 5.25a.75.75 0 0 0 1.06 0l5.25-5.25a.75.75 0 0 0-1.06-1.06l-3.544 3.543a.25.25 0 0 1-.426-.177V.75a.75.75 0 0 0-1.5 0v10.086a.25.25 0 0 1-.427.176L2.28 7.47Z" fill="#fff"/></svg>`,ARROW_UP_RIGHT_ICON:ut`<svg width="15" height="14" fill="none"><path d="M4.5 1.75A.75.75 0 0 1 5.25 1H12a1.5 1.5 0 0 1 1.5 1.5v6.75a.75.75 0 0 1-1.5 0V4.164a.25.25 0 0 0-.427-.176L4.061 11.5A.75.75 0 0 1 3 10.44l7.513-7.513a.25.25 0 0 0-.177-.427H5.25a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,ARROW_RIGHT_ICON:ut`<svg width="6" height="14" viewBox="0 0 6 14"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.181 1.099a.75.75 0 0 1 1.024.279l2.433 4.258a2.75 2.75 0 0 1 0 2.729l-2.433 4.257a.75.75 0 1 1-1.303-.744L4.335 7.62a1.25 1.25 0 0 0 0-1.24L1.902 2.122a.75.75 0 0 1 .28-1.023Z" fill="#fff"/></svg>`,QRCODE_ICON:ut`<svg width="25" height="24" viewBox="0 0 25 24"><path d="M23.748 9a.748.748 0 0 0 .748-.752c-.018-2.596-.128-4.07-.784-5.22a6 6 0 0 0-2.24-2.24c-1.15-.656-2.624-.766-5.22-.784a.748.748 0 0 0-.752.748c0 .414.335.749.748.752 1.015.007 1.82.028 2.494.088.995.09 1.561.256 1.988.5.7.398 1.28.978 1.679 1.678.243.427.41.993.498 1.988.061.675.082 1.479.09 2.493a.753.753 0 0 0 .75.749ZM3.527.788C4.677.132 6.152.022 8.747.004A.748.748 0 0 1 9.5.752a.753.753 0 0 1-.749.752c-1.014.007-1.818.028-2.493.088-.995.09-1.561.256-1.988.5-.7.398-1.28.978-1.679 1.678-.243.427-.41.993-.499 1.988-.06.675-.081 1.479-.088 2.493A.753.753 0 0 1 1.252 9a.748.748 0 0 1-.748-.752c.018-2.596.128-4.07.784-5.22a6 6 0 0 1 2.24-2.24ZM1.252 15a.748.748 0 0 0-.748.752c.018 2.596.128 4.07.784 5.22a6 6 0 0 0 2.24 2.24c1.15.656 2.624.766 5.22.784a.748.748 0 0 0 .752-.748.753.753 0 0 0-.749-.752c-1.014-.007-1.818-.028-2.493-.089-.995-.089-1.561-.255-1.988-.498a4.5 4.5 0 0 1-1.679-1.68c-.243-.426-.41-.992-.499-1.987-.06-.675-.081-1.479-.088-2.493A.753.753 0 0 0 1.252 15ZM22.996 15.749a.753.753 0 0 1 .752-.749c.415 0 .751.338.748.752-.018 2.596-.128 4.07-.784 5.22a6 6 0 0 1-2.24 2.24c-1.15.656-2.624.766-5.22.784a.748.748 0 0 1-.752-.748c0-.414.335-.749.748-.752 1.015-.007 1.82-.028 2.494-.089.995-.089 1.561-.255 1.988-.498a4.5 4.5 0 0 0 1.679-1.68c.243-.426.41-.992.498-1.987.061-.675.082-1.479.09-2.493Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 4a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 11h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 4H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1ZM13.5 6.5A2.5 2.5 0 0 1 16 4h2a2.5 2.5 0 0 1 2.5 2.5v2A2.5 2.5 0 0 1 18 11h-2a2.5 2.5 0 0 1-2.5-2.5v-2Zm2.5-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1ZM7 13a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 20h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 13H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1Z" fill="#fff"/><path d="M13.5 15.5c0-.465 0-.697.038-.89a2 2 0 0 1 1.572-1.572C15.303 13 15.535 13 16 13v2.5h-2.5ZM18 13c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89H18V13ZM18 17.5h2.5c0 .465 0 .697-.038.89a2 2 0 0 1-1.572 1.572C18.697 20 18.465 20 18 20v-2.5ZM13.5 17.5H16V20c-.465 0-.697 0-.89-.038a2 2 0 0 1-1.572-1.572c-.038-.193-.038-.425-.038-.89Z" fill="#fff"/></svg>`,SCAN_ICON:ut`<svg width="16" height="16" fill="none"><path fill="#fff" d="M10 15.216c0 .422.347.763.768.74 1.202-.064 2.025-.222 2.71-.613a5.001 5.001 0 0 0 1.865-1.866c.39-.684.549-1.507.613-2.709a.735.735 0 0 0-.74-.768.768.768 0 0 0-.76.732c-.009.157-.02.306-.032.447-.073.812-.206 1.244-.384 1.555-.31.545-.761.996-1.306 1.306-.311.178-.743.311-1.555.384-.141.013-.29.023-.447.032a.768.768 0 0 0-.732.76ZM10 .784c0 .407.325.737.732.76.157.009.306.02.447.032.812.073 1.244.206 1.555.384a3.5 3.5 0 0 1 1.306 1.306c.178.311.311.743.384 1.555.013.142.023.29.032.447a.768.768 0 0 0 .76.732.734.734 0 0 0 .74-.768c-.064-1.202-.222-2.025-.613-2.71A5 5 0 0 0 13.477.658c-.684-.39-1.507-.549-2.709-.613a.735.735 0 0 0-.768.74ZM5.232.044A.735.735 0 0 1 6 .784a.768.768 0 0 1-.732.76c-.157.009-.305.02-.447.032-.812.073-1.244.206-1.555.384A3.5 3.5 0 0 0 1.96 3.266c-.178.311-.311.743-.384 1.555-.013.142-.023.29-.032.447A.768.768 0 0 1 .784 6a.735.735 0 0 1-.74-.768c.064-1.202.222-2.025.613-2.71A5 5 0 0 1 2.523.658C3.207.267 4.03.108 5.233.044ZM5.268 14.456a.768.768 0 0 1 .732.76.734.734 0 0 1-.768.74c-1.202-.064-2.025-.222-2.71-.613a5 5 0 0 1-1.865-1.866c-.39-.684-.549-1.507-.613-2.709A.735.735 0 0 1 .784 10c.407 0 .737.325.76.732.009.157.02.306.032.447.073.812.206 1.244.384 1.555a3.5 3.5 0 0 0 1.306 1.306c.311.178.743.311 1.555.384.142.013.29.023.447.032Z"/></svg>`,CHECKMARK_ICON:ut`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,HELP_ETH_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#j)"><rect width="60" height="60" rx="30" fill="#987DE8"/><path fill-rule="evenodd" clip-rule="evenodd" d="m15.48 28.367 11.966-19.3c1.174-1.892 3.927-1.892 5.1 0l11.97 19.306a6 6 0 0 1 .9 3.142v.028a6 6 0 0 1-1.154 3.56L33.227 50.208c-1.599 2.188-4.864 2.188-6.461 0L15.733 35.095a6 6 0 0 1-1.154-3.538v-.029a6 6 0 0 1 .9-3.161Z" fill="#fff"/><path d="M30.84 10.112a.992.992 0 0 0-.844-.464V24.5l12.598 5.53c.081-.466-.001-.963-.27-1.398L30.84 10.112Z" fill="#643CDD"/><path d="M29.996 9.648a.991.991 0 0 0-.845.465l-11.489 18.53a1.991 1.991 0 0 0-.264 1.387l12.598-5.53V9.648Z" fill="#BDADEB"/><path d="M29.996 50.544a.994.994 0 0 0 .808-.41l11.235-15.38c.307-.434-.193-.988-.658-.72L31.49 39.71a2.998 2.998 0 0 1-1.494.398v10.437Z" fill="#643CDD"/><path d="M17.966 34.762 29.19 50.134c.2.274.503.41.807.41V40.108a2.998 2.998 0 0 1-1.493-.398l-9.884-5.676c-.468-.27-.971.292-.653.728Z" fill="#BDADEB"/><path d="M42.594 30.03 29.996 24.5v13.138a3 3 0 0 0 1.495-.399l10.149-5.83c.525-.31.856-.823.954-1.38Z" fill="#401AB3"/><path d="M29.996 37.638V24.462l-12.598 5.566c.098.564.437 1.083.974 1.392l10.13 5.82c.462.265.978.398 1.494.398Z" fill="#7C5AE2"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="29.5"/><defs><clipPath id="j"><rect width="60" height="60" rx="30" fill="#fff"/></clipPath></defs></svg>`,HELP_PAINTING_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#k)"><rect width="60" height="60" rx="3" fill="#C653C6"/><path d="M52.094 47.344c0-4.246-1.436-9.557-5.885-12.4a2.876 2.876 0 0 0-1.615-3.891v-.819a4.037 4.037 0 0 0-1.34-3.007 4.75 4.75 0 0 0-2.41-6.252v-5.506c0-6.248-5.065-11.313-11.313-11.313-6.247 0-11.312 5.065-11.312 11.313v2.152a3.343 3.343 0 0 0-1.18 5.045 4.738 4.738 0 0 0-1.633 3.584 4.73 4.73 0 0 0 .956 2.858 5.218 5.218 0 0 0-2.358 6.815c-3.06 4.129-6.098 8.298-6.098 15.64 0 2.668.364 4.856.731 6.385.184.765.368 1.366.509 1.78a12.721 12.721 0 0 0 .225.611l.015.037.005.011.001.004v.002h.001l.92-.393-.92.394.26.606h38.26l.291-.49-.86-.51.86.51v-.001l.002-.002.002-.005.01-.017.035-.06.127-.225c.108-.195.26-.477.441-.835.363-.714.845-1.732 1.328-2.953.959-2.427 1.945-5.725 1.945-9.068Z" fill="#E87DE8" stroke="#fff" stroke-width="2"/><path fill-rule="evenodd" clip-rule="evenodd" d="M26.5 29.5c-3-.5-5.5-3-5.503-7l.002-7c0-.466 0-.698.026-.893a3 3 0 0 1 2.582-2.582c.195-.026.428-.026.893-.026 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.398 0 2.097 0 2.648.229a3 3 0 0 1 1.624 1.623c.228.552.228 1.25.228 2.649v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.495 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z" fill="#fff"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="2.5"/><defs><clipPath id="k"><rect width="60" height="60" rx="3" fill="#fff"/></clipPath></defs></svg>`,HELP_CHART_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#l)"><path d="M0 25.01C0 15.76 0 11.133 1.97 7.678a15 15 0 0 1 5.598-5.597C11.023.11 15.648.11 24.9.11h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.597C60 11.133 60 15.758 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a15 15 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a14.999 14.999 0 0 1-5.597-5.598C0 49.087 0 44.462 0 35.21v-10.2Z" fill="#1DC956"/><path d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z" stroke="#fff" stroke-opacity=".1"/><path d="M16.109 60c-3.833-.179-6.41-.645-8.541-1.86a15 15 0 0 1-5.598-5.598C.553 50.057.155 46.967.043 41.985l4.146-1.382a4 4 0 0 0 2.48-2.39l4.654-12.409a2 2 0 0 1 2.505-1.195l2.526.842a2 2 0 0 0 2.422-1.003l2.968-5.938c.81-1.62 3.185-1.415 3.705.32l3.774 12.581a2 2 0 0 0 3.025 1.09l3.342-2.228c.27-.18.49-.422.646-.706l5.297-9.712a2 2 0 0 1 1.428-1.016l4.134-.689a2 2 0 0 1 1.61.437l3.892 3.243a2 2 0 0 0 2.694-.122l4.633-4.632C60 19.28 60 21.88 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a14.998 14.998 0 0 1-5.598 5.598c-2.131 1.215-4.708 1.681-8.54 1.86H16.108Z" fill="#2BEE6C"/><path d="M.072 43.03a112.37 112.37 0 0 1-.048-2.093l3.85-1.283a3 3 0 0 0 1.86-1.793l4.653-12.408a3 3 0 0 1 3.758-1.793l2.526.842a1 1 0 0 0 1.21-.501l2.97-5.938c1.214-2.43 4.775-2.123 5.556.48l3.774 12.58a1 1 0 0 0 1.513.545l3.341-2.227a1 1 0 0 0 .323-.353l5.298-9.712a3 3 0 0 1 2.14-1.523l4.135-.69a3 3 0 0 1 2.414.655l3.892 3.244a1 1 0 0 0 1.347-.061l5.28-5.28c.046.845.077 1.752.097 2.732l-3.962 3.962a3 3 0 0 1-4.042.183l-3.893-3.243a1 1 0 0 0-.804-.218l-4.135.689a1 1 0 0 0-.714.507l-5.297 9.712c-.233.427-.565.79-.97 1.06l-3.34 2.228a3 3 0 0 1-4.538-1.635l-3.775-12.58c-.26-.868-1.447-.97-1.852-.16l-2.969 5.937a3 3 0 0 1-3.632 1.505l-2.526-.842a1 1 0 0 0-1.252.597L7.606 38.564a5 5 0 0 1-3.1 2.988L.072 43.029Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z" fill="#2BEE6C"/><path d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" fill="#fff"/><path d="M45 .283v59.654c-.63.042-1.294.074-2 .098V.185c.706.025 1.37.056 2 .098Z" fill="#fff"/><path class="help-img-highlight" d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z"/></g><defs><clipPath id="l"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_KEY_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#m)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M39.192 29.192c5.077-5.077 5.077-13.308 0-18.385-5.076-5.077-13.308-5.077-18.384 0-5.077 5.077-5.077 13.308 0 18.385l1.287 1.291c1.137 1.142 1.706 1.712 2.097 2.387.267.462.472.957.608 1.473.2.755.2 1.56.2 3.171V48.75c0 1.077 0 1.615.134 2.119a4 4 0 0 0 .407.984c.262.45.643.831 1.404 1.592l.294.295c.654.654.982.981 1.365 1.086.26.07.533.07.792 0 .383-.105.71-.432 1.365-1.086l3.478-3.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.478-.479c-.655-.654-.982-.981-1.087-1.365a1.5 1.5 0 0 1 0-.791c.105-.384.432-.711 1.087-1.365l.478-.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.492-.493c-.65-.65-.974-.974-1.08-1.355a1.5 1.5 0 0 1-.003-.788c.102-.382.425-.71 1.069-1.364l5.46-5.547Z"/><circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="m"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_USER_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#n)"><rect width="60" height="60" fill="#00ACE6" rx="30"/><path fill="#1AC6FF" stroke="#fff" stroke-width="2" d="M59 73c0 16.016-12.984 29-29 29S1 89.016 1 73c0-16.017 11-29 29-29s29 12.983 29 29ZM18.69 19.902a11 11 0 0 1 9.281-8.692 14.842 14.842 0 0 1 4.058 0 11 11 0 0 1 9.28 8.692c.178.866.322 1.75.44 2.625.132.977.132 1.968 0 2.945a39.467 39.467 0 0 1-.44 2.625 11 11 0 0 1-9.28 8.692 14.862 14.862 0 0 1-4.058 0 11 11 0 0 1-9.28-8.692 39.467 39.467 0 0 1-.44-2.625 11.004 11.004 0 0 1 0-2.945c.118-.876.262-1.759.44-2.625Z"/><circle cx="24.5" cy="23.5" r="1.5" fill="#fff"/><circle cx="35.5" cy="23.5" r="1.5" fill="#fff"/><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m31 20-3 8h4"/></g><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/><defs><clipPath id="n"><rect width="60" height="60" fill="#fff" rx="30"/></clipPath></defs></svg>`,HELP_LOCK_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#C653C6" rx="3"/><path fill="#fff" d="M20.034 15.216C20 15.607 20 16.07 20 17v2.808c0 1.13 0 1.696-.2 2.11a1.78 1.78 0 0 1-.584.714c-.366.28-1.051.42-2.423.7a7.076 7.076 0 0 0-1.597.511 9.001 9.001 0 0 0-4.353 4.353C10 30.005 10 32.336 10 37c0 4.663 0 6.995.843 8.804a9.001 9.001 0 0 0 4.353 4.353C17.005 51 19.336 51 24 51h12c4.663 0 6.995 0 8.804-.843a9.001 9.001 0 0 0 4.353-4.353C50 43.995 50 41.664 50 37c0-4.663 0-6.995-.843-8.804a9.001 9.001 0 0 0-4.353-4.353 7.076 7.076 0 0 0-1.597-.511c-1.372-.28-2.057-.42-2.423-.7a1.78 1.78 0 0 1-.583-.715C40 21.505 40 20.94 40 19.809V17c0-.929 0-1.393-.034-1.784a9 9 0 0 0-8.182-8.182C31.393 7 30.93 7 30 7s-1.393 0-1.784.034a9 9 0 0 0-8.182 8.182Z"/><path fill="#E87DE8" d="M22 17c0-.929 0-1.393.044-1.784a7 7 0 0 1 6.172-6.172C28.606 9 29.071 9 30 9s1.393 0 1.784.044a7 7 0 0 1 6.172 6.172c.044.39.044.855.044 1.784v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.394-.077-1.78a4 4 0 0 0-3.143-3.143C31.394 12 30.93 12 30 12s-1.394 0-1.78.077a4 4 0 0 0-3.143 3.143C25 15.606 25 16.07 25 17v4.5a1.5 1.5 0 0 1-3 0V17Z"/><path fill="#E87DE8" fill-rule="evenodd" d="M12 36.62c0-4.317 0-6.476.92-8.088a7 7 0 0 1 2.612-2.612c1.612-.92 3.77-.92 8.088-.92h6.855c.469 0 .703 0 .906.017 2.73.222 4.364 2.438 4.619 4.983.27-2.698 2.111-5 5.015-5A6.985 6.985 0 0 1 48 31.985v5.395c0 4.317 0 6.476-.92 8.088a7 7 0 0 1-2.612 2.612c-1.612.92-3.77.92-8.088.92h-5.855c-.469 0-.703 0-.906-.017-2.73-.222-4.364-2.438-4.619-4.983-.258 2.583-1.943 4.818-4.714 4.99-.155.01-.335.01-.694.01-.55 0-.825 0-1.057-.015a7 7 0 0 1-6.52-6.52C12 42.233 12 41.958 12 41.408V36.62Zm21.24-.273a4 4 0 1 0-6.478 0c.985 1.36 1.479 2.039 1.564 2.229.178.398.176.818.174 1.247V42.5a1.5 1.5 0 0 0 3 0v-2.677c-.002-.429-.004-.85.174-1.247.085-.19.579-.87 1.565-2.229Z" clip-rule="evenodd"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_COMPAS_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#1DC956" rx="30"/><circle cx="30" cy="29.999" r="3" fill="#fff"/><path fill="#2BEE6C" stroke="#fff" stroke-width="2" d="m45.316 17.9-.88-.425.88.424a7.9 7.9 0 0 1 .026-.053c.093-.192.21-.432.26-.687l-.819-.162.819.162a2 2 0 0 0-.239-1.405c-.132-.224-.32-.412-.472-.562a8.415 8.415 0 0 1-.042-.042l-.042-.042c-.15-.151-.338-.34-.562-.472l-.508.862.508-.862a2 2 0 0 0-1.405-.239c-.255.05-.495.167-.687.26l-.053.026-15.05 7.246-.108.052c-1.131.545-1.843.887-2.456 1.374a6.994 6.994 0 0 0-1.13 1.13c-.487.613-.83 1.325-1.375 2.457l-.051.108-7.247 15.05-.025.053c-.094.192-.21.431-.26.686a2 2 0 0 0 .239 1.406l.855-.505-.856.505c.133.224.321.411.473.562l.042.042.041.042c.15.151.338.34.563.472a2 2 0 0 0 1.405.239l-.195-.981.195.98c.255-.05.494-.166.686-.26l.054-.025-.419-.87.419.87 15.05-7.247.107-.051c1.132-.545 1.844-.888 2.457-1.374a7.002 7.002 0 0 0 1.13-1.13c.487-.614.83-1.325 1.374-2.457l.052-.108 7.246-15.05Z"/><path fill="#1DC956" d="m33.376 32.723-2.669-3.43-14.85 14.849.206.205a1 1 0 0 0 1.141.194l15.105-7.273a3 3 0 0 0 1.067-4.545Z"/><path fill="#86F999" d="m26.624 27.276 2.669 3.43 14.85-14.849-.206-.205a1 1 0 0 0-1.141-.194L27.69 22.731a3 3 0 0 0-1.067 4.545Z"/><circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/></svg>`,HELP_NOUN_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#794CFF" rx="3"/><path fill="#987DE8" stroke="#fff" stroke-width="2" d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z"/><path fill="#fff" d="M37.5 25h10v10h-10z"/><path fill="#4019B2" d="M42.5 25h5v10h-5z"/><path fill="#fff" d="M19.5 25h10v10h-10z"/><path fill="#4019B2" d="M24.5 25h5v10h-5z"/><path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_DAO_IMG:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#o)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M19 52c5.523 0 10-4.477 10-10s-4.477-10-10-10S9 36.477 9 42s4.477 10 10 10Z"/><path fill="#fff" fill-rule="evenodd" d="M42.844 8.326a1 1 0 0 0-1.687 0L28.978 27.463A1 1 0 0 0 29.822 29h24.357a1 1 0 0 0 .843-1.537L42.844 8.326Z" clip-rule="evenodd"/><path fill="#FF974C" fill-rule="evenodd" d="M42.335 11.646c.324.115.571.504 1.066 1.28l7.332 11.523c.562.883.843 1.325.792 1.69a1 1 0 0 1-.342.623c-.28.238-.803.238-1.85.238H34.667c-1.047 0-1.57 0-1.85-.238a1 1 0 0 1-.342-.623c-.051-.365.23-.806.792-1.69l7.332-11.523c.495-.776.742-1.165 1.066-1.28a1 1 0 0 1 .67 0ZM35 27a7 7 0 0 0 7-7 7 7 0 0 0 7 7H35Z" clip-rule="evenodd"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M10.106 9.357c-.109.32-.107.682-.106.975V25.668c-.001.293-.003.654.106.975a2 2 0 0 0 1.251 1.25c.32.11.682.108.975.107H19c5.523 0 10-4.477 10-10S24.523 8 19 8h-6.668c-.293-.001-.654-.003-.975.106a2 2 0 0 0-1.25 1.251Z"/><circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/><circle cx="19" cy="41.999" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="o"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,SEARCH_ICON:ut`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,HELP_ICON:ut`<svg width="11" height="17" viewBox="0 0 11 17"><path fill="#fff" d="M5.22 2.97c-1.07 0-2.25.843-2.25 2.25a.75.75 0 0 1-1.5 0c0-2.393 2.019-3.75 3.75-3.75 1.73 0 3.75 1.357 3.75 3.75 0 1.64-1.038 2.466-1.785 3.057-.802.635-1.215.984-1.215 1.693a.75.75 0 1 1-1.5 0c0-1.466.985-2.24 1.681-2.788l.103-.081C7.007 6.504 7.47 6.08 7.47 5.22c0-1.407-1.181-2.25-2.25-2.25ZM5.22 14.97a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"/></svg>`,WALLET_ICON:ut`<svg width="15" height="14" fill="none" viewBox="0 0 15 14"><path fill="#fff" fill-rule="evenodd" d="M.64 9.2v-3h.001c.009-1.857.07-2.886.525-3.682a4 4 0 0 1 1.492-1.493C3.58.5 4.813.5 7.28.5h3.735c.58 0 .871 0 1.114.04A3 3 0 0 1 14.6 3.011c.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041h-.777c.178.307.302.648.362 1.011.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041H4.507A3.867 3.867 0 0 1 .64 9.633V9.2ZM7.28 2h3.735c.64 0 .779.005.87.02a1.5 1.5 0 0 1 1.235 1.236c.015.09.02.229.02.869s-.005.779-.02.87a1.5 1.5 0 0 1-1.236 1.235c-.09.015-.229.02-.869.02H4.023c-.697 0-1.345.21-1.883.572V6.25h.001c.004-.791.015-1.383.059-1.867.056-.629.157-.926.269-1.122a2.5 2.5 0 0 1 .932-.933c.197-.111.494-.212 1.123-.268C5.173 2 6.019 2 7.28 2Zm-.265 5.75H4.023c-1.04 0-1.883.843-1.883 1.883A2.367 2.367 0 0 0 4.507 12h2.508c.64 0 .779-.005.87-.02a1.5 1.5 0 0 0 1.235-1.236c.015-.09.02-.229.02-.869s-.005-.779-.02-.87A1.5 1.5 0 0 0 7.884 7.77c-.09-.015-.228-.02-.869-.02Z" clip-rule="evenodd"/></svg>`,NETWORK_PLACEHOLDER:ut`<svg width="28" height="28" fill="none" viewBox="0 0 28 28"><mask id="p" width="26" height="28" x="1" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#D9D9D9" d="M12 1.172a4 4 0 0 1 4 0l8.124 4.69a4 4 0 0 1 2 3.465v9.381a4 4 0 0 1-2 3.464L16 26.862a4 4 0 0 1-4 0l-8.124-4.69a4 4 0 0 1-2-3.464V9.327a4 4 0 0 1 2-3.464L12 1.173Z"/></mask><g mask="url(#p)"><path id="network-placeholder-fill" fill="#fff" d="M0 0h28v28H0z"/><path id="network-placeholder-dash" stroke="#000" stroke-dasharray="2 2" d="m8.953 2.931 2.032-1.173.25.433 1.015-.586c.269-.155.553-.271.844-.35l-.13-.483a4.003 4.003 0 0 1 2.071 0l-.13.483c.293.079.576.195.845.35l1.016.586.25-.433 2.03 1.173-.25.433 2.032 1.173.25-.433 2.03 1.172-.25.433 1.016.587c.269.155.512.342.725.556l.354-.354a4.003 4.003 0 0 1 1.035 1.794l-.483.129c.078.292.12.596.12.906v1.172h.5v2.346h-.5v2.345h.5v2.345h-.5v1.173c0 .31-.042.614-.12.906l.483.13a4.003 4.003 0 0 1-1.035 1.793l-.354-.354a3.498 3.498 0 0 1-.725.556l-1.015.586.25.434-2.031 1.172-.25-.433-2.031 1.173.25.433-2.031 1.172-.25-.433-1.016.587a3.494 3.494 0 0 1-.844.35l.13.482a4.003 4.003 0 0 1-2.071 0l.13-.483a3.496 3.496 0 0 1-.845-.35l-1.015-.586-.25.433-2.032-1.172.25-.433-2.03-1.173-.25.433L4.89 22.76l.25-.434-1.015-.586a3.498 3.498 0 0 1-.725-.556l-.354.354a4.003 4.003 0 0 1-1.035-1.794l.483-.13a3.497 3.497 0 0 1-.12-.905v-1.173h-.5V15.19h.5v-2.345h-.5v-2.346h.5V9.327c0-.31.042-.614.12-.906l-.483-.13a4.003 4.003 0 0 1 1.035-1.793l.354.354c.213-.214.456-.401.725-.556l1.015-.587-.25-.433 2.031-1.172.25.433 2.031-1.173-.25-.433Z"/><path fill="#798686" stroke="#fff" d="M14.243 13.563 14 13.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.538.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.538-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#9EA9A9" stroke="#fff" d="M14.243 8.563 14 8.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.316.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.316-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#C9CFCF" stroke="#fff" d="m22.344 9.53-.468-.176.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-3.163-1.758-.09-.05c-1.163-.645-1.856-1.03-2.606-1.161a4.5 4.5 0 0 0-1.544 0c-.75.13-1.443.516-2.607 1.162l-.088.05-3.164 1.757-.024.013c-.432.24-.79.44-1.053.622-.266.185-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722Z"/></g></svg>`,WALLET_PLACEHOLDER:ut`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,TOKEN_PLACEHOLDER:ut`<svg width="60" height="60" viewBox="0 0 60 60" fill="none"><rect id="token-placeholder-fill" width="58" height="58" x="1" y="1" fill="#fff" rx="29"/><path fill="#3B4040" stroke="#fff" stroke-width="2" d="M32 10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v5.566c0 .357.192.685.495.875a16.001 16.001 0 0 1 4.256 3.894c.667.88.33 2.113-.627 2.665l-2.494 1.44c-.956.552-2.166.204-2.913-.609a9.12 9.12 0 1 0 .064 12.267c.739-.82 1.945-1.181 2.907-.64l2.509 1.415c.962.542 1.312 1.77.654 2.658a16 16 0 0 1-4.356 4.028c-.303.19-.495.518-.495.875V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-2.992c0-.602-.528-1.065-1.13-1.032-.579.032-1.16.032-1.74 0-.602-.032-1.13.43-1.13 1.032V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-5.566c0-.357-.192-.685-.495-.875a16 16 0 0 1 0-27.118c.303-.19.495-.517.495-.875V10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2.992c0 .601.528 1.064 1.13 1.032.58-.032 1.161-.032 1.74 0 .602.033 1.13-.43 1.13-1.032V10Z"/><rect id="token-placeholder-dash" width="58" height="58" x="1" y="1" stroke="#000" stroke-dasharray="6 6" stroke-width="2" rx="29"/></svg>`,ACCOUNT_COPY:ut`<svg width="14" height="14" fill="none" viewBox="0 0 14 14"><path fill="#fff" fill-rule="evenodd" d="M4.003 4.005c.012-1.225.074-1.936.391-2.491a3 3 0 0 1 1.12-1.12C6.204 0 7.136 0 9 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C14 2.204 14 3.136 14 5s0 2.795-.394 3.486a3 3 0 0 1-1.12 1.12c-.555.317-1.266.379-2.491.391l.002.003c-.012 1.222-.075 1.932-.391 2.486a3 3 0 0 1-1.12 1.12C7.796 14 6.864 14 5 14s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C0 11.796 0 10.864 0 9s0-2.795.394-3.486a3 3 0 0 1 1.12-1.12c.554-.316 1.264-.379 2.486-.391l.003.002ZM9 8.5c-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.045-.08-.113-.243-.154-.693C5.501 6.58 5.5 5.959 5.5 5c0-.959.001-1.58.043-2.05.04-.45.109-.613.154-.693a1.5 1.5 0 0 1 .56-.56c.08-.045.243-.113.693-.154C7.42 1.501 8.041 1.5 9 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.045.08.113.243.154.693.042.47.043 1.091.043 2.05 0 .959-.001 1.58-.043 2.05-.04.45-.109.613-.154.693a1.5 1.5 0 0 1-.56.56c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043ZM4 5.503a13.77 13.77 0 0 0-1.05.04c-.45.04-.613.109-.693.154a1.5 1.5 0 0 0-.56.56c-.045.08-.113.243-.154.693C1.501 7.42 1.5 8.041 1.5 9c0 .959.001 1.58.043 2.05.04.45.109.613.154.693a1.5 1.5 0 0 0 .56.56c.08.045.243.113.693.154.47.042 1.091.043 2.05.043.959 0 1.58-.001 2.05-.043.45-.04.613-.109.693-.154a1.5 1.5 0 0 0 .56-.56c.045-.08.113-.242.154-.693.025-.283.035-.619.04-1.05-1.534-.003-2.358-.037-2.983-.394a3 3 0 0 1-1.12-1.12c-.357-.625-.39-1.449-.394-2.983Z" clip-rule="evenodd"/></svg>`,ACCOUNT_DISCONNECT:ut`<svg width="16" height="14" fill="none" viewBox="0 0 16 14"><path fill="#fff" d="M9.677 1.5h-2.61c-1.261 0-2.107.001-2.757.06-.629.056-.926.157-1.122.268a2.5 2.5 0 0 0-.933.933c-.112.196-.212.493-.269 1.122-.058.65-.06 1.496-.06 2.757v.72c0 1.26.002 2.107.06 2.756.057.63.157.927.27 1.123a2.5 2.5 0 0 0 .932.933c.196.111.493.212 1.122.268.65.059 1.496.06 2.757.06h2.61a.75.75 0 1 1 0 1.5h-2.61c-2.467 0-3.7 0-4.622-.525a4 4 0 0 1-1.493-1.493C.427 11.06.427 9.827.427 7.36v-.72c0-2.467 0-3.7.525-4.622A4 4 0 0 1 2.445.525C3.366 0 4.6 0 7.067 0h2.61a.75.75 0 1 1 0 1.5Z"/><path fill="#fff" d="M10.896 11.03a.75.75 0 0 1 0-1.06l1.793-1.793a.25.25 0 0 0-.176-.427H8.177a.75.75 0 0 1 0-1.5h4.336a.25.25 0 0 0 .176-.427L10.896 4.03a.75.75 0 0 1 1.061-1.06l3.323 3.323a1 1 0 0 1 0 1.414l-3.323 3.323a.75.75 0 0 1-1.06 0Z"/></svg>`,GLOBE_ICON:ut`<svg width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="M15.5 8a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-2.113.75c.301 0 .535.264.47.558a6.01 6.01 0 0 1-2.867 3.896c-.203.116-.42-.103-.334-.32.409-1.018.691-2.274.797-3.657a.512.512 0 0 1 .507-.477h1.427Zm.47-2.058c.065.294-.169.558-.47.558H11.96a.512.512 0 0 1-.507-.477c-.106-1.383-.389-2.638-.797-3.656-.087-.217.13-.437.333-.32a6.01 6.01 0 0 1 2.868 3.895Zm-4.402.558c.286 0 .515-.24.49-.525-.121-1.361-.429-2.534-.83-3.393-.279-.6-.549-.93-.753-1.112a.535.535 0 0 0-.724 0c-.204.182-.474.513-.754 1.112-.4.859-.708 2.032-.828 3.393a.486.486 0 0 0 .49.525h2.909Zm-5.415 0c.267 0 .486-.21.507-.477.106-1.383.389-2.638.797-3.656.087-.217-.13-.437-.333-.32a6.01 6.01 0 0 0-2.868 3.895c-.065.294.169.558.47.558H4.04ZM2.143 9.308c-.065-.294.169-.558.47-.558H4.04c.267 0 .486.21.507.477.106 1.383.389 2.639.797 3.657.087.217-.13.436-.333.32a6.01 6.01 0 0 1-2.868-3.896Zm3.913-.033a.486.486 0 0 1 .49-.525h2.909c.286 0 .515.24.49.525-.121 1.361-.428 2.535-.83 3.394-.279.6-.549.93-.753 1.112a.535.535 0 0 1-.724 0c-.204-.182-.474-.513-.754-1.112-.4-.859-.708-2.033-.828-3.394Z" clip-rule="evenodd"/></svg>`},uI=Ve`.w3m-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--w3m-background-border-radius) * .9);background-color:var(--w3m-background-color);background-image:var(--w3m-background-image-url);background-position:center;background-size:cover}.w3m-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--w3m-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--w3m-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--w3m-color-bg-1);box-shadow:0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--w3m-color-fg-1)}.w3m-toolbar div{display:flex}.w3m-toolbar div button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--w3m-color-fg-1)}.w3m-help-active button:first-child path{fill:var(--w3m-color-bg-1)}@media(hover:hover){button:hover{background-color:var(--w3m-color-bg-2)}}`;var hI=Object.defineProperty,fI=Object.getOwnPropertyDescriptor,am=(t,e,r,n)=>{for(var i=n>1?void 0:n?fI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&hI(e,r,i),i};let qc=class extends $e{constructor(){super(),this.isHelp=!1,this.unsubscribeRouter=void 0,this.unsubscribeRouter=tt.subscribe(t=>{this.isHelp=t.view==="Help"})}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this)}onHelp(){tt.push("Help")}logoTemplate(){var t;const e=(t=Mn.state.themeVariables)==null?void 0:t["--w3m-logo-image-url"];return e?oe`<img src="${e}">`:Le.WALLET_CONNECT_LOGO}render(){const t={"w3m-help-active":this.isHelp};return oe`<div class="w3m-toolbar-placeholder"></div><div class="w3m-toolbar">${this.logoTemplate()}<div class="${Lr(t)}"><button @click="${this.onHelp}">${Le.HELP_ICON}</button> <button @click="${Nr.close}">${Le.CROSS_ICON}</button></div></div>`}};qc.styles=[Fe.globalCss,uI],am([gt()],qc.prototype,"isHelp",2),qc=am([Ne("w3m-modal-backcard")],qc);const dI=Ve`main{padding:20px;padding-top:0;width:100%}`;var pI=Object.defineProperty,gI=Object.getOwnPropertyDescriptor,mI=(t,e,r,n)=>{for(var i=n>1?void 0:n?gI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&pI(e,r,i),i};let xf=class extends $e{render(){return oe`<main><slot></slot></main>`}};xf.styles=[Fe.globalCss,dI],xf=mI([Ne("w3m-modal-content")],xf);const wI=Ve`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--w3m-color-bg-2)}`;var vI=Object.defineProperty,yI=Object.getOwnPropertyDescriptor,bI=(t,e,r,n)=>{for(var i=n>1?void 0:n?yI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&vI(e,r,i),i};let Cf=class extends $e{render(){return oe`<footer><slot></slot></footer>`}};Cf.styles=[Fe.globalCss,wI],Cf=bI([Ne("w3m-modal-footer")],Cf);const _I=Ve`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--w3m-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--w3m-accent-color)}`;var EI=Object.defineProperty,xI=Object.getOwnPropertyDescriptor,va=(t,e,r,n)=>{for(var i=n>1?void 0:n?xI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&EI(e,r,i),i};let ns=class extends $e{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return oe`<button class="w3m-back-btn" @click="${tt.goBack}">${Le.BACK_ICON}</button>`}actionBtnTemplate(){return oe`<button class="w3m-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"w3m-border":this.border},e=tt.state.history.length>1,r=this.title?oe`<w3m-text variant="big-bold">${this.title}</w3m-text>`:oe`<slot></slot>`;return oe`<header class="${Lr(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};ns.styles=[Fe.globalCss,_I],va([Oe()],ns.prototype,"title",2),va([Oe()],ns.prototype,"onAction",2),va([Oe()],ns.prototype,"actionIcon",2),va([Oe()],ns.prototype,"border",2),ns=va([Ne("w3m-modal-header")],ns);const CI={1:"692ed6ba-e569-459a-556a-776476829e00",42161:"600a9a04-c1b9-42ca-6785-9b4b6ff85200",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00"},II={ETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},WETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},AVAX:{icon:"30c46e53-e989-45fb-4549-be3bd4eb3b00"},FTM:{icon:"06b26297-fe0c-4733-5d6b-ffa5498aac00"},BNB:{icon:"93564157-2e8e-4ce7-81df-b264dbee9b00"},MATIC:{icon:"41d04d42-da3b-4453-8506-668cc0727900"},OP:{icon:"ab9c186a-c52f-464b-2906-ca59d760a400"},xDAI:{icon:"02b53f6a-e3d4-479e-1cb4-21178987d100"},EVMOS:{icon:"f926ff41-260d-4028-635e-91913fc28e00"},METIS:{icon:"3897a66d-40b9-4833-162f-a2c90531c900"},IOTX:{icon:"34e68754-e536-40da-c153-6ef2e7188a00"}},en={externalWallets(){const{isStandalone:t}=De.state;if(t)return[];let e=Lt.client().getConnectors();return e=e.filter(r=>r.id!=="injected"),e},manualWallets(){var t,e;const{mobileWallets:r,desktopWallets:n}=Ft.state,i=(t=en.recentWallet())==null?void 0:t.id,o=Se.isMobile()?r:n,c=o?.filter(l=>i!==l.id);return(e=Se.isMobile()?c?.map(({id:l,name:h,links:f})=>({id:l,name:h,mobile:f,links:f})):c?.map(({id:l,name:h,links:f})=>({id:l,name:h,desktop:f,links:f})))!=null?e:[]},installedInjectedWallets(){const{isStandalone:t}=De.state;if(t)return[];if(!Lt.client().isInjectedProviderInstalled())return[];const{namespace:e}=Lt.client(),{injectedWallets:r}=rr.state;let n=r.filter(({injected:i})=>!!i.some(o=>Lt.client().safeCheckInjectedProvider(o.injected_id)&&o.namespace===e));return n.length>1&&(n=n.filter(({injected:i})=>!!i.map(({injected_id:o})=>o).every(o=>o!=="isMetaMask"))),n.length?n:[{name:"Browser",id:"browser",image_id:void 0}]},injectedWallets(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,explorerRecommendedWalletIds:r}=Ft.state,n=Se.isMobile();if(t||e==="ALL"||n)return[];const{namespace:i}=Lt.client(),{injectedWallets:o}=rr.state;return o.filter(({id:c,injected:l})=>{const h=Se.isArray(e)?e:[],f=Se.isArray(r)?r:[];return!!l.some(v=>v.namespace===i&&!h.includes(c)&&!f.includes(c))})},recentWallet(){return xe.getRecentWallet()},recomendedWallets(t=!1){var e;const r=en.installedInjectedWallets().map(({id:c})=>c),n=t||(e=en.recentWallet())==null?void 0:e.id,i=[...r,n],{recomendedWallets:o}=rr.state;return o.filter(c=>!i.includes(c.id))}},xe={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET_DATA:"W3M_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",rejectStandaloneButtonComponent(){const{isStandalone:t}=De.state;if(t)throw new Error("Web3Modal button components are not available in standalone mode.")},getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletIcon({id:t,image_id:e}){const{walletImages:r}=Ft.state;return r!=null&&r[t]?r[t]:e?rr.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e?t.split(" ")[0]:t},getChainIcon(t){var e;const r=CI[t],{projectId:n,chainImages:i}=Ft.state;return(e=i?.[t])!=null?e:n&&r?rr.getAssetImageUrl(r):""},getTokenIcon(t){var e,r;const n=(e=II[t])==null?void 0:e.icon,{projectId:i,tokenImages:o}=Ft.state;return(r=o?.[t])!=null?r:i&&n?rr.getAssetImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=xe.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.src=t});return Promise.race([e,Se.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},handleMobileLinking(t){const{standaloneUri:e}=De.state,{pairingUri:r}=ur.state,{mobile:n,name:i}=t,o=n?.native,c=n?.universal;xe.setRecentWallet(t);function l(h){let f="";o?f=Se.formatUniversalUrl(o,h,i):c&&(f=Se.formatNativeUrl(c,h,i)),Se.openHref(f,"_self")}l(e||r)},handleAndroidLinking(){const{standaloneUri:t}=De.state,{pairingUri:e}=ur.state;t?(Se.setWalletConnectAndroidDeepLink(t),Se.openHref(t,"_self")):(Se.setWalletConnectAndroidDeepLink(e),Se.openHref(e,"_self"))},async handleUriCopy(){const{standaloneUri:t}=De.state,{pairingUri:e}=ur.state;t?await navigator.clipboard.writeText(t):await navigator.clipboard.writeText(e),qr.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=De.state;await Lt.client().connectConnector(t,r?.id),Nr.close()}catch(r){console.error(r),e?e():qr.openToast(xe.getErrorMessage(r),"error")}},getCustomImageUrls(){const{chainImages:t,walletImages:e}=Ft.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},generateAvatarColors(t){var e;const r=(e=t.match(/.{1,7}/g))==null?void 0:e.splice(0,5),n=[];r?.forEach(o=>{let c=0;for(let h=0;h<o.length;h+=1)c=o.charCodeAt(h)+((c<<5)-c),c=c&c;const l=[0,0,0];for(let h=0;h<3;h+=1){const f=c>>h*8&255;l[h]=f}n.push(`rgb(${l[0]}, ${l[1]}, ${l[2]})`)});const i=document.querySelector(":root");if(i){const o={"--w3m-color-av-1":n[0],"--w3m-color-av-2":n[1],"--w3m-color-av-3":n[2],"--w3m-color-av-4":n[3],"--w3m-color-av-5":n[4]};Object.entries(o).forEach(([c,l])=>i.style.setProperty(c,l))}},setRecentWallet(t){const{walletConnectVersion:e}=De.state;localStorage.setItem(xe.W3M_RECENT_WALLET_DATA,JSON.stringify({[e]:t}))},getRecentWallet(){const t=localStorage.getItem(xe.W3M_RECENT_WALLET_DATA);if(t){const{walletConnectVersion:e}=De.state,r=JSON.parse(t);if(r[e])return r[e]}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){Se.openHref(xe.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{id:t,desktop:e,mobile:r,injected:n}=Se.getWalletRouterData(),i=en.installedInjectedWallets(),o=!!(n!=null&&n.length),c=i.some(v=>v.id===t),l=!!(e!=null&&e.native),h=!!(e!=null&&e.universal),f=!!(r!=null&&r.native)||!!(r!=null&&r.universal);return{isInjectedInstalled:c,isInjected:o,isDesktop:l,isMobile:f,isWeb:h}},goToConnectingView(t){tt.setData({Wallet:t});const e=Se.isMobile(),{isDesktop:r,isWeb:n,isMobile:i,isInjectedInstalled:o}=xe.getCachedRouterWalletPlatforms();e?o?tt.push("InjectedConnecting"):i?tt.push("MobileConnecting"):n?tt.push("WebConnecting"):tt.push("InstallWallet"):o?tt.push("InjectedConnecting"):r?tt.push("DesktopConnecting"):n?tt.push("WebConnecting"):i?tt.push("MobileQrcodeConnecting"):tt.push("InstallWallet")}},SI=Ve`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var OI=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,If=(t,e,r,n)=>{for(var i=n>1?void 0:n?AI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&OI(e,r,i),i};let ya=class extends $e{constructor(){super(),this.view=tt.state.view,this.prevView=tt.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=tt.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&rs(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return xe.getShadowRootElement(this,".w3m-router")}get contentEl(){return xe.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return oe`<w3m-connect-wallet-view></w3m-connect-wallet-view>`;case"SelectNetwork":return oe`<w3m-select-network-view></w3m-select-network-view>`;case"InjectedConnecting":return oe`<w3m-injected-connecting-view></w3m-injected-connecting-view>`;case"DesktopConnecting":return oe`<w3m-desktop-connecting-view></w3m-desktop-connecting-view>`;case"MobileConnecting":return oe`<w3m-mobile-connecting-view></w3m-mobile-connecting-view>`;case"WebConnecting":return oe`<w3m-web-connecting-view></w3m-web-connecting-view>`;case"MobileQrcodeConnecting":return oe`<w3m-mobile-qr-connecting-view></w3m-mobile-qr-connecting-view>`;case"GetWallet":return oe`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"WalletExplorer":return oe`<w3m-wallet-explorer-view></w3m-wallet-explorer-view>`;case"Qrcode":return oe`<w3m-qrcode-view></w3m-qrcode-view>`;case"Help":return oe`<w3m-help-view></w3m-help-view>`;case"Account":return oe`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return oe`<w3m-switch-network-view></w3m-switch-network-view>`;case"InstallWallet":return oe`<w3m-install-wallet-view></w3m-install-wallet-view>`;default:return oe`<div>Not Found</div>`}}async onChangeRoute(){await rs(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=tt.state.view,rs(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return oe`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};ya.styles=[Fe.globalCss,SI],If([gt()],ya.prototype,"view",2),If([gt()],ya.prototype,"prevView",2),ya=If([Ne("w3m-modal-router")],ya);const DI=Ve`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--w3m-notification-border-radius);border:1px solid var(--w3m-color-overlay);background-color:var(--w3m-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--w3m-color-bg-3)}}.w3m-success path{fill:var(--w3m-accent-color)}.w3m-error path{fill:var(--w3m-error-color)}`;var $I=Object.defineProperty,PI=Object.getOwnPropertyDescriptor,cm=(t,e,r,n)=>{for(var i=n>1?void 0:n?PI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&$I(e,r,i),i};let Vc=class extends $e{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=qr.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>qr.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),qr.closeToast()}render(){const{message:t,variant:e}=qr.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?oe`<div class="${Lr(r)}">${e==="success"?Le.CHECKMARK_ICON:null} ${e==="error"?Le.CROSS_ICON:null}<w3m-text variant="small-regular">${t}</w3m-text></div>`:null}};Vc.styles=[Fe.globalCss,DI],cm([gt()],Vc.prototype,"open",2),Vc=cm([Ne("w3m-modal-toast")],Vc);const TI=Ve`button{padding:5px;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px;position:relative}w3m-network-image{width:54px;height:59px}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;margin-top:5px}button:active{background-color:var(--w3m-color-overlay)}.w3m-unsupported{opacity:.3}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}`;var RI=Object.defineProperty,NI=Object.getOwnPropertyDescriptor,ba=(t,e,r,n)=>{for(var i=n>1?void 0:n?NI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&RI(e,r,i),i};let is=class extends $e{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.chainId="",this.unsupported=!1}render(){const t={"w3m-unsupported":this.unsupported};return oe`<button @click="${this.onClick}" class="${Lr(t)}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-regular">${this.name}</w3m-text></button>`}};is.styles=[Fe.globalCss,TI],ba([Oe()],is.prototype,"onClick",2),ba([Oe()],is.prototype,"name",2),ba([Oe()],is.prototype,"chainId",2),ba([Oe()],is.prototype,"unsupported",2),is=ba([Ne("w3m-network-button")],is);const LI=Ve`@keyframes loading{to{stroke-dashoffset:0}}:host{width:inherit;height:inherit;position:relative}path{stroke:var(--w3m-color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--w3m-color-bg-3)}#network-placeholder-dash{stroke:var(--w3m-color-overlay)}image{clip-path:path('M17.033 4.964c3.852-2.262 5.778-3.393 7.84-3.77a11.807 11.807 0 0 1 4.254 0c2.062.377 3.988 1.508 7.84 3.77l6.066 3.562c3.852 2.263 5.777 3.394 7.13 5.022a12.268 12.268 0 0 1 2.127 3.747c.71 2.006.71 4.268.71 8.793v7.124c0 4.525 0 6.787-.71 8.793a12.268 12.268 0 0 1-2.126 3.747c-1.354 1.628-3.28 2.76-7.131 5.022l-6.066 3.562c-3.852 2.262-5.778 3.393-7.84 3.771a11.814 11.814 0 0 1-4.254 0c-2.062-.378-3.988-1.509-7.84-3.77l-6.066-3.563c-3.852-2.263-5.778-3.394-7.13-5.022a12.268 12.268 0 0 1-2.127-3.747C1 40 1 37.737 1 33.212v-7.124c0-4.525 0-6.787.71-8.793a12.268 12.268 0 0 1 2.127-3.747c1.352-1.628 3.278-2.76 7.13-5.022l6.066-3.562Z')}`;var MI=Object.defineProperty,UI=Object.getOwnPropertyDescriptor,lm=(t,e,r,n)=>{for(var i=n>1?void 0:n?UI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&MI(e,r,i),i};let Kc=class extends $e{constructor(){super(...arguments),this.chainId=""}render(){const t=xe.getChainIcon(this.chainId);return t?oe`<svg width="54" height="59" viewBox="0 0 54 59" fill="none"><image href="${t}"/><image href="${t}" width="54" height="59"/><path d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z"/></svg>`:oe`${Le.NETWORK_PLACEHOLDER}`}};Kc.styles=[Fe.globalCss,LI],lm([Oe()],Kc.prototype,"chainId",2),Kc=lm([Ne("w3m-network-image")],Kc);const jI=.1,um=2.5,Qn=7;function Sf(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+jI}function FI(t,e){const r=Array.prototype.slice.call(da.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,o,c)=>(c%n===0?i.push([o]):i[i.length-1].push(o))&&i,[])}const BI={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",o=n==="light"?"#fff":"#141414",c=[],l=FI(t,"Q"),h=e/l.length,f=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];f.forEach(({x:j,y:H})=>{const Z=(l.length-Qn)*h*j,N=(l.length-Qn)*h*H,L=.32;for(let $=0;$<f.length;$+=1){const T=h*(Qn-$*2);c.push(ut`<rect fill="${$%2===0?i:o}" height="${T}" rx="${T*L}" ry="${T*L}" width="${T}" x="${Z+h*$}" y="${N+h*$}">`)}});const v=Math.floor((r+25)/h),E=l.length/2-v/2,_=l.length/2+v/2-1,S=[];l.forEach((j,H)=>{j.forEach((Z,N)=>{if(l[H][N]&&!(H<Qn&&N<Qn||H>l.length-(Qn+1)&&N<Qn||H<Qn&&N>l.length-(Qn+1))&&!(H>E&&H<_&&N>E&&N<_)){const L=H*h+h/2,$=N*h+h/2;S.push([L,$])}})});const P={};return S.forEach(([j,H])=>{P[j]?P[j].push(H):P[j]=[H]}),Object.entries(P).map(([j,H])=>{const Z=H.filter(N=>H.every(L=>!Sf(N,L,h)));return[Number(j),Z]}).forEach(([j,H])=>{H.forEach(Z=>{c.push(ut`<circle cx="${j}" cy="${Z}" fill="${i}" r="${h/um}">`)})}),Object.entries(P).filter(([j,H])=>H.length>1).map(([j,H])=>{const Z=H.filter(N=>H.some(L=>Sf(N,L,h)));return[Number(j),Z]}).map(([j,H])=>{H.sort((N,L)=>N<L?-1:1);const Z=[];for(const N of H){const L=Z.find($=>$.some(T=>Sf(N,T,h)));L?L.push(N):Z.push([N])}return[j,Z.map(N=>[N[0],N[N.length-1]])]}).forEach(([j,H])=>{H.forEach(([Z,N])=>{c.push(ut`<line x1="${j}" x2="${j}" y1="${Z}" y2="${N}" stroke="${i}" stroke-width="${h/(um/2)}" stroke-linecap="round">`)})}),c}},kI=Ve`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;width:100%;aspect-ratio:1/1;animation:fadeIn ease .2s}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:var(--w3m-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--w3m-accent-color)}svg:first-child path:last-child{stroke:var(--w3m-color-overlay)}`;var HI=Object.defineProperty,WI=Object.getOwnPropertyDescriptor,Ys=(t,e,r,n)=>{for(var i=n>1?void 0:n?WI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&HI(e,r,i),i};let Xn=class extends $e{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){var t;const e=(t=Mn.state.themeMode)!=null?t:"light";return ut`<svg height="${this.size}" width="${this.size}">${BI.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return oe`<div>${this.walletId||this.imageUrl?oe`<w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}" imageUrl="${this.imageUrl}"></w3m-wallet-image>`:Le.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}<w3m-theme-context></w3m-theme-context></div>`}};Xn.styles=[Fe.globalCss,kI],Ys([Oe()],Xn.prototype,"uri",2),Ys([Oe({type:Number})],Xn.prototype,"size",2),Ys([Oe()],Xn.prototype,"imageId",2),Ys([Oe()],Xn.prototype,"walletId",2),Ys([Oe()],Xn.prototype,"imageUrl",2),Xn=Ys([Ne("w3m-qrcode")],Xn);const zI=Ve`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--w3m-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--w3m-color-fg-1);background-color:var(--w3m-color-bg-3);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);caret-color:var(--w3m-accent-color)}input::placeholder{color:var(--w3m-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--w3m-accent-color)}path{fill:var(--w3m-color-fg-2)}`;var qI=Object.defineProperty,VI=Object.getOwnPropertyDescriptor,hm=(t,e,r,n)=>{for(var i=n>1?void 0:n?VI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&qI(e,r,i),i};let Gc=class extends $e{constructor(){super(...arguments),this.onChange=()=>null}render(){return oe`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Le.SEARCH_ICON}`}};Gc.styles=[Fe.globalCss,zI],hm([Oe()],Gc.prototype,"onChange",2),Gc=hm([Ne("w3m-search-input")],Gc);const KI=Ve`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--w3m-accent-color)}`;var GI=Object.defineProperty,ZI=Object.getOwnPropertyDescriptor,YI=(t,e,r,n)=>{for(var i=n>1?void 0:n?ZI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&GI(e,r,i),i};let Of=class extends $e{render(){return oe`<svg viewBox="0 0 50 50" width="24" height="24"><circle cx="25" cy="25" r="20" fill="none" stroke-width="4" stroke="#fff"/></svg>`}};Of.styles=[Fe.globalCss,KI],Of=YI([Ne("w3m-spinner")],Of);const JI=Ve`span{font-style:normal;font-family:var(--w3m-font-family);font-feature-settings:'tnum' on,'lnum' on,'case' on}.w3m-xsmall-bold{font-family:var(--w3m-text-xsmall-bold-font-family);font-weight:var(--w3m-text-xsmall-bold-weight);font-size:var(--w3m-text-xsmall-bold-size);line-height:var(--w3m-text-xsmall-bold-line-height);letter-spacing:var(--w3m-text-xsmall-bold-letter-spacing);text-transform:var(--w3m-text-xsmall-bold-text-transform)}.w3m-xsmall-regular{font-family:var(--w3m-text-xsmall-regular-font-family);font-weight:var(--w3m-text-xsmall-regular-weight);font-size:var(--w3m-text-xsmall-regular-size);line-height:var(--w3m-text-xsmall-regular-line-height);letter-spacing:var(--w3m-text-xsmall-regular-letter-spacing);text-transform:var(--w3m-text-xsmall-regular-text-transform)}.w3m-small-thin{font-family:var(--w3m-text-small-thin-font-family);font-weight:var(--w3m-text-small-thin-weight);font-size:var(--w3m-text-small-thin-size);line-height:var(--w3m-text-small-thin-line-height);letter-spacing:var(--w3m-text-small-thin-letter-spacing);text-transform:var(--w3m-text-small-thin-text-transform)}.w3m-small-regular{font-family:var(--w3m-text-small-regular-font-family);font-weight:var(--w3m-text-small-regular-weight);font-size:var(--w3m-text-small-regular-size);line-height:var(--w3m-text-small-regular-line-height);letter-spacing:var(--w3m-text-small-regular-letter-spacing);text-transform:var(--w3m-text-small-regular-text-transform)}.w3m-medium-regular{font-family:var(--w3m-text-medium-regular-font-family);font-weight:var(--w3m-text-medium-regular-weight);font-size:var(--w3m-text-medium-regular-size);line-height:var(--w3m-text-medium-regular-line-height);letter-spacing:var(--w3m-text-medium-regular-letter-spacing);text-transform:var(--w3m-text-medium-regular-text-transform)}.w3m-big-bold{font-family:var(--w3m-text-big-bold-font-family);font-weight:var(--w3m-text-big-bold-weight);font-size:var(--w3m-text-big-bold-size);line-height:var(--w3m-text-big-bold-line-height);letter-spacing:var(--w3m-text-big-bold-letter-spacing);text-transform:var(--w3m-text-big-bold-text-transform)}:host(*){color:var(--w3m-color-fg-1)}.w3m-color-primary{color:var(--w3m-color-fg-1)}.w3m-color-secondary{color:var(--w3m-color-fg-2)}.w3m-color-tertiary{color:var(--w3m-color-fg-3)}.w3m-color-inverse{color:var(--w3m-accent-fill-color)}.w3m-color-accnt{color:var(--w3m-accent-color)}.w3m-color-error{color:var(--w3m-error-color)}`;var QI=Object.defineProperty,XI=Object.getOwnPropertyDescriptor,Af=(t,e,r,n)=>{for(var i=n>1?void 0:n?XI(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&QI(e,r,i),i};let _a=class extends $e{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"w3m-big-bold":this.variant==="big-bold","w3m-medium-regular":this.variant==="medium-regular","w3m-small-regular":this.variant==="small-regular","w3m-small-thin":this.variant==="small-thin","w3m-xsmall-regular":this.variant==="xsmall-regular","w3m-xsmall-bold":this.variant==="xsmall-bold","w3m-color-primary":this.color==="primary","w3m-color-secondary":this.color==="secondary","w3m-color-tertiary":this.color==="tertiary","w3m-color-inverse":this.color==="inverse","w3m-color-accnt":this.color==="accent","w3m-color-error":this.color==="error"};return oe`<span><slot class="${Lr(t)}"></slot></span>`}};_a.styles=[Fe.globalCss,JI],Af([Oe()],_a.prototype,"variant",2),Af([Oe()],_a.prototype,"color",2),_a=Af([Ne("w3m-text")],_a);const eS=Ve`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:50%;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--w3m-color-bg-3)}#token-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var tS=Object.defineProperty,rS=Object.getOwnPropertyDescriptor,fm=(t,e,r,n)=>{for(var i=n>1?void 0:n?rS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&tS(e,r,i),i};let Zc=class extends $e{constructor(){super(...arguments),this.symbol=void 0}render(){var t;const e=xe.getTokenIcon((t=this.symbol)!=null?t:"");return e?oe`<div><img src="${e}" alt="${this.id}"></div>`:Le.TOKEN_PLACEHOLDER}};Zc.styles=[Fe.globalCss,eS],fm([Oe()],Zc.prototype,"symbol",2),Zc=fm([Ne("w3m-token-image")],Zc);const nS=Ve`button{width:100%;height:100%;border-radius:var(--w3m-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--w3m-wallet-icon-border-radius);margin-bottom:5px}.w3m-sublabel{margin-top:2px}`;var iS=Object.defineProperty,sS=Object.getOwnPropertyDescriptor,Si=(t,e,r,n)=>{for(var i=n>1?void 0:n?sS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&iS(e,r,i),i};let jn=class extends $e{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?oe`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">RECENT</w3m-text>`:this.installed?oe`<w3m-text class="w3m-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</w3m-text>`:null}handleClick(){yi.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return oe`<button @click="${this.handleClick.bind(this)}"><div><w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}"></w3m-wallet-image><w3m-text variant="xsmall-regular">${(t=this.label)!=null?t:xe.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};jn.styles=[Fe.globalCss,nS],Si([Oe()],jn.prototype,"onClick",2),Si([Oe()],jn.prototype,"name",2),Si([Oe()],jn.prototype,"walletId",2),Si([Oe()],jn.prototype,"label",2),Si([Oe()],jn.prototype,"imageId",2),Si([Oe()],jn.prototype,"installed",2),Si([Oe()],jn.prototype,"recent",2),jn=Si([Ne("w3m-wallet-button")],jn);const oS=Ve`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--w3m-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--w3m-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var aS=Object.defineProperty,cS=Object.getOwnPropertyDescriptor,Yc=(t,e,r,n)=>{for(var i=n>1?void 0:n?cS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&aS(e,r,i),i};let Js=class extends $e{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;const e=(t=this.imageUrl)!=null&&t.length?this.imageUrl:xe.getWalletIcon({id:this.walletId,image_id:this.imageId});return oe`${e.length?oe`<div><img src="${e}" alt="${this.id}"></div>`:Le.WALLET_PLACEHOLDER}`}};Js.styles=[Fe.globalCss,oS],Yc([Oe()],Js.prototype,"walletId",2),Yc([Oe()],Js.prototype,"imageId",2),Yc([Oe()],Js.prototype,"imageUrl",2),Js=Yc([Ne("w3m-wallet-image")],Js);var lS=Object.defineProperty,uS=Object.getOwnPropertyDescriptor,hS=(t,e,r,n)=>{for(var i=n>1?void 0:n?uS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&lS(e,r,i),i};let dm=class extends $e{constructor(){super(),this.unwatchAccount=void 0,Et.getAccount(),this.fetchProfile(),this.fetchBalance(),this.unwatchAccount=Lt.client().watchAccount(t=>{const{address:e,isConnected:r}=Et.state;t.isConnected&&t.address!==e&&(this.fetchProfile(t.address),this.fetchBalance(t.address),Et.setAddress(t.address)),t.isConnected||Et.resetAccount(),r!==t.isConnected&&Nr.close(),!r&&t.isConnected?yi.track({name:"ACCOUNT_CONNECTED"}):r&&!t.isConnected&&yi.track({name:"ACCOUNT_DISCONNECTED"}),Et.setIsConnected(t.isConnected)})}disconnectedCallback(){var t;(t=this.unwatchAccount)==null||t.call(this)}async fetchProfile(t){var e;const r=(e=De.state.chains)==null?void 0:e.find(n=>n.id===1);if(Ft.state.enableAccountView&&r)try{await Et.fetchProfile(xe.preloadImage,t)}catch(n){console.error(n),qr.openToast(xe.getErrorMessage(n),"error")}}async fetchBalance(t){if(Ft.state.enableAccountView)try{await Et.fetchBalance(t)}catch(e){console.error(e),qr.openToast(xe.getErrorMessage(e),"error")}}};dm=hS([Ne("w3m-account-context")],dm);var fS=Object.defineProperty,dS=Object.getOwnPropertyDescriptor,pm=(t,e,r,n)=>{for(var i=n>1?void 0:n?dS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&fS(e,r,i),i};let Df=class extends $e{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>xe.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){var t;if(Ft.state.enableExplorer){const{chains:e}=De.state;await Promise.all([rr.getRecomendedWallets(),rr.getInjectedWallets()]),De.setIsDataLoaded(!0);const{recomendedWallets:r}=rr.state,n=en.installedInjectedWallets(),i=(t=e?.map(l=>xe.getChainIcon(l.id)))!=null?t:[],o=r.map(l=>xe.getWalletIcon(l)),c=n.map(l=>xe.getWalletIcon(l));await this.loadImages([...i,...o,...c])}else De.setIsDataLoaded(!0)}async preloadCustomImages(){const t=xe.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),qr.openToast("Failed preloading","error")}}};pm([gt()],Df.prototype,"preload",2),Df=pm([Ne("w3m-explorer-context")],Df);var pS=Object.defineProperty,gS=Object.getOwnPropertyDescriptor,gm=(t,e,r,n)=>{for(var i=n>1?void 0:n?gS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&pS(e,r,i),i};let $f=class extends $e{constructor(){super(),this.activeChainId=void 0,this.unwatchNetwork=void 0;const t=De.getSelectedChain();this.activeChainId=t?.id,this.unwatchNetwork=Lt.client().watchNetwork(e=>{const r=e.chain;r&&this.activeChainId!==r.id&&(De.setSelectedChain(r),this.activeChainId=r.id,Et.resetBalance(),this.fetchBalance())})}disconnectedCallback(){var t;(t=this.unwatchNetwork)==null||t.call(this)}async fetchBalance(){if(Ft.state.enableAccountView)try{await Et.fetchBalance()}catch(t){console.error(t),qr.openToast(xe.getErrorMessage(t),"error")}}};gm([gt()],$f.prototype,"activeChainId",2),$f=gm([Ne("w3m-network-context")],$f);var mS=Object.defineProperty,wS=Object.getOwnPropertyDescriptor,vS=(t,e,r,n)=>{for(var i=n>1?void 0:n?wS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&mS(e,r,i),i};let mm=class extends $e{constructor(){super(),this.unsubscribeTheme=void 0,Fe.setTheme(),this.unsubscribeTheme=Mn.subscribe(Fe.setTheme),this.preloadThemeImages()}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}async preloadThemeImages(){try{const{themeVariables:t}=Mn.state,e=[t?.["--w3m-background-image-url"],t?.["--w3m-logo-image-url"]].filter(Boolean);e.length&&await Promise.all(e.map(async r=>xe.preloadImage(r)))}catch{console.info("Unsuccessful attempt at preloading some images")}}};mm=vS([Ne("w3m-theme-context")],mm);var yS=Object.defineProperty,bS=Object.getOwnPropertyDescriptor,_S=(t,e,r,n)=>{for(var i=n>1?void 0:n?bS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&yS(e,r,i),i};const ES=24e4,xS=1e3;var wm;let vm=class extends $e{constructor(){super(),this.unwatchOptions=void 0,this.unwatchAccount=void 0,this.timeout=void 0,this.isGenerated=!1,this.selectedChainId=(wm=De.state.selectedChain)==null?void 0:wm.id,this.isAccountConnected=Et.state.isConnected,this.lastRetry=Date.now(),this.unwatchOptions=De.subscribe(t=>{var e,r;((e=t.selectedChain)==null?void 0:e.id)!==this.selectedChainId&&(this.selectedChainId=(r=t.selectedChain)==null?void 0:r.id,this.connectAndWait())}),this.unwatchAccount=Et.subscribe(t=>{(this.isAccountConnected!==t.isConnected||!this.isGenerated)&&(this.isAccountConnected=t.isConnected,setTimeout(this.connectAndWait.bind(this),0))})}disconnectedCallback(){var t,e;(t=this.unwatchOptions)==null||t.call(this),(e=this.unwatchAccount)==null||e.call(this)}async connectAndWait(){if(clearTimeout(this.timeout),!this.isAccountConnected){this.isGenerated=!0,this.timeout=setTimeout(this.connectAndWait.bind(this),ES);try{const{standaloneUri:t,selectedChain:e}=De.state;t?ur.setPairingUri(t):await Lt.client().connectWalletConnect(r=>ur.setPairingUri(r),e?.id)}catch(t){console.error(t),ur.setPairingError(!0),qr.openToast("Connection request declined","error"),Date.now()-this.lastRetry>=xS&&(this.lastRetry=Date.now(),this.connectAndWait())}}}};vm=_S([Ne("w3m-wc-connection-context")],vm);const CS=Ve`:host{all:initial}div{display:flex;align-items:center;background-color:var(--w3m-color-overlay);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);border-radius:var(--w3m-button-border-radius);padding:4px 4px 4px 8px}div button{border-radius:var(--w3m-secondary-button-border-radius);padding:4px 8px;padding-left:4px;height:auto;margin-left:10px;color:var(--w3m-accent-fill-color);background-color:var(--w3m-accent-color)}.w3m-no-avatar{padding-left:8px}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--w3m-color-overlay)}button:hover::after{background-color:var(--w3m-color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`;var IS=Object.defineProperty,SS=Object.getOwnPropertyDescriptor,Pf=(t,e,r,n)=>{for(var i=n>1?void 0:n?SS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&IS(e,r,i),i};let Qs=class extends $e{constructor(){super(),this.balance="hide",this.avatar="show",xe.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=De.state;t||(yi.click({name:"ACCOUNT_BUTTON"}),Nr.open({route:"Account"}))}accountTemplate(){const t=this.avatar==="show";return oe`${t?oe`<w3m-avatar></w3m-avatar>`:null}<w3m-address-text></w3m-address-text>`}render(){const t=this.balance==="show",e={"w3m-no-avatar":this.avatar==="hide"};return t?oe`<div><w3m-balance></w3m-balance><button @click="${this.onOpen}" class="${Lr(e)}">${this.accountTemplate()}</button></div>`:oe`<w3m-button-big @click="${this.onOpen}">${this.accountTemplate()}</w3m-button-big>`}};Qs.styles=[Fe.globalCss,CS],Pf([Oe()],Qs.prototype,"balance",2),Pf([Oe()],Qs.prototype,"avatar",2),Qs=Pf([Ne("w3m-account-button")],Qs);const OS=Ve`button{display:flex;border-radius:var(--w3m-button-hover-highlight-border-radius);flex-direction:column;justify-content:center;padding:5px;width:100px}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`;var AS=Object.defineProperty,DS=Object.getOwnPropertyDescriptor,Tf=(t,e,r,n)=>{for(var i=n>1?void 0:n?DS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&AS(e,r,i),i};let Ea=class extends $e{constructor(){super(),this.chainId=0,this.label="",this.unsubscribeNetwork=void 0;const{selectedChain:t}=De.state;this.chainId=t?.id,this.label=t?.name,this.unsubscribeNetwork=De.subscribe(({selectedChain:e})=>{this.chainId=e?.id,this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){tt.push("SelectNetwork")}render(){const{chains:t,selectedChain:e}=De.state,r=t?.map(o=>o.id),n=e&&r?.includes(e.id),i=t&&t.length<=1&&n;return oe`<button @click="${this.onClick}" ?disabled="${i}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-regular" color="accent">${this.label}</w3m-text></button>`}};Ea.styles=[Fe.globalCss,OS],Tf([gt()],Ea.prototype,"chainId",2),Tf([gt()],Ea.prototype,"label",2),Ea=Tf([Ne("w3m-account-network-button")],Ea);const $S=Ve`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--w3m-color-fg-1) 36.33%,var(--w3m-color-fg-3) 42.07%,var(--w3m-color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`;var PS=Object.defineProperty,TS=Object.getOwnPropertyDescriptor,xa=(t,e,r,n)=>{for(var i=n>1?void 0:n?TS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&PS(e,r,i),i};let ss=class extends $e{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=Et.state.address,this.name=Et.state.profileName,this.loading=!!Et.state.profileLoading,this.unsubscribeAccount=Et.subscribe(({address:t,profileName:e,profileLoading:r})=>{this.address=t,this.name=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){var t;const e=this.variant==="button",r={"w3m-loading":this.loading};return oe`<w3m-text class="${Lr(r)}" variant="${e?"medium-regular":"big-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:xe.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};ss.styles=[Fe.globalCss,$S],xa([gt()],ss.prototype,"address",2),xa([gt()],ss.prototype,"name",2),xa([gt()],ss.prototype,"loading",2),xa([Oe()],ss.prototype,"variant",2),ss=xa([Ne("w3m-address-text")],ss);const Mr={onConnecting(t){xe.goToConnectingView(t)},onExternal(t){xe.handleConnectorConnection(t)},manualWalletsTemplate(){return en.manualWallets().map(t=>oe`<w3m-wallet-button walletId="${t.id}" name="${t.name}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)},recomendedWalletsTemplate(t=!1){return en.recomendedWallets(t).map(e=>oe`<w3m-wallet-button walletId="${e.id}" imageId="${e.image_id}" name="${e.name}" .onClick="${()=>this.onConnecting(e)}"></w3m-wallet-button>`)},externalWalletsTemplate(){return en.externalWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${()=>this.onExternal(t.id)}"></w3m-wallet-button>`)},recentWalletTemplate(){const t=en.recentWallet();if(t)return oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .recent="${!0}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`},installedInjectedWalletsTemplate(){return en.installedInjectedWallets().map(t=>oe`<w3m-wallet-button .installed="${!0}" name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)},injectedWalletsTemplate(){return en.injectedWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)}},RS=Ve`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.w3m-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.w3m-track svg{margin:0 5px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--w3m-wallet-icon-border-radius)}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-title{display:flex;align-items:center;margin-bottom:10px}.w3m-title svg{margin-right:6px}.w3m-title path{fill:var(--w3m-accent-color)}w3m-modal-footer .w3m-title{padding:0 10px}w3m-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--w3m-color-bg-1))}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var NS=Object.defineProperty,LS=Object.getOwnPropertyDescriptor,MS=(t,e,r,n)=>{for(var i=n>1?void 0:n?LS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&NS(e,r,i),i};let Rf=class extends $e{onGoToQrcode(){tt.push("Qrcode")}onGetWallet(){tt.push("GetWallet")}render(){const{recomendedWallets:t}=rr.state,e=[...t,...t],r=Mr.externalWalletsTemplate(),n=Mr.installedInjectedWalletsTemplate(),i=[...n,...r].length>0,o=Se.RECOMMENDED_WALLET_AMOUNT*2;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Le.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-title">${Le.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">WalletConnect</w3m-text></div><div class="w3m-slider"><div class="w3m-track">${[...Array(o)].map((c,l)=>{const h=e[l%e.length];return h?oe`<w3m-wallet-image walletId="${h.id}" imageId="${h.image_id}"></w3m-wallet-image>`:Le.WALLET_PLACEHOLDER})}</div><w3m-button-big @click="${xe.handleAndroidLinking}"><w3m-text variant="medium-regular" color="inverse">Select Wallet</w3m-text></w3m-button-big></div></w3m-modal-content>${i?oe`<w3m-modal-footer><div class="w3m-title">${Le.WALLET_ICON}<w3m-text variant="small-regular" color="accent">Other</w3m-text></div><div class="w3m-grid">${n} ${r}</div></w3m-modal-footer>`:null}<w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Choose WalletConnect to see supported apps on your device${i?", or select from other options":""}`}</w3m-text><w3m-button variant="outline" .iconRight="${Le.ARROW_UP_RIGHT_ICON}" .onClick="${()=>this.onGetWallet()}">I don't have a wallet</w3m-button></w3m-info-footer>`}};Rf.styles=[Fe.globalCss,RS],Rf=MS([Ne("w3m-android-wallet-selection")],Rf);const US=Ve`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--w3m-color-av-1);background-image:radial-gradient(at 66% 77%,var(--w3m-color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--w3m-color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--w3m-color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--w3m-color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`;var jS=Object.defineProperty,FS=Object.getOwnPropertyDescriptor,Ca=(t,e,r,n)=>{for(var i=n>1?void 0:n?FS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&jS(e,r,i),i};let os=class extends $e{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=Et.state.address,this.avatar=Et.state.profileAvatar,this.loading=!!Et.state.profileLoading,this.unsubscribeAccount=Et.subscribe(({address:t,profileAvatar:e,profileLoading:r})=>{this.address=t,this.avatar=e,this.loading=!!r})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const t={"w3m-placeholder":!0,"w3m-small":this.size==="small","w3m-medium":this.size==="medium"};return this.avatar?oe`<img class="${Lr(t)}" src="${this.avatar}">`:this.address?(xe.generateAvatarColors(this.address),oe`<div class="${Lr(t)}">${this.loading?oe`<div class="w3m-loader"></div>`:null}</div>`):null}};os.styles=[Fe.globalCss,US],Ca([gt()],os.prototype,"address",2),Ca([gt()],os.prototype,"avatar",2),Ca([gt()],os.prototype,"loading",2),Ca([Oe()],os.prototype,"size",2),os=Ca([Ne("w3m-avatar")],os);const BS=Ve`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var kS=Object.defineProperty,HS=Object.getOwnPropertyDescriptor,Nf=(t,e,r,n)=>{for(var i=n>1?void 0:n?HS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&kS(e,r,i),i};let Ia=class extends $e{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=Et.state.balance)==null?void 0:t.symbol,this.amount=(e=Et.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=Et.subscribe(({balance:r})=>{this.symbol=r?.symbol,this.amount=r?.amount})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){let t="_._";return this.amount==="0.0"?t="0":typeof this.amount=="string"&&this.amount.length>6?t=this.amount.substring(0,6):typeof this.amount=="string"&&(t=this.amount),oe`<div><w3m-token-image symbol="${this.symbol}"></w3m-token-image><w3m-text variant="medium-regular" color="primary">${t} ${this.symbol}</w3m-text></div>`}};Ia.styles=[Fe.globalCss,BS],Nf([gt()],Ia.prototype,"symbol",2),Nf([gt()],Ia.prototype,"amount",2),Ia=Nf([Ne("w3m-balance")],Ia);const WS=Ve`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--w3m-accent-fill-color)}button:disabled svg path{fill:var(--w3m-color-fg-3)}w3m-spinner{margin:0 10px 0 0}`;var zS=Object.defineProperty,qS=Object.getOwnPropertyDescriptor,Jc=(t,e,r,n)=>{for(var i=n>1?void 0:n?qS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&zS(e,r,i),i};let as=class extends $e{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,xe.rejectStandaloneButtonComponent(),this.modalUnsub=Nr.subscribe(t=>{t.open&&(this.loading=!0),t.open||(this.loading=!1)})}disconnectedCallback(){var t;(t=this.modalUnsub)==null||t.call(this)}iconTemplate(){return this.icon==="show"?Le.WALLET_CONNECT_ICON:null}onClick(){Et.state.isConnected?this.onDisconnect():this.onConnect()}async onConnect(){this.loading=!0,yi.click({name:"CONNECT_BUTTON"}),await Nr.open(),Nr.state.open||(this.loading=!1)}async onDisconnect(){yi.click({name:"DISCONNECT_BUTTON"}),await Lt.client().disconnect()}render(){return oe`<w3m-button-big .disabled="${this.loading}" @click="${this.onClick}">${this.loading?oe`<w3m-spinner></w3m-spinner><w3m-text variant="medium-regular" color="accent">Connecting...</w3m-text>`:oe`${this.iconTemplate()}<w3m-text variant="medium-regular" color="inverse">${this.label}</w3m-text>`}</w3m-button-big>`}};as.styles=[Fe.globalCss,WS],Jc([gt()],as.prototype,"loading",2),Jc([Oe()],as.prototype,"label",2),Jc([Oe()],as.prototype,"icon",2),as=Jc([Ne("w3m-connect-button")],as);const VS=Ve`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:90px;height:90px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.w3m-stale svg,.w3m-stale use{display:none}`;var KS=Object.defineProperty,GS=Object.getOwnPropertyDescriptor,Xs=(t,e,r,n)=>{for(var i=n>1?void 0:n?GS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&KS(e,r,i),i};let Oi=class extends $e{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;const r=(e=(t=Mn.state.themeVariables)==null?void 0:t["--w3m-wallet-icon-large-border-radius"])!=null?e:Fe.getPreset("--w3m-wallet-icon-large-border-radius");let n=0;r.includes("%")?n=88/100*parseInt(r,10):n=parseInt(r,10),n*=1.17;const i=317-n*1.57,o=425-n*1.8;return oe`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="w3m-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#w3m-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${o}"></use></svg>`}render(){const t={"w3m-error":this.isError,"w3m-stale":this.isStale};return oe`<div class="${Lr(t)}">${this.svgLoaderTemplate()}<w3m-wallet-image walletId="${this.walletId}" imageId="${this.imageId}"></w3m-wallet-image></div><w3m-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</w3m-text>`}};Oi.styles=[Fe.globalCss,VS],Xs([Oe()],Oi.prototype,"walletId",2),Xs([Oe()],Oi.prototype,"imageId",2),Xs([Oe()],Oi.prototype,"isError",2),Xs([Oe()],Oi.prototype,"isStale",2),Xs([Oe()],Oi.prototype,"label",2),Oi=Xs([Ne("w3m-connector-waiting")],Oi);var ZS=Object.defineProperty,YS=Object.getOwnPropertyDescriptor,eo=(t,e,r,n)=>{for(var i=n>1?void 0:n?YS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&ZS(e,r,i),i};let Ai=class extends $e{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.avatar="show",this.balance="hide",this.unsubscribeAccount=void 0,xe.rejectStandaloneButtonComponent(),this.isConnected=Et.state.isConnected,this.unsubscribeAccount=Et.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){const{enableAccountView:t}=Ft.state,e=this.balance,r=this.label,n=this.icon,i=this.avatar;return this.isConnected&&t?oe`<w3m-account-button balance="${e}" avatar="${i}"></w3m-account-button>`:oe`<w3m-connect-button label="${this.isConnected?"Disconnect":r}" icon="${n}"></w3m-connect-button>`}};eo([gt()],Ai.prototype,"isConnected",2),eo([Oe()],Ai.prototype,"label",2),eo([Oe()],Ai.prototype,"icon",2),eo([Oe()],Ai.prototype,"avatar",2),eo([Oe()],Ai.prototype,"balance",2),Ai=eo([Ne("w3m-core-button")],Ai);const JS=Ve`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--w3m-color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--w3m-accent-color)}`;var QS=Object.defineProperty,XS=Object.getOwnPropertyDescriptor,eO=(t,e,r,n)=>{for(var i=n>1?void 0:n?XS(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&QS(e,r,i),i};let Lf=class extends $e{render(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,enableExplorer:r}=Ft.state,n=e!=="ALL"&&r,i=Mr.manualWalletsTemplate(),o=Mr.recomendedWalletsTemplate(),c=Mr.externalWalletsTemplate(),l=Mr.recentWalletTemplate(),h=Mr.installedInjectedWalletsTemplate();let f=[l,...i,...o];t||(f=[...h,l,...c,...i,...o]),f=f.filter(Boolean);const v=f.length>4||n;let E=[];v?E=f.slice(0,3):E=f;const _=!!E.length;return oe`<w3m-modal-header .border="${!0}" title="Connect your wallet" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${Le.MOBILE_ICON}<w3m-text variant="small-regular" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${Le.SCAN_ICON}<w3m-text variant="small-regular" color="secondary">Scan with your wallet</w3m-text></div></div><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>${_?oe`<w3m-modal-footer><div class="w3m-desktop-title">${Le.DESKTOP_ICON}<w3m-text variant="small-regular" color="accent">Desktop</w3m-text></div><div class="w3m-grid">${E} ${v?oe`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};Lf.styles=[Fe.globalCss,JS],Lf=eO([Ne("w3m-desktop-wallet-selection")],Lf);const tO=Ve`div{background-color:var(--w3m-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--w3m-color-bg-3);text-align:center}a{color:var(--w3m-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var rO=Object.defineProperty,nO=Object.getOwnPropertyDescriptor,iO=(t,e,r,n)=>{for(var i=n>1?void 0:n?nO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&rO(e,r,i),i};let Mf=class extends $e{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=Ft.state;return t??e?oe`<div><w3m-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${t?oe`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?oe`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</w3m-text></div>`:null}};Mf.styles=[Fe.globalCss,tO],Mf=iO([Ne("w3m-legal-notice")],Mf);const sO=Ve`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var oO=Object.defineProperty,aO=Object.getOwnPropertyDescriptor,cO=(t,e,r,n)=>{for(var i=n>1?void 0:n?aO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&oO(e,r,i),i};let Uf=class extends $e{onQrcode(){tt.push("Qrcode")}render(){const{isStandalone:t}=De.state,{explorerExcludedWalletIds:e,enableExplorer:r}=Ft.state,n=e!=="ALL"&&r,i=Mr.manualWalletsTemplate(),o=Mr.recomendedWalletsTemplate(),c=Mr.externalWalletsTemplate(),l=Mr.recentWalletTemplate(),h=Mr.installedInjectedWalletsTemplate();let f=[l,...i,...o];t||(f=[...h,l,...c,...i,...o]),f=f.filter(Boolean);const v=f.length>8||n;let E=[];v?E=f.slice(0,7):E=f;const _=!!E.length;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Le.QRCODE_ICON}"></w3m-modal-header>${_?oe`<w3m-modal-content><div>${E} ${v?oe`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-content>`:null}`}};Uf.styles=[Fe.globalCss,sO],Uf=cO([Ne("w3m-mobile-wallet-selection")],Uf);const lO=Ve`:host{all:initial}.w3m-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--w3m-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3);opacity:0;pointer-events:none}@media(max-height:720px) and (orientation:landscape){.w3m-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.w3m-active{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) var(--w3m-container-border-radius) var(--w3m-container-border-radius);border:1px solid var(--w3m-color-overlay);overflow:hidden}.w3m-card{width:100%;position:relative;border-radius:var(--w3m-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--w3m-color-overlay);background-color:var(--w3m-color-bg-1);color:var(--w3m-color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px;border-radius:var(--w3m-background-border-radius) var(--w3m-background-border-radius) 0 0}.w3m-card{border-radius:var(--w3m-container-border-radius) var(--w3m-container-border-radius) 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:440px){.w3m-container{border:0}}`;var uO=Object.defineProperty,hO=Object.getOwnPropertyDescriptor,jf=(t,e,r,n)=>{for(var i=n>1?void 0:n?hO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&uO(e,r,i),i};let to=class extends $e{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Nr.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return xe.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return xe.getShadowRootElement(this,".w3m-container")}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("w3m-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="w3m-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(t){t.target===t.currentTarget&&Nr.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=xe.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,r=.2;await Promise.all([rs(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,rs(this.containerEl,t,{delay:e,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=xe.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([rs(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,rs(this.containerEl,t,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?Nr.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("W3M-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}managedModalContextTemplate(){const{isStandalone:t}=De.state;return t?null:oe`<w3m-wc-connection-context></w3m-wc-connection-context><w3m-account-context></w3m-account-context><w3m-network-context></w3m-network-context>`}render(){const t={"w3m-overlay":!0,"w3m-active":this.active};return oe`<w3m-explorer-context></w3m-explorer-context><w3m-theme-context></w3m-theme-context>${this.managedModalContextTemplate()}<div id="w3m-modal" class="${Lr(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="w3m-container" tabindex="0">${this.open?oe`<w3m-modal-backcard></w3m-modal-backcard><div class="w3m-card"><w3m-modal-router></w3m-modal-router><w3m-modal-toast></w3m-modal-toast></div>`:null}</div></div>`}};to.styles=[Fe.globalCss,lO],jf([gt()],to.prototype,"open",2),jf([gt()],to.prototype,"active",2),to=jf([Ne("w3m-modal")],to);const fO=Ve`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var dO=Object.defineProperty,pO=Object.getOwnPropertyDescriptor,Qc=(t,e,r,n)=>{for(var i=n>1?void 0:n?pO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&dO(e,r,i),i};let cs=class extends $e{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,xe.rejectStandaloneButtonComponent();const{selectedChain:t}=De.state;this.onSetChainData(t),this.unsubscribeNetwork=De.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){const{chains:e}=De.state,r=e?.map(n=>n.id);this.chainId=t.id.toString(),this.wrongNetwork=!(r!=null&&r.includes(t.id)),this.label=this.wrongNetwork?"Wrong Network":t.name}}onClick(){yi.click({name:"NETWORK_BUTTON"}),Nr.open({route:"SelectNetwork"})}render(){var t;const{chains:e}=De.state,r=e&&e.length>1;return oe`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="medium-regular" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};cs.styles=[Fe.globalCss,fO],Qc([gt()],cs.prototype,"chainId",2),Qc([gt()],cs.prototype,"label",2),Qc([gt()],cs.prototype,"wrongNetwork",2),cs=Qc([Ne("w3m-network-switch")],cs);const gO=Ve`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:1px;top:0;left:0}use{stroke:var(--w3m-accent-color);animation:loading 1s linear infinite}w3m-network-image{width:92px;height:92px}w3m-text{margin-bottom:40px}.w3m-error svg{stroke:var(--w3m-error-color)}.w3m-error use{display:none}.w3m-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}`;var mO=Object.defineProperty,wO=Object.getOwnPropertyDescriptor,Xc=(t,e,r,n)=>{for(var i=n>1?void 0:n?wO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&mO(e,r,i),i};let ro=class extends $e{constructor(){super(...arguments),this.chainId=void 0,this.isError=!1,this.label=""}svgLoaderTemplate(){return oe`<svg width="54" height="59" viewBox="0 0 54 59" fill="none" class="w3m-loader"><path id="w3m-loader-path" d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z"/><use xlink:href="#w3m-loader-path" stroke-dasharray="54 118" stroke-dashoffset="172"></use></svg>`}render(){const t={"w3m-error":this.isError};return oe`<div class="${Lr(t)}">${this.svgLoaderTemplate()}<w3m-network-image chainId="${this.chainId}"></w3m-network-image></div><w3m-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Switch declined":this.label}</w3m-text>`}};ro.styles=[Fe.globalCss,gO],Xc([Oe()],ro.prototype,"chainId",2),Xc([Oe()],ro.prototype,"isError",2),Xc([Oe()],ro.prototype,"label",2),ro=Xc([Ne("w3m-network-waiting")],ro);const vO=Ve`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}w3m-button{margin:0 5px}`;var yO=Object.defineProperty,bO=Object.getOwnPropertyDescriptor,ls=(t,e,r,n)=>{for(var i=n>1?void 0:n?bO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&yO(e,r,i),i};let ei=class extends $e{constructor(){super(...arguments),this.isMobile=!1,this.isInjected=!1,this.isInjectedInstalled=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){Se.isMobile()?tt.replace("MobileConnecting"):tt.replace("MobileQrcodeConnecting")}onInjected(){this.isInjectedInstalled?tt.replace("InjectedConnecting"):tt.replace("InstallWallet")}onDesktop(){tt.replace("DesktopConnecting")}onWeb(){tt.replace("WebConnecting")}render(){const{isStandalone:t}=De.state;return oe`<div>${this.isRetry?oe`<slot></slot>`:null} ${this.isMobile?oe`<w3m-button .onClick="${this.onMobile}" .iconLeft="${Le.MOBILE_ICON}" variant="outline">Mobile</w3m-button>`:null} ${this.isInjected&&!t?oe`<w3m-button .onClick="${this.onInjected}" .iconLeft="${Le.WALLET_ICON}" variant="outline">Browser</w3m-button>`:null} ${this.isDesktop?oe`<w3m-button .onClick="${this.onDesktop}" .iconLeft="${Le.DESKTOP_ICON}" variant="outline">Desktop</w3m-button>`:null} ${this.isWeb?oe`<w3m-button .onClick="${this.onWeb}" .iconLeft="${Le.GLOBE_ICON}" variant="outline">Web</w3m-button>`:null}</div>`}};ei.styles=[Fe.globalCss,vO],ls([Oe()],ei.prototype,"isMobile",2),ls([Oe()],ei.prototype,"isInjected",2),ls([Oe()],ei.prototype,"isInjectedInstalled",2),ls([Oe()],ei.prototype,"isDesktop",2),ls([Oe()],ei.prototype,"isWeb",2),ls([Oe()],ei.prototype,"isRetry",2),ei=ls([Ne("w3m-platform-selection")],ei);const _O=Ve`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--w3m-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--w3m-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay)}button:active{background-color:var(--w3m-color-overlay)}@media(hover:hover){button:hover{background-color:var(--w3m-color-overlay)}}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--w3m-wallet-icon-border-radius)/ 2);border:1px solid var(--w3m-color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--w3m-color-bg-3)}#wallet-placeholder-dash{stroke:var(--w3m-color-overlay)}`;var EO=Object.defineProperty,xO=Object.getOwnPropertyDescriptor,CO=(t,e,r,n)=>{for(var i=n>1?void 0:n?xO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&EO(e,r,i),i};let Ff=class extends $e{onClick(){tt.push("WalletExplorer")}render(){const{recomendedWallets:t}=rr.state,e=en.manualWallets(),r=[...t,...e].reverse().slice(0,4);return oe`<button @click="${this.onClick}"><div class="w3m-icons">${r.map(n=>{const i=xe.getWalletIcon(n);if(i)return oe`<img src="${i}">`;const o=xe.getWalletIcon({id:n.id});return o?oe`<img src="${o}">`:Le.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>Le.WALLET_PLACEHOLDER)}</div><w3m-text variant="xsmall-regular">View All</w3m-text></button>`}};Ff.styles=[Fe.globalCss,_O],Ff=CO([Ne("w3m-view-all-wallets-button")],Ff);const IO=Ve`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var SO=Object.defineProperty,OO=Object.getOwnPropertyDescriptor,el=(t,e,r,n)=>{for(var i=n>1?void 0:n?OO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&SO(e,r,i),i};let no=class extends $e{constructor(){super(),this.walletId="",this.imageId="",this.uri="",this.unwatchWcConnection=void 0,setTimeout(()=>{const{pairingUri:t}=ur.state,{standaloneUri:e}=De.state;this.uri=e??t},0),this.unwatchWcConnection=ur.subscribe(t=>{t.pairingUri&&(this.uri=t.pairingUri)})}disconnectedCallback(){var t;(t=this.unwatchWcConnection)==null||t.call(this)}get overlayEl(){return xe.getShadowRootElement(this,".w3m-qr-container")}render(){return oe`<div class="w3m-qr-container">${this.uri?oe`<w3m-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${this.walletId}" imageId="${this.imageId}"></w3m-qrcode>`:oe`<w3m-spinner></w3m-spinner>`}</div>`}};no.styles=[Fe.globalCss,IO],el([Oe()],no.prototype,"walletId",2),el([Oe()],no.prototype,"imageId",2),el([gt()],no.prototype,"uri",2),no=el([Ne("w3m-walletconnect-qr")],no);const AO=Ve`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--w3m-color-bg-2);box-shadow:inset 0 0 0 1px var(--w3m-color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--w3m-success-color);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--w3m-success-color),inset 0 0 0 1px var(--w3m-color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--w3m-color-bg-2);padding:11px 20px}`;var DO=Object.defineProperty,$O=Object.getOwnPropertyDescriptor,PO=(t,e,r,n)=>{for(var i=n>1?void 0:n?$O(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&DO(e,r,i),i};let Bf=class extends $e{async onDisconnect(){await Lt.client().disconnect()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=Et.state.address)!=null?t:""),qr.openToast("Address copied","success")}render(){return oe`<w3m-modal-content><div class="w3m-profile"><div class="w3m-info"><w3m-avatar size="medium"></w3m-avatar><w3m-address-text variant="modal"></w3m-address-text></div><div class="w3m-connection-badge"><w3m-text variant="small-regular" color="secondary">Connected</w3m-text></div></div></w3m-modal-content><div class="w3m-balance"><w3m-balance></w3m-balance></div><w3m-modal-footer><div class="w3m-footer"><w3m-account-network-button></w3m-account-network-button><w3m-box-button label="Copy Address" .onClick="${this.onCopyAddress}" .icon="${Le.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${Le.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};Bf.styles=[Fe.globalCss,AO],Bf=PO([Ne("w3m-account-view")],Bf);var TO=Object.defineProperty,RO=Object.getOwnPropertyDescriptor,NO=(t,e,r,n)=>{for(var i=n>1?void 0:n?RO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&TO(e,r,i),i};let kf=class extends $e{viewTemplate(){return Se.isAndroid()?oe`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:Se.isMobile()?oe`<w3m-mobile-wallet-selection></w3m-mobile-wallet-selection>`:oe`<w3m-desktop-wallet-selection></w3m-desktop-wallet-selection>`}render(){return oe`${this.viewTemplate()}<w3m-legal-notice></w3m-legal-notice>`}};kf.styles=[Fe.globalCss],kf=NO([Ne("w3m-connect-wallet-view")],kf);const LO=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var MO=Object.defineProperty,UO=Object.getOwnPropertyDescriptor,ym=(t,e,r,n)=>{for(var i=n>1?void 0:n?UO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&MO(e,r,i),i};let tl=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openDesktopApp(),this.unwatchConnection=ur.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Se.getWalletRouterData(),n=e?.native;if(n){const i=Se.formatNativeUrl(n,t,r);Se.openHref(i,"_self")}}openDesktopApp(){ur.setPairingError(!1);const{standaloneUri:t}=De.state,{pairingUri:e}=ur.state,r=Se.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isMobile:n,isInjected:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Connection can continue loading if ${t} is not installed on your device`}</w3m-text><w3m-platform-selection .isMobile="${n}" .isInjected="${i}" .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};tl.styles=[Fe.globalCss,LO],ym([gt()],tl.prototype,"isError",2),tl=ym([Ne("w3m-desktop-connecting-view")],tl);const jO=Ve`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--w3m-color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--w3m-color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`;var FO=Object.defineProperty,BO=Object.getOwnPropertyDescriptor,kO=(t,e,r,n)=>{for(var i=n>1?void 0:n?BO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&FO(e,r,i),i};let Hf=class extends $e{onGet(t){Se.openHref(t,"_blank")}render(){const t=rr.state.recomendedWallets.slice(0,5),e=en.manualWallets().slice(0,5),r=t.length,n=e.length;return oe`<w3m-modal-header title="Get a wallet"></w3m-modal-header><w3m-modal-content>${r?t.map(i=>oe`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${i.id}" imageId="${i.image_id}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i.name}</w3m-text><w3m-button .iconRight="${Le.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(i.homepage)}">Get</w3m-button></div></div>`):null} ${n?e.map(i=>oe`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${i.id}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-regular">${i.name}</w3m-text><w3m-button .iconRight="${Le.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(i.links.universal)}">Get</w3m-button></div></div>`):null}</w3m-modal-content><div class="w3m-footer-actions"><w3m-text variant="medium-regular">Not what you're looking for?</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With hundreds of wallets out there, there's something for everyone</w3m-text><w3m-button .onClick="${xe.openWalletExplorerUrl}" .iconRight="${Le.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};Hf.styles=[Fe.globalCss,jO],Hf=kO([Ne("w3m-get-wallet-view")],Hf);const HO=Ve`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--w3m-color-overlay)}`;var WO=Object.defineProperty,zO=Object.getOwnPropertyDescriptor,qO=(t,e,r,n)=>{for(var i=n>1?void 0:n?zO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&WO(e,r,i),i};let Wf=class extends $e{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){Ft.state.enableExplorer?tt.push("GetWallet"):xe.openWalletExplorerUrl()}onLearnMore(){Se.openHref(this.learnUrl,"_blank")}render(){return oe`<w3m-modal-header title="What is a wallet?"></w3m-modal-header><w3m-modal-content><div class="w3m-info-container"><div class="w3m-images">${Le.HELP_CHART_IMG} ${Le.HELP_PAINTING_IMG} ${Le.HELP_ETH_IMG}</div><w3m-text variant="medium-regular">A home for your digital assets</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs.</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Le.HELP_KEY_IMG} ${Le.HELP_USER_IMG} ${Le.HELP_LOCK_IMG}</div><w3m-text variant="medium-regular">One login for all of web3</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">Log in to any app by connecting your wallet. Say goodbye to countless passwords!</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Le.HELP_COMPAS_IMG} ${Le.HELP_NOUN_IMG} ${Le.HELP_DAO_IMG}</div><w3m-text variant="medium-regular">Your gateway to a new web</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more.</w3m-text></div><div class="w3m-footer-actions"><w3m-button .onClick="${this.onGet.bind(this)}" .iconLeft="${Le.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${Le.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};Wf.styles=[Fe.globalCss,HO],Wf=qO([Ne("w3m-help-view")],Wf);const VO=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var KO=Object.defineProperty,GO=Object.getOwnPropertyDescriptor,bm=(t,e,r,n)=>{for(var i=n>1?void 0:n?GO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&KO(e,r,i),i};let rl=class extends $e{constructor(){super(),this.isError=!1,this.connector=Lt.client().getConnectorById("injected"),this.openInjectedApp()}async openInjectedApp(){const{ready:t}=this.connector;t&&(this.isError=!1,await xe.handleConnectorConnection("injected",()=>{this.isError=!0}))}render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isMobile:n,isDesktop:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">Connection can be declined if multiple wallets are installed or previous request is still active</w3m-text><w3m-platform-selection .isMobile="${n}" .isDesktop="${i}" .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${this.openInjectedApp.bind(this)}" .disabled="${!this.isError}" .iconRight="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};rl.styles=[Fe.globalCss,VO],bm([gt()],rl.prototype,"isError",2),rl=bm([Ne("w3m-injected-connecting-view")],rl);const ZO=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var YO=Object.defineProperty,JO=Object.getOwnPropertyDescriptor,QO=(t,e,r,n)=>{for(var i=n>1?void 0:n?JO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&YO(e,r,i),i};let zf=class extends $e{onInstall(t){t&&Se.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:n}=Se.getWalletRouterData();return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="Not Detected" .isStale="${!0}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}</w3m-text><w3m-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${Le.ARROW_DOWN_ICON}">Download</w3m-button></w3m-info-footer>`}};zf.styles=[Fe.globalCss,ZO],zf=QO([Ne("w3m-install-wallet-view")],zf);const XO=Ve`w3m-wallet-image{border-radius:var(--w3m-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}w3m-info-footer{display:flex;width:100%}.w3m-app-store{justify-content:space-between}.w3m-app-store w3m-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--w3m-wallet-icon-small-border-radius)}.w3m-app-store div{display:flex;align-items:center}.w3m-app-store w3m-button{margin-right:-10px}.w3m-note{flex-direction:column;align-items:center;padding:5px 0}.w3m-note w3m-text{text-align:center}w3m-platform-selection{margin-top:-15px}.w3m-note w3m-text{margin-top:15px}.w3m-note w3m-text span{color:var(--w3m-accent-color)}`;var eA=Object.defineProperty,tA=Object.getOwnPropertyDescriptor,_m=(t,e,r,n)=>{for(var i=n>1?void 0:n?tA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&eA(e,r,i),i};let nl=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openMobileApp(),this.unwatchConnection=ur.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t,e=!1){const{mobile:r,name:n}=Se.getWalletRouterData(),i=r?.native,o=r?.universal;if(i&&!e){const c=Se.formatNativeUrl(i,t,n);Se.openHref(c,"_self")}else if(o){const c=Se.formatUniversalUrl(o,t,n);Se.openHref(c,"_self")}}openMobileApp(t=!1){ur.setPairingError(!1);const{standaloneUri:e}=De.state,{pairingUri:r}=ur.state,n=Se.getWalletRouterData();xe.setRecentWallet(n),e?this.onFormatAndRedirect(e,t):this.onFormatAndRedirect(r,t)}onGoToAppStore(t){t&&Se.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:n,mobile:i}=Se.getWalletRouterData(),{isWeb:o}=xe.getCachedRouterWalletPlatforms(),c=n?.ios,l=i?.universal;return oe`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="Tap 'Open' to continue…" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer class="w3m-note"><w3m-platform-selection .isWeb="${o}" .isRetry="${!0}"><w3m-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection>${l?oe`<w3m-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></w3m-text>`:null}</w3m-info-footer><w3m-info-footer class="w3m-app-store"><div><w3m-wallet-image walletId="${e}" imageId="${r}"></w3m-wallet-image><w3m-text>${`Get ${t}`}</w3m-text></div><w3m-button .iconRight="${Le.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</w3m-button></w3m-info-footer>`}};nl.styles=[Fe.globalCss,XO],_m([gt()],nl.prototype,"isError",2),nl=_m([Ne("w3m-mobile-connecting-view")],nl);const rA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var nA=Object.defineProperty,iA=Object.getOwnPropertyDescriptor,sA=(t,e,r,n)=>{for(var i=n>1?void 0:n?iA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&nA(e,r,i),i};let qf=class extends $e{render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isInjected:n,isDesktop:i,isWeb:o}=xe.getCachedRouterWalletPlatforms();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr walletId="${e}" imageId="${r}"></w3m-walletconnect-qr></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${t} app`}</w3m-text><w3m-platform-selection .isDesktop="${i}" .isInjected="${n}" .isWeb="${o}"></w3m-platform-selection></w3m-info-footer>`}};qf.styles=[Fe.globalCss,rA],qf=sA([Ne("w3m-mobile-qr-connecting-view")],qf);var oA=Object.defineProperty,aA=Object.getOwnPropertyDescriptor,cA=(t,e,r,n)=>{for(var i=n>1?void 0:n?aA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&oA(e,r,i),i};let Vf=class extends $e{render(){return oe`<w3m-modal-header title="Scan the code" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};Vf.styles=[Fe.globalCss],Vf=cA([Ne("w3m-qrcode-view")],Vf);const lA=Ve`div{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-info-footer w3m-text{text-align:center}`;var Em=Object.defineProperty,uA=Object.defineProperties,hA=Object.getOwnPropertyDescriptor,fA=Object.getOwnPropertyDescriptors,xm=Object.getOwnPropertySymbols,dA=Object.prototype.hasOwnProperty,pA=Object.prototype.propertyIsEnumerable,Cm=(t,e,r)=>e in t?Em(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gA=(t,e)=>{for(var r in e||(e={}))dA.call(e,r)&&Cm(t,r,e[r]);if(xm)for(var r of xm(e))pA.call(e,r)&&Cm(t,r,e[r]);return t},mA=(t,e)=>uA(t,fA(e)),Kf=(t,e,r,n)=>{for(var i=n>1?void 0:n?hA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&Em(e,r,i),i};let Sa=class extends $e{constructor(){super(),this.connectedChains="ALL",this.isUnsupportedChains=!1,this.getConnectedChainIds()}async getConnectedChainIds(){this.connectedChains=await Lt.client().getConnectedChainIds()}async onSelectChain(t){try{const{selectedChain:e,walletConnectVersion:r,isPreferInjected:n}=De.state,{isConnected:i}=Et.state;i?e?.id===t.id?tt.reset("Account"):r===2?(await Lt.client().switchNetwork({chainId:t.id}),tt.reset("Account")):tt.push("SwitchNetwork",{SwitchNetwork:t}):n?(De.setSelectedChain(t),Nr.close()):(De.setSelectedChain(t),tt.push("ConnectWallet"))}catch(e){console.error(e),qr.openToast("Unsupported chain","error")}}isUnsuportedChainId(t){return typeof this.connectedChains=="string"&&this.connectedChains!=="ALL"?(this.isUnsupportedChains=!0,!0):Array.isArray(this.connectedChains)&&!this.connectedChains.includes(String(t))?(this.isUnsupportedChains=!0,!0):!1}render(){const{chains:t}=De.state,e=t?.map(n=>mA(gA({},n),{unsupported:this.isUnsuportedChainId(n.id)})),r=e?.sort((n,i)=>Number(n.unsupported)-Number(i.unsupported));return oe`<w3m-modal-header title="Select network"></w3m-modal-header><w3m-modal-content><div>${r?.map(n=>oe`<w3m-network-button name="${n.name}" chainId="${n.id}" .unsupported="${n.unsupported}" .onClick="${async()=>this.onSelectChain(n)}">${n.name}</w3m-network-button>`)}</div></w3m-modal-content>${this.isUnsupportedChains?oe`<w3m-info-footer><w3m-text color="secondary" variant="small-thin">Your connected wallet may not support some of the networks available for this dapp</w3m-text></w3m-info-footer>`:null}`}};Sa.styles=[Fe.globalCss,lA],Kf([gt()],Sa.prototype,"connectedChains",2),Kf([gt()],Sa.prototype,"isUnsupportedChains",2),Sa=Kf([Ne("w3m-select-network-view")],Sa);const wA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}w3m-button{margin-top:15px}`;var vA=Object.defineProperty,yA=Object.getOwnPropertyDescriptor,Im=(t,e,r,n)=>{for(var i=n>1?void 0:n?yA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&vA(e,r,i),i};let il=class extends $e{constructor(){super(),this.isError=!1,this.onSwitchNetwork()}async onSwitchNetwork(){try{this.isError=!1;const t=Se.getSwitchNetworkRouterData();await Lt.client().switchNetwork({chainId:t.id}),De.setSelectedChain(t),tt.reset("Account")}catch{this.isError=!0}}render(){const{id:t,name:e}=Se.getSwitchNetworkRouterData();return oe`<w3m-modal-header title="${`Connect to ${e}`}"></w3m-modal-header><w3m-modal-content><w3m-network-waiting chainId="${t}" label="Approve in your wallet" .isError="${this.isError}"></w3m-network-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">Switch can be declined if chain is not supported by a wallet or previous request is still active</w3m-text><w3m-button .onClick="${this.onSwitchNetwork.bind(this)}" .disabled="${!this.isError}" .iconRight="${Le.RETRY_ICON}">Try Again</w3m-button></w3m-info-footer>`}};il.styles=[Fe.globalCss,wA],Im([gt()],il.prototype,"isError",2),il=Im([Ne("w3m-switch-network-view")],il);const bA=Ve`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(var(--w3m-color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--w3m-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--w3m-color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var _A=Object.defineProperty,EA=Object.getOwnPropertyDescriptor,Oa=(t,e,r,n)=>{for(var i=n>1?void 0:n?EA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&_A(e,r,i),i};const Gf=40;let us=class extends $e{constructor(){super(...arguments),this.loading=!rr.state.wallets.listings.length,this.firstFetch=!rr.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=xe.debounce(t=>{t.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=t,rr.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),rr.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return xe.getShadowRootElement(this,".w3m-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=rr.state,{listings:r,total:n}=this.search?e:t;return n<=Gf||r.length>=n}async fetchWallets(){var t;const{wallets:e,search:r,injectedWallets:n}=rr.state,{listings:i,total:o,page:c}=this.search?r:e;if(!this.endReached&&(this.firstFetch||o>Gf&&i.length<o))try{this.loading=!0;const l=(t=De.state.standaloneChains)==null?void 0:t.join(","),{listings:h}=await rr.getWallets({page:this.firstFetch?1:c+1,entries:Gf,search:this.search,version:De.state.walletConnectVersion,chains:l}),f=h.map(E=>xe.getWalletIcon(E)),v=n.map(E=>xe.getWalletIcon(E));await Promise.all([...f.map(async E=>xe.preloadImage(E)),...v.map(async E=>xe.preloadImage(E)),Se.wait(300)]),this.endReached=this.isLastPage()}catch(l){console.error(l),qr.openToast(xe.getErrorMessage(l),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){Se.isAndroid()?xe.handleMobileLinking(t):xe.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=rr.state,{listings:r}=this.search?e:t,n=this.loading&&!r.length,i=this.search.length>=3;let o=Mr.injectedWalletsTemplate(),c=Mr.manualWalletsTemplate(),l=Mr.recomendedWalletsTemplate(!0);i&&(o=o.filter(({values:E})=>xe.caseSafeIncludes(E[0],this.search)),c=c.filter(({values:E})=>xe.caseSafeIncludes(E[0],this.search)),l=l.filter(({values:E})=>xe.caseSafeIncludes(E[0],this.search)));const h=!this.loading&&!r.length&&!o.length&&!l.length,f=Math.max(o.length,r.length),v={"w3m-loading":n,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":h};return oe`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content class="${Lr(v)}"><div class="w3m-grid">${n?null:l} ${n?null:[...Array(f)].map((E,_)=>oe`${c[_]} ${o[_]} ${r[_]?oe`<w3m-wallet-button imageId="${r[_].image_id}" name="${r[_].name}" walletId="${r[_].id}" .onClick="${()=>this.onConnect(r[_])}"></w3m-wallet-button>`:null}`)}</div><div class="w3m-placeholder-block">${h?oe`<w3m-text variant="big-bold" color="secondary">No results found</w3m-text>`:null} ${!h&&this.loading?oe`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};us.styles=[Fe.globalCss,bA],Oa([gt()],us.prototype,"loading",2),Oa([gt()],us.prototype,"firstFetch",2),Oa([gt()],us.prototype,"search",2),Oa([gt()],us.prototype,"endReached",2),us=Oa([Ne("w3m-wallet-explorer-view")],us);const xA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var CA=Object.defineProperty,IA=Object.getOwnPropertyDescriptor,Sm=(t,e,r,n)=>{for(var i=n>1?void 0:n?IA(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&CA(e,r,i),i};let sl=class extends $e{constructor(){super(),this.isError=!1,this.unwatchConnection=void 0,this.openWebWallet(),this.unwatchConnection=ur.subscribe(t=>{this.isError=t.pairingError})}disconnectedCallback(){var t;(t=this.unwatchConnection)==null||t.call(this)}onFormatAndRedirect(t){const{desktop:e,name:r}=Se.getWalletRouterData(),n=e?.universal;if(n){const i=Se.formatUniversalUrl(n,t,r);Se.openHref(i,"_blank")}}openWebWallet(){ur.setPairingError(!1);const{standaloneUri:t}=De.state,{pairingUri:e}=ur.state,r=Se.getWalletRouterData();xe.setRecentWallet(r),t?this.onFormatAndRedirect(t):this.onFormatAndRedirect(e)}render(){const{name:t,id:e,image_id:r}=Se.getWalletRouterData(),{isMobile:n,isInjected:i,isDesktop:o}=xe.getCachedRouterWalletPlatforms(),c=Se.isMobile();return oe`<w3m-modal-header title="${t}" .onAction="${xe.handleUriCopy}" .actionIcon="${Le.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-connector-waiting walletId="${e}" imageId="${r}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></w3m-connector-waiting></w3m-modal-content><w3m-info-footer><w3m-text color="secondary" variant="small-thin">${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}</w3m-text><w3m-platform-selection .isMobile="${n}" .isInjected="${c?!1:i}" .isDesktop="${c?!1:o}" .isRetry="${!0}"><w3m-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${Le.RETRY_ICON}">Retry</w3m-button></w3m-platform-selection></w3m-info-footer>`}};sl.styles=[Fe.globalCss,xA],Sm([gt()],sl.prototype,"isError",2),sl=Sm([Ne("w3m-web-connecting-view")],sl);var SA=Object.freeze({__proto__:null,get W3mAccountButton(){return Qs},get W3mConnectButton(){return as},get W3mCoreButton(){return Ai},get W3mModal(){return to},get W3mNetworkSwitch(){return cs},get W3mQrCode(){return Xn}});_n.EthereumProvider=_x,_n.OPTIONAL_EVENTS=Bg,_n.OPTIONAL_METHODS=Fg,_n.REQUIRED_EVENTS=bc,_n.REQUIRED_METHODS=yc,_n.default=Ec,Object.defineProperty(_n,"__esModule",{value:!0})});
99
153
  //# sourceMappingURL=index.umd.js.map