@walletconnect/ethereum-provider 2.10.4 → 2.10.5-rc-e12288e
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.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +82 -41
- package/dist/index.umd.js.map +1 -1
- package/package.json +6 -14
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(xn,Dr){typeof exports=="object"&&typeof module<"u"?Dr(exports):typeof define=="function"&&define.amd?define(["exports"],Dr):(xn=typeof globalThis<"u"?globalThis:xn||self,Dr(xn["@walletconnect/ethereum-provider"]={}))})(this,function(xn){"use strict";var Dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function As(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:{}},Ds=typeof Reflect=="object"?Reflect:null,yd=Ds&&typeof Ds.apply=="function"?Ds.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Va;Ds&&typeof Ds.ownKeys=="function"?Va=Ds.ownKeys:Object.getOwnPropertySymbols?Va=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Va=function(e){return Object.getOwnPropertyNames(e)};function Iw(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=Dw,_t.EventEmitter=_t,_t.prototype._events=void 0,_t.prototype._eventsCount=0,_t.prototype._maxListeners=void 0;var _d=10;function Ka(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 f=o[e];if(f===void 0)return!1;if(typeof f=="function")yd(f,this,r);else for(var h=f.length,v=Od(f,h),n=0;n<h;++n)yd(v[n],this,r);return!0};function xd(t,e,r,n){var i,o,c;if(Ka(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,Iw(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 Sw(){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=Sw.bind(n);return i.listener=r,n.wrapFn=i,i}_t.prototype.once=function(e,r){return Ka(r),this.on(e,Cd(this,e,r)),this},_t.prototype.prependOnceListener=function(e,r){return Ka(r),this.prependListener(e,Cd(this,e,r)),this},_t.prototype.removeListener=function(e,r){var n,i,o,c,l;if(Ka(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():Ow(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?Aw(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?Va(this._events):[]};function Od(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Ow(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Aw(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Dw(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"&&$w(t,i,{once:!0})})}function $w(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 fu={},Ga={},et={},Dd={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,f){var h=l>>>16&65535,v=l&65535,y=f>>>16&65535,b=f&65535;return v*b+(h*b+v*y<<16>>>0)|0}t.mul=Math.imul||e;function r(l,f){return l+f|0}t.add=r;function n(l,f){return l-f|0}t.sub=n;function i(l,f){return l<<f|l>>>32-f}t.rotl=i;function o(l,f){return l<<32-f|l>>>f}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 Pw(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}et.readInt16BE=Pw;function Tw(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}et.readUint16BE=Tw;function Rw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}et.readInt16LE=Rw;function Nw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}et.readUint16LE=Nw;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 du(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}et.readInt32BE=du;function pu(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=pu;function gu(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}et.readInt32LE=gu;function mu(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=mu;function Za(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=Za,et.writeInt32BE=Za;function Ya(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=Ya,et.writeInt32LE=Ya;function Lw(t,e){e===void 0&&(e=0);var r=du(t,e),n=du(t,e+4);return r*4294967296+n-(n>>31)*4294967296}et.readInt64BE=Lw;function Mw(t,e){e===void 0&&(e=0);var r=pu(t,e),n=pu(t,e+4);return r*4294967296+n}et.readUint64BE=Mw;function Uw(t,e){e===void 0&&(e=0);var r=gu(t,e),n=gu(t,e+4);return n*4294967296+r-(r>>31)*4294967296}et.readInt64LE=Uw;function jw(t,e){e===void 0&&(e=0);var r=mu(t,e),n=mu(t,e+4);return n*4294967296+r}et.readUint64LE=jw;function Rd(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Za(t/4294967296>>>0,e,r),Za(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),Ya(t>>>0,e,r),Ya(t/4294967296>>>0,e,r+4),e}et.writeUint64LE=Nd,et.writeInt64LE=Nd;function Fw(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=Fw;function Bw(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=Bw;function kw(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=kw;function Hw(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=Hw;function zw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}et.readFloat32BE=zw;function Ww(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}et.readFloat32LE=Ww;function qw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}et.readFloat64BE=qw;function Vw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}et.readFloat64LE=Vw;function Kw(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=Kw;function Gw(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=Gw;function Zw(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=Zw;function Yw(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=Yw;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});function Jw(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Xr.wipe=Jw,Object.defineProperty(Ga,"__esModule",{value:!0});var Cr=et,wu=Xr,Qw=20;function Xw(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],f=r[7]<<24|r[6]<<16|r[5]<<8|r[4],h=r[11]<<24|r[10]<<16|r[9]<<8|r[8],v=r[15]<<24|r[14]<<16|r[13]<<8|r[12],y=r[19]<<24|r[18]<<16|r[17]<<8|r[16],b=r[23]<<24|r[22]<<16|r[21]<<8|r[20],x=r[27]<<24|r[26]<<16|r[25]<<8|r[24],P=r[31]<<24|r[30]<<16|r[29]<<8|r[28],M=e[3]<<24|e[2]<<16|e[1]<<8|e[0],H=e[7]<<24|e[6]<<16|e[5]<<8|e[4],V=e[11]<<24|e[10]<<16|e[9]<<8|e[8],T=e[15]<<24|e[14]<<16|e[13]<<8|e[12],L=n,$=i,R=o,S=c,d=l,C=f,J=h,z=v,ee=y,de=b,me=x,O=P,j=M,ce=H,le=V,re=T,ne=0;ne<Qw;ne+=2)L=L+d|0,j^=L,j=j>>>32-16|j<<16,ee=ee+j|0,d^=ee,d=d>>>32-12|d<<12,$=$+C|0,ce^=$,ce=ce>>>32-16|ce<<16,de=de+ce|0,C^=de,C=C>>>32-12|C<<12,R=R+J|0,le^=R,le=le>>>32-16|le<<16,me=me+le|0,J^=me,J=J>>>32-12|J<<12,S=S+z|0,re^=S,re=re>>>32-16|re<<16,O=O+re|0,z^=O,z=z>>>32-12|z<<12,R=R+J|0,le^=R,le=le>>>32-8|le<<8,me=me+le|0,J^=me,J=J>>>32-7|J<<7,S=S+z|0,re^=S,re=re>>>32-8|re<<8,O=O+re|0,z^=O,z=z>>>32-7|z<<7,$=$+C|0,ce^=$,ce=ce>>>32-8|ce<<8,de=de+ce|0,C^=de,C=C>>>32-7|C<<7,L=L+d|0,j^=L,j=j>>>32-8|j<<8,ee=ee+j|0,d^=ee,d=d>>>32-7|d<<7,L=L+C|0,re^=L,re=re>>>32-16|re<<16,me=me+re|0,C^=me,C=C>>>32-12|C<<12,$=$+J|0,j^=$,j=j>>>32-16|j<<16,O=O+j|0,J^=O,J=J>>>32-12|J<<12,R=R+z|0,ce^=R,ce=ce>>>32-16|ce<<16,ee=ee+ce|0,z^=ee,z=z>>>32-12|z<<12,S=S+d|0,le^=S,le=le>>>32-16|le<<16,de=de+le|0,d^=de,d=d>>>32-12|d<<12,R=R+z|0,ce^=R,ce=ce>>>32-8|ce<<8,ee=ee+ce|0,z^=ee,z=z>>>32-7|z<<7,S=S+d|0,le^=S,le=le>>>32-8|le<<8,de=de+le|0,d^=de,d=d>>>32-7|d<<7,$=$+J|0,j^=$,j=j>>>32-8|j<<8,O=O+j|0,J^=O,J=J>>>32-7|J<<7,L=L+C|0,re^=L,re=re>>>32-8|re<<8,me=me+re|0,C^=me,C=C>>>32-7|C<<7;Cr.writeUint32LE(L+n|0,t,0),Cr.writeUint32LE($+i|0,t,4),Cr.writeUint32LE(R+o|0,t,8),Cr.writeUint32LE(S+c|0,t,12),Cr.writeUint32LE(d+l|0,t,16),Cr.writeUint32LE(C+f|0,t,20),Cr.writeUint32LE(J+h|0,t,24),Cr.writeUint32LE(z+v|0,t,28),Cr.writeUint32LE(ee+y|0,t,32),Cr.writeUint32LE(de+b|0,t,36),Cr.writeUint32LE(me+x|0,t,40),Cr.writeUint32LE(O+P|0,t,44),Cr.writeUint32LE(j+M|0,t,48),Cr.writeUint32LE(ce+H|0,t,52),Cr.writeUint32LE(le+V|0,t,56),Cr.writeUint32LE(re+T|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),f=0;f<r.length;f+=64){Xw(l,o,t);for(var h=f;h<f+64&&h<r.length;h++)n[h]=r[h]^l[h-f];tv(o,0,c)}return wu.wipe(l),i===0&&wu.wipe(o),n}Ga.streamXOR=Ld;function ev(t,e,r,n){return n===void 0&&(n=0),wu.wipe(r),Ld(t,e,r,r,n)}Ga.stream=ev;function tv(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={},gi={};Object.defineProperty(gi,"__esModule",{value:!0});function rv(t,e,r){return~(t-1)&e|t-1&r}gi.select=rv;function nv(t,e){return(t|0)-(e|0)-1>>>31&1}gi.lessOrEqual=nv;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}gi.compare=Ud;function iv(t,e){return t.length===0||e.length===0?!1:Ud(t,e)!==0}gi.equal=iv,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=gi,r=Xr;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 f=l[0]|l[1]<<8;this._r[0]=f&8191;var h=l[2]|l[3]<<8;this._r[1]=(f>>>13|h<<3)&8191;var v=l[4]|l[5]<<8;this._r[2]=(h>>>10|v<<6)&7939;var y=l[6]|l[7]<<8;this._r[3]=(v>>>7|y<<9)&8191;var b=l[8]|l[9]<<8;this._r[4]=(y>>>4|b<<12)&255,this._r[5]=b>>>1&8190;var x=l[10]|l[11]<<8;this._r[6]=(b>>>14|x<<2)&8191;var P=l[12]|l[13]<<8;this._r[7]=(x>>>11|P<<5)&8065;var M=l[14]|l[15]<<8;this._r[8]=(P>>>8|M<<8)&8191,this._r[9]=M>>>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,f,h){for(var v=this._fin?0:2048,y=this._h[0],b=this._h[1],x=this._h[2],P=this._h[3],M=this._h[4],H=this._h[5],V=this._h[6],T=this._h[7],L=this._h[8],$=this._h[9],R=this._r[0],S=this._r[1],d=this._r[2],C=this._r[3],J=this._r[4],z=this._r[5],ee=this._r[6],de=this._r[7],me=this._r[8],O=this._r[9];h>=16;){var j=l[f+0]|l[f+1]<<8;y+=j&8191;var ce=l[f+2]|l[f+3]<<8;b+=(j>>>13|ce<<3)&8191;var le=l[f+4]|l[f+5]<<8;x+=(ce>>>10|le<<6)&8191;var re=l[f+6]|l[f+7]<<8;P+=(le>>>7|re<<9)&8191;var ne=l[f+8]|l[f+9]<<8;M+=(re>>>4|ne<<12)&8191,H+=ne>>>1&8191;var ae=l[f+10]|l[f+11]<<8;V+=(ne>>>14|ae<<2)&8191;var ie=l[f+12]|l[f+13]<<8;T+=(ae>>>11|ie<<5)&8191;var Ae=l[f+14]|l[f+15]<<8;L+=(ie>>>8|Ae<<8)&8191,$+=Ae>>>5|v;var ge=0,Be=ge;Be+=y*R,Be+=b*(5*O),Be+=x*(5*me),Be+=P*(5*de),Be+=M*(5*ee),ge=Be>>>13,Be&=8191,Be+=H*(5*z),Be+=V*(5*J),Be+=T*(5*C),Be+=L*(5*d),Be+=$*(5*S),ge+=Be>>>13,Be&=8191;var ye=ge;ye+=y*S,ye+=b*R,ye+=x*(5*O),ye+=P*(5*me),ye+=M*(5*de),ge=ye>>>13,ye&=8191,ye+=H*(5*ee),ye+=V*(5*z),ye+=T*(5*J),ye+=L*(5*C),ye+=$*(5*d),ge+=ye>>>13,ye&=8191;var Me=ge;Me+=y*d,Me+=b*S,Me+=x*R,Me+=P*(5*O),Me+=M*(5*me),ge=Me>>>13,Me&=8191,Me+=H*(5*de),Me+=V*(5*ee),Me+=T*(5*z),Me+=L*(5*J),Me+=$*(5*C),ge+=Me>>>13,Me&=8191;var Q=ge;Q+=y*C,Q+=b*d,Q+=x*S,Q+=P*R,Q+=M*(5*O),ge=Q>>>13,Q&=8191,Q+=H*(5*me),Q+=V*(5*de),Q+=T*(5*ee),Q+=L*(5*z),Q+=$*(5*J),ge+=Q>>>13,Q&=8191;var Y=ge;Y+=y*J,Y+=b*C,Y+=x*d,Y+=P*S,Y+=M*R,ge=Y>>>13,Y&=8191,Y+=H*(5*O),Y+=V*(5*me),Y+=T*(5*de),Y+=L*(5*ee),Y+=$*(5*z),ge+=Y>>>13,Y&=8191;var W=ge;W+=y*z,W+=b*J,W+=x*C,W+=P*d,W+=M*S,ge=W>>>13,W&=8191,W+=H*R,W+=V*(5*O),W+=T*(5*me),W+=L*(5*de),W+=$*(5*ee),ge+=W>>>13,W&=8191;var w=ge;w+=y*ee,w+=b*z,w+=x*J,w+=P*C,w+=M*d,ge=w>>>13,w&=8191,w+=H*S,w+=V*R,w+=T*(5*O),w+=L*(5*me),w+=$*(5*de),ge+=w>>>13,w&=8191;var F=ge;F+=y*de,F+=b*ee,F+=x*z,F+=P*J,F+=M*C,ge=F>>>13,F&=8191,F+=H*d,F+=V*S,F+=T*R,F+=L*(5*O),F+=$*(5*me),ge+=F>>>13,F&=8191;var we=ge;we+=y*me,we+=b*de,we+=x*ee,we+=P*z,we+=M*J,ge=we>>>13,we&=8191,we+=H*C,we+=V*d,we+=T*S,we+=L*R,we+=$*(5*O),ge+=we>>>13,we&=8191;var ve=ge;ve+=y*O,ve+=b*me,ve+=x*de,ve+=P*ee,ve+=M*z,ge=ve>>>13,ve&=8191,ve+=H*J,ve+=V*C,ve+=T*d,ve+=L*S,ve+=$*R,ge+=ve>>>13,ve&=8191,ge=(ge<<2)+ge|0,ge=ge+Be|0,Be=ge&8191,ge=ge>>>13,ye+=ge,y=Be,b=ye,x=Me,P=Q,M=Y,H=W,V=w,T=F,L=we,$=ve,f+=16,h-=16}this._h[0]=y,this._h[1]=b,this._h[2]=x,this._h[3]=P,this._h[4]=M,this._h[5]=H,this._h[6]=V,this._h[7]=T,this._h[8]=L,this._h[9]=$},c.prototype.finish=function(l,f){f===void 0&&(f=0);var h=new Uint16Array(10),v,y,b,x;if(this._leftover){for(x=this._leftover,this._buffer[x++]=1;x<16;x++)this._buffer[x]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(v=this._h[1]>>>13,this._h[1]&=8191,x=2;x<10;x++)this._h[x]+=v,v=this._h[x]>>>13,this._h[x]&=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,h[0]=this._h[0]+5,v=h[0]>>>13,h[0]&=8191,x=1;x<10;x++)h[x]=this._h[x]+v,v=h[x]>>>13,h[x]&=8191;for(h[9]-=8192,y=(v^1)-1,x=0;x<10;x++)h[x]&=y;for(y=~y,x=0;x<10;x++)this._h[x]=this._h[x]&y|h[x];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,b=this._h[0]+this._pad[0],this._h[0]=b&65535,x=1;x<8;x++)b=(this._h[x]+this._pad[x]|0)+(b>>>16)|0,this._h[x]=b&65535;return l[f+0]=this._h[0]>>>0,l[f+1]=this._h[0]>>>8,l[f+2]=this._h[1]>>>0,l[f+3]=this._h[1]>>>8,l[f+4]=this._h[2]>>>0,l[f+5]=this._h[2]>>>8,l[f+6]=this._h[3]>>>0,l[f+7]=this._h[3]>>>8,l[f+8]=this._h[4]>>>0,l[f+9]=this._h[4]>>>8,l[f+10]=this._h[5]>>>0,l[f+11]=this._h[5]>>>8,l[f+12]=this._h[6]>>>0,l[f+13]=this._h[6]>>>8,l[f+14]=this._h[7]>>>0,l[f+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(l){var f=0,h=l.length,v;if(this._leftover){v=16-this._leftover,v>h&&(v=h);for(var y=0;y<v;y++)this._buffer[this._leftover+y]=l[f+y];if(h-=v,f+=v,this._leftover+=v,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(h>=16&&(v=h-h%16,this._blocks(l,f,v),f+=v,h-=v),h){for(var y=0;y<h;y++)this._buffer[this._leftover+y]=l[f+y];this._leftover+=h}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 f=new n(c);f.update(l);var h=f.digest();return f.clean(),h}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=Ga,r=Md,n=Xr,i=et,o=gi;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var c=new Uint8Array(16),l=function(){function f(h){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,h.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(h)}return f.prototype.seal=function(h,v,y,b){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var x=new Uint8Array(16);x.set(h,x.length-h.length);var P=new Uint8Array(32);e.stream(this._key,x,P,4);var M=v.length+this.tagLength,H;if(b){if(b.length!==M)throw new Error("ChaCha20Poly1305: incorrect destination length");H=b}else H=new Uint8Array(M);return e.streamXOR(this._key,x,v,H,4),this._authenticate(H.subarray(H.length-this.tagLength,H.length),P,H.subarray(0,H.length-this.tagLength),y),n.wipe(x),H},f.prototype.open=function(h,v,y,b){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(v.length<this.tagLength)return null;var x=new Uint8Array(16);x.set(h,x.length-h.length);var P=new Uint8Array(32);e.stream(this._key,x,P,4);var M=new Uint8Array(this.tagLength);if(this._authenticate(M,P,v.subarray(0,v.length-this.tagLength),y),!o.equal(M,v.subarray(v.length-this.tagLength,v.length)))return null;var H=v.length-this.tagLength,V;if(b){if(b.length!==H)throw new Error("ChaCha20Poly1305: incorrect destination length");V=b}else V=new Uint8Array(H);return e.streamXOR(this._key,x,v.subarray(0,v.length-this.tagLength),V,4),n.wipe(x),V},f.prototype.clean=function(){return n.wipe(this._key),this},f.prototype._authenticate=function(h,v,y,b){var x=new r.Poly1305(v);b&&(x.update(b),b.length%16>0&&x.update(c.subarray(b.length%16))),x.update(y),y.length%16>0&&x.update(c.subarray(y.length%16));var P=new Uint8Array(8);b&&i.writeUint64LE(b.length,P),x.update(P),i.writeUint64LE(y.length,P),x.update(P);for(var M=x.digest(),H=0;H<M.length;H++)h[H]=M[H];x.clean(),n.wipe(M),n.wipe(P)},f}();t.ChaCha20Poly1305=l}(fu);var jd={},Do={},vu={};Object.defineProperty(vu,"__esModule",{value:!0});function sv(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}vu.isSerializableHash=sv,Object.defineProperty(Do,"__esModule",{value:!0});var Rn=vu,ov=gi,av=Xr,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),Rn.isSerializableHash(this._inner)&&Rn.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),av.wipe(n)}return t.prototype.reset=function(){if(!Rn.isSerializableHash(this._inner)||!Rn.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(){Rn.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Rn.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(!Rn.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(!Rn.isSerializableHash(this._inner)||!Rn.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(!Rn.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Do.HMAC=Fd;function cv(t,e,r){var n=new Fd(t,e);n.update(r);var i=n.digest();return n.clean(),i}Do.hmac=cv,Do.equal=ov.equal,Object.defineProperty(jd,"__esModule",{value:!0});var Bd=Do,kd=Xr,lv=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}(),uv=jd.HKDF=lv,$s={},Ja={},Qa={};Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.BrowserRandomSource=void 0;const Hd=65536;class hv{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}}Qa.BrowserRandomSource=hv;function fv(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 Xa={},dv={},pv=Object.freeze({__proto__:null,default:dv}),gv=As(pv);Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.NodeRandomSource=void 0;const mv=Xr;class wv{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof fv<"u"){const e=gv;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,mv.wipe)(r),n}}Xa.NodeRandomSource=wv,Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.SystemRandomSource=void 0;const vv=Qa,yv=Xa;class bv{constructor(){if(this.isAvailable=!1,this.name="",this._source=new vv.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new yv.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)}}Ja.SystemRandomSource=bv,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Ja,r=et,n=Xr;t.defaultRandomSource=new e.SystemRandomSource;function i(h,v=t.defaultRandomSource){return v.randomBytes(h)}t.randomBytes=i;function o(h=t.defaultRandomSource){const v=i(4,h),y=(0,r.readUint32LE)(v);return(0,n.wipe)(v),y}t.randomUint32=o;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(h,v=c,y=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 b="";const x=v.length,P=256-256%x;for(;h>0;){const M=i(Math.ceil(h*256/P),y);for(let H=0;H<M.length&&h>0;H++){const V=M[H];V<P&&(b+=v.charAt(V%x),h--)}(0,n.wipe)(M)}return b}t.randomString=l;function f(h,v=c,y=t.defaultRandomSource){const b=Math.ceil(h/(Math.log(v.length)/Math.LN2));return l(b,v,y)}t.randomStringForEntropy=f}($s);var ec={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Xr;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(f,h){if(h===void 0&&(h=f.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var v=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&h>0;)this._buffer[this._bufferLength++]=f[v++],h--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(v=o(this._temp,this._state,f,v,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[v++],h--;return this},l.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,v=this._bufferLength,y=h/536870912|0,b=h<<3,x=h%64<56?64:128;this._buffer[v]=128;for(var P=v+1;P<x-8;P++)this._buffer[P]=0;e.writeUint32BE(y,this._buffer,x-8),e.writeUint32BE(b,this._buffer,x-4),o(this._temp,this._state,this._buffer,0,x),this._finished=!0}for(var P=0;P<this.digestLength/4;P++)e.writeUint32BE(this._state[P],f,P*4);return this},l.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},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(f){return this._state.set(f.state),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(f){r.wipe(f.state),f.buffer&&r.wipe(f.buffer),f.bufferLength=0,f.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,f,h,v,y){for(;y>=64;){for(var b=f[0],x=f[1],P=f[2],M=f[3],H=f[4],V=f[5],T=f[6],L=f[7],$=0;$<16;$++){var R=v+$*4;l[$]=e.readUint32BE(h,R)}for(var $=16;$<64;$++){var S=l[$-2],d=(S>>>17|S<<32-17)^(S>>>19|S<<32-19)^S>>>10;S=l[$-15];var C=(S>>>7|S<<32-7)^(S>>>18|S<<32-18)^S>>>3;l[$]=(d+l[$-7]|0)+(C+l[$-16]|0)}for(var $=0;$<64;$++){var d=(((H>>>6|H<<26)^(H>>>11|H<<21)^(H>>>25|H<<7))+(H&V^~H&T)|0)+(L+(i[$]+l[$]|0)|0)|0,C=((b>>>2|b<<32-2)^(b>>>13|b<<32-13)^(b>>>22|b<<32-22))+(b&x^b&P^x&P)|0;L=T,T=V,V=H,H=M+d|0,M=P,P=x,x=b,b=d+C|0}f[0]+=b,f[1]+=x,f[2]+=P,f[3]+=M,f[4]+=H,f[5]+=V,f[6]+=T,f[7]+=L,v+=64,y-=64}return v}function c(l){var f=new n;f.update(l);var h=f.digest();return f.clean(),h}t.hash=c})(ec);var yu={};(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=$s,r=Xr;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n($){const R=new Float64Array(16);if($)for(let S=0;S<$.length;S++)R[S]=$[S];return R}const i=new Uint8Array(32);i[0]=9;const o=n([56129,1]);function c($){let R=1;for(let S=0;S<16;S++){let d=$[S]+R+65535;R=Math.floor(d/65536),$[S]=d-R*65536}$[0]+=R-1+37*(R-1)}function l($,R,S){const d=~(S-1);for(let C=0;C<16;C++){const J=d&($[C]^R[C]);$[C]^=J,R[C]^=J}}function f($,R){const S=n(),d=n();for(let C=0;C<16;C++)d[C]=R[C];c(d),c(d),c(d);for(let C=0;C<2;C++){S[0]=d[0]-65517;for(let z=1;z<15;z++)S[z]=d[z]-65535-(S[z-1]>>16&1),S[z-1]&=65535;S[15]=d[15]-32767-(S[14]>>16&1);const J=S[15]>>16&1;S[14]&=65535,l(d,S,1-J)}for(let C=0;C<16;C++)$[2*C]=d[C]&255,$[2*C+1]=d[C]>>8}function h($,R){for(let S=0;S<16;S++)$[S]=R[2*S]+(R[2*S+1]<<8);$[15]&=32767}function v($,R,S){for(let d=0;d<16;d++)$[d]=R[d]+S[d]}function y($,R,S){for(let d=0;d<16;d++)$[d]=R[d]-S[d]}function b($,R,S){let d,C,J=0,z=0,ee=0,de=0,me=0,O=0,j=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,W=0,w=0,F=0,we=0,ve=0,Ue=0,nt=0,at=0,Ge=0,Dt=0,$t=0,Je=S[0],He=S[1],ke=S[2],Ke=S[3],rt=S[4],je=S[5],Ze=S[6],E=S[7],p=S[8],m=S[9],D=S[10],B=S[11],G=S[12],X=S[13],Ee=S[14],Re=S[15];d=R[0],J+=d*Je,z+=d*He,ee+=d*ke,de+=d*Ke,me+=d*rt,O+=d*je,j+=d*Ze,ce+=d*E,le+=d*p,re+=d*m,ne+=d*D,ae+=d*B,ie+=d*G,Ae+=d*X,ge+=d*Ee,Be+=d*Re,d=R[1],z+=d*Je,ee+=d*He,de+=d*ke,me+=d*Ke,O+=d*rt,j+=d*je,ce+=d*Ze,le+=d*E,re+=d*p,ne+=d*m,ae+=d*D,ie+=d*B,Ae+=d*G,ge+=d*X,Be+=d*Ee,ye+=d*Re,d=R[2],ee+=d*Je,de+=d*He,me+=d*ke,O+=d*Ke,j+=d*rt,ce+=d*je,le+=d*Ze,re+=d*E,ne+=d*p,ae+=d*m,ie+=d*D,Ae+=d*B,ge+=d*G,Be+=d*X,ye+=d*Ee,Me+=d*Re,d=R[3],de+=d*Je,me+=d*He,O+=d*ke,j+=d*Ke,ce+=d*rt,le+=d*je,re+=d*Ze,ne+=d*E,ae+=d*p,ie+=d*m,Ae+=d*D,ge+=d*B,Be+=d*G,ye+=d*X,Me+=d*Ee,Q+=d*Re,d=R[4],me+=d*Je,O+=d*He,j+=d*ke,ce+=d*Ke,le+=d*rt,re+=d*je,ne+=d*Ze,ae+=d*E,ie+=d*p,Ae+=d*m,ge+=d*D,Be+=d*B,ye+=d*G,Me+=d*X,Q+=d*Ee,Y+=d*Re,d=R[5],O+=d*Je,j+=d*He,ce+=d*ke,le+=d*Ke,re+=d*rt,ne+=d*je,ae+=d*Ze,ie+=d*E,Ae+=d*p,ge+=d*m,Be+=d*D,ye+=d*B,Me+=d*G,Q+=d*X,Y+=d*Ee,W+=d*Re,d=R[6],j+=d*Je,ce+=d*He,le+=d*ke,re+=d*Ke,ne+=d*rt,ae+=d*je,ie+=d*Ze,Ae+=d*E,ge+=d*p,Be+=d*m,ye+=d*D,Me+=d*B,Q+=d*G,Y+=d*X,W+=d*Ee,w+=d*Re,d=R[7],ce+=d*Je,le+=d*He,re+=d*ke,ne+=d*Ke,ae+=d*rt,ie+=d*je,Ae+=d*Ze,ge+=d*E,Be+=d*p,ye+=d*m,Me+=d*D,Q+=d*B,Y+=d*G,W+=d*X,w+=d*Ee,F+=d*Re,d=R[8],le+=d*Je,re+=d*He,ne+=d*ke,ae+=d*Ke,ie+=d*rt,Ae+=d*je,ge+=d*Ze,Be+=d*E,ye+=d*p,Me+=d*m,Q+=d*D,Y+=d*B,W+=d*G,w+=d*X,F+=d*Ee,we+=d*Re,d=R[9],re+=d*Je,ne+=d*He,ae+=d*ke,ie+=d*Ke,Ae+=d*rt,ge+=d*je,Be+=d*Ze,ye+=d*E,Me+=d*p,Q+=d*m,Y+=d*D,W+=d*B,w+=d*G,F+=d*X,we+=d*Ee,ve+=d*Re,d=R[10],ne+=d*Je,ae+=d*He,ie+=d*ke,Ae+=d*Ke,ge+=d*rt,Be+=d*je,ye+=d*Ze,Me+=d*E,Q+=d*p,Y+=d*m,W+=d*D,w+=d*B,F+=d*G,we+=d*X,ve+=d*Ee,Ue+=d*Re,d=R[11],ae+=d*Je,ie+=d*He,Ae+=d*ke,ge+=d*Ke,Be+=d*rt,ye+=d*je,Me+=d*Ze,Q+=d*E,Y+=d*p,W+=d*m,w+=d*D,F+=d*B,we+=d*G,ve+=d*X,Ue+=d*Ee,nt+=d*Re,d=R[12],ie+=d*Je,Ae+=d*He,ge+=d*ke,Be+=d*Ke,ye+=d*rt,Me+=d*je,Q+=d*Ze,Y+=d*E,W+=d*p,w+=d*m,F+=d*D,we+=d*B,ve+=d*G,Ue+=d*X,nt+=d*Ee,at+=d*Re,d=R[13],Ae+=d*Je,ge+=d*He,Be+=d*ke,ye+=d*Ke,Me+=d*rt,Q+=d*je,Y+=d*Ze,W+=d*E,w+=d*p,F+=d*m,we+=d*D,ve+=d*B,Ue+=d*G,nt+=d*X,at+=d*Ee,Ge+=d*Re,d=R[14],ge+=d*Je,Be+=d*He,ye+=d*ke,Me+=d*Ke,Q+=d*rt,Y+=d*je,W+=d*Ze,w+=d*E,F+=d*p,we+=d*m,ve+=d*D,Ue+=d*B,nt+=d*G,at+=d*X,Ge+=d*Ee,Dt+=d*Re,d=R[15],Be+=d*Je,ye+=d*He,Me+=d*ke,Q+=d*Ke,Y+=d*rt,W+=d*je,w+=d*Ze,F+=d*E,we+=d*p,ve+=d*m,Ue+=d*D,nt+=d*B,at+=d*G,Ge+=d*X,Dt+=d*Ee,$t+=d*Re,J+=38*ye,z+=38*Me,ee+=38*Q,de+=38*Y,me+=38*W,O+=38*w,j+=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,C=1,d=J+C+65535,C=Math.floor(d/65536),J=d-C*65536,d=z+C+65535,C=Math.floor(d/65536),z=d-C*65536,d=ee+C+65535,C=Math.floor(d/65536),ee=d-C*65536,d=de+C+65535,C=Math.floor(d/65536),de=d-C*65536,d=me+C+65535,C=Math.floor(d/65536),me=d-C*65536,d=O+C+65535,C=Math.floor(d/65536),O=d-C*65536,d=j+C+65535,C=Math.floor(d/65536),j=d-C*65536,d=ce+C+65535,C=Math.floor(d/65536),ce=d-C*65536,d=le+C+65535,C=Math.floor(d/65536),le=d-C*65536,d=re+C+65535,C=Math.floor(d/65536),re=d-C*65536,d=ne+C+65535,C=Math.floor(d/65536),ne=d-C*65536,d=ae+C+65535,C=Math.floor(d/65536),ae=d-C*65536,d=ie+C+65535,C=Math.floor(d/65536),ie=d-C*65536,d=Ae+C+65535,C=Math.floor(d/65536),Ae=d-C*65536,d=ge+C+65535,C=Math.floor(d/65536),ge=d-C*65536,d=Be+C+65535,C=Math.floor(d/65536),Be=d-C*65536,J+=C-1+37*(C-1),C=1,d=J+C+65535,C=Math.floor(d/65536),J=d-C*65536,d=z+C+65535,C=Math.floor(d/65536),z=d-C*65536,d=ee+C+65535,C=Math.floor(d/65536),ee=d-C*65536,d=de+C+65535,C=Math.floor(d/65536),de=d-C*65536,d=me+C+65535,C=Math.floor(d/65536),me=d-C*65536,d=O+C+65535,C=Math.floor(d/65536),O=d-C*65536,d=j+C+65535,C=Math.floor(d/65536),j=d-C*65536,d=ce+C+65535,C=Math.floor(d/65536),ce=d-C*65536,d=le+C+65535,C=Math.floor(d/65536),le=d-C*65536,d=re+C+65535,C=Math.floor(d/65536),re=d-C*65536,d=ne+C+65535,C=Math.floor(d/65536),ne=d-C*65536,d=ae+C+65535,C=Math.floor(d/65536),ae=d-C*65536,d=ie+C+65535,C=Math.floor(d/65536),ie=d-C*65536,d=Ae+C+65535,C=Math.floor(d/65536),Ae=d-C*65536,d=ge+C+65535,C=Math.floor(d/65536),ge=d-C*65536,d=Be+C+65535,C=Math.floor(d/65536),Be=d-C*65536,J+=C-1+37*(C-1),$[0]=J,$[1]=z,$[2]=ee,$[3]=de,$[4]=me,$[5]=O,$[6]=j,$[7]=ce,$[8]=le,$[9]=re,$[10]=ne,$[11]=ae,$[12]=ie,$[13]=Ae,$[14]=ge,$[15]=Be}function x($,R){b($,R,R)}function P($,R){const S=n();for(let d=0;d<16;d++)S[d]=R[d];for(let d=253;d>=0;d--)x(S,S),d!==2&&d!==4&&b(S,S,R);for(let d=0;d<16;d++)$[d]=S[d]}function M($,R){const S=new Uint8Array(32),d=new Float64Array(80),C=n(),J=n(),z=n(),ee=n(),de=n(),me=n();for(let le=0;le<31;le++)S[le]=$[le];S[31]=$[31]&127|64,S[0]&=248,h(d,R);for(let le=0;le<16;le++)J[le]=d[le];C[0]=ee[0]=1;for(let le=254;le>=0;--le){const re=S[le>>>3]>>>(le&7)&1;l(C,J,re),l(z,ee,re),v(de,C,z),y(C,C,z),v(z,J,ee),y(J,J,ee),x(ee,de),x(me,C),b(C,z,C),b(z,J,de),v(de,C,z),y(C,C,z),x(J,C),y(z,ee,me),b(C,z,o),v(C,C,ee),b(z,z,C),b(C,ee,me),b(ee,J,d),x(J,de),l(C,J,re),l(z,ee,re)}for(let le=0;le<16;le++)d[le+16]=C[le],d[le+32]=z[le],d[le+48]=J[le],d[le+64]=ee[le];const O=d.subarray(32),j=d.subarray(16);P(O,O),b(j,j,O);const ce=new Uint8Array(32);return f(ce,j),ce}t.scalarMult=M;function H($){return M($,i)}t.scalarMultBase=H;function V($){if($.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const R=new Uint8Array($);return{publicKey:H(R),secretKey:R}}t.generateKeyPairFromSeed=V;function T($){const R=(0,e.randomBytes)(32,$),S=V(R);return(0,r.wipe)(R),S}t.generateKeyPair=T;function L($,R,S=!1){if($.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(R.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const d=M($,R);if(S){let C=0;for(let J=0;J<d.length;J++)C|=d[J];if(C===0)throw new Error("X25519: invalid shared key")}return d}t.sharedKey=L})(yu);function bu(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function zd(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?bu(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function _u(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));const r=zd(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return bu(r)}function _v(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,f=t.charAt(0),h=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function y(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 M=0,H=0,V=0,T=P.length;V!==T&&P[V]===0;)V++,M++;for(var L=(T-V)*v+1>>>0,$=new Uint8Array(L);V!==T;){for(var R=P[V],S=0,d=L-1;(R!==0||S<H)&&d!==-1;d--,S++)R+=256*$[d]>>>0,$[d]=R%l>>>0,R=R/l>>>0;if(R!==0)throw new Error("Non-zero carry");H=S,V++}for(var C=L-H;C!==L&&$[C]===0;)C++;for(var J=f.repeat(M);C<L;++C)J+=t.charAt($[C]);return J}function b(P){if(typeof P!="string")throw new TypeError("Expected String");if(P.length===0)return new Uint8Array;var M=0;if(P[M]!==" "){for(var H=0,V=0;P[M]===f;)H++,M++;for(var T=(P.length-M)*h+1>>>0,L=new Uint8Array(T);P[M];){var $=r[P.charCodeAt(M)];if($===255)return;for(var R=0,S=T-1;($!==0||R<V)&&S!==-1;S--,R++)$+=l*L[S]>>>0,L[S]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");V=R,M++}if(P[M]!==" "){for(var d=T-V;d!==T&&L[d]===0;)d++;for(var C=new Uint8Array(H+(T-d)),J=H;d!==T;)C[J++]=L[d++];return C}}}function x(P){var M=b(P);if(M)return M;throw new Error(`Non-${e} character`)}return{encode:y,decodeUnsafe:b,decode:x}}var Ev=_v,xv=Ev;const Wd=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")},Cv=t=>new TextEncoder().encode(t),Iv=t=>new TextDecoder().decode(t);class Sv{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 Ov{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 Av{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 Av({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Dv{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Sv(e,r,n),this.decoder=new Ov(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const tc=({name:t,prefix:e,encode:r,decode:n})=>new Dv(t,e,r,n),$o=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=xv(r,e);return tc({prefix:t,name:e,encode:n,decode:o=>Wd(i(o))})},$v=(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,f=0,h=0;for(let v=0;v<o;++v){const y=i[t[v]];if(y===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|y,l+=r,l>=8&&(l-=8,c[h++]=255&f>>l)}if(l>=r||255&f<<8-l)throw new SyntaxError("Unexpected end of data");return c},Pv=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let f=0;f<t.length;++f)for(l=l<<8|t[f],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})=>tc({prefix:e,name:t,encode(i){return Pv(i,n,r)},decode(i){return $v(i,n,r,t)}}),Tv=tc({prefix:"\0",name:"identity",encode:t=>Iv(t),decode:t=>Cv(t)});var Rv=Object.freeze({__proto__:null,identity:Tv});const Nv=br({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Lv=Object.freeze({__proto__:null,base2:Nv});const Mv=br({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Uv=Object.freeze({__proto__:null,base8:Mv});const jv=$o({prefix:"9",name:"base10",alphabet:"0123456789"});var Fv=Object.freeze({__proto__:null,base10:jv});const Bv=br({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),kv=br({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Hv=Object.freeze({__proto__:null,base16:Bv,base16upper:kv});const zv=br({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Wv=br({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qv=br({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Vv=br({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Kv=br({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Gv=br({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zv=br({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Yv=br({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Jv=br({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Qv=Object.freeze({__proto__:null,base32:zv,base32upper:Wv,base32pad:qv,base32padupper:Vv,base32hex:Kv,base32hexupper:Gv,base32hexpad:Zv,base32hexpadupper:Yv,base32z:Jv});const Xv=$o({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ey=$o({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ty=Object.freeze({__proto__:null,base36:Xv,base36upper:ey});const ry=$o({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ny=$o({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var iy=Object.freeze({__proto__:null,base58btc:ry,base58flickr:ny});const sy=br({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),oy=br({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ay=br({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),cy=br({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var ly=Object.freeze({__proto__:null,base64:sy,base64pad:oy,base64url:ay,base64urlpad:cy});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}"),uy=Vd.reduce((t,e,r)=>(t[r]=e,t),[]),hy=Vd.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function fy(t){return t.reduce((e,r)=>(e+=uy[r],e),"")}function dy(t){const e=[];for(const r of t){const n=hy[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const py=tc({prefix:"\u{1F680}",name:"base256emoji",encode:fy,decode:dy});var gy=Object.freeze({__proto__:null,base256emoji:py}),my=Gd,Kd=128,wy=127,vy=~wy,yy=Math.pow(2,31);function Gd(t,e,r){e=e||[],r=r||0;for(var n=r;t>=yy;)e[r++]=t&255|Kd,t/=128;for(;t&vy;)e[r++]=t&255|Kd,t>>>=7;return e[r]=t|0,Gd.bytes=r-n+1,e}var by=Eu,_y=128,Zd=127;function Eu(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw Eu.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>=_y);return Eu.bytes=o-n,r}var Ey=Math.pow(2,7),xy=Math.pow(2,14),Cy=Math.pow(2,21),Iy=Math.pow(2,28),Sy=Math.pow(2,35),Oy=Math.pow(2,42),Ay=Math.pow(2,49),Dy=Math.pow(2,56),$y=Math.pow(2,63),Py=function(t){return t<Ey?1:t<xy?2:t<Cy?3:t<Iy?4:t<Sy?5:t<Oy?6:t<Ay?7:t<Dy?8:t<$y?9:10},Ty={encode:my,decode:by,encodingLength:Py},Yd=Ty;const Jd=(t,e,r=0)=>(Yd.encode(t,e,r),e),Qd=t=>Yd.encodingLength(t),xu=(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 Ry(t,r,e,o)};class Ry{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 Ny(t,e,r);class Ny{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?xu(this.code,r):r.then(n=>xu(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)),Ly=Xd({name:"sha2-256",code:18,encode:e1("SHA-256")}),My=Xd({name:"sha2-512",code:19,encode:e1("SHA-512")});var Uy=Object.freeze({__proto__:null,sha256:Ly,sha512:My});const t1=0,jy="identity",r1=Wd;var Fy=Object.freeze({__proto__:null,identity:{code:t1,name:jy,encode:r1,digest:t=>xu(t1,r1(t))}});new TextEncoder,new TextDecoder;const n1={...Rv,...Lv,...Uv,...Fv,...Hv,...Qv,...ty,...iy,...ly,...gy};({...Uy,...Fy});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))),Cu=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=zd(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:Cu,ascii:Cu,binary:Cu,...n1};function zr(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?bu(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function $r(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))},By=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),ky=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),Hy=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}(),zy=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Wy=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),qy=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Vy=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,c1=3,Ky=[["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",qy]],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 Gy(t){return t?u1(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Wy:typeof navigator<"u"?u1(navigator.userAgent):Jy()}function Zy(t){return t!==""&&Ky.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=Zy(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new zy;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<c1&&(i=a1(a1([],i,!0),Qy(c1-i.length),!0)):i=[];var o=i.join("."),c=Yy(t),l=Vy.exec(t);return l&&l[1]?new Hy(r,o,c,l[1]):new By(r,o,c)}function Yy(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 Jy(){var t=typeof process<"u"&&process.version;return t?new ky(process.version.slice(1)):null}function Qy(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: ${
|
|
16
|
-
Received: ${Object.keys(e).toString()}`)),
|
|
17
|
-
Required: ${
|
|
18
|
-
Approved: ${
|
|
19
|
-
Required: ${
|
|
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 Iu=function(t,e){return Iu=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])},Iu(t,e)};function Xy(t,e){Iu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Su=function(){return Su=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},Su.apply(this,arguments)};function e5(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 t5(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 r5(t,e){return function(r,n){e(r,n,t)}}function n5(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function i5(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{h(n.next(v))}catch(y){c(y)}}function f(v){try{h(n.throw(v))}catch(y){c(y)}}function h(v){v.done?o(v.value):i(v.value).then(l,f)}h((n=n.apply(t,e||[])).next())})}function s5(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(h){return function(v){return f([h,v])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=h[0]&2?i.return:h[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,h[1])).done)return o;switch(i=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,i=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(v){h=[6,v],i=0}finally{n=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function o5(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function a5(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Ou(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 c5(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(h1(arguments[e]));return t}function l5(){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 Po(t){return this instanceof Po?(this.v=t,this):new Po(t)}function u5(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(b){n[b]&&(i[b]=function(x){return new Promise(function(P,M){o.push([b,x,P,M])>1||l(b,x)})})}function l(b,x){try{f(n[b](x))}catch(P){y(o[0][3],P)}}function f(b){b.value instanceof Po?Promise.resolve(b.value.v).then(h,v):y(o[0][2],b)}function h(b){l("next",b)}function v(b){l("throw",b)}function y(b,x){b(x),o.shift(),o.length&&l(o[0][0],o[0][1])}}function h5(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:Po(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function f5(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 Ou=="function"?Ou(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,f){c=t[o](c),i(l,f,c.done,c.value)})}}function i(o,c,l,f){Promise.resolve(f).then(function(h){o({value:h,done:l})},c)}}function d5(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function p5(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 g5(t){return t&&t.__esModule?t:{default:t}}function m5(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function w5(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 v5=Object.freeze({__proto__:null,__extends:Xy,get __assign(){return Su},__rest:e5,__decorate:t5,__param:r5,__metadata:n5,__awaiter:i5,__generator:s5,__createBinding:o5,__exportStar:a5,__values:Ou,__read:h1,__spread:c5,__spreadArrays:l5,__await:Po,__asyncGenerator:u5,__asyncDelegator:h5,__asyncValues:f5,__makeTemplateObject:d5,__importStar:p5,__importDefault:g5,__classPrivateFieldGet:m5,__classPrivateFieldSet:w5}),rc=As(v5),Au={},To={},f1;function y5(){if(f1)return To;f1=1,Object.defineProperty(To,"__esModule",{value:!0}),To.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return To.delay=t,To}var Hi={},Du={},zi={},d1;function b5(){return d1||(d1=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.ONE_THOUSAND=zi.ONE_HUNDRED=void 0,zi.ONE_HUNDRED=100,zi.ONE_THOUSAND=1e3),zi}var $u={},p1;function _5(){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}($u)),$u}var g1;function m1(){return g1||(g1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=rc;e.__exportStar(b5(),t),e.__exportStar(_5(),t)}(Du)),Du}var w1;function E5(){if(w1)return Hi;w1=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.fromMiliseconds=Hi.toMiliseconds=void 0;const t=m1();function e(n){return n*t.ONE_THOUSAND}Hi.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Hi.fromMiliseconds=r,Hi}var v1;function x5(){return v1||(v1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=rc;e.__exportStar(y5(),t),e.__exportStar(E5(),t)}(Au)),Au}var Ps={},y1;function C5(){if(y1)return Ps;y1=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.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 Ps.Watch=t,Ps.default=t,Ps}var Pu={},Ro={},b1;function I5(){if(b1)return Ro;b1=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.IWatch=void 0;class t{}return Ro.IWatch=t,Ro}var _1;function S5(){return _1||(_1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),rc.__exportStar(I5(),t)}(Pu)),Pu}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=rc;e.__exportStar(x5(),t),e.__exportStar(C5(),t),e.__exportStar(S5(),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=Tu=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 Ts(t){const e=Wi(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}At.getFromWindowOrThrow=Ts;function O5(){return Ts("document")}At.getDocumentOrThrow=O5;function A5(){return Wi("document")}var E1=At.getDocument=A5;function D5(){return Ts("navigator")}At.getNavigatorOrThrow=D5;function $5(){return Wi("navigator")}var Tu=At.getNavigator=$5;function P5(){return Ts("location")}At.getLocationOrThrow=P5;function T5(){return Wi("location")}var x1=At.getLocation=T5;function R5(){return Ts("crypto")}At.getCryptoOrThrow=R5;function N5(){return Wi("crypto")}At.getCrypto=N5;function L5(){return Ts("localStorage")}At.getLocalStorageOrThrow=L5;function M5(){return Wi("localStorage")}At.getLocalStorage=M5;var Ru={};Object.defineProperty(Ru,"__esModule",{value:!0});var C1=Ru.getWindowMetadata=void 0;const I1=At;function U5(){let t,e;try{t=I1.getDocumentOrThrow(),e=I1.getLocationOrThrow()}catch{return null}function r(){const y=t.getElementsByTagName("link"),b=[];for(let x=0;x<y.length;x++){const P=y[x],M=P.getAttribute("rel");if(M&&M.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 V=e.protocol+"//"+e.host;if(H.indexOf("/")===0)V+=H;else{const T=e.pathname.split("/");T.pop();const L=T.join("/");V+=L+"/"+H}b.push(V)}else if(H.indexOf("//")===0){const V=e.protocol+H;b.push(V)}else b.push(H)}}return b}function n(...y){const b=t.getElementsByTagName("meta");for(let x=0;x<b.length;x++){const P=b[x],M=["itemprop","property","name"].map(H=>P.getAttribute(H)).filter(H=>H?y.includes(H):!1);if(M.length&&M){const H=P.getAttribute("content");if(H)return H}}return""}function i(){let y=n("name","og:site_name","og:title","twitter:title");return y||(y=t.title),y}function o(){return n("description","og:description","twitter:description","keywords")}const c=i(),l=o(),f=e.origin,h=r();return{description:l,url:f,icons:h,name:c}}C1=Ru.getWindowMetadata=U5;var No={},j5=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 Nu(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([],Nu(r),Nu(n))}function F5(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(O1)||[],r=1;r<e.length;r++)t=Nu(e,r).join(""),e=t.match(O1)||[];return t}}function B5(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=F5(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 k5=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 B5(t)}},H5=(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)]},z5=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=j5,r=k5,n=H5,i=z5,o=T=>T==null,c=Symbol("encodeFragmentIdentifier");function l(T){switch(T.arrayFormat){case"index":return L=>($,R)=>{const S=$.length;return R===void 0||T.skipNull&&R===null||T.skipEmptyString&&R===""?$:R===null?[...$,[v(L,T),"[",S,"]"].join("")]:[...$,[v(L,T),"[",v(S,T),"]=",v(R,T)].join("")]};case"bracket":return L=>($,R)=>R===void 0||T.skipNull&&R===null||T.skipEmptyString&&R===""?$:R===null?[...$,[v(L,T),"[]"].join("")]:[...$,[v(L,T),"[]=",v(R,T)].join("")];case"colon-list-separator":return L=>($,R)=>R===void 0||T.skipNull&&R===null||T.skipEmptyString&&R===""?$:R===null?[...$,[v(L,T),":list="].join("")]:[...$,[v(L,T),":list=",v(R,T)].join("")];case"comma":case"separator":case"bracket-separator":{const L=T.arrayFormat==="bracket-separator"?"[]=":"=";return $=>(R,S)=>S===void 0||T.skipNull&&S===null||T.skipEmptyString&&S===""?R:(S=S===null?"":S,R.length===0?[[v($,T),L,v(S,T)].join("")]:[[R,v(S,T)].join(T.arrayFormatSeparator)])}default:return L=>($,R)=>R===void 0||T.skipNull&&R===null||T.skipEmptyString&&R===""?$:R===null?[...$,v(L,T)]:[...$,[v(L,T),"=",v(R,T)].join("")]}}function f(T){let L;switch(T.arrayFormat){case"index":return($,R,S)=>{if(L=/\[(\d*)\]$/.exec($),$=$.replace(/\[\d*\]$/,""),!L){S[$]=R;return}S[$]===void 0&&(S[$]={}),S[$][L[1]]=R};case"bracket":return($,R,S)=>{if(L=/(\[\])$/.exec($),$=$.replace(/\[\]$/,""),!L){S[$]=R;return}if(S[$]===void 0){S[$]=[R];return}S[$]=[].concat(S[$],R)};case"colon-list-separator":return($,R,S)=>{if(L=/(:list)$/.exec($),$=$.replace(/:list$/,""),!L){S[$]=R;return}if(S[$]===void 0){S[$]=[R];return}S[$]=[].concat(S[$],R)};case"comma":case"separator":return($,R,S)=>{const d=typeof R=="string"&&R.includes(T.arrayFormatSeparator),C=typeof R=="string"&&!d&&y(R,T).includes(T.arrayFormatSeparator);R=C?y(R,T):R;const J=d||C?R.split(T.arrayFormatSeparator).map(z=>y(z,T)):R===null?R:y(R,T);S[$]=J};case"bracket-separator":return($,R,S)=>{const d=/(\[\])$/.test($);if($=$.replace(/\[\]$/,""),!d){S[$]=R&&y(R,T);return}const C=R===null?[]:R.split(T.arrayFormatSeparator).map(J=>y(J,T));if(S[$]===void 0){S[$]=C;return}S[$]=[].concat(S[$],C)};default:return($,R,S)=>{if(S[$]===void 0){S[$]=R;return}S[$]=[].concat(S[$],R)}}}function h(T){if(typeof T!="string"||T.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function v(T,L){return L.encode?L.strict?e(T):encodeURIComponent(T):T}function y(T,L){return L.decode?r(T):T}function b(T){return Array.isArray(T)?T.sort():typeof T=="object"?b(Object.keys(T)).sort((L,$)=>Number(L)-Number($)).map(L=>T[L]):T}function x(T){const L=T.indexOf("#");return L!==-1&&(T=T.slice(0,L)),T}function P(T){let L="";const $=T.indexOf("#");return $!==-1&&(L=T.slice($)),L}function M(T){T=x(T);const L=T.indexOf("?");return L===-1?"":T.slice(L+1)}function H(T,L){return L.parseNumbers&&!Number.isNaN(Number(T))&&typeof T=="string"&&T.trim()!==""?T=Number(T):L.parseBooleans&&T!==null&&(T.toLowerCase()==="true"||T.toLowerCase()==="false")&&(T=T.toLowerCase()==="true"),T}function V(T,L){L=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},L),h(L.arrayFormatSeparator);const $=f(L),R=Object.create(null);if(typeof T!="string"||(T=T.trim().replace(/^[?#&]/,""),!T))return R;for(const S of T.split("&")){if(S==="")continue;let[d,C]=n(L.decode?S.replace(/\+/g," "):S,"=");C=C===void 0?null:["comma","separator","bracket-separator"].includes(L.arrayFormat)?C:y(C,L),$(y(d,L),C,R)}for(const S of Object.keys(R)){const d=R[S];if(typeof d=="object"&&d!==null)for(const C of Object.keys(d))d[C]=H(d[C],L);else R[S]=H(d,L)}return L.sort===!1?R:(L.sort===!0?Object.keys(R).sort():Object.keys(R).sort(L.sort)).reduce((S,d)=>{const C=R[d];return C&&typeof C=="object"&&!Array.isArray(C)?S[d]=b(C):S[d]=C,S},Object.create(null))}t.extract=M,t.parse=V,t.stringify=(T,L)=>{if(!T)return"";L=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},L),h(L.arrayFormatSeparator);const $=C=>L.skipNull&&o(T[C])||L.skipEmptyString&&T[C]==="",R=l(L),S={};for(const C of Object.keys(T))$(C)||(S[C]=T[C]);const d=Object.keys(S);return L.sort!==!1&&d.sort(L.sort),d.map(C=>{const J=T[C];return J===void 0?"":J===null?v(C,L):Array.isArray(J)?J.length===0&&L.arrayFormat==="bracket-separator"?v(C,L)+"[]":J.reduce(R(C),[]).join("&"):v(C,L)+"="+v(J,L)}).filter(C=>C.length>0).join("&")},t.parseUrl=(T,L)=>{L=Object.assign({decode:!0},L);const[$,R]=n(T,"#");return Object.assign({url:$.split("?")[0]||"",query:V(M(T),L)},L&&L.parseFragmentIdentifier&&R?{fragmentIdentifier:y(R,L)}:{})},t.stringifyUrl=(T,L)=>{L=Object.assign({encode:!0,strict:!0,[c]:!0},L);const $=x(T.url).split("?")[0]||"",R=t.extract(T.url),S=t.parse(R,{sort:!1}),d=Object.assign(S,T.query);let C=t.stringify(d,L);C&&(C=`?${C}`);let J=P(T.url);return T.fragmentIdentifier&&(J=`#${L[c]?v(T.fragmentIdentifier,L):T.fragmentIdentifier}`),`${$}${C}${J}`},t.pick=(T,L,$)=>{$=Object.assign({parseFragmentIdentifier:!0,[c]:!1},$);const{url:R,query:S,fragmentIdentifier:d}=t.parseUrl(T,$);return t.stringifyUrl({url:R,query:i(S,L),fragmentIdentifier:d},$)},t.exclude=(T,L,$)=>{const R=Array.isArray(L)?S=>!L.includes(S):(S,d)=>!L(S,d);return t.pick(T,R,$)}})(No);const W5={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"}},q5=":";function V5(t){const[e,r]=t.split(q5);return{namespace:e,reference:r}}function K5(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",Pr="base16",Lu="base64pad",Mu="utf8",P1=0,qi=1,G5=0,T1=1,Uu=12,ju=32;function Z5(){const t=yu.generateKeyPair();return{privateKey:$r(t.secretKey,Pr),publicKey:$r(t.publicKey,Pr)}}function Fu(){const t=$s.randomBytes(ju);return $r(t,Pr)}function Y5(t,e){const r=yu.sharedKey(zr(t,Pr),zr(e,Pr),!0),n=new uv(ec.SHA256,r).expand(ju);return $r(n,Pr)}function J5(t){const e=ec.hash(zr(t,Pr));return $r(e,Pr)}function Rs(t){const e=ec.hash(zr(t,Mu));return $r(e,Pr)}function Q5(t){return zr(`${t}`,$1)}function Lo(t){return Number($r(t,$1))}function X5(t){const e=Q5(typeof t.type<"u"?t.type:P1);if(Lo(e)===qi&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?zr(t.senderPublicKey,Pr):void 0,n=typeof t.iv<"u"?zr(t.iv,Pr):$s.randomBytes(Uu),i=new fu.ChaCha20Poly1305(zr(t.symKey,Pr)).seal(n,zr(t.message,Mu));return tb({type:e,sealed:i,iv:n,senderPublicKey:r})}function eb(t){const e=new fu.ChaCha20Poly1305(zr(t.symKey,Pr)),{sealed:r,iv:n}=nc(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return $r(i,Mu)}function tb(t){if(Lo(t.type)===qi){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return $r(_u([t.type,t.senderPublicKey,t.iv,t.sealed]),Lu)}return $r(_u([t.type,t.iv,t.sealed]),Lu)}function nc(t){const e=zr(t,Lu),r=e.slice(G5,T1),n=T1;if(Lo(r)===qi){const l=n+ju,f=l+Uu,h=e.slice(n,l),v=e.slice(l,f),y=e.slice(f);return{type:r,sealed:y,iv:v,senderPublicKey:h}}const i=n+Uu,o=e.slice(n,i),c=e.slice(i);return{type:r,sealed:c,iv:o}}function rb(t,e){const r=nc(t);return R1({type:Lo(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?$r(r.senderPublicKey,Pr):void 0,receiverPublicKey:e?.receiverPublicKey})}function R1(t){const e=t?.type||P1;if(e===qi){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===qi&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var nb=Object.defineProperty,L1=Object.getOwnPropertySymbols,ib=Object.prototype.hasOwnProperty,sb=Object.prototype.propertyIsEnumerable,M1=(t,e,r)=>e in t?nb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,U1=(t,e)=>{for(var r in e||(e={}))ib.call(e,r)&&M1(t,r,e[r]);if(L1)for(var r of L1(e))sb.call(e,r)&&M1(t,r,e[r]);return t};const ob="ReactNative",en={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},ab="js";function Bu(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Ns(){return!E1()&&!!Tu()&&navigator.product===ob}function Mo(){return!Bu()&&!!Tu()}function Uo(){return Ns()?en.reactNative:Bu()?en.node:Mo()?en.browser:en.unknown}function cb(){var t;try{return Ns()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function lb(t,e){let r=No.parse(t);return r=U1(U1({},r),e),t=No.stringify(r),t}function ub(){return C1()||{name:"",description:"",url:"",icons:[""]}}function hb(){if(Uo()===en.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=Gy();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 fb(){var t;const e=Uo();return e===en.browser?[e,((t=x1())==null?void 0:t.host)||"unknown"].join(":"):e}function db(t,e,r){const n=hb(),i=fb();return[[t,e].join("-"),[ab,r].join("-"),n,i].join("/")}function pb({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:c,bundleId:l}){const f=r.split("?"),h=db(t,e,n),v={auth:i,ua:h,projectId:o,useOnCloseEvent:c||void 0,origin:l||void 0},y=lb(f[1]||"",v);return f[0]+"?"+y}function Vi(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 Ls(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 jo(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 gb(t){return B1("topic",t)}function mb(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 Cn(t,e){return Te.fromMiliseconds((e||Date.now())+Te.toMiliseconds(t))}function mi(t){return Date.now()>=Te.toMiliseconds(t)}function tr(t,e){return`${t}${e?`:${e}`:""}`}function ku(t=[],e=[]){return[...new Set([...t,...e])]}async function wb({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=Uo();c===en.browser?o.startsWith("https://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,"_self","noreferrer noopener"):c===en.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(n){console.error(n)}}const vb="irn";function Hu(t){return t?.relay||{protocol:vb}}function ic(t){const e=W5[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var yb=Object.defineProperty,H1=Object.getOwnPropertySymbols,bb=Object.prototype.hasOwnProperty,_b=Object.prototype.propertyIsEnumerable,z1=(t,e,r)=>e in t?yb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Eb=(t,e)=>{for(var r in e||(e={}))bb.call(e,r)&&z1(t,r,e[r]);if(H1)for(var r of H1(e))_b.call(e,r)&&z1(t,r,e[r]);return t};function xb(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 Cb(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=No.parse(o);return{protocol:n,topic:Ib(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:xb(c)}}function Ib(t){return t.startsWith("//")?t.substring(2):t}function Sb(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 Ob(t){return`${t.protocol}:${t.topic}@${t.version}?`+No.stringify(Eb({symKey:t.symKey},Sb(t.relay)))}function Ms(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Ab(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Ms(r.accounts))}),e}function Db(t,e){const r=[];return Object.values(t).forEach(n=>{Ms(n.accounts).includes(e)&&r.push(...n.methods)}),r}function $b(t,e){const r=[];return Object.values(t).forEach(n=>{Ms(n.accounts).includes(e)&&r.push(...n.events)}),r}function Pb(t,e){const r=oc(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 zu(t){return t.includes(":")}function Fo(t){return zu(t)?t.split(":")[0]:t}const Tb={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}},Rb={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}=Rb[t];return{message:e?`${r} ${e}`:r,code:n}}function Yt(t,e){const{message:r,code:n}=Tb[t];return{message:e?`${r} ${e}`:r,code:n}}function Nn(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Us(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Tr(t){return typeof t>"u"}function dr(t,e){return e&&Tr(t)?!0:typeof t=="string"&&!!t.trim().length}function Wu(t,e){return e&&Tr(t)?!0:typeof t=="number"&&!isNaN(t)}function Nb(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let o=!0;return Vi(i,n)?(n.forEach(c=>{const{accounts:l,methods:f,events:h}=t.namespaces[c],v=Ms(l),y=r[c];(!Vi(D1(c,y),v)||!Vi(y.methods,f)||!Vi(y.events,h))&&(o=!1)}),o):!1}function sc(t){return dr(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Lb(t){if(dr(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&sc(r)}}return!1}function Mb(t){if(dr(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function Ub(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function jb(t){return t?.topic}function Fb(t,e){let r=null;return dr(t?.publicKey,!1)||(r=_e("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function W1(t){let e=!0;return Nn(t)?t.length&&(e=t.every(r=>dr(r,!1))):e=!1,e}function Bb(t,e,r){let n=null;return Nn(e)&&e.length?e.forEach(i=>{n||sc(i)||(n=Yt("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):sc(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 kb(t,e,r){let n=null;return Object.entries(t).forEach(([i,o])=>{if(n)return;const c=Bb(i,D1(i,o),`${e} ${r}`);c&&(n=c)}),n}function Hb(t,e){let r=null;return Nn(t)?t.forEach(n=>{r||Lb(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=Hb(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function Wb(t,e){let r=null;return W1(t?.methods)?W1(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=Wb(n,`${e}, namespace`);i&&(r=i)}),r}function qb(t,e,r){let n=null;if(t&&Us(t)){const i=q1(t,e);i&&(n=i);const o=kb(t,e,r);o&&(n=o)}else n=_e("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function oc(t,e){let r=null;if(t&&Us(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 dr(t.protocol,!0)}function Vb(t,e){let r=!1;return e&&!t?r=!0:t&&Nn(t)&&t.length&&t.forEach(n=>{r=V1(n)}),r}function Kb(t){return typeof t=="number"}function Wr(t){return typeof t<"u"&&typeof t!==null}function Gb(t){return!(!t||typeof t!="object"||!t.code||!Wu(t.code,!1)||!t.message||!dr(t.message,!1))}function Zb(t){return!(Tr(t)||!dr(t.method,!1))}function Yb(t){return!(Tr(t)||Tr(t.result)&&Tr(t.error)||!Wu(t.id,!1)||!dr(t.jsonrpc,!1))}function Jb(t){return!(Tr(t)||!dr(t.name,!1))}function K1(t,e){return!(!sc(e)||!Ab(t).includes(e))}function Qb(t,e,r){return dr(r,!1)?Db(t,e).includes(r):!1}function Xb(t,e,r){return dr(r,!1)?$b(t,e).includes(r):!1}function G1(t,e,r){let n=null;const i=e6(t),o=t6(e),c=Object.keys(i),l=Object.keys(o),f=Z1(Object.keys(t)),h=Z1(Object.keys(e)),v=f.filter(y=>!h.includes(y));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()}`)),Vi(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(y=>{if(!y.includes(":")||n)return;const b=Ms(e[y].accounts);b.includes(y)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${y}
|
|
19
|
+
Required: ${y}
|
|
20
|
+
Approved: ${b.toString()}`))}),c.forEach(y=>{n||(Vi(i[y].methods,o[y].methods)?Vi(i[y].events,o[y].events)||(n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${y}`)):n=_e("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${y}`))}),n}function e6(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 t6(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Ms(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 r6(t,e){return Wu(t,!1)&&t<=e.max&&t>=e.min}function Y1(){const t=Uo();return new Promise(e=>{switch(t){case en.browser:e(n6());break;case en.reactNative:e(i6());break;case en.node:e(s6());break;default:e(!0)}})}function n6(){return Mo()&&navigator?.onLine}async function i6(){if(Ns()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t?.isConnected}return!0}function s6(){return!0}function o6(t){switch(Uo()){case en.browser:a6(t);break;case en.reactNative:c6(t);break}}function a6(t){!Ns()&&Mo()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function c6(t){Ns()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(e=>t(e?.isConnected))}const qu={};class ac{static get(e){return qu[e]}static set(e,r){qu[e]=r}static delete(e){delete qu[e]}}const l6=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,u6=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,h6=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function f6(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){d6(t);return}return e}function d6(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function cc(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.at(-1)==='"'&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!h6.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(l6.test(t)||u6.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,f6)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}function p6(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function pr(t,...e){try{return p6(t(...e))}catch(r){return Promise.reject(r)}}function g6(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function m6(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function lc(t){if(g6(t))return String(t);if(m6(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return lc(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function J1(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const Vu="base64:";function w6(t){if(typeof t=="string")return t;J1();const e=Buffer.from(t).toString("base64");return Vu+e}function v6(t){return typeof t!="string"||!t.startsWith(Vu)?t:(J1(),Buffer.from(t.slice(Vu.length),"base64"))}function qr(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function y6(...t){return qr(t.join(":"))}function uc(t){return t=qr(t),t?t+":":""}function oL(t){return t}const b6="memory",_6=()=>{const t=new Map;return{name:b6,options:{},hasItem(e){return t.has(e)},getItem(e){return t.get(e)||null},getItemRaw(e){return t.get(e)||null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return Array.from(t.keys())},clear(){t.clear()},dispose(){t.clear()}}};function E6(t={}){const e={mounts:{"":t.driver||_6()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=h=>{for(const v of e.mountpoints)if(h.startsWith(v))return{base:v,relativeKey:h.slice(v.length),driver:e.mounts[v]};return{base:"",relativeKey:h,driver:e.mounts[""]}},n=(h,v)=>e.mountpoints.filter(y=>y.startsWith(h)||v&&h.startsWith(y)).map(y=>({relativeBase:h.length>y.length?h.slice(y.length):void 0,mountpoint:y,driver:e.mounts[y]})),i=(h,v)=>{if(e.watching){v=qr(v);for(const y of e.watchListeners)y(h,v)}},o=async()=>{if(!e.watching){e.watching=!0;for(const h in e.mounts)e.unwatch[h]=await Q1(e.mounts[h],i,h)}},c=async()=>{if(e.watching){for(const h in e.unwatch)await e.unwatch[h]();e.unwatch={},e.watching=!1}},l=(h,v,y)=>{const b=new Map,x=P=>{let M=b.get(P.base);return M||(M={driver:P.driver,base:P.base,items:[]},b.set(P.base,M)),M};for(const P of h){const M=typeof P=="string",H=qr(M?P:P.key),V=M?void 0:P.value,T=M||!P.options?v:{...v,...P.options},L=r(H);x(L).items.push({key:H,value:V,relativeKey:L.relativeKey,options:T})}return Promise.all([...b.values()].map(P=>y(P))).then(P=>P.flat())},f={hasItem(h,v={}){h=qr(h);const{relativeKey:y,driver:b}=r(h);return pr(b.hasItem,y,v)},getItem(h,v={}){h=qr(h);const{relativeKey:y,driver:b}=r(h);return pr(b.getItem,y,v).then(x=>cc(x))},getItems(h,v){return l(h,v,y=>y.driver.getItems?pr(y.driver.getItems,y.items.map(b=>({key:b.relativeKey,options:b.options})),v).then(b=>b.map(x=>({key:y6(y.base,x.key),value:cc(x.value)}))):Promise.all(y.items.map(b=>pr(y.driver.getItem,b.relativeKey,b.options).then(x=>({key:b.key,value:cc(x)})))))},getItemRaw(h,v={}){h=qr(h);const{relativeKey:y,driver:b}=r(h);return b.getItemRaw?pr(b.getItemRaw,y,v):pr(b.getItem,y,v).then(x=>v6(x))},async setItem(h,v,y={}){if(v===void 0)return f.removeItem(h);h=qr(h);const{relativeKey:b,driver:x}=r(h);x.setItem&&(await pr(x.setItem,b,lc(v),y),x.watch||i("update",h))},async setItems(h,v){await l(h,v,async y=>{y.driver.setItems&&await pr(y.driver.setItems,y.items.map(b=>({key:b.relativeKey,value:lc(b.value),options:b.options})),v),y.driver.setItem&&await Promise.all(y.items.map(b=>pr(y.driver.setItem,b.relativeKey,lc(b.value),b.options)))})},async setItemRaw(h,v,y={}){if(v===void 0)return f.removeItem(h,y);h=qr(h);const{relativeKey:b,driver:x}=r(h);if(x.setItemRaw)await pr(x.setItemRaw,b,v,y);else if(x.setItem)await pr(x.setItem,b,w6(v),y);else return;x.watch||i("update",h)},async removeItem(h,v={}){typeof v=="boolean"&&(v={removeMeta:v}),h=qr(h);const{relativeKey:y,driver:b}=r(h);b.removeItem&&(await pr(b.removeItem,y,v),(v.removeMeta||v.removeMata)&&await pr(b.removeItem,y+"$",v),b.watch||i("remove",h))},async getMeta(h,v={}){typeof v=="boolean"&&(v={nativeOnly:v}),h=qr(h);const{relativeKey:y,driver:b}=r(h),x=Object.create(null);if(b.getMeta&&Object.assign(x,await pr(b.getMeta,y,v)),!v.nativeOnly){const P=await pr(b.getItem,y+"$",v).then(M=>cc(M));P&&typeof P=="object"&&(typeof P.atime=="string"&&(P.atime=new Date(P.atime)),typeof P.mtime=="string"&&(P.mtime=new Date(P.mtime)),Object.assign(x,P))}return x},setMeta(h,v,y={}){return this.setItem(h+"$",v,y)},removeMeta(h,v={}){return this.removeItem(h+"$",v)},async getKeys(h,v={}){h=uc(h);const y=n(h,!0);let b=[];const x=[];for(const P of y){const H=(await pr(P.driver.getKeys,P.relativeBase,v)).map(V=>P.mountpoint+qr(V)).filter(V=>!b.some(T=>V.startsWith(T)));x.push(...H),b=[P.mountpoint,...b.filter(V=>!V.startsWith(P.mountpoint))]}return h?x.filter(P=>P.startsWith(h)&&!P.endsWith("$")):x.filter(P=>!P.endsWith("$"))},async clear(h,v={}){h=uc(h),await Promise.all(n(h,!1).map(async y=>{if(y.driver.clear)return pr(y.driver.clear,y.relativeBase,v);if(y.driver.removeItem){const b=await y.driver.getKeys(y.relativeBase||"",v);return Promise.all(b.map(x=>y.driver.removeItem(x,v)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(h=>X1(h)))},async watch(h){return await o(),e.watchListeners.push(h),async()=>{e.watchListeners=e.watchListeners.filter(v=>v!==h),e.watchListeners.length===0&&await c()}},async unwatch(){e.watchListeners=[],await c()},mount(h,v){if(h=uc(h),h&&e.mounts[h])throw new Error(`already mounted at ${h}`);return h&&(e.mountpoints.push(h),e.mountpoints.sort((y,b)=>b.length-y.length)),e.mounts[h]=v,e.watching&&Promise.resolve(Q1(v,i,h)).then(y=>{e.unwatch[h]=y}).catch(console.error),f},async unmount(h,v=!0){h=uc(h),!(!h||!e.mounts[h])&&(e.watching&&h in e.unwatch&&(e.unwatch[h](),delete e.unwatch[h]),v&&await X1(e.mounts[h]),e.mountpoints=e.mountpoints.filter(y=>y!==h),delete e.mounts[h])},getMount(h=""){h=qr(h)+":";const v=r(h);return{driver:v.driver,base:v.base}},getMounts(h="",v={}){return h=qr(h),n(h,v.parents).map(b=>({driver:b.driver,base:b.mountpoint}))}};return f}function Q1(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function X1(t){typeof t.dispose=="function"&&await pr(t.dispose)}function Ki(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function ep(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=Ki(r);return(i,o)=>n.then(c=>o(c.transaction(e,i).objectStore(e)))}let Ku;function Bo(){return Ku||(Ku=ep("keyval-store","keyval")),Ku}function tp(t,e=Bo()){return e("readonly",r=>Ki(r.get(t)))}function x6(t,e,r=Bo()){return r("readwrite",n=>(n.put(e,t),Ki(n.transaction)))}function C6(t,e=Bo()){return e("readwrite",r=>(r.delete(t),Ki(r.transaction)))}function I6(t=Bo()){return t("readwrite",e=>(e.clear(),Ki(e.transaction)))}function S6(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Ki(t.transaction)}function O6(t=Bo()){return t("readonly",e=>{if(e.getAllKeys)return Ki(e.getAllKeys());const r=[];return S6(e,n=>r.push(n.key)).then(()=>r)})}const A6=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),D6=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 ko(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return D6(t)}catch{return t}}function Gi(t){return typeof t=="string"?t:A6(t)||""}const $6="idb-keyval";var P6=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=ep(t.dbName,t.storeName)),{name:$6,options:t,async hasItem(i){return!(typeof await tp(r(i),n)>"u")},async getItem(i){return await tp(r(i),n)??null},setItem(i,o){return x6(r(i),o,n)},removeItem(i){return C6(r(i),n)},getKeys(){return O6(n)},clear(){return I6(n)}}};const T6="WALLET_CONNECT_V2_INDEXED_DB",R6="keyvaluestorage";class N6{constructor(){this.indexedDb=E6({driver:P6({dbName:T6,storeName:R6})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,Gi(r))}async removeItem(e){await this.indexedDb.removeItem(e)}}var Gu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},hc={exports:{}};(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 Gu<"u"&&Gu.localStorage?hc.exports=Gu.localStorage:typeof window<"u"&&window.localStorage?hc.exports=window.localStorage:hc.exports=new e})();function L6(t){var e;return[t[0],ko((e=t[1])!=null?e:"")]}class M6{constructor(){this.localStorage=hc.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(L6)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return ko(r)}async setItem(e,r){this.localStorage.setItem(e,Gi(r))}async removeItem(e){this.localStorage.removeItem(e)}}const U6="wc_storage_version",rp=1,j6=async(t,e,r)=>{const n=U6,i=await e.getItem(n);if(i&&i>=rp){r(e);return}const o=await t.getKeys();if(!o.length){r(e);return}const c=[];for(;o.length;){const l=o.shift();if(!l)continue;const f=l.toLowerCase();if(f.includes("wc@")||f.includes("walletconnect")||f.includes("wc_")||f.includes("wallet_connect")){const h=await t.getItem(l);await e.setItem(l,h),c.push(l)}}await e.setItem(n,rp),r(e),F6(t,c)},F6=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};class B6{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new M6;this.storage=e;try{const r=new N6;j6(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}}var js={};/*! *****************************************************************************
|
|
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
|
|
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 k6(t,e){Zu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Yu=function(){return Yu=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},Yu.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 z6(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 W6(t,e){return function(r,n){e(r,n,t)}}function q6(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function V6(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{h(n.next(v))}catch(y){c(y)}}function f(v){try{h(n.throw(v))}catch(y){c(y)}}function h(v){v.done?o(v.value):i(v.value).then(l,f)}h((n=n.apply(t,e||[])).next())})}function K6(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(h){return function(v){return f([h,v])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=h[0]&2?i.return:h[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,h[1])).done)return o;switch(i=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,i=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(v){h=[6,v],i=0}finally{n=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function G6(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Z6(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Ju(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 np(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(np(arguments[e]));return t}function J6(){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 Q6(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(b){n[b]&&(i[b]=function(x){return new Promise(function(P,M){o.push([b,x,P,M])>1||l(b,x)})})}function l(b,x){try{f(n[b](x))}catch(P){y(o[0][3],P)}}function f(b){b.value instanceof Ho?Promise.resolve(b.value.v).then(h,v):y(o[0][2],b)}function h(b){l("next",b)}function v(b){l("throw",b)}function y(b,x){b(x),o.shift(),o.length&&l(o[0][0],o[0][1])}}function X6(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 e4(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 Ju=="function"?Ju(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,f){c=t[o](c),i(l,f,c.done,c.value)})}}function i(o,c,l,f){Promise.resolve(f).then(function(h){o({value:h,done:l})},c)}}function t4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function r4(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 n4(t){return t&&t.__esModule?t:{default:t}}function i4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function s4(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 o4=Object.freeze({__proto__:null,__extends:k6,get __assign(){return Yu},__rest:H6,__decorate:z6,__param:W6,__metadata:q6,__awaiter:V6,__generator:K6,__createBinding:G6,__exportStar:Z6,__values:Ju,__read:np,__spread:Y6,__spreadArrays:J6,__await:Ho,__asyncGenerator:Q6,__asyncDelegator:X6,__asyncValues:e4,__makeTemplateObject:t4,__importStar:r4,__importDefault:n4,__classPrivateFieldGet:i4,__classPrivateFieldSet:s4}),fc=As(o4),zo={},Qu={},Wo={};class Zi{}var a4=Object.freeze({__proto__:null,IEvents:Zi}),c4=As(a4),ip;function l4(){if(ip)return Wo;ip=1,Object.defineProperty(Wo,"__esModule",{value:!0}),Wo.IHeartBeat=void 0;const t=c4;class e extends t.IEvents{constructor(n){super()}}return Wo.IHeartBeat=e,Wo}var sp;function op(){return sp||(sp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),fc.__exportStar(l4(),t)}(Qu)),Qu}var Xu={},Yi={},ap;function u4(){if(ap)return Yi;ap=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.HEARTBEAT_EVENTS=Yi.HEARTBEAT_INTERVAL=void 0;const t=Te;return Yi.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,Yi.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Yi}var cp;function lp(){return cp||(cp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),fc.__exportStar(u4(),t)}(Xu)),Xu}var up;function h4(){if(up)return zo;up=1,Object.defineProperty(zo,"__esModule",{value:!0}),zo.HeartBeat=void 0;const t=fc,e=yr.exports,r=Te,n=op(),i=lp();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 f=new o(l);return yield f.init(),f})}init(){return t.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(l,f){this.events.on(l,f)}once(l,f){this.events.once(l,f)}off(l,f){this.events.off(l,f)}removeListener(l,f){this.events.removeListener(l,f)}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 zo.HeartBeat=o,zo}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=fc;e.__exportStar(h4(),t),e.__exportStar(op(),t),e.__exportStar(lp(),t)})(js);var pt={};/*! *****************************************************************************
|
|
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 eh=function(t,e){return eh=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])},eh(t,e)};function f4(t,e){eh(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var th=function(){return th=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},th.apply(this,arguments)};function d4(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 p4(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 g4(t,e){return function(r,n){e(r,n,t)}}function m4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function w4(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{h(n.next(v))}catch(y){c(y)}}function f(v){try{h(n.throw(v))}catch(y){c(y)}}function h(v){v.done?o(v.value):i(v.value).then(l,f)}h((n=n.apply(t,e||[])).next())})}function v4(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(h){return function(v){return f([h,v])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=h[0]&2?i.return:h[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,h[1])).done)return o;switch(i=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,i=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(v){h=[6,v],i=0}finally{n=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function y4(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function b4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function rh(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 hp(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 _4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(hp(arguments[e]));return t}function E4(){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 x4(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(b){n[b]&&(i[b]=function(x){return new Promise(function(P,M){o.push([b,x,P,M])>1||l(b,x)})})}function l(b,x){try{f(n[b](x))}catch(P){y(o[0][3],P)}}function f(b){b.value instanceof qo?Promise.resolve(b.value.v).then(h,v):y(o[0][2],b)}function h(b){l("next",b)}function v(b){l("throw",b)}function y(b,x){b(x),o.shift(),o.length&&l(o[0][0],o[0][1])}}function C4(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 I4(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 rh=="function"?rh(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,f){c=t[o](c),i(l,f,c.done,c.value)})}}function i(o,c,l,f){Promise.resolve(f).then(function(h){o({value:h,done:l})},c)}}function S4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function O4(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 A4(t){return t&&t.__esModule?t:{default:t}}function D4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function $4(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 P4=Object.freeze({__proto__:null,__extends:f4,get __assign(){return th},__rest:d4,__decorate:p4,__param:g4,__metadata:m4,__awaiter:w4,__generator:v4,__createBinding:y4,__exportStar:b4,__values:rh,__read:hp,__spread:_4,__spreadArrays:E4,__await:qo,__asyncGenerator:x4,__asyncDelegator:C4,__asyncValues:I4,__makeTemplateObject:S4,__importStar:O4,__importDefault:A4,__classPrivateFieldGet:D4,__classPrivateFieldSet:$4}),T4=As(P4),nh,fp;function R4(){if(fp)return nh;fp=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}nh=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 f=new Array(l);f[0]=o(r);for(var h=1;h<l;h++)f[h]=o(n[h]);return f.join(" ")}if(typeof r!="string")return r;var v=n.length;if(v===0)return r;for(var y="",b=1-c,x=-1,P=r&&r.length||0,M=0;M<P;){if(r.charCodeAt(M)===37&&M+1<P){switch(x=x>-1?x:0,r.charCodeAt(M+1)){case 100:case 102:if(b>=v||n[b]==null)break;x<M&&(y+=r.slice(x,M)),y+=Number(n[b]),x=M+2,M++;break;case 105:if(b>=v||n[b]==null)break;x<M&&(y+=r.slice(x,M)),y+=Math.floor(Number(n[b])),x=M+2,M++;break;case 79:case 111:case 106:if(b>=v||n[b]===void 0)break;x<M&&(y+=r.slice(x,M));var H=typeof n[b];if(H==="string"){y+="'"+n[b]+"'",x=M+2,M++;break}if(H==="function"){y+=n[b].name||"<anonymous>",x=M+2,M++;break}y+=o(n[b]),x=M+2,M++;break;case 115:if(b>=v)break;x<M&&(y+=r.slice(x,M)),y+=String(n[b]),x=M+2,M++;break;case 37:x<M&&(y+=r.slice(x,M)),y+="%",x=M+2,M++,b--;break}++b}++M}return x===-1?r:(x<P&&(y+=r.slice(x)),y)}return nh}var ih,dp;function N4(){if(dp)return ih;dp=1;const t=R4();ih=i;const e=R().console||{},r={mapHttpRequest:P,mapHttpResponse:P,wrapRequestSerializer:M,wrapResponseSerializer:M,wrapErrorSerializer:M,req:P,res:P,err:b};function n(S,d){return Array.isArray(S)?S.filter(function(J){return J!=="!stdSerializers.err"}):S===!0?Object.keys(d):!1}function i(S){S=S||{},S.browser=S.browser||{};const d=S.browser.transmit;if(d&&typeof d.send!="function")throw Error("pino: transmit option must have a send function");const C=S.browser.write||e;S.browser.write&&(S.browser.asObject=!0);const J=S.serializers||{},z=n(S.browser.serialize,J);let ee=S.browser.serialize;Array.isArray(S.browser.serialize)&&S.browser.serialize.indexOf("!stdSerializers.err")>-1&&(ee=!1);const de=["error","fatal","warn","info","debug","trace"];typeof C=="function"&&(C.error=C.fatal=C.warn=C.info=C.debug=C.trace=C),S.enabled===!1&&(S.level="silent");const me=S.level||"info",O=Object.create(C);O.log||(O.log=H),Object.defineProperty(O,"levelVal",{get:ce}),Object.defineProperty(O,"level",{get:le,set:re});const j={transmit:d,serialize:z,asObject:S.browser.asObject,levels:de,timestamp:x(S)};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=z,O._stdErrSerialize=ee,O.child=ne,d&&(O._logEvent=y());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(j,O,"error","log"),o(j,O,"fatal","error"),o(j,O,"warn","error"),o(j,O,"info","log"),o(j,O,"debug","log"),o(j,O,"trace","log")}function ne(ae,ie){if(!ae)throw new Error("missing bindings for child Pino");ie=ie||{},z&&ae.serializers&&(ie.serializers=ae.serializers);const Ae=ie.serializers;if(z&&Ae){var ge=Object.assign({},J,Ae),Be=S.browser.serialize===!0?Object.keys(ge):z;delete ae.serializers,f([ae],Be,ge,this._stdErrSerialize)}function ye(Me){this._childLevel=(Me._childLevel|0)+1,this.error=h(Me,ae,"error"),this.fatal=h(Me,ae,"fatal"),this.warn=h(Me,ae,"warn"),this.info=h(Me,ae,"info"),this.debug=h(Me,ae,"debug"),this.trace=h(Me,ae,"trace"),ge&&(this.serializers=ge,this._serialize=Be),d&&(this._logEvent=y([].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:V,epochTime:T,unixTime:L,isoTime:$});function o(S,d,C,J){const z=Object.getPrototypeOf(d);d[C]=d.levelVal>d.levels.values[C]?H:z[C]?z[C]:e[C]||e[J]||H,c(S,d,C)}function c(S,d,C){!S.transmit&&d[C]===H||(d[C]=function(J){return function(){const ee=S.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(S.serialize&&!S.asObject&&f(de,this._serialize,this.serializers,this._stdErrSerialize),S.asObject?J.call(me,l(this,C,de,ee)):J.apply(me,de),S.transmit){const j=S.transmit.level||d.level,ce=i.levels.values[j],le=i.levels.values[C];if(le<ce)return;v(this,{ts:ee,methodLevel:C,methodValue:le,transmitLevel:j,transmitValue:i.levels.values[S.transmit.level||d.level],send:S.transmit.send,val:d.levelVal},de)}}}(d[C]))}function l(S,d,C,J){S._serialize&&f(C,S._serialize,S.serializers,S._stdErrSerialize);const z=C.slice();let ee=z[0];const de={};J&&(de.time=J),de.level=i.levels.values[d];let me=(S._childLevel|0)+1;if(me<1&&(me=1),ee!==null&&typeof ee=="object"){for(;me--&&typeof z[0]=="object";)Object.assign(de,z.shift());ee=z.length?t(z.shift(),z):void 0}else typeof ee=="string"&&(ee=t(z.shift(),z));return ee!==void 0&&(de.msg=ee),de}function f(S,d,C,J){for(const z in S)if(J&&S[z]instanceof Error)S[z]=i.stdSerializers.err(S[z]);else if(typeof S[z]=="object"&&!Array.isArray(S[z]))for(const ee in S[z])d&&d.indexOf(ee)>-1&&ee in C&&(S[z][ee]=C[ee](S[z][ee]))}function h(S,d,C){return function(){const J=new Array(1+arguments.length);J[0]=d;for(var z=1;z<J.length;z++)J[z]=arguments[z-1];return S[C].apply(this,J)}}function v(S,d,C){const J=d.send,z=d.ts,ee=d.methodLevel,de=d.methodValue,me=d.val,O=S._logEvent.bindings;f(C,S._serialize||Object.keys(S.serializers),S.serializers,S._stdErrSerialize===void 0?!0:S._stdErrSerialize),S._logEvent.ts=z,S._logEvent.messages=C.filter(function(j){return O.indexOf(j)===-1}),S._logEvent.level.label=ee,S._logEvent.level.value=de,J(ee,S._logEvent,me),S._logEvent=y(O)}function y(S){return{ts:0,messages:[],bindings:S||[],level:{label:"",value:0}}}function b(S){const d={type:S.constructor.name,msg:S.message,stack:S.stack};for(const C in S)d[C]===void 0&&(d[C]=S[C]);return d}function x(S){return typeof S.timestamp=="function"?S.timestamp:S.timestamp===!1?V:T}function P(){return{}}function M(S){return S}function H(){}function V(){return!1}function T(){return Date.now()}function L(){return Math.round(Date.now()/1e3)}function $(){return new Date(Date.now()).toISOString()}function R(){function S(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 S(self)||S(window)||S(this)||{}}}return ih}var Ji={},pp;function gp(){return pp||(pp=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.PINO_CUSTOM_CONTEXT_KEY=Ji.PINO_LOGGER_DEFAULTS=void 0,Ji.PINO_LOGGER_DEFAULTS={level:"info"},Ji.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Ji}var Rr={},mp;function L4(){if(mp)return Rr;mp=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.generateChildLogger=Rr.formatChildLoggerContext=Rr.getLoggerContext=Rr.setBrowserLoggerContext=Rr.getBrowserLoggerContext=Rr.getDefaultLoggerOptions=void 0;const t=gp();function e(l){return Object.assign(Object.assign({},l),{level:l?.level||t.PINO_LOGGER_DEFAULTS.level})}Rr.getDefaultLoggerOptions=e;function r(l,f=t.PINO_CUSTOM_CONTEXT_KEY){return l[f]||""}Rr.getBrowserLoggerContext=r;function n(l,f,h=t.PINO_CUSTOM_CONTEXT_KEY){return l[h]=f,l}Rr.setBrowserLoggerContext=n;function i(l,f=t.PINO_CUSTOM_CONTEXT_KEY){let h="";return typeof l.bindings>"u"?h=r(l,f):h=l.bindings().context||"",h}Rr.getLoggerContext=i;function o(l,f,h=t.PINO_CUSTOM_CONTEXT_KEY){const v=i(l,h);return v.trim()?`${v}/${f}`:f}Rr.formatChildLoggerContext=o;function c(l,f,h=t.PINO_CUSTOM_CONTEXT_KEY){const v=o(l,f,h),y=l.child({context:v});return n(y,v,h)}return Rr.generateChildLogger=c,Rr}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=T4,r=e.__importDefault(N4());Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(gp(),t),e.__exportStar(L4(),t)})(pt);class M4 extends Zi{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class U4 extends Zi{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class j4{constructor(e,r){this.logger=e,this.core=r}}class F4 extends Zi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class B4 extends Zi{constructor(e){super()}}class k4{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class H4 extends Zi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class z4 extends Zi{constructor(e,r){super(),this.core=e,this.logger=r}}class W4{constructor(e,r){this.projectId=e,this.logger=r}}class q4{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class V4{constructor(e){this.client=e}}var sh={},wp={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=et,r=Xr;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(f,h){if(h===void 0&&(h=f.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var v=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&h>0;)this._buffer[this._bufferLength++]=f[v++],h--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(v=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,f,v,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[v++],h--;return this},l.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,v=this._bufferLength,y=h/536870912|0,b=h<<3,x=h%128<112?128:256;this._buffer[v]=128;for(var P=v+1;P<x-8;P++)this._buffer[P]=0;e.writeUint32BE(y,this._buffer,x-8),e.writeUint32BE(b,this._buffer,x-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,x),this._finished=!0}for(var P=0;P<this.digestLength/8;P++)e.writeUint32BE(this._stateHi[P],f,P*8),e.writeUint32BE(this._stateLo[P],f,P*8+4);return this},l.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},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(f){return this._stateHi.set(f.stateHi),this._stateLo.set(f.stateLo),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(f){r.wipe(f.stateHi),r.wipe(f.stateLo),f.buffer&&r.wipe(f.buffer),f.bufferLength=0,f.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,f,h,v,y,b,x){for(var P=h[0],M=h[1],H=h[2],V=h[3],T=h[4],L=h[5],$=h[6],R=h[7],S=v[0],d=v[1],C=v[2],J=v[3],z=v[4],ee=v[5],de=v[6],me=v[7],O,j,ce,le,re,ne,ae,ie;x>=128;){for(var Ae=0;Ae<16;Ae++){var ge=8*Ae+b;l[Ae]=e.readUint32BE(y,ge),f[Ae]=e.readUint32BE(y,ge+4)}for(var Ae=0;Ae<80;Ae++){var Be=P,ye=M,Me=H,Q=V,Y=T,W=L,w=$,F=R,we=S,ve=d,Ue=C,nt=J,at=z,Ge=ee,Dt=de,$t=me;if(O=R,j=me,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=(T>>>14|z<<32-14)^(T>>>18|z<<32-18)^(z>>>41-32|T<<32-(41-32)),j=(z>>>14|T<<32-14)^(z>>>18|T<<32-18)^(T>>>41-32|z<<32-(41-32)),re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,O=T&L^~T&$,j=z&ee^~z&de,re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,O=i[Ae*2],j=i[Ae*2+1],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,O=l[Ae%16],j=f[Ae%16],re+=j&65535,ne+=j>>>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,j=le,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=(P>>>28|S<<32-28)^(S>>>34-32|P<<32-(34-32))^(S>>>39-32|P<<32-(39-32)),j=(S>>>28|P<<32-28)^(P>>>34-32|S<<32-(34-32))^(P>>>39-32|S<<32-(39-32)),re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,O=P&M^P&H^M&H,j=S&d^S&C^d&C,re+=j&65535,ne+=j>>>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,j=nt,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=ce,j=le,re+=j&65535,ne+=j>>>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,M=Be,H=ye,V=Me,T=Q,L=Y,$=W,R=w,P=F,d=we,C=ve,J=Ue,z=nt,ee=at,de=Ge,me=Dt,S=$t,Ae%16===15)for(var ge=0;ge<16;ge++)O=l[ge],j=f[ge],re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=l[(ge+9)%16],j=f[(ge+9)%16],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ce=l[(ge+1)%16],le=f[(ge+1)%16],O=(ce>>>1|le<<32-1)^(ce>>>8|le<<32-8)^ce>>>7,j=(le>>>1|ce<<32-1)^(le>>>8|ce<<32-8)^(le>>>7|ce<<32-7),re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ce=l[(ge+14)%16],le=f[(ge+14)%16],O=(ce>>>19|le<<32-19)^(le>>>61-32|ce<<32-(61-32))^ce>>>6,j=(le>>>19|ce<<32-19)^(ce>>>61-32|le<<32-(61-32))^(le>>>6|ce<<32-6),re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,l[ge]=ae&65535|ie<<16,f[ge]=re&65535|ne<<16}O=P,j=S,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=h[0],j=v[0],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,h[0]=P=ae&65535|ie<<16,v[0]=S=re&65535|ne<<16,O=M,j=d,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=h[1],j=v[1],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,h[1]=M=ae&65535|ie<<16,v[1]=d=re&65535|ne<<16,O=H,j=C,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=h[2],j=v[2],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,h[2]=H=ae&65535|ie<<16,v[2]=C=re&65535|ne<<16,O=V,j=J,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=h[3],j=v[3],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,h[3]=V=ae&65535|ie<<16,v[3]=J=re&65535|ne<<16,O=T,j=z,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=h[4],j=v[4],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,h[4]=T=ae&65535|ie<<16,v[4]=z=re&65535|ne<<16,O=L,j=ee,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=h[5],j=v[5],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,h[5]=L=ae&65535|ie<<16,v[5]=ee=re&65535|ne<<16,O=$,j=de,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=h[6],j=v[6],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,h[6]=$=ae&65535|ie<<16,v[6]=de=re&65535|ne<<16,O=R,j=me,re=j&65535,ne=j>>>16,ae=O&65535,ie=O>>>16,O=h[7],j=v[7],re+=j&65535,ne+=j>>>16,ae+=O&65535,ie+=O>>>16,ne+=re>>>16,ae+=ne>>>16,ie+=ae>>>16,h[7]=R=ae&65535|ie<<16,v[7]=me=re&65535|ne<<16,b+=128,x-=128}return b}function c(l){var f=new n;f.update(l);var h=f.digest();return f.clean(),h}t.hash=c})(wp),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=$s,r=wp,n=Xr;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 W=0;W<Q.length;W++)Y[W]=Q[W];return Y}const o=new Uint8Array(32);o[0]=9;const c=i(),l=i([1]),f=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=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]),y=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),b=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function x(Q,Y){for(let W=0;W<16;W++)Q[W]=Y[W]|0}function P(Q){let Y=1;for(let W=0;W<16;W++){let w=Q[W]+Y+65535;Y=Math.floor(w/65536),Q[W]=w-Y*65536}Q[0]+=Y-1+37*(Y-1)}function M(Q,Y,W){const w=~(W-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 W=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++){W[0]=w[0]-65517;for(let ve=1;ve<15;ve++)W[ve]=w[ve]-65535-(W[ve-1]>>16&1),W[ve-1]&=65535;W[15]=w[15]-32767-(W[14]>>16&1);const we=W[15]>>16&1;W[14]&=65535,M(w,W,1-we)}for(let F=0;F<16;F++)Q[2*F]=w[F]&255,Q[2*F+1]=w[F]>>8}function V(Q,Y){let W=0;for(let w=0;w<32;w++)W|=Q[w]^Y[w];return(1&W-1>>>8)-1}function T(Q,Y){const W=new Uint8Array(32),w=new Uint8Array(32);return H(W,Q),H(w,Y),V(W,w)}function L(Q){const Y=new Uint8Array(32);return H(Y,Q),Y[0]&1}function $(Q,Y){for(let W=0;W<16;W++)Q[W]=Y[2*W]+(Y[2*W+1]<<8);Q[15]&=32767}function R(Q,Y,W){for(let w=0;w<16;w++)Q[w]=Y[w]+W[w]}function S(Q,Y,W){for(let w=0;w<16;w++)Q[w]=Y[w]-W[w]}function d(Q,Y,W){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,E=0,p=0,m=0,D=0,B=0,G=0,X=0,Ee=0,Re=0,st=0,ht=0,lt=0,jr=0,ni=0,Pi=0,ps=0,zt=W[0],Mt=W[1],Wt=W[2],qt=W[3],Bt=W[4],Ut=W[5],nr=W[6],ir=W[7],Vt=W[8],sr=W[9],Kt=W[10],Jt=W[11],Gt=W[12],Pt=W[13],or=W[14],ar=W[15];w=Y[0],we+=w*zt,ve+=w*Mt,Ue+=w*Wt,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,E+=w*ar,w=Y[1],ve+=w*zt,Ue+=w*Mt,nt+=w*Wt,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,E+=w*or,p+=w*ar,w=Y[2],Ue+=w*zt,nt+=w*Mt,at+=w*Wt,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,E+=w*Pt,p+=w*or,m+=w*ar,w=Y[3],nt+=w*zt,at+=w*Mt,Ge+=w*Wt,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,E+=w*Gt,p+=w*Pt,m+=w*or,D+=w*ar,w=Y[4],at+=w*zt,Ge+=w*Mt,Dt+=w*Wt,$t+=w*qt,Je+=w*Bt,He+=w*Ut,ke+=w*nr,Ke+=w*ir,rt+=w*Vt,je+=w*sr,Ze+=w*Kt,E+=w*Jt,p+=w*Gt,m+=w*Pt,D+=w*or,B+=w*ar,w=Y[5],Ge+=w*zt,Dt+=w*Mt,$t+=w*Wt,Je+=w*qt,He+=w*Bt,ke+=w*Ut,Ke+=w*nr,rt+=w*ir,je+=w*Vt,Ze+=w*sr,E+=w*Kt,p+=w*Jt,m+=w*Gt,D+=w*Pt,B+=w*or,G+=w*ar,w=Y[6],Dt+=w*zt,$t+=w*Mt,Je+=w*Wt,He+=w*qt,ke+=w*Bt,Ke+=w*Ut,rt+=w*nr,je+=w*ir,Ze+=w*Vt,E+=w*sr,p+=w*Kt,m+=w*Jt,D+=w*Gt,B+=w*Pt,G+=w*or,X+=w*ar,w=Y[7],$t+=w*zt,Je+=w*Mt,He+=w*Wt,ke+=w*qt,Ke+=w*Bt,rt+=w*Ut,je+=w*nr,Ze+=w*ir,E+=w*Vt,p+=w*sr,m+=w*Kt,D+=w*Jt,B+=w*Gt,G+=w*Pt,X+=w*or,Ee+=w*ar,w=Y[8],Je+=w*zt,He+=w*Mt,ke+=w*Wt,Ke+=w*qt,rt+=w*Bt,je+=w*Ut,Ze+=w*nr,E+=w*ir,p+=w*Vt,m+=w*sr,D+=w*Kt,B+=w*Jt,G+=w*Gt,X+=w*Pt,Ee+=w*or,Re+=w*ar,w=Y[9],He+=w*zt,ke+=w*Mt,Ke+=w*Wt,rt+=w*qt,je+=w*Bt,Ze+=w*Ut,E+=w*nr,p+=w*ir,m+=w*Vt,D+=w*sr,B+=w*Kt,G+=w*Jt,X+=w*Gt,Ee+=w*Pt,Re+=w*or,st+=w*ar,w=Y[10],ke+=w*zt,Ke+=w*Mt,rt+=w*Wt,je+=w*qt,Ze+=w*Bt,E+=w*Ut,p+=w*nr,m+=w*ir,D+=w*Vt,B+=w*sr,G+=w*Kt,X+=w*Jt,Ee+=w*Gt,Re+=w*Pt,st+=w*or,ht+=w*ar,w=Y[11],Ke+=w*zt,rt+=w*Mt,je+=w*Wt,Ze+=w*qt,E+=w*Bt,p+=w*Ut,m+=w*nr,D+=w*ir,B+=w*Vt,G+=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*zt,je+=w*Mt,Ze+=w*Wt,E+=w*qt,p+=w*Bt,m+=w*Ut,D+=w*nr,B+=w*ir,G+=w*Vt,X+=w*sr,Ee+=w*Kt,Re+=w*Jt,st+=w*Gt,ht+=w*Pt,lt+=w*or,jr+=w*ar,w=Y[13],je+=w*zt,Ze+=w*Mt,E+=w*Wt,p+=w*qt,m+=w*Bt,D+=w*Ut,B+=w*nr,G+=w*ir,X+=w*Vt,Ee+=w*sr,Re+=w*Kt,st+=w*Jt,ht+=w*Gt,lt+=w*Pt,jr+=w*or,ni+=w*ar,w=Y[14],Ze+=w*zt,E+=w*Mt,p+=w*Wt,m+=w*qt,D+=w*Bt,B+=w*Ut,G+=w*nr,X+=w*ir,Ee+=w*Vt,Re+=w*sr,st+=w*Kt,ht+=w*Jt,lt+=w*Gt,jr+=w*Pt,ni+=w*or,Pi+=w*ar,w=Y[15],E+=w*zt,p+=w*Mt,m+=w*Wt,D+=w*qt,B+=w*Bt,G+=w*Ut,X+=w*nr,Ee+=w*ir,Re+=w*Vt,st+=w*sr,ht+=w*Kt,lt+=w*Jt,jr+=w*Gt,ni+=w*Pt,Pi+=w*or,ps+=w*ar,we+=38*p,ve+=38*m,Ue+=38*D,nt+=38*B,at+=38*G,Ge+=38*X,Dt+=38*Ee,$t+=38*Re,Je+=38*st,He+=38*ht,ke+=38*lt,Ke+=38*jr,rt+=38*ni,je+=38*Pi,Ze+=38*ps,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=E+F+65535,F=Math.floor(w/65536),E=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=E+F+65535,F=Math.floor(w/65536),E=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]=E}function C(Q,Y){d(Q,Y,Y)}function J(Q,Y){const W=i();let w;for(w=0;w<16;w++)W[w]=Y[w];for(w=253;w>=0;w--)C(W,W),w!==2&&w!==4&&d(W,W,Y);for(w=0;w<16;w++)Q[w]=W[w]}function z(Q,Y){const W=i();let w;for(w=0;w<16;w++)W[w]=Y[w];for(w=250;w>=0;w--)C(W,W),w!==1&&d(W,W,Y);for(w=0;w<16;w++)Q[w]=W[w]}function ee(Q,Y){const W=i(),w=i(),F=i(),we=i(),ve=i(),Ue=i(),nt=i(),at=i(),Ge=i();S(W,Q[1],Q[0]),S(Ge,Y[1],Y[0]),d(W,W,Ge),R(w,Q[0],Q[1]),R(Ge,Y[0],Y[1]),d(w,w,Ge),d(F,Q[3],Y[3]),d(F,F,h),d(we,Q[2],Y[2]),R(we,we,we),S(ve,w,W),S(Ue,we,F),R(nt,we,F),R(at,w,W),d(Q[0],ve,Ue),d(Q[1],at,nt),d(Q[2],nt,Ue),d(Q[3],ve,at)}function de(Q,Y,W){for(let w=0;w<4;w++)M(Q[w],Y[w],W)}function me(Q,Y){const W=i(),w=i(),F=i();J(F,Y[2]),d(W,Y[0],F),d(w,Y[1],F),H(Q,w),Q[31]^=L(W)<<7}function O(Q,Y,W){x(Q[0],c),x(Q[1],l),x(Q[2],l),x(Q[3],c);for(let w=255;w>=0;--w){const F=W[w/8|0]>>(w&7)&1;de(Q,Y,F),ee(Y,Q),ee(Q,Q),de(Q,Y,F)}}function j(Q,Y){const W=[i(),i(),i(),i()];x(W[0],v),x(W[1],y),x(W[2],l),d(W[3],v,y),O(Q,W,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 W=new Uint8Array(32),w=[i(),i(),i(),i()];j(w,Y),me(W,w);const F=new Uint8Array(64);return F.set(Q),F.set(W,32),{publicKey:W,secretKey:F}}t.generateKeyPairFromSeed=ce;function le(Q){const Y=(0,e.randomBytes)(32,Q),W=ce(Y);return(0,n.wipe)(Y),W}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 W,w,F,we;for(w=63;w>=32;--w){for(W=0,F=w-32,we=w-12;F<we;++F)Y[F]+=W-16*Y[w]*ne[F-(w-32)],W=Math.floor((Y[F]+128)/256),Y[F]-=W*256;Y[F]+=W,Y[w]=0}for(W=0,F=0;F<32;F++)Y[F]+=W-(Y[31]>>4)*ne[F],W=Y[F]>>8,Y[F]&=255;for(F=0;F<32;F++)Y[F]-=W*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 W=0;W<64;W++)Y[W]=Q[W];for(let W=0;W<64;W++)Q[W]=0;ae(Q,Y)}function Ae(Q,Y){const W=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),j(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++)W[at]=Ue[at];for(let at=0;at<32;at++)for(let Ge=0;Ge<32;Ge++)W[at+Ge]+=nt[at]*F[Ge];return ae(we.subarray(32),W),we}t.sign=Ae;function ge(Q,Y){const W=i(),w=i(),F=i(),we=i(),ve=i(),Ue=i(),nt=i();return x(Q[2],l),$(Q[1],Y),C(F,Q[1]),d(we,F,f),S(F,F,Q[2]),R(we,Q[2],we),C(ve,we),C(Ue,ve),d(nt,Ue,ve),d(W,nt,F),d(W,W,we),z(W,W),d(W,W,F),d(W,W,we),d(W,W,we),d(Q[0],W,we),C(w,Q[0]),d(w,w,we),T(w,F)&&d(Q[0],Q[0],b),C(w,Q[0]),d(w,w,we),T(w,F)?-1:(L(Q[0])===Y[31]>>7&&S(Q[0],c,Q[0]),d(Q[3],Q[0],Q[1]),0)}function Be(Q,Y,W){const w=new Uint8Array(32),F=[i(),i(),i(),i()],we=[i(),i(),i(),i()];if(W.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(W.subarray(0,32)),ve.update(Q),ve.update(Y);const Ue=ve.digest();return ie(Ue),O(F,we,Ue),j(we,W.subarray(32)),ee(F,we),me(w,F),!V(W,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 W=i(),w=i(),F=Y[1];R(W,l,F),S(w,l,F),J(w,w),d(W,W,w);let we=new Uint8Array(32);return H(we,W),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 W=new Uint8Array(Y.subarray(0,32));return(0,n.wipe)(Y),W}t.convertSecretKeyToX25519=Me}(sh);const K4="EdDSA",G4="JWT",vp=".",yp="base64url",Z4="utf8",Y4="utf8",J4=":",Q4="did",X4="key",bp="base58btc",e_="z",t_="K36",r_=32;function dc(t){return $r(zr(Gi(t),Z4),yp)}function _p(t){const e=zr(t_,bp),r=e_+$r(_u([e,t]),bp);return[Q4,X4,r].join(J4)}function n_(t){return $r(t,yp)}function i_(t){return zr([dc(t.header),dc(t.payload)].join(vp),Y4)}function s_(t){return[dc(t.header),dc(t.payload),n_(t.signature)].join(vp)}function Ep(t=$s.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=_p(n.publicKey),l=i+r,f={iss:c,sub:t,aud:e,iat:i,exp:l},h=i_({header:o,payload:f}),v=sh.sign(n.secretKey,h);return s_({header:o,payload:f,signature:v})}const a_="PARSE_ERROR",c_="INVALID_REQUEST",l_="METHOD_NOT_FOUND",u_="INVALID_PARAMS",xp="INTERNAL_ERROR",oh="SERVER_ERROR",h_=[-32700,-32600,-32601,-32602,-32603],Vo={[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"},[xp]:{code:-32603,message:"Internal error"},[oh]:{code:-32e3,message:"Server error"}},Cp=oh;function f_(t){return h_.includes(t)}function Ip(t){return Object.keys(Vo).includes(t)?Vo[t]:Vo[Cp]}function d_(t){const e=Object.values(Vo).find(r=>r.code===t);return e||Vo[Cp]}function Sp(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Op={};/*! *****************************************************************************
|
|
47
47
|
Copyright (c) Microsoft Corporation.
|
|
48
48
|
|
|
49
49
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -56,44 +56,85 @@
|
|
|
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={};/*! *****************************************************************************
|
|
60
|
-
Copyright (c) Microsoft Corporation.
|
|
61
|
-
|
|
62
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
63
|
-
purpose with or without fee is hereby granted.
|
|
64
|
-
|
|
65
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
66
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
67
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
68
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
69
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
70
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
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.4",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:{}};/**
|
|
59
|
+
***************************************************************************** */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{h(n.next(v))}catch(y){c(y)}}function f(v){try{h(n.throw(v))}catch(y){c(y)}}function h(v){v.done?o(v.value):i(v.value).then(l,f)}h((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(h){return function(v){return f([h,v])}}function f(h){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=h[0]&2?i.return:h[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,h[1])).done)return o;switch(i=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,i=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(v){h=[6,v],i=0}finally{n=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[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 Ap(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(Ap(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 Ko(t){return this instanceof Ko?(this.v=t,this):new Ko(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(b){n[b]&&(i[b]=function(x){return new Promise(function(P,M){o.push([b,x,P,M])>1||l(b,x)})})}function l(b,x){try{f(n[b](x))}catch(P){y(o[0][3],P)}}function f(b){b.value instanceof Ko?Promise.resolve(b.value.v).then(h,v):y(o[0][2],b)}function h(b){l("next",b)}function v(b){l("throw",b)}function y(b,x){b(x),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:Ko(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,f){c=t[o](c),i(l,f,c.done,c.value)})}}function i(o,c,l,f){Promise.resolve(f).then(function(h){o({value:h,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:Ap,__spread:x_,__spreadArrays:C_,__await:Ko,__asyncGenerator:I_,__asyncDelegator:S_,__asyncValues:O_,__makeTemplateObject:A_,__importStar:D_,__importDefault:$_,__classPrivateFieldGet:P_,__classPrivateFieldSet:T_}),N_=As(R_),Vn={},Dp;function L_(){if(Dp)return Vn;Dp=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.isBrowserCryptoAvailable=Vn.getSubtleCrypto=Vn.getBrowerCrypto=void 0;function t(){return Dr?.crypto||Dr?.msCrypto||{}}Vn.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Vn.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Vn.isBrowserCryptoAvailable=r,Vn}var Kn={},$p;function M_(){if($p)return Kn;$p=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.isBrowser=Kn.isNode=Kn.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Kn.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Kn.isNode=e;function r(){return!t()&&!e()}return Kn.isBrowser=r,Kn}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=N_;e.__exportStar(L_(),t),e.__exportStar(M_(),t)})(Op);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 Pp(t=6){return BigInt(uh(t))}function Fs(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 pc(t,e,r){return{id:t,jsonrpc:"2.0",error:U_(e,r)}}function U_(t,e){return typeof t>"u"?Ip(xp):(typeof t=="string"&&(t=Object.assign(Object.assign({},Ip(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 z_(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Tp(t,e){const r=z_(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Rp(t){return Tp(t,k_)}function Np(t){return Tp(t,H_)}function W_(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Lp(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function fh(t){return Lp(t)&&"method"in t}function gc(t){return Lp(t)&&(Gn(t)||In(t))}function Gn(t){return"result"in t}function In(t){return"error"in t}class Zn 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(Fs(e.method,e.params||[],e.id||Pp().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=>{In(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),gc(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",Mp=t=>t.split("?")[0],Up=10,K_=q_();class G_{constructor(e){if(this.url=e,this.events=new yr.exports.EventEmitter,this.registering=!1,!Np(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){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Gi(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!Np(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=new URLSearchParams(e).get("origin"),o=Op.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!W_(e)},c=new K_(e,[],o);V_()?c.onerror=l=>{const f=l;n(this.emitError(f.error))}:c.on("error",l=>{n(this.emitError(l))}),c.onopen=()=>{this.onOpen(c),r(c)}})}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"?ko(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=pc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return Sp(e,Mp(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Up&&this.events.setMaxListeners(Up)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${Mp(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]",f="[object Array]",h="[object AsyncFunction]",v="[object Boolean]",y="[object Date]",b="[object Error]",x="[object Function]",P="[object GeneratorFunction]",M="[object Map]",H="[object Number]",V="[object Null]",T="[object Object]",L="[object Promise]",$="[object Proxy]",R="[object RegExp]",S="[object Set]",d="[object String]",C="[object Symbol]",J="[object Undefined]",z="[object WeakMap]",ee="[object ArrayBuffer]",de="[object DataView]",me="[object Float32Array]",O="[object Float64Array]",j="[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[j]=ye[ce]=ye[le]=ye[re]=ye[ne]=ye[ae]=ye[ie]=!0,ye[l]=ye[f]=ye[ee]=ye[v]=ye[de]=ye[y]=ye[b]=ye[x]=ye[M]=ye[H]=ye[T]=ye[R]=ye[S]=ye[d]=ye[z]=!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")(),W=e&&!e.nodeType&&e,w=W&&!0&&t&&!t.nodeType&&t,F=w&&w.exports===W,we=F&&Me.process,ve=function(){try{return we&&we.binding&&we.binding("util")}catch{}}(),Ue=ve&&ve.isTypedArray;function nt(N,q){for(var fe=-1,Ce=N==null?0:N.length,It=0,Qe=[];++fe<Ce;){var Tt=N[fe];q(Tt,fe,N)&&(Qe[It++]=Tt)}return Qe}function at(N,q){for(var fe=-1,Ce=q.length,It=N.length;++fe<Ce;)N[It+fe]=q[fe];return N}function Ge(N,q){for(var fe=-1,Ce=N==null?0:N.length;++fe<Ce;)if(q(N[fe],fe,N))return!0;return!1}function Dt(N,q){for(var fe=-1,Ce=Array(N);++fe<N;)Ce[fe]=q(fe);return Ce}function $t(N){return function(q){return N(q)}}function Je(N,q){return N.has(q)}function He(N,q){return N?.[q]}function ke(N){var q=-1,fe=Array(N.size);return N.forEach(function(Ce,It){fe[++q]=[It,Ce]}),fe}function Ke(N,q){return function(fe){return N(q(fe))}}function rt(N){var q=-1,fe=Array(N.size);return N.forEach(function(Ce){fe[++q]=Ce}),fe}var je=Array.prototype,Ze=Function.prototype,E=Object.prototype,p=Y["__core-js_shared__"],m=Ze.toString,D=E.hasOwnProperty,B=function(){var N=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return N?"Symbol(src)_1."+N:""}(),G=E.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=E.propertyIsEnumerable,lt=je.splice,jr=Re?Re.toStringTag:void 0,ni=Object.getOwnPropertySymbols,Pi=Ee?Ee.isBuffer:void 0,ps=Ke(Object.keys,Object),zt=nn(Y,"DataView"),Mt=nn(Y,"Map"),Wt=nn(Y,"Promise"),qt=nn(Y,"Set"),Bt=nn(Y,"WeakMap"),Ut=nn(Object,"create"),nr=si(zt),ir=si(Mt),Vt=si(Wt),sr=si(qt),Kt=si(Bt),Jt=Re?Re.prototype:void 0,Gt=Jt?Jt.valueOf:void 0;function Pt(N){var q=-1,fe=N==null?0:N.length;for(this.clear();++q<fe;){var Ce=N[q];this.set(Ce[0],Ce[1])}}function or(){this.__data__=Ut?Ut(null):{},this.size=0}function ar(N){var q=this.has(N)&&delete this.__data__[N];return this.size-=q?1:0,q}function Zf(N){var q=this.__data__;if(Ut){var fe=q[N];return fe===n?void 0:fe}return D.call(q,N)?q[N]:void 0}function Yf(N){var q=this.__data__;return Ut?q[N]!==void 0:D.call(q,N)}function Jf(N,q){var fe=this.__data__;return this.size+=this.has(N)?0:1,fe[N]=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 pn(N){var q=-1,fe=N==null?0:N.length;for(this.clear();++q<fe;){var Ce=N[q];this.set(Ce[0],Ce[1])}}function Qf(){this.__data__=[],this.size=0}function Xf(N){var q=this.__data__,fe=gs(q,N);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(N){var q=this.__data__,fe=gs(q,N);return fe<0?void 0:q[fe][1]}function t0(N){return gs(this.__data__,N)>-1}function r0(N,q){var fe=this.__data__,Ce=gs(fe,N);return Ce<0?(++this.size,fe.push([N,q])):fe[Ce][1]=q,this}pn.prototype.clear=Qf,pn.prototype.delete=Xf,pn.prototype.get=e0,pn.prototype.has=t0,pn.prototype.set=r0;function ii(N){var q=-1,fe=N==null?0:N.length;for(this.clear();++q<fe;){var Ce=N[q];this.set(Ce[0],Ce[1])}}function co(){this.size=0,this.__data__={hash:new Pt,map:new(Mt||pn),string:new Pt}}function n0(N){var q=Ti(this,N).delete(N);return this.size-=q?1:0,q}function lo(N){return Ti(this,N).get(N)}function i0(N){return Ti(this,N).has(N)}function s0(N,q){var fe=Ti(this,N),Ce=fe.size;return fe.set(N,q),this.size+=fe.size==Ce?0:1,this}ii.prototype.clear=co,ii.prototype.delete=n0,ii.prototype.get=lo,ii.prototype.has=i0,ii.prototype.set=s0;function uo(N){var q=-1,fe=N==null?0:N.length;for(this.__data__=new ii;++q<fe;)this.add(N[q])}function cl(N){return this.__data__.set(N,n),this}function ll(N){return this.__data__.has(N)}uo.prototype.add=uo.prototype.push=cl,uo.prototype.has=ll;function On(N){var q=this.__data__=new pn(N);this.size=q.size}function o0(){this.__data__=new pn,this.size=0}function a0(N){var q=this.__data__,fe=q.delete(N);return this.size=q.size,fe}function c0(N){return this.__data__.get(N)}function l0(N){return this.__data__.has(N)}function ul(N,q){var fe=this.__data__;if(fe instanceof pn){var Ce=fe.__data__;if(!Mt||Ce.length<r-1)return Ce.push([N,q]),this.size=++fe.size,this;fe=this.__data__=new ii(Ce)}return fe.set(N,q),this.size=fe.size,this}On.prototype.clear=o0,On.prototype.delete=a0,On.prototype.get=c0,On.prototype.has=l0,On.prototype.set=ul;function hl(N,q){var fe=po(N),Ce=!fe&&xl(N),It=!fe&&!Ce&&Da(N),Qe=!fe&&!Ce&&!It&&Sl(N),Tt=fe||Ce||It||Qe,cr=Tt?Dt(N.length,String):[],mt=cr.length;for(var St in N)(q||D.call(N,St))&&!(Tt&&(St=="length"||It&&(St=="offset"||St=="parent")||Qe&&(St=="buffer"||St=="byteLength"||St=="byteOffset")||vl(St,mt)))&&cr.push(St);return cr}function gs(N,q){for(var fe=N.length;fe--;)if(El(N[fe][0],q))return fe;return-1}function Oa(N,q,fe){var Ce=q(N);return po(N)?Ce:at(Ce,fe(N))}function ms(N){return N==null?N===void 0?J:V:jr&&jr in Object(N)?ml(N):f0(N)}function Aa(N){return vs(N)&&ms(N)==l}function ws(N,q,fe,Ce,It){return N===q?!0:N==null||q==null||!vs(N)&&!vs(q)?N!==N&&q!==q:fl(N,q,fe,Ce,ws,It)}function fl(N,q,fe,Ce,It,Qe){var Tt=po(N),cr=po(q),mt=Tt?f:kn(N),St=cr?f:kn(q);mt=mt==l?T:mt,St=St==l?T:St;var Qt=mt==T,Gr=St==T,lr=mt==St;if(lr&&Da(N)){if(!Da(q))return!1;Tt=!0,Qt=!1}if(lr&&!Qt)return Qe||(Qe=new On),Tt||Sl(N)?ho(N,q,fe,Ce,It,Qe):h0(N,q,mt,fe,Ce,It,Qe);if(!(fe&i)){var Rt=Qt&&D.call(N,"__wrapped__"),Fr=Gr&&D.call(q,"__wrapped__");if(Rt||Fr){var An=Rt?N.value():N,gn=Fr?q.value():q;return Qe||(Qe=new On),It(An,gn,fe,Ce,Qe)}}return lr?(Qe||(Qe=new On),gl(N,q,fe,Ce,It,Qe)):!1}function u0(N){if(!Il(N)||bl(N))return!1;var q=go(N)?X:ge;return q.test(si(N))}function dl(N){return vs(N)&&Cl(N.length)&&!!ye[ms(N)]}function pl(N){if(!_l(N))return ps(N);var q=[];for(var fe in Object(N))D.call(N,fe)&&fe!="constructor"&&q.push(fe);return q}function ho(N,q,fe,Ce,It,Qe){var Tt=fe&i,cr=N.length,mt=q.length;if(cr!=mt&&!(Tt&&mt>cr))return!1;var St=Qe.get(N);if(St&&Qe.get(q))return St==q;var Qt=-1,Gr=!0,lr=fe&o?new uo:void 0;for(Qe.set(N,q),Qe.set(q,N);++Qt<cr;){var Rt=N[Qt],Fr=q[Qt];if(Ce)var An=Tt?Ce(Fr,Rt,Qt,q,N,Qe):Ce(Rt,Fr,Qt,N,q,Qe);if(An!==void 0){if(An)continue;Gr=!1;break}if(lr){if(!Ge(q,function(gn,Hn){if(!Je(lr,Hn)&&(Rt===gn||It(Rt,gn,fe,Ce,Qe)))return lr.push(Hn)})){Gr=!1;break}}else if(!(Rt===Fr||It(Rt,Fr,fe,Ce,Qe))){Gr=!1;break}}return Qe.delete(N),Qe.delete(q),Gr}function h0(N,q,fe,Ce,It,Qe,Tt){switch(fe){case de:if(N.byteLength!=q.byteLength||N.byteOffset!=q.byteOffset)return!1;N=N.buffer,q=q.buffer;case ee:return!(N.byteLength!=q.byteLength||!Qe(new st(N),new st(q)));case v:case y:case H:return El(+N,+q);case b:return N.name==q.name&&N.message==q.message;case R:case d:return N==q+"";case M:var cr=ke;case S:var mt=Ce&i;if(cr||(cr=rt),N.size!=q.size&&!mt)return!1;var St=Tt.get(N);if(St)return St==q;Ce|=o,Tt.set(N,q);var Qt=ho(cr(N),cr(q),Ce,It,Qe,Tt);return Tt.delete(N),Qt;case C:if(Gt)return Gt.call(N)==Gt.call(q)}return!1}function gl(N,q,fe,Ce,It,Qe){var Tt=fe&i,cr=fo(N),mt=cr.length,St=fo(q),Qt=St.length;if(mt!=Qt&&!Tt)return!1;for(var Gr=mt;Gr--;){var lr=cr[Gr];if(!(Tt?lr in q:D.call(q,lr)))return!1}var Rt=Qe.get(N);if(Rt&&Qe.get(q))return Rt==q;var Fr=!0;Qe.set(N,q),Qe.set(q,N);for(var An=Tt;++Gr<mt;){lr=cr[Gr];var gn=N[lr],Hn=q[lr];if(Ce)var $a=Tt?Ce(Hn,gn,lr,q,N,Qe):Ce(gn,Hn,lr,N,q,Qe);if(!($a===void 0?gn===Hn||It(gn,Hn,fe,Ce,Qe):$a)){Fr=!1;break}An||(An=lr=="constructor")}if(Fr&&!An){var ys=N.constructor,wr=q.constructor;ys!=wr&&"constructor"in N&&"constructor"in q&&!(typeof ys=="function"&&ys instanceof ys&&typeof wr=="function"&&wr instanceof wr)&&(Fr=!1)}return Qe.delete(N),Qe.delete(q),Fr}function fo(N){return Oa(N,g0,wl)}function Ti(N,q){var fe=N.__data__;return yl(q)?fe[typeof q=="string"?"string":"hash"]:fe.map}function nn(N,q){var fe=He(N,q);return u0(fe)?fe:void 0}function ml(N){var q=D.call(N,jr),fe=N[jr];try{N[jr]=void 0;var Ce=!0}catch{}var It=G.call(N);return Ce&&(q?N[jr]=fe:delete N[jr]),It}var wl=ni?function(N){return N==null?[]:(N=Object(N),nt(ni(N),function(q){return ht.call(N,q)}))}:Ct,kn=ms;(zt&&kn(new zt(new ArrayBuffer(1)))!=de||Mt&&kn(new Mt)!=M||Wt&&kn(Wt.resolve())!=L||qt&&kn(new qt)!=S||Bt&&kn(new Bt)!=z)&&(kn=function(N){var q=ms(N),fe=q==T?N.constructor:void 0,Ce=fe?si(fe):"";if(Ce)switch(Ce){case nr:return de;case ir:return M;case Vt:return L;case sr:return S;case Kt:return z}return q});function vl(N,q){return q=q??c,!!q&&(typeof N=="number"||Be.test(N))&&N>-1&&N%1==0&&N<q}function yl(N){var q=typeof N;return q=="string"||q=="number"||q=="symbol"||q=="boolean"?N!=="__proto__":N===null}function bl(N){return!!B&&B in N}function _l(N){var q=N&&N.constructor,fe=typeof q=="function"&&q.prototype||E;return N===fe}function f0(N){return G.call(N)}function si(N){if(N!=null){try{return m.call(N)}catch{}try{return N+""}catch{}}return""}function El(N,q){return N===q||N!==N&&q!==q}var xl=Aa(function(){return arguments}())?Aa:function(N){return vs(N)&&D.call(N,"callee")&&!ht.call(N,"callee")},po=Array.isArray;function d0(N){return N!=null&&Cl(N.length)&&!go(N)}var Da=Pi||xt;function p0(N,q){return ws(N,q)}function go(N){if(!Il(N))return!1;var q=ms(N);return q==x||q==P||q==h||q==$}function Cl(N){return typeof N=="number"&&N>-1&&N%1==0&&N<=c}function Il(N){var q=typeof N;return N!=null&&(q=="object"||q=="function")}function vs(N){return N!=null&&typeof N=="object"}var Sl=Ue?$t(Ue):dl;function g0(N){return d0(N)?hl(N):pl(N)}function Ct(){return[]}function xt(){return!1}t.exports=p0})(dh,dh.exports);var Z_=dh.exports,Y_=Object.defineProperty,jp=Object.getOwnPropertySymbols,J_=Object.prototype.hasOwnProperty,Q_=Object.prototype.propertyIsEnumerable,Fp=(t,e,r)=>e in t?Y_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Nr=(t,e)=>{for(var r in e||(e={}))J_.call(e,r)&&Fp(t,r,e[r]);if(jp)for(var r of jp(e))Q_.call(e,r)&&Fp(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,f=t.charAt(0),h=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function y(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 M=0,H=0,V=0,T=P.length;V!==T&&P[V]===0;)V++,M++;for(var L=(T-V)*v+1>>>0,$=new Uint8Array(L);V!==T;){for(var R=P[V],S=0,d=L-1;(R!==0||S<H)&&d!==-1;d--,S++)R+=256*$[d]>>>0,$[d]=R%l>>>0,R=R/l>>>0;if(R!==0)throw new Error("Non-zero carry");H=S,V++}for(var C=L-H;C!==L&&$[C]===0;)C++;for(var J=f.repeat(M);C<L;++C)J+=t.charAt($[C]);return J}function b(P){if(typeof P!="string")throw new TypeError("Expected String");if(P.length===0)return new Uint8Array;var M=0;if(P[M]!==" "){for(var H=0,V=0;P[M]===f;)H++,M++;for(var T=(P.length-M)*h+1>>>0,L=new Uint8Array(T);P[M];){var $=r[P.charCodeAt(M)];if($===255)return;for(var R=0,S=T-1;($!==0||R<V)&&S!==-1;S--,R++)$+=l*L[S]>>>0,L[S]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");V=R,M++}if(P[M]!==" "){for(var d=T-V;d!==T&&L[d]===0;)d++;for(var C=new Uint8Array(H+(T-d)),J=H;d!==T;)C[J++]=L[d++];return C}}}function x(P){var M=b(P);if(M)return M;throw new Error(`Non-${e} character`)}return{encode:y,decodeUnsafe:b,decode:x}}var e8=X_,t8=e8;const Bp=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 kp(this,e)}}class o8{constructor(e){this.decoders=e}or(e){return kp(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 kp=(t,e)=>new o8(Nr(Nr({},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 mc=({name:t,prefix:e,encode:r,decode:n})=>new a8(t,e,r,n),Go=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=t8(r,e);return mc({prefix:t,name:e,encode:n,decode:o=>Bp(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,f=0,h=0;for(let v=0;v<o;++v){const y=i[t[v]];if(y===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|y,l+=r,l>=8&&(l-=8,c[h++]=255&f>>l)}if(l>=r||255&f<<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 f=0;f<t.length;++f)for(l=l<<8|t[f],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})=>mc({prefix:e,name:t,encode(i){return l8(i,n,r)},decode(i){return c8(i,n,r,t)}}),u8=mc({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=Go({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=Go({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),T8=Go({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var R8=Object.freeze({__proto__:null,base36:P8,base36upper:T8});const N8=Go({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),L8=Go({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 Hp=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=Hp.reduce((t,e,r)=>(t[r]=e,t),[]),z8=Hp.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function W8(t){return t.reduce((e,r)=>(e+=H8[r],e),"")}function q8(t){const e=[];for(const r of t){const n=z8[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const V8=mc({prefix:"\u{1F680}",name:"base256emoji",encode:W8,decode:q8});var K8=Object.freeze({__proto__:null,base256emoji:V8}),G8=Wp,zp=128,Z8=127,Y8=~Z8,J8=Math.pow(2,31);function Wp(t,e,r){e=e||[],r=r||0;for(var n=r;t>=J8;)e[r++]=t&255|zp,t/=128;for(;t&Y8;)e[r++]=t&255|zp,t>>>=7;return e[r]=t|0,Wp.bytes=r-n+1,e}var Q8=ph,X8=128,qp=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&qp)<<i:(c&qp)*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},Vp=uE;const Kp=(t,e,r=0)=>(Vp.encode(t,e,r),e),Gp=t=>Vp.encodingLength(t),gh=(t,e)=>{const r=e.byteLength,n=Gp(t),i=n+Gp(r),o=new Uint8Array(i+r);return Kp(t,o,0),Kp(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 Zp=({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 Yp=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),dE=Zp({name:"sha2-256",code:18,encode:Yp("SHA-256")}),pE=Zp({name:"sha2-512",code:19,encode:Yp("SHA-512")});var gE=Object.freeze({__proto__:null,sha256:dE,sha512:pE});const Jp=0,mE="identity",Qp=Bp;var wE=Object.freeze({__proto__:null,identity:{code:Jp,name:mE,encode:Qp,digest:t=>gh(Jp,Qp(t))}});new TextEncoder,new TextDecoder;const Xp=Nr(Nr(Nr(Nr(Nr(Nr(Nr(Nr(Nr(Nr({},h8),d8),g8),w8),b8),$8),R8),M8),k8),K8);Nr(Nr({},gE),wE);function eg(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?eg(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function tg(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const rg=tg("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),mh=tg("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=Nr({utf8:rg,"utf-8":rg,hex:Xp.base16,latin1:mh,ascii:mh,binary:mh},Xp);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?eg(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}const ng="wc",_E=2,wh="core",wi=`${ng}@2:${wh}:`,EE={name:wh,logger:"error"},xE={database:":memory:"},CE="crypto",ig="client_ed25519_seed",IE=Te.ONE_DAY,SE="keychain",OE="0.3",AE="messages",DE="0.3",$E=Te.SIX_HOURS,PE="publisher",sg="irn",TE="error",og="wss://relay.walletconnect.com",ag="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",Yn={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},LE=Te.ONE_SECOND,ME="2.10.5",UE=1e4,jE="0.3",FE="WALLETCONNECT_CLIENT_ID",Sn={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,zE="pairing",WE="0.3",Zo={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}}},Yo={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Ln={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},qE="history",VE="0.3",KE="expirer",un={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},GE="0.3",vh="verify-api",Bs="https://verify.walletconnect.com",yh="https://verify.walletconnect.org",ZE=[Bs,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=wi,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=Ep(i);return _p(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=Z5();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const o=await this.getClientSeed(),c=Ep(o),l=Fu();return await o_(l,i,IE,c)},this.generateSharedKey=(i,o,c)=>{this.isInitialized();const l=this.getPrivateKey(i),f=Y5(l,o);return this.setSymKey(f,c)},this.setSymKey=async(i,o)=>{this.isInitialized();const c=o||J5(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),f=Gi(o);if(N1(l)){const b=l.senderPublicKey,x=l.receiverPublicKey;i=await this.generateSharedKey(b,x)}const h=this.getSymKey(i),{type:v,senderPublicKey:y}=l;return X5({type:v,symKey:h,message:f,senderPublicKey:y})},this.decode=async(i,o,c)=>{this.isInitialized();const l=rb(o,c);if(N1(l)){const f=l.receiverPublicKey,h=l.senderPublicKey;i=await this.generateSharedKey(f,h)}try{const f=this.getSymKey(i),h=eb({symKey:f,encoded:o});return ko(h)}catch(f){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(f)}},this.getPayloadType=i=>{const o=nc(i);return Lo(o.type)},this.getPayloadSenderPublicKey=i=>{const o=nc(i);return o.senderPublicKey?$r(o.senderPublicKey,Pr):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(ig)}catch{e=Fu(),await this.keychain.set(ig,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 j4{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=wi,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=Rs(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=Rs(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 F4{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,f=Hu(o),h=o?.prompt||!1,v=o?.tag||0,y=o?.id||Pp().toString(),b={topic:n,message:i,opts:{ttl:l,relay:f,prompt:h,tag:v,id:y}},x=setTimeout(()=>this.queue.set(y,b),this.publishTimeout);try{await await jo(this.rpcPublish(n,i,l,f,h,v,y),this.publishTimeout,"Failed to publish payload, please try again."),this.removeRequestFromQueue(y),this.relayer.events.emit(Ir.publish,b)}catch(P){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(c=o?.internal)!=null&&c.throwOnFailedPublish)throw this.removeRequestFromQueue(y),P;return}finally{clearTimeout(x)}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 f,h,v,y;const b={method:ic(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:o,tag:c},id:l};return Tr((f=b.params)==null?void 0:f.prompt)&&((h=b.params)==null||delete h.prompt),Tr((v=b.params)==null?void 0:v.tag)&&((y=b.params)==null||delete y.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:b}),this.relayer.request(b)}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(js.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,cg=Object.getOwnPropertySymbols,i7=Object.prototype.hasOwnProperty,s7=Object.prototype.propertyIsEnumerable,lg=(t,e,r)=>e in t?t7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Jo=(t,e)=>{for(var r in e||(e={}))i7.call(e,r)&&lg(t,r,e[r]);if(cg)for(var r of cg(e))s7.call(e,r)&&lg(t,r,e[r]);return t},bh=(t,e)=>r7(t,n7(e));class o7 extends H4{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=wi,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=Hu(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=Hu(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:ic(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await jo(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Ir.connection_stalled)}return Rs(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:ic(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 jo(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:ic(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(Jo({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,Jo({},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,Jo({},r)),this.topicMap.set(r.topic,e),this.events.emit(Sn.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(Sn.deleted,bh(Jo({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Sn.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(Sn.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);Nn(r)&&this.onBatchSubscribe(r.map((n,i)=>bh(Jo({},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(js.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(Sn.created,async e=>{const r=Sn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Sn.deleted,async e=>{const r=Sn.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,ug=Object.getOwnPropertySymbols,c7=Object.prototype.hasOwnProperty,l7=Object.prototype.propertyIsEnumerable,hg=(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)&&hg(t,r,e[r]);if(ug)for(var r of ug(e))l7.call(e,r)&&hg(t,r,e[r]);return t};class h7 extends B4{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(Yn.payload,this.onPayloadHandler),this.provider.on(Yn.connect,this.onConnectHandler),this.provider.on(Yn.disconnect,this.onDisconnectHandler),this.provider.on(Yn.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||og,this.projectId=e.projectId,this.bundleId=cb(),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 ${ag}...`),await this.restartTransport(ag)}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(Sn.created,c),o())};return await Promise.all([new Promise(l=>{o=l,this.subscriber.on(Sn.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 jo(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(Sn.resubscribed,()=>{r()})}),new Promise(async(r,n)=>{try{await jo(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(Yn.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 Zn(new G_(pb({sdkVersion:ME,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),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 gc(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(Yn.payload,this.onPayloadHandler),this.provider.off(Yn.connect,this.onConnectHandler),this.provider.off(Yn.disconnect,this.onDisconnectHandler),this.provider.off(Yn.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(Ir.connection_stalled,()=>{this.restartTransport().catch(r=>this.logger.error(r))});let e=await Y1();o6(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,fg=Object.getOwnPropertySymbols,d7=Object.prototype.hasOwnProperty,p7=Object.prototype.propertyIsEnumerable,dg=(t,e,r)=>e in t?f7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pg=(t,e)=>{for(var r in e||(e={}))d7.call(e,r)&&dg(t,r,e[r]);if(fg)for(var r of fg(e))p7.call(e,r)&&dg(t,r,e[r]);return t};class wc extends k4{constructor(e,r,n,i=wi,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=wi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!Tr(c)?this.map.set(this.getKey(c),c):Ub(c)?this.map.set(c.id,c):jb(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(f=>Z_(l[f],c[f]))):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 f=pg(pg({},this.getData(c)),l);this.map.set(c,f),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=zE,this.version=WE,this.events=new yr.exports,this.initialized=!1,this.storagePrefix=wi,this.ignoredPayloadTypes=[qi],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=Fu(),i=await this.core.crypto.setSymKey(n),o=Cn(Te.FIVE_MINUTES),c={protocol:sg},l={topic:i,expiry:o,relay:c,active:!1},f=Ob({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:f}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:o,relay:c}=Cb(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 f=Cn(Te.FIVE_MINUTES),h={topic:i,relay:c,expiry:f,active:!1};return await this.pairings.set(i,h),this.core.expirer.set(i,f),n.activatePairing&&await this.activate({topic:i}),this.events.emit(Yo.create,h),h},this.activate=async({topic:n})=>{this.isInitialized();const i=Cn(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:f}=Ls();this.events.once(tr("pairing_ping",o),({error:h})=>{h?f(h):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=Fs(i,o),l=await this.core.crypto.encode(n,c),f=Zo[i].req;return this.core.history.set(n,c),this.core.relayer.publish(n,l,f),c.id},this.sendResult=async(n,i,o)=>{const c=hh(n,o),l=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=Zo[f.request.method].res;await this.core.relayer.publish(i,l,h),await this.core.history.resolve(c)},this.sendError=async(n,i,o)=>{const c=pc(n,o),l=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=Zo[f.request.method]?Zo[f.request.method].res:Zo.unregistered_method.res;await this.core.relayer.publish(i,l,h),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=>mi(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(Yo.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(()=>{Gn(i)?this.events.emit(tr("pairing_ping",o),{}):In(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(Yo.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(!Mb(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(!dr(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(mi(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 wc(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})):gc(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(un.expired,async e=>{const{topic:r}=k1(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(Yo.expire,{topic:r}))})}}class m7 extends U4{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=wi,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:Cn(Te.THIRTY_DAYS)};this.records.set(c.id,c),this.events.emit(Ln.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=In(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(Ln.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(Ln.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:Fs(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(Ln.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(Ln.created,e=>{const r=Ln.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Ln.updated,e=>{const r=Ln.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Ln.deleted,e=>{const r=Ln.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.core.heartbeat.on(js.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 z4{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=wi,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(un.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(un.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 gb(e);if(typeof e=="number")return mb(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(un.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(un.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(js.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(un.created,e=>{const r=un.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(un.expired,e=>{const r=un.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(un.deleted,e=>{const r=un.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 W4{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||Ns()||!Mo())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||Bs;return ZE.includes(i)||(this.logger.info(`verify url: ${i}, not included in trusted list, assigning default: ${Bs}`),i=Bs),i},this.logger=pt.generateChildLogger(r,this.name),this.verifyUrl=Bs,this.abortController=new AbortController,this.isDevEnv=Bu()&&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,gg=Object.getOwnPropertySymbols,b7=Object.prototype.hasOwnProperty,_7=Object.prototype.propertyIsEnumerable,mg=(t,e,r)=>e in t?y7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wg=(t,e)=>{for(var r in e||(e={}))b7.call(e,r)&&mg(t,r,e[r]);if(gg)for(var r of gg(e))_7.call(e,r)&&mg(t,r,e[r]);return t};class _h extends M4{constructor(e){super(e),this.protocol=ng,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||og,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 js.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 B6(wg(wg({},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,vg="wc",yg=2,bg="client",Eh=`${vg}@${yg}:${bg}:`,xh={name:bg,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},_g="WALLETCONNECT_DEEPLINK_CHOICE",x7="proposal",Eg="Proposal expired",C7="session",vc=Te.SEVEN_DAYS,I7="engine",Qo={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},Jn={idle:"IDLE",active:"ACTIVE"},S7="request",O7=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var A7=Object.defineProperty,D7=Object.defineProperties,$7=Object.getOwnPropertyDescriptors,xg=Object.getOwnPropertySymbols,P7=Object.prototype.hasOwnProperty,T7=Object.prototype.propertyIsEnumerable,Cg=(t,e,r)=>e in t?A7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Vr=(t,e)=>{for(var r in e||(e={}))P7.call(e,r)&&Cg(t,r,e[r]);if(xg)for(var r of xg(e))T7.call(e,r)&&Cg(t,r,e[r]);return t},Xo=(t,e)=>D7(t,$7(e));class R7 extends V4{constructor(e){super(e),this.name=I7,this.events=new yr.exports,this.initialized=!1,this.ignoredPayloadTypes=[qi],this.requestQueue={state:Jn.idle,queue:[]},this.sessionRequestQueue={state:Jn.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(Qo)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Te.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const n=Xo(Vr({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:o,optionalNamespaces:c,sessionProperties:l,relays:f}=n;let h=i,v,y=!1;if(h&&(y=this.client.core.pairing.pairings.get(h).active),!h||!y){const{topic:L,uri:$}=await this.client.core.pairing.create();h=L,v=$}const b=await this.client.core.crypto.generateKeyPair(),x=Vr({requiredNamespaces:o,optionalNamespaces:c,relays:f??[{protocol:sg}],proposer:{publicKey:b,metadata:this.client.metadata}},l&&{sessionProperties:l}),{reject:P,resolve:M,done:H}=Ls(Te.FIVE_MINUTES,Eg);if(this.events.once(tr("session_connect"),async({error:L,session:$})=>{if(L)P(L);else if($){$.self.publicKey=b;const R=Xo(Vr({},$),{requiredNamespaces:$.requiredNamespaces,optionalNamespaces:$.optionalNamespaces});await this.client.session.set($.topic,R),await this.setExpiry($.topic,$.expiry),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:$.peer.metadata}),M(R)}}),!h){const{message:L}=_e("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(L)}const V=await this.sendRequest({topic:h,method:"wc_sessionPropose",params:x}),T=Cn(Te.FIVE_MINUTES);return await this.setProposal(V,Vr({id:V,expiry:T},x)),{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:f,proposer:h,requiredNamespaces:v,optionalNamespaces:y}=l;f=f||"",Us(v)||(v=Pb(o,"approve()"));const b=await this.client.core.crypto.generateKeyPair(),x=h.publicKey,P=await this.client.core.crypto.generateSharedKey(b,x);f&&n&&(await this.client.core.pairing.updateMetadata({topic:f,metadata:h.metadata}),await this.sendResult({id:n,topic:f,result:{relay:{protocol:i??"irn"},responderPublicKey:b}}),await this.client.proposal.delete(n,Yt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:f}));const M=Vr({relay:{protocol:i??"irn"},namespaces:o,requiredNamespaces:v,optionalNamespaces:y,pairingTopic:f,controller:{publicKey:b,metadata:this.client.metadata},expiry:Cn(vc)},c&&{sessionProperties:c});await this.client.core.relayer.subscribe(P),await this.sendRequest({topic:P,method:"wc_sessionSettle",params:M,throwOnFailedPublish:!0});const H=Xo(Vr({},M),{topic:P,pairingTopic:f,acknowledged:!1,self:M.controller,peer:{publicKey:h.publicKey,metadata:h.metadata},controller:b});return await this.client.session.set(P,H),await this.setExpiry(P,Cn(vc)),{topic:P,acknowledged:()=>new Promise(V=>setTimeout(()=>V(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:f}=Ls();return this.events.once(tr("session_update",o),({error:h})=>{h?f(h):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}=Ls();return this.events.once(tr("session_extend",i),({error:f})=>{f?l(f):c()}),await this.setExpiry(n,Cn(vc)),{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:f,resolve:h,reject:v}=Ls(c,"Request expired. Please try again.");return this.events.once(tr("session_request",l),({error:y,result:b})=>{y?v(y):h(b)}),await Promise.all([new Promise(async y=>{await this.sendRequest({clientRpcId:l,topic:o,method:"wc_sessionRequest",params:{request:i,chainId:n},expiry:c,throwOnFailedPublish:!0}).catch(b=>v(b)),this.client.events.emit("session_request_sent",{topic:o,request:i,chainId:n,id:l}),y()}),new Promise(async y=>{const b=await this.client.core.storage.getItem(_g);wb({id:l,topic:o,wcDeepLink:b}),y()}),f()]).then(y=>y[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:o}=i;Gn(i)?await this.sendResult({id:o,topic:n,result:i.result,throwOnFailedPublish:!0}):In(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}=Ls();this.events.once(tr("session_ping",i),({error:f})=>{f?l(f):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=>Nb(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(_g).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=Jn.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=Qo.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,Cn(n))},this.sendRequest=async r=>{const{topic:n,method:i,params:o,expiry:c,relayRpcId:l,clientRpcId:f,throwOnFailedPublish:h}=r,v=Fs(i,o,f);if(Mo()&&O7.includes(i)){const x=Rs(JSON.stringify(v));this.client.core.verify.register({attestationId:x})}const y=await this.client.core.crypto.encode(n,v),b=Qo[i].req;return c&&(b.ttl=c),l&&(b.id=l),this.client.core.history.set(n,v),h?(b.internal=Xo(Vr({},b.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,y,b)):this.client.core.relayer.publish(n,y,b).catch(x=>this.client.logger.error(x)),v.id},this.sendResult=async r=>{const{id:n,topic:i,result:o,throwOnFailedPublish:c}=r,l=hh(n,o),f=await this.client.core.crypto.encode(i,l),h=await this.client.core.history.get(i,n),v=Qo[h.request.method].res;c?(v.internal=Xo(Vr({},v.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,f,v)):this.client.core.relayer.publish(i,f,v).catch(y=>this.client.logger.error(y)),await this.client.core.history.resolve(l)},this.sendError=async(r,n,i)=>{const o=pc(r,i),c=await this.client.core.crypto.encode(n,o),l=await this.client.core.history.get(n,r),f=Qo[l.request.method].res;this.client.core.relayer.publish(n,c,f),await this.client.core.history.resolve(o)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{mi(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{mi(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===Jn.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=Jn.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=Jn.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(Vr({},n.params));const c=Cn(Te.FIVE_MINUTES),l=Vr({id:o,pairingTopic:r,expiry:c},i);await this.setProposal(o,l);const f=Rs(JSON.stringify(n)),h=await this.getVerifyContext(f,l.proposer.metadata);this.client.events.emit("session_proposal",{id:o,params:l,verifyContext:h})}catch(c){await this.sendError(o,r,c),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(Gn(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 f=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:f});const h=await this.client.core.crypto.generateSharedKey(l,f);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:h});const v=await this.client.core.relayer.subscribe(h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:v}),await this.client.core.pairing.activate({topic:r})}else In(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:f,namespaces:h,requiredNamespaces:v,optionalNamespaces:y,sessionProperties:b,pairingTopic:x}=n.params,P=Vr({topic:r,relay:c,expiry:f,namespaces:h,acknowledged:!0,pairingTopic:x,requiredNamespaces:v,optionalNamespaces:y,controller:l.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:l.publicKey,metadata:l.metadata}},b&&{sessionProperties:b});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;Gn(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(tr("session_approve",i),{})):In(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=ac.get(c);if(l&&this.isRequestOutOfSync(l,o)){this.client.logger.info(`Discarding out of sync request - ${o}`);return}this.isValidUpdate(Vr({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}),ac.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;Gn(n)?this.events.emit(tr("session_update",i),{}):In(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,Cn(vc)),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;Gn(n)?this.events.emit(tr("session_extend",i),{}):In(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(()=>{Gn(n)?this.events.emit(tr("session_ping",i),{}):In(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(Vr({topic:r},o));const c=Rs(JSON.stringify(Fs("wc_sessionRequest",o,i))),l=this.client.session.get(r),f=await this.getVerifyContext(c,l.peer.metadata),h={id:i,topic:r,params:o,verifyContext:f};await this.setPendingSessionRequest(h),this.addSessionRequestToSessionRequestQueue(h),this.processSessionRequestQueue()}catch(c){await this.sendError(i,r,c),this.client.logger.error(c)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;Gn(n)?this.events.emit(tr("session_request",i),{result:n.result}):In(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=ac.get(c);if(l&&this.isRequestOutOfSync(l,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Vr({topic:r},o)),this.client.events.emit("session_event",{id:i,topic:r,params:o}),ac.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=Jn.idle,this.processSessionRequestQueue()},Te.toMiliseconds(this.requestQueueDelay))},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Jn.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=Jn.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,Fs("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:f}=_e("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(f)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:o,sessionProperties:c,relays:l}=r;if(Tr(n)||await this.isValidPairingTopic(n),!Vb(l,!0)){const{message:f}=_e("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(f)}!Tr(i)&&Us(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Tr(o)&&Us(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),Tr(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=qb(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),f=oc(i,"approve()");if(f)throw new Error(f.message);const h=G1(l.requiredNamespaces,i,"approve()");if(h)throw new Error(h.message);if(!dr(o,!0)){const{message:v}=_e("MISSING_OR_INVALID",`approve() relayProtocol: ${o}`);throw new Error(v)}Tr(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),!Gb(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:h}=_e("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(h)}const{relay:n,controller:i,namespaces:o,expiry:c}=r;if(!V1(n)){const{message:h}=_e("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(h)}const l=Fb(i,"onSessionSettleRequest()");if(l)throw new Error(l.message);const f=oc(o,"onSessionSettleRequest()");if(f)throw new Error(f.message);if(mi(c)){const{message:h}=_e("EXPIRED","onSessionSettleRequest()");throw new Error(h)}},this.isValidUpdate=async r=>{if(!Wr(r)){const{message:f}=_e("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(f)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const o=this.client.session.get(n),c=oc(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:f}=_e("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(f)}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:f}=_e("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(f)}if(!Zb(i)){const{message:f}=_e("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(f)}if(!Qb(l,o,i.method)){const{message:f}=_e("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(f)}if(c&&!r6(c,Ch)){const{message:f}=_e("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${Ch.min} and ${Ch.max}`);throw new Error(f)}},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),!Yb(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(!Jb(i)){const{message:l}=_e("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}if(!Xb(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||Bs,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(!dr(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})):gc(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(un.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(Yo.create,e=>this.onPairingCreated(e))}isValidPairingTopic(e){if(!dr(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(mi(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=_e("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!dr(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(mi(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(dr(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(!Kb(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(mi(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 wc{constructor(e,r){super(e,r,x7,Eh),this.core=e,this.logger=r}}class L7 extends wc{constructor(e,r){super(e,r,C7,Eh),this.core=e,this.logger=r}}class M7 extends wc{constructor(e,r){super(e,r,S7,Eh,n=>n.id),this.core=e,this.logger=r}}class Ih extends q4{constructor(e){super(e),this.protocol=vg,this.version=yg,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||ub();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 f(O){return O&&DataView.prototype.isPrototypeOf(O)}if(l.arrayBuffer)var h=["[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&&h.indexOf(Object.prototype.toString.call(O))>-1};function y(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 b(O){return typeof O!="string"&&(O=String(O)),O}function x(O){var j={next:function(){var ce=O.shift();return{done:ce===void 0,value:ce}}};return l.iterable&&(j[Symbol.iterator]=function(){return j}),j}function P(O){this.map={},O instanceof P?O.forEach(function(j,ce){this.append(ce,j)},this):Array.isArray(O)?O.forEach(function(j){this.append(j[0],j[1])},this):O&&Object.getOwnPropertyNames(O).forEach(function(j){this.append(j,O[j])},this)}P.prototype.append=function(O,j){O=y(O),j=b(j);var ce=this.map[O];this.map[O]=ce?ce+", "+j:j},P.prototype.delete=function(O){delete this.map[y(O)]},P.prototype.get=function(O){return O=y(O),this.has(O)?this.map[O]:null},P.prototype.has=function(O){return this.map.hasOwnProperty(y(O))},P.prototype.set=function(O,j){this.map[y(O)]=b(j)},P.prototype.forEach=function(O,j){for(var ce in this.map)this.map.hasOwnProperty(ce)&&O.call(j,this.map[ce],ce,this)},P.prototype.keys=function(){var O=[];return this.forEach(function(j,ce){O.push(ce)}),x(O)},P.prototype.values=function(){var O=[];return this.forEach(function(j){O.push(j)}),x(O)},P.prototype.entries=function(){var O=[];return this.forEach(function(j,ce){O.push([ce,j])}),x(O)},l.iterable&&(P.prototype[Symbol.iterator]=P.prototype.entries);function M(O){if(O.bodyUsed)return Promise.reject(new TypeError("Already read"));O.bodyUsed=!0}function H(O){return new Promise(function(j,ce){O.onload=function(){j(O.result)},O.onerror=function(){ce(O.error)}})}function V(O){var j=new FileReader,ce=H(j);return j.readAsArrayBuffer(O),ce}function T(O){var j=new FileReader,ce=H(j);return j.readAsText(O),ce}function L(O){for(var j=new Uint8Array(O),ce=new Array(j.length),le=0;le<j.length;le++)ce[le]=String.fromCharCode(j[le]);return ce.join("")}function $(O){if(O.slice)return O.slice(0);var j=new Uint8Array(O.byteLength);return j.set(new Uint8Array(O)),j.buffer}function R(){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&&f(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=M(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?M(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(V)}),this.text=function(){var O=M(this);if(O)return O;if(this._bodyBlob)return T(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 S=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function d(O){var j=O.toUpperCase();return S.indexOf(j)>-1?j:O}function C(O,j){j=j||{};var ce=j.body;if(O instanceof C){if(O.bodyUsed)throw new TypeError("Already read");this.url=O.url,this.credentials=O.credentials,j.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=j.credentials||this.credentials||"same-origin",(j.headers||!this.headers)&&(this.headers=new P(j.headers)),this.method=d(j.method||this.method||"GET"),this.mode=j.mode||this.mode||null,this.signal=j.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)}C.prototype.clone=function(){return new C(this,{body:this._bodyInit})};function J(O){var j=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," ");j.append(decodeURIComponent(re),decodeURIComponent(ne))}}),j}function z(O){var j=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();j.append(ne,ae)}}),j}R.call(C.prototype);function ee(O,j){j||(j={}),this.type="default",this.status=j.status===void 0?200:j.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in j?j.statusText:"OK",this.headers=new P(j.headers),this.url=j.url||"",this._initBody(O)}R.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,j){if(de.indexOf(j)===-1)throw new RangeError("Invalid status code");return new ee(null,{status:j,headers:{location:O}})},c.DOMException=o.DOMException;try{new c.DOMException}catch{c.DOMException=function(j,ce){this.message=j,this.name=ce;var le=Error(j);this.stack=le.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function me(O,j){return new Promise(function(ce,le){var re=new C(O,j);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:z(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=C,o.Response=ee),c.Headers=P,c.Request=C,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 Ig=Cw(Sh.exports);const Sg={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Og=10;class vi{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new yr.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Rp(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=Gi(e),o=await(await Ig(this.url,Object.assign(Object.assign({},Sg),{body:n}))).json();this.onPayload({data:o})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Rp(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=Gi({id:1,jsonrpc:"2.0",method:"test",params:[]});await Ig(e,Object.assign(Object.assign({},Sg),{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"?ko(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),o=pc(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return Sp(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Og&&this.events.setMaxListeners(Og)}}const Ag="error",U7="wss://relay.walletconnect.com",j7="wc",F7="universal_provider",Dg=`${j7}@2:${F7}:`,B7="https://rpc.walletconnect.com/v1/",Qn={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var ea=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Oh={exports:{}};/**
|
|
73
60
|
* @license
|
|
74
61
|
* Lodash <https://lodash.com/>
|
|
75
62
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
76
63
|
* Released under MIT license <https://lodash.com/license>
|
|
77
64
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
78
65
|
* 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={"&":"&","<":"<",">":">",'"':""","'":"'"},te={"&":"&","<":"<",">":">",""":'"',"'":"'"},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 `+
|
|
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
|
-
`;
|
|
83
|
-
__e(`+
|
|
84
|
-
'`),
|
|
85
|
-
`+
|
|
86
|
-
__p += '`),
|
|
87
|
-
((__t = (`+
|
|
88
|
-
'`),
|
|
89
|
-
`;var
|
|
90
|
-
`+
|
|
66
|
+
*/(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`",f="__lodash_hash_undefined__",h=500,v="__lodash_placeholder__",y=1,b=2,x=4,P=1,M=2,H=1,V=2,T=4,L=8,$=16,R=32,S=64,d=128,C=256,J=512,z=30,ee="...",de=800,me=16,O=1,j=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",V],["curry",L],["curryRight",$],["flip",J],["partial",R],["partialRight",S],["rearg",C]],ye="[object Arguments]",Me="[object Array]",Q="[object AsyncFunction]",Y="[object Boolean]",W="[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]",E="[object ArrayBuffer]",p="[object DataView]",m="[object Float32Array]",D="[object Float64Array]",B="[object Int8Array]",G="[object Int16Array]",X="[object Int32Array]",Ee="[object Uint8Array]",Re="[object Uint8ClampedArray]",st="[object Uint16Array]",ht="[object Uint32Array]",lt=/\b__p \+= '';/g,jr=/\b(__p \+=) '' \+/g,ni=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Pi=/&(?:amp|lt|gt|quot|#39);/g,ps=/[&<>"']/g,zt=RegExp(Pi.source),Mt=RegExp(ps.source),Wt=/<%-([\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,pn=/\w*$/,Qf=/^[-+]0x[0-9a-f]+$/i,Xf=/^0b[01]+$/i,e0=/^\[object .+?Constructor\]$/,t0=/^0o[0-7]+$/i,r0=/^(?:0|[1-9]\d*)$/,ii=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,co=/($^)/,n0=/['\n\r\u2028\u2029\\]/g,lo="\\ud800-\\udfff",i0="\\u0300-\\u036f",s0="\\ufe20-\\ufe2f",uo="\\u20d0-\\u20ff",cl=i0+s0+uo,ll="\\u2700-\\u27bf",On="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",ul="A-Z\\xc0-\\xd6\\xd8-\\xde",hl="\\ufe0e\\ufe0f",gs=o0+a0+c0+l0,Oa="['\u2019]",ms="["+lo+"]",Aa="["+gs+"]",ws="["+cl+"]",fl="\\d+",u0="["+ll+"]",dl="["+On+"]",pl="[^"+lo+gs+fl+ll+On+ul+"]",ho="\\ud83c[\\udffb-\\udfff]",h0="(?:"+ws+"|"+ho+")",gl="[^"+lo+"]",fo="(?:\\ud83c[\\udde6-\\uddff]){2}",Ti="[\\ud800-\\udbff][\\udc00-\\udfff]",nn="["+ul+"]",ml="\\u200d",wl="(?:"+dl+"|"+pl+")",kn="(?:"+nn+"|"+pl+")",vl="(?:"+Oa+"(?:d|ll|m|re|s|t|ve))?",yl="(?:"+Oa+"(?:D|LL|M|RE|S|T|VE))?",bl=h0+"?",_l="["+hl+"]?",f0="(?:"+ml+"(?:"+[gl,fo,Ti].join("|")+")"+_l+bl+")*",si="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",El="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",xl=_l+bl+f0,po="(?:"+[u0,fo,Ti].join("|")+")"+xl,d0="(?:"+[gl+ws+"?",ws,fo,Ti,ms].join("|")+")",Da=RegExp(Oa,"g"),p0=RegExp(ws,"g"),go=RegExp(ho+"(?="+ho+")|"+d0+xl,"g"),Cl=RegExp([nn+"?"+dl+"+"+vl+"(?="+[Aa,nn,"$"].join("|")+")",kn+"+"+yl+"(?="+[Aa,nn+wl,"$"].join("|")+")",nn+"?"+wl+"+"+vl,nn+"+"+yl,El,si,fl,po].join("|"),"g"),Il=RegExp("["+ml+lo+cl+hl+"]"),vs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Sl=["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[G]=Ct[X]=Ct[Ee]=Ct[Re]=Ct[st]=Ct[ht]=!0,Ct[ye]=Ct[Me]=Ct[E]=Ct[Y]=Ct[p]=Ct[W]=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[E]=xt[p]=xt[Y]=xt[W]=xt[m]=xt[D]=xt[B]=xt[G]=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 N={\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={"&":"&","<":"<",">":">",'"':""","'":"'"},fe={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},It=parseFloat,Qe=parseInt,Tt=typeof ea=="object"&&ea&&ea.Object===Object&&ea,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,Gr=Qt&&Qt.exports===St,lr=Gr&&Tt.process,Rt=function(){try{var K=Qt&&Qt.require&&Qt.require("util").types;return K||lr&&lr.binding&&lr.binding("util")}catch{}}(),Fr=Rt&&Rt.isArrayBuffer,An=Rt&&Rt.isDate,gn=Rt&&Rt.isMap,Hn=Rt&&Rt.isRegExp,$a=Rt&&Rt.isSet,ys=Rt&&Rt.isTypedArray;function wr(K,se,te){switch(te.length){case 0:return K.call(se);case 1:return K.call(se,te[0]);case 2:return K.call(se,te[0],te[1]);case 3:return K.call(se,te[0],te[1],te[2])}return K.apply(se,te)}function OA(K,se,te,Ie){for(var Ye=-1,vt=K==null?0:K.length;++Ye<vt;){var hr=K[Ye];se(Ie,hr,te(hr),K)}return Ie}function mn(K,se){for(var te=-1,Ie=K==null?0:K.length;++te<Ie&&se(K[te],te,K)!==!1;);return K}function AA(K,se){for(var te=K==null?0:K.length;te--&&se(K[te],te,K)!==!1;);return K}function I3(K,se){for(var te=-1,Ie=K==null?0:K.length;++te<Ie;)if(!se(K[te],te,K))return!1;return!0}function Ri(K,se){for(var te=-1,Ie=K==null?0:K.length,Ye=0,vt=[];++te<Ie;){var hr=K[te];se(hr,te,K)&&(vt[Ye++]=hr)}return vt}function Ol(K,se){var te=K==null?0:K.length;return!!te&&mo(K,se,0)>-1}function m0(K,se,te){for(var Ie=-1,Ye=K==null?0:K.length;++Ie<Ye;)if(te(se,K[Ie]))return!0;return!1}function jt(K,se){for(var te=-1,Ie=K==null?0:K.length,Ye=Array(Ie);++te<Ie;)Ye[te]=se(K[te],te,K);return Ye}function Ni(K,se){for(var te=-1,Ie=se.length,Ye=K.length;++te<Ie;)K[Ye+te]=se[te];return K}function w0(K,se,te,Ie){var Ye=-1,vt=K==null?0:K.length;for(Ie&&vt&&(te=K[++Ye]);++Ye<vt;)te=se(te,K[Ye],Ye,K);return te}function DA(K,se,te,Ie){var Ye=K==null?0:K.length;for(Ie&&Ye&&(te=K[--Ye]);Ye--;)te=se(te,K[Ye],Ye,K);return te}function v0(K,se){for(var te=-1,Ie=K==null?0:K.length;++te<Ie;)if(se(K[te],te,K))return!0;return!1}var $A=y0("length");function PA(K){return K.split("")}function TA(K){return K.match(ar)||[]}function S3(K,se,te){var Ie;return te(K,function(Ye,vt,hr){if(se(Ye,vt,hr))return Ie=vt,!1}),Ie}function Al(K,se,te,Ie){for(var Ye=K.length,vt=te+(Ie?1:-1);Ie?vt--:++vt<Ye;)if(se(K[vt],vt,K))return vt;return-1}function mo(K,se,te){return se===se?WA(K,se,te):Al(K,O3,te)}function RA(K,se,te,Ie){for(var Ye=te-1,vt=K.length;++Ye<vt;)if(Ie(K[Ye],se))return Ye;return-1}function O3(K){return K!==K}function A3(K,se){var te=K==null?0:K.length;return te?_0(K,se)/te:ae}function y0(K){return function(se){return se==null?r:se[K]}}function b0(K){return function(se){return K==null?r:K[se]}}function D3(K,se,te,Ie,Ye){return Ye(K,function(vt,hr,Ot){te=Ie?(Ie=!1,vt):se(te,vt,hr,Ot)}),te}function NA(K,se){var te=K.length;for(K.sort(se);te--;)K[te]=K[te].value;return K}function _0(K,se){for(var te,Ie=-1,Ye=K.length;++Ie<Ye;){var vt=se(K[Ie]);vt!==r&&(te=te===r?vt:te+vt)}return te}function E0(K,se){for(var te=-1,Ie=Array(K);++te<K;)Ie[te]=se(te);return Ie}function LA(K,se){return jt(se,function(te){return[te,K[te]]})}function $3(K){return K&&K.slice(0,N3(K)+1).replace(Kt,"")}function sn(K){return function(se){return K(se)}}function x0(K,se){return jt(se,function(te){return K[te]})}function Pa(K,se){return K.has(se)}function P3(K,se){for(var te=-1,Ie=K.length;++te<Ie&&mo(se,K[te],0)>-1;);return te}function T3(K,se){for(var te=K.length;te--&&mo(se,K[te],0)>-1;);return te}function MA(K,se){for(var te=K.length,Ie=0;te--;)K[te]===se&&++Ie;return Ie}var UA=b0(N),jA=b0(q);function FA(K){return"\\"+Ce[K]}function BA(K,se){return K==null?r:K[se]}function wo(K){return Il.test(K)}function kA(K){return vs.test(K)}function HA(K){for(var se,te=[];!(se=K.next()).done;)te.push(se.value);return te}function C0(K){var se=-1,te=Array(K.size);return K.forEach(function(Ie,Ye){te[++se]=[Ye,Ie]}),te}function R3(K,se){return function(te){return K(se(te))}}function Li(K,se){for(var te=-1,Ie=K.length,Ye=0,vt=[];++te<Ie;){var hr=K[te];(hr===se||hr===v)&&(K[te]=v,vt[Ye++]=te)}return vt}function Dl(K){var se=-1,te=Array(K.size);return K.forEach(function(Ie){te[++se]=Ie}),te}function zA(K){var se=-1,te=Array(K.size);return K.forEach(function(Ie){te[++se]=[Ie,Ie]}),te}function WA(K,se,te){for(var Ie=te-1,Ye=K.length;++Ie<Ye;)if(K[Ie]===se)return Ie;return-1}function qA(K,se,te){for(var Ie=te+1;Ie--;)if(K[Ie]===se)return Ie;return Ie}function vo(K){return wo(K)?KA(K):$A(K)}function Dn(K){return wo(K)?GA(K):PA(K)}function N3(K){for(var se=K.length;se--&&Jt.test(K.charAt(se)););return se}var VA=b0(fe);function KA(K){for(var se=go.lastIndex=0;go.test(K);)++se;return se}function GA(K){return K.match(go)||[]}function ZA(K){return K.match(Cl)||[]}var YA=function K(se){se=se==null?mt:yo.defaults(mt.Object(),se,yo.pick(mt,Sl));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,wn=se.TypeError,$l=te.prototype,QA=vt.prototype,bo=Ot.prototype,Pl=se["__core-js_shared__"],Tl=QA.toString,bt=bo.hasOwnProperty,XA=0,L3=function(){var s=/[^.]+$/.exec(Pl&&Pl.keys&&Pl.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Rl=bo.toString,eD=Tl.call(Ot),tD=mt._,rD=I0("^"+Tl.call(bt).replace(Vt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nl=Gr?se.Buffer:r,Mi=se.Symbol,Ll=se.Uint8Array,M3=Nl?Nl.allocUnsafe:r,Ml=R3(Ot.getPrototypeOf,Ot),U3=Ot.create,j3=bo.propertyIsEnumerable,Ul=$l.splice,F3=Mi?Mi.isConcatSpreadable:r,Ta=Mi?Mi.iterator:r,bs=Mi?Mi.toStringTag:r,jl=function(){try{var s=Is(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,Fl=hr.ceil,Bl=hr.floor,S0=Ot.getOwnPropertySymbols,oD=Nl?Nl.isBuffer:r,B3=se.isFinite,aD=$l.join,cD=R3(Ot.keys,Ot),fr=hr.max,Or=hr.min,lD=Ie.now,uD=se.parseInt,k3=hr.random,hD=$l.reverse,O0=Is(se,"DataView"),Ra=Is(se,"Map"),A0=Is(se,"Promise"),_o=Is(se,"Set"),Na=Is(se,"WeakMap"),La=Is(Ot,"create"),kl=Na&&new Na,Eo={},fD=Ss(O0),dD=Ss(Ra),pD=Ss(A0),gD=Ss(_o),mD=Ss(Na),Hl=Mi?Mi.prototype:r,Ma=Hl?Hl.valueOf:r,H3=Hl?Hl.toString:r;function I(s){if(Zt(s)&&!Xe(s)&&!(s instanceof dt)){if(s instanceof vn)return s;if(bt.call(s,"__wrapped__"))return z2(s)}return new vn(s)}var xo=function(){function s(){}return function(a){if(!kt(a))return{};if(U3)return U3(a);s.prototype=a;var u=new s;return s.prototype=r,u}}();function zl(){}function vn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=r}I.templateSettings={escape:Wt,evaluate:qt,interpolate:Bt,variable:"",imports:{_:I}},I.prototype=zl.prototype,I.prototype.constructor=I,vn.prototype=xo(zl.prototype),vn.prototype.constructor=vn;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__=Zr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Zr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Zr(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,_=u?s.length:0,A=P$(0,_,this.__views__),U=A.start,k=A.end,Z=k-U,ue=g?k:U-1,he=this.__iteratees__,pe=he.length,be=0,Pe=Or(Z,this.__takeCount__);if(!u||!g&&_==Z&&Pe==Z)return f2(s,this.__actions__);var We=[];e:for(;Z--&&be<Pe;){ue+=a;for(var ot=-1,qe=s[ue];++ot<pe;){var ft=he[ot],wt=ft.iteratee,cn=ft.type,Hr=wt(qe);if(cn==j)qe=Hr;else if(!Hr){if(cn==O)continue e;break e}}We[be++]=qe}return We}dt.prototype=xo(zl.prototype),dt.prototype.constructor=dt;function _s(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__=La?La(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(La){var u=a[s];return u===f?r:u}return bt.call(a,s)?a[s]:r}function xD(s){var a=this.__data__;return La?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]=La&&a===r?f:a,this}_s.prototype.clear=bD,_s.prototype.delete=_D,_s.prototype.get=ED,_s.prototype.has=xD,_s.prototype.set=CD;function oi(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=Wl(a,s);if(u<0)return!1;var g=a.length-1;return u==g?a.pop():Ul.call(a,u,1),--this.size,!0}function OD(s){var a=this.__data__,u=Wl(a,s);return u<0?r:a[u][1]}function AD(s){return Wl(this.__data__,s)>-1}function DD(s,a){var u=this.__data__,g=Wl(u,s);return g<0?(++this.size,u.push([s,a])):u[g][1]=a,this}oi.prototype.clear=ID,oi.prototype.delete=SD,oi.prototype.get=OD,oi.prototype.has=AD,oi.prototype.set=DD;function ai(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 _s,map:new(Ra||oi),string:new _s}}function PD(s){var a=ru(this,s).delete(s);return this.size-=a?1:0,a}function TD(s){return ru(this,s).get(s)}function RD(s){return ru(this,s).has(s)}function ND(s,a){var u=ru(this,s),g=u.size;return u.set(s,a),this.size+=u.size==g?0:1,this}ai.prototype.clear=$D,ai.prototype.delete=PD,ai.prototype.get=TD,ai.prototype.has=RD,ai.prototype.set=ND;function Es(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new ai;++a<u;)this.add(s[a])}function LD(s){return this.__data__.set(s,f),this}function MD(s){return this.__data__.has(s)}Es.prototype.add=Es.prototype.push=LD,Es.prototype.has=MD;function $n(s){var a=this.__data__=new oi(s);this.size=a.size}function UD(){this.__data__=new oi,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 oi){var g=u.__data__;if(!Ra||g.length<i-1)return g.push([s,a]),this.size=++u.size,this;u=this.__data__=new ai(g)}return u.set(s,a),this.size=u.size,this}$n.prototype.clear=UD,$n.prototype.delete=jD,$n.prototype.get=FD,$n.prototype.has=BD,$n.prototype.set=kD;function z3(s,a){var u=Xe(s),g=!u&&Os(s),_=!u&&!g&&ki(s),A=!u&&!g&&!_&&Oo(s),U=u||g||_||A,k=U?E0(s.length,JA):[],Z=k.length;for(var ue in s)(a||bt.call(s,ue))&&!(U&&(ue=="length"||_&&(ue=="offset"||ue=="parent")||A&&(ue=="buffer"||ue=="byteLength"||ue=="byteOffset")||hi(ue,Z)))&&k.push(ue);return k}function W3(s){var a=s.length;return a?s[F0(0,a-1)]:r}function HD(s,a){return nu(Zr(s),xs(a,0,s.length))}function zD(s){return nu(Zr(s))}function D0(s,a,u){(u!==r&&!Pn(s[a],u)||u===r&&!(a in s))&&ci(s,a,u)}function Ua(s,a,u){var g=s[a];(!(bt.call(s,a)&&Pn(g,u))||u===r&&!(a in s))&&ci(s,a,u)}function Wl(s,a){for(var u=s.length;u--;)if(Pn(s[u][0],a))return u;return-1}function WD(s,a,u,g){return Ui(s,function(_,A,U){a(g,_,u(_),U)}),g}function q3(s,a){return s&&Wn(a,vr(a),s)}function qD(s,a){return s&&Wn(a,Jr(a),s)}function ci(s,a,u){a=="__proto__"&&jl?jl(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function $0(s,a){for(var u=-1,g=a.length,_=te(g),A=s==null;++u<g;)_[u]=A?r:ud(s,a[u]);return _}function xs(s,a,u){return s===s&&(u!==r&&(s=s<=u?s:u),a!==r&&(s=s>=a?s:a)),s}function yn(s,a,u,g,_,A){var U,k=a&y,Z=a&b,ue=a&x;if(u&&(U=_?u(s,g,_,A):u(s)),U!==r)return U;if(!kt(s))return s;var he=Xe(s);if(he){if(U=R$(s),!k)return Zr(s,U)}else{var pe=Ar(s),be=pe==we||pe==ve;if(ki(s))return g2(s,k);if(pe==Ge||pe==ye||be&&!_){if(U=Z||be?{}:N2(s),!k)return Z?E$(s,qD(U,s)):_$(s,q3(U,s))}else{if(!xt[pe])return _?s:{};U=N$(s,pe,k)}}A||(A=new $n);var Pe=A.get(s);if(Pe)return Pe;A.set(s,U),lw(s)?s.forEach(function(qe){U.add(yn(qe,a,u,qe,s,A))}):aw(s)&&s.forEach(function(qe,ft){U.set(ft,yn(qe,a,u,ft,s,A))});var We=ue?Z?Y0:Z0:Z?Jr:vr,ot=he?r:We(s);return mn(ot||s,function(qe,ft){ot&&(ft=qe,qe=s[ft]),Ua(U,ft,yn(qe,a,u,ft,s,A))}),U}function VD(s){var a=vr(s);return function(u){return V3(u,s,a)}}function V3(s,a,u){var g=u.length;if(s==null)return!g;for(s=Ot(s);g--;){var _=u[g],A=a[_],U=s[_];if(U===r&&!(_ in s)||!A(U))return!1}return!0}function K3(s,a,u){if(typeof s!="function")throw new wn(c);return Wa(function(){s.apply(r,u)},a)}function ja(s,a,u,g){var _=-1,A=Ol,U=!0,k=s.length,Z=[],ue=a.length;if(!k)return Z;u&&(a=jt(a,sn(u))),g?(A=m0,U=!1):a.length>=i&&(A=Pa,U=!1,a=new Es(a));e:for(;++_<k;){var he=s[_],pe=u==null?he:u(he);if(he=g||he!==0?he:0,U&&pe===pe){for(var be=ue;be--;)if(a[be]===pe)continue e;Z.push(he)}else A(a,pe,g)||Z.push(he)}return Z}var Ui=b2(zn),G3=b2(T0,!0);function KD(s,a){var u=!0;return Ui(s,function(g,_,A){return u=!!a(g,_,A),u}),u}function ql(s,a,u){for(var g=-1,_=s.length;++g<_;){var A=s[g],U=a(A);if(U!=null&&(k===r?U===U&&!an(U):u(U,k)))var k=U,Z=A}return Z}function GD(s,a,u,g){var _=s.length;for(u=it(u),u<0&&(u=-u>_?0:_+u),g=g===r||g>_?_:it(g),g<0&&(g+=_),g=u>g?0:hw(g);u<g;)s[u++]=a;return s}function Z3(s,a){var u=[];return Ui(s,function(g,_,A){a(g,_,A)&&u.push(g)}),u}function xr(s,a,u,g,_){var A=-1,U=s.length;for(u||(u=M$),_||(_=[]);++A<U;){var k=s[A];a>0&&u(k)?a>1?xr(k,a-1,u,g,_):Ni(_,k):g||(_[_.length]=k)}return _}var P0=_2(),Y3=_2(!0);function zn(s,a){return s&&P0(s,a,vr)}function T0(s,a){return s&&Y3(s,a,vr)}function Vl(s,a){return Ri(a,function(u){return fi(s[u])})}function Cs(s,a){a=Fi(a,s);for(var u=0,g=a.length;s!=null&&u<g;)s=s[qn(a[u++])];return u&&u==g?s:r}function J3(s,a,u){var g=a(s);return Xe(s)?g:Ni(g,u(s))}function Br(s){return s==null?s===r?rt:at:bs&&bs in Ot(s)?$$(s):z$(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:Ol,_=s[0].length,A=s.length,U=A,k=te(A),Z=1/0,ue=[];U--;){var he=s[U];U&&a&&(he=jt(he,sn(a))),Z=Or(he.length,Z),k[U]=!u&&(a||_>=120&&he.length>=120)?new Es(U&&he):r}he=s[0];var pe=-1,be=k[0];e:for(;++pe<_&&ue.length<Z;){var Pe=he[pe],We=a?a(Pe):Pe;if(Pe=u||Pe!==0?Pe:0,!(be?Pa(be,We):g(ue,We,u))){for(U=A;--U;){var ot=k[U];if(!(ot?Pa(ot,We):g(s[U],We,u)))continue e}be&&be.push(We),ue.push(Pe)}}return ue}function QD(s,a,u,g){return zn(s,function(_,A,U){a(g,u(_),A,U)}),g}function Fa(s,a,u){a=Fi(a,s),s=j2(s,a);var g=s==null?s:s[qn(_n(a))];return g==null?r:wr(g,s,u)}function Q3(s){return Zt(s)&&Br(s)==ye}function XD(s){return Zt(s)&&Br(s)==E}function e$(s){return Zt(s)&&Br(s)==W}function Ba(s,a,u,g,_){return s===a?!0:s==null||a==null||!Zt(s)&&!Zt(a)?s!==s&&a!==a:t$(s,a,u,g,Ba,_)}function t$(s,a,u,g,_,A){var U=Xe(s),k=Xe(a),Z=U?Me:Ar(s),ue=k?Me:Ar(a);Z=Z==ye?Ge:Z,ue=ue==ye?Ge:ue;var he=Z==Ge,pe=ue==Ge,be=Z==ue;if(be&&ki(s)){if(!ki(a))return!1;U=!0,he=!1}if(be&&!he)return A||(A=new $n),U||Oo(s)?P2(s,a,u,g,_,A):A$(s,a,Z,u,g,_,A);if(!(u&P)){var Pe=he&&bt.call(s,"__wrapped__"),We=pe&&bt.call(a,"__wrapped__");if(Pe||We){var ot=Pe?s.value():s,qe=We?a.value():a;return A||(A=new $n),_(ot,qe,u,g,A)}}return be?(A||(A=new $n),D$(s,a,u,g,_,A)):!1}function r$(s){return Zt(s)&&Ar(s)==Ue}function L0(s,a,u,g){var _=u.length,A=_,U=!g;if(s==null)return!A;for(s=Ot(s);_--;){var k=u[_];if(U&&k[2]?k[1]!==s[k[0]]:!(k[0]in s))return!1}for(;++_<A;){k=u[_];var Z=k[0],ue=s[Z],he=k[1];if(U&&k[2]){if(ue===r&&!(Z in s))return!1}else{var pe=new $n;if(g)var be=g(ue,he,Z,s,a,pe);if(!(be===r?Ba(he,ue,P|M,g,pe):be))return!1}}return!0}function X3(s){if(!kt(s)||j$(s))return!1;var a=fi(s)?rD:e0;return a.test(Ss(s))}function n$(s){return Zt(s)&&Br(s)==Je}function i$(s){return Zt(s)&&Ar(s)==He}function s$(s){return Zt(s)&&lu(s.length)&&!!Ct[Br(s)]}function e2(s){return typeof s=="function"?s:s==null?Qr:typeof s=="object"?Xe(s)?n2(s[0],s[1]):r2(s):Ew(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 t2(s,a){var u=-1,g=Yr(s)?te(s.length):[];return Ui(s,function(_,A,U){g[++u]=a(_,A,U)}),g}function r2(s){var a=Q0(s);return a.length==1&&a[0][2]?M2(a[0][0],a[0][1]):function(u){return u===s||L0(u,s,a)}}function n2(s,a){return ed(s)&&L2(a)?M2(qn(s),a):function(u){var g=ud(u,s);return g===r&&g===a?hd(u,s):Ba(a,g,P|M)}}function Kl(s,a,u,g,_){s!==a&&P0(a,function(A,U){if(_||(_=new $n),kt(A))a$(s,a,U,u,Kl,g,_);else{var k=g?g(rd(s,U),A,U+"",s,a,_):r;k===r&&(k=A),D0(s,U,k)}},Jr)}function a$(s,a,u,g,_,A,U){var k=rd(s,u),Z=rd(a,u),ue=U.get(Z);if(ue){D0(s,u,ue);return}var he=A?A(k,Z,u+"",s,a,U):r,pe=he===r;if(pe){var be=Xe(Z),Pe=!be&&ki(Z),We=!be&&!Pe&&Oo(Z);he=Z,be||Pe||We?Xe(k)?he=k:Xt(k)?he=Zr(k):Pe?(pe=!1,he=g2(Z,!0)):We?(pe=!1,he=m2(Z,!0)):he=[]:qa(Z)||Os(Z)?(he=k,Os(k)?he=fw(k):(!kt(k)||fi(k))&&(he=N2(Z))):pe=!1}pe&&(U.set(Z,he),_(he,Z,g,A,U),U.delete(Z)),D0(s,u,he)}function i2(s,a){var u=s.length;if(u)return a+=a<0?u:0,hi(a,u)?s[a]:r}function s2(s,a,u){a.length?a=jt(a,function(A){return Xe(A)?function(U){return Cs(U,A.length===1?A[0]:A)}:A}):a=[Qr];var g=-1;a=jt(a,sn(ze()));var _=t2(s,function(A,U,k){var Z=jt(a,function(ue){return ue(A)});return{criteria:Z,index:++g,value:A}});return NA(_,function(A,U){return b$(A,U,u)})}function c$(s,a){return o2(s,a,function(u,g){return hd(s,g)})}function o2(s,a,u){for(var g=-1,_=a.length,A={};++g<_;){var U=a[g],k=Cs(s,U);u(k,U)&&ka(A,Fi(U,s),k)}return A}function l$(s){return function(a){return Cs(a,s)}}function j0(s,a,u,g){var _=g?RA:mo,A=-1,U=a.length,k=s;for(s===a&&(a=Zr(a)),u&&(k=jt(s,sn(u)));++A<U;)for(var Z=0,ue=a[A],he=u?u(ue):ue;(Z=_(k,he,Z,g))>-1;)k!==s&&Ul.call(k,Z,1),Ul.call(s,Z,1);return s}function a2(s,a){for(var u=s?a.length:0,g=u-1;u--;){var _=a[u];if(u==g||_!==A){var A=_;hi(_)?Ul.call(s,_,1):H0(s,_)}}return s}function F0(s,a){return s+Bl(k3()*(a-s+1))}function u$(s,a,u,g){for(var _=-1,A=fr(Fl((a-s)/(u||1)),0),U=te(A);A--;)U[g?A:++_]=s,s+=u;return U}function B0(s,a){var u="";if(!s||a<1||a>re)return u;do a%2&&(u+=s),a=Bl(a/2),a&&(s+=s);while(a);return u}function ct(s,a){return nd(U2(s,a,Qr),s+"")}function h$(s){return W3(Ao(s))}function f$(s,a){var u=Ao(s);return nu(u,xs(a,0,u.length))}function ka(s,a,u,g){if(!kt(s))return s;a=Fi(a,s);for(var _=-1,A=a.length,U=A-1,k=s;k!=null&&++_<A;){var Z=qn(a[_]),ue=u;if(Z==="__proto__"||Z==="constructor"||Z==="prototype")return s;if(_!=U){var he=k[Z];ue=g?g(he,Z,k):r,ue===r&&(ue=kt(he)?he:hi(a[_+1])?[]:{})}Ua(k,Z,ue),k=k[Z]}return s}var c2=kl?function(s,a){return kl.set(s,a),s}:Qr,d$=jl?function(s,a){return jl(s,"toString",{configurable:!0,enumerable:!1,value:dd(a),writable:!0})}:Qr;function p$(s){return nu(Ao(s))}function bn(s,a,u){var g=-1,_=s.length;a<0&&(a=-a>_?0:_+a),u=u>_?_:u,u<0&&(u+=_),_=a>u?0:u-a>>>0,a>>>=0;for(var A=te(_);++g<_;)A[g]=s[g+a];return A}function g$(s,a){var u;return Ui(s,function(g,_,A){return u=a(g,_,A),!u}),!!u}function Gl(s,a,u){var g=0,_=s==null?g:s.length;if(typeof a=="number"&&a===a&&_<=ge){for(;g<_;){var A=g+_>>>1,U=s[A];U!==null&&!an(U)&&(u?U<=a:U<a)?g=A+1:_=A}return _}return k0(s,a,Qr,u)}function k0(s,a,u,g){var _=0,A=s==null?0:s.length;if(A===0)return 0;a=u(a);for(var U=a!==a,k=a===null,Z=an(a),ue=a===r;_<A;){var he=Bl((_+A)/2),pe=u(s[he]),be=pe!==r,Pe=pe===null,We=pe===pe,ot=an(pe);if(U)var qe=g||We;else ue?qe=We&&(g||be):k?qe=We&&be&&(g||!Pe):Z?qe=We&&be&&!Pe&&(g||!ot):Pe||ot?qe=!1:qe=g?pe<=a:pe<a;qe?_=he+1:A=he}return Or(A,Ae)}function l2(s,a){for(var u=-1,g=s.length,_=0,A=[];++u<g;){var U=s[u],k=a?a(U):U;if(!u||!Pn(k,Z)){var Z=k;A[_++]=U===0?0:U}}return A}function u2(s){return typeof s=="number"?s:an(s)?ae:+s}function on(s){if(typeof s=="string")return s;if(Xe(s))return jt(s,on)+"";if(an(s))return H3?H3.call(s):"";var a=s+"";return a=="0"&&1/s==-le?"-0":a}function ji(s,a,u){var g=-1,_=Ol,A=s.length,U=!0,k=[],Z=k;if(u)U=!1,_=m0;else if(A>=i){var ue=a?null:S$(s);if(ue)return Dl(ue);U=!1,_=Pa,Z=new Es}else Z=a?[]:k;e:for(;++g<A;){var he=s[g],pe=a?a(he):he;if(he=u||he!==0?he:0,U&&pe===pe){for(var be=Z.length;be--;)if(Z[be]===pe)continue e;a&&Z.push(pe),k.push(he)}else _(Z,pe,u)||(Z!==k&&Z.push(pe),k.push(he))}return k}function H0(s,a){return a=Fi(a,s),s=j2(s,a),s==null||delete s[qn(_n(a))]}function h2(s,a,u,g){return ka(s,a,u(Cs(s,a)),g)}function Zl(s,a,u,g){for(var _=s.length,A=g?_:-1;(g?A--:++A<_)&&a(s[A],A,s););return u?bn(s,g?0:A,g?A+1:_):bn(s,g?A+1:0,g?_:A)}function f2(s,a){var u=s;return u instanceof dt&&(u=u.value()),w0(a,function(g,_){return _.func.apply(_.thisArg,Ni([g],_.args))},u)}function z0(s,a,u){var g=s.length;if(g<2)return g?ji(s[0]):[];for(var _=-1,A=te(g);++_<g;)for(var U=s[_],k=-1;++k<g;)k!=_&&(A[_]=ja(A[_]||U,s[k],a,u));return ji(xr(A,1),a,u)}function d2(s,a,u){for(var g=-1,_=s.length,A=a.length,U={};++g<_;){var k=g<A?a[g]:r;u(U,s[g],k)}return U}function W0(s){return Xt(s)?s:[]}function q0(s){return typeof s=="function"?s:Qr}function Fi(s,a){return Xe(s)?s:ed(s,a)?[s]:H2(yt(s))}var m$=ct;function Bi(s,a,u){var g=s.length;return u=u===r?g:u,!a&&u>=g?s:bn(s,a,u)}var p2=nD||function(s){return mt.clearTimeout(s)};function g2(s,a){if(a)return s.slice();var u=s.length,g=M3?M3(u):new s.constructor(u);return s.copy(g),g}function V0(s){var a=new s.constructor(s.byteLength);return new Ll(a).set(new Ll(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,pn.exec(s));return a.lastIndex=s.lastIndex,a}function y$(s){return Ma?Ot(Ma.call(s)):{}}function m2(s,a){var u=a?V0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function w2(s,a){if(s!==a){var u=s!==r,g=s===null,_=s===s,A=an(s),U=a!==r,k=a===null,Z=a===a,ue=an(a);if(!k&&!ue&&!A&&s>a||A&&U&&Z&&!k&&!ue||g&&U&&Z||!u&&Z||!_)return 1;if(!g&&!A&&!ue&&s<a||ue&&u&&_&&!g&&!A||k&&u&&_||!U&&_||!Z)return-1}return 0}function b$(s,a,u){for(var g=-1,_=s.criteria,A=a.criteria,U=_.length,k=u.length;++g<U;){var Z=w2(_[g],A[g]);if(Z){if(g>=k)return Z;var ue=u[g];return Z*(ue=="desc"?-1:1)}}return s.index-a.index}function v2(s,a,u,g){for(var _=-1,A=s.length,U=u.length,k=-1,Z=a.length,ue=fr(A-U,0),he=te(Z+ue),pe=!g;++k<Z;)he[k]=a[k];for(;++_<U;)(pe||_<A)&&(he[u[_]]=s[_]);for(;ue--;)he[k++]=s[_++];return he}function y2(s,a,u,g){for(var _=-1,A=s.length,U=-1,k=u.length,Z=-1,ue=a.length,he=fr(A-k,0),pe=te(he+ue),be=!g;++_<he;)pe[_]=s[_];for(var Pe=_;++Z<ue;)pe[Pe+Z]=a[Z];for(;++U<k;)(be||_<A)&&(pe[Pe+u[U]]=s[_++]);return pe}function Zr(s,a){var u=-1,g=s.length;for(a||(a=te(g));++u<g;)a[u]=s[u];return a}function Wn(s,a,u,g){var _=!u;u||(u={});for(var A=-1,U=a.length;++A<U;){var k=a[A],Z=g?g(u[k],s[k],k,u,s):r;Z===r&&(Z=s[k]),_?ci(u,k,Z):Ua(u,k,Z)}return u}function _$(s,a){return Wn(s,X0(s),a)}function E$(s,a){return Wn(s,T2(s),a)}function Yl(s,a){return function(u,g){var _=Xe(u)?OA:WD,A=a?a():{};return _(u,s,ze(g,2),A)}}function Co(s){return ct(function(a,u){var g=-1,_=u.length,A=_>1?u[_-1]:r,U=_>2?u[2]:r;for(A=s.length>3&&typeof A=="function"?(_--,A):r,U&&kr(u[0],u[1],U)&&(A=_<3?r:A,_=1),a=Ot(a);++g<_;){var k=u[g];k&&s(a,k,g,A)}return a})}function b2(s,a){return function(u,g){if(u==null)return u;if(!Yr(u))return s(u,g);for(var _=u.length,A=a?_:-1,U=Ot(u);(a?A--:++A<_)&&g(U[A],A,U)!==!1;);return u}}function _2(s){return function(a,u,g){for(var _=-1,A=Ot(a),U=g(a),k=U.length;k--;){var Z=U[s?k:++_];if(u(A[Z],Z,A)===!1)break}return a}}function x$(s,a,u){var g=a&H,_=Ha(s);function A(){var U=this&&this!==mt&&this instanceof A?_:s;return U.apply(g?u:this,arguments)}return A}function E2(s){return function(a){a=yt(a);var u=wo(a)?Dn(a):r,g=u?u[0]:a.charAt(0),_=u?Bi(u,1).join(""):a.slice(1);return g[s]()+_}}function Io(s){return function(a){return w0(bw(yw(a).replace(Da,"")),s,"")}}function Ha(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=xo(s.prototype),g=s.apply(u,a);return kt(g)?g:u}}function C$(s,a,u){var g=Ha(s);function _(){for(var A=arguments.length,U=te(A),k=A,Z=So(_);k--;)U[k]=arguments[k];var ue=A<3&&U[0]!==Z&&U[A-1]!==Z?[]:Li(U,Z);if(A-=ue.length,A<u)return O2(s,a,Jl,_.placeholder,r,U,ue,r,r,u-A);var he=this&&this!==mt&&this instanceof _?g:s;return wr(he,this,U)}return _}function x2(s){return function(a,u,g){var _=Ot(a);if(!Yr(a)){var A=ze(u,3);a=vr(a),u=function(k){return A(_[k],k,_)}}var U=s(a,u,g);return U>-1?_[A?a[U]:U]:r}}function C2(s){return ui(function(a){var u=a.length,g=u,_=vn.prototype.thru;for(s&&a.reverse();g--;){var A=a[g];if(typeof A!="function")throw new wn(c);if(_&&!U&&tu(A)=="wrapper")var U=new vn([],!0)}for(g=U?g:u;++g<u;){A=a[g];var k=tu(A),Z=k=="wrapper"?J0(A):r;Z&&td(Z[0])&&Z[1]==(d|L|R|C)&&!Z[4].length&&Z[9]==1?U=U[tu(Z[0])].apply(U,Z[3]):U=A.length==1&&td(A)?U[k]():U.thru(A)}return function(){var ue=arguments,he=ue[0];if(U&&ue.length==1&&Xe(he))return U.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 Jl(s,a,u,g,_,A,U,k,Z,ue){var he=a&d,pe=a&H,be=a&V,Pe=a&(L|$),We=a&J,ot=be?r:Ha(s);function qe(){for(var ft=arguments.length,wt=te(ft),cn=ft;cn--;)wt[cn]=arguments[cn];if(Pe)var Hr=So(qe),ln=MA(wt,Hr);if(g&&(wt=v2(wt,g,_,Pe)),A&&(wt=y2(wt,A,U,Pe)),ft-=ln,Pe&&ft<ue){var er=Li(wt,Hr);return O2(s,a,Jl,qe.placeholder,u,wt,er,k,Z,ue-ft)}var Tn=pe?u:this,pi=be?Tn[s]:s;return ft=wt.length,k?wt=W$(wt,k):We&&ft>1&&wt.reverse(),he&&Z<ft&&(wt.length=Z),this&&this!==mt&&this instanceof qe&&(pi=ot||Ha(pi)),pi.apply(Tn,wt)}return qe}function I2(s,a){return function(u,g){return QD(u,s,a(g),{})}}function Ql(s,a){return function(u,g){var _;if(u===r&&g===r)return a;if(u!==r&&(_=u),g!==r){if(_===r)return g;typeof u=="string"||typeof g=="string"?(u=on(u),g=on(g)):(u=u2(u),g=u2(g)),_=s(u,g)}return _}}function K0(s){return ui(function(a){return a=jt(a,sn(ze())),ct(function(u){var g=this;return s(a,function(_){return wr(_,g,u)})})})}function Xl(s,a){a=a===r?" ":on(a);var u=a.length;if(u<2)return u?B0(a,s):a;var g=B0(a,Fl(s/vo(a)));return wo(a)?Bi(Dn(g),0,s).join(""):g.slice(0,s)}function I$(s,a,u,g){var _=a&H,A=Ha(s);function U(){for(var k=-1,Z=arguments.length,ue=-1,he=g.length,pe=te(he+Z),be=this&&this!==mt&&this instanceof U?A:s;++ue<he;)pe[ue]=g[ue];for(;Z--;)pe[ue++]=arguments[++k];return wr(be,_?u:this,pe)}return U}function S2(s){return function(a,u,g){return g&&typeof g!="number"&&kr(a,u,g)&&(u=g=r),a=di(a),u===r?(u=a,a=0):u=di(u),g=g===r?a<u?1:-1:di(g),u$(a,u,g,s)}}function eu(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=En(a),u=En(u)),s(a,u)}}function O2(s,a,u,g,_,A,U,k,Z,ue){var he=a&L,pe=he?U:r,be=he?r:U,Pe=he?A:r,We=he?r:A;a|=he?R:S,a&=~(he?S:R),a&T||(a&=~(H|V));var ot=[s,a,_,Pe,pe,We,be,k,Z,ue],qe=u.apply(r,ot);return td(s)&&F2(qe,ot),qe.placeholder=g,B2(qe,s,a)}function G0(s){var a=hr[s];return function(u,g){if(u=En(u),g=g==null?0:Or(it(g),292),g&&B3(u)){var _=(yt(u)+"e").split("e"),A=a(_[0]+"e"+(+_[1]+g));return _=(yt(A)+"e").split("e"),+(_[0]+"e"+(+_[1]-g))}return a(u)}}var S$=_o&&1/Dl(new _o([,-0]))[1]==le?function(s){return new _o(s)}:md;function A2(s){return function(a){var u=Ar(a);return u==Ue?C0(a):u==He?zA(a):LA(a,s(a))}}function li(s,a,u,g,_,A,U,k){var Z=a&V;if(!Z&&typeof s!="function")throw new wn(c);var ue=g?g.length:0;if(ue||(a&=~(R|S),g=_=r),U=U===r?U:fr(it(U),0),k=k===r?k:it(k),ue-=_?_.length:0,a&S){var he=g,pe=_;g=_=r}var be=Z?r:J0(s),Pe=[s,a,u,g,_,he,pe,A,U,k];if(be&&k$(Pe,be),s=Pe[0],a=Pe[1],u=Pe[2],g=Pe[3],_=Pe[4],k=Pe[9]=Pe[9]===r?Z?0:s.length:fr(Pe[9]-ue,0),!k&&a&(L|$)&&(a&=~(L|$)),!a||a==H)var We=x$(s,a,u);else a==L||a==$?We=C$(s,a,k):(a==R||a==(H|R))&&!_.length?We=I$(s,a,u,g):We=Jl.apply(r,Pe);var ot=be?c2:F2;return B2(ot(We,Pe),s,a)}function D2(s,a,u,g){return s===r||Pn(s,bo[u])&&!bt.call(g,u)?a:s}function $2(s,a,u,g,_,A){return kt(s)&&kt(a)&&(A.set(a,s),Kl(s,a,r,$2,A),A.delete(a)),s}function O$(s){return qa(s)?r:s}function P2(s,a,u,g,_,A){var U=u&P,k=s.length,Z=a.length;if(k!=Z&&!(U&&Z>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&M?new Es:r;for(A.set(s,a),A.set(a,s);++pe<k;){var We=s[pe],ot=a[pe];if(g)var qe=U?g(ot,We,pe,a,s,A):g(We,ot,pe,s,a,A);if(qe!==r){if(qe)continue;be=!1;break}if(Pe){if(!v0(a,function(ft,wt){if(!Pa(Pe,wt)&&(We===ft||_(We,ft,u,g,A)))return Pe.push(wt)})){be=!1;break}}else if(!(We===ot||_(We,ot,u,g,A))){be=!1;break}}return A.delete(s),A.delete(a),be}function A$(s,a,u,g,_,A,U){switch(u){case p:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case E:return!(s.byteLength!=a.byteLength||!A(new Ll(s),new Ll(a)));case Y:case W:case nt:return Pn(+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 Z=g&P;if(k||(k=Dl),s.size!=a.size&&!Z)return!1;var ue=U.get(s);if(ue)return ue==a;g|=M,U.set(s,a);var he=P2(k(s),k(a),g,_,A,U);return U.delete(s),he;case Ke:if(Ma)return Ma.call(s)==Ma.call(a)}return!1}function D$(s,a,u,g,_,A){var U=u&P,k=Z0(s),Z=k.length,ue=Z0(a),he=ue.length;if(Z!=he&&!U)return!1;for(var pe=Z;pe--;){var be=k[pe];if(!(U?be in a:bt.call(a,be)))return!1}var Pe=A.get(s),We=A.get(a);if(Pe&&We)return Pe==a&&We==s;var ot=!0;A.set(s,a),A.set(a,s);for(var qe=U;++pe<Z;){be=k[pe];var ft=s[be],wt=a[be];if(g)var cn=U?g(wt,ft,be,a,s,A):g(ft,wt,be,s,a,A);if(!(cn===r?ft===wt||_(ft,wt,u,g,A):cn)){ot=!1;break}qe||(qe=be=="constructor")}if(ot&&!qe){var Hr=s.constructor,ln=a.constructor;Hr!=ln&&"constructor"in s&&"constructor"in a&&!(typeof Hr=="function"&&Hr instanceof Hr&&typeof ln=="function"&&ln instanceof ln)&&(ot=!1)}return A.delete(s),A.delete(a),ot}function ui(s){return nd(U2(s,r,V2),s+"")}function Z0(s){return J3(s,vr,X0)}function Y0(s){return J3(s,Jr,T2)}var J0=kl?function(s){return kl.get(s)}:md;function tu(s){for(var a=s.name+"",u=Eo[a],g=bt.call(Eo,a)?u.length:0;g--;){var _=u[g],A=_.func;if(A==null||A==s)return _.name}return a}function So(s){var a=bt.call(I,"placeholder")?I:s;return a.placeholder}function ze(){var s=I.iteratee||pd;return s=s===pd?e2:s,arguments.length?s(arguments[0],arguments[1]):s}function ru(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],_=s[g];a[u]=[g,_,L2(_)]}return a}function Is(s,a){var u=BA(s,a);return X3(u)?u:r}function $$(s){var a=bt.call(s,bs),u=s[bs];try{s[bs]=r;var g=!0}catch{}var _=Rl.call(s);return g&&(a?s[bs]=u:delete s[bs]),_}var X0=S0?function(s){return s==null?[]:(s=Ot(s),Ri(S0(s),function(a){return j3.call(s,a)}))}:wd,T2=S0?function(s){for(var a=[];s;)Ni(a,X0(s)),s=Ml(s);return a}:wd,Ar=Br;(O0&&Ar(new O0(new ArrayBuffer(1)))!=p||Ra&&Ar(new Ra)!=Ue||A0&&Ar(A0.resolve())!=Dt||_o&&Ar(new _o)!=He||Na&&Ar(new Na)!=je)&&(Ar=function(s){var a=Br(s),u=a==Ge?s.constructor:r,g=u?Ss(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,_=u.length;++g<_;){var A=u[g],U=A.size;switch(A.type){case"drop":s+=U;break;case"dropRight":a-=U;break;case"take":a=Or(a,s+U);break;case"takeRight":s=fr(s,a-U);break}}return{start:s,end:a}}function T$(s){var a=s.match(Pt);return a?a[1].split(or):[]}function R2(s,a,u){a=Fi(a,s);for(var g=-1,_=a.length,A=!1;++g<_;){var U=qn(a[g]);if(!(A=s!=null&&u(s,U)))break;s=s[U]}return A||++g!=_?A:(_=s==null?0:s.length,!!_&&lu(_)&&hi(U,_)&&(Xe(s)||Os(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 N2(s){return typeof s.constructor=="function"&&!za(s)?xo(Ml(s)):{}}function N$(s,a,u){var g=s.constructor;switch(a){case E:return V0(s);case Y:case W:return new g(+s);case p:return w$(s,u);case m:case D:case B:case G:case X:case Ee:case Re:case st:case ht:return m2(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,`{
|
|
67
|
+
/* [wrapped with `+a+`] */
|
|
68
|
+
`)}function M$(s){return Xe(s)||Os(s)||!!(F3&&s&&s[F3])}function hi(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 kr(s,a,u){if(!kt(u))return!1;var g=typeof a;return(g=="number"?Yr(u)&&hi(a,u.length):g=="string"&&a in u)?Pn(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||an(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=tu(s),u=I[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!!L3&&L3 in s}var F$=Pl?fi:vd;function za(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||bo;return s===u}function L2(s){return s===s&&!kt(s)}function M2(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==r||s in Ot(u))}}function B$(s){var a=au(s,function(g){return u.size===h&&u.clear(),g}),u=a.cache;return a}function k$(s,a){var u=s[1],g=a[1],_=u|g,A=_<(H|V|d),U=g==d&&u==L||g==d&&u==C&&s[7].length<=a[8]||g==(d|C)&&a[7].length<=a[8]&&u==L;if(!(A||U))return s;g&H&&(s[2]=a[2],_|=u&H?0:T);var k=a[3];if(k){var Z=s[3];s[3]=Z?v2(Z,k,a[4]):k,s[4]=Z?Li(s[3],v):a[4]}return k=a[5],k&&(Z=s[5],s[5]=Z?y2(Z,k,a[6]):k,s[6]=Z?Li(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]=_,s}function H$(s){var a=[];if(s!=null)for(var u in Ot(s))a.push(u);return a}function z$(s){return Rl.call(s)}function U2(s,a,u){return a=fr(a===r?s.length-1:a,0),function(){for(var g=arguments,_=-1,A=fr(g.length-a,0),U=te(A);++_<A;)U[_]=g[a+_];_=-1;for(var k=te(a+1);++_<a;)k[_]=g[_];return k[a]=u(U),wr(s,this,k)}}function j2(s,a){return a.length<2?s:Cs(s,bn(a,0,-1))}function W$(s,a){for(var u=s.length,g=Or(a.length,u),_=Zr(s);g--;){var A=a[g];s[g]=hi(A,u)?_[A]:r}return s}function rd(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var F2=k2(c2),Wa=sD||function(s,a){return mt.setTimeout(s,a)},nd=k2(d$);function B2(s,a,u){var g=a+"";return nd(s,L$(g,q$(T$(g),u)))}function k2(s){var a=0,u=0;return function(){var g=lD(),_=me-(g-u);if(u=g,_>0){if(++a>=de)return arguments[0]}else a=0;return s.apply(r,arguments)}}function nu(s,a){var u=-1,g=s.length,_=g-1;for(a=a===r?g:a;++u<a;){var A=F0(u,_),U=s[A];s[A]=s[u],s[u]=U}return s.length=a,s}var H2=B$(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(ir,function(u,g,_,A){a.push(_?A.replace(Yf,"$1"):g||u)}),a});function qn(s){if(typeof s=="string"||an(s))return s;var a=s+"";return a=="0"&&1/s==-le?"-0":a}function Ss(s){if(s!=null){try{return Tl.call(s)}catch{}try{return s+""}catch{}}return""}function q$(s,a){return mn(Be,function(u){var g="_."+u[0];a&u[1]&&!Ol(s,g)&&s.push(g)}),s.sort()}function z2(s){if(s instanceof dt)return s.clone();var a=new vn(s.__wrapped__,s.__chain__);return a.__actions__=Zr(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function V$(s,a,u){(u?kr(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 _=0,A=0,U=te(Fl(g/a));_<g;)U[A++]=bn(s,_,_+=a);return U}function K$(s){for(var a=-1,u=s==null?0:s.length,g=0,_=[];++a<u;){var A=s[a];A&&(_[g++]=A)}return _}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 Ni(Xe(u)?Zr(u):[u],xr(a,1))}var Z$=ct(function(s,a){return Xt(s)?ja(s,xr(a,1,Xt,!0)):[]}),Y$=ct(function(s,a){var u=_n(a);return Xt(u)&&(u=r),Xt(s)?ja(s,xr(a,1,Xt,!0),ze(u,2)):[]}),J$=ct(function(s,a){var u=_n(a);return Xt(u)&&(u=r),Xt(s)?ja(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),bn(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,bn(s,0,a<0?0:a)):[]}function eP(s,a){return s&&s.length?Zl(s,ze(a,3),!0,!0):[]}function tP(s,a){return s&&s.length?Zl(s,ze(a,3),!0):[]}function rP(s,a,u,g){var _=s==null?0:s.length;return _?(u&&typeof u!="number"&&kr(s,a,u)&&(u=0,g=_),GD(s,a,u,g)):[]}function W2(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var _=u==null?0:it(u);return _<0&&(_=fr(g+_,0)),Al(s,ze(a,3),_)}function q2(s,a,u){var g=s==null?0:s.length;if(!g)return-1;var _=g-1;return u!==r&&(_=it(u),_=u<0?fr(g+_,0):Or(_,g-1)),Al(s,ze(a,3),_,!0)}function V2(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 _=s[a];g[_[0]]=_[1]}return g}function K2(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 _=u==null?0:it(u);return _<0&&(_=fr(g+_,0)),mo(s,a,_)}function aP(s){var a=s==null?0:s.length;return a?bn(s,0,-1):[]}var cP=ct(function(s){var a=jt(s,W0);return a.length&&a[0]===s[0]?N0(a):[]}),lP=ct(function(s){var a=_n(s),u=jt(s,W0);return a===_n(u)?a=r:u.pop(),u.length&&u[0]===s[0]?N0(u,ze(a,2)):[]}),uP=ct(function(s){var a=_n(s),u=jt(s,W0);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 _n(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 _=g;return u!==r&&(_=it(u),_=_<0?fr(g+_,0):Or(_,g-1)),a===a?qA(s,a,_):Al(s,O3,_,!0)}function dP(s,a){return s&&s.length?i2(s,it(a)):r}var pP=ct(G2);function G2(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,ze(u,2)):s}function mP(s,a,u){return s&&s.length&&a&&a.length?j0(s,a,r,u):s}var wP=ui(function(s,a){var u=s==null?0:s.length,g=$0(s,a);return a2(s,jt(a,function(_){return hi(_,u)?+_:_}).sort(w2)),g});function vP(s,a){var u=[];if(!(s&&s.length))return u;var g=-1,_=[],A=s.length;for(a=ze(a,3);++g<A;){var U=s[g];a(U,g,s)&&(u.push(U),_.push(g))}return a2(s,_),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"&&kr(s,a,u)?(a=0,u=g):(a=a==null?0:it(a),u=u===r?g:it(u)),bn(s,a,u)):[]}function bP(s,a){return Gl(s,a)}function _P(s,a,u){return k0(s,a,ze(u,2))}function EP(s,a){var u=s==null?0:s.length;if(u){var g=Gl(s,a);if(g<u&&Pn(s[g],a))return g}return-1}function xP(s,a){return Gl(s,a,!0)}function CP(s,a,u){return k0(s,a,ze(u,2),!0)}function IP(s,a){var u=s==null?0:s.length;if(u){var g=Gl(s,a,!0)-1;if(Pn(s[g],a))return g}return-1}function SP(s){return s&&s.length?l2(s):[]}function OP(s,a){return s&&s.length?l2(s,ze(a,2)):[]}function AP(s){var a=s==null?0:s.length;return a?bn(s,1,a):[]}function DP(s,a,u){return s&&s.length?(a=u||a===r?1:it(a),bn(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,bn(s,a<0?0:a,g)):[]}function PP(s,a){return s&&s.length?Zl(s,ze(a,3),!1,!0):[]}function TP(s,a){return s&&s.length?Zl(s,ze(a,3)):[]}var RP=ct(function(s){return ji(xr(s,1,Xt,!0))}),NP=ct(function(s){var a=_n(s);return Xt(a)&&(a=r),ji(xr(s,1,Xt,!0),ze(a,2))}),LP=ct(function(s){var a=_n(s);return a=typeof a=="function"?a:r,ji(xr(s,1,Xt,!0),r,a)});function MP(s){return s&&s.length?ji(s):[]}function UP(s,a){return s&&s.length?ji(s,ze(a,2)):[]}function jP(s,a){return a=typeof a=="function"?a:r,s&&s.length?ji(s,r,a):[]}function sd(s){if(!(s&&s.length))return[];var a=0;return s=Ri(s,function(u){if(Xt(u))return a=fr(u.length,a),!0}),E0(a,function(u){return jt(s,y0(u))})}function Z2(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)?ja(s,a):[]}),BP=ct(function(s){return z0(Ri(s,Xt))}),kP=ct(function(s){var a=_n(s);return Xt(a)&&(a=r),z0(Ri(s,Xt),ze(a,2))}),HP=ct(function(s){var a=_n(s);return a=typeof a=="function"?a:r,z0(Ri(s,Xt),r,a)}),zP=ct(sd);function WP(s,a){return d2(s||[],a||[],Ua)}function qP(s,a){return d2(s||[],a||[],ka)}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,Z2(s,u)});function Y2(s){var a=I(s);return a.__chain__=!0,a}function KP(s,a){return a(s),s}function iu(s,a){return a(s)}var GP=ui(function(s){var a=s.length,u=a?s[0]:0,g=this.__wrapped__,_=function(A){return $0(A,s)};return a>1||this.__actions__.length||!(g instanceof dt)||!hi(u)?this.thru(_):(g=g.slice(u,+u+(a?1:0)),g.__actions__.push({func:iu,args:[_],thisArg:r}),new vn(g,this.__chain__).thru(function(A){return a&&!A.length&&A.push(r),A}))});function ZP(){return Y2(this)}function YP(){return new vn(this.value(),this.__chain__)}function JP(){this.__values__===r&&(this.__values__=uw(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 zl;){var g=z2(u);g.__index__=0,g.__values__=r,a?_.__wrapped__=g:a=g;var _=g;u=u.__wrapped__}return _.__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:iu,args:[id],thisArg:r}),new vn(a,this.__chain__)}return this.thru(id)}function tT(){return f2(this.__wrapped__,this.__actions__)}var rT=Yl(function(s,a,u){bt.call(s,u)?++s[u]:ci(s,u,1)});function nT(s,a,u){var g=Xe(s)?I3:KD;return u&&kr(s,a,u)&&(a=r),g(s,ze(a,3))}function iT(s,a){var u=Xe(s)?Ri:Z3;return u(s,ze(a,3))}var sT=x2(W2),oT=x2(q2);function aT(s,a){return xr(su(s,a),1)}function cT(s,a){return xr(su(s,a),le)}function lT(s,a,u){return u=u===r?1:it(u),xr(su(s,a),u)}function J2(s,a){var u=Xe(s)?mn:Ui;return u(s,ze(a,3))}function Q2(s,a){var u=Xe(s)?AA:G3;return u(s,ze(a,3))}var uT=Yl(function(s,a,u){bt.call(s,u)?s[u].push(a):ci(s,u,[a])});function hT(s,a,u,g){s=Yr(s)?s:Ao(s),u=u&&!g?it(u):0;var _=s.length;return u<0&&(u=fr(_+u,0)),uu(s)?u<=_&&s.indexOf(a,u)>-1:!!_&&mo(s,a,u)>-1}var fT=ct(function(s,a,u){var g=-1,_=typeof a=="function",A=Yr(s)?te(s.length):[];return Ui(s,function(U){A[++g]=_?wr(a,U,u):Fa(U,a,u)}),A}),dT=Yl(function(s,a,u){ci(s,u,a)});function su(s,a){var u=Xe(s)?jt:t2;return u(s,ze(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]),s2(s,a,u))}var gT=Yl(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function mT(s,a,u){var g=Xe(s)?w0:D3,_=arguments.length<3;return g(s,ze(a,4),u,_,Ui)}function wT(s,a,u){var g=Xe(s)?DA:D3,_=arguments.length<3;return g(s,ze(a,4),u,_,G3)}function vT(s,a){var u=Xe(s)?Ri:Z3;return u(s,cu(ze(a,3)))}function yT(s){var a=Xe(s)?W3:h$;return a(s)}function bT(s,a,u){(u?kr(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)?zD:p$;return a(s)}function ET(s){if(s==null)return 0;if(Yr(s))return uu(s)?vo(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&&kr(s,a,u)&&(a=r),g(s,ze(a,3))}var CT=ct(function(s,a){if(s==null)return[];var u=a.length;return u>1&&kr(s,a[0],a[1])?a=[]:u>2&&kr(a[0],a[1],a[2])&&(a=[a[0]]),s2(s,xr(a,1),[])}),ou=iD||function(){return mt.Date.now()};function IT(s,a){if(typeof a!="function")throw new wn(c);return s=it(s),function(){if(--s<1)return a.apply(this,arguments)}}function X2(s,a,u){return a=u?r:a,a=s&&a==null?s.length:a,li(s,d,r,r,r,r,a)}function ew(s,a){var u;if(typeof a!="function")throw new wn(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 _=Li(u,So(od));g|=R}return li(s,g,a,u,_)}),tw=ct(function(s,a,u){var g=H|V;if(u.length){var _=Li(u,So(tw));g|=R}return li(a,g,s,u,_)});function rw(s,a,u){a=u?r:a;var g=li(s,L,r,r,r,r,r,a);return g.placeholder=rw.placeholder,g}function nw(s,a,u){a=u?r:a;var g=li(s,$,r,r,r,r,r,a);return g.placeholder=nw.placeholder,g}function iw(s,a,u){var g,_,A,U,k,Z,ue=0,he=!1,pe=!1,be=!0;if(typeof s!="function")throw new wn(c);a=En(a)||0,kt(u)&&(he=!!u.leading,pe="maxWait"in u,A=pe?fr(En(u.maxWait)||0,a):A,be="trailing"in u?!!u.trailing:be);function Pe(er){var Tn=g,pi=_;return g=_=r,ue=er,U=s.apply(pi,Tn),U}function We(er){return ue=er,k=Wa(ft,a),he?Pe(er):U}function ot(er){var Tn=er-Z,pi=er-ue,xw=a-Tn;return pe?Or(xw,A-pi):xw}function qe(er){var Tn=er-Z,pi=er-ue;return Z===r||Tn>=a||Tn<0||pe&&pi>=A}function ft(){var er=ou();if(qe(er))return wt(er);k=Wa(ft,ot(er))}function wt(er){return k=r,be&&g?Pe(er):(g=_=r,U)}function cn(){k!==r&&p2(k),ue=0,g=Z=_=k=r}function Hr(){return k===r?U:wt(ou())}function ln(){var er=ou(),Tn=qe(er);if(g=arguments,_=this,Z=er,Tn){if(k===r)return We(Z);if(pe)return p2(k),k=Wa(ft,a),Pe(Z)}return k===r&&(k=Wa(ft,a)),U}return ln.cancel=cn,ln.flush=Hr,ln}var ST=ct(function(s,a){return K3(s,1,a)}),OT=ct(function(s,a,u){return K3(s,En(a)||0,u)});function AT(s){return li(s,J)}function au(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new wn(c);var u=function(){var g=arguments,_=a?a.apply(this,g):g[0],A=u.cache;if(A.has(_))return A.get(_);var U=s.apply(this,g);return u.cache=A.set(_,U)||A,U};return u.cache=new(au.Cache||ai),u}au.Cache=ai;function cu(s){if(typeof s!="function")throw new wn(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 ew(2,s)}var $T=m$(function(s,a){a=a.length==1&&Xe(a[0])?jt(a[0],sn(ze())):jt(xr(a,1),sn(ze()));var u=a.length;return ct(function(g){for(var _=-1,A=Or(g.length,u);++_<A;)g[_]=a[_].call(this,g[_]);return wr(s,this,g)})}),ad=ct(function(s,a){var u=Li(a,So(ad));return li(s,R,r,a,u)}),sw=ct(function(s,a){var u=Li(a,So(sw));return li(s,S,r,a,u)}),PT=ui(function(s,a){return li(s,C,r,r,r,a)});function TT(s,a){if(typeof s!="function")throw new wn(c);return a=a===r?a:it(a),ct(s,a)}function RT(s,a){if(typeof s!="function")throw new wn(c);return a=a==null?0:fr(it(a),0),ct(function(u){var g=u[a],_=Bi(u,0,a);return g&&Ni(_,g),wr(s,this,_)})}function NT(s,a,u){var g=!0,_=!0;if(typeof s!="function")throw new wn(c);return kt(u)&&(g="leading"in u?!!u.leading:g,_="trailing"in u?!!u.trailing:_),iw(s,a,{leading:g,maxWait:a,trailing:_})}function LT(s){return X2(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 yn(s,x)}function FT(s,a){return a=typeof a=="function"?a:r,yn(s,x,a)}function BT(s){return yn(s,y|x)}function kT(s,a){return a=typeof a=="function"?a:r,yn(s,y|x,a)}function HT(s,a){return a==null||V3(s,a,vr(a))}function Pn(s,a){return s===a||s!==s&&a!==a}var zT=eu(R0),WT=eu(function(s,a){return s>=a}),Os=Q3(function(){return arguments}())?Q3:function(s){return Zt(s)&&bt.call(s,"callee")&&!j3.call(s,"callee")},Xe=te.isArray,qT=Fr?sn(Fr):XD;function Yr(s){return s!=null&&lu(s.length)&&!fi(s)}function Xt(s){return Zt(s)&&Yr(s)}function VT(s){return s===!0||s===!1||Zt(s)&&Br(s)==Y}var ki=oD||vd,KT=An?sn(An):e$;function GT(s){return Zt(s)&&s.nodeType===1&&!qa(s)}function ZT(s){if(s==null)return!0;if(Yr(s)&&(Xe(s)||typeof s=="string"||typeof s.splice=="function"||ki(s)||Oo(s)||Os(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 Ba(s,a)}function JT(s,a,u){u=typeof u=="function"?u:r;var g=u?u(s,a):r;return g===r?Ba(s,a,r,u):!!g}function cd(s){if(!Zt(s))return!1;var a=Br(s);return a==F||a==w||typeof s.message=="string"&&typeof s.name=="string"&&!qa(s)}function QT(s){return typeof s=="number"&&B3(s)}function fi(s){if(!kt(s))return!1;var a=Br(s);return a==we||a==ve||a==Q||a==$t}function ow(s){return typeof s=="number"&&s==it(s)}function lu(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 aw=gn?sn(gn):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 cw(s)&&s!=+s}function rR(s){if(F$(s))throw new Ye(o);return X3(s)}function nR(s){return s===null}function iR(s){return s==null}function cw(s){return typeof s=="number"||Zt(s)&&Br(s)==nt}function qa(s){if(!Zt(s)||Br(s)!=Ge)return!1;var a=Ml(s);if(a===null)return!0;var u=bt.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&Tl.call(u)==eD}var ld=Hn?sn(Hn):n$;function sR(s){return ow(s)&&s>=-re&&s<=re}var lw=$a?sn($a):i$;function uu(s){return typeof s=="string"||!Xe(s)&&Zt(s)&&Br(s)==ke}function an(s){return typeof s=="symbol"||Zt(s)&&Br(s)==Ke}var Oo=ys?sn(ys):s$;function oR(s){return s===r}function aR(s){return Zt(s)&&Ar(s)==je}function cR(s){return Zt(s)&&Br(s)==Ze}var lR=eu(U0),uR=eu(function(s,a){return s<=a});function uw(s){if(!s)return[];if(Yr(s))return uu(s)?Dn(s):Zr(s);if(Ta&&s[Ta])return HA(s[Ta]());var a=Ar(s),u=a==Ue?C0:a==He?Dl:Ao;return u(s)}function di(s){if(!s)return s===0?s:0;if(s=En(s),s===le||s===-le){var a=s<0?-1:1;return a*ne}return s===s?s:0}function it(s){var a=di(s),u=a%1;return a===a?u?a-u:a:0}function hw(s){return s?xs(it(s),0,ie):0}function En(s){if(typeof s=="number")return s;if(an(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=$3(s);var u=Xf.test(s);return u||t0.test(s)?Qe(s.slice(2),u?2:8):Qf.test(s)?ae:+s}function fw(s){return Wn(s,Jr(s))}function hR(s){return s?xs(it(s),-re,re):s===0?s:0}function yt(s){return s==null?"":on(s)}var fR=Co(function(s,a){if(za(a)||Yr(a)){Wn(a,vr(a),s);return}for(var u in a)bt.call(a,u)&&Ua(s,u,a[u])}),dw=Co(function(s,a){Wn(a,Jr(a),s)}),hu=Co(function(s,a,u,g){Wn(a,Jr(a),s,g)}),dR=Co(function(s,a,u,g){Wn(a,vr(a),s,g)}),pR=ui($0);function gR(s,a){var u=xo(s);return a==null?u:q3(u,a)}var mR=ct(function(s,a){s=Ot(s);var u=-1,g=a.length,_=g>2?a[2]:r;for(_&&kr(a[0],a[1],_)&&(g=1);++u<g;)for(var A=a[u],U=Jr(A),k=-1,Z=U.length;++k<Z;){var ue=U[k],he=s[ue];(he===r||Pn(he,bo[ue])&&!bt.call(s,ue))&&(s[ue]=A[ue])}return s}),wR=ct(function(s){return s.push(r,$2),wr(pw,r,s)});function vR(s,a){return S3(s,ze(a,3),zn)}function yR(s,a){return S3(s,ze(a,3),T0)}function bR(s,a){return s==null?s:P0(s,ze(a,3),Jr)}function _R(s,a){return s==null?s:Y3(s,ze(a,3),Jr)}function ER(s,a){return s&&zn(s,ze(a,3))}function xR(s,a){return s&&T0(s,ze(a,3))}function CR(s){return s==null?[]:Vl(s,vr(s))}function IR(s){return s==null?[]:Vl(s,Jr(s))}function ud(s,a,u){var g=s==null?r:Cs(s,a);return g===r?u:g}function SR(s,a){return s!=null&&R2(s,a,ZD)}function hd(s,a){return s!=null&&R2(s,a,YD)}var OR=I2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=Rl.call(a)),s[a]=u},dd(Qr)),AR=I2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=Rl.call(a)),bt.call(s,a)?s[a].push(u):s[a]=[u]},ze),DR=ct(Fa);function vr(s){return Yr(s)?z3(s):M0(s)}function Jr(s){return Yr(s)?z3(s,!0):o$(s)}function $R(s,a){var u={};return a=ze(a,3),zn(s,function(g,_,A){ci(u,a(g,_,A),g)}),u}function PR(s,a){var u={};return a=ze(a,3),zn(s,function(g,_,A){ci(u,_,a(g,_,A))}),u}var TR=Co(function(s,a,u){Kl(s,a,u)}),pw=Co(function(s,a,u,g){Kl(s,a,u,g)}),RR=ui(function(s,a){var u={};if(s==null)return u;var g=!1;a=jt(a,function(A){return A=Fi(A,s),g||(g=A.length>1),A}),Wn(s,Y0(s),u),g&&(u=yn(u,y|b|x,O$));for(var _=a.length;_--;)H0(u,a[_]);return u});function NR(s,a){return gw(s,cu(ze(a)))}var LR=ui(function(s,a){return s==null?{}:c$(s,a)});function gw(s,a){if(s==null)return{};var u=jt(Y0(s),function(g){return[g]});return a=ze(a),o2(s,u,function(g,_){return a(g,_[0])})}function MR(s,a,u){a=Fi(a,s);var g=-1,_=a.length;for(_||(_=1,s=r);++g<_;){var A=s==null?r:s[qn(a[g])];A===r&&(g=_,A=u),s=fi(A)?A.call(s):A}return s}function UR(s,a,u){return s==null?s:ka(s,a,u)}function jR(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:ka(s,a,u,g)}var mw=A2(vr),ww=A2(Jr);function FR(s,a,u){var g=Xe(s),_=g||ki(s)||Oo(s);if(a=ze(a,4),u==null){var A=s&&s.constructor;_?u=g?new A:[]:kt(s)?u=fi(A)?xo(Ml(s)):{}:u={}}return(_?mn:zn)(s,function(U,k,Z){return a(u,U,k,Z)}),u}function BR(s,a){return s==null?!0:H0(s,a)}function kR(s,a,u){return s==null?s:h2(s,a,q0(u))}function HR(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:h2(s,a,q0(u),g)}function Ao(s){return s==null?[]:x0(s,vr(s))}function zR(s){return s==null?[]:x0(s,Jr(s))}function WR(s,a,u){return u===r&&(u=a,a=r),u!==r&&(u=En(u),u=u===u?u:0),a!==r&&(a=En(a),a=a===a?a:0),xs(En(s),a,u)}function qR(s,a,u){return a=di(a),u===r?(u=a,a=0):u=di(u),s=En(s),JD(s,a,u)}function VR(s,a,u){if(u&&typeof u!="boolean"&&kr(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=di(s),a===r?(a=s,s=0):a=di(a)),s>a){var g=s;s=a,a=g}if(u||s%1||a%1){var _=k3();return Or(s+_*(a-s+It("1e-"+((_+"").length-1))),a)}return F0(s,a)}var KR=Io(function(s,a,u){return a=a.toLowerCase(),s+(u?vw(a):a)});function vw(s){return fd(yt(s).toLowerCase())}function yw(s){return s=yt(s),s&&s.replace(ii,UA).replace(p0,"")}function GR(s,a,u){s=yt(s),a=on(a);var g=s.length;u=u===r?g:xs(it(u),0,g);var _=u;return u-=a.length,u>=0&&s.slice(u,_)==a}function ZR(s){return s=yt(s),s&&Mt.test(s)?s.replace(ps,jA):s}function YR(s){return s=yt(s),s&&sr.test(s)?s.replace(Vt,"\\$&"):s}var JR=Io(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),QR=Io(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),XR=E2("toLowerCase");function eN(s,a,u){s=yt(s),a=it(a);var g=a?vo(s):0;if(!a||g>=a)return s;var _=(a-g)/2;return Xl(Bl(_),u)+s+Xl(Fl(_),u)}function tN(s,a,u){s=yt(s),a=it(a);var g=a?vo(s):0;return a&&g<a?s+Xl(a-g,u):s}function rN(s,a,u){s=yt(s),a=it(a);var g=a?vo(s):0;return a&&g<a?Xl(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?kr(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=Io(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function aN(s,a,u){return u&&typeof u!="number"&&kr(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=on(a),!a&&wo(s))?Bi(Dn(s),0,u):s.split(a,u)):[]}var cN=Io(function(s,a,u){return s+(u?" ":"")+fd(a)});function lN(s,a,u){return s=yt(s),u=u==null?0:xs(it(u),0,s.length),a=on(a),s.slice(u,u+a.length)==a}function uN(s,a,u){var g=I.templateSettings;u&&kr(s,a,u)&&(a=r),s=yt(s),a=hu({},a,g,D2);var _=hu({},a.imports,g.imports,D2),A=vr(_),U=x0(_,A),k,Z,ue=0,he=a.interpolate||co,pe="__p += '",be=I0((a.escape||co).source+"|"+he.source+"|"+(he===Bt?Jf:co).source+"|"+(a.evaluate||co).source+"|$","g"),Pe="//# sourceURL="+(bt.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++g0+"]")+`
|
|
69
|
+
`;s.replace(be,function(qe,ft,wt,cn,Hr,ln){return wt||(wt=cn),pe+=s.slice(ue,ln).replace(n0,FA),ft&&(k=!0,pe+=`' +
|
|
70
|
+
__e(`+ft+`) +
|
|
71
|
+
'`),Hr&&(Z=!0,pe+=`';
|
|
72
|
+
`+Hr+`;
|
|
73
|
+
__p += '`),wt&&(pe+=`' +
|
|
74
|
+
((__t = (`+wt+`)) == null ? '' : __t) +
|
|
75
|
+
'`),ue=ln+qe.length,qe}),pe+=`';
|
|
76
|
+
`;var We=bt.call(a,"variable")&&a.variable;if(!We)pe=`with (obj) {
|
|
77
|
+
`+pe+`
|
|
91
78
|
}
|
|
92
|
-
`;else if(
|
|
93
|
-
`+(
|
|
94
|
-
`)+"var __t, __p = ''"+(
|
|
79
|
+
`;else if(Zf.test(We))throw new Ye(l);pe=(Z?pe.replace(lt,""):pe).replace(jr,"$1").replace(ni,"$1;"),pe="function("+(We||"obj")+`) {
|
|
80
|
+
`+(We?"":`obj || (obj = {});
|
|
81
|
+
`)+"var __t, __p = ''"+(k?", __e = _.escape":"")+(Z?`, __j = Array.prototype.join;
|
|
95
82
|
function print() { __p += __j.call(arguments, '') }
|
|
96
83
|
`:`;
|
|
97
|
-
`)+
|
|
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").WalletConnectModal}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})});
|
|
84
|
+
`)+pe+`return __p
|
|
85
|
+
}`;var ot=_w(function(){return vt(A,Pe+"return "+pe).apply(r,U)});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 $3(s);if(!s||!(a=on(a)))return s;var g=Dn(s),_=Dn(a),A=P3(g,_),U=T3(g,_)+1;return Bi(g,A,U).join("")}function pN(s,a,u){if(s=yt(s),s&&(u||a===r))return s.slice(0,N3(s)+1);if(!s||!(a=on(a)))return s;var g=Dn(s),_=T3(g,Dn(a))+1;return Bi(g,0,_).join("")}function gN(s,a,u){if(s=yt(s),s&&(u||a===r))return s.replace(Kt,"");if(!s||!(a=on(a)))return s;var g=Dn(s),_=P3(g,Dn(a));return Bi(g,_).join("")}function mN(s,a){var u=z,g=ee;if(kt(a)){var _="separator"in a?a.separator:_;u="length"in a?it(a.length):u,g="omission"in a?on(a.omission):g}s=yt(s);var A=s.length;if(wo(s)){var U=Dn(s);A=U.length}if(u>=A)return s;var k=u-vo(g);if(k<1)return g;var Z=U?Bi(U,0,k).join(""):s.slice(0,k);if(_===r)return Z+g;if(U&&(k+=Z.length-k),ld(_)){if(s.slice(k).search(_)){var ue,he=Z;for(_.global||(_=I0(_.source,yt(pn.exec(_))+"g")),_.lastIndex=0;ue=_.exec(he);)var pe=ue.index;Z=Z.slice(0,pe===r?k:pe)}}else if(s.indexOf(on(_),k)!=k){var be=Z.lastIndexOf(_);be>-1&&(Z=Z.slice(0,be))}return Z+g}function wN(s){return s=yt(s),s&&zt.test(s)?s.replace(Pi,VA):s}var vN=Io(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),fd=E2("toUpperCase");function bw(s,a,u){return s=yt(s),a=u?r:a,a===r?kA(s)?ZA(s):TA(s):s.match(a)||[]}var _w=ct(function(s,a){try{return wr(s,r,a)}catch(u){return cd(u)?u:new Ye(u)}}),yN=ui(function(s,a){return mn(a,function(u){u=qn(u),ci(s,u,od(s[u],s))}),s});function bN(s){var a=s==null?0:s.length,u=ze();return s=a?jt(s,function(g){if(typeof g[1]!="function")throw new wn(c);return[u(g[0]),g[1]]}):[],ct(function(g){for(var _=-1;++_<a;){var A=s[_];if(wr(A[0],this,g))return wr(A[1],this,g)}})}function _N(s){return VD(yn(s,y))}function dd(s){return function(){return s}}function EN(s,a){return s==null||s!==s?a:s}var xN=C2(),CN=C2(!0);function Qr(s){return s}function pd(s){return e2(typeof s=="function"?s:yn(s,y))}function IN(s){return r2(yn(s,y))}function SN(s,a){return n2(s,yn(a,y))}var ON=ct(function(s,a){return function(u){return Fa(u,s,a)}}),AN=ct(function(s,a){return function(u){return Fa(s,u,a)}});function gd(s,a,u){var g=vr(a),_=Vl(a,g);u==null&&!(kt(a)&&(_.length||!g.length))&&(u=a,a=s,s=this,_=Vl(a,vr(a)));var A=!(kt(u)&&"chain"in u)||!!u.chain,U=fi(s);return mn(_,function(k){var Z=a[k];s[k]=Z,U&&(s.prototype[k]=function(){var ue=this.__chain__;if(A||ue){var he=s(this.__wrapped__),pe=he.__actions__=Zr(this.__actions__);return pe.push({func:Z,args:arguments,thisArg:s}),he.__chain__=ue,he}return Z.apply(s,Ni([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 i2(a,s)})}var PN=K0(jt),TN=K0(I3),RN=K0(v0);function Ew(s){return ed(s)?y0(qn(s)):l$(s)}function NN(s){return function(a){return s==null?r:Cs(s,a)}}var LN=S2(),MN=S2(!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=ze(a),s-=ie;for(var _=E0(g,a);++u<s;)a(u);return _}function kN(s){return Xe(s)?jt(s,qn):an(s)?[s]:Zr(H2(yt(s)))}function HN(s){var a=++XA;return yt(s)+a}var zN=Ql(function(s,a){return s+a},0),WN=G0("ceil"),qN=Ql(function(s,a){return s/a},1),VN=G0("floor");function KN(s){return s&&s.length?ql(s,Qr,R0):r}function GN(s,a){return s&&s.length?ql(s,ze(a,2),R0):r}function ZN(s){return A3(s,Qr)}function YN(s,a){return A3(s,ze(a,2))}function JN(s){return s&&s.length?ql(s,Qr,U0):r}function QN(s,a){return s&&s.length?ql(s,ze(a,2),U0):r}var XN=Ql(function(s,a){return s*a},1),eL=G0("round"),tL=Ql(function(s,a){return s-a},0);function rL(s){return s&&s.length?_0(s,Qr):0}function nL(s,a){return s&&s.length?_0(s,ze(a,2)):0}return I.after=IT,I.ary=X2,I.assign=fR,I.assignIn=dw,I.assignInWith=hu,I.assignWith=dR,I.at=pR,I.before=ew,I.bind=od,I.bindAll=yN,I.bindKey=tw,I.castArray=UT,I.chain=Y2,I.chunk=V$,I.compact=K$,I.concat=G$,I.cond=bN,I.conforms=_N,I.constant=dd,I.countBy=rT,I.create=gR,I.curry=rw,I.curryRight=nw,I.debounce=iw,I.defaults=mR,I.defaultsDeep=wR,I.defer=ST,I.delay=OT,I.difference=Z$,I.differenceBy=Y$,I.differenceWith=J$,I.drop=Q$,I.dropRight=X$,I.dropRightWhile=eP,I.dropWhile=tP,I.fill=rP,I.filter=iT,I.flatMap=aT,I.flatMapDeep=cT,I.flatMapDepth=lT,I.flatten=V2,I.flattenDeep=nP,I.flattenDepth=iP,I.flip=AT,I.flow=xN,I.flowRight=CN,I.fromPairs=sP,I.functions=CR,I.functionsIn=IR,I.groupBy=uT,I.initial=aP,I.intersection=cP,I.intersectionBy=lP,I.intersectionWith=uP,I.invert=OR,I.invertBy=AR,I.invokeMap=fT,I.iteratee=pd,I.keyBy=dT,I.keys=vr,I.keysIn=Jr,I.map=su,I.mapKeys=$R,I.mapValues=PR,I.matches=IN,I.matchesProperty=SN,I.memoize=au,I.merge=TR,I.mergeWith=pw,I.method=ON,I.methodOf=AN,I.mixin=gd,I.negate=cu,I.nthArg=$N,I.omit=RR,I.omitBy=NR,I.once=DT,I.orderBy=pT,I.over=PN,I.overArgs=$T,I.overEvery=TN,I.overSome=RN,I.partial=ad,I.partialRight=sw,I.partition=gT,I.pick=LR,I.pickBy=gw,I.property=Ew,I.propertyOf=NN,I.pull=pP,I.pullAll=G2,I.pullAllBy=gP,I.pullAllWith=mP,I.pullAt=wP,I.range=LN,I.rangeRight=MN,I.rearg=PT,I.reject=vT,I.remove=vP,I.rest=TT,I.reverse=id,I.sampleSize=bT,I.set=UR,I.setWith=jR,I.shuffle=_T,I.slice=yP,I.sortBy=CT,I.sortedUniq=SP,I.sortedUniqBy=OP,I.split=aN,I.spread=RT,I.tail=AP,I.take=DP,I.takeRight=$P,I.takeRightWhile=PP,I.takeWhile=TP,I.tap=KP,I.throttle=NT,I.thru=iu,I.toArray=uw,I.toPairs=mw,I.toPairsIn=ww,I.toPath=kN,I.toPlainObject=fw,I.transform=FR,I.unary=LT,I.union=RP,I.unionBy=NP,I.unionWith=LP,I.uniq=MP,I.uniqBy=UP,I.uniqWith=jP,I.unset=BR,I.unzip=sd,I.unzipWith=Z2,I.update=kR,I.updateWith=HR,I.values=Ao,I.valuesIn=zR,I.without=FP,I.words=bw,I.wrap=MT,I.xor=BP,I.xorBy=kP,I.xorWith=HP,I.zip=zP,I.zipObject=WP,I.zipObjectDeep=qP,I.zipWith=VP,I.entries=mw,I.entriesIn=ww,I.extend=dw,I.extendWith=hu,gd(I,I),I.add=zN,I.attempt=_w,I.camelCase=KR,I.capitalize=vw,I.ceil=WN,I.clamp=WR,I.clone=jT,I.cloneDeep=BT,I.cloneDeepWith=kT,I.cloneWith=FT,I.conformsTo=HT,I.deburr=yw,I.defaultTo=EN,I.divide=qN,I.endsWith=GR,I.eq=Pn,I.escape=ZR,I.escapeRegExp=YR,I.every=nT,I.find=sT,I.findIndex=W2,I.findKey=vR,I.findLast=oT,I.findLastIndex=q2,I.findLastKey=yR,I.floor=VN,I.forEach=J2,I.forEachRight=Q2,I.forIn=bR,I.forInRight=_R,I.forOwn=ER,I.forOwnRight=xR,I.get=ud,I.gt=zT,I.gte=WT,I.has=SR,I.hasIn=hd,I.head=K2,I.identity=Qr,I.includes=hT,I.indexOf=oP,I.inRange=qR,I.invoke=DR,I.isArguments=Os,I.isArray=Xe,I.isArrayBuffer=qT,I.isArrayLike=Yr,I.isArrayLikeObject=Xt,I.isBoolean=VT,I.isBuffer=ki,I.isDate=KT,I.isElement=GT,I.isEmpty=ZT,I.isEqual=YT,I.isEqualWith=JT,I.isError=cd,I.isFinite=QT,I.isFunction=fi,I.isInteger=ow,I.isLength=lu,I.isMap=aw,I.isMatch=XT,I.isMatchWith=eR,I.isNaN=tR,I.isNative=rR,I.isNil=iR,I.isNull=nR,I.isNumber=cw,I.isObject=kt,I.isObjectLike=Zt,I.isPlainObject=qa,I.isRegExp=ld,I.isSafeInteger=sR,I.isSet=lw,I.isString=uu,I.isSymbol=an,I.isTypedArray=Oo,I.isUndefined=oR,I.isWeakMap=aR,I.isWeakSet=cR,I.join=hP,I.kebabCase=JR,I.last=_n,I.lastIndexOf=fP,I.lowerCase=QR,I.lowerFirst=XR,I.lt=lR,I.lte=uR,I.max=KN,I.maxBy=GN,I.mean=ZN,I.meanBy=YN,I.min=JN,I.minBy=QN,I.stubArray=wd,I.stubFalse=vd,I.stubObject=UN,I.stubString=jN,I.stubTrue=FN,I.multiply=XN,I.nth=dP,I.noConflict=DN,I.noop=md,I.now=ou,I.pad=eN,I.padEnd=tN,I.padStart=rN,I.parseInt=nN,I.random=VR,I.reduce=mT,I.reduceRight=wT,I.repeat=iN,I.replace=sN,I.result=MR,I.round=eL,I.runInContext=K,I.sample=yT,I.size=ET,I.snakeCase=oN,I.some=xT,I.sortedIndex=bP,I.sortedIndexBy=_P,I.sortedIndexOf=EP,I.sortedLastIndex=xP,I.sortedLastIndexBy=CP,I.sortedLastIndexOf=IP,I.startCase=cN,I.startsWith=lN,I.subtract=tL,I.sum=rL,I.sumBy=nL,I.template=uN,I.times=BN,I.toFinite=di,I.toInteger=it,I.toLength=hw,I.toLower=hN,I.toNumber=En,I.toSafeInteger=hR,I.toString=yt,I.toUpper=fN,I.trim=dN,I.trimEnd=pN,I.trimStart=gN,I.truncate=mN,I.unescape=wN,I.uniqueId=HN,I.upperCase=vN,I.upperFirst=fd,I.each=J2,I.eachRight=Q2,I.first=K2,gd(I,function(){var s={};return zn(I,function(a,u){bt.call(I.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),I.VERSION=n,mn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){I[s].placeholder=I}),mn(["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()}}),mn(["filter","map","takeWhile"],function(s,a){var u=a+1,g=u==O||u==ce;dt.prototype[s]=function(_){var A=this.clone();return A.__iteratees__.push({iteratee:ze(_,3),type:u}),A.__filtered__=A.__filtered__||g,A}}),mn(["head","last"],function(s,a){var u="take"+(a?"Right":"");dt.prototype[s]=function(){return this[u](1).value()[0]}}),mn(["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(Qr)},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 Fa(u,s,a)})}),dt.prototype.reject=function(s){return this.filter(cu(ze(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)},zn(dt.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),g=/^(?:head|last)$/.test(a),_=I[g?"take"+(a=="last"?"Right":""):a],A=g||/^find/.test(a);_&&(I.prototype[a]=function(){var U=this.__wrapped__,k=g?[1]:arguments,Z=U instanceof dt,ue=k[0],he=Z||Xe(U),pe=function(ft){var wt=_.apply(I,Ni([ft],k));return g&&be?wt[0]:wt};he&&u&&typeof ue=="function"&&ue.length!=1&&(Z=he=!1);var be=this.__chain__,Pe=!!this.__actions__.length,We=A&&!be,ot=Z&&!Pe;if(!A&&he){U=ot?U:new dt(this);var qe=s.apply(U,k);return qe.__actions__.push({func:iu,args:[pe],thisArg:r}),new vn(qe,be)}return We&&ot?s.apply(this,k):(qe=this.thru(pe),We?g?qe.value()[0]:qe.value():qe)})}),mn(["pop","push","shift","sort","splice","unshift"],function(s){var a=$l[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",g=/^(?:pop|shift)$/.test(s);I.prototype[s]=function(){var _=arguments;if(g&&!this.__chain__){var A=this.value();return a.apply(Xe(A)?A:[],_)}return this[u](function(U){return a.apply(Xe(U)?U:[],_)})}}),zn(dt.prototype,function(s,a){var u=I[a];if(u){var g=u.name+"";bt.call(Eo,g)||(Eo[g]=[]),Eo[g].push({name:a,func:u})}}),Eo[Jl(r,V).name]=[{name:"wrapper",func:r}],dt.prototype.clone=wD,dt.prototype.reverse=vD,dt.prototype.value=yD,I.prototype.at=GP,I.prototype.chain=ZP,I.prototype.commit=YP,I.prototype.next=JP,I.prototype.plant=XP,I.prototype.reverse=eT,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=tT,I.prototype.first=I.prototype.head,Ta&&(I.prototype[Ta]=QP),I},yo=YA();Qt?((Qt.exports=yo)._=yo,St._=yo):mt._=yo}).call(ea)})(Oh,Oh.exports);var k7=Object.defineProperty,H7=Object.defineProperties,z7=Object.getOwnPropertyDescriptors,$g=Object.getOwnPropertySymbols,W7=Object.prototype.hasOwnProperty,q7=Object.prototype.propertyIsEnumerable,Pg=(t,e,r)=>e in t?k7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yc=(t,e)=>{for(var r in e||(e={}))W7.call(e,r)&&Pg(t,r,e[r]);if($g)for(var r of $g(e))q7.call(e,r)&&Pg(t,r,e[r]);return t},V7=(t,e)=>H7(t,z7(e));function yi(t,e,r){var n;const i=V5(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${B7}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function Qi(t){return t.includes(":")?t.split(":")[1]:t}function Tg(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=Rg(t),n=Rg(e);return Oh.exports.merge(r,n)}function Rg(t){var e,r,n,i;const o={};if(!Us(t))return o;for(const[c,l]of Object.entries(t)){const f=zu(c)?[c]:l.chains,h=l.methods||[],v=l.events||[],y=l.rpcMap||{},b=Fo(c);o[b]=V7(yc(yc({},o[b]),l),{chains:ku(f,(e=o[b])==null?void 0:e.chains),methods:ku(h,(r=o[b])==null?void 0:r.methods),events:ku(v,(n=o[b])==null?void 0:n.events),rpcMap:yc(yc({},y),(i=o[b])==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=zu(r)?[r]:n.chains?n.chains:Tg(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 Ng={},Nt=t=>Ng[t],Dh=(t,e)=>{Ng[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(Qn.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=Qi(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||yi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zn(new vi(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(Qn.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||yi(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zn(new vi(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(Qi(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(Qn.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=Qi(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||yi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zn(new vi(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(Qn.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=Qi(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||yi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zn(new vi(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(Qn.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=Qi(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 Zn(new vi(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(Qn.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=Qi(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||yi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zn(new vi(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(Qn.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=Qi(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||yi(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zn(new vi(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||yi(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Qn.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||yi(e,this.namespace);return typeof n>"u"?void 0:new Zn(new vi(n,Nt("disableProviderPing")))}}var sx=Object.defineProperty,ox=Object.defineProperties,ax=Object.getOwnPropertyDescriptors,Lg=Object.getOwnPropertySymbols,cx=Object.prototype.hasOwnProperty,lx=Object.prototype.propertyIsEnumerable,Mg=(t,e,r)=>e in t?sx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bc=(t,e)=>{for(var r in e||(e={}))cx.call(e,r)&&Mg(t,r,e[r]);if(Lg)for(var r of Lg(e))lx.call(e,r)&&Mg(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||Ag})),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:bc({},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!==Eg)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(Nn(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||Ag,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=>Fo(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=Tg(n),o=G7(this.namespaces,this.optionalNamespaces),c=$h(bc({},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&&Nn(i)&&this.events.emit("accountsChanged",i.map(Z7))}else if(n.name==="chainChanged"){const i=r.chainId,o=r.event.data,c=Fo(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(bc({},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(bc({},Yt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Qn.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=>Fo(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=Fo(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(`${Dg}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${Dg}/${e}`)}}const ux=Ph,hx="wc",fx="ethereum_provider",dx=`${hx}@2:${fx}:`,px="https://rpc.walletconnect.com/v1/",_c=["eth_sendTransaction","personal_sign"],Ug=["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"],Ec=["chainChanged","accountsChanged"],jg=["chainChanged","accountsChanged","message","disconnect","connect"];var gx=Object.defineProperty,mx=Object.defineProperties,wx=Object.getOwnPropertyDescriptors,Fg=Object.getOwnPropertySymbols,vx=Object.prototype.hasOwnProperty,yx=Object.prototype.propertyIsEnumerable,Bg=(t,e,r)=>e in t?gx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ta=(t,e)=>{for(var r in e||(e={}))vx.call(e,r)&&Bg(t,r,e[r]);if(Fg)for(var r of Fg(e))yx.call(e,r)&&Bg(t,r,e[r]);return t},kg=(t,e)=>mx(t,wx(e));function xc(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(!Nn(e))throw new Error("Invalid chains");const f={chains:e,methods:n||_c,events:o||Ec,rpcMap:ta({},e.length?{[xc(e)]:l[xc(e)]}:{})},h=o?.filter(x=>!Ec.includes(x)),v=n?.filter(x=>!_c.includes(x));if(!r&&!c&&!i&&!(h!=null&&h.length)&&!(v!=null&&v.length))return{required:e.length?f:void 0};const y=h?.length&&v?.length||!r,b={chains:[...new Set(y?f.chains.concat(r||[]):r)],methods:[...new Set(f.methods.concat(i!=null&&i.length?i:Ug))],events:[...new Set(f.events.concat(c!=null&&c.length?c:jg))],rpcMap:l};return{required:e.length?f:void 0,optional:r.length?b:void 0}}class Cc{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 Cc;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 f;this.rpc.showQrModal&&((f=this.modal)==null||f.subscribeModal(h=>{!h.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(kg(ta({namespaces:ta({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic})).then(h=>{c(h)}).catch(h=>{l(new Error(h.message))})});if(!i)return;const o=K5(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",kg(ta({},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||_c:[],f=i.length?e?.events||Ec:[],h=e?.optionalMethods||[],v=e?.optionalEvents||[],y=e?.rpcMap||this.buildRpcMap(c,e.projectId),b=e?.qrModalOptions||void 0;return{chains:i?.map(x=>this.formatChainId(x)),optionalChains:o.map(x=>this.formatChainId(x)),methods:l,events:f,optionalMethods:h,optionalEvents:v,rpcMap:y,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:b,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?xc(this.rpc.chains):xc(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{const{WalletConnectModal:n}=await Promise.resolve().then(function(){return Jx});r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(ta({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&&Nn(r)&&(this.rpc.chains=r.map(o=>this.formatChainId(o)),r.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)})),n&&Nn(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=Cc,Ex=Symbol(),Hg=Object.getPrototypeOf,Rh=new WeakMap,xx=t=>t&&(Rh.has(t)?Rh.get(t):Hg(t)===Object.prototype||Hg(t)===Array.prototype),Cx=t=>xx(t)&&t[Ex]||null,zg=(t,e=!0)=>{Rh.set(t,e)},Nh=t=>typeof t=="object"&&t!==null,bi=new WeakMap,Ic=new WeakSet,Ix=(t=Object.is,e=(h,v)=>new Proxy(h,v),r=h=>Nh(h)&&!Ic.has(h)&&(Array.isArray(h)||!(Symbol.iterator in h))&&!(h instanceof WeakMap)&&!(h instanceof WeakSet)&&!(h instanceof Error)&&!(h instanceof Number)&&!(h instanceof Date)&&!(h instanceof String)&&!(h instanceof RegExp)&&!(h instanceof ArrayBuffer),n=h=>{switch(h.status){case"fulfilled":return h.value;case"rejected":throw h.reason;default:throw h}},i=new WeakMap,o=(h,v,y=n)=>{const b=i.get(h);if(b?.[0]===v)return b[1];const x=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h));return zg(x,!0),i.set(h,[v,x]),Reflect.ownKeys(h).forEach(P=>{if(Object.getOwnPropertyDescriptor(x,P))return;const M=Reflect.get(h,P),H={value:M,enumerable:!0,configurable:!0};if(Ic.has(M))zg(M,!1);else if(M instanceof Promise)delete H.value,H.get=()=>y(M);else if(bi.has(M)){const[V,T]=bi.get(M);H.value=o(V,T(),y)}Object.defineProperty(x,P,H)}),x},c=new WeakMap,l=[1,1],f=h=>{if(!Nh(h))throw new Error("object required");const v=c.get(h);if(v)return v;let y=l[0];const b=new Set,x=(J,z=++l[0])=>{y!==z&&(y=z,b.forEach(ee=>ee(J,z)))};let P=l[1];const M=(J=++l[1])=>(P!==J&&!b.size&&(P=J,V.forEach(([z])=>{const ee=z[1](J);ee>y&&(y=ee)})),y),H=J=>(z,ee)=>{const de=[...z];de[1]=[J,...de[1]],x(de,ee)},V=new Map,T=(J,z)=>{if(V.has(J))throw new Error("prop listener already exists");if(b.size){const ee=z[3](H(J));V.set(J,[z,ee])}else V.set(J,[z])},L=J=>{var z;const ee=V.get(J);ee&&(V.delete(J),(z=ee[1])==null||z.call(ee))},$=J=>(b.add(J),b.size===1&&V.forEach(([ee,de],me)=>{if(de)throw new Error("remove already exists");const O=ee[3](H(me));V.set(me,[ee,O])}),()=>{b.delete(J),b.size===0&&V.forEach(([ee,de],me)=>{de&&(de(),V.set(me,[ee]))})}),R=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h)),d=e(R,{deleteProperty(J,z){const ee=Reflect.get(J,z);L(z);const de=Reflect.deleteProperty(J,z);return de&&x(["delete",[z],ee]),de},set(J,z,ee,de){const me=Reflect.has(J,z),O=Reflect.get(J,z,de);if(me&&(t(O,ee)||c.has(ee)&&t(O,c.get(ee))))return!0;L(z),Nh(ee)&&(ee=Cx(ee)||ee);let j=ee;if(ee instanceof Promise)ee.then(ce=>{ee.status="fulfilled",ee.value=ce,x(["resolve",[z],ce])}).catch(ce=>{ee.status="rejected",ee.reason=ce,x(["reject",[z],ce])});else{!bi.has(ee)&&r(ee)&&(j=f(ee));const ce=!Ic.has(j)&&bi.get(j);ce&&T(z,ce)}return Reflect.set(J,z,j,de),x(["set",[z],ee,O]),!0}});c.set(h,d);const C=[R,M,o,$];return bi.set(d,C),Reflect.ownKeys(h).forEach(J=>{const z=Object.getOwnPropertyDescriptor(h,J);"value"in z&&(d[J]=h[J],delete z.value,delete z.writable),Object.defineProperty(R,J,z)}),d})=>[f,bi,Ic,t,e,r,n,i,o,c,l],[Sx]=Ix();function Mn(t={}){return Sx(t)}function Xn(t,e,r){const n=bi.get(t);n||console.warn("Please use proxy object");let i;const o=[],c=n[3];let l=!1;const h=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,h()}}function Ox(t,e){const r=bi.get(t);r||console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),e)}var Wg={},Sc={};Sc.byteLength=$x,Sc.toByteArray=Tx,Sc.fromByteArray=Lx;for(var Un=[],hn=[],Ax=typeof Uint8Array<"u"?Uint8Array:Array,Lh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ks=0,Dx=Lh.length;ks<Dx;++ks)Un[ks]=Lh[ks],hn[Lh.charCodeAt(ks)]=ks;hn["-".charCodeAt(0)]=62,hn["_".charCodeAt(0)]=63;function qg(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=qg(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=qg(t),n=r[0],i=r[1],o=new Ax(Px(t,n,i)),c=0,l=i>0?n-4:n,f;for(f=0;f<l;f+=4)e=hn[t.charCodeAt(f)]<<18|hn[t.charCodeAt(f+1)]<<12|hn[t.charCodeAt(f+2)]<<6|hn[t.charCodeAt(f+3)],o[c++]=e>>16&255,o[c++]=e>>8&255,o[c++]=e&255;return i===2&&(e=hn[t.charCodeAt(f)]<<2|hn[t.charCodeAt(f+1)]>>4,o[c++]=e&255),i===1&&(e=hn[t.charCodeAt(f)]<<10|hn[t.charCodeAt(f+1)]<<4|hn[t.charCodeAt(f+2)]>>2,o[c++]=e>>8&255,o[c++]=e&255),o}function Rx(t){return Un[t>>18&63]+Un[t>>12&63]+Un[t>>6&63]+Un[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(Un[e>>2]+Un[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Un[e>>10]+Un[e>>4&63]+Un[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,f=(1<<l)-1,h=f>>1,v=-7,y=r?i-1:0,b=r?-1:1,x=t[e+y];for(y+=b,o=x&(1<<-v)-1,x>>=-v,v+=l;v>0;o=o*256+t[e+y],y+=b,v-=8);for(c=o&(1<<-v)-1,o>>=-v,v+=n;v>0;c=c*256+t[e+y],y+=b,v-=8);if(o===0)o=1-h;else{if(o===f)return c?NaN:(x?-1:1)*(1/0);c=c+Math.pow(2,n),o=o-h}return(x?-1:1)*c*Math.pow(2,o-n)},Mh.write=function(t,e,r,n,i,o){var c,l,f,h=o*8-i-1,v=(1<<h)-1,y=v>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=n?0:o-1,P=n?1:-1,M=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*(f=Math.pow(2,-c))<1&&(c--,f*=2),c+y>=1?e+=b/f:e+=b*Math.pow(2,1-y),e*f>=2&&(c++,f/=2),c+y>=v?(l=0,c=v):c+y>=1?(l=(e*f-1)*Math.pow(2,i),c=c+y):(l=e*Math.pow(2,y-1)*Math.pow(2,i),c=0));i>=8;t[r+x]=l&255,x+=P,l/=256,i-=8);for(c=c<<i|l,h+=i;h>0;t[r+x]=c&255,x+=P,c/=256,h-=8);t[r+x-P]|=M*128};/*!
|
|
86
|
+
* The buffer module from node.js, for the browser.
|
|
87
|
+
*
|
|
88
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
89
|
+
* @license MIT
|
|
90
|
+
*/(function(t){const e=Sc,r=Mh,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=T,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 E=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(E,p),E.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(E){if(E>i)throw new RangeError('The value "'+E+'" is invalid for option "size"');const p=new Uint8Array(E);return Object.setPrototypeOf(p,l.prototype),p}function l(E,p,m){if(typeof E=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(E)}return f(E,p,m)}l.poolSize=8192;function f(E,p,m){if(typeof E=="string")return b(E,p);if(ArrayBuffer.isView(E))return P(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(ke(E,ArrayBuffer)||E&&ke(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ke(E,SharedArrayBuffer)||E&&ke(E.buffer,SharedArrayBuffer)))return M(E,p,m);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const D=E.valueOf&&E.valueOf();if(D!=null&&D!==E)return l.from(D,p,m);const B=H(E);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return l.from(E[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 E)}l.from=function(E,p,m){return f(E,p,m)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function h(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function v(E,p,m){return h(E),E<=0?c(E):p!==void 0?typeof m=="string"?c(E).fill(p,m):c(E).fill(p):c(E)}l.alloc=function(E,p,m){return v(E,p,m)};function y(E){return h(E),c(E<0?0:V(E)|0)}l.allocUnsafe=function(E){return y(E)},l.allocUnsafeSlow=function(E){return y(E)};function b(E,p){if((typeof p!="string"||p==="")&&(p="utf8"),!l.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const m=L(E,p)|0;let D=c(m);const B=D.write(E,p);return B!==m&&(D=D.slice(0,B)),D}function x(E){const p=E.length<0?0:V(E.length)|0,m=c(p);for(let D=0;D<p;D+=1)m[D]=E[D]&255;return m}function P(E){if(ke(E,Uint8Array)){const p=new Uint8Array(E);return M(p.buffer,p.byteOffset,p.byteLength)}return x(E)}function M(E,p,m){if(p<0||E.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(E.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(E):m===void 0?D=new Uint8Array(E,p):D=new Uint8Array(E,p,m),Object.setPrototypeOf(D,l.prototype),D}function H(E){if(l.isBuffer(E)){const p=V(E.length)|0,m=c(p);return m.length===0||E.copy(m,0,0,p),m}if(E.length!==void 0)return typeof E.length!="number"||Ke(E.length)?c(0):x(E);if(E.type==="Buffer"&&Array.isArray(E.data))return x(E.data)}function V(E){if(E>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return E|0}function T(E){return+E!=E&&(E=0),l.alloc(+E)}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 G=0,X=Math.min(D,B);G<X;++G)if(p[G]!==m[G]){D=p[G],B=m[G];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 G=0;for(D=0;D<p.length;++D){let X=p[D];if(ke(X,Uint8Array))G+X.length>B.length?(l.isBuffer(X)||(X=l.from(X)),X.copy(B,G)):Uint8Array.prototype.set.call(B,X,G);else if(l.isBuffer(X))X.copy(B,G);else throw new TypeError('"list" argument must be an Array of Buffers');G+=X.length}return B};function L(E,p){if(l.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||ke(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const m=E.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(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return Je(E).length;default:if(B)return D?-1:Ge(E).length;p=(""+p).toLowerCase(),B=!0}}l.byteLength=L;function $(E,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(E||(E="utf8");;)switch(E){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: "+E);E=(E+"").toLowerCase(),D=!0}}l.prototype._isBuffer=!0;function R(E,p,m){const D=E[p];E[p]=E[m],E[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)R(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)R(this,m,m+3),R(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)R(this,m,m+7),R(this,m+1,m+6),R(this,m+2,m+5),R(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,G){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),G===void 0&&(G=this.length),m<0||D>p.length||B<0||G>this.length)throw new RangeError("out of range index");if(B>=G&&m>=D)return 0;if(B>=G)return-1;if(m>=D)return 1;if(m>>>=0,D>>>=0,B>>>=0,G>>>=0,this===p)return 0;let X=G-B,Ee=D-m;const Re=Math.min(X,Ee),st=this.slice(B,G),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 S(E,p,m,D,B){if(E.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:E.length-1),m<0&&(m=E.length+m),m>=E.length){if(B)return-1;m=E.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(E,p,m,D,B);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(E,p,m):Uint8Array.prototype.lastIndexOf.call(E,p,m):d(E,[p],m,D,B);throw new TypeError("val must be string, number or Buffer")}function d(E,p,m,D,B){let G=1,X=E.length,Ee=p.length;if(D!==void 0&&(D=String(D).toLowerCase(),D==="ucs2"||D==="ucs-2"||D==="utf16le"||D==="utf-16le")){if(E.length<2||p.length<2)return-1;G=2,X/=2,Ee/=2,m/=2}function Re(ht,lt){return G===1?ht[lt]:ht.readUInt16BE(lt*G)}let st;if(B){let ht=-1;for(st=m;st<X;st++)if(Re(E,st)===Re(p,ht===-1?0:st-ht)){if(ht===-1&&(ht=st),st-ht+1===Ee)return ht*G}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(E,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 S(this,p,m,D,!0)},l.prototype.lastIndexOf=function(p,m,D){return S(this,p,m,D,!1)};function C(E,p,m,D){m=Number(m)||0;const B=E.length-m;D?(D=Number(D),D>B&&(D=B)):D=B;const G=p.length;D>G/2&&(D=G/2);let X;for(X=0;X<D;++X){const Ee=parseInt(p.substr(X*2,2),16);if(Ke(Ee))return X;E[m+X]=Ee}return X}function J(E,p,m,D){return He(Ge(p,E.length-m),E,m,D)}function z(E,p,m,D){return He(Dt(p),E,m,D)}function ee(E,p,m,D){return He(Je(p),E,m,D)}function de(E,p,m,D){return He($t(p,E.length-m),E,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 G=this.length-m;if((D===void 0||D>G)&&(D=G),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 C(this,p,m,D);case"utf8":case"utf-8":return J(this,p,m,D);case"ascii":case"latin1":case"binary":return z(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(E,p,m){return p===0&&m===E.length?e.fromByteArray(E):e.fromByteArray(E.slice(p,m))}function O(E,p,m){m=Math.min(E.length,m);const D=[];let B=p;for(;B<m;){const G=E[B];let X=null,Ee=G>239?4:G>223?3:G>191?2:1;if(B+Ee<=m){let Re,st,ht,lt;switch(Ee){case 1:G<128&&(X=G);break;case 2:Re=E[B+1],(Re&192)===128&&(lt=(G&31)<<6|Re&63,lt>127&&(X=lt));break;case 3:Re=E[B+1],st=E[B+2],(Re&192)===128&&(st&192)===128&&(lt=(G&15)<<12|(Re&63)<<6|st&63,lt>2047&&(lt<55296||lt>57343)&&(X=lt));break;case 4:Re=E[B+1],st=E[B+2],ht=E[B+3],(Re&192)===128&&(st&192)===128&&(ht&192)===128&&(lt=(G&15)<<18|(Re&63)<<12|(st&63)<<6|ht&63,lt>65535&<<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 j=4096;function ce(E){const p=E.length;if(p<=j)return String.fromCharCode.apply(String,E);let m="",D=0;for(;D<p;)m+=String.fromCharCode.apply(String,E.slice(D,D+=j));return m}function le(E,p,m){let D="";m=Math.min(E.length,m);for(let B=p;B<m;++B)D+=String.fromCharCode(E[B]&127);return D}function re(E,p,m){let D="";m=Math.min(E.length,m);for(let B=p;B<m;++B)D+=String.fromCharCode(E[B]);return D}function ne(E,p,m){const D=E.length;(!p||p<0)&&(p=0),(!m||m<0||m>D)&&(m=D);let B="";for(let G=p;G<m;++G)B+=rt[E[G]];return B}function ae(E,p,m){const D=E.slice(p,m);let B="";for(let G=0;G<D.length-1;G+=2)B+=String.fromCharCode(D[G]+D[G+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(E,p,m){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+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],G=1,X=0;for(;++X<m&&(G*=256);)B+=this[p+X]*G;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],G=1;for(;m>0&&(G*=256);)B+=this[p+--m]*G;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,G=this[++p]+this[++p]*2**8+this[++p]*2**16+D*2**24;return BigInt(B)+(BigInt(G)<<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],G=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+D;return(BigInt(B)<<BigInt(32))+BigInt(G)}),l.prototype.readIntLE=function(p,m,D){p=p>>>0,m=m>>>0,D||ie(p,m,this.length);let B=this[p],G=1,X=0;for(;++X<m&&(G*=256);)B+=this[p+X]*G;return G*=128,B>=G&&(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,G=1,X=this[p+--B];for(;B>0&&(G*=256);)X+=this[p+--B]*G;return G*=128,X>=G&&(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(E,p,m,D,B,G){if(!l.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>B||p<G)throw new RangeError('"value" argument is out of bounds');if(m+D>E.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 G=1,X=0;for(this[m]=p&255;++X<D&&(G*=256);)this[m+X]=p/G&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 G=D-1,X=1;for(this[m+G]=p&255;--G>=0&&(X*=256);)this[m+G]=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(E,p,m,D,B){we(p,D,B,E,m,7);let G=Number(p&BigInt(4294967295));E[m++]=G,G=G>>8,E[m++]=G,G=G>>8,E[m++]=G,G=G>>8,E[m++]=G;let X=Number(p>>BigInt(32)&BigInt(4294967295));return E[m++]=X,X=X>>8,E[m++]=X,X=X>>8,E[m++]=X,X=X>>8,E[m++]=X,m}function Be(E,p,m,D,B){we(p,D,B,E,m,7);let G=Number(p&BigInt(4294967295));E[m+7]=G,G=G>>8,E[m+6]=G,G=G>>8,E[m+5]=G,G=G>>8,E[m+4]=G;let X=Number(p>>BigInt(32)&BigInt(4294967295));return E[m+3]=X,X=X>>8,E[m+2]=X,X=X>>8,E[m+1]=X,X=X>>8,E[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 G=0,X=1,Ee=0;for(this[m]=p&255;++G<D&&(X*=256);)p<0&&Ee===0&&this[m+G-1]!==0&&(Ee=1),this[m+G]=(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 G=D-1,X=1,Ee=0;for(this[m+G]=p&255;--G>=0&&(X*=256);)p<0&&Ee===0&&this[m+G+1]!==0&&(Ee=1),this[m+G]=(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(E,p,m,D,B,G){if(m+D>E.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function Me(E,p,m,D,B){return p=+p,m=m>>>0,B||ye(E,p,m,4),r.write(E,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(E,p,m,D,B){return p=+p,m=m>>>0,B||ye(E,p,m,8),r.write(E,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 G=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),G},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 G;if(typeof p=="number")for(G=m;G<D;++G)this[G]=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(G=0;G<D-m;++G)this[G+m]=X[G%Ee]}return this};const Y={};function W(E,p,m){Y[E]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(B){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:B,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(E,p){return`The "${E}" argument must be of type number. Received type ${typeof p}`},TypeError),W("ERR_OUT_OF_RANGE",function(E,p,m){let D=`The value of "${E}" 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(E){let p="",m=E.length;const D=E[0]==="-"?1:0;for(;m>=D+4;m-=3)p=`_${E.slice(m-3,m)}${p}`;return`${E.slice(0,m)}${p}`}function F(E,p,m){ve(p,"offset"),(E[p]===void 0||E[p+m]===void 0)&&Ue(p,E.length-(m+1))}function we(E,p,m,D,B,G){if(E>m||E<p){const X=typeof p=="bigint"?"n":"";let Ee;throw G>3?p===0||p===BigInt(0)?Ee=`>= 0${X} and < 2${X} ** ${(G+1)*8}${X}`:Ee=`>= -(2${X} ** ${(G+1)*8-1}${X}) and < 2 ** ${(G+1)*8-1}${X}`:Ee=`>= ${p}${X} and <= ${m}${X}`,new Y.ERR_OUT_OF_RANGE("value",Ee,E)}F(D,B,G)}function ve(E,p){if(typeof E!="number")throw new Y.ERR_INVALID_ARG_TYPE(p,"number",E)}function Ue(E,p,m){throw Math.floor(E)!==E?(ve(E,m),new Y.ERR_OUT_OF_RANGE(m||"offset","an integer",E)):p<0?new Y.ERR_BUFFER_OUT_OF_BOUNDS:new Y.ERR_OUT_OF_RANGE(m||"offset",`>= ${m?1:0} and <= ${p}`,E)}const nt=/[^+/0-9A-Za-z-_]/g;function at(E){if(E=E.split("=")[0],E=E.trim().replace(nt,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function Ge(E,p){p=p||1/0;let m;const D=E.length;let B=null;const G=[];for(let X=0;X<D;++X){if(m=E.charCodeAt(X),m>55295&&m<57344){if(!B){if(m>56319){(p-=3)>-1&&G.push(239,191,189);continue}else if(X+1===D){(p-=3)>-1&&G.push(239,191,189);continue}B=m;continue}if(m<56320){(p-=3)>-1&&G.push(239,191,189),B=m;continue}m=(B-55296<<10|m-56320)+65536}else B&&(p-=3)>-1&&G.push(239,191,189);if(B=null,m<128){if((p-=1)<0)break;G.push(m)}else if(m<2048){if((p-=2)<0)break;G.push(m>>6|192,m&63|128)}else if(m<65536){if((p-=3)<0)break;G.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((p-=4)<0)break;G.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return G}function Dt(E){const p=[];for(let m=0;m<E.length;++m)p.push(E.charCodeAt(m)&255);return p}function $t(E,p){let m,D,B;const G=[];for(let X=0;X<E.length&&!((p-=2)<0);++X)m=E.charCodeAt(X),D=m>>8,B=m%256,G.push(B),G.push(D);return G}function Je(E){return e.toByteArray(at(E))}function He(E,p,m,D){let B;for(B=0;B<D&&!(B+m>=p.length||B>=E.length);++B)p[B+m]=E[B];return B}function ke(E,p){return E instanceof p||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===p.name}function Ke(E){return E!==E}const rt=function(){const E="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]=E[m]+E[B]}return p}();function je(E){return typeof BigInt>"u"?Ze:E}function Ze(){throw new Error("BigInt not supported")}})(Wg);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=Mn({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),tt={state:gr,subscribe(t){return Xn(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=Mn({enabled:Mx,userSessionId:"",events:[],connectedWalletId:void 0}),_i={state:Sr,subscribe(t){return Xn(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=Mn({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 Xn(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}},Oc=Mn({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:Oc,subscribe(t){return Xn(Oc,()=>t(Oc))},setConfig(t){var e,r,n,i;_i.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(Oc,t)}},Ht=Mn({address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1}),Et={state:Ht,subscribe(t){return Xn(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 Ac(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 Ei={async getDesktopListings(t){return Ac("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return Ac("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return Ac("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return Ac("/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,Vg=Object.getOwnPropertySymbols,jx=Object.prototype.hasOwnProperty,Fx=Object.prototype.propertyIsEnumerable,Kg=(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)&&Kg(t,r,e[r]);if(Vg)for(var r of Vg(e))Fx.call(e,r)&&Kg(t,r,e[r]);return t};const Gg=Se.isMobile(),fn=Mn({wallets:{listings:[],total:0,page:1},injectedWallets:[],search:{listings:[],total:0,page:1},recomendedWallets:[]}),rr={state:fn,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=Ft.state;if(t==="NONE"||e==="ALL"&&!t)return fn.recomendedWallets;if(Se.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await Ei.getAllListings(r),i=Object.values(n);i.sort((o,c)=>{const l=t.indexOf(o.id),f=t.indexOf(c.id);return l-f}),fn.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:f}=Gg?await Ei.getMobileListings(l):await Ei.getDesktopListings(l);fn.recomendedWallets=Object.values(f)}return fn.recomendedWallets},async getWallets(t){const e=Bx({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=Ft.state,{recomendedWallets:i}=fn;if(n==="ALL")return fn.wallets;e.search||(i.length?e.excludedIds=i.map(y=>y.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:f}=Gg?await Ei.getMobileListings(e):await Ei.getDesktopListings(e),h=Object.values(l),v=c?"search":"wallets";return fn[v]={listings:[...fn[v].listings,...h],total:f,page:o??1},{listings:h,total:f}},async getInjectedWallets(){const{listings:t}=await Ei.getInjectedListings({}),e=Object.values(t);return fn.injectedWallets=e,fn.injectedWallets},getWalletImageUrl(t){return Ei.getWalletImageUrl(t)},getAssetImageUrl(t){return Ei.getAssetImageUrl(t)},resetSearch(){fn.search={listings:[],total:0,page:1}}},ra=Mn({pairingUri:"",pairingError:!1}),ur={state:ra,subscribe(t){return Xn(ra,()=>t(ra))},setPairingUri(t){ra.pairingUri=t},setPairingError(t){ra.pairingError=t}},Hs=Mn({open:!1}),Lr={state:Hs,subscribe(t){return Xn(Hs,()=>t(Hs))},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:f}=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(f)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:h}=ur.state;if(n&&i&&(r||h||l))Hs.open=!0,e();else{const v=setInterval(()=>{const y=De.state,b=ur.state;y.isUiLoaded&&y.isDataLoaded&&(y.isStandalone||b.pairingUri||l)&&(clearInterval(v),Hs.open=!0,e())},200)}})},close(){Hs.open=!1}};var kx=Object.defineProperty,Zg=Object.getOwnPropertySymbols,Hx=Object.prototype.hasOwnProperty,zx=Object.prototype.propertyIsEnumerable,Yg=(t,e,r)=>e in t?kx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wx=(t,e)=>{for(var r in e||(e={}))Hx.call(e,r)&&Yg(t,r,e[r]);if(Zg)for(var r of Zg(e))zx.call(e,r)&&Yg(t,r,e[r]);return t};function qx(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const na=Mn({themeMode:qx()?"dark":"light"}),jn={state:na,subscribe(t){return Xn(na,()=>t(na))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(na.themeMode=e),r&&(na.themeVariables=Wx({},r))}},Xi=Mn({open:!1,message:"",variant:"success"}),Kr={state:Xi,subscribe(t){return Xn(Xi,()=>t(Xi))},openToast(t,e){Xi.open=!0,Xi.message=t,Xi.variant=e},closeToast(){Xi.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=Wg.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var Vx=Object.defineProperty,Jg=Object.getOwnPropertySymbols,Kx=Object.prototype.hasOwnProperty,Gx=Object.prototype.propertyIsEnumerable,Qg=(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)&&Qg(t,r,e[r]);if(Jg)for(var r of Jg(e))Gx.call(e,r)&&Qg(t,r,e[r]);return t};class Yx{constructor(e){this.openModal=Lr.open,this.closeModal=Lr.close,this.subscribeModal=Lr.subscribe,this.setTheme=jn.setThemeConfig,jn.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});/**
|
|
91
|
+
* @license
|
|
92
|
+
* Copyright 2019 Google LLC
|
|
93
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
94
|
+
*/const Dc=window,Fh=Dc.ShadowRoot&&(Dc.ShadyCSS===void 0||Dc.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Bh=Symbol(),Xg=new WeakMap;class em{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=Xg.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Xg.set(r,e))}return e}toString(){return this.cssText}}const Qx=t=>new em(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 em(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=Dc.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},tm=Fh?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return Qx(r)})(t):t;/**
|
|
95
|
+
* @license
|
|
96
|
+
* Copyright 2017 Google LLC
|
|
97
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
+
*/var kh;const $c=window,rm=$c.trustedTypes,e9=rm?rm.emptyScript:"",nm=$c.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}},im=(t,e)=>e!==t&&(e==e||t==t),zh={attribute:!0,type:String,converter:Hh,reflect:!1,hasChanged:im};class zs 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=zh){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)||zh}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(tm(i))}else e!==void 0&&r.push(tm(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=zh){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||im)(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){}}zs.finalized=!0,zs.elementProperties=new Map,zs.elementStyles=[],zs.shadowRootOptions={mode:"open"},nm?.({ReactiveElement:zs}),((kh=$c.reactiveElementVersions)!==null&&kh!==void 0?kh:$c.reactiveElementVersions=[]).push("1.6.1");/**
|
|
99
|
+
* @license
|
|
100
|
+
* Copyright 2017 Google LLC
|
|
101
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
+
*/var Wh;const Pc=window,Ws=Pc.trustedTypes,sm=Ws?Ws.createPolicy("lit-html",{createHTML:t=>t}):void 0,qh="$lit$",xi=`lit$${(Math.random()+"").slice(9)}$`,om="?"+xi,t9=`<${om}>`,es=document,ia=()=>es.createComment(""),sa=t=>t===null||typeof t!="object"&&typeof t!="function",am=Array.isArray,r9=t=>am(t)||typeof t?.[Symbol.iterator]=="function",Vh=`[
|
|
103
|
+
\f\r]`,oa=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,cm=/-->/g,lm=/>/g,ts=RegExp(`>|${Vh}(?:([^\\s"'>=/]+)(${Vh}*=${Vh}*(?:[^
|
|
104
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),um=/'/g,hm=/"/g,fm=/^(?:script|style|textarea|title)$/i,dm=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),oe=dm(1),ut=dm(2),rs=Symbol.for("lit-noChange"),mr=Symbol.for("lit-nothing"),pm=new WeakMap,ns=es.createTreeWalker(es,129,null,!1),n9=(t,e)=>{const r=t.length-1,n=[];let i,o=e===2?"<svg>":"",c=oa;for(let f=0;f<r;f++){const h=t[f];let v,y,b=-1,x=0;for(;x<h.length&&(c.lastIndex=x,y=c.exec(h),y!==null);)x=c.lastIndex,c===oa?y[1]==="!--"?c=cm:y[1]!==void 0?c=lm:y[2]!==void 0?(fm.test(y[2])&&(i=RegExp("</"+y[2],"g")),c=ts):y[3]!==void 0&&(c=ts):c===ts?y[0]===">"?(c=i??oa,b=-1):y[1]===void 0?b=-2:(b=c.lastIndex-y[2].length,v=y[1],c=y[3]===void 0?ts:y[3]==='"'?hm:um):c===hm||c===um?c=ts:c===cm||c===lm?c=oa:(c=ts,i=void 0);const P=c===ts&&t[f+1].startsWith("/>")?" ":"";o+=c===oa?h+t9:b>=0?(n.push(v),h.slice(0,b)+qh+h.slice(b)+xi+P):h+xi+(b===-2?(n.push(void 0),f):P)}const l=o+(t[r]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[sm!==void 0?sm.createHTML(l):l,n]};class aa{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let o=0,c=0;const l=e.length-1,f=this.parts,[h,v]=n9(e,r);if(this.el=aa.createElement(h,n),ns.currentNode=this.el.content,r===2){const y=this.el.content,b=y.firstChild;b.remove(),y.append(...b.childNodes)}for(;(i=ns.nextNode())!==null&&f.length<l;){if(i.nodeType===1){if(i.hasAttributes()){const y=[];for(const b of i.getAttributeNames())if(b.endsWith(qh)||b.startsWith(xi)){const x=v[c++];if(y.push(b),x!==void 0){const P=i.getAttribute(x.toLowerCase()+qh).split(xi),M=/([.?@])?(.*)/.exec(x);f.push({type:1,index:o,name:M[2],strings:P,ctor:M[1]==="."?s9:M[1]==="?"?a9:M[1]==="@"?c9:Tc})}else f.push({type:6,index:o})}for(const b of y)i.removeAttribute(b)}if(fm.test(i.tagName)){const y=i.textContent.split(xi),b=y.length-1;if(b>0){i.textContent=Ws?Ws.emptyScript:"";for(let x=0;x<b;x++)i.append(y[x],ia()),ns.nextNode(),f.push({type:2,index:++o});i.append(y[b],ia())}}}else if(i.nodeType===8)if(i.data===om)f.push({type:2,index:o});else{let y=-1;for(;(y=i.data.indexOf(xi,y+1))!==-1;)f.push({type:7,index:o}),y+=xi.length-1}o++}}static createElement(e,r){const n=es.createElement("template");return n.innerHTML=e,n}}function qs(t,e,r=t,n){var i,o,c,l;if(e===rs)return e;let f=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl;const h=sa(e)?void 0:e._$litDirective$;return f?.constructor!==h&&((o=f?._$AO)===null||o===void 0||o.call(f,!1),h===void 0?f=void 0:(f=new h(t),f._$AT(t,r,n)),n!==void 0?((c=(l=r)._$Co)!==null&&c!==void 0?c:l._$Co=[])[n]=f:r._$Cl=f),f!==void 0&&(e=qs(t,f._$AS(t,e.values),f,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:es).importNode(n,!0);ns.currentNode=o;let c=ns.nextNode(),l=0,f=0,h=i[0];for(;h!==void 0;){if(l===h.index){let v;h.type===2?v=new ca(c,c.nextSibling,this,e):h.type===1?v=new h.ctor(c,h.name,h.strings,this,e):h.type===6&&(v=new l9(c,this,e)),this._$AV.push(v),h=i[++f]}l!==h?.index&&(c=ns.nextNode(),l++)}return ns.currentNode=es,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 ca{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=qs(this,e,r),sa(e)?e===mr||e==null||e===""?(this._$AH!==mr&&this._$AR(),this._$AH=mr):e!==this._$AH&&e!==rs&&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&&sa(this._$AH)?this._$AA.nextSibling.data=e:this.$(es.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=aa.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=pm.get(e.strings);return r===void 0&&pm.set(e.strings,r=new aa(e)),r}T(e){am(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 ca(this.k(ia()),this.k(ia()),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 Tc{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=qs(this,e,r,0),c=!sa(e)||e!==this._$AH&&e!==rs,c&&(this._$AH=e);else{const l=e;let f,h;for(e=o[0],f=0;f<o.length-1;f++)h=qs(this,l[n+f],r,f),h===rs&&(h=this._$AH[f]),c||(c=!sa(h)||h!==this._$AH[f]),h===mr?e=mr:e!==mr&&(e+=(h??"")+o[f+1]),this._$AH[f]=h}c&&!i&&this.j(e)}j(e){e===mr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class s9 extends Tc{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===mr?void 0:e}}const o9=Ws?Ws.emptyScript:"";class a9 extends Tc{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 Tc{constructor(e,r,n,i,o){super(e,r,n,i,o),this.type=5}_$AI(e,r=this){var n;if((e=(n=qs(this,e,r,0))!==null&&n!==void 0?n:mr)===rs)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){qs(this,e)}}const gm=Pc.litHtmlPolyfillSupport;gm?.(aa,ca),((Wh=Pc.litHtmlVersions)!==null&&Wh!==void 0?Wh:Pc.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 ca(e.insertBefore(ia(),l),l,void 0,r??{})}return c._$AI(t),c};/**
|
|
105
|
+
* @license
|
|
106
|
+
* Copyright 2017 Google LLC
|
|
107
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
108
|
+
*/var Kh,Gh;class $e extends zs{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 rs}}$e.finalized=!0,$e._$litElement$=!0,(Kh=globalThis.litElementHydrateSupport)===null||Kh===void 0||Kh.call(globalThis,{LitElement:$e});const mm=globalThis.litElementPolyfillSupport;mm?.({LitElement:$e}),((Gh=globalThis.litElementVersions)!==null&&Gh!==void 0?Gh:globalThis.litElementVersions=[]).push("3.3.2");/**
|
|
109
|
+
* @license
|
|
110
|
+
* Copyright 2017 Google LLC
|
|
111
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
112
|
+
*/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);/**
|
|
113
|
+
* @license
|
|
114
|
+
* Copyright 2017 Google LLC
|
|
115
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
116
|
+
*/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)}/**
|
|
117
|
+
* @license
|
|
118
|
+
* Copyright 2017 Google LLC
|
|
119
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
120
|
+
*/function gt(t){return Oe({...t,state:!0})}/**
|
|
121
|
+
* @license
|
|
122
|
+
* Copyright 2021 Google LLC
|
|
123
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
124
|
+
*/var Zh;((Zh=window.HTMLSlotElement)===null||Zh===void 0?void 0:Zh.prototype.assignedElements)!=null;/**
|
|
125
|
+
* @license
|
|
126
|
+
* Copyright 2017 Google LLC
|
|
127
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
128
|
+
*/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)}}/**
|
|
129
|
+
* @license
|
|
130
|
+
* Copyright 2018 Google LLC
|
|
131
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
132
|
+
*/const Mr=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 rs}});function g9(t,e){t.indexOf(e)===-1&&t.push(e)}const wm=(t,e,r)=>Math.min(Math.max(r,t),e),dn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Rc=t=>typeof t=="number",Vs=t=>Array.isArray(t)&&!Rc(t[0]),m9=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function w9(t,e){return Vs(t)?t[m9(0,t.length,e)]:t}const vm=(t,e,r)=>-r*t+r*e+t,ym=()=>{},Ci=t=>t,Yh=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function bm(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Yh(0,e,n);t.push(vm(r,1,i))}}function v9(t){const e=[0];return bm(e,t-1),e}function y9(t,e=v9(t.length),r=Ci){const n=t.length,i=n-e.length;return i>0&&bm(e,i),o=>{let c=0;for(;c<n-2&&!(o<e[c+1]);c++);let l=wm(0,1,Yh(e[c],e[c+1],o));return l=w9(r,c)(l),vm(t[c],t[c+1],l)}}const _m=t=>Array.isArray(t)&&Rc(t[0]),Jh=t=>typeof t=="object"&&!!t.createAnimation,is=t=>typeof t=="function",b9=t=>typeof t=="string",la={ms:t=>t*1e3,s:t=>t/1e3},Em=(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=Em(c,n,i)-t,o>0?r=c:e=c;while(Math.abs(o)>_9&&++l<E9);return c}function ua(t,e,r,n){if(t===e&&r===n)return Ci;const i=o=>x9(o,0,1,t,r);return o=>o===0||o===1?o:Em(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 wm(0,1,i/t)},xm={ease:ua(.25,.1,.25,1),"ease-in":ua(.42,0,1,1),"ease-in-out":ua(.42,0,.58,1),"ease-out":ua(0,0,.58,1)},I9=/\((.*?)\)/;function Cm(t){if(is(t))return t;if(_m(t))return ua(...t);if(xm[t])return xm[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 Ci}class Im{constructor(e,r=[0,1],{easing:n,duration:i=dn.duration,delay:o=dn.delay,endDelay:c=dn.endDelay,repeat:l=dn.repeat,offset:f,direction:h="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=Ci,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((y,b)=>{this.resolve=y,this.reject=b}),n=n||dn.easing,Jh(n)){const y=n.createAnimation(r);n=y.easing,r=y.keyframes||r,i=y.duration||i}this.repeat=l,this.easing=Vs(n)?Ci:Cm(n),this.updateDuration(i);const v=y9(r,f,Vs(n)?n.map(Cm):Ci);this.tick=y=>{var b;o=o;let x=0;this.pauseTime!==void 0?x=this.pauseTime:x=(y-this.startTime)*this.rate,this.t=x,x/=1e3,x=Math.max(x-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(x=this.totalDuration);const P=x/this.duration;let M=Math.floor(P),H=P%1;!H&&P>=1&&(H=1),H===1&&M--;const V=M%2;(h==="reverse"||h==="alternate"&&V||h==="alternate-reverse"&&!V)&&(H=1-H);const T=x>=this.totalDuration?1:Math.min(H,1),L=v(this.easing(T));e(L),this.pauseTime===void 0&&(this.playState==="finished"||x>=this.totalDuration+c)?(this.playState="finished",(b=this.resolve)===null||b===void 0||b.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 Sm(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"],Nc={x:"translateX",y:"translateY",z:"translateZ"},Om={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},$9={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:Om,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:Ci},skew:Om},ha=new Map,ef=t=>`--motion-${t}`,Lc=["x","y","z"];D9.forEach(t=>{A9.forEach(e=>{Lc.push(t+e),ha.set(ef(t+e),$9[t])})});const P9=(t,e)=>Lc.indexOf(t)-Lc.indexOf(e),T9=new Set(Lc),Am=t=>T9.has(t),R9=(t,e)=>{Nc[e]&&(e=Nc[e]);const{transforms:r}=Sm(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("--"),Dm=new Set;function M9(t){if(!Dm.has(t)){Dm.add(t);try{const{syntax:e,initialValue:r}=ha.has(t)?ha.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const rf=(t,e)=>document.createElement("div").animate(t,e),$m={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={},Ks={};for(const t in $m)Ks[t]=()=>(nf[t]===void 0&&(nf[t]=$m[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)},Pm=(t,e)=>is(t)?Ks.linearEasing()?`linear(${j9(t,e)})`:dn.easing:_m(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 Nc[t]&&(t=Nc[t]),Am(t)?ef(t):t}const Mc={get:(t,e)=>{e=sf(e);let r=tf(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const n=ha.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 Tm(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||Ci;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 z9(){return window.__MOTION_DEV_TOOLS_RECORD}function W9(t,e,r,n={},i){const o=z9(),c=n.record!==!1&&o;let l,{duration:f=dn.duration,delay:h=dn.delay,endDelay:v=dn.endDelay,repeat:y=dn.repeat,easing:b=dn.easing,persist:x=!1,direction:P,offset:M,allowWebkitAcceleration:H=!1}=n;const V=Sm(t),T=Am(e);let L=Ks.waapi();T&&R9(t,e);const $=sf(e),R=O9(V.values,$),S=ha.get($);return Tm(R.animation,!(Jh(b)&&R.generator)&&n.record!==!1),()=>{const d=()=>{var z,ee;return(ee=(z=Mc.get(t,$))!==null&&z!==void 0?z:S?.initialValue)!==null&&ee!==void 0?ee:0};let C=B9(k9(r),d);const J=H9(C,S);if(Jh(b)){const z=b.createAnimation(C,e!=="opacity",d,$,R);b=z.easing,C=z.keyframes||C,f=z.duration||f}if(tf($)&&(Ks.cssRegisterProperty()?M9($):L=!1),T&&!Ks.linearEasing()&&(is(b)||Vs(b)&&b.some(is))&&(L=!1),L){S&&(C=C.map(de=>Rc(de)?S.toDefaultUnit(de):de)),C.length===1&&(!Ks.partialKeyframes()||c)&&C.unshift(d());const z={delay:la.ms(h),duration:la.ms(f),endDelay:la.ms(v),easing:Vs(b)?void 0:Pm(b,f),direction:P,iterations:y+1,fill:"both"};l=t.animate({[$]:C,offset:M,easing:Vs(b)?b.map(de=>Pm(de,f)):void 0},z),l.finished||(l.finished=new Promise((de,me)=>{l.onfinish=de,l.oncancel=me}));const ee=C[C.length-1];l.finished.then(()=>{x||(Mc.set(t,$,ee),l.cancel())}).catch(ym),H||(l.playbackRate=1.000001)}else if(i&&T)C=C.map(z=>typeof z=="string"?parseFloat(z):z),C.length===1&&C.unshift(parseFloat(d())),l=new i(z=>{Mc.set(t,$,J?J(z):z)},C,Object.assign(Object.assign({},n),{duration:f,easing:b}));else{const z=C[C.length-1];Mc.set(t,$,S&&Rc(z)?S.toDefaultUnit(z):z)}return c&&o(t,e,C,{duration:f,delay:h,easing:b,repeat:y,offset:M},"motion-one"),R.setAnimation(l),l}}const q9=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function Rm(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(),Nm=(t,e,r=dn.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 la.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(ym)),t.finished;case"stop":return()=>{t.animations.forEach(n=>Tm(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=la.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 is(t)?t(e,r):t}function J9(t){return function(r,n,i={}){r=Rm(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 f=r[l];for(const h in n){const v=q9(i,h);v.delay=Y9(v.delay,l,o);const y=W9(f,h,n[h],v,t);c.push(y)}}return Nm(c,i,i.duration)}}const Q9=J9(Im);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=Rm(t),c=new WeakMap,l=h=>{h.forEach(v=>{const y=c.get(v.target);if(v.isIntersecting!==!!y)if(v.isIntersecting){const b=e(v);is(b)?c.set(v.target,b):f.unobserve(v.target)}else y&&(y(v),c.delete(v.target))})},f=new IntersectionObserver(l,{root:r,rootMargin:n,threshold:typeof i=="number"?i:eC[i]});return o.forEach(h=>f.observe(h)),()=>f.disconnect()}function of(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function Lm(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(),Lm(t,"viewenter",c),!i)return l=>{r(),Lm(t,"viewleave",l)}},o)}},Mm=(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=Mm(t,"hoverstart",e),i=Mm(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 Nm([()=>{const r=new Im(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function ss(t,e,r){return(is(t)?nC:Q9)(t,e,r)}var fa={},iC=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Um={},tn={};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];tn.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},tn.getSymbolTotalCodewords=function(e){return sC[e]},tn.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},tn.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');af=e},tn.isKanjiModeEnabled=function(){return typeof af<"u"},tn.toSJIS=function(e){return af(e)};var Uc={};(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}}})(Uc);function jm(){this.buffer=[],this.length=0}jm.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=jm;function da(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)}da.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},da.prototype.get=function(t,e){return this.data[t*this.size+e]},da.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},da.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var aC=da,Fm={};(function(t){const e=tn.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 f=1;f<i-1;f++)l[f]=l[f-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 f=0;f<c;f++)l===0&&f===0||l===0&&f===c-1||l===c-1&&f===0||i.push([o[l],o[f]]);return i}})(Fm);var Bm={};const cC=tn.getSymbolSize,km=7;Bm.getPositions=function(e){const r=cC(e);return[[0,0],[r-km,0],[0,r-km]]};var Hm={};(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,f=0,h=null,v=null;for(let y=0;y<o;y++){l=f=0,h=v=null;for(let b=0;b<o;b++){let x=i.get(y,b);x===h?l++:(l>=5&&(c+=e.N1+(l-5)),h=x,l=1),x=i.get(b,y),x===v?f++:(f>=5&&(c+=e.N1+(f-5)),v=x,f=1)}l>=5&&(c+=e.N1+(l-5)),f>=5&&(c+=e.N1+(f-5))}return c},t.getPenaltyN2=function(i){const o=i.size;let c=0;for(let l=0;l<o-1;l++)for(let f=0;f<o-1;f++){const h=i.get(l,f)+i.get(l,f+1)+i.get(l+1,f)+i.get(l+1,f+1);(h===4||h===0)&&c++}return c*e.N2},t.getPenaltyN3=function(i){const o=i.size;let c=0,l=0,f=0;for(let h=0;h<o;h++){l=f=0;for(let v=0;v<o;v++)l=l<<1&2047|i.get(h,v),v>=10&&(l===1488||l===93)&&c++,f=f<<1&2047|i.get(v,h),v>=10&&(f===1488||f===93)&&c++}return c*e.N3},t.getPenaltyN4=function(i){let o=0;const c=i.data.length;for(let f=0;f<c;f++)o+=i.data[f];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 f=0;f<c;f++)o.isReserved(f,l)||o.xor(f,l,r(i,f,l))},t.getBestMask=function(i,o){const c=Object.keys(t.Patterns).length;let l=0,f=1/0;for(let h=0;h<c;h++){o(h),t.applyMask(h,i);const v=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(h,i),v<f&&(f=v,l=h)}return l}})(Hm);var jc={};const Ii=Uc,Fc=[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],Bc=[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];jc.getBlocksCount=function(e,r){switch(r){case Ii.L:return Fc[(e-1)*4+0];case Ii.M:return Fc[(e-1)*4+1];case Ii.Q:return Fc[(e-1)*4+2];case Ii.H:return Fc[(e-1)*4+3];default:return}},jc.getTotalCodewordsCount=function(e,r){switch(r){case Ii.L:return Bc[(e-1)*4+0];case Ii.M:return Bc[(e-1)*4+1];case Ii.Q:return Bc[(e-1)*4+2];case Ii.H:return Bc[(e-1)*4+3];default:return}};var zm={},kc={};const pa=new Uint8Array(512),Hc=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)pa[r]=e,Hc[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)pa[r]=pa[r-255]})(),kc.log=function(e){if(e<1)throw new Error("log("+e+")");return Hc[e]},kc.exp=function(e){return pa[e]},kc.mul=function(e,r){return e===0||r===0?0:pa[Hc[e]+Hc[r]]},function(t){const e=kc;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 f=0;f<i.length;f++)o[f]^=e.mul(i[f],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}}(zm);const Wm=zm;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=Wm.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=Wm.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,qm={},Si={},lf={};lf.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Fn={};const Vm="[0-9]+",uC="[A-Z $%*+\\-./:]+";let ga="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ga=ga.replace(/u/g,"\\u");const hC="(?:(?![A-Z0-9 $%*+\\-./:]|"+ga+`)(?:.|[\r
|
|
133
|
+
]))+`;Fn.KANJI=new RegExp(ga,"g"),Fn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Fn.BYTE=new RegExp(hC,"g"),Fn.NUMERIC=new RegExp(Vm,"g"),Fn.ALPHANUMERIC=new RegExp(uC,"g");const fC=new RegExp("^"+ga+"$"),dC=new RegExp("^"+Vm+"$"),pC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Fn.testKanji=function(e){return fC.test(e)},Fn.testNumeric=function(e){return dC.test(e)},Fn.testAlphanumeric=function(e){return pC.test(e)},function(t){const e=lf,r=Fn;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}}}(Si),function(t){const e=tn,r=jc,n=Uc,i=Si,o=lf,c=7973,l=e.getBCHDigit(c);function f(b,x,P){for(let M=1;M<=40;M++)if(x<=t.getCapacity(M,P,b))return M}function h(b,x){return i.getCharCountIndicator(b,x)+4}function v(b,x){let P=0;return b.forEach(function(M){const H=h(M.mode,x);P+=H+M.getBitsLength()}),P}function y(b,x){for(let P=1;P<=40;P++)if(v(b,P)<=t.getCapacity(P,x,i.MIXED))return P}t.from=function(x,P){return o.isValid(x)?parseInt(x,10):P},t.getCapacity=function(x,P,M){if(!o.isValid(x))throw new Error("Invalid QR Code version");typeof M>"u"&&(M=i.BYTE);const H=e.getSymbolTotalCodewords(x),V=r.getTotalCodewordsCount(x,P),T=(H-V)*8;if(M===i.MIXED)return T;const L=T-h(M,x);switch(M){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(x,P){let M;const H=n.from(P,n.M);if(Array.isArray(x)){if(x.length>1)return y(x,H);if(x.length===0)return 1;M=x[0]}else M=x;return f(M.mode,M.getLength(),H)},t.getEncodedBits=function(x){if(!o.isValid(x)||x<7)throw new Error("Invalid QR Code version");let P=x<<12;for(;e.getBCHDigit(P)-l>=0;)P^=c<<e.getBCHDigit(P)-l;return x<<12|P}}(qm);var Km={};const uf=tn,Gm=1335,gC=21522,Zm=uf.getBCHDigit(Gm);Km.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;uf.getBCHDigit(i)-Zm>=0;)i^=Gm<<uf.getBCHDigit(i)-Zm;return(n<<10|i)^gC};var Ym={};const mC=Si;function Gs(t){this.mode=mC.NUMERIC,this.data=t.toString()}Gs.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Gs.prototype.getLength=function(){return this.data.length},Gs.prototype.getBitsLength=function(){return Gs.getBitsLength(this.data.length)},Gs.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=Gs;const vC=Si,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 Zs(t){this.mode=vC.ALPHANUMERIC,this.data=t}Zs.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},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;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=Zs,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=Si;function Ys(t){this.mode=EC.BYTE,typeof t=="string"&&(t=_C(t)),this.data=new Uint8Array(t)}Ys.getBitsLength=function(e){return e*8},Ys.prototype.getLength=function(){return this.data.length},Ys.prototype.getBitsLength=function(){return Ys.getBitsLength(this.data.length)},Ys.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var xC=Ys;const CC=Si,IC=tn;function Js(t){this.mode=CC.KANJI,this.data=t}Js.getBitsLength=function(e){return e*13},Js.prototype.getLength=function(){return this.data.length},Js.prototype.getBitsLength=function(){return Js.getBitsLength(this.data.length)},Js.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]+`
|
|
134
|
+
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var SC=Js,Jm={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 f,h,v,y,b,x,P,M,H;!l.empty();){f=l.pop(),h=f.value,y=f.cost,b=r[h]||{};for(v in b)b.hasOwnProperty(v)&&(x=b[v],P=y+x,M=c[v],H=typeof c[v]>"u",(H||M>P)&&(c[v]=P,l.push(v,P),o[v]=h))}if(typeof i<"u"&&typeof c[i]>"u"){var V=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(V)}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})(Jm),function(t){const e=Si,r=wC,n=yC,i=xC,o=SC,c=Fn,l=tn,f=Jm.exports;function h(V){return unescape(encodeURIComponent(V)).length}function v(V,T,L){const $=[];let R;for(;(R=V.exec(L))!==null;)$.push({data:R[0],index:R.index,mode:T,length:R[0].length});return $}function y(V){const T=v(c.NUMERIC,e.NUMERIC,V),L=v(c.ALPHANUMERIC,e.ALPHANUMERIC,V);let $,R;return l.isKanjiModeEnabled()?($=v(c.BYTE,e.BYTE,V),R=v(c.KANJI,e.KANJI,V)):($=v(c.BYTE_KANJI,e.BYTE,V),R=[]),T.concat(L,$,R).sort(function(d,C){return d.index-C.index}).map(function(d){return{data:d.data,mode:d.mode,length:d.length}})}function b(V,T){switch(T){case e.NUMERIC:return r.getBitsLength(V);case e.ALPHANUMERIC:return n.getBitsLength(V);case e.KANJI:return o.getBitsLength(V);case e.BYTE:return i.getBitsLength(V)}}function x(V){return V.reduce(function(T,L){const $=T.length-1>=0?T[T.length-1]:null;return $&&$.mode===L.mode?(T[T.length-1].data+=L.data,T):(T.push(L),T)},[])}function P(V){const T=[];for(let L=0;L<V.length;L++){const $=V[L];switch($.mode){case e.NUMERIC:T.push([$,{data:$.data,mode:e.ALPHANUMERIC,length:$.length},{data:$.data,mode:e.BYTE,length:$.length}]);break;case e.ALPHANUMERIC:T.push([$,{data:$.data,mode:e.BYTE,length:$.length}]);break;case e.KANJI:T.push([$,{data:$.data,mode:e.BYTE,length:h($.data)}]);break;case e.BYTE:T.push([{data:$.data,mode:e.BYTE,length:h($.data)}])}}return T}function M(V,T){const L={},$={start:{}};let R=["start"];for(let S=0;S<V.length;S++){const d=V[S],C=[];for(let J=0;J<d.length;J++){const z=d[J],ee=""+S+J;C.push(ee),L[ee]={node:z,lastCount:0},$[ee]={};for(let de=0;de<R.length;de++){const me=R[de];L[me]&&L[me].node.mode===z.mode?($[me][ee]=b(L[me].lastCount+z.length,z.mode)-b(L[me].lastCount,z.mode),L[me].lastCount+=z.length):(L[me]&&(L[me].lastCount=z.length),$[me][ee]=b(z.length,z.mode)+4+e.getCharCountIndicator(z.mode,T))}}R=C}for(let S=0;S<R.length;S++)$[R[S]].end=0;return{map:$,table:L}}function H(V,T){let L;const $=e.getBestModeForData(V);if(L=e.from(T,$),L!==e.BYTE&&L.bit<$.bit)throw new Error('"'+V+'" cannot be encoded with mode '+e.toString(L)+`.
|
|
135
|
+
Suggested mode is: `+e.toString($));switch(L===e.KANJI&&!l.isKanjiModeEnabled()&&(L=e.BYTE),L){case e.NUMERIC:return new r(V);case e.ALPHANUMERIC:return new n(V);case e.KANJI:return new o(V);case e.BYTE:return new i(V)}}t.fromArray=function(T){return T.reduce(function(L,$){return typeof $=="string"?L.push(H($,null)):$.data&&L.push(H($.data,$.mode)),L},[])},t.fromString=function(T,L){const $=y(T,l.isKanjiModeEnabled()),R=P($),S=M(R,L),d=f.find_path(S.map,"start","end"),C=[];for(let J=1;J<d.length-1;J++)C.push(S.table[d[J]].node);return t.fromArray(x(C))},t.rawSplit=function(T){return t.fromArray(y(T,l.isKanjiModeEnabled()))}}(Ym);const zc=tn,ff=Uc,OC=oC,AC=aC,DC=Fm,$C=Bm,df=Hm,pf=jc,PC=lC,Wc=qm,TC=Km,RC=Si,gf=Ym;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 f=-1;f<=7;f++)c+f<=-1||r<=c+f||(l>=0&&l<=6&&(f===0||f===6)||f>=0&&f<=6&&(l===0||l===6)||l>=2&&l<=4&&f>=2&&f<=4?t.set(o+l,c+f,!0,!0):t.set(o+l,c+f,!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=Wc.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 f=0;f<2;f++)if(!t.isReserved(i,l-f)){let h=!1;c<e.length&&(h=(e[c]>>>o&1)===1),t.set(i,l-f,h),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(f){n.put(f.mode.bit,4),n.put(f.getLength(),RC.getCharCountIndicator(f.mode,t)),f.write(n)});const i=zc.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 f=0;f<l;f++)n.put(f%2?17:236,8);return BC(n,t,e)}function BC(t,e,r){const n=zc.getSymbolTotalCodewords(e),i=pf.getTotalCodewordsCount(e,r),o=n-i,c=pf.getBlocksCount(e,r),l=n%c,f=c-l,h=Math.floor(n/c),v=Math.floor(o/c),y=v+1,b=h-v,x=new PC(b);let P=0;const M=new Array(c),H=new Array(c);let V=0;const T=new Uint8Array(t.buffer);for(let d=0;d<c;d++){const C=d<f?v:y;M[d]=T.slice(P,P+C),H[d]=x.encode(M[d]),P+=C,V=Math.max(V,C)}const L=new Uint8Array(n);let $=0,R,S;for(R=0;R<V;R++)for(S=0;S<c;S++)R<M[S].length&&(L[$++]=M[S][R]);for(R=0;R<b;R++)for(S=0;S<c;S++)L[$++]=H[S][R];return L}function kC(t,e,r,n){let i;if(Array.isArray(t))i=gf.fromArray(t);else if(typeof t=="string"){let h=e;if(!h){const v=gf.rawSplit(t);h=Wc.getBestVersionForData(v,r)}i=gf.fromString(t,h||40)}else throw new Error("Invalid data");const o=Wc.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(`
|
|
136
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
137
|
+
Minimum version required to store current data is: `+o+`.
|
|
138
|
+
`);const c=FC(e,r,i),l=zc.getSymbolSize(e),f=new AC(l);return NC(f,e),LC(f),MC(f,e),mf(f,r,0),e>=7&&UC(f,e),jC(f,c),isNaN(n)&&(n=df.getBestMask(f,mf.bind(null,f,r))),df.applyMask(n,f),mf(f,r,n),{modules:f,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}Um.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=Wc.from(r.version),o=df.from(r.maskPattern),r.toSJISFunc&&zc.setToSJISFunction(r.toSJISFunc)),kC(e,i,n,o)};var Qm={},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,f=t.getScale(c,o),h=Math.floor((c+o.margin*2)*f),v=o.margin*f,y=[o.color.light,o.color.dark];for(let b=0;b<h;b++)for(let x=0;x<h;x++){let P=(b*h+x)*4,M=o.color.light;if(b>=v&&x>=v&&b<h-v&&x<h-v){const H=Math.floor((b-v)/f),V=Math.floor((x-v)/f);M=y[l[H*c+V]?1:0]}n[P++]=M.r,n[P++]=M.g,n[P++]=M.b,n[P]=M.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 f=l,h=c;typeof f>"u"&&(!c||!c.getContext)&&(f=c,c=void 0),c||(h=n()),f=e.getOptions(f);const v=e.getImageWidth(o.modules.size,f),y=h.getContext("2d"),b=y.createImageData(v,v);return e.qrToImageData(b.data,o,f),r(y,h,v),y.putImageData(b,0,0),h},t.renderToDataURL=function(o,c,l){let f=l;typeof f>"u"&&(!c||!c.getContext)&&(f=c,c=void 0),f||(f={});const h=t.render(o,c,f),v=f.type||"image/png",y=f.rendererOpts||{};return h.toDataURL(v,y.quality)}}(Qm);var Xm={};const HC=wf;function e3(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 zC(t,e,r){let n="",i=0,o=!1,c=0;for(let l=0;l<t.length;l++){const f=Math.floor(l%e),h=Math.floor(l/e);!f&&!o&&(o=!0),t[l]?(c++,l>0&&f>0&&t[l-1]||(n+=o?vf("M",f+r,.5+h+r):vf("m",i,0),i=0,o=!1),f+1<e&&t[l+1]||(n+=vf("h",c),c=0)):i++}return n}Xm.render=function(e,r,n){const i=HC.getOptions(r),o=e.modules.size,c=e.modules.data,l=o+i.margin*2,f=i.color.light.a?"<path "+e3(i.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",h="<path "+e3(i.color.dark,"stroke")+' d="'+zC(c,o,i.margin)+'"/>',v='viewBox="0 0 '+l+" "+l+'"',b='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+v+' shape-rendering="crispEdges">'+f+h+`</svg>
|
|
139
|
+
`;return typeof n=="function"&&n(null,b),b};const WC=iC,yf=Um,t3=Qm,qC=Xm;function bf(t,e,r,n,i){const o=[].slice.call(arguments,1),c=o.length,l=typeof o[c-1]=="function";if(!l&&!WC())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(f,h){try{const v=yf.create(r,n);f(t(v,e,n))}catch(v){h(v)}})}try{const f=yf.create(r,n);i(null,t(f,e,n))}catch(f){i(f)}}fa.create=yf.create,fa.toCanvas=bf.bind(null,t3.render),fa.toDataURL=bf.bind(null,t3.renderToDataURL),fa.toString=bf.bind(null,function(t,e,r){return qC.render(t,r)});var VC=Object.defineProperty,r3=Object.getOwnPropertySymbols,KC=Object.prototype.hasOwnProperty,GC=Object.prototype.propertyIsEnumerable,n3=(t,e,r)=>e in t?VC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qc=(t,e)=>{for(var r in e||(e={}))KC.call(e,r)&&n3(t,r,e[r]);if(r3)for(var r of r3(e))GC.call(e,r)&&n3(t,r,e[r]);return t};function ZC(){var t;const e=(t=jn.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 i3(){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}=jn.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 i3()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=jn.state;if(t){const r=qc(qc(qc(qc({},ZC()),i3()),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,Vc=(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 Qs=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>`}};Qs.styles=[Fe.globalCss,JC],Vc([Oe()],Qs.prototype,"icon",2),Vc([Oe()],Qs.prototype,"label",2),Vc([Oe()],Qs.prototype,"onClick",2),Qs=Vc([Ne("w3m-box-button")],Qs);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,Xs=(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 Oi=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="${Mr(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-regular" color="${e}"><slot></slot></w3m-text>${this.iconRight}</button>`}};Oi.styles=[Fe.globalCss,eI],Xs([Oe()],Oi.prototype,"disabled",2),Xs([Oe()],Oi.prototype,"iconLeft",2),Xs([Oe()],Oi.prototype,"iconRight",2),Xs([Oe()],Oi.prototype,"onClick",2),Xs([Oe()],Oi.prototype,"variant",2),Oi=Xs([Ne("w3m-button")],Oi);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 ma=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="${Mr(t)}"><slot></slot></button>`}};ma.styles=[Fe.globalCss,nI],_f([Oe()],ma.prototype,"disabled",2),_f([Oe()],ma.prototype,"variant",2),ma=_f([Ne("w3m-button-big")],ma);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,s3=(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 Kc=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=jn.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="${Mr(t)}"><button @click="${this.onHelp}">${Le.HELP_ICON}</button> <button @click="${Lr.close}">${Le.CROSS_ICON}</button></div></div>`}};Kc.styles=[Fe.globalCss,uI],s3([gt()],Kc.prototype,"isHelp",2),Kc=s3([Ne("w3m-modal-backcard")],Kc);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,wa=(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 os=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="${Mr(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};os.styles=[Fe.globalCss,_I],wa([Oe()],os.prototype,"title",2),wa([Oe()],os.prototype,"onAction",2),wa([Oe()],os.prototype,"actionIcon",2),wa([Oe()],os.prototype,"border",2),os=wa([Ne("w3m-modal-header")],os);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"}},rn={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=rn.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:f,links:h})=>({id:l,name:f,mobile:h,links:h})):c?.map(({id:l,name:f,links:h})=>({id:l,name:f,desktop:h,links:h})))!=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 f=Se.isArray(e)?e:[],h=Se.isArray(r)?r:[];return!!l.some(v=>v.namespace===i&&!f.includes(c)&&!h.includes(c))})},recentWallet(){return xe.getRecentWallet()},recomendedWallets(t=!1){var e;const r=rn.installedInjectedWallets().map(({id:c})=>c),n=t||(e=rn.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(f){let h="";o?h=Se.formatUniversalUrl(o,f,i):c&&(h=Se.formatNativeUrl(c,f,i)),Se.openHref(h,"_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),Kr.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{const{selectedChain:r}=De.state;await Lt.client().connectConnector(t,r?.id),Lr.close()}catch(r){console.error(r),e?e():Kr.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 f=0;f<o.length;f+=1)c=o.charCodeAt(f)+((c<<5)-c),c=c&c;const l=[0,0,0];for(let f=0;f<3;f+=1){const h=c>>f*8&255;l[f]=h}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=rn.installedInjectedWallets(),o=!!(n!=null&&n.length),c=i.some(v=>v.id===t),l=!!(e!=null&&e.native),f=!!(e!=null&&e.universal),h=!!(r!=null&&r.native)||!!(r!=null&&r.universal);return{isInjectedInstalled:c,isInjected:o,isDesktop:l,isMobile:h,isWeb:f}},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 va=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"&&ss(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 ss(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=tt.state.view,ss(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>`}};va.styles=[Fe.globalCss,SI],If([gt()],va.prototype,"view",2),If([gt()],va.prototype,"prevView",2),va=If([Ne("w3m-modal-router")],va);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,o3=(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 Gc=class extends $e{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Kr.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Kr.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Kr.closeToast()}render(){const{message:t,variant:e}=Kr.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?oe`<div class="${Mr(r)}">${e==="success"?Le.CHECKMARK_ICON:null} ${e==="error"?Le.CROSS_ICON:null}<w3m-text variant="small-regular">${t}</w3m-text></div>`:null}};Gc.styles=[Fe.globalCss,DI],o3([gt()],Gc.prototype,"open",2),Gc=o3([Ne("w3m-modal-toast")],Gc);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,ya=(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 as=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="${Mr(t)}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-regular">${this.name}</w3m-text></button>`}};as.styles=[Fe.globalCss,TI],ya([Oe()],as.prototype,"onClick",2),ya([Oe()],as.prototype,"name",2),ya([Oe()],as.prototype,"chainId",2),ya([Oe()],as.prototype,"unsupported",2),as=ya([Ne("w3m-network-button")],as);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,a3=(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 Zc=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}`}};Zc.styles=[Fe.globalCss,LI],a3([Oe()],Zc.prototype,"chainId",2),Zc=a3([Ne("w3m-network-image")],Zc);const jI=.1,c3=2.5,ei=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(fa.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"),f=e/l.length,h=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];h.forEach(({x:M,y:H})=>{const V=(l.length-ei)*f*M,T=(l.length-ei)*f*H,L=.32;for(let $=0;$<h.length;$+=1){const R=f*(ei-$*2);c.push(ut`<rect fill="${$%2===0?i:o}" height="${R}" rx="${R*L}" ry="${R*L}" width="${R}" x="${V+f*$}" y="${T+f*$}">`)}});const v=Math.floor((r+25)/f),y=l.length/2-v/2,b=l.length/2+v/2-1,x=[];l.forEach((M,H)=>{M.forEach((V,T)=>{if(l[H][T]&&!(H<ei&&T<ei||H>l.length-(ei+1)&&T<ei||H<ei&&T>l.length-(ei+1))&&!(H>y&&H<b&&T>y&&T<b)){const L=H*f+f/2,$=T*f+f/2;x.push([L,$])}})});const P={};return x.forEach(([M,H])=>{P[M]?P[M].push(H):P[M]=[H]}),Object.entries(P).map(([M,H])=>{const V=H.filter(T=>H.every(L=>!Sf(T,L,f)));return[Number(M),V]}).forEach(([M,H])=>{H.forEach(V=>{c.push(ut`<circle cx="${M}" cy="${V}" fill="${i}" r="${f/c3}">`)})}),Object.entries(P).filter(([M,H])=>H.length>1).map(([M,H])=>{const V=H.filter(T=>H.some(L=>Sf(T,L,f)));return[Number(M),V]}).map(([M,H])=>{H.sort((T,L)=>T<L?-1:1);const V=[];for(const T of H){const L=V.find($=>$.some(R=>Sf(T,R,f)));L?L.push(T):V.push([T])}return[M,V.map(T=>[T[0],T[T.length-1]])]}).forEach(([M,H])=>{H.forEach(([V,T])=>{c.push(ut`<line x1="${M}" x2="${M}" y1="${V}" y2="${T}" stroke="${i}" stroke-width="${f/(c3/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,zI=Object.getOwnPropertyDescriptor,eo=(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&&HI(e,r,i),i};let ti=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=jn.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>`}};ti.styles=[Fe.globalCss,kI],eo([Oe()],ti.prototype,"uri",2),eo([Oe({type:Number})],ti.prototype,"size",2),eo([Oe()],ti.prototype,"imageId",2),eo([Oe()],ti.prototype,"walletId",2),eo([Oe()],ti.prototype,"imageUrl",2),ti=eo([Ne("w3m-qrcode")],ti);const WI=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,l3=(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 Yc=class extends $e{constructor(){super(...arguments),this.onChange=()=>null}render(){return oe`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Le.SEARCH_ICON}`}};Yc.styles=[Fe.globalCss,WI],l3([Oe()],Yc.prototype,"onChange",2),Yc=l3([Ne("w3m-search-input")],Yc);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 ba=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="${Mr(t)}"></slot></span>`}};ba.styles=[Fe.globalCss,JI],Af([Oe()],ba.prototype,"variant",2),Af([Oe()],ba.prototype,"color",2),ba=Af([Ne("w3m-text")],ba);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,u3=(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 Jc=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}};Jc.styles=[Fe.globalCss,eS],u3([Oe()],Jc.prototype,"symbol",2),Jc=u3([Ne("w3m-token-image")],Jc);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,Ai=(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 Bn=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(){_i.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>`}};Bn.styles=[Fe.globalCss,nS],Ai([Oe()],Bn.prototype,"onClick",2),Ai([Oe()],Bn.prototype,"name",2),Ai([Oe()],Bn.prototype,"walletId",2),Ai([Oe()],Bn.prototype,"label",2),Ai([Oe()],Bn.prototype,"imageId",2),Ai([Oe()],Bn.prototype,"installed",2),Ai([Oe()],Bn.prototype,"recent",2),Bn=Ai([Ne("w3m-wallet-button")],Bn);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,Qc=(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 to=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}`}};to.styles=[Fe.globalCss,oS],Qc([Oe()],to.prototype,"walletId",2),Qc([Oe()],to.prototype,"imageId",2),Qc([Oe()],to.prototype,"imageUrl",2),to=Qc([Ne("w3m-wallet-image")],to);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 h3=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&&Lr.close(),!r&&t.isConnected?_i.track({name:"ACCOUNT_CONNECTED"}):r&&!t.isConnected&&_i.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),Kr.openToast(xe.getErrorMessage(n),"error")}}async fetchBalance(t){if(Ft.state.enableAccountView)try{await Et.fetchBalance(t)}catch(e){console.error(e),Kr.openToast(xe.getErrorMessage(e),"error")}}};h3=hS([Ne("w3m-account-context")],h3);var fS=Object.defineProperty,dS=Object.getOwnPropertyDescriptor,f3=(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=rn.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),Kr.openToast("Failed preloading","error")}}};f3([gt()],Df.prototype,"preload",2),Df=f3([Ne("w3m-explorer-context")],Df);var pS=Object.defineProperty,gS=Object.getOwnPropertyDescriptor,d3=(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),Kr.openToast(xe.getErrorMessage(t),"error")}}};d3([gt()],$f.prototype,"activeChainId",2),$f=d3([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 p3=class extends $e{constructor(){super(),this.unsubscribeTheme=void 0,Fe.setTheme(),this.unsubscribeTheme=jn.subscribe(Fe.setTheme),this.preloadThemeImages()}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}async preloadThemeImages(){try{const{themeVariables:t}=jn.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")}}};p3=vS([Ne("w3m-theme-context")],p3);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 g3;let m3=class extends $e{constructor(){super(),this.unwatchOptions=void 0,this.unwatchAccount=void 0,this.timeout=void 0,this.isGenerated=!1,this.selectedChainId=(g3=De.state.selectedChain)==null?void 0:g3.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),Kr.openToast("Connection request declined","error"),Date.now()-this.lastRetry>=xS&&(this.lastRetry=Date.now(),this.connectAndWait())}}}};m3=_S([Ne("w3m-wc-connection-context")],m3);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 ro=class extends $e{constructor(){super(),this.balance="hide",this.avatar="show",xe.rejectStandaloneButtonComponent()}onOpen(){const{isStandalone:t}=De.state;t||(_i.click({name:"ACCOUNT_BUTTON"}),Lr.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="${Mr(e)}">${this.accountTemplate()}</button></div>`:oe`<w3m-button-big @click="${this.onOpen}">${this.accountTemplate()}</w3m-button-big>`}};ro.styles=[Fe.globalCss,CS],Pf([Oe()],ro.prototype,"balance",2),Pf([Oe()],ro.prototype,"avatar",2),ro=Pf([Ne("w3m-account-button")],ro);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 _a=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>`}};_a.styles=[Fe.globalCss,OS],Tf([gt()],_a.prototype,"chainId",2),Tf([gt()],_a.prototype,"label",2),_a=Tf([Ne("w3m-account-network-button")],_a);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,Ea=(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 cs=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="${Mr(r)}" variant="${e?"medium-regular":"big-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:xe.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};cs.styles=[Fe.globalCss,$S],Ea([gt()],cs.prototype,"address",2),Ea([gt()],cs.prototype,"name",2),Ea([gt()],cs.prototype,"loading",2),Ea([Oe()],cs.prototype,"variant",2),cs=Ea([Ne("w3m-address-text")],cs);const Ur={onConnecting(t){xe.goToConnectingView(t)},onExternal(t){xe.handleConnectorConnection(t)},manualWalletsTemplate(){return rn.manualWallets().map(t=>oe`<w3m-wallet-button walletId="${t.id}" name="${t.name}" .onClick="${()=>this.onConnecting(t)}"></w3m-wallet-button>`)},recomendedWalletsTemplate(t=!1){return rn.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 rn.externalWallets().map(t=>oe`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${()=>this.onExternal(t.id)}"></w3m-wallet-button>`)},recentWalletTemplate(){const t=rn.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 rn.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 rn.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=Ur.externalWalletsTemplate(),n=Ur.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 f=e[l%e.length];return f?oe`<w3m-wallet-image walletId="${f.id}" imageId="${f.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,xa=(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 ls=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="${Mr(t)}" src="${this.avatar}">`:this.address?(xe.generateAvatarColors(this.address),oe`<div class="${Mr(t)}">${this.loading?oe`<div class="w3m-loader"></div>`:null}</div>`):null}};ls.styles=[Fe.globalCss,US],xa([gt()],ls.prototype,"address",2),xa([gt()],ls.prototype,"avatar",2),xa([gt()],ls.prototype,"loading",2),xa([Oe()],ls.prototype,"size",2),ls=xa([Ne("w3m-avatar")],ls);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 Ca=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>`}};Ca.styles=[Fe.globalCss,BS],Nf([gt()],Ca.prototype,"symbol",2),Nf([gt()],Ca.prototype,"amount",2),Ca=Nf([Ne("w3m-balance")],Ca);const zS=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 WS=Object.defineProperty,qS=Object.getOwnPropertyDescriptor,Xc=(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&&WS(e,r,i),i};let us=class extends $e{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,xe.rejectStandaloneButtonComponent(),this.modalUnsub=Lr.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,_i.click({name:"CONNECT_BUTTON"}),await Lr.open(),Lr.state.open||(this.loading=!1)}async onDisconnect(){_i.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>`}};us.styles=[Fe.globalCss,zS],Xc([gt()],us.prototype,"loading",2),Xc([Oe()],us.prototype,"label",2),Xc([Oe()],us.prototype,"icon",2),us=Xc([Ne("w3m-connect-button")],us);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,no=(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 Di=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=jn.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="${Mr(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>`}};Di.styles=[Fe.globalCss,VS],no([Oe()],Di.prototype,"walletId",2),no([Oe()],Di.prototype,"imageId",2),no([Oe()],Di.prototype,"isError",2),no([Oe()],Di.prototype,"isStale",2),no([Oe()],Di.prototype,"label",2),Di=no([Ne("w3m-connector-waiting")],Di);var ZS=Object.defineProperty,YS=Object.getOwnPropertyDescriptor,io=(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 $i=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>`}};io([gt()],$i.prototype,"isConnected",2),io([Oe()],$i.prototype,"label",2),io([Oe()],$i.prototype,"icon",2),io([Oe()],$i.prototype,"avatar",2),io([Oe()],$i.prototype,"balance",2),$i=io([Ne("w3m-core-button")],$i);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=Ur.manualWalletsTemplate(),o=Ur.recomendedWalletsTemplate(),c=Ur.externalWalletsTemplate(),l=Ur.recentWalletTemplate(),f=Ur.installedInjectedWalletsTemplate();let h=[l,...i,...o];t||(h=[...f,l,...c,...i,...o]),h=h.filter(Boolean);const v=h.length>4||n;let y=[];v?y=h.slice(0,3):y=h;const b=!!y.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>${b?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">${y} ${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=Ur.manualWalletsTemplate(),o=Ur.recomendedWalletsTemplate(),c=Ur.externalWalletsTemplate(),l=Ur.recentWalletTemplate(),f=Ur.installedInjectedWalletsTemplate();let h=[l,...i,...o];t||(h=[...f,l,...c,...i,...o]),h=h.filter(Boolean);const v=h.length>8||n;let y=[];v?y=h.slice(0,7):y=h;const b=!!y.length;return oe`<w3m-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Le.QRCODE_ICON}"></w3m-modal-header>${b?oe`<w3m-modal-content><div>${y} ${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 so=class extends $e{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Lr.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&&Lr.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([ss(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,ss(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([ss(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,ss(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"?Lr.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="${Mr(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>`}};so.styles=[Fe.globalCss,lO],jf([gt()],so.prototype,"open",2),jf([gt()],so.prototype,"active",2),so=jf([Ne("w3m-modal")],so);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,el=(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 hs=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(){_i.click({name:"NETWORK_BUTTON"}),Lr.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>`}};hs.styles=[Fe.globalCss,fO],el([gt()],hs.prototype,"chainId",2),el([gt()],hs.prototype,"label",2),el([gt()],hs.prototype,"wrongNetwork",2),hs=el([Ne("w3m-network-switch")],hs);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,tl=(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 oo=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="${Mr(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>`}};oo.styles=[Fe.globalCss,gO],tl([Oe()],oo.prototype,"chainId",2),tl([Oe()],oo.prototype,"isError",2),tl([Oe()],oo.prototype,"label",2),oo=tl([Ne("w3m-network-waiting")],oo);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,fs=(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 ri=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>`}};ri.styles=[Fe.globalCss,vO],fs([Oe()],ri.prototype,"isMobile",2),fs([Oe()],ri.prototype,"isInjected",2),fs([Oe()],ri.prototype,"isInjectedInstalled",2),fs([Oe()],ri.prototype,"isDesktop",2),fs([Oe()],ri.prototype,"isWeb",2),fs([Oe()],ri.prototype,"isRetry",2),ri=fs([Ne("w3m-platform-selection")],ri);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=rn.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,rl=(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 ao=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>`}};ao.styles=[Fe.globalCss,IO],rl([Oe()],ao.prototype,"walletId",2),rl([Oe()],ao.prototype,"imageId",2),rl([gt()],ao.prototype,"uri",2),ao=rl([Ne("w3m-walletconnect-qr")],ao);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:""),Kr.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,w3=(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 nl=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>`}};nl.styles=[Fe.globalCss,LO],w3([gt()],nl.prototype,"isError",2),nl=w3([Ne("w3m-desktop-connecting-view")],nl);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=rn.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 zO=Object.defineProperty,WO=Object.getOwnPropertyDescriptor,qO=(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&&zO(e,r,i),i};let zf=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>`}};zf.styles=[Fe.globalCss,HO],zf=qO([Ne("w3m-help-view")],zf);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,v3=(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 il=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>`}};il.styles=[Fe.globalCss,VO],v3([gt()],il.prototype,"isError",2),il=v3([Ne("w3m-injected-connecting-view")],il);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 Wf=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>`}};Wf.styles=[Fe.globalCss,ZO],Wf=QO([Ne("w3m-install-wallet-view")],Wf);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,y3=(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 sl=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>`}};sl.styles=[Fe.globalCss,XO],y3([gt()],sl.prototype,"isError",2),sl=y3([Ne("w3m-mobile-connecting-view")],sl);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 b3=Object.defineProperty,uA=Object.defineProperties,hA=Object.getOwnPropertyDescriptor,fA=Object.getOwnPropertyDescriptors,_3=Object.getOwnPropertySymbols,dA=Object.prototype.hasOwnProperty,pA=Object.prototype.propertyIsEnumerable,E3=(t,e,r)=>e in t?b3(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)&&E3(t,r,e[r]);if(_3)for(var r of _3(e))pA.call(e,r)&&E3(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&&b3(e,r,i),i};let Ia=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),Lr.close()):(De.setSelectedChain(t),tt.push("ConnectWallet"))}catch(e){console.error(e),Kr.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}`}};Ia.styles=[Fe.globalCss,lA],Kf([gt()],Ia.prototype,"connectedChains",2),Kf([gt()],Ia.prototype,"isUnsupportedChains",2),Ia=Kf([Ne("w3m-select-network-view")],Ia);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,x3=(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 ol=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>`}};ol.styles=[Fe.globalCss,wA],x3([gt()],ol.prototype,"isError",2),ol=x3([Ne("w3m-switch-network-view")],ol);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,Sa=(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 ds=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:f}=await rr.getWallets({page:this.firstFetch?1:c+1,entries:Gf,search:this.search,version:De.state.walletConnectVersion,chains:l}),h=f.map(y=>xe.getWalletIcon(y)),v=n.map(y=>xe.getWalletIcon(y));await Promise.all([...h.map(async y=>xe.preloadImage(y)),...v.map(async y=>xe.preloadImage(y)),Se.wait(300)]),this.endReached=this.isLastPage()}catch(l){console.error(l),Kr.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=Ur.injectedWalletsTemplate(),c=Ur.manualWalletsTemplate(),l=Ur.recomendedWalletsTemplate(!0);i&&(o=o.filter(({values:y})=>xe.caseSafeIncludes(y[0],this.search)),c=c.filter(({values:y})=>xe.caseSafeIncludes(y[0],this.search)),l=l.filter(({values:y})=>xe.caseSafeIncludes(y[0],this.search)));const f=!this.loading&&!r.length&&!o.length&&!l.length,h=Math.max(o.length,r.length),v={"w3m-loading":n,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":f};return oe`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content class="${Mr(v)}"><div class="w3m-grid">${n?null:l} ${n?null:[...Array(h)].map((y,b)=>oe`${c[b]} ${o[b]} ${r[b]?oe`<w3m-wallet-button imageId="${r[b].image_id}" name="${r[b].name}" walletId="${r[b].id}" .onClick="${()=>this.onConnect(r[b])}"></w3m-wallet-button>`:null}`)}</div><div class="w3m-placeholder-block">${f?oe`<w3m-text variant="big-bold" color="secondary">No results found</w3m-text>`:null} ${!f&&this.loading?oe`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};ds.styles=[Fe.globalCss,bA],Sa([gt()],ds.prototype,"loading",2),Sa([gt()],ds.prototype,"firstFetch",2),Sa([gt()],ds.prototype,"search",2),Sa([gt()],ds.prototype,"endReached",2),ds=Sa([Ne("w3m-wallet-explorer-view")],ds);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,C3=(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 al=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>`}};al.styles=[Fe.globalCss,xA],C3([gt()],al.prototype,"isError",2),al=C3([Ne("w3m-web-connecting-view")],al);var SA=Object.freeze({__proto__:null,get W3mAccountButton(){return ro},get W3mConnectButton(){return us},get W3mCoreButton(){return $i},get W3mModal(){return so},get W3mNetworkSwitch(){return hs},get W3mQrCode(){return ti}});xn.EthereumProvider=_x,xn.OPTIONAL_EVENTS=jg,xn.OPTIONAL_METHODS=Ug,xn.REQUIRED_EVENTS=Ec,xn.REQUIRED_METHODS=_c,xn.default=Cc,Object.defineProperty(xn,"__esModule",{value:!0})});
|
|
99
140
|
//# sourceMappingURL=index.umd.js.map
|