@walletconnect/ethereum-provider 2.10.5 → 2.10.6-canary-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.js +27 -27
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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={};/*! *****************************************************************************
|
|
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 Sw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Hi(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 Ow(t){console&&console.warn&&console.warn(t)}var bd=Number.isNaN||function(e){return e!==e};function _t(){_t.init.call(this)}yr.exports=_t,yr.exports.once=Pw,_t.EventEmitter=_t,_t.prototype._events=void 0,_t.prototype._eventsCount=0,_t.prototype._maxListeners=void 0;var _d=10;function 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,Ow(l)}return t}_t.prototype.addListener=function(e,r){return xd(this,e,r,!1)},_t.prototype.on=_t.prototype.addListener,_t.prototype.prependListener=function(e,r){return xd(this,e,r,!0)};function Aw(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Id(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=Aw.bind(n);return i.listener=r,n.wrapFn=i,i}_t.prototype.once=function(e,r){return Ka(r),this.on(e,Id(this,e,r)),this},_t.prototype.prependOnceListener=function(e,r){return Ka(r),this.prependListener(e,Id(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():Dw(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},_t.prototype.off=_t.prototype.removeListener,_t.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),c;for(i=0;i<o.length;++i)c=o[i],c!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function Cd(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?$w(i):Od(i,i.length)}_t.prototype.listeners=function(e){return Cd(this,e,!0)},_t.prototype.rawListeners=function(e){return Cd(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 Dw(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function $w(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Pw(t,e){return new Promise(function(r,n){function i(c){t.removeListener(e,o),n(c)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}Ad(t,e,o,{once:!0}),e!=="error"&&Tw(t,i,{once:!0})})}function Tw(t,e,r){typeof t.on=="function"&&Ad(t,"error",e,r)}function Ad(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var 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 Rw(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}et.readInt16BE=Rw;function Nw(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}et.readUint16BE=Nw;function Lw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}et.readInt16LE=Lw;function Mw(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}et.readUint16LE=Mw;function Pd(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}et.writeUint16BE=Pd,et.writeInt16BE=Pd;function Td(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}et.writeUint16LE=Td,et.writeInt16LE=Td;function 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 Uw(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=Uw;function jw(t,e){e===void 0&&(e=0);var r=pu(t,e),n=pu(t,e+4);return r*4294967296+n}et.readUint64BE=jw;function Fw(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=Fw;function Bw(t,e){e===void 0&&(e=0);var r=mu(t,e),n=mu(t,e+4);return n*4294967296+r}et.readUint64LE=Bw;function Rd(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),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 kw(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=t/8+r-1;o>=r;o--)n+=e[o]*i,i*=256;return n}et.readUintBE=kw;function Hw(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+t/8;o++)n+=e[o]*i,i*=256;return n}et.readUintLE=Hw;function zw(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("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=zw;function Ww(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("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=Ww;function qw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}et.readFloat32BE=qw;function Vw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}et.readFloat32LE=Vw;function Kw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}et.readFloat64BE=Kw;function Gw(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}et.readFloat64LE=Gw;function Zw(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}et.writeFloat32BE=Zw;function Yw(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}et.writeFloat32LE=Yw;function Jw(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}et.writeFloat64BE=Jw;function Qw(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}et.writeFloat64LE=Qw;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});function Xw(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Xr.wipe=Xw,Object.defineProperty(Ga,"__esModule",{value:!0});var Ir=et,wu=Xr,ev=20;function tv(t,e,r){for(var n=1634760805,i=857760878,o=2036477234,c=1797285236,l=r[3]<<24|r[2]<<16|r[1]<<8|r[0],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,I=f,J=h,z=v,ee=y,de=b,me=x,O=P,j=M,ce=H,le=V,re=T,ne=0;ne<ev;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,$=$+I|0,ce^=$,ce=ce>>>32-16|ce<<16,de=de+ce|0,I^=de,I=I>>>32-12|I<<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,$=$+I|0,ce^=$,ce=ce>>>32-8|ce<<8,de=de+ce|0,I^=de,I=I>>>32-7|I<<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+I|0,re^=L,re=re>>>32-16|re<<16,me=me+re|0,I^=me,I=I>>>32-12|I<<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+I|0,re^=L,re=re>>>32-8|re<<8,me=me+re|0,I^=me,I=I>>>32-7|I<<7;Ir.writeUint32LE(L+n|0,t,0),Ir.writeUint32LE($+i|0,t,4),Ir.writeUint32LE(R+o|0,t,8),Ir.writeUint32LE(S+c|0,t,12),Ir.writeUint32LE(d+l|0,t,16),Ir.writeUint32LE(I+f|0,t,20),Ir.writeUint32LE(J+h|0,t,24),Ir.writeUint32LE(z+v|0,t,28),Ir.writeUint32LE(ee+y|0,t,32),Ir.writeUint32LE(de+b|0,t,36),Ir.writeUint32LE(me+x|0,t,40),Ir.writeUint32LE(O+P|0,t,44),Ir.writeUint32LE(j+M|0,t,48),Ir.writeUint32LE(ce+H|0,t,52),Ir.writeUint32LE(le+V|0,t,56),Ir.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){tv(l,o,t);for(var h=f;h<f+64&&h<r.length;h++)n[h]=r[h]^l[h-f];nv(o,0,c)}return wu.wipe(l),i===0&&wu.wipe(o),n}Ga.streamXOR=Ld;function rv(t,e,r,n){return n===void 0&&(n=0),wu.wipe(r),Ld(t,e,r,r,n)}Ga.stream=rv;function nv(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Md={},gi={};Object.defineProperty(gi,"__esModule",{value:!0});function iv(t,e,r){return~(t-1)&e|t-1&r}gi.select=iv;function sv(t,e){return(t|0)-(e|0)-1>>>31&1}gi.lessOrEqual=sv;function Ud(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}gi.compare=Ud;function ov(t,e){return t.length===0||e.length===0?!1:Ud(t,e)!==0}gi.equal=ov,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],I=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*I),Be+=L*(5*d),Be+=$*(5*S),ge+=Be>>>13,Be&=8191;var be=ge;be+=y*S,be+=b*R,be+=x*(5*O),be+=P*(5*me),be+=M*(5*de),ge=be>>>13,be&=8191,be+=H*(5*ee),be+=V*(5*z),be+=T*(5*J),be+=L*(5*I),be+=$*(5*d),ge+=be>>>13,be&=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*I),ge+=Me>>>13,Me&=8191;var Q=ge;Q+=y*I,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*I,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*I,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*I,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*I,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*I,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*I,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,be+=ge,y=Be,b=be,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={},$o={},vu={};Object.defineProperty(vu,"__esModule",{value:!0});function av(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}vu.isSerializableHash=av,Object.defineProperty($o,"__esModule",{value:!0});var Rn=vu,cv=gi,lv=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()),lv.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}();$o.HMAC=Fd;function uv(t,e,r){var n=new Fd(t,e);n.update(r);var i=n.digest();return n.clean(),i}$o.hmac=uv,$o.equal=cv.equal,Object.defineProperty(jd,"__esModule",{value:!0});var Bd=$o,kd=Xr,hv=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var o=Bd.hmac(this._hash,n,r);this._hmac=new Bd.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),kd.wipe(this._buffer),kd.wipe(this._counter),this._bufpos=0},t}(),fv=jd.HKDF=hv,$s={},Ja={},Qa={};Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.BrowserRandomSource=void 0;const Hd=65536;class dv{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=Hd)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,Hd)));return r}}Qa.BrowserRandomSource=dv;function pv(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xa={},gv={},mv=Object.freeze({__proto__:null,default:gv}),wv=Hi(mv);Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.NodeRandomSource=void 0;const vv=Xr;class yv{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof pv<"u"){const e=wv;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,vv.wipe)(r),n}}Xa.NodeRandomSource=yv,Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.SystemRandomSource=void 0;const bv=Qa,_v=Xa;class Ev{constructor(){if(this.isAvailable=!1,this.name="",this._source=new bv.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new _v.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}Ja.SystemRandomSource=Ev,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 I=(S>>>7|S<<32-7)^(S>>>18|S<<32-18)^S>>>3;l[$]=(d+l[$-7]|0)+(I+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,I=((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+I|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 I=0;I<16;I++){const J=d&($[I]^R[I]);$[I]^=J,R[I]^=J}}function f($,R){const S=n(),d=n();for(let I=0;I<16;I++)d[I]=R[I];c(d),c(d),c(d);for(let I=0;I<2;I++){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 I=0;I<16;I++)$[2*I]=d[I]&255,$[2*I+1]=d[I]>>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,I,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,be=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,be+=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,be+=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,be+=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,be+=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,be+=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,be+=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,be+=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,be+=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,be+=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,be+=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,be+=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,be+=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,be+=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,be+=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,be+=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*be,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,I=1,d=J+I+65535,I=Math.floor(d/65536),J=d-I*65536,d=z+I+65535,I=Math.floor(d/65536),z=d-I*65536,d=ee+I+65535,I=Math.floor(d/65536),ee=d-I*65536,d=de+I+65535,I=Math.floor(d/65536),de=d-I*65536,d=me+I+65535,I=Math.floor(d/65536),me=d-I*65536,d=O+I+65535,I=Math.floor(d/65536),O=d-I*65536,d=j+I+65535,I=Math.floor(d/65536),j=d-I*65536,d=ce+I+65535,I=Math.floor(d/65536),ce=d-I*65536,d=le+I+65535,I=Math.floor(d/65536),le=d-I*65536,d=re+I+65535,I=Math.floor(d/65536),re=d-I*65536,d=ne+I+65535,I=Math.floor(d/65536),ne=d-I*65536,d=ae+I+65535,I=Math.floor(d/65536),ae=d-I*65536,d=ie+I+65535,I=Math.floor(d/65536),ie=d-I*65536,d=Ae+I+65535,I=Math.floor(d/65536),Ae=d-I*65536,d=ge+I+65535,I=Math.floor(d/65536),ge=d-I*65536,d=Be+I+65535,I=Math.floor(d/65536),Be=d-I*65536,J+=I-1+37*(I-1),I=1,d=J+I+65535,I=Math.floor(d/65536),J=d-I*65536,d=z+I+65535,I=Math.floor(d/65536),z=d-I*65536,d=ee+I+65535,I=Math.floor(d/65536),ee=d-I*65536,d=de+I+65535,I=Math.floor(d/65536),de=d-I*65536,d=me+I+65535,I=Math.floor(d/65536),me=d-I*65536,d=O+I+65535,I=Math.floor(d/65536),O=d-I*65536,d=j+I+65535,I=Math.floor(d/65536),j=d-I*65536,d=ce+I+65535,I=Math.floor(d/65536),ce=d-I*65536,d=le+I+65535,I=Math.floor(d/65536),le=d-I*65536,d=re+I+65535,I=Math.floor(d/65536),re=d-I*65536,d=ne+I+65535,I=Math.floor(d/65536),ne=d-I*65536,d=ae+I+65535,I=Math.floor(d/65536),ae=d-I*65536,d=ie+I+65535,I=Math.floor(d/65536),ie=d-I*65536,d=Ae+I+65535,I=Math.floor(d/65536),Ae=d-I*65536,d=ge+I+65535,I=Math.floor(d/65536),ge=d-I*65536,d=Be+I+65535,I=Math.floor(d/65536),Be=d-I*65536,J+=I-1+37*(I-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),I=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];I[0]=ee[0]=1;for(let le=254;le>=0;--le){const re=S[le>>>3]>>>(le&7)&1;l(I,J,re),l(z,ee,re),v(de,I,z),y(I,I,z),v(z,J,ee),y(J,J,ee),x(ee,de),x(me,I),b(I,z,I),b(z,J,de),v(de,I,z),y(I,I,z),x(J,I),y(z,ee,me),b(I,z,o),v(I,I,ee),b(z,z,I),b(I,ee,me),b(ee,J,d),x(J,de),l(I,J,re),l(z,ee,re)}for(let le=0;le<16;le++)d[le+16]=I[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 I=0;for(let J=0;J<d.length;J++)I|=d[J];if(I===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 xv(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=t.length,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 I=L-H;I!==L&&$[I]===0;)I++;for(var J=f.repeat(M);I<L;++I)J+=t.charAt($[I]);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 I=new Uint8Array(H+(T-d)),J=H;d!==T;)I[J++]=L[d++];return I}}}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 Iv=xv,Cv=Iv;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")},Sv=t=>new TextEncoder().encode(t),Ov=t=>new TextDecoder().decode(t);class Av{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Dv{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return qd(this,e)}}class $v{constructor(e){this.decoders=e}or(e){return qd(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const qd=(t,e)=>new $v({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Pv{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Av(e,r,n),this.decoder=new Dv(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const tc=({name:t,prefix:e,encode:r,decode:n})=>new Pv(t,e,r,n),Po=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Cv(r,e);return tc({prefix:t,name:e,encode:n,decode:o=>Wd(i(o))})},Tv=(t,e,r,n)=>{const i={};for(let v=0;v<e.length;++v)i[e[v]]=v;let o=t.length;for(;t[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,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},Rv=(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 Rv(i,n,r)},decode(i){return Tv(i,n,r,t)}}),Nv=tc({prefix:"\0",name:"identity",encode:t=>Ov(t),decode:t=>Sv(t)});var Lv=Object.freeze({__proto__:null,identity:Nv});const Mv=br({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Uv=Object.freeze({__proto__:null,base2:Mv});const jv=br({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Fv=Object.freeze({__proto__:null,base8:jv});const Bv=Po({prefix:"9",name:"base10",alphabet:"0123456789"});var kv=Object.freeze({__proto__:null,base10:Bv});const Hv=br({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),zv=br({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Wv=Object.freeze({__proto__:null,base16:Hv,base16upper:zv});const qv=br({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vv=br({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Kv=br({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Gv=br({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Zv=br({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Yv=br({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Jv=br({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Qv=br({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Xv=br({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ey=Object.freeze({__proto__:null,base32:qv,base32upper:Vv,base32pad:Kv,base32padupper:Gv,base32hex:Zv,base32hexupper:Yv,base32hexpad:Jv,base32hexpadupper:Qv,base32z:Xv});const ty=Po({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ry=Po({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ny=Object.freeze({__proto__:null,base36:ty,base36upper:ry});const iy=Po({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),sy=Po({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var oy=Object.freeze({__proto__:null,base58btc:iy,base58flickr:sy});const ay=br({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),cy=br({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ly=br({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),uy=br({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var hy=Object.freeze({__proto__:null,base64:ay,base64pad:cy,base64url:ly,base64urlpad:uy});const Vd=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),fy=Vd.reduce((t,e,r)=>(t[r]=e,t),[]),dy=Vd.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function py(t){return t.reduce((e,r)=>(e+=fy[r],e),"")}function gy(t){const e=[];for(const r of t){const n=dy[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const my=tc({prefix:"\u{1F680}",name:"base256emoji",encode:py,decode:gy});var wy=Object.freeze({__proto__:null,base256emoji:my}),vy=Gd,Kd=128,yy=127,by=~yy,_y=Math.pow(2,31);function Gd(t,e,r){e=e||[],r=r||0;for(var n=r;t>=_y;)e[r++]=t&255|Kd,t/=128;for(;t&by;)e[r++]=t&255|Kd,t>>>=7;return e[r]=t|0,Gd.bytes=r-n+1,e}var Ey=Eu,xy=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>=xy);return Eu.bytes=o-n,r}var Iy=Math.pow(2,7),Cy=Math.pow(2,14),Sy=Math.pow(2,21),Oy=Math.pow(2,28),Ay=Math.pow(2,35),Dy=Math.pow(2,42),$y=Math.pow(2,49),Py=Math.pow(2,56),Ty=Math.pow(2,63),Ry=function(t){return t<Iy?1:t<Cy?2:t<Sy?3:t<Oy?4:t<Ay?5:t<Dy?6:t<$y?7:t<Py?8:t<Ty?9:10},Ny={encode:vy,decode:Ey,encodingLength:Ry},Yd=Ny;const Jd=(t,e,r=0)=>(Yd.encode(t,e,r),e),Qd=t=>Yd.encodingLength(t),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 Ly(t,r,e,o)};class Ly{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Xd=({name:t,code:e,encode:r})=>new My(t,e,r);class My{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?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)),Uy=Xd({name:"sha2-256",code:18,encode:e1("SHA-256")}),jy=Xd({name:"sha2-512",code:19,encode:e1("SHA-512")});var Fy=Object.freeze({__proto__:null,sha256:Uy,sha512:jy});const t1=0,By="identity",r1=Wd;var ky=Object.freeze({__proto__:null,identity:{code:t1,name:By,encode:r1,digest:t=>xu(t1,r1(t))}});new TextEncoder,new TextDecoder;const n1={...Lv,...Uv,...Fv,...kv,...Wv,...ey,...ny,...oy,...hy,...wy};({...Fy,...ky});function i1(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const s1=i1("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Iu=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:Iu,ascii:Iu,binary:Iu,...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))},Hy=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),zy=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),Wy=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),qy=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Vy=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Ky=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Gy=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,c1=3,Zy=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Ky]],l1=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Yy(t){return t?u1(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Vy:typeof navigator<"u"?u1(navigator.userAgent):Xy()}function Jy(t){return t!==""&&Zy.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var o=i.exec(t);return!!o&&[n,o]},!1)}function u1(t){var e=Jy(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new qy;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<c1&&(i=a1(a1([],i,!0),e5(c1-i.length),!0)):i=[];var o=i.join("."),c=Qy(t),l=Gy.exec(t);return l&&l[1]?new Wy(r,o,c,l[1]):new Hy(r,o,c)}function Qy(t){for(var e=0,r=l1.length;e<r;e++){var n=l1[e],i=n[0],o=n[1],c=o.exec(t);if(c)return i}return null}function Xy(){var t=typeof process<"u"&&process.version;return t?new zy(process.version.slice(1)):null}function e5(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Te={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
12
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
13
|
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */var 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.
|
|
14
|
+
***************************************************************************** */var Cu=function(t,e){return Cu=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])},Cu(t,e)};function t5(t,e){Cu(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 r5(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function n5(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(o=(i<3?c(o):i>3?c(e,r,o):c(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function i5(t,e){return function(r,n){e(r,n,t)}}function s5(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function o5(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{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 a5(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(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 c5(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function l5(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function 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 u5(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(h1(arguments[e]));return t}function h5(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function To(t){return this instanceof To?(this.v=t,this):new To(t)}function f5(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(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 To?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 d5(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(c){return(r=!r)?{value:To(t[i](c)),done:i==="return"}:o?o(c):c}:o}}function p5(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof 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 g5(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function m5(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function w5(t){return t&&t.__esModule?t:{default:t}}function v5(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function y5(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var b5=Object.freeze({__proto__:null,__extends:t5,get __assign(){return Su},__rest:r5,__decorate:n5,__param:i5,__metadata:s5,__awaiter:o5,__generator:a5,__createBinding:c5,__exportStar:l5,__values:Ou,__read:h1,__spread:u5,__spreadArrays:h5,__await:To,__asyncGenerator:f5,__asyncDelegator:d5,__asyncValues:p5,__makeTemplateObject:g5,__importStar:m5,__importDefault:w5,__classPrivateFieldGet:v5,__classPrivateFieldSet:y5}),rc=Hi(b5),Au={},Ro={},f1;function _5(){if(f1)return Ro;f1=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Ro.delay=t,Ro}var zi={},Du={},Wi={},d1;function E5(){return d1||(d1=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.ONE_THOUSAND=Wi.ONE_HUNDRED=void 0,Wi.ONE_HUNDRED=100,Wi.ONE_THOUSAND=1e3),Wi}var $u={},p1;function x5(){return p1||(p1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}($u)),$u}var g1;function m1(){return g1||(g1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=rc;e.__exportStar(E5(),t),e.__exportStar(x5(),t)}(Du)),Du}var w1;function I5(){if(w1)return zi;w1=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.fromMiliseconds=zi.toMiliseconds=void 0;const t=m1();function e(n){return n*t.ONE_THOUSAND}zi.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return zi.fromMiliseconds=r,zi}var v1;function C5(){return v1||(v1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=rc;e.__exportStar(_5(),t),e.__exportStar(I5(),t)}(Au)),Au}var Ps={},y1;function S5(){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={},No={},b1;function O5(){if(b1)return No;b1=1,Object.defineProperty(No,"__esModule",{value:!0}),No.IWatch=void 0;class t{}return No.IWatch=t,No}var _1;function A5(){return _1||(_1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),rc.__exportStar(O5(),t)}(Pu)),Pu}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=rc;e.__exportStar(C5(),t),e.__exportStar(S5(),t),e.__exportStar(A5(),t),e.__exportStar(m1(),t)})(Te);var At={};Object.defineProperty(At,"__esModule",{value:!0}),At.getLocalStorage=At.getLocalStorageOrThrow=At.getCrypto=At.getCryptoOrThrow=x1=At.getLocation=At.getLocationOrThrow=Tu=At.getNavigator=At.getNavigatorOrThrow=E1=At.getDocument=At.getDocumentOrThrow=At.getFromWindowOrThrow=At.getFromWindow=void 0;function qi(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}At.getFromWindow=qi;function Ts(t){const e=qi(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}At.getFromWindowOrThrow=Ts;function D5(){return Ts("document")}At.getDocumentOrThrow=D5;function $5(){return qi("document")}var E1=At.getDocument=$5;function P5(){return Ts("navigator")}At.getNavigatorOrThrow=P5;function T5(){return qi("navigator")}var Tu=At.getNavigator=T5;function R5(){return Ts("location")}At.getLocationOrThrow=R5;function N5(){return qi("location")}var x1=At.getLocation=N5;function L5(){return Ts("crypto")}At.getCryptoOrThrow=L5;function M5(){return qi("crypto")}At.getCrypto=M5;function U5(){return Ts("localStorage")}At.getLocalStorageOrThrow=U5;function j5(){return qi("localStorage")}At.getLocalStorage=j5;var Ru={};Object.defineProperty(Ru,"__esModule",{value:!0});var I1=Ru.getWindowMetadata=void 0;const C1=At;function F5(){let t,e;try{t=C1.getDocumentOrThrow(),e=C1.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}}I1=Ru.getWindowMetadata=F5;var Lo={},B5=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),S1="%[a-f0-9]{2}",O1=new RegExp("("+S1+")|([^%]+?)","gi"),A1=new RegExp("("+S1+")+","gi");function 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 k5(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 H5(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=A1.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=k5(r[0]);n!==r[0]&&(e[r[0]]=n)}r=A1.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),o=0;o<i.length;o++){var c=i[o];t=t.replace(new RegExp(c,"g"),e[c])}return t}var z5=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return H5(t)}},W5=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},q5=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),o=0;o<n.length;o++){var c=n[o],l=t[c];(i?e.indexOf(c)!==-1:e(c,l,t))&&(r[c]=l)}return r};(function(t){const e=B5,r=z5,n=W5,i=q5,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),I=typeof R=="string"&&!d&&y(R,T).includes(T.arrayFormatSeparator);R=I?y(R,T):R;const J=d||I?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 I=R===null?[]:R.split(T.arrayFormatSeparator).map(J=>y(J,T));if(S[$]===void 0){S[$]=I;return}S[$]=[].concat(S[$],I)};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,I]=n(L.decode?S.replace(/\+/g," "):S,"=");I=I===void 0?null:["comma","separator","bracket-separator"].includes(L.arrayFormat)?I:y(I,L),$(y(d,L),I,R)}for(const S of Object.keys(R)){const d=R[S];if(typeof d=="object"&&d!==null)for(const I of Object.keys(d))d[I]=H(d[I],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 I=R[d];return I&&typeof I=="object"&&!Array.isArray(I)?S[d]=b(I):S[d]=I,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 $=I=>L.skipNull&&o(T[I])||L.skipEmptyString&&T[I]==="",R=l(L),S={};for(const I of Object.keys(T))$(I)||(S[I]=T[I]);const d=Object.keys(S);return L.sort!==!1&&d.sort(L.sort),d.map(I=>{const J=T[I];return J===void 0?"":J===null?v(I,L):Array.isArray(J)?J.length===0&&L.arrayFormat==="bracket-separator"?v(I,L)+"[]":J.reduce(R(I),[]).join("&"):v(I,L)+"="+v(J,L)}).filter(I=>I.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 I=t.stringify(d,L);I&&(I=`?${I}`);let J=P(T.url);return T.fragmentIdentifier&&(J=`#${L[c]?v(T.fragmentIdentifier,L):T.fragmentIdentifier}`),`${$}${I}${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,$)}})(Lo);const V5={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}},K5=":";function G5(t){const[e,r]=t.split(K5);return{namespace:e,reference:r}}function Z5(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function D1(t,e){return t.includes(":")?[t]:e.chains||[]}const $1="base10",Pr="base16",Lu="base64pad",Mu="utf8",P1=0,Vi=1,Y5=0,T1=1,Uu=12,ju=32;function J5(){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 Q5(t,e){const r=yu.sharedKey(zr(t,Pr),zr(e,Pr),!0),n=new fv(ec.SHA256,r).expand(ju);return $r(n,Pr)}function X5(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 eb(t){return zr(`${t}`,$1)}function Mo(t){return Number($r(t,$1))}function tb(t){const e=eb(typeof t.type<"u"?t.type:P1);if(Mo(e)===Vi&&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 nb({type:e,sealed:i,iv:n,senderPublicKey:r})}function rb(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 nb(t){if(Mo(t.type)===Vi){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(Y5,T1),n=T1;if(Mo(r)===Vi){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 ib(t,e){const r=nc(t);return R1({type:Mo(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===Vi){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===Vi&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var sb=Object.defineProperty,L1=Object.getOwnPropertySymbols,ob=Object.prototype.hasOwnProperty,ab=Object.prototype.propertyIsEnumerable,M1=(t,e,r)=>e in t?sb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,U1=(t,e)=>{for(var r in e||(e={}))ob.call(e,r)&&M1(t,r,e[r]);if(L1)for(var r of L1(e))ab.call(e,r)&&M1(t,r,e[r]);return t};const cb="ReactNative",en={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},lb="js";function Bu(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Ns(){return!E1()&&!!Tu()&&navigator.product===cb}function Ls(){return!Bu()&&!!Tu()}function Uo(){return Ns()?en.reactNative:Bu()?en.node:Ls()?en.browser:en.unknown}function ub(){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 hb(t,e){let r=Lo.parse(t);return r=U1(U1({},r),e),t=Lo.stringify(r),t}function fb(){return I1()||{name:"",description:"",url:"",icons:[""]}}function db(){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=Yy();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function pb(){var t;const e=Uo();return e===en.browser?[e,((t=x1())==null?void 0:t.host)||"unknown"].join(":"):e}function gb(t,e,r){const n=db(),i=pb();return[[t,e].join("-"),[lb,r].join("-"),n,i].join("/")}function mb({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:c,bundleId:l}){const f=r.split("?"),h=gb(t,e,n),v={auth:i,ua:h,projectId:o,useOnCloseEvent:c||void 0,origin:l||void 0},y=hb(f[1]||"",v);return f[0]+"?"+y}function Ki(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 Ms(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 wb(t){return B1("topic",t)}function vb(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 In(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 yb({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)}}async function bb(t,e){try{return await t.getItem(e)||(Ls()?localStorage.getItem(e):void 0)}catch(r){console.error(r)}}const _b="irn";function Hu(t){return t?.relay||{protocol:_b}}function ic(t){const e=V5[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Eb=Object.defineProperty,H1=Object.getOwnPropertySymbols,xb=Object.prototype.hasOwnProperty,Ib=Object.prototype.propertyIsEnumerable,z1=(t,e,r)=>e in t?Eb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Cb=(t,e)=>{for(var r in e||(e={}))xb.call(e,r)&&z1(t,r,e[r]);if(H1)for(var r of H1(e))Ib.call(e,r)&&z1(t,r,e[r]);return t};function Sb(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 W1(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=Lo.parse(o);return{protocol:n,topic:Ob(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:Sb(c)}}function Ob(t){return t.startsWith("//")?t.substring(2):t}function Ab(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 Db(t){return`${t.protocol}:${t.topic}@${t.version}?`+Lo.stringify(Cb({symKey:t.symKey},Ab(t.relay)))}function Us(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function $b(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Us(r.accounts))}),e}function Pb(t,e){const r=[];return Object.values(t).forEach(n=>{Us(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Tb(t,e){const r=[];return Object.values(t).forEach(n=>{Us(n.accounts).includes(e)&&r.push(...n.events)}),r}function Rb(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 Nb={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}},Lb={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 ye(t,e){const{message:r,code:n}=Lb[t];return{message:e?`${r} ${e}`:r,code:n}}function Yt(t,e){const{message:r,code:n}=Nb[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 js(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 Mb(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let o=!0;return Ki(i,n)?(n.forEach(c=>{const{accounts:l,methods:f,events:h}=t.namespaces[c],v=Us(l),y=r[c];(!Ki(D1(c,y),v)||!Ki(y.methods,f)||!Ki(y.events,h))&&(o=!1)}),o):!1}function sc(t){return dr(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Ub(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 jb(t){if(dr(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function Fb(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function Bb(t){return t?.topic}function kb(t,e){let r=null;return dr(t?.publicKey,!1)||(r=ye("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function q1(t){let e=!0;return Nn(t)?t.length&&(e=t.every(r=>dr(r,!1))):e=!1,e}function Hb(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 zb(t,e,r){let n=null;return Object.entries(t).forEach(([i,o])=>{if(n)return;const c=Hb(i,D1(i,o),`${e} ${r}`);c&&(n=c)}),n}function Wb(t,e){let r=null;return Nn(t)?t.forEach(n=>{r||Ub(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 qb(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Wb(n?.accounts,`${e} namespace`);i&&(r=i)}),r}function Vb(t,e){let r=null;return q1(t?.methods)?q1(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 V1(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Vb(n,`${e}, namespace`);i&&(r=i)}),r}function Kb(t,e,r){let n=null;if(t&&js(t)){const i=V1(t,e);i&&(n=i);const o=zb(t,e,r);o&&(n=o)}else n=ye("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function oc(t,e){let r=null;if(t&&js(t)){const n=V1(t,e);n&&(r=n);const i=qb(t,e);i&&(r=i)}else r=ye("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function K1(t){return dr(t.protocol,!0)}function Gb(t,e){let r=!1;return e&&!t?r=!0:t&&Nn(t)&&t.length&&t.forEach(n=>{r=K1(n)}),r}function Zb(t){return typeof t=="number"}function Wr(t){return typeof t<"u"&&typeof t!==null}function Yb(t){return!(!t||typeof t!="object"||!t.code||!Wu(t.code,!1)||!t.message||!dr(t.message,!1))}function Jb(t){return!(Tr(t)||!dr(t.method,!1))}function Qb(t){return!(Tr(t)||Tr(t.result)&&Tr(t.error)||!Wu(t.id,!1)||!dr(t.jsonrpc,!1))}function Xb(t){return!(Tr(t)||!dr(t.name,!1))}function G1(t,e){return!(!sc(e)||!$b(t).includes(e))}function e6(t,e,r){return dr(r,!1)?Pb(t,e).includes(r):!1}function t6(t,e,r){return dr(r,!1)?Tb(t,e).includes(r):!1}function Z1(t,e,r){let n=null;const i=r6(t),o=n6(e),c=Object.keys(i),l=Object.keys(o),f=Y1(Object.keys(t)),h=Y1(Object.keys(e)),v=f.filter(y=>!h.includes(y));return v.length&&(n=ye("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
15
15
|
Required: ${v.toString()}
|
|
16
|
-
Received: ${Object.keys(e).toString()}`)),
|
|
16
|
+
Received: ${Object.keys(e).toString()}`)),Ki(c,l)||(n=ye("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
|
|
17
17
|
Required: ${c.toString()}
|
|
18
|
-
Approved: ${l.toString()}`)),Object.keys(e).forEach(y=>{if(!y.includes(":")||n)return;const b=
|
|
18
|
+
Approved: ${l.toString()}`)),Object.keys(e).forEach(y=>{if(!y.includes(":")||n)return;const b=Us(e[y].accounts);b.includes(y)||(n=ye("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${y}
|
|
19
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={};/*! *****************************************************************************
|
|
20
|
+
Approved: ${b.toString()}`))}),c.forEach(y=>{n||(Ki(i[y].methods,o[y].methods)?Ki(i[y].events,o[y].events)||(n=ye("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${y}`)):n=ye("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${y}`))}),n}function r6(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 Y1(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function n6(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Us(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 i6(t,e){return Wu(t,!1)&&t<=e.max&&t>=e.min}function J1(){const t=Uo();return new Promise(e=>{switch(t){case en.browser:e(s6());break;case en.reactNative:e(o6());break;case en.node:e(a6());break;default:e(!0)}})}function s6(){return Ls()&&navigator?.onLine}async function o6(){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 a6(){return!0}function c6(t){switch(Uo()){case en.browser:l6(t);break;case en.reactNative:u6(t);break}}function l6(t){!Ns()&&Ls()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function u6(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 h6=/"(?:_|\\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*:/,f6=/"(?: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*:/,d6=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function p6(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){g6(t);return}return e}function g6(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(!d6.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(h6.test(t)||f6.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,p6)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}function m6(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function pr(t,...e){try{return m6(t(...e))}catch(r){return Promise.reject(r)}}function w6(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function v6(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function lc(t){if(w6(t))return String(t);if(v6(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 Q1(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const Vu="base64:";function y6(t){if(typeof t=="string")return t;Q1();const e=Buffer.from(t).toString("base64");return Vu+e}function b6(t){return typeof t!="string"||!t.startsWith(Vu)?t:(Q1(),Buffer.from(t.slice(Vu.length),"base64"))}function qr(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function _6(...t){return qr(t.join(":"))}function uc(t){return t=qr(t),t?t+":":""}function gL(t){return t}const E6="memory",x6=()=>{const t=new Map;return{name:E6,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 I6(t={}){const e={mounts:{"":t.driver||x6()},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 X1(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:_6(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=>b6(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,y6(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=>ep(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(X1(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 ep(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 X1(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function ep(t){typeof t.dispose=="function"&&await pr(t.dispose)}function Gi(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function tp(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=Gi(r);return(i,o)=>n.then(c=>o(c.transaction(e,i).objectStore(e)))}let Ku;function Bo(){return Ku||(Ku=tp("keyval-store","keyval")),Ku}function rp(t,e=Bo()){return e("readonly",r=>Gi(r.get(t)))}function C6(t,e,r=Bo()){return r("readwrite",n=>(n.put(e,t),Gi(n.transaction)))}function S6(t,e=Bo()){return e("readwrite",r=>(r.delete(t),Gi(r.transaction)))}function O6(t=Bo()){return t("readwrite",e=>(e.clear(),Gi(e.transaction)))}function A6(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Gi(t.transaction)}function D6(t=Bo()){return t("readonly",e=>{if(e.getAllKeys)return Gi(e.getAllKeys());const r=[];return A6(e,n=>r.push(n.key)).then(()=>r)})}const $6=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),P6=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 P6(t)}catch{return t}}function Zi(t){return typeof t=="string"?t:$6(t)||""}const T6="idb-keyval";var R6=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=tp(t.dbName,t.storeName)),{name:T6,options:t,async hasItem(i){return!(typeof await rp(r(i),n)>"u")},async getItem(i){return await rp(r(i),n)??null},setItem(i,o){return C6(r(i),o,n)},removeItem(i){return S6(r(i),n)},getKeys(){return D6(n)},clear(){return O6(n)}}};const N6="WALLET_CONNECT_V2_INDEXED_DB",L6="keyvaluestorage";class M6{constructor(){this.indexedDb=I6({driver:R6({dbName:N6,storeName:L6})})}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,Zi(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 U6(t){var e;return[t[0],ko((e=t[1])!=null?e:"")]}class j6{constructor(){this.localStorage=hc.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(U6)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return ko(r)}async setItem(e,r){this.localStorage.setItem(e,Zi(r))}async removeItem(e){this.localStorage.removeItem(e)}}const F6="wc_storage_version",np=1,B6=async(t,e,r)=>{const n=F6,i=await e.getItem(n);if(i&&i>=np){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,np),r(e),k6(t,c)},k6=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};class H6{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new j6;this.storage=e;try{const r=new M6;B6(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 Fs={};/*! *****************************************************************************
|
|
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 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
|
|
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 z6(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 W6(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 q6(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 V6(t,e){return function(r,n){e(r,n,t)}}function K6(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function G6(t,e,r,n){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function l(v){try{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 Z6(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 Y6(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function J6(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 ip(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 Q6(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(ip(arguments[e]));return t}function X6(){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 e4(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 t4(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 r4(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 n4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function i4(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function s4(t){return t&&t.__esModule?t:{default:t}}function o4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function a4(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var c4=Object.freeze({__proto__:null,__extends:z6,get __assign(){return Yu},__rest:W6,__decorate:q6,__param:V6,__metadata:K6,__awaiter:G6,__generator:Z6,__createBinding:Y6,__exportStar:J6,__values:Ju,__read:ip,__spread:Q6,__spreadArrays:X6,__await:Ho,__asyncGenerator:e4,__asyncDelegator:t4,__asyncValues:r4,__makeTemplateObject:n4,__importStar:i4,__importDefault:s4,__classPrivateFieldGet:o4,__classPrivateFieldSet:a4}),fc=Hi(c4),zo={},Qu={},Wo={};class Yi{}var l4=Object.freeze({__proto__:null,IEvents:Yi}),u4=Hi(l4),sp;function h4(){if(sp)return Wo;sp=1,Object.defineProperty(Wo,"__esModule",{value:!0}),Wo.IHeartBeat=void 0;const t=u4;class e extends t.IEvents{constructor(n){super()}}return Wo.IHeartBeat=e,Wo}var op;function ap(){return op||(op=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),fc.__exportStar(h4(),t)}(Qu)),Qu}var Xu={},Ji={},cp;function f4(){if(cp)return Ji;cp=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.HEARTBEAT_EVENTS=Ji.HEARTBEAT_INTERVAL=void 0;const t=Te;return Ji.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,Ji.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Ji}var lp;function up(){return lp||(lp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),fc.__exportStar(f4(),t)}(Xu)),Xu}var hp;function d4(){if(hp)return zo;hp=1,Object.defineProperty(zo,"__esModule",{value:!0}),zo.HeartBeat=void 0;const t=fc,e=yr.exports,r=Te,n=ap(),i=up();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(d4(),t),e.__exportStar(ap(),t),e.__exportStar(up(),t)})(Fs);var dt={};/*! *****************************************************************************
|
|
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 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={};/*! *****************************************************************************
|
|
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 p4(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 g4(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 m4(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 w4(t,e){return function(r,n){e(r,n,t)}}function v4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function y4(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 b4(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 _4(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function E4(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 fp(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 x4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(fp(arguments[e]));return t}function I4(){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 C4(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 S4(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 O4(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 A4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function D4(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 $4(t){return t&&t.__esModule?t:{default:t}}function P4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function T4(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 R4=Object.freeze({__proto__:null,__extends:p4,get __assign(){return th},__rest:g4,__decorate:m4,__param:w4,__metadata:v4,__awaiter:y4,__generator:b4,__createBinding:_4,__exportStar:E4,__values:rh,__read:fp,__spread:x4,__spreadArrays:I4,__await:qo,__asyncGenerator:C4,__asyncDelegator:S4,__asyncValues:O4,__makeTemplateObject:A4,__importStar:D4,__importDefault:$4,__classPrivateFieldGet:P4,__classPrivateFieldSet:T4}),N4=Hi(R4),nh,dp;function L4(){if(dp)return nh;dp=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,pp;function M4(){if(pp)return ih;pp=1;const t=L4();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 I=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 I=="function"&&(I.error=I.fatal=I.warn=I.info=I.debug=I.trace=I),S.enabled===!1&&(S.level="silent");const me=S.level||"info",O=Object.create(I);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 be(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 be.prototype=this,new be(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,I,J){const z=Object.getPrototypeOf(d);d[I]=d.levelVal>d.levels.values[I]?H:z[I]?z[I]:e[I]||e[J]||H,c(S,d,I)}function c(S,d,I){!S.transmit&&d[I]===H||(d[I]=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,I,de,ee)):J.apply(me,de),S.transmit){const j=S.transmit.level||d.level,ce=i.levels.values[j],le=i.levels.values[I];if(le<ce)return;v(this,{ts:ee,methodLevel:I,methodValue:le,transmitLevel:j,transmitValue:i.levels.values[S.transmit.level||d.level],send:S.transmit.send,val:d.levelVal},de)}}}(d[I]))}function l(S,d,I,J){S._serialize&&f(I,S._serialize,S.serializers,S._stdErrSerialize);const z=I.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,I,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 I&&(S[z][ee]=I[ee](S[z][ee]))}function h(S,d,I){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[I].apply(this,J)}}function v(S,d,I){const J=d.send,z=d.ts,ee=d.methodLevel,de=d.methodValue,me=d.val,O=S._logEvent.bindings;f(I,S._serialize||Object.keys(S.serializers),S.serializers,S._stdErrSerialize===void 0?!0:S._stdErrSerialize),S._logEvent.ts=z,S._logEvent.messages=I.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 I in S)d[I]===void 0&&(d[I]=S[I]);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 Qi={},gp;function mp(){return gp||(gp=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.PINO_CUSTOM_CONTEXT_KEY=Qi.PINO_LOGGER_DEFAULTS=void 0,Qi.PINO_LOGGER_DEFAULTS={level:"info"},Qi.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Qi}var Rr={},wp;function U4(){if(wp)return Rr;wp=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.generateChildLogger=Rr.formatChildLoggerContext=Rr.getLoggerContext=Rr.setBrowserLoggerContext=Rr.getBrowserLoggerContext=Rr.getDefaultLoggerOptions=void 0;const t=mp();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=N4,r=e.__importDefault(M4());Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(mp(),t),e.__exportStar(U4(),t)})(dt);class j4 extends Yi{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class F4 extends Yi{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class B4{constructor(e,r){this.logger=e,this.core=r}}class k4 extends Yi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class H4 extends Yi{constructor(e){super()}}class z4{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}}class W4 extends Yi{constructor(e,r){super(),this.relayer=e,this.logger=r}}class q4 extends Yi{constructor(e,r){super(),this.core=e,this.logger=r}}class V4{constructor(e,r){this.projectId=e,this.logger=r}}class K4{constructor(e,r){this.projectId=e,this.logger=r}}class G4{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class Z4{constructor(e){this.client=e}}var sh={},vp={};(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],I=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,be=M,Me=H,Q=V,Y=T,W=L,w=$,F=R,we=S,ve=d,Ue=I,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&I^d&I,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=be,V=Me,T=Q,L=Y,$=W,R=w,P=F,d=we,I=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=I,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]=I=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})(vp),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=vp,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,gs=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,gs+=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*gs,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 I(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--)I(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--)I(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),I(F,Q[1]),d(we,F,f),S(F,F,Q[2]),R(we,Q[2],we),I(ve,we),I(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),I(w,Q[0]),d(w,w,we),T(w,F)&&d(Q[0],Q[0],b),I(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 be(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=be;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 Y4="EdDSA",J4="JWT",yp=".",bp="base64url",Q4="utf8",X4="utf8",e_=":",t_="did",r_="key",_p="base58btc",n_="z",i_="K36",s_=32;function dc(t){return $r(zr(Zi(t),Q4),bp)}function Ep(t){const e=zr(i_,_p),r=n_+$r(_u([e,t]),_p);return[t_,r_,r].join(e_)}function o_(t){return $r(t,bp)}function a_(t){return zr([dc(t.header),dc(t.payload)].join(yp),X4)}function c_(t){return[dc(t.header),dc(t.payload),o_(t.signature)].join(yp)}function xp(t=$s.randomBytes(s_)){return sh.generateKeyPairFromSeed(t)}async function l_(t,e,r,n,i=Te.fromMiliseconds(Date.now())){const o={alg:Y4,typ:J4},c=Ep(n.publicKey),l=i+r,f={iss:c,sub:t,aud:e,iat:i,exp:l},h=a_({header:o,payload:f}),v=sh.sign(n.secretKey,h);return c_({header:o,payload:f,signature:v})}const u_="PARSE_ERROR",h_="INVALID_REQUEST",f_="METHOD_NOT_FOUND",d_="INVALID_PARAMS",Ip="INTERNAL_ERROR",oh="SERVER_ERROR",p_=[-32700,-32600,-32601,-32602,-32603],Vo={[u_]:{code:-32700,message:"Parse error"},[h_]:{code:-32600,message:"Invalid Request"},[f_]:{code:-32601,message:"Method not found"},[d_]:{code:-32602,message:"Invalid params"},[Ip]:{code:-32603,message:"Internal error"},[oh]:{code:-32e3,message:"Server error"}},Cp=oh;function g_(t){return p_.includes(t)}function Sp(t){return Object.keys(Vo).includes(t)?Vo[t]:Vo[Cp]}function m_(t){const e=Object.values(Vo).find(r=>r.code===t);return e||Vo[Cp]}function Op(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Ap={};/*! *****************************************************************************
|
|
47
47
|
Copyright (c) Microsoft Corporation.
|
|
48
48
|
|
|
49
49
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -56,17 +56,17 @@
|
|
|
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 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:{}};/**
|
|
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 w_(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 v_(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 y_(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 b_(t,e){return function(r,n){e(r,n,t)}}function __(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function E_(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 x_(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 I_(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function C_(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 Dp(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){c={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return o}function S_(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Dp(arguments[e]));return t}function O_(){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 A_(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 D_(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 $_(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 P_(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function T_(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 R_(t){return t&&t.__esModule?t:{default:t}}function N_(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function L_(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 M_=Object.freeze({__proto__:null,__extends:w_,get __assign(){return ch},__rest:v_,__decorate:y_,__param:b_,__metadata:__,__awaiter:E_,__generator:x_,__createBinding:I_,__exportStar:C_,__values:lh,__read:Dp,__spread:S_,__spreadArrays:O_,__await:Ko,__asyncGenerator:A_,__asyncDelegator:D_,__asyncValues:$_,__makeTemplateObject:P_,__importStar:T_,__importDefault:R_,__classPrivateFieldGet:N_,__classPrivateFieldSet:L_}),U_=Hi(M_),Vn={},$p;function j_(){if($p)return Vn;$p=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={},Pp;function F_(){if(Pp)return Kn;Pp=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=U_;e.__exportStar(j_(),t),e.__exportStar(F_(),t)})(Ap);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 Tp(t=6){return BigInt(uh(t))}function Bs(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:B_(e,r)}}function B_(t,e){return typeof t>"u"?Sp(Ip):(typeof t=="string"&&(t=Object.assign(Object.assign({},Sp(oh)),{message:t})),typeof e<"u"&&(t.data=e),g_(t.code)&&(t=m_(t.code)),t)}class k_{}class H_ extends k_{constructor(){super()}}class z_ extends H_{constructor(e){super()}}const W_="^https?:",q_="^wss?:";function V_(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Rp(t,e){const r=V_(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Np(t){return Rp(t,W_)}function Lp(t){return Rp(t,q_)}function K_(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Mp(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function fh(t){return Mp(t)&&"method"in t}function gc(t){return Mp(t)&&(Gn(t)||Cn(t))}function Gn(t){return"result"in t}function Cn(t){return"error"in t}class Zn extends z_{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(Bs(e.method,e.params||[],e.id||Tp().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=>{Cn(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 G_=()=>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"),Z_=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Up=t=>t.split("?")[0],jp=10,Y_=G_();class J_{constructor(e){if(this.url=e,this.events=new yr.exports.EventEmitter,this.registering=!1,!Lp(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(Zi(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!Lp(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=Ap.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!K_(e)},c=new Y_(e,[],o);Z_()?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 Op(e,Up(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>jp&&this.events.setMaxListeners(jp)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${Up(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]",I="[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*)$/,be={};be[me]=be[O]=be[j]=be[ce]=be[le]=be[re]=be[ne]=be[ae]=be[ie]=!0,be[l]=be[f]=be[ee]=be[v]=be[de]=be[y]=be[b]=be[x]=be[M]=be[H]=be[T]=be[R]=be[S]=be[d]=be[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,Ie=N==null?0:N.length,Ct=0,Qe=[];++fe<Ie;){var Tt=N[fe];q(Tt,fe,N)&&(Qe[Ct++]=Tt)}return Qe}function at(N,q){for(var fe=-1,Ie=q.length,Ct=N.length;++fe<Ie;)N[Ct+fe]=q[fe];return N}function Ge(N,q){for(var fe=-1,Ie=N==null?0:N.length;++fe<Ie;)if(q(N[fe],fe,N))return!0;return!1}function Dt(N,q){for(var fe=-1,Ie=Array(N);++fe<N;)Ie[fe]=q(fe);return Ie}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(Ie,Ct){fe[++q]=[Ct,Ie]}),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(Ie){fe[++q]=Ie}),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,gs=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 Ie=N[q];this.set(Ie[0],Ie[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 Ie=N[q];this.set(Ie[0],Ie[1])}}function Qf(){this.__data__=[],this.size=0}function Xf(N){var q=this.__data__,fe=ms(q,N);if(fe<0)return!1;var Ie=q.length-1;return fe==Ie?q.pop():lt.call(q,fe,1),--this.size,!0}function e0(N){var q=this.__data__,fe=ms(q,N);return fe<0?void 0:q[fe][1]}function t0(N){return ms(this.__data__,N)>-1}function r0(N,q){var fe=this.__data__,Ie=ms(fe,N);return Ie<0?(++this.size,fe.push([N,q])):fe[Ie][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 Ie=N[q];this.set(Ie[0],Ie[1])}}function lo(){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 uo(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),Ie=fe.size;return fe.set(N,q),this.size+=fe.size==Ie?0:1,this}ii.prototype.clear=lo,ii.prototype.delete=n0,ii.prototype.get=uo,ii.prototype.has=i0,ii.prototype.set=s0;function ho(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)}ho.prototype.add=ho.prototype.push=cl,ho.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 Ie=fe.__data__;if(!Mt||Ie.length<r-1)return Ie.push([N,q]),this.size=++fe.size,this;fe=this.__data__=new ii(Ie)}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=go(N),Ie=!fe&&xl(N),Ct=!fe&&!Ie&&Da(N),Qe=!fe&&!Ie&&!Ct&&Sl(N),Tt=fe||Ie||Ct||Qe,cr=Tt?Dt(N.length,String):[],mt=cr.length;for(var St in N)(q||D.call(N,St))&&!(Tt&&(St=="length"||Ct&&(St=="offset"||St=="parent")||Qe&&(St=="buffer"||St=="byteLength"||St=="byteOffset")||vl(St,mt)))&&cr.push(St);return cr}function ms(N,q){for(var fe=N.length;fe--;)if(El(N[fe][0],q))return fe;return-1}function Oa(N,q,fe){var Ie=q(N);return go(N)?Ie:at(Ie,fe(N))}function ws(N){return N==null?N===void 0?J:V:jr&&jr in Object(N)?ml(N):f0(N)}function Aa(N){return ys(N)&&ws(N)==l}function vs(N,q,fe,Ie,Ct){return N===q?!0:N==null||q==null||!ys(N)&&!ys(q)?N!==N&&q!==q:fl(N,q,fe,Ie,vs,Ct)}function fl(N,q,fe,Ie,Ct,Qe){var Tt=go(N),cr=go(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)?fo(N,q,fe,Ie,Ct,Qe):h0(N,q,mt,fe,Ie,Ct,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),Ct(An,gn,fe,Ie,Qe)}}return lr?(Qe||(Qe=new On),gl(N,q,fe,Ie,Ct,Qe)):!1}function u0(N){if(!Cl(N)||bl(N))return!1;var q=mo(N)?X:ge;return q.test(si(N))}function dl(N){return ys(N)&&Il(N.length)&&!!be[ws(N)]}function pl(N){if(!_l(N))return gs(N);var q=[];for(var fe in Object(N))D.call(N,fe)&&fe!="constructor"&&q.push(fe);return q}function fo(N,q,fe,Ie,Ct,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 ho:void 0;for(Qe.set(N,q),Qe.set(q,N);++Qt<cr;){var Rt=N[Qt],Fr=q[Qt];if(Ie)var An=Tt?Ie(Fr,Rt,Qt,q,N,Qe):Ie(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||Ct(Rt,gn,fe,Ie,Qe)))return lr.push(Hn)})){Gr=!1;break}}else if(!(Rt===Fr||Ct(Rt,Fr,fe,Ie,Qe))){Gr=!1;break}}return Qe.delete(N),Qe.delete(q),Gr}function h0(N,q,fe,Ie,Ct,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=Ie&i;if(cr||(cr=rt),N.size!=q.size&&!mt)return!1;var St=Tt.get(N);if(St)return St==q;Ie|=o,Tt.set(N,q);var Qt=fo(cr(N),cr(q),Ie,Ct,Qe,Tt);return Tt.delete(N),Qt;case I:if(Gt)return Gt.call(N)==Gt.call(q)}return!1}function gl(N,q,fe,Ie,Ct,Qe){var Tt=fe&i,cr=po(N),mt=cr.length,St=po(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(Ie)var $a=Tt?Ie(Hn,gn,lr,q,N,Qe):Ie(gn,Hn,lr,N,q,Qe);if(!($a===void 0?gn===Hn||Ct(gn,Hn,fe,Ie,Qe):$a)){Fr=!1;break}An||(An=lr=="constructor")}if(Fr&&!An){var bs=N.constructor,wr=q.constructor;bs!=wr&&"constructor"in N&&"constructor"in q&&!(typeof bs=="function"&&bs instanceof bs&&typeof wr=="function"&&wr instanceof wr)&&(Fr=!1)}return Qe.delete(N),Qe.delete(q),Fr}function po(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 Ie=!0}catch{}var Ct=G.call(N);return Ie&&(q?N[jr]=fe:delete N[jr]),Ct}var wl=ni?function(N){return N==null?[]:(N=Object(N),nt(ni(N),function(q){return ht.call(N,q)}))}:It,kn=ws;(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=ws(N),fe=q==T?N.constructor:void 0,Ie=fe?si(fe):"";if(Ie)switch(Ie){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 ys(N)&&D.call(N,"callee")&&!ht.call(N,"callee")},go=Array.isArray;function d0(N){return N!=null&&Il(N.length)&&!mo(N)}var Da=Pi||xt;function p0(N,q){return vs(N,q)}function mo(N){if(!Cl(N))return!1;var q=ws(N);return q==x||q==P||q==h||q==$}function Il(N){return typeof N=="number"&&N>-1&&N%1==0&&N<=c}function Cl(N){var q=typeof N;return N!=null&&(q=="object"||q=="function")}function ys(N){return N!=null&&typeof N=="object"}var Sl=Ue?$t(Ue):dl;function g0(N){return d0(N)?hl(N):pl(N)}function It(){return[]}function xt(){return!1}t.exports=p0})(dh,dh.exports);var Q_=dh.exports;function X_(t,e){return e=e||{},new Promise(function(r,n){var i=new XMLHttpRequest,o=[],c=[],l={},f=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:f,headers:{keys:function(){return o},entries:function(){return c},get:function(v){return l[v.toLowerCase()]},has:function(v){return v.toLowerCase()in l}}}};for(var h in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(v,y,b){o.push(y=y.toLowerCase()),c.push([y,b]),l[y]=l[y]?l[y]+","+b:b}),r(f())},i.onerror=n,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(h,e.headers[h]);i.send(e.body||null)})}var e8=Object.freeze({__proto__:null,default:X_}),Fp=Hi(e8),t8=self.fetch||(self.fetch=Fp.default||Fp),r8=Object.defineProperty,Bp=Object.getOwnPropertySymbols,n8=Object.prototype.hasOwnProperty,i8=Object.prototype.propertyIsEnumerable,kp=(t,e,r)=>e in t?r8(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Nr=(t,e)=>{for(var r in e||(e={}))n8.call(e,r)&&kp(t,r,e[r]);if(Bp)for(var r of Bp(e))i8.call(e,r)&&kp(t,r,e[r]);return t};function s8(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 I=L-H;I!==L&&$[I]===0;)I++;for(var J=f.repeat(M);I<L;++I)J+=t.charAt($[I]);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 I=new Uint8Array(H+(T-d)),J=H;d!==T;)I[J++]=L[d++];return I}}}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 o8=s8,a8=o8;const Hp=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},c8=t=>new TextEncoder().encode(t),l8=t=>new TextDecoder().decode(t);class u8{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 h8{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 zp(this,e)}}class f8{constructor(e){this.decoders=e}or(e){return zp(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 zp=(t,e)=>new f8(Nr(Nr({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class d8{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new u8(e,r,n),this.decoder=new h8(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 d8(t,e,r,n),Go=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=a8(r,e);return mc({prefix:t,name:e,encode:n,decode:o=>Hp(i(o))})},p8=(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},g8=(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 g8(i,n,r)},decode(i){return p8(i,n,r,t)}}),m8=mc({prefix:"\0",name:"identity",encode:t=>l8(t),decode:t=>c8(t)});var w8=Object.freeze({__proto__:null,identity:m8});const v8=_r({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var y8=Object.freeze({__proto__:null,base2:v8});const b8=_r({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var _8=Object.freeze({__proto__:null,base8:b8});const E8=Go({prefix:"9",name:"base10",alphabet:"0123456789"});var x8=Object.freeze({__proto__:null,base10:E8});const I8=_r({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),C8=_r({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var S8=Object.freeze({__proto__:null,base16:I8,base16upper:C8});const O8=_r({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),A8=_r({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),D8=_r({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),$8=_r({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),P8=_r({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),T8=_r({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),R8=_r({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),N8=_r({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),L8=_r({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var M8=Object.freeze({__proto__:null,base32:O8,base32upper:A8,base32pad:D8,base32padupper:$8,base32hex:P8,base32hexupper:T8,base32hexpad:R8,base32hexpadupper:N8,base32z:L8});const U8=Go({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),j8=Go({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var F8=Object.freeze({__proto__:null,base36:U8,base36upper:j8});const B8=Go({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),k8=Go({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var H8=Object.freeze({__proto__:null,base58btc:B8,base58flickr:k8});const z8=_r({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),W8=_r({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),q8=_r({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),V8=_r({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var K8=Object.freeze({__proto__:null,base64:z8,base64pad:W8,base64url:q8,base64urlpad:V8});const Wp=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}"),G8=Wp.reduce((t,e,r)=>(t[r]=e,t),[]),Z8=Wp.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Y8(t){return t.reduce((e,r)=>(e+=G8[r],e),"")}function J8(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 Q8=mc({prefix:"\u{1F680}",name:"base256emoji",encode:Y8,decode:J8});var X8=Object.freeze({__proto__:null,base256emoji:Q8}),eE=Vp,qp=128,tE=127,rE=~tE,nE=Math.pow(2,31);function Vp(t,e,r){e=e||[],r=r||0;for(var n=r;t>=nE;)e[r++]=t&255|qp,t/=128;for(;t&rE;)e[r++]=t&255|qp,t>>>=7;return e[r]=t|0,Vp.bytes=r-n+1,e}var iE=ph,sE=128,Kp=127;function ph(t,n){var r=0,n=n||0,i=0,o=n,c,l=t.length;do{if(o>=l)throw ph.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=i<28?(c&Kp)<<i:(c&Kp)*Math.pow(2,i),i+=7}while(c>=sE);return ph.bytes=o-n,r}var oE=Math.pow(2,7),aE=Math.pow(2,14),cE=Math.pow(2,21),lE=Math.pow(2,28),uE=Math.pow(2,35),hE=Math.pow(2,42),fE=Math.pow(2,49),dE=Math.pow(2,56),pE=Math.pow(2,63),gE=function(t){return t<oE?1:t<aE?2:t<cE?3:t<lE?4:t<uE?5:t<hE?6:t<fE?7:t<dE?8:t<pE?9:10},mE={encode:eE,decode:iE,encodingLength:gE},Gp=mE;const Zp=(t,e,r=0)=>(Gp.encode(t,e,r),e),Yp=t=>Gp.encodingLength(t),gh=(t,e)=>{const r=e.byteLength,n=Yp(t),i=n+Yp(r),o=new Uint8Array(i+r);return Zp(t,o,0),Zp(r,o,n),o.set(e,i),new wE(t,r,e,o)};class wE{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Jp=({name:t,code:e,encode:r})=>new vE(t,e,r);class vE{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?gh(this.code,r):r.then(n=>gh(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Qp=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),yE=Jp({name:"sha2-256",code:18,encode:Qp("SHA-256")}),bE=Jp({name:"sha2-512",code:19,encode:Qp("SHA-512")});var _E=Object.freeze({__proto__:null,sha256:yE,sha512:bE});const Xp=0,EE="identity",eg=Hp;var xE=Object.freeze({__proto__:null,identity:{code:Xp,name:EE,encode:eg,digest:t=>gh(Xp,eg(t))}});new TextEncoder,new TextDecoder;const tg=Nr(Nr(Nr(Nr(Nr(Nr(Nr(Nr(Nr(Nr({},w8),y8),_8),x8),S8),M8),F8),H8),K8),X8);Nr(Nr({},_E),xE);function rg(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function IE(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?rg(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function ng(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const ig=ng("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),mh=ng("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=IE(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),CE=Nr({utf8:ig,"utf-8":ig,hex:tg.base16,latin1:mh,ascii:mh,binary:mh},tg);function SE(t,e="utf8"){const r=CE[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?rg(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}const sg="wc",OE=2,wh="core",wi=`${sg}@2:${wh}:`,AE={name:wh,logger:"error"},DE={database:":memory:"},$E="crypto",og="client_ed25519_seed",PE=Te.ONE_DAY,TE="keychain",RE="0.3",NE="messages",LE="0.3",ME=Te.SIX_HOURS,UE="publisher",ag="irn",jE="error",cg="wss://relay.walletconnect.com",lg="wss://relay.walletconnect.org",FE="relayer",Cr={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"},BE="_subscription",Yn={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},kE=Te.ONE_SECOND,HE="2.10.6-canary-8",zE=1e4,WE="0.3",qE="WALLETCONNECT_CLIENT_ID",Sn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},VE="subscription",KE="0.3",GE=Te.FIVE_SECONDS*1e3,ZE="pairing",YE="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"},JE="history",QE="0.3",XE="expirer",un={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},e7="0.3",vh="verify-api",ks="https://verify.walletconnect.com",yh="https://verify.walletconnect.org",t7=[ks,yh],r7="echo",n7="https://echo.walletconnect.com";class i7{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=TE,this.version=RE,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}=ye("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=dt.generateChildLogger(r,this.name)}get context(){return dt.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}=ye("NOT_INITIALIZED",this.name);throw new Error(e)}}}class s7{constructor(e,r,n){this.core=e,this.logger=r,this.name=$E,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=xp(i);return Ep(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=J5();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const o=await this.getClientSeed(),c=xp(o),l=Fu();return await l_(l,i,PE,c)},this.generateSharedKey=(i,o,c)=>{this.isInitialized();const l=this.getPrivateKey(i),f=Q5(l,o);return this.setSymKey(f,c)},this.setSymKey=async(i,o)=>{this.isInitialized();const c=o||X5(i);return await this.keychain.set(c,i),c},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,o,c)=>{this.isInitialized();const l=R1(c),f=Zi(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 tb({type:v,symKey:h,message:f,senderPublicKey:y})},this.decode=async(i,o,c)=>{this.isInitialized();const l=ib(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=rb({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 Mo(o.type)},this.getPayloadSenderPublicKey=i=>{const o=nc(i);return o.senderPublicKey?$r(o.senderPublicKey,Pr):void 0},this.core=e,this.logger=dt.generateChildLogger(r,this.name),this.keychain=n||new i7(this.core,this.logger)}get context(){return dt.getLoggerContext(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(og)}catch{e=Fu(),await this.keychain.set(og,e)}return SE(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ye("NOT_INITIALIZED",this.name);throw new Error(e)}}}class o7 extends B4{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=NE,this.version=LE,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=dt.generateChildLogger(e,this.name),this.core=r}get context(){return dt.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}=ye("NOT_INITIALIZED",this.name);throw new Error(e)}}}class a7 extends k4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new yr.exports.EventEmitter,this.name=UE,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||ME,f=Hu(o),h=o?.prompt||!1,v=o?.tag||0,y=o?.id||Tp().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(Cr.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=dt.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return dt.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(Fs.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Cr.connection_stalled);return}this.checkQueue()}),this.relayer.on(Cr.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class c7{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 l7=Object.defineProperty,u7=Object.defineProperties,h7=Object.getOwnPropertyDescriptors,ug=Object.getOwnPropertySymbols,f7=Object.prototype.hasOwnProperty,d7=Object.prototype.propertyIsEnumerable,hg=(t,e,r)=>e in t?l7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Jo=(t,e)=>{for(var r in e||(e={}))f7.call(e,r)&&hg(t,r,e[r]);if(ug)for(var r of ug(e))d7.call(e,r)&&hg(t,r,e[r]);return t},bh=(t,e)=>u7(t,h7(e));class p7 extends W4{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new c7,this.events=new yr.exports.EventEmitter,this.name=VE,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)>=GE&&(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=dt.generateChildLogger(r,this.name),this.clientId=""}get context(){return dt.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(Cr.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(Cr.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}=ye("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}=ye("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(Fs.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(Cr.connect,async()=>{await this.onConnect()}),this.relayer.on(Cr.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}=ye("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 g7=Object.defineProperty,fg=Object.getOwnPropertySymbols,m7=Object.prototype.hasOwnProperty,w7=Object.prototype.propertyIsEnumerable,dg=(t,e,r)=>e in t?g7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,v7=(t,e)=>{for(var r in e||(e={}))m7.call(e,r)&&dg(t,r,e[r]);if(fg)for(var r of fg(e))w7.call(e,r)&&dg(t,r,e[r]);return t};class y7 extends H4{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new yr.exports.EventEmitter,this.name=FE,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(Cr.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Cr.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"?dt.generateChildLogger(e.logger,this.name):dt.pino(dt.getDefaultLoggerOptions({level:e.logger||jE})),this.messages=new o7(this.logger,e.core),this.subscriber=new p7(this,this.logger),this.publisher=new a7(this,this.logger),this.relayUrl=e?.relayUrl||cg,this.projectId=e.projectId,this.bundleId=ub(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${lg}...`),await this.restartTransport(lg)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},zE)}get context(){return dt.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 J1())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 J_(mb({sdkVersion:HE,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(BE))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(v7({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(Cr.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Cr.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(Cr.connection_stalled,()=>{this.restartTransport().catch(r=>this.logger.error(r))});let e=await J1();c6(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(Cr.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(kE)))}isInitialized(){if(!this.initialized){const{message:e}=ye("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 b7=Object.defineProperty,pg=Object.getOwnPropertySymbols,_7=Object.prototype.hasOwnProperty,E7=Object.prototype.propertyIsEnumerable,gg=(t,e,r)=>e in t?b7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mg=(t,e)=>{for(var r in e||(e={}))_7.call(e,r)&&gg(t,r,e[r]);if(pg)for(var r of pg(e))E7.call(e,r)&&gg(t,r,e[r]);return t};class wc extends z4{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=WE,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):Fb(c)?this.map.set(c.id,c):Bb(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=>Q_(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=mg(mg({},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=dt.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=o}get context(){return dt.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}=ye("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}=ye("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}=ye("NOT_INITIALIZED",this.name);throw new Error(e)}}}class x7{constructor(e,r){this.core=e,this.logger=r,this.name=ZE,this.version=YE,this.events=new yr.exports,this.initialized=!1,this.storagePrefix=wi,this.ignoredPayloadTypes=[Vi],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=In(Te.FIVE_MINUTES),c={protocol:ag},l={topic:i,expiry:o,relay:c,active:!1},f=Db({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}=W1(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.`);const f=In(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),this.core.crypto.keychain.has(i)||(await this.core.crypto.setSymKey(o,i),await this.core.relayer.subscribe(i,{relay:c})),h},this.activate=async({topic:n})=>{this.isInitialized();const i=In(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}=Ms();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=Bs(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),{}):Cn(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=>{var i;if(!Wr(n)){const{message:c}=ye("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(c)}if(!jb(n.uri)){const{message:c}=ye("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(c)}const o=W1(n.uri);if(!((i=o?.relay)!=null&&i.protocol)){const{message:c}=ye("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(c)}if(!(o!=null&&o.symKey)){const{message:c}=ye("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(c)}},this.isValidPing=async n=>{if(!Wr(n)){const{message:o}=ye("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}=ye("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}=ye("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=ye("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}=ye("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=dt.generateChildLogger(r,this.name),this.pairings=new wc(this.core,this.logger,this.name,this.storagePrefix)}get context(){return dt.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ye("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Cr.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 I7 extends F4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new yr.exports.EventEmitter,this.name=JE,this.version=QE,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:In(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=Cn(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=dt.generateChildLogger(r,this.name)}get context(){return dt.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:Bs(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}=ye("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}=ye("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(Fs.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}=ye("NOT_INITIALIZED",this.name);throw new Error(e)}}}class C7 extends q4{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new yr.exports.EventEmitter,this.name=XE,this.version=e7,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=dt.generateChildLogger(r,this.name)}get context(){return dt.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 wb(e);if(typeof e=="number")return vb(e);const{message:r}=ye("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}=ye("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}=ye("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(Fs.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}=ye("NOT_INITIALIZED",this.name);throw new Error(e)}}}class S7 extends V4{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()||!Ls())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||ks;return t7.includes(i)||(this.logger.info(`verify url: ${i}, not included in trusted list, assigning default: ${ks}`),i=ks),i},this.logger=dt.generateChildLogger(r,this.name),this.verifyUrl=ks,this.abortController=new AbortController,this.isDevEnv=Bu()&&process.env.IS_VITEST}get context(){return dt.getLoggerContext(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),Te.toMiliseconds(e))}}class O7 extends K4{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=r7,this.registerDeviceToken=async n=>{const{clientId:i,token:o,notificationType:c,enableEncrypted:l=!1}=n,f=`${n7}/${this.projectId}/clients`;await t8(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:c,token:o,always_raw:l})})},this.logger=dt.generateChildLogger(r,this.context)}}var A7=Object.defineProperty,wg=Object.getOwnPropertySymbols,D7=Object.prototype.hasOwnProperty,$7=Object.prototype.propertyIsEnumerable,vg=(t,e,r)=>e in t?A7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yg=(t,e)=>{for(var r in e||(e={}))D7.call(e,r)&&vg(t,r,e[r]);if(wg)for(var r of wg(e))$7.call(e,r)&&vg(t,r,e[r]);return t};class _h extends j4{constructor(e){super(e),this.protocol=sg,this.version=OE,this.name=wh,this.events=new yr.exports.EventEmitter,this.initialized=!1,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||cg,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:dt.pino(dt.getDefaultLoggerOptions({level:e?.logger||AE.logger}));this.logger=dt.generateChildLogger(r,this.name),this.heartbeat=new Fs.HeartBeat,this.crypto=new s7(this,this.logger,e?.keychain),this.history=new I7(this,this.logger),this.expirer=new C7(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new H6(yg(yg({},DE),e?.storageOptions)),this.relayer=new y7({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new x7(this,this.logger),this.verify=new S7(this.projectId||"",this.logger),this.echoClient=new O7(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(qE,n),r}get context(){return dt.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 P7=_h,bg="wc",_g=2,Eg="client",Eh=`${bg}@${_g}:${Eg}:`,xh={name:Eg,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},xg="WALLETCONNECT_DEEPLINK_CHOICE",T7="proposal",Ig="Proposal expired",R7="session",vc=Te.SEVEN_DAYS,N7="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}}},Ih={min:Te.FIVE_MINUTES,max:Te.SEVEN_DAYS},Jn={idle:"IDLE",active:"ACTIVE"},L7="request",M7=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var U7=Object.defineProperty,j7=Object.defineProperties,F7=Object.getOwnPropertyDescriptors,Cg=Object.getOwnPropertySymbols,B7=Object.prototype.hasOwnProperty,k7=Object.prototype.propertyIsEnumerable,Sg=(t,e,r)=>e in t?U7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Vr=(t,e)=>{for(var r in e||(e={}))B7.call(e,r)&&Sg(t,r,e[r]);if(Cg)for(var r of Cg(e))k7.call(e,r)&&Sg(t,r,e[r]);return t},Xo=(t,e)=>j7(t,F7(e));class H7 extends Z4{constructor(e){super(e),this.name=N7,this.events=new yr.exports,this.initialized=!1,this.ignoredPayloadTypes=[Vi],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:ag}],proposer:{publicKey:b,metadata:this.client.metadata}},l&&{sessionProperties:l}),{reject:P,resolve:M,done:H}=Ms(Te.FIVE_MINUTES,Ig);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}=ye("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(L)}const V=await this.sendRequest({topic:h,method:"wc_sessionPropose",params:x}),T=In(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||"",js(v)||(v=Rb(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:In(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,In(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}=Ms();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}=Ms();return this.events.once(tr("session_extend",i),({error:f})=>{f?l(f):c()}),await this.setExpiry(n,In(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}=Ms(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 bb(this.client.core.storage,xg);yb({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}):Cn(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}=Ms();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=>Mb(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(o=>{var c,l;return((c=o.peerMetadata)==null?void 0:c.url)&&((l=o.peerMetadata)==null?void 0:l.url)===r.peer.metadata.url&&o.topic&&o.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(o=>this.client.core.pairing.disconnect({topic:o.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),this.client.session.delete(r,Yt("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(i.publicKey)&&await this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(xg).catch(o=>this.client.logger.warn(o))},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,Yt("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(o=>o.id!==r),i&&(this.sessionRequestQueue.state=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,In(n))},this.sendRequest=async r=>{const{topic:n,method:i,params:o,expiry:c,relayRpcId:l,clientRpcId:f,throwOnFailedPublish:h}=r,v=Bs(i,o,f);if(Ls()&&M7.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}=ye("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=In(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 Cn(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),{})):Cn(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),{}):Cn(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,In(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),{}):Cn(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),{}):Cn(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(Cr.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(Bs("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}):Cn(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,Bs("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id))},this.isValidConnect=async r=>{if(!Wr(r)){const{message:f}=ye("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),!Gb(l,!0)){const{message:f}=ye("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(f)}!Tr(i)&&js(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Tr(o)&&js(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),Tr(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=Kb(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Wr(r))throw new Error(ye("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=Z1(l.requiredNamespaces,i,"approve()");if(h)throw new Error(h.message);if(!dr(o,!0)){const{message:v}=ye("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}=ye("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(o)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!Yb(i)){const{message:o}=ye("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidSessionSettleRequest=r=>{if(!Wr(r)){const{message:h}=ye("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(h)}const{relay:n,controller:i,namespaces:o,expiry:c}=r;if(!K1(n)){const{message:h}=ye("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(h)}const l=kb(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}=ye("EXPIRED","onSessionSettleRequest()");throw new Error(h)}},this.isValidUpdate=async r=>{if(!Wr(r)){const{message:f}=ye("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=Z1(o.requiredNamespaces,i,"update()");if(l)throw new Error(l.message)},this.isValidExtend=async r=>{if(!Wr(r)){const{message:i}=ye("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}=ye("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(!G1(l,o)){const{message:f}=ye("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(f)}if(!Jb(i)){const{message:f}=ye("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(f)}if(!e6(l,o,i.method)){const{message:f}=ye("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(f)}if(c&&!i6(c,Ih)){const{message:f}=ye("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${Ih.min} and ${Ih.max}`);throw new Error(f)}},this.isValidRespond=async r=>{if(!Wr(r)){const{message:o}=ye("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!Qb(i)){const{message:o}=ye("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!Wr(r)){const{message:i}=ye("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}=ye("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(!G1(c,o)){const{message:l}=ye("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(l)}if(!Xb(i)){const{message:l}=ye("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}if(!t6(c,o,i.name)){const{message:l}=ye("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}},this.isValidDisconnect=async r=>{if(!Wr(r)){const{message:i}=ye("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||ks,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}=ye("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}=ye("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Cr.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,ye("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}=ye("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}=ye("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}=ye("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!dr(e,!1)){const{message:r}=ye("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=ye("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}=ye("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}=ye("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=ye("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!Zb(e)){const{message:r}=ye("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=ye("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}=ye("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class z7 extends wc{constructor(e,r){super(e,r,T7,Eh),this.core=e,this.logger=r}}class W7 extends wc{constructor(e,r){super(e,r,R7,Eh),this.core=e,this.logger=r}}class q7 extends wc{constructor(e,r){super(e,r,L7,Eh,n=>n.id),this.core=e,this.logger=r}}class Ch extends G4{constructor(e){super(e),this.protocol=bg,this.version=_g,this.name=xh.name,this.events=new yr.exports.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=e?.name||xh.name,this.metadata=e?.metadata||fb();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:dt.pino(dt.getDefaultLoggerOptions({level:e?.logger||xh.logger}));this.core=e?.core||new P7(e),this.logger=dt.generateChildLogger(r,this.name),this.session=new W7(this.core,this.logger),this.proposal=new z7(this.core,this.logger),this.pendingRequest=new q7(this.core,this.logger),this.engine=new H7(this)}static async init(e){const r=new Ch(e);return await r.initialize(),r}get context(){return dt.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 I(O,j){j=j||{};var ce=j.body;if(O instanceof I){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)}I.prototype.clone=function(){return new I(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(I.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 I(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=I,o.Response=ee),c.Headers=P,c.Request=I,c.Response=ee,c.fetch=me,Object.defineProperty(c,"__esModule",{value:!0}),c})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(Sh,Sh.exports);var Og=Sw(Sh.exports);const Ag={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},Dg=10;class vi{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new yr.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Np(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=Zi(e),o=await(await Og(this.url,Object.assign(Object.assign({},Ag),{body:n}))).json();this.onPayload({data:o})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Np(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=Zi({id:1,jsonrpc:"2.0",method:"test",params:[]});await Og(e,Object.assign(Object.assign({},Ag),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?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 Op(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Dg&&this.events.setMaxListeners(Dg)}}const $g="error",V7="wss://relay.walletconnect.com",K7="wc",G7="universal_provider",Pg=`${K7}@2:${G7}:`,Z7="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:{}};/**
|
|
60
60
|
* @license
|
|
61
61
|
* Lodash <https://lodash.com/>
|
|
62
62
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
63
63
|
* Released under MIT license <https://lodash.com/license>
|
|
64
64
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
65
65
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
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,`{
|
|
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,I=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",I]],be="[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,gs=/[&<>"']/g,zt=RegExp(Pi.source),Mt=RegExp(gs.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,lo=/($^)/,n0=/['\n\r\u2028\u2029\\]/g,uo="\\ud800-\\udfff",i0="\\u0300-\\u036f",s0="\\ufe20-\\ufe2f",ho="\\u20d0-\\u20ff",cl=i0+s0+ho,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",ms=o0+a0+c0+l0,Oa="['\u2019]",ws="["+uo+"]",Aa="["+ms+"]",vs="["+cl+"]",fl="\\d+",u0="["+ll+"]",dl="["+On+"]",pl="[^"+uo+ms+fl+ll+On+ul+"]",fo="\\ud83c[\\udffb-\\udfff]",h0="(?:"+vs+"|"+fo+")",gl="[^"+uo+"]",po="(?:\\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,po,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,go="(?:"+[u0,po,Ti].join("|")+")"+xl,d0="(?:"+[gl+vs+"?",vs,po,Ti,ws].join("|")+")",Da=RegExp(Oa,"g"),p0=RegExp(vs,"g"),mo=RegExp(fo+"(?="+fo+")|"+d0+xl,"g"),Il=RegExp([nn+"?"+dl+"+"+vl+"(?="+[Aa,nn,"$"].join("|")+")",kn+"+"+yl+"(?="+[Aa,nn+wl,"$"].join("|")+")",nn+"?"+wl+"+"+vl,nn+"+"+yl,El,si,fl,go].join("|"),"g"),Cl=RegExp("["+ml+uo+cl+hl+"]"),ys=/[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,It={};It[m]=It[D]=It[B]=It[G]=It[X]=It[Ee]=It[Re]=It[st]=It[ht]=!0,It[be]=It[Me]=It[E]=It[Y]=It[p]=It[W]=It[F]=It[we]=It[Ue]=It[nt]=It[Ge]=It[Je]=It[He]=It[ke]=It[je]=!1;var xt={};xt[be]=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={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ie={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ct=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,bs=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 MA(K,se,te,Ce){for(var Ye=-1,vt=K==null?0:K.length;++Ye<vt;){var hr=K[Ye];se(Ce,hr,te(hr),K)}return Ce}function mn(K,se){for(var te=-1,Ce=K==null?0:K.length;++te<Ce&&se(K[te],te,K)!==!1;);return K}function UA(K,se){for(var te=K==null?0:K.length;te--&&se(K[te],te,K)!==!1;);return K}function O3(K,se){for(var te=-1,Ce=K==null?0:K.length;++te<Ce;)if(!se(K[te],te,K))return!1;return!0}function Ri(K,se){for(var te=-1,Ce=K==null?0:K.length,Ye=0,vt=[];++te<Ce;){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&&wo(K,se,0)>-1}function m0(K,se,te){for(var Ce=-1,Ye=K==null?0:K.length;++Ce<Ye;)if(te(se,K[Ce]))return!0;return!1}function jt(K,se){for(var te=-1,Ce=K==null?0:K.length,Ye=Array(Ce);++te<Ce;)Ye[te]=se(K[te],te,K);return Ye}function Ni(K,se){for(var te=-1,Ce=se.length,Ye=K.length;++te<Ce;)K[Ye+te]=se[te];return K}function w0(K,se,te,Ce){var Ye=-1,vt=K==null?0:K.length;for(Ce&&vt&&(te=K[++Ye]);++Ye<vt;)te=se(te,K[Ye],Ye,K);return te}function jA(K,se,te,Ce){var Ye=K==null?0:K.length;for(Ce&&Ye&&(te=K[--Ye]);Ye--;)te=se(te,K[Ye],Ye,K);return te}function v0(K,se){for(var te=-1,Ce=K==null?0:K.length;++te<Ce;)if(se(K[te],te,K))return!0;return!1}var FA=y0("length");function BA(K){return K.split("")}function kA(K){return K.match(ar)||[]}function A3(K,se,te){var Ce;return te(K,function(Ye,vt,hr){if(se(Ye,vt,hr))return Ce=vt,!1}),Ce}function Al(K,se,te,Ce){for(var Ye=K.length,vt=te+(Ce?1:-1);Ce?vt--:++vt<Ye;)if(se(K[vt],vt,K))return vt;return-1}function wo(K,se,te){return se===se?XA(K,se,te):Al(K,D3,te)}function HA(K,se,te,Ce){for(var Ye=te-1,vt=K.length;++Ye<vt;)if(Ce(K[Ye],se))return Ye;return-1}function D3(K){return K!==K}function $3(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 P3(K,se,te,Ce,Ye){return Ye(K,function(vt,hr,Ot){te=Ce?(Ce=!1,vt):se(te,vt,hr,Ot)}),te}function zA(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,Ce=-1,Ye=K.length;++Ce<Ye;){var vt=se(K[Ce]);vt!==r&&(te=te===r?vt:te+vt)}return te}function E0(K,se){for(var te=-1,Ce=Array(K);++te<K;)Ce[te]=se(te);return Ce}function WA(K,se){return jt(se,function(te){return[te,K[te]]})}function T3(K){return K&&K.slice(0,M3(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 R3(K,se){for(var te=-1,Ce=K.length;++te<Ce&&wo(se,K[te],0)>-1;);return te}function N3(K,se){for(var te=K.length;te--&&wo(se,K[te],0)>-1;);return te}function qA(K,se){for(var te=K.length,Ce=0;te--;)K[te]===se&&++Ce;return Ce}var VA=b0(N),KA=b0(q);function GA(K){return"\\"+Ie[K]}function ZA(K,se){return K==null?r:K[se]}function vo(K){return Cl.test(K)}function YA(K){return ys.test(K)}function JA(K){for(var se,te=[];!(se=K.next()).done;)te.push(se.value);return te}function I0(K){var se=-1,te=Array(K.size);return K.forEach(function(Ce,Ye){te[++se]=[Ye,Ce]}),te}function L3(K,se){return function(te){return K(se(te))}}function Li(K,se){for(var te=-1,Ce=K.length,Ye=0,vt=[];++te<Ce;){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(Ce){te[++se]=Ce}),te}function QA(K){var se=-1,te=Array(K.size);return K.forEach(function(Ce){te[++se]=[Ce,Ce]}),te}function XA(K,se,te){for(var Ce=te-1,Ye=K.length;++Ce<Ye;)if(K[Ce]===se)return Ce;return-1}function eD(K,se,te){for(var Ce=te+1;Ce--;)if(K[Ce]===se)return Ce;return Ce}function yo(K){return vo(K)?rD(K):FA(K)}function Dn(K){return vo(K)?nD(K):BA(K)}function M3(K){for(var se=K.length;se--&&Jt.test(K.charAt(se)););return se}var tD=b0(fe);function rD(K){for(var se=mo.lastIndex=0;mo.test(K);)++se;return se}function nD(K){return K.match(mo)||[]}function iD(K){return K.match(Il)||[]}var sD=function K(se){se=se==null?mt:bo.defaults(mt.Object(),se,bo.pick(mt,Sl));var te=se.Array,Ce=se.Date,Ye=se.Error,vt=se.Function,hr=se.Math,Ot=se.Object,C0=se.RegExp,oD=se.String,wn=se.TypeError,$l=te.prototype,aD=vt.prototype,_o=Ot.prototype,Pl=se["__core-js_shared__"],Tl=aD.toString,bt=_o.hasOwnProperty,cD=0,U3=function(){var s=/[^.]+$/.exec(Pl&&Pl.keys&&Pl.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Rl=_o.toString,lD=Tl.call(Ot),uD=mt._,hD=C0("^"+Tl.call(bt).replace(Vt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nl=Gr?se.Buffer:r,Mi=se.Symbol,Ll=se.Uint8Array,j3=Nl?Nl.allocUnsafe:r,Ml=L3(Ot.getPrototypeOf,Ot),F3=Ot.create,B3=_o.propertyIsEnumerable,Ul=$l.splice,k3=Mi?Mi.isConcatSpreadable:r,Ta=Mi?Mi.iterator:r,_s=Mi?Mi.toStringTag:r,jl=function(){try{var s=Ss(Ot,"defineProperty");return s({},"",{}),s}catch{}}(),fD=se.clearTimeout!==mt.clearTimeout&&se.clearTimeout,dD=Ce&&Ce.now!==mt.Date.now&&Ce.now,pD=se.setTimeout!==mt.setTimeout&&se.setTimeout,Fl=hr.ceil,Bl=hr.floor,S0=Ot.getOwnPropertySymbols,gD=Nl?Nl.isBuffer:r,H3=se.isFinite,mD=$l.join,wD=L3(Ot.keys,Ot),fr=hr.max,Or=hr.min,vD=Ce.now,yD=se.parseInt,z3=hr.random,bD=$l.reverse,O0=Ss(se,"DataView"),Ra=Ss(se,"Map"),A0=Ss(se,"Promise"),Eo=Ss(se,"Set"),Na=Ss(se,"WeakMap"),La=Ss(Ot,"create"),kl=Na&&new Na,xo={},_D=Os(O0),ED=Os(Ra),xD=Os(A0),ID=Os(Eo),CD=Os(Na),Hl=Mi?Mi.prototype:r,Ma=Hl?Hl.valueOf:r,W3=Hl?Hl.toString:r;function C(s){if(Zt(s)&&!Xe(s)&&!(s instanceof pt)){if(s instanceof vn)return s;if(bt.call(s,"__wrapped__"))return q2(s)}return new vn(s)}var Io=function(){function s(){}return function(a){if(!kt(a))return{};if(F3)return F3(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}C.templateSettings={escape:Wt,evaluate:qt,interpolate:Bt,variable:"",imports:{_:C}},C.prototype=zl.prototype,C.prototype.constructor=C,vn.prototype=Io(zl.prototype),vn.prototype.constructor=vn;function pt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ie,this.__views__=[]}function SD(){var s=new pt(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 OD(){if(this.__filtered__){var s=new pt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function AD(){var s=this.__wrapped__.value(),a=this.__dir__,u=Xe(s),g=a<0,_=u?s.length:0,A=B$(0,_,this.__views__),U=A.start,k=A.end,Z=k-U,ue=g?k:U-1,he=this.__iteratees__,pe=he.length,_e=0,Pe=Or(Z,this.__takeCount__);if(!u||!g&&_==Z&&Pe==Z)return p2(s,this.__actions__);var We=[];e:for(;Z--&&_e<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[_e++]=qe}return We}pt.prototype=Io(zl.prototype),pt.prototype.constructor=pt;function Es(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 DD(){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 PD(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 TD(s){var a=this.__data__;return La?a[s]!==r:bt.call(a,s)}function RD(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=La&&a===r?f:a,this}Es.prototype.clear=DD,Es.prototype.delete=$D,Es.prototype.get=PD,Es.prototype.has=TD,Es.prototype.set=RD;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 ND(){this.__data__=[],this.size=0}function LD(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 MD(s){var a=this.__data__,u=Wl(a,s);return u<0?r:a[u][1]}function UD(s){return Wl(this.__data__,s)>-1}function jD(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=ND,oi.prototype.delete=LD,oi.prototype.get=MD,oi.prototype.has=UD,oi.prototype.set=jD;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 FD(){this.size=0,this.__data__={hash:new Es,map:new(Ra||oi),string:new Es}}function BD(s){var a=ru(this,s).delete(s);return this.size-=a?1:0,a}function kD(s){return ru(this,s).get(s)}function HD(s){return ru(this,s).has(s)}function zD(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=FD,ai.prototype.delete=BD,ai.prototype.get=kD,ai.prototype.has=HD,ai.prototype.set=zD;function xs(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new ai;++a<u;)this.add(s[a])}function WD(s){return this.__data__.set(s,f),this}function qD(s){return this.__data__.has(s)}xs.prototype.add=xs.prototype.push=WD,xs.prototype.has=qD;function $n(s){var a=this.__data__=new oi(s);this.size=a.size}function VD(){this.__data__=new oi,this.size=0}function KD(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function GD(s){return this.__data__.get(s)}function ZD(s){return this.__data__.has(s)}function YD(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=VD,$n.prototype.delete=KD,$n.prototype.get=GD,$n.prototype.has=ZD,$n.prototype.set=YD;function q3(s,a){var u=Xe(s),g=!u&&As(s),_=!u&&!g&&ki(s),A=!u&&!g&&!_&&Ao(s),U=u||g||_||A,k=U?E0(s.length,oD):[],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 V3(s){var a=s.length;return a?s[F0(0,a-1)]:r}function JD(s,a){return nu(Zr(s),Is(a,0,s.length))}function QD(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 XD(s,a,u,g){return Ui(s,function(_,A,U){a(g,_,u(_),U)}),g}function K3(s,a){return s&&Wn(a,vr(a),s)}function e$(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 Is(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=H$(s),!k)return Zr(s,U)}else{var pe=Ar(s),_e=pe==we||pe==ve;if(ki(s))return w2(s,k);if(pe==Ge||pe==be||_e&&!_){if(U=Z||_e?{}:M2(s),!k)return Z?P$(s,e$(U,s)):$$(s,K3(U,s))}else{if(!xt[pe])return _?s:{};U=z$(s,pe,k)}}A||(A=new $n);var Pe=A.get(s);if(Pe)return Pe;A.set(s,U),hw(s)?s.forEach(function(qe){U.add(yn(qe,a,u,qe,s,A))}):lw(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 t$(s){var a=vr(s);return function(u){return G3(u,s,a)}}function G3(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 Z3(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 xs(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 _e=ue;_e--;)if(a[_e]===pe)continue e;Z.push(he)}else A(a,pe,g)||Z.push(he)}return Z}var Ui=E2(zn),Y3=E2(T0,!0);function r$(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 n$(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:dw(g);u<g;)s[u++]=a;return s}function J3(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=q$),_||(_=[]);++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=x2(),Q3=x2(!0);function zn(s,a){return s&&P0(s,a,vr)}function T0(s,a){return s&&Q3(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 X3(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:_s&&_s in Ot(s)?F$(s):Q$(s)}function R0(s,a){return s>a}function i$(s,a){return s!=null&&bt.call(s,a)}function s$(s,a){return s!=null&&a in Ot(s)}function o$(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 xs(U&&he):r}he=s[0];var pe=-1,_e=k[0];e:for(;++pe<_&&ue.length<Z;){var Pe=he[pe],We=a?a(Pe):Pe;if(Pe=u||Pe!==0?Pe:0,!(_e?Pa(_e,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}_e&&_e.push(We),ue.push(Pe)}}return ue}function a$(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=B2(s,a);var g=s==null?s:s[qn(_n(a))];return g==null?r:wr(g,s,u)}function e2(s){return Zt(s)&&Br(s)==be}function c$(s){return Zt(s)&&Br(s)==E}function l$(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:u$(s,a,u,g,Ba,_)}function u$(s,a,u,g,_,A){var U=Xe(s),k=Xe(a),Z=U?Me:Ar(s),ue=k?Me:Ar(a);Z=Z==be?Ge:Z,ue=ue==be?Ge:ue;var he=Z==Ge,pe=ue==Ge,_e=Z==ue;if(_e&&ki(s)){if(!ki(a))return!1;U=!0,he=!1}if(_e&&!he)return A||(A=new $n),U||Ao(s)?R2(s,a,u,g,_,A):U$(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 _e?(A||(A=new $n),j$(s,a,u,g,_,A)):!1}function h$(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 _e=g(ue,he,Z,s,a,pe);if(!(_e===r?Ba(he,ue,P|M,g,pe):_e))return!1}}return!0}function t2(s){if(!kt(s)||K$(s))return!1;var a=fi(s)?hD:e0;return a.test(Os(s))}function f$(s){return Zt(s)&&Br(s)==Je}function d$(s){return Zt(s)&&Ar(s)==He}function p$(s){return Zt(s)&&lu(s.length)&&!!It[Br(s)]}function r2(s){return typeof s=="function"?s:s==null?Qr:typeof s=="object"?Xe(s)?s2(s[0],s[1]):i2(s):Iw(s)}function M0(s){if(!za(s))return wD(s);var a=[];for(var u in Ot(s))bt.call(s,u)&&u!="constructor"&&a.push(u);return a}function g$(s){if(!kt(s))return J$(s);var a=za(s),u=[];for(var g in s)g=="constructor"&&(a||!bt.call(s,g))||u.push(g);return u}function U0(s,a){return s<a}function n2(s,a){var u=-1,g=Yr(s)?te(s.length):[];return Ui(s,function(_,A,U){g[++u]=a(_,A,U)}),g}function i2(s){var a=Q0(s);return a.length==1&&a[0][2]?j2(a[0][0],a[0][1]):function(u){return u===s||L0(u,s,a)}}function s2(s,a){return ed(s)&&U2(a)?j2(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))m$(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 m$(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 _e=Xe(Z),Pe=!_e&&ki(Z),We=!_e&&!Pe&&Ao(Z);he=Z,_e||Pe||We?Xe(k)?he=k:Xt(k)?he=Zr(k):Pe?(pe=!1,he=w2(Z,!0)):We?(pe=!1,he=v2(Z,!0)):he=[]:qa(Z)||As(Z)?(he=k,As(k)?he=pw(k):(!kt(k)||fi(k))&&(he=M2(Z))):pe=!1}pe&&(U.set(Z,he),_(he,Z,g,A,U),U.delete(Z)),D0(s,u,he)}function o2(s,a){var u=s.length;if(u)return a+=a<0?u:0,hi(a,u)?s[a]:r}function a2(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 _=n2(s,function(A,U,k){var Z=jt(a,function(ue){return ue(A)});return{criteria:Z,index:++g,value:A}});return zA(_,function(A,U){return D$(A,U,u)})}function w$(s,a){return c2(s,a,function(u,g){return hd(s,g)})}function c2(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 v$(s){return function(a){return Cs(a,s)}}function j0(s,a,u,g){var _=g?HA:wo,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 l2(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(z3()*(a-s+1))}function y$(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(F2(s,a,Qr),s+"")}function b$(s){return V3(Do(s))}function _$(s,a){var u=Do(s);return nu(u,Is(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 u2=kl?function(s,a){return kl.set(s,a),s}:Qr,E$=jl?function(s,a){return jl(s,"toString",{configurable:!0,enumerable:!1,value:dd(a),writable:!0})}:Qr;function x$(s){return nu(Do(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 I$(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]),_e=pe!==r,Pe=pe===null,We=pe===pe,ot=an(pe);if(U)var qe=g||We;else ue?qe=We&&(g||_e):k?qe=We&&_e&&(g||!Pe):Z?qe=We&&_e&&!Pe&&(g||!ot):Pe||ot?qe=!1:qe=g?pe<=a:pe<a;qe?_=he+1:A=he}return Or(A,Ae)}function h2(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 f2(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 W3?W3.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:L$(s);if(ue)return Dl(ue);U=!1,_=Pa,Z=new xs}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 _e=Z.length;_e--;)if(Z[_e]===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=B2(s,a),s==null||delete s[qn(_n(a))]}function d2(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 p2(s,a){var u=s;return u instanceof pt&&(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 g2(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]:W2(yt(s))}var C$=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 m2=fD||function(s){return mt.clearTimeout(s)};function w2(s,a){if(a)return s.slice();var u=s.length,g=j3?j3(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 S$(s,a){var u=a?V0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function O$(s){var a=new s.constructor(s.source,pn.exec(s));return a.lastIndex=s.lastIndex,a}function A$(s){return Ma?Ot(Ma.call(s)):{}}function v2(s,a){var u=a?V0(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function y2(s,a){if(s!==a){var u=s!==r,g=s===null,_=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 D$(s,a,u){for(var g=-1,_=s.criteria,A=a.criteria,U=_.length,k=u.length;++g<U;){var Z=y2(_[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 b2(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 _2(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),_e=!g;++_<he;)pe[_]=s[_];for(var Pe=_;++Z<ue;)pe[Pe+Z]=a[Z];for(;++U<k;)(_e||_<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 P$(s,a){return Wn(s,N2(s),a)}function Yl(s,a){return function(u,g){var _=Xe(u)?MA:XD,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 E2(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 x2(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 T$(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 I2(s){return function(a){a=yt(a);var u=vo(a)?Dn(a):r,g=u?u[0]:a.charAt(0),_=u?Bi(u,1).join(""):a.slice(1);return g[s]()+_}}function So(s){return function(a){return w0(Ew(_w(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=Io(s.prototype),g=s.apply(u,a);return kt(g)?g:u}}function R$(s,a,u){var g=Ha(s);function _(){for(var A=arguments.length,U=te(A),k=A,Z=Oo(_);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 D2(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 C2(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 S2(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|I)&&!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,_e=u?a[pe].apply(this,ue):he;++pe<u;)_e=a[pe].call(this,_e);return _e}})}function Jl(s,a,u,g,_,A,U,k,Z,ue){var he=a&d,pe=a&H,_e=a&V,Pe=a&(L|$),We=a&J,ot=_e?r:Ha(s);function qe(){for(var ft=arguments.length,wt=te(ft),cn=ft;cn--;)wt[cn]=arguments[cn];if(Pe)var Hr=Oo(qe),ln=qA(wt,Hr);if(g&&(wt=b2(wt,g,_,Pe)),A&&(wt=_2(wt,A,U,Pe)),ft-=ln,Pe&&ft<ue){var er=Li(wt,Hr);return D2(s,a,Jl,qe.placeholder,u,wt,er,k,Z,ue-ft)}var Tn=pe?u:this,pi=_e?Tn[s]:s;return ft=wt.length,k?wt=X$(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 O2(s,a){return function(u,g){return a$(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=f2(u),g=f2(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/yo(a)));return vo(a)?Bi(Dn(g),0,s).join(""):g.slice(0,s)}function N$(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),_e=this&&this!==mt&&this instanceof U?A:s;++ue<he;)pe[ue]=g[ue];for(;Z--;)pe[ue++]=arguments[++k];return wr(_e,_?u:this,pe)}return U}function A2(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),y$(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 D2(s,a,u,g,_,A,U,k,Z,ue){var he=a&L,pe=he?U:r,_e=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,_e,k,Z,ue],qe=u.apply(r,ot);return td(s)&&k2(qe,ot),qe.placeholder=g,H2(qe,s,a)}function G0(s){var a=hr[s];return function(u,g){if(u=En(u),g=g==null?0:Or(it(g),292),g&&H3(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 L$=Eo&&1/Dl(new Eo([,-0]))[1]==le?function(s){return new Eo(s)}:md;function $2(s){return function(a){var u=Ar(a);return u==Ue?I0(a):u==He?QA(a):WA(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 _e=Z?r:J0(s),Pe=[s,a,u,g,_,he,pe,A,U,k];if(_e&&Y$(Pe,_e),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=T$(s,a,u);else a==L||a==$?We=R$(s,a,k):(a==R||a==(H|R))&&!_.length?We=N$(s,a,u,g):We=Jl.apply(r,Pe);var ot=_e?u2:k2;return H2(ot(We,Pe),s,a)}function P2(s,a,u,g){return s===r||Pn(s,_o[u])&&!bt.call(g,u)?a:s}function T2(s,a,u,g,_,A){return kt(s)&&kt(a)&&(A.set(a,s),Kl(s,a,r,T2,A),A.delete(a)),s}function M$(s){return qa(s)?r:s}function R2(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,_e=!0,Pe=u&M?new xs: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;_e=!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)})){_e=!1;break}}else if(!(We===ot||_(We,ot,u,g,A))){_e=!1;break}}return A.delete(s),A.delete(a),_e}function U$(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=I0;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=R2(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 j$(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 _e=k[pe];if(!(U?_e in a:bt.call(a,_e)))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;){_e=k[pe];var ft=s[_e],wt=a[_e];if(g)var cn=U?g(wt,ft,_e,a,s,A):g(ft,wt,_e,s,a,A);if(!(cn===r?ft===wt||_(ft,wt,u,g,A):cn)){ot=!1;break}qe||(qe=_e=="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(F2(s,r,G2),s+"")}function Z0(s){return X3(s,vr,X0)}function Y0(s){return X3(s,Jr,N2)}var J0=kl?function(s){return kl.get(s)}:md;function tu(s){for(var a=s.name+"",u=xo[a],g=bt.call(xo,a)?u.length:0;g--;){var _=u[g],A=_.func;if(A==null||A==s)return _.name}return a}function Oo(s){var a=bt.call(C,"placeholder")?C:s;return a.placeholder}function ze(){var s=C.iteratee||pd;return s=s===pd?r2:s,arguments.length?s(arguments[0],arguments[1]):s}function ru(s,a){var u=s.__data__;return V$(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,_,U2(_)]}return a}function Ss(s,a){var u=ZA(s,a);return t2(u)?u:r}function F$(s){var a=bt.call(s,_s),u=s[_s];try{s[_s]=r;var g=!0}catch{}var _=Rl.call(s);return g&&(a?s[_s]=u:delete s[_s]),_}var X0=S0?function(s){return s==null?[]:(s=Ot(s),Ri(S0(s),function(a){return B3.call(s,a)}))}:wd,N2=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||Eo&&Ar(new Eo)!=He||Na&&Ar(new Na)!=je)&&(Ar=function(s){var a=Br(s),u=a==Ge?s.constructor:r,g=u?Os(u):"";if(g)switch(g){case _D:return p;case ED:return Ue;case xD:return Dt;case ID:return He;case CD:return je}return a});function B$(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 k$(s){var a=s.match(Pt);return a?a[1].split(or):[]}function L2(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)||As(s)))}function H$(s){var a=s.length,u=new s.constructor(a);return a&&typeof s[0]=="string"&&bt.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function M2(s){return typeof s.constructor=="function"&&!za(s)?Io(Ml(s)):{}}function z$(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 S$(s,u);case m:case D:case B:case G:case X:case Ee:case Re:case st:case ht:return v2(s,u);case Ue:return new g;case nt:case ke:return new g(s);case Je:return O$(s);case He:return new g;case Ke:return A$(s)}}function W$(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
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(
|
|
68
|
+
`)}function q$(s){return Xe(s)||As(s)||!!(k3&&s&&s[k3])}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 V$(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=C[a];if(typeof u!="function"||!(a in pt.prototype))return!1;if(s===u)return!0;var g=J0(u);return!!g&&s===g[0]}function K$(s){return!!U3&&U3 in s}var G$=Pl?fi:vd;function za(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||_o;return s===u}function U2(s){return s===s&&!kt(s)}function j2(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==r||s in Ot(u))}}function Z$(s){var a=au(s,function(g){return u.size===h&&u.clear(),g}),u=a.cache;return a}function Y$(s,a){var u=s[1],g=a[1],_=u|g,A=_<(H|V|d),U=g==d&&u==L||g==d&&u==I&&s[7].length<=a[8]||g==(d|I)&&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?b2(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?_2(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 J$(s){var a=[];if(s!=null)for(var u in Ot(s))a.push(u);return a}function Q$(s){return Rl.call(s)}function F2(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 B2(s,a){return a.length<2?s:Cs(s,bn(a,0,-1))}function X$(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 k2=z2(u2),Wa=pD||function(s,a){return mt.setTimeout(s,a)},nd=z2(E$);function H2(s,a,u){var g=a+"";return nd(s,W$(g,eP(k$(g),u)))}function z2(s){var a=0,u=0;return function(){var g=vD(),_=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 W2=Z$(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 Os(s){if(s!=null){try{return Tl.call(s)}catch{}try{return s+""}catch{}}return""}function eP(s,a){return mn(Be,function(u){var g="_."+u[0];a&u[1]&&!Ol(s,g)&&s.push(g)}),s.sort()}function q2(s){if(s instanceof pt)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 tP(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 rP(s){for(var a=-1,u=s==null?0:s.length,g=0,_=[];++a<u;){var A=s[a];A&&(_[g++]=A)}return _}function nP(){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 iP=ct(function(s,a){return Xt(s)?ja(s,xr(a,1,Xt,!0)):[]}),sP=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)):[]}),oP=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 aP(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 cP(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 lP(s,a){return s&&s.length?Zl(s,ze(a,3),!0,!0):[]}function uP(s,a){return s&&s.length?Zl(s,ze(a,3),!0):[]}function hP(s,a,u,g){var _=s==null?0:s.length;return _?(u&&typeof u!="number"&&kr(s,a,u)&&(u=0,g=_),n$(s,a,u,g)):[]}function V2(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 K2(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 G2(s){var a=s==null?0:s.length;return a?xr(s,1):[]}function fP(s){var a=s==null?0:s.length;return a?xr(s,le):[]}function dP(s,a){var u=s==null?0:s.length;return u?(a=a===r?1:it(a),xr(s,a)):[]}function pP(s){for(var a=-1,u=s==null?0:s.length,g={};++a<u;){var _=s[a];g[_[0]]=_[1]}return g}function Z2(s){return s&&s.length?s[0]:r}function gP(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)),wo(s,a,_)}function mP(s){var a=s==null?0:s.length;return a?bn(s,0,-1):[]}var wP=ct(function(s){var a=jt(s,W0);return a.length&&a[0]===s[0]?N0(a):[]}),vP=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)):[]}),yP=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 bP(s,a){return s==null?"":mD.call(s,a)}function _n(s){var a=s==null?0:s.length;return a?s[a-1]:r}function _P(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?eD(s,a,_):Al(s,D3,_,!0)}function EP(s,a){return s&&s.length?o2(s,it(a)):r}var xP=ct(Y2);function Y2(s,a){return s&&s.length&&a&&a.length?j0(s,a):s}function IP(s,a,u){return s&&s.length&&a&&a.length?j0(s,a,ze(u,2)):s}function CP(s,a,u){return s&&s.length&&a&&a.length?j0(s,a,r,u):s}var SP=ui(function(s,a){var u=s==null?0:s.length,g=$0(s,a);return l2(s,jt(a,function(_){return hi(_,u)?+_:_}).sort(y2)),g});function OP(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 l2(s,_),u}function id(s){return s==null?s:bD.call(s)}function AP(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 DP(s,a){return Gl(s,a)}function $P(s,a,u){return k0(s,a,ze(u,2))}function PP(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 TP(s,a){return Gl(s,a,!0)}function RP(s,a,u){return k0(s,a,ze(u,2),!0)}function NP(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 LP(s){return s&&s.length?h2(s):[]}function MP(s,a){return s&&s.length?h2(s,ze(a,2)):[]}function UP(s){var a=s==null?0:s.length;return a?bn(s,1,a):[]}function jP(s,a,u){return s&&s.length?(a=u||a===r?1:it(a),bn(s,0,a<0?0:a)):[]}function FP(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 BP(s,a){return s&&s.length?Zl(s,ze(a,3),!1,!0):[]}function kP(s,a){return s&&s.length?Zl(s,ze(a,3)):[]}var HP=ct(function(s){return ji(xr(s,1,Xt,!0))}),zP=ct(function(s){var a=_n(s);return Xt(a)&&(a=r),ji(xr(s,1,Xt,!0),ze(a,2))}),WP=ct(function(s){var a=_n(s);return a=typeof a=="function"?a:r,ji(xr(s,1,Xt,!0),r,a)});function qP(s){return s&&s.length?ji(s):[]}function VP(s,a){return s&&s.length?ji(s,ze(a,2)):[]}function KP(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 J2(s,a){if(!(s&&s.length))return[];var u=sd(s);return a==null?u:jt(u,function(g){return wr(a,r,g)})}var GP=ct(function(s,a){return Xt(s)?ja(s,a):[]}),ZP=ct(function(s){return z0(Ri(s,Xt))}),YP=ct(function(s){var a=_n(s);return Xt(a)&&(a=r),z0(Ri(s,Xt),ze(a,2))}),JP=ct(function(s){var a=_n(s);return a=typeof a=="function"?a:r,z0(Ri(s,Xt),r,a)}),QP=ct(sd);function XP(s,a){return g2(s||[],a||[],Ua)}function eT(s,a){return g2(s||[],a||[],ka)}var tT=ct(function(s){var a=s.length,u=a>1?s[a-1]:r;return u=typeof u=="function"?(s.pop(),u):r,J2(s,u)});function Q2(s){var a=C(s);return a.__chain__=!0,a}function rT(s,a){return a(s),s}function iu(s,a){return a(s)}var nT=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 pt)||!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 iT(){return Q2(this)}function sT(){return new vn(this.value(),this.__chain__)}function oT(){this.__values__===r&&(this.__values__=fw(this.value()));var s=this.__index__>=this.__values__.length,a=s?r:this.__values__[this.__index__++];return{done:s,value:a}}function aT(){return this}function cT(s){for(var a,u=this;u instanceof zl;){var g=q2(u);g.__index__=0,g.__values__=r,a?_.__wrapped__=g:a=g;var _=g;u=u.__wrapped__}return _.__wrapped__=s,a}function lT(){var s=this.__wrapped__;if(s instanceof pt){var a=s;return this.__actions__.length&&(a=new pt(this)),a=a.reverse(),a.__actions__.push({func:iu,args:[id],thisArg:r}),new vn(a,this.__chain__)}return this.thru(id)}function uT(){return p2(this.__wrapped__,this.__actions__)}var hT=Yl(function(s,a,u){bt.call(s,u)?++s[u]:ci(s,u,1)});function fT(s,a,u){var g=Xe(s)?O3:r$;return u&&kr(s,a,u)&&(a=r),g(s,ze(a,3))}function dT(s,a){var u=Xe(s)?Ri:J3;return u(s,ze(a,3))}var pT=C2(V2),gT=C2(K2);function mT(s,a){return xr(su(s,a),1)}function wT(s,a){return xr(su(s,a),le)}function vT(s,a,u){return u=u===r?1:it(u),xr(su(s,a),u)}function X2(s,a){var u=Xe(s)?mn:Ui;return u(s,ze(a,3))}function ew(s,a){var u=Xe(s)?UA:Y3;return u(s,ze(a,3))}var yT=Yl(function(s,a,u){bt.call(s,u)?s[u].push(a):ci(s,u,[a])});function bT(s,a,u,g){s=Yr(s)?s:Do(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:!!_&&wo(s,a,u)>-1}var _T=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}),ET=Yl(function(s,a,u){ci(s,u,a)});function su(s,a){var u=Xe(s)?jt:n2;return u(s,ze(a,3))}function xT(s,a,u,g){return s==null?[]:(Xe(a)||(a=a==null?[]:[a]),u=g?r:u,Xe(u)||(u=u==null?[]:[u]),a2(s,a,u))}var IT=Yl(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function CT(s,a,u){var g=Xe(s)?w0:P3,_=arguments.length<3;return g(s,ze(a,4),u,_,Ui)}function ST(s,a,u){var g=Xe(s)?jA:P3,_=arguments.length<3;return g(s,ze(a,4),u,_,Y3)}function OT(s,a){var u=Xe(s)?Ri:J3;return u(s,cu(ze(a,3)))}function AT(s){var a=Xe(s)?V3:b$;return a(s)}function DT(s,a,u){(u?kr(s,a,u):a===r)?a=1:a=it(a);var g=Xe(s)?JD:_$;return g(s,a)}function $T(s){var a=Xe(s)?QD:x$;return a(s)}function PT(s){if(s==null)return 0;if(Yr(s))return uu(s)?yo(s):s.length;var a=Ar(s);return a==Ue||a==He?s.size:M0(s).length}function TT(s,a,u){var g=Xe(s)?v0:I$;return u&&kr(s,a,u)&&(a=r),g(s,ze(a,3))}var RT=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]]),a2(s,xr(a,1),[])}),ou=dD||function(){return mt.Date.now()};function NT(s,a){if(typeof a!="function")throw new wn(c);return s=it(s),function(){if(--s<1)return a.apply(this,arguments)}}function tw(s,a,u){return a=u?r:a,a=s&&a==null?s.length:a,li(s,d,r,r,r,r,a)}function rw(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,Oo(od));g|=R}return li(s,g,a,u,_)}),nw=ct(function(s,a,u){var g=H|V;if(u.length){var _=Li(u,Oo(nw));g|=R}return li(a,g,s,u,_)});function iw(s,a,u){a=u?r:a;var g=li(s,L,r,r,r,r,r,a);return g.placeholder=iw.placeholder,g}function sw(s,a,u){a=u?r:a;var g=li(s,$,r,r,r,r,r,a);return g.placeholder=sw.placeholder,g}function ow(s,a,u){var g,_,A,U,k,Z,ue=0,he=!1,pe=!1,_e=!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,_e="trailing"in u?!!u.trailing:_e);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,Cw=a-Tn;return pe?Or(Cw,A-pi):Cw}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,_e&&g?Pe(er):(g=_=r,U)}function cn(){k!==r&&m2(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 m2(k),k=Wa(ft,a),Pe(Z)}return k===r&&(k=Wa(ft,a)),U}return ln.cancel=cn,ln.flush=Hr,ln}var LT=ct(function(s,a){return Z3(s,1,a)}),MT=ct(function(s,a,u){return Z3(s,En(a)||0,u)});function UT(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 jT(s){return rw(2,s)}var FT=C$(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,Oo(ad));return li(s,R,r,a,u)}),aw=ct(function(s,a){var u=Li(a,Oo(aw));return li(s,S,r,a,u)}),BT=ui(function(s,a){return li(s,I,r,r,r,a)});function kT(s,a){if(typeof s!="function")throw new wn(c);return a=a===r?a:it(a),ct(s,a)}function HT(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 zT(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:_),ow(s,a,{leading:g,maxWait:a,trailing:_})}function WT(s){return tw(s,1)}function qT(s,a){return ad(q0(a),s)}function VT(){if(!arguments.length)return[];var s=arguments[0];return Xe(s)?s:[s]}function KT(s){return yn(s,x)}function GT(s,a){return a=typeof a=="function"?a:r,yn(s,x,a)}function ZT(s){return yn(s,y|x)}function YT(s,a){return a=typeof a=="function"?a:r,yn(s,y|x,a)}function JT(s,a){return a==null||G3(s,a,vr(a))}function Pn(s,a){return s===a||s!==s&&a!==a}var QT=eu(R0),XT=eu(function(s,a){return s>=a}),As=e2(function(){return arguments}())?e2:function(s){return Zt(s)&&bt.call(s,"callee")&&!B3.call(s,"callee")},Xe=te.isArray,eR=Fr?sn(Fr):c$;function Yr(s){return s!=null&&lu(s.length)&&!fi(s)}function Xt(s){return Zt(s)&&Yr(s)}function tR(s){return s===!0||s===!1||Zt(s)&&Br(s)==Y}var ki=gD||vd,rR=An?sn(An):l$;function nR(s){return Zt(s)&&s.nodeType===1&&!qa(s)}function iR(s){if(s==null)return!0;if(Yr(s)&&(Xe(s)||typeof s=="string"||typeof s.splice=="function"||ki(s)||Ao(s)||As(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 sR(s,a){return Ba(s,a)}function oR(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 aR(s){return typeof s=="number"&&H3(s)}function fi(s){if(!kt(s))return!1;var a=Br(s);return a==we||a==ve||a==Q||a==$t}function cw(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 lw=gn?sn(gn):h$;function cR(s,a){return s===a||L0(s,a,Q0(a))}function lR(s,a,u){return u=typeof u=="function"?u:r,L0(s,a,Q0(a),u)}function uR(s){return uw(s)&&s!=+s}function hR(s){if(G$(s))throw new Ye(o);return t2(s)}function fR(s){return s===null}function dR(s){return s==null}function uw(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)==lD}var ld=Hn?sn(Hn):f$;function pR(s){return cw(s)&&s>=-re&&s<=re}var hw=$a?sn($a):d$;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 Ao=bs?sn(bs):p$;function gR(s){return s===r}function mR(s){return Zt(s)&&Ar(s)==je}function wR(s){return Zt(s)&&Br(s)==Ze}var vR=eu(U0),yR=eu(function(s,a){return s<=a});function fw(s){if(!s)return[];if(Yr(s))return uu(s)?Dn(s):Zr(s);if(Ta&&s[Ta])return JA(s[Ta]());var a=Ar(s),u=a==Ue?I0:a==He?Dl:Do;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 dw(s){return s?Is(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=T3(s);var u=Xf.test(s);return u||t0.test(s)?Qe(s.slice(2),u?2:8):Qf.test(s)?ae:+s}function pw(s){return Wn(s,Jr(s))}function bR(s){return s?Is(it(s),-re,re):s===0?s:0}function yt(s){return s==null?"":on(s)}var _R=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])}),gw=Co(function(s,a){Wn(a,Jr(a),s)}),hu=Co(function(s,a,u,g){Wn(a,Jr(a),s,g)}),ER=Co(function(s,a,u,g){Wn(a,vr(a),s,g)}),xR=ui($0);function IR(s,a){var u=Io(s);return a==null?u:K3(u,a)}var CR=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,_o[ue])&&!bt.call(s,ue))&&(s[ue]=A[ue])}return s}),SR=ct(function(s){return s.push(r,T2),wr(mw,r,s)});function OR(s,a){return A3(s,ze(a,3),zn)}function AR(s,a){return A3(s,ze(a,3),T0)}function DR(s,a){return s==null?s:P0(s,ze(a,3),Jr)}function $R(s,a){return s==null?s:Q3(s,ze(a,3),Jr)}function PR(s,a){return s&&zn(s,ze(a,3))}function TR(s,a){return s&&T0(s,ze(a,3))}function RR(s){return s==null?[]:Vl(s,vr(s))}function NR(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 LR(s,a){return s!=null&&L2(s,a,i$)}function hd(s,a){return s!=null&&L2(s,a,s$)}var MR=O2(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=Rl.call(a)),s[a]=u},dd(Qr)),UR=O2(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),jR=ct(Fa);function vr(s){return Yr(s)?q3(s):M0(s)}function Jr(s){return Yr(s)?q3(s,!0):g$(s)}function FR(s,a){var u={};return a=ze(a,3),zn(s,function(g,_,A){ci(u,a(g,_,A),g)}),u}function BR(s,a){var u={};return a=ze(a,3),zn(s,function(g,_,A){ci(u,_,a(g,_,A))}),u}var kR=Co(function(s,a,u){Kl(s,a,u)}),mw=Co(function(s,a,u,g){Kl(s,a,u,g)}),HR=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,M$));for(var _=a.length;_--;)H0(u,a[_]);return u});function zR(s,a){return ww(s,cu(ze(a)))}var WR=ui(function(s,a){return s==null?{}:w$(s,a)});function ww(s,a){if(s==null)return{};var u=jt(Y0(s),function(g){return[g]});return a=ze(a),c2(s,u,function(g,_){return a(g,_[0])})}function qR(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 VR(s,a,u){return s==null?s:ka(s,a,u)}function KR(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:ka(s,a,u,g)}var vw=$2(vr),yw=$2(Jr);function GR(s,a,u){var g=Xe(s),_=g||ki(s)||Ao(s);if(a=ze(a,4),u==null){var A=s&&s.constructor;_?u=g?new A:[]:kt(s)?u=fi(A)?Io(Ml(s)):{}:u={}}return(_?mn:zn)(s,function(U,k,Z){return a(u,U,k,Z)}),u}function ZR(s,a){return s==null?!0:H0(s,a)}function YR(s,a,u){return s==null?s:d2(s,a,q0(u))}function JR(s,a,u,g){return g=typeof g=="function"?g:r,s==null?s:d2(s,a,q0(u),g)}function Do(s){return s==null?[]:x0(s,vr(s))}function QR(s){return s==null?[]:x0(s,Jr(s))}function XR(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),Is(En(s),a,u)}function eN(s,a,u){return a=di(a),u===r?(u=a,a=0):u=di(u),s=En(s),o$(s,a,u)}function tN(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 _=z3();return Or(s+_*(a-s+Ct("1e-"+((_+"").length-1))),a)}return F0(s,a)}var rN=So(function(s,a,u){return a=a.toLowerCase(),s+(u?bw(a):a)});function bw(s){return fd(yt(s).toLowerCase())}function _w(s){return s=yt(s),s&&s.replace(ii,VA).replace(p0,"")}function nN(s,a,u){s=yt(s),a=on(a);var g=s.length;u=u===r?g:Is(it(u),0,g);var _=u;return u-=a.length,u>=0&&s.slice(u,_)==a}function iN(s){return s=yt(s),s&&Mt.test(s)?s.replace(gs,KA):s}function sN(s){return s=yt(s),s&&sr.test(s)?s.replace(Vt,"\\$&"):s}var oN=So(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),aN=So(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),cN=I2("toLowerCase");function lN(s,a,u){s=yt(s),a=it(a);var g=a?yo(s):0;if(!a||g>=a)return s;var _=(a-g)/2;return Xl(Bl(_),u)+s+Xl(Fl(_),u)}function uN(s,a,u){s=yt(s),a=it(a);var g=a?yo(s):0;return a&&g<a?s+Xl(a-g,u):s}function hN(s,a,u){s=yt(s),a=it(a);var g=a?yo(s):0;return a&&g<a?Xl(a-g,u)+s:s}function fN(s,a,u){return u||a==null?a=0:a&&(a=+a),yD(yt(s).replace(Kt,""),a||0)}function dN(s,a,u){return(u?kr(s,a,u):a===r)?a=1:a=it(a),B0(yt(s),a)}function pN(){var s=arguments,a=yt(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var gN=So(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function mN(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&&vo(s))?Bi(Dn(s),0,u):s.split(a,u)):[]}var wN=So(function(s,a,u){return s+(u?" ":"")+fd(a)});function vN(s,a,u){return s=yt(s),u=u==null?0:Is(it(u),0,s.length),a=on(a),s.slice(u,u+a.length)==a}function yN(s,a,u){var g=C.templateSettings;u&&kr(s,a,u)&&(a=r),s=yt(s),a=hu({},a,g,P2);var _=hu({},a.imports,g.imports,P2),A=vr(_),U=x0(_,A),k,Z,ue=0,he=a.interpolate||lo,pe="__p += '",_e=C0((a.escape||lo).source+"|"+he.source+"|"+(he===Bt?Jf:lo).source+"|"+(a.evaluate||lo).source+"|$","g"),Pe="//# sourceURL="+(bt.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++g0+"]")+`
|
|
69
|
+
`;s.replace(_e,function(qe,ft,wt,cn,Hr,ln){return wt||(wt=cn),pe+=s.slice(ue,ln).replace(n0,GA),ft&&(k=!0,pe+=`' +
|
|
70
70
|
__e(`+ft+`) +
|
|
71
71
|
'`),Hr&&(Z=!0,pe+=`';
|
|
72
72
|
`+Hr+`;
|
|
@@ -82,30 +82,30 @@ __p += '`),wt&&(pe+=`' +
|
|
|
82
82
|
function print() { __p += __j.call(arguments, '') }
|
|
83
83
|
`:`;
|
|
84
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};/*!
|
|
85
|
+
}`;var ot=xw(function(){return vt(A,Pe+"return "+pe).apply(r,U)});if(ot.source=pe,cd(ot))throw ot;return ot}function bN(s){return yt(s).toLowerCase()}function _N(s){return yt(s).toUpperCase()}function EN(s,a,u){if(s=yt(s),s&&(u||a===r))return T3(s);if(!s||!(a=on(a)))return s;var g=Dn(s),_=Dn(a),A=R3(g,_),U=N3(g,_)+1;return Bi(g,A,U).join("")}function xN(s,a,u){if(s=yt(s),s&&(u||a===r))return s.slice(0,M3(s)+1);if(!s||!(a=on(a)))return s;var g=Dn(s),_=N3(g,Dn(a))+1;return Bi(g,0,_).join("")}function IN(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),_=R3(g,Dn(a));return Bi(g,_).join("")}function CN(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(vo(s)){var U=Dn(s);A=U.length}if(u>=A)return s;var k=u-yo(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||(_=C0(_.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 _e=Z.lastIndexOf(_);_e>-1&&(Z=Z.slice(0,_e))}return Z+g}function SN(s){return s=yt(s),s&&zt.test(s)?s.replace(Pi,tD):s}var ON=So(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),fd=I2("toUpperCase");function Ew(s,a,u){return s=yt(s),a=u?r:a,a===r?YA(s)?iD(s):kA(s):s.match(a)||[]}var xw=ct(function(s,a){try{return wr(s,r,a)}catch(u){return cd(u)?u:new Ye(u)}}),AN=ui(function(s,a){return mn(a,function(u){u=qn(u),ci(s,u,od(s[u],s))}),s});function DN(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 t$(yn(s,y))}function dd(s){return function(){return s}}function PN(s,a){return s==null||s!==s?a:s}var TN=S2(),RN=S2(!0);function Qr(s){return s}function pd(s){return r2(typeof s=="function"?s:yn(s,y))}function NN(s){return i2(yn(s,y))}function LN(s,a){return s2(s,yn(a,y))}var MN=ct(function(s,a){return function(u){return Fa(u,s,a)}}),UN=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 jN(){return mt._===this&&(mt._=uD),this}function md(){}function FN(s){return s=it(s),ct(function(a){return o2(a,s)})}var BN=K0(jt),kN=K0(O3),HN=K0(v0);function Iw(s){return ed(s)?y0(qn(s)):v$(s)}function zN(s){return function(a){return s==null?r:Cs(s,a)}}var WN=A2(),qN=A2(!0);function wd(){return[]}function vd(){return!1}function VN(){return{}}function KN(){return""}function GN(){return!0}function ZN(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 YN(s){return Xe(s)?jt(s,qn):an(s)?[s]:Zr(W2(yt(s)))}function JN(s){var a=++cD;return yt(s)+a}var QN=Ql(function(s,a){return s+a},0),XN=G0("ceil"),eL=Ql(function(s,a){return s/a},1),tL=G0("floor");function rL(s){return s&&s.length?ql(s,Qr,R0):r}function nL(s,a){return s&&s.length?ql(s,ze(a,2),R0):r}function iL(s){return $3(s,Qr)}function sL(s,a){return $3(s,ze(a,2))}function oL(s){return s&&s.length?ql(s,Qr,U0):r}function aL(s,a){return s&&s.length?ql(s,ze(a,2),U0):r}var cL=Ql(function(s,a){return s*a},1),lL=G0("round"),uL=Ql(function(s,a){return s-a},0);function hL(s){return s&&s.length?_0(s,Qr):0}function fL(s,a){return s&&s.length?_0(s,ze(a,2)):0}return C.after=NT,C.ary=tw,C.assign=_R,C.assignIn=gw,C.assignInWith=hu,C.assignWith=ER,C.at=xR,C.before=rw,C.bind=od,C.bindAll=AN,C.bindKey=nw,C.castArray=VT,C.chain=Q2,C.chunk=tP,C.compact=rP,C.concat=nP,C.cond=DN,C.conforms=$N,C.constant=dd,C.countBy=hT,C.create=IR,C.curry=iw,C.curryRight=sw,C.debounce=ow,C.defaults=CR,C.defaultsDeep=SR,C.defer=LT,C.delay=MT,C.difference=iP,C.differenceBy=sP,C.differenceWith=oP,C.drop=aP,C.dropRight=cP,C.dropRightWhile=lP,C.dropWhile=uP,C.fill=hP,C.filter=dT,C.flatMap=mT,C.flatMapDeep=wT,C.flatMapDepth=vT,C.flatten=G2,C.flattenDeep=fP,C.flattenDepth=dP,C.flip=UT,C.flow=TN,C.flowRight=RN,C.fromPairs=pP,C.functions=RR,C.functionsIn=NR,C.groupBy=yT,C.initial=mP,C.intersection=wP,C.intersectionBy=vP,C.intersectionWith=yP,C.invert=MR,C.invertBy=UR,C.invokeMap=_T,C.iteratee=pd,C.keyBy=ET,C.keys=vr,C.keysIn=Jr,C.map=su,C.mapKeys=FR,C.mapValues=BR,C.matches=NN,C.matchesProperty=LN,C.memoize=au,C.merge=kR,C.mergeWith=mw,C.method=MN,C.methodOf=UN,C.mixin=gd,C.negate=cu,C.nthArg=FN,C.omit=HR,C.omitBy=zR,C.once=jT,C.orderBy=xT,C.over=BN,C.overArgs=FT,C.overEvery=kN,C.overSome=HN,C.partial=ad,C.partialRight=aw,C.partition=IT,C.pick=WR,C.pickBy=ww,C.property=Iw,C.propertyOf=zN,C.pull=xP,C.pullAll=Y2,C.pullAllBy=IP,C.pullAllWith=CP,C.pullAt=SP,C.range=WN,C.rangeRight=qN,C.rearg=BT,C.reject=OT,C.remove=OP,C.rest=kT,C.reverse=id,C.sampleSize=DT,C.set=VR,C.setWith=KR,C.shuffle=$T,C.slice=AP,C.sortBy=RT,C.sortedUniq=LP,C.sortedUniqBy=MP,C.split=mN,C.spread=HT,C.tail=UP,C.take=jP,C.takeRight=FP,C.takeRightWhile=BP,C.takeWhile=kP,C.tap=rT,C.throttle=zT,C.thru=iu,C.toArray=fw,C.toPairs=vw,C.toPairsIn=yw,C.toPath=YN,C.toPlainObject=pw,C.transform=GR,C.unary=WT,C.union=HP,C.unionBy=zP,C.unionWith=WP,C.uniq=qP,C.uniqBy=VP,C.uniqWith=KP,C.unset=ZR,C.unzip=sd,C.unzipWith=J2,C.update=YR,C.updateWith=JR,C.values=Do,C.valuesIn=QR,C.without=GP,C.words=Ew,C.wrap=qT,C.xor=ZP,C.xorBy=YP,C.xorWith=JP,C.zip=QP,C.zipObject=XP,C.zipObjectDeep=eT,C.zipWith=tT,C.entries=vw,C.entriesIn=yw,C.extend=gw,C.extendWith=hu,gd(C,C),C.add=QN,C.attempt=xw,C.camelCase=rN,C.capitalize=bw,C.ceil=XN,C.clamp=XR,C.clone=KT,C.cloneDeep=ZT,C.cloneDeepWith=YT,C.cloneWith=GT,C.conformsTo=JT,C.deburr=_w,C.defaultTo=PN,C.divide=eL,C.endsWith=nN,C.eq=Pn,C.escape=iN,C.escapeRegExp=sN,C.every=fT,C.find=pT,C.findIndex=V2,C.findKey=OR,C.findLast=gT,C.findLastIndex=K2,C.findLastKey=AR,C.floor=tL,C.forEach=X2,C.forEachRight=ew,C.forIn=DR,C.forInRight=$R,C.forOwn=PR,C.forOwnRight=TR,C.get=ud,C.gt=QT,C.gte=XT,C.has=LR,C.hasIn=hd,C.head=Z2,C.identity=Qr,C.includes=bT,C.indexOf=gP,C.inRange=eN,C.invoke=jR,C.isArguments=As,C.isArray=Xe,C.isArrayBuffer=eR,C.isArrayLike=Yr,C.isArrayLikeObject=Xt,C.isBoolean=tR,C.isBuffer=ki,C.isDate=rR,C.isElement=nR,C.isEmpty=iR,C.isEqual=sR,C.isEqualWith=oR,C.isError=cd,C.isFinite=aR,C.isFunction=fi,C.isInteger=cw,C.isLength=lu,C.isMap=lw,C.isMatch=cR,C.isMatchWith=lR,C.isNaN=uR,C.isNative=hR,C.isNil=dR,C.isNull=fR,C.isNumber=uw,C.isObject=kt,C.isObjectLike=Zt,C.isPlainObject=qa,C.isRegExp=ld,C.isSafeInteger=pR,C.isSet=hw,C.isString=uu,C.isSymbol=an,C.isTypedArray=Ao,C.isUndefined=gR,C.isWeakMap=mR,C.isWeakSet=wR,C.join=bP,C.kebabCase=oN,C.last=_n,C.lastIndexOf=_P,C.lowerCase=aN,C.lowerFirst=cN,C.lt=vR,C.lte=yR,C.max=rL,C.maxBy=nL,C.mean=iL,C.meanBy=sL,C.min=oL,C.minBy=aL,C.stubArray=wd,C.stubFalse=vd,C.stubObject=VN,C.stubString=KN,C.stubTrue=GN,C.multiply=cL,C.nth=EP,C.noConflict=jN,C.noop=md,C.now=ou,C.pad=lN,C.padEnd=uN,C.padStart=hN,C.parseInt=fN,C.random=tN,C.reduce=CT,C.reduceRight=ST,C.repeat=dN,C.replace=pN,C.result=qR,C.round=lL,C.runInContext=K,C.sample=AT,C.size=PT,C.snakeCase=gN,C.some=TT,C.sortedIndex=DP,C.sortedIndexBy=$P,C.sortedIndexOf=PP,C.sortedLastIndex=TP,C.sortedLastIndexBy=RP,C.sortedLastIndexOf=NP,C.startCase=wN,C.startsWith=vN,C.subtract=uL,C.sum=hL,C.sumBy=fL,C.template=yN,C.times=ZN,C.toFinite=di,C.toInteger=it,C.toLength=dw,C.toLower=bN,C.toNumber=En,C.toSafeInteger=bR,C.toString=yt,C.toUpper=_N,C.trim=EN,C.trimEnd=xN,C.trimStart=IN,C.truncate=CN,C.unescape=SN,C.uniqueId=JN,C.upperCase=ON,C.upperFirst=fd,C.each=X2,C.eachRight=ew,C.first=Z2,gd(C,function(){var s={};return zn(C,function(a,u){bt.call(C.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),C.VERSION=n,mn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){C[s].placeholder=C}),mn(["drop","take"],function(s,a){pt.prototype[s]=function(u){u=u===r?1:fr(it(u),0);var g=this.__filtered__&&!a?new pt(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},pt.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;pt.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":"");pt.prototype[s]=function(){return this[u](1).value()[0]}}),mn(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");pt.prototype[s]=function(){return this.__filtered__?new pt(this):this[u](1)}}),pt.prototype.compact=function(){return this.filter(Qr)},pt.prototype.find=function(s){return this.filter(s).head()},pt.prototype.findLast=function(s){return this.reverse().find(s)},pt.prototype.invokeMap=ct(function(s,a){return typeof s=="function"?new pt(this):this.map(function(u){return Fa(u,s,a)})}),pt.prototype.reject=function(s){return this.filter(cu(ze(s)))},pt.prototype.slice=function(s,a){s=it(s);var u=this;return u.__filtered__&&(s>0||a<0)?new pt(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)},pt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},pt.prototype.toArray=function(){return this.take(ie)},zn(pt.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),g=/^(?:head|last)$/.test(a),_=C[g?"take"+(a=="last"?"Right":""):a],A=g||/^find/.test(a);_&&(C.prototype[a]=function(){var U=this.__wrapped__,k=g?[1]:arguments,Z=U instanceof pt,ue=k[0],he=Z||Xe(U),pe=function(ft){var wt=_.apply(C,Ni([ft],k));return g&&_e?wt[0]:wt};he&&u&&typeof ue=="function"&&ue.length!=1&&(Z=he=!1);var _e=this.__chain__,Pe=!!this.__actions__.length,We=A&&!_e,ot=Z&&!Pe;if(!A&&he){U=ot?U:new pt(this);var qe=s.apply(U,k);return qe.__actions__.push({func:iu,args:[pe],thisArg:r}),new vn(qe,_e)}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);C.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(pt.prototype,function(s,a){var u=C[a];if(u){var g=u.name+"";bt.call(xo,g)||(xo[g]=[]),xo[g].push({name:a,func:u})}}),xo[Jl(r,V).name]=[{name:"wrapper",func:r}],pt.prototype.clone=SD,pt.prototype.reverse=OD,pt.prototype.value=AD,C.prototype.at=nT,C.prototype.chain=iT,C.prototype.commit=sT,C.prototype.next=oT,C.prototype.plant=cT,C.prototype.reverse=lT,C.prototype.toJSON=C.prototype.valueOf=C.prototype.value=uT,C.prototype.first=C.prototype.head,Ta&&(C.prototype[Ta]=aT),C},bo=sD();Qt?((Qt.exports=bo)._=bo,St._=bo):mt._=bo}).call(ea)})(Oh,Oh.exports);var Y7=Object.defineProperty,J7=Object.defineProperties,Q7=Object.getOwnPropertyDescriptors,Tg=Object.getOwnPropertySymbols,X7=Object.prototype.hasOwnProperty,ex=Object.prototype.propertyIsEnumerable,Rg=(t,e,r)=>e in t?Y7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yc=(t,e)=>{for(var r in e||(e={}))X7.call(e,r)&&Rg(t,r,e[r]);if(Tg)for(var r of Tg(e))ex.call(e,r)&&Rg(t,r,e[r]);return t},tx=(t,e)=>J7(t,Q7(e));function yi(t,e,r){var n;const i=G5(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${Z7}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function Xi(t){return t.includes(":")?t.split(":")[1]:t}function Ng(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function rx(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 nx(t={},e={}){const r=Lg(t),n=Lg(e);return Oh.exports.merge(r,n)}function Lg(t){var e,r,n,i;const o={};if(!js(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]=tx(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 ix(t){return t.includes(":")?t.split(":")[2]:t}function sx(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:Ng(n.accounts);e[r]={chains:l,methods:i,events:o,accounts:c}}return e}function Ah(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):t.includes(":")?Number(t.split(":")[1]):Number(t)}const Mg={},Nt=t=>Mg[t],Dh=(t,e)=>{Mg[t]=e};class ox{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=Xi(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 ax{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(Xi(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 cx{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=Xi(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 lx{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=Xi(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 ux{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=Xi(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 hx{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=Xi(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 fx{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=Xi(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 dx{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 px=Object.defineProperty,gx=Object.defineProperties,mx=Object.getOwnPropertyDescriptors,Ug=Object.getOwnPropertySymbols,wx=Object.prototype.hasOwnProperty,vx=Object.prototype.propertyIsEnumerable,jg=(t,e,r)=>e in t?px(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bc=(t,e)=>{for(var r in e||(e={}))wx.call(e,r)&&jg(t,r,e[r]);if(Ug)for(var r of Ug(e))vx.call(e,r)&&jg(t,r,e[r]);return t},$h=(t,e)=>gx(t,mx(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:dt.pino(dt.getDefaultLoggerOptions({level:e?.logger||$g})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const r=new Ph(e);return await r.initialize(),r}async request(e,r){const[n,i]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request: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=sx(o.namespaces),this.persist("namespaces",this.namespaces))}).catch(o=>{if(o.message!==Ig)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 Ch.init({logger:this.providerOpts.logger||$g,relayUrl:this.providerOpts.relayUrl||V7,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=rx(r,this.session),i=Ng(n),o=nx(this.namespaces,this.optionalNamespaces),c=$h(bc({},o[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new ax({namespace:c});break;case"solana":this.rpcProviders[r]=new cx({namespace:c});break;case"cosmos":this.rpcProviders[r]=new lx({namespace:c});break;case"polkadot":this.rpcProviders[r]=new ox({namespace:c});break;case"cip34":this.rpcProviders[r]=new ux({namespace:c});break;case"elrond":this.rpcProviders[r]=new hx({namespace:c});break;case"multiversx":this.rpcProviders[r]=new fx({namespace:c});break;case"near":this.rpcProviders[r]=new dx({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(ix))}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(`${Pg}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${Pg}/${e}`)}}const yx=Ph,bx="wc",_x="ethereum_provider",Ex=`${bx}@2:${_x}:`,xx="https://rpc.walletconnect.com/v1/",_c=["eth_sendTransaction","personal_sign"],Fg=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],Ec=["chainChanged","accountsChanged"],Bg=["chainChanged","accountsChanged","message","disconnect","connect"];var Ix=Object.defineProperty,Cx=Object.defineProperties,Sx=Object.getOwnPropertyDescriptors,kg=Object.getOwnPropertySymbols,Ox=Object.prototype.hasOwnProperty,Ax=Object.prototype.propertyIsEnumerable,Hg=(t,e,r)=>e in t?Ix(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ta=(t,e)=>{for(var r in e||(e={}))Ox.call(e,r)&&Hg(t,r,e[r]);if(kg)for(var r of kg(e))Ax.call(e,r)&&Hg(t,r,e[r]);return t},zg=(t,e)=>Cx(t,Sx(e));function xc(t){return Number(t[0].split(":")[1])}function Th(t){return`0x${t.toString(16)}`}function Dx(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:Fg))],events:[...new Set(f.events.concat(c!=null&&c.length?c:Bg))],rpcMap:l};return{required:e.length?f:void 0,optional:r.length?b:void 0}}class Ic{constructor(){this.events=new yr.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Ex,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 Ic;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}=Dx(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(zg(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=Z5(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:Th(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",Th(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",zg(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 yx.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 o9});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])||`${xx}?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=Ic,Px=Symbol(),Wg=Object.getPrototypeOf,Rh=new WeakMap,Tx=t=>t&&(Rh.has(t)?Rh.get(t):Wg(t)===Object.prototype||Wg(t)===Array.prototype),Rx=t=>Tx(t)&&t[Px]||null,qg=(t,e=!0)=>{Rh.set(t,e)},Nh=t=>typeof t=="object"&&t!==null,bi=new WeakMap,Cc=new WeakSet,Nx=(t=Object.is,e=(h,v)=>new Proxy(h,v),r=h=>Nh(h)&&!Cc.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 qg(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(Cc.has(M))qg(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=Rx(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=!Cc.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 I=[R,M,o,$];return bi.set(d,I),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,Cc,t,e,r,n,i,o,c,l],[Lx]=Nx();function Mn(t={}){return Lx(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 Mx(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 Vg={},Sc={};Sc.byteLength=Fx,Sc.toByteArray=kx,Sc.fromByteArray=Wx;for(var Un=[],hn=[],Ux=typeof Uint8Array<"u"?Uint8Array:Array,Lh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hs=0,jx=Lh.length;Hs<jx;++Hs)Un[Hs]=Lh[Hs],hn[Lh.charCodeAt(Hs)]=Hs;hn["-".charCodeAt(0)]=62,hn["_".charCodeAt(0)]=63;function Kg(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Fx(t){var e=Kg(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Bx(t,e,r){return(e+r)*3/4-r}function kx(t){var e,r=Kg(t),n=r[0],i=r[1],o=new Ux(Bx(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 Hx(t){return Un[t>>18&63]+Un[t>>12&63]+Un[t>>6&63]+Un[t&63]}function zx(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(Hx(n));return i.join("")}function Wx(t){for(var e,r=t.length,n=r%3,i=[],o=16383,c=0,l=r-n;c<l;c+=o)i.push(zx(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
86
|
* The buffer module from node.js, for the browser.
|
|
87
87
|
*
|
|
88
88
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
89
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});/**
|
|
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 I(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 I(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 be(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||be(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||be(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")}})(Vg);let Uh;const Lt={ethereumClient:void 0,setEthereumClient(t){Uh=t},client(){if(Uh)return Uh;throw new Error("ClientCtrl has no client set")}},gr=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}},qx=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Sr=Mn({enabled:qx,userSessionId:"",events:[],connectedWalletId:void 0}),_i={state:Sr,subscribe(t){return Xn(Sr.events,()=>t(Mx(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 Vx=Object.defineProperty,Gg=Object.getOwnPropertySymbols,Kx=Object.prototype.hasOwnProperty,Gx=Object.prototype.propertyIsEnumerable,Zg=(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)&&Zg(t,r,e[r]);if(Gg)for(var r of Gg(e))Gx.call(e,r)&&Zg(t,r,e[r]);return t};const Yg=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}=Yg?await Ei.getMobileListings(l):await Ei.getDesktopListings(l);fn.recomendedWallets=Object.values(f)}return fn.recomendedWallets},async getWallets(t){const e=Zx({},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}=Yg?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}},zs=Mn({open:!1}),Lr={state:zs,subscribe(t){return Xn(zs,()=>t(zs))},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))zs.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),zs.open=!0,e())},200)}})},close(){zs.open=!1}};var Yx=Object.defineProperty,Jg=Object.getOwnPropertySymbols,Jx=Object.prototype.hasOwnProperty,Qx=Object.prototype.propertyIsEnumerable,Qg=(t,e,r)=>e in t?Yx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Xx=(t,e)=>{for(var r in e||(e={}))Jx.call(e,r)&&Qg(t,r,e[r]);if(Jg)for(var r of Jg(e))Qx.call(e,r)&&Qg(t,r,e[r]);return t};function e9(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const na=Mn({themeMode:e9()?"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=Xx({},r))}},es=Mn({open:!1,message:"",variant:"success"}),Kr={state:es,subscribe(t){return Xn(es,()=>t(es))},openToast(t,e){es.open=!0,es.message=t,es.variant=e},closeToast(){es.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=Vg.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}));var t9=Object.defineProperty,Xg=Object.getOwnPropertySymbols,r9=Object.prototype.hasOwnProperty,n9=Object.prototype.propertyIsEnumerable,em=(t,e,r)=>e in t?t9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,i9=(t,e)=>{for(var r in e||(e={}))r9.call(e,r)&&em(t,r,e[r]);if(Xg)for(var r of Xg(e))n9.call(e,r)&&em(t,r,e[r]);return t};class s9{constructor(e){this.openModal=Lr.open,this.closeModal=Lr.close,this.subscribeModal=Lr.subscribe,this.setTheme=jn.setThemeConfig,jn.setThemeConfig(e),Ft.setConfig(i9({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return LA});const e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),De.setIsUiLoaded(!0)}}}var o9=Object.freeze({__proto__:null,WalletConnectModal:s9});/**
|
|
91
91
|
* @license
|
|
92
92
|
* Copyright 2019 Google LLC
|
|
93
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(),
|
|
94
|
+
*/const Dc=window,Fh=Dc.ShadowRoot&&(Dc.ShadyCSS===void 0||Dc.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Bh=Symbol(),tm=new WeakMap;class rm{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=tm.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&tm.set(r,e))}return e}toString(){return this.cssText}}const a9=t=>new rm(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 rm(r,t,Bh)},c9=(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)})},nm=Fh?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return a9(r)})(t):t;/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2017 Google LLC
|
|
97
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
-
*/var kh;const $c=window,
|
|
98
|
+
*/var kh;const $c=window,im=$c.trustedTypes,l9=im?im.emptyScript:"",sm=$c.reactiveElementPolyfillSupport,Hh={toAttribute(t,e){switch(e){case Boolean:t=t?l9: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}},om=(t,e)=>e!==t&&(e==e||t==t),zh={attribute:!0,type:String,converter:Hh,reflect:!1,hasChanged:om};class Ws 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(nm(i))}else e!==void 0&&r.push(nm(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 c9(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||om)(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){}}Ws.finalized=!0,Ws.elementProperties=new Map,Ws.elementStyles=[],Ws.shadowRootOptions={mode:"open"},sm?.({ReactiveElement:Ws}),((kh=$c.reactiveElementVersions)!==null&&kh!==void 0?kh:$c.reactiveElementVersions=[]).push("1.6.1");/**
|
|
99
99
|
* @license
|
|
100
100
|
* Copyright 2017 Google LLC
|
|
101
101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/var Wh;const Pc=window,
|
|
103
|
-
\f\r]`,oa=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
104
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
102
|
+
*/var Wh;const Pc=window,qs=Pc.trustedTypes,am=qs?qs.createPolicy("lit-html",{createHTML:t=>t}):void 0,qh="$lit$",xi=`lit$${(Math.random()+"").slice(9)}$`,cm="?"+xi,u9=`<${cm}>`,ts=document,ia=()=>ts.createComment(""),sa=t=>t===null||typeof t!="object"&&typeof t!="function",lm=Array.isArray,h9=t=>lm(t)||typeof t?.[Symbol.iterator]=="function",Vh=`[
|
|
103
|
+
\f\r]`,oa=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,um=/-->/g,hm=/>/g,rs=RegExp(`>|${Vh}(?:([^\\s"'>=/]+)(${Vh}*=${Vh}*(?:[^
|
|
104
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),fm=/'/g,dm=/"/g,pm=/^(?:script|style|textarea|title)$/i,gm=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),oe=gm(1),ut=gm(2),ns=Symbol.for("lit-noChange"),mr=Symbol.for("lit-nothing"),mm=new WeakMap,is=ts.createTreeWalker(ts,129,null,!1),f9=(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=um:y[1]!==void 0?c=hm:y[2]!==void 0?(pm.test(y[2])&&(i=RegExp("</"+y[2],"g")),c=rs):y[3]!==void 0&&(c=rs):c===rs?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?rs:y[3]==='"'?dm:fm):c===dm||c===fm?c=rs:c===um||c===hm?c=oa:(c=rs,i=void 0);const P=c===rs&&t[f+1].startsWith("/>")?" ":"";o+=c===oa?h+u9: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[am!==void 0?am.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]=f9(e,r);if(this.el=aa.createElement(h,n),is.currentNode=this.el.content,r===2){const y=this.el.content,b=y.firstChild;b.remove(),y.append(...b.childNodes)}for(;(i=is.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]==="."?p9:M[1]==="?"?m9:M[1]==="@"?w9:Tc})}else f.push({type:6,index:o})}for(const b of y)i.removeAttribute(b)}if(pm.test(i.tagName)){const y=i.textContent.split(xi),b=y.length-1;if(b>0){i.textContent=qs?qs.emptyScript:"";for(let x=0;x<b;x++)i.append(y[x],ia()),is.nextNode(),f.push({type:2,index:++o});i.append(y[b],ia())}}}else if(i.nodeType===8)if(i.data===cm)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=ts.createElement("template");return n.innerHTML=e,n}}function Vs(t,e,r=t,n){var i,o,c,l;if(e===ns)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=Vs(t,f._$AS(t,e.values),f,n)),e}class d9{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:ts).importNode(n,!0);is.currentNode=o;let c=is.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 v9(c,this,e)),this._$AV.push(v),h=i[++f]}l!==h?.index&&(c=is.nextNode(),l++)}return is.currentNode=ts,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=Vs(this,e,r),sa(e)?e===mr||e==null||e===""?(this._$AH!==mr&&this._$AR(),this._$AH=mr):e!==this._$AH&&e!==ns&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):h9(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.$(ts.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 d9(o,this),l=c.u(this.options);c.v(n),this.$(l),this._$AH=c}}_$AC(e){let r=mm.get(e.strings);return r===void 0&&mm.set(e.strings,r=new aa(e)),r}T(e){lm(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=Vs(this,e,r,0),c=!sa(e)||e!==this._$AH&&e!==ns,c&&(this._$AH=e);else{const l=e;let f,h;for(e=o[0],f=0;f<o.length-1;f++)h=Vs(this,l[n+f],r,f),h===ns&&(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 p9 extends Tc{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===mr?void 0:e}}const g9=qs?qs.emptyScript:"";class m9 extends Tc{constructor(){super(...arguments),this.type=4}j(e){e&&e!==mr?this.element.setAttribute(this.name,g9):this.element.removeAttribute(this.name)}}class w9 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=Vs(this,e,r,0))!==null&&n!==void 0?n:mr)===ns)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 v9{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){Vs(this,e)}}const wm=Pc.litHtmlPolyfillSupport;wm?.(aa,ca),((Wh=Pc.litHtmlVersions)!==null&&Wh!==void 0?Wh:Pc.litHtmlVersions=[]).push("2.7.4");const y9=(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
105
|
* @license
|
|
106
106
|
* Copyright 2017 Google LLC
|
|
107
107
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
108
|
-
*/var Kh,Gh;class $e extends
|
|
108
|
+
*/var Kh,Gh;class $e extends Ws{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=y9(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 ns}}$e.finalized=!0,$e._$litElement$=!0,(Kh=globalThis.litElementHydrateSupport)===null||Kh===void 0||Kh.call(globalThis,{LitElement:$e});const vm=globalThis.litElementPolyfillSupport;vm?.({LitElement:$e}),((Gh=globalThis.litElementVersions)!==null&&Gh!==void 0?Gh:globalThis.litElementVersions=[]).push("3.3.2");/**
|
|
109
109
|
* @license
|
|
110
110
|
* Copyright 2017 Google LLC
|
|
111
111
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -113,7 +113,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
113
113
|
* @license
|
|
114
114
|
* Copyright 2017 Google LLC
|
|
115
115
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
116
|
-
*/const
|
|
116
|
+
*/const b9=(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):b9(t,e)}/**
|
|
117
117
|
* @license
|
|
118
118
|
* Copyright 2017 Google LLC
|
|
119
119
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -125,16 +125,16 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
125
125
|
* @license
|
|
126
126
|
* Copyright 2017 Google LLC
|
|
127
127
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
128
|
-
*/const
|
|
128
|
+
*/const _9={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},E9=t=>(...e)=>({_$litDirective$:t,values:e});class x9{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
129
|
* @license
|
|
130
130
|
* Copyright 2018 Google LLC
|
|
131
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}typeof SuppressedError=="function"&&SuppressedError;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(
|
|
134
|
-
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var
|
|
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"),
|
|
132
|
+
*/const Mr=E9(class extends x9{constructor(t){var e;if(super(t),t.type!==_9.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 ns}});function I9(t,e){t.indexOf(e)===-1&&t.push(e)}const ym=(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",Ks=t=>Array.isArray(t)&&!Rc(t[0]),C9=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t};function S9(t,e){return Ks(t)?t[C9(0,t.length,e)]:t}const bm=(t,e,r)=>-r*t+r*e+t,_m=()=>{},Ii=t=>t,Yh=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function Em(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Yh(0,e,n);t.push(bm(r,1,i))}}function O9(t){const e=[0];return Em(e,t-1),e}function A9(t,e=O9(t.length),r=Ii){const n=t.length,i=n-e.length;return i>0&&Em(e,i),o=>{let c=0;for(;c<n-2&&!(o<e[c+1]);c++);let l=ym(0,1,Yh(e[c],e[c+1],o));return l=S9(r,c)(l),bm(t[c],t[c+1],l)}}const xm=t=>Array.isArray(t)&&Rc(t[0]),Jh=t=>typeof t=="object"&&!!t.createAnimation,ss=t=>typeof t=="function",D9=t=>typeof t=="string",la={ms:t=>t*1e3,s:t=>t/1e3},Im=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,$9=1e-7,P9=12;function T9(t,e,r,n,i){let o,c,l=0;do c=e+(r-e)/2,o=Im(c,n,i)-t,o>0?r=c:e=c;while(Math.abs(o)>$9&&++l<P9);return c}function ua(t,e,r,n){if(t===e&&r===n)return Ii;const i=o=>T9(o,0,1,t,r);return o=>o===0||o===1?o:Im(i(o),e,n)}const R9=(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 ym(0,1,i/t)},Cm={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)},N9=/\((.*?)\)/;function Sm(t){if(ss(t))return t;if(xm(t))return ua(...t);if(Cm[t])return Cm[t];if(t.startsWith("steps")){const e=N9.exec(t);if(e){const r=e[1].split(",");return R9(parseFloat(r[0]),r[1].trim())}}return Ii}class Om{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=Ii,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=Ks(n)?Ii:Sm(n),this.updateDuration(i);const v=A9(r,f,Ks(n)?n.map(Sm):Ii);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 L9{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Xh=new WeakMap;function Am(t){return Xh.has(t)||Xh.set(t,{transforms:[],values:new Map}),Xh.get(t)}function M9(t,e){return t.has(e)||t.set(e,new L9),t.get(e)}const U9=["","X","Y","Z"],j9=["translate","scale","rotate","skew"],Nc={x:"translateX",y:"translateY",z:"translateZ"},Dm={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},F9={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:Dm,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:Ii},skew:Dm},ha=new Map,ef=t=>`--motion-${t}`,Lc=["x","y","z"];j9.forEach(t=>{U9.forEach(e=>{Lc.push(t+e),ha.set(ef(t+e),F9[t])})});const B9=(t,e)=>Lc.indexOf(t)-Lc.indexOf(e),k9=new Set(Lc),$m=t=>k9.has(t),H9=(t,e)=>{Nc[e]&&(e=Nc[e]);const{transforms:r}=Am(t);I9(r,e),t.style.transform=z9(r)},z9=t=>t.sort(B9).reduce(W9,"").trim(),W9=(t,e)=>`${t} ${e}(var(${ef(e)}))`,tf=t=>t.startsWith("--"),Pm=new Set;function q9(t){if(!Pm.has(t)){Pm.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),Tm={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={},Gs={};for(const t in Tm)Gs[t]=()=>(nf[t]===void 0&&(nf[t]=Tm[t]()),nf[t]);const V9=.015,K9=(t,e)=>{let r="";const n=Math.round(e/V9);for(let i=0;i<n;i++)r+=t(Yh(0,n-1,i))+", ";return r.substring(0,r.length-2)},Rm=(t,e)=>ss(t)?Gs.linearEasing()?`linear(${K9(t,e)})`:dn.easing:xm(t)?G9(t):t,G9=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`;function Z9(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const Y9=t=>Array.isArray(t)?t:[t];function sf(t){return Nc[t]&&(t=Nc[t]),$m(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 Nm(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function J9(t,e){var r;let n=e?.toDefaultUnit||Ii;const i=t[t.length-1];if(D9(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 Q9(){return window.__MOTION_DEV_TOOLS_RECORD}function X9(t,e,r,n={},i){const o=Q9(),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=Am(t),T=$m(e);let L=Gs.waapi();T&&H9(t,e);const $=sf(e),R=M9(V.values,$),S=ha.get($);return Nm(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 I=Z9(Y9(r),d);const J=J9(I,S);if(Jh(b)){const z=b.createAnimation(I,e!=="opacity",d,$,R);b=z.easing,I=z.keyframes||I,f=z.duration||f}if(tf($)&&(Gs.cssRegisterProperty()?q9($):L=!1),T&&!Gs.linearEasing()&&(ss(b)||Ks(b)&&b.some(ss))&&(L=!1),L){S&&(I=I.map(de=>Rc(de)?S.toDefaultUnit(de):de)),I.length===1&&(!Gs.partialKeyframes()||c)&&I.unshift(d());const z={delay:la.ms(h),duration:la.ms(f),endDelay:la.ms(v),easing:Ks(b)?void 0:Rm(b,f),direction:P,iterations:y+1,fill:"both"};l=t.animate({[$]:I,offset:M,easing:Ks(b)?b.map(de=>Rm(de,f)):void 0},z),l.finished||(l.finished=new Promise((de,me)=>{l.onfinish=de,l.oncancel=me}));const ee=I[I.length-1];l.finished.then(()=>{x||(Mc.set(t,$,ee),l.cancel())}).catch(_m),H||(l.playbackRate=1.000001)}else if(i&&T)I=I.map(z=>typeof z=="string"?parseFloat(z):z),I.length===1&&I.unshift(parseFloat(d())),l=new i(z=>{Mc.set(t,$,J?J(z):z)},I,Object.assign(Object.assign({},n),{duration:f,easing:b}));else{const z=I[I.length-1];Mc.set(t,$,S&&Rc(z)?S.toDefaultUnit(z):z)}return c&&o(t,e,I,{duration:f,delay:h,easing:b,repeat:y,offset:M},"motion-one"),R.setAnimation(l),l}}const eI=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function Lm(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 tI=t=>t(),Mm=(t,e,r=dn.duration)=>new Proxy({animations:t.map(tI).filter(Boolean),duration:r,options:e},nI),rI=t=>t.animations[0],nI={get:(t,e)=>{const r=rI(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(iI)).catch(_m)),t.finished;case"stop":return()=>{t.animations.forEach(n=>Nm(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}},iI=t=>t.finished;function sI(t,e,r){return ss(t)?t(e,r):t}function oI(t){return function(r,n,i={}){r=Lm(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=eI(i,h);v.delay=sI(v.delay,l,o);const y=X9(f,h,n[h],v,t);c.push(y)}}return Mm(c,i,i.duration)}}const aI=oI(Om);function cI(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}typeof SuppressedError=="function"&&SuppressedError;const lI={any:0,all:1};function uI(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=Lm(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);ss(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:lI[i]});return o.forEach(h=>f.observe(h)),()=>f.disconnect()}function of(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function Um(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const hI={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=cI(n,["once"]);return uI(t,c=>{if(e(),Um(t,"viewenter",c),!i)return l=>{r(),Um(t,"viewleave",l)}},o)}},jm=(t,e,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),of(t,e,n))};[...Object.keys({inView:hI,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const n=jm(t,"hoverstart",e),i=jm(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 fI(t,e={}){return Mm([()=>{const r=new Om(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function os(t,e,r){return(ss(t)?fI:aI)(t,e,r)}var fa={},dI=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Fm={},tn={};let af;const pI=[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 pI[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 Bm(){this.buffer=[],this.length=0}Bm.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 gI=Bm;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 mI=da,km={};(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}})(km);var Hm={};const wI=tn.getSymbolSize,zm=7;Hm.getPositions=function(e){const r=wI(e);return[[0,0],[r-zm,0],[0,r-zm]]};var Wm={};(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}})(Wm);var jc={};const Ci=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 Ci.L:return Fc[(e-1)*4+0];case Ci.M:return Fc[(e-1)*4+1];case Ci.Q:return Fc[(e-1)*4+2];case Ci.H:return Fc[(e-1)*4+3];default:return}},jc.getTotalCodewordsCount=function(e,r){switch(r){case Ci.L:return Bc[(e-1)*4+0];case Ci.M:return Bc[(e-1)*4+1];case Ci.Q:return Bc[(e-1)*4+2];case Ci.H:return Bc[(e-1)*4+3];default:return}};var qm={},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}}(qm);const Vm=qm;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=Vm.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=Vm.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 vI=cf,Km={},Si={},lf={};lf.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Fn={};const Gm="[0-9]+",yI="[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 bI="(?:(?![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(bI,"g"),Fn.NUMERIC=new RegExp(Gm,"g"),Fn.ALPHANUMERIC=new RegExp(yI,"g");const _I=new RegExp("^"+ga+"$"),EI=new RegExp("^"+Gm+"$"),xI=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Fn.testKanji=function(e){return _I.test(e)},Fn.testNumeric=function(e){return EI.test(e)},Fn.testAlphanumeric=function(e){return xI.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}}(Km);var Zm={};const uf=tn,Ym=1335,II=21522,Jm=uf.getBCHDigit(Ym);Zm.getEncodedBits=function(e,r){const n=e.bit<<3|r;let i=n<<10;for(;uf.getBCHDigit(i)-Jm>=0;)i^=Ym<<uf.getBCHDigit(i)-Jm;return(n<<10|i)^II};var Qm={};const CI=Si;function Zs(t){this.mode=CI.NUMERIC,this.data=t.toString()}Zs.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Zs.prototype.getLength=function(){return this.data.length},Zs.prototype.getBitsLength=function(){return Zs.getBitsLength(this.data.length)},Zs.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);const o=this.data.length-r;o>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,o*3+1))};var SI=Zs;const OI=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 Ys(t){this.mode=OI.ALPHANUMERIC,this.data=t}Ys.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},Ys.prototype.getLength=function(){return this.data.length},Ys.prototype.getBitsLength=function(){return Ys.getBitsLength(this.data.length)},Ys.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 AI=Ys,DI=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 $I=DI,PI=Si;function Js(t){this.mode=PI.BYTE,typeof t=="string"&&(t=$I(t)),this.data=new Uint8Array(t)}Js.getBitsLength=function(e){return e*8},Js.prototype.getLength=function(){return this.data.length},Js.prototype.getBitsLength=function(){return Js.getBitsLength(this.data.length)},Js.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var TI=Js;const RI=Si,NI=tn;function Qs(t){this.mode=RI.KANJI,this.data=t}Qs.getBitsLength=function(e){return e*13},Qs.prototype.getLength=function(){return this.data.length},Qs.prototype.getBitsLength=function(){return Qs.getBitsLength(this.data.length)},Qs.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=NI.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 LI=Qs,Xm={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})(Xm),function(t){const e=Si,r=SI,n=AI,i=TI,o=LI,c=Fn,l=tn,f=Xm.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,I){return d.index-I.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],I=[];for(let J=0;J<d.length;J++){const z=d[J],ee=""+S+J;I.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=I}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"),I=[];for(let J=1;J<d.length-1;J++)I.push(S.table[d[J]].node);return t.fromArray(x(I))},t.rawSplit=function(T){return t.fromArray(y(T,l.isKanjiModeEnabled()))}}(Qm);const zc=tn,ff=Uc,MI=gI,UI=mI,jI=km,FI=Hm,df=Wm,pf=jc,BI=vI,Wc=Km,kI=Zm,HI=Si,gf=Qm;function zI(t,e){const r=t.size,n=FI.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 WI(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 qI(t,e){const r=jI.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 VI(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=kI.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 KI(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 GI(t,e,r){const n=new MI;r.forEach(function(f){n.put(f.mode.bit,4),n.put(f.getLength(),HI.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 ZI(n,t,e)}function ZI(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 BI(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 I=d<f?v:y;M[d]=T.slice(P,P+I),H[d]=x.encode(M[d]),P+=I,V=Math.max(V,I)}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 YI(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
136
|
The chosen QR Code version cannot contain this amount of data.
|
|
137
137
|
Minimum version required to store current data is: `+o+`.
|
|
138
|
-
`);const c=
|
|
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})});
|
|
138
|
+
`);const c=GI(e,r,i),l=zc.getSymbolSize(e),f=new UI(l);return zI(f,e),WI(f),qI(f,e),mf(f,r,0),e>=7&&VI(f,e),KI(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}}Fm.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)),YI(e,i,n,o)};var e3={},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)}}(e3);var t3={};const JI=wf;function r3(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 QI(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}t3.render=function(e,r,n){const i=JI.getOptions(r),o=e.modules.size,c=e.modules.data,l=o+i.margin*2,f=i.color.light.a?"<path "+r3(i.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",h="<path "+r3(i.color.dark,"stroke")+' d="'+QI(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 XI=dI,yf=Fm,n3=e3,eC=t3;function bf(t,e,r,n,i){const o=[].slice.call(arguments,1),c=o.length,l=typeof o[c-1]=="function";if(!l&&!XI())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,n3.render),fa.toDataURL=bf.bind(null,n3.renderToDataURL),fa.toString=bf.bind(null,function(t,e,r){return eC.render(t,r)});var tC=Object.defineProperty,i3=Object.getOwnPropertySymbols,rC=Object.prototype.hasOwnProperty,nC=Object.prototype.propertyIsEnumerable,s3=(t,e,r)=>e in t?tC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qc=(t,e)=>{for(var r in e||(e={}))rC.call(e,r)&&s3(t,r,e[r]);if(i3)for(var r of i3(e))nC.call(e,r)&&s3(t,r,e[r]);return t};function iC(){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 o3(){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 sC(){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 o3()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=jn.state;if(t){const r=qc(qc(qc(qc({},iC()),o3()),e),sC());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)}`},oC=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 aC=Object.defineProperty,cC=Object.getOwnPropertyDescriptor,Vc=(t,e,r,n)=>{for(var i=n>1?void 0:n?cC(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&&aC(e,r,i),i};let Xs=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>`}};Xs.styles=[Fe.globalCss,oC],Vc([Oe()],Xs.prototype,"icon",2),Vc([Oe()],Xs.prototype,"label",2),Vc([Oe()],Xs.prototype,"onClick",2),Xs=Vc([Ne("w3m-box-button")],Xs);const lC=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 uC=Object.defineProperty,hC=Object.getOwnPropertyDescriptor,eo=(t,e,r,n)=>{for(var i=n>1?void 0:n?hC(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&&uC(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,lC],eo([Oe()],Oi.prototype,"disabled",2),eo([Oe()],Oi.prototype,"iconLeft",2),eo([Oe()],Oi.prototype,"iconRight",2),eo([Oe()],Oi.prototype,"onClick",2),eo([Oe()],Oi.prototype,"variant",2),Oi=eo([Ne("w3m-button")],Oi);const fC=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 dC=Object.defineProperty,pC=Object.getOwnPropertyDescriptor,_f=(t,e,r,n)=>{for(var i=n>1?void 0:n?pC(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&&dC(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,fC],_f([Oe()],ma.prototype,"disabled",2),_f([Oe()],ma.prototype,"variant",2),ma=_f([Ne("w3m-button-big")],ma);const gC=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 mC=Object.defineProperty,wC=Object.getOwnPropertyDescriptor,vC=(t,e,r,n)=>{for(var i=n>1?void 0:n?wC(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&&mC(e,r,i),i};let Ef=class extends $e{render(){return oe`<div><slot></slot></div>`}};Ef.styles=[Fe.globalCss,gC],Ef=vC([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>`},yC=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 bC=Object.defineProperty,_C=Object.getOwnPropertyDescriptor,a3=(t,e,r,n)=>{for(var i=n>1?void 0:n?_C(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&&bC(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,yC],a3([gt()],Kc.prototype,"isHelp",2),Kc=a3([Ne("w3m-modal-backcard")],Kc);const EC=Ve`main{padding:20px;padding-top:0;width:100%}`;var xC=Object.defineProperty,IC=Object.getOwnPropertyDescriptor,CC=(t,e,r,n)=>{for(var i=n>1?void 0:n?IC(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&&xC(e,r,i),i};let xf=class extends $e{render(){return oe`<main><slot></slot></main>`}};xf.styles=[Fe.globalCss,EC],xf=CC([Ne("w3m-modal-content")],xf);const SC=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 OC=Object.defineProperty,AC=Object.getOwnPropertyDescriptor,DC=(t,e,r,n)=>{for(var i=n>1?void 0:n?AC(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&&OC(e,r,i),i};let If=class extends $e{render(){return oe`<footer><slot></slot></footer>`}};If.styles=[Fe.globalCss,SC],If=DC([Ne("w3m-modal-footer")],If);const $C=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 PC=Object.defineProperty,TC=Object.getOwnPropertyDescriptor,wa=(t,e,r,n)=>{for(var i=n>1?void 0:n?TC(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&&PC(e,r,i),i};let as=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>`}};as.styles=[Fe.globalCss,$C],wa([Oe()],as.prototype,"title",2),wa([Oe()],as.prototype,"onAction",2),wa([Oe()],as.prototype,"actionIcon",2),wa([Oe()],as.prototype,"border",2),as=wa([Ne("w3m-modal-header")],as);const RC={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"},NC={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=RC[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=NC[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")}},LC=Ve`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`;var MC=Object.defineProperty,UC=Object.getOwnPropertyDescriptor,Cf=(t,e,r,n)=>{for(var i=n>1?void 0:n?UC(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&&MC(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"&&os(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 os(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=tt.state.view,os(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,LC],Cf([gt()],va.prototype,"view",2),Cf([gt()],va.prototype,"prevView",2),va=Cf([Ne("w3m-modal-router")],va);const jC=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 FC=Object.defineProperty,BC=Object.getOwnPropertyDescriptor,c3=(t,e,r,n)=>{for(var i=n>1?void 0:n?BC(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&&FC(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,jC],c3([gt()],Gc.prototype,"open",2),Gc=c3([Ne("w3m-modal-toast")],Gc);const kC=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 HC=Object.defineProperty,zC=Object.getOwnPropertyDescriptor,ya=(t,e,r,n)=>{for(var i=n>1?void 0:n?zC(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&&HC(e,r,i),i};let cs=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>`}};cs.styles=[Fe.globalCss,kC],ya([Oe()],cs.prototype,"onClick",2),ya([Oe()],cs.prototype,"name",2),ya([Oe()],cs.prototype,"chainId",2),ya([Oe()],cs.prototype,"unsupported",2),cs=ya([Ne("w3m-network-button")],cs);const WC=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 qC=Object.defineProperty,VC=Object.getOwnPropertyDescriptor,l3=(t,e,r,n)=>{for(var i=n>1?void 0:n?VC(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 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,WC],l3([Oe()],Zc.prototype,"chainId",2),Zc=l3([Ne("w3m-network-image")],Zc);const KC=.1,u3=2.5,ei=7;function Sf(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+KC}function GC(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 ZC={generate(t,e,r,n){const i=n==="light"?"#141414":"#fff",o=n==="light"?"#fff":"#141414",c=[],l=GC(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/u3}">`)})}),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/(u3/2)}" stroke-linecap="round">`)})}),c}},YC=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 JC=Object.defineProperty,QC=Object.getOwnPropertyDescriptor,to=(t,e,r,n)=>{for(var i=n>1?void 0:n?QC(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&&JC(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}">${ZC.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,YC],to([Oe()],ti.prototype,"uri",2),to([Oe({type:Number})],ti.prototype,"size",2),to([Oe()],ti.prototype,"imageId",2),to([Oe()],ti.prototype,"walletId",2),to([Oe()],ti.prototype,"imageUrl",2),ti=to([Ne("w3m-qrcode")],ti);const XC=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 eS=Object.defineProperty,tS=Object.getOwnPropertyDescriptor,h3=(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&&eS(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,XC],h3([Oe()],Yc.prototype,"onChange",2),Yc=h3([Ne("w3m-search-input")],Yc);const rS=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 nS=Object.defineProperty,iS=Object.getOwnPropertyDescriptor,sS=(t,e,r,n)=>{for(var i=n>1?void 0:n?iS(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 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,rS],Of=sS([Ne("w3m-spinner")],Of);const oS=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 aS=Object.defineProperty,cS=Object.getOwnPropertyDescriptor,Af=(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 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,oS],Af([Oe()],ba.prototype,"variant",2),Af([Oe()],ba.prototype,"color",2),ba=Af([Ne("w3m-text")],ba);const lS=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 uS=Object.defineProperty,hS=Object.getOwnPropertyDescriptor,f3=(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&&uS(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,lS],f3([Oe()],Jc.prototype,"symbol",2),Jc=f3([Ne("w3m-token-image")],Jc);const fS=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 dS=Object.defineProperty,pS=Object.getOwnPropertyDescriptor,Ai=(t,e,r,n)=>{for(var i=n>1?void 0:n?pS(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&&dS(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,fS],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 gS=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 mS=Object.defineProperty,wS=Object.getOwnPropertyDescriptor,Qc=(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 ro=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}`}};ro.styles=[Fe.globalCss,gS],Qc([Oe()],ro.prototype,"walletId",2),Qc([Oe()],ro.prototype,"imageId",2),Qc([Oe()],ro.prototype,"imageUrl",2),ro=Qc([Ne("w3m-wallet-image")],ro);var vS=Object.defineProperty,yS=Object.getOwnPropertyDescriptor,bS=(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&&vS(e,r,i),i};let d3=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")}}};d3=bS([Ne("w3m-account-context")],d3);var _S=Object.defineProperty,ES=Object.getOwnPropertyDescriptor,p3=(t,e,r,n)=>{for(var i=n>1?void 0:n?ES(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&&_S(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")}}};p3([gt()],Df.prototype,"preload",2),Df=p3([Ne("w3m-explorer-context")],Df);var xS=Object.defineProperty,IS=Object.getOwnPropertyDescriptor,g3=(t,e,r,n)=>{for(var i=n>1?void 0:n?IS(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&&xS(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")}}};g3([gt()],$f.prototype,"activeChainId",2),$f=g3([Ne("w3m-network-context")],$f);var CS=Object.defineProperty,SS=Object.getOwnPropertyDescriptor,OS=(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&&CS(e,r,i),i};let m3=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")}}};m3=OS([Ne("w3m-theme-context")],m3);var AS=Object.defineProperty,DS=Object.getOwnPropertyDescriptor,$S=(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};const PS=24e4,TS=1e3;var w3;let v3=class extends $e{constructor(){super(),this.unwatchOptions=void 0,this.unwatchAccount=void 0,this.timeout=void 0,this.isGenerated=!1,this.selectedChainId=(w3=De.state.selectedChain)==null?void 0:w3.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),PS);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>=TS&&(this.lastRetry=Date.now(),this.connectAndWait())}}}};v3=$S([Ne("w3m-wc-connection-context")],v3);const RS=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 NS=Object.defineProperty,LS=Object.getOwnPropertyDescriptor,Pf=(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 no=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>`}};no.styles=[Fe.globalCss,RS],Pf([Oe()],no.prototype,"balance",2),Pf([Oe()],no.prototype,"avatar",2),no=Pf([Ne("w3m-account-button")],no);const MS=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 US=Object.defineProperty,jS=Object.getOwnPropertyDescriptor,Tf=(t,e,r,n)=>{for(var i=n>1?void 0:n?jS(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&&US(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,MS],Tf([gt()],_a.prototype,"chainId",2),Tf([gt()],_a.prototype,"label",2),_a=Tf([Ne("w3m-account-network-button")],_a);const FS=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 BS=Object.defineProperty,kS=Object.getOwnPropertyDescriptor,Ea=(t,e,r,n)=>{for(var i=n>1?void 0:n?kS(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&&BS(e,r,i),i};let ls=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>`}};ls.styles=[Fe.globalCss,FS],Ea([gt()],ls.prototype,"address",2),Ea([gt()],ls.prototype,"name",2),Ea([gt()],ls.prototype,"loading",2),Ea([Oe()],ls.prototype,"variant",2),ls=Ea([Ne("w3m-address-text")],ls);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>`)}},HS=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 zS=Object.defineProperty,WS=Object.getOwnPropertyDescriptor,qS=(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&&zS(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,HS],Rf=qS([Ne("w3m-android-wallet-selection")],Rf);const VS=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 KS=Object.defineProperty,GS=Object.getOwnPropertyDescriptor,xa=(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 us=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}};us.styles=[Fe.globalCss,VS],xa([gt()],us.prototype,"address",2),xa([gt()],us.prototype,"avatar",2),xa([gt()],us.prototype,"loading",2),xa([Oe()],us.prototype,"size",2),us=xa([Ne("w3m-avatar")],us);const ZS=Ve`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`;var YS=Object.defineProperty,JS=Object.getOwnPropertyDescriptor,Nf=(t,e,r,n)=>{for(var i=n>1?void 0:n?JS(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};let Ia=class extends $e{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=Et.state.balance)==null?void 0:t.symbol,this.amount=(e=Et.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=Et.subscribe(({balance:r})=>{this.symbol=r?.symbol,this.amount=r?.amount})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){let t="_._";return this.amount==="0.0"?t="0":typeof this.amount=="string"&&this.amount.length>6?t=this.amount.substring(0,6):typeof this.amount=="string"&&(t=this.amount),oe`<div><w3m-token-image symbol="${this.symbol}"></w3m-token-image><w3m-text variant="medium-regular" color="primary">${t} ${this.symbol}</w3m-text></div>`}};Ia.styles=[Fe.globalCss,ZS],Nf([gt()],Ia.prototype,"symbol",2),Nf([gt()],Ia.prototype,"amount",2),Ia=Nf([Ne("w3m-balance")],Ia);const QS=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 XS=Object.defineProperty,eO=Object.getOwnPropertyDescriptor,Xc=(t,e,r,n)=>{for(var i=n>1?void 0:n?eO(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&&XS(e,r,i),i};let hs=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>`}};hs.styles=[Fe.globalCss,QS],Xc([gt()],hs.prototype,"loading",2),Xc([Oe()],hs.prototype,"label",2),Xc([Oe()],hs.prototype,"icon",2),hs=Xc([Ne("w3m-connect-button")],hs);const tO=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 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 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,tO],io([Oe()],Di.prototype,"walletId",2),io([Oe()],Di.prototype,"imageId",2),io([Oe()],Di.prototype,"isError",2),io([Oe()],Di.prototype,"isStale",2),io([Oe()],Di.prototype,"label",2),Di=io([Ne("w3m-connector-waiting")],Di);var iO=Object.defineProperty,sO=Object.getOwnPropertyDescriptor,so=(t,e,r,n)=>{for(var i=n>1?void 0:n?sO(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&&iO(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>`}};so([gt()],$i.prototype,"isConnected",2),so([Oe()],$i.prototype,"label",2),so([Oe()],$i.prototype,"icon",2),so([Oe()],$i.prototype,"avatar",2),so([Oe()],$i.prototype,"balance",2),$i=so([Ne("w3m-core-button")],$i);const oO=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 aO=Object.defineProperty,cO=Object.getOwnPropertyDescriptor,lO=(t,e,r,n)=>{for(var i=n>1?void 0:n?cO(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&&aO(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,oO],Lf=lO([Ne("w3m-desktop-wallet-selection")],Lf);const uO=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 hO=Object.defineProperty,fO=Object.getOwnPropertyDescriptor,dO=(t,e,r,n)=>{for(var i=n>1?void 0:n?fO(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&&hO(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,uO],Mf=dO([Ne("w3m-legal-notice")],Mf);const pO=Ve`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var gO=Object.defineProperty,mO=Object.getOwnPropertyDescriptor,wO=(t,e,r,n)=>{for(var i=n>1?void 0:n?mO(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&&gO(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,pO],Uf=wO([Ne("w3m-mobile-wallet-selection")],Uf);const vO=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 yO=Object.defineProperty,bO=Object.getOwnPropertyDescriptor,jf=(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 oo=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([os(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,os(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([os(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,os(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>`}};oo.styles=[Fe.globalCss,vO],jf([gt()],oo.prototype,"open",2),jf([gt()],oo.prototype,"active",2),oo=jf([Ne("w3m-modal")],oo);const _O=Ve`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`;var EO=Object.defineProperty,xO=Object.getOwnPropertyDescriptor,el=(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 fs=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>`}};fs.styles=[Fe.globalCss,_O],el([gt()],fs.prototype,"chainId",2),el([gt()],fs.prototype,"label",2),el([gt()],fs.prototype,"wrongNetwork",2),fs=el([Ne("w3m-network-switch")],fs);const IO=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 CO=Object.defineProperty,SO=Object.getOwnPropertyDescriptor,tl=(t,e,r,n)=>{for(var i=n>1?void 0:n?SO(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&&CO(e,r,i),i};let ao=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>`}};ao.styles=[Fe.globalCss,IO],tl([Oe()],ao.prototype,"chainId",2),tl([Oe()],ao.prototype,"isError",2),tl([Oe()],ao.prototype,"label",2),ao=tl([Ne("w3m-network-waiting")],ao);const OO=Ve`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}w3m-button{margin:0 5px}`;var AO=Object.defineProperty,DO=Object.getOwnPropertyDescriptor,ds=(t,e,r,n)=>{for(var i=n>1?void 0:n?DO(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&&AO(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,OO],ds([Oe()],ri.prototype,"isMobile",2),ds([Oe()],ri.prototype,"isInjected",2),ds([Oe()],ri.prototype,"isInjectedInstalled",2),ds([Oe()],ri.prototype,"isDesktop",2),ds([Oe()],ri.prototype,"isWeb",2),ds([Oe()],ri.prototype,"isRetry",2),ri=ds([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 PO=Object.defineProperty,TO=Object.getOwnPropertyDescriptor,RO=(t,e,r,n)=>{for(var i=n>1?void 0:n?TO(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&&PO(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=RO([Ne("w3m-view-all-wallets-button")],Ff);const NO=Ve`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var LO=Object.defineProperty,MO=Object.getOwnPropertyDescriptor,rl=(t,e,r,n)=>{for(var i=n>1?void 0:n?MO(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&&LO(e,r,i),i};let co=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>`}};co.styles=[Fe.globalCss,NO],rl([Oe()],co.prototype,"walletId",2),rl([Oe()],co.prototype,"imageId",2),rl([gt()],co.prototype,"uri",2),co=rl([Ne("w3m-walletconnect-qr")],co);const UO=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 jO=Object.defineProperty,FO=Object.getOwnPropertyDescriptor,BO=(t,e,r,n)=>{for(var i=n>1?void 0:n?FO(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&&jO(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,UO],Bf=BO([Ne("w3m-account-view")],Bf);var kO=Object.defineProperty,HO=Object.getOwnPropertyDescriptor,zO=(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&&kO(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=zO([Ne("w3m-connect-wallet-view")],kf);const WO=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var qO=Object.defineProperty,VO=Object.getOwnPropertyDescriptor,y3=(t,e,r,n)=>{for(var i=n>1?void 0:n?VO(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&&qO(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,WO],y3([gt()],nl.prototype,"isError",2),nl=y3([Ne("w3m-desktop-connecting-view")],nl);const KO=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 GO=Object.defineProperty,ZO=Object.getOwnPropertyDescriptor,YO=(t,e,r,n)=>{for(var i=n>1?void 0:n?ZO(e,r):e,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(e,r,i):c(i))||i);return n&&i&&GO(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,KO],Hf=YO([Ne("w3m-get-wallet-view")],Hf);const JO=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 QO=Object.defineProperty,XO=Object.getOwnPropertyDescriptor,eA=(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&&QO(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,JO],zf=eA([Ne("w3m-help-view")],zf);const tA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var rA=Object.defineProperty,nA=Object.getOwnPropertyDescriptor,b3=(t,e,r,n)=>{for(var i=n>1?void 0:n?nA(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&&rA(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,tA],b3([gt()],il.prototype,"isError",2),il=b3([Ne("w3m-injected-connecting-view")],il);const iA=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 sA=Object.defineProperty,oA=Object.getOwnPropertyDescriptor,aA=(t,e,r,n)=>{for(var i=n>1?void 0:n?oA(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&&sA(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,iA],Wf=aA([Ne("w3m-install-wallet-view")],Wf);const cA=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 lA=Object.defineProperty,uA=Object.getOwnPropertyDescriptor,_3=(t,e,r,n)=>{for(var i=n>1?void 0:n?uA(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&&lA(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,cA],_3([gt()],sl.prototype,"isError",2),sl=_3([Ne("w3m-mobile-connecting-view")],sl);const hA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var fA=Object.defineProperty,dA=Object.getOwnPropertyDescriptor,pA=(t,e,r,n)=>{for(var i=n>1?void 0:n?dA(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&&fA(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,hA],qf=pA([Ne("w3m-mobile-qr-connecting-view")],qf);var gA=Object.defineProperty,mA=Object.getOwnPropertyDescriptor,wA=(t,e,r,n)=>{for(var i=n>1?void 0:n?mA(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&&gA(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=wA([Ne("w3m-qrcode-view")],Vf);const vA=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 E3=Object.defineProperty,yA=Object.defineProperties,bA=Object.getOwnPropertyDescriptor,_A=Object.getOwnPropertyDescriptors,x3=Object.getOwnPropertySymbols,EA=Object.prototype.hasOwnProperty,xA=Object.prototype.propertyIsEnumerable,I3=(t,e,r)=>e in t?E3(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,IA=(t,e)=>{for(var r in e||(e={}))EA.call(e,r)&&I3(t,r,e[r]);if(x3)for(var r of x3(e))xA.call(e,r)&&I3(t,r,e[r]);return t},CA=(t,e)=>yA(t,_A(e)),Kf=(t,e,r,n)=>{for(var i=n>1?void 0:n?bA(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&&E3(e,r,i),i};let Ca=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=>CA(IA({},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}`}};Ca.styles=[Fe.globalCss,vA],Kf([gt()],Ca.prototype,"connectedChains",2),Kf([gt()],Ca.prototype,"isUnsupportedChains",2),Ca=Kf([Ne("w3m-select-network-view")],Ca);const SA=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 OA=Object.defineProperty,AA=Object.getOwnPropertyDescriptor,C3=(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 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,SA],C3([gt()],ol.prototype,"isError",2),ol=C3([Ne("w3m-switch-network-view")],ol);const DA=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,PA=Object.getOwnPropertyDescriptor,Sa=(t,e,r,n)=>{for(var i=n>1?void 0:n?PA(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 ps=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>`}};ps.styles=[Fe.globalCss,DA],Sa([gt()],ps.prototype,"loading",2),Sa([gt()],ps.prototype,"firstFetch",2),Sa([gt()],ps.prototype,"search",2),Sa([gt()],ps.prototype,"endReached",2),ps=Sa([Ne("w3m-wallet-explorer-view")],ps);const TA=Ve`w3m-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}w3m-text{text-align:center}`;var RA=Object.defineProperty,NA=Object.getOwnPropertyDescriptor,S3=(t,e,r,n)=>{for(var i=n>1?void 0:n?NA(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&&RA(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,TA],S3([gt()],al.prototype,"isError",2),al=S3([Ne("w3m-web-connecting-view")],al);var LA=Object.freeze({__proto__:null,get W3mAccountButton(){return no},get W3mConnectButton(){return hs},get W3mCoreButton(){return $i},get W3mModal(){return oo},get W3mNetworkSwitch(){return fs},get W3mQrCode(){return ti}});xn.EthereumProvider=$x,xn.OPTIONAL_EVENTS=Bg,xn.OPTIONAL_METHODS=Fg,xn.REQUIRED_EVENTS=Ec,xn.REQUIRED_METHODS=_c,xn.default=Ic,Object.defineProperty(xn,"__esModule",{value:!0})});
|
|
140
140
|
//# sourceMappingURL=index.umd.js.map
|