@walletconnect/ethereum-provider 2.14.0 → 2.15.0
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 +48 -48
- package/dist/index.umd.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Vn,jr){typeof exports=="object"&&typeof module<"u"?jr(exports):typeof define=="function"&&define.amd?define(["exports"],jr):(Vn=typeof globalThis<"u"?globalThis:Vn||self,jr(Vn["@walletconnect/ethereum-provider"]={}))})(this,function(Vn){"use strict";var jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function e3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ol(e){var t=e.default;if(typeof t=="function"){var r=function(){return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Cr={exports:{}},No=typeof Reflect=="object"?Reflect:null,jp=No&&typeof No.apply=="function"?No.apply:function(t,r,n){return Function.prototype.apply.call(t,r,n)},al;No&&typeof No.ownKeys=="function"?al=No.ownKeys:Object.getOwnPropertySymbols?al=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:al=function(t){return Object.getOwnPropertyNames(t)};function r3(e){console&&console.warn&&console.warn(e)}var kp=Number.isNaN||function(t){return t!==t};function ze(){ze.init.call(this)}Cr.exports=ze,Cr.exports.once=o3,ze.EventEmitter=ze,ze.prototype._events=void 0,ze.prototype._eventsCount=0,ze.prototype._maxListeners=void 0;var qp=10;function cl(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(ze,"defaultMaxListeners",{enumerable:!0,get:function(){return qp},set:function(e){if(typeof e!="number"||e<0||kp(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");qp=e}}),ze.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},ze.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||kp(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function zp(e){return e._maxListeners===void 0?ze.defaultMaxListeners:e._maxListeners}ze.prototype.getMaxListeners=function(){return zp(this)},ze.prototype.emit=function(t){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=t==="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[t];if(f===void 0)return!1;if(typeof f=="function")jp(f,this,r);else for(var h=f.length,g=Gp(f,h),n=0;n<h;++n)jp(g[n],this,r);return!0};function Hp(e,t,r,n){var i,o,c;if(cl(r),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),c=o[t]),c===void 0)c=o[t]=r,++e._eventsCount;else if(typeof c=="function"?c=o[t]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),i=zp(e),i>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=c.length,r3(l)}return e}ze.prototype.addListener=function(t,r){return Hp(this,t,r,!1)},ze.prototype.on=ze.prototype.addListener,ze.prototype.prependListener=function(t,r){return Hp(this,t,r,!0)};function n3(){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 Kp(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=n3.bind(n);return i.listener=r,n.wrapFn=i,i}ze.prototype.once=function(t,r){return cl(r),this.on(t,Kp(this,t,r)),this},ze.prototype.prependOnceListener=function(t,r){return cl(r),this.prependListener(t,Kp(this,t,r)),this},ze.prototype.removeListener=function(t,r){var n,i,o,c,l;if(cl(r),i=this._events,i===void 0)return this;if(n=i[t],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,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():i3(n,o),n.length===1&&(i[t]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",t,l||r)}return this},ze.prototype.off=ze.prototype.removeListener,ze.prototype.removeAllListeners=function(t){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[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),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[t],typeof r=="function")this.removeListener(t,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(t,r[i]);return this};function Wp(e,t,r){var n=e._events;if(n===void 0)return[];var i=n[t];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?s3(i):Gp(i,i.length)}ze.prototype.listeners=function(t){return Wp(this,t,!0)},ze.prototype.rawListeners=function(t){return Wp(this,t,!1)},ze.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Vp.call(e,t)},ze.prototype.listenerCount=Vp;function Vp(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}ze.prototype.eventNames=function(){return this._eventsCount>0?al(this._events):[]};function Gp(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function i3(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function s3(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function o3(e,t){return new Promise(function(r,n){function i(c){e.removeListener(t,o),n(c)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",i),r([].slice.call(arguments))}Yp(e,t,o,{once:!0}),t!=="error"&&a3(e,i,{once:!0})})}function a3(e,t,r){typeof e.on=="function"&&Yp(e,"error",t,r)}function Yp(e,t,r,n){if(typeof e.on=="function")n.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var Qp=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},c3=function(){function e(t,r,n){this.name=t,this.version=r,this.os=n,this.type="browser"}return e}(),l3=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),u3=function(){function e(t,r,n,i){this.name=t,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return e}(),h3=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),f3=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),d3=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,p3=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Jp=3,g3=[["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",d3]],Zp=[["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 m3(e){return e?Xp(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new f3:typeof navigator<"u"?Xp(navigator.userAgent):y3()}function v3(e){return e!==""&&g3.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var o=i.exec(e);return!!o&&[n,o]},!1)}function Xp(e){var t=v3(e);if(!t)return null;var r=t[0],n=t[1];if(r==="searchbot")return new h3;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Jp&&(i=Qp(Qp([],i,!0),b3(Jp-i.length),!0)):i=[];var o=i.join("."),c=w3(e),l=p3.exec(e);return l&&l[1]?new u3(r,o,c,l[1]):new c3(r,o,c)}function w3(e){for(var t=0,r=Zp.length;t<r;t++){var n=Zp[t],i=n[0],o=n[1],c=o.exec(e);if(c)return i}return null}function y3(){var e=typeof process<"u"&&process.version;return e?new l3(process.version.slice(1)):null}function b3(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}var yt={};/*! *****************************************************************************
|
|
1
|
+
(function(mn,Gr){typeof exports=="object"&&typeof module<"u"?Gr(exports):typeof define=="function"&&define.amd?define(["exports"],Gr):(mn=typeof globalThis<"u"?globalThis:mn||self,Gr(mn["@walletconnect/ethereum-provider"]={}))})(this,function(mn){"use strict";var Gr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function o0(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(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),r}var Br={exports:{}},Ea=typeof Reflect=="object"?Reflect:null,Lg=Ea&&typeof Ea.apply=="function"?Ea.apply:function(e,r,i){return Function.prototype.apply.call(e,r,i)},gf;Ea&&typeof Ea.ownKeys=="function"?gf=Ea.ownKeys:Object.getOwnPropertySymbols?gf=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:gf=function(e){return Object.getOwnPropertyNames(e)};function p4(t){console&&console.warn&&console.warn(t)}var Bg=Number.isNaN||function(e){return e!==e};function Qt(){Qt.init.call(this)}Br.exports=Qt,Br.exports.once=b4,Qt.EventEmitter=Qt,Qt.prototype._events=void 0,Qt.prototype._eventsCount=0,Qt.prototype._maxListeners=void 0;var Ug=10;function vf(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Qt,"defaultMaxListeners",{enumerable:!0,get:function(){return Ug},set:function(t){if(typeof t!="number"||t<0||Bg(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ug=t}}),Qt.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},Qt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Bg(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 kg(t){return t._maxListeners===void 0?Qt.defaultMaxListeners:t._maxListeners}Qt.prototype.getMaxListeners=function(){return kg(this)},Qt.prototype.emit=function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){var a;if(r.length>0&&(a=r[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw u.context=a,u}var d=s[e];if(d===void 0)return!1;if(typeof d=="function")Lg(d,this,r);else for(var p=d.length,y=Kg(d,p),i=0;i<p;++i)Lg(y[i],this,r);return!0};function jg(t,e,r,i){var n,s,a;if(vf(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),a=s[e]),a===void 0)a=s[e]=r,++t._eventsCount;else if(typeof a=="function"?a=s[e]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),n=kg(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,p4(u)}return t}Qt.prototype.addListener=function(e,r){return jg(this,e,r,!1)},Qt.prototype.on=Qt.prototype.addListener,Qt.prototype.prependListener=function(e,r){return jg(this,e,r,!0)};function g4(){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 qg(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=g4.bind(i);return n.listener=r,i.wrapFn=n,n}Qt.prototype.once=function(e,r){return vf(r),this.on(e,qg(this,e,r)),this},Qt.prototype.prependOnceListener=function(e,r){return vf(r),this.prependListener(e,qg(this,e,r)),this},Qt.prototype.removeListener=function(e,r){var i,n,s,a,u;if(vf(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(s=-1,a=i.length-1;a>=0;a--)if(i[a]===r||i[a].listener===r){u=i[a].listener,s=a;break}if(s<0)return this;s===0?i.shift():v4(i,s),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,u||r)}return this},Qt.prototype.off=Qt.prototype.removeListener,Qt.prototype.removeAllListeners=function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var s=Object.keys(i),a;for(n=0;n<s.length;++n)a=s[n],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this};function zg(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?m4(n):Kg(n,n.length)}Qt.prototype.listeners=function(e){return zg(this,e,!0)},Qt.prototype.rawListeners=function(e){return zg(this,e,!1)},Qt.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Hg.call(t,e)},Qt.prototype.listenerCount=Hg;function Hg(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}Qt.prototype.eventNames=function(){return this._eventsCount>0?gf(this._events):[]};function Kg(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function v4(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function m4(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function b4(t,e){return new Promise(function(r,i){function n(a){t.removeListener(e,s),i(a)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}Wg(t,e,s,{once:!0}),e!=="error"&&y4(t,n,{once:!0})})}function y4(t,e,r){typeof t.on=="function"&&Wg(t,"error",e,r)}function Wg(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function n(s){i.once&&t.removeEventListener(e,n),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var Vg=function(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))},w4=function(){function t(e,r,i){this.name=e,this.version=r,this.os=i,this.type="browser"}return t}(),_4=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),A4=function(){function t(e,r,i,n){this.name=e,this.version=r,this.os=i,this.bot=n,this.type="bot-device"}return t}(),E4=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),x4=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),S4=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,I4=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Gg=3,M4=[["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",S4]],Yg=[["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 C4(t){return t?Jg(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new x4:typeof navigator<"u"?Jg(navigator.userAgent):O4()}function D4(t){return t!==""&&M4.reduce(function(e,r){var i=r[0],n=r[1];if(e)return e;var s=n.exec(t);return!!s&&[i,s]},!1)}function Jg(t){var e=D4(t);if(!e)return null;var r=e[0],i=e[1];if(r==="searchbot")return new E4;var n=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);n?n.length<Gg&&(n=Vg(Vg([],n,!0),$4(Gg-n.length),!0)):n=[];var s=n.join("."),a=P4(t),u=I4.exec(t);return u&&u[1]?new A4(r,s,a,u[1]):new w4(r,s,a)}function P4(t){for(var e=0,r=Yg.length;e<r;e++){var i=Yg[e],n=i[0],s=i[1],a=s.exec(t);if(a)return n}return null}function O4(){var t=typeof process<"u"&&process.version;return t?new _4(process.version.slice(1)):null}function $4(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var He={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -11,23 +11,23 @@
|
|
|
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 Th=function(e,t){return Th=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])},Th(e,t)};function _3(e,t){Th(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Rh=function(){return Rh=Object.assign||function(t){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)&&(t[o]=r[o])}return t},Rh.apply(this,arguments)};function E3(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function A3(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(o=(i<3?c(o):i>3?c(t,r,o):c(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function x3(e,t){return function(r,n){t(r,n,e)}}function I3(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function S3(e,t,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(g){try{h(n.next(g))}catch(_){c(_)}}function f(g){try{h(n.throw(g))}catch(_){c(_)}}function h(g){g.done?o(g.value):i(g.value).then(l,f)}h((n=n.apply(e,t||[])).next())})}function C3(e,t){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(g){return f([h,g])}}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=t.call(e,r)}catch(g){h=[6,g],i=0}finally{n=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function D3(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}function O3(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function Lh(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function t1(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],c;try{for(;(t===void 0||t-- >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 P3(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(t1(arguments[t]));return e}function M3(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function ja(e){return this instanceof ja?(this.v=e,this):new ja(e)}function $3(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(E){n[E]&&(i[E]=function(x){return new Promise(function(I,F){o.push([E,x,I,F])>1||l(E,x)})})}function l(E,x){try{f(n[E](x))}catch(I){_(o[0][3],I)}}function f(E){E.value instanceof ja?Promise.resolve(E.value.v).then(h,g):_(o[0][2],E)}function h(E){l("next",E)}function g(E){l("throw",E)}function _(E,x){E(x),o.shift(),o.length&&l(o[0][0],o[0][1])}}function N3(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,o){t[i]=e[i]?function(c){return(r=!r)?{value:ja(e[i](c)),done:i==="return"}:o?o(c):c}:o}}function T3(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Lh=="function"?Lh(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(c){return new Promise(function(l,f){c=e[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 R3(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function L3(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function B3(e){return e&&e.__esModule?e:{default:e}}function U3(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function F3(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}var j3=Object.freeze({__proto__:null,__extends:_3,get __assign(){return Rh},__rest:E3,__decorate:A3,__param:x3,__metadata:I3,__awaiter:S3,__generator:C3,__createBinding:D3,__exportStar:O3,__values:Lh,__read:t1,__spread:P3,__spreadArrays:M3,__await:ja,__asyncGenerator:$3,__asyncDelegator:N3,__asyncValues:T3,__makeTemplateObject:R3,__importStar:L3,__importDefault:B3,__classPrivateFieldGet:U3,__classPrivateFieldSet:F3}),ll=ol(j3),Bh={},ka={},e1;function k3(){if(e1)return ka;e1=1,Object.defineProperty(ka,"__esModule",{value:!0}),ka.delay=void 0;function e(t){return new Promise(r=>{setTimeout(()=>{r(!0)},t)})}return ka.delay=e,ka}var Us={},Uh={},Fs={},r1;function q3(){return r1||(r1=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.ONE_THOUSAND=Fs.ONE_HUNDRED=void 0,Fs.ONE_HUNDRED=100,Fs.ONE_THOUSAND=1e3),Fs}var Fh={},n1;function z3(){return n1||(n1=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=e.ONE_MINUTE*5,e.TEN_MINUTES=e.ONE_MINUTE*10,e.THIRTY_MINUTES=e.ONE_MINUTE*30,e.SIXTY_MINUTES=e.ONE_MINUTE*60,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=e.ONE_HOUR*3,e.SIX_HOURS=e.ONE_HOUR*6,e.TWELVE_HOURS=e.ONE_HOUR*12,e.TWENTY_FOUR_HOURS=e.ONE_HOUR*24,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=e.ONE_DAY*3,e.FIVE_DAYS=e.ONE_DAY*5,e.SEVEN_DAYS=e.ONE_DAY*7,e.THIRTY_DAYS=e.ONE_DAY*30,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=e.ONE_WEEK*2,e.THREE_WEEKS=e.ONE_WEEK*3,e.FOUR_WEEKS=e.ONE_WEEK*4,e.ONE_YEAR=e.ONE_DAY*365}(Fh)),Fh}var i1;function s1(){return i1||(i1=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=ll;t.__exportStar(q3(),e),t.__exportStar(z3(),e)}(Uh)),Uh}var o1;function H3(){if(o1)return Us;o1=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.fromMiliseconds=Us.toMiliseconds=void 0;const e=s1();function t(n){return n*e.ONE_THOUSAND}Us.toMiliseconds=t;function r(n){return Math.floor(n/e.ONE_THOUSAND)}return Us.fromMiliseconds=r,Us}var a1;function K3(){return a1||(a1=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=ll;t.__exportStar(k3(),e),t.__exportStar(H3(),e)}(Bh)),Bh}var To={},c1;function W3(){if(c1)return To;c1=1,Object.defineProperty(To,"__esModule",{value:!0}),To.Watch=void 0;class e{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 To.Watch=e,To.default=e,To}var jh={},qa={},l1;function V3(){if(l1)return qa;l1=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.IWatch=void 0;class e{}return qa.IWatch=e,qa}var u1;function G3(){return u1||(u1=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),ll.__exportStar(V3(),e)}(jh)),jh}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=ll;t.__exportStar(K3(),e),t.__exportStar(W3(),e),t.__exportStar(G3(),e),t.__exportStar(s1(),e)})(yt);var Je={};Object.defineProperty(Je,"__esModule",{value:!0}),Je.getLocalStorage=Je.getLocalStorageOrThrow=Je.getCrypto=Je.getCryptoOrThrow=h1=Je.getLocation=Je.getLocationOrThrow=qh=Je.getNavigator=Je.getNavigatorOrThrow=kh=Je.getDocument=Je.getDocumentOrThrow=Je.getFromWindowOrThrow=Je.getFromWindow=void 0;function js(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}Je.getFromWindow=js;function Ro(e){const t=js(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}Je.getFromWindowOrThrow=Ro;function Y3(){return Ro("document")}Je.getDocumentOrThrow=Y3;function Q3(){return js("document")}var kh=Je.getDocument=Q3;function J3(){return Ro("navigator")}Je.getNavigatorOrThrow=J3;function Z3(){return js("navigator")}var qh=Je.getNavigator=Z3;function X3(){return Ro("location")}Je.getLocationOrThrow=X3;function t6(){return js("location")}var h1=Je.getLocation=t6;function e6(){return Ro("crypto")}Je.getCryptoOrThrow=e6;function r6(){return js("crypto")}Je.getCrypto=r6;function n6(){return Ro("localStorage")}Je.getLocalStorageOrThrow=n6;function i6(){return js("localStorage")}Je.getLocalStorage=i6;var zh={};Object.defineProperty(zh,"__esModule",{value:!0});var f1=zh.getWindowMetadata=void 0;const d1=Je;function s6(){let e,t;try{e=d1.getDocumentOrThrow(),t=d1.getLocationOrThrow()}catch{return null}function r(){const _=e.getElementsByTagName("link"),E=[];for(let x=0;x<_.length;x++){const I=_[x],F=I.getAttribute("rel");if(F&&F.toLowerCase().indexOf("icon")>-1){const W=I.getAttribute("href");if(W)if(W.toLowerCase().indexOf("https:")===-1&&W.toLowerCase().indexOf("http:")===-1&&W.indexOf("//")!==0){let Y=t.protocol+"//"+t.host;if(W.indexOf("/")===0)Y+=W;else{const B=t.pathname.split("/");B.pop();const z=B.join("/");Y+=z+"/"+W}E.push(Y)}else if(W.indexOf("//")===0){const Y=t.protocol+W;E.push(Y)}else E.push(W)}}return E}function n(..._){const E=e.getElementsByTagName("meta");for(let x=0;x<E.length;x++){const I=E[x],F=["itemprop","property","name"].map(W=>I.getAttribute(W)).filter(W=>W?_.includes(W):!1);if(F.length&&F){const W=I.getAttribute("content");if(W)return W}}return""}function i(){let _=n("name","og:site_name","og:title","twitter:title");return _||(_=e.title),_}function o(){return n("description","og:description","twitter:description","keywords")}const c=i(),l=o(),f=t.origin,h=r();return{description:l,url:f,icons:h,name:c}}f1=zh.getWindowMetadata=s6;var za={},o6=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),p1="%[a-f0-9]{2}",g1=new RegExp("("+p1+")|([^%]+?)","gi"),m1=new RegExp("("+p1+")+","gi");function Hh(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],Hh(r),Hh(n))}function a6(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(g1)||[],r=1;r<t.length;r++)e=Hh(t,r).join(""),t=e.match(g1)||[];return e}}function c6(e){for(var t={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=m1.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var n=a6(r[0]);n!==r[0]&&(t[r[0]]=n)}r=m1.exec(e)}t["%C2"]="\uFFFD";for(var i=Object.keys(t),o=0;o<i.length;o++){var c=i[o];e=e.replace(new RegExp(c,"g"),t[c])}return e}var l6=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return c6(e)}},u6=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]},h6=function(e,t){for(var r={},n=Object.keys(e),i=Array.isArray(t),o=0;o<n.length;o++){var c=n[o],l=e[c];(i?t.indexOf(c)!==-1:t(c,l,e))&&(r[c]=l)}return r};(function(e){const t=o6,r=l6,n=u6,i=h6,o=B=>B==null,c=Symbol("encodeFragmentIdentifier");function l(B){switch(B.arrayFormat){case"index":return z=>(P,U)=>{const j=P.length;return U===void 0||B.skipNull&&U===null||B.skipEmptyString&&U===""?P:U===null?[...P,[g(z,B),"[",j,"]"].join("")]:[...P,[g(z,B),"[",g(j,B),"]=",g(U,B)].join("")]};case"bracket":return z=>(P,U)=>U===void 0||B.skipNull&&U===null||B.skipEmptyString&&U===""?P:U===null?[...P,[g(z,B),"[]"].join("")]:[...P,[g(z,B),"[]=",g(U,B)].join("")];case"colon-list-separator":return z=>(P,U)=>U===void 0||B.skipNull&&U===null||B.skipEmptyString&&U===""?P:U===null?[...P,[g(z,B),":list="].join("")]:[...P,[g(z,B),":list=",g(U,B)].join("")];case"comma":case"separator":case"bracket-separator":{const z=B.arrayFormat==="bracket-separator"?"[]=":"=";return P=>(U,j)=>j===void 0||B.skipNull&&j===null||B.skipEmptyString&&j===""?U:(j=j===null?"":j,U.length===0?[[g(P,B),z,g(j,B)].join("")]:[[U,g(j,B)].join(B.arrayFormatSeparator)])}default:return z=>(P,U)=>U===void 0||B.skipNull&&U===null||B.skipEmptyString&&U===""?P:U===null?[...P,g(z,B)]:[...P,[g(z,B),"=",g(U,B)].join("")]}}function f(B){let z;switch(B.arrayFormat){case"index":return(P,U,j)=>{if(z=/\[(\d*)\]$/.exec(P),P=P.replace(/\[\d*\]$/,""),!z){j[P]=U;return}j[P]===void 0&&(j[P]={}),j[P][z[1]]=U};case"bracket":return(P,U,j)=>{if(z=/(\[\])$/.exec(P),P=P.replace(/\[\]$/,""),!z){j[P]=U;return}if(j[P]===void 0){j[P]=[U];return}j[P]=[].concat(j[P],U)};case"colon-list-separator":return(P,U,j)=>{if(z=/(:list)$/.exec(P),P=P.replace(/:list$/,""),!z){j[P]=U;return}if(j[P]===void 0){j[P]=[U];return}j[P]=[].concat(j[P],U)};case"comma":case"separator":return(P,U,j)=>{const m=typeof U=="string"&&U.includes(B.arrayFormatSeparator),$=typeof U=="string"&&!m&&_(U,B).includes(B.arrayFormatSeparator);U=$?_(U,B):U;const et=m||$?U.split(B.arrayFormatSeparator).map(tt=>_(tt,B)):U===null?U:_(U,B);j[P]=et};case"bracket-separator":return(P,U,j)=>{const m=/(\[\])$/.test(P);if(P=P.replace(/\[\]$/,""),!m){j[P]=U&&_(U,B);return}const $=U===null?[]:U.split(B.arrayFormatSeparator).map(et=>_(et,B));if(j[P]===void 0){j[P]=$;return}j[P]=[].concat(j[P],$)};default:return(P,U,j)=>{if(j[P]===void 0){j[P]=U;return}j[P]=[].concat(j[P],U)}}}function h(B){if(typeof B!="string"||B.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function g(B,z){return z.encode?z.strict?t(B):encodeURIComponent(B):B}function _(B,z){return z.decode?r(B):B}function E(B){return Array.isArray(B)?B.sort():typeof B=="object"?E(Object.keys(B)).sort((z,P)=>Number(z)-Number(P)).map(z=>B[z]):B}function x(B){const z=B.indexOf("#");return z!==-1&&(B=B.slice(0,z)),B}function I(B){let z="";const P=B.indexOf("#");return P!==-1&&(z=B.slice(P)),z}function F(B){B=x(B);const z=B.indexOf("?");return z===-1?"":B.slice(z+1)}function W(B,z){return z.parseNumbers&&!Number.isNaN(Number(B))&&typeof B=="string"&&B.trim()!==""?B=Number(B):z.parseBooleans&&B!==null&&(B.toLowerCase()==="true"||B.toLowerCase()==="false")&&(B=B.toLowerCase()==="true"),B}function Y(B,z){z=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},z),h(z.arrayFormatSeparator);const P=f(z),U=Object.create(null);if(typeof B!="string"||(B=B.trim().replace(/^[?#&]/,""),!B))return U;for(const j of B.split("&")){if(j==="")continue;let[m,$]=n(z.decode?j.replace(/\+/g," "):j,"=");$=$===void 0?null:["comma","separator","bracket-separator"].includes(z.arrayFormat)?$:_($,z),P(_(m,z),$,U)}for(const j of Object.keys(U)){const m=U[j];if(typeof m=="object"&&m!==null)for(const $ of Object.keys(m))m[$]=W(m[$],z);else U[j]=W(m,z)}return z.sort===!1?U:(z.sort===!0?Object.keys(U).sort():Object.keys(U).sort(z.sort)).reduce((j,m)=>{const $=U[m];return $&&typeof $=="object"&&!Array.isArray($)?j[m]=E($):j[m]=$,j},Object.create(null))}e.extract=F,e.parse=Y,e.stringify=(B,z)=>{if(!B)return"";z=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},z),h(z.arrayFormatSeparator);const P=$=>z.skipNull&&o(B[$])||z.skipEmptyString&&B[$]==="",U=l(z),j={};for(const $ of Object.keys(B))P($)||(j[$]=B[$]);const m=Object.keys(j);return z.sort!==!1&&m.sort(z.sort),m.map($=>{const et=B[$];return et===void 0?"":et===null?g($,z):Array.isArray(et)?et.length===0&&z.arrayFormat==="bracket-separator"?g($,z)+"[]":et.reduce(U($),[]).join("&"):g($,z)+"="+g(et,z)}).filter($=>$.length>0).join("&")},e.parseUrl=(B,z)=>{z=Object.assign({decode:!0},z);const[P,U]=n(B,"#");return Object.assign({url:P.split("?")[0]||"",query:Y(F(B),z)},z&&z.parseFragmentIdentifier&&U?{fragmentIdentifier:_(U,z)}:{})},e.stringifyUrl=(B,z)=>{z=Object.assign({encode:!0,strict:!0,[c]:!0},z);const P=x(B.url).split("?")[0]||"",U=e.extract(B.url),j=e.parse(U,{sort:!1}),m=Object.assign(j,B.query);let $=e.stringify(m,z);$&&($=`?${$}`);let et=I(B.url);return B.fragmentIdentifier&&(et=`#${z[c]?g(B.fragmentIdentifier,z):B.fragmentIdentifier}`),`${P}${$}${et}`},e.pick=(B,z,P)=>{P=Object.assign({parseFragmentIdentifier:!0,[c]:!1},P);const{url:U,query:j,fragmentIdentifier:m}=e.parseUrl(B,P);return e.stringifyUrl({url:U,query:i(j,z),fragmentIdentifier:m},P)},e.exclude=(B,z,P)=>{const U=Array.isArray(z)?j=>!z.includes(j):(j,m)=>!z(j,m);return e.pick(B,U,P)}})(za);var Kh={},ul={},ce={},v1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,f){var h=l>>>16&65535,g=l&65535,_=f>>>16&65535,E=f&65535;return g*E+(h*E+g*_<<16>>>0)|0}e.mul=Math.imul||t;function r(l,f){return l+f|0}e.add=r;function n(l,f){return l-f|0}e.sub=n;function i(l,f){return l<<f|l>>>32-f}e.rotl=i;function o(l,f){return l<<32-f|l>>>f}e.rotr=o;function c(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l}e.isInteger=Number.isInteger||c,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(l){return e.isInteger(l)&&l>=-e.MAX_SAFE_INTEGER&&l<=e.MAX_SAFE_INTEGER}})(v1),Object.defineProperty(ce,"__esModule",{value:!0});var w1=v1;function f6(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16}ce.readInt16BE=f6;function d6(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])>>>0}ce.readUint16BE=d6;function p6(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])<<16>>16}ce.readInt16LE=p6;function g6(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])>>>0}ce.readUint16LE=g6;function y1(e,t,r){return t===void 0&&(t=new Uint8Array(2)),r===void 0&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}ce.writeUint16BE=y1,ce.writeInt16BE=y1;function b1(e,t,r){return t===void 0&&(t=new Uint8Array(2)),r===void 0&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}ce.writeUint16LE=b1,ce.writeInt16LE=b1;function Wh(e,t){return t===void 0&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}ce.readInt32BE=Wh;function Vh(e,t){return t===void 0&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}ce.readUint32BE=Vh;function Gh(e,t){return t===void 0&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}ce.readInt32LE=Gh;function Yh(e,t){return t===void 0&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}ce.readUint32LE=Yh;function hl(e,t,r){return t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}ce.writeUint32BE=hl,ce.writeInt32BE=hl;function fl(e,t,r){return t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}ce.writeUint32LE=fl,ce.writeInt32LE=fl;function m6(e,t){t===void 0&&(t=0);var r=Wh(e,t),n=Wh(e,t+4);return r*4294967296+n-(n>>31)*4294967296}ce.readInt64BE=m6;function v6(e,t){t===void 0&&(t=0);var r=Vh(e,t),n=Vh(e,t+4);return r*4294967296+n}ce.readUint64BE=v6;function w6(e,t){t===void 0&&(t=0);var r=Gh(e,t),n=Gh(e,t+4);return n*4294967296+r-(r>>31)*4294967296}ce.readInt64LE=w6;function y6(e,t){t===void 0&&(t=0);var r=Yh(e,t),n=Yh(e,t+4);return n*4294967296+r}ce.readUint64LE=y6;function _1(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),hl(e/4294967296>>>0,t,r),hl(e>>>0,t,r+4),t}ce.writeUint64BE=_1,ce.writeInt64BE=_1;function E1(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),fl(e>>>0,t,r),fl(e/4294967296>>>0,t,r+4),t}ce.writeUint64LE=E1,ce.writeInt64LE=E1;function b6(e,t,r){if(r===void 0&&(r=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=e/8+r-1;o>=r;o--)n+=t[o]*i,i*=256;return n}ce.readUintBE=b6;function _6(e,t,r){if(r===void 0&&(r=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+e/8;o++)n+=t[o]*i,i*=256;return n}ce.readUintLE=_6;function E6(e,t,r,n){if(r===void 0&&(r=new Uint8Array(e/8)),n===void 0&&(n=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!w1.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var i=1,o=e/8+n-1;o>=n;o--)r[o]=t/i&255,i*=256;return r}ce.writeUintBE=E6;function A6(e,t,r,n){if(r===void 0&&(r=new Uint8Array(e/8)),n===void 0&&(n=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!w1.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var i=1,o=n;o<n+e/8;o++)r[o]=t/i&255,i*=256;return r}ce.writeUintLE=A6;function x6(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat32(t)}ce.readFloat32BE=x6;function I6(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat32(t,!0)}ce.readFloat32LE=I6;function S6(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t)}ce.readFloat64BE=S6;function C6(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t,!0)}ce.readFloat64LE=C6;function D6(e,t,r){t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.setFloat32(r,e),t}ce.writeFloat32BE=D6;function O6(e,t,r){t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.setFloat32(r,e,!0),t}ce.writeFloat32LE=O6;function P6(e,t,r){t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.setFloat64(r,e),t}ce.writeFloat64BE=P6;function M6(e,t,r){t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.setFloat64(r,e,!0),t}ce.writeFloat64LE=M6;var pn={};Object.defineProperty(pn,"__esModule",{value:!0});function $6(e){for(var t=0;t<e.length;t++)e[t]=0;return e}pn.wipe=$6,Object.defineProperty(ul,"__esModule",{value:!0});var Rr=ce,Qh=pn,N6=20;function T6(e,t,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],g=r[15]<<24|r[14]<<16|r[13]<<8|r[12],_=r[19]<<24|r[18]<<16|r[17]<<8|r[16],E=r[23]<<24|r[22]<<16|r[21]<<8|r[20],x=r[27]<<24|r[26]<<16|r[25]<<8|r[24],I=r[31]<<24|r[30]<<16|r[29]<<8|r[28],F=t[3]<<24|t[2]<<16|t[1]<<8|t[0],W=t[7]<<24|t[6]<<16|t[5]<<8|t[4],Y=t[11]<<24|t[10]<<16|t[9]<<8|t[8],B=t[15]<<24|t[14]<<16|t[13]<<8|t[12],z=n,P=i,U=o,j=c,m=l,$=f,et=h,tt=g,nt=_,dt=E,d=x,p=I,b=F,C=W,O=Y,N=B,L=0;L<N6;L+=2)z=z+m|0,b^=z,b=b>>>32-16|b<<16,nt=nt+b|0,m^=nt,m=m>>>32-12|m<<12,P=P+$|0,C^=P,C=C>>>32-16|C<<16,dt=dt+C|0,$^=dt,$=$>>>32-12|$<<12,U=U+et|0,O^=U,O=O>>>32-16|O<<16,d=d+O|0,et^=d,et=et>>>32-12|et<<12,j=j+tt|0,N^=j,N=N>>>32-16|N<<16,p=p+N|0,tt^=p,tt=tt>>>32-12|tt<<12,U=U+et|0,O^=U,O=O>>>32-8|O<<8,d=d+O|0,et^=d,et=et>>>32-7|et<<7,j=j+tt|0,N^=j,N=N>>>32-8|N<<8,p=p+N|0,tt^=p,tt=tt>>>32-7|tt<<7,P=P+$|0,C^=P,C=C>>>32-8|C<<8,dt=dt+C|0,$^=dt,$=$>>>32-7|$<<7,z=z+m|0,b^=z,b=b>>>32-8|b<<8,nt=nt+b|0,m^=nt,m=m>>>32-7|m<<7,z=z+$|0,N^=z,N=N>>>32-16|N<<16,d=d+N|0,$^=d,$=$>>>32-12|$<<12,P=P+et|0,b^=P,b=b>>>32-16|b<<16,p=p+b|0,et^=p,et=et>>>32-12|et<<12,U=U+tt|0,C^=U,C=C>>>32-16|C<<16,nt=nt+C|0,tt^=nt,tt=tt>>>32-12|tt<<12,j=j+m|0,O^=j,O=O>>>32-16|O<<16,dt=dt+O|0,m^=dt,m=m>>>32-12|m<<12,U=U+tt|0,C^=U,C=C>>>32-8|C<<8,nt=nt+C|0,tt^=nt,tt=tt>>>32-7|tt<<7,j=j+m|0,O^=j,O=O>>>32-8|O<<8,dt=dt+O|0,m^=dt,m=m>>>32-7|m<<7,P=P+et|0,b^=P,b=b>>>32-8|b<<8,p=p+b|0,et^=p,et=et>>>32-7|et<<7,z=z+$|0,N^=z,N=N>>>32-8|N<<8,d=d+N|0,$^=d,$=$>>>32-7|$<<7;Rr.writeUint32LE(z+n|0,e,0),Rr.writeUint32LE(P+i|0,e,4),Rr.writeUint32LE(U+o|0,e,8),Rr.writeUint32LE(j+c|0,e,12),Rr.writeUint32LE(m+l|0,e,16),Rr.writeUint32LE($+f|0,e,20),Rr.writeUint32LE(et+h|0,e,24),Rr.writeUint32LE(tt+g|0,e,28),Rr.writeUint32LE(nt+_|0,e,32),Rr.writeUint32LE(dt+E|0,e,36),Rr.writeUint32LE(d+x|0,e,40),Rr.writeUint32LE(p+I|0,e,44),Rr.writeUint32LE(b+F|0,e,48),Rr.writeUint32LE(C+W|0,e,52),Rr.writeUint32LE(O+Y|0,e,56),Rr.writeUint32LE(N+B|0,e,60)}function A1(e,t,r,n,i){if(i===void 0&&(i=0),e.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(t.length!==8&&t.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),c=o.length-t.length,o.set(t,c)}else{if(t.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=t,c=i}for(var l=new Uint8Array(64),f=0;f<r.length;f+=64){T6(l,o,e);for(var h=f;h<f+64&&h<r.length;h++)n[h]=r[h]^l[h-f];L6(o,0,c)}return Qh.wipe(l),i===0&&Qh.wipe(o),n}ul.streamXOR=A1;function R6(e,t,r,n){return n===void 0&&(n=0),Qh.wipe(r),A1(e,t,r,r,n)}ul.stream=R6;function L6(e,t,r){for(var n=1;r--;)n=n+(e[t]&255)|0,e[t]=n&255,n>>>=8,t++;if(n>0)throw new Error("ChaCha: counter overflow")}var x1={},as={};Object.defineProperty(as,"__esModule",{value:!0});function B6(e,t,r){return~(e-1)&t|e-1&r}as.select=B6;function U6(e,t){return(e|0)-(t|0)-1>>>31&1}as.lessOrEqual=U6;function I1(e,t){if(e.length!==t.length)return 0;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return 1&r-1>>>8}as.compare=I1;function F6(e,t){return e.length===0||t.length===0?!1:I1(e,t)!==0}as.equal=F6,function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=as,r=pn;e.DIGEST_LENGTH=16;var n=function(){function c(l){this.digestLength=e.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 g=l[4]|l[5]<<8;this._r[2]=(h>>>10|g<<6)&7939;var _=l[6]|l[7]<<8;this._r[3]=(g>>>7|_<<9)&8191;var E=l[8]|l[9]<<8;this._r[4]=(_>>>4|E<<12)&255,this._r[5]=E>>>1&8190;var x=l[10]|l[11]<<8;this._r[6]=(E>>>14|x<<2)&8191;var I=l[12]|l[13]<<8;this._r[7]=(x>>>11|I<<5)&8065;var F=l[14]|l[15]<<8;this._r[8]=(I>>>8|F<<8)&8191,this._r[9]=F>>>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 g=this._fin?0:2048,_=this._h[0],E=this._h[1],x=this._h[2],I=this._h[3],F=this._h[4],W=this._h[5],Y=this._h[6],B=this._h[7],z=this._h[8],P=this._h[9],U=this._r[0],j=this._r[1],m=this._r[2],$=this._r[3],et=this._r[4],tt=this._r[5],nt=this._r[6],dt=this._r[7],d=this._r[8],p=this._r[9];h>=16;){var b=l[f+0]|l[f+1]<<8;_+=b&8191;var C=l[f+2]|l[f+3]<<8;E+=(b>>>13|C<<3)&8191;var O=l[f+4]|l[f+5]<<8;x+=(C>>>10|O<<6)&8191;var N=l[f+6]|l[f+7]<<8;I+=(O>>>7|N<<9)&8191;var L=l[f+8]|l[f+9]<<8;F+=(N>>>4|L<<12)&8191,W+=L>>>1&8191;var D=l[f+10]|l[f+11]<<8;Y+=(L>>>14|D<<2)&8191;var v=l[f+12]|l[f+13]<<8;B+=(D>>>11|v<<5)&8191;var T=l[f+14]|l[f+15]<<8;z+=(v>>>8|T<<8)&8191,P+=T>>>5|g;var ot=0,pt=ot;pt+=_*U,pt+=E*(5*p),pt+=x*(5*d),pt+=I*(5*dt),pt+=F*(5*nt),ot=pt>>>13,pt&=8191,pt+=W*(5*tt),pt+=Y*(5*et),pt+=B*(5*$),pt+=z*(5*m),pt+=P*(5*j),ot+=pt>>>13,pt&=8191;var A=ot;A+=_*j,A+=E*U,A+=x*(5*p),A+=I*(5*d),A+=F*(5*dt),ot=A>>>13,A&=8191,A+=W*(5*nt),A+=Y*(5*tt),A+=B*(5*et),A+=z*(5*$),A+=P*(5*m),ot+=A>>>13,A&=8191;var rt=ot;rt+=_*m,rt+=E*j,rt+=x*U,rt+=I*(5*p),rt+=F*(5*d),ot=rt>>>13,rt&=8191,rt+=W*(5*dt),rt+=Y*(5*nt),rt+=B*(5*tt),rt+=z*(5*et),rt+=P*(5*$),ot+=rt>>>13,rt&=8191;var q=ot;q+=_*$,q+=E*m,q+=x*j,q+=I*U,q+=F*(5*p),ot=q>>>13,q&=8191,q+=W*(5*d),q+=Y*(5*dt),q+=B*(5*nt),q+=z*(5*tt),q+=P*(5*et),ot+=q>>>13,q&=8191;var H=ot;H+=_*et,H+=E*$,H+=x*m,H+=I*j,H+=F*U,ot=H>>>13,H&=8191,H+=W*(5*p),H+=Y*(5*d),H+=B*(5*dt),H+=z*(5*nt),H+=P*(5*tt),ot+=H>>>13,H&=8191;var V=ot;V+=_*tt,V+=E*et,V+=x*$,V+=I*m,V+=F*j,ot=V>>>13,V&=8191,V+=W*U,V+=Y*(5*p),V+=B*(5*d),V+=z*(5*dt),V+=P*(5*nt),ot+=V>>>13,V&=8191;var w=ot;w+=_*nt,w+=E*tt,w+=x*et,w+=I*$,w+=F*m,ot=w>>>13,w&=8191,w+=W*j,w+=Y*U,w+=B*(5*p),w+=z*(5*d),w+=P*(5*dt),ot+=w>>>13,w&=8191;var k=ot;k+=_*dt,k+=E*nt,k+=x*tt,k+=I*et,k+=F*$,ot=k>>>13,k&=8191,k+=W*m,k+=Y*j,k+=B*U,k+=z*(5*p),k+=P*(5*d),ot+=k>>>13,k&=8191;var it=ot;it+=_*d,it+=E*dt,it+=x*nt,it+=I*tt,it+=F*et,ot=it>>>13,it&=8191,it+=W*$,it+=Y*m,it+=B*j,it+=z*U,it+=P*(5*p),ot+=it>>>13,it&=8191;var ht=ot;ht+=_*p,ht+=E*d,ht+=x*dt,ht+=I*nt,ht+=F*tt,ot=ht>>>13,ht&=8191,ht+=W*et,ht+=Y*$,ht+=B*m,ht+=z*j,ht+=P*U,ot+=ht>>>13,ht&=8191,ot=(ot<<2)+ot|0,ot=ot+pt|0,pt=ot&8191,ot=ot>>>13,A+=ot,_=pt,E=A,x=rt,I=q,F=H,W=V,Y=w,B=k,z=it,P=ht,f+=16,h-=16}this._h[0]=_,this._h[1]=E,this._h[2]=x,this._h[3]=I,this._h[4]=F,this._h[5]=W,this._h[6]=Y,this._h[7]=B,this._h[8]=z,this._h[9]=P},c.prototype.finish=function(l,f){f===void 0&&(f=0);var h=new Uint16Array(10),g,_,E,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(g=this._h[1]>>>13,this._h[1]&=8191,x=2;x<10;x++)this._h[x]+=g,g=this._h[x]>>>13,this._h[x]&=8191;for(this._h[0]+=g*5,g=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=g,g=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=g,h[0]=this._h[0]+5,g=h[0]>>>13,h[0]&=8191,x=1;x<10;x++)h[x]=this._h[x]+g,g=h[x]>>>13,h[x]&=8191;for(h[9]-=8192,_=(g^1)-1,x=0;x<10;x++)h[x]&=_;for(_=~_,x=0;x<10;x++)this._h[x]=this._h[x]&_|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,E=this._h[0]+this._pad[0],this._h[0]=E&65535,x=1;x<8;x++)E=(this._h[x]+this._pad[x]|0)+(E>>>16)|0,this._h[x]=E&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,g;if(this._leftover){g=16-this._leftover,g>h&&(g=h);for(var _=0;_<g;_++)this._buffer[this._leftover+_]=l[f+_];if(h-=g,f+=g,this._leftover+=g,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(h>=16&&(g=h-h%16,this._blocks(l,f,g),f+=g,h-=g),h){for(var _=0;_<h;_++)this._buffer[this._leftover+_]=l[f+_];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}();e.Poly1305=n;function i(c,l){var f=new n(c);f.update(l);var h=f.digest();return f.clean(),h}e.oneTimeAuth=i;function o(c,l){return c.length!==e.DIGEST_LENGTH||l.length!==e.DIGEST_LENGTH?!1:t.equal(c,l)}e.equal=o}(x1),function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=ul,r=x1,n=pn,i=ce,o=as;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var c=new Uint8Array(16),l=function(){function f(h){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,h.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(h)}return f.prototype.seal=function(h,g,_,E){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var x=new Uint8Array(16);x.set(h,x.length-h.length);var I=new Uint8Array(32);t.stream(this._key,x,I,4);var F=g.length+this.tagLength,W;if(E){if(E.length!==F)throw new Error("ChaCha20Poly1305: incorrect destination length");W=E}else W=new Uint8Array(F);return t.streamXOR(this._key,x,g,W,4),this._authenticate(W.subarray(W.length-this.tagLength,W.length),I,W.subarray(0,W.length-this.tagLength),_),n.wipe(x),W},f.prototype.open=function(h,g,_,E){if(h.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(g.length<this.tagLength)return null;var x=new Uint8Array(16);x.set(h,x.length-h.length);var I=new Uint8Array(32);t.stream(this._key,x,I,4);var F=new Uint8Array(this.tagLength);if(this._authenticate(F,I,g.subarray(0,g.length-this.tagLength),_),!o.equal(F,g.subarray(g.length-this.tagLength,g.length)))return null;var W=g.length-this.tagLength,Y;if(E){if(E.length!==W)throw new Error("ChaCha20Poly1305: incorrect destination length");Y=E}else Y=new Uint8Array(W);return t.streamXOR(this._key,x,g.subarray(0,g.length-this.tagLength),Y,4),n.wipe(x),Y},f.prototype.clean=function(){return n.wipe(this._key),this},f.prototype._authenticate=function(h,g,_,E){var x=new r.Poly1305(g);E&&(x.update(E),E.length%16>0&&x.update(c.subarray(E.length%16))),x.update(_),_.length%16>0&&x.update(c.subarray(_.length%16));var I=new Uint8Array(8);E&&i.writeUint64LE(E.length,I),x.update(I),i.writeUint64LE(_.length,I),x.update(I);for(var F=x.digest(),W=0;W<F.length;W++)h[W]=F[W];x.clean(),n.wipe(F),n.wipe(I)},f}();e.ChaCha20Poly1305=l}(Kh);var S1={},Ha={},Jh={};Object.defineProperty(Jh,"__esModule",{value:!0});function j6(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}Jh.isSerializableHash=j6,Object.defineProperty(Ha,"__esModule",{value:!0});var ai=Jh,k6=as,q6=pn,C1=function(){function e(t,r){this._finished=!1,this._inner=new t,this._outer=new t,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),ai.isSerializableHash(this._inner)&&ai.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),q6.wipe(n)}return e.prototype.reset=function(){if(!ai.isSerializableHash(this._inner)||!ai.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},e.prototype.clean=function(){ai.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),ai.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(t){return this._inner.update(t),this},e.prototype.finish=function(t){return this._finished?(this._outer.finish(t),this):(this._inner.finish(t),this._outer.update(t.subarray(0,this.digestLength)).finish(t),this._finished=!0,this)},e.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},e.prototype.saveState=function(){if(!ai.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(t){if(!ai.isSerializableHash(this._inner)||!ai.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(t),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(t){if(!ai.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(t)},e}();Ha.HMAC=C1;function z6(e,t,r){var n=new C1(e,t);n.update(r);var i=n.digest();return n.clean(),i}Ha.hmac=z6,Ha.equal=k6.equal,Object.defineProperty(S1,"__esModule",{value:!0});var D1=Ha,O1=pn,H6=function(){function e(t,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=t,this._info=i;var o=D1.hmac(this._hash,n,r);this._hmac=new D1.HMAC(t,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var t=this._counter[0];if(t===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),t>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},e.prototype.expand=function(t){for(var r=new Uint8Array(t),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},e.prototype.clean=function(){this._hmac.clean(),O1.wipe(this._buffer),O1.wipe(this._counter),this._bufpos=0},e}(),K6=S1.HKDF=H6,Lo={},dl={},pl={};Object.defineProperty(pl,"__esModule",{value:!0}),pl.BrowserRandomSource=void 0;const P1=65536;class W6{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const t=typeof self<"u"?self.crypto||self.msCrypto:null;t&&t.getRandomValues!==void 0&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(t);for(let n=0;n<r.length;n+=P1)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,P1)));return r}}pl.BrowserRandomSource=W6;function V6(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gl={},G6={},Y6=Object.freeze({__proto__:null,default:G6}),Q6=ol(Y6);Object.defineProperty(gl,"__esModule",{value:!0}),gl.NodeRandomSource=void 0;const J6=pn;class Z6{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof V6<"u"){const t=Q6;t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(t);if(r.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(t);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,J6.wipe)(r),n}}gl.NodeRandomSource=Z6,Object.defineProperty(dl,"__esModule",{value:!0}),dl.SystemRandomSource=void 0;const X6=pl,t5=gl;class e5{constructor(){if(this.isAvailable=!1,this.name="",this._source=new X6.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new t5.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)}}dl.SystemRandomSource=e5,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const t=dl,r=ce,n=pn;e.defaultRandomSource=new t.SystemRandomSource;function i(h,g=e.defaultRandomSource){return g.randomBytes(h)}e.randomBytes=i;function o(h=e.defaultRandomSource){const g=i(4,h),_=(0,r.readUint32LE)(g);return(0,n.wipe)(g),_}e.randomUint32=o;const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(h,g=c,_=e.defaultRandomSource){if(g.length<2)throw new Error("randomString charset is too short");if(g.length>256)throw new Error("randomString charset is too long");let E="";const x=g.length,I=256-256%x;for(;h>0;){const F=i(Math.ceil(h*256/I),_);for(let W=0;W<F.length&&h>0;W++){const Y=F[W];Y<I&&(E+=g.charAt(Y%x),h--)}(0,n.wipe)(F)}return E}e.randomString=l;function f(h,g=c,_=e.defaultRandomSource){const E=Math.ceil(h/(Math.log(g.length)/Math.LN2));return l(E,g,_)}e.randomStringForEntropy=f}(Lo);var ml={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=ce,r=pn;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var n=function(){function l(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 g=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&h>0;)this._buffer[this._bufferLength++]=f[g++],h--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(h>=this.blockSize&&(g=o(this._temp,this._state,f,g,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[g++],h--;return this},l.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,g=this._bufferLength,_=h/536870912|0,E=h<<3,x=h%64<56?64:128;this._buffer[g]=128;for(var I=g+1;I<x-8;I++)this._buffer[I]=0;t.writeUint32BE(_,this._buffer,x-8),t.writeUint32BE(E,this._buffer,x-4),o(this._temp,this._state,this._buffer,0,x),this._finished=!0}for(var I=0;I<this.digestLength/4;I++)t.writeUint32BE(this._state[I],f,I*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}();e.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,g,_){for(;_>=64;){for(var E=f[0],x=f[1],I=f[2],F=f[3],W=f[4],Y=f[5],B=f[6],z=f[7],P=0;P<16;P++){var U=g+P*4;l[P]=t.readUint32BE(h,U)}for(var P=16;P<64;P++){var j=l[P-2],m=(j>>>17|j<<32-17)^(j>>>19|j<<32-19)^j>>>10;j=l[P-15];var $=(j>>>7|j<<32-7)^(j>>>18|j<<32-18)^j>>>3;l[P]=(m+l[P-7]|0)+($+l[P-16]|0)}for(var P=0;P<64;P++){var m=(((W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7))+(W&Y^~W&B)|0)+(z+(i[P]+l[P]|0)|0)|0,$=((E>>>2|E<<32-2)^(E>>>13|E<<32-13)^(E>>>22|E<<32-22))+(E&x^E&I^x&I)|0;z=B,B=Y,Y=W,W=F+m|0,F=I,I=x,x=E,E=m+$|0}f[0]+=E,f[1]+=x,f[2]+=I,f[3]+=F,f[4]+=W,f[5]+=Y,f[6]+=B,f[7]+=z,g+=64,_-=64}return g}function c(l){var f=new n;f.update(l);var h=f.digest();return f.clean(),h}e.hash=c})(ml);var Zh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const t=Lo,r=pn;e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;function n(P){const U=new Float64Array(16);if(P)for(let j=0;j<P.length;j++)U[j]=P[j];return U}const i=new Uint8Array(32);i[0]=9;const o=n([56129,1]);function c(P){let U=1;for(let j=0;j<16;j++){let m=P[j]+U+65535;U=Math.floor(m/65536),P[j]=m-U*65536}P[0]+=U-1+37*(U-1)}function l(P,U,j){const m=~(j-1);for(let $=0;$<16;$++){const et=m&(P[$]^U[$]);P[$]^=et,U[$]^=et}}function f(P,U){const j=n(),m=n();for(let $=0;$<16;$++)m[$]=U[$];c(m),c(m),c(m);for(let $=0;$<2;$++){j[0]=m[0]-65517;for(let tt=1;tt<15;tt++)j[tt]=m[tt]-65535-(j[tt-1]>>16&1),j[tt-1]&=65535;j[15]=m[15]-32767-(j[14]>>16&1);const et=j[15]>>16&1;j[14]&=65535,l(m,j,1-et)}for(let $=0;$<16;$++)P[2*$]=m[$]&255,P[2*$+1]=m[$]>>8}function h(P,U){for(let j=0;j<16;j++)P[j]=U[2*j]+(U[2*j+1]<<8);P[15]&=32767}function g(P,U,j){for(let m=0;m<16;m++)P[m]=U[m]+j[m]}function _(P,U,j){for(let m=0;m<16;m++)P[m]=U[m]-j[m]}function E(P,U,j){let m,$,et=0,tt=0,nt=0,dt=0,d=0,p=0,b=0,C=0,O=0,N=0,L=0,D=0,v=0,T=0,ot=0,pt=0,A=0,rt=0,q=0,H=0,V=0,w=0,k=0,it=0,ht=0,lt=0,Ot=0,Mt=0,St=0,Pe=0,zt=0,Dt=j[0],Ft=j[1],Et=j[2],At=j[3],Gt=j[4],bt=j[5],xt=j[6],Bt=j[7],_t=j[8],Pt=j[9],jt=j[10],$t=j[11],Nt=j[12],le=j[13],Rt=j[14],Tt=j[15];m=U[0],et+=m*Dt,tt+=m*Ft,nt+=m*Et,dt+=m*At,d+=m*Gt,p+=m*bt,b+=m*xt,C+=m*Bt,O+=m*_t,N+=m*Pt,L+=m*jt,D+=m*$t,v+=m*Nt,T+=m*le,ot+=m*Rt,pt+=m*Tt,m=U[1],tt+=m*Dt,nt+=m*Ft,dt+=m*Et,d+=m*At,p+=m*Gt,b+=m*bt,C+=m*xt,O+=m*Bt,N+=m*_t,L+=m*Pt,D+=m*jt,v+=m*$t,T+=m*Nt,ot+=m*le,pt+=m*Rt,A+=m*Tt,m=U[2],nt+=m*Dt,dt+=m*Ft,d+=m*Et,p+=m*At,b+=m*Gt,C+=m*bt,O+=m*xt,N+=m*Bt,L+=m*_t,D+=m*Pt,v+=m*jt,T+=m*$t,ot+=m*Nt,pt+=m*le,A+=m*Rt,rt+=m*Tt,m=U[3],dt+=m*Dt,d+=m*Ft,p+=m*Et,b+=m*At,C+=m*Gt,O+=m*bt,N+=m*xt,L+=m*Bt,D+=m*_t,v+=m*Pt,T+=m*jt,ot+=m*$t,pt+=m*Nt,A+=m*le,rt+=m*Rt,q+=m*Tt,m=U[4],d+=m*Dt,p+=m*Ft,b+=m*Et,C+=m*At,O+=m*Gt,N+=m*bt,L+=m*xt,D+=m*Bt,v+=m*_t,T+=m*Pt,ot+=m*jt,pt+=m*$t,A+=m*Nt,rt+=m*le,q+=m*Rt,H+=m*Tt,m=U[5],p+=m*Dt,b+=m*Ft,C+=m*Et,O+=m*At,N+=m*Gt,L+=m*bt,D+=m*xt,v+=m*Bt,T+=m*_t,ot+=m*Pt,pt+=m*jt,A+=m*$t,rt+=m*Nt,q+=m*le,H+=m*Rt,V+=m*Tt,m=U[6],b+=m*Dt,C+=m*Ft,O+=m*Et,N+=m*At,L+=m*Gt,D+=m*bt,v+=m*xt,T+=m*Bt,ot+=m*_t,pt+=m*Pt,A+=m*jt,rt+=m*$t,q+=m*Nt,H+=m*le,V+=m*Rt,w+=m*Tt,m=U[7],C+=m*Dt,O+=m*Ft,N+=m*Et,L+=m*At,D+=m*Gt,v+=m*bt,T+=m*xt,ot+=m*Bt,pt+=m*_t,A+=m*Pt,rt+=m*jt,q+=m*$t,H+=m*Nt,V+=m*le,w+=m*Rt,k+=m*Tt,m=U[8],O+=m*Dt,N+=m*Ft,L+=m*Et,D+=m*At,v+=m*Gt,T+=m*bt,ot+=m*xt,pt+=m*Bt,A+=m*_t,rt+=m*Pt,q+=m*jt,H+=m*$t,V+=m*Nt,w+=m*le,k+=m*Rt,it+=m*Tt,m=U[9],N+=m*Dt,L+=m*Ft,D+=m*Et,v+=m*At,T+=m*Gt,ot+=m*bt,pt+=m*xt,A+=m*Bt,rt+=m*_t,q+=m*Pt,H+=m*jt,V+=m*$t,w+=m*Nt,k+=m*le,it+=m*Rt,ht+=m*Tt,m=U[10],L+=m*Dt,D+=m*Ft,v+=m*Et,T+=m*At,ot+=m*Gt,pt+=m*bt,A+=m*xt,rt+=m*Bt,q+=m*_t,H+=m*Pt,V+=m*jt,w+=m*$t,k+=m*Nt,it+=m*le,ht+=m*Rt,lt+=m*Tt,m=U[11],D+=m*Dt,v+=m*Ft,T+=m*Et,ot+=m*At,pt+=m*Gt,A+=m*bt,rt+=m*xt,q+=m*Bt,H+=m*_t,V+=m*Pt,w+=m*jt,k+=m*$t,it+=m*Nt,ht+=m*le,lt+=m*Rt,Ot+=m*Tt,m=U[12],v+=m*Dt,T+=m*Ft,ot+=m*Et,pt+=m*At,A+=m*Gt,rt+=m*bt,q+=m*xt,H+=m*Bt,V+=m*_t,w+=m*Pt,k+=m*jt,it+=m*$t,ht+=m*Nt,lt+=m*le,Ot+=m*Rt,Mt+=m*Tt,m=U[13],T+=m*Dt,ot+=m*Ft,pt+=m*Et,A+=m*At,rt+=m*Gt,q+=m*bt,H+=m*xt,V+=m*Bt,w+=m*_t,k+=m*Pt,it+=m*jt,ht+=m*$t,lt+=m*Nt,Ot+=m*le,Mt+=m*Rt,St+=m*Tt,m=U[14],ot+=m*Dt,pt+=m*Ft,A+=m*Et,rt+=m*At,q+=m*Gt,H+=m*bt,V+=m*xt,w+=m*Bt,k+=m*_t,it+=m*Pt,ht+=m*jt,lt+=m*$t,Ot+=m*Nt,Mt+=m*le,St+=m*Rt,Pe+=m*Tt,m=U[15],pt+=m*Dt,A+=m*Ft,rt+=m*Et,q+=m*At,H+=m*Gt,V+=m*bt,w+=m*xt,k+=m*Bt,it+=m*_t,ht+=m*Pt,lt+=m*jt,Ot+=m*$t,Mt+=m*Nt,St+=m*le,Pe+=m*Rt,zt+=m*Tt,et+=38*A,tt+=38*rt,nt+=38*q,dt+=38*H,d+=38*V,p+=38*w,b+=38*k,C+=38*it,O+=38*ht,N+=38*lt,L+=38*Ot,D+=38*Mt,v+=38*St,T+=38*Pe,ot+=38*zt,$=1,m=et+$+65535,$=Math.floor(m/65536),et=m-$*65536,m=tt+$+65535,$=Math.floor(m/65536),tt=m-$*65536,m=nt+$+65535,$=Math.floor(m/65536),nt=m-$*65536,m=dt+$+65535,$=Math.floor(m/65536),dt=m-$*65536,m=d+$+65535,$=Math.floor(m/65536),d=m-$*65536,m=p+$+65535,$=Math.floor(m/65536),p=m-$*65536,m=b+$+65535,$=Math.floor(m/65536),b=m-$*65536,m=C+$+65535,$=Math.floor(m/65536),C=m-$*65536,m=O+$+65535,$=Math.floor(m/65536),O=m-$*65536,m=N+$+65535,$=Math.floor(m/65536),N=m-$*65536,m=L+$+65535,$=Math.floor(m/65536),L=m-$*65536,m=D+$+65535,$=Math.floor(m/65536),D=m-$*65536,m=v+$+65535,$=Math.floor(m/65536),v=m-$*65536,m=T+$+65535,$=Math.floor(m/65536),T=m-$*65536,m=ot+$+65535,$=Math.floor(m/65536),ot=m-$*65536,m=pt+$+65535,$=Math.floor(m/65536),pt=m-$*65536,et+=$-1+37*($-1),$=1,m=et+$+65535,$=Math.floor(m/65536),et=m-$*65536,m=tt+$+65535,$=Math.floor(m/65536),tt=m-$*65536,m=nt+$+65535,$=Math.floor(m/65536),nt=m-$*65536,m=dt+$+65535,$=Math.floor(m/65536),dt=m-$*65536,m=d+$+65535,$=Math.floor(m/65536),d=m-$*65536,m=p+$+65535,$=Math.floor(m/65536),p=m-$*65536,m=b+$+65535,$=Math.floor(m/65536),b=m-$*65536,m=C+$+65535,$=Math.floor(m/65536),C=m-$*65536,m=O+$+65535,$=Math.floor(m/65536),O=m-$*65536,m=N+$+65535,$=Math.floor(m/65536),N=m-$*65536,m=L+$+65535,$=Math.floor(m/65536),L=m-$*65536,m=D+$+65535,$=Math.floor(m/65536),D=m-$*65536,m=v+$+65535,$=Math.floor(m/65536),v=m-$*65536,m=T+$+65535,$=Math.floor(m/65536),T=m-$*65536,m=ot+$+65535,$=Math.floor(m/65536),ot=m-$*65536,m=pt+$+65535,$=Math.floor(m/65536),pt=m-$*65536,et+=$-1+37*($-1),P[0]=et,P[1]=tt,P[2]=nt,P[3]=dt,P[4]=d,P[5]=p,P[6]=b,P[7]=C,P[8]=O,P[9]=N,P[10]=L,P[11]=D,P[12]=v,P[13]=T,P[14]=ot,P[15]=pt}function x(P,U){E(P,U,U)}function I(P,U){const j=n();for(let m=0;m<16;m++)j[m]=U[m];for(let m=253;m>=0;m--)x(j,j),m!==2&&m!==4&&E(j,j,U);for(let m=0;m<16;m++)P[m]=j[m]}function F(P,U){const j=new Uint8Array(32),m=new Float64Array(80),$=n(),et=n(),tt=n(),nt=n(),dt=n(),d=n();for(let O=0;O<31;O++)j[O]=P[O];j[31]=P[31]&127|64,j[0]&=248,h(m,U);for(let O=0;O<16;O++)et[O]=m[O];$[0]=nt[0]=1;for(let O=254;O>=0;--O){const N=j[O>>>3]>>>(O&7)&1;l($,et,N),l(tt,nt,N),g(dt,$,tt),_($,$,tt),g(tt,et,nt),_(et,et,nt),x(nt,dt),x(d,$),E($,tt,$),E(tt,et,dt),g(dt,$,tt),_($,$,tt),x(et,$),_(tt,nt,d),E($,tt,o),g($,$,nt),E(tt,tt,$),E($,nt,d),E(nt,et,m),x(et,dt),l($,et,N),l(tt,nt,N)}for(let O=0;O<16;O++)m[O+16]=$[O],m[O+32]=tt[O],m[O+48]=et[O],m[O+64]=nt[O];const p=m.subarray(32),b=m.subarray(16);I(p,p),E(b,b,p);const C=new Uint8Array(32);return f(C,b),C}e.scalarMult=F;function W(P){return F(P,i)}e.scalarMultBase=W;function Y(P){if(P.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const U=new Uint8Array(P);return{publicKey:W(U),secretKey:U}}e.generateKeyPairFromSeed=Y;function B(P){const U=(0,t.randomBytes)(32,P),j=Y(U);return(0,r.wipe)(U),j}e.generateKeyPair=B;function z(P,U,j=!1){if(P.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(U.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const m=F(P,U);if(j){let $=0;for(let et=0;et<m.length;et++)$|=m[et];if($===0)throw new Error("X25519: invalid shared key")}return m}e.sharedKey=z})(Zh);function M1(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function $1(e,t){t||(t=e.reduce((i,o)=>i+o.length,0));const r=M1(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}function r5(e,t){if(e.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<e.length;i++){var o=e.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=e.length,f=e.charAt(0),h=Math.log(l)/Math.log(256),g=Math.log(256)/Math.log(l);function _(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var F=0,W=0,Y=0,B=I.length;Y!==B&&I[Y]===0;)Y++,F++;for(var z=(B-Y)*g+1>>>0,P=new Uint8Array(z);Y!==B;){for(var U=I[Y],j=0,m=z-1;(U!==0||j<W)&&m!==-1;m--,j++)U+=256*P[m]>>>0,P[m]=U%l>>>0,U=U/l>>>0;if(U!==0)throw new Error("Non-zero carry");W=j,Y++}for(var $=z-W;$!==z&&P[$]===0;)$++;for(var et=f.repeat(F);$<z;++$)et+=e.charAt(P[$]);return et}function E(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var F=0;if(I[F]!==" "){for(var W=0,Y=0;I[F]===f;)W++,F++;for(var B=(I.length-F)*h+1>>>0,z=new Uint8Array(B);I[F];){var P=r[I.charCodeAt(F)];if(P===255)return;for(var U=0,j=B-1;(P!==0||U<Y)&&j!==-1;j--,U++)P+=l*z[j]>>>0,z[j]=P%256>>>0,P=P/256>>>0;if(P!==0)throw new Error("Non-zero carry");Y=U,F++}if(I[F]!==" "){for(var m=B-Y;m!==B&&z[m]===0;)m++;for(var $=new Uint8Array(W+(B-m)),et=W;m!==B;)$[et++]=z[m++];return $}}}function x(I){var F=E(I);if(F)return F;throw new Error(`Non-${t} character`)}return{encode:_,decodeUnsafe:E,decode:x}}var n5=r5,i5=n5;const N1=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},s5=e=>new TextEncoder().encode(e),o5=e=>new TextDecoder().decode(e);class a5{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class c5{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return T1(this,t)}}class l5{constructor(t){this.decoders=t}or(t){return T1(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const T1=(e,t)=>new l5({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class u5{constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new a5(t,r,n),this.decoder=new c5(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const vl=({name:e,prefix:t,encode:r,decode:n})=>new u5(e,t,r,n),Ka=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=i5(r,t);return vl({prefix:e,name:t,encode:n,decode:o=>N1(i(o))})},h5=(e,t,r,n)=>{const i={};for(let g=0;g<t.length;++g)i[t[g]]=g;let o=e.length;for(;e[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,f=0,h=0;for(let g=0;g<o;++g){const _=i[e[g]];if(_===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|_,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},f5=(e,t,r)=>{const n=t[t.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let f=0;f<e.length;++f)for(l=l<<8|e[f],c+=8;c>r;)c-=r,o+=t[i&l>>c];if(c&&(o+=t[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},Dr=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>vl({prefix:t,name:e,encode(i){return f5(i,n,r)},decode(i){return h5(i,n,r,e)}}),d5=vl({prefix:"\0",name:"identity",encode:e=>o5(e),decode:e=>s5(e)});var p5=Object.freeze({__proto__:null,identity:d5});const g5=Dr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var m5=Object.freeze({__proto__:null,base2:g5});const v5=Dr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var w5=Object.freeze({__proto__:null,base8:v5});const y5=Ka({prefix:"9",name:"base10",alphabet:"0123456789"});var b5=Object.freeze({__proto__:null,base10:y5});const _5=Dr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),E5=Dr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var A5=Object.freeze({__proto__:null,base16:_5,base16upper:E5});const x5=Dr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),I5=Dr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),S5=Dr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),C5=Dr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),D5=Dr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),O5=Dr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),P5=Dr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),M5=Dr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),$5=Dr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var N5=Object.freeze({__proto__:null,base32:x5,base32upper:I5,base32pad:S5,base32padupper:C5,base32hex:D5,base32hexupper:O5,base32hexpad:P5,base32hexpadupper:M5,base32z:$5});const T5=Ka({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),R5=Ka({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var L5=Object.freeze({__proto__:null,base36:T5,base36upper:R5});const B5=Ka({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),U5=Ka({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var F5=Object.freeze({__proto__:null,base58btc:B5,base58flickr:U5});const j5=Dr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),k5=Dr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),q5=Dr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),z5=Dr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var H5=Object.freeze({__proto__:null,base64:j5,base64pad:k5,base64url:q5,base64urlpad:z5});const R1=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}"),K5=R1.reduce((e,t,r)=>(e[r]=t,e),[]),W5=R1.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function V5(e){return e.reduce((t,r)=>(t+=K5[r],t),"")}function G5(e){const t=[];for(const r of e){const n=W5[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const Y5=vl({prefix:"\u{1F680}",name:"base256emoji",encode:V5,decode:G5});var Q5=Object.freeze({__proto__:null,base256emoji:Y5}),J5=B1,L1=128,Z5=127,X5=~Z5,t8=Math.pow(2,31);function B1(e,t,r){t=t||[],r=r||0;for(var n=r;e>=t8;)t[r++]=e&255|L1,e/=128;for(;e&X5;)t[r++]=e&255|L1,e>>>=7;return t[r]=e|0,B1.bytes=r-n+1,t}var e8=Xh,r8=128,U1=127;function Xh(e,n){var r=0,n=n||0,i=0,o=n,c,l=e.length;do{if(o>=l)throw Xh.bytes=0,new RangeError("Could not decode varint");c=e[o++],r+=i<28?(c&U1)<<i:(c&U1)*Math.pow(2,i),i+=7}while(c>=r8);return Xh.bytes=o-n,r}var n8=Math.pow(2,7),i8=Math.pow(2,14),s8=Math.pow(2,21),o8=Math.pow(2,28),a8=Math.pow(2,35),c8=Math.pow(2,42),l8=Math.pow(2,49),u8=Math.pow(2,56),h8=Math.pow(2,63),f8=function(e){return e<n8?1:e<i8?2:e<s8?3:e<o8?4:e<a8?5:e<c8?6:e<l8?7:e<u8?8:e<h8?9:10},d8={encode:J5,decode:e8,encodingLength:f8},F1=d8;const j1=(e,t,r=0)=>(F1.encode(e,t,r),t),k1=e=>F1.encodingLength(e),tf=(e,t)=>{const r=t.byteLength,n=k1(e),i=n+k1(r),o=new Uint8Array(i+r);return j1(e,o,0),j1(r,o,n),o.set(t,i),new p8(e,r,t,o)};class p8{constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}}const q1=({name:e,code:t,encode:r})=>new g8(e,t,r);class g8{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){const r=this.encode(t);return r instanceof Uint8Array?tf(this.code,r):r.then(n=>tf(this.code,n))}else throw Error("Unknown type, must be binary type")}}const z1=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),m8=q1({name:"sha2-256",code:18,encode:z1("SHA-256")}),v8=q1({name:"sha2-512",code:19,encode:z1("SHA-512")});var w8=Object.freeze({__proto__:null,sha256:m8,sha512:v8});const H1=0,y8="identity",K1=N1;var b8=Object.freeze({__proto__:null,identity:{code:H1,name:y8,encode:K1,digest:e=>tf(H1,K1(e))}});new TextEncoder,new TextDecoder;const Bo={...p5,...m5,...w5,...b5,...A5,...N5,...L5,...F5,...H5,...Q5};({...w8,...b8});function W1(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const V1=W1("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),ef=W1("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=M1(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),G1={utf8:V1,"utf-8":V1,hex:Bo.base16,latin1:ef,ascii:ef,binary:ef,...Bo};function Gn(e,t="utf8"){const r=G1[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}function Yn(e,t="utf8"){const r=G1[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}const _8={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},E8=":";function Wa(e){const[t,r]=e.split(E8);return{namespace:t,reference:r}}function Y1(e,t=[]){const r=[];return Object.keys(e).forEach(n=>{if(t.length&&!t.includes(n))return;const i=e[n];r.push(...i.accounts)}),r}function Q1(e,t){return e.includes(":")?[e]:t.chains||[]}var A8=Object.defineProperty,J1=Object.getOwnPropertySymbols,x8=Object.prototype.hasOwnProperty,I8=Object.prototype.propertyIsEnumerable,Z1=(e,t,r)=>t in e?A8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,X1=(e,t)=>{for(var r in t||(t={}))x8.call(t,r)&&Z1(e,r,t[r]);if(J1)for(var r of J1(t))I8.call(t,r)&&Z1(e,r,t[r]);return e};const S8="ReactNative",gn={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},C8="js";function Va(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Uo(){return!kh()&&!!qh()&&navigator.product===S8}function Fo(){return!Va()&&!!qh()&&!!kh()}function Ga(){return Uo()?gn.reactNative:Va()?gn.node:Fo()?gn.browser:gn.unknown}function D8(){var e;try{return Uo()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(e=global.Application)==null?void 0:e.applicationId:void 0}catch{return}}function O8(e,t){let r=za.parse(e);return r=X1(X1({},r),t),e=za.stringify(r),e}function P8(){return f1()||{name:"",description:"",url:"",icons:[""]}}function M8(){if(Ga()===gn.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const e=m3();if(e===null)return"unknown";const t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return e.type==="browser"?[t,e.name,e.version].join("-"):[t,e.version].join("-")}function $8(){var e;const t=Ga();return t===gn.browser?[t,((e=h1())==null?void 0:e.host)||"unknown"].join(":"):t}function N8(e,t,r){const n=M8(),i=$8();return[[e,t].join("-"),[C8,r].join("-"),n,i].join("/")}function T8({protocol:e,version:t,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:c,bundleId:l}){const f=r.split("?"),h=N8(e,t,n),g={auth:i,ua:h,projectId:o,useOnCloseEvent:c||void 0,origin:l||void 0},_=O8(f[1]||"",g);return f[0]+"?"+_}function ks(e,t){return e.filter(r=>t.includes(r)).length===e.length}function tg(e){return Object.fromEntries(e.entries())}function eg(e){return new Map(Object.entries(e))}function qs(e=yt.FIVE_MINUTES,t){const r=yt.toMiliseconds(e||yt.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(t))},r),n=c,i=l})}}function jo(e,t,r){return new Promise(async(n,i)=>{const o=setTimeout(()=>i(new Error(r)),t);try{const c=await e;n(c)}catch(c){i(c)}clearTimeout(o)})}function rg(e,t){if(typeof t=="string"&&t.startsWith(`${e}:`))return t;if(e.toLowerCase()==="topic"){if(typeof t!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}else if(e.toLowerCase()==="id"){if(typeof t!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function R8(e){return rg("topic",e)}function L8(e){return rg("id",e)}function ng(e){const[t,r]=e.split(":"),n={id:void 0,topic:void 0};if(t==="topic"&&typeof r=="string")n.topic=r;else if(t==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);return n}function Or(e,t){return yt.fromMiliseconds((t||Date.now())+yt.toMiliseconds(e))}function cs(e){return Date.now()>=yt.toMiliseconds(e)}function we(e,t){return`${e}${t?`:${t}`:""}`}function wl(e=[],t=[]){return[...new Set([...e,...t])]}async function B8({id:e,topic:t,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=${e}&sessionTopic=${t}`,c=Ga();c===gn.browser?o.startsWith("https://")||o.startsWith("http://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,"_self","noreferrer noopener"):c===gn.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(n){console.error(n)}}async function U8(e,t){try{return await e.getItem(t)||(Fo()?localStorage.getItem(t):void 0)}catch(r){console.error(r)}}var ig=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function F8(e){var t=e.default;if(typeof t=="function"){var r=function(){return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var sg={exports:{}};/**
|
|
14
|
+
***************************************************************************** */var a0=function(t,e){return a0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},a0(t,e)};function N4(t,e){a0(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var c0=function(){return c0=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},c0.apply(this,arguments)};function R4(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function T4(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var u=t.length-1;u>=0;u--)(a=t[u])&&(s=(n<3?a(s):n>3?a(e,r,s):a(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s}function F4(t,e){return function(r,i){e(r,i,t)}}function L4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function B4(t,e,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function u(y){try{p(i.next(y))}catch(_){a(_)}}function d(y){try{p(i.throw(y))}catch(_){a(_)}}function p(y){y.done?s(y.value):n(y.value).then(u,d)}p((i=i.apply(t,e||[])).next())})}function U4(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(p){return function(y){return d([p,y])}}function d(p){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=p[0]&2?n.return:p[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,p[1])).done)return s;switch(n=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,n=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){r.label=p[1];break}if(p[0]===6&&r.label<s[1]){r.label=s[1],s=p;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(p);break}s[2]&&r.ops.pop(),r.trys.pop();continue}p=e.call(t,r)}catch(y){p=[6,y],n=0}finally{i=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function k4(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}function j4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function u0(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Qg(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(u){a={error:u}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s}function q4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Qg(arguments[e]));return t}function z4(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],a=0,u=s.length;a<u;a++,n++)i[n]=s[a];return i}function jc(t){return this instanceof jc?(this.v=t,this):new jc(t)}function H4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(C){i[C]&&(n[C]=function(I){return new Promise(function(M,B){s.push([C,I,M,B])>1||u(C,I)})})}function u(C,I){try{d(i[C](I))}catch(M){_(s[0][3],M)}}function d(C){C.value instanceof jc?Promise.resolve(C.value.v).then(p,y):_(s[0][2],C)}function p(C){u("next",C)}function y(C){u("throw",C)}function _(C,I){C(I),s.shift(),s.length&&u(s[0][0],s[0][1])}}function K4(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,s){e[n]=t[n]?function(a){return(r=!r)?{value:jc(t[n](a)),done:n==="return"}:s?s(a):a}:s}}function W4(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 u0=="function"?u0(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(s){r[s]=t[s]&&function(a){return new Promise(function(u,d){a=t[s](a),n(u,d,a.done,a.value)})}}function n(s,a,u,d){Promise.resolve(d).then(function(p){s({value:p,done:u})},a)}}function V4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function G4(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 Y4(t){return t&&t.__esModule?t:{default:t}}function J4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Q4(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 Z4=Object.freeze({__proto__:null,__extends:N4,get __assign(){return c0},__rest:R4,__decorate:T4,__param:F4,__metadata:L4,__awaiter:B4,__generator:U4,__createBinding:k4,__exportStar:j4,__values:u0,__read:Qg,__spread:q4,__spreadArrays:z4,__await:jc,__asyncGenerator:H4,__asyncDelegator:K4,__asyncValues:W4,__makeTemplateObject:V4,__importStar:G4,__importDefault:Y4,__classPrivateFieldGet:J4,__classPrivateFieldSet:Q4}),mf=o0(Z4),f0={},qc={},Zg;function X4(){if(Zg)return qc;Zg=1,Object.defineProperty(qc,"__esModule",{value:!0}),qc.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return qc.delay=t,qc}var Co={},h0={},Do={},Xg;function e8(){return Xg||(Xg=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.ONE_THOUSAND=Do.ONE_HUNDRED=void 0,Do.ONE_HUNDRED=100,Do.ONE_THOUSAND=1e3),Do}var l0={},e2;function t8(){return e2||(e2=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}(l0)),l0}var t2;function r2(){return t2||(t2=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=mf;e.__exportStar(e8(),t),e.__exportStar(t8(),t)}(h0)),h0}var i2;function r8(){if(i2)return Co;i2=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.fromMiliseconds=Co.toMiliseconds=void 0;const t=r2();function e(i){return i*t.ONE_THOUSAND}Co.toMiliseconds=e;function r(i){return Math.floor(i/t.ONE_THOUSAND)}return Co.fromMiliseconds=r,Co}var n2;function i8(){return n2||(n2=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=mf;e.__exportStar(X4(),t),e.__exportStar(r8(),t)}(f0)),f0}var xa={},s2;function n8(){if(s2)return xa;s2=1,Object.defineProperty(xa,"__esModule",{value:!0}),xa.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 i=this.get(r);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const n=Date.now()-i.started;this.timestamps.set(r,{started:i.started,elapsed:n})}get(r){const i=this.timestamps.get(r);if(typeof i>"u")throw new Error(`No timestamp found for label: ${r}`);return i}elapsed(r){const i=this.get(r);return i.elapsed||Date.now()-i.started}}return xa.Watch=t,xa.default=t,xa}var d0={},zc={},o2;function s8(){if(o2)return zc;o2=1,Object.defineProperty(zc,"__esModule",{value:!0}),zc.IWatch=void 0;class t{}return zc.IWatch=t,zc}var a2;function o8(){return a2||(a2=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),mf.__exportStar(s8(),t)}(d0)),d0}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=mf;e.__exportStar(i8(),t),e.__exportStar(n8(),t),e.__exportStar(o8(),t),e.__exportStar(r2(),t)})(He);var ir={};Object.defineProperty(ir,"__esModule",{value:!0}),ir.getLocalStorage=ir.getLocalStorageOrThrow=ir.getCrypto=ir.getCryptoOrThrow=c2=ir.getLocation=ir.getLocationOrThrow=g0=ir.getNavigator=ir.getNavigatorOrThrow=p0=ir.getDocument=ir.getDocumentOrThrow=ir.getFromWindowOrThrow=ir.getFromWindow=void 0;function Po(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}ir.getFromWindow=Po;function Sa(t){const e=Po(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}ir.getFromWindowOrThrow=Sa;function a8(){return Sa("document")}ir.getDocumentOrThrow=a8;function c8(){return Po("document")}var p0=ir.getDocument=c8;function u8(){return Sa("navigator")}ir.getNavigatorOrThrow=u8;function f8(){return Po("navigator")}var g0=ir.getNavigator=f8;function h8(){return Sa("location")}ir.getLocationOrThrow=h8;function l8(){return Po("location")}var c2=ir.getLocation=l8;function d8(){return Sa("crypto")}ir.getCryptoOrThrow=d8;function p8(){return Po("crypto")}ir.getCrypto=p8;function g8(){return Sa("localStorage")}ir.getLocalStorageOrThrow=g8;function v8(){return Po("localStorage")}ir.getLocalStorage=v8;var v0={};Object.defineProperty(v0,"__esModule",{value:!0});var u2=v0.getWindowMetadata=void 0;const f2=ir;function m8(){let t,e;try{t=f2.getDocumentOrThrow(),e=f2.getLocationOrThrow()}catch{return null}function r(){const _=t.getElementsByTagName("link"),C=[];for(let I=0;I<_.length;I++){const M=_[I],B=M.getAttribute("rel");if(B&&B.toLowerCase().indexOf("icon")>-1){const W=M.getAttribute("href");if(W)if(W.toLowerCase().indexOf("https:")===-1&&W.toLowerCase().indexOf("http:")===-1&&W.indexOf("//")!==0){let Y=e.protocol+"//"+e.host;if(W.indexOf("/")===0)Y+=W;else{const q=e.pathname.split("/");q.pop();const V=q.join("/");Y+=V+"/"+W}C.push(Y)}else if(W.indexOf("//")===0){const Y=e.protocol+W;C.push(Y)}else C.push(W)}}return C}function i(..._){const C=t.getElementsByTagName("meta");for(let I=0;I<C.length;I++){const M=C[I],B=["itemprop","property","name"].map(W=>M.getAttribute(W)).filter(W=>W?_.includes(W):!1);if(B.length&&B){const W=M.getAttribute("content");if(W)return W}}return""}function n(){let _=i("name","og:site_name","og:title","twitter:title");return _||(_=t.title),_}function s(){return i("description","og:description","twitter:description","keywords")}const a=n(),u=s(),d=e.origin,p=r();return{description:u,url:d,icons:p,name:a}}u2=v0.getWindowMetadata=m8;var Hc={},b8=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),h2="%[a-f0-9]{2}",l2=new RegExp("("+h2+")|([^%]+?)","gi"),d2=new RegExp("("+h2+")+","gi");function m0(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),i=t.slice(e);return Array.prototype.concat.call([],m0(r),m0(i))}function y8(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(l2)||[],r=1;r<e.length;r++)t=m0(e,r).join(""),e=t.match(l2)||[];return t}}function w8(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=d2.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var i=y8(r[0]);i!==r[0]&&(e[r[0]]=i)}r=d2.exec(t)}e["%C2"]="\uFFFD";for(var n=Object.keys(e),s=0;s<n.length;s++){var a=n[s];t=t.replace(new RegExp(a,"g"),e[a])}return t}var _8=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 w8(t)}},A8=(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)]},E8=function(t,e){for(var r={},i=Object.keys(t),n=Array.isArray(e),s=0;s<i.length;s++){var a=i[s],u=t[a];(n?e.indexOf(a)!==-1:e(a,u,t))&&(r[a]=u)}return r};(function(t){const e=b8,r=_8,i=A8,n=E8,s=q=>q==null,a=Symbol("encodeFragmentIdentifier");function u(q){switch(q.arrayFormat){case"index":return V=>(U,z)=>{const K=U.length;return z===void 0||q.skipNull&&z===null||q.skipEmptyString&&z===""?U:z===null?[...U,[y(V,q),"[",K,"]"].join("")]:[...U,[y(V,q),"[",y(K,q),"]=",y(z,q)].join("")]};case"bracket":return V=>(U,z)=>z===void 0||q.skipNull&&z===null||q.skipEmptyString&&z===""?U:z===null?[...U,[y(V,q),"[]"].join("")]:[...U,[y(V,q),"[]=",y(z,q)].join("")];case"colon-list-separator":return V=>(U,z)=>z===void 0||q.skipNull&&z===null||q.skipEmptyString&&z===""?U:z===null?[...U,[y(V,q),":list="].join("")]:[...U,[y(V,q),":list=",y(z,q)].join("")];case"comma":case"separator":case"bracket-separator":{const V=q.arrayFormat==="bracket-separator"?"[]=":"=";return U=>(z,K)=>K===void 0||q.skipNull&&K===null||q.skipEmptyString&&K===""?z:(K=K===null?"":K,z.length===0?[[y(U,q),V,y(K,q)].join("")]:[[z,y(K,q)].join(q.arrayFormatSeparator)])}default:return V=>(U,z)=>z===void 0||q.skipNull&&z===null||q.skipEmptyString&&z===""?U:z===null?[...U,y(V,q)]:[...U,[y(V,q),"=",y(z,q)].join("")]}}function d(q){let V;switch(q.arrayFormat){case"index":return(U,z,K)=>{if(V=/\[(\d*)\]$/.exec(U),U=U.replace(/\[\d*\]$/,""),!V){K[U]=z;return}K[U]===void 0&&(K[U]={}),K[U][V[1]]=z};case"bracket":return(U,z,K)=>{if(V=/(\[\])$/.exec(U),U=U.replace(/\[\]$/,""),!V){K[U]=z;return}if(K[U]===void 0){K[U]=[z];return}K[U]=[].concat(K[U],z)};case"colon-list-separator":return(U,z,K)=>{if(V=/(:list)$/.exec(U),U=U.replace(/:list$/,""),!V){K[U]=z;return}if(K[U]===void 0){K[U]=[z];return}K[U]=[].concat(K[U],z)};case"comma":case"separator":return(U,z,K)=>{const A=typeof z=="string"&&z.includes(q.arrayFormatSeparator),j=typeof z=="string"&&!A&&_(z,q).includes(q.arrayFormatSeparator);z=j?_(z,q):z;const ee=A||j?z.split(q.arrayFormatSeparator).map(re=>_(re,q)):z===null?z:_(z,q);K[U]=ee};case"bracket-separator":return(U,z,K)=>{const A=/(\[\])$/.test(U);if(U=U.replace(/\[\]$/,""),!A){K[U]=z&&_(z,q);return}const j=z===null?[]:z.split(q.arrayFormatSeparator).map(ee=>_(ee,q));if(K[U]===void 0){K[U]=j;return}K[U]=[].concat(K[U],j)};default:return(U,z,K)=>{if(K[U]===void 0){K[U]=z;return}K[U]=[].concat(K[U],z)}}}function p(q){if(typeof q!="string"||q.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function y(q,V){return V.encode?V.strict?e(q):encodeURIComponent(q):q}function _(q,V){return V.decode?r(q):q}function C(q){return Array.isArray(q)?q.sort():typeof q=="object"?C(Object.keys(q)).sort((V,U)=>Number(V)-Number(U)).map(V=>q[V]):q}function I(q){const V=q.indexOf("#");return V!==-1&&(q=q.slice(0,V)),q}function M(q){let V="";const U=q.indexOf("#");return U!==-1&&(V=q.slice(U)),V}function B(q){q=I(q);const V=q.indexOf("?");return V===-1?"":q.slice(V+1)}function W(q,V){return V.parseNumbers&&!Number.isNaN(Number(q))&&typeof q=="string"&&q.trim()!==""?q=Number(q):V.parseBooleans&&q!==null&&(q.toLowerCase()==="true"||q.toLowerCase()==="false")&&(q=q.toLowerCase()==="true"),q}function Y(q,V){V=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},V),p(V.arrayFormatSeparator);const U=d(V),z=Object.create(null);if(typeof q!="string"||(q=q.trim().replace(/^[?#&]/,""),!q))return z;for(const K of q.split("&")){if(K==="")continue;let[A,j]=i(V.decode?K.replace(/\+/g," "):K,"=");j=j===void 0?null:["comma","separator","bracket-separator"].includes(V.arrayFormat)?j:_(j,V),U(_(A,V),j,z)}for(const K of Object.keys(z)){const A=z[K];if(typeof A=="object"&&A!==null)for(const j of Object.keys(A))A[j]=W(A[j],V);else z[K]=W(A,V)}return V.sort===!1?z:(V.sort===!0?Object.keys(z).sort():Object.keys(z).sort(V.sort)).reduce((K,A)=>{const j=z[A];return j&&typeof j=="object"&&!Array.isArray(j)?K[A]=C(j):K[A]=j,K},Object.create(null))}t.extract=B,t.parse=Y,t.stringify=(q,V)=>{if(!q)return"";V=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},V),p(V.arrayFormatSeparator);const U=j=>V.skipNull&&s(q[j])||V.skipEmptyString&&q[j]==="",z=u(V),K={};for(const j of Object.keys(q))U(j)||(K[j]=q[j]);const A=Object.keys(K);return V.sort!==!1&&A.sort(V.sort),A.map(j=>{const ee=q[j];return ee===void 0?"":ee===null?y(j,V):Array.isArray(ee)?ee.length===0&&V.arrayFormat==="bracket-separator"?y(j,V)+"[]":ee.reduce(z(j),[]).join("&"):y(j,V)+"="+y(ee,V)}).filter(j=>j.length>0).join("&")},t.parseUrl=(q,V)=>{V=Object.assign({decode:!0},V);const[U,z]=i(q,"#");return Object.assign({url:U.split("?")[0]||"",query:Y(B(q),V)},V&&V.parseFragmentIdentifier&&z?{fragmentIdentifier:_(z,V)}:{})},t.stringifyUrl=(q,V)=>{V=Object.assign({encode:!0,strict:!0,[a]:!0},V);const U=I(q.url).split("?")[0]||"",z=t.extract(q.url),K=t.parse(z,{sort:!1}),A=Object.assign(K,q.query);let j=t.stringify(A,V);j&&(j=`?${j}`);let ee=M(q.url);return q.fragmentIdentifier&&(ee=`#${V[a]?y(q.fragmentIdentifier,V):q.fragmentIdentifier}`),`${U}${j}${ee}`},t.pick=(q,V,U)=>{U=Object.assign({parseFragmentIdentifier:!0,[a]:!1},U);const{url:z,query:K,fragmentIdentifier:A}=t.parseUrl(q,U);return t.stringifyUrl({url:z,query:n(K,V),fragmentIdentifier:A},U)},t.exclude=(q,V,U)=>{const z=Array.isArray(V)?K=>!V.includes(K):(K,A)=>!V(K,A);return t.pick(q,z,U)}})(Hc);var b0={},bf={},_t={},p2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(u,d){var p=u>>>16&65535,y=u&65535,_=d>>>16&65535,C=d&65535;return y*C+(p*C+y*_<<16>>>0)|0}t.mul=Math.imul||e;function r(u,d){return u+d|0}t.add=r;function i(u,d){return u-d|0}t.sub=i;function n(u,d){return u<<d|u>>>32-d}t.rotl=n;function s(u,d){return u<<32-d|u>>>d}t.rotr=s;function a(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}t.isInteger=Number.isInteger||a,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(u){return t.isInteger(u)&&u>=-t.MAX_SAFE_INTEGER&&u<=t.MAX_SAFE_INTEGER}})(p2),Object.defineProperty(_t,"__esModule",{value:!0});var g2=p2;function x8(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}_t.readInt16BE=x8;function S8(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}_t.readUint16BE=S8;function I8(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}_t.readInt16LE=I8;function M8(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}_t.readUint16LE=M8;function v2(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}_t.writeUint16BE=v2,_t.writeInt16BE=v2;function m2(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}_t.writeUint16LE=m2,_t.writeInt16LE=m2;function y0(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}_t.readInt32BE=y0;function w0(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}_t.readUint32BE=w0;function _0(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}_t.readInt32LE=_0;function A0(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}_t.readUint32LE=A0;function yf(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}_t.writeUint32BE=yf,_t.writeInt32BE=yf;function wf(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}_t.writeUint32LE=wf,_t.writeInt32LE=wf;function C8(t,e){e===void 0&&(e=0);var r=y0(t,e),i=y0(t,e+4);return r*4294967296+i-(i>>31)*4294967296}_t.readInt64BE=C8;function D8(t,e){e===void 0&&(e=0);var r=w0(t,e),i=w0(t,e+4);return r*4294967296+i}_t.readUint64BE=D8;function P8(t,e){e===void 0&&(e=0);var r=_0(t,e),i=_0(t,e+4);return i*4294967296+r-(r>>31)*4294967296}_t.readInt64LE=P8;function O8(t,e){e===void 0&&(e=0);var r=A0(t,e),i=A0(t,e+4);return i*4294967296+r}_t.readUint64LE=O8;function b2(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),yf(t/4294967296>>>0,e,r),yf(t>>>0,e,r+4),e}_t.writeUint64BE=b2,_t.writeInt64BE=b2;function y2(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),wf(t>>>0,e,r),wf(t/4294967296>>>0,e,r+4),e}_t.writeUint64LE=y2,_t.writeInt64LE=y2;function $8(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 i=0,n=1,s=t/8+r-1;s>=r;s--)i+=e[s]*n,n*=256;return i}_t.readUintBE=$8;function N8(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 i=0,n=1,s=r;s<r+t/8;s++)i+=e[s]*n,n*=256;return i}_t.readUintLE=N8;function R8(t,e,r,i){if(r===void 0&&(r=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!g2.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var n=1,s=t/8+i-1;s>=i;s--)r[s]=e/n&255,n*=256;return r}_t.writeUintBE=R8;function T8(t,e,r,i){if(r===void 0&&(r=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!g2.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var n=1,s=i;s<i+t/8;s++)r[s]=e/n&255,n*=256;return r}_t.writeUintLE=T8;function F8(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}_t.readFloat32BE=F8;function L8(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}_t.readFloat32LE=L8;function B8(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}_t.readFloat64BE=B8;function U8(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}_t.readFloat64LE=U8;function k8(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(r,t),e}_t.writeFloat32BE=k8;function j8(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(r,t,!0),e}_t.writeFloat32LE=j8;function q8(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(r,t),e}_t.writeFloat64BE=q8;function z8(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(r,t,!0),e}_t.writeFloat64LE=z8;var Fi={};Object.defineProperty(Fi,"__esModule",{value:!0});function H8(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Fi.wipe=H8,Object.defineProperty(bf,"__esModule",{value:!0});var Yr=_t,E0=Fi,K8=20;function W8(t,e,r){for(var i=1634760805,n=857760878,s=2036477234,a=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],d=r[7]<<24|r[6]<<16|r[5]<<8|r[4],p=r[11]<<24|r[10]<<16|r[9]<<8|r[8],y=r[15]<<24|r[14]<<16|r[13]<<8|r[12],_=r[19]<<24|r[18]<<16|r[17]<<8|r[16],C=r[23]<<24|r[22]<<16|r[21]<<8|r[20],I=r[27]<<24|r[26]<<16|r[25]<<8|r[24],M=r[31]<<24|r[30]<<16|r[29]<<8|r[28],B=e[3]<<24|e[2]<<16|e[1]<<8|e[0],W=e[7]<<24|e[6]<<16|e[5]<<8|e[4],Y=e[11]<<24|e[10]<<16|e[9]<<8|e[8],q=e[15]<<24|e[14]<<16|e[13]<<8|e[12],V=i,U=n,z=s,K=a,A=u,j=d,ee=p,re=y,k=_,w=C,f=I,h=M,g=B,E=W,D=Y,P=q,x=0;x<K8;x+=2)V=V+A|0,g^=V,g=g>>>32-16|g<<16,k=k+g|0,A^=k,A=A>>>32-12|A<<12,U=U+j|0,E^=U,E=E>>>32-16|E<<16,w=w+E|0,j^=w,j=j>>>32-12|j<<12,z=z+ee|0,D^=z,D=D>>>32-16|D<<16,f=f+D|0,ee^=f,ee=ee>>>32-12|ee<<12,K=K+re|0,P^=K,P=P>>>32-16|P<<16,h=h+P|0,re^=h,re=re>>>32-12|re<<12,z=z+ee|0,D^=z,D=D>>>32-8|D<<8,f=f+D|0,ee^=f,ee=ee>>>32-7|ee<<7,K=K+re|0,P^=K,P=P>>>32-8|P<<8,h=h+P|0,re^=h,re=re>>>32-7|re<<7,U=U+j|0,E^=U,E=E>>>32-8|E<<8,w=w+E|0,j^=w,j=j>>>32-7|j<<7,V=V+A|0,g^=V,g=g>>>32-8|g<<8,k=k+g|0,A^=k,A=A>>>32-7|A<<7,V=V+j|0,P^=V,P=P>>>32-16|P<<16,f=f+P|0,j^=f,j=j>>>32-12|j<<12,U=U+ee|0,g^=U,g=g>>>32-16|g<<16,h=h+g|0,ee^=h,ee=ee>>>32-12|ee<<12,z=z+re|0,E^=z,E=E>>>32-16|E<<16,k=k+E|0,re^=k,re=re>>>32-12|re<<12,K=K+A|0,D^=K,D=D>>>32-16|D<<16,w=w+D|0,A^=w,A=A>>>32-12|A<<12,z=z+re|0,E^=z,E=E>>>32-8|E<<8,k=k+E|0,re^=k,re=re>>>32-7|re<<7,K=K+A|0,D^=K,D=D>>>32-8|D<<8,w=w+D|0,A^=w,A=A>>>32-7|A<<7,U=U+ee|0,g^=U,g=g>>>32-8|g<<8,h=h+g|0,ee^=h,ee=ee>>>32-7|ee<<7,V=V+j|0,P^=V,P=P>>>32-8|P<<8,f=f+P|0,j^=f,j=j>>>32-7|j<<7;Yr.writeUint32LE(V+i|0,t,0),Yr.writeUint32LE(U+n|0,t,4),Yr.writeUint32LE(z+s|0,t,8),Yr.writeUint32LE(K+a|0,t,12),Yr.writeUint32LE(A+u|0,t,16),Yr.writeUint32LE(j+d|0,t,20),Yr.writeUint32LE(ee+p|0,t,24),Yr.writeUint32LE(re+y|0,t,28),Yr.writeUint32LE(k+_|0,t,32),Yr.writeUint32LE(w+C|0,t,36),Yr.writeUint32LE(f+I|0,t,40),Yr.writeUint32LE(h+M|0,t,44),Yr.writeUint32LE(g+B|0,t,48),Yr.writeUint32LE(E+W|0,t,52),Yr.writeUint32LE(D+Y|0,t,56),Yr.writeUint32LE(P+q|0,t,60)}function w2(t,e,r,i,n){if(n===void 0&&(n=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<r.length)throw new Error("ChaCha: destination is shorter than source");var s,a;if(n===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),a=s.length-e.length,s.set(e,a)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,a=n}for(var u=new Uint8Array(64),d=0;d<r.length;d+=64){W8(u,s,t);for(var p=d;p<d+64&&p<r.length;p++)i[p]=r[p]^u[p-d];G8(s,0,a)}return E0.wipe(u),n===0&&E0.wipe(s),i}bf.streamXOR=w2;function V8(t,e,r,i){return i===void 0&&(i=0),E0.wipe(r),w2(t,e,r,r,i)}bf.stream=V8;function G8(t,e,r){for(var i=1;r--;)i=i+(t[e]&255)|0,t[e]=i&255,i>>>=8,e++;if(i>0)throw new Error("ChaCha: counter overflow")}var _2={},Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});function Y8(t,e,r){return~(t-1)&e|t-1&r}Gs.select=Y8;function J8(t,e){return(t|0)-(e|0)-1>>>31&1}Gs.lessOrEqual=J8;function A2(t,e){if(t.length!==e.length)return 0;for(var r=0,i=0;i<t.length;i++)r|=t[i]^e[i];return 1&r-1>>>8}Gs.compare=A2;function Q8(t,e){return t.length===0||e.length===0?!1:A2(t,e)!==0}Gs.equal=Q8,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Gs,r=Fi;t.DIGEST_LENGTH=16;var i=function(){function a(u){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 d=u[0]|u[1]<<8;this._r[0]=d&8191;var p=u[2]|u[3]<<8;this._r[1]=(d>>>13|p<<3)&8191;var y=u[4]|u[5]<<8;this._r[2]=(p>>>10|y<<6)&7939;var _=u[6]|u[7]<<8;this._r[3]=(y>>>7|_<<9)&8191;var C=u[8]|u[9]<<8;this._r[4]=(_>>>4|C<<12)&255,this._r[5]=C>>>1&8190;var I=u[10]|u[11]<<8;this._r[6]=(C>>>14|I<<2)&8191;var M=u[12]|u[13]<<8;this._r[7]=(I>>>11|M<<5)&8065;var B=u[14]|u[15]<<8;this._r[8]=(M>>>8|B<<8)&8191,this._r[9]=B>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return a.prototype._blocks=function(u,d,p){for(var y=this._fin?0:2048,_=this._h[0],C=this._h[1],I=this._h[2],M=this._h[3],B=this._h[4],W=this._h[5],Y=this._h[6],q=this._h[7],V=this._h[8],U=this._h[9],z=this._r[0],K=this._r[1],A=this._r[2],j=this._r[3],ee=this._r[4],re=this._r[5],k=this._r[6],w=this._r[7],f=this._r[8],h=this._r[9];p>=16;){var g=u[d+0]|u[d+1]<<8;_+=g&8191;var E=u[d+2]|u[d+3]<<8;C+=(g>>>13|E<<3)&8191;var D=u[d+4]|u[d+5]<<8;I+=(E>>>10|D<<6)&8191;var P=u[d+6]|u[d+7]<<8;M+=(D>>>7|P<<9)&8191;var x=u[d+8]|u[d+9]<<8;B+=(P>>>4|x<<12)&8191,W+=x>>>1&8191;var v=u[d+10]|u[d+11]<<8;Y+=(x>>>14|v<<2)&8191;var b=u[d+12]|u[d+13]<<8;q+=(v>>>11|b<<5)&8191;var L=u[d+14]|u[d+15]<<8;V+=(b>>>8|L<<8)&8191,U+=L>>>5|y;var X=0,ce=X;ce+=_*z,ce+=C*(5*h),ce+=I*(5*f),ce+=M*(5*w),ce+=B*(5*k),X=ce>>>13,ce&=8191,ce+=W*(5*re),ce+=Y*(5*ee),ce+=q*(5*j),ce+=V*(5*A),ce+=U*(5*K),X+=ce>>>13,ce&=8191;var O=X;O+=_*K,O+=C*z,O+=I*(5*h),O+=M*(5*f),O+=B*(5*w),X=O>>>13,O&=8191,O+=W*(5*k),O+=Y*(5*re),O+=q*(5*ee),O+=V*(5*j),O+=U*(5*A),X+=O>>>13,O&=8191;var ie=X;ie+=_*A,ie+=C*K,ie+=I*z,ie+=M*(5*h),ie+=B*(5*f),X=ie>>>13,ie&=8191,ie+=W*(5*w),ie+=Y*(5*k),ie+=q*(5*re),ie+=V*(5*ee),ie+=U*(5*j),X+=ie>>>13,ie&=8191;var N=X;N+=_*j,N+=C*A,N+=I*K,N+=M*z,N+=B*(5*h),X=N>>>13,N&=8191,N+=W*(5*f),N+=Y*(5*w),N+=q*(5*k),N+=V*(5*re),N+=U*(5*ee),X+=N>>>13,N&=8191;var F=X;F+=_*ee,F+=C*j,F+=I*A,F+=M*K,F+=B*z,X=F>>>13,F&=8191,F+=W*(5*h),F+=Y*(5*f),F+=q*(5*w),F+=V*(5*k),F+=U*(5*re),X+=F>>>13,F&=8191;var R=X;R+=_*re,R+=C*ee,R+=I*j,R+=M*A,R+=B*K,X=R>>>13,R&=8191,R+=W*z,R+=Y*(5*h),R+=q*(5*f),R+=V*(5*w),R+=U*(5*k),X+=R>>>13,R&=8191;var l=X;l+=_*k,l+=C*re,l+=I*ee,l+=M*j,l+=B*A,X=l>>>13,l&=8191,l+=W*K,l+=Y*z,l+=q*(5*h),l+=V*(5*f),l+=U*(5*w),X+=l>>>13,l&=8191;var $=X;$+=_*w,$+=C*k,$+=I*re,$+=M*ee,$+=B*j,X=$>>>13,$&=8191,$+=W*A,$+=Y*K,$+=q*z,$+=V*(5*h),$+=U*(5*f),X+=$>>>13,$&=8191;var Z=X;Z+=_*f,Z+=C*w,Z+=I*k,Z+=M*re,Z+=B*ee,X=Z>>>13,Z&=8191,Z+=W*j,Z+=Y*A,Z+=q*K,Z+=V*z,Z+=U*(5*h),X+=Z>>>13,Z&=8191;var ae=X;ae+=_*h,ae+=C*f,ae+=I*w,ae+=M*k,ae+=B*re,X=ae>>>13,ae&=8191,ae+=W*ee,ae+=Y*j,ae+=q*A,ae+=V*K,ae+=U*z,X+=ae>>>13,ae&=8191,X=(X<<2)+X|0,X=X+ce|0,ce=X&8191,X=X>>>13,O+=X,_=ce,C=O,I=ie,M=N,B=F,W=R,Y=l,q=$,V=Z,U=ae,d+=16,p-=16}this._h[0]=_,this._h[1]=C,this._h[2]=I,this._h[3]=M,this._h[4]=B,this._h[5]=W,this._h[6]=Y,this._h[7]=q,this._h[8]=V,this._h[9]=U},a.prototype.finish=function(u,d){d===void 0&&(d=0);var p=new Uint16Array(10),y,_,C,I;if(this._leftover){for(I=this._leftover,this._buffer[I++]=1;I<16;I++)this._buffer[I]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(y=this._h[1]>>>13,this._h[1]&=8191,I=2;I<10;I++)this._h[I]+=y,y=this._h[I]>>>13,this._h[I]&=8191;for(this._h[0]+=y*5,y=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=y,y=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=y,p[0]=this._h[0]+5,y=p[0]>>>13,p[0]&=8191,I=1;I<10;I++)p[I]=this._h[I]+y,y=p[I]>>>13,p[I]&=8191;for(p[9]-=8192,_=(y^1)-1,I=0;I<10;I++)p[I]&=_;for(_=~_,I=0;I<10;I++)this._h[I]=this._h[I]&_|p[I];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,C=this._h[0]+this._pad[0],this._h[0]=C&65535,I=1;I<8;I++)C=(this._h[I]+this._pad[I]|0)+(C>>>16)|0,this._h[I]=C&65535;return u[d+0]=this._h[0]>>>0,u[d+1]=this._h[0]>>>8,u[d+2]=this._h[1]>>>0,u[d+3]=this._h[1]>>>8,u[d+4]=this._h[2]>>>0,u[d+5]=this._h[2]>>>8,u[d+6]=this._h[3]>>>0,u[d+7]=this._h[3]>>>8,u[d+8]=this._h[4]>>>0,u[d+9]=this._h[4]>>>8,u[d+10]=this._h[5]>>>0,u[d+11]=this._h[5]>>>8,u[d+12]=this._h[6]>>>0,u[d+13]=this._h[6]>>>8,u[d+14]=this._h[7]>>>0,u[d+15]=this._h[7]>>>8,this._finished=!0,this},a.prototype.update=function(u){var d=0,p=u.length,y;if(this._leftover){y=16-this._leftover,y>p&&(y=p);for(var _=0;_<y;_++)this._buffer[this._leftover+_]=u[d+_];if(p-=y,d+=y,this._leftover+=y,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(p>=16&&(y=p-p%16,this._blocks(u,d,y),d+=y,p-=y),p){for(var _=0;_<p;_++)this._buffer[this._leftover+_]=u[d+_];this._leftover+=p}return this},a.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},a.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},a}();t.Poly1305=i;function n(a,u){var d=new i(a);d.update(u);var p=d.digest();return d.clean(),p}t.oneTimeAuth=n;function s(a,u){return a.length!==t.DIGEST_LENGTH||u.length!==t.DIGEST_LENGTH?!1:e.equal(a,u)}t.equal=s}(_2),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=bf,r=_2,i=Fi,n=_t,s=Gs;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var a=new Uint8Array(16),u=function(){function d(p){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,p.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(p)}return d.prototype.seal=function(p,y,_,C){if(p.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var I=new Uint8Array(16);I.set(p,I.length-p.length);var M=new Uint8Array(32);e.stream(this._key,I,M,4);var B=y.length+this.tagLength,W;if(C){if(C.length!==B)throw new Error("ChaCha20Poly1305: incorrect destination length");W=C}else W=new Uint8Array(B);return e.streamXOR(this._key,I,y,W,4),this._authenticate(W.subarray(W.length-this.tagLength,W.length),M,W.subarray(0,W.length-this.tagLength),_),i.wipe(I),W},d.prototype.open=function(p,y,_,C){if(p.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(y.length<this.tagLength)return null;var I=new Uint8Array(16);I.set(p,I.length-p.length);var M=new Uint8Array(32);e.stream(this._key,I,M,4);var B=new Uint8Array(this.tagLength);if(this._authenticate(B,M,y.subarray(0,y.length-this.tagLength),_),!s.equal(B,y.subarray(y.length-this.tagLength,y.length)))return null;var W=y.length-this.tagLength,Y;if(C){if(C.length!==W)throw new Error("ChaCha20Poly1305: incorrect destination length");Y=C}else Y=new Uint8Array(W);return e.streamXOR(this._key,I,y.subarray(0,y.length-this.tagLength),Y,4),i.wipe(I),Y},d.prototype.clean=function(){return i.wipe(this._key),this},d.prototype._authenticate=function(p,y,_,C){var I=new r.Poly1305(y);C&&(I.update(C),C.length%16>0&&I.update(a.subarray(C.length%16))),I.update(_),_.length%16>0&&I.update(a.subarray(_.length%16));var M=new Uint8Array(8);C&&n.writeUint64LE(C.length,M),I.update(M),n.writeUint64LE(_.length,M),I.update(M);for(var B=I.digest(),W=0;W<B.length;W++)p[W]=B[W];I.clean(),i.wipe(B),i.wipe(M)},d}();t.ChaCha20Poly1305=u}(b0);var E2={},Kc={},x0={};Object.defineProperty(x0,"__esModule",{value:!0});function Z8(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}x0.isSerializableHash=Z8,Object.defineProperty(Kc,"__esModule",{value:!0});var jn=x0,X8=Gs,e7=Fi,x2=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 i=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(i).clean():i.set(r);for(var n=0;n<i.length;n++)i[n]^=54;this._inner.update(i);for(var n=0;n<i.length;n++)i[n]^=106;this._outer.update(i),jn.isSerializableHash(this._inner)&&jn.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),e7.wipe(i)}return t.prototype.reset=function(){if(!jn.isSerializableHash(this._inner)||!jn.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(){jn.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),jn.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(!jn.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(!jn.isSerializableHash(this._inner)||!jn.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(!jn.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Kc.HMAC=x2;function t7(t,e,r){var i=new x2(t,e);i.update(r);var n=i.digest();return i.clean(),n}Kc.hmac=t7,Kc.equal=X8.equal,Object.defineProperty(E2,"__esModule",{value:!0});var S2=Kc,I2=Fi,r7=function(){function t(e,r,i,n){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=n;var s=S2.hmac(this._hash,i,r);this._hmac=new S2.HMAC(e,s),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),i=0;i<r.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[i]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),I2.wipe(this._buffer),I2.wipe(this._counter),this._bufpos=0},t}(),i7=E2.HKDF=r7,Oo={},_f={},Af={};Object.defineProperty(Af,"__esModule",{value:!0}),Af.BrowserRandomSource=void 0;const M2=65536;class n7{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 i=0;i<r.length;i+=M2)this._crypto.getRandomValues(r.subarray(i,i+Math.min(r.length-i,M2)));return r}}Af.BrowserRandomSource=n7;function s7(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 Ef={},o7={},a7=Object.freeze({__proto__:null,default:o7}),S0=o0(a7);Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.NodeRandomSource=void 0;const c7=Fi;class u7{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof s7<"u"){const e=S0;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 i=new Uint8Array(e);for(let n=0;n<i.length;n++)i[n]=r[n];return(0,c7.wipe)(r),i}}Ef.NodeRandomSource=u7,Object.defineProperty(_f,"__esModule",{value:!0}),_f.SystemRandomSource=void 0;const f7=Af,h7=Ef;class l7{constructor(){if(this.isAvailable=!1,this.name="",this._source=new f7.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new h7.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)}}_f.SystemRandomSource=l7,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=_f,r=_t,i=Fi;t.defaultRandomSource=new e.SystemRandomSource;function n(p,y=t.defaultRandomSource){return y.randomBytes(p)}t.randomBytes=n;function s(p=t.defaultRandomSource){const y=n(4,p),_=(0,r.readUint32LE)(y);return(0,i.wipe)(y),_}t.randomUint32=s;const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(p,y=a,_=t.defaultRandomSource){if(y.length<2)throw new Error("randomString charset is too short");if(y.length>256)throw new Error("randomString charset is too long");let C="";const I=y.length,M=256-256%I;for(;p>0;){const B=n(Math.ceil(p*256/M),_);for(let W=0;W<B.length&&p>0;W++){const Y=B[W];Y<M&&(C+=y.charAt(Y%I),p--)}(0,i.wipe)(B)}return C}t.randomString=u;function d(p,y=a,_=t.defaultRandomSource){const C=Math.ceil(p/(Math.log(y.length)/Math.LN2));return u(C,y,_)}t.randomStringForEntropy=d}(Oo);var d7=Fg(Oo),Wc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=_t,r=Fi;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var i=function(){function u(){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 u.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},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},u.prototype.update=function(d,p){if(p===void 0&&(p=d.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var y=0;if(this._bytesHashed+=p,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&p>0;)this._buffer[this._bufferLength++]=d[y++],p--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(p>=this.blockSize&&(y=s(this._temp,this._state,d,y,p),p%=this.blockSize);p>0;)this._buffer[this._bufferLength++]=d[y++],p--;return this},u.prototype.finish=function(d){if(!this._finished){var p=this._bytesHashed,y=this._bufferLength,_=p/536870912|0,C=p<<3,I=p%64<56?64:128;this._buffer[y]=128;for(var M=y+1;M<I-8;M++)this._buffer[M]=0;e.writeUint32BE(_,this._buffer,I-8),e.writeUint32BE(C,this._buffer,I-4),s(this._temp,this._state,this._buffer,0,I),this._finished=!0}for(var M=0;M<this.digestLength/4;M++)e.writeUint32BE(this._state[M],d,M*4);return this},u.prototype.digest=function(){var d=new Uint8Array(this.digestLength);return this.finish(d),d},u.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}},u.prototype.restoreState=function(d){return this._state.set(d.state),this._bufferLength=d.bufferLength,d.buffer&&this._buffer.set(d.buffer),this._bytesHashed=d.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(d){r.wipe(d.state),d.buffer&&r.wipe(d.buffer),d.bufferLength=0,d.bytesHashed=0},u}();t.SHA256=i;var n=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 s(u,d,p,y,_){for(;_>=64;){for(var C=d[0],I=d[1],M=d[2],B=d[3],W=d[4],Y=d[5],q=d[6],V=d[7],U=0;U<16;U++){var z=y+U*4;u[U]=e.readUint32BE(p,z)}for(var U=16;U<64;U++){var K=u[U-2],A=(K>>>17|K<<32-17)^(K>>>19|K<<32-19)^K>>>10;K=u[U-15];var j=(K>>>7|K<<32-7)^(K>>>18|K<<32-18)^K>>>3;u[U]=(A+u[U-7]|0)+(j+u[U-16]|0)}for(var U=0;U<64;U++){var A=(((W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7))+(W&Y^~W&q)|0)+(V+(n[U]+u[U]|0)|0)|0,j=((C>>>2|C<<32-2)^(C>>>13|C<<32-13)^(C>>>22|C<<32-22))+(C&I^C&M^I&M)|0;V=q,q=Y,Y=W,W=B+A|0,B=M,M=I,I=C,C=A+j|0}d[0]+=C,d[1]+=I,d[2]+=M,d[3]+=B,d[4]+=W,d[5]+=Y,d[6]+=q,d[7]+=V,y+=64,_-=64}return y}function a(u){var d=new i;d.update(u);var p=d.digest();return d.clean(),p}t.hash=a})(Wc);var I0={};(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=Oo,r=Fi;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function i(U){const z=new Float64Array(16);if(U)for(let K=0;K<U.length;K++)z[K]=U[K];return z}const n=new Uint8Array(32);n[0]=9;const s=i([56129,1]);function a(U){let z=1;for(let K=0;K<16;K++){let A=U[K]+z+65535;z=Math.floor(A/65536),U[K]=A-z*65536}U[0]+=z-1+37*(z-1)}function u(U,z,K){const A=~(K-1);for(let j=0;j<16;j++){const ee=A&(U[j]^z[j]);U[j]^=ee,z[j]^=ee}}function d(U,z){const K=i(),A=i();for(let j=0;j<16;j++)A[j]=z[j];a(A),a(A),a(A);for(let j=0;j<2;j++){K[0]=A[0]-65517;for(let re=1;re<15;re++)K[re]=A[re]-65535-(K[re-1]>>16&1),K[re-1]&=65535;K[15]=A[15]-32767-(K[14]>>16&1);const ee=K[15]>>16&1;K[14]&=65535,u(A,K,1-ee)}for(let j=0;j<16;j++)U[2*j]=A[j]&255,U[2*j+1]=A[j]>>8}function p(U,z){for(let K=0;K<16;K++)U[K]=z[2*K]+(z[2*K+1]<<8);U[15]&=32767}function y(U,z,K){for(let A=0;A<16;A++)U[A]=z[A]+K[A]}function _(U,z,K){for(let A=0;A<16;A++)U[A]=z[A]-K[A]}function C(U,z,K){let A,j,ee=0,re=0,k=0,w=0,f=0,h=0,g=0,E=0,D=0,P=0,x=0,v=0,b=0,L=0,X=0,ce=0,O=0,ie=0,N=0,F=0,R=0,l=0,$=0,Z=0,ae=0,ue=0,ve=0,ge=0,Ee=0,Ye=0,De=0,Re=K[0],xe=K[1],ye=K[2],Me=K[3],Pe=K[4],pe=K[5],Se=K[6],_e=K[7],me=K[8],Te=K[9],Ce=K[10],Ae=K[11],ke=K[12],qe=K[13],Ie=K[14],Ke=K[15];A=z[0],ee+=A*Re,re+=A*xe,k+=A*ye,w+=A*Me,f+=A*Pe,h+=A*pe,g+=A*Se,E+=A*_e,D+=A*me,P+=A*Te,x+=A*Ce,v+=A*Ae,b+=A*ke,L+=A*qe,X+=A*Ie,ce+=A*Ke,A=z[1],re+=A*Re,k+=A*xe,w+=A*ye,f+=A*Me,h+=A*Pe,g+=A*pe,E+=A*Se,D+=A*_e,P+=A*me,x+=A*Te,v+=A*Ce,b+=A*Ae,L+=A*ke,X+=A*qe,ce+=A*Ie,O+=A*Ke,A=z[2],k+=A*Re,w+=A*xe,f+=A*ye,h+=A*Me,g+=A*Pe,E+=A*pe,D+=A*Se,P+=A*_e,x+=A*me,v+=A*Te,b+=A*Ce,L+=A*Ae,X+=A*ke,ce+=A*qe,O+=A*Ie,ie+=A*Ke,A=z[3],w+=A*Re,f+=A*xe,h+=A*ye,g+=A*Me,E+=A*Pe,D+=A*pe,P+=A*Se,x+=A*_e,v+=A*me,b+=A*Te,L+=A*Ce,X+=A*Ae,ce+=A*ke,O+=A*qe,ie+=A*Ie,N+=A*Ke,A=z[4],f+=A*Re,h+=A*xe,g+=A*ye,E+=A*Me,D+=A*Pe,P+=A*pe,x+=A*Se,v+=A*_e,b+=A*me,L+=A*Te,X+=A*Ce,ce+=A*Ae,O+=A*ke,ie+=A*qe,N+=A*Ie,F+=A*Ke,A=z[5],h+=A*Re,g+=A*xe,E+=A*ye,D+=A*Me,P+=A*Pe,x+=A*pe,v+=A*Se,b+=A*_e,L+=A*me,X+=A*Te,ce+=A*Ce,O+=A*Ae,ie+=A*ke,N+=A*qe,F+=A*Ie,R+=A*Ke,A=z[6],g+=A*Re,E+=A*xe,D+=A*ye,P+=A*Me,x+=A*Pe,v+=A*pe,b+=A*Se,L+=A*_e,X+=A*me,ce+=A*Te,O+=A*Ce,ie+=A*Ae,N+=A*ke,F+=A*qe,R+=A*Ie,l+=A*Ke,A=z[7],E+=A*Re,D+=A*xe,P+=A*ye,x+=A*Me,v+=A*Pe,b+=A*pe,L+=A*Se,X+=A*_e,ce+=A*me,O+=A*Te,ie+=A*Ce,N+=A*Ae,F+=A*ke,R+=A*qe,l+=A*Ie,$+=A*Ke,A=z[8],D+=A*Re,P+=A*xe,x+=A*ye,v+=A*Me,b+=A*Pe,L+=A*pe,X+=A*Se,ce+=A*_e,O+=A*me,ie+=A*Te,N+=A*Ce,F+=A*Ae,R+=A*ke,l+=A*qe,$+=A*Ie,Z+=A*Ke,A=z[9],P+=A*Re,x+=A*xe,v+=A*ye,b+=A*Me,L+=A*Pe,X+=A*pe,ce+=A*Se,O+=A*_e,ie+=A*me,N+=A*Te,F+=A*Ce,R+=A*Ae,l+=A*ke,$+=A*qe,Z+=A*Ie,ae+=A*Ke,A=z[10],x+=A*Re,v+=A*xe,b+=A*ye,L+=A*Me,X+=A*Pe,ce+=A*pe,O+=A*Se,ie+=A*_e,N+=A*me,F+=A*Te,R+=A*Ce,l+=A*Ae,$+=A*ke,Z+=A*qe,ae+=A*Ie,ue+=A*Ke,A=z[11],v+=A*Re,b+=A*xe,L+=A*ye,X+=A*Me,ce+=A*Pe,O+=A*pe,ie+=A*Se,N+=A*_e,F+=A*me,R+=A*Te,l+=A*Ce,$+=A*Ae,Z+=A*ke,ae+=A*qe,ue+=A*Ie,ve+=A*Ke,A=z[12],b+=A*Re,L+=A*xe,X+=A*ye,ce+=A*Me,O+=A*Pe,ie+=A*pe,N+=A*Se,F+=A*_e,R+=A*me,l+=A*Te,$+=A*Ce,Z+=A*Ae,ae+=A*ke,ue+=A*qe,ve+=A*Ie,ge+=A*Ke,A=z[13],L+=A*Re,X+=A*xe,ce+=A*ye,O+=A*Me,ie+=A*Pe,N+=A*pe,F+=A*Se,R+=A*_e,l+=A*me,$+=A*Te,Z+=A*Ce,ae+=A*Ae,ue+=A*ke,ve+=A*qe,ge+=A*Ie,Ee+=A*Ke,A=z[14],X+=A*Re,ce+=A*xe,O+=A*ye,ie+=A*Me,N+=A*Pe,F+=A*pe,R+=A*Se,l+=A*_e,$+=A*me,Z+=A*Te,ae+=A*Ce,ue+=A*Ae,ve+=A*ke,ge+=A*qe,Ee+=A*Ie,Ye+=A*Ke,A=z[15],ce+=A*Re,O+=A*xe,ie+=A*ye,N+=A*Me,F+=A*Pe,R+=A*pe,l+=A*Se,$+=A*_e,Z+=A*me,ae+=A*Te,ue+=A*Ce,ve+=A*Ae,ge+=A*ke,Ee+=A*qe,Ye+=A*Ie,De+=A*Ke,ee+=38*O,re+=38*ie,k+=38*N,w+=38*F,f+=38*R,h+=38*l,g+=38*$,E+=38*Z,D+=38*ae,P+=38*ue,x+=38*ve,v+=38*ge,b+=38*Ee,L+=38*Ye,X+=38*De,j=1,A=ee+j+65535,j=Math.floor(A/65536),ee=A-j*65536,A=re+j+65535,j=Math.floor(A/65536),re=A-j*65536,A=k+j+65535,j=Math.floor(A/65536),k=A-j*65536,A=w+j+65535,j=Math.floor(A/65536),w=A-j*65536,A=f+j+65535,j=Math.floor(A/65536),f=A-j*65536,A=h+j+65535,j=Math.floor(A/65536),h=A-j*65536,A=g+j+65535,j=Math.floor(A/65536),g=A-j*65536,A=E+j+65535,j=Math.floor(A/65536),E=A-j*65536,A=D+j+65535,j=Math.floor(A/65536),D=A-j*65536,A=P+j+65535,j=Math.floor(A/65536),P=A-j*65536,A=x+j+65535,j=Math.floor(A/65536),x=A-j*65536,A=v+j+65535,j=Math.floor(A/65536),v=A-j*65536,A=b+j+65535,j=Math.floor(A/65536),b=A-j*65536,A=L+j+65535,j=Math.floor(A/65536),L=A-j*65536,A=X+j+65535,j=Math.floor(A/65536),X=A-j*65536,A=ce+j+65535,j=Math.floor(A/65536),ce=A-j*65536,ee+=j-1+37*(j-1),j=1,A=ee+j+65535,j=Math.floor(A/65536),ee=A-j*65536,A=re+j+65535,j=Math.floor(A/65536),re=A-j*65536,A=k+j+65535,j=Math.floor(A/65536),k=A-j*65536,A=w+j+65535,j=Math.floor(A/65536),w=A-j*65536,A=f+j+65535,j=Math.floor(A/65536),f=A-j*65536,A=h+j+65535,j=Math.floor(A/65536),h=A-j*65536,A=g+j+65535,j=Math.floor(A/65536),g=A-j*65536,A=E+j+65535,j=Math.floor(A/65536),E=A-j*65536,A=D+j+65535,j=Math.floor(A/65536),D=A-j*65536,A=P+j+65535,j=Math.floor(A/65536),P=A-j*65536,A=x+j+65535,j=Math.floor(A/65536),x=A-j*65536,A=v+j+65535,j=Math.floor(A/65536),v=A-j*65536,A=b+j+65535,j=Math.floor(A/65536),b=A-j*65536,A=L+j+65535,j=Math.floor(A/65536),L=A-j*65536,A=X+j+65535,j=Math.floor(A/65536),X=A-j*65536,A=ce+j+65535,j=Math.floor(A/65536),ce=A-j*65536,ee+=j-1+37*(j-1),U[0]=ee,U[1]=re,U[2]=k,U[3]=w,U[4]=f,U[5]=h,U[6]=g,U[7]=E,U[8]=D,U[9]=P,U[10]=x,U[11]=v,U[12]=b,U[13]=L,U[14]=X,U[15]=ce}function I(U,z){C(U,z,z)}function M(U,z){const K=i();for(let A=0;A<16;A++)K[A]=z[A];for(let A=253;A>=0;A--)I(K,K),A!==2&&A!==4&&C(K,K,z);for(let A=0;A<16;A++)U[A]=K[A]}function B(U,z){const K=new Uint8Array(32),A=new Float64Array(80),j=i(),ee=i(),re=i(),k=i(),w=i(),f=i();for(let D=0;D<31;D++)K[D]=U[D];K[31]=U[31]&127|64,K[0]&=248,p(A,z);for(let D=0;D<16;D++)ee[D]=A[D];j[0]=k[0]=1;for(let D=254;D>=0;--D){const P=K[D>>>3]>>>(D&7)&1;u(j,ee,P),u(re,k,P),y(w,j,re),_(j,j,re),y(re,ee,k),_(ee,ee,k),I(k,w),I(f,j),C(j,re,j),C(re,ee,w),y(w,j,re),_(j,j,re),I(ee,j),_(re,k,f),C(j,re,s),y(j,j,k),C(re,re,j),C(j,k,f),C(k,ee,A),I(ee,w),u(j,ee,P),u(re,k,P)}for(let D=0;D<16;D++)A[D+16]=j[D],A[D+32]=re[D],A[D+48]=ee[D],A[D+64]=k[D];const h=A.subarray(32),g=A.subarray(16);M(h,h),C(g,g,h);const E=new Uint8Array(32);return d(E,g),E}t.scalarMult=B;function W(U){return B(U,n)}t.scalarMultBase=W;function Y(U){if(U.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const z=new Uint8Array(U);return{publicKey:W(z),secretKey:z}}t.generateKeyPairFromSeed=Y;function q(U){const z=(0,e.randomBytes)(32,U),K=Y(z);return(0,r.wipe)(z),K}t.generateKeyPair=q;function V(U,z,K=!1){if(U.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(z.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const A=B(U,z);if(K){let j=0;for(let ee=0;ee<A.length;ee++)j|=A[ee];if(j===0)throw new Error("X25519: invalid shared key")}return A}t.sharedKey=V})(I0);function C2(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function D2(t,e){e||(e=t.reduce((n,s)=>n+s.length,0));const r=C2(e);let i=0;for(const n of t)r.set(n,i),i+=n.length;return r}function p7(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=n}var u=t.length,d=t.charAt(0),p=Math.log(u)/Math.log(256),y=Math.log(256)/Math.log(u);function _(M){if(M instanceof Uint8Array||(ArrayBuffer.isView(M)?M=new Uint8Array(M.buffer,M.byteOffset,M.byteLength):Array.isArray(M)&&(M=Uint8Array.from(M))),!(M instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(M.length===0)return"";for(var B=0,W=0,Y=0,q=M.length;Y!==q&&M[Y]===0;)Y++,B++;for(var V=(q-Y)*y+1>>>0,U=new Uint8Array(V);Y!==q;){for(var z=M[Y],K=0,A=V-1;(z!==0||K<W)&&A!==-1;A--,K++)z+=256*U[A]>>>0,U[A]=z%u>>>0,z=z/u>>>0;if(z!==0)throw new Error("Non-zero carry");W=K,Y++}for(var j=V-W;j!==V&&U[j]===0;)j++;for(var ee=d.repeat(B);j<V;++j)ee+=t.charAt(U[j]);return ee}function C(M){if(typeof M!="string")throw new TypeError("Expected String");if(M.length===0)return new Uint8Array;var B=0;if(M[B]!==" "){for(var W=0,Y=0;M[B]===d;)W++,B++;for(var q=(M.length-B)*p+1>>>0,V=new Uint8Array(q);M[B];){var U=r[M.charCodeAt(B)];if(U===255)return;for(var z=0,K=q-1;(U!==0||z<Y)&&K!==-1;K--,z++)U+=u*V[K]>>>0,V[K]=U%256>>>0,U=U/256>>>0;if(U!==0)throw new Error("Non-zero carry");Y=z,B++}if(M[B]!==" "){for(var A=q-Y;A!==q&&V[A]===0;)A++;for(var j=new Uint8Array(W+(q-A)),ee=W;A!==q;)j[ee++]=V[A++];return j}}}function I(M){var B=C(M);if(B)return B;throw new Error(`Non-${e} character`)}return{encode:_,decodeUnsafe:C,decode:I}}var g7=p7,v7=g7;const P2=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")},m7=t=>new TextEncoder().encode(t),b7=t=>new TextDecoder().decode(t);class y7{constructor(e,r,i){this.name=e,this.prefix=r,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class w7{constructor(e,r,i){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=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return O2(this,e)}}class _7{constructor(e){this.decoders=e}or(e){return O2(this,e)}decode(e){const r=e[0],i=this.decoders[r];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const O2=(t,e)=>new _7({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class A7{constructor(e,r,i,n){this.name=e,this.prefix=r,this.baseEncode=i,this.baseDecode=n,this.encoder=new y7(e,r,i),this.decoder=new w7(e,r,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const xf=({name:t,prefix:e,encode:r,decode:i})=>new A7(t,e,r,i),Vc=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=v7(r,e);return xf({prefix:t,name:e,encode:i,decode:s=>P2(n(s))})},E7=(t,e,r,i)=>{const n={};for(let y=0;y<e.length;++y)n[e[y]]=y;let s=t.length;for(;t[s-1]==="=";)--s;const a=new Uint8Array(s*r/8|0);let u=0,d=0,p=0;for(let y=0;y<s;++y){const _=n[t[y]];if(_===void 0)throw new SyntaxError(`Non-${i} character`);d=d<<r|_,u+=r,u>=8&&(u-=8,a[p++]=255&d>>u)}if(u>=r||255&d<<8-u)throw new SyntaxError("Unexpected end of data");return a},x7=(t,e,r)=>{const i=e[e.length-1]==="=",n=(1<<r)-1;let s="",a=0,u=0;for(let d=0;d<t.length;++d)for(u=u<<8|t[d],a+=8;a>r;)a-=r,s+=e[n&u>>a];if(a&&(s+=e[n&u<<r-a]),i)for(;s.length*r&7;)s+="=";return s},Ur=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>xf({prefix:e,name:t,encode(n){return x7(n,i,r)},decode(n){return E7(n,i,r,t)}}),S7=xf({prefix:"\0",name:"identity",encode:t=>b7(t),decode:t=>m7(t)});var I7=Object.freeze({__proto__:null,identity:S7});const M7=Ur({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var C7=Object.freeze({__proto__:null,base2:M7});const D7=Ur({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var P7=Object.freeze({__proto__:null,base8:D7});const O7=Vc({prefix:"9",name:"base10",alphabet:"0123456789"});var $7=Object.freeze({__proto__:null,base10:O7});const N7=Ur({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),R7=Ur({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var T7=Object.freeze({__proto__:null,base16:N7,base16upper:R7});const F7=Ur({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),L7=Ur({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),B7=Ur({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),U7=Ur({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),k7=Ur({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),j7=Ur({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),q7=Ur({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),z7=Ur({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),H7=Ur({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var K7=Object.freeze({__proto__:null,base32:F7,base32upper:L7,base32pad:B7,base32padupper:U7,base32hex:k7,base32hexupper:j7,base32hexpad:q7,base32hexpadupper:z7,base32z:H7});const W7=Vc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),V7=Vc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var G7=Object.freeze({__proto__:null,base36:W7,base36upper:V7});const Y7=Vc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),J7=Vc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Q7=Object.freeze({__proto__:null,base58btc:Y7,base58flickr:J7});const Z7=Ur({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),X7=Ur({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),e9=Ur({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),t9=Ur({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var r9=Object.freeze({__proto__:null,base64:Z7,base64pad:X7,base64url:e9,base64urlpad:t9});const $2=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}"),i9=$2.reduce((t,e,r)=>(t[r]=e,t),[]),n9=$2.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function s9(t){return t.reduce((e,r)=>(e+=i9[r],e),"")}function o9(t){const e=[];for(const r of t){const i=n9[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(i)}return new Uint8Array(e)}const a9=xf({prefix:"\u{1F680}",name:"base256emoji",encode:s9,decode:o9});var c9=Object.freeze({__proto__:null,base256emoji:a9}),u9=R2,N2=128,f9=127,h9=~f9,l9=Math.pow(2,31);function R2(t,e,r){e=e||[],r=r||0;for(var i=r;t>=l9;)e[r++]=t&255|N2,t/=128;for(;t&h9;)e[r++]=t&255|N2,t>>>=7;return e[r]=t|0,R2.bytes=r-i+1,e}var d9=M0,p9=128,T2=127;function M0(t,i){var r=0,i=i||0,n=0,s=i,a,u=t.length;do{if(s>=u)throw M0.bytes=0,new RangeError("Could not decode varint");a=t[s++],r+=n<28?(a&T2)<<n:(a&T2)*Math.pow(2,n),n+=7}while(a>=p9);return M0.bytes=s-i,r}var g9=Math.pow(2,7),v9=Math.pow(2,14),m9=Math.pow(2,21),b9=Math.pow(2,28),y9=Math.pow(2,35),w9=Math.pow(2,42),_9=Math.pow(2,49),A9=Math.pow(2,56),E9=Math.pow(2,63),x9=function(t){return t<g9?1:t<v9?2:t<m9?3:t<b9?4:t<y9?5:t<w9?6:t<_9?7:t<A9?8:t<E9?9:10},S9={encode:u9,decode:d9,encodingLength:x9},F2=S9;const L2=(t,e,r=0)=>(F2.encode(t,e,r),e),B2=t=>F2.encodingLength(t),C0=(t,e)=>{const r=e.byteLength,i=B2(t),n=i+B2(r),s=new Uint8Array(n+r);return L2(t,s,0),L2(r,s,i),s.set(e,n),new I9(t,r,e,s)};class I9{constructor(e,r,i,n){this.code=e,this.size=r,this.digest=i,this.bytes=n}}const U2=({name:t,code:e,encode:r})=>new M9(t,e,r);class M9{constructor(e,r,i){this.name=e,this.code=r,this.encode=i}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?C0(this.code,r):r.then(i=>C0(this.code,i))}else throw Error("Unknown type, must be binary type")}}const k2=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),C9=U2({name:"sha2-256",code:18,encode:k2("SHA-256")}),D9=U2({name:"sha2-512",code:19,encode:k2("SHA-512")});var P9=Object.freeze({__proto__:null,sha256:C9,sha512:D9});const j2=0,O9="identity",q2=P2;var $9=Object.freeze({__proto__:null,identity:{code:j2,name:O9,encode:q2,digest:t=>C0(j2,q2(t))}});new TextEncoder,new TextDecoder;const Ia={...I7,...C7,...P7,...$7,...T7,...K7,...G7,...Q7,...r9,...c9};({...P9,...$9});function z2(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const H2=z2("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),D0=z2("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=C2(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),K2={utf8:H2,"utf-8":H2,hex:Ia.base16,latin1:D0,ascii:D0,binary:D0,...Ia};function bn(t,e="utf8"){const r=K2[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,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}function yn(t,e="utf8"){const r=K2[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 W2={},N9="elliptic",R9="6.5.7",T9="EC cryptography",F9="lib/elliptic.js",L9=["lib"],B9={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},U9={type:"git",url:"git@github.com:indutny/elliptic"},k9=["EC","Elliptic","curve","Cryptography"],j9="Fedor Indutny <fedor@indutny.com>",q9="MIT",z9={url:"https://github.com/indutny/elliptic/issues"},H9="https://github.com/indutny/elliptic",K9={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},W9={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},V9={name:N9,version:R9,description:T9,main:F9,files:L9,scripts:B9,repository:U9,keywords:k9,author:j9,license:q9,bugs:z9,homepage:H9,devDependencies:K9,dependencies:W9},Li={},qn={exports:{}};(function(t){(function(e,r){function i(k,w){if(!k)throw new Error(w||"Assertion failed")}function n(k,w){k.super_=w;var f=function(){};f.prototype=w.prototype,k.prototype=new f,k.prototype.constructor=k}function s(k,w,f){if(s.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((w==="le"||w==="be")&&(f=w,w=10),this._init(k||0,w||10,f||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=S0.Buffer}catch{}s.isBN=function(w){return w instanceof s?!0:w!==null&&typeof w=="object"&&w.constructor.wordSize===s.wordSize&&Array.isArray(w.words)},s.max=function(w,f){return w.cmp(f)>0?w:f},s.min=function(w,f){return w.cmp(f)<0?w:f},s.prototype._init=function(w,f,h){if(typeof w=="number")return this._initNumber(w,f,h);if(typeof w=="object")return this._initArray(w,f,h);f==="hex"&&(f=16),i(f===(f|0)&&f>=2&&f<=36),w=w.toString().replace(/\s+/g,"");var g=0;w[0]==="-"&&(g++,this.negative=1),g<w.length&&(f===16?this._parseHex(w,g,h):(this._parseBase(w,f,g),h==="le"&&this._initArray(this.toArray(),f,h)))},s.prototype._initNumber=function(w,f,h){w<0&&(this.negative=1,w=-w),w<67108864?(this.words=[w&67108863],this.length=1):w<4503599627370496?(this.words=[w&67108863,w/67108864&67108863],this.length=2):(i(w<9007199254740992),this.words=[w&67108863,w/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),f,h)},s.prototype._initArray=function(w,f,h){if(i(typeof w.length=="number"),w.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(w.length/3),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var E,D,P=0;if(h==="be")for(g=w.length-1,E=0;g>=0;g-=3)D=w[g]|w[g-1]<<8|w[g-2]<<16,this.words[E]|=D<<P&67108863,this.words[E+1]=D>>>26-P&67108863,P+=24,P>=26&&(P-=26,E++);else if(h==="le")for(g=0,E=0;g<w.length;g+=3)D=w[g]|w[g+1]<<8|w[g+2]<<16,this.words[E]|=D<<P&67108863,this.words[E+1]=D>>>26-P&67108863,P+=24,P>=26&&(P-=26,E++);return this.strip()};function u(k,w){var f=k.charCodeAt(w);return f>=65&&f<=70?f-55:f>=97&&f<=102?f-87:f-48&15}function d(k,w,f){var h=u(k,f);return f-1>=w&&(h|=u(k,f-1)<<4),h}s.prototype._parseHex=function(w,f,h){this.length=Math.ceil((w.length-f)/6),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var E=0,D=0,P;if(h==="be")for(g=w.length-1;g>=f;g-=2)P=d(w,f,g)<<E,this.words[D]|=P&67108863,E>=18?(E-=18,D+=1,this.words[D]|=P>>>26):E+=8;else{var x=w.length-f;for(g=x%2===0?f+1:f;g<w.length;g+=2)P=d(w,f,g)<<E,this.words[D]|=P&67108863,E>=18?(E-=18,D+=1,this.words[D]|=P>>>26):E+=8}this.strip()};function p(k,w,f,h){for(var g=0,E=Math.min(k.length,f),D=w;D<E;D++){var P=k.charCodeAt(D)-48;g*=h,P>=49?g+=P-49+10:P>=17?g+=P-17+10:g+=P}return g}s.prototype._parseBase=function(w,f,h){this.words=[0],this.length=1;for(var g=0,E=1;E<=67108863;E*=f)g++;g--,E=E/f|0;for(var D=w.length-h,P=D%g,x=Math.min(D,D-P)+h,v=0,b=h;b<x;b+=g)v=p(w,b,b+g,f),this.imuln(E),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v);if(P!==0){var L=1;for(v=p(w,b,w.length,f),b=0;b<P;b++)L*=f;this.imuln(L),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v)}this.strip()},s.prototype.copy=function(w){w.words=new Array(this.length);for(var f=0;f<this.length;f++)w.words[f]=this.words[f];w.length=this.length,w.negative=this.negative,w.red=this.red},s.prototype.clone=function(){var w=new s(null);return this.copy(w),w},s.prototype._expand=function(w){for(;this.length<w;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],_=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],C=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(w,f){w=w||10,f=f|0||1;var h;if(w===16||w==="hex"){h="";for(var g=0,E=0,D=0;D<this.length;D++){var P=this.words[D],x=((P<<g|E)&16777215).toString(16);E=P>>>24-g&16777215,E!==0||D!==this.length-1?h=y[6-x.length]+x+h:h=x+h,g+=2,g>=26&&(g-=26,D--)}for(E!==0&&(h=E.toString(16)+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(w===(w|0)&&w>=2&&w<=36){var v=_[w],b=C[w];h="";var L=this.clone();for(L.negative=0;!L.isZero();){var X=L.modn(b).toString(w);L=L.idivn(b),L.isZero()?h=X+h:h=y[v-X.length]+X+h}for(this.isZero()&&(h="0"+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var w=this.words[0];return this.length===2?w+=this.words[1]*67108864:this.length===3&&this.words[2]===1?w+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-w:w},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(w,f){return i(typeof a<"u"),this.toArrayLike(a,w,f)},s.prototype.toArray=function(w,f){return this.toArrayLike(Array,w,f)},s.prototype.toArrayLike=function(w,f,h){var g=this.byteLength(),E=h||Math.max(1,g);i(g<=E,"byte array longer than desired length"),i(E>0,"Requested array length <= 0"),this.strip();var D=f==="le",P=new w(E),x,v,b=this.clone();if(D){for(v=0;!b.isZero();v++)x=b.andln(255),b.iushrn(8),P[v]=x;for(;v<E;v++)P[v]=0}else{for(v=0;v<E-g;v++)P[v]=0;for(v=0;!b.isZero();v++)x=b.andln(255),b.iushrn(8),P[E-v-1]=x}return P},Math.clz32?s.prototype._countBits=function(w){return 32-Math.clz32(w)}:s.prototype._countBits=function(w){var f=w,h=0;return f>=4096&&(h+=13,f>>>=13),f>=64&&(h+=7,f>>>=7),f>=8&&(h+=4,f>>>=4),f>=2&&(h+=2,f>>>=2),h+f},s.prototype._zeroBits=function(w){if(w===0)return 26;var f=w,h=0;return f&8191||(h+=13,f>>>=13),f&127||(h+=7,f>>>=7),f&15||(h+=4,f>>>=4),f&3||(h+=2,f>>>=2),f&1||h++,h},s.prototype.bitLength=function(){var w=this.words[this.length-1],f=this._countBits(w);return(this.length-1)*26+f};function I(k){for(var w=new Array(k.bitLength()),f=0;f<w.length;f++){var h=f/26|0,g=f%26;w[f]=(k.words[h]&1<<g)>>>g}return w}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var w=0,f=0;f<this.length;f++){var h=this._zeroBits(this.words[f]);if(w+=h,h!==26)break}return w},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(w){return this.negative!==0?this.abs().inotn(w).iaddn(1):this.clone()},s.prototype.fromTwos=function(w){return this.testn(w-1)?this.notn(w).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(w){for(;this.length<w.length;)this.words[this.length++]=0;for(var f=0;f<w.length;f++)this.words[f]=this.words[f]|w.words[f];return this.strip()},s.prototype.ior=function(w){return i((this.negative|w.negative)===0),this.iuor(w)},s.prototype.or=function(w){return this.length>w.length?this.clone().ior(w):w.clone().ior(this)},s.prototype.uor=function(w){return this.length>w.length?this.clone().iuor(w):w.clone().iuor(this)},s.prototype.iuand=function(w){var f;this.length>w.length?f=w:f=this;for(var h=0;h<f.length;h++)this.words[h]=this.words[h]&w.words[h];return this.length=f.length,this.strip()},s.prototype.iand=function(w){return i((this.negative|w.negative)===0),this.iuand(w)},s.prototype.and=function(w){return this.length>w.length?this.clone().iand(w):w.clone().iand(this)},s.prototype.uand=function(w){return this.length>w.length?this.clone().iuand(w):w.clone().iuand(this)},s.prototype.iuxor=function(w){var f,h;this.length>w.length?(f=this,h=w):(f=w,h=this);for(var g=0;g<h.length;g++)this.words[g]=f.words[g]^h.words[g];if(this!==f)for(;g<f.length;g++)this.words[g]=f.words[g];return this.length=f.length,this.strip()},s.prototype.ixor=function(w){return i((this.negative|w.negative)===0),this.iuxor(w)},s.prototype.xor=function(w){return this.length>w.length?this.clone().ixor(w):w.clone().ixor(this)},s.prototype.uxor=function(w){return this.length>w.length?this.clone().iuxor(w):w.clone().iuxor(this)},s.prototype.inotn=function(w){i(typeof w=="number"&&w>=0);var f=Math.ceil(w/26)|0,h=w%26;this._expand(f),h>0&&f--;for(var g=0;g<f;g++)this.words[g]=~this.words[g]&67108863;return h>0&&(this.words[g]=~this.words[g]&67108863>>26-h),this.strip()},s.prototype.notn=function(w){return this.clone().inotn(w)},s.prototype.setn=function(w,f){i(typeof w=="number"&&w>=0);var h=w/26|0,g=w%26;return this._expand(h+1),f?this.words[h]=this.words[h]|1<<g:this.words[h]=this.words[h]&~(1<<g),this.strip()},s.prototype.iadd=function(w){var f;if(this.negative!==0&&w.negative===0)return this.negative=0,f=this.isub(w),this.negative^=1,this._normSign();if(this.negative===0&&w.negative!==0)return w.negative=0,f=this.isub(w),w.negative=1,f._normSign();var h,g;this.length>w.length?(h=this,g=w):(h=w,g=this);for(var E=0,D=0;D<g.length;D++)f=(h.words[D]|0)+(g.words[D]|0)+E,this.words[D]=f&67108863,E=f>>>26;for(;E!==0&&D<h.length;D++)f=(h.words[D]|0)+E,this.words[D]=f&67108863,E=f>>>26;if(this.length=h.length,E!==0)this.words[this.length]=E,this.length++;else if(h!==this)for(;D<h.length;D++)this.words[D]=h.words[D];return this},s.prototype.add=function(w){var f;return w.negative!==0&&this.negative===0?(w.negative=0,f=this.sub(w),w.negative^=1,f):w.negative===0&&this.negative!==0?(this.negative=0,f=w.sub(this),this.negative=1,f):this.length>w.length?this.clone().iadd(w):w.clone().iadd(this)},s.prototype.isub=function(w){if(w.negative!==0){w.negative=0;var f=this.iadd(w);return w.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(w),this.negative=1,this._normSign();var h=this.cmp(w);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var g,E;h>0?(g=this,E=w):(g=w,E=this);for(var D=0,P=0;P<E.length;P++)f=(g.words[P]|0)-(E.words[P]|0)+D,D=f>>26,this.words[P]=f&67108863;for(;D!==0&&P<g.length;P++)f=(g.words[P]|0)+D,D=f>>26,this.words[P]=f&67108863;if(D===0&&P<g.length&&g!==this)for(;P<g.length;P++)this.words[P]=g.words[P];return this.length=Math.max(this.length,P),g!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(w){return this.clone().isub(w)};function M(k,w,f){f.negative=w.negative^k.negative;var h=k.length+w.length|0;f.length=h,h=h-1|0;var g=k.words[0]|0,E=w.words[0]|0,D=g*E,P=D&67108863,x=D/67108864|0;f.words[0]=P;for(var v=1;v<h;v++){for(var b=x>>>26,L=x&67108863,X=Math.min(v,w.length-1),ce=Math.max(0,v-k.length+1);ce<=X;ce++){var O=v-ce|0;g=k.words[O]|0,E=w.words[ce]|0,D=g*E+L,b+=D/67108864|0,L=D&67108863}f.words[v]=L|0,x=b|0}return x!==0?f.words[v]=x|0:f.length--,f.strip()}var B=function(w,f,h){var g=w.words,E=f.words,D=h.words,P=0,x,v,b,L=g[0]|0,X=L&8191,ce=L>>>13,O=g[1]|0,ie=O&8191,N=O>>>13,F=g[2]|0,R=F&8191,l=F>>>13,$=g[3]|0,Z=$&8191,ae=$>>>13,ue=g[4]|0,ve=ue&8191,ge=ue>>>13,Ee=g[5]|0,Ye=Ee&8191,De=Ee>>>13,Re=g[6]|0,xe=Re&8191,ye=Re>>>13,Me=g[7]|0,Pe=Me&8191,pe=Me>>>13,Se=g[8]|0,_e=Se&8191,me=Se>>>13,Te=g[9]|0,Ce=Te&8191,Ae=Te>>>13,ke=E[0]|0,qe=ke&8191,Ie=ke>>>13,Ke=E[1]|0,ut=Ke&8191,Je=Ke>>>13,gt=E[2]|0,ht=gt&8191,ot=gt>>>13,St=E[3]|0,Ct=St&8191,Oe=St>>>13,Ve=E[4]|0,Ze=Ve&8191,$e=Ve>>>13,Qe=E[5]|0,Ge=Qe&8191,Fe=Qe>>>13,nt=E[6]|0,Xe=nt&8191,Le=nt>>>13,et=E[7]|0,rt=et&8191,Ne=et>>>13,We=E[8]|0,st=We&8191,Be=We>>>13,qt=E[9]|0,zt=qt&8191,lt=qt>>>13;h.negative=w.negative^f.negative,h.length=19,x=Math.imul(X,qe),v=Math.imul(X,Ie),v=v+Math.imul(ce,qe)|0,b=Math.imul(ce,Ie);var At=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(At>>>26)|0,At&=67108863,x=Math.imul(ie,qe),v=Math.imul(ie,Ie),v=v+Math.imul(N,qe)|0,b=Math.imul(N,Ie),x=x+Math.imul(X,ut)|0,v=v+Math.imul(X,Je)|0,v=v+Math.imul(ce,ut)|0,b=b+Math.imul(ce,Je)|0;var Xr=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,x=Math.imul(R,qe),v=Math.imul(R,Ie),v=v+Math.imul(l,qe)|0,b=Math.imul(l,Ie),x=x+Math.imul(ie,ut)|0,v=v+Math.imul(ie,Je)|0,v=v+Math.imul(N,ut)|0,b=b+Math.imul(N,Je)|0,x=x+Math.imul(X,ht)|0,v=v+Math.imul(X,ot)|0,v=v+Math.imul(ce,ht)|0,b=b+Math.imul(ce,ot)|0;var ei=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(ei>>>26)|0,ei&=67108863,x=Math.imul(Z,qe),v=Math.imul(Z,Ie),v=v+Math.imul(ae,qe)|0,b=Math.imul(ae,Ie),x=x+Math.imul(R,ut)|0,v=v+Math.imul(R,Je)|0,v=v+Math.imul(l,ut)|0,b=b+Math.imul(l,Je)|0,x=x+Math.imul(ie,ht)|0,v=v+Math.imul(ie,ot)|0,v=v+Math.imul(N,ht)|0,b=b+Math.imul(N,ot)|0,x=x+Math.imul(X,Ct)|0,v=v+Math.imul(X,Oe)|0,v=v+Math.imul(ce,Ct)|0,b=b+Math.imul(ce,Oe)|0;var ti=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(ti>>>26)|0,ti&=67108863,x=Math.imul(ve,qe),v=Math.imul(ve,Ie),v=v+Math.imul(ge,qe)|0,b=Math.imul(ge,Ie),x=x+Math.imul(Z,ut)|0,v=v+Math.imul(Z,Je)|0,v=v+Math.imul(ae,ut)|0,b=b+Math.imul(ae,Je)|0,x=x+Math.imul(R,ht)|0,v=v+Math.imul(R,ot)|0,v=v+Math.imul(l,ht)|0,b=b+Math.imul(l,ot)|0,x=x+Math.imul(ie,Ct)|0,v=v+Math.imul(ie,Oe)|0,v=v+Math.imul(N,Ct)|0,b=b+Math.imul(N,Oe)|0,x=x+Math.imul(X,Ze)|0,v=v+Math.imul(X,$e)|0,v=v+Math.imul(ce,Ze)|0,b=b+Math.imul(ce,$e)|0;var ri=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(ri>>>26)|0,ri&=67108863,x=Math.imul(Ye,qe),v=Math.imul(Ye,Ie),v=v+Math.imul(De,qe)|0,b=Math.imul(De,Ie),x=x+Math.imul(ve,ut)|0,v=v+Math.imul(ve,Je)|0,v=v+Math.imul(ge,ut)|0,b=b+Math.imul(ge,Je)|0,x=x+Math.imul(Z,ht)|0,v=v+Math.imul(Z,ot)|0,v=v+Math.imul(ae,ht)|0,b=b+Math.imul(ae,ot)|0,x=x+Math.imul(R,Ct)|0,v=v+Math.imul(R,Oe)|0,v=v+Math.imul(l,Ct)|0,b=b+Math.imul(l,Oe)|0,x=x+Math.imul(ie,Ze)|0,v=v+Math.imul(ie,$e)|0,v=v+Math.imul(N,Ze)|0,b=b+Math.imul(N,$e)|0,x=x+Math.imul(X,Ge)|0,v=v+Math.imul(X,Fe)|0,v=v+Math.imul(ce,Ge)|0,b=b+Math.imul(ce,Fe)|0;var ii=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(ii>>>26)|0,ii&=67108863,x=Math.imul(xe,qe),v=Math.imul(xe,Ie),v=v+Math.imul(ye,qe)|0,b=Math.imul(ye,Ie),x=x+Math.imul(Ye,ut)|0,v=v+Math.imul(Ye,Je)|0,v=v+Math.imul(De,ut)|0,b=b+Math.imul(De,Je)|0,x=x+Math.imul(ve,ht)|0,v=v+Math.imul(ve,ot)|0,v=v+Math.imul(ge,ht)|0,b=b+Math.imul(ge,ot)|0,x=x+Math.imul(Z,Ct)|0,v=v+Math.imul(Z,Oe)|0,v=v+Math.imul(ae,Ct)|0,b=b+Math.imul(ae,Oe)|0,x=x+Math.imul(R,Ze)|0,v=v+Math.imul(R,$e)|0,v=v+Math.imul(l,Ze)|0,b=b+Math.imul(l,$e)|0,x=x+Math.imul(ie,Ge)|0,v=v+Math.imul(ie,Fe)|0,v=v+Math.imul(N,Ge)|0,b=b+Math.imul(N,Fe)|0,x=x+Math.imul(X,Xe)|0,v=v+Math.imul(X,Le)|0,v=v+Math.imul(ce,Xe)|0,b=b+Math.imul(ce,Le)|0;var gr=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(gr>>>26)|0,gr&=67108863,x=Math.imul(Pe,qe),v=Math.imul(Pe,Ie),v=v+Math.imul(pe,qe)|0,b=Math.imul(pe,Ie),x=x+Math.imul(xe,ut)|0,v=v+Math.imul(xe,Je)|0,v=v+Math.imul(ye,ut)|0,b=b+Math.imul(ye,Je)|0,x=x+Math.imul(Ye,ht)|0,v=v+Math.imul(Ye,ot)|0,v=v+Math.imul(De,ht)|0,b=b+Math.imul(De,ot)|0,x=x+Math.imul(ve,Ct)|0,v=v+Math.imul(ve,Oe)|0,v=v+Math.imul(ge,Ct)|0,b=b+Math.imul(ge,Oe)|0,x=x+Math.imul(Z,Ze)|0,v=v+Math.imul(Z,$e)|0,v=v+Math.imul(ae,Ze)|0,b=b+Math.imul(ae,$e)|0,x=x+Math.imul(R,Ge)|0,v=v+Math.imul(R,Fe)|0,v=v+Math.imul(l,Ge)|0,b=b+Math.imul(l,Fe)|0,x=x+Math.imul(ie,Xe)|0,v=v+Math.imul(ie,Le)|0,v=v+Math.imul(N,Xe)|0,b=b+Math.imul(N,Le)|0,x=x+Math.imul(X,rt)|0,v=v+Math.imul(X,Ne)|0,v=v+Math.imul(ce,rt)|0,b=b+Math.imul(ce,Ne)|0;var Ci=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(Ci>>>26)|0,Ci&=67108863,x=Math.imul(_e,qe),v=Math.imul(_e,Ie),v=v+Math.imul(me,qe)|0,b=Math.imul(me,Ie),x=x+Math.imul(Pe,ut)|0,v=v+Math.imul(Pe,Je)|0,v=v+Math.imul(pe,ut)|0,b=b+Math.imul(pe,Je)|0,x=x+Math.imul(xe,ht)|0,v=v+Math.imul(xe,ot)|0,v=v+Math.imul(ye,ht)|0,b=b+Math.imul(ye,ot)|0,x=x+Math.imul(Ye,Ct)|0,v=v+Math.imul(Ye,Oe)|0,v=v+Math.imul(De,Ct)|0,b=b+Math.imul(De,Oe)|0,x=x+Math.imul(ve,Ze)|0,v=v+Math.imul(ve,$e)|0,v=v+Math.imul(ge,Ze)|0,b=b+Math.imul(ge,$e)|0,x=x+Math.imul(Z,Ge)|0,v=v+Math.imul(Z,Fe)|0,v=v+Math.imul(ae,Ge)|0,b=b+Math.imul(ae,Fe)|0,x=x+Math.imul(R,Xe)|0,v=v+Math.imul(R,Le)|0,v=v+Math.imul(l,Xe)|0,b=b+Math.imul(l,Le)|0,x=x+Math.imul(ie,rt)|0,v=v+Math.imul(ie,Ne)|0,v=v+Math.imul(N,rt)|0,b=b+Math.imul(N,Ne)|0,x=x+Math.imul(X,st)|0,v=v+Math.imul(X,Be)|0,v=v+Math.imul(ce,st)|0,b=b+Math.imul(ce,Be)|0;var Pn=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,x=Math.imul(Ce,qe),v=Math.imul(Ce,Ie),v=v+Math.imul(Ae,qe)|0,b=Math.imul(Ae,Ie),x=x+Math.imul(_e,ut)|0,v=v+Math.imul(_e,Je)|0,v=v+Math.imul(me,ut)|0,b=b+Math.imul(me,Je)|0,x=x+Math.imul(Pe,ht)|0,v=v+Math.imul(Pe,ot)|0,v=v+Math.imul(pe,ht)|0,b=b+Math.imul(pe,ot)|0,x=x+Math.imul(xe,Ct)|0,v=v+Math.imul(xe,Oe)|0,v=v+Math.imul(ye,Ct)|0,b=b+Math.imul(ye,Oe)|0,x=x+Math.imul(Ye,Ze)|0,v=v+Math.imul(Ye,$e)|0,v=v+Math.imul(De,Ze)|0,b=b+Math.imul(De,$e)|0,x=x+Math.imul(ve,Ge)|0,v=v+Math.imul(ve,Fe)|0,v=v+Math.imul(ge,Ge)|0,b=b+Math.imul(ge,Fe)|0,x=x+Math.imul(Z,Xe)|0,v=v+Math.imul(Z,Le)|0,v=v+Math.imul(ae,Xe)|0,b=b+Math.imul(ae,Le)|0,x=x+Math.imul(R,rt)|0,v=v+Math.imul(R,Ne)|0,v=v+Math.imul(l,rt)|0,b=b+Math.imul(l,Ne)|0,x=x+Math.imul(ie,st)|0,v=v+Math.imul(ie,Be)|0,v=v+Math.imul(N,st)|0,b=b+Math.imul(N,Be)|0,x=x+Math.imul(X,zt)|0,v=v+Math.imul(X,lt)|0,v=v+Math.imul(ce,zt)|0,b=b+Math.imul(ce,lt)|0;var Di=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(Di>>>26)|0,Di&=67108863,x=Math.imul(Ce,ut),v=Math.imul(Ce,Je),v=v+Math.imul(Ae,ut)|0,b=Math.imul(Ae,Je),x=x+Math.imul(_e,ht)|0,v=v+Math.imul(_e,ot)|0,v=v+Math.imul(me,ht)|0,b=b+Math.imul(me,ot)|0,x=x+Math.imul(Pe,Ct)|0,v=v+Math.imul(Pe,Oe)|0,v=v+Math.imul(pe,Ct)|0,b=b+Math.imul(pe,Oe)|0,x=x+Math.imul(xe,Ze)|0,v=v+Math.imul(xe,$e)|0,v=v+Math.imul(ye,Ze)|0,b=b+Math.imul(ye,$e)|0,x=x+Math.imul(Ye,Ge)|0,v=v+Math.imul(Ye,Fe)|0,v=v+Math.imul(De,Ge)|0,b=b+Math.imul(De,Fe)|0,x=x+Math.imul(ve,Xe)|0,v=v+Math.imul(ve,Le)|0,v=v+Math.imul(ge,Xe)|0,b=b+Math.imul(ge,Le)|0,x=x+Math.imul(Z,rt)|0,v=v+Math.imul(Z,Ne)|0,v=v+Math.imul(ae,rt)|0,b=b+Math.imul(ae,Ne)|0,x=x+Math.imul(R,st)|0,v=v+Math.imul(R,Be)|0,v=v+Math.imul(l,st)|0,b=b+Math.imul(l,Be)|0,x=x+Math.imul(ie,zt)|0,v=v+Math.imul(ie,lt)|0,v=v+Math.imul(N,zt)|0,b=b+Math.imul(N,lt)|0;var On=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(On>>>26)|0,On&=67108863,x=Math.imul(Ce,ht),v=Math.imul(Ce,ot),v=v+Math.imul(Ae,ht)|0,b=Math.imul(Ae,ot),x=x+Math.imul(_e,Ct)|0,v=v+Math.imul(_e,Oe)|0,v=v+Math.imul(me,Ct)|0,b=b+Math.imul(me,Oe)|0,x=x+Math.imul(Pe,Ze)|0,v=v+Math.imul(Pe,$e)|0,v=v+Math.imul(pe,Ze)|0,b=b+Math.imul(pe,$e)|0,x=x+Math.imul(xe,Ge)|0,v=v+Math.imul(xe,Fe)|0,v=v+Math.imul(ye,Ge)|0,b=b+Math.imul(ye,Fe)|0,x=x+Math.imul(Ye,Xe)|0,v=v+Math.imul(Ye,Le)|0,v=v+Math.imul(De,Xe)|0,b=b+Math.imul(De,Le)|0,x=x+Math.imul(ve,rt)|0,v=v+Math.imul(ve,Ne)|0,v=v+Math.imul(ge,rt)|0,b=b+Math.imul(ge,Ne)|0,x=x+Math.imul(Z,st)|0,v=v+Math.imul(Z,Be)|0,v=v+Math.imul(ae,st)|0,b=b+Math.imul(ae,Be)|0,x=x+Math.imul(R,zt)|0,v=v+Math.imul(R,lt)|0,v=v+Math.imul(l,zt)|0,b=b+Math.imul(l,lt)|0;var $n=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+($n>>>26)|0,$n&=67108863,x=Math.imul(Ce,Ct),v=Math.imul(Ce,Oe),v=v+Math.imul(Ae,Ct)|0,b=Math.imul(Ae,Oe),x=x+Math.imul(_e,Ze)|0,v=v+Math.imul(_e,$e)|0,v=v+Math.imul(me,Ze)|0,b=b+Math.imul(me,$e)|0,x=x+Math.imul(Pe,Ge)|0,v=v+Math.imul(Pe,Fe)|0,v=v+Math.imul(pe,Ge)|0,b=b+Math.imul(pe,Fe)|0,x=x+Math.imul(xe,Xe)|0,v=v+Math.imul(xe,Le)|0,v=v+Math.imul(ye,Xe)|0,b=b+Math.imul(ye,Le)|0,x=x+Math.imul(Ye,rt)|0,v=v+Math.imul(Ye,Ne)|0,v=v+Math.imul(De,rt)|0,b=b+Math.imul(De,Ne)|0,x=x+Math.imul(ve,st)|0,v=v+Math.imul(ve,Be)|0,v=v+Math.imul(ge,st)|0,b=b+Math.imul(ge,Be)|0,x=x+Math.imul(Z,zt)|0,v=v+Math.imul(Z,lt)|0,v=v+Math.imul(ae,zt)|0,b=b+Math.imul(ae,lt)|0;var Pi=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(Pi>>>26)|0,Pi&=67108863,x=Math.imul(Ce,Ze),v=Math.imul(Ce,$e),v=v+Math.imul(Ae,Ze)|0,b=Math.imul(Ae,$e),x=x+Math.imul(_e,Ge)|0,v=v+Math.imul(_e,Fe)|0,v=v+Math.imul(me,Ge)|0,b=b+Math.imul(me,Fe)|0,x=x+Math.imul(Pe,Xe)|0,v=v+Math.imul(Pe,Le)|0,v=v+Math.imul(pe,Xe)|0,b=b+Math.imul(pe,Le)|0,x=x+Math.imul(xe,rt)|0,v=v+Math.imul(xe,Ne)|0,v=v+Math.imul(ye,rt)|0,b=b+Math.imul(ye,Ne)|0,x=x+Math.imul(Ye,st)|0,v=v+Math.imul(Ye,Be)|0,v=v+Math.imul(De,st)|0,b=b+Math.imul(De,Be)|0,x=x+Math.imul(ve,zt)|0,v=v+Math.imul(ve,lt)|0,v=v+Math.imul(ge,zt)|0,b=b+Math.imul(ge,lt)|0;var an=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(an>>>26)|0,an&=67108863,x=Math.imul(Ce,Ge),v=Math.imul(Ce,Fe),v=v+Math.imul(Ae,Ge)|0,b=Math.imul(Ae,Fe),x=x+Math.imul(_e,Xe)|0,v=v+Math.imul(_e,Le)|0,v=v+Math.imul(me,Xe)|0,b=b+Math.imul(me,Le)|0,x=x+Math.imul(Pe,rt)|0,v=v+Math.imul(Pe,Ne)|0,v=v+Math.imul(pe,rt)|0,b=b+Math.imul(pe,Ne)|0,x=x+Math.imul(xe,st)|0,v=v+Math.imul(xe,Be)|0,v=v+Math.imul(ye,st)|0,b=b+Math.imul(ye,Be)|0,x=x+Math.imul(Ye,zt)|0,v=v+Math.imul(Ye,lt)|0,v=v+Math.imul(De,zt)|0,b=b+Math.imul(De,lt)|0;var cn=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(cn>>>26)|0,cn&=67108863,x=Math.imul(Ce,Xe),v=Math.imul(Ce,Le),v=v+Math.imul(Ae,Xe)|0,b=Math.imul(Ae,Le),x=x+Math.imul(_e,rt)|0,v=v+Math.imul(_e,Ne)|0,v=v+Math.imul(me,rt)|0,b=b+Math.imul(me,Ne)|0,x=x+Math.imul(Pe,st)|0,v=v+Math.imul(Pe,Be)|0,v=v+Math.imul(pe,st)|0,b=b+Math.imul(pe,Be)|0,x=x+Math.imul(xe,zt)|0,v=v+Math.imul(xe,lt)|0,v=v+Math.imul(ye,zt)|0,b=b+Math.imul(ye,lt)|0;var Mr=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,x=Math.imul(Ce,rt),v=Math.imul(Ce,Ne),v=v+Math.imul(Ae,rt)|0,b=Math.imul(Ae,Ne),x=x+Math.imul(_e,st)|0,v=v+Math.imul(_e,Be)|0,v=v+Math.imul(me,st)|0,b=b+Math.imul(me,Be)|0,x=x+Math.imul(Pe,zt)|0,v=v+Math.imul(Pe,lt)|0,v=v+Math.imul(pe,zt)|0,b=b+Math.imul(pe,lt)|0;var Nn=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,x=Math.imul(Ce,st),v=Math.imul(Ce,Be),v=v+Math.imul(Ae,st)|0,b=Math.imul(Ae,Be),x=x+Math.imul(_e,zt)|0,v=v+Math.imul(_e,lt)|0,v=v+Math.imul(me,zt)|0,b=b+Math.imul(me,lt)|0;var Rn=(P+x|0)+((v&8191)<<13)|0;P=(b+(v>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,x=Math.imul(Ce,zt),v=Math.imul(Ce,lt),v=v+Math.imul(Ae,zt)|0,b=Math.imul(Ae,lt);var Tn=(P+x|0)+((v&8191)<<13)|0;return P=(b+(v>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,D[0]=At,D[1]=Xr,D[2]=ei,D[3]=ti,D[4]=ri,D[5]=ii,D[6]=gr,D[7]=Ci,D[8]=Pn,D[9]=Di,D[10]=On,D[11]=$n,D[12]=Pi,D[13]=an,D[14]=cn,D[15]=Mr,D[16]=Nn,D[17]=Rn,D[18]=Tn,P!==0&&(D[19]=P,h.length++),h};Math.imul||(B=M);function W(k,w,f){f.negative=w.negative^k.negative,f.length=k.length+w.length;for(var h=0,g=0,E=0;E<f.length-1;E++){var D=g;g=0;for(var P=h&67108863,x=Math.min(E,w.length-1),v=Math.max(0,E-k.length+1);v<=x;v++){var b=E-v,L=k.words[b]|0,X=w.words[v]|0,ce=L*X,O=ce&67108863;D=D+(ce/67108864|0)|0,O=O+P|0,P=O&67108863,D=D+(O>>>26)|0,g+=D>>>26,D&=67108863}f.words[E]=P,h=D,D=g}return h!==0?f.words[E]=h:f.length--,f.strip()}function Y(k,w,f){var h=new q;return h.mulp(k,w,f)}s.prototype.mulTo=function(w,f){var h,g=this.length+w.length;return this.length===10&&w.length===10?h=B(this,w,f):g<63?h=M(this,w,f):g<1024?h=W(this,w,f):h=Y(this,w,f),h};function q(k,w){this.x=k,this.y=w}q.prototype.makeRBT=function(w){for(var f=new Array(w),h=s.prototype._countBits(w)-1,g=0;g<w;g++)f[g]=this.revBin(g,h,w);return f},q.prototype.revBin=function(w,f,h){if(w===0||w===h-1)return w;for(var g=0,E=0;E<f;E++)g|=(w&1)<<f-E-1,w>>=1;return g},q.prototype.permute=function(w,f,h,g,E,D){for(var P=0;P<D;P++)g[P]=f[w[P]],E[P]=h[w[P]]},q.prototype.transform=function(w,f,h,g,E,D){this.permute(D,w,f,h,g,E);for(var P=1;P<E;P<<=1)for(var x=P<<1,v=Math.cos(2*Math.PI/x),b=Math.sin(2*Math.PI/x),L=0;L<E;L+=x)for(var X=v,ce=b,O=0;O<P;O++){var ie=h[L+O],N=g[L+O],F=h[L+O+P],R=g[L+O+P],l=X*F-ce*R;R=X*R+ce*F,F=l,h[L+O]=ie+F,g[L+O]=N+R,h[L+O+P]=ie-F,g[L+O+P]=N-R,O!==x&&(l=v*X-b*ce,ce=v*ce+b*X,X=l)}},q.prototype.guessLen13b=function(w,f){var h=Math.max(f,w)|1,g=h&1,E=0;for(h=h/2|0;h;h=h>>>1)E++;return 1<<E+1+g},q.prototype.conjugate=function(w,f,h){if(!(h<=1))for(var g=0;g<h/2;g++){var E=w[g];w[g]=w[h-g-1],w[h-g-1]=E,E=f[g],f[g]=-f[h-g-1],f[h-g-1]=-E}},q.prototype.normalize13b=function(w,f){for(var h=0,g=0;g<f/2;g++){var E=Math.round(w[2*g+1]/f)*8192+Math.round(w[2*g]/f)+h;w[g]=E&67108863,E<67108864?h=0:h=E/67108864|0}return w},q.prototype.convert13b=function(w,f,h,g){for(var E=0,D=0;D<f;D++)E=E+(w[D]|0),h[2*D]=E&8191,E=E>>>13,h[2*D+1]=E&8191,E=E>>>13;for(D=2*f;D<g;++D)h[D]=0;i(E===0),i((E&-8192)===0)},q.prototype.stub=function(w){for(var f=new Array(w),h=0;h<w;h++)f[h]=0;return f},q.prototype.mulp=function(w,f,h){var g=2*this.guessLen13b(w.length,f.length),E=this.makeRBT(g),D=this.stub(g),P=new Array(g),x=new Array(g),v=new Array(g),b=new Array(g),L=new Array(g),X=new Array(g),ce=h.words;ce.length=g,this.convert13b(w.words,w.length,P,g),this.convert13b(f.words,f.length,b,g),this.transform(P,D,x,v,g,E),this.transform(b,D,L,X,g,E);for(var O=0;O<g;O++){var ie=x[O]*L[O]-v[O]*X[O];v[O]=x[O]*X[O]+v[O]*L[O],x[O]=ie}return this.conjugate(x,v,g),this.transform(x,v,ce,D,g,E),this.conjugate(ce,D,g),this.normalize13b(ce,g),h.negative=w.negative^f.negative,h.length=w.length+f.length,h.strip()},s.prototype.mul=function(w){var f=new s(null);return f.words=new Array(this.length+w.length),this.mulTo(w,f)},s.prototype.mulf=function(w){var f=new s(null);return f.words=new Array(this.length+w.length),Y(this,w,f)},s.prototype.imul=function(w){return this.clone().mulTo(w,this)},s.prototype.imuln=function(w){i(typeof w=="number"),i(w<67108864);for(var f=0,h=0;h<this.length;h++){var g=(this.words[h]|0)*w,E=(g&67108863)+(f&67108863);f>>=26,f+=g/67108864|0,f+=E>>>26,this.words[h]=E&67108863}return f!==0&&(this.words[h]=f,this.length++),this},s.prototype.muln=function(w){return this.clone().imuln(w)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(w){var f=I(w);if(f.length===0)return new s(1);for(var h=this,g=0;g<f.length&&f[g]===0;g++,h=h.sqr());if(++g<f.length)for(var E=h.sqr();g<f.length;g++,E=E.sqr())f[g]!==0&&(h=h.mul(E));return h},s.prototype.iushln=function(w){i(typeof w=="number"&&w>=0);var f=w%26,h=(w-f)/26,g=67108863>>>26-f<<26-f,E;if(f!==0){var D=0;for(E=0;E<this.length;E++){var P=this.words[E]&g,x=(this.words[E]|0)-P<<f;this.words[E]=x|D,D=P>>>26-f}D&&(this.words[E]=D,this.length++)}if(h!==0){for(E=this.length-1;E>=0;E--)this.words[E+h]=this.words[E];for(E=0;E<h;E++)this.words[E]=0;this.length+=h}return this.strip()},s.prototype.ishln=function(w){return i(this.negative===0),this.iushln(w)},s.prototype.iushrn=function(w,f,h){i(typeof w=="number"&&w>=0);var g;f?g=(f-f%26)/26:g=0;var E=w%26,D=Math.min((w-E)/26,this.length),P=67108863^67108863>>>E<<E,x=h;if(g-=D,g=Math.max(0,g),x){for(var v=0;v<D;v++)x.words[v]=this.words[v];x.length=D}if(D!==0)if(this.length>D)for(this.length-=D,v=0;v<this.length;v++)this.words[v]=this.words[v+D];else this.words[0]=0,this.length=1;var b=0;for(v=this.length-1;v>=0&&(b!==0||v>=g);v--){var L=this.words[v]|0;this.words[v]=b<<26-E|L>>>E,b=L&P}return x&&b!==0&&(x.words[x.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(w,f,h){return i(this.negative===0),this.iushrn(w,f,h)},s.prototype.shln=function(w){return this.clone().ishln(w)},s.prototype.ushln=function(w){return this.clone().iushln(w)},s.prototype.shrn=function(w){return this.clone().ishrn(w)},s.prototype.ushrn=function(w){return this.clone().iushrn(w)},s.prototype.testn=function(w){i(typeof w=="number"&&w>=0);var f=w%26,h=(w-f)/26,g=1<<f;if(this.length<=h)return!1;var E=this.words[h];return!!(E&g)},s.prototype.imaskn=function(w){i(typeof w=="number"&&w>=0);var f=w%26,h=(w-f)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(f!==0&&h++,this.length=Math.min(h,this.length),f!==0){var g=67108863^67108863>>>f<<f;this.words[this.length-1]&=g}return this.strip()},s.prototype.maskn=function(w){return this.clone().imaskn(w)},s.prototype.iaddn=function(w){return i(typeof w=="number"),i(w<67108864),w<0?this.isubn(-w):this.negative!==0?this.length===1&&(this.words[0]|0)<w?(this.words[0]=w-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(w),this.negative=1,this):this._iaddn(w)},s.prototype._iaddn=function(w){this.words[0]+=w;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},s.prototype.isubn=function(w){if(i(typeof w=="number"),i(w<67108864),w<0)return this.iaddn(-w);if(this.negative!==0)return this.negative=0,this.iaddn(w),this.negative=1,this;if(this.words[0]-=w,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this.strip()},s.prototype.addn=function(w){return this.clone().iaddn(w)},s.prototype.subn=function(w){return this.clone().isubn(w)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(w,f,h){var g=w.length+h,E;this._expand(g);var D,P=0;for(E=0;E<w.length;E++){D=(this.words[E+h]|0)+P;var x=(w.words[E]|0)*f;D-=x&67108863,P=(D>>26)-(x/67108864|0),this.words[E+h]=D&67108863}for(;E<this.length-h;E++)D=(this.words[E+h]|0)+P,P=D>>26,this.words[E+h]=D&67108863;if(P===0)return this.strip();for(i(P===-1),P=0,E=0;E<this.length;E++)D=-(this.words[E]|0)+P,P=D>>26,this.words[E]=D&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(w,f){var h=this.length-w.length,g=this.clone(),E=w,D=E.words[E.length-1]|0,P=this._countBits(D);h=26-P,h!==0&&(E=E.ushln(h),g.iushln(h),D=E.words[E.length-1]|0);var x=g.length-E.length,v;if(f!=="mod"){v=new s(null),v.length=x+1,v.words=new Array(v.length);for(var b=0;b<v.length;b++)v.words[b]=0}var L=g.clone()._ishlnsubmul(E,1,x);L.negative===0&&(g=L,v&&(v.words[x]=1));for(var X=x-1;X>=0;X--){var ce=(g.words[E.length+X]|0)*67108864+(g.words[E.length+X-1]|0);for(ce=Math.min(ce/D|0,67108863),g._ishlnsubmul(E,ce,X);g.negative!==0;)ce--,g.negative=0,g._ishlnsubmul(E,1,X),g.isZero()||(g.negative^=1);v&&(v.words[X]=ce)}return v&&v.strip(),g.strip(),f!=="div"&&h!==0&&g.iushrn(h),{div:v||null,mod:g}},s.prototype.divmod=function(w,f,h){if(i(!w.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var g,E,D;return this.negative!==0&&w.negative===0?(D=this.neg().divmod(w,f),f!=="mod"&&(g=D.div.neg()),f!=="div"&&(E=D.mod.neg(),h&&E.negative!==0&&E.iadd(w)),{div:g,mod:E}):this.negative===0&&w.negative!==0?(D=this.divmod(w.neg(),f),f!=="mod"&&(g=D.div.neg()),{div:g,mod:D.mod}):this.negative&w.negative?(D=this.neg().divmod(w.neg(),f),f!=="div"&&(E=D.mod.neg(),h&&E.negative!==0&&E.isub(w)),{div:D.div,mod:E}):w.length>this.length||this.cmp(w)<0?{div:new s(0),mod:this}:w.length===1?f==="div"?{div:this.divn(w.words[0]),mod:null}:f==="mod"?{div:null,mod:new s(this.modn(w.words[0]))}:{div:this.divn(w.words[0]),mod:new s(this.modn(w.words[0]))}:this._wordDiv(w,f)},s.prototype.div=function(w){return this.divmod(w,"div",!1).div},s.prototype.mod=function(w){return this.divmod(w,"mod",!1).mod},s.prototype.umod=function(w){return this.divmod(w,"mod",!0).mod},s.prototype.divRound=function(w){var f=this.divmod(w);if(f.mod.isZero())return f.div;var h=f.div.negative!==0?f.mod.isub(w):f.mod,g=w.ushrn(1),E=w.andln(1),D=h.cmp(g);return D<0||E===1&&D===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},s.prototype.modn=function(w){i(w<=67108863);for(var f=(1<<26)%w,h=0,g=this.length-1;g>=0;g--)h=(f*h+(this.words[g]|0))%w;return h},s.prototype.idivn=function(w){i(w<=67108863);for(var f=0,h=this.length-1;h>=0;h--){var g=(this.words[h]|0)+f*67108864;this.words[h]=g/w|0,f=g%w}return this.strip()},s.prototype.divn=function(w){return this.clone().idivn(w)},s.prototype.egcd=function(w){i(w.negative===0),i(!w.isZero());var f=this,h=w.clone();f.negative!==0?f=f.umod(w):f=f.clone();for(var g=new s(1),E=new s(0),D=new s(0),P=new s(1),x=0;f.isEven()&&h.isEven();)f.iushrn(1),h.iushrn(1),++x;for(var v=h.clone(),b=f.clone();!f.isZero();){for(var L=0,X=1;!(f.words[0]&X)&&L<26;++L,X<<=1);if(L>0)for(f.iushrn(L);L-- >0;)(g.isOdd()||E.isOdd())&&(g.iadd(v),E.isub(b)),g.iushrn(1),E.iushrn(1);for(var ce=0,O=1;!(h.words[0]&O)&&ce<26;++ce,O<<=1);if(ce>0)for(h.iushrn(ce);ce-- >0;)(D.isOdd()||P.isOdd())&&(D.iadd(v),P.isub(b)),D.iushrn(1),P.iushrn(1);f.cmp(h)>=0?(f.isub(h),g.isub(D),E.isub(P)):(h.isub(f),D.isub(g),P.isub(E))}return{a:D,b:P,gcd:h.iushln(x)}},s.prototype._invmp=function(w){i(w.negative===0),i(!w.isZero());var f=this,h=w.clone();f.negative!==0?f=f.umod(w):f=f.clone();for(var g=new s(1),E=new s(0),D=h.clone();f.cmpn(1)>0&&h.cmpn(1)>0;){for(var P=0,x=1;!(f.words[0]&x)&&P<26;++P,x<<=1);if(P>0)for(f.iushrn(P);P-- >0;)g.isOdd()&&g.iadd(D),g.iushrn(1);for(var v=0,b=1;!(h.words[0]&b)&&v<26;++v,b<<=1);if(v>0)for(h.iushrn(v);v-- >0;)E.isOdd()&&E.iadd(D),E.iushrn(1);f.cmp(h)>=0?(f.isub(h),g.isub(E)):(h.isub(f),E.isub(g))}var L;return f.cmpn(1)===0?L=g:L=E,L.cmpn(0)<0&&L.iadd(w),L},s.prototype.gcd=function(w){if(this.isZero())return w.abs();if(w.isZero())return this.abs();var f=this.clone(),h=w.clone();f.negative=0,h.negative=0;for(var g=0;f.isEven()&&h.isEven();g++)f.iushrn(1),h.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;h.isEven();)h.iushrn(1);var E=f.cmp(h);if(E<0){var D=f;f=h,h=D}else if(E===0||h.cmpn(1)===0)break;f.isub(h)}while(!0);return h.iushln(g)},s.prototype.invm=function(w){return this.egcd(w).a.umod(w)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(w){return this.words[0]&w},s.prototype.bincn=function(w){i(typeof w=="number");var f=w%26,h=(w-f)/26,g=1<<f;if(this.length<=h)return this._expand(h+1),this.words[h]|=g,this;for(var E=g,D=h;E!==0&&D<this.length;D++){var P=this.words[D]|0;P+=E,E=P>>>26,P&=67108863,this.words[D]=P}return E!==0&&(this.words[D]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(w){var f=w<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this.strip();var h;if(this.length>1)h=1;else{f&&(w=-w),i(w<=67108863,"Number is too big");var g=this.words[0]|0;h=g===w?0:g<w?-1:1}return this.negative!==0?-h|0:h},s.prototype.cmp=function(w){if(this.negative!==0&&w.negative===0)return-1;if(this.negative===0&&w.negative!==0)return 1;var f=this.ucmp(w);return this.negative!==0?-f|0:f},s.prototype.ucmp=function(w){if(this.length>w.length)return 1;if(this.length<w.length)return-1;for(var f=0,h=this.length-1;h>=0;h--){var g=this.words[h]|0,E=w.words[h]|0;if(g!==E){g<E?f=-1:g>E&&(f=1);break}}return f},s.prototype.gtn=function(w){return this.cmpn(w)===1},s.prototype.gt=function(w){return this.cmp(w)===1},s.prototype.gten=function(w){return this.cmpn(w)>=0},s.prototype.gte=function(w){return this.cmp(w)>=0},s.prototype.ltn=function(w){return this.cmpn(w)===-1},s.prototype.lt=function(w){return this.cmp(w)===-1},s.prototype.lten=function(w){return this.cmpn(w)<=0},s.prototype.lte=function(w){return this.cmp(w)<=0},s.prototype.eqn=function(w){return this.cmpn(w)===0},s.prototype.eq=function(w){return this.cmp(w)===0},s.red=function(w){return new ee(w)},s.prototype.toRed=function(w){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),w.convertTo(this)._forceRed(w)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(w){return this.red=w,this},s.prototype.forceRed=function(w){return i(!this.red,"Already a number in reduction context"),this._forceRed(w)},s.prototype.redAdd=function(w){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,w)},s.prototype.redIAdd=function(w){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,w)},s.prototype.redSub=function(w){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,w)},s.prototype.redISub=function(w){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,w)},s.prototype.redShl=function(w){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,w)},s.prototype.redMul=function(w){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,w),this.red.mul(this,w)},s.prototype.redIMul=function(w){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,w),this.red.imul(this,w)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(w){return i(this.red&&!w.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,w)};var V={k256:null,p224:null,p192:null,p25519:null};function U(k,w){this.name=k,this.p=new s(w,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}U.prototype._tmp=function(){var w=new s(null);return w.words=new Array(Math.ceil(this.n/13)),w},U.prototype.ireduce=function(w){var f=w,h;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),h=f.bitLength();while(h>this.n);var g=h<this.n?-1:f.ucmp(this.p);return g===0?(f.words[0]=0,f.length=1):g>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},U.prototype.split=function(w,f){w.iushrn(this.n,0,f)},U.prototype.imulK=function(w){return w.imul(this.k)};function z(){U.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(z,U),z.prototype.split=function(w,f){for(var h=4194303,g=Math.min(w.length,9),E=0;E<g;E++)f.words[E]=w.words[E];if(f.length=g,w.length<=9){w.words[0]=0,w.length=1;return}var D=w.words[9];for(f.words[f.length++]=D&h,E=10;E<w.length;E++){var P=w.words[E]|0;w.words[E-10]=(P&h)<<4|D>>>22,D=P}D>>>=22,w.words[E-10]=D,D===0&&w.length>10?w.length-=10:w.length-=9},z.prototype.imulK=function(w){w.words[w.length]=0,w.words[w.length+1]=0,w.length+=2;for(var f=0,h=0;h<w.length;h++){var g=w.words[h]|0;f+=g*977,w.words[h]=f&67108863,f=g*64+(f/67108864|0)}return w.words[w.length-1]===0&&(w.length--,w.words[w.length-1]===0&&w.length--),w};function K(){U.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(K,U);function A(){U.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(A,U);function j(){U.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(j,U),j.prototype.imulK=function(w){for(var f=0,h=0;h<w.length;h++){var g=(w.words[h]|0)*19+f,E=g&67108863;g>>>=26,w.words[h]=E,f=g}return f!==0&&(w.words[w.length++]=f),w},s._prime=function(w){if(V[w])return V[w];var f;if(w==="k256")f=new z;else if(w==="p224")f=new K;else if(w==="p192")f=new A;else if(w==="p25519")f=new j;else throw new Error("Unknown prime "+w);return V[w]=f,f};function ee(k){if(typeof k=="string"){var w=s._prime(k);this.m=w.p,this.prime=w}else i(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}ee.prototype._verify1=function(w){i(w.negative===0,"red works only with positives"),i(w.red,"red works only with red numbers")},ee.prototype._verify2=function(w,f){i((w.negative|f.negative)===0,"red works only with positives"),i(w.red&&w.red===f.red,"red works only with red numbers")},ee.prototype.imod=function(w){return this.prime?this.prime.ireduce(w)._forceRed(this):w.umod(this.m)._forceRed(this)},ee.prototype.neg=function(w){return w.isZero()?w.clone():this.m.sub(w)._forceRed(this)},ee.prototype.add=function(w,f){this._verify2(w,f);var h=w.add(f);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},ee.prototype.iadd=function(w,f){this._verify2(w,f);var h=w.iadd(f);return h.cmp(this.m)>=0&&h.isub(this.m),h},ee.prototype.sub=function(w,f){this._verify2(w,f);var h=w.sub(f);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},ee.prototype.isub=function(w,f){this._verify2(w,f);var h=w.isub(f);return h.cmpn(0)<0&&h.iadd(this.m),h},ee.prototype.shl=function(w,f){return this._verify1(w),this.imod(w.ushln(f))},ee.prototype.imul=function(w,f){return this._verify2(w,f),this.imod(w.imul(f))},ee.prototype.mul=function(w,f){return this._verify2(w,f),this.imod(w.mul(f))},ee.prototype.isqr=function(w){return this.imul(w,w.clone())},ee.prototype.sqr=function(w){return this.mul(w,w)},ee.prototype.sqrt=function(w){if(w.isZero())return w.clone();var f=this.m.andln(3);if(i(f%2===1),f===3){var h=this.m.add(new s(1)).iushrn(2);return this.pow(w,h)}for(var g=this.m.subn(1),E=0;!g.isZero()&&g.andln(1)===0;)E++,g.iushrn(1);i(!g.isZero());var D=new s(1).toRed(this),P=D.redNeg(),x=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new s(2*v*v).toRed(this);this.pow(v,x).cmp(P)!==0;)v.redIAdd(P);for(var b=this.pow(v,g),L=this.pow(w,g.addn(1).iushrn(1)),X=this.pow(w,g),ce=E;X.cmp(D)!==0;){for(var O=X,ie=0;O.cmp(D)!==0;ie++)O=O.redSqr();i(ie<ce);var N=this.pow(b,new s(1).iushln(ce-ie-1));L=L.redMul(N),b=N.redSqr(),X=X.redMul(b),ce=ie}return L},ee.prototype.invm=function(w){var f=w._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},ee.prototype.pow=function(w,f){if(f.isZero())return new s(1).toRed(this);if(f.cmpn(1)===0)return w.clone();var h=4,g=new Array(1<<h);g[0]=new s(1).toRed(this),g[1]=w;for(var E=2;E<g.length;E++)g[E]=this.mul(g[E-1],w);var D=g[0],P=0,x=0,v=f.bitLength()%26;for(v===0&&(v=26),E=f.length-1;E>=0;E--){for(var b=f.words[E],L=v-1;L>=0;L--){var X=b>>L&1;if(D!==g[0]&&(D=this.sqr(D)),X===0&&P===0){x=0;continue}P<<=1,P|=X,x++,!(x!==h&&(E!==0||L!==0))&&(D=this.mul(D,g[P]),x=0,P=0)}v=26}return D},ee.prototype.convertTo=function(w){var f=w.umod(this.m);return f===w?f.clone():f},ee.prototype.convertFrom=function(w){var f=w.clone();return f.red=null,f},s.mont=function(w){return new re(w)};function re(k){ee.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(re,ee),re.prototype.convertTo=function(w){return this.imod(w.ushln(this.shift))},re.prototype.convertFrom=function(w){var f=this.imod(w.mul(this.rinv));return f.red=null,f},re.prototype.imul=function(w,f){if(w.isZero()||f.isZero())return w.words[0]=0,w.length=1,w;var h=w.imul(f),g=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=h.isub(g).iushrn(this.shift),D=E;return E.cmp(this.m)>=0?D=E.isub(this.m):E.cmpn(0)<0&&(D=E.iadd(this.m)),D._forceRed(this)},re.prototype.mul=function(w,f){if(w.isZero()||f.isZero())return new s(0)._forceRed(this);var h=w.mul(f),g=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=h.isub(g).iushrn(this.shift),D=E;return E.cmp(this.m)>=0?D=E.isub(this.m):E.cmpn(0)<0&&(D=E.iadd(this.m)),D._forceRed(this)},re.prototype.invm=function(w){var f=this.imod(w._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(t,Gr)})(qn);var $o=V2;function V2(t,e){if(!t)throw new Error(e||"Assertion failed")}V2.equal=function(e,r,i){if(e!=r)throw new Error(i||"Assertion failed: "+e+" != "+r)};var P0={};(function(t){var e=t;function r(s,a){if(Array.isArray(s))return s.slice();if(!s)return[];var u=[];if(typeof s!="string"){for(var d=0;d<s.length;d++)u[d]=s[d]|0;return u}if(a==="hex"){s=s.replace(/[^a-z0-9]+/ig,""),s.length%2!==0&&(s="0"+s);for(var d=0;d<s.length;d+=2)u.push(parseInt(s[d]+s[d+1],16))}else for(var d=0;d<s.length;d++){var p=s.charCodeAt(d),y=p>>8,_=p&255;y?u.push(y,_):u.push(_)}return u}e.toArray=r;function i(s){return s.length===1?"0"+s:s}e.zero2=i;function n(s){for(var a="",u=0;u<s.length;u++)a+=i(s[u].toString(16));return a}e.toHex=n,e.encode=function(a,u){return u==="hex"?n(a):a}})(P0),function(t){var e=t,r=qn.exports,i=$o,n=P0;e.assert=i,e.toArray=n.toArray,e.zero2=n.zero2,e.toHex=n.toHex,e.encode=n.encode;function s(y,_,C){var I=new Array(Math.max(y.bitLength(),C)+1),M;for(M=0;M<I.length;M+=1)I[M]=0;var B=1<<_+1,W=y.clone();for(M=0;M<I.length;M++){var Y,q=W.andln(B-1);W.isOdd()?(q>(B>>1)-1?Y=(B>>1)-q:Y=q,W.isubn(Y)):Y=0,I[M]=Y,W.iushrn(1)}return I}e.getNAF=s;function a(y,_){var C=[[],[]];y=y.clone(),_=_.clone();for(var I=0,M=0,B;y.cmpn(-I)>0||_.cmpn(-M)>0;){var W=y.andln(3)+I&3,Y=_.andln(3)+M&3;W===3&&(W=-1),Y===3&&(Y=-1);var q;W&1?(B=y.andln(7)+I&7,(B===3||B===5)&&Y===2?q=-W:q=W):q=0,C[0].push(q);var V;Y&1?(B=_.andln(7)+M&7,(B===3||B===5)&&W===2?V=-Y:V=Y):V=0,C[1].push(V),2*I===q+1&&(I=1-I),2*M===V+1&&(M=1-M),y.iushrn(1),_.iushrn(1)}return C}e.getJSF=a;function u(y,_,C){var I="_"+_;y.prototype[_]=function(){return this[I]!==void 0?this[I]:this[I]=C.call(this)}}e.cachedProperty=u;function d(y){return typeof y=="string"?e.toArray(y,"hex"):y}e.parseBytes=d;function p(y){return new r(y,"hex","le")}e.intFromLE=p}(Li);var Sf={exports:{}},O0;Sf.exports=function(e){return O0||(O0=new Ys(null)),O0.generate(e)};function Ys(t){this.rand=t}if(Sf.exports.Rand=Ys,Ys.prototype.generate=function(e){return this._rand(e)},Ys.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),i=0;i<r.length;i++)r[i]=this.rand.getByte();return r},typeof self=="object")self.crypto&&self.crypto.getRandomValues?Ys.prototype._rand=function(e){var r=new Uint8Array(e);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?Ys.prototype._rand=function(e){var r=new Uint8Array(e);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(Ys.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var G2=S0;if(typeof G2.randomBytes!="function")throw new Error("Not supported");Ys.prototype._rand=function(e){return G2.randomBytes(e)}}catch{}var $0={},No=qn.exports,Gc=Li,If=Gc.getNAF,G9=Gc.getJSF,Mf=Gc.assert;function Js(t,e){this.type=t,this.p=new No(e.p,16),this.red=e.prime?No.red(e.prime):No.mont(this.p),this.zero=new No(0).toRed(this.red),this.one=new No(1).toRed(this.red),this.two=new No(2).toRed(this.red),this.n=e.n&&new No(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Cf=Js;Js.prototype.point=function(){throw new Error("Not implemented")},Js.prototype.validate=function(){throw new Error("Not implemented")},Js.prototype._fixedNafMul=function(e,r){Mf(e.precomputed);var i=e._getDoubles(),n=If(r,1,this._bitLength),s=(1<<i.step+1)-(i.step%2===0?2:1);s/=3;var a=[],u,d;for(u=0;u<n.length;u+=i.step){d=0;for(var p=u+i.step-1;p>=u;p--)d=(d<<1)+n[p];a.push(d)}for(var y=this.jpoint(null,null,null),_=this.jpoint(null,null,null),C=s;C>0;C--){for(u=0;u<a.length;u++)d=a[u],d===C?_=_.mixedAdd(i.points[u]):d===-C&&(_=_.mixedAdd(i.points[u].neg()));y=y.add(_)}return y.toP()},Js.prototype._wnafMul=function(e,r){var i=4,n=e._getNAFPoints(i);i=n.wnd;for(var s=n.points,a=If(r,i,this._bitLength),u=this.jpoint(null,null,null),d=a.length-1;d>=0;d--){for(var p=0;d>=0&&a[d]===0;d--)p++;if(d>=0&&p++,u=u.dblp(p),d<0)break;var y=a[d];Mf(y!==0),e.type==="affine"?y>0?u=u.mixedAdd(s[y-1>>1]):u=u.mixedAdd(s[-y-1>>1].neg()):y>0?u=u.add(s[y-1>>1]):u=u.add(s[-y-1>>1].neg())}return e.type==="affine"?u.toP():u},Js.prototype._wnafMulAdd=function(e,r,i,n,s){var a=this._wnafT1,u=this._wnafT2,d=this._wnafT3,p=0,y,_,C;for(y=0;y<n;y++){C=r[y];var I=C._getNAFPoints(e);a[y]=I.wnd,u[y]=I.points}for(y=n-1;y>=1;y-=2){var M=y-1,B=y;if(a[M]!==1||a[B]!==1){d[M]=If(i[M],a[M],this._bitLength),d[B]=If(i[B],a[B],this._bitLength),p=Math.max(d[M].length,p),p=Math.max(d[B].length,p);continue}var W=[r[M],null,null,r[B]];r[M].y.cmp(r[B].y)===0?(W[1]=r[M].add(r[B]),W[2]=r[M].toJ().mixedAdd(r[B].neg())):r[M].y.cmp(r[B].y.redNeg())===0?(W[1]=r[M].toJ().mixedAdd(r[B]),W[2]=r[M].add(r[B].neg())):(W[1]=r[M].toJ().mixedAdd(r[B]),W[2]=r[M].toJ().mixedAdd(r[B].neg()));var Y=[-3,-1,-5,-7,0,7,5,1,3],q=G9(i[M],i[B]);for(p=Math.max(q[0].length,p),d[M]=new Array(p),d[B]=new Array(p),_=0;_<p;_++){var V=q[0][_]|0,U=q[1][_]|0;d[M][_]=Y[(V+1)*3+(U+1)],d[B][_]=0,u[M]=W}}var z=this.jpoint(null,null,null),K=this._wnafT4;for(y=p;y>=0;y--){for(var A=0;y>=0;){var j=!0;for(_=0;_<n;_++)K[_]=d[_][y]|0,K[_]!==0&&(j=!1);if(!j)break;A++,y--}if(y>=0&&A++,z=z.dblp(A),y<0)break;for(_=0;_<n;_++){var ee=K[_];ee!==0&&(ee>0?C=u[_][ee-1>>1]:ee<0&&(C=u[_][-ee-1>>1].neg()),C.type==="affine"?z=z.mixedAdd(C):z=z.add(C))}}for(y=0;y<n;y++)u[y]=null;return s?z:z.toP()};function Yi(t,e){this.curve=t,this.type=e,this.precomputed=null}Js.BasePoint=Yi,Yi.prototype.eq=function(){throw new Error("Not implemented")},Yi.prototype.validate=function(){return this.curve.validate(this)},Js.prototype.decodePoint=function(e,r){e=Gc.toArray(e,r);var i=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*i){e[0]===6?Mf(e[e.length-1]%2===0):e[0]===7&&Mf(e[e.length-1]%2===1);var n=this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));return n}else if((e[0]===2||e[0]===3)&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),e[0]===3);throw new Error("Unknown point format")},Yi.prototype.encodeCompressed=function(e){return this.encode(e,!0)},Yi.prototype._encode=function(e){var r=this.curve.p.byteLength(),i=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",r))},Yi.prototype.encode=function(e,r){return Gc.encode(this._encode(r),e)},Yi.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this},Yi.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1},Yi.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,s=0;s<r;s+=e){for(var a=0;a<e;a++)n=n.dbl();i.push(n)}return{step:e,points:i}},Yi.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],i=(1<<e)-1,n=i===1?null:this.dbl(),s=1;s<i;s++)r[s]=r[s-1].add(n);return{wnd:e,points:r}},Yi.prototype._getBeta=function(){return null},Yi.prototype.dblp=function(e){for(var r=this,i=0;i<e;i++)r=r.dbl();return r};var Ma={exports:{}};typeof Object.create=="function"?Ma.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ma.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}};var Y9=Li,lr=qn.exports,N0=Ma.exports,Ca=Cf,J9=Y9.assert;function Ji(t){Ca.call(this,"short",t),this.a=new lr(t.a,16).toRed(this.red),this.b=new lr(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}N0(Ji,Ca);var Q9=Ji;Ji.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,i;if(e.beta)r=new lr(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);r=n[0].cmp(n[1])<0?n[0]:n[1],r=r.toRed(this.red)}if(e.lambda)i=new lr(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))===0?i=s[0]:(i=s[1],J9(this.g.mul(i).x.cmp(this.g.x.redMul(r))===0))}var a;return e.basis?a=e.basis.map(function(u){return{a:new lr(u.a,16),b:new lr(u.b,16)}}):a=this._getEndoBasis(i),{beta:r,lambda:i,basis:a}}},Ji.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:lr.mont(e),i=new lr(2).toRed(r).redInvm(),n=i.redNeg(),s=new lr(3).toRed(r).redNeg().redSqrt().redMul(i),a=n.redAdd(s).fromRed(),u=n.redSub(s).fromRed();return[a,u]},Ji.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),i=e,n=this.n.clone(),s=new lr(1),a=new lr(0),u=new lr(0),d=new lr(1),p,y,_,C,I,M,B,W=0,Y,q;i.cmpn(0)!==0;){var V=n.div(i);Y=n.sub(V.mul(i)),q=u.sub(V.mul(s));var U=d.sub(V.mul(a));if(!_&&Y.cmp(r)<0)p=B.neg(),y=s,_=Y.neg(),C=q;else if(_&&++W===2)break;B=Y,n=i,i=Y,u=s,s=q,d=a,a=U}I=Y.neg(),M=q;var z=_.sqr().add(C.sqr()),K=I.sqr().add(M.sqr());return K.cmp(z)>=0&&(I=p,M=y),_.negative&&(_=_.neg(),C=C.neg()),I.negative&&(I=I.neg(),M=M.neg()),[{a:_,b:C},{a:I,b:M}]},Ji.prototype._endoSplit=function(e){var r=this.endo.basis,i=r[0],n=r[1],s=n.b.mul(e).divRound(this.n),a=i.b.neg().mul(e).divRound(this.n),u=s.mul(i.a),d=a.mul(n.a),p=s.mul(i.b),y=a.mul(n.b),_=e.sub(u).sub(d),C=p.add(y).neg();return{k1:_,k2:C}},Ji.prototype.pointFromX=function(e,r){e=new lr(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(n.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var s=n.fromRed().isOdd();return(r&&!s||!r&&s)&&(n=n.redNeg()),this.point(e,n)},Ji.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,i=e.y,n=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(n).redIAdd(this.b);return i.redSqr().redISub(s).cmpn(0)===0},Ji.prototype._endoWnafMulAdd=function(e,r,i){for(var n=this._endoWnafT1,s=this._endoWnafT2,a=0;a<e.length;a++){var u=this._endoSplit(r[a]),d=e[a],p=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),p=p.neg(!0)),n[a*2]=d,n[a*2+1]=p,s[a*2]=u.k1,s[a*2+1]=u.k2}for(var y=this._wnafMulAdd(1,n,s,a*2,i),_=0;_<a*2;_++)n[_]=null,s[_]=null;return y};function Pr(t,e,r,i){Ca.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new lr(e,16),this.y=new lr(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}N0(Pr,Ca.BasePoint),Ji.prototype.point=function(e,r,i){return new Pr(this,e,r,i)},Ji.prototype.pointFromJSON=function(e,r){return Pr.fromJSON(this,e,r)},Pr.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,n=function(s){return i.point(s.x.redMul(i.endo.beta),s.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return r}},Pr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Pr.fromJSON=function(e,r,i){typeof r=="string"&&(r=JSON.parse(r));var n=e.point(r[0],r[1],i);if(!r[2])return n;function s(u){return e.point(u[0],u[1],i)}var a=r[2];return n.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[n].concat(a.doubles.points.map(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[n].concat(a.naf.points.map(s))}},n},Pr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Pr.prototype.isInfinity=function(){return this.inf},Pr.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var i=r.redSqr().redISub(this.x).redISub(e.x),n=r.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)},Pr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),s=i.redAdd(i).redIAdd(i).redIAdd(r).redMul(n),a=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,u)},Pr.prototype.getX=function(){return this.x.fromRed()},Pr.prototype.getY=function(){return this.y.fromRed()},Pr.prototype.mul=function(e){return e=new lr(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Pr.prototype.mulAdd=function(e,r,i){var n=[this,r],s=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,s):this.curve._wnafMulAdd(1,n,s,2)},Pr.prototype.jmulAdd=function(e,r,i){var n=[this,r],s=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,s,!0):this.curve._wnafMulAdd(1,n,s,2,!0)},Pr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},Pr.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(s){return s.neg()};r.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return r},Pr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function kr(t,e,r,i){Ca.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new lr(0)):(this.x=new lr(e,16),this.y=new lr(r,16),this.z=new lr(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}N0(kr,Ca.BasePoint),Ji.prototype.jpoint=function(e,r,i){return new kr(this,e,r,i)},kr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),i=this.x.redMul(r),n=this.y.redMul(r).redMul(e);return this.curve.point(i,n)},kr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},kr.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(r),s=e.x.redMul(i),a=this.y.redMul(r.redMul(e.z)),u=e.y.redMul(i.redMul(this.z)),d=n.redSub(s),p=a.redSub(u);if(d.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=d.redSqr(),_=y.redMul(d),C=n.redMul(y),I=p.redSqr().redIAdd(_).redISub(C).redISub(C),M=p.redMul(C.redISub(I)).redISub(a.redMul(_)),B=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(I,M,B)},kr.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),i=this.x,n=e.x.redMul(r),s=this.y,a=e.y.redMul(r).redMul(this.z),u=i.redSub(n),d=s.redSub(a);if(u.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=u.redSqr(),y=p.redMul(u),_=i.redMul(p),C=d.redSqr().redIAdd(y).redISub(_).redISub(_),I=d.redMul(_.redISub(C)).redISub(s.redMul(y)),M=this.z.redMul(u);return this.curve.jpoint(C,I,M)},kr.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var i=this;for(r=0;r<e;r++)i=i.dbl();return i}var n=this.curve.a,s=this.curve.tinv,a=this.x,u=this.y,d=this.z,p=d.redSqr().redSqr(),y=u.redAdd(u);for(r=0;r<e;r++){var _=a.redSqr(),C=y.redSqr(),I=C.redSqr(),M=_.redAdd(_).redIAdd(_).redIAdd(n.redMul(p)),B=a.redMul(C),W=M.redSqr().redISub(B.redAdd(B)),Y=B.redISub(W),q=M.redMul(Y);q=q.redIAdd(q).redISub(I);var V=y.redMul(d);r+1<e&&(p=p.redMul(I)),a=W,d=V,y=q}return this.curve.jpoint(a,y.redMul(s),d)},kr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},kr.prototype._zeroDbl=function(){var e,r,i;if(this.zOne){var n=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(n).redISub(a);u=u.redIAdd(u);var d=n.redAdd(n).redIAdd(n),p=d.redSqr().redISub(u).redISub(u),y=a.redIAdd(a);y=y.redIAdd(y),y=y.redIAdd(y),e=p,r=d.redMul(u.redISub(p)).redISub(y),i=this.y.redAdd(this.y)}else{var _=this.x.redSqr(),C=this.y.redSqr(),I=C.redSqr(),M=this.x.redAdd(C).redSqr().redISub(_).redISub(I);M=M.redIAdd(M);var B=_.redAdd(_).redIAdd(_),W=B.redSqr(),Y=I.redIAdd(I);Y=Y.redIAdd(Y),Y=Y.redIAdd(Y),e=W.redISub(M).redISub(M),r=B.redMul(M.redISub(e)).redISub(Y),i=this.y.redMul(this.z),i=i.redIAdd(i)}return this.curve.jpoint(e,r,i)},kr.prototype._threeDbl=function(){var e,r,i;if(this.zOne){var n=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(n).redISub(a);u=u.redIAdd(u);var d=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),p=d.redSqr().redISub(u).redISub(u);e=p;var y=a.redIAdd(a);y=y.redIAdd(y),y=y.redIAdd(y),r=d.redMul(u.redISub(p)).redISub(y),i=this.y.redAdd(this.y)}else{var _=this.z.redSqr(),C=this.y.redSqr(),I=this.x.redMul(C),M=this.x.redSub(_).redMul(this.x.redAdd(_));M=M.redAdd(M).redIAdd(M);var B=I.redIAdd(I);B=B.redIAdd(B);var W=B.redAdd(B);e=M.redSqr().redISub(W),i=this.y.redAdd(this.z).redSqr().redISub(C).redISub(_);var Y=C.redSqr();Y=Y.redIAdd(Y),Y=Y.redIAdd(Y),Y=Y.redIAdd(Y),r=M.redMul(B.redISub(e)).redISub(Y)}return this.curve.jpoint(e,r,i)},kr.prototype._dbl=function(){var e=this.curve.a,r=this.x,i=this.y,n=this.z,s=n.redSqr().redSqr(),a=r.redSqr(),u=i.redSqr(),d=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(s)),p=r.redAdd(r);p=p.redIAdd(p);var y=p.redMul(u),_=d.redSqr().redISub(y.redAdd(y)),C=y.redISub(_),I=u.redSqr();I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var M=d.redMul(C).redISub(I),B=i.redAdd(i).redMul(n);return this.curve.jpoint(_,M,B)},kr.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr(),n=r.redSqr(),s=e.redAdd(e).redIAdd(e),a=s.redSqr(),u=this.x.redAdd(r).redSqr().redISub(e).redISub(n);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(a);var d=u.redSqr(),p=n.redIAdd(n);p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var y=s.redIAdd(u).redSqr().redISub(a).redISub(d).redISub(p),_=r.redMul(y);_=_.redIAdd(_),_=_.redIAdd(_);var C=this.x.redMul(d).redISub(_);C=C.redIAdd(C),C=C.redIAdd(C);var I=this.y.redMul(y.redMul(p.redISub(y)).redISub(u.redMul(d)));I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var M=this.z.redAdd(u).redSqr().redISub(i).redISub(d);return this.curve.jpoint(C,I,M)},kr.prototype.mul=function(e,r){return e=new lr(e,r),this.curve._wnafMul(this,e)},kr.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),i=e.z.redSqr();if(this.x.redMul(i).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var n=r.redMul(this.z),s=i.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(n)).cmpn(0)===0},kr.prototype.eqXToP=function(e){var r=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(i)===0)return!0;for(var n=e.clone(),s=this.curve.redN.redMul(r);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(s),this.x.cmp(i)===0)return!0}},kr.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},kr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Da=qn.exports,Y2=Ma.exports,Df=Cf,Z9=Li;function Pa(t){Df.call(this,"mont",t),this.a=new Da(t.a,16).toRed(this.red),this.b=new Da(t.b,16).toRed(this.red),this.i4=new Da(4).toRed(this.red).redInvm(),this.two=new Da(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Y2(Pa,Df);var X9=Pa;Pa.prototype.validate=function(e){var r=e.normalize().x,i=r.redSqr(),n=i.redMul(r).redAdd(i.redMul(this.a)).redAdd(r),s=n.redSqrt();return s.redSqr().cmp(n)===0};function Or(t,e,r){Df.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Da(e,16),this.z=new Da(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Y2(Or,Df.BasePoint),Pa.prototype.decodePoint=function(e,r){return this.point(Z9.toArray(e,r),1)},Pa.prototype.point=function(e,r){return new Or(this,e,r)},Pa.prototype.pointFromJSON=function(e){return Or.fromJSON(this,e)},Or.prototype.precompute=function(){},Or.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Or.fromJSON=function(e,r){return new Or(e,r[0],r[1]||e.one)},Or.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Or.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Or.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),i=this.x.redSub(this.z),n=i.redSqr(),s=r.redSub(n),a=r.redMul(n),u=s.redMul(n.redAdd(this.curve.a24.redMul(s)));return this.curve.point(a,u)},Or.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Or.prototype.diffAdd=function(e,r){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),s=e.x.redAdd(e.z),a=e.x.redSub(e.z),u=a.redMul(i),d=s.redMul(n),p=r.z.redMul(u.redAdd(d).redSqr()),y=r.x.redMul(u.redISub(d).redSqr());return this.curve.point(p,y)},Or.prototype.mul=function(e){for(var r=e.clone(),i=this,n=this.curve.point(null,null),s=this,a=[];r.cmpn(0)!==0;r.iushrn(1))a.push(r.andln(1));for(var u=a.length-1;u>=0;u--)a[u]===0?(i=i.diffAdd(n,s),n=n.dbl()):(n=i.diffAdd(n,s),i=i.dbl());return n},Or.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Or.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Or.prototype.eq=function(e){return this.getX().cmp(e.getX())===0},Or.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Or.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var e_=Li,Es=qn.exports,J2=Ma.exports,Pf=Cf,t_=e_.assert;function zn(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Pf.call(this,"edwards",t),this.a=new Es(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Es(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Es(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),t_(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}J2(zn,Pf);var r_=zn;zn.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},zn.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},zn.prototype.jpoint=function(e,r,i,n){return this.point(e,r,i,n)},zn.prototype.pointFromX=function(e,r){e=new Es(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=this.c2.redSub(this.a.redMul(i)),s=this.one.redSub(this.c2.redMul(this.d).redMul(i)),a=n.redMul(s.redInvm()),u=a.redSqrt();if(u.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var d=u.fromRed().isOdd();return(r&&!d||!r&&d)&&(u=u.redNeg()),this.point(e,u)},zn.prototype.pointFromY=function(e,r){e=new Es(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=i.redSub(this.c2),s=i.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(s.redInvm());if(a.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var u=a.redSqrt();if(u.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==r&&(u=u.redNeg()),this.point(u,e)},zn.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),i=e.y.redSqr(),n=r.redMul(this.a).redAdd(i),s=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(i)));return n.cmp(s)===0};function nr(t,e,r,i,n){Pf.BasePoint.call(this,t,"projective"),e===null&&r===null&&i===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Es(e,16),this.y=new Es(r,16),this.z=i?new Es(i,16):this.curve.one,this.t=n&&new Es(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}J2(nr,Pf.BasePoint),zn.prototype.pointFromJSON=function(e){return nr.fromJSON(this,e)},zn.prototype.point=function(e,r,i,n){return new nr(this,e,r,i,n)},nr.fromJSON=function(e,r){return new nr(e,r[0],r[1],r[2])},nr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},nr.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},nr.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),a=n.redAdd(r),u=a.redSub(i),d=n.redSub(r),p=s.redMul(u),y=a.redMul(d),_=s.redMul(d),C=u.redMul(a);return this.curve.point(p,y,C,_)},nr.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),i=this.y.redSqr(),n,s,a,u,d,p;if(this.curve.twisted){u=this.curve._mulA(r);var y=u.redAdd(i);this.zOne?(n=e.redSub(r).redSub(i).redMul(y.redSub(this.curve.two)),s=y.redMul(u.redSub(i)),a=y.redSqr().redSub(y).redSub(y)):(d=this.z.redSqr(),p=y.redSub(d).redISub(d),n=e.redSub(r).redISub(i).redMul(p),s=y.redMul(u.redSub(i)),a=y.redMul(p))}else u=r.redAdd(i),d=this.curve._mulC(this.z).redSqr(),p=u.redSub(d).redSub(d),n=this.curve._mulC(e.redISub(u)).redMul(p),s=this.curve._mulC(u).redMul(r.redISub(i)),a=u.redMul(p);return this.curve.point(n,s,a)},nr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},nr.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),a=i.redSub(r),u=s.redSub(n),d=s.redAdd(n),p=i.redAdd(r),y=a.redMul(u),_=d.redMul(p),C=a.redMul(p),I=u.redMul(d);return this.curve.point(y,_,I,C)},nr.prototype._projAdd=function(e){var r=this.z.redMul(e.z),i=r.redSqr(),n=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(n).redMul(s),u=i.redSub(a),d=i.redAdd(a),p=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(s),y=r.redMul(u).redMul(p),_,C;return this.curve.twisted?(_=r.redMul(d).redMul(s.redSub(this.curve._mulA(n))),C=u.redMul(d)):(_=r.redMul(d).redMul(s.redSub(n)),C=this.curve._mulC(u).redMul(d)),this.curve.point(y,_,C)},nr.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},nr.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},nr.prototype.mulAdd=function(e,r,i){return this.curve._wnafMulAdd(1,[this,r],[e,i],2,!1)},nr.prototype.jmulAdd=function(e,r,i){return this.curve._wnafMulAdd(1,[this,r],[e,i],2,!0)},nr.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},nr.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},nr.prototype.getX=function(){return this.normalize(),this.x.fromRed()},nr.prototype.getY=function(){return this.normalize(),this.y.fromRed()},nr.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},nr.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),this.x.cmp(r)===0)return!0}},nr.prototype.toP=nr.prototype.normalize,nr.prototype.mixedAdd=nr.prototype.add,function(t){var e=t;e.base=Cf,e.short=Q9,e.mont=X9,e.edwards=r_}($0);var Of={},$f={},Rt={},i_=$o,n_=Ma.exports;Rt.inherits=n_;function s_(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function o_(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var s=t.charCodeAt(n);s<128?r[i++]=s:s<2048?(r[i++]=s>>6|192,r[i++]=s&63|128):s_(t,n)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++n)&1023),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=s&63|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=s&63|128)}else for(n=0;n<t.length;n++)r[n]=t[n]|0;return r}Rt.toArray=o_;function a_(t){for(var e="",r=0;r<t.length;r++)e+=Z2(t[r].toString(16));return e}Rt.toHex=a_;function Q2(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Rt.htonl=Q2;function c_(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];e==="little"&&(n=Q2(n)),r+=X2(n.toString(16))}return r}Rt.toHex32=c_;function Z2(t){return t.length===1?"0"+t:t}Rt.zero2=Z2;function X2(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}Rt.zero8=X2;function u_(t,e,r,i){var n=r-e;i_(n%4===0);for(var s=new Array(n/4),a=0,u=e;a<s.length;a++,u+=4){var d;i==="big"?d=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:d=t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=d>>>0}return s}Rt.join32=u_;function f_(t,e){for(var r=new Array(t.length*4),i=0,n=0;i<t.length;i++,n+=4){var s=t[i];e==="big"?(r[n]=s>>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=s&255):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=s&255)}return r}Rt.split32=f_;function h_(t,e){return t>>>e|t<<32-e}Rt.rotr32=h_;function l_(t,e){return t<<e|t>>>32-e}Rt.rotl32=l_;function d_(t,e){return t+e>>>0}Rt.sum32=d_;function p_(t,e,r){return t+e+r>>>0}Rt.sum32_3=p_;function g_(t,e,r,i){return t+e+r+i>>>0}Rt.sum32_4=g_;function v_(t,e,r,i,n){return t+e+r+i+n>>>0}Rt.sum32_5=v_;function m_(t,e,r,i){var n=t[e],s=t[e+1],a=i+s>>>0,u=(a<i?1:0)+r+n;t[e]=u>>>0,t[e+1]=a}Rt.sum64=m_;function b_(t,e,r,i){var n=e+i>>>0,s=(n<e?1:0)+t+r;return s>>>0}Rt.sum64_hi=b_;function y_(t,e,r,i){var n=e+i;return n>>>0}Rt.sum64_lo=y_;function w_(t,e,r,i,n,s,a,u){var d=0,p=e;p=p+i>>>0,d+=p<e?1:0,p=p+s>>>0,d+=p<s?1:0,p=p+u>>>0,d+=p<u?1:0;var y=t+r+n+a+d;return y>>>0}Rt.sum64_4_hi=w_;function __(t,e,r,i,n,s,a,u){var d=e+i+s+u;return d>>>0}Rt.sum64_4_lo=__;function A_(t,e,r,i,n,s,a,u,d,p){var y=0,_=e;_=_+i>>>0,y+=_<e?1:0,_=_+s>>>0,y+=_<s?1:0,_=_+u>>>0,y+=_<u?1:0,_=_+p>>>0,y+=_<p?1:0;var C=t+r+n+a+d+y;return C>>>0}Rt.sum64_5_hi=A_;function E_(t,e,r,i,n,s,a,u,d,p){var y=e+i+s+u+p;return y>>>0}Rt.sum64_5_lo=E_;function x_(t,e,r){var i=e<<32-r|t>>>r;return i>>>0}Rt.rotr64_hi=x_;function S_(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}Rt.rotr64_lo=S_;function I_(t,e,r){return t>>>r}Rt.shr64_hi=I_;function M_(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}Rt.shr64_lo=M_;var Oa={},ev=Rt,C_=$o;function Nf(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Oa.BlockHash=Nf,Nf.prototype.update=function(e,r){if(e=ev.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var i=e.length%this._delta8;this.pending=e.slice(e.length-i,e.length),this.pending.length===0&&(this.pending=null),e=ev.join32(e,0,e.length-i,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},Nf.prototype.digest=function(e){return this.update(this._pad()),C_(this.pending===null),this._digest(e)},Nf.prototype._pad=function(){var e=this.pendingTotal,r=this._delta8,i=r-(e+this.padLength)%r,n=new Array(i+this.padLength);n[0]=128;for(var s=1;s<i;s++)n[s]=0;if(e<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)n[s++]=0;n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=e>>>24&255,n[s++]=e>>>16&255,n[s++]=e>>>8&255,n[s++]=e&255}else for(n[s++]=e&255,n[s++]=e>>>8&255,n[s++]=e>>>16&255,n[s++]=e>>>24&255,n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=0,a=8;a<this.padLength;a++)n[s++]=0;return n};var $a={},Hn={},D_=Rt,Kn=D_.rotr32;function P_(t,e,r,i){if(t===0)return tv(e,r,i);if(t===1||t===3)return iv(e,r,i);if(t===2)return rv(e,r,i)}Hn.ft_1=P_;function tv(t,e,r){return t&e^~t&r}Hn.ch32=tv;function rv(t,e,r){return t&e^t&r^e&r}Hn.maj32=rv;function iv(t,e,r){return t^e^r}Hn.p32=iv;function O_(t){return Kn(t,2)^Kn(t,13)^Kn(t,22)}Hn.s0_256=O_;function $_(t){return Kn(t,6)^Kn(t,11)^Kn(t,25)}Hn.s1_256=$_;function N_(t){return Kn(t,7)^Kn(t,18)^t>>>3}Hn.g0_256=N_;function R_(t){return Kn(t,17)^Kn(t,19)^t>>>10}Hn.g1_256=R_;var Na=Rt,T_=Oa,F_=Hn,R0=Na.rotl32,Yc=Na.sum32,L_=Na.sum32_5,B_=F_.ft_1,nv=T_.BlockHash,U_=[1518500249,1859775393,2400959708,3395469782];function Wn(){if(!(this instanceof Wn))return new Wn;nv.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Na.inherits(Wn,nv);var k_=Wn;Wn.blockSize=512,Wn.outSize=160,Wn.hmacStrength=80,Wn.padLength=64,Wn.prototype._update=function(e,r){for(var i=this.W,n=0;n<16;n++)i[n]=e[r+n];for(;n<i.length;n++)i[n]=R0(i[n-3]^i[n-8]^i[n-14]^i[n-16],1);var s=this.h[0],a=this.h[1],u=this.h[2],d=this.h[3],p=this.h[4];for(n=0;n<i.length;n++){var y=~~(n/20),_=L_(R0(s,5),B_(y,a,u,d),p,i[n],U_[y]);p=d,d=u,u=R0(a,30),a=s,s=_}this.h[0]=Yc(this.h[0],s),this.h[1]=Yc(this.h[1],a),this.h[2]=Yc(this.h[2],u),this.h[3]=Yc(this.h[3],d),this.h[4]=Yc(this.h[4],p)},Wn.prototype._digest=function(e){return e==="hex"?Na.toHex32(this.h,"big"):Na.split32(this.h,"big")};var Ra=Rt,j_=Oa,Ta=Hn,q_=$o,wn=Ra.sum32,z_=Ra.sum32_4,H_=Ra.sum32_5,K_=Ta.ch32,W_=Ta.maj32,V_=Ta.s0_256,G_=Ta.s1_256,Y_=Ta.g0_256,J_=Ta.g1_256,sv=j_.BlockHash,Q_=[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 Vn(){if(!(this instanceof Vn))return new Vn;sv.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Q_,this.W=new Array(64)}Ra.inherits(Vn,sv);var ov=Vn;Vn.blockSize=512,Vn.outSize=256,Vn.hmacStrength=192,Vn.padLength=64,Vn.prototype._update=function(e,r){for(var i=this.W,n=0;n<16;n++)i[n]=e[r+n];for(;n<i.length;n++)i[n]=z_(J_(i[n-2]),i[n-7],Y_(i[n-15]),i[n-16]);var s=this.h[0],a=this.h[1],u=this.h[2],d=this.h[3],p=this.h[4],y=this.h[5],_=this.h[6],C=this.h[7];for(q_(this.k.length===i.length),n=0;n<i.length;n++){var I=H_(C,G_(p),K_(p,y,_),this.k[n],i[n]),M=wn(V_(s),W_(s,a,u));C=_,_=y,y=p,p=wn(d,I),d=u,u=a,a=s,s=wn(I,M)}this.h[0]=wn(this.h[0],s),this.h[1]=wn(this.h[1],a),this.h[2]=wn(this.h[2],u),this.h[3]=wn(this.h[3],d),this.h[4]=wn(this.h[4],p),this.h[5]=wn(this.h[5],y),this.h[6]=wn(this.h[6],_),this.h[7]=wn(this.h[7],C)},Vn.prototype._digest=function(e){return e==="hex"?Ra.toHex32(this.h,"big"):Ra.split32(this.h,"big")};var T0=Rt,av=ov;function xs(){if(!(this instanceof xs))return new xs;av.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}T0.inherits(xs,av);var Z_=xs;xs.blockSize=512,xs.outSize=224,xs.hmacStrength=192,xs.padLength=64,xs.prototype._digest=function(e){return e==="hex"?T0.toHex32(this.h.slice(0,7),"big"):T0.split32(this.h.slice(0,7),"big")};var mi=Rt,X_=Oa,eA=$o,Gn=mi.rotr64_hi,Yn=mi.rotr64_lo,cv=mi.shr64_hi,uv=mi.shr64_lo,Qs=mi.sum64,F0=mi.sum64_hi,L0=mi.sum64_lo,tA=mi.sum64_4_hi,rA=mi.sum64_4_lo,iA=mi.sum64_5_hi,nA=mi.sum64_5_lo,fv=X_.BlockHash,sA=[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 _n(){if(!(this instanceof _n))return new _n;fv.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=sA,this.W=new Array(160)}mi.inherits(_n,fv);var hv=_n;_n.blockSize=1024,_n.outSize=512,_n.hmacStrength=192,_n.padLength=128,_n.prototype._prepareBlock=function(e,r){for(var i=this.W,n=0;n<32;n++)i[n]=e[r+n];for(;n<i.length;n+=2){var s=vA(i[n-4],i[n-3]),a=mA(i[n-4],i[n-3]),u=i[n-14],d=i[n-13],p=pA(i[n-30],i[n-29]),y=gA(i[n-30],i[n-29]),_=i[n-32],C=i[n-31];i[n]=tA(s,a,u,d,p,y,_,C),i[n+1]=rA(s,a,u,d,p,y,_,C)}},_n.prototype._update=function(e,r){this._prepareBlock(e,r);var i=this.W,n=this.h[0],s=this.h[1],a=this.h[2],u=this.h[3],d=this.h[4],p=this.h[5],y=this.h[6],_=this.h[7],C=this.h[8],I=this.h[9],M=this.h[10],B=this.h[11],W=this.h[12],Y=this.h[13],q=this.h[14],V=this.h[15];eA(this.k.length===i.length);for(var U=0;U<i.length;U+=2){var z=q,K=V,A=lA(C,I),j=dA(C,I),ee=oA(C,I,M,B,W),re=aA(C,I,M,B,W,Y),k=this.k[U],w=this.k[U+1],f=i[U],h=i[U+1],g=iA(z,K,A,j,ee,re,k,w,f,h),E=nA(z,K,A,j,ee,re,k,w,f,h);z=fA(n,s),K=hA(n,s),A=cA(n,s,a,u,d),j=uA(n,s,a,u,d,p);var D=F0(z,K,A,j),P=L0(z,K,A,j);q=W,V=Y,W=M,Y=B,M=C,B=I,C=F0(y,_,g,E),I=L0(_,_,g,E),y=d,_=p,d=a,p=u,a=n,u=s,n=F0(g,E,D,P),s=L0(g,E,D,P)}Qs(this.h,0,n,s),Qs(this.h,2,a,u),Qs(this.h,4,d,p),Qs(this.h,6,y,_),Qs(this.h,8,C,I),Qs(this.h,10,M,B),Qs(this.h,12,W,Y),Qs(this.h,14,q,V)},_n.prototype._digest=function(e){return e==="hex"?mi.toHex32(this.h,"big"):mi.split32(this.h,"big")};function oA(t,e,r,i,n){var s=t&r^~t&n;return s<0&&(s+=4294967296),s}function aA(t,e,r,i,n,s){var a=e&i^~e&s;return a<0&&(a+=4294967296),a}function cA(t,e,r,i,n){var s=t&r^t&n^r&n;return s<0&&(s+=4294967296),s}function uA(t,e,r,i,n,s){var a=e&i^e&s^i&s;return a<0&&(a+=4294967296),a}function fA(t,e){var r=Gn(t,e,28),i=Gn(e,t,2),n=Gn(e,t,7),s=r^i^n;return s<0&&(s+=4294967296),s}function hA(t,e){var r=Yn(t,e,28),i=Yn(e,t,2),n=Yn(e,t,7),s=r^i^n;return s<0&&(s+=4294967296),s}function lA(t,e){var r=Gn(t,e,14),i=Gn(t,e,18),n=Gn(e,t,9),s=r^i^n;return s<0&&(s+=4294967296),s}function dA(t,e){var r=Yn(t,e,14),i=Yn(t,e,18),n=Yn(e,t,9),s=r^i^n;return s<0&&(s+=4294967296),s}function pA(t,e){var r=Gn(t,e,1),i=Gn(t,e,8),n=cv(t,e,7),s=r^i^n;return s<0&&(s+=4294967296),s}function gA(t,e){var r=Yn(t,e,1),i=Yn(t,e,8),n=uv(t,e,7),s=r^i^n;return s<0&&(s+=4294967296),s}function vA(t,e){var r=Gn(t,e,19),i=Gn(e,t,29),n=cv(t,e,6),s=r^i^n;return s<0&&(s+=4294967296),s}function mA(t,e){var r=Yn(t,e,19),i=Yn(e,t,29),n=uv(t,e,6),s=r^i^n;return s<0&&(s+=4294967296),s}var B0=Rt,lv=hv;function Ss(){if(!(this instanceof Ss))return new Ss;lv.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}B0.inherits(Ss,lv);var bA=Ss;Ss.blockSize=1024,Ss.outSize=384,Ss.hmacStrength=192,Ss.padLength=128,Ss.prototype._digest=function(e){return e==="hex"?B0.toHex32(this.h.slice(0,12),"big"):B0.split32(this.h.slice(0,12),"big")},$a.sha1=k_,$a.sha224=Z_,$a.sha256=ov,$a.sha384=bA,$a.sha512=hv;var dv={},Ro=Rt,yA=Oa,Rf=Ro.rotl32,pv=Ro.sum32,Jc=Ro.sum32_3,gv=Ro.sum32_4,vv=yA.BlockHash;function Jn(){if(!(this instanceof Jn))return new Jn;vv.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Ro.inherits(Jn,vv),dv.ripemd160=Jn,Jn.blockSize=512,Jn.outSize=160,Jn.hmacStrength=192,Jn.padLength=64,Jn.prototype._update=function(e,r){for(var i=this.h[0],n=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],d=i,p=n,y=s,_=a,C=u,I=0;I<80;I++){var M=pv(Rf(gv(i,mv(I,n,s,a),e[AA[I]+r],wA(I)),xA[I]),u);i=u,u=a,a=Rf(s,10),s=n,n=M,M=pv(Rf(gv(d,mv(79-I,p,y,_),e[EA[I]+r],_A(I)),SA[I]),C),d=C,C=_,_=Rf(y,10),y=p,p=M}M=Jc(this.h[1],s,_),this.h[1]=Jc(this.h[2],a,C),this.h[2]=Jc(this.h[3],u,d),this.h[3]=Jc(this.h[4],i,p),this.h[4]=Jc(this.h[0],n,y),this.h[0]=M},Jn.prototype._digest=function(e){return e==="hex"?Ro.toHex32(this.h,"little"):Ro.split32(this.h,"little")};function mv(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function wA(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function _A(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var AA=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],EA=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],xA=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],SA=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],IA=Rt,MA=$o;function Fa(t,e,r){if(!(this instanceof Fa))return new Fa(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(IA.toArray(e,r))}var CA=Fa;Fa.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),MA(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=new this.Hash().update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=new this.Hash().update(e)},Fa.prototype.update=function(e,r){return this.inner.update(e,r),this},Fa.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(t){var e=t;e.utils=Rt,e.common=Oa,e.sha=$a,e.ripemd=dv,e.hmac=CA,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}($f);var U0,bv;function DA(){return bv||(bv=1,U0={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),U0}(function(t){var e=t,r=$f,i=$0,n=Li,s=n.assert;function a(p){p.type==="short"?this.curve=new i.short(p):p.type==="edwards"?this.curve=new i.edwards(p):this.curve=new i.mont(p),this.g=this.curve.g,this.n=this.curve.n,this.hash=p.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=a;function u(p,y){Object.defineProperty(e,p,{configurable:!0,enumerable:!0,get:function(){var _=new a(y);return Object.defineProperty(e,p,{configurable:!0,enumerable:!0,value:_}),_}})}u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var d;try{d=DA()}catch{d=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",d]})})(Of);var PA=$f,To=P0,yv=$o;function Zs(t){if(!(this instanceof Zs))return new Zs(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=To.toArray(t.entropy,t.entropyEnc||"hex"),r=To.toArray(t.nonce,t.nonceEnc||"hex"),i=To.toArray(t.pers,t.persEnc||"hex");yv(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var OA=Zs;Zs.prototype._init=function(e,r,i){var n=e.concat(r).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Zs.prototype._hmac=function(){return new PA.hmac(this.hash,this.K)},Zs.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Zs.prototype.reseed=function(e,r,i,n){typeof r!="string"&&(n=i,i=r,r=null),e=To.toArray(e,r),i=To.toArray(i,n),yv(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},Zs.prototype.generate=function(e,r,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(n=i,i=r,r=null),i&&(i=To.toArray(i,n||"hex"),this._update(i));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var a=s.slice(0,e);return this._update(i),this._reseed++,To.encode(a,r)};var $A=qn.exports,NA=Li,k0=NA.assert;function Jr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var RA=Jr;Jr.fromPublic=function(e,r,i){return r instanceof Jr?r:new Jr(e,{pub:r,pubEnc:i})},Jr.fromPrivate=function(e,r,i){return r instanceof Jr?r:new Jr(e,{priv:r,privEnc:i})},Jr.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Jr.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub},Jr.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv},Jr.prototype._importPrivate=function(e,r){this.priv=new $A(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},Jr.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?k0(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&k0(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)},Jr.prototype.derive=function(e){return e.validate()||k0(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Jr.prototype.sign=function(e,r,i){return this.ec.sign(e,this,r,i)},Jr.prototype.verify=function(e,r){return this.ec.verify(e,r,this)},Jr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Tf=qn.exports,j0=Li,TA=j0.assert;function Ff(t,e){if(t instanceof Ff)return t;this._importDER(t,e)||(TA(t.r&&t.s,"Signature without r or s"),this.r=new Tf(t.r,16),this.s=new Tf(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var FA=Ff;function LA(){this.place=0}function q0(t,e){var r=t[e.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4||t[e.place]===0)return!1;for(var n=0,s=0,a=e.place;s<i;s++,a++)n<<=8,n|=t[a],n>>>=0;return n<=127?!1:(e.place=a,n)}function wv(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}Ff.prototype._importDER=function(e,r){e=j0.toArray(e,r);var i=new LA;if(e[i.place++]!==48)return!1;var n=q0(e,i);if(n===!1||n+i.place!==e.length||e[i.place++]!==2)return!1;var s=q0(e,i);if(s===!1||e[i.place]&128)return!1;var a=e.slice(i.place,s+i.place);if(i.place+=s,e[i.place++]!==2)return!1;var u=q0(e,i);if(u===!1||e.length!==u+i.place||e[i.place]&128)return!1;var d=e.slice(i.place,u+i.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(d[0]===0)if(d[1]&128)d=d.slice(1);else return!1;return this.r=new Tf(a),this.s=new Tf(d),this.recoveryParam=null,!0};function z0(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Ff.prototype.toDER=function(e){var r=this.r.toArray(),i=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),i[0]&128&&(i=[0].concat(i)),r=wv(r),i=wv(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var n=[2];z0(n,r.length),n=n.concat(r),n.push(2),z0(n,i.length);var s=n.concat(i),a=[48];return z0(a,s.length),a=a.concat(s),j0.encode(a,e)};var Fo=qn.exports,_v=OA,BA=Li,H0=Of,UA=Sf.exports,Av=BA.assert,K0=RA,Lf=FA;function Qi(t){if(!(this instanceof Qi))return new Qi(t);typeof t=="string"&&(Av(Object.prototype.hasOwnProperty.call(H0,t),"Unknown curve "+t),t=H0[t]),t instanceof H0.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var kA=Qi;Qi.prototype.keyPair=function(e){return new K0(this,e)},Qi.prototype.keyFromPrivate=function(e,r){return K0.fromPrivate(this,e,r)},Qi.prototype.keyFromPublic=function(e,r){return K0.fromPublic(this,e,r)},Qi.prototype.genKeyPair=function(e){e||(e={});for(var r=new _v({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||UA(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new Fo(2));;){var s=new Fo(r.generate(i));if(!(s.cmp(n)>0))return s.iaddn(1),this.keyFromPrivate(s)}},Qi.prototype._truncateToN=function(e,r){var i=e.byteLength()*8-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},Qi.prototype.sign=function(e,r,i,n){typeof i=="object"&&(n=i,i=null),n||(n={}),r=this.keyFromPrivate(r,i),e=this._truncateToN(new Fo(e,16));for(var s=this.n.byteLength(),a=r.getPrivate().toArray("be",s),u=e.toArray("be",s),d=new _v({hash:this.hash,entropy:a,nonce:u,pers:n.pers,persEnc:n.persEnc||"utf8"}),p=this.n.sub(new Fo(1)),y=0;;y++){var _=n.k?n.k(y):new Fo(d.generate(this.n.byteLength()));if(_=this._truncateToN(_,!0),!(_.cmpn(1)<=0||_.cmp(p)>=0)){var C=this.g.mul(_);if(!C.isInfinity()){var I=C.getX(),M=I.umod(this.n);if(M.cmpn(0)!==0){var B=_.invm(this.n).mul(M.mul(r.getPrivate()).iadd(e));if(B=B.umod(this.n),B.cmpn(0)!==0){var W=(C.getY().isOdd()?1:0)|(I.cmp(M)!==0?2:0);return n.canonical&&B.cmp(this.nh)>0&&(B=this.n.sub(B),W^=1),new Lf({r:M,s:B,recoveryParam:W})}}}}}},Qi.prototype.verify=function(e,r,i,n){e=this._truncateToN(new Fo(e,16)),i=this.keyFromPublic(i,n),r=new Lf(r,"hex");var s=r.r,a=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var u=a.invm(this.n),d=u.mul(e).umod(this.n),p=u.mul(s).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(d,i.getPublic(),p),y.isInfinity()?!1:y.eqXToP(s)):(y=this.g.mulAdd(d,i.getPublic(),p),y.isInfinity()?!1:y.getX().umod(this.n).cmp(s)===0)},Qi.prototype.recoverPubKey=function(t,e,r,i){Av((3&r)===r,"The recovery param is more than two bits"),e=new Lf(e,i);var n=this.n,s=new Fo(t),a=e.r,u=e.s,d=r&1,p=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");p?a=this.curve.pointFromX(a.add(this.curve.n),d):a=this.curve.pointFromX(a,d);var y=e.r.invm(n),_=n.sub(s).mul(y).umod(n),C=u.mul(y).umod(n);return this.g.mulAdd(_,a,C)},Qi.prototype.getKeyRecoveryParam=function(t,e,r,i){if(e=new Lf(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch{continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var Qc=Li,Ev=Qc.assert,xv=Qc.parseBytes,La=Qc.cachedProperty;function $r(t,e){this.eddsa=t,this._secret=xv(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=xv(e.pub)}$r.fromPublic=function(e,r){return r instanceof $r?r:new $r(e,{pub:r})},$r.fromSecret=function(e,r){return r instanceof $r?r:new $r(e,{secret:r})},$r.prototype.secret=function(){return this._secret},La($r,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),La($r,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),La($r,"privBytes",function(){var e=this.eddsa,r=this.hash(),i=e.encodingLength-1,n=r.slice(0,e.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n}),La($r,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),La($r,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),La($r,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),$r.prototype.sign=function(e){return Ev(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},$r.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)},$r.prototype.getSecret=function(e){return Ev(this._secret,"KeyPair is public only"),Qc.encode(this.secret(),e)},$r.prototype.getPublic=function(e){return Qc.encode(this.pubBytes(),e)};var jA=$r,qA=qn.exports,Bf=Li,Sv=Bf.assert,Uf=Bf.cachedProperty,zA=Bf.parseBytes;function Lo(t,e){this.eddsa=t,typeof e!="object"&&(e=zA(e)),Array.isArray(e)&&(Sv(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),Sv(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof qA&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}Uf(Lo,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),Uf(Lo,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),Uf(Lo,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),Uf(Lo,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),Lo.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Lo.prototype.toHex=function(){return Bf.encode(this.toBytes(),"hex").toUpperCase()};var HA=Lo,KA=$f,WA=Of,Ba=Li,VA=Ba.assert,Iv=Ba.parseBytes,Mv=jA,Cv=HA;function bi(t){if(VA(t==="ed25519","only tested with ed25519 so far"),!(this instanceof bi))return new bi(t);t=WA[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=KA.sha512}var GA=bi;bi.prototype.sign=function(e,r){e=Iv(e);var i=this.keyFromSecret(r),n=this.hashInt(i.messagePrefix(),e),s=this.g.mul(n),a=this.encodePoint(s),u=this.hashInt(a,i.pubBytes(),e).mul(i.priv()),d=n.add(u).umod(this.curve.n);return this.makeSignature({R:s,S:d,Rencoded:a})},bi.prototype.verify=function(e,r,i){if(e=Iv(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var n=this.keyFromPublic(i),s=this.hashInt(r.Rencoded(),n.pubBytes(),e),a=this.g.mul(r.S()),u=r.R().add(n.pub().mul(s));return u.eq(a)},bi.prototype.hashInt=function(){for(var e=this.hash(),r=0;r<arguments.length;r++)e.update(arguments[r]);return Ba.intFromLE(e.digest()).umod(this.curve.n)},bi.prototype.keyFromPublic=function(e){return Mv.fromPublic(this,e)},bi.prototype.keyFromSecret=function(e){return Mv.fromSecret(this,e)},bi.prototype.makeSignature=function(e){return e instanceof Cv?e:new Cv(this,e)},bi.prototype.encodePoint=function(e){var r=e.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=e.getX().isOdd()?128:0,r},bi.prototype.decodePoint=function(e){e=Ba.parseBytes(e);var r=e.length-1,i=e.slice(0,r).concat(e[r]&-129),n=(e[r]&128)!==0,s=Ba.intFromLE(i);return this.curve.pointFromY(s,n)},bi.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},bi.prototype.decodeInt=function(e){return Ba.intFromLE(e)},bi.prototype.isPoint=function(e){return e instanceof this.pointClass},function(t){var e=t;e.version=V9.version,e.utils=Li,e.rand=Sf.exports,e.curve=$0,e.curves=Of,e.ec=kA,e.eddsa=GA}(W2);const YA=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),JA=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,(i,n)=>typeof n=="string"&&n.match(/^\d+n$/)?BigInt(n.substring(0,n.length-1)):n)};function Ua(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JA(t)}catch{return t}}function Is(t){return typeof t=="string"?t:YA(t)||""}const QA={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var ZA=Object.defineProperty,Dv=Object.getOwnPropertySymbols,XA=Object.prototype.hasOwnProperty,eE=Object.prototype.propertyIsEnumerable,Pv=(t,e,r)=>e in t?ZA(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,oi=(t,e)=>{for(var r in e||(e={}))XA.call(e,r)&&Pv(t,r,e[r]);if(Dv)for(var r of Dv(e))eE.call(e,r)&&Pv(t,r,e[r]);return t};const tE=":";function Zc(t){const[e,r]=t.split(tE);return{namespace:e,reference:r}}function Ov(t,e=[]){const r=[];return Object.keys(t).forEach(i=>{if(e.length&&!e.includes(i))return;const n=t[i];r.push(...n.accounts)}),r}function $v(t,e){return t.includes(":")?[t]:e.chains||[]}var rE=Object.defineProperty,Nv=Object.getOwnPropertySymbols,iE=Object.prototype.hasOwnProperty,nE=Object.prototype.propertyIsEnumerable,Rv=(t,e,r)=>e in t?rE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Tv=(t,e)=>{for(var r in e||(e={}))iE.call(e,r)&&Rv(t,r,e[r]);if(Nv)for(var r of Nv(e))nE.call(e,r)&&Rv(t,r,e[r]);return t};const sE="ReactNative",Bi={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},oE="js";function Xc(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function eu(){return!p0()&&!!g0()&&navigator.product===sE}function tu(){return!Xc()&&!!g0()&&!!p0()}function ru(){return eu()?Bi.reactNative:Xc()?Bi.node:tu()?Bi.browser:Bi.unknown}function aE(){var t;try{return eu()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function cE(t,e){let r=Hc.parse(t);return r=Tv(Tv({},r),e),t=Hc.stringify(r),t}function uE(){return u2()||{name:"",description:"",url:"",icons:[""]}}function fE(){if(ru()===Bi.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:i}=global.Platform;return[r,i].join("-")}const t=C4();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 hE(){var t;const e=ru();return e===Bi.browser?[e,((t=c2())==null?void 0:t.host)||"unknown"].join(":"):e}function lE(t,e,r){const i=fE(),n=hE();return[[t,e].join("-"),[oE,r].join("-"),i,n].join("/")}function dE({protocol:t,version:e,relayUrl:r,sdkVersion:i,auth:n,projectId:s,useOnCloseEvent:a,bundleId:u}){const d=r.split("?"),p=lE(t,e,i),y={auth:n,ua:p,projectId:s,useOnCloseEvent:a||void 0,origin:u||void 0},_=cE(d[1]||"",y);return d[0]+"?"+_}function Bo(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Fv(t){return Object.fromEntries(t.entries())}function Lv(t){return new Map(Object.entries(t))}function Uo(t=He.FIVE_MINUTES,e){const r=He.toMiliseconds(t||He.FIVE_MINUTES);let i,n,s;return{resolve:a=>{s&&i&&(clearTimeout(s),i(a))},reject:a=>{s&&n&&(clearTimeout(s),n(a))},done:()=>new Promise((a,u)=>{s=setTimeout(()=>{u(new Error(e))},r),i=a,n=u})}}function ka(t,e,r){return new Promise(async(i,n)=>{const s=setTimeout(()=>n(new Error(r)),e);try{const a=await t;i(a)}catch(a){n(a)}clearTimeout(s)})}function Bv(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 pE(t){return Bv("topic",t)}function gE(t){return Bv("id",t)}function Uv(t){const[e,r]=t.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")i.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))i.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return i}function jr(t,e){return He.fromMiliseconds((e||Date.now())+He.toMiliseconds(t))}function Xs(t){return Date.now()>=He.toMiliseconds(t)}function $t(t,e){return`${t}${e?`:${e}`:""}`}function kf(t=[],e=[]){return[...new Set([...t,...e])]}async function vE({id:t,topic:e,wcDeepLink:r}){try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r;let n=i?.href;if(typeof n!="string")return;n.endsWith("/")&&(n=n.slice(0,-1));const s=`${n}/wc?requestId=${t}&sessionTopic=${e}`,a=ru();a===Bi.browser?s.startsWith("https://")||s.startsWith("http://")?window.open(s,"_blank","noreferrer noopener"):window.open(s,"_self","noreferrer noopener"):a===Bi.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(s)}catch(i){console.error(i)}}async function mE(t,e){try{return await t.getItem(e)||(tu()?localStorage.getItem(e):void 0)}catch(r){console.error(r)}}var kv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bE(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(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),r}var jv={exports:{}};/**
|
|
15
15
|
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
16
16
|
*
|
|
17
17
|
* @version 0.8.0
|
|
18
18
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
19
19
|
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
20
20
|
* @license MIT
|
|
21
|
-
*/(function(e){(function(){var t="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var o=!n&&typeof self=="object",c=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;c?i=ig:o&&(i=self);var l=!i.JS_SHA3_NO_COMMON_JS&&!0&&e.exports,f=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",h="0123456789abcdef".split(""),g=[31,7936,2031616,520093696],_=[4,1024,262144,67108864],E=[1,256,65536,16777216],x=[6,1536,393216,100663296],I=[0,8,16,24],F=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],W=[224,256,384,512],Y=[128,256],B=["hex","buffer","arrayBuffer","array","digest"],z={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(A){return Object.prototype.toString.call(A)==="[object Array]"}),f&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(A){return typeof A=="object"&&A.buffer&&A.buffer.constructor===ArrayBuffer});for(var P=function(A,rt,q){return function(H){return new T(A,rt,A).update(H)[q]()}},U=function(A,rt,q){return function(H,V){return new T(A,rt,V).update(H)[q]()}},j=function(A,rt,q){return function(H,V,w,k){return p["cshake"+A].update(H,V,w,k)[q]()}},m=function(A,rt,q){return function(H,V,w,k){return p["kmac"+A].update(H,V,w,k)[q]()}},$=function(A,rt,q,H){for(var V=0;V<B.length;++V){var w=B[V];A[w]=rt(q,H,w)}return A},et=function(A,rt){var q=P(A,rt,"hex");return q.create=function(){return new T(A,rt,A)},q.update=function(H){return q.create().update(H)},$(q,P,A,rt)},tt=function(A,rt){var q=U(A,rt,"hex");return q.create=function(H){return new T(A,rt,H)},q.update=function(H,V){return q.create(V).update(H)},$(q,U,A,rt)},nt=function(A,rt){var q=z[A],H=j(A,rt,"hex");return H.create=function(V,w,k){return!w&&!k?p["shake"+A].create(V):new T(A,rt,V).bytepad([w,k],q)},H.update=function(V,w,k,it){return H.create(w,k,it).update(V)},$(H,j,A,rt)},dt=function(A,rt){var q=z[A],H=m(A,rt,"hex");return H.create=function(V,w,k){return new ot(A,rt,w).bytepad(["KMAC",k],q).bytepad([V],q)},H.update=function(V,w,k,it){return H.create(V,k,it).update(w)},$(H,m,A,rt)},d=[{name:"keccak",padding:E,bits:W,createMethod:et},{name:"sha3",padding:x,bits:W,createMethod:et},{name:"shake",padding:g,bits:Y,createMethod:tt},{name:"cshake",padding:_,bits:Y,createMethod:nt},{name:"kmac",padding:_,bits:Y,createMethod:dt}],p={},b=[],C=0;C<d.length;++C)for(var O=d[C],N=O.bits,L=0;L<N.length;++L){var D=O.name+"_"+N[L];if(b.push(D),p[D]=O.createMethod(N[L],O.padding),O.name!=="sha3"){var v=O.name+N[L];b.push(v),p[v]=p[D]}}function T(A,rt,q){this.blocks=[],this.s=[],this.padding=rt,this.outputBits=q,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(A<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=q>>5,this.extraBytes=(q&31)>>3;for(var H=0;H<50;++H)this.s[H]=0}T.prototype.update=function(A){if(this.finalized)throw new Error(r);var rt,q=typeof A;if(q!=="string"){if(q==="object"){if(A===null)throw new Error(t);if(f&&A.constructor===ArrayBuffer)A=new Uint8Array(A);else if(!Array.isArray(A)&&(!f||!ArrayBuffer.isView(A)))throw new Error(t)}else throw new Error(t);rt=!0}for(var H=this.blocks,V=this.byteCount,w=A.length,k=this.blockCount,it=0,ht=this.s,lt,Ot;it<w;){if(this.reset)for(this.reset=!1,H[0]=this.block,lt=1;lt<k+1;++lt)H[lt]=0;if(rt)for(lt=this.start;it<w&<<V;++it)H[lt>>2]|=A[it]<<I[lt++&3];else for(lt=this.start;it<w&<<V;++it)Ot=A.charCodeAt(it),Ot<128?H[lt>>2]|=Ot<<I[lt++&3]:Ot<2048?(H[lt>>2]|=(192|Ot>>6)<<I[lt++&3],H[lt>>2]|=(128|Ot&63)<<I[lt++&3]):Ot<55296||Ot>=57344?(H[lt>>2]|=(224|Ot>>12)<<I[lt++&3],H[lt>>2]|=(128|Ot>>6&63)<<I[lt++&3],H[lt>>2]|=(128|Ot&63)<<I[lt++&3]):(Ot=65536+((Ot&1023)<<10|A.charCodeAt(++it)&1023),H[lt>>2]|=(240|Ot>>18)<<I[lt++&3],H[lt>>2]|=(128|Ot>>12&63)<<I[lt++&3],H[lt>>2]|=(128|Ot>>6&63)<<I[lt++&3],H[lt>>2]|=(128|Ot&63)<<I[lt++&3]);if(this.lastByteIndex=lt,lt>=V){for(this.start=lt-V,this.block=H[k],lt=0;lt<k;++lt)ht[lt]^=H[lt];pt(ht),this.reset=!0}else this.start=lt}return this},T.prototype.encode=function(A,rt){var q=A&255,H=1,V=[q];for(A=A>>8,q=A&255;q>0;)V.unshift(q),A=A>>8,q=A&255,++H;return rt?V.push(H):V.unshift(H),this.update(V),V.length},T.prototype.encodeString=function(A){var rt,q=typeof A;if(q!=="string"){if(q==="object"){if(A===null)throw new Error(t);if(f&&A.constructor===ArrayBuffer)A=new Uint8Array(A);else if(!Array.isArray(A)&&(!f||!ArrayBuffer.isView(A)))throw new Error(t)}else throw new Error(t);rt=!0}var H=0,V=A.length;if(rt)H=V;else for(var w=0;w<A.length;++w){var k=A.charCodeAt(w);k<128?H+=1:k<2048?H+=2:k<55296||k>=57344?H+=3:(k=65536+((k&1023)<<10|A.charCodeAt(++w)&1023),H+=4)}return H+=this.encode(H*8),this.update(A),H},T.prototype.bytepad=function(A,rt){for(var q=this.encode(rt),H=0;H<A.length;++H)q+=this.encodeString(A[H]);var V=rt-q%rt,w=[];return w.length=V,this.update(w),this},T.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var A=this.blocks,rt=this.lastByteIndex,q=this.blockCount,H=this.s;if(A[rt>>2]|=this.padding[rt&3],this.lastByteIndex===this.byteCount)for(A[0]=A[q],rt=1;rt<q+1;++rt)A[rt]=0;for(A[q-1]|=2147483648,rt=0;rt<q;++rt)H[rt]^=A[rt];pt(H)}},T.prototype.toString=T.prototype.hex=function(){this.finalize();for(var A=this.blockCount,rt=this.s,q=this.outputBlocks,H=this.extraBytes,V=0,w=0,k="",it;w<q;){for(V=0;V<A&&w<q;++V,++w)it=rt[V],k+=h[it>>4&15]+h[it&15]+h[it>>12&15]+h[it>>8&15]+h[it>>20&15]+h[it>>16&15]+h[it>>28&15]+h[it>>24&15];w%A===0&&(pt(rt),V=0)}return H&&(it=rt[V],k+=h[it>>4&15]+h[it&15],H>1&&(k+=h[it>>12&15]+h[it>>8&15]),H>2&&(k+=h[it>>20&15]+h[it>>16&15])),k},T.prototype.arrayBuffer=function(){this.finalize();var A=this.blockCount,rt=this.s,q=this.outputBlocks,H=this.extraBytes,V=0,w=0,k=this.outputBits>>3,it;H?it=new ArrayBuffer(q+1<<2):it=new ArrayBuffer(k);for(var ht=new Uint32Array(it);w<q;){for(V=0;V<A&&w<q;++V,++w)ht[w]=rt[V];w%A===0&&pt(rt)}return H&&(ht[V]=rt[V],it=it.slice(0,k)),it},T.prototype.buffer=T.prototype.arrayBuffer,T.prototype.digest=T.prototype.array=function(){this.finalize();for(var A=this.blockCount,rt=this.s,q=this.outputBlocks,H=this.extraBytes,V=0,w=0,k=[],it,ht;w<q;){for(V=0;V<A&&w<q;++V,++w)it=w<<2,ht=rt[V],k[it]=ht&255,k[it+1]=ht>>8&255,k[it+2]=ht>>16&255,k[it+3]=ht>>24&255;w%A===0&&pt(rt)}return H&&(it=w<<2,ht=rt[V],k[it]=ht&255,H>1&&(k[it+1]=ht>>8&255),H>2&&(k[it+2]=ht>>16&255)),k};function ot(A,rt,q){T.call(this,A,rt,q)}ot.prototype=new T,ot.prototype.finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var pt=function(A){var rt,q,H,V,w,k,it,ht,lt,Ot,Mt,St,Pe,zt,Dt,Ft,Et,At,Gt,bt,xt,Bt,_t,Pt,jt,$t,Nt,le,Rt,Tt,nr,de,Ee,ir,Ie,Oe,Vr,Yt,Ht,Re,Qt,Vt,Me,Xt,te,Le,ee,Jt,Fe,Zt,kt,He,re,je,ei,ke,ve,Tn,Rn,Ln,Bn,Un,xr;for(H=0;H<48;H+=2)V=A[0]^A[10]^A[20]^A[30]^A[40],w=A[1]^A[11]^A[21]^A[31]^A[41],k=A[2]^A[12]^A[22]^A[32]^A[42],it=A[3]^A[13]^A[23]^A[33]^A[43],ht=A[4]^A[14]^A[24]^A[34]^A[44],lt=A[5]^A[15]^A[25]^A[35]^A[45],Ot=A[6]^A[16]^A[26]^A[36]^A[46],Mt=A[7]^A[17]^A[27]^A[37]^A[47],St=A[8]^A[18]^A[28]^A[38]^A[48],Pe=A[9]^A[19]^A[29]^A[39]^A[49],rt=St^(k<<1|it>>>31),q=Pe^(it<<1|k>>>31),A[0]^=rt,A[1]^=q,A[10]^=rt,A[11]^=q,A[20]^=rt,A[21]^=q,A[30]^=rt,A[31]^=q,A[40]^=rt,A[41]^=q,rt=V^(ht<<1|lt>>>31),q=w^(lt<<1|ht>>>31),A[2]^=rt,A[3]^=q,A[12]^=rt,A[13]^=q,A[22]^=rt,A[23]^=q,A[32]^=rt,A[33]^=q,A[42]^=rt,A[43]^=q,rt=k^(Ot<<1|Mt>>>31),q=it^(Mt<<1|Ot>>>31),A[4]^=rt,A[5]^=q,A[14]^=rt,A[15]^=q,A[24]^=rt,A[25]^=q,A[34]^=rt,A[35]^=q,A[44]^=rt,A[45]^=q,rt=ht^(St<<1|Pe>>>31),q=lt^(Pe<<1|St>>>31),A[6]^=rt,A[7]^=q,A[16]^=rt,A[17]^=q,A[26]^=rt,A[27]^=q,A[36]^=rt,A[37]^=q,A[46]^=rt,A[47]^=q,rt=Ot^(V<<1|w>>>31),q=Mt^(w<<1|V>>>31),A[8]^=rt,A[9]^=q,A[18]^=rt,A[19]^=q,A[28]^=rt,A[29]^=q,A[38]^=rt,A[39]^=q,A[48]^=rt,A[49]^=q,zt=A[0],Dt=A[1],Le=A[11]<<4|A[10]>>>28,ee=A[10]<<4|A[11]>>>28,le=A[20]<<3|A[21]>>>29,Rt=A[21]<<3|A[20]>>>29,Ln=A[31]<<9|A[30]>>>23,Bn=A[30]<<9|A[31]>>>23,Vt=A[40]<<18|A[41]>>>14,Me=A[41]<<18|A[40]>>>14,ir=A[2]<<1|A[3]>>>31,Ie=A[3]<<1|A[2]>>>31,Ft=A[13]<<12|A[12]>>>20,Et=A[12]<<12|A[13]>>>20,Jt=A[22]<<10|A[23]>>>22,Fe=A[23]<<10|A[22]>>>22,Tt=A[33]<<13|A[32]>>>19,nr=A[32]<<13|A[33]>>>19,Un=A[42]<<2|A[43]>>>30,xr=A[43]<<2|A[42]>>>30,je=A[5]<<30|A[4]>>>2,ei=A[4]<<30|A[5]>>>2,Oe=A[14]<<6|A[15]>>>26,Vr=A[15]<<6|A[14]>>>26,At=A[25]<<11|A[24]>>>21,Gt=A[24]<<11|A[25]>>>21,Zt=A[34]<<15|A[35]>>>17,kt=A[35]<<15|A[34]>>>17,de=A[45]<<29|A[44]>>>3,Ee=A[44]<<29|A[45]>>>3,Pt=A[6]<<28|A[7]>>>4,jt=A[7]<<28|A[6]>>>4,ke=A[17]<<23|A[16]>>>9,ve=A[16]<<23|A[17]>>>9,Yt=A[26]<<25|A[27]>>>7,Ht=A[27]<<25|A[26]>>>7,bt=A[36]<<21|A[37]>>>11,xt=A[37]<<21|A[36]>>>11,He=A[47]<<24|A[46]>>>8,re=A[46]<<24|A[47]>>>8,Xt=A[8]<<27|A[9]>>>5,te=A[9]<<27|A[8]>>>5,$t=A[18]<<20|A[19]>>>12,Nt=A[19]<<20|A[18]>>>12,Tn=A[29]<<7|A[28]>>>25,Rn=A[28]<<7|A[29]>>>25,Re=A[38]<<8|A[39]>>>24,Qt=A[39]<<8|A[38]>>>24,Bt=A[48]<<14|A[49]>>>18,_t=A[49]<<14|A[48]>>>18,A[0]=zt^~Ft&At,A[1]=Dt^~Et&Gt,A[10]=Pt^~$t&le,A[11]=jt^~Nt&Rt,A[20]=ir^~Oe&Yt,A[21]=Ie^~Vr&Ht,A[30]=Xt^~Le&Jt,A[31]=te^~ee&Fe,A[40]=je^~ke&Tn,A[41]=ei^~ve&Rn,A[2]=Ft^~At&bt,A[3]=Et^~Gt&xt,A[12]=$t^~le&Tt,A[13]=Nt^~Rt&nr,A[22]=Oe^~Yt&Re,A[23]=Vr^~Ht&Qt,A[32]=Le^~Jt&Zt,A[33]=ee^~Fe&kt,A[42]=ke^~Tn&Ln,A[43]=ve^~Rn&Bn,A[4]=At^~bt&Bt,A[5]=Gt^~xt&_t,A[14]=le^~Tt&de,A[15]=Rt^~nr&Ee,A[24]=Yt^~Re&Vt,A[25]=Ht^~Qt&Me,A[34]=Jt^~Zt&He,A[35]=Fe^~kt&re,A[44]=Tn^~Ln&Un,A[45]=Rn^~Bn&xr,A[6]=bt^~Bt&zt,A[7]=xt^~_t&Dt,A[16]=Tt^~de&Pt,A[17]=nr^~Ee&jt,A[26]=Re^~Vt&ir,A[27]=Qt^~Me&Ie,A[36]=Zt^~He&Xt,A[37]=kt^~re&te,A[46]=Ln^~Un&je,A[47]=Bn^~xr&ei,A[8]=Bt^~zt&Ft,A[9]=_t^~Dt&Et,A[18]=de^~Pt&$t,A[19]=Ee^~jt&Nt,A[28]=Vt^~ir&Oe,A[29]=Me^~Ie&Vr,A[38]=He^~Xt&Le,A[39]=re^~te&ee,A[48]=Un^~je&ke,A[49]=xr^~ei&ve,A[0]^=F[H],A[1]^=F[H+1]};if(l)e.exports=p;else for(C=0;C<b.length;++C)i[b[C]]=p[b[C]]})()})(sg);var j8=sg.exports;const k8="logger/5.7.0";let og=!1,ag=!1;const yl={debug:1,default:2,info:2,warning:3,error:4,off:5};let cg=yl.default,rf=null;function q8(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{e.push(t)}}),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}const lg=q8();var nf;(function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"})(nf||(nf={}));var Qn;(function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"})(Qn||(Qn={}));const ug="0123456789abcdef";class ue{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,r){const n=t.toLowerCase();yl[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(cg>yl[n])&&console.log.apply(console,r)}debug(...t){this._log(ue.levels.DEBUG,t)}info(...t){this._log(ue.levels.INFO,t)}warn(...t){this._log(ue.levels.WARNING,t)}makeError(t,r,n){if(ag)return this.makeError("censored error",r,{});r||(r=ue.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(f=>{const h=n[f];try{if(h instanceof Uint8Array){let g="";for(let _=0;_<h.length;_++)g+=ug[h[_]>>4],g+=ug[h[_]&15];i.push(f+"=Uint8Array(0x"+g+")")}else i.push(f+"="+JSON.stringify(h))}catch{i.push(f+"="+JSON.stringify(n[f].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const o=t;let c="";switch(r){case Qn.NUMERIC_FAULT:{c="NUMERIC_FAULT";const f=t;switch(f){case"overflow":case"underflow":case"division-by-zero":c+="-"+f;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case Qn.CALL_EXCEPTION:case Qn.INSUFFICIENT_FUNDS:case Qn.MISSING_NEW:case Qn.NONCE_EXPIRED:case Qn.REPLACEMENT_UNDERPRICED:case Qn.TRANSACTION_REPLACED:case Qn.UNPREDICTABLE_GAS_LIMIT:c=r;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const l=new Error(t);return l.reason=o,l.code=r,Object.keys(n).forEach(function(f){l[f]=n[f]}),l}throwError(t,r,n){throw this.makeError(t,r,n)}throwArgumentError(t,r,n){return this.throwError(t,ue.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(t,r,n,i){t||this.throwError(r,n,i)}assertArgument(t,r,n,i){t||this.throwArgumentError(r,n,i)}checkNormalize(t){lg&&this.throwError("platform missing String.prototype.normalize",ue.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:lg})}checkSafeUint53(t,r){typeof t=="number"&&(r==null&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,ue.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,ue.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,r,n){n?n=": "+n:n="",t<r&&this.throwError("missing argument"+n,ue.errors.MISSING_ARGUMENT,{count:t,expectedCount:r}),t>r&&this.throwError("too many arguments"+n,ue.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}checkNew(t,r){(t===Object||t==null)&&this.throwError("missing new",ue.errors.MISSING_NEW,{name:r.name})}checkAbstract(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",ue.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",ue.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return rf||(rf=new ue(k8)),rf}static setCensorship(t,r){if(!t&&r&&this.globalLogger().throwError("cannot permanently disable censorship",ue.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),og){if(!t)return;this.globalLogger().throwError("error censorship permanent",ue.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}ag=!!t,og=!!r}static setLogLevel(t){const r=yl[t.toLowerCase()];if(r==null){ue.globalLogger().warn("invalid log level - "+t);return}cg=r}static from(t){return new ue(t)}}ue.errors=Qn,ue.levels=nf;const z8="bytes/5.7.0",lr=new ue(z8);function hg(e){return!!e.toHexString}function ko(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return ko(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function H8(e){return mn(e)&&!(e.length%2)||qo(e)}function fg(e){return typeof e=="number"&&e==e&&e%1===0}function qo(e){if(e==null)return!1;if(e.constructor===Uint8Array)return!0;if(typeof e=="string"||!fg(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!fg(r)||r<0||r>=256)return!1}return!0}function or(e,t){if(t||(t={}),typeof e=="number"){lr.checkSafeUint53(e,"invalid arrayify value");const r=[];for(;e;)r.unshift(e&255),e=parseInt(String(e/256));return r.length===0&&r.push(0),ko(new Uint8Array(r))}if(t.allowMissingPrefix&&typeof e=="string"&&e.substring(0,2)!=="0x"&&(e="0x"+e),hg(e)&&(e=e.toHexString()),mn(e)){let r=e.substring(2);r.length%2&&(t.hexPad==="left"?r="0"+r:t.hexPad==="right"?r+="0":lr.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let i=0;i<r.length;i+=2)n.push(parseInt(r.substring(i,i+2),16));return ko(new Uint8Array(n))}return qo(e)?ko(new Uint8Array(e)):lr.throwArgumentError("invalid arrayify value","value",e)}function K8(e){const t=e.map(i=>or(i)),r=t.reduce((i,o)=>i+o.length,0),n=new Uint8Array(r);return t.reduce((i,o)=>(n.set(o,i),i+o.length),0),ko(n)}function W8(e,t){e=or(e),e.length>t&&lr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),ko(r)}function mn(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}const sf="0123456789abcdef";function kr(e,t){if(t||(t={}),typeof e=="number"){lr.checkSafeUint53(e,"invalid hexlify value");let r="";for(;e;)r=sf[e&15]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof e=="bigint")return e=e.toString(16),e.length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&typeof e=="string"&&e.substring(0,2)!=="0x"&&(e="0x"+e),hg(e))return e.toHexString();if(mn(e))return e.length%2&&(t.hexPad==="left"?e="0x0"+e.substring(2):t.hexPad==="right"?e+="0":lr.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(qo(e)){let r="0x";for(let n=0;n<e.length;n++){let i=e[n];r+=sf[(i&240)>>4]+sf[i&15]}return r}return lr.throwArgumentError("invalid hexlify value","value",e)}function V8(e){if(typeof e!="string")e=kr(e);else if(!mn(e)||e.length%2)return null;return(e.length-2)/2}function dg(e,t,r){return typeof e!="string"?e=kr(e):(!mn(e)||e.length%2)&&lr.throwArgumentError("invalid hexData","value",e),t=2+2*t,r!=null?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function ci(e,t){for(typeof e!="string"?e=kr(e):mn(e)||lr.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&lr.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function pg(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(H8(e)){let r=or(e);r.length===64?(t.v=27+(r[32]>>7),r[32]&=127,t.r=kr(r.slice(0,32)),t.s=kr(r.slice(32,64))):r.length===65?(t.r=kr(r.slice(0,32)),t.s=kr(r.slice(32,64)),t.v=r[64]):lr.throwArgumentError("invalid signature string","signature",e),t.v<27&&(t.v===0||t.v===1?t.v+=27:lr.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=kr(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,t._vs!=null){const i=W8(or(t._vs),32);t._vs=kr(i);const o=i[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=o:t.recoveryParam!==o&&lr.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),i[0]&=127;const c=kr(i);t.s==null?t.s=c:t.s!==c&&lr.throwArgumentError("signature v mismatch _vs","signature",e)}if(t.recoveryParam==null)t.v==null?lr.throwArgumentError("signature missing v and recoveryParam","signature",e):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const i=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==i&&lr.throwArgumentError("signature recoveryParam mismatch v","signature",e)}t.r==null||!mn(t.r)?lr.throwArgumentError("signature missing or invalid r","signature",e):t.r=ci(t.r,32),t.s==null||!mn(t.s)?lr.throwArgumentError("signature missing or invalid s","signature",e):t.s=ci(t.s,32);const r=or(t.s);r[0]>=128&&lr.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=kr(r);t._vs&&(mn(t._vs)||lr.throwArgumentError("signature invalid _vs","signature",e),t._vs=ci(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&lr.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function of(e){return"0x"+j8.keccak_256(or(e))}var gg={exports:{}},G8={},Y8=Object.freeze({__proto__:null,default:G8}),Q8=F8(Y8);(function(e){(function(t,r){function n(d,p){if(!d)throw new Error(p||"Assertion failed")}function i(d,p){d.super_=p;var b=function(){};b.prototype=p.prototype,d.prototype=new b,d.prototype.constructor=d}function o(d,p,b){if(o.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((p==="le"||p==="be")&&(b=p,p=10),this._init(d||0,p||10,b||"be"))}typeof t=="object"?t.exports=o:r.BN=o,o.BN=o,o.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=Q8.Buffer}catch{}o.isBN=function(d){return d instanceof o?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===o.wordSize&&Array.isArray(d.words)},o.max=function(d,p){return d.cmp(p)>0?d:p},o.min=function(d,p){return d.cmp(p)<0?d:p},o.prototype._init=function(d,p,b){if(typeof d=="number")return this._initNumber(d,p,b);if(typeof d=="object")return this._initArray(d,p,b);p==="hex"&&(p=16),n(p===(p|0)&&p>=2&&p<=36),d=d.toString().replace(/\s+/g,"");var C=0;d[0]==="-"&&(C++,this.negative=1),C<d.length&&(p===16?this._parseHex(d,C,b):(this._parseBase(d,p,C),b==="le"&&this._initArray(this.toArray(),p,b)))},o.prototype._initNumber=function(d,p,b){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(n(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),p,b)},o.prototype._initArray=function(d,p,b){if(n(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var C=0;C<this.length;C++)this.words[C]=0;var O,N,L=0;if(b==="be")for(C=d.length-1,O=0;C>=0;C-=3)N=d[C]|d[C-1]<<8|d[C-2]<<16,this.words[O]|=N<<L&67108863,this.words[O+1]=N>>>26-L&67108863,L+=24,L>=26&&(L-=26,O++);else if(b==="le")for(C=0,O=0;C<d.length;C+=3)N=d[C]|d[C+1]<<8|d[C+2]<<16,this.words[O]|=N<<L&67108863,this.words[O+1]=N>>>26-L&67108863,L+=24,L>=26&&(L-=26,O++);return this._strip()};function l(d,p){var b=d.charCodeAt(p);if(b>=48&&b<=57)return b-48;if(b>=65&&b<=70)return b-55;if(b>=97&&b<=102)return b-87;n(!1,"Invalid character in "+d)}function f(d,p,b){var C=l(d,b);return b-1>=p&&(C|=l(d,b-1)<<4),C}o.prototype._parseHex=function(d,p,b){this.length=Math.ceil((d.length-p)/6),this.words=new Array(this.length);for(var C=0;C<this.length;C++)this.words[C]=0;var O=0,N=0,L;if(b==="be")for(C=d.length-1;C>=p;C-=2)L=f(d,p,C)<<O,this.words[N]|=L&67108863,O>=18?(O-=18,N+=1,this.words[N]|=L>>>26):O+=8;else{var D=d.length-p;for(C=D%2===0?p+1:p;C<d.length;C+=2)L=f(d,p,C)<<O,this.words[N]|=L&67108863,O>=18?(O-=18,N+=1,this.words[N]|=L>>>26):O+=8}this._strip()};function h(d,p,b,C){for(var O=0,N=0,L=Math.min(d.length,b),D=p;D<L;D++){var v=d.charCodeAt(D)-48;O*=C,v>=49?N=v-49+10:v>=17?N=v-17+10:N=v,n(v>=0&&N<C,"Invalid character"),O+=N}return O}o.prototype._parseBase=function(d,p,b){this.words=[0],this.length=1;for(var C=0,O=1;O<=67108863;O*=p)C++;C--,O=O/p|0;for(var N=d.length-b,L=N%C,D=Math.min(N,N-L)+b,v=0,T=b;T<D;T+=C)v=h(d,T,T+C,p),this.imuln(O),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v);if(L!==0){var ot=1;for(v=h(d,T,d.length,p),T=0;T<L;T++)ot*=p;this.imuln(ot),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v)}this._strip()},o.prototype.copy=function(d){d.words=new Array(this.length);for(var p=0;p<this.length;p++)d.words[p]=this.words[p];d.length=this.length,d.negative=this.negative,d.red=this.red};function g(d,p){d.words=p.words,d.length=p.length,d.negative=p.negative,d.red=p.red}if(o.prototype._move=function(d){g(d,this)},o.prototype.clone=function(){var d=new o(null);return this.copy(d),d},o.prototype._expand=function(d){for(;this.length<d;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=_}catch{o.prototype.inspect=_}else o.prototype.inspect=_;function _(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(d,p){d=d||10,p=p|0||1;var b;if(d===16||d==="hex"){b="";for(var C=0,O=0,N=0;N<this.length;N++){var L=this.words[N],D=((L<<C|O)&16777215).toString(16);O=L>>>24-C&16777215,C+=2,C>=26&&(C-=26,N--),O!==0||N!==this.length-1?b=E[6-D.length]+D+b:b=D+b}for(O!==0&&(b=O.toString(16)+b);b.length%p!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(d===(d|0)&&d>=2&&d<=36){var v=x[d],T=I[d];b="";var ot=this.clone();for(ot.negative=0;!ot.isZero();){var pt=ot.modrn(T).toString(d);ot=ot.idivn(T),ot.isZero()?b=pt+b:b=E[v-pt.length]+pt+b}for(this.isZero()&&(b="0"+b);b.length%p!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},o.prototype.toJSON=function(){return this.toString(16,2)},c&&(o.prototype.toBuffer=function(d,p){return this.toArrayLike(c,d,p)}),o.prototype.toArray=function(d,p){return this.toArrayLike(Array,d,p)};var F=function(d,p){return d.allocUnsafe?d.allocUnsafe(p):new d(p)};o.prototype.toArrayLike=function(d,p,b){this._strip();var C=this.byteLength(),O=b||Math.max(1,C);n(C<=O,"byte array longer than desired length"),n(O>0,"Requested array length <= 0");var N=F(d,O),L=p==="le"?"LE":"BE";return this["_toArrayLike"+L](N,C),N},o.prototype._toArrayLikeLE=function(d,p){for(var b=0,C=0,O=0,N=0;O<this.length;O++){var L=this.words[O]<<N|C;d[b++]=L&255,b<d.length&&(d[b++]=L>>8&255),b<d.length&&(d[b++]=L>>16&255),N===6?(b<d.length&&(d[b++]=L>>24&255),C=0,N=0):(C=L>>>24,N+=2)}if(b<d.length)for(d[b++]=C;b<d.length;)d[b++]=0},o.prototype._toArrayLikeBE=function(d,p){for(var b=d.length-1,C=0,O=0,N=0;O<this.length;O++){var L=this.words[O]<<N|C;d[b--]=L&255,b>=0&&(d[b--]=L>>8&255),b>=0&&(d[b--]=L>>16&255),N===6?(b>=0&&(d[b--]=L>>24&255),C=0,N=0):(C=L>>>24,N+=2)}if(b>=0)for(d[b--]=C;b>=0;)d[b--]=0},Math.clz32?o.prototype._countBits=function(d){return 32-Math.clz32(d)}:o.prototype._countBits=function(d){var p=d,b=0;return p>=4096&&(b+=13,p>>>=13),p>=64&&(b+=7,p>>>=7),p>=8&&(b+=4,p>>>=4),p>=2&&(b+=2,p>>>=2),b+p},o.prototype._zeroBits=function(d){if(d===0)return 26;var p=d,b=0;return p&8191||(b+=13,p>>>=13),p&127||(b+=7,p>>>=7),p&15||(b+=4,p>>>=4),p&3||(b+=2,p>>>=2),p&1||b++,b},o.prototype.bitLength=function(){var d=this.words[this.length-1],p=this._countBits(d);return(this.length-1)*26+p};function W(d){for(var p=new Array(d.bitLength()),b=0;b<p.length;b++){var C=b/26|0,O=b%26;p[b]=d.words[C]>>>O&1}return p}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,p=0;p<this.length;p++){var b=this._zeroBits(this.words[p]);if(d+=b,b!==26)break}return d},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},o.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var p=0;p<d.length;p++)this.words[p]=this.words[p]|d.words[p];return this._strip()},o.prototype.ior=function(d){return n((this.negative|d.negative)===0),this.iuor(d)},o.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},o.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},o.prototype.iuand=function(d){var p;this.length>d.length?p=d:p=this;for(var b=0;b<p.length;b++)this.words[b]=this.words[b]&d.words[b];return this.length=p.length,this._strip()},o.prototype.iand=function(d){return n((this.negative|d.negative)===0),this.iuand(d)},o.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},o.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},o.prototype.iuxor=function(d){var p,b;this.length>d.length?(p=this,b=d):(p=d,b=this);for(var C=0;C<b.length;C++)this.words[C]=p.words[C]^b.words[C];if(this!==p)for(;C<p.length;C++)this.words[C]=p.words[C];return this.length=p.length,this._strip()},o.prototype.ixor=function(d){return n((this.negative|d.negative)===0),this.iuxor(d)},o.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},o.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},o.prototype.inotn=function(d){n(typeof d=="number"&&d>=0);var p=Math.ceil(d/26)|0,b=d%26;this._expand(p),b>0&&p--;for(var C=0;C<p;C++)this.words[C]=~this.words[C]&67108863;return b>0&&(this.words[C]=~this.words[C]&67108863>>26-b),this._strip()},o.prototype.notn=function(d){return this.clone().inotn(d)},o.prototype.setn=function(d,p){n(typeof d=="number"&&d>=0);var b=d/26|0,C=d%26;return this._expand(b+1),p?this.words[b]=this.words[b]|1<<C:this.words[b]=this.words[b]&~(1<<C),this._strip()},o.prototype.iadd=function(d){var p;if(this.negative!==0&&d.negative===0)return this.negative=0,p=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,p=this.isub(d),d.negative=1,p._normSign();var b,C;this.length>d.length?(b=this,C=d):(b=d,C=this);for(var O=0,N=0;N<C.length;N++)p=(b.words[N]|0)+(C.words[N]|0)+O,this.words[N]=p&67108863,O=p>>>26;for(;O!==0&&N<b.length;N++)p=(b.words[N]|0)+O,this.words[N]=p&67108863,O=p>>>26;if(this.length=b.length,O!==0)this.words[this.length]=O,this.length++;else if(b!==this)for(;N<b.length;N++)this.words[N]=b.words[N];return this},o.prototype.add=function(d){var p;return d.negative!==0&&this.negative===0?(d.negative=0,p=this.sub(d),d.negative^=1,p):d.negative===0&&this.negative!==0?(this.negative=0,p=d.sub(this),this.negative=1,p):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},o.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var p=this.iadd(d);return d.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var b=this.cmp(d);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var C,O;b>0?(C=this,O=d):(C=d,O=this);for(var N=0,L=0;L<O.length;L++)p=(C.words[L]|0)-(O.words[L]|0)+N,N=p>>26,this.words[L]=p&67108863;for(;N!==0&&L<C.length;L++)p=(C.words[L]|0)+N,N=p>>26,this.words[L]=p&67108863;if(N===0&&L<C.length&&C!==this)for(;L<C.length;L++)this.words[L]=C.words[L];return this.length=Math.max(this.length,L),C!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(d){return this.clone().isub(d)};function Y(d,p,b){b.negative=p.negative^d.negative;var C=d.length+p.length|0;b.length=C,C=C-1|0;var O=d.words[0]|0,N=p.words[0]|0,L=O*N,D=L&67108863,v=L/67108864|0;b.words[0]=D;for(var T=1;T<C;T++){for(var ot=v>>>26,pt=v&67108863,A=Math.min(T,p.length-1),rt=Math.max(0,T-d.length+1);rt<=A;rt++){var q=T-rt|0;O=d.words[q]|0,N=p.words[rt]|0,L=O*N+pt,ot+=L/67108864|0,pt=L&67108863}b.words[T]=pt|0,v=ot|0}return v!==0?b.words[T]=v|0:b.length--,b._strip()}var B=function(d,p,b){var C=d.words,O=p.words,N=b.words,L=0,D,v,T,ot=C[0]|0,pt=ot&8191,A=ot>>>13,rt=C[1]|0,q=rt&8191,H=rt>>>13,V=C[2]|0,w=V&8191,k=V>>>13,it=C[3]|0,ht=it&8191,lt=it>>>13,Ot=C[4]|0,Mt=Ot&8191,St=Ot>>>13,Pe=C[5]|0,zt=Pe&8191,Dt=Pe>>>13,Ft=C[6]|0,Et=Ft&8191,At=Ft>>>13,Gt=C[7]|0,bt=Gt&8191,xt=Gt>>>13,Bt=C[8]|0,_t=Bt&8191,Pt=Bt>>>13,jt=C[9]|0,$t=jt&8191,Nt=jt>>>13,le=O[0]|0,Rt=le&8191,Tt=le>>>13,nr=O[1]|0,de=nr&8191,Ee=nr>>>13,ir=O[2]|0,Ie=ir&8191,Oe=ir>>>13,Vr=O[3]|0,Yt=Vr&8191,Ht=Vr>>>13,Re=O[4]|0,Qt=Re&8191,Vt=Re>>>13,Me=O[5]|0,Xt=Me&8191,te=Me>>>13,Le=O[6]|0,ee=Le&8191,Jt=Le>>>13,Fe=O[7]|0,Zt=Fe&8191,kt=Fe>>>13,He=O[8]|0,re=He&8191,je=He>>>13,ei=O[9]|0,ke=ei&8191,ve=ei>>>13;b.negative=d.negative^p.negative,b.length=19,D=Math.imul(pt,Rt),v=Math.imul(pt,Tt),v=v+Math.imul(A,Rt)|0,T=Math.imul(A,Tt);var Tn=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,D=Math.imul(q,Rt),v=Math.imul(q,Tt),v=v+Math.imul(H,Rt)|0,T=Math.imul(H,Tt),D=D+Math.imul(pt,de)|0,v=v+Math.imul(pt,Ee)|0,v=v+Math.imul(A,de)|0,T=T+Math.imul(A,Ee)|0;var Rn=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,D=Math.imul(w,Rt),v=Math.imul(w,Tt),v=v+Math.imul(k,Rt)|0,T=Math.imul(k,Tt),D=D+Math.imul(q,de)|0,v=v+Math.imul(q,Ee)|0,v=v+Math.imul(H,de)|0,T=T+Math.imul(H,Ee)|0,D=D+Math.imul(pt,Ie)|0,v=v+Math.imul(pt,Oe)|0,v=v+Math.imul(A,Ie)|0,T=T+Math.imul(A,Oe)|0;var Ln=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,D=Math.imul(ht,Rt),v=Math.imul(ht,Tt),v=v+Math.imul(lt,Rt)|0,T=Math.imul(lt,Tt),D=D+Math.imul(w,de)|0,v=v+Math.imul(w,Ee)|0,v=v+Math.imul(k,de)|0,T=T+Math.imul(k,Ee)|0,D=D+Math.imul(q,Ie)|0,v=v+Math.imul(q,Oe)|0,v=v+Math.imul(H,Ie)|0,T=T+Math.imul(H,Oe)|0,D=D+Math.imul(pt,Yt)|0,v=v+Math.imul(pt,Ht)|0,v=v+Math.imul(A,Yt)|0,T=T+Math.imul(A,Ht)|0;var Bn=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,D=Math.imul(Mt,Rt),v=Math.imul(Mt,Tt),v=v+Math.imul(St,Rt)|0,T=Math.imul(St,Tt),D=D+Math.imul(ht,de)|0,v=v+Math.imul(ht,Ee)|0,v=v+Math.imul(lt,de)|0,T=T+Math.imul(lt,Ee)|0,D=D+Math.imul(w,Ie)|0,v=v+Math.imul(w,Oe)|0,v=v+Math.imul(k,Ie)|0,T=T+Math.imul(k,Oe)|0,D=D+Math.imul(q,Yt)|0,v=v+Math.imul(q,Ht)|0,v=v+Math.imul(H,Yt)|0,T=T+Math.imul(H,Ht)|0,D=D+Math.imul(pt,Qt)|0,v=v+Math.imul(pt,Vt)|0,v=v+Math.imul(A,Qt)|0,T=T+Math.imul(A,Vt)|0;var Un=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(Un>>>26)|0,Un&=67108863,D=Math.imul(zt,Rt),v=Math.imul(zt,Tt),v=v+Math.imul(Dt,Rt)|0,T=Math.imul(Dt,Tt),D=D+Math.imul(Mt,de)|0,v=v+Math.imul(Mt,Ee)|0,v=v+Math.imul(St,de)|0,T=T+Math.imul(St,Ee)|0,D=D+Math.imul(ht,Ie)|0,v=v+Math.imul(ht,Oe)|0,v=v+Math.imul(lt,Ie)|0,T=T+Math.imul(lt,Oe)|0,D=D+Math.imul(w,Yt)|0,v=v+Math.imul(w,Ht)|0,v=v+Math.imul(k,Yt)|0,T=T+Math.imul(k,Ht)|0,D=D+Math.imul(q,Qt)|0,v=v+Math.imul(q,Vt)|0,v=v+Math.imul(H,Qt)|0,T=T+Math.imul(H,Vt)|0,D=D+Math.imul(pt,Xt)|0,v=v+Math.imul(pt,te)|0,v=v+Math.imul(A,Xt)|0,T=T+Math.imul(A,te)|0;var xr=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(xr>>>26)|0,xr&=67108863,D=Math.imul(Et,Rt),v=Math.imul(Et,Tt),v=v+Math.imul(At,Rt)|0,T=Math.imul(At,Tt),D=D+Math.imul(zt,de)|0,v=v+Math.imul(zt,Ee)|0,v=v+Math.imul(Dt,de)|0,T=T+Math.imul(Dt,Ee)|0,D=D+Math.imul(Mt,Ie)|0,v=v+Math.imul(Mt,Oe)|0,v=v+Math.imul(St,Ie)|0,T=T+Math.imul(St,Oe)|0,D=D+Math.imul(ht,Yt)|0,v=v+Math.imul(ht,Ht)|0,v=v+Math.imul(lt,Yt)|0,T=T+Math.imul(lt,Ht)|0,D=D+Math.imul(w,Qt)|0,v=v+Math.imul(w,Vt)|0,v=v+Math.imul(k,Qt)|0,T=T+Math.imul(k,Vt)|0,D=D+Math.imul(q,Xt)|0,v=v+Math.imul(q,te)|0,v=v+Math.imul(H,Xt)|0,T=T+Math.imul(H,te)|0,D=D+Math.imul(pt,ee)|0,v=v+Math.imul(pt,Jt)|0,v=v+Math.imul(A,ee)|0,T=T+Math.imul(A,Jt)|0;var Pi=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(Pi>>>26)|0,Pi&=67108863,D=Math.imul(bt,Rt),v=Math.imul(bt,Tt),v=v+Math.imul(xt,Rt)|0,T=Math.imul(xt,Tt),D=D+Math.imul(Et,de)|0,v=v+Math.imul(Et,Ee)|0,v=v+Math.imul(At,de)|0,T=T+Math.imul(At,Ee)|0,D=D+Math.imul(zt,Ie)|0,v=v+Math.imul(zt,Oe)|0,v=v+Math.imul(Dt,Ie)|0,T=T+Math.imul(Dt,Oe)|0,D=D+Math.imul(Mt,Yt)|0,v=v+Math.imul(Mt,Ht)|0,v=v+Math.imul(St,Yt)|0,T=T+Math.imul(St,Ht)|0,D=D+Math.imul(ht,Qt)|0,v=v+Math.imul(ht,Vt)|0,v=v+Math.imul(lt,Qt)|0,T=T+Math.imul(lt,Vt)|0,D=D+Math.imul(w,Xt)|0,v=v+Math.imul(w,te)|0,v=v+Math.imul(k,Xt)|0,T=T+Math.imul(k,te)|0,D=D+Math.imul(q,ee)|0,v=v+Math.imul(q,Jt)|0,v=v+Math.imul(H,ee)|0,T=T+Math.imul(H,Jt)|0,D=D+Math.imul(pt,Zt)|0,v=v+Math.imul(pt,kt)|0,v=v+Math.imul(A,Zt)|0,T=T+Math.imul(A,kt)|0;var fo=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(fo>>>26)|0,fo&=67108863,D=Math.imul(_t,Rt),v=Math.imul(_t,Tt),v=v+Math.imul(Pt,Rt)|0,T=Math.imul(Pt,Tt),D=D+Math.imul(bt,de)|0,v=v+Math.imul(bt,Ee)|0,v=v+Math.imul(xt,de)|0,T=T+Math.imul(xt,Ee)|0,D=D+Math.imul(Et,Ie)|0,v=v+Math.imul(Et,Oe)|0,v=v+Math.imul(At,Ie)|0,T=T+Math.imul(At,Oe)|0,D=D+Math.imul(zt,Yt)|0,v=v+Math.imul(zt,Ht)|0,v=v+Math.imul(Dt,Yt)|0,T=T+Math.imul(Dt,Ht)|0,D=D+Math.imul(Mt,Qt)|0,v=v+Math.imul(Mt,Vt)|0,v=v+Math.imul(St,Qt)|0,T=T+Math.imul(St,Vt)|0,D=D+Math.imul(ht,Xt)|0,v=v+Math.imul(ht,te)|0,v=v+Math.imul(lt,Xt)|0,T=T+Math.imul(lt,te)|0,D=D+Math.imul(w,ee)|0,v=v+Math.imul(w,Jt)|0,v=v+Math.imul(k,ee)|0,T=T+Math.imul(k,Jt)|0,D=D+Math.imul(q,Zt)|0,v=v+Math.imul(q,kt)|0,v=v+Math.imul(H,Zt)|0,T=T+Math.imul(H,kt)|0,D=D+Math.imul(pt,re)|0,v=v+Math.imul(pt,je)|0,v=v+Math.imul(A,re)|0,T=T+Math.imul(A,je)|0;var Mi=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,D=Math.imul($t,Rt),v=Math.imul($t,Tt),v=v+Math.imul(Nt,Rt)|0,T=Math.imul(Nt,Tt),D=D+Math.imul(_t,de)|0,v=v+Math.imul(_t,Ee)|0,v=v+Math.imul(Pt,de)|0,T=T+Math.imul(Pt,Ee)|0,D=D+Math.imul(bt,Ie)|0,v=v+Math.imul(bt,Oe)|0,v=v+Math.imul(xt,Ie)|0,T=T+Math.imul(xt,Oe)|0,D=D+Math.imul(Et,Yt)|0,v=v+Math.imul(Et,Ht)|0,v=v+Math.imul(At,Yt)|0,T=T+Math.imul(At,Ht)|0,D=D+Math.imul(zt,Qt)|0,v=v+Math.imul(zt,Vt)|0,v=v+Math.imul(Dt,Qt)|0,T=T+Math.imul(Dt,Vt)|0,D=D+Math.imul(Mt,Xt)|0,v=v+Math.imul(Mt,te)|0,v=v+Math.imul(St,Xt)|0,T=T+Math.imul(St,te)|0,D=D+Math.imul(ht,ee)|0,v=v+Math.imul(ht,Jt)|0,v=v+Math.imul(lt,ee)|0,T=T+Math.imul(lt,Jt)|0,D=D+Math.imul(w,Zt)|0,v=v+Math.imul(w,kt)|0,v=v+Math.imul(k,Zt)|0,T=T+Math.imul(k,kt)|0,D=D+Math.imul(q,re)|0,v=v+Math.imul(q,je)|0,v=v+Math.imul(H,re)|0,T=T+Math.imul(H,je)|0,D=D+Math.imul(pt,ke)|0,v=v+Math.imul(pt,ve)|0,v=v+Math.imul(A,ke)|0,T=T+Math.imul(A,ve)|0;var po=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(po>>>26)|0,po&=67108863,D=Math.imul($t,de),v=Math.imul($t,Ee),v=v+Math.imul(Nt,de)|0,T=Math.imul(Nt,Ee),D=D+Math.imul(_t,Ie)|0,v=v+Math.imul(_t,Oe)|0,v=v+Math.imul(Pt,Ie)|0,T=T+Math.imul(Pt,Oe)|0,D=D+Math.imul(bt,Yt)|0,v=v+Math.imul(bt,Ht)|0,v=v+Math.imul(xt,Yt)|0,T=T+Math.imul(xt,Ht)|0,D=D+Math.imul(Et,Qt)|0,v=v+Math.imul(Et,Vt)|0,v=v+Math.imul(At,Qt)|0,T=T+Math.imul(At,Vt)|0,D=D+Math.imul(zt,Xt)|0,v=v+Math.imul(zt,te)|0,v=v+Math.imul(Dt,Xt)|0,T=T+Math.imul(Dt,te)|0,D=D+Math.imul(Mt,ee)|0,v=v+Math.imul(Mt,Jt)|0,v=v+Math.imul(St,ee)|0,T=T+Math.imul(St,Jt)|0,D=D+Math.imul(ht,Zt)|0,v=v+Math.imul(ht,kt)|0,v=v+Math.imul(lt,Zt)|0,T=T+Math.imul(lt,kt)|0,D=D+Math.imul(w,re)|0,v=v+Math.imul(w,je)|0,v=v+Math.imul(k,re)|0,T=T+Math.imul(k,je)|0,D=D+Math.imul(q,ke)|0,v=v+Math.imul(q,ve)|0,v=v+Math.imul(H,ke)|0,T=T+Math.imul(H,ve)|0;var go=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(go>>>26)|0,go&=67108863,D=Math.imul($t,Ie),v=Math.imul($t,Oe),v=v+Math.imul(Nt,Ie)|0,T=Math.imul(Nt,Oe),D=D+Math.imul(_t,Yt)|0,v=v+Math.imul(_t,Ht)|0,v=v+Math.imul(Pt,Yt)|0,T=T+Math.imul(Pt,Ht)|0,D=D+Math.imul(bt,Qt)|0,v=v+Math.imul(bt,Vt)|0,v=v+Math.imul(xt,Qt)|0,T=T+Math.imul(xt,Vt)|0,D=D+Math.imul(Et,Xt)|0,v=v+Math.imul(Et,te)|0,v=v+Math.imul(At,Xt)|0,T=T+Math.imul(At,te)|0,D=D+Math.imul(zt,ee)|0,v=v+Math.imul(zt,Jt)|0,v=v+Math.imul(Dt,ee)|0,T=T+Math.imul(Dt,Jt)|0,D=D+Math.imul(Mt,Zt)|0,v=v+Math.imul(Mt,kt)|0,v=v+Math.imul(St,Zt)|0,T=T+Math.imul(St,kt)|0,D=D+Math.imul(ht,re)|0,v=v+Math.imul(ht,je)|0,v=v+Math.imul(lt,re)|0,T=T+Math.imul(lt,je)|0,D=D+Math.imul(w,ke)|0,v=v+Math.imul(w,ve)|0,v=v+Math.imul(k,ke)|0,T=T+Math.imul(k,ve)|0;var $i=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+($i>>>26)|0,$i&=67108863,D=Math.imul($t,Yt),v=Math.imul($t,Ht),v=v+Math.imul(Nt,Yt)|0,T=Math.imul(Nt,Ht),D=D+Math.imul(_t,Qt)|0,v=v+Math.imul(_t,Vt)|0,v=v+Math.imul(Pt,Qt)|0,T=T+Math.imul(Pt,Vt)|0,D=D+Math.imul(bt,Xt)|0,v=v+Math.imul(bt,te)|0,v=v+Math.imul(xt,Xt)|0,T=T+Math.imul(xt,te)|0,D=D+Math.imul(Et,ee)|0,v=v+Math.imul(Et,Jt)|0,v=v+Math.imul(At,ee)|0,T=T+Math.imul(At,Jt)|0,D=D+Math.imul(zt,Zt)|0,v=v+Math.imul(zt,kt)|0,v=v+Math.imul(Dt,Zt)|0,T=T+Math.imul(Dt,kt)|0,D=D+Math.imul(Mt,re)|0,v=v+Math.imul(Mt,je)|0,v=v+Math.imul(St,re)|0,T=T+Math.imul(St,je)|0,D=D+Math.imul(ht,ke)|0,v=v+Math.imul(ht,ve)|0,v=v+Math.imul(lt,ke)|0,T=T+Math.imul(lt,ve)|0;var Ss=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(Ss>>>26)|0,Ss&=67108863,D=Math.imul($t,Qt),v=Math.imul($t,Vt),v=v+Math.imul(Nt,Qt)|0,T=Math.imul(Nt,Vt),D=D+Math.imul(_t,Xt)|0,v=v+Math.imul(_t,te)|0,v=v+Math.imul(Pt,Xt)|0,T=T+Math.imul(Pt,te)|0,D=D+Math.imul(bt,ee)|0,v=v+Math.imul(bt,Jt)|0,v=v+Math.imul(xt,ee)|0,T=T+Math.imul(xt,Jt)|0,D=D+Math.imul(Et,Zt)|0,v=v+Math.imul(Et,kt)|0,v=v+Math.imul(At,Zt)|0,T=T+Math.imul(At,kt)|0,D=D+Math.imul(zt,re)|0,v=v+Math.imul(zt,je)|0,v=v+Math.imul(Dt,re)|0,T=T+Math.imul(Dt,je)|0,D=D+Math.imul(Mt,ke)|0,v=v+Math.imul(Mt,ve)|0,v=v+Math.imul(St,ke)|0,T=T+Math.imul(St,ve)|0;var Cs=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(Cs>>>26)|0,Cs&=67108863,D=Math.imul($t,Xt),v=Math.imul($t,te),v=v+Math.imul(Nt,Xt)|0,T=Math.imul(Nt,te),D=D+Math.imul(_t,ee)|0,v=v+Math.imul(_t,Jt)|0,v=v+Math.imul(Pt,ee)|0,T=T+Math.imul(Pt,Jt)|0,D=D+Math.imul(bt,Zt)|0,v=v+Math.imul(bt,kt)|0,v=v+Math.imul(xt,Zt)|0,T=T+Math.imul(xt,kt)|0,D=D+Math.imul(Et,re)|0,v=v+Math.imul(Et,je)|0,v=v+Math.imul(At,re)|0,T=T+Math.imul(At,je)|0,D=D+Math.imul(zt,ke)|0,v=v+Math.imul(zt,ve)|0,v=v+Math.imul(Dt,ke)|0,T=T+Math.imul(Dt,ve)|0;var Gr=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,D=Math.imul($t,ee),v=Math.imul($t,Jt),v=v+Math.imul(Nt,ee)|0,T=Math.imul(Nt,Jt),D=D+Math.imul(_t,Zt)|0,v=v+Math.imul(_t,kt)|0,v=v+Math.imul(Pt,Zt)|0,T=T+Math.imul(Pt,kt)|0,D=D+Math.imul(bt,re)|0,v=v+Math.imul(bt,je)|0,v=v+Math.imul(xt,re)|0,T=T+Math.imul(xt,je)|0,D=D+Math.imul(Et,ke)|0,v=v+Math.imul(Et,ve)|0,v=v+Math.imul(At,ke)|0,T=T+Math.imul(At,ve)|0;var mo=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(mo>>>26)|0,mo&=67108863,D=Math.imul($t,Zt),v=Math.imul($t,kt),v=v+Math.imul(Nt,Zt)|0,T=Math.imul(Nt,kt),D=D+Math.imul(_t,re)|0,v=v+Math.imul(_t,je)|0,v=v+Math.imul(Pt,re)|0,T=T+Math.imul(Pt,je)|0,D=D+Math.imul(bt,ke)|0,v=v+Math.imul(bt,ve)|0,v=v+Math.imul(xt,ke)|0,T=T+Math.imul(xt,ve)|0;var vo=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(vo>>>26)|0,vo&=67108863,D=Math.imul($t,re),v=Math.imul($t,je),v=v+Math.imul(Nt,re)|0,T=Math.imul(Nt,je),D=D+Math.imul(_t,ke)|0,v=v+Math.imul(_t,ve)|0,v=v+Math.imul(Pt,ke)|0,T=T+Math.imul(Pt,ve)|0;var wo=(L+D|0)+((v&8191)<<13)|0;L=(T+(v>>>13)|0)+(wo>>>26)|0,wo&=67108863,D=Math.imul($t,ke),v=Math.imul($t,ve),v=v+Math.imul(Nt,ke)|0,T=Math.imul(Nt,ve);var yo=(L+D|0)+((v&8191)<<13)|0;return L=(T+(v>>>13)|0)+(yo>>>26)|0,yo&=67108863,N[0]=Tn,N[1]=Rn,N[2]=Ln,N[3]=Bn,N[4]=Un,N[5]=xr,N[6]=Pi,N[7]=fo,N[8]=Mi,N[9]=po,N[10]=go,N[11]=$i,N[12]=Ss,N[13]=Cs,N[14]=Gr,N[15]=mo,N[16]=vo,N[17]=wo,N[18]=yo,L!==0&&(N[19]=L,b.length++),b};Math.imul||(B=Y);function z(d,p,b){b.negative=p.negative^d.negative,b.length=d.length+p.length;for(var C=0,O=0,N=0;N<b.length-1;N++){var L=O;O=0;for(var D=C&67108863,v=Math.min(N,p.length-1),T=Math.max(0,N-d.length+1);T<=v;T++){var ot=N-T,pt=d.words[ot]|0,A=p.words[T]|0,rt=pt*A,q=rt&67108863;L=L+(rt/67108864|0)|0,q=q+D|0,D=q&67108863,L=L+(q>>>26)|0,O+=L>>>26,L&=67108863}b.words[N]=D,C=L,L=O}return C!==0?b.words[N]=C:b.length--,b._strip()}function P(d,p,b){return z(d,p,b)}o.prototype.mulTo=function(d,p){var b,C=this.length+d.length;return this.length===10&&d.length===10?b=B(this,d,p):C<63?b=Y(this,d,p):C<1024?b=z(this,d,p):b=P(this,d,p),b},o.prototype.mul=function(d){var p=new o(null);return p.words=new Array(this.length+d.length),this.mulTo(d,p)},o.prototype.mulf=function(d){var p=new o(null);return p.words=new Array(this.length+d.length),P(this,d,p)},o.prototype.imul=function(d){return this.clone().mulTo(d,this)},o.prototype.imuln=function(d){var p=d<0;p&&(d=-d),n(typeof d=="number"),n(d<67108864);for(var b=0,C=0;C<this.length;C++){var O=(this.words[C]|0)*d,N=(O&67108863)+(b&67108863);b>>=26,b+=O/67108864|0,b+=N>>>26,this.words[C]=N&67108863}return b!==0&&(this.words[C]=b,this.length++),p?this.ineg():this},o.prototype.muln=function(d){return this.clone().imuln(d)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(d){var p=W(d);if(p.length===0)return new o(1);for(var b=this,C=0;C<p.length&&p[C]===0;C++,b=b.sqr());if(++C<p.length)for(var O=b.sqr();C<p.length;C++,O=O.sqr())p[C]!==0&&(b=b.mul(O));return b},o.prototype.iushln=function(d){n(typeof d=="number"&&d>=0);var p=d%26,b=(d-p)/26,C=67108863>>>26-p<<26-p,O;if(p!==0){var N=0;for(O=0;O<this.length;O++){var L=this.words[O]&C,D=(this.words[O]|0)-L<<p;this.words[O]=D|N,N=L>>>26-p}N&&(this.words[O]=N,this.length++)}if(b!==0){for(O=this.length-1;O>=0;O--)this.words[O+b]=this.words[O];for(O=0;O<b;O++)this.words[O]=0;this.length+=b}return this._strip()},o.prototype.ishln=function(d){return n(this.negative===0),this.iushln(d)},o.prototype.iushrn=function(d,p,b){n(typeof d=="number"&&d>=0);var C;p?C=(p-p%26)/26:C=0;var O=d%26,N=Math.min((d-O)/26,this.length),L=67108863^67108863>>>O<<O,D=b;if(C-=N,C=Math.max(0,C),D){for(var v=0;v<N;v++)D.words[v]=this.words[v];D.length=N}if(N!==0)if(this.length>N)for(this.length-=N,v=0;v<this.length;v++)this.words[v]=this.words[v+N];else this.words[0]=0,this.length=1;var T=0;for(v=this.length-1;v>=0&&(T!==0||v>=C);v--){var ot=this.words[v]|0;this.words[v]=T<<26-O|ot>>>O,T=ot&L}return D&&T!==0&&(D.words[D.length++]=T),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(d,p,b){return n(this.negative===0),this.iushrn(d,p,b)},o.prototype.shln=function(d){return this.clone().ishln(d)},o.prototype.ushln=function(d){return this.clone().iushln(d)},o.prototype.shrn=function(d){return this.clone().ishrn(d)},o.prototype.ushrn=function(d){return this.clone().iushrn(d)},o.prototype.testn=function(d){n(typeof d=="number"&&d>=0);var p=d%26,b=(d-p)/26,C=1<<p;if(this.length<=b)return!1;var O=this.words[b];return!!(O&C)},o.prototype.imaskn=function(d){n(typeof d=="number"&&d>=0);var p=d%26,b=(d-p)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(p!==0&&b++,this.length=Math.min(b,this.length),p!==0){var C=67108863^67108863>>>p<<p;this.words[this.length-1]&=C}return this._strip()},o.prototype.maskn=function(d){return this.clone().imaskn(d)},o.prototype.iaddn=function(d){return n(typeof d=="number"),n(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<=d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},o.prototype._iaddn=function(d){this.words[0]+=d;for(var p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},o.prototype.isubn=function(d){if(n(typeof d=="number"),n(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+1]-=1;return this._strip()},o.prototype.addn=function(d){return this.clone().iaddn(d)},o.prototype.subn=function(d){return this.clone().isubn(d)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(d,p,b){var C=d.length+b,O;this._expand(C);var N,L=0;for(O=0;O<d.length;O++){N=(this.words[O+b]|0)+L;var D=(d.words[O]|0)*p;N-=D&67108863,L=(N>>26)-(D/67108864|0),this.words[O+b]=N&67108863}for(;O<this.length-b;O++)N=(this.words[O+b]|0)+L,L=N>>26,this.words[O+b]=N&67108863;if(L===0)return this._strip();for(n(L===-1),L=0,O=0;O<this.length;O++)N=-(this.words[O]|0)+L,L=N>>26,this.words[O]=N&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(d,p){var b=this.length-d.length,C=this.clone(),O=d,N=O.words[O.length-1]|0,L=this._countBits(N);b=26-L,b!==0&&(O=O.ushln(b),C.iushln(b),N=O.words[O.length-1]|0);var D=C.length-O.length,v;if(p!=="mod"){v=new o(null),v.length=D+1,v.words=new Array(v.length);for(var T=0;T<v.length;T++)v.words[T]=0}var ot=C.clone()._ishlnsubmul(O,1,D);ot.negative===0&&(C=ot,v&&(v.words[D]=1));for(var pt=D-1;pt>=0;pt--){var A=(C.words[O.length+pt]|0)*67108864+(C.words[O.length+pt-1]|0);for(A=Math.min(A/N|0,67108863),C._ishlnsubmul(O,A,pt);C.negative!==0;)A--,C.negative=0,C._ishlnsubmul(O,1,pt),C.isZero()||(C.negative^=1);v&&(v.words[pt]=A)}return v&&v._strip(),C._strip(),p!=="div"&&b!==0&&C.iushrn(b),{div:v||null,mod:C}},o.prototype.divmod=function(d,p,b){if(n(!d.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var C,O,N;return this.negative!==0&&d.negative===0?(N=this.neg().divmod(d,p),p!=="mod"&&(C=N.div.neg()),p!=="div"&&(O=N.mod.neg(),b&&O.negative!==0&&O.iadd(d)),{div:C,mod:O}):this.negative===0&&d.negative!==0?(N=this.divmod(d.neg(),p),p!=="mod"&&(C=N.div.neg()),{div:C,mod:N.mod}):this.negative&d.negative?(N=this.neg().divmod(d.neg(),p),p!=="div"&&(O=N.mod.neg(),b&&O.negative!==0&&O.isub(d)),{div:N.div,mod:O}):d.length>this.length||this.cmp(d)<0?{div:new o(0),mod:this}:d.length===1?p==="div"?{div:this.divn(d.words[0]),mod:null}:p==="mod"?{div:null,mod:new o(this.modrn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new o(this.modrn(d.words[0]))}:this._wordDiv(d,p)},o.prototype.div=function(d){return this.divmod(d,"div",!1).div},o.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},o.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},o.prototype.divRound=function(d){var p=this.divmod(d);if(p.mod.isZero())return p.div;var b=p.div.negative!==0?p.mod.isub(d):p.mod,C=d.ushrn(1),O=d.andln(1),N=b.cmp(C);return N<0||O===1&&N===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},o.prototype.modrn=function(d){var p=d<0;p&&(d=-d),n(d<=67108863);for(var b=(1<<26)%d,C=0,O=this.length-1;O>=0;O--)C=(b*C+(this.words[O]|0))%d;return p?-C:C},o.prototype.modn=function(d){return this.modrn(d)},o.prototype.idivn=function(d){var p=d<0;p&&(d=-d),n(d<=67108863);for(var b=0,C=this.length-1;C>=0;C--){var O=(this.words[C]|0)+b*67108864;this.words[C]=O/d|0,b=O%d}return this._strip(),p?this.ineg():this},o.prototype.divn=function(d){return this.clone().idivn(d)},o.prototype.egcd=function(d){n(d.negative===0),n(!d.isZero());var p=this,b=d.clone();p.negative!==0?p=p.umod(d):p=p.clone();for(var C=new o(1),O=new o(0),N=new o(0),L=new o(1),D=0;p.isEven()&&b.isEven();)p.iushrn(1),b.iushrn(1),++D;for(var v=b.clone(),T=p.clone();!p.isZero();){for(var ot=0,pt=1;!(p.words[0]&pt)&&ot<26;++ot,pt<<=1);if(ot>0)for(p.iushrn(ot);ot-- >0;)(C.isOdd()||O.isOdd())&&(C.iadd(v),O.isub(T)),C.iushrn(1),O.iushrn(1);for(var A=0,rt=1;!(b.words[0]&rt)&&A<26;++A,rt<<=1);if(A>0)for(b.iushrn(A);A-- >0;)(N.isOdd()||L.isOdd())&&(N.iadd(v),L.isub(T)),N.iushrn(1),L.iushrn(1);p.cmp(b)>=0?(p.isub(b),C.isub(N),O.isub(L)):(b.isub(p),N.isub(C),L.isub(O))}return{a:N,b:L,gcd:b.iushln(D)}},o.prototype._invmp=function(d){n(d.negative===0),n(!d.isZero());var p=this,b=d.clone();p.negative!==0?p=p.umod(d):p=p.clone();for(var C=new o(1),O=new o(0),N=b.clone();p.cmpn(1)>0&&b.cmpn(1)>0;){for(var L=0,D=1;!(p.words[0]&D)&&L<26;++L,D<<=1);if(L>0)for(p.iushrn(L);L-- >0;)C.isOdd()&&C.iadd(N),C.iushrn(1);for(var v=0,T=1;!(b.words[0]&T)&&v<26;++v,T<<=1);if(v>0)for(b.iushrn(v);v-- >0;)O.isOdd()&&O.iadd(N),O.iushrn(1);p.cmp(b)>=0?(p.isub(b),C.isub(O)):(b.isub(p),O.isub(C))}var ot;return p.cmpn(1)===0?ot=C:ot=O,ot.cmpn(0)<0&&ot.iadd(d),ot},o.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var p=this.clone(),b=d.clone();p.negative=0,b.negative=0;for(var C=0;p.isEven()&&b.isEven();C++)p.iushrn(1),b.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;b.isEven();)b.iushrn(1);var O=p.cmp(b);if(O<0){var N=p;p=b,b=N}else if(O===0||b.cmpn(1)===0)break;p.isub(b)}while(!0);return b.iushln(C)},o.prototype.invm=function(d){return this.egcd(d).a.umod(d)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(d){return this.words[0]&d},o.prototype.bincn=function(d){n(typeof d=="number");var p=d%26,b=(d-p)/26,C=1<<p;if(this.length<=b)return this._expand(b+1),this.words[b]|=C,this;for(var O=C,N=b;O!==0&&N<this.length;N++){var L=this.words[N]|0;L+=O,O=L>>>26,L&=67108863,this.words[N]=L}return O!==0&&(this.words[N]=O,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(d){var p=d<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var b;if(this.length>1)b=1;else{p&&(d=-d),n(d<=67108863,"Number is too big");var C=this.words[0]|0;b=C===d?0:C<d?-1:1}return this.negative!==0?-b|0:b},o.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var p=this.ucmp(d);return this.negative!==0?-p|0:p},o.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var p=0,b=this.length-1;b>=0;b--){var C=this.words[b]|0,O=d.words[b]|0;if(C!==O){C<O?p=-1:C>O&&(p=1);break}}return p},o.prototype.gtn=function(d){return this.cmpn(d)===1},o.prototype.gt=function(d){return this.cmp(d)===1},o.prototype.gten=function(d){return this.cmpn(d)>=0},o.prototype.gte=function(d){return this.cmp(d)>=0},o.prototype.ltn=function(d){return this.cmpn(d)===-1},o.prototype.lt=function(d){return this.cmp(d)===-1},o.prototype.lten=function(d){return this.cmpn(d)<=0},o.prototype.lte=function(d){return this.cmp(d)<=0},o.prototype.eqn=function(d){return this.cmpn(d)===0},o.prototype.eq=function(d){return this.cmp(d)===0},o.red=function(d){return new nt(d)},o.prototype.toRed=function(d){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(d){return this.red=d,this},o.prototype.forceRed=function(d){return n(!this.red,"Already a number in reduction context"),this._forceRed(d)},o.prototype.redAdd=function(d){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},o.prototype.redIAdd=function(d){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},o.prototype.redSub=function(d){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},o.prototype.redISub=function(d){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},o.prototype.redShl=function(d){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},o.prototype.redMul=function(d){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},o.prototype.redIMul=function(d){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(d){return n(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var U={k256:null,p224:null,p192:null,p25519:null};function j(d,p){this.name=d,this.p=new o(p,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}j.prototype._tmp=function(){var d=new o(null);return d.words=new Array(Math.ceil(this.n/13)),d},j.prototype.ireduce=function(d){var p=d,b;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),b=p.bitLength();while(b>this.n);var C=b<this.n?-1:p.ucmp(this.p);return C===0?(p.words[0]=0,p.length=1):C>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},j.prototype.split=function(d,p){d.iushrn(this.n,0,p)},j.prototype.imulK=function(d){return d.imul(this.k)};function m(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(m,j),m.prototype.split=function(d,p){for(var b=4194303,C=Math.min(d.length,9),O=0;O<C;O++)p.words[O]=d.words[O];if(p.length=C,d.length<=9){d.words[0]=0,d.length=1;return}var N=d.words[9];for(p.words[p.length++]=N&b,O=10;O<d.length;O++){var L=d.words[O]|0;d.words[O-10]=(L&b)<<4|N>>>22,N=L}N>>>=22,d.words[O-10]=N,N===0&&d.length>10?d.length-=10:d.length-=9},m.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var p=0,b=0;b<d.length;b++){var C=d.words[b]|0;p+=C*977,d.words[b]=p&67108863,p=C*64+(p/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function $(){j.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i($,j);function et(){j.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(et,j);function tt(){j.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(tt,j),tt.prototype.imulK=function(d){for(var p=0,b=0;b<d.length;b++){var C=(d.words[b]|0)*19+p,O=C&67108863;C>>>=26,d.words[b]=O,p=C}return p!==0&&(d.words[d.length++]=p),d},o._prime=function(d){if(U[d])return U[d];var p;if(d==="k256")p=new m;else if(d==="p224")p=new $;else if(d==="p192")p=new et;else if(d==="p25519")p=new tt;else throw new Error("Unknown prime "+d);return U[d]=p,p};function nt(d){if(typeof d=="string"){var p=o._prime(d);this.m=p.p,this.prime=p}else n(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}nt.prototype._verify1=function(d){n(d.negative===0,"red works only with positives"),n(d.red,"red works only with red numbers")},nt.prototype._verify2=function(d,p){n((d.negative|p.negative)===0,"red works only with positives"),n(d.red&&d.red===p.red,"red works only with red numbers")},nt.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):(g(d,d.umod(this.m)._forceRed(this)),d)},nt.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},nt.prototype.add=function(d,p){this._verify2(d,p);var b=d.add(p);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},nt.prototype.iadd=function(d,p){this._verify2(d,p);var b=d.iadd(p);return b.cmp(this.m)>=0&&b.isub(this.m),b},nt.prototype.sub=function(d,p){this._verify2(d,p);var b=d.sub(p);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},nt.prototype.isub=function(d,p){this._verify2(d,p);var b=d.isub(p);return b.cmpn(0)<0&&b.iadd(this.m),b},nt.prototype.shl=function(d,p){return this._verify1(d),this.imod(d.ushln(p))},nt.prototype.imul=function(d,p){return this._verify2(d,p),this.imod(d.imul(p))},nt.prototype.mul=function(d,p){return this._verify2(d,p),this.imod(d.mul(p))},nt.prototype.isqr=function(d){return this.imul(d,d.clone())},nt.prototype.sqr=function(d){return this.mul(d,d)},nt.prototype.sqrt=function(d){if(d.isZero())return d.clone();var p=this.m.andln(3);if(n(p%2===1),p===3){var b=this.m.add(new o(1)).iushrn(2);return this.pow(d,b)}for(var C=this.m.subn(1),O=0;!C.isZero()&&C.andln(1)===0;)O++,C.iushrn(1);n(!C.isZero());var N=new o(1).toRed(this),L=N.redNeg(),D=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new o(2*v*v).toRed(this);this.pow(v,D).cmp(L)!==0;)v.redIAdd(L);for(var T=this.pow(v,C),ot=this.pow(d,C.addn(1).iushrn(1)),pt=this.pow(d,C),A=O;pt.cmp(N)!==0;){for(var rt=pt,q=0;rt.cmp(N)!==0;q++)rt=rt.redSqr();n(q<A);var H=this.pow(T,new o(1).iushln(A-q-1));ot=ot.redMul(H),T=H.redSqr(),pt=pt.redMul(T),A=q}return ot},nt.prototype.invm=function(d){var p=d._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},nt.prototype.pow=function(d,p){if(p.isZero())return new o(1).toRed(this);if(p.cmpn(1)===0)return d.clone();var b=4,C=new Array(1<<b);C[0]=new o(1).toRed(this),C[1]=d;for(var O=2;O<C.length;O++)C[O]=this.mul(C[O-1],d);var N=C[0],L=0,D=0,v=p.bitLength()%26;for(v===0&&(v=26),O=p.length-1;O>=0;O--){for(var T=p.words[O],ot=v-1;ot>=0;ot--){var pt=T>>ot&1;if(N!==C[0]&&(N=this.sqr(N)),pt===0&&L===0){D=0;continue}L<<=1,L|=pt,D++,!(D!==b&&(O!==0||ot!==0))&&(N=this.mul(N,C[L]),D=0,L=0)}v=26}return N},nt.prototype.convertTo=function(d){var p=d.umod(this.m);return p===d?p.clone():p},nt.prototype.convertFrom=function(d){var p=d.clone();return p.red=null,p},o.mont=function(d){return new dt(d)};function dt(d){nt.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(dt,nt),dt.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},dt.prototype.convertFrom=function(d){var p=this.imod(d.mul(this.rinv));return p.red=null,p},dt.prototype.imul=function(d,p){if(d.isZero()||p.isZero())return d.words[0]=0,d.length=1,d;var b=d.imul(p),C=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=b.isub(C).iushrn(this.shift),N=O;return O.cmp(this.m)>=0?N=O.isub(this.m):O.cmpn(0)<0&&(N=O.iadd(this.m)),N._forceRed(this)},dt.prototype.mul=function(d,p){if(d.isZero()||p.isZero())return new o(0)._forceRed(this);var b=d.mul(p),C=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=b.isub(C).iushrn(this.shift),N=O;return O.cmp(this.m)>=0?N=O.isub(this.m):O.cmpn(0)<0&&(N=O.iadd(this.m)),N._forceRed(this)},dt.prototype.invm=function(d){var p=this.imod(d._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(e,ig)})(gg);var se=gg.exports;const mg="bignumber/5.7.0";var bl=se.BN;const Ui=new ue(mg),af={},vg=9007199254740991;function J8(e){return e!=null&&(Ze.isBigNumber(e)||typeof e=="number"&&e%1===0||typeof e=="string"&&!!e.match(/^-?[0-9]+$/)||mn(e)||typeof e=="bigint"||qo(e))}let wg=!1;class Ze{constructor(t,r){t!==af&&Ui.throwError("cannot call constructor directly; use BigNumber.from",ue.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return Xr(be(this).fromTwos(t))}toTwos(t){return Xr(be(this).toTwos(t))}abs(){return this._hex[0]==="-"?Ze.from(this._hex.substring(1)):this}add(t){return Xr(be(this).add(be(t)))}sub(t){return Xr(be(this).sub(be(t)))}div(t){return Ze.from(t).isZero()&&Sn("division-by-zero","div"),Xr(be(this).div(be(t)))}mul(t){return Xr(be(this).mul(be(t)))}mod(t){const r=be(t);return r.isNeg()&&Sn("division-by-zero","mod"),Xr(be(this).umod(r))}pow(t){const r=be(t);return r.isNeg()&&Sn("negative-power","pow"),Xr(be(this).pow(r))}and(t){const r=be(t);return(this.isNegative()||r.isNeg())&&Sn("unbound-bitwise-result","and"),Xr(be(this).and(r))}or(t){const r=be(t);return(this.isNegative()||r.isNeg())&&Sn("unbound-bitwise-result","or"),Xr(be(this).or(r))}xor(t){const r=be(t);return(this.isNegative()||r.isNeg())&&Sn("unbound-bitwise-result","xor"),Xr(be(this).xor(r))}mask(t){return(this.isNegative()||t<0)&&Sn("negative-width","mask"),Xr(be(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&Sn("negative-width","shl"),Xr(be(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&Sn("negative-width","shr"),Xr(be(this).shrn(t))}eq(t){return be(this).eq(be(t))}lt(t){return be(this).lt(be(t))}lte(t){return be(this).lte(be(t))}gt(t){return be(this).gt(be(t))}gte(t){return be(this).gte(be(t))}isNegative(){return this._hex[0]==="-"}isZero(){return be(this).isZero()}toNumber(){try{return be(this).toNumber()}catch{Sn("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Ui.throwError("this platform does not support BigInt",ue.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?wg||(wg=!0,Ui.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Ui.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ue.errors.UNEXPECTED_ARGUMENT,{}):Ui.throwError("BigNumber.toString does not accept parameters",ue.errors.UNEXPECTED_ARGUMENT,{})),be(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof Ze)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new Ze(af,Ya(t)):t.match(/^-?[0-9]+$/)?new Ze(af,Ya(new bl(t))):Ui.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&Sn("underflow","BigNumber.from",t),(t>=vg||t<=-vg)&&Sn("overflow","BigNumber.from",t),Ze.from(String(t));const r=t;if(typeof r=="bigint")return Ze.from(r.toString());if(qo(r))return Ze.from(kr(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return Ze.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(mn(n)||n[0]==="-"&&mn(n.substring(1))))return Ze.from(n)}return Ui.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function Ya(e){if(typeof e!="string")return Ya(e.toString(16));if(e[0]==="-")return e=e.substring(1),e[0]==="-"&&Ui.throwArgumentError("invalid hex","value",e),e=Ya(e),e==="0x00"?e:"-"+e;if(e.substring(0,2)!=="0x"&&(e="0x"+e),e==="0x")return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&e.substring(0,4)==="0x00";)e="0x"+e.substring(4);return e}function Xr(e){return Ze.from(Ya(e))}function be(e){const t=Ze.from(e).toHexString();return t[0]==="-"?new bl("-"+t.substring(3),16):new bl(t.substring(2),16)}function Sn(e,t,r){const n={fault:e,operation:t};return r!=null&&(n.value=r),Ui.throwError(e,ue.errors.NUMERIC_FAULT,n)}function Z8(e){return new bl(e,36).toString(16)}const qr=new ue(mg),Qa={},yg=Ze.from(0),bg=Ze.from(-1);function _g(e,t,r,n){const i={fault:t,operation:r};return n!==void 0&&(i.value=n),qr.throwError(e,ue.errors.NUMERIC_FAULT,i)}let Ja="0";for(;Ja.length<256;)Ja+=Ja;function cf(e){if(typeof e!="number")try{e=Ze.from(e).toNumber()}catch{}return typeof e=="number"&&e>=0&&e<=256&&!(e%1)?"1"+Ja.substring(0,e):qr.throwArgumentError("invalid decimal size","decimals",e)}function lf(e,t){t==null&&(t=0);const r=cf(t);e=Ze.from(e);const n=e.lt(yg);n&&(e=e.mul(bg));let i=e.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=e.div(r).toString();return r.length===1?e=o:e=o+"."+i,n&&(e="-"+e),e}function Fi(e,t){t==null&&(t=0);const r=cf(t);(typeof e!="string"||!e.match(/^-?[0-9.]+$/))&&qr.throwArgumentError("invalid decimal value","value",e);const n=e.substring(0,1)==="-";n&&(e=e.substring(1)),e==="."&&qr.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&qr.throwArgumentError("too many decimal points","value",e);let o=i[0],c=i[1];for(o||(o="0"),c||(c="0");c[c.length-1]==="0";)c=c.substring(0,c.length-1);for(c.length>r.length-1&&_g("fractional component exceeds decimals","underflow","parseFixed"),c===""&&(c="0");c.length<r.length-1;)c+="0";const l=Ze.from(o),f=Ze.from(c);let h=l.mul(r).add(f);return n&&(h=h.mul(bg)),h}class zo{constructor(t,r,n,i){t!==Qa&&qr.throwError("cannot use FixedFormat constructor; use FixedFormat.from",ue.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=n,this.decimals=i,this.name=(r?"":"u")+"fixed"+String(n)+"x"+String(i),this._multiplier=cf(i),Object.freeze(this)}static from(t){if(t instanceof zo)return t;typeof t=="number"&&(t=`fixed128x${t}`);let r=!0,n=128,i=18;if(typeof t=="string"){if(t!=="fixed")if(t==="ufixed")r=!1;else{const o=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);o||qr.throwArgumentError("invalid fixed format","format",t),r=o[1]!=="u",n=parseInt(o[2]),i=parseInt(o[3])}}else if(t){const o=(c,l,f)=>t[c]==null?f:(typeof t[c]!==l&&qr.throwArgumentError("invalid fixed format ("+c+" not "+l+")","format."+c,t[c]),t[c]);r=o("signed","boolean",r),n=o("width","number",n),i=o("decimals","number",i)}return n%8&&qr.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&qr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new zo(Qa,r,n,i)}}class Pr{constructor(t,r,n,i){t!==Qa&&qr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ue.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&qr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const r=Fi(this._value,this.format.decimals),n=Fi(t._value,t.format.decimals);return Pr.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const r=Fi(this._value,this.format.decimals),n=Fi(t._value,t.format.decimals);return Pr.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const r=Fi(this._value,this.format.decimals),n=Fi(t._value,t.format.decimals);return Pr.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const r=Fi(this._value,this.format.decimals),n=Fi(t._value,t.format.decimals);return Pr.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");t.length===1&&t.push("0");let r=Pr.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(Eg.toFormat(r.format))),r}ceiling(){const t=this.toString().split(".");t.length===1&&t.push("0");let r=Pr.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(Eg.toFormat(r.format))),r}round(t){t==null&&(t=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(t<0||t>80||t%1)&&qr.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this;const n=Pr.from("1"+Ja.substring(0,t),this.format),i=X8.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(t){if(t==null)return this._hex;t%8&&qr.throwArgumentError("invalid byte width","width",t);const r=Ze.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return ci(r,t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return Pr.fromString(this._value,t)}static fromValue(t,r,n){return n==null&&r!=null&&!J8(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),Pr.fromString(lf(t,r),zo.from(n))}static fromString(t,r){r==null&&(r="fixed");const n=zo.from(r),i=Fi(t,n.decimals);!n.signed&&i.lt(yg)&&_g("unsigned value cannot be negative","overflow","value",t);let o=null;n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=ci(o,n.width/8));const c=lf(i,n.decimals);return new Pr(Qa,o,c,n)}static fromBytes(t,r){r==null&&(r="fixed");const n=zo.from(r);if(or(t).length>n.width/8)throw new Error("overflow");let i=Ze.from(t);n.signed&&(i=i.fromTwos(n.width));const o=i.toTwos((n.signed?0:1)+n.width).toHexString(),c=lf(i,n.decimals);return new Pr(Qa,o,c,n)}static from(t,r){if(typeof t=="string")return Pr.fromString(t,r);if(qo(t))return Pr.fromBytes(t,r);try{return Pr.fromValue(t,0,r)}catch(n){if(n.code!==ue.errors.INVALID_ARGUMENT)throw n}return qr.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!!(t&&t._isFixedNumber)}}const Eg=Pr.from(1),X8=Pr.from("0.5"),t_="strings/5.7.0",Ag=new ue(t_);var _l;(function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"})(_l||(_l={}));var Ho;(function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"})(Ho||(Ho={}));function e_(e,t,r,n,i){return Ag.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)}function xg(e,t,r,n,i){if(e===Ho.BAD_PREFIX||e===Ho.UNEXPECTED_CONTINUE){let o=0;for(let c=t+1;c<r.length&&r[c]>>6===2;c++)o++;return o}return e===Ho.OVERRUN?r.length-t-1:0}function r_(e,t,r,n,i){return e===Ho.OVERLONG?(n.push(i),0):(n.push(65533),xg(e,t,r))}Object.freeze({error:e_,ignore:xg,replace:r_});function uf(e,t=_l.current){t!=_l.current&&(Ag.checkNormalize(),e=e.normalize(t));let r=[];for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const o=e.charCodeAt(n);if(n>=e.length||(o&64512)!==56320)throw new Error("invalid utf-8 string");const c=65536+((i&1023)<<10)+(o&1023);r.push(c>>18|240),r.push(c>>12&63|128),r.push(c>>6&63|128),r.push(c&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return or(r)}function n_(e){if(e.length%4!==0)throw new Error("bad data");let t=[];for(let r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t}function hf(e,t){t||(t=function(i){return[parseInt(i,16)]});let r=0,n={};return e.split(",").forEach(i=>{let o=i.split(":");r+=parseInt(o[0],16),n[r]=t(o[1])}),n}function Ig(e){let t=0;return e.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=t+parseInt(n[0],16);return t=parseInt(n[1],16),{l:i,h:t}})}Ig("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(e=>parseInt(e,16)),hf("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),hf("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),hf("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",n_),Ig("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");const Sg="hash/5.7.0";function i_(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return or(t)}function Cg(e,t){t==null&&(t=1);const r=[],n=r.forEach,i=function(o,c){n.call(o,function(l){c>0&&Array.isArray(l)?i(l,c-1):r.push(l)})};return i(e,t),r}function s_(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[n[0]]=n[1]}return t}function o_(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let U=1;U<n;U++)o.push(i+=r());let c=r(),l=t;t+=c;let f=0,h=0;function g(){return f==0&&(h=h<<8|e[t++],f=8),h>>--f&1}const _=31,E=Math.pow(2,_),x=E>>>1,I=x>>1,F=E-1;let W=0;for(let U=0;U<_;U++)W=W<<1|g();let Y=[],B=0,z=E;for(;;){let U=Math.floor(((W-B+1)*i-1)/z),j=0,m=n;for(;m-j>1;){let tt=j+m>>>1;U<o[tt]?m=tt:j=tt}if(j==0)break;Y.push(j);let $=B+Math.floor(z*o[j]/i),et=B+Math.floor(z*o[j+1]/i)-1;for(;!(($^et)&x);)W=W<<1&F|g(),$=$<<1&F,et=et<<1&F|1;for(;$&~et&I;)W=W&x|W<<1&F>>>1|g(),$=$<<1^x,et=(et^x)<<1|x|1;B=$,z=1+et-$}let P=n-4;return Y.map(U=>{switch(U-P){case 3:return P+65792+(e[l++]<<16|e[l++]<<8|e[l++]);case 2:return P+256+(e[l++]<<8|e[l++]);case 1:return P+e[l++];default:return U-1}})}function a_(e){let t=0;return()=>e[t++]}function c_(e){return a_(o_(e))}function l_(e){return e&1?~e>>1:e>>1}function u_(e,t){let r=Array(e);for(let n=0;n<e;n++)r[n]=1+t();return r}function Dg(e,t){let r=Array(e);for(let n=0,i=-1;n<e;n++)r[n]=i+=1+t();return r}function h_(e,t){let r=Array(e);for(let n=0,i=0;n<e;n++)r[n]=i+=l_(t());return r}function El(e,t){let r=Dg(e(),e),n=e(),i=Dg(n,e),o=u_(n,e);for(let c=0;c<n;c++)for(let l=0;l<o[c];l++)r.push(i[c]+l);return t?r.map(c=>t[c]):r}function f_(e){let t=[];for(;;){let r=e();if(r==0)break;t.push(p_(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(g_(r,e))}return s_(Cg(t))}function d_(e){let t=[];for(;;){let r=e();if(r==0)break;t.push(r)}return t}function Og(e,t,r){let n=Array(e).fill(void 0).map(()=>[]);for(let i=0;i<t;i++)h_(e,r).forEach((o,c)=>n[c].push(o));return n}function p_(e,t){let r=1+t(),n=t(),i=d_(t),o=Og(i.length,1+e,t);return Cg(o.map((c,l)=>{const f=c[0],h=c.slice(1);return Array(i[l]).fill(void 0).map((g,_)=>{let E=_*n;return[f+_*r,h.map(x=>x+E)]})}))}function g_(e,t){let r=1+t();return Og(r,1+e,t).map(n=>[n[0],n.slice(1)])}function m_(e){let t=El(e).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let h=El(e,t);if(h.length==0)break;n.push({set:new Set(h),node:r()})}n.sort((h,g)=>g.set.size-h.set.size);let i=e(),o=i%3;i=i/3|0;let c=!!(i&1);i>>=1;let l=i==1,f=i==2;return{branches:n,valid:o,fe0f:c,save:l,check:f}}}function v_(){return c_(i_("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Al=v_();new Set(El(Al)),new Set(El(Al)),f_(Al),m_(Al),new ue(Sg),new Uint8Array(32).fill(0);const w_=`Ethereum Signed Message:
|
|
22
|
-
`;function Pg(e){return typeof e=="string"&&(e=uf(e)),of(K8([uf(w_),uf(String(e.length)),e]))}const y_="rlp/5.7.0";new ue(y_);const b_="address/5.7.0",Za=new ue(b_);function Mg(e){mn(e,20)||Za.throwArgumentError("invalid address","address",e),e=e.toLowerCase();const t=e.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=t[i].charCodeAt(0);const n=or(of(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(n[i>>1]&15)>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}const __=9007199254740991;function E_(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}const ff={};for(let e=0;e<10;e++)ff[String(e)]=String(e);for(let e=0;e<26;e++)ff[String.fromCharCode(65+e)]=String(10+e);const $g=Math.floor(E_(__));function A_(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(n=>ff[n]).join("");for(;t.length>=$g;){let n=t.substring(0,$g);t=parseInt(n,10)%97+t.substring(n.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function x_(e){let t=null;if(typeof e!="string"&&Za.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))e.substring(0,2)!=="0x"&&(e="0x"+e),t=Mg(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&Za.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==A_(e)&&Za.throwArgumentError("bad icap checksum","address",e),t=Z8(e.substring(4));t.length<40;)t="0"+t;t=Mg("0x"+t)}else Za.throwArgumentError("invalid address","address",e);return t}const I_="properties/5.7.0";new ue(I_);function Xa(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}new ue(Sg),new Uint8Array(32).fill(0),Ze.from(-1);const S_=Ze.from(0),C_=Ze.from(1);Ze.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ci(C_.toHexString(),32),ci(S_.toHexString(),32);var li={},_e={},tc=Ng;function Ng(e,t){if(!e)throw new Error(t||"Assertion failed")}Ng.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var df={exports:{}};typeof Object.create=="function"?df.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:df.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}};var D_=tc,O_=df.exports;_e.inherits=O_;function P_(e,t){return(e.charCodeAt(t)&64512)!==55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)===56320}function M_(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e=="string")if(t){if(t==="hex")for(e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=o&63|128):P_(e,i)?(o=65536+((o&1023)<<10)+(e.charCodeAt(++i)&1023),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=o&63|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=o&63|128)}else for(i=0;i<e.length;i++)r[i]=e[i]|0;return r}_e.toArray=M_;function $_(e){for(var t="",r=0;r<e.length;r++)t+=Rg(e[r].toString(16));return t}_e.toHex=$_;function Tg(e){var t=e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}_e.htonl=Tg;function N_(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];t==="little"&&(i=Tg(i)),r+=Lg(i.toString(16))}return r}_e.toHex32=N_;function Rg(e){return e.length===1?"0"+e:e}_e.zero2=Rg;function Lg(e){return e.length===7?"0"+e:e.length===6?"00"+e:e.length===5?"000"+e:e.length===4?"0000"+e:e.length===3?"00000"+e:e.length===2?"000000"+e:e.length===1?"0000000"+e:e}_e.zero8=Lg;function T_(e,t,r,n){var i=r-t;D_(i%4===0);for(var o=new Array(i/4),c=0,l=t;c<o.length;c++,l+=4){var f;n==="big"?f=e[l]<<24|e[l+1]<<16|e[l+2]<<8|e[l+3]:f=e[l+3]<<24|e[l+2]<<16|e[l+1]<<8|e[l],o[c]=f>>>0}return o}_e.join32=T_;function R_(e,t){for(var r=new Array(e.length*4),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];t==="big"?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=o&255):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=o&255)}return r}_e.split32=R_;function L_(e,t){return e>>>t|e<<32-t}_e.rotr32=L_;function B_(e,t){return e<<t|e>>>32-t}_e.rotl32=B_;function U_(e,t){return e+t>>>0}_e.sum32=U_;function F_(e,t,r){return e+t+r>>>0}_e.sum32_3=F_;function j_(e,t,r,n){return e+t+r+n>>>0}_e.sum32_4=j_;function k_(e,t,r,n,i){return e+t+r+n+i>>>0}_e.sum32_5=k_;function q_(e,t,r,n){var i=e[t],o=e[t+1],c=n+o>>>0,l=(c<n?1:0)+r+i;e[t]=l>>>0,e[t+1]=c}_e.sum64=q_;function z_(e,t,r,n){var i=t+n>>>0,o=(i<t?1:0)+e+r;return o>>>0}_e.sum64_hi=z_;function H_(e,t,r,n){var i=t+n;return i>>>0}_e.sum64_lo=H_;function K_(e,t,r,n,i,o,c,l){var f=0,h=t;h=h+n>>>0,f+=h<t?1:0,h=h+o>>>0,f+=h<o?1:0,h=h+l>>>0,f+=h<l?1:0;var g=e+r+i+c+f;return g>>>0}_e.sum64_4_hi=K_;function W_(e,t,r,n,i,o,c,l){var f=t+n+o+l;return f>>>0}_e.sum64_4_lo=W_;function V_(e,t,r,n,i,o,c,l,f,h){var g=0,_=t;_=_+n>>>0,g+=_<t?1:0,_=_+o>>>0,g+=_<o?1:0,_=_+l>>>0,g+=_<l?1:0,_=_+h>>>0,g+=_<h?1:0;var E=e+r+i+c+f+g;return E>>>0}_e.sum64_5_hi=V_;function G_(e,t,r,n,i,o,c,l,f,h){var g=t+n+o+l+h;return g>>>0}_e.sum64_5_lo=G_;function Y_(e,t,r){var n=t<<32-r|e>>>r;return n>>>0}_e.rotr64_hi=Y_;function Q_(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}_e.rotr64_lo=Q_;function J_(e,t,r){return e>>>r}_e.shr64_hi=J_;function Z_(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}_e.shr64_lo=Z_;var Ko={},Bg=_e,X_=tc;function xl(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Ko.BlockHash=xl,xl.prototype.update=function(e,t){if(e=Bg.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),this.pending.length===0&&(this.pending=null),e=Bg.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},xl.prototype.digest=function(e){return this.update(this._pad()),X_(this.pending===null),this._digest(e)},xl.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,this.endian==="big"){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=e&255}else for(n[i++]=e&255,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var Wo={},ui={},t4=_e,hi=t4.rotr32;function e4(e,t,r,n){if(e===0)return Ug(t,r,n);if(e===1||e===3)return jg(t,r,n);if(e===2)return Fg(t,r,n)}ui.ft_1=e4;function Ug(e,t,r){return e&t^~e&r}ui.ch32=Ug;function Fg(e,t,r){return e&t^e&r^t&r}ui.maj32=Fg;function jg(e,t,r){return e^t^r}ui.p32=jg;function r4(e){return hi(e,2)^hi(e,13)^hi(e,22)}ui.s0_256=r4;function n4(e){return hi(e,6)^hi(e,11)^hi(e,25)}ui.s1_256=n4;function i4(e){return hi(e,7)^hi(e,18)^e>>>3}ui.g0_256=i4;function s4(e){return hi(e,17)^hi(e,19)^e>>>10}ui.g1_256=s4;var Vo=_e,o4=Ko,a4=ui,pf=Vo.rotl32,ec=Vo.sum32,c4=Vo.sum32_5,l4=a4.ft_1,kg=o4.BlockHash,u4=[1518500249,1859775393,2400959708,3395469782];function fi(){if(!(this instanceof fi))return new fi;kg.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Vo.inherits(fi,kg);var h4=fi;fi.blockSize=512,fi.outSize=160,fi.hmacStrength=80,fi.padLength=64,fi.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=pf(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],c=this.h[2],l=this.h[3],f=this.h[4];for(n=0;n<r.length;n++){var h=~~(n/20),g=c4(pf(i,5),l4(h,o,c,l),f,r[n],u4[h]);f=l,l=c,c=pf(o,30),o=i,i=g}this.h[0]=ec(this.h[0],i),this.h[1]=ec(this.h[1],o),this.h[2]=ec(this.h[2],c),this.h[3]=ec(this.h[3],l),this.h[4]=ec(this.h[4],f)},fi.prototype._digest=function(e){return e==="hex"?Vo.toHex32(this.h,"big"):Vo.split32(this.h,"big")};var Go=_e,f4=Ko,Yo=ui,d4=tc,Jn=Go.sum32,p4=Go.sum32_4,g4=Go.sum32_5,m4=Yo.ch32,v4=Yo.maj32,w4=Yo.s0_256,y4=Yo.s1_256,b4=Yo.g0_256,_4=Yo.g1_256,qg=f4.BlockHash,E4=[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 di(){if(!(this instanceof di))return new di;qg.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=E4,this.W=new Array(64)}Go.inherits(di,qg);var zg=di;di.blockSize=512,di.outSize=256,di.hmacStrength=192,di.padLength=64,di.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=p4(_4(r[n-2]),r[n-7],b4(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],c=this.h[2],l=this.h[3],f=this.h[4],h=this.h[5],g=this.h[6],_=this.h[7];for(d4(this.k.length===r.length),n=0;n<r.length;n++){var E=g4(_,y4(f),m4(f,h,g),this.k[n],r[n]),x=Jn(w4(i),v4(i,o,c));_=g,g=h,h=f,f=Jn(l,E),l=c,c=o,o=i,i=Jn(E,x)}this.h[0]=Jn(this.h[0],i),this.h[1]=Jn(this.h[1],o),this.h[2]=Jn(this.h[2],c),this.h[3]=Jn(this.h[3],l),this.h[4]=Jn(this.h[4],f),this.h[5]=Jn(this.h[5],h),this.h[6]=Jn(this.h[6],g),this.h[7]=Jn(this.h[7],_)},di.prototype._digest=function(e){return e==="hex"?Go.toHex32(this.h,"big"):Go.split32(this.h,"big")};var gf=_e,Hg=zg;function ji(){if(!(this instanceof ji))return new ji;Hg.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}gf.inherits(ji,Hg);var A4=ji;ji.blockSize=512,ji.outSize=224,ji.hmacStrength=192,ji.padLength=64,ji.prototype._digest=function(e){return e==="hex"?gf.toHex32(this.h.slice(0,7),"big"):gf.split32(this.h.slice(0,7),"big")};var tn=_e,x4=Ko,I4=tc,pi=tn.rotr64_hi,gi=tn.rotr64_lo,Kg=tn.shr64_hi,Wg=tn.shr64_lo,ls=tn.sum64,mf=tn.sum64_hi,vf=tn.sum64_lo,S4=tn.sum64_4_hi,C4=tn.sum64_4_lo,D4=tn.sum64_5_hi,O4=tn.sum64_5_lo,Vg=x4.BlockHash,P4=[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 Zn(){if(!(this instanceof Zn))return new Zn;Vg.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=P4,this.W=new Array(160)}tn.inherits(Zn,Vg);var Gg=Zn;Zn.blockSize=1024,Zn.outSize=512,Zn.hmacStrength=192,Zn.padLength=128,Zn.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=k4(r[n-4],r[n-3]),o=q4(r[n-4],r[n-3]),c=r[n-14],l=r[n-13],f=F4(r[n-30],r[n-29]),h=j4(r[n-30],r[n-29]),g=r[n-32],_=r[n-31];r[n]=S4(i,o,c,l,f,h,g,_),r[n+1]=C4(i,o,c,l,f,h,g,_)}},Zn.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],c=this.h[3],l=this.h[4],f=this.h[5],h=this.h[6],g=this.h[7],_=this.h[8],E=this.h[9],x=this.h[10],I=this.h[11],F=this.h[12],W=this.h[13],Y=this.h[14],B=this.h[15];I4(this.k.length===r.length);for(var z=0;z<r.length;z+=2){var P=Y,U=B,j=B4(_,E),m=U4(_,E),$=M4(_,E,x,I,F),et=$4(_,E,x,I,F,W),tt=this.k[z],nt=this.k[z+1],dt=r[z],d=r[z+1],p=D4(P,U,j,m,$,et,tt,nt,dt,d),b=O4(P,U,j,m,$,et,tt,nt,dt,d);P=R4(n,i),U=L4(n,i),j=N4(n,i,o,c,l),m=T4(n,i,o,c,l,f);var C=mf(P,U,j,m),O=vf(P,U,j,m);Y=F,B=W,F=x,W=I,x=_,I=E,_=mf(h,g,p,b),E=vf(g,g,p,b),h=l,g=f,l=o,f=c,o=n,c=i,n=mf(p,b,C,O),i=vf(p,b,C,O)}ls(this.h,0,n,i),ls(this.h,2,o,c),ls(this.h,4,l,f),ls(this.h,6,h,g),ls(this.h,8,_,E),ls(this.h,10,x,I),ls(this.h,12,F,W),ls(this.h,14,Y,B)},Zn.prototype._digest=function(e){return e==="hex"?tn.toHex32(this.h,"big"):tn.split32(this.h,"big")};function M4(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function $4(e,t,r,n,i,o){var c=t&n^~t&o;return c<0&&(c+=4294967296),c}function N4(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function T4(e,t,r,n,i,o){var c=t&n^t&o^n&o;return c<0&&(c+=4294967296),c}function R4(e,t){var r=pi(e,t,28),n=pi(t,e,2),i=pi(t,e,7),o=r^n^i;return o<0&&(o+=4294967296),o}function L4(e,t){var r=gi(e,t,28),n=gi(t,e,2),i=gi(t,e,7),o=r^n^i;return o<0&&(o+=4294967296),o}function B4(e,t){var r=pi(e,t,14),n=pi(e,t,18),i=pi(t,e,9),o=r^n^i;return o<0&&(o+=4294967296),o}function U4(e,t){var r=gi(e,t,14),n=gi(e,t,18),i=gi(t,e,9),o=r^n^i;return o<0&&(o+=4294967296),o}function F4(e,t){var r=pi(e,t,1),n=pi(e,t,8),i=Kg(e,t,7),o=r^n^i;return o<0&&(o+=4294967296),o}function j4(e,t){var r=gi(e,t,1),n=gi(e,t,8),i=Wg(e,t,7),o=r^n^i;return o<0&&(o+=4294967296),o}function k4(e,t){var r=pi(e,t,19),n=pi(t,e,29),i=Kg(e,t,6),o=r^n^i;return o<0&&(o+=4294967296),o}function q4(e,t){var r=gi(e,t,19),n=gi(t,e,29),i=Wg(e,t,6),o=r^n^i;return o<0&&(o+=4294967296),o}var wf=_e,Yg=Gg;function ki(){if(!(this instanceof ki))return new ki;Yg.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}wf.inherits(ki,Yg);var z4=ki;ki.blockSize=1024,ki.outSize=384,ki.hmacStrength=192,ki.padLength=128,ki.prototype._digest=function(e){return e==="hex"?wf.toHex32(this.h.slice(0,12),"big"):wf.split32(this.h.slice(0,12),"big")},Wo.sha1=h4,Wo.sha224=A4,Wo.sha256=zg,Wo.sha384=z4,Wo.sha512=Gg;var Qg={},zs=_e,H4=Ko,Il=zs.rotl32,Jg=zs.sum32,rc=zs.sum32_3,Zg=zs.sum32_4,Xg=H4.BlockHash;function mi(){if(!(this instanceof mi))return new mi;Xg.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}zs.inherits(mi,Xg),Qg.ripemd160=mi,mi.blockSize=512,mi.outSize=160,mi.hmacStrength=192,mi.padLength=64,mi.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],c=this.h[4],l=r,f=n,h=i,g=o,_=c,E=0;E<80;E++){var x=Jg(Il(Zg(r,tm(E,n,i,o),e[V4[E]+t],K4(E)),Y4[E]),c);r=c,c=o,o=Il(i,10),i=n,n=x,x=Jg(Il(Zg(l,tm(79-E,f,h,g),e[G4[E]+t],W4(E)),Q4[E]),_),l=_,_=g,g=Il(h,10),h=f,f=x}x=rc(this.h[1],i,g),this.h[1]=rc(this.h[2],o,_),this.h[2]=rc(this.h[3],c,l),this.h[3]=rc(this.h[4],r,f),this.h[4]=rc(this.h[0],n,h),this.h[0]=x},mi.prototype._digest=function(e){return e==="hex"?zs.toHex32(this.h,"little"):zs.split32(this.h,"little")};function tm(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function K4(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function W4(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}var V4=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],G4=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Y4=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Q4=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],J4=_e,Z4=tc;function Qo(e,t,r){if(!(this instanceof Qo))return new Qo(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(J4.toArray(t,r))}var X4=Qo;Qo.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),Z4(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=new this.Hash().update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=new this.Hash().update(e)},Qo.prototype.update=function(e,t){return this.inner.update(e,t),this},Qo.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=e;t.utils=_e,t.common=Ko,t.sha=Wo,t.ripemd=Qg,t.hmac=X4,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(li);function Jo(e,t,r){return r={path:t,exports:{},require:function(n,i){return tE(n,i??r.path)}},e(r,r.exports),r.exports}function tE(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var yf=em;function em(e,t){if(!e)throw new Error(t||"Assertion failed")}em.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Xn=Jo(function(e,t){var r=t;function n(c,l){if(Array.isArray(c))return c.slice();if(!c)return[];var f=[];if(typeof c!="string"){for(var h=0;h<c.length;h++)f[h]=c[h]|0;return f}if(l==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var h=0;h<c.length;h+=2)f.push(parseInt(c[h]+c[h+1],16))}else for(var h=0;h<c.length;h++){var g=c.charCodeAt(h),_=g>>8,E=g&255;_?f.push(_,E):f.push(E)}return f}r.toArray=n;function i(c){return c.length===1?"0"+c:c}r.zero2=i;function o(c){for(var l="",f=0;f<c.length;f++)l+=i(c[f].toString(16));return l}r.toHex=o,r.encode=function(c,l){return l==="hex"?o(c):c}}),vn=Jo(function(e,t){var r=t;r.assert=yf,r.toArray=Xn.toArray,r.zero2=Xn.zero2,r.toHex=Xn.toHex,r.encode=Xn.encode;function n(f,h,g){var _=new Array(Math.max(f.bitLength(),g)+1);_.fill(0);for(var E=1<<h+1,x=f.clone(),I=0;I<_.length;I++){var F,W=x.andln(E-1);x.isOdd()?(W>(E>>1)-1?F=(E>>1)-W:F=W,x.isubn(F)):F=0,_[I]=F,x.iushrn(1)}return _}r.getNAF=n;function i(f,h){var g=[[],[]];f=f.clone(),h=h.clone();for(var _=0,E=0,x;f.cmpn(-_)>0||h.cmpn(-E)>0;){var I=f.andln(3)+_&3,F=h.andln(3)+E&3;I===3&&(I=-1),F===3&&(F=-1);var W;I&1?(x=f.andln(7)+_&7,(x===3||x===5)&&F===2?W=-I:W=I):W=0,g[0].push(W);var Y;F&1?(x=h.andln(7)+E&7,(x===3||x===5)&&I===2?Y=-F:Y=F):Y=0,g[1].push(Y),2*_===W+1&&(_=1-_),2*E===Y+1&&(E=1-E),f.iushrn(1),h.iushrn(1)}return g}r.getJSF=i;function o(f,h,g){var _="_"+h;f.prototype[h]=function(){return this[_]!==void 0?this[_]:this[_]=g.call(this)}}r.cachedProperty=o;function c(f){return typeof f=="string"?r.toArray(f,"hex"):f}r.parseBytes=c;function l(f){return new se(f,"hex","le")}r.intFromLE=l}),Sl=vn.getNAF,eE=vn.getJSF,Cl=vn.assert;function us(e,t){this.type=e,this.p=new se(t.p,16),this.red=t.prime?se.red(t.prime):se.mont(this.p),this.zero=new se(0).toRed(this.red),this.one=new se(1).toRed(this.red),this.two=new se(2).toRed(this.red),this.n=t.n&&new se(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Hs=us;us.prototype.point=function(){throw new Error("Not implemented")},us.prototype.validate=function(){throw new Error("Not implemented")},us.prototype._fixedNafMul=function(e,t){Cl(e.precomputed);var r=e._getDoubles(),n=Sl(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2===0?2:1);i/=3;var o=[],c,l;for(c=0;c<n.length;c+=r.step){l=0;for(var f=c+r.step-1;f>=c;f--)l=(l<<1)+n[f];o.push(l)}for(var h=this.jpoint(null,null,null),g=this.jpoint(null,null,null),_=i;_>0;_--){for(c=0;c<o.length;c++)l=o[c],l===_?g=g.mixedAdd(r.points[c]):l===-_&&(g=g.mixedAdd(r.points[c].neg()));h=h.add(g)}return h.toP()},us.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=Sl(t,r,this._bitLength),c=this.jpoint(null,null,null),l=o.length-1;l>=0;l--){for(var f=0;l>=0&&o[l]===0;l--)f++;if(l>=0&&f++,c=c.dblp(f),l<0)break;var h=o[l];Cl(h!==0),e.type==="affine"?h>0?c=c.mixedAdd(i[h-1>>1]):c=c.mixedAdd(i[-h-1>>1].neg()):h>0?c=c.add(i[h-1>>1]):c=c.add(i[-h-1>>1].neg())}return e.type==="affine"?c.toP():c},us.prototype._wnafMulAdd=function(e,t,r,n,i){var o=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0,h,g,_;for(h=0;h<n;h++){_=t[h];var E=_._getNAFPoints(e);o[h]=E.wnd,c[h]=E.points}for(h=n-1;h>=1;h-=2){var x=h-1,I=h;if(o[x]!==1||o[I]!==1){l[x]=Sl(r[x],o[x],this._bitLength),l[I]=Sl(r[I],o[I],this._bitLength),f=Math.max(l[x].length,f),f=Math.max(l[I].length,f);continue}var F=[t[x],null,null,t[I]];t[x].y.cmp(t[I].y)===0?(F[1]=t[x].add(t[I]),F[2]=t[x].toJ().mixedAdd(t[I].neg())):t[x].y.cmp(t[I].y.redNeg())===0?(F[1]=t[x].toJ().mixedAdd(t[I]),F[2]=t[x].add(t[I].neg())):(F[1]=t[x].toJ().mixedAdd(t[I]),F[2]=t[x].toJ().mixedAdd(t[I].neg()));var W=[-3,-1,-5,-7,0,7,5,1,3],Y=eE(r[x],r[I]);for(f=Math.max(Y[0].length,f),l[x]=new Array(f),l[I]=new Array(f),g=0;g<f;g++){var B=Y[0][g]|0,z=Y[1][g]|0;l[x][g]=W[(B+1)*3+(z+1)],l[I][g]=0,c[x]=F}}var P=this.jpoint(null,null,null),U=this._wnafT4;for(h=f;h>=0;h--){for(var j=0;h>=0;){var m=!0;for(g=0;g<n;g++)U[g]=l[g][h]|0,U[g]!==0&&(m=!1);if(!m)break;j++,h--}if(h>=0&&j++,P=P.dblp(j),h<0)break;for(g=0;g<n;g++){var $=U[g];$!==0&&($>0?_=c[g][$-1>>1]:$<0&&(_=c[g][-$-1>>1].neg()),_.type==="affine"?P=P.mixedAdd(_):P=P.add(_))}}for(h=0;h<n;h++)c[h]=null;return i?P:P.toP()};function Cn(e,t){this.curve=e,this.type=t,this.precomputed=null}us.BasePoint=Cn,Cn.prototype.eq=function(){throw new Error("Not implemented")},Cn.prototype.validate=function(){return this.curve.validate(this)},us.prototype.decodePoint=function(e,t){e=vn.toArray(e,t);var r=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*r){e[0]===6?Cl(e[e.length-1]%2===0):e[0]===7&&Cl(e[e.length-1]%2===1);var n=this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));return n}else if((e[0]===2||e[0]===3)&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),e[0]===3);throw new Error("Unknown point format")},Cn.prototype.encodeCompressed=function(e){return this.encode(e,!0)},Cn.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},Cn.prototype.encode=function(e,t){return vn.encode(this._encode(t),e)},Cn.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},Cn.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1},Cn.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},Cn.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=r===1?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},Cn.prototype._getBeta=function(){return null},Cn.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var bf=Jo(function(e){typeof Object.create=="function"?e.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}}),rE=vn.assert;function Dn(e){Hs.call(this,"short",e),this.a=new se(e.a,16).toRed(this.red),this.b=new se(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}bf(Dn,Hs);var nE=Dn;Dn.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,r;if(e.beta)t=new se(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=n[0].cmp(n[1])<0?n[0]:n[1],t=t.toRed(this.red)}if(e.lambda)r=new se(e.lambda,16);else{var i=this._getEndoRoots(this.n);this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))===0?r=i[0]:(r=i[1],rE(this.g.mul(r).x.cmp(this.g.x.redMul(t))===0))}var o;return e.basis?o=e.basis.map(function(c){return{a:new se(c.a,16),b:new se(c.b,16)}}):o=this._getEndoBasis(r),{beta:t,lambda:r,basis:o}}},Dn.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:se.mont(e),r=new se(2).toRed(t).redInvm(),n=r.redNeg(),i=new se(3).toRed(t).redNeg().redSqrt().redMul(r),o=n.redAdd(i).fromRed(),c=n.redSub(i).fromRed();return[o,c]},Dn.prototype._getEndoBasis=function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),r=e,n=this.n.clone(),i=new se(1),o=new se(0),c=new se(0),l=new se(1),f,h,g,_,E,x,I,F=0,W,Y;r.cmpn(0)!==0;){var B=n.div(r);W=n.sub(B.mul(r)),Y=c.sub(B.mul(i));var z=l.sub(B.mul(o));if(!g&&W.cmp(t)<0)f=I.neg(),h=i,g=W.neg(),_=Y;else if(g&&++F===2)break;I=W,n=r,r=W,c=i,i=Y,l=o,o=z}E=W.neg(),x=Y;var P=g.sqr().add(_.sqr()),U=E.sqr().add(x.sqr());return U.cmp(P)>=0&&(E=f,x=h),g.negative&&(g=g.neg(),_=_.neg()),E.negative&&(E=E.neg(),x=x.neg()),[{a:g,b:_},{a:E,b:x}]},Dn.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),c=i.mul(r.a),l=o.mul(n.a),f=i.mul(r.b),h=o.mul(n.b),g=e.sub(c).sub(l),_=f.add(h).neg();return{k1:g,k2:_}},Dn.prototype.pointFromX=function(e,t){e=new se(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(n.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},Dn.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return r.redSqr().redISub(i).cmpn(0)===0},Dn.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var c=this._endoSplit(t[o]),l=e[o],f=l._getBeta();c.k1.negative&&(c.k1.ineg(),l=l.neg(!0)),c.k2.negative&&(c.k2.ineg(),f=f.neg(!0)),n[o*2]=l,n[o*2+1]=f,i[o*2]=c.k1,i[o*2+1]=c.k2}for(var h=this._wnafMulAdd(1,n,i,o*2,r),g=0;g<o*2;g++)n[g]=null,i[g]=null;return h};function _r(e,t,r,n){Hs.BasePoint.call(this,e,"affine"),t===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new se(t,16),this.y=new se(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}bf(_r,Hs.BasePoint),Dn.prototype.point=function(e,t,r){return new _r(this,e,t,r)},Dn.prototype.pointFromJSON=function(e,t){return _r.fromJSON(this,e,t)},_r.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(i){return r.point(i.x.redMul(r.endo.beta),i.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},_r.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},_r.fromJSON=function(e,t,r){typeof t=="string"&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(c){return e.point(c[0],c[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},_r.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},_r.prototype.isInfinity=function(){return this.inf},_r.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},_r.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),c=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,c)},_r.prototype.getX=function(){return this.x.fromRed()},_r.prototype.getY=function(){return this.y.fromRed()},_r.prototype.mul=function(e){return e=new se(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},_r.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},_r.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},_r.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},_r.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(i){return i.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},_r.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Mr(e,t,r,n){Hs.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new se(0)):(this.x=new se(t,16),this.y=new se(r,16),this.z=new se(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}bf(Mr,Hs.BasePoint),Dn.prototype.jpoint=function(e,t,r){return new Mr(this,e,t,r)},Mr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},Mr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Mr.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),c=e.y.redMul(r.redMul(this.z)),l=n.redSub(i),f=o.redSub(c);if(l.cmpn(0)===0)return f.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var h=l.redSqr(),g=h.redMul(l),_=n.redMul(h),E=f.redSqr().redIAdd(g).redISub(_).redISub(_),x=f.redMul(_.redISub(E)).redISub(o.redMul(g)),I=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(E,x,I)},Mr.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),c=r.redSub(n),l=i.redSub(o);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),h=f.redMul(c),g=r.redMul(f),_=l.redSqr().redIAdd(h).redISub(g).redISub(g),E=l.redMul(g.redISub(_)).redISub(i.redMul(h)),x=this.z.redMul(c);return this.curve.jpoint(_,E,x)},Mr.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,c=this.y,l=this.z,f=l.redSqr().redSqr(),h=c.redAdd(c);for(t=0;t<e;t++){var g=o.redSqr(),_=h.redSqr(),E=_.redSqr(),x=g.redAdd(g).redIAdd(g).redIAdd(n.redMul(f)),I=o.redMul(_),F=x.redSqr().redISub(I.redAdd(I)),W=I.redISub(F),Y=x.redMul(W);Y=Y.redIAdd(Y).redISub(E);var B=h.redMul(l);t+1<e&&(f=f.redMul(E)),o=F,l=B,h=Y}return this.curve.jpoint(o,h.redMul(i),l)},Mr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Mr.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),c=this.x.redAdd(i).redSqr().redISub(n).redISub(o);c=c.redIAdd(c);var l=n.redAdd(n).redIAdd(n),f=l.redSqr().redISub(c).redISub(c),h=o.redIAdd(o);h=h.redIAdd(h),h=h.redIAdd(h),e=f,t=l.redMul(c.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var g=this.x.redSqr(),_=this.y.redSqr(),E=_.redSqr(),x=this.x.redAdd(_).redSqr().redISub(g).redISub(E);x=x.redIAdd(x);var I=g.redAdd(g).redIAdd(g),F=I.redSqr(),W=E.redIAdd(E);W=W.redIAdd(W),W=W.redIAdd(W),e=F.redISub(x).redISub(x),t=I.redMul(x.redISub(e)).redISub(W),r=this.y.redMul(this.z),r=r.redIAdd(r)}return this.curve.jpoint(e,t,r)},Mr.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),c=this.x.redAdd(i).redSqr().redISub(n).redISub(o);c=c.redIAdd(c);var l=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),f=l.redSqr().redISub(c).redISub(c);e=f;var h=o.redIAdd(o);h=h.redIAdd(h),h=h.redIAdd(h),t=l.redMul(c.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var g=this.z.redSqr(),_=this.y.redSqr(),E=this.x.redMul(_),x=this.x.redSub(g).redMul(this.x.redAdd(g));x=x.redAdd(x).redIAdd(x);var I=E.redIAdd(E);I=I.redIAdd(I);var F=I.redAdd(I);e=x.redSqr().redISub(F),r=this.y.redAdd(this.z).redSqr().redISub(_).redISub(g);var W=_.redSqr();W=W.redIAdd(W),W=W.redIAdd(W),W=W.redIAdd(W),t=x.redMul(I.redISub(e)).redISub(W)}return this.curve.jpoint(e,t,r)},Mr.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),c=r.redSqr(),l=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),f=t.redAdd(t);f=f.redIAdd(f);var h=f.redMul(c),g=l.redSqr().redISub(h.redAdd(h)),_=h.redISub(g),E=c.redSqr();E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var x=l.redMul(_).redISub(E),I=r.redAdd(r).redMul(n);return this.curve.jpoint(g,x,I)},Mr.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),c=this.x.redAdd(t).redSqr().redISub(e).redISub(n);c=c.redIAdd(c),c=c.redAdd(c).redIAdd(c),c=c.redISub(o);var l=c.redSqr(),f=n.redIAdd(n);f=f.redIAdd(f),f=f.redIAdd(f),f=f.redIAdd(f);var h=i.redIAdd(c).redSqr().redISub(o).redISub(l).redISub(f),g=t.redMul(h);g=g.redIAdd(g),g=g.redIAdd(g);var _=this.x.redMul(l).redISub(g);_=_.redIAdd(_),_=_.redIAdd(_);var E=this.y.redMul(h.redMul(f.redISub(h)).redISub(c.redMul(l)));E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var x=this.z.redAdd(c).redSqr().redISub(r).redISub(l);return this.curve.jpoint(_,E,x)},Mr.prototype.mul=function(e,t){return e=new se(e,t),this.curve._wnafMul(this,e)},Mr.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)===0},Mr.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(r)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}},Mr.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Mr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Dl=Jo(function(e,t){var r=t;r.base=Hs,r.short=nE,r.mont=null,r.edwards=null}),Ol=Jo(function(e,t){var r=t,n=vn.assert;function i(l){l.type==="short"?this.curve=new Dl.short(l):l.type==="edwards"?this.curve=new Dl.edwards(l):this.curve=new Dl.mont(l),this.g=this.curve.g,this.n=this.curve.n,this.hash=l.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function o(l,f){Object.defineProperty(r,l,{configurable:!0,enumerable:!0,get:function(){var h=new i(f);return Object.defineProperty(r,l,{configurable:!0,enumerable:!0,value:h}),h}})}o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:li.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:li.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:li.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:li.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:li.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:li.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:li.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:li.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function hs(e){if(!(this instanceof hs))return new hs(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Xn.toArray(e.entropy,e.entropyEnc||"hex"),r=Xn.toArray(e.nonce,e.nonceEnc||"hex"),n=Xn.toArray(e.pers,e.persEnc||"hex");yf(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var rm=hs;hs.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},hs.prototype._hmac=function(){return new li.hmac(this.hash,this.K)},hs.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},hs.prototype.reseed=function(e,t,r,n){typeof t!="string"&&(n=r,r=t,t=null),e=Xn.toArray(e,t),r=Xn.toArray(r,n),yf(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},hs.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(n=r,r=t,t=null),r&&(r=Xn.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(r),this._reseed++,Xn.encode(o,t)};var _f=vn.assert;function Lr(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var Ef=Lr;Lr.fromPublic=function(e,t,r){return t instanceof Lr?t:new Lr(e,{pub:t,pubEnc:r})},Lr.fromPrivate=function(e,t,r){return t instanceof Lr?t:new Lr(e,{priv:t,privEnc:r})},Lr.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Lr.prototype.getPublic=function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},Lr.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv},Lr.prototype._importPrivate=function(e,t){this.priv=new se(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},Lr.prototype._importPublic=function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?_f(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&_f(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},Lr.prototype.derive=function(e){return e.validate()||_f(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Lr.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},Lr.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},Lr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var iE=vn.assert;function Pl(e,t){if(e instanceof Pl)return e;this._importDER(e,t)||(iE(e.r&&e.s,"Signature without r or s"),this.r=new se(e.r,16),this.s=new se(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Ml=Pl;function sE(){this.place=0}function Af(e,t){var r=e[t.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,o=0,c=t.place;o<n;o++,c++)i<<=8,i|=e[c],i>>>=0;return i<=127?!1:(t.place=c,i)}function nm(e){for(var t=0,r=e.length-1;!e[t]&&!(e[t+1]&128)&&t<r;)t++;return t===0?e:e.slice(t)}Pl.prototype._importDER=function(e,t){e=vn.toArray(e,t);var r=new sE;if(e[r.place++]!==48)return!1;var n=Af(e,r);if(n===!1||n+r.place!==e.length||e[r.place++]!==2)return!1;var i=Af(e,r);if(i===!1)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,e[r.place++]!==2)return!1;var c=Af(e,r);if(c===!1||e.length!==c+r.place)return!1;var l=e.slice(r.place,c+r.place);if(o[0]===0)if(o[1]&128)o=o.slice(1);else return!1;if(l[0]===0)if(l[1]&128)l=l.slice(1);else return!1;return this.r=new se(o),this.s=new se(l),this.recoveryParam=null,!0};function xf(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(r|128);--r;)e.push(t>>>(r<<3)&255);e.push(t)}Pl.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),r[0]&128&&(r=[0].concat(r)),t=nm(t),r=nm(r);!r[0]&&!(r[1]&128);)r=r.slice(1);var n=[2];xf(n,t.length),n=n.concat(t),n.push(2),xf(n,r.length);var i=n.concat(r),o=[48];return xf(o,i.length),o=o.concat(i),vn.encode(o,e)};var oE=function(){throw new Error("unsupported")},im=vn.assert;function On(e){if(!(this instanceof On))return new On(e);typeof e=="string"&&(im(Object.prototype.hasOwnProperty.call(Ol,e),"Unknown curve "+e),e=Ol[e]),e instanceof Ol.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var aE=On;On.prototype.keyPair=function(e){return new Ef(this,e)},On.prototype.keyFromPrivate=function(e,t){return Ef.fromPrivate(this,e,t)},On.prototype.keyFromPublic=function(e,t){return Ef.fromPublic(this,e,t)},On.prototype.genKeyPair=function(e){e||(e={});for(var t=new rm({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||oE(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new se(2));;){var i=new se(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},On.prototype._truncateToN=function(e,t){var r=e.byteLength()*8-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},On.prototype.sign=function(e,t,r,n){typeof r=="object"&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new se(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),c=e.toArray("be",i),l=new rm({hash:this.hash,entropy:o,nonce:c,pers:n.pers,persEnc:n.persEnc||"utf8"}),f=this.n.sub(new se(1)),h=0;;h++){var g=n.k?n.k(h):new se(l.generate(this.n.byteLength()));if(g=this._truncateToN(g,!0),!(g.cmpn(1)<=0||g.cmp(f)>=0)){var _=this.g.mul(g);if(!_.isInfinity()){var E=_.getX(),x=E.umod(this.n);if(x.cmpn(0)!==0){var I=g.invm(this.n).mul(x.mul(t.getPrivate()).iadd(e));if(I=I.umod(this.n),I.cmpn(0)!==0){var F=(_.getY().isOdd()?1:0)|(E.cmp(x)!==0?2:0);return n.canonical&&I.cmp(this.nh)>0&&(I=this.n.sub(I),F^=1),new Ml({r:x,s:I,recoveryParam:F})}}}}}},On.prototype.verify=function(e,t,r,n){e=this._truncateToN(new se(e,16)),r=this.keyFromPublic(r,n),t=new Ml(t,"hex");var i=t.r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var c=o.invm(this.n),l=c.mul(e).umod(this.n),f=c.mul(i).umod(this.n),h;return this.curve._maxwellTrick?(h=this.g.jmulAdd(l,r.getPublic(),f),h.isInfinity()?!1:h.eqXToP(i)):(h=this.g.mulAdd(l,r.getPublic(),f),h.isInfinity()?!1:h.getX().umod(this.n).cmp(i)===0)},On.prototype.recoverPubKey=function(e,t,r,n){im((3&r)===r,"The recovery param is more than two bits"),t=new Ml(t,n);var i=this.n,o=new se(e),c=t.r,l=t.s,f=r&1,h=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");h?c=this.curve.pointFromX(c.add(this.curve.n),f):c=this.curve.pointFromX(c,f);var g=t.r.invm(i),_=i.sub(o).mul(g).umod(i),E=l.mul(g).umod(i);return this.g.mulAdd(_,c,E)},On.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new Ml(t,n),t.recoveryParam!==null)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch{continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var cE=Jo(function(e,t){var r=t;r.version="6.5.4",r.utils=vn,r.rand=function(){throw new Error("unsupported")},r.curve=Dl,r.curves=Ol,r.ec=aE,r.eddsa=null}),lE=cE.ec;const uE="signing-key/5.7.0",If=new ue(uE);let Sf=null;function vi(){return Sf||(Sf=new lE("secp256k1")),Sf}class hE{constructor(t){Xa(this,"curve","secp256k1"),Xa(this,"privateKey",kr(t)),V8(this.privateKey)!==32&&If.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=vi().keyFromPrivate(or(this.privateKey));Xa(this,"publicKey","0x"+r.getPublic(!1,"hex")),Xa(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),Xa(this,"_isSigningKey",!0)}_addPoint(t){const r=vi().keyFromPublic(or(this.publicKey)),n=vi().keyFromPublic(or(t));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(t){const r=vi().keyFromPrivate(or(this.privateKey)),n=or(t);n.length!==32&&If.throwArgumentError("bad digest length","digest",t);const i=r.sign(n,{canonical:!0});return pg({recoveryParam:i.recoveryParam,r:ci("0x"+i.r.toString(16),32),s:ci("0x"+i.s.toString(16),32)})}computeSharedSecret(t){const r=vi().keyFromPrivate(or(this.privateKey)),n=vi().keyFromPublic(or(sm(t)));return ci("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(t){return!!(t&&t._isSigningKey)}}function fE(e,t){const r=pg(t),n={r:or(r.r),s:or(r.s)};return"0x"+vi().recoverPubKey(or(e),n,r.recoveryParam).encode("hex",!1)}function sm(e,t){const r=or(e);if(r.length===32){const n=new hE(r);return t?"0x"+vi().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return t?kr(r):"0x"+vi().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return t?"0x"+vi().keyFromPublic(r).getPublic(!0,"hex"):kr(r)}return If.throwArgumentError("invalid public or private key","key","[REDACTED]")}const dE="transactions/5.7.0";new ue(dE);var om;(function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"})(om||(om={}));function pE(e){const t=sm(e);return x_(dg(of(dg(t,1)),12))}function gE(e,t){return pE(fE(or(e),t))}const mE="https://rpc.walletconnect.com/v1";async function vE(e,t,r,n,i,o){switch(r.t){case"eip191":return wE(e,t,r.s);case"eip1271":return await yE(e,t,r.s,n,i,o);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function wE(e,t,r){return gE(Pg(t),r).toLowerCase()===e.toLowerCase()}async function yE(e,t,r,n,i,o){try{const c="0x1626ba7e",l="0000000000000000000000000000000000000000000000000000000000000040",f="0000000000000000000000000000000000000000000000000000000000000041",h=r.substring(2),g=Pg(t).substring(2),_=c+g+l+f+h,E=await fetch(`${o||mE}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:bE(),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:_},"latest"]})}),{result:x}=await E.json();return x?x.slice(0,c.length).toLowerCase()===c.toLowerCase():!1}catch(c){return console.error("isValidEip1271Signature: ",c),!1}}function bE(){return Date.now()+Math.floor(Math.random()*1e3)}var _E=Object.defineProperty,EE=Object.defineProperties,AE=Object.getOwnPropertyDescriptors,am=Object.getOwnPropertySymbols,xE=Object.prototype.hasOwnProperty,IE=Object.prototype.propertyIsEnumerable,cm=(e,t,r)=>t in e?_E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SE=(e,t)=>{for(var r in t||(t={}))xE.call(t,r)&&cm(e,r,t[r]);if(am)for(var r of am(t))IE.call(t,r)&&cm(e,r,t[r]);return e},CE=(e,t)=>EE(e,AE(t));const DE="did:pkh:",Cf=e=>e?.split(":"),lm=e=>{const t=e&&Cf(e);if(t)return e.includes(DE)?t[3]:t[1]},um=e=>{const t=e&&Cf(e);if(t)return t[2]+":"+t[3]},$l=e=>{const t=e&&Cf(e);if(t)return t.pop()};async function hm(e){const{cacao:t,projectId:r}=e,{s:n,p:i}=t,o=fm(i,i.iss),c=$l(i.iss);return await vE(c,o,n,lm(i.iss),r)}const fm=(e,t)=>{const r=`${e.domain} wants you to sign in with your Ethereum account:`,n=$l(t);if(!e.aud&&!e.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=e.statement||void 0;const o=`URI: ${e.aud||e.uri}`,c=`Version: ${e.version}`,l=`Chain ID: ${lm(t)}`,f=`Nonce: ${e.nonce}`,h=`Issued At: ${e.iat}`,g=e.exp?`Expiration Time: ${e.exp}`:void 0,_=e.nbf?`Not Before: ${e.nbf}`:void 0,E=e.requestId?`Request ID: ${e.requestId}`:void 0,x=e.resources?`Resources:${e.resources.map(F=>`
|
|
23
|
-
- ${
|
|
24
|
-
`)};function OE(e){return Buffer.from(JSON.stringify(e)).toString("base64")}function PE(e){return JSON.parse(Buffer.from(e,"base64").toString("utf-8"))}function Ks(e){if(!e)throw new Error("No recap provided, value is undefined");if(!e.att)throw new Error("No `att` property found");const t=Object.keys(e.att);if(!(t!=null&&t.length))throw new Error("No resources found in `att` property");t.forEach(r=>{const n=e.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(i=>{const o=n[i];if(!Array.isArray(o))throw new Error(`Ability limits ${i} must be an array of objects, found: ${o}`);if(!o.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);o.forEach(c=>{if(typeof c!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${c}`)})})})}function ME(e,t,r,n={}){return r?.sort((i,o)=>i.localeCompare(o)),{att:{[e]:$E(t,r,n)}}}function $E(e,t,r={}){t=t?.sort((i,o)=>i.localeCompare(o));const n=t.map(i=>({[`${e}/${i}`]:[r]}));return Object.assign({},...n)}function dm(e){return Ks(e),`urn:recap:${OE(e).replace(/=/g,"")}`}function nc(e){const t=PE(e.replace("urn:recap:",""));return Ks(t),t}function NE(e,t,r){const n=ME(e,t,r);return dm(n)}function TE(e){return e&&e.includes("urn:recap:")}function RE(e,t){const r=nc(e),n=nc(t),i=LE(r,n);return dm(i)}function LE(e,t){Ks(e),Ks(t);const r=Object.keys(e.att).concat(Object.keys(t.att)).sort((i,o)=>i.localeCompare(o)),n={att:{}};return r.forEach(i=>{var o,c;Object.keys(((o=e.att)==null?void 0:o[i])||{}).concat(Object.keys(((c=t.att)==null?void 0:c[i])||{})).sort((l,f)=>l.localeCompare(f)).forEach(l=>{var f,h;n.att[i]=CE(SE({},n.att[i]),{[l]:((f=e.att[i])==null?void 0:f[l])||((h=t.att[i])==null?void 0:h[l])})})}),n}function BE(e="",t){Ks(t);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(r))return e;const n=[];let i=0;Object.keys(t.att).forEach(l=>{const f=Object.keys(t.att[l]).map(_=>({ability:_.split("/")[0],action:_.split("/")[1]}));f.sort((_,E)=>_.action.localeCompare(E.action));const h={};f.forEach(_=>{h[_.ability]||(h[_.ability]=[]),h[_.ability].push(_.action)});const g=Object.keys(h).map(_=>(i++,`(${i}) '${_}': '${h[_].join("', '")}' for '${l}'.`));n.push(g.join(", ").replace(".,","."))});const o=n.join(" "),c=`${r}${o}`;return`${e?e+" ":""}${c}`}function pm(e){var t;const r=nc(e);Ks(r);const n=(t=r.att)==null?void 0:t.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function gm(e){const t=nc(e);Ks(t);const r=[];return Object.values(t.att).forEach(n=>{Object.values(n).forEach(i=>{var o;(o=i?.[0])!=null&&o.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function Nl(e){if(!e)return;const t=e?.[e.length-1];return TE(t)?t:void 0}const mm="base10",zr="base16",Df="base64pad",Of="utf8",vm=0,qi=1,UE=0,wm=1,Pf=12,Mf=32;function FE(){const e=Zh.generateKeyPair();return{privateKey:Yn(e.secretKey,zr),publicKey:Yn(e.publicKey,zr)}}function $f(){const e=Lo.randomBytes(Mf);return Yn(e,zr)}function jE(e,t){const r=Zh.sharedKey(Gn(e,zr),Gn(t,zr),!0),n=new K6(ml.SHA256,r).expand(Mf);return Yn(n,zr)}function Tl(e){const t=ml.hash(Gn(e,zr));return Yn(t,zr)}function Ws(e){const t=ml.hash(Gn(e,Of));return Yn(t,zr)}function kE(e){return Gn(`${e}`,mm)}function ic(e){return Number(Yn(e,mm))}function qE(e){const t=kE(typeof e.type<"u"?e.type:vm);if(ic(t)===qi&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof e.senderPublicKey<"u"?Gn(e.senderPublicKey,zr):void 0,n=typeof e.iv<"u"?Gn(e.iv,zr):Lo.randomBytes(Pf),i=new Kh.ChaCha20Poly1305(Gn(e.symKey,zr)).seal(n,Gn(e.message,Of));return HE({type:t,sealed:i,iv:n,senderPublicKey:r})}function zE(e){const t=new Kh.ChaCha20Poly1305(Gn(e.symKey,zr)),{sealed:r,iv:n}=Rl(e.encoded),i=t.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Yn(i,Of)}function HE(e){if(ic(e.type)===qi){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Yn($1([e.type,e.senderPublicKey,e.iv,e.sealed]),Df)}return Yn($1([e.type,e.iv,e.sealed]),Df)}function Rl(e){const t=Gn(e,Df),r=t.slice(UE,wm),n=wm;if(ic(r)===qi){const l=n+Mf,f=l+Pf,h=t.slice(n,l),g=t.slice(l,f),_=t.slice(f);return{type:r,sealed:_,iv:g,senderPublicKey:h}}const i=n+Pf,o=t.slice(n,i),c=t.slice(i);return{type:r,sealed:c,iv:o}}function KE(e,t){const r=Rl(e);return ym({type:ic(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Yn(r.senderPublicKey,zr):void 0,receiverPublicKey:t?.receiverPublicKey})}function ym(e){const t=e?.type||vm;if(t===qi){if(typeof e?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function bm(e){return e.type===qi&&typeof e.senderPublicKey=="string"&&typeof e.receiverPublicKey=="string"}const WE="irn";function Nf(e){return e?.relay||{protocol:WE}}function sc(e){const t=_8[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}var VE=Object.defineProperty,GE=Object.defineProperties,YE=Object.getOwnPropertyDescriptors,_m=Object.getOwnPropertySymbols,QE=Object.prototype.hasOwnProperty,JE=Object.prototype.propertyIsEnumerable,Em=(e,t,r)=>t in e?VE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Am=(e,t)=>{for(var r in t||(t={}))QE.call(t,r)&&Em(e,r,t[r]);if(_m)for(var r of _m(t))JE.call(t,r)&&Em(e,r,t[r]);return e},ZE=(e,t)=>GE(e,YE(t));function XE(e,t="-"){const r={},n="relay"+t;return Object.keys(e).forEach(i=>{if(i.startsWith(n)){const o=i.replace(n,""),c=e[i];r[o]=c}}),r}function xm(e){e=e.includes("wc://")?e.replace("wc://",""):e,e=e.includes("wc:")?e.replace("wc:",""):e;const t=e.indexOf(":"),r=e.indexOf("?")!==-1?e.indexOf("?"):void 0,n=e.substring(0,t),i=e.substring(t+1,r).split("@"),o=typeof r<"u"?e.substring(r):"",c=za.parse(o),l=typeof c.methods=="string"?c.methods.split(","):void 0;return{protocol:n,topic:tA(i[0]),version:parseInt(i[1],10),symKey:c.symKey,relay:XE(c),methods:l,expiryTimestamp:c.expiryTimestamp?parseInt(c.expiryTimestamp,10):void 0}}function tA(e){return e.startsWith("//")?e.substring(2):e}function eA(e,t="-"){const r="relay",n={};return Object.keys(e).forEach(i=>{const o=r+t+i;e[i]&&(n[o]=e[i])}),n}function rA(e){return`${e.protocol}:${e.topic}@${e.version}?`+za.stringify(Am(ZE(Am({symKey:e.symKey},eA(e.relay)),{expiryTimestamp:e.expiryTimestamp}),e.methods?{methods:e.methods.join(",")}:{}))}function Zo(e){const t=[];return e.forEach(r=>{const[n,i]=r.split(":");t.push(`${n}:${i}`)}),t}function nA(e){const t=[];return Object.values(e).forEach(r=>{t.push(...Zo(r.accounts))}),t}function iA(e,t){const r=[];return Object.values(e).forEach(n=>{Zo(n.accounts).includes(t)&&r.push(...n.methods)}),r}function sA(e,t){const r=[];return Object.values(e).forEach(n=>{Zo(n.accounts).includes(t)&&r.push(...n.events)}),r}function Tf(e){return e.includes(":")}function oc(e){return Tf(e)?e.split(":")[0]:e}function oA(e){const t={};return e?.forEach(r=>{const[n,i]=r.split(":");t[n]||(t[n]={accounts:[],chains:[],events:[]}),t[n].accounts.push(r),t[n].chains.push(`${n}:${i}`)}),t}function Im(e,t){t=t.map(n=>n.replace("did:pkh:",""));const r=oA(t);for(const[n,i]of Object.entries(r))i.methods?i.methods=wl(i.methods,e):i.methods=e,i.events=["chainChanged","accountsChanged"];return r}const aA={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}},cA={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 mt(e,t){const{message:r,code:n}=cA[e];return{message:t?`${r} ${t}`:r,code:n}}function Ue(e,t){const{message:r,code:n}=aA[e];return{message:t?`${r} ${t}`:r,code:n}}function wi(e,t){return Array.isArray(e)?typeof t<"u"&&e.length?e.every(t):!0:!1}function ac(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function Hr(e){return typeof e>"u"}function ur(e,t){return t&&Hr(e)?!0:typeof e=="string"&&!!e.trim().length}function Rf(e,t){return t&&Hr(e)?!0:typeof e=="number"&&!isNaN(e)}function lA(e,t){const{requiredNamespaces:r}=t,n=Object.keys(e.namespaces),i=Object.keys(r);let o=!0;return ks(i,n)?(n.forEach(c=>{const{accounts:l,methods:f,events:h}=e.namespaces[c],g=Zo(l),_=r[c];(!ks(Q1(c,_),g)||!ks(_.methods,f)||!ks(_.events,h))&&(o=!1)}),o):!1}function Ll(e){return ur(e,!1)&&e.includes(":")?e.split(":").length===2:!1}function uA(e){if(ur(e,!1)&&e.includes(":")){const t=e.split(":");if(t.length===3){const r=t[0]+":"+t[1];return!!t[2]&&Ll(r)}}return!1}function hA(e){if(ur(e,!1))try{return typeof new URL(e)<"u"}catch{return!1}return!1}function fA(e){var t;return(t=e?.proposer)==null?void 0:t.publicKey}function dA(e){return e?.topic}function pA(e,t){let r=null;return ur(e?.publicKey,!1)||(r=mt("MISSING_OR_INVALID",`${t} controller public key should be a string`)),r}function Sm(e){let t=!0;return wi(e)?e.length&&(t=e.every(r=>ur(r,!1))):t=!1,t}function gA(e,t,r){let n=null;return wi(t)&&t.length?t.forEach(i=>{n||Ll(i)||(n=Ue("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):Ll(e)||(n=Ue("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 mA(e,t,r){let n=null;return Object.entries(e).forEach(([i,o])=>{if(n)return;const c=gA(i,Q1(i,o),`${t} ${r}`);c&&(n=c)}),n}function vA(e,t){let r=null;return wi(e)?e.forEach(n=>{r||uA(n)||(r=Ue("UNSUPPORTED_ACCOUNTS",`${t}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Ue("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function wA(e,t){let r=null;return Object.values(e).forEach(n=>{if(r)return;const i=vA(n?.accounts,`${t} namespace`);i&&(r=i)}),r}function yA(e,t){let r=null;return Sm(e?.methods)?Sm(e?.events)||(r=Ue("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):r=Ue("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),r}function Cm(e,t){let r=null;return Object.values(e).forEach(n=>{if(r)return;const i=yA(n,`${t}, namespace`);i&&(r=i)}),r}function bA(e,t,r){let n=null;if(e&&ac(e)){const i=Cm(e,t);i&&(n=i);const o=mA(e,t,r);o&&(n=o)}else n=mt("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return n}function Lf(e,t){let r=null;if(e&&ac(e)){const n=Cm(e,t);n&&(r=n);const i=wA(e,t);i&&(r=i)}else r=mt("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function Dm(e){return ur(e.protocol,!0)}function _A(e,t){let r=!1;return t&&!e?r=!0:e&&wi(e)&&e.length&&e.forEach(n=>{r=Dm(n)}),r}function EA(e){return typeof e=="number"}function en(e){return typeof e<"u"&&typeof e!==null}function AA(e){return!(!e||typeof e!="object"||!e.code||!Rf(e.code,!1)||!e.message||!ur(e.message,!1))}function xA(e){return!(Hr(e)||!ur(e.method,!1))}function IA(e){return!(Hr(e)||Hr(e.result)&&Hr(e.error)||!Rf(e.id,!1)||!ur(e.jsonrpc,!1))}function SA(e){return!(Hr(e)||!ur(e.name,!1))}function Om(e,t){return!(!Ll(t)||!nA(e).includes(t))}function CA(e,t,r){return ur(r,!1)?iA(e,t).includes(r):!1}function DA(e,t,r){return ur(r,!1)?sA(e,t).includes(r):!1}function Pm(e,t,r){let n=null;const i=OA(e),o=PA(t),c=Object.keys(i),l=Object.keys(o),f=Mm(Object.keys(e)),h=Mm(Object.keys(t)),g=f.filter(_=>!h.includes(_));return g.length&&(n=mt("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
25
|
-
Required: ${
|
|
26
|
-
Received: ${Object.keys(
|
|
27
|
-
Required: ${
|
|
28
|
-
Approved: ${
|
|
21
|
+
*/(function(t){(function(){var e="input is invalid type",r="finalize already called",i=typeof window=="object",n=i?window:{};n.JS_SHA3_NO_WINDOW&&(i=!1);var s=!i&&typeof self=="object",a=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;a?n=kv:s&&(n=self);var u=!n.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,d=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",p="0123456789abcdef".split(""),y=[31,7936,2031616,520093696],_=[4,1024,262144,67108864],C=[1,256,65536,16777216],I=[6,1536,393216,100663296],M=[0,8,16,24],B=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],W=[224,256,384,512],Y=[128,256],q=["hex","buffer","arrayBuffer","array","digest"],V={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(O){return Object.prototype.toString.call(O)==="[object Array]"}),d&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(O){return typeof O=="object"&&O.buffer&&O.buffer.constructor===ArrayBuffer});for(var U=function(O,ie,N){return function(F){return new L(O,ie,O).update(F)[N]()}},z=function(O,ie,N){return function(F,R){return new L(O,ie,R).update(F)[N]()}},K=function(O,ie,N){return function(F,R,l,$){return h["cshake"+O].update(F,R,l,$)[N]()}},A=function(O,ie,N){return function(F,R,l,$){return h["kmac"+O].update(F,R,l,$)[N]()}},j=function(O,ie,N,F){for(var R=0;R<q.length;++R){var l=q[R];O[l]=ie(N,F,l)}return O},ee=function(O,ie){var N=U(O,ie,"hex");return N.create=function(){return new L(O,ie,O)},N.update=function(F){return N.create().update(F)},j(N,U,O,ie)},re=function(O,ie){var N=z(O,ie,"hex");return N.create=function(F){return new L(O,ie,F)},N.update=function(F,R){return N.create(R).update(F)},j(N,z,O,ie)},k=function(O,ie){var N=V[O],F=K(O,ie,"hex");return F.create=function(R,l,$){return!l&&!$?h["shake"+O].create(R):new L(O,ie,R).bytepad([l,$],N)},F.update=function(R,l,$,Z){return F.create(l,$,Z).update(R)},j(F,K,O,ie)},w=function(O,ie){var N=V[O],F=A(O,ie,"hex");return F.create=function(R,l,$){return new X(O,ie,l).bytepad(["KMAC",$],N).bytepad([R],N)},F.update=function(R,l,$,Z){return F.create(R,$,Z).update(l)},j(F,A,O,ie)},f=[{name:"keccak",padding:C,bits:W,createMethod:ee},{name:"sha3",padding:I,bits:W,createMethod:ee},{name:"shake",padding:y,bits:Y,createMethod:re},{name:"cshake",padding:_,bits:Y,createMethod:k},{name:"kmac",padding:_,bits:Y,createMethod:w}],h={},g=[],E=0;E<f.length;++E)for(var D=f[E],P=D.bits,x=0;x<P.length;++x){var v=D.name+"_"+P[x];if(g.push(v),h[v]=D.createMethod(P[x],D.padding),D.name!=="sha3"){var b=D.name+P[x];g.push(b),h[b]=h[v]}}function L(O,ie,N){this.blocks=[],this.s=[],this.padding=ie,this.outputBits=N,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(O<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=N>>5,this.extraBytes=(N&31)>>3;for(var F=0;F<50;++F)this.s[F]=0}L.prototype.update=function(O){if(this.finalized)throw new Error(r);var ie,N=typeof O;if(N!=="string"){if(N==="object"){if(O===null)throw new Error(e);if(d&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!d||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);ie=!0}for(var F=this.blocks,R=this.byteCount,l=O.length,$=this.blockCount,Z=0,ae=this.s,ue,ve;Z<l;){if(this.reset)for(this.reset=!1,F[0]=this.block,ue=1;ue<$+1;++ue)F[ue]=0;if(ie)for(ue=this.start;Z<l&&ue<R;++Z)F[ue>>2]|=O[Z]<<M[ue++&3];else for(ue=this.start;Z<l&&ue<R;++Z)ve=O.charCodeAt(Z),ve<128?F[ue>>2]|=ve<<M[ue++&3]:ve<2048?(F[ue>>2]|=(192|ve>>6)<<M[ue++&3],F[ue>>2]|=(128|ve&63)<<M[ue++&3]):ve<55296||ve>=57344?(F[ue>>2]|=(224|ve>>12)<<M[ue++&3],F[ue>>2]|=(128|ve>>6&63)<<M[ue++&3],F[ue>>2]|=(128|ve&63)<<M[ue++&3]):(ve=65536+((ve&1023)<<10|O.charCodeAt(++Z)&1023),F[ue>>2]|=(240|ve>>18)<<M[ue++&3],F[ue>>2]|=(128|ve>>12&63)<<M[ue++&3],F[ue>>2]|=(128|ve>>6&63)<<M[ue++&3],F[ue>>2]|=(128|ve&63)<<M[ue++&3]);if(this.lastByteIndex=ue,ue>=R){for(this.start=ue-R,this.block=F[$],ue=0;ue<$;++ue)ae[ue]^=F[ue];ce(ae),this.reset=!0}else this.start=ue}return this},L.prototype.encode=function(O,ie){var N=O&255,F=1,R=[N];for(O=O>>8,N=O&255;N>0;)R.unshift(N),O=O>>8,N=O&255,++F;return ie?R.push(F):R.unshift(F),this.update(R),R.length},L.prototype.encodeString=function(O){var ie,N=typeof O;if(N!=="string"){if(N==="object"){if(O===null)throw new Error(e);if(d&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!d||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);ie=!0}var F=0,R=O.length;if(ie)F=R;else for(var l=0;l<O.length;++l){var $=O.charCodeAt(l);$<128?F+=1:$<2048?F+=2:$<55296||$>=57344?F+=3:($=65536+(($&1023)<<10|O.charCodeAt(++l)&1023),F+=4)}return F+=this.encode(F*8),this.update(O),F},L.prototype.bytepad=function(O,ie){for(var N=this.encode(ie),F=0;F<O.length;++F)N+=this.encodeString(O[F]);var R=ie-N%ie,l=[];return l.length=R,this.update(l),this},L.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var O=this.blocks,ie=this.lastByteIndex,N=this.blockCount,F=this.s;if(O[ie>>2]|=this.padding[ie&3],this.lastByteIndex===this.byteCount)for(O[0]=O[N],ie=1;ie<N+1;++ie)O[ie]=0;for(O[N-1]|=2147483648,ie=0;ie<N;++ie)F[ie]^=O[ie];ce(F)}},L.prototype.toString=L.prototype.hex=function(){this.finalize();for(var O=this.blockCount,ie=this.s,N=this.outputBlocks,F=this.extraBytes,R=0,l=0,$="",Z;l<N;){for(R=0;R<O&&l<N;++R,++l)Z=ie[R],$+=p[Z>>4&15]+p[Z&15]+p[Z>>12&15]+p[Z>>8&15]+p[Z>>20&15]+p[Z>>16&15]+p[Z>>28&15]+p[Z>>24&15];l%O===0&&(ce(ie),R=0)}return F&&(Z=ie[R],$+=p[Z>>4&15]+p[Z&15],F>1&&($+=p[Z>>12&15]+p[Z>>8&15]),F>2&&($+=p[Z>>20&15]+p[Z>>16&15])),$},L.prototype.arrayBuffer=function(){this.finalize();var O=this.blockCount,ie=this.s,N=this.outputBlocks,F=this.extraBytes,R=0,l=0,$=this.outputBits>>3,Z;F?Z=new ArrayBuffer(N+1<<2):Z=new ArrayBuffer($);for(var ae=new Uint32Array(Z);l<N;){for(R=0;R<O&&l<N;++R,++l)ae[l]=ie[R];l%O===0&&ce(ie)}return F&&(ae[R]=ie[R],Z=Z.slice(0,$)),Z},L.prototype.buffer=L.prototype.arrayBuffer,L.prototype.digest=L.prototype.array=function(){this.finalize();for(var O=this.blockCount,ie=this.s,N=this.outputBlocks,F=this.extraBytes,R=0,l=0,$=[],Z,ae;l<N;){for(R=0;R<O&&l<N;++R,++l)Z=l<<2,ae=ie[R],$[Z]=ae&255,$[Z+1]=ae>>8&255,$[Z+2]=ae>>16&255,$[Z+3]=ae>>24&255;l%O===0&&ce(ie)}return F&&(Z=l<<2,ae=ie[R],$[Z]=ae&255,F>1&&($[Z+1]=ae>>8&255),F>2&&($[Z+2]=ae>>16&255)),$};function X(O,ie,N){L.call(this,O,ie,N)}X.prototype=new L,X.prototype.finalize=function(){return this.encode(this.outputBits,!0),L.prototype.finalize.call(this)};var ce=function(O){var ie,N,F,R,l,$,Z,ae,ue,ve,ge,Ee,Ye,De,Re,xe,ye,Me,Pe,pe,Se,_e,me,Te,Ce,Ae,ke,qe,Ie,Ke,ut,Je,gt,ht,ot,St,Ct,Oe,Ve,Ze,$e,Qe,Ge,Fe,nt,Xe,Le,et,rt,Ne,We,st,Be,qt,zt,lt,At,Xr,ei,ti,ri,ii,gr;for(F=0;F<48;F+=2)R=O[0]^O[10]^O[20]^O[30]^O[40],l=O[1]^O[11]^O[21]^O[31]^O[41],$=O[2]^O[12]^O[22]^O[32]^O[42],Z=O[3]^O[13]^O[23]^O[33]^O[43],ae=O[4]^O[14]^O[24]^O[34]^O[44],ue=O[5]^O[15]^O[25]^O[35]^O[45],ve=O[6]^O[16]^O[26]^O[36]^O[46],ge=O[7]^O[17]^O[27]^O[37]^O[47],Ee=O[8]^O[18]^O[28]^O[38]^O[48],Ye=O[9]^O[19]^O[29]^O[39]^O[49],ie=Ee^($<<1|Z>>>31),N=Ye^(Z<<1|$>>>31),O[0]^=ie,O[1]^=N,O[10]^=ie,O[11]^=N,O[20]^=ie,O[21]^=N,O[30]^=ie,O[31]^=N,O[40]^=ie,O[41]^=N,ie=R^(ae<<1|ue>>>31),N=l^(ue<<1|ae>>>31),O[2]^=ie,O[3]^=N,O[12]^=ie,O[13]^=N,O[22]^=ie,O[23]^=N,O[32]^=ie,O[33]^=N,O[42]^=ie,O[43]^=N,ie=$^(ve<<1|ge>>>31),N=Z^(ge<<1|ve>>>31),O[4]^=ie,O[5]^=N,O[14]^=ie,O[15]^=N,O[24]^=ie,O[25]^=N,O[34]^=ie,O[35]^=N,O[44]^=ie,O[45]^=N,ie=ae^(Ee<<1|Ye>>>31),N=ue^(Ye<<1|Ee>>>31),O[6]^=ie,O[7]^=N,O[16]^=ie,O[17]^=N,O[26]^=ie,O[27]^=N,O[36]^=ie,O[37]^=N,O[46]^=ie,O[47]^=N,ie=ve^(R<<1|l>>>31),N=ge^(l<<1|R>>>31),O[8]^=ie,O[9]^=N,O[18]^=ie,O[19]^=N,O[28]^=ie,O[29]^=N,O[38]^=ie,O[39]^=N,O[48]^=ie,O[49]^=N,De=O[0],Re=O[1],Xe=O[11]<<4|O[10]>>>28,Le=O[10]<<4|O[11]>>>28,qe=O[20]<<3|O[21]>>>29,Ie=O[21]<<3|O[20]>>>29,ti=O[31]<<9|O[30]>>>23,ri=O[30]<<9|O[31]>>>23,Qe=O[40]<<18|O[41]>>>14,Ge=O[41]<<18|O[40]>>>14,ht=O[2]<<1|O[3]>>>31,ot=O[3]<<1|O[2]>>>31,xe=O[13]<<12|O[12]>>>20,ye=O[12]<<12|O[13]>>>20,et=O[22]<<10|O[23]>>>22,rt=O[23]<<10|O[22]>>>22,Ke=O[33]<<13|O[32]>>>19,ut=O[32]<<13|O[33]>>>19,ii=O[42]<<2|O[43]>>>30,gr=O[43]<<2|O[42]>>>30,qt=O[5]<<30|O[4]>>>2,zt=O[4]<<30|O[5]>>>2,St=O[14]<<6|O[15]>>>26,Ct=O[15]<<6|O[14]>>>26,Me=O[25]<<11|O[24]>>>21,Pe=O[24]<<11|O[25]>>>21,Ne=O[34]<<15|O[35]>>>17,We=O[35]<<15|O[34]>>>17,Je=O[45]<<29|O[44]>>>3,gt=O[44]<<29|O[45]>>>3,Te=O[6]<<28|O[7]>>>4,Ce=O[7]<<28|O[6]>>>4,lt=O[17]<<23|O[16]>>>9,At=O[16]<<23|O[17]>>>9,Oe=O[26]<<25|O[27]>>>7,Ve=O[27]<<25|O[26]>>>7,pe=O[36]<<21|O[37]>>>11,Se=O[37]<<21|O[36]>>>11,st=O[47]<<24|O[46]>>>8,Be=O[46]<<24|O[47]>>>8,Fe=O[8]<<27|O[9]>>>5,nt=O[9]<<27|O[8]>>>5,Ae=O[18]<<20|O[19]>>>12,ke=O[19]<<20|O[18]>>>12,Xr=O[29]<<7|O[28]>>>25,ei=O[28]<<7|O[29]>>>25,Ze=O[38]<<8|O[39]>>>24,$e=O[39]<<8|O[38]>>>24,_e=O[48]<<14|O[49]>>>18,me=O[49]<<14|O[48]>>>18,O[0]=De^~xe&Me,O[1]=Re^~ye&Pe,O[10]=Te^~Ae&qe,O[11]=Ce^~ke&Ie,O[20]=ht^~St&Oe,O[21]=ot^~Ct&Ve,O[30]=Fe^~Xe&et,O[31]=nt^~Le&rt,O[40]=qt^~lt&Xr,O[41]=zt^~At&ei,O[2]=xe^~Me&pe,O[3]=ye^~Pe&Se,O[12]=Ae^~qe&Ke,O[13]=ke^~Ie&ut,O[22]=St^~Oe&Ze,O[23]=Ct^~Ve&$e,O[32]=Xe^~et&Ne,O[33]=Le^~rt&We,O[42]=lt^~Xr&ti,O[43]=At^~ei&ri,O[4]=Me^~pe&_e,O[5]=Pe^~Se&me,O[14]=qe^~Ke&Je,O[15]=Ie^~ut>,O[24]=Oe^~Ze&Qe,O[25]=Ve^~$e&Ge,O[34]=et^~Ne&st,O[35]=rt^~We&Be,O[44]=Xr^~ti&ii,O[45]=ei^~ri&gr,O[6]=pe^~_e&De,O[7]=Se^~me&Re,O[16]=Ke^~Je&Te,O[17]=ut^~gt&Ce,O[26]=Ze^~Qe&ht,O[27]=$e^~Ge&ot,O[36]=Ne^~st&Fe,O[37]=We^~Be&nt,O[46]=ti^~ii&qt,O[47]=ri^~gr&zt,O[8]=_e^~De&xe,O[9]=me^~Re&ye,O[18]=Je^~Te&Ae,O[19]=gt^~Ce&ke,O[28]=Qe^~ht&St,O[29]=Ge^~ot&Ct,O[38]=st^~Fe&Xe,O[39]=Be^~nt&Le,O[48]=ii^~qt<,O[49]=gr^~zt&At,O[0]^=B[F],O[1]^=B[F+1]};if(u)t.exports=h;else for(E=0;E<g.length;++E)n[g[E]]=h[g[E]]})()})(jv);var yE=jv.exports;const wE="logger/5.7.0";let qv=!1,zv=!1;const jf={debug:1,default:2,info:2,warning:3,error:4,off:5};let Hv=jf.default,W0=null;function _E(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const Kv=_E();var V0;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(V0||(V0={}));var An;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(An||(An={}));const Wv="0123456789abcdef";class Et{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const i=e.toLowerCase();jf[i]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Hv>jf[i])&&console.log.apply(console,r)}debug(...e){this._log(Et.levels.DEBUG,e)}info(...e){this._log(Et.levels.INFO,e)}warn(...e){this._log(Et.levels.WARNING,e)}makeError(e,r,i){if(zv)return this.makeError("censored error",r,{});r||(r=Et.errors.UNKNOWN_ERROR),i||(i={});const n=[];Object.keys(i).forEach(d=>{const p=i[d];try{if(p instanceof Uint8Array){let y="";for(let _=0;_<p.length;_++)y+=Wv[p[_]>>4],y+=Wv[p[_]&15];n.push(d+"=Uint8Array(0x"+y+")")}else n.push(d+"="+JSON.stringify(p))}catch{n.push(d+"="+JSON.stringify(i[d].toString()))}}),n.push(`code=${r}`),n.push(`version=${this.version}`);const s=e;let a="";switch(r){case An.NUMERIC_FAULT:{a="NUMERIC_FAULT";const d=e;switch(d){case"overflow":case"underflow":case"division-by-zero":a+="-"+d;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result";break}break}case An.CALL_EXCEPTION:case An.INSUFFICIENT_FUNDS:case An.MISSING_NEW:case An.NONCE_EXPIRED:case An.REPLACEMENT_UNDERPRICED:case An.TRANSACTION_REPLACED:case An.UNPREDICTABLE_GAS_LIMIT:a=r;break}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const u=new Error(e);return u.reason=s,u.code=r,Object.keys(i).forEach(function(d){u[d]=i[d]}),u}throwError(e,r,i){throw this.makeError(e,r,i)}throwArgumentError(e,r,i){return this.throwError(e,Et.errors.INVALID_ARGUMENT,{argument:r,value:i})}assert(e,r,i,n){e||this.throwError(r,i,n)}assertArgument(e,r,i,n){e||this.throwArgumentError(r,i,n)}checkNormalize(e){Kv&&this.throwError("platform missing String.prototype.normalize",Et.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Kv})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Et.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Et.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,i){i?i=": "+i:i="",e<r&&this.throwError("missing argument"+i,Et.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+i,Et.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Et.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Et.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Et.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return W0||(W0=new Et(wE)),W0}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Et.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),qv){if(!e)return;this.globalLogger().throwError("error censorship permanent",Et.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}zv=!!e,qv=!!r}static setLogLevel(e){const r=jf[e.toLowerCase()];if(r==null){Et.globalLogger().warn("invalid log level - "+e);return}Hv=r}static from(e){return new Et(e)}}Et.errors=An,Et.levels=V0;const AE="bytes/5.7.0",mr=new Et(AE);function Vv(t){return!!t.toHexString}function ja(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return ja(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function EE(t){return Ui(t)&&!(t.length%2)||qa(t)}function Gv(t){return typeof t=="number"&&t==t&&t%1===0}function qa(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Gv(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(!Gv(r)||r<0||r>=256)return!1}return!0}function dr(t,e){if(e||(e={}),typeof t=="number"){mr.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),ja(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Vv(t)&&(t=t.toHexString()),Ui(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":mr.throwArgumentError("hex data is odd-length","value",t));const i=[];for(let n=0;n<r.length;n+=2)i.push(parseInt(r.substring(n,n+2),16));return ja(new Uint8Array(i))}return qa(t)?ja(new Uint8Array(t)):mr.throwArgumentError("invalid arrayify value","value",t)}function xE(t){const e=t.map(n=>dr(n)),r=e.reduce((n,s)=>n+s.length,0),i=new Uint8Array(r);return e.reduce((n,s)=>(i.set(s,n),n+s.length),0),ja(i)}function SE(t,e){t=dr(t),t.length>e&&mr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),ja(r)}function Ui(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const G0="0123456789abcdef";function ai(t,e){if(e||(e={}),typeof t=="number"){mr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=G0[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Vv(t))return t.toHexString();if(Ui(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":mr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(qa(t)){let r="0x";for(let i=0;i<t.length;i++){let n=t[i];r+=G0[(n&240)>>4]+G0[n&15]}return r}return mr.throwArgumentError("invalid hexlify value","value",t)}function IE(t){if(typeof t!="string")t=ai(t);else if(!Ui(t)||t.length%2)return null;return(t.length-2)/2}function Yv(t,e,r){return typeof t!="string"?t=ai(t):(!Ui(t)||t.length%2)&&mr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Qn(t,e){for(typeof t!="string"?t=ai(t):Ui(t)||mr.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&mr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Jv(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(EE(t)){let r=dr(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=ai(r.slice(0,32)),e.s=ai(r.slice(32,64))):r.length===65?(e.r=ai(r.slice(0,32)),e.s=ai(r.slice(32,64)),e.v=r[64]):mr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:mr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=ai(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const n=SE(dr(e._vs),32);e._vs=ai(n);const s=n[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&mr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),n[0]&=127;const a=ai(n);e.s==null?e.s=a:e.s!==a&&mr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?mr.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const n=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==n&&mr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Ui(e.r)?mr.throwArgumentError("signature missing or invalid r","signature",t):e.r=Qn(e.r,32),e.s==null||!Ui(e.s)?mr.throwArgumentError("signature missing or invalid s","signature",t):e.s=Qn(e.s,32);const r=dr(e.s);r[0]>=128&&mr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const i=ai(r);e._vs&&(Ui(e._vs)||mr.throwArgumentError("signature invalid _vs","signature",t),e._vs=Qn(e._vs,32)),e._vs==null?e._vs=i:e._vs!==i&&mr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function Y0(t){return"0x"+yE.keccak_256(dr(t))}var Qv={exports:{}},ME={},CE=Object.freeze({__proto__:null,default:ME}),DE=bE(CE);(function(t){(function(e,r){function i(f,h){if(!f)throw new Error(h||"Assertion failed")}function n(f,h){f.super_=h;var g=function(){};g.prototype=h.prototype,f.prototype=new g,f.prototype.constructor=f}function s(f,h,g){if(s.isBN(f))return f;this.negative=0,this.words=null,this.length=0,this.red=null,f!==null&&((h==="le"||h==="be")&&(g=h,h=10),this._init(f||0,h||10,g||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=DE.Buffer}catch{}s.isBN=function(f){return f instanceof s?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===s.wordSize&&Array.isArray(f.words)},s.max=function(f,h){return f.cmp(h)>0?f:h},s.min=function(f,h){return f.cmp(h)<0?f:h},s.prototype._init=function(f,h,g){if(typeof f=="number")return this._initNumber(f,h,g);if(typeof f=="object")return this._initArray(f,h,g);h==="hex"&&(h=16),i(h===(h|0)&&h>=2&&h<=36),f=f.toString().replace(/\s+/g,"");var E=0;f[0]==="-"&&(E++,this.negative=1),E<f.length&&(h===16?this._parseHex(f,E,g):(this._parseBase(f,h,E),g==="le"&&this._initArray(this.toArray(),h,g)))},s.prototype._initNumber=function(f,h,g){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(i(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),g==="le"&&this._initArray(this.toArray(),h,g)},s.prototype._initArray=function(f,h,g){if(i(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var D,P,x=0;if(g==="be")for(E=f.length-1,D=0;E>=0;E-=3)P=f[E]|f[E-1]<<8|f[E-2]<<16,this.words[D]|=P<<x&67108863,this.words[D+1]=P>>>26-x&67108863,x+=24,x>=26&&(x-=26,D++);else if(g==="le")for(E=0,D=0;E<f.length;E+=3)P=f[E]|f[E+1]<<8|f[E+2]<<16,this.words[D]|=P<<x&67108863,this.words[D+1]=P>>>26-x&67108863,x+=24,x>=26&&(x-=26,D++);return this._strip()};function u(f,h){var g=f.charCodeAt(h);if(g>=48&&g<=57)return g-48;if(g>=65&&g<=70)return g-55;if(g>=97&&g<=102)return g-87;i(!1,"Invalid character in "+f)}function d(f,h,g){var E=u(f,g);return g-1>=h&&(E|=u(f,g-1)<<4),E}s.prototype._parseHex=function(f,h,g){this.length=Math.ceil((f.length-h)/6),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var D=0,P=0,x;if(g==="be")for(E=f.length-1;E>=h;E-=2)x=d(f,h,E)<<D,this.words[P]|=x&67108863,D>=18?(D-=18,P+=1,this.words[P]|=x>>>26):D+=8;else{var v=f.length-h;for(E=v%2===0?h+1:h;E<f.length;E+=2)x=d(f,h,E)<<D,this.words[P]|=x&67108863,D>=18?(D-=18,P+=1,this.words[P]|=x>>>26):D+=8}this._strip()};function p(f,h,g,E){for(var D=0,P=0,x=Math.min(f.length,g),v=h;v<x;v++){var b=f.charCodeAt(v)-48;D*=E,b>=49?P=b-49+10:b>=17?P=b-17+10:P=b,i(b>=0&&P<E,"Invalid character"),D+=P}return D}s.prototype._parseBase=function(f,h,g){this.words=[0],this.length=1;for(var E=0,D=1;D<=67108863;D*=h)E++;E--,D=D/h|0;for(var P=f.length-g,x=P%E,v=Math.min(P,P-x)+g,b=0,L=g;L<v;L+=E)b=p(f,L,L+E,h),this.imuln(D),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b);if(x!==0){var X=1;for(b=p(f,L,f.length,h),L=0;L<x;L++)X*=h;this.imuln(X),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b)}this._strip()},s.prototype.copy=function(f){f.words=new Array(this.length);for(var h=0;h<this.length;h++)f.words[h]=this.words[h];f.length=this.length,f.negative=this.negative,f.red=this.red};function y(f,h){f.words=h.words,f.length=h.length,f.negative=h.negative,f.red=h.red}if(s.prototype._move=function(f){y(f,this)},s.prototype.clone=function(){var f=new s(null);return this.copy(f),f},s.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=_}catch{s.prototype.inspect=_}else s.prototype.inspect=_;function _(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var C=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],I=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(f,h){f=f||10,h=h|0||1;var g;if(f===16||f==="hex"){g="";for(var E=0,D=0,P=0;P<this.length;P++){var x=this.words[P],v=((x<<E|D)&16777215).toString(16);D=x>>>24-E&16777215,E+=2,E>=26&&(E-=26,P--),D!==0||P!==this.length-1?g=C[6-v.length]+v+g:g=v+g}for(D!==0&&(g=D.toString(16)+g);g.length%h!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(f===(f|0)&&f>=2&&f<=36){var b=I[f],L=M[f];g="";var X=this.clone();for(X.negative=0;!X.isZero();){var ce=X.modrn(L).toString(f);X=X.idivn(L),X.isZero()?g=ce+g:g=C[b-ce.length]+ce+g}for(this.isZero()&&(g="0"+g);g.length%h!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(f,h){return this.toArrayLike(a,f,h)}),s.prototype.toArray=function(f,h){return this.toArrayLike(Array,f,h)};var B=function(f,h){return f.allocUnsafe?f.allocUnsafe(h):new f(h)};s.prototype.toArrayLike=function(f,h,g){this._strip();var E=this.byteLength(),D=g||Math.max(1,E);i(E<=D,"byte array longer than desired length"),i(D>0,"Requested array length <= 0");var P=B(f,D),x=h==="le"?"LE":"BE";return this["_toArrayLike"+x](P,E),P},s.prototype._toArrayLikeLE=function(f,h){for(var g=0,E=0,D=0,P=0;D<this.length;D++){var x=this.words[D]<<P|E;f[g++]=x&255,g<f.length&&(f[g++]=x>>8&255),g<f.length&&(f[g++]=x>>16&255),P===6?(g<f.length&&(f[g++]=x>>24&255),E=0,P=0):(E=x>>>24,P+=2)}if(g<f.length)for(f[g++]=E;g<f.length;)f[g++]=0},s.prototype._toArrayLikeBE=function(f,h){for(var g=f.length-1,E=0,D=0,P=0;D<this.length;D++){var x=this.words[D]<<P|E;f[g--]=x&255,g>=0&&(f[g--]=x>>8&255),g>=0&&(f[g--]=x>>16&255),P===6?(g>=0&&(f[g--]=x>>24&255),E=0,P=0):(E=x>>>24,P+=2)}if(g>=0)for(f[g--]=E;g>=0;)f[g--]=0},Math.clz32?s.prototype._countBits=function(f){return 32-Math.clz32(f)}:s.prototype._countBits=function(f){var h=f,g=0;return h>=4096&&(g+=13,h>>>=13),h>=64&&(g+=7,h>>>=7),h>=8&&(g+=4,h>>>=4),h>=2&&(g+=2,h>>>=2),g+h},s.prototype._zeroBits=function(f){if(f===0)return 26;var h=f,g=0;return h&8191||(g+=13,h>>>=13),h&127||(g+=7,h>>>=7),h&15||(g+=4,h>>>=4),h&3||(g+=2,h>>>=2),h&1||g++,g},s.prototype.bitLength=function(){var f=this.words[this.length-1],h=this._countBits(f);return(this.length-1)*26+h};function W(f){for(var h=new Array(f.bitLength()),g=0;g<h.length;g++){var E=g/26|0,D=g%26;h[g]=f.words[E]>>>D&1}return h}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,h=0;h<this.length;h++){var g=this._zeroBits(this.words[h]);if(f+=g,g!==26)break}return f},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},s.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var h=0;h<f.length;h++)this.words[h]=this.words[h]|f.words[h];return this._strip()},s.prototype.ior=function(f){return i((this.negative|f.negative)===0),this.iuor(f)},s.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},s.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},s.prototype.iuand=function(f){var h;this.length>f.length?h=f:h=this;for(var g=0;g<h.length;g++)this.words[g]=this.words[g]&f.words[g];return this.length=h.length,this._strip()},s.prototype.iand=function(f){return i((this.negative|f.negative)===0),this.iuand(f)},s.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},s.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},s.prototype.iuxor=function(f){var h,g;this.length>f.length?(h=this,g=f):(h=f,g=this);for(var E=0;E<g.length;E++)this.words[E]=h.words[E]^g.words[E];if(this!==h)for(;E<h.length;E++)this.words[E]=h.words[E];return this.length=h.length,this._strip()},s.prototype.ixor=function(f){return i((this.negative|f.negative)===0),this.iuxor(f)},s.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},s.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},s.prototype.inotn=function(f){i(typeof f=="number"&&f>=0);var h=Math.ceil(f/26)|0,g=f%26;this._expand(h),g>0&&h--;for(var E=0;E<h;E++)this.words[E]=~this.words[E]&67108863;return g>0&&(this.words[E]=~this.words[E]&67108863>>26-g),this._strip()},s.prototype.notn=function(f){return this.clone().inotn(f)},s.prototype.setn=function(f,h){i(typeof f=="number"&&f>=0);var g=f/26|0,E=f%26;return this._expand(g+1),h?this.words[g]=this.words[g]|1<<E:this.words[g]=this.words[g]&~(1<<E),this._strip()},s.prototype.iadd=function(f){var h;if(this.negative!==0&&f.negative===0)return this.negative=0,h=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,h=this.isub(f),f.negative=1,h._normSign();var g,E;this.length>f.length?(g=this,E=f):(g=f,E=this);for(var D=0,P=0;P<E.length;P++)h=(g.words[P]|0)+(E.words[P]|0)+D,this.words[P]=h&67108863,D=h>>>26;for(;D!==0&&P<g.length;P++)h=(g.words[P]|0)+D,this.words[P]=h&67108863,D=h>>>26;if(this.length=g.length,D!==0)this.words[this.length]=D,this.length++;else if(g!==this)for(;P<g.length;P++)this.words[P]=g.words[P];return this},s.prototype.add=function(f){var h;return f.negative!==0&&this.negative===0?(f.negative=0,h=this.sub(f),f.negative^=1,h):f.negative===0&&this.negative!==0?(this.negative=0,h=f.sub(this),this.negative=1,h):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},s.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var h=this.iadd(f);return f.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var g=this.cmp(f);if(g===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,D;g>0?(E=this,D=f):(E=f,D=this);for(var P=0,x=0;x<D.length;x++)h=(E.words[x]|0)-(D.words[x]|0)+P,P=h>>26,this.words[x]=h&67108863;for(;P!==0&&x<E.length;x++)h=(E.words[x]|0)+P,P=h>>26,this.words[x]=h&67108863;if(P===0&&x<E.length&&E!==this)for(;x<E.length;x++)this.words[x]=E.words[x];return this.length=Math.max(this.length,x),E!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(f){return this.clone().isub(f)};function Y(f,h,g){g.negative=h.negative^f.negative;var E=f.length+h.length|0;g.length=E,E=E-1|0;var D=f.words[0]|0,P=h.words[0]|0,x=D*P,v=x&67108863,b=x/67108864|0;g.words[0]=v;for(var L=1;L<E;L++){for(var X=b>>>26,ce=b&67108863,O=Math.min(L,h.length-1),ie=Math.max(0,L-f.length+1);ie<=O;ie++){var N=L-ie|0;D=f.words[N]|0,P=h.words[ie]|0,x=D*P+ce,X+=x/67108864|0,ce=x&67108863}g.words[L]=ce|0,b=X|0}return b!==0?g.words[L]=b|0:g.length--,g._strip()}var q=function(f,h,g){var E=f.words,D=h.words,P=g.words,x=0,v,b,L,X=E[0]|0,ce=X&8191,O=X>>>13,ie=E[1]|0,N=ie&8191,F=ie>>>13,R=E[2]|0,l=R&8191,$=R>>>13,Z=E[3]|0,ae=Z&8191,ue=Z>>>13,ve=E[4]|0,ge=ve&8191,Ee=ve>>>13,Ye=E[5]|0,De=Ye&8191,Re=Ye>>>13,xe=E[6]|0,ye=xe&8191,Me=xe>>>13,Pe=E[7]|0,pe=Pe&8191,Se=Pe>>>13,_e=E[8]|0,me=_e&8191,Te=_e>>>13,Ce=E[9]|0,Ae=Ce&8191,ke=Ce>>>13,qe=D[0]|0,Ie=qe&8191,Ke=qe>>>13,ut=D[1]|0,Je=ut&8191,gt=ut>>>13,ht=D[2]|0,ot=ht&8191,St=ht>>>13,Ct=D[3]|0,Oe=Ct&8191,Ve=Ct>>>13,Ze=D[4]|0,$e=Ze&8191,Qe=Ze>>>13,Ge=D[5]|0,Fe=Ge&8191,nt=Ge>>>13,Xe=D[6]|0,Le=Xe&8191,et=Xe>>>13,rt=D[7]|0,Ne=rt&8191,We=rt>>>13,st=D[8]|0,Be=st&8191,qt=st>>>13,zt=D[9]|0,lt=zt&8191,At=zt>>>13;g.negative=f.negative^h.negative,g.length=19,v=Math.imul(ce,Ie),b=Math.imul(ce,Ke),b=b+Math.imul(O,Ie)|0,L=Math.imul(O,Ke);var Xr=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,v=Math.imul(N,Ie),b=Math.imul(N,Ke),b=b+Math.imul(F,Ie)|0,L=Math.imul(F,Ke),v=v+Math.imul(ce,Je)|0,b=b+Math.imul(ce,gt)|0,b=b+Math.imul(O,Je)|0,L=L+Math.imul(O,gt)|0;var ei=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(ei>>>26)|0,ei&=67108863,v=Math.imul(l,Ie),b=Math.imul(l,Ke),b=b+Math.imul($,Ie)|0,L=Math.imul($,Ke),v=v+Math.imul(N,Je)|0,b=b+Math.imul(N,gt)|0,b=b+Math.imul(F,Je)|0,L=L+Math.imul(F,gt)|0,v=v+Math.imul(ce,ot)|0,b=b+Math.imul(ce,St)|0,b=b+Math.imul(O,ot)|0,L=L+Math.imul(O,St)|0;var ti=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(ti>>>26)|0,ti&=67108863,v=Math.imul(ae,Ie),b=Math.imul(ae,Ke),b=b+Math.imul(ue,Ie)|0,L=Math.imul(ue,Ke),v=v+Math.imul(l,Je)|0,b=b+Math.imul(l,gt)|0,b=b+Math.imul($,Je)|0,L=L+Math.imul($,gt)|0,v=v+Math.imul(N,ot)|0,b=b+Math.imul(N,St)|0,b=b+Math.imul(F,ot)|0,L=L+Math.imul(F,St)|0,v=v+Math.imul(ce,Oe)|0,b=b+Math.imul(ce,Ve)|0,b=b+Math.imul(O,Oe)|0,L=L+Math.imul(O,Ve)|0;var ri=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(ri>>>26)|0,ri&=67108863,v=Math.imul(ge,Ie),b=Math.imul(ge,Ke),b=b+Math.imul(Ee,Ie)|0,L=Math.imul(Ee,Ke),v=v+Math.imul(ae,Je)|0,b=b+Math.imul(ae,gt)|0,b=b+Math.imul(ue,Je)|0,L=L+Math.imul(ue,gt)|0,v=v+Math.imul(l,ot)|0,b=b+Math.imul(l,St)|0,b=b+Math.imul($,ot)|0,L=L+Math.imul($,St)|0,v=v+Math.imul(N,Oe)|0,b=b+Math.imul(N,Ve)|0,b=b+Math.imul(F,Oe)|0,L=L+Math.imul(F,Ve)|0,v=v+Math.imul(ce,$e)|0,b=b+Math.imul(ce,Qe)|0,b=b+Math.imul(O,$e)|0,L=L+Math.imul(O,Qe)|0;var ii=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(ii>>>26)|0,ii&=67108863,v=Math.imul(De,Ie),b=Math.imul(De,Ke),b=b+Math.imul(Re,Ie)|0,L=Math.imul(Re,Ke),v=v+Math.imul(ge,Je)|0,b=b+Math.imul(ge,gt)|0,b=b+Math.imul(Ee,Je)|0,L=L+Math.imul(Ee,gt)|0,v=v+Math.imul(ae,ot)|0,b=b+Math.imul(ae,St)|0,b=b+Math.imul(ue,ot)|0,L=L+Math.imul(ue,St)|0,v=v+Math.imul(l,Oe)|0,b=b+Math.imul(l,Ve)|0,b=b+Math.imul($,Oe)|0,L=L+Math.imul($,Ve)|0,v=v+Math.imul(N,$e)|0,b=b+Math.imul(N,Qe)|0,b=b+Math.imul(F,$e)|0,L=L+Math.imul(F,Qe)|0,v=v+Math.imul(ce,Fe)|0,b=b+Math.imul(ce,nt)|0,b=b+Math.imul(O,Fe)|0,L=L+Math.imul(O,nt)|0;var gr=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(gr>>>26)|0,gr&=67108863,v=Math.imul(ye,Ie),b=Math.imul(ye,Ke),b=b+Math.imul(Me,Ie)|0,L=Math.imul(Me,Ke),v=v+Math.imul(De,Je)|0,b=b+Math.imul(De,gt)|0,b=b+Math.imul(Re,Je)|0,L=L+Math.imul(Re,gt)|0,v=v+Math.imul(ge,ot)|0,b=b+Math.imul(ge,St)|0,b=b+Math.imul(Ee,ot)|0,L=L+Math.imul(Ee,St)|0,v=v+Math.imul(ae,Oe)|0,b=b+Math.imul(ae,Ve)|0,b=b+Math.imul(ue,Oe)|0,L=L+Math.imul(ue,Ve)|0,v=v+Math.imul(l,$e)|0,b=b+Math.imul(l,Qe)|0,b=b+Math.imul($,$e)|0,L=L+Math.imul($,Qe)|0,v=v+Math.imul(N,Fe)|0,b=b+Math.imul(N,nt)|0,b=b+Math.imul(F,Fe)|0,L=L+Math.imul(F,nt)|0,v=v+Math.imul(ce,Le)|0,b=b+Math.imul(ce,et)|0,b=b+Math.imul(O,Le)|0,L=L+Math.imul(O,et)|0;var Ci=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(Ci>>>26)|0,Ci&=67108863,v=Math.imul(pe,Ie),b=Math.imul(pe,Ke),b=b+Math.imul(Se,Ie)|0,L=Math.imul(Se,Ke),v=v+Math.imul(ye,Je)|0,b=b+Math.imul(ye,gt)|0,b=b+Math.imul(Me,Je)|0,L=L+Math.imul(Me,gt)|0,v=v+Math.imul(De,ot)|0,b=b+Math.imul(De,St)|0,b=b+Math.imul(Re,ot)|0,L=L+Math.imul(Re,St)|0,v=v+Math.imul(ge,Oe)|0,b=b+Math.imul(ge,Ve)|0,b=b+Math.imul(Ee,Oe)|0,L=L+Math.imul(Ee,Ve)|0,v=v+Math.imul(ae,$e)|0,b=b+Math.imul(ae,Qe)|0,b=b+Math.imul(ue,$e)|0,L=L+Math.imul(ue,Qe)|0,v=v+Math.imul(l,Fe)|0,b=b+Math.imul(l,nt)|0,b=b+Math.imul($,Fe)|0,L=L+Math.imul($,nt)|0,v=v+Math.imul(N,Le)|0,b=b+Math.imul(N,et)|0,b=b+Math.imul(F,Le)|0,L=L+Math.imul(F,et)|0,v=v+Math.imul(ce,Ne)|0,b=b+Math.imul(ce,We)|0,b=b+Math.imul(O,Ne)|0,L=L+Math.imul(O,We)|0;var Pn=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,v=Math.imul(me,Ie),b=Math.imul(me,Ke),b=b+Math.imul(Te,Ie)|0,L=Math.imul(Te,Ke),v=v+Math.imul(pe,Je)|0,b=b+Math.imul(pe,gt)|0,b=b+Math.imul(Se,Je)|0,L=L+Math.imul(Se,gt)|0,v=v+Math.imul(ye,ot)|0,b=b+Math.imul(ye,St)|0,b=b+Math.imul(Me,ot)|0,L=L+Math.imul(Me,St)|0,v=v+Math.imul(De,Oe)|0,b=b+Math.imul(De,Ve)|0,b=b+Math.imul(Re,Oe)|0,L=L+Math.imul(Re,Ve)|0,v=v+Math.imul(ge,$e)|0,b=b+Math.imul(ge,Qe)|0,b=b+Math.imul(Ee,$e)|0,L=L+Math.imul(Ee,Qe)|0,v=v+Math.imul(ae,Fe)|0,b=b+Math.imul(ae,nt)|0,b=b+Math.imul(ue,Fe)|0,L=L+Math.imul(ue,nt)|0,v=v+Math.imul(l,Le)|0,b=b+Math.imul(l,et)|0,b=b+Math.imul($,Le)|0,L=L+Math.imul($,et)|0,v=v+Math.imul(N,Ne)|0,b=b+Math.imul(N,We)|0,b=b+Math.imul(F,Ne)|0,L=L+Math.imul(F,We)|0,v=v+Math.imul(ce,Be)|0,b=b+Math.imul(ce,qt)|0,b=b+Math.imul(O,Be)|0,L=L+Math.imul(O,qt)|0;var Di=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(Di>>>26)|0,Di&=67108863,v=Math.imul(Ae,Ie),b=Math.imul(Ae,Ke),b=b+Math.imul(ke,Ie)|0,L=Math.imul(ke,Ke),v=v+Math.imul(me,Je)|0,b=b+Math.imul(me,gt)|0,b=b+Math.imul(Te,Je)|0,L=L+Math.imul(Te,gt)|0,v=v+Math.imul(pe,ot)|0,b=b+Math.imul(pe,St)|0,b=b+Math.imul(Se,ot)|0,L=L+Math.imul(Se,St)|0,v=v+Math.imul(ye,Oe)|0,b=b+Math.imul(ye,Ve)|0,b=b+Math.imul(Me,Oe)|0,L=L+Math.imul(Me,Ve)|0,v=v+Math.imul(De,$e)|0,b=b+Math.imul(De,Qe)|0,b=b+Math.imul(Re,$e)|0,L=L+Math.imul(Re,Qe)|0,v=v+Math.imul(ge,Fe)|0,b=b+Math.imul(ge,nt)|0,b=b+Math.imul(Ee,Fe)|0,L=L+Math.imul(Ee,nt)|0,v=v+Math.imul(ae,Le)|0,b=b+Math.imul(ae,et)|0,b=b+Math.imul(ue,Le)|0,L=L+Math.imul(ue,et)|0,v=v+Math.imul(l,Ne)|0,b=b+Math.imul(l,We)|0,b=b+Math.imul($,Ne)|0,L=L+Math.imul($,We)|0,v=v+Math.imul(N,Be)|0,b=b+Math.imul(N,qt)|0,b=b+Math.imul(F,Be)|0,L=L+Math.imul(F,qt)|0,v=v+Math.imul(ce,lt)|0,b=b+Math.imul(ce,At)|0,b=b+Math.imul(O,lt)|0,L=L+Math.imul(O,At)|0;var On=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(On>>>26)|0,On&=67108863,v=Math.imul(Ae,Je),b=Math.imul(Ae,gt),b=b+Math.imul(ke,Je)|0,L=Math.imul(ke,gt),v=v+Math.imul(me,ot)|0,b=b+Math.imul(me,St)|0,b=b+Math.imul(Te,ot)|0,L=L+Math.imul(Te,St)|0,v=v+Math.imul(pe,Oe)|0,b=b+Math.imul(pe,Ve)|0,b=b+Math.imul(Se,Oe)|0,L=L+Math.imul(Se,Ve)|0,v=v+Math.imul(ye,$e)|0,b=b+Math.imul(ye,Qe)|0,b=b+Math.imul(Me,$e)|0,L=L+Math.imul(Me,Qe)|0,v=v+Math.imul(De,Fe)|0,b=b+Math.imul(De,nt)|0,b=b+Math.imul(Re,Fe)|0,L=L+Math.imul(Re,nt)|0,v=v+Math.imul(ge,Le)|0,b=b+Math.imul(ge,et)|0,b=b+Math.imul(Ee,Le)|0,L=L+Math.imul(Ee,et)|0,v=v+Math.imul(ae,Ne)|0,b=b+Math.imul(ae,We)|0,b=b+Math.imul(ue,Ne)|0,L=L+Math.imul(ue,We)|0,v=v+Math.imul(l,Be)|0,b=b+Math.imul(l,qt)|0,b=b+Math.imul($,Be)|0,L=L+Math.imul($,qt)|0,v=v+Math.imul(N,lt)|0,b=b+Math.imul(N,At)|0,b=b+Math.imul(F,lt)|0,L=L+Math.imul(F,At)|0;var $n=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+($n>>>26)|0,$n&=67108863,v=Math.imul(Ae,ot),b=Math.imul(Ae,St),b=b+Math.imul(ke,ot)|0,L=Math.imul(ke,St),v=v+Math.imul(me,Oe)|0,b=b+Math.imul(me,Ve)|0,b=b+Math.imul(Te,Oe)|0,L=L+Math.imul(Te,Ve)|0,v=v+Math.imul(pe,$e)|0,b=b+Math.imul(pe,Qe)|0,b=b+Math.imul(Se,$e)|0,L=L+Math.imul(Se,Qe)|0,v=v+Math.imul(ye,Fe)|0,b=b+Math.imul(ye,nt)|0,b=b+Math.imul(Me,Fe)|0,L=L+Math.imul(Me,nt)|0,v=v+Math.imul(De,Le)|0,b=b+Math.imul(De,et)|0,b=b+Math.imul(Re,Le)|0,L=L+Math.imul(Re,et)|0,v=v+Math.imul(ge,Ne)|0,b=b+Math.imul(ge,We)|0,b=b+Math.imul(Ee,Ne)|0,L=L+Math.imul(Ee,We)|0,v=v+Math.imul(ae,Be)|0,b=b+Math.imul(ae,qt)|0,b=b+Math.imul(ue,Be)|0,L=L+Math.imul(ue,qt)|0,v=v+Math.imul(l,lt)|0,b=b+Math.imul(l,At)|0,b=b+Math.imul($,lt)|0,L=L+Math.imul($,At)|0;var Pi=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(Pi>>>26)|0,Pi&=67108863,v=Math.imul(Ae,Oe),b=Math.imul(Ae,Ve),b=b+Math.imul(ke,Oe)|0,L=Math.imul(ke,Ve),v=v+Math.imul(me,$e)|0,b=b+Math.imul(me,Qe)|0,b=b+Math.imul(Te,$e)|0,L=L+Math.imul(Te,Qe)|0,v=v+Math.imul(pe,Fe)|0,b=b+Math.imul(pe,nt)|0,b=b+Math.imul(Se,Fe)|0,L=L+Math.imul(Se,nt)|0,v=v+Math.imul(ye,Le)|0,b=b+Math.imul(ye,et)|0,b=b+Math.imul(Me,Le)|0,L=L+Math.imul(Me,et)|0,v=v+Math.imul(De,Ne)|0,b=b+Math.imul(De,We)|0,b=b+Math.imul(Re,Ne)|0,L=L+Math.imul(Re,We)|0,v=v+Math.imul(ge,Be)|0,b=b+Math.imul(ge,qt)|0,b=b+Math.imul(Ee,Be)|0,L=L+Math.imul(Ee,qt)|0,v=v+Math.imul(ae,lt)|0,b=b+Math.imul(ae,At)|0,b=b+Math.imul(ue,lt)|0,L=L+Math.imul(ue,At)|0;var an=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(an>>>26)|0,an&=67108863,v=Math.imul(Ae,$e),b=Math.imul(Ae,Qe),b=b+Math.imul(ke,$e)|0,L=Math.imul(ke,Qe),v=v+Math.imul(me,Fe)|0,b=b+Math.imul(me,nt)|0,b=b+Math.imul(Te,Fe)|0,L=L+Math.imul(Te,nt)|0,v=v+Math.imul(pe,Le)|0,b=b+Math.imul(pe,et)|0,b=b+Math.imul(Se,Le)|0,L=L+Math.imul(Se,et)|0,v=v+Math.imul(ye,Ne)|0,b=b+Math.imul(ye,We)|0,b=b+Math.imul(Me,Ne)|0,L=L+Math.imul(Me,We)|0,v=v+Math.imul(De,Be)|0,b=b+Math.imul(De,qt)|0,b=b+Math.imul(Re,Be)|0,L=L+Math.imul(Re,qt)|0,v=v+Math.imul(ge,lt)|0,b=b+Math.imul(ge,At)|0,b=b+Math.imul(Ee,lt)|0,L=L+Math.imul(Ee,At)|0;var cn=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(cn>>>26)|0,cn&=67108863,v=Math.imul(Ae,Fe),b=Math.imul(Ae,nt),b=b+Math.imul(ke,Fe)|0,L=Math.imul(ke,nt),v=v+Math.imul(me,Le)|0,b=b+Math.imul(me,et)|0,b=b+Math.imul(Te,Le)|0,L=L+Math.imul(Te,et)|0,v=v+Math.imul(pe,Ne)|0,b=b+Math.imul(pe,We)|0,b=b+Math.imul(Se,Ne)|0,L=L+Math.imul(Se,We)|0,v=v+Math.imul(ye,Be)|0,b=b+Math.imul(ye,qt)|0,b=b+Math.imul(Me,Be)|0,L=L+Math.imul(Me,qt)|0,v=v+Math.imul(De,lt)|0,b=b+Math.imul(De,At)|0,b=b+Math.imul(Re,lt)|0,L=L+Math.imul(Re,At)|0;var Mr=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,v=Math.imul(Ae,Le),b=Math.imul(Ae,et),b=b+Math.imul(ke,Le)|0,L=Math.imul(ke,et),v=v+Math.imul(me,Ne)|0,b=b+Math.imul(me,We)|0,b=b+Math.imul(Te,Ne)|0,L=L+Math.imul(Te,We)|0,v=v+Math.imul(pe,Be)|0,b=b+Math.imul(pe,qt)|0,b=b+Math.imul(Se,Be)|0,L=L+Math.imul(Se,qt)|0,v=v+Math.imul(ye,lt)|0,b=b+Math.imul(ye,At)|0,b=b+Math.imul(Me,lt)|0,L=L+Math.imul(Me,At)|0;var Nn=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,v=Math.imul(Ae,Ne),b=Math.imul(Ae,We),b=b+Math.imul(ke,Ne)|0,L=Math.imul(ke,We),v=v+Math.imul(me,Be)|0,b=b+Math.imul(me,qt)|0,b=b+Math.imul(Te,Be)|0,L=L+Math.imul(Te,qt)|0,v=v+Math.imul(pe,lt)|0,b=b+Math.imul(pe,At)|0,b=b+Math.imul(Se,lt)|0,L=L+Math.imul(Se,At)|0;var Rn=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,v=Math.imul(Ae,Be),b=Math.imul(Ae,qt),b=b+Math.imul(ke,Be)|0,L=Math.imul(ke,qt),v=v+Math.imul(me,lt)|0,b=b+Math.imul(me,At)|0,b=b+Math.imul(Te,lt)|0,L=L+Math.imul(Te,At)|0;var Tn=(x+v|0)+((b&8191)<<13)|0;x=(L+(b>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,v=Math.imul(Ae,lt),b=Math.imul(Ae,At),b=b+Math.imul(ke,lt)|0,L=Math.imul(ke,At);var ua=(x+v|0)+((b&8191)<<13)|0;return x=(L+(b>>>13)|0)+(ua>>>26)|0,ua&=67108863,P[0]=Xr,P[1]=ei,P[2]=ti,P[3]=ri,P[4]=ii,P[5]=gr,P[6]=Ci,P[7]=Pn,P[8]=Di,P[9]=On,P[10]=$n,P[11]=Pi,P[12]=an,P[13]=cn,P[14]=Mr,P[15]=Nn,P[16]=Rn,P[17]=Tn,P[18]=ua,x!==0&&(P[19]=x,g.length++),g};Math.imul||(q=Y);function V(f,h,g){g.negative=h.negative^f.negative,g.length=f.length+h.length;for(var E=0,D=0,P=0;P<g.length-1;P++){var x=D;D=0;for(var v=E&67108863,b=Math.min(P,h.length-1),L=Math.max(0,P-f.length+1);L<=b;L++){var X=P-L,ce=f.words[X]|0,O=h.words[L]|0,ie=ce*O,N=ie&67108863;x=x+(ie/67108864|0)|0,N=N+v|0,v=N&67108863,x=x+(N>>>26)|0,D+=x>>>26,x&=67108863}g.words[P]=v,E=x,x=D}return E!==0?g.words[P]=E:g.length--,g._strip()}function U(f,h,g){return V(f,h,g)}s.prototype.mulTo=function(f,h){var g,E=this.length+f.length;return this.length===10&&f.length===10?g=q(this,f,h):E<63?g=Y(this,f,h):E<1024?g=V(this,f,h):g=U(this,f,h),g},s.prototype.mul=function(f){var h=new s(null);return h.words=new Array(this.length+f.length),this.mulTo(f,h)},s.prototype.mulf=function(f){var h=new s(null);return h.words=new Array(this.length+f.length),U(this,f,h)},s.prototype.imul=function(f){return this.clone().mulTo(f,this)},s.prototype.imuln=function(f){var h=f<0;h&&(f=-f),i(typeof f=="number"),i(f<67108864);for(var g=0,E=0;E<this.length;E++){var D=(this.words[E]|0)*f,P=(D&67108863)+(g&67108863);g>>=26,g+=D/67108864|0,g+=P>>>26,this.words[E]=P&67108863}return g!==0&&(this.words[E]=g,this.length++),h?this.ineg():this},s.prototype.muln=function(f){return this.clone().imuln(f)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(f){var h=W(f);if(h.length===0)return new s(1);for(var g=this,E=0;E<h.length&&h[E]===0;E++,g=g.sqr());if(++E<h.length)for(var D=g.sqr();E<h.length;E++,D=D.sqr())h[E]!==0&&(g=g.mul(D));return g},s.prototype.iushln=function(f){i(typeof f=="number"&&f>=0);var h=f%26,g=(f-h)/26,E=67108863>>>26-h<<26-h,D;if(h!==0){var P=0;for(D=0;D<this.length;D++){var x=this.words[D]&E,v=(this.words[D]|0)-x<<h;this.words[D]=v|P,P=x>>>26-h}P&&(this.words[D]=P,this.length++)}if(g!==0){for(D=this.length-1;D>=0;D--)this.words[D+g]=this.words[D];for(D=0;D<g;D++)this.words[D]=0;this.length+=g}return this._strip()},s.prototype.ishln=function(f){return i(this.negative===0),this.iushln(f)},s.prototype.iushrn=function(f,h,g){i(typeof f=="number"&&f>=0);var E;h?E=(h-h%26)/26:E=0;var D=f%26,P=Math.min((f-D)/26,this.length),x=67108863^67108863>>>D<<D,v=g;if(E-=P,E=Math.max(0,E),v){for(var b=0;b<P;b++)v.words[b]=this.words[b];v.length=P}if(P!==0)if(this.length>P)for(this.length-=P,b=0;b<this.length;b++)this.words[b]=this.words[b+P];else this.words[0]=0,this.length=1;var L=0;for(b=this.length-1;b>=0&&(L!==0||b>=E);b--){var X=this.words[b]|0;this.words[b]=L<<26-D|X>>>D,L=X&x}return v&&L!==0&&(v.words[v.length++]=L),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(f,h,g){return i(this.negative===0),this.iushrn(f,h,g)},s.prototype.shln=function(f){return this.clone().ishln(f)},s.prototype.ushln=function(f){return this.clone().iushln(f)},s.prototype.shrn=function(f){return this.clone().ishrn(f)},s.prototype.ushrn=function(f){return this.clone().iushrn(f)},s.prototype.testn=function(f){i(typeof f=="number"&&f>=0);var h=f%26,g=(f-h)/26,E=1<<h;if(this.length<=g)return!1;var D=this.words[g];return!!(D&E)},s.prototype.imaskn=function(f){i(typeof f=="number"&&f>=0);var h=f%26,g=(f-h)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(h!==0&&g++,this.length=Math.min(g,this.length),h!==0){var E=67108863^67108863>>>h<<h;this.words[this.length-1]&=E}return this._strip()},s.prototype.maskn=function(f){return this.clone().imaskn(f)},s.prototype.iaddn=function(f){return i(typeof f=="number"),i(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},s.prototype._iaddn=function(f){this.words[0]+=f;for(var h=0;h<this.length&&this.words[h]>=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},s.prototype.isubn=function(f){if(i(typeof f=="number"),i(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h<this.length&&this.words[h]<0;h++)this.words[h]+=67108864,this.words[h+1]-=1;return this._strip()},s.prototype.addn=function(f){return this.clone().iaddn(f)},s.prototype.subn=function(f){return this.clone().isubn(f)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(f,h,g){var E=f.length+g,D;this._expand(E);var P,x=0;for(D=0;D<f.length;D++){P=(this.words[D+g]|0)+x;var v=(f.words[D]|0)*h;P-=v&67108863,x=(P>>26)-(v/67108864|0),this.words[D+g]=P&67108863}for(;D<this.length-g;D++)P=(this.words[D+g]|0)+x,x=P>>26,this.words[D+g]=P&67108863;if(x===0)return this._strip();for(i(x===-1),x=0,D=0;D<this.length;D++)P=-(this.words[D]|0)+x,x=P>>26,this.words[D]=P&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(f,h){var g=this.length-f.length,E=this.clone(),D=f,P=D.words[D.length-1]|0,x=this._countBits(P);g=26-x,g!==0&&(D=D.ushln(g),E.iushln(g),P=D.words[D.length-1]|0);var v=E.length-D.length,b;if(h!=="mod"){b=new s(null),b.length=v+1,b.words=new Array(b.length);for(var L=0;L<b.length;L++)b.words[L]=0}var X=E.clone()._ishlnsubmul(D,1,v);X.negative===0&&(E=X,b&&(b.words[v]=1));for(var ce=v-1;ce>=0;ce--){var O=(E.words[D.length+ce]|0)*67108864+(E.words[D.length+ce-1]|0);for(O=Math.min(O/P|0,67108863),E._ishlnsubmul(D,O,ce);E.negative!==0;)O--,E.negative=0,E._ishlnsubmul(D,1,ce),E.isZero()||(E.negative^=1);b&&(b.words[ce]=O)}return b&&b._strip(),E._strip(),h!=="div"&&g!==0&&E.iushrn(g),{div:b||null,mod:E}},s.prototype.divmod=function(f,h,g){if(i(!f.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var E,D,P;return this.negative!==0&&f.negative===0?(P=this.neg().divmod(f,h),h!=="mod"&&(E=P.div.neg()),h!=="div"&&(D=P.mod.neg(),g&&D.negative!==0&&D.iadd(f)),{div:E,mod:D}):this.negative===0&&f.negative!==0?(P=this.divmod(f.neg(),h),h!=="mod"&&(E=P.div.neg()),{div:E,mod:P.mod}):this.negative&f.negative?(P=this.neg().divmod(f.neg(),h),h!=="div"&&(D=P.mod.neg(),g&&D.negative!==0&&D.isub(f)),{div:P.div,mod:D}):f.length>this.length||this.cmp(f)<0?{div:new s(0),mod:this}:f.length===1?h==="div"?{div:this.divn(f.words[0]),mod:null}:h==="mod"?{div:null,mod:new s(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new s(this.modrn(f.words[0]))}:this._wordDiv(f,h)},s.prototype.div=function(f){return this.divmod(f,"div",!1).div},s.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},s.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},s.prototype.divRound=function(f){var h=this.divmod(f);if(h.mod.isZero())return h.div;var g=h.div.negative!==0?h.mod.isub(f):h.mod,E=f.ushrn(1),D=f.andln(1),P=g.cmp(E);return P<0||D===1&&P===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},s.prototype.modrn=function(f){var h=f<0;h&&(f=-f),i(f<=67108863);for(var g=(1<<26)%f,E=0,D=this.length-1;D>=0;D--)E=(g*E+(this.words[D]|0))%f;return h?-E:E},s.prototype.modn=function(f){return this.modrn(f)},s.prototype.idivn=function(f){var h=f<0;h&&(f=-f),i(f<=67108863);for(var g=0,E=this.length-1;E>=0;E--){var D=(this.words[E]|0)+g*67108864;this.words[E]=D/f|0,g=D%f}return this._strip(),h?this.ineg():this},s.prototype.divn=function(f){return this.clone().idivn(f)},s.prototype.egcd=function(f){i(f.negative===0),i(!f.isZero());var h=this,g=f.clone();h.negative!==0?h=h.umod(f):h=h.clone();for(var E=new s(1),D=new s(0),P=new s(0),x=new s(1),v=0;h.isEven()&&g.isEven();)h.iushrn(1),g.iushrn(1),++v;for(var b=g.clone(),L=h.clone();!h.isZero();){for(var X=0,ce=1;!(h.words[0]&ce)&&X<26;++X,ce<<=1);if(X>0)for(h.iushrn(X);X-- >0;)(E.isOdd()||D.isOdd())&&(E.iadd(b),D.isub(L)),E.iushrn(1),D.iushrn(1);for(var O=0,ie=1;!(g.words[0]&ie)&&O<26;++O,ie<<=1);if(O>0)for(g.iushrn(O);O-- >0;)(P.isOdd()||x.isOdd())&&(P.iadd(b),x.isub(L)),P.iushrn(1),x.iushrn(1);h.cmp(g)>=0?(h.isub(g),E.isub(P),D.isub(x)):(g.isub(h),P.isub(E),x.isub(D))}return{a:P,b:x,gcd:g.iushln(v)}},s.prototype._invmp=function(f){i(f.negative===0),i(!f.isZero());var h=this,g=f.clone();h.negative!==0?h=h.umod(f):h=h.clone();for(var E=new s(1),D=new s(0),P=g.clone();h.cmpn(1)>0&&g.cmpn(1)>0;){for(var x=0,v=1;!(h.words[0]&v)&&x<26;++x,v<<=1);if(x>0)for(h.iushrn(x);x-- >0;)E.isOdd()&&E.iadd(P),E.iushrn(1);for(var b=0,L=1;!(g.words[0]&L)&&b<26;++b,L<<=1);if(b>0)for(g.iushrn(b);b-- >0;)D.isOdd()&&D.iadd(P),D.iushrn(1);h.cmp(g)>=0?(h.isub(g),E.isub(D)):(g.isub(h),D.isub(E))}var X;return h.cmpn(1)===0?X=E:X=D,X.cmpn(0)<0&&X.iadd(f),X},s.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var h=this.clone(),g=f.clone();h.negative=0,g.negative=0;for(var E=0;h.isEven()&&g.isEven();E++)h.iushrn(1),g.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;g.isEven();)g.iushrn(1);var D=h.cmp(g);if(D<0){var P=h;h=g,g=P}else if(D===0||g.cmpn(1)===0)break;h.isub(g)}while(!0);return g.iushln(E)},s.prototype.invm=function(f){return this.egcd(f).a.umod(f)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(f){return this.words[0]&f},s.prototype.bincn=function(f){i(typeof f=="number");var h=f%26,g=(f-h)/26,E=1<<h;if(this.length<=g)return this._expand(g+1),this.words[g]|=E,this;for(var D=E,P=g;D!==0&&P<this.length;P++){var x=this.words[P]|0;x+=D,D=x>>>26,x&=67108863,this.words[P]=x}return D!==0&&(this.words[P]=D,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(f){var h=f<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var g;if(this.length>1)g=1;else{h&&(f=-f),i(f<=67108863,"Number is too big");var E=this.words[0]|0;g=E===f?0:E<f?-1:1}return this.negative!==0?-g|0:g},s.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var h=this.ucmp(f);return this.negative!==0?-h|0:h},s.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var h=0,g=this.length-1;g>=0;g--){var E=this.words[g]|0,D=f.words[g]|0;if(E!==D){E<D?h=-1:E>D&&(h=1);break}}return h},s.prototype.gtn=function(f){return this.cmpn(f)===1},s.prototype.gt=function(f){return this.cmp(f)===1},s.prototype.gten=function(f){return this.cmpn(f)>=0},s.prototype.gte=function(f){return this.cmp(f)>=0},s.prototype.ltn=function(f){return this.cmpn(f)===-1},s.prototype.lt=function(f){return this.cmp(f)===-1},s.prototype.lten=function(f){return this.cmpn(f)<=0},s.prototype.lte=function(f){return this.cmp(f)<=0},s.prototype.eqn=function(f){return this.cmpn(f)===0},s.prototype.eq=function(f){return this.cmp(f)===0},s.red=function(f){return new k(f)},s.prototype.toRed=function(f){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(f){return this.red=f,this},s.prototype.forceRed=function(f){return i(!this.red,"Already a number in reduction context"),this._forceRed(f)},s.prototype.redAdd=function(f){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},s.prototype.redIAdd=function(f){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},s.prototype.redSub=function(f){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},s.prototype.redISub=function(f){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},s.prototype.redShl=function(f){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},s.prototype.redMul=function(f){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},s.prototype.redIMul=function(f){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(f){return i(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var z={k256:null,p224:null,p192:null,p25519:null};function K(f,h){this.name=f,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}K.prototype._tmp=function(){var f=new s(null);return f.words=new Array(Math.ceil(this.n/13)),f},K.prototype.ireduce=function(f){var h=f,g;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),g=h.bitLength();while(g>this.n);var E=g<this.n?-1:h.ucmp(this.p);return E===0?(h.words[0]=0,h.length=1):E>0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},K.prototype.split=function(f,h){f.iushrn(this.n,0,h)},K.prototype.imulK=function(f){return f.imul(this.k)};function A(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(A,K),A.prototype.split=function(f,h){for(var g=4194303,E=Math.min(f.length,9),D=0;D<E;D++)h.words[D]=f.words[D];if(h.length=E,f.length<=9){f.words[0]=0,f.length=1;return}var P=f.words[9];for(h.words[h.length++]=P&g,D=10;D<f.length;D++){var x=f.words[D]|0;f.words[D-10]=(x&g)<<4|P>>>22,P=x}P>>>=22,f.words[D-10]=P,P===0&&f.length>10?f.length-=10:f.length-=9},A.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var h=0,g=0;g<f.length;g++){var E=f.words[g]|0;h+=E*977,f.words[g]=h&67108863,h=E*64+(h/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function j(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(j,K);function ee(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(ee,K);function re(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(re,K),re.prototype.imulK=function(f){for(var h=0,g=0;g<f.length;g++){var E=(f.words[g]|0)*19+h,D=E&67108863;E>>>=26,f.words[g]=D,h=E}return h!==0&&(f.words[f.length++]=h),f},s._prime=function(f){if(z[f])return z[f];var h;if(f==="k256")h=new A;else if(f==="p224")h=new j;else if(f==="p192")h=new ee;else if(f==="p25519")h=new re;else throw new Error("Unknown prime "+f);return z[f]=h,h};function k(f){if(typeof f=="string"){var h=s._prime(f);this.m=h.p,this.prime=h}else i(f.gtn(1),"modulus must be greater than 1"),this.m=f,this.prime=null}k.prototype._verify1=function(f){i(f.negative===0,"red works only with positives"),i(f.red,"red works only with red numbers")},k.prototype._verify2=function(f,h){i((f.negative|h.negative)===0,"red works only with positives"),i(f.red&&f.red===h.red,"red works only with red numbers")},k.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(y(f,f.umod(this.m)._forceRed(this)),f)},k.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},k.prototype.add=function(f,h){this._verify2(f,h);var g=f.add(h);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},k.prototype.iadd=function(f,h){this._verify2(f,h);var g=f.iadd(h);return g.cmp(this.m)>=0&&g.isub(this.m),g},k.prototype.sub=function(f,h){this._verify2(f,h);var g=f.sub(h);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},k.prototype.isub=function(f,h){this._verify2(f,h);var g=f.isub(h);return g.cmpn(0)<0&&g.iadd(this.m),g},k.prototype.shl=function(f,h){return this._verify1(f),this.imod(f.ushln(h))},k.prototype.imul=function(f,h){return this._verify2(f,h),this.imod(f.imul(h))},k.prototype.mul=function(f,h){return this._verify2(f,h),this.imod(f.mul(h))},k.prototype.isqr=function(f){return this.imul(f,f.clone())},k.prototype.sqr=function(f){return this.mul(f,f)},k.prototype.sqrt=function(f){if(f.isZero())return f.clone();var h=this.m.andln(3);if(i(h%2===1),h===3){var g=this.m.add(new s(1)).iushrn(2);return this.pow(f,g)}for(var E=this.m.subn(1),D=0;!E.isZero()&&E.andln(1)===0;)D++,E.iushrn(1);i(!E.isZero());var P=new s(1).toRed(this),x=P.redNeg(),v=this.m.subn(1).iushrn(1),b=this.m.bitLength();for(b=new s(2*b*b).toRed(this);this.pow(b,v).cmp(x)!==0;)b.redIAdd(x);for(var L=this.pow(b,E),X=this.pow(f,E.addn(1).iushrn(1)),ce=this.pow(f,E),O=D;ce.cmp(P)!==0;){for(var ie=ce,N=0;ie.cmp(P)!==0;N++)ie=ie.redSqr();i(N<O);var F=this.pow(L,new s(1).iushln(O-N-1));X=X.redMul(F),L=F.redSqr(),ce=ce.redMul(L),O=N}return X},k.prototype.invm=function(f){var h=f._invmp(this.m);return h.negative!==0?(h.negative=0,this.imod(h).redNeg()):this.imod(h)},k.prototype.pow=function(f,h){if(h.isZero())return new s(1).toRed(this);if(h.cmpn(1)===0)return f.clone();var g=4,E=new Array(1<<g);E[0]=new s(1).toRed(this),E[1]=f;for(var D=2;D<E.length;D++)E[D]=this.mul(E[D-1],f);var P=E[0],x=0,v=0,b=h.bitLength()%26;for(b===0&&(b=26),D=h.length-1;D>=0;D--){for(var L=h.words[D],X=b-1;X>=0;X--){var ce=L>>X&1;if(P!==E[0]&&(P=this.sqr(P)),ce===0&&x===0){v=0;continue}x<<=1,x|=ce,v++,!(v!==g&&(D!==0||X!==0))&&(P=this.mul(P,E[x]),v=0,x=0)}b=26}return P},k.prototype.convertTo=function(f){var h=f.umod(this.m);return h===f?h.clone():h},k.prototype.convertFrom=function(f){var h=f.clone();return h.red=null,h},s.mont=function(f){return new w(f)};function w(f){k.call(this,f),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(w,k),w.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},w.prototype.convertFrom=function(f){var h=this.imod(f.mul(this.rinv));return h.red=null,h},w.prototype.imul=function(f,h){if(f.isZero()||h.isZero())return f.words[0]=0,f.length=1,f;var g=f.imul(h),E=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),D=g.isub(E).iushrn(this.shift),P=D;return D.cmp(this.m)>=0?P=D.isub(this.m):D.cmpn(0)<0&&(P=D.iadd(this.m)),P._forceRed(this)},w.prototype.mul=function(f,h){if(f.isZero()||h.isZero())return new s(0)._forceRed(this);var g=f.mul(h),E=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),D=g.isub(E).iushrn(this.shift),P=D;return D.cmp(this.m)>=0?P=D.isub(this.m):D.cmpn(0)<0&&(P=D.iadd(this.m)),P._forceRed(this)},w.prototype.invm=function(f){var h=this.imod(f._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(t,kv)})(Qv);var bt=Qv.exports;const Zv="bignumber/5.7.0";var qf=bt.BN;const Ms=new Et(Zv),J0={},Xv=9007199254740991;function PE(t){return t!=null&&(sr.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Ui(t)||typeof t=="bigint"||qa(t))}let e3=!1;class sr{constructor(e,r){e!==J0&&Ms.throwError("cannot call constructor directly; use BigNumber.from",Et.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return yi(Tt(this).fromTwos(e))}toTwos(e){return yi(Tt(this).toTwos(e))}abs(){return this._hex[0]==="-"?sr.from(this._hex.substring(1)):this}add(e){return yi(Tt(this).add(Tt(e)))}sub(e){return yi(Tt(this).sub(Tt(e)))}div(e){return sr.from(e).isZero()&&Zi("division-by-zero","div"),yi(Tt(this).div(Tt(e)))}mul(e){return yi(Tt(this).mul(Tt(e)))}mod(e){const r=Tt(e);return r.isNeg()&&Zi("division-by-zero","mod"),yi(Tt(this).umod(r))}pow(e){const r=Tt(e);return r.isNeg()&&Zi("negative-power","pow"),yi(Tt(this).pow(r))}and(e){const r=Tt(e);return(this.isNegative()||r.isNeg())&&Zi("unbound-bitwise-result","and"),yi(Tt(this).and(r))}or(e){const r=Tt(e);return(this.isNegative()||r.isNeg())&&Zi("unbound-bitwise-result","or"),yi(Tt(this).or(r))}xor(e){const r=Tt(e);return(this.isNegative()||r.isNeg())&&Zi("unbound-bitwise-result","xor"),yi(Tt(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Zi("negative-width","mask"),yi(Tt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Zi("negative-width","shl"),yi(Tt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Zi("negative-width","shr"),yi(Tt(this).shrn(e))}eq(e){return Tt(this).eq(Tt(e))}lt(e){return Tt(this).lt(Tt(e))}lte(e){return Tt(this).lte(Tt(e))}gt(e){return Tt(this).gt(Tt(e))}gte(e){return Tt(this).gte(Tt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Tt(this).isZero()}toNumber(){try{return Tt(this).toNumber()}catch{Zi("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Ms.throwError("this platform does not support BigInt",Et.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?e3||(e3=!0,Ms.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Ms.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Et.errors.UNEXPECTED_ARGUMENT,{}):Ms.throwError("BigNumber.toString does not accept parameters",Et.errors.UNEXPECTED_ARGUMENT,{})),Tt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof sr)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new sr(J0,iu(e)):e.match(/^-?[0-9]+$/)?new sr(J0,iu(new qf(e))):Ms.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Zi("underflow","BigNumber.from",e),(e>=Xv||e<=-Xv)&&Zi("overflow","BigNumber.from",e),sr.from(String(e));const r=e;if(typeof r=="bigint")return sr.from(r.toString());if(qa(r))return sr.from(ai(r));if(r)if(r.toHexString){const i=r.toHexString();if(typeof i=="string")return sr.from(i)}else{let i=r._hex;if(i==null&&r.type==="BigNumber"&&(i=r.hex),typeof i=="string"&&(Ui(i)||i[0]==="-"&&Ui(i.substring(1))))return sr.from(i)}return Ms.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function iu(t){if(typeof t!="string")return iu(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Ms.throwArgumentError("invalid hex","value",t),t=iu(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function yi(t){return sr.from(iu(t))}function Tt(t){const e=sr.from(t).toHexString();return e[0]==="-"?new qf("-"+e.substring(3),16):new qf(e.substring(2),16)}function Zi(t,e,r){const i={fault:t,operation:e};return r!=null&&(i.value=r),Ms.throwError(t,Et.errors.NUMERIC_FAULT,i)}function OE(t){return new qf(t,36).toString(16)}const ci=new Et(Zv),nu={},t3=sr.from(0),r3=sr.from(-1);function i3(t,e,r,i){const n={fault:e,operation:r};return i!==void 0&&(n.value=i),ci.throwError(t,Et.errors.NUMERIC_FAULT,n)}let su="0";for(;su.length<256;)su+=su;function Q0(t){if(typeof t!="number")try{t=sr.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+su.substring(0,t):ci.throwArgumentError("invalid decimal size","decimals",t)}function Z0(t,e){e==null&&(e=0);const r=Q0(e);t=sr.from(t);const i=t.lt(t3);i&&(t=t.mul(r3));let n=t.mod(r).toString();for(;n.length<r.length-1;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];const s=t.div(r).toString();return r.length===1?t=s:t=s+"."+n,i&&(t="-"+t),t}function Cs(t,e){e==null&&(e=0);const r=Q0(e);(typeof t!="string"||!t.match(/^-?[0-9.]+$/))&&ci.throwArgumentError("invalid decimal value","value",t);const i=t.substring(0,1)==="-";i&&(t=t.substring(1)),t==="."&&ci.throwArgumentError("missing value","value",t);const n=t.split(".");n.length>2&&ci.throwArgumentError("too many decimal points","value",t);let s=n[0],a=n[1];for(s||(s="0"),a||(a="0");a[a.length-1]==="0";)a=a.substring(0,a.length-1);for(a.length>r.length-1&&i3("fractional component exceeds decimals","underflow","parseFixed"),a===""&&(a="0");a.length<r.length-1;)a+="0";const u=sr.from(s),d=sr.from(a);let p=u.mul(r).add(d);return i&&(p=p.mul(r3)),p}class za{constructor(e,r,i,n){e!==nu&&ci.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Et.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=i,this.decimals=n,this.name=(r?"":"u")+"fixed"+String(i)+"x"+String(n),this._multiplier=Q0(n),Object.freeze(this)}static from(e){if(e instanceof za)return e;typeof e=="number"&&(e=`fixed128x${e}`);let r=!0,i=128,n=18;if(typeof e=="string"){if(e!=="fixed")if(e==="ufixed")r=!1;else{const s=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);s||ci.throwArgumentError("invalid fixed format","format",e),r=s[1]!=="u",i=parseInt(s[2]),n=parseInt(s[3])}}else if(e){const s=(a,u,d)=>e[a]==null?d:(typeof e[a]!==u&&ci.throwArgumentError("invalid fixed format ("+a+" not "+u+")","format."+a,e[a]),e[a]);r=s("signed","boolean",r),i=s("width","number",i),n=s("decimals","number",n)}return i%8&&ci.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",i),n>80&&ci.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new za(nu,r,i,n)}}class qr{constructor(e,r,i,n){e!==nu&&ci.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Et.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=r,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&ci.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Cs(this._value,this.format.decimals),i=Cs(e._value,e.format.decimals);return qr.fromValue(r.add(i),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Cs(this._value,this.format.decimals),i=Cs(e._value,e.format.decimals);return qr.fromValue(r.sub(i),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Cs(this._value,this.format.decimals),i=Cs(e._value,e.format.decimals);return qr.fromValue(r.mul(i).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Cs(this._value,this.format.decimals),i=Cs(e._value,e.format.decimals);return qr.fromValue(r.mul(this.format._multiplier).div(i),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=qr.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return this.isNegative()&&i&&(r=r.subUnsafe(n3.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=qr.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return!this.isNegative()&&i&&(r=r.addUnsafe(n3.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&ci.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const i=qr.from("1"+su.substring(0,e),this.format),n=$E.toFormat(this.format);return this.mulUnsafe(i).addUnsafe(n).floor().divUnsafe(i)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&ci.throwArgumentError("invalid byte width","width",e);const r=sr.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Qn(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return qr.fromString(this._value,e)}static fromValue(e,r,i){return i==null&&r!=null&&!PE(r)&&(i=r,r=null),r==null&&(r=0),i==null&&(i="fixed"),qr.fromString(Z0(e,r),za.from(i))}static fromString(e,r){r==null&&(r="fixed");const i=za.from(r),n=Cs(e,i.decimals);!i.signed&&n.lt(t3)&&i3("unsigned value cannot be negative","overflow","value",e);let s=null;i.signed?s=n.toTwos(i.width).toHexString():(s=n.toHexString(),s=Qn(s,i.width/8));const a=Z0(n,i.decimals);return new qr(nu,s,a,i)}static fromBytes(e,r){r==null&&(r="fixed");const i=za.from(r);if(dr(e).length>i.width/8)throw new Error("overflow");let n=sr.from(e);i.signed&&(n=n.fromTwos(i.width));const s=n.toTwos((i.signed?0:1)+i.width).toHexString(),a=Z0(n,i.decimals);return new qr(nu,s,a,i)}static from(e,r){if(typeof e=="string")return qr.fromString(e,r);if(qa(e))return qr.fromBytes(e,r);try{return qr.fromValue(e,0,r)}catch(i){if(i.code!==Et.errors.INVALID_ARGUMENT)throw i}return ci.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const n3=qr.from(1),$E=qr.from("0.5"),NE="strings/5.7.0",s3=new Et(NE);var zf;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(zf||(zf={}));var Ha;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(Ha||(Ha={}));function RE(t,e,r,i,n){return s3.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function o3(t,e,r,i,n){if(t===Ha.BAD_PREFIX||t===Ha.UNEXPECTED_CONTINUE){let s=0;for(let a=e+1;a<r.length&&r[a]>>6===2;a++)s++;return s}return t===Ha.OVERRUN?r.length-e-1:0}function TE(t,e,r,i,n){return t===Ha.OVERLONG?(i.push(n),0):(i.push(65533),o3(t,e,r))}Object.freeze({error:RE,ignore:o3,replace:TE});function X0(t,e=zf.current){e!=zf.current&&(s3.checkNormalize(),t=t.normalize(e));let r=[];for(let i=0;i<t.length;i++){const n=t.charCodeAt(i);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(n&63|128);else if((n&64512)==55296){i++;const s=t.charCodeAt(i);if(i>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const a=65536+((n&1023)<<10)+(s&1023);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(a&63|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(n&63|128)}return dr(r)}function FE(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e}function ed(t,e){e||(e=function(n){return[parseInt(n,16)]});let r=0,i={};return t.split(",").forEach(n=>{let s=n.split(":");r+=parseInt(s[0],16),i[r]=e(s[1])}),i}function a3(t){let e=0;return t.split(",").map(r=>{let i=r.split("-");i.length===1?i[1]="0":i[1]===""&&(i[1]="1");let n=e+parseInt(i[0],16);return e=parseInt(i[1],16),{l:n,h:e}})}a3("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),ed("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),ed("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),ed("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",FE),a3("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");const c3="hash/5.7.0";function LE(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return dr(e)}function u3(t,e){e==null&&(e=1);const r=[],i=r.forEach,n=function(s,a){i.call(s,function(u){a>0&&Array.isArray(u)?n(u,a-1):r.push(u)})};return n(t,e),r}function BE(t){const e={};for(let r=0;r<t.length;r++){const i=t[r];e[i[0]]=i[1]}return e}function UE(t){let e=0;function r(){return t[e++]<<8|t[e++]}let i=r(),n=1,s=[0,1];for(let z=1;z<i;z++)s.push(n+=r());let a=r(),u=e;e+=a;let d=0,p=0;function y(){return d==0&&(p=p<<8|t[e++],d=8),p>>--d&1}const _=31,C=Math.pow(2,_),I=C>>>1,M=I>>1,B=C-1;let W=0;for(let z=0;z<_;z++)W=W<<1|y();let Y=[],q=0,V=C;for(;;){let z=Math.floor(((W-q+1)*n-1)/V),K=0,A=i;for(;A-K>1;){let re=K+A>>>1;z<s[re]?A=re:K=re}if(K==0)break;Y.push(K);let j=q+Math.floor(V*s[K]/n),ee=q+Math.floor(V*s[K+1]/n)-1;for(;!((j^ee)&I);)W=W<<1&B|y(),j=j<<1&B,ee=ee<<1&B|1;for(;j&~ee&M;)W=W&I|W<<1&B>>>1|y(),j=j<<1^I,ee=(ee^I)<<1|I|1;q=j,V=1+ee-j}let U=i-4;return Y.map(z=>{switch(z-U){case 3:return U+65792+(t[u++]<<16|t[u++]<<8|t[u++]);case 2:return U+256+(t[u++]<<8|t[u++]);case 1:return U+t[u++];default:return z-1}})}function kE(t){let e=0;return()=>t[e++]}function jE(t){return kE(UE(t))}function qE(t){return t&1?~t>>1:t>>1}function zE(t,e){let r=Array(t);for(let i=0;i<t;i++)r[i]=1+e();return r}function f3(t,e){let r=Array(t);for(let i=0,n=-1;i<t;i++)r[i]=n+=1+e();return r}function HE(t,e){let r=Array(t);for(let i=0,n=0;i<t;i++)r[i]=n+=qE(e());return r}function Hf(t,e){let r=f3(t(),t),i=t(),n=f3(i,t),s=zE(i,t);for(let a=0;a<i;a++)for(let u=0;u<s[a];u++)r.push(n[a]+u);return e?r.map(a=>e[a]):r}function KE(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(VE(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(GE(r,t))}return BE(u3(e))}function WE(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function h3(t,e,r){let i=Array(t).fill(void 0).map(()=>[]);for(let n=0;n<e;n++)HE(t,r).forEach((s,a)=>i[a].push(s));return i}function VE(t,e){let r=1+e(),i=e(),n=WE(e),s=h3(n.length,1+t,e);return u3(s.map((a,u)=>{const d=a[0],p=a.slice(1);return Array(n[u]).fill(void 0).map((y,_)=>{let C=_*i;return[d+_*r,p.map(I=>I+C)]})}))}function GE(t,e){let r=1+e();return h3(r,1+t,e).map(i=>[i[0],i.slice(1)])}function YE(t){let e=Hf(t).sort((i,n)=>i-n);return r();function r(){let i=[];for(;;){let p=Hf(t,e);if(p.length==0)break;i.push({set:new Set(p),node:r()})}i.sort((p,y)=>y.set.size-p.set.size);let n=t(),s=n%3;n=n/3|0;let a=!!(n&1);n>>=1;let u=n==1,d=n==2;return{branches:i,valid:s,fe0f:a,save:u,check:d}}}function JE(){return jE(LE("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Kf=JE();new Set(Hf(Kf)),new Set(Hf(Kf)),KE(Kf),YE(Kf),new Et(c3),new Uint8Array(32).fill(0);const QE=`Ethereum Signed Message:
|
|
22
|
+
`;function l3(t){return typeof t=="string"&&(t=X0(t)),Y0(xE([X0(QE),X0(String(t.length)),t]))}const ZE="rlp/5.7.0";new Et(ZE);const XE="address/5.7.0",ou=new Et(XE);function d3(t){Ui(t,20)||ou.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let n=0;n<40;n++)r[n]=e[n].charCodeAt(0);const i=dr(Y0(r));for(let n=0;n<40;n+=2)i[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(i[n>>1]&15)>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}const ex=9007199254740991;function tx(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const td={};for(let t=0;t<10;t++)td[String(t)]=String(t);for(let t=0;t<26;t++)td[String.fromCharCode(65+t)]=String(10+t);const p3=Math.floor(tx(ex));function rx(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(i=>td[i]).join("");for(;e.length>=p3;){let i=e.substring(0,p3);e=parseInt(i,10)%97+e.substring(i.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function ix(t){let e=null;if(typeof t!="string"&&ou.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=d3(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&ou.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==rx(t)&&ou.throwArgumentError("bad icap checksum","address",t),e=OE(t.substring(4));e.length<40;)e="0"+e;e=d3("0x"+e)}else ou.throwArgumentError("invalid address","address",t);return e}const nx="properties/5.7.0";new Et(nx);function au(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}new Et(c3),new Uint8Array(32).fill(0),sr.from(-1);const sx=sr.from(0),ox=sr.from(1);sr.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Qn(ox.toHexString(),32),Qn(sx.toHexString(),32);var Zn={},Ft={},cu=g3;function g3(t,e){if(!t)throw new Error(e||"Assertion failed")}g3.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var rd={exports:{}};typeof Object.create=="function"?rd.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:rd.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var ax=cu,cx=rd.exports;Ft.inherits=cx;function ux(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function fx(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var s=t.charCodeAt(n);s<128?r[i++]=s:s<2048?(r[i++]=s>>6|192,r[i++]=s&63|128):ux(t,n)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++n)&1023),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=s&63|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=s&63|128)}else for(n=0;n<t.length;n++)r[n]=t[n]|0;return r}Ft.toArray=fx;function hx(t){for(var e="",r=0;r<t.length;r++)e+=m3(t[r].toString(16));return e}Ft.toHex=hx;function v3(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Ft.htonl=v3;function lx(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];e==="little"&&(n=v3(n)),r+=b3(n.toString(16))}return r}Ft.toHex32=lx;function m3(t){return t.length===1?"0"+t:t}Ft.zero2=m3;function b3(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}Ft.zero8=b3;function dx(t,e,r,i){var n=r-e;ax(n%4===0);for(var s=new Array(n/4),a=0,u=e;a<s.length;a++,u+=4){var d;i==="big"?d=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:d=t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=d>>>0}return s}Ft.join32=dx;function px(t,e){for(var r=new Array(t.length*4),i=0,n=0;i<t.length;i++,n+=4){var s=t[i];e==="big"?(r[n]=s>>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=s&255):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=s&255)}return r}Ft.split32=px;function gx(t,e){return t>>>e|t<<32-e}Ft.rotr32=gx;function vx(t,e){return t<<e|t>>>32-e}Ft.rotl32=vx;function mx(t,e){return t+e>>>0}Ft.sum32=mx;function bx(t,e,r){return t+e+r>>>0}Ft.sum32_3=bx;function yx(t,e,r,i){return t+e+r+i>>>0}Ft.sum32_4=yx;function wx(t,e,r,i,n){return t+e+r+i+n>>>0}Ft.sum32_5=wx;function _x(t,e,r,i){var n=t[e],s=t[e+1],a=i+s>>>0,u=(a<i?1:0)+r+n;t[e]=u>>>0,t[e+1]=a}Ft.sum64=_x;function Ax(t,e,r,i){var n=e+i>>>0,s=(n<e?1:0)+t+r;return s>>>0}Ft.sum64_hi=Ax;function Ex(t,e,r,i){var n=e+i;return n>>>0}Ft.sum64_lo=Ex;function xx(t,e,r,i,n,s,a,u){var d=0,p=e;p=p+i>>>0,d+=p<e?1:0,p=p+s>>>0,d+=p<s?1:0,p=p+u>>>0,d+=p<u?1:0;var y=t+r+n+a+d;return y>>>0}Ft.sum64_4_hi=xx;function Sx(t,e,r,i,n,s,a,u){var d=e+i+s+u;return d>>>0}Ft.sum64_4_lo=Sx;function Ix(t,e,r,i,n,s,a,u,d,p){var y=0,_=e;_=_+i>>>0,y+=_<e?1:0,_=_+s>>>0,y+=_<s?1:0,_=_+u>>>0,y+=_<u?1:0,_=_+p>>>0,y+=_<p?1:0;var C=t+r+n+a+d+y;return C>>>0}Ft.sum64_5_hi=Ix;function Mx(t,e,r,i,n,s,a,u,d,p){var y=e+i+s+u+p;return y>>>0}Ft.sum64_5_lo=Mx;function Cx(t,e,r){var i=e<<32-r|t>>>r;return i>>>0}Ft.rotr64_hi=Cx;function Dx(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}Ft.rotr64_lo=Dx;function Px(t,e,r){return t>>>r}Ft.shr64_hi=Px;function Ox(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}Ft.shr64_lo=Ox;var Ka={},y3=Ft,$x=cu;function Wf(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Ka.BlockHash=Wf,Wf.prototype.update=function(t,e){if(t=y3.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),this.pending.length===0&&(this.pending=null),t=y3.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},Wf.prototype.digest=function(t){return this.update(this._pad()),$x(this.pending===null),this._digest(t)},Wf.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(t<<=3,this.endian==="big"){for(var s=8;s<this.padLength;s++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=t&255}else for(i[n++]=t&255,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s<this.padLength;s++)i[n++]=0;return i};var Wa={},Xn={},Nx=Ft,es=Nx.rotr32;function Rx(t,e,r,i){if(t===0)return w3(e,r,i);if(t===1||t===3)return A3(e,r,i);if(t===2)return _3(e,r,i)}Xn.ft_1=Rx;function w3(t,e,r){return t&e^~t&r}Xn.ch32=w3;function _3(t,e,r){return t&e^t&r^e&r}Xn.maj32=_3;function A3(t,e,r){return t^e^r}Xn.p32=A3;function Tx(t){return es(t,2)^es(t,13)^es(t,22)}Xn.s0_256=Tx;function Fx(t){return es(t,6)^es(t,11)^es(t,25)}Xn.s1_256=Fx;function Lx(t){return es(t,7)^es(t,18)^t>>>3}Xn.g0_256=Lx;function Bx(t){return es(t,17)^es(t,19)^t>>>10}Xn.g1_256=Bx;var Va=Ft,Ux=Ka,kx=Xn,id=Va.rotl32,uu=Va.sum32,jx=Va.sum32_5,qx=kx.ft_1,E3=Ux.BlockHash,zx=[1518500249,1859775393,2400959708,3395469782];function ts(){if(!(this instanceof ts))return new ts;E3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Va.inherits(ts,E3);var Hx=ts;ts.blockSize=512,ts.outSize=160,ts.hmacStrength=80,ts.padLength=64,ts.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=id(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],s=this.h[1],a=this.h[2],u=this.h[3],d=this.h[4];for(i=0;i<r.length;i++){var p=~~(i/20),y=jx(id(n,5),qx(p,s,a,u),d,r[i],zx[p]);d=u,u=a,a=id(s,30),s=n,n=y}this.h[0]=uu(this.h[0],n),this.h[1]=uu(this.h[1],s),this.h[2]=uu(this.h[2],a),this.h[3]=uu(this.h[3],u),this.h[4]=uu(this.h[4],d)},ts.prototype._digest=function(t){return t==="hex"?Va.toHex32(this.h,"big"):Va.split32(this.h,"big")};var Ga=Ft,Kx=Ka,Ya=Xn,Wx=cu,En=Ga.sum32,Vx=Ga.sum32_4,Gx=Ga.sum32_5,Yx=Ya.ch32,Jx=Ya.maj32,Qx=Ya.s0_256,Zx=Ya.s1_256,Xx=Ya.g0_256,eS=Ya.g1_256,x3=Kx.BlockHash,tS=[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 rs(){if(!(this instanceof rs))return new rs;x3.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=tS,this.W=new Array(64)}Ga.inherits(rs,x3);var S3=rs;rs.blockSize=512,rs.outSize=256,rs.hmacStrength=192,rs.padLength=64,rs.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=Vx(eS(r[i-2]),r[i-7],Xx(r[i-15]),r[i-16]);var n=this.h[0],s=this.h[1],a=this.h[2],u=this.h[3],d=this.h[4],p=this.h[5],y=this.h[6],_=this.h[7];for(Wx(this.k.length===r.length),i=0;i<r.length;i++){var C=Gx(_,Zx(d),Yx(d,p,y),this.k[i],r[i]),I=En(Qx(n),Jx(n,s,a));_=y,y=p,p=d,d=En(u,C),u=a,a=s,s=n,n=En(C,I)}this.h[0]=En(this.h[0],n),this.h[1]=En(this.h[1],s),this.h[2]=En(this.h[2],a),this.h[3]=En(this.h[3],u),this.h[4]=En(this.h[4],d),this.h[5]=En(this.h[5],p),this.h[6]=En(this.h[6],y),this.h[7]=En(this.h[7],_)},rs.prototype._digest=function(t){return t==="hex"?Ga.toHex32(this.h,"big"):Ga.split32(this.h,"big")};var nd=Ft,I3=S3;function Ds(){if(!(this instanceof Ds))return new Ds;I3.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}nd.inherits(Ds,I3);var rS=Ds;Ds.blockSize=512,Ds.outSize=224,Ds.hmacStrength=192,Ds.padLength=64,Ds.prototype._digest=function(t){return t==="hex"?nd.toHex32(this.h.slice(0,7),"big"):nd.split32(this.h.slice(0,7),"big")};var wi=Ft,iS=Ka,nS=cu,is=wi.rotr64_hi,ns=wi.rotr64_lo,M3=wi.shr64_hi,C3=wi.shr64_lo,eo=wi.sum64,sd=wi.sum64_hi,od=wi.sum64_lo,sS=wi.sum64_4_hi,oS=wi.sum64_4_lo,aS=wi.sum64_5_hi,cS=wi.sum64_5_lo,D3=iS.BlockHash,uS=[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 xn(){if(!(this instanceof xn))return new xn;D3.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=uS,this.W=new Array(160)}wi.inherits(xn,D3);var P3=xn;xn.blockSize=1024,xn.outSize=512,xn.hmacStrength=192,xn.padLength=128,xn.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i<r.length;i+=2){var n=wS(r[i-4],r[i-3]),s=_S(r[i-4],r[i-3]),a=r[i-14],u=r[i-13],d=bS(r[i-30],r[i-29]),p=yS(r[i-30],r[i-29]),y=r[i-32],_=r[i-31];r[i]=sS(n,s,a,u,d,p,y,_),r[i+1]=oS(n,s,a,u,d,p,y,_)}},xn.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,i=this.h[0],n=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],d=this.h[5],p=this.h[6],y=this.h[7],_=this.h[8],C=this.h[9],I=this.h[10],M=this.h[11],B=this.h[12],W=this.h[13],Y=this.h[14],q=this.h[15];nS(this.k.length===r.length);for(var V=0;V<r.length;V+=2){var U=Y,z=q,K=vS(_,C),A=mS(_,C),j=fS(_,C,I,M,B),ee=hS(_,C,I,M,B,W),re=this.k[V],k=this.k[V+1],w=r[V],f=r[V+1],h=aS(U,z,K,A,j,ee,re,k,w,f),g=cS(U,z,K,A,j,ee,re,k,w,f);U=pS(i,n),z=gS(i,n),K=lS(i,n,s,a,u),A=dS(i,n,s,a,u,d);var E=sd(U,z,K,A),D=od(U,z,K,A);Y=B,q=W,B=I,W=M,I=_,M=C,_=sd(p,y,h,g),C=od(y,y,h,g),p=u,y=d,u=s,d=a,s=i,a=n,i=sd(h,g,E,D),n=od(h,g,E,D)}eo(this.h,0,i,n),eo(this.h,2,s,a),eo(this.h,4,u,d),eo(this.h,6,p,y),eo(this.h,8,_,C),eo(this.h,10,I,M),eo(this.h,12,B,W),eo(this.h,14,Y,q)},xn.prototype._digest=function(t){return t==="hex"?wi.toHex32(this.h,"big"):wi.split32(this.h,"big")};function fS(t,e,r,i,n){var s=t&r^~t&n;return s<0&&(s+=4294967296),s}function hS(t,e,r,i,n,s){var a=e&i^~e&s;return a<0&&(a+=4294967296),a}function lS(t,e,r,i,n){var s=t&r^t&n^r&n;return s<0&&(s+=4294967296),s}function dS(t,e,r,i,n,s){var a=e&i^e&s^i&s;return a<0&&(a+=4294967296),a}function pS(t,e){var r=is(t,e,28),i=is(e,t,2),n=is(e,t,7),s=r^i^n;return s<0&&(s+=4294967296),s}function gS(t,e){var r=ns(t,e,28),i=ns(e,t,2),n=ns(e,t,7),s=r^i^n;return s<0&&(s+=4294967296),s}function vS(t,e){var r=is(t,e,14),i=is(t,e,18),n=is(e,t,9),s=r^i^n;return s<0&&(s+=4294967296),s}function mS(t,e){var r=ns(t,e,14),i=ns(t,e,18),n=ns(e,t,9),s=r^i^n;return s<0&&(s+=4294967296),s}function bS(t,e){var r=is(t,e,1),i=is(t,e,8),n=M3(t,e,7),s=r^i^n;return s<0&&(s+=4294967296),s}function yS(t,e){var r=ns(t,e,1),i=ns(t,e,8),n=C3(t,e,7),s=r^i^n;return s<0&&(s+=4294967296),s}function wS(t,e){var r=is(t,e,19),i=is(e,t,29),n=M3(t,e,6),s=r^i^n;return s<0&&(s+=4294967296),s}function _S(t,e){var r=ns(t,e,19),i=ns(e,t,29),n=C3(t,e,6),s=r^i^n;return s<0&&(s+=4294967296),s}var ad=Ft,O3=P3;function Ps(){if(!(this instanceof Ps))return new Ps;O3.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}ad.inherits(Ps,O3);var AS=Ps;Ps.blockSize=1024,Ps.outSize=384,Ps.hmacStrength=192,Ps.padLength=128,Ps.prototype._digest=function(t){return t==="hex"?ad.toHex32(this.h.slice(0,12),"big"):ad.split32(this.h.slice(0,12),"big")},Wa.sha1=Hx,Wa.sha224=rS,Wa.sha256=S3,Wa.sha384=AS,Wa.sha512=P3;var $3={},ko=Ft,ES=Ka,Vf=ko.rotl32,N3=ko.sum32,fu=ko.sum32_3,R3=ko.sum32_4,T3=ES.BlockHash;function ss(){if(!(this instanceof ss))return new ss;T3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}ko.inherits(ss,T3),$3.ripemd160=ss,ss.blockSize=512,ss.outSize=160,ss.hmacStrength=192,ss.padLength=64,ss.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],s=this.h[3],a=this.h[4],u=r,d=i,p=n,y=s,_=a,C=0;C<80;C++){var I=N3(Vf(R3(r,F3(C,i,n,s),t[IS[C]+e],xS(C)),CS[C]),a);r=a,a=s,s=Vf(n,10),n=i,i=I,I=N3(Vf(R3(u,F3(79-C,d,p,y),t[MS[C]+e],SS(C)),DS[C]),_),u=_,_=y,y=Vf(p,10),p=d,d=I}I=fu(this.h[1],n,y),this.h[1]=fu(this.h[2],s,_),this.h[2]=fu(this.h[3],a,u),this.h[3]=fu(this.h[4],r,d),this.h[4]=fu(this.h[0],i,p),this.h[0]=I},ss.prototype._digest=function(t){return t==="hex"?ko.toHex32(this.h,"little"):ko.split32(this.h,"little")};function F3(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function xS(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function SS(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var IS=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],MS=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],CS=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],DS=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],PS=Ft,OS=cu;function Ja(t,e,r){if(!(this instanceof Ja))return new Ja(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(PS.toArray(e,r))}var $S=Ja;Ja.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),OS(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=new this.Hash().update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=new this.Hash().update(t)},Ja.prototype.update=function(t,e){return this.inner.update(t,e),this},Ja.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},function(t){var e=t;e.utils=Ft,e.common=Ka,e.sha=Wa,e.ripemd=$3,e.hmac=$S,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(Zn);function Qa(t,e,r){return r={path:e,exports:{},require:function(i,n){return NS(i,n??r.path)}},t(r,r.exports),r.exports}function NS(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var cd=L3;function L3(t,e){if(!t)throw new Error(e||"Assertion failed")}L3.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var Sn=Qa(function(t,e){var r=e;function i(a,u){if(Array.isArray(a))return a.slice();if(!a)return[];var d=[];if(typeof a!="string"){for(var p=0;p<a.length;p++)d[p]=a[p]|0;return d}if(u==="hex"){a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a);for(var p=0;p<a.length;p+=2)d.push(parseInt(a[p]+a[p+1],16))}else for(var p=0;p<a.length;p++){var y=a.charCodeAt(p),_=y>>8,C=y&255;_?d.push(_,C):d.push(C)}return d}r.toArray=i;function n(a){return a.length===1?"0"+a:a}r.zero2=n;function s(a){for(var u="",d=0;d<a.length;d++)u+=n(a[d].toString(16));return u}r.toHex=s,r.encode=function(a,u){return u==="hex"?s(a):a}}),ki=Qa(function(t,e){var r=e;r.assert=cd,r.toArray=Sn.toArray,r.zero2=Sn.zero2,r.toHex=Sn.toHex,r.encode=Sn.encode;function i(d,p,y){var _=new Array(Math.max(d.bitLength(),y)+1);_.fill(0);for(var C=1<<p+1,I=d.clone(),M=0;M<_.length;M++){var B,W=I.andln(C-1);I.isOdd()?(W>(C>>1)-1?B=(C>>1)-W:B=W,I.isubn(B)):B=0,_[M]=B,I.iushrn(1)}return _}r.getNAF=i;function n(d,p){var y=[[],[]];d=d.clone(),p=p.clone();for(var _=0,C=0,I;d.cmpn(-_)>0||p.cmpn(-C)>0;){var M=d.andln(3)+_&3,B=p.andln(3)+C&3;M===3&&(M=-1),B===3&&(B=-1);var W;M&1?(I=d.andln(7)+_&7,(I===3||I===5)&&B===2?W=-M:W=M):W=0,y[0].push(W);var Y;B&1?(I=p.andln(7)+C&7,(I===3||I===5)&&M===2?Y=-B:Y=B):Y=0,y[1].push(Y),2*_===W+1&&(_=1-_),2*C===Y+1&&(C=1-C),d.iushrn(1),p.iushrn(1)}return y}r.getJSF=n;function s(d,p,y){var _="_"+p;d.prototype[p]=function(){return this[_]!==void 0?this[_]:this[_]=y.call(this)}}r.cachedProperty=s;function a(d){return typeof d=="string"?r.toArray(d,"hex"):d}r.parseBytes=a;function u(d){return new bt(d,"hex","le")}r.intFromLE=u}),Gf=ki.getNAF,RS=ki.getJSF,Yf=ki.assert;function to(t,e){this.type=t,this.p=new bt(e.p,16),this.red=e.prime?bt.red(e.prime):bt.mont(this.p),this.zero=new bt(0).toRed(this.red),this.one=new bt(1).toRed(this.red),this.two=new bt(2).toRed(this.red),this.n=e.n&&new bt(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var jo=to;to.prototype.point=function(){throw new Error("Not implemented")},to.prototype.validate=function(){throw new Error("Not implemented")},to.prototype._fixedNafMul=function(t,e){Yf(t.precomputed);var r=t._getDoubles(),i=Gf(e,1,this._bitLength),n=(1<<r.step+1)-(r.step%2===0?2:1);n/=3;var s=[],a,u;for(a=0;a<i.length;a+=r.step){u=0;for(var d=a+r.step-1;d>=a;d--)u=(u<<1)+i[d];s.push(u)}for(var p=this.jpoint(null,null,null),y=this.jpoint(null,null,null),_=n;_>0;_--){for(a=0;a<s.length;a++)u=s[a],u===_?y=y.mixedAdd(r.points[a]):u===-_&&(y=y.mixedAdd(r.points[a].neg()));p=p.add(y)}return p.toP()},to.prototype._wnafMul=function(t,e){var r=4,i=t._getNAFPoints(r);r=i.wnd;for(var n=i.points,s=Gf(e,r,this._bitLength),a=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(var d=0;u>=0&&s[u]===0;u--)d++;if(u>=0&&d++,a=a.dblp(d),u<0)break;var p=s[u];Yf(p!==0),t.type==="affine"?p>0?a=a.mixedAdd(n[p-1>>1]):a=a.mixedAdd(n[-p-1>>1].neg()):p>0?a=a.add(n[p-1>>1]):a=a.add(n[-p-1>>1].neg())}return t.type==="affine"?a.toP():a},to.prototype._wnafMulAdd=function(t,e,r,i,n){var s=this._wnafT1,a=this._wnafT2,u=this._wnafT3,d=0,p,y,_;for(p=0;p<i;p++){_=e[p];var C=_._getNAFPoints(t);s[p]=C.wnd,a[p]=C.points}for(p=i-1;p>=1;p-=2){var I=p-1,M=p;if(s[I]!==1||s[M]!==1){u[I]=Gf(r[I],s[I],this._bitLength),u[M]=Gf(r[M],s[M],this._bitLength),d=Math.max(u[I].length,d),d=Math.max(u[M].length,d);continue}var B=[e[I],null,null,e[M]];e[I].y.cmp(e[M].y)===0?(B[1]=e[I].add(e[M]),B[2]=e[I].toJ().mixedAdd(e[M].neg())):e[I].y.cmp(e[M].y.redNeg())===0?(B[1]=e[I].toJ().mixedAdd(e[M]),B[2]=e[I].add(e[M].neg())):(B[1]=e[I].toJ().mixedAdd(e[M]),B[2]=e[I].toJ().mixedAdd(e[M].neg()));var W=[-3,-1,-5,-7,0,7,5,1,3],Y=RS(r[I],r[M]);for(d=Math.max(Y[0].length,d),u[I]=new Array(d),u[M]=new Array(d),y=0;y<d;y++){var q=Y[0][y]|0,V=Y[1][y]|0;u[I][y]=W[(q+1)*3+(V+1)],u[M][y]=0,a[I]=B}}var U=this.jpoint(null,null,null),z=this._wnafT4;for(p=d;p>=0;p--){for(var K=0;p>=0;){var A=!0;for(y=0;y<i;y++)z[y]=u[y][p]|0,z[y]!==0&&(A=!1);if(!A)break;K++,p--}if(p>=0&&K++,U=U.dblp(K),p<0)break;for(y=0;y<i;y++){var j=z[y];j!==0&&(j>0?_=a[y][j-1>>1]:j<0&&(_=a[y][-j-1>>1].neg()),_.type==="affine"?U=U.mixedAdd(_):U=U.add(_))}}for(p=0;p<i;p++)a[p]=null;return n?U:U.toP()};function Xi(t,e){this.curve=t,this.type=e,this.precomputed=null}to.BasePoint=Xi,Xi.prototype.eq=function(){throw new Error("Not implemented")},Xi.prototype.validate=function(){return this.curve.validate(this)},to.prototype.decodePoint=function(t,e){t=ki.toArray(t,e);var r=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*r){t[0]===6?Yf(t[t.length-1]%2===0):t[0]===7&&Yf(t[t.length-1]%2===1);var i=this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));return i}else if((t[0]===2||t[0]===3)&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),t[0]===3);throw new Error("Unknown point format")},Xi.prototype.encodeCompressed=function(t){return this.encode(t,!0)},Xi.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},Xi.prototype.encode=function(t,e){return ki.encode(this._encode(e),t)},Xi.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},Xi.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return e?e.points.length>=Math.ceil((t.bitLength()+1)/e.step):!1},Xi.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<e;n+=t){for(var s=0;s<t;s++)i=i.dbl();r.push(i)}return{step:t,points:r}},Xi.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,i=r===1?null:this.dbl(),n=1;n<r;n++)e[n]=e[n-1].add(i);return{wnd:t,points:e}},Xi.prototype._getBeta=function(){return null},Xi.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e};var ud=Qa(function(t){typeof Object.create=="function"?t.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}}),TS=ki.assert;function en(t){jo.call(this,"short",t),this.a=new bt(t.a,16).toRed(this.red),this.b=new bt(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}ud(en,jo);var FS=en;en.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,r;if(t.beta)e=new bt(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=i[0].cmp(i[1])<0?i[0]:i[1],e=e.toRed(this.red)}if(t.lambda)r=new bt(t.lambda,16);else{var n=this._getEndoRoots(this.n);this.g.mul(n[0]).x.cmp(this.g.x.redMul(e))===0?r=n[0]:(r=n[1],TS(this.g.mul(r).x.cmp(this.g.x.redMul(e))===0))}var s;return t.basis?s=t.basis.map(function(a){return{a:new bt(a.a,16),b:new bt(a.b,16)}}):s=this._getEndoBasis(r),{beta:e,lambda:r,basis:s}}},en.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:bt.mont(t),r=new bt(2).toRed(e).redInvm(),i=r.redNeg(),n=new bt(3).toRed(e).redNeg().redSqrt().redMul(r),s=i.redAdd(n).fromRed(),a=i.redSub(n).fromRed();return[s,a]},en.prototype._getEndoBasis=function(t){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),r=t,i=this.n.clone(),n=new bt(1),s=new bt(0),a=new bt(0),u=new bt(1),d,p,y,_,C,I,M,B=0,W,Y;r.cmpn(0)!==0;){var q=i.div(r);W=i.sub(q.mul(r)),Y=a.sub(q.mul(n));var V=u.sub(q.mul(s));if(!y&&W.cmp(e)<0)d=M.neg(),p=n,y=W.neg(),_=Y;else if(y&&++B===2)break;M=W,i=r,r=W,a=n,n=Y,u=s,s=V}C=W.neg(),I=Y;var U=y.sqr().add(_.sqr()),z=C.sqr().add(I.sqr());return z.cmp(U)>=0&&(C=d,I=p),y.negative&&(y=y.neg(),_=_.neg()),C.negative&&(C=C.neg(),I=I.neg()),[{a:y,b:_},{a:C,b:I}]},en.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),a=n.mul(r.a),u=s.mul(i.a),d=n.mul(r.b),p=s.mul(i.b),y=t.sub(a).sub(u),_=d.add(p).neg();return{k1:y,k2:_}},en.prototype.pointFromX=function(t,e){t=new bt(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(i.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},en.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return r.redSqr().redISub(n).cmpn(0)===0},en.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s<t.length;s++){var a=this._endoSplit(e[s]),u=t[s],d=u._getBeta();a.k1.negative&&(a.k1.ineg(),u=u.neg(!0)),a.k2.negative&&(a.k2.ineg(),d=d.neg(!0)),i[s*2]=u,i[s*2+1]=d,n[s*2]=a.k1,n[s*2+1]=a.k2}for(var p=this._wnafMulAdd(1,i,n,s*2,r),y=0;y<s*2;y++)i[y]=null,n[y]=null;return p};function Nr(t,e,r,i){jo.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new bt(e,16),this.y=new bt(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}ud(Nr,jo.BasePoint),en.prototype.point=function(t,e,r){return new Nr(this,t,e,r)},en.prototype.pointFromJSON=function(t,e){return Nr.fromJSON(this,t,e)},Nr.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(n){return r.point(n.x.redMul(r.endo.beta),n.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},Nr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Nr.fromJSON=function(t,e,r){typeof e=="string"&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(a){return t.point(a[0],a[1],r)}var s=e[2];return i.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[i].concat(s.doubles.points.map(n))},naf:s.naf&&{wnd:s.naf.wnd,points:[i].concat(s.naf.points.map(n))}},i},Nr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Nr.prototype.isInfinity=function(){return this.inf},Nr.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},Nr.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,a)},Nr.prototype.getX=function(){return this.x.fromRed()},Nr.prototype.getY=function(){return this.y.fromRed()},Nr.prototype.mul=function(t){return t=new bt(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},Nr.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},Nr.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},Nr.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},Nr.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(n){return n.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},Nr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function zr(t,e,r,i){jo.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new bt(0)):(this.x=new bt(e,16),this.y=new bt(r,16),this.z=new bt(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}ud(zr,jo.BasePoint),en.prototype.jpoint=function(t,e,r){return new zr(this,t,e,r)},zr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},zr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},zr.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),u=i.redSub(n),d=s.redSub(a);if(u.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=u.redSqr(),y=p.redMul(u),_=i.redMul(p),C=d.redSqr().redIAdd(y).redISub(_).redISub(_),I=d.redMul(_.redISub(C)).redISub(s.redMul(y)),M=this.z.redMul(t.z).redMul(u);return this.curve.jpoint(C,I,M)},zr.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),a=r.redSub(i),u=n.redSub(s);if(a.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var d=a.redSqr(),p=d.redMul(a),y=r.redMul(d),_=u.redSqr().redIAdd(p).redISub(y).redISub(y),C=u.redMul(y.redISub(_)).redISub(n.redMul(p)),I=this.z.redMul(a);return this.curve.jpoint(_,C,I)},zr.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,s=this.x,a=this.y,u=this.z,d=u.redSqr().redSqr(),p=a.redAdd(a);for(e=0;e<t;e++){var y=s.redSqr(),_=p.redSqr(),C=_.redSqr(),I=y.redAdd(y).redIAdd(y).redIAdd(i.redMul(d)),M=s.redMul(_),B=I.redSqr().redISub(M.redAdd(M)),W=M.redISub(B),Y=I.redMul(W);Y=Y.redIAdd(Y).redISub(C);var q=p.redMul(u);e+1<t&&(d=d.redMul(C)),s=B,u=q,p=Y}return this.curve.jpoint(s,p.redMul(n),u)},zr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},zr.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),a=this.x.redAdd(n).redSqr().redISub(i).redISub(s);a=a.redIAdd(a);var u=i.redAdd(i).redIAdd(i),d=u.redSqr().redISub(a).redISub(a),p=s.redIAdd(s);p=p.redIAdd(p),p=p.redIAdd(p),t=d,e=u.redMul(a.redISub(d)).redISub(p),r=this.y.redAdd(this.y)}else{var y=this.x.redSqr(),_=this.y.redSqr(),C=_.redSqr(),I=this.x.redAdd(_).redSqr().redISub(y).redISub(C);I=I.redIAdd(I);var M=y.redAdd(y).redIAdd(y),B=M.redSqr(),W=C.redIAdd(C);W=W.redIAdd(W),W=W.redIAdd(W),t=B.redISub(I).redISub(I),e=M.redMul(I.redISub(t)).redISub(W),r=this.y.redMul(this.z),r=r.redIAdd(r)}return this.curve.jpoint(t,e,r)},zr.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),a=this.x.redAdd(n).redSqr().redISub(i).redISub(s);a=a.redIAdd(a);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),d=u.redSqr().redISub(a).redISub(a);t=d;var p=s.redIAdd(s);p=p.redIAdd(p),p=p.redIAdd(p),e=u.redMul(a.redISub(d)).redISub(p),r=this.y.redAdd(this.y)}else{var y=this.z.redSqr(),_=this.y.redSqr(),C=this.x.redMul(_),I=this.x.redSub(y).redMul(this.x.redAdd(y));I=I.redAdd(I).redIAdd(I);var M=C.redIAdd(C);M=M.redIAdd(M);var B=M.redAdd(M);t=I.redSqr().redISub(B),r=this.y.redAdd(this.z).redSqr().redISub(_).redISub(y);var W=_.redSqr();W=W.redIAdd(W),W=W.redIAdd(W),W=W.redIAdd(W),e=I.redMul(M.redISub(t)).redISub(W)}return this.curve.jpoint(t,e,r)},zr.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),s=e.redSqr(),a=r.redSqr(),u=s.redAdd(s).redIAdd(s).redIAdd(t.redMul(n)),d=e.redAdd(e);d=d.redIAdd(d);var p=d.redMul(a),y=u.redSqr().redISub(p.redAdd(p)),_=p.redISub(y),C=a.redSqr();C=C.redIAdd(C),C=C.redIAdd(C),C=C.redIAdd(C);var I=u.redMul(_).redISub(C),M=r.redAdd(r).redMul(i);return this.curve.jpoint(y,I,M)},zr.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),n=t.redAdd(t).redIAdd(t),s=n.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(i);a=a.redIAdd(a),a=a.redAdd(a).redIAdd(a),a=a.redISub(s);var u=a.redSqr(),d=i.redIAdd(i);d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var p=n.redIAdd(a).redSqr().redISub(s).redISub(u).redISub(d),y=e.redMul(p);y=y.redIAdd(y),y=y.redIAdd(y);var _=this.x.redMul(u).redISub(y);_=_.redIAdd(_),_=_.redIAdd(_);var C=this.y.redMul(p.redMul(d.redISub(p)).redISub(a.redMul(u)));C=C.redIAdd(C),C=C.redIAdd(C),C=C.redIAdd(C);var I=this.z.redAdd(a).redSqr().redISub(r).redISub(u);return this.curve.jpoint(_,C,I)},zr.prototype.mul=function(t,e){return t=new bt(t,e),this.curve._wnafMul(this,t)},zr.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0)!==0)return!1;var i=e.redMul(this.z),n=r.redMul(t.z);return this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0)===0},zr.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(this.x.cmp(r)===0)return!0;for(var i=t.clone(),n=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),this.x.cmp(r)===0)return!0}},zr.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},zr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Jf=Qa(function(t,e){var r=e;r.base=jo,r.short=FS,r.mont=null,r.edwards=null}),Qf=Qa(function(t,e){var r=e,i=ki.assert;function n(u){u.type==="short"?this.curve=new Jf.short(u):u.type==="edwards"?this.curve=new Jf.edwards(u):this.curve=new Jf.mont(u),this.g=this.curve.g,this.n=this.curve.n,this.hash=u.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=n;function s(u,d){Object.defineProperty(r,u,{configurable:!0,enumerable:!0,get:function(){var p=new n(d);return Object.defineProperty(r,u,{configurable:!0,enumerable:!0,value:p}),p}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Zn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Zn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Zn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Zn.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Zn.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Zn.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Zn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var a;try{a=null.crash()}catch{a=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Zn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",a]})});function ro(t){if(!(this instanceof ro))return new ro(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Sn.toArray(t.entropy,t.entropyEnc||"hex"),r=Sn.toArray(t.nonce,t.nonceEnc||"hex"),i=Sn.toArray(t.pers,t.persEnc||"hex");cd(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var B3=ro;ro.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},ro.prototype._hmac=function(){return new Zn.hmac(this.hash,this.K)},ro.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},ro.prototype.reseed=function(t,e,r,i){typeof e!="string"&&(i=r,r=e,e=null),t=Sn.toArray(t,e),r=Sn.toArray(r,i),cd(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},ro.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(i=r,r=e,e=null),r&&(r=Sn.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<t;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var s=n.slice(0,t);return this._update(r),this._reseed++,Sn.encode(s,e)};var fd=ki.assert;function Qr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var hd=Qr;Qr.fromPublic=function(t,e,r){return e instanceof Qr?e:new Qr(t,{pub:e,pubEnc:r})},Qr.fromPrivate=function(t,e,r){return e instanceof Qr?e:new Qr(t,{priv:e,privEnc:r})},Qr.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Qr.prototype.getPublic=function(t,e){return typeof t=="string"&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},Qr.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv},Qr.prototype._importPrivate=function(t,e){this.priv=new bt(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},Qr.prototype._importPublic=function(t,e){if(t.x||t.y){this.ec.curve.type==="mont"?fd(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&fd(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,e)},Qr.prototype.derive=function(t){return t.validate()||fd(t.validate(),"public point not validated"),t.mul(this.priv).getX()},Qr.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},Qr.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},Qr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var LS=ki.assert;function Zf(t,e){if(t instanceof Zf)return t;this._importDER(t,e)||(LS(t.r&&t.s,"Signature without r or s"),this.r=new bt(t.r,16),this.s=new bt(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Xf=Zf;function BS(){this.place=0}function ld(t,e){var r=t[e.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4)return!1;for(var n=0,s=0,a=e.place;s<i;s++,a++)n<<=8,n|=t[a],n>>>=0;return n<=127?!1:(e.place=a,n)}function U3(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}Zf.prototype._importDER=function(t,e){t=ki.toArray(t,e);var r=new BS;if(t[r.place++]!==48)return!1;var i=ld(t,r);if(i===!1||i+r.place!==t.length||t[r.place++]!==2)return!1;var n=ld(t,r);if(n===!1)return!1;var s=t.slice(r.place,n+r.place);if(r.place+=n,t[r.place++]!==2)return!1;var a=ld(t,r);if(a===!1||t.length!==a+r.place)return!1;var u=t.slice(r.place,a+r.place);if(s[0]===0)if(s[1]&128)s=s.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new bt(s),this.s=new bt(u),this.recoveryParam=null,!0};function dd(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Zf.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(e[0]&128&&(e=[0].concat(e)),r[0]&128&&(r=[0].concat(r)),e=U3(e),r=U3(r);!r[0]&&!(r[1]&128);)r=r.slice(1);var i=[2];dd(i,e.length),i=i.concat(e),i.push(2),dd(i,r.length);var n=i.concat(r),s=[48];return dd(s,n.length),s=s.concat(n),ki.encode(s,t)};var US=function(){throw new Error("unsupported")},k3=ki.assert;function tn(t){if(!(this instanceof tn))return new tn(t);typeof t=="string"&&(k3(Object.prototype.hasOwnProperty.call(Qf,t),"Unknown curve "+t),t=Qf[t]),t instanceof Qf.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var kS=tn;tn.prototype.keyPair=function(t){return new hd(this,t)},tn.prototype.keyFromPrivate=function(t,e){return hd.fromPrivate(this,t,e)},tn.prototype.keyFromPublic=function(t,e){return hd.fromPublic(this,t,e)},tn.prototype.genKeyPair=function(t){t||(t={});for(var e=new B3({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||US(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new bt(2));;){var n=new bt(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},tn.prototype._truncateToN=function(t,e){var r=t.byteLength()*8-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},tn.prototype.sign=function(t,e,r,i){typeof r=="object"&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new bt(t,16));for(var n=this.n.byteLength(),s=e.getPrivate().toArray("be",n),a=t.toArray("be",n),u=new B3({hash:this.hash,entropy:s,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),d=this.n.sub(new bt(1)),p=0;;p++){var y=i.k?i.k(p):new bt(u.generate(this.n.byteLength()));if(y=this._truncateToN(y,!0),!(y.cmpn(1)<=0||y.cmp(d)>=0)){var _=this.g.mul(y);if(!_.isInfinity()){var C=_.getX(),I=C.umod(this.n);if(I.cmpn(0)!==0){var M=y.invm(this.n).mul(I.mul(e.getPrivate()).iadd(t));if(M=M.umod(this.n),M.cmpn(0)!==0){var B=(_.getY().isOdd()?1:0)|(C.cmp(I)!==0?2:0);return i.canonical&&M.cmp(this.nh)>0&&(M=this.n.sub(M),B^=1),new Xf({r:I,s:M,recoveryParam:B})}}}}}},tn.prototype.verify=function(t,e,r,i){t=this._truncateToN(new bt(t,16)),r=this.keyFromPublic(r,i),e=new Xf(e,"hex");var n=e.r,s=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a=s.invm(this.n),u=a.mul(t).umod(this.n),d=a.mul(n).umod(this.n),p;return this.curve._maxwellTrick?(p=this.g.jmulAdd(u,r.getPublic(),d),p.isInfinity()?!1:p.eqXToP(n)):(p=this.g.mulAdd(u,r.getPublic(),d),p.isInfinity()?!1:p.getX().umod(this.n).cmp(n)===0)},tn.prototype.recoverPubKey=function(t,e,r,i){k3((3&r)===r,"The recovery param is more than two bits"),e=new Xf(e,i);var n=this.n,s=new bt(t),a=e.r,u=e.s,d=r&1,p=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");p?a=this.curve.pointFromX(a.add(this.curve.n),d):a=this.curve.pointFromX(a,d);var y=e.r.invm(n),_=n.sub(s).mul(y).umod(n),C=u.mul(y).umod(n);return this.g.mulAdd(_,a,C)},tn.prototype.getKeyRecoveryParam=function(t,e,r,i){if(e=new Xf(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch{continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var jS=Qa(function(t,e){var r=e;r.version="6.5.4",r.utils=ki,r.rand=function(){throw new Error("unsupported")},r.curve=Jf,r.curves=Qf,r.ec=kS,r.eddsa=null}),qS=jS.ec;const zS="signing-key/5.7.0",pd=new Et(zS);let gd=null;function os(){return gd||(gd=new qS("secp256k1")),gd}class HS{constructor(e){au(this,"curve","secp256k1"),au(this,"privateKey",ai(e)),IE(this.privateKey)!==32&&pd.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=os().keyFromPrivate(dr(this.privateKey));au(this,"publicKey","0x"+r.getPublic(!1,"hex")),au(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),au(this,"_isSigningKey",!0)}_addPoint(e){const r=os().keyFromPublic(dr(this.publicKey)),i=os().keyFromPublic(dr(e));return"0x"+r.pub.add(i.pub).encodeCompressed("hex")}signDigest(e){const r=os().keyFromPrivate(dr(this.privateKey)),i=dr(e);i.length!==32&&pd.throwArgumentError("bad digest length","digest",e);const n=r.sign(i,{canonical:!0});return Jv({recoveryParam:n.recoveryParam,r:Qn("0x"+n.r.toString(16),32),s:Qn("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const r=os().keyFromPrivate(dr(this.privateKey)),i=os().keyFromPublic(dr(j3(e)));return Qn("0x"+r.derive(i.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function KS(t,e){const r=Jv(e),i={r:dr(r.r),s:dr(r.s)};return"0x"+os().recoverPubKey(dr(t),i,r.recoveryParam).encode("hex",!1)}function j3(t,e){const r=dr(t);if(r.length===32){const i=new HS(r);return e?"0x"+os().keyFromPrivate(r).getPublic(!0,"hex"):i.publicKey}else{if(r.length===33)return e?ai(r):"0x"+os().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+os().keyFromPublic(r).getPublic(!0,"hex"):ai(r)}return pd.throwArgumentError("invalid public or private key","key","[REDACTED]")}const WS="transactions/5.7.0";new Et(WS);var q3;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(q3||(q3={}));function VS(t){const e=j3(t);return ix(Yv(Y0(Yv(e,1)),12))}function GS(t,e){return VS(KS(dr(t),e))}const YS="https://rpc.walletconnect.com/v1";async function JS(t,e,r,i,n,s){switch(r.t){case"eip191":return QS(t,e,r.s);case"eip1271":return await ZS(t,e,r.s,i,n,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function QS(t,e,r){return GS(l3(e),r).toLowerCase()===t.toLowerCase()}async function ZS(t,e,r,i,n,s){try{const a="0x1626ba7e",u="0000000000000000000000000000000000000000000000000000000000000040",d="0000000000000000000000000000000000000000000000000000000000000041",p=r.substring(2),y=l3(e).substring(2),_=a+y+u+d+p,C=await fetch(`${s||YS}/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:XS(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:_},"latest"]})}),{result:I}=await C.json();return I?I.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function XS(){return Date.now()+Math.floor(Math.random()*1e3)}var eI=Object.defineProperty,tI=Object.defineProperties,rI=Object.getOwnPropertyDescriptors,z3=Object.getOwnPropertySymbols,iI=Object.prototype.hasOwnProperty,nI=Object.prototype.propertyIsEnumerable,H3=(t,e,r)=>e in t?eI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,sI=(t,e)=>{for(var r in e||(e={}))iI.call(e,r)&&H3(t,r,e[r]);if(z3)for(var r of z3(e))nI.call(e,r)&&H3(t,r,e[r]);return t},oI=(t,e)=>tI(t,rI(e));const aI="did:pkh:",vd=t=>t?.split(":"),K3=t=>{const e=t&&vd(t);if(e)return t.includes(aI)?e[3]:e[1]},W3=t=>{const e=t&&vd(t);if(e)return e[2]+":"+e[3]},eh=t=>{const e=t&&vd(t);if(e)return e.pop()};async function V3(t){const{cacao:e,projectId:r}=t,{s:i,p:n}=e,s=G3(n,n.iss),a=eh(n.iss);return await JS(a,s,i,K3(n.iss),r)}const G3=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,i=eh(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let n=t.statement||void 0;const s=`URI: ${t.aud||t.uri}`,a=`Version: ${t.version}`,u=`Chain ID: ${K3(e)}`,d=`Nonce: ${t.nonce}`,p=`Issued At: ${t.iat}`,y=t.exp?`Expiration Time: ${t.exp}`:void 0,_=t.nbf?`Not Before: ${t.nbf}`:void 0,C=t.requestId?`Request ID: ${t.requestId}`:void 0,I=t.resources?`Resources:${t.resources.map(B=>`
|
|
23
|
+
- ${B}`).join("")}`:void 0,M=th(t.resources);if(M){const B=hu(M);n=vI(n,B)}return[r,i,"",n,"",s,a,u,d,p,y,_,C,I].filter(B=>B!=null).join(`
|
|
24
|
+
`)};function cI(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function uI(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function qo(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const i=t.att[r];if(Array.isArray(i))throw new Error(`Resource must be an object: ${r}`);if(typeof i!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(i).forEach(n=>{const s=i[n];if(!Array.isArray(s))throw new Error(`Ability limits ${n} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${n} is empty array, must be an array with objects`);s.forEach(a=>{if(typeof a!="object")throw new Error(`Ability limits (${n}) must be an array of objects, found: ${a}`)})})})}function fI(t,e,r,i={}){return r?.sort((n,s)=>n.localeCompare(s)),{att:{[t]:hI(e,r,i)}}}function hI(t,e,r={}){e=e?.sort((n,s)=>n.localeCompare(s));const i=e.map(n=>({[`${t}/${n}`]:[r]}));return Object.assign({},...i)}function Y3(t){return qo(t),`urn:recap:${cI(t).replace(/=/g,"")}`}function hu(t){const e=uI(t.replace("urn:recap:",""));return qo(e),e}function lI(t,e,r){const i=fI(t,e,r);return Y3(i)}function dI(t){return t&&t.includes("urn:recap:")}function pI(t,e){const r=hu(t),i=hu(e),n=gI(r,i);return Y3(n)}function gI(t,e){qo(t),qo(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((n,s)=>n.localeCompare(s)),i={att:{}};return r.forEach(n=>{var s,a;Object.keys(((s=t.att)==null?void 0:s[n])||{}).concat(Object.keys(((a=e.att)==null?void 0:a[n])||{})).sort((u,d)=>u.localeCompare(d)).forEach(u=>{var d,p;i.att[n]=oI(sI({},i.att[n]),{[u]:((d=t.att[n])==null?void 0:d[u])||((p=e.att[n])==null?void 0:p[u])})})}),i}function vI(t="",e){qo(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const i=[];let n=0;Object.keys(e.att).forEach(u=>{const d=Object.keys(e.att[u]).map(_=>({ability:_.split("/")[0],action:_.split("/")[1]}));d.sort((_,C)=>_.action.localeCompare(C.action));const p={};d.forEach(_=>{p[_.ability]||(p[_.ability]=[]),p[_.ability].push(_.action)});const y=Object.keys(p).map(_=>(n++,`(${n}) '${_}': '${p[_].join("', '")}' for '${u}'.`));i.push(y.join(", ").replace(".,","."))});const s=i.join(" "),a=`${r}${s}`;return`${t?t+" ":""}${a}`}function J3(t){var e;const r=hu(t);qo(r);const i=(e=r.att)==null?void 0:e.eip155;return i?Object.keys(i).map(n=>n.split("/")[1]):[]}function Q3(t){const e=hu(t);qo(e);const r=[];return Object.values(e.att).forEach(i=>{Object.values(i).forEach(n=>{var s;(s=n?.[0])!=null&&s.chains&&r.push(n[0].chains)})}),[...new Set(r.flat())]}function th(t){if(!t)return;const e=t?.[t.length-1];return dI(e)?e:void 0}var mI={},Z3={},Pt={},X3={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(u,d){var p=u>>>16&65535,y=u&65535,_=d>>>16&65535,C=d&65535;return y*C+(p*C+y*_<<16>>>0)|0}t.mul=Math.imul||e;function r(u,d){return u+d|0}t.add=r;function i(u,d){return u-d|0}t.sub=i;function n(u,d){return u<<d|u>>>32-d}t.rotl=n;function s(u,d){return u<<32-d|u>>>d}t.rotr=s;function a(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}t.isInteger=Number.isInteger||a,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(u){return t.isInteger(u)&&u>=-t.MAX_SAFE_INTEGER&&u<=t.MAX_SAFE_INTEGER}})(X3),Object.defineProperty(Pt,"__esModule",{value:!0});var em=X3;function bI(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}Pt.readInt16BE=bI;function yI(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}Pt.readUint16BE=yI;function wI(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}Pt.readInt16LE=wI;function _I(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}Pt.readUint16LE=_I;function tm(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}Pt.writeUint16BE=tm,Pt.writeInt16BE=tm;function rm(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}Pt.writeUint16LE=rm,Pt.writeInt16LE=rm;function md(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}Pt.readInt32BE=md;function bd(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}Pt.readUint32BE=bd;function yd(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}Pt.readInt32LE=yd;function wd(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}Pt.readUint32LE=wd;function rh(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}Pt.writeUint32BE=rh,Pt.writeInt32BE=rh;function ih(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}Pt.writeUint32LE=ih,Pt.writeInt32LE=ih;function AI(t,e){e===void 0&&(e=0);var r=md(t,e),i=md(t,e+4);return r*4294967296+i-(i>>31)*4294967296}Pt.readInt64BE=AI;function EI(t,e){e===void 0&&(e=0);var r=bd(t,e),i=bd(t,e+4);return r*4294967296+i}Pt.readUint64BE=EI;function xI(t,e){e===void 0&&(e=0);var r=yd(t,e),i=yd(t,e+4);return i*4294967296+r-(r>>31)*4294967296}Pt.readInt64LE=xI;function SI(t,e){e===void 0&&(e=0);var r=wd(t,e),i=wd(t,e+4);return i*4294967296+r}Pt.readUint64LE=SI;function im(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),rh(t/4294967296>>>0,e,r),rh(t>>>0,e,r+4),e}Pt.writeUint64BE=im,Pt.writeInt64BE=im;function nm(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),ih(t>>>0,e,r),ih(t/4294967296>>>0,e,r+4),e}Pt.writeUint64LE=nm,Pt.writeInt64LE=nm;function II(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 i=0,n=1,s=t/8+r-1;s>=r;s--)i+=e[s]*n,n*=256;return i}Pt.readUintBE=II;function MI(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 i=0,n=1,s=r;s<r+t/8;s++)i+=e[s]*n,n*=256;return i}Pt.readUintLE=MI;function CI(t,e,r,i){if(r===void 0&&(r=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!em.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var n=1,s=t/8+i-1;s>=i;s--)r[s]=e/n&255,n*=256;return r}Pt.writeUintBE=CI;function DI(t,e,r,i){if(r===void 0&&(r=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!em.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var n=1,s=i;s<i+t/8;s++)r[s]=e/n&255,n*=256;return r}Pt.writeUintLE=DI;function PI(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}Pt.readFloat32BE=PI;function OI(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}Pt.readFloat32LE=OI;function $I(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}Pt.readFloat64BE=$I;function NI(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}Pt.readFloat64LE=NI;function RI(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(r,t),e}Pt.writeFloat32BE=RI;function TI(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(r,t,!0),e}Pt.writeFloat32LE=TI;function FI(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(r,t),e}Pt.writeFloat64BE=FI;function LI(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(r,t,!0),e}Pt.writeFloat64LE=LI;var nh={};Object.defineProperty(nh,"__esModule",{value:!0});function BI(t){for(var e=0;e<t.length;e++)t[e]=0;return t}nh.wipe=BI,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Pt,r=nh;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var i=function(){function u(){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 u.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},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},u.prototype.update=function(d,p){if(p===void 0&&(p=d.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var y=0;if(this._bytesHashed+=p,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&p>0;)this._buffer[this._bufferLength++]=d[y++],p--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(p>=this.blockSize&&(y=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,d,y,p),p%=this.blockSize);p>0;)this._buffer[this._bufferLength++]=d[y++],p--;return this},u.prototype.finish=function(d){if(!this._finished){var p=this._bytesHashed,y=this._bufferLength,_=p/536870912|0,C=p<<3,I=p%128<112?128:256;this._buffer[y]=128;for(var M=y+1;M<I-8;M++)this._buffer[M]=0;e.writeUint32BE(_,this._buffer,I-8),e.writeUint32BE(C,this._buffer,I-4),s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,I),this._finished=!0}for(var M=0;M<this.digestLength/8;M++)e.writeUint32BE(this._stateHi[M],d,M*8),e.writeUint32BE(this._stateLo[M],d,M*8+4);return this},u.prototype.digest=function(){var d=new Uint8Array(this.digestLength);return this.finish(d),d},u.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}},u.prototype.restoreState=function(d){return this._stateHi.set(d.stateHi),this._stateLo.set(d.stateLo),this._bufferLength=d.bufferLength,d.buffer&&this._buffer.set(d.buffer),this._bytesHashed=d.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(d){r.wipe(d.stateHi),r.wipe(d.stateLo),d.buffer&&r.wipe(d.buffer),d.bufferLength=0,d.bytesHashed=0},u}();t.SHA512=i;var n=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 s(u,d,p,y,_,C,I){for(var M=p[0],B=p[1],W=p[2],Y=p[3],q=p[4],V=p[5],U=p[6],z=p[7],K=y[0],A=y[1],j=y[2],ee=y[3],re=y[4],k=y[5],w=y[6],f=y[7],h,g,E,D,P,x,v,b;I>=128;){for(var L=0;L<16;L++){var X=8*L+C;u[L]=e.readUint32BE(_,X),d[L]=e.readUint32BE(_,X+4)}for(var L=0;L<80;L++){var ce=M,O=B,ie=W,N=Y,F=q,R=V,l=U,$=z,Z=K,ae=A,ue=j,ve=ee,ge=re,Ee=k,Ye=w,De=f;if(h=z,g=f,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=(q>>>14|re<<32-14)^(q>>>18|re<<32-18)^(re>>>41-32|q<<32-(41-32)),g=(re>>>14|q<<32-14)^(re>>>18|q<<32-18)^(q>>>41-32|re<<32-(41-32)),P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,h=q&V^~q&U,g=re&k^~re&w,P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,h=n[L*2],g=n[L*2+1],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,h=u[L%16],g=d[L%16],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,E=v&65535|b<<16,D=P&65535|x<<16,h=E,g=D,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=(M>>>28|K<<32-28)^(K>>>34-32|M<<32-(34-32))^(K>>>39-32|M<<32-(39-32)),g=(K>>>28|M<<32-28)^(M>>>34-32|K<<32-(34-32))^(M>>>39-32|K<<32-(39-32)),P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,h=M&B^M&W^B&W,g=K&A^K&j^A&j,P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,$=v&65535|b<<16,De=P&65535|x<<16,h=N,g=ve,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=E,g=D,P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,N=v&65535|b<<16,ve=P&65535|x<<16,B=ce,W=O,Y=ie,q=N,V=F,U=R,z=l,M=$,A=Z,j=ae,ee=ue,re=ve,k=ge,w=Ee,f=Ye,K=De,L%16===15)for(var X=0;X<16;X++)h=u[X],g=d[X],P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=u[(X+9)%16],g=d[(X+9)%16],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,E=u[(X+1)%16],D=d[(X+1)%16],h=(E>>>1|D<<32-1)^(E>>>8|D<<32-8)^E>>>7,g=(D>>>1|E<<32-1)^(D>>>8|E<<32-8)^(D>>>7|E<<32-7),P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,E=u[(X+14)%16],D=d[(X+14)%16],h=(E>>>19|D<<32-19)^(D>>>61-32|E<<32-(61-32))^E>>>6,g=(D>>>19|E<<32-19)^(E>>>61-32|D<<32-(61-32))^(D>>>6|E<<32-6),P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,u[X]=v&65535|b<<16,d[X]=P&65535|x<<16}h=M,g=K,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[0],g=y[0],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[0]=M=v&65535|b<<16,y[0]=K=P&65535|x<<16,h=B,g=A,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[1],g=y[1],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[1]=B=v&65535|b<<16,y[1]=A=P&65535|x<<16,h=W,g=j,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[2],g=y[2],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[2]=W=v&65535|b<<16,y[2]=j=P&65535|x<<16,h=Y,g=ee,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[3],g=y[3],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[3]=Y=v&65535|b<<16,y[3]=ee=P&65535|x<<16,h=q,g=re,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[4],g=y[4],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[4]=q=v&65535|b<<16,y[4]=re=P&65535|x<<16,h=V,g=k,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[5],g=y[5],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[5]=V=v&65535|b<<16,y[5]=k=P&65535|x<<16,h=U,g=w,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[6],g=y[6],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[6]=U=v&65535|b<<16,y[6]=w=P&65535|x<<16,h=z,g=f,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[7],g=y[7],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[7]=z=v&65535|b<<16,y[7]=f=P&65535|x<<16,C+=128,I-=128}return C}function a(u){var d=new i;d.update(u);var p=d.digest();return d.clean(),p}t.hash=a}(Z3),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=d7,r=Z3,i=nh;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function n(N){const F=new Float64Array(16);if(N)for(let R=0;R<N.length;R++)F[R]=N[R];return F}const s=new Uint8Array(32);s[0]=9;const a=n(),u=n([1]),d=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),p=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),y=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),_=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),C=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function I(N,F){for(let R=0;R<16;R++)N[R]=F[R]|0}function M(N){let F=1;for(let R=0;R<16;R++){let l=N[R]+F+65535;F=Math.floor(l/65536),N[R]=l-F*65536}N[0]+=F-1+37*(F-1)}function B(N,F,R){const l=~(R-1);for(let $=0;$<16;$++){const Z=l&(N[$]^F[$]);N[$]^=Z,F[$]^=Z}}function W(N,F){const R=n(),l=n();for(let $=0;$<16;$++)l[$]=F[$];M(l),M(l),M(l);for(let $=0;$<2;$++){R[0]=l[0]-65517;for(let ae=1;ae<15;ae++)R[ae]=l[ae]-65535-(R[ae-1]>>16&1),R[ae-1]&=65535;R[15]=l[15]-32767-(R[14]>>16&1);const Z=R[15]>>16&1;R[14]&=65535,B(l,R,1-Z)}for(let $=0;$<16;$++)N[2*$]=l[$]&255,N[2*$+1]=l[$]>>8}function Y(N,F){let R=0;for(let l=0;l<32;l++)R|=N[l]^F[l];return(1&R-1>>>8)-1}function q(N,F){const R=new Uint8Array(32),l=new Uint8Array(32);return W(R,N),W(l,F),Y(R,l)}function V(N){const F=new Uint8Array(32);return W(F,N),F[0]&1}function U(N,F){for(let R=0;R<16;R++)N[R]=F[2*R]+(F[2*R+1]<<8);N[15]&=32767}function z(N,F,R){for(let l=0;l<16;l++)N[l]=F[l]+R[l]}function K(N,F,R){for(let l=0;l<16;l++)N[l]=F[l]-R[l]}function A(N,F,R){let l,$,Z=0,ae=0,ue=0,ve=0,ge=0,Ee=0,Ye=0,De=0,Re=0,xe=0,ye=0,Me=0,Pe=0,pe=0,Se=0,_e=0,me=0,Te=0,Ce=0,Ae=0,ke=0,qe=0,Ie=0,Ke=0,ut=0,Je=0,gt=0,ht=0,ot=0,St=0,Ct=0,Oe=R[0],Ve=R[1],Ze=R[2],$e=R[3],Qe=R[4],Ge=R[5],Fe=R[6],nt=R[7],Xe=R[8],Le=R[9],et=R[10],rt=R[11],Ne=R[12],We=R[13],st=R[14],Be=R[15];l=F[0],Z+=l*Oe,ae+=l*Ve,ue+=l*Ze,ve+=l*$e,ge+=l*Qe,Ee+=l*Ge,Ye+=l*Fe,De+=l*nt,Re+=l*Xe,xe+=l*Le,ye+=l*et,Me+=l*rt,Pe+=l*Ne,pe+=l*We,Se+=l*st,_e+=l*Be,l=F[1],ae+=l*Oe,ue+=l*Ve,ve+=l*Ze,ge+=l*$e,Ee+=l*Qe,Ye+=l*Ge,De+=l*Fe,Re+=l*nt,xe+=l*Xe,ye+=l*Le,Me+=l*et,Pe+=l*rt,pe+=l*Ne,Se+=l*We,_e+=l*st,me+=l*Be,l=F[2],ue+=l*Oe,ve+=l*Ve,ge+=l*Ze,Ee+=l*$e,Ye+=l*Qe,De+=l*Ge,Re+=l*Fe,xe+=l*nt,ye+=l*Xe,Me+=l*Le,Pe+=l*et,pe+=l*rt,Se+=l*Ne,_e+=l*We,me+=l*st,Te+=l*Be,l=F[3],ve+=l*Oe,ge+=l*Ve,Ee+=l*Ze,Ye+=l*$e,De+=l*Qe,Re+=l*Ge,xe+=l*Fe,ye+=l*nt,Me+=l*Xe,Pe+=l*Le,pe+=l*et,Se+=l*rt,_e+=l*Ne,me+=l*We,Te+=l*st,Ce+=l*Be,l=F[4],ge+=l*Oe,Ee+=l*Ve,Ye+=l*Ze,De+=l*$e,Re+=l*Qe,xe+=l*Ge,ye+=l*Fe,Me+=l*nt,Pe+=l*Xe,pe+=l*Le,Se+=l*et,_e+=l*rt,me+=l*Ne,Te+=l*We,Ce+=l*st,Ae+=l*Be,l=F[5],Ee+=l*Oe,Ye+=l*Ve,De+=l*Ze,Re+=l*$e,xe+=l*Qe,ye+=l*Ge,Me+=l*Fe,Pe+=l*nt,pe+=l*Xe,Se+=l*Le,_e+=l*et,me+=l*rt,Te+=l*Ne,Ce+=l*We,Ae+=l*st,ke+=l*Be,l=F[6],Ye+=l*Oe,De+=l*Ve,Re+=l*Ze,xe+=l*$e,ye+=l*Qe,Me+=l*Ge,Pe+=l*Fe,pe+=l*nt,Se+=l*Xe,_e+=l*Le,me+=l*et,Te+=l*rt,Ce+=l*Ne,Ae+=l*We,ke+=l*st,qe+=l*Be,l=F[7],De+=l*Oe,Re+=l*Ve,xe+=l*Ze,ye+=l*$e,Me+=l*Qe,Pe+=l*Ge,pe+=l*Fe,Se+=l*nt,_e+=l*Xe,me+=l*Le,Te+=l*et,Ce+=l*rt,Ae+=l*Ne,ke+=l*We,qe+=l*st,Ie+=l*Be,l=F[8],Re+=l*Oe,xe+=l*Ve,ye+=l*Ze,Me+=l*$e,Pe+=l*Qe,pe+=l*Ge,Se+=l*Fe,_e+=l*nt,me+=l*Xe,Te+=l*Le,Ce+=l*et,Ae+=l*rt,ke+=l*Ne,qe+=l*We,Ie+=l*st,Ke+=l*Be,l=F[9],xe+=l*Oe,ye+=l*Ve,Me+=l*Ze,Pe+=l*$e,pe+=l*Qe,Se+=l*Ge,_e+=l*Fe,me+=l*nt,Te+=l*Xe,Ce+=l*Le,Ae+=l*et,ke+=l*rt,qe+=l*Ne,Ie+=l*We,Ke+=l*st,ut+=l*Be,l=F[10],ye+=l*Oe,Me+=l*Ve,Pe+=l*Ze,pe+=l*$e,Se+=l*Qe,_e+=l*Ge,me+=l*Fe,Te+=l*nt,Ce+=l*Xe,Ae+=l*Le,ke+=l*et,qe+=l*rt,Ie+=l*Ne,Ke+=l*We,ut+=l*st,Je+=l*Be,l=F[11],Me+=l*Oe,Pe+=l*Ve,pe+=l*Ze,Se+=l*$e,_e+=l*Qe,me+=l*Ge,Te+=l*Fe,Ce+=l*nt,Ae+=l*Xe,ke+=l*Le,qe+=l*et,Ie+=l*rt,Ke+=l*Ne,ut+=l*We,Je+=l*st,gt+=l*Be,l=F[12],Pe+=l*Oe,pe+=l*Ve,Se+=l*Ze,_e+=l*$e,me+=l*Qe,Te+=l*Ge,Ce+=l*Fe,Ae+=l*nt,ke+=l*Xe,qe+=l*Le,Ie+=l*et,Ke+=l*rt,ut+=l*Ne,Je+=l*We,gt+=l*st,ht+=l*Be,l=F[13],pe+=l*Oe,Se+=l*Ve,_e+=l*Ze,me+=l*$e,Te+=l*Qe,Ce+=l*Ge,Ae+=l*Fe,ke+=l*nt,qe+=l*Xe,Ie+=l*Le,Ke+=l*et,ut+=l*rt,Je+=l*Ne,gt+=l*We,ht+=l*st,ot+=l*Be,l=F[14],Se+=l*Oe,_e+=l*Ve,me+=l*Ze,Te+=l*$e,Ce+=l*Qe,Ae+=l*Ge,ke+=l*Fe,qe+=l*nt,Ie+=l*Xe,Ke+=l*Le,ut+=l*et,Je+=l*rt,gt+=l*Ne,ht+=l*We,ot+=l*st,St+=l*Be,l=F[15],_e+=l*Oe,me+=l*Ve,Te+=l*Ze,Ce+=l*$e,Ae+=l*Qe,ke+=l*Ge,qe+=l*Fe,Ie+=l*nt,Ke+=l*Xe,ut+=l*Le,Je+=l*et,gt+=l*rt,ht+=l*Ne,ot+=l*We,St+=l*st,Ct+=l*Be,Z+=38*me,ae+=38*Te,ue+=38*Ce,ve+=38*Ae,ge+=38*ke,Ee+=38*qe,Ye+=38*Ie,De+=38*Ke,Re+=38*ut,xe+=38*Je,ye+=38*gt,Me+=38*ht,Pe+=38*ot,pe+=38*St,Se+=38*Ct,$=1,l=Z+$+65535,$=Math.floor(l/65536),Z=l-$*65536,l=ae+$+65535,$=Math.floor(l/65536),ae=l-$*65536,l=ue+$+65535,$=Math.floor(l/65536),ue=l-$*65536,l=ve+$+65535,$=Math.floor(l/65536),ve=l-$*65536,l=ge+$+65535,$=Math.floor(l/65536),ge=l-$*65536,l=Ee+$+65535,$=Math.floor(l/65536),Ee=l-$*65536,l=Ye+$+65535,$=Math.floor(l/65536),Ye=l-$*65536,l=De+$+65535,$=Math.floor(l/65536),De=l-$*65536,l=Re+$+65535,$=Math.floor(l/65536),Re=l-$*65536,l=xe+$+65535,$=Math.floor(l/65536),xe=l-$*65536,l=ye+$+65535,$=Math.floor(l/65536),ye=l-$*65536,l=Me+$+65535,$=Math.floor(l/65536),Me=l-$*65536,l=Pe+$+65535,$=Math.floor(l/65536),Pe=l-$*65536,l=pe+$+65535,$=Math.floor(l/65536),pe=l-$*65536,l=Se+$+65535,$=Math.floor(l/65536),Se=l-$*65536,l=_e+$+65535,$=Math.floor(l/65536),_e=l-$*65536,Z+=$-1+37*($-1),$=1,l=Z+$+65535,$=Math.floor(l/65536),Z=l-$*65536,l=ae+$+65535,$=Math.floor(l/65536),ae=l-$*65536,l=ue+$+65535,$=Math.floor(l/65536),ue=l-$*65536,l=ve+$+65535,$=Math.floor(l/65536),ve=l-$*65536,l=ge+$+65535,$=Math.floor(l/65536),ge=l-$*65536,l=Ee+$+65535,$=Math.floor(l/65536),Ee=l-$*65536,l=Ye+$+65535,$=Math.floor(l/65536),Ye=l-$*65536,l=De+$+65535,$=Math.floor(l/65536),De=l-$*65536,l=Re+$+65535,$=Math.floor(l/65536),Re=l-$*65536,l=xe+$+65535,$=Math.floor(l/65536),xe=l-$*65536,l=ye+$+65535,$=Math.floor(l/65536),ye=l-$*65536,l=Me+$+65535,$=Math.floor(l/65536),Me=l-$*65536,l=Pe+$+65535,$=Math.floor(l/65536),Pe=l-$*65536,l=pe+$+65535,$=Math.floor(l/65536),pe=l-$*65536,l=Se+$+65535,$=Math.floor(l/65536),Se=l-$*65536,l=_e+$+65535,$=Math.floor(l/65536),_e=l-$*65536,Z+=$-1+37*($-1),N[0]=Z,N[1]=ae,N[2]=ue,N[3]=ve,N[4]=ge,N[5]=Ee,N[6]=Ye,N[7]=De,N[8]=Re,N[9]=xe,N[10]=ye,N[11]=Me,N[12]=Pe,N[13]=pe,N[14]=Se,N[15]=_e}function j(N,F){A(N,F,F)}function ee(N,F){const R=n();let l;for(l=0;l<16;l++)R[l]=F[l];for(l=253;l>=0;l--)j(R,R),l!==2&&l!==4&&A(R,R,F);for(l=0;l<16;l++)N[l]=R[l]}function re(N,F){const R=n();let l;for(l=0;l<16;l++)R[l]=F[l];for(l=250;l>=0;l--)j(R,R),l!==1&&A(R,R,F);for(l=0;l<16;l++)N[l]=R[l]}function k(N,F){const R=n(),l=n(),$=n(),Z=n(),ae=n(),ue=n(),ve=n(),ge=n(),Ee=n();K(R,N[1],N[0]),K(Ee,F[1],F[0]),A(R,R,Ee),z(l,N[0],N[1]),z(Ee,F[0],F[1]),A(l,l,Ee),A($,N[3],F[3]),A($,$,p),A(Z,N[2],F[2]),z(Z,Z,Z),K(ae,l,R),K(ue,Z,$),z(ve,Z,$),z(ge,l,R),A(N[0],ae,ue),A(N[1],ge,ve),A(N[2],ve,ue),A(N[3],ae,ge)}function w(N,F,R){for(let l=0;l<4;l++)B(N[l],F[l],R)}function f(N,F){const R=n(),l=n(),$=n();ee($,F[2]),A(R,F[0],$),A(l,F[1],$),W(N,l),N[31]^=V(R)<<7}function h(N,F,R){I(N[0],a),I(N[1],u),I(N[2],u),I(N[3],a);for(let l=255;l>=0;--l){const $=R[l/8|0]>>(l&7)&1;w(N,F,$),k(F,N),k(N,N),w(N,F,$)}}function g(N,F){const R=[n(),n(),n(),n()];I(R[0],y),I(R[1],_),I(R[2],u),A(R[3],y,_),h(N,R,F)}function E(N){if(N.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const F=(0,r.hash)(N);F[0]&=248,F[31]&=127,F[31]|=64;const R=new Uint8Array(32),l=[n(),n(),n(),n()];g(l,F),f(R,l);const $=new Uint8Array(64);return $.set(N),$.set(R,32),{publicKey:R,secretKey:$}}t.generateKeyPairFromSeed=E;function D(N){const F=(0,e.randomBytes)(32,N),R=E(F);return(0,i.wipe)(F),R}t.generateKeyPair=D;function P(N){if(N.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(N.subarray(32))}t.extractPublicKeyFromSecretKey=P;const x=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 v(N,F){let R,l,$,Z;for(l=63;l>=32;--l){for(R=0,$=l-32,Z=l-12;$<Z;++$)F[$]+=R-16*F[l]*x[$-(l-32)],R=Math.floor((F[$]+128)/256),F[$]-=R*256;F[$]+=R,F[l]=0}for(R=0,$=0;$<32;$++)F[$]+=R-(F[31]>>4)*x[$],R=F[$]>>8,F[$]&=255;for($=0;$<32;$++)F[$]-=R*x[$];for(l=0;l<32;l++)F[l+1]+=F[l]>>8,N[l]=F[l]&255}function b(N){const F=new Float64Array(64);for(let R=0;R<64;R++)F[R]=N[R];for(let R=0;R<64;R++)N[R]=0;v(N,F)}function L(N,F){const R=new Float64Array(64),l=[n(),n(),n(),n()],$=(0,r.hash)(N.subarray(0,32));$[0]&=248,$[31]&=127,$[31]|=64;const Z=new Uint8Array(64);Z.set($.subarray(32),32);const ae=new r.SHA512;ae.update(Z.subarray(32)),ae.update(F);const ue=ae.digest();ae.clean(),b(ue),g(l,ue),f(Z,l),ae.reset(),ae.update(Z.subarray(0,32)),ae.update(N.subarray(32)),ae.update(F);const ve=ae.digest();b(ve);for(let ge=0;ge<32;ge++)R[ge]=ue[ge];for(let ge=0;ge<32;ge++)for(let Ee=0;Ee<32;Ee++)R[ge+Ee]+=ve[ge]*$[Ee];return v(Z.subarray(32),R),Z}t.sign=L;function X(N,F){const R=n(),l=n(),$=n(),Z=n(),ae=n(),ue=n(),ve=n();return I(N[2],u),U(N[1],F),j($,N[1]),A(Z,$,d),K($,$,N[2]),z(Z,N[2],Z),j(ae,Z),j(ue,ae),A(ve,ue,ae),A(R,ve,$),A(R,R,Z),re(R,R),A(R,R,$),A(R,R,Z),A(R,R,Z),A(N[0],R,Z),j(l,N[0]),A(l,l,Z),q(l,$)&&A(N[0],N[0],C),j(l,N[0]),A(l,l,Z),q(l,$)?-1:(V(N[0])===F[31]>>7&&K(N[0],a,N[0]),A(N[3],N[0],N[1]),0)}function ce(N,F,R){const l=new Uint8Array(32),$=[n(),n(),n(),n()],Z=[n(),n(),n(),n()];if(R.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(X(Z,N))return!1;const ae=new r.SHA512;ae.update(R.subarray(0,32)),ae.update(N),ae.update(F);const ue=ae.digest();return b(ue),h($,Z,ue),g(Z,R.subarray(32)),k($,Z),f(l,$),!Y(R,l)}t.verify=ce;function O(N){let F=[n(),n(),n(),n()];if(X(F,N))throw new Error("Ed25519: invalid public key");let R=n(),l=n(),$=F[1];z(R,u,$),K(l,u,$),ee(l,l),A(R,R,l);let Z=new Uint8Array(32);return W(Z,R),Z}t.convertPublicKeyToX25519=O;function ie(N){const F=(0,r.hash)(N.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const R=new Uint8Array(F.subarray(0,32));return(0,i.wipe)(F),R}t.convertSecretKeyToX25519=ie}(mI);const sm=".",om="base64url",UI="utf8",kI="utf8";function am(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function jI(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?am(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function qI(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=n}var u=t.length,d=t.charAt(0),p=Math.log(u)/Math.log(256),y=Math.log(256)/Math.log(u);function _(M){if(M instanceof Uint8Array||(ArrayBuffer.isView(M)?M=new Uint8Array(M.buffer,M.byteOffset,M.byteLength):Array.isArray(M)&&(M=Uint8Array.from(M))),!(M instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(M.length===0)return"";for(var B=0,W=0,Y=0,q=M.length;Y!==q&&M[Y]===0;)Y++,B++;for(var V=(q-Y)*y+1>>>0,U=new Uint8Array(V);Y!==q;){for(var z=M[Y],K=0,A=V-1;(z!==0||K<W)&&A!==-1;A--,K++)z+=256*U[A]>>>0,U[A]=z%u>>>0,z=z/u>>>0;if(z!==0)throw new Error("Non-zero carry");W=K,Y++}for(var j=V-W;j!==V&&U[j]===0;)j++;for(var ee=d.repeat(B);j<V;++j)ee+=t.charAt(U[j]);return ee}function C(M){if(typeof M!="string")throw new TypeError("Expected String");if(M.length===0)return new Uint8Array;var B=0;if(M[B]!==" "){for(var W=0,Y=0;M[B]===d;)W++,B++;for(var q=(M.length-B)*p+1>>>0,V=new Uint8Array(q);M[B];){var U=r[M.charCodeAt(B)];if(U===255)return;for(var z=0,K=q-1;(U!==0||z<Y)&&K!==-1;K--,z++)U+=u*V[K]>>>0,V[K]=U%256>>>0,U=U/256>>>0;if(U!==0)throw new Error("Non-zero carry");Y=z,B++}if(M[B]!==" "){for(var A=q-Y;A!==q&&V[A]===0;)A++;for(var j=new Uint8Array(W+(q-A)),ee=W;A!==q;)j[ee++]=V[A++];return j}}}function I(M){var B=C(M);if(B)return B;throw new Error(`Non-${e} character`)}return{encode:_,decodeUnsafe:C,decode:I}}var zI=qI,HI=zI;const cm=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")},KI=t=>new TextEncoder().encode(t),WI=t=>new TextDecoder().decode(t);class VI{constructor(e,r,i){this.name=e,this.prefix=r,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class GI{constructor(e,r,i){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=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return um(this,e)}}class YI{constructor(e){this.decoders=e}or(e){return um(this,e)}decode(e){const r=e[0],i=this.decoders[r];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const um=(t,e)=>new YI(oi(oi({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class JI{constructor(e,r,i,n){this.name=e,this.prefix=r,this.baseEncode=i,this.baseDecode=n,this.encoder=new VI(e,r,i),this.decoder=new GI(e,r,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const sh=({name:t,prefix:e,encode:r,decode:i})=>new JI(t,e,r,i),lu=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=HI(r,e);return sh({prefix:t,name:e,encode:i,decode:s=>cm(n(s))})},QI=(t,e,r,i)=>{const n={};for(let y=0;y<e.length;++y)n[e[y]]=y;let s=t.length;for(;t[s-1]==="=";)--s;const a=new Uint8Array(s*r/8|0);let u=0,d=0,p=0;for(let y=0;y<s;++y){const _=n[t[y]];if(_===void 0)throw new SyntaxError(`Non-${i} character`);d=d<<r|_,u+=r,u>=8&&(u-=8,a[p++]=255&d>>u)}if(u>=r||255&d<<8-u)throw new SyntaxError("Unexpected end of data");return a},ZI=(t,e,r)=>{const i=e[e.length-1]==="=",n=(1<<r)-1;let s="",a=0,u=0;for(let d=0;d<t.length;++d)for(u=u<<8|t[d],a+=8;a>r;)a-=r,s+=e[n&u>>a];if(a&&(s+=e[n&u<<r-a]),i)for(;s.length*r&7;)s+="=";return s},Hr=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>sh({prefix:e,name:t,encode(n){return ZI(n,i,r)},decode(n){return QI(n,i,r,t)}}),XI=sh({prefix:"\0",name:"identity",encode:t=>WI(t),decode:t=>KI(t)});var eM=Object.freeze({__proto__:null,identity:XI});const tM=Hr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var rM=Object.freeze({__proto__:null,base2:tM});const iM=Hr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var nM=Object.freeze({__proto__:null,base8:iM});const sM=lu({prefix:"9",name:"base10",alphabet:"0123456789"});var oM=Object.freeze({__proto__:null,base10:sM});const aM=Hr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),cM=Hr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var uM=Object.freeze({__proto__:null,base16:aM,base16upper:cM});const fM=Hr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),hM=Hr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),lM=Hr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),dM=Hr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),pM=Hr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),gM=Hr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),vM=Hr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),mM=Hr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),bM=Hr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var yM=Object.freeze({__proto__:null,base32:fM,base32upper:hM,base32pad:lM,base32padupper:dM,base32hex:pM,base32hexupper:gM,base32hexpad:vM,base32hexpadupper:mM,base32z:bM});const wM=lu({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),_M=lu({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var AM=Object.freeze({__proto__:null,base36:wM,base36upper:_M});const EM=lu({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),xM=lu({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var SM=Object.freeze({__proto__:null,base58btc:EM,base58flickr:xM});const IM=Hr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),MM=Hr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),CM=Hr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),DM=Hr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var PM=Object.freeze({__proto__:null,base64:IM,base64pad:MM,base64url:CM,base64urlpad:DM});const fm=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}"),OM=fm.reduce((t,e,r)=>(t[r]=e,t),[]),$M=fm.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function NM(t){return t.reduce((e,r)=>(e+=OM[r],e),"")}function RM(t){const e=[];for(const r of t){const i=$M[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(i)}return new Uint8Array(e)}const TM=sh({prefix:"\u{1F680}",name:"base256emoji",encode:NM,decode:RM});var FM=Object.freeze({__proto__:null,base256emoji:TM}),LM=lm,hm=128,BM=127,UM=~BM,kM=Math.pow(2,31);function lm(t,e,r){e=e||[],r=r||0;for(var i=r;t>=kM;)e[r++]=t&255|hm,t/=128;for(;t&UM;)e[r++]=t&255|hm,t>>>=7;return e[r]=t|0,lm.bytes=r-i+1,e}var jM=_d,qM=128,dm=127;function _d(t,i){var r=0,i=i||0,n=0,s=i,a,u=t.length;do{if(s>=u)throw _d.bytes=0,new RangeError("Could not decode varint");a=t[s++],r+=n<28?(a&dm)<<n:(a&dm)*Math.pow(2,n),n+=7}while(a>=qM);return _d.bytes=s-i,r}var zM=Math.pow(2,7),HM=Math.pow(2,14),KM=Math.pow(2,21),WM=Math.pow(2,28),VM=Math.pow(2,35),GM=Math.pow(2,42),YM=Math.pow(2,49),JM=Math.pow(2,56),QM=Math.pow(2,63),ZM=function(t){return t<zM?1:t<HM?2:t<KM?3:t<WM?4:t<VM?5:t<GM?6:t<YM?7:t<JM?8:t<QM?9:10},XM={encode:LM,decode:jM,encodingLength:ZM},pm=XM;const gm=(t,e,r=0)=>(pm.encode(t,e,r),e),vm=t=>pm.encodingLength(t),Ad=(t,e)=>{const r=e.byteLength,i=vm(t),n=i+vm(r),s=new Uint8Array(n+r);return gm(t,s,0),gm(r,s,i),s.set(e,n),new eC(t,r,e,s)};class eC{constructor(e,r,i,n){this.code=e,this.size=r,this.digest=i,this.bytes=n}}const mm=({name:t,code:e,encode:r})=>new tC(t,e,r);class tC{constructor(e,r,i){this.name=e,this.code=r,this.encode=i}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?Ad(this.code,r):r.then(i=>Ad(this.code,i))}else throw Error("Unknown type, must be binary type")}}const bm=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),rC=mm({name:"sha2-256",code:18,encode:bm("SHA-256")}),iC=mm({name:"sha2-512",code:19,encode:bm("SHA-512")});var nC=Object.freeze({__proto__:null,sha256:rC,sha512:iC});const ym=0,sC="identity",wm=cm;var oC=Object.freeze({__proto__:null,identity:{code:ym,name:sC,encode:wm,digest:t=>Ad(ym,wm(t))}});new TextEncoder,new TextDecoder;const _m=oi(oi(oi(oi(oi(oi(oi(oi(oi(oi({},eM),rM),nM),oM),uM),yM),AM),SM),PM),FM);oi(oi({},nC),oC);function Am(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const Em=Am("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Ed=Am("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=jI(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),xm=oi({utf8:Em,"utf-8":Em,hex:_m.base16,latin1:Ed,ascii:Ed,binary:Ed},_m);function aC(t,e="utf8"){const r=xm[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)}function xd(t,e="utf8"){const r=xm[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?am(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Sm(t){return Ua(aC(xd(t,om),UI))}function cC(t){return xd(t,om)}function uC(t){const e=t.split(sm),r=Sm(e[0]),i=Sm(e[1]),n=cC(e[2]),s=xd(e.slice(0,2).join(sm),kI);return{header:r,payload:i,signature:n,data:s}}var fC=Object.defineProperty,hC=Object.defineProperties,lC=Object.getOwnPropertyDescriptors,Im=Object.getOwnPropertySymbols,dC=Object.prototype.hasOwnProperty,pC=Object.prototype.propertyIsEnumerable,Mm=(t,e,r)=>e in t?fC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gC=(t,e)=>{for(var r in e||(e={}))dC.call(e,r)&&Mm(t,r,e[r]);if(Im)for(var r of Im(e))pC.call(e,r)&&Mm(t,r,e[r]);return t},vC=(t,e)=>hC(t,lC(e));const Cm="base10",ui="base16",Sd="base64pad",Id="utf8",Dm=0,Os=1,mC=0,Pm=1,Md=12,Cd=32;function bC(){const t=I0.generateKeyPair();return{privateKey:yn(t.secretKey,ui),publicKey:yn(t.publicKey,ui)}}function Dd(){const t=Oo.randomBytes(Cd);return yn(t,ui)}function yC(t,e){const r=I0.sharedKey(bn(t,ui),bn(e,ui),!0),i=new i7(Wc.SHA256,r).expand(Cd);return yn(i,ui)}function oh(t){const e=Wc.hash(bn(t,ui));return yn(e,ui)}function io(t){const e=Wc.hash(bn(t,Id));return yn(e,ui)}function wC(t){return bn(`${t}`,Cm)}function du(t){return Number(yn(t,Cm))}function _C(t){const e=wC(typeof t.type<"u"?t.type:Dm);if(du(e)===Os&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?bn(t.senderPublicKey,ui):void 0,i=typeof t.iv<"u"?bn(t.iv,ui):Oo.randomBytes(Md),n=new b0.ChaCha20Poly1305(bn(t.symKey,ui)).seal(i,bn(t.message,Id));return EC({type:e,sealed:n,iv:i,senderPublicKey:r})}function AC(t){const e=new b0.ChaCha20Poly1305(bn(t.symKey,ui)),{sealed:r,iv:i}=ah(t.encoded),n=e.open(i,r);if(n===null)throw new Error("Failed to decrypt");return yn(n,Id)}function EC(t){if(du(t.type)===Os){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return yn(D2([t.type,t.senderPublicKey,t.iv,t.sealed]),Sd)}return yn(D2([t.type,t.iv,t.sealed]),Sd)}function ah(t){const e=bn(t,Sd),r=e.slice(mC,Pm),i=Pm;if(du(r)===Os){const u=i+Cd,d=u+Md,p=e.slice(i,u),y=e.slice(u,d),_=e.slice(d);return{type:r,sealed:_,iv:y,senderPublicKey:p}}const n=i+Md,s=e.slice(i,n),a=e.slice(n);return{type:r,sealed:a,iv:s}}function xC(t,e){const r=ah(t);return Om({type:du(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?yn(r.senderPublicKey,ui):void 0,receiverPublicKey:e?.receiverPublicKey})}function Om(t){const e=t?.type||Dm;if(e===Os){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 $m(t){return t.type===Os&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function SC(t){return new W2.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function IC(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function MC(t){return Buffer.from(IC(t),"base64")}function CC(t,e){const[r,i,n]=t.split("."),s=MC(n);if(s.length!==64)throw new Error("Invalid signature length");const a=s.slice(0,32).toString("hex"),u=s.slice(32,64).toString("hex"),d=`${r}.${i}`,p=new Wc.SHA256().update(Buffer.from(d)).digest(),y=SC(e),_=Buffer.from(p).toString("hex"),C=y.verify(_,{r:a,s:u});if(!C)throw new Error("Invalid signature");const I=uC(t);return vC(gC({},I.payload),{isVerified:C})}const DC="irn";function Pd(t){return t?.relay||{protocol:DC}}function pu(t){const e=QA[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var PC=Object.defineProperty,OC=Object.defineProperties,$C=Object.getOwnPropertyDescriptors,Nm=Object.getOwnPropertySymbols,NC=Object.prototype.hasOwnProperty,RC=Object.prototype.propertyIsEnumerable,Rm=(t,e,r)=>e in t?PC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Tm=(t,e)=>{for(var r in e||(e={}))NC.call(e,r)&&Rm(t,r,e[r]);if(Nm)for(var r of Nm(e))RC.call(e,r)&&Rm(t,r,e[r]);return t},TC=(t,e)=>OC(t,$C(e));function FC(t,e="-"){const r={},i="relay"+e;return Object.keys(t).forEach(n=>{if(n.startsWith(i)){const s=n.replace(i,""),a=t[n];r[s]=a}}),r}function Fm(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,i=t.substring(0,e),n=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",a=Hc.parse(s),u=typeof a.methods=="string"?a.methods.split(","):void 0;return{protocol:i,topic:LC(n[0]),version:parseInt(n[1],10),symKey:a.symKey,relay:FC(a),methods:u,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function LC(t){return t.startsWith("//")?t.substring(2):t}function BC(t,e="-"){const r="relay",i={};return Object.keys(t).forEach(n=>{const s=r+e+n;t[n]&&(i[s]=t[n])}),i}function UC(t){return`${t.protocol}:${t.topic}@${t.version}?`+Hc.stringify(Tm(TC(Tm({symKey:t.symKey},BC(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function Za(t){const e=[];return t.forEach(r=>{const[i,n]=r.split(":");e.push(`${i}:${n}`)}),e}function kC(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Za(r.accounts))}),e}function jC(t,e){const r=[];return Object.values(t).forEach(i=>{Za(i.accounts).includes(e)&&r.push(...i.methods)}),r}function qC(t,e){const r=[];return Object.values(t).forEach(i=>{Za(i.accounts).includes(e)&&r.push(...i.events)}),r}function Od(t){return t.includes(":")}function gu(t){return Od(t)?t.split(":")[0]:t}function zC(t){const e={};return t?.forEach(r=>{const[i,n]=r.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[]}),e[i].accounts.push(r),e[i].chains.push(`${i}:${n}`)}),e}function Lm(t,e){e=e.map(i=>i.replace("did:pkh:",""));const r=zC(e);for(const[i,n]of Object.entries(r))n.methods?n.methods=kf(n.methods,t):n.methods=t,n.events=["chainChanged","accountsChanged"];return r}const HC={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}},KC={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 Ue(t,e){const{message:r,code:i}=KC[t];return{message:e?`${r} ${e}`:r,code:i}}function Yt(t,e){const{message:r,code:i}=HC[t];return{message:e?`${r} ${e}`:r,code:i}}function as(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function vu(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function fi(t){return typeof t>"u"}function br(t,e){return e&&fi(t)?!0:typeof t=="string"&&!!t.trim().length}function $d(t,e){return e&&fi(t)?!0:typeof t=="number"&&!isNaN(t)}function WC(t,e){const{requiredNamespaces:r}=e,i=Object.keys(t.namespaces),n=Object.keys(r);let s=!0;return Bo(n,i)?(i.forEach(a=>{const{accounts:u,methods:d,events:p}=t.namespaces[a],y=Za(u),_=r[a];(!Bo($v(a,_),y)||!Bo(_.methods,d)||!Bo(_.events,p))&&(s=!1)}),s):!1}function ch(t){return br(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function VC(t){if(br(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&ch(r)}}return!1}function GC(t){if(br(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function YC(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function JC(t){return t?.topic}function QC(t,e){let r=null;return br(t?.publicKey,!1)||(r=Ue("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function Bm(t){let e=!0;return as(t)?t.length&&(e=t.every(r=>br(r,!1))):e=!1,e}function ZC(t,e,r){let i=null;return as(e)&&e.length?e.forEach(n=>{i||ch(n)||(i=Yt("UNSUPPORTED_CHAINS",`${r}, chain ${n} should be a string and conform to "namespace:chainId" format`))}):ch(t)||(i=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"] }`)),i}function XC(t,e,r){let i=null;return Object.entries(t).forEach(([n,s])=>{if(i)return;const a=ZC(n,$v(n,s),`${e} ${r}`);a&&(i=a)}),i}function eD(t,e){let r=null;return as(t)?t.forEach(i=>{r||VC(i)||(r=Yt("UNSUPPORTED_ACCOUNTS",`${e}, account ${i} 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 tD(t,e){let r=null;return Object.values(t).forEach(i=>{if(r)return;const n=eD(i?.accounts,`${e} namespace`);n&&(r=n)}),r}function rD(t,e){let r=null;return Bm(t?.methods)?Bm(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 Um(t,e){let r=null;return Object.values(t).forEach(i=>{if(r)return;const n=rD(i,`${e}, namespace`);n&&(r=n)}),r}function iD(t,e,r){let i=null;if(t&&vu(t)){const n=Um(t,e);n&&(i=n);const s=XC(t,e,r);s&&(i=s)}else i=Ue("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return i}function Nd(t,e){let r=null;if(t&&vu(t)){const i=Um(t,e);i&&(r=i);const n=tD(t,e);n&&(r=n)}else r=Ue("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function km(t){return br(t.protocol,!0)}function nD(t,e){let r=!1;return e&&!t?r=!0:t&&as(t)&&t.length&&t.forEach(i=>{r=km(i)}),r}function sD(t){return typeof t=="number"}function _i(t){return typeof t<"u"&&typeof t!==null}function oD(t){return!(!t||typeof t!="object"||!t.code||!$d(t.code,!1)||!t.message||!br(t.message,!1))}function aD(t){return!(fi(t)||!br(t.method,!1))}function cD(t){return!(fi(t)||fi(t.result)&&fi(t.error)||!$d(t.id,!1)||!br(t.jsonrpc,!1))}function uD(t){return!(fi(t)||!br(t.name,!1))}function jm(t,e){return!(!ch(e)||!kC(t).includes(e))}function fD(t,e,r){return br(r,!1)?jC(t,e).includes(r):!1}function hD(t,e,r){return br(r,!1)?qC(t,e).includes(r):!1}function qm(t,e,r){let i=null;const n=lD(t),s=dD(e),a=Object.keys(n),u=Object.keys(s),d=zm(Object.keys(t)),p=zm(Object.keys(e)),y=d.filter(_=>!p.includes(_));return y.length&&(i=Ue("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
25
|
+
Required: ${y.toString()}
|
|
26
|
+
Received: ${Object.keys(e).toString()}`)),Bo(a,u)||(i=Ue("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
|
|
27
|
+
Required: ${a.toString()}
|
|
28
|
+
Approved: ${u.toString()}`)),Object.keys(e).forEach(_=>{if(!_.includes(":")||i)return;const C=Za(e[_].accounts);C.includes(_)||(i=Ue("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${_}
|
|
29
29
|
Required: ${_}
|
|
30
|
-
Approved: ${E.toString()}`))}),c.forEach(_=>{n||(ks(i[_].methods,o[_].methods)?ks(i[_].events,o[_].events)||(n=mt("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${_}`)):n=mt("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${_}`))}),n}function OA(e){const t={};return Object.keys(e).forEach(r=>{var n;r.includes(":")?t[r]=e[r]:(n=e[r].chains)==null||n.forEach(i=>{t[i]={methods:e[r].methods,events:e[r].events}})}),t}function Mm(e){return[...new Set(e.map(t=>t.includes(":")?t.split(":")[0]:t))]}function PA(e){const t={};return Object.keys(e).forEach(r=>{if(r.includes(":"))t[r]=e[r];else{const n=Zo(e[r].accounts);n?.forEach(i=>{t[i]={accounts:e[r].accounts.filter(o=>o.includes(`${i}:`)),methods:e[r].methods,events:e[r].events}})}}),t}function MA(e,t){return Rf(e,!1)&&e<=t.max&&e>=t.min}function $m(){const e=Ga();return new Promise(t=>{switch(e){case gn.browser:t($A());break;case gn.reactNative:t(NA());break;case gn.node:t(TA());break;default:t(!0)}})}function $A(){return Fo()&&navigator?.onLine}async function NA(){if(Uo()&&typeof global<"u"&&global!=null&&global.NetInfo){const e=await(global==null?void 0:global.NetInfo.fetch());return e?.isConnected}return!0}function TA(){return!0}function RA(e){switch(Ga()){case gn.browser:LA(e);break;case gn.reactNative:BA(e);break}}function LA(e){!Uo()&&Fo()&&(window.addEventListener("online",()=>e(!0)),window.addEventListener("offline",()=>e(!1)))}function BA(e){Uo()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(t=>e(t?.isConnected))}const Bf={};class cc{static get(t){return Bf[t]}static set(t,r){Bf[t]=r}static delete(t){delete Bf[t]}}const UA=/"(?:_|\\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*:/,FA=/"(?: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*:/,jA=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function kA(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){qA(e);return}return t}function qA(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function Bl(e,t={}){if(typeof e!="string")return e;const r=e.trim();if(e[0]==='"'&&e.at(-1)==='"'&&!e.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(!jA.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(UA.test(e)||FA.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,kA)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function zA(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function Er(e,...t){try{return zA(e(...t))}catch(r){return Promise.reject(r)}}function HA(e){const t=typeof e;return e===null||t!=="object"&&t!=="function"}function KA(e){const t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function Ul(e){if(HA(e))return String(e);if(KA(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return Ul(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Nm(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const Uf="base64:";function WA(e){if(typeof e=="string")return e;Nm();const t=Buffer.from(e).toString("base64");return Uf+t}function VA(e){return typeof e!="string"||!e.startsWith(Uf)?e:(Nm(),Buffer.from(e.slice(Uf.length),"base64"))}function rn(e){return e?e.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function GA(...e){return rn(e.join(":"))}function Fl(e){return e=rn(e),e?e+":":""}function bF(e){return e}const YA="memory",QA=()=>{const e=new Map;return{name:YA,options:{},hasItem(t){return e.has(t)},getItem(t){return e.get(t)||null},getItemRaw(t){return e.get(t)||null},setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys(){return Array.from(e.keys())},clear(){e.clear()},dispose(){e.clear()}}};function JA(e={}){const t={mounts:{"":e.driver||QA()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=h=>{for(const g of t.mountpoints)if(h.startsWith(g))return{base:g,relativeKey:h.slice(g.length),driver:t.mounts[g]};return{base:"",relativeKey:h,driver:t.mounts[""]}},n=(h,g)=>t.mountpoints.filter(_=>_.startsWith(h)||g&&h.startsWith(_)).map(_=>({relativeBase:h.length>_.length?h.slice(_.length):void 0,mountpoint:_,driver:t.mounts[_]})),i=(h,g)=>{if(t.watching){g=rn(g);for(const _ of t.watchListeners)_(h,g)}},o=async()=>{if(!t.watching){t.watching=!0;for(const h in t.mounts)t.unwatch[h]=await Tm(t.mounts[h],i,h)}},c=async()=>{if(t.watching){for(const h in t.unwatch)await t.unwatch[h]();t.unwatch={},t.watching=!1}},l=(h,g,_)=>{const E=new Map,x=I=>{let F=E.get(I.base);return F||(F={driver:I.driver,base:I.base,items:[]},E.set(I.base,F)),F};for(const I of h){const F=typeof I=="string",W=rn(F?I:I.key),Y=F?void 0:I.value,B=F||!I.options?g:{...g,...I.options},z=r(W);x(z).items.push({key:W,value:Y,relativeKey:z.relativeKey,options:B})}return Promise.all([...E.values()].map(I=>_(I))).then(I=>I.flat())},f={hasItem(h,g={}){h=rn(h);const{relativeKey:_,driver:E}=r(h);return Er(E.hasItem,_,g)},getItem(h,g={}){h=rn(h);const{relativeKey:_,driver:E}=r(h);return Er(E.getItem,_,g).then(x=>Bl(x))},getItems(h,g){return l(h,g,_=>_.driver.getItems?Er(_.driver.getItems,_.items.map(E=>({key:E.relativeKey,options:E.options})),g).then(E=>E.map(x=>({key:GA(_.base,x.key),value:Bl(x.value)}))):Promise.all(_.items.map(E=>Er(_.driver.getItem,E.relativeKey,E.options).then(x=>({key:E.key,value:Bl(x)})))))},getItemRaw(h,g={}){h=rn(h);const{relativeKey:_,driver:E}=r(h);return E.getItemRaw?Er(E.getItemRaw,_,g):Er(E.getItem,_,g).then(x=>VA(x))},async setItem(h,g,_={}){if(g===void 0)return f.removeItem(h);h=rn(h);const{relativeKey:E,driver:x}=r(h);x.setItem&&(await Er(x.setItem,E,Ul(g),_),x.watch||i("update",h))},async setItems(h,g){await l(h,g,async _=>{_.driver.setItems&&await Er(_.driver.setItems,_.items.map(E=>({key:E.relativeKey,value:Ul(E.value),options:E.options})),g),_.driver.setItem&&await Promise.all(_.items.map(E=>Er(_.driver.setItem,E.relativeKey,Ul(E.value),E.options)))})},async setItemRaw(h,g,_={}){if(g===void 0)return f.removeItem(h,_);h=rn(h);const{relativeKey:E,driver:x}=r(h);if(x.setItemRaw)await Er(x.setItemRaw,E,g,_);else if(x.setItem)await Er(x.setItem,E,WA(g),_);else return;x.watch||i("update",h)},async removeItem(h,g={}){typeof g=="boolean"&&(g={removeMeta:g}),h=rn(h);const{relativeKey:_,driver:E}=r(h);E.removeItem&&(await Er(E.removeItem,_,g),(g.removeMeta||g.removeMata)&&await Er(E.removeItem,_+"$",g),E.watch||i("remove",h))},async getMeta(h,g={}){typeof g=="boolean"&&(g={nativeOnly:g}),h=rn(h);const{relativeKey:_,driver:E}=r(h),x=Object.create(null);if(E.getMeta&&Object.assign(x,await Er(E.getMeta,_,g)),!g.nativeOnly){const I=await Er(E.getItem,_+"$",g).then(F=>Bl(F));I&&typeof I=="object"&&(typeof I.atime=="string"&&(I.atime=new Date(I.atime)),typeof I.mtime=="string"&&(I.mtime=new Date(I.mtime)),Object.assign(x,I))}return x},setMeta(h,g,_={}){return this.setItem(h+"$",g,_)},removeMeta(h,g={}){return this.removeItem(h+"$",g)},async getKeys(h,g={}){h=Fl(h);const _=n(h,!0);let E=[];const x=[];for(const I of _){const W=(await Er(I.driver.getKeys,I.relativeBase,g)).map(Y=>I.mountpoint+rn(Y)).filter(Y=>!E.some(B=>Y.startsWith(B)));x.push(...W),E=[I.mountpoint,...E.filter(Y=>!Y.startsWith(I.mountpoint))]}return h?x.filter(I=>I.startsWith(h)&&!I.endsWith("$")):x.filter(I=>!I.endsWith("$"))},async clear(h,g={}){h=Fl(h),await Promise.all(n(h,!1).map(async _=>{if(_.driver.clear)return Er(_.driver.clear,_.relativeBase,g);if(_.driver.removeItem){const E=await _.driver.getKeys(_.relativeBase||"",g);return Promise.all(E.map(x=>_.driver.removeItem(x,g)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(h=>Rm(h)))},async watch(h){return await o(),t.watchListeners.push(h),async()=>{t.watchListeners=t.watchListeners.filter(g=>g!==h),t.watchListeners.length===0&&await c()}},async unwatch(){t.watchListeners=[],await c()},mount(h,g){if(h=Fl(h),h&&t.mounts[h])throw new Error(`already mounted at ${h}`);return h&&(t.mountpoints.push(h),t.mountpoints.sort((_,E)=>E.length-_.length)),t.mounts[h]=g,t.watching&&Promise.resolve(Tm(g,i,h)).then(_=>{t.unwatch[h]=_}).catch(console.error),f},async unmount(h,g=!0){h=Fl(h),!(!h||!t.mounts[h])&&(t.watching&&h in t.unwatch&&(t.unwatch[h](),delete t.unwatch[h]),g&&await Rm(t.mounts[h]),t.mountpoints=t.mountpoints.filter(_=>_!==h),delete t.mounts[h])},getMount(h=""){h=rn(h)+":";const g=r(h);return{driver:g.driver,base:g.base}},getMounts(h="",g={}){return h=rn(h),n(h,g.parents).map(E=>({driver:E.driver,base:E.mountpoint}))}};return f}function Tm(e,t,r){return e.watch?e.watch((n,i)=>t(n,r+i)):()=>{}}async function Rm(e){typeof e.dispose=="function"&&await Er(e.dispose)}function Vs(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function Lm(e,t){const r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);const n=Vs(r);return(i,o)=>n.then(c=>o(c.transaction(t,i).objectStore(t)))}let Ff;function lc(){return Ff||(Ff=Lm("keyval-store","keyval")),Ff}function Bm(e,t=lc()){return t("readonly",r=>Vs(r.get(e)))}function ZA(e,t,r=lc()){return r("readwrite",n=>(n.put(t,e),Vs(n.transaction)))}function XA(e,t=lc()){return t("readwrite",r=>(r.delete(e),Vs(r.transaction)))}function t7(e=lc()){return e("readwrite",t=>(t.clear(),Vs(t.transaction)))}function e7(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},Vs(e.transaction)}function r7(e=lc()){return e("readonly",t=>{if(t.getAllKeys)return Vs(t.getAllKeys());const r=[];return e7(t,n=>r.push(n.key)).then(()=>r)})}const n7=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),i7=e=>{const t=/([\[:])?(\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=e.replace(t,'$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 uc(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return i7(e)}catch{return e}}function zi(e){return typeof e=="string"?e:n7(e)||""}const s7="idb-keyval";var o7=(e={})=>{const t=e.base&&e.base.length>0?`${e.base}:`:"",r=i=>t+i;let n;return e.dbName&&e.storeName&&(n=Lm(e.dbName,e.storeName)),{name:s7,options:e,async hasItem(i){return!(typeof await Bm(r(i),n)>"u")},async getItem(i){return await Bm(r(i),n)??null},setItem(i,o){return ZA(r(i),o,n)},removeItem(i){return XA(r(i),n)},getKeys(){return r7(n)},clear(){return t7(n)}}};const a7="WALLET_CONNECT_V2_INDEXED_DB",c7="keyvaluestorage";class l7{constructor(){this.indexedDb=JA({driver:o7({dbName:a7,storeName:c7})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(t=>[t.key,t.value])}async getItem(t){const r=await this.indexedDb.getItem(t);if(r!==null)return r}async setItem(t,r){await this.indexedDb.setItem(t,zi(r))}async removeItem(t){await this.indexedDb.removeItem(t)}}var jf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},jl={exports:{}};(function(){let e;function t(){}e=t,e.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},e.prototype.setItem=function(r,n){this[r]=String(n)},e.prototype.removeItem=function(r){delete this[r]},e.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},e.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof jf<"u"&&jf.localStorage?jl.exports=jf.localStorage:typeof window<"u"&&window.localStorage?jl.exports=window.localStorage:jl.exports=new t})();function u7(e){var t;return[e[0],uc((t=e[1])!=null?t:"")]}class h7{constructor(){this.localStorage=jl.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(u7)}async getItem(t){const r=this.localStorage.getItem(t);if(r!==null)return uc(r)}async setItem(t,r){this.localStorage.setItem(t,zi(r))}async removeItem(t){this.localStorage.removeItem(t)}}const f7="wc_storage_version",Um=1,d7=async(e,t,r)=>{const n=f7,i=await t.getItem(n);if(i&&i>=Um){r(t);return}const o=await e.getKeys();if(!o.length){r(t);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 e.getItem(l);await t.setItem(l,h),c.push(l)}}await t.setItem(n,Um),r(t),p7(e,c)},p7=async(e,t)=>{t.length&&t.forEach(async r=>{await e.removeItem(r)})};class g7{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const t=new h7;this.storage=t;try{const r=new l7;d7(t,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(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,r){return await this.initialize(),this.storage.setItem(t,r)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise(t=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),t())},20)})}}class Gs{}class m7 extends Gs{constructor(t){super()}}const Fm=yt.FIVE_SECONDS,hc={pulse:"heartbeat_pulse"};class kf extends m7{constructor(t){super(t),this.events=new Cr.exports.EventEmitter,this.interval=Fm,this.interval=t?.interval||Fm}static async init(t){const r=new kf(t);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),yt.toMiliseconds(this.interval))}pulse(){this.events.emit(hc.pulse)}}function v7(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var w7=y7;function y7(e,t,r){var n=r&&r.stringify||v7,i=1;if(typeof e=="object"&&e!==null){var o=t.length+i;if(o===1)return e;var c=new Array(o);c[0]=n(e);for(var l=1;l<o;l++)c[l]=n(t[l]);return c.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var h="",g=1-i,_=-1,E=e&&e.length||0,x=0;x<E;){if(e.charCodeAt(x)===37&&x+1<E){switch(_=_>-1?_:0,e.charCodeAt(x+1)){case 100:case 102:if(g>=f||t[g]==null)break;_<x&&(h+=e.slice(_,x)),h+=Number(t[g]),_=x+2,x++;break;case 105:if(g>=f||t[g]==null)break;_<x&&(h+=e.slice(_,x)),h+=Math.floor(Number(t[g])),_=x+2,x++;break;case 79:case 111:case 106:if(g>=f||t[g]===void 0)break;_<x&&(h+=e.slice(_,x));var I=typeof t[g];if(I==="string"){h+="'"+t[g]+"'",_=x+2,x++;break}if(I==="function"){h+=t[g].name||"<anonymous>",_=x+2,x++;break}h+=n(t[g]),_=x+2,x++;break;case 115:if(g>=f)break;_<x&&(h+=e.slice(_,x)),h+=String(t[g]),_=x+2,x++;break;case 37:_<x&&(h+=e.slice(_,x)),h+="%",_=x+2,x++,g--;break}++g}++x}return _===-1?e:(_<E&&(h+=e.slice(_)),h)}const jm=w7;var yi=bi;const fc=O7().console||{},b7={mapHttpRequest:ql,mapHttpResponse:ql,wrapRequestSerializer:zf,wrapResponseSerializer:zf,wrapErrorSerializer:zf,req:ql,res:ql,err:I7};function _7(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function bi(e){e=e||{},e.browser=e.browser||{};const t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");const r=e.browser.write||fc;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},i=_7(e.browser.serialize,n);let o=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);const c=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),e.enabled===!1&&(e.level="silent");const l=e.level||"info",f=Object.create(r);f.log||(f.log=dc),Object.defineProperty(f,"levelVal",{get:g}),Object.defineProperty(f,"level",{get:_,set:E});const h={transmit:t,serialize:i,asObject:e.browser.asObject,levels:c,timestamp:S7(e)};f.levels=bi.levels,f.level=l,f.setMaxListeners=f.getMaxListeners=f.emit=f.addListener=f.on=f.prependListener=f.once=f.prependOnceListener=f.removeListener=f.removeAllListeners=f.listeners=f.listenerCount=f.eventNames=f.write=f.flush=dc,f.serializers=n,f._serialize=i,f._stdErrSerialize=o,f.child=x,t&&(f._logEvent=qf());function g(){return this.level==="silent"?1/0:this.levels.values[this.level]}function _(){return this._level}function E(I){if(I!=="silent"&&!this.levels.values[I])throw Error("unknown level "+I);this._level=I,Xo(h,f,"error","log"),Xo(h,f,"fatal","error"),Xo(h,f,"warn","error"),Xo(h,f,"info","log"),Xo(h,f,"debug","log"),Xo(h,f,"trace","log")}function x(I,F){if(!I)throw new Error("missing bindings for child Pino");F=F||{},i&&I.serializers&&(F.serializers=I.serializers);const W=F.serializers;if(i&&W){var Y=Object.assign({},n,W),B=e.browser.serialize===!0?Object.keys(Y):i;delete I.serializers,kl([I],B,Y,this._stdErrSerialize)}function z(P){this._childLevel=(P._childLevel|0)+1,this.error=ta(P,I,"error"),this.fatal=ta(P,I,"fatal"),this.warn=ta(P,I,"warn"),this.info=ta(P,I,"info"),this.debug=ta(P,I,"debug"),this.trace=ta(P,I,"trace"),Y&&(this.serializers=Y,this._serialize=B),t&&(this._logEvent=qf([].concat(P._logEvent.bindings,I)))}return z.prototype=this,new z(this)}return f}bi.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"}},bi.stdSerializers=b7,bi.stdTimeFunctions=Object.assign({},{nullTime:km,epochTime:qm,unixTime:C7,isoTime:D7});function Xo(e,t,r,n){const i=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?dc:i[r]?i[r]:fc[r]||fc[n]||dc,E7(e,t,r)}function E7(e,t,r){!e.transmit&&t[r]===dc||(t[r]=function(n){return function(){const o=e.timestamp(),c=new Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===fc?fc:this;for(var f=0;f<c.length;f++)c[f]=arguments[f];if(e.serialize&&!e.asObject&&kl(c,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?n.call(l,A7(this,r,c,o)):n.apply(l,c),e.transmit){const h=e.transmit.level||t.level,g=bi.levels.values[h],_=bi.levels.values[r];if(_<g)return;x7(this,{ts:o,methodLevel:r,methodValue:_,transmitLevel:h,transmitValue:bi.levels.values[e.transmit.level||t.level],send:e.transmit.send,val:t.levelVal},c)}}}(t[r]))}function A7(e,t,r,n){e._serialize&&kl(r,e._serialize,e.serializers,e._stdErrSerialize);const i=r.slice();let o=i[0];const c={};n&&(c.time=n),c.level=bi.levels.values[t];let l=(e._childLevel|0)+1;if(l<1&&(l=1),o!==null&&typeof o=="object"){for(;l--&&typeof i[0]=="object";)Object.assign(c,i.shift());o=i.length?jm(i.shift(),i):void 0}else typeof o=="string"&&(o=jm(i.shift(),i));return o!==void 0&&(c.msg=o),c}function kl(e,t,r,n){for(const i in e)if(n&&e[i]instanceof Error)e[i]=bi.stdSerializers.err(e[i]);else if(typeof e[i]=="object"&&!Array.isArray(e[i]))for(const o in e[i])t&&t.indexOf(o)>-1&&o in r&&(e[i][o]=r[o](e[i][o]))}function ta(e,t,r){return function(){const n=new Array(1+arguments.length);n[0]=t;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return e[r].apply(this,n)}}function x7(e,t,r){const n=t.send,i=t.ts,o=t.methodLevel,c=t.methodValue,l=t.val,f=e._logEvent.bindings;kl(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(h){return f.indexOf(h)===-1}),e._logEvent.level.label=o,e._logEvent.level.value=c,n(o,e._logEvent,l),e._logEvent=qf(f)}function qf(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function I7(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)t[r]===void 0&&(t[r]=e[r]);return t}function S7(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?km:qm}function ql(){return{}}function zf(e){return e}function dc(){}function km(){return!1}function qm(){return Date.now()}function C7(){return Math.round(Date.now()/1e3)}function D7(){return new Date(Date.now()).toISOString()}function O7(){function e(t){return typeof t<"u"&&t}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}const P7={level:"info"},pc="custom_context",Hf=1e3*1024;class M7{constructor(t){this.nodeValue=t,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class zm{constructor(t){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=t,this.sizeInBytes=0}append(t){const r=new M7(t);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${t} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const t=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=t.size}toArray(){const t=[];let r=this.head;for(;r!==null;)t.push(r.value),r=r.next;return t}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let t=this.head;return{next:()=>{if(!t)return{done:!0,value:null};const r=t.value;return t=t.next,{done:!1,value:r}}}}}class Hm{constructor(t,r=Hf){this.level=t??"error",this.levelValue=yi.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new zm(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(t,r){r===yi.levels.values.error?console.error(t):r===yi.levels.values.warn?console.warn(t):r===yi.levels.values.debug?console.debug(t):r===yi.levels.values.trace?console.trace(t):console.log(t)}appendToLogs(t){this.logs.append(zi({timestamp:new Date().toISOString(),log:t}));const r=typeof t=="string"?JSON.parse(t).level:t.level;r>=this.levelValue&&this.forwardToConsole(t,r)}getLogs(){return this.logs}clearLogs(){this.logs=new zm(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(t){const r=this.getLogArray();return r.push(zi({extraMetadata:t})),new Blob(r,{type:"application/json"})}}class $7{constructor(t,r=Hf){this.baseChunkLogger=new Hm(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}downloadLogsBlobInBrowser(t){const r=URL.createObjectURL(this.logsToBlob(t)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}}class N7{constructor(t,r=Hf){this.baseChunkLogger=new Hm(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}}var T7=Object.defineProperty,R7=Object.defineProperties,L7=Object.getOwnPropertyDescriptors,Km=Object.getOwnPropertySymbols,B7=Object.prototype.hasOwnProperty,U7=Object.prototype.propertyIsEnumerable,Wm=(e,t,r)=>t in e?T7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zl=(e,t)=>{for(var r in t||(t={}))B7.call(t,r)&&Wm(e,r,t[r]);if(Km)for(var r of Km(t))U7.call(t,r)&&Wm(e,r,t[r]);return e},Hl=(e,t)=>R7(e,L7(t));function Kl(e){return Hl(zl({},e),{level:e?.level||P7.level})}function F7(e,t=pc){return e[t]||""}function j7(e,t,r=pc){return e[r]=t,e}function nn(e,t=pc){let r="";return typeof e.bindings>"u"?r=F7(e,t):r=e.bindings().context||"",r}function k7(e,t,r=pc){const n=nn(e,r);return n.trim()?`${n}/${t}`:t}function sn(e,t,r=pc){const n=k7(e,t,r),i=e.child({context:n});return j7(i,n,r)}function q7(e){var t,r;const n=new $7((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:yi(Hl(zl({},e.opts),{level:"trace",browser:Hl(zl({},(r=e.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function z7(e){var t;const r=new N7((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:yi(Hl(zl({},e.opts),{level:"trace"})),chunkLoggerController:r}}function H7(e){return typeof e.loggerOverride<"u"&&typeof e.loggerOverride!="string"?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?q7(e):z7(e)}class K7 extends Gs{constructor(t){super(),this.opts=t,this.protocol="wc",this.version=2}}class W7 extends Gs{constructor(t,r){super(),this.core=t,this.logger=r,this.records=new Map}}class V7{constructor(t,r){this.logger=t,this.core=r}}class G7 extends Gs{constructor(t,r){super(),this.relayer=t,this.logger=r}}class Y7 extends Gs{constructor(t){super()}}class Q7{constructor(t,r,n,i){this.core=t,this.logger=r,this.name=n}}class J7 extends Gs{constructor(t,r){super(),this.relayer=t,this.logger=r}}class Z7 extends Gs{constructor(t,r){super(),this.core=t,this.logger=r}}class X7{constructor(t,r){this.projectId=t,this.logger=r}}class tx{constructor(t,r){this.projectId=t,this.logger=r}}class ex{constructor(t){this.opts=t,this.protocol="wc",this.version=2}}class rx{constructor(t){this.client=t}}var Kf={},Vm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=ce,r=pn;e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var n=function(){function l(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 g=0;if(this._bytesHashed+=h,this._bufferLength>0){for(;this._bufferLength<e.BLOCK_SIZE&&h>0;)this._buffer[this._bufferLength++]=f[g++],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&&(g=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,f,g,h),h%=this.blockSize);h>0;)this._buffer[this._bufferLength++]=f[g++],h--;return this},l.prototype.finish=function(f){if(!this._finished){var h=this._bytesHashed,g=this._bufferLength,_=h/536870912|0,E=h<<3,x=h%128<112?128:256;this._buffer[g]=128;for(var I=g+1;I<x-8;I++)this._buffer[I]=0;t.writeUint32BE(_,this._buffer,x-8),t.writeUint32BE(E,this._buffer,x-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,x),this._finished=!0}for(var I=0;I<this.digestLength/8;I++)t.writeUint32BE(this._stateHi[I],f,I*8),t.writeUint32BE(this._stateLo[I],f,I*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}();e.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,g,_,E,x){for(var I=h[0],F=h[1],W=h[2],Y=h[3],B=h[4],z=h[5],P=h[6],U=h[7],j=g[0],m=g[1],$=g[2],et=g[3],tt=g[4],nt=g[5],dt=g[6],d=g[7],p,b,C,O,N,L,D,v;x>=128;){for(var T=0;T<16;T++){var ot=8*T+E;l[T]=t.readUint32BE(_,ot),f[T]=t.readUint32BE(_,ot+4)}for(var T=0;T<80;T++){var pt=I,A=F,rt=W,q=Y,H=B,V=z,w=P,k=U,it=j,ht=m,lt=$,Ot=et,Mt=tt,St=nt,Pe=dt,zt=d;if(p=U,b=d,N=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=(B>>>14|tt<<32-14)^(B>>>18|tt<<32-18)^(tt>>>41-32|B<<32-(41-32)),b=(tt>>>14|B<<32-14)^(tt>>>18|B<<32-18)^(B>>>41-32|tt<<32-(41-32)),N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,p=B&z^~B&P,b=tt&nt^~tt&dt,N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,p=i[T*2],b=i[T*2+1],N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,p=l[T%16],b=f[T%16],N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=N>>>16,D+=L>>>16,v+=D>>>16,C=D&65535|v<<16,O=N&65535|L<<16,p=C,b=O,N=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=(I>>>28|j<<32-28)^(j>>>34-32|I<<32-(34-32))^(j>>>39-32|I<<32-(39-32)),b=(j>>>28|I<<32-28)^(I>>>34-32|j<<32-(34-32))^(I>>>39-32|j<<32-(39-32)),N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,p=I&F^I&W^F&W,b=j&m^j&$^m&$,N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=N>>>16,D+=L>>>16,v+=D>>>16,k=D&65535|v<<16,zt=N&65535|L<<16,p=q,b=Ot,N=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=C,b=O,N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=N>>>16,D+=L>>>16,v+=D>>>16,q=D&65535|v<<16,Ot=N&65535|L<<16,F=pt,W=A,Y=rt,B=q,z=H,P=V,U=w,I=k,m=it,$=ht,et=lt,tt=Ot,nt=Mt,dt=St,d=Pe,j=zt,T%16===15)for(var ot=0;ot<16;ot++)p=l[ot],b=f[ot],N=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=l[(ot+9)%16],b=f[(ot+9)%16],N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,C=l[(ot+1)%16],O=f[(ot+1)%16],p=(C>>>1|O<<32-1)^(C>>>8|O<<32-8)^C>>>7,b=(O>>>1|C<<32-1)^(O>>>8|C<<32-8)^(O>>>7|C<<32-7),N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,C=l[(ot+14)%16],O=f[(ot+14)%16],p=(C>>>19|O<<32-19)^(O>>>61-32|C<<32-(61-32))^C>>>6,b=(O>>>19|C<<32-19)^(C>>>61-32|O<<32-(61-32))^(O>>>6|C<<32-6),N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=N>>>16,D+=L>>>16,v+=D>>>16,l[ot]=D&65535|v<<16,f[ot]=N&65535|L<<16}p=I,b=j,N=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[0],b=g[0],N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=N>>>16,D+=L>>>16,v+=D>>>16,h[0]=I=D&65535|v<<16,g[0]=j=N&65535|L<<16,p=F,b=m,N=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[1],b=g[1],N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=N>>>16,D+=L>>>16,v+=D>>>16,h[1]=F=D&65535|v<<16,g[1]=m=N&65535|L<<16,p=W,b=$,N=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[2],b=g[2],N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=N>>>16,D+=L>>>16,v+=D>>>16,h[2]=W=D&65535|v<<16,g[2]=$=N&65535|L<<16,p=Y,b=et,N=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[3],b=g[3],N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=N>>>16,D+=L>>>16,v+=D>>>16,h[3]=Y=D&65535|v<<16,g[3]=et=N&65535|L<<16,p=B,b=tt,N=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[4],b=g[4],N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=N>>>16,D+=L>>>16,v+=D>>>16,h[4]=B=D&65535|v<<16,g[4]=tt=N&65535|L<<16,p=z,b=nt,N=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[5],b=g[5],N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=N>>>16,D+=L>>>16,v+=D>>>16,h[5]=z=D&65535|v<<16,g[5]=nt=N&65535|L<<16,p=P,b=dt,N=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[6],b=g[6],N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=N>>>16,D+=L>>>16,v+=D>>>16,h[6]=P=D&65535|v<<16,g[6]=dt=N&65535|L<<16,p=U,b=d,N=b&65535,L=b>>>16,D=p&65535,v=p>>>16,p=h[7],b=g[7],N+=b&65535,L+=b>>>16,D+=p&65535,v+=p>>>16,L+=N>>>16,D+=L>>>16,v+=D>>>16,h[7]=U=D&65535|v<<16,g[7]=d=N&65535|L<<16,E+=128,x-=128}return E}function c(l){var f=new n;f.update(l);var h=f.digest();return f.clean(),h}e.hash=c})(Vm),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.convertSecretKeyToX25519=e.convertPublicKeyToX25519=e.verify=e.sign=e.extractPublicKeyFromSecretKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.SEED_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=e.SIGNATURE_LENGTH=void 0;const t=Lo,r=Vm,n=pn;e.SIGNATURE_LENGTH=64,e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=64,e.SEED_LENGTH=32;function i(q){const H=new Float64Array(16);if(q)for(let V=0;V<q.length;V++)H[V]=q[V];return H}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]),g=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),_=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),E=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function x(q,H){for(let V=0;V<16;V++)q[V]=H[V]|0}function I(q){let H=1;for(let V=0;V<16;V++){let w=q[V]+H+65535;H=Math.floor(w/65536),q[V]=w-H*65536}q[0]+=H-1+37*(H-1)}function F(q,H,V){const w=~(V-1);for(let k=0;k<16;k++){const it=w&(q[k]^H[k]);q[k]^=it,H[k]^=it}}function W(q,H){const V=i(),w=i();for(let k=0;k<16;k++)w[k]=H[k];I(w),I(w),I(w);for(let k=0;k<2;k++){V[0]=w[0]-65517;for(let ht=1;ht<15;ht++)V[ht]=w[ht]-65535-(V[ht-1]>>16&1),V[ht-1]&=65535;V[15]=w[15]-32767-(V[14]>>16&1);const it=V[15]>>16&1;V[14]&=65535,F(w,V,1-it)}for(let k=0;k<16;k++)q[2*k]=w[k]&255,q[2*k+1]=w[k]>>8}function Y(q,H){let V=0;for(let w=0;w<32;w++)V|=q[w]^H[w];return(1&V-1>>>8)-1}function B(q,H){const V=new Uint8Array(32),w=new Uint8Array(32);return W(V,q),W(w,H),Y(V,w)}function z(q){const H=new Uint8Array(32);return W(H,q),H[0]&1}function P(q,H){for(let V=0;V<16;V++)q[V]=H[2*V]+(H[2*V+1]<<8);q[15]&=32767}function U(q,H,V){for(let w=0;w<16;w++)q[w]=H[w]+V[w]}function j(q,H,V){for(let w=0;w<16;w++)q[w]=H[w]-V[w]}function m(q,H,V){let w,k,it=0,ht=0,lt=0,Ot=0,Mt=0,St=0,Pe=0,zt=0,Dt=0,Ft=0,Et=0,At=0,Gt=0,bt=0,xt=0,Bt=0,_t=0,Pt=0,jt=0,$t=0,Nt=0,le=0,Rt=0,Tt=0,nr=0,de=0,Ee=0,ir=0,Ie=0,Oe=0,Vr=0,Yt=V[0],Ht=V[1],Re=V[2],Qt=V[3],Vt=V[4],Me=V[5],Xt=V[6],te=V[7],Le=V[8],ee=V[9],Jt=V[10],Fe=V[11],Zt=V[12],kt=V[13],He=V[14],re=V[15];w=H[0],it+=w*Yt,ht+=w*Ht,lt+=w*Re,Ot+=w*Qt,Mt+=w*Vt,St+=w*Me,Pe+=w*Xt,zt+=w*te,Dt+=w*Le,Ft+=w*ee,Et+=w*Jt,At+=w*Fe,Gt+=w*Zt,bt+=w*kt,xt+=w*He,Bt+=w*re,w=H[1],ht+=w*Yt,lt+=w*Ht,Ot+=w*Re,Mt+=w*Qt,St+=w*Vt,Pe+=w*Me,zt+=w*Xt,Dt+=w*te,Ft+=w*Le,Et+=w*ee,At+=w*Jt,Gt+=w*Fe,bt+=w*Zt,xt+=w*kt,Bt+=w*He,_t+=w*re,w=H[2],lt+=w*Yt,Ot+=w*Ht,Mt+=w*Re,St+=w*Qt,Pe+=w*Vt,zt+=w*Me,Dt+=w*Xt,Ft+=w*te,Et+=w*Le,At+=w*ee,Gt+=w*Jt,bt+=w*Fe,xt+=w*Zt,Bt+=w*kt,_t+=w*He,Pt+=w*re,w=H[3],Ot+=w*Yt,Mt+=w*Ht,St+=w*Re,Pe+=w*Qt,zt+=w*Vt,Dt+=w*Me,Ft+=w*Xt,Et+=w*te,At+=w*Le,Gt+=w*ee,bt+=w*Jt,xt+=w*Fe,Bt+=w*Zt,_t+=w*kt,Pt+=w*He,jt+=w*re,w=H[4],Mt+=w*Yt,St+=w*Ht,Pe+=w*Re,zt+=w*Qt,Dt+=w*Vt,Ft+=w*Me,Et+=w*Xt,At+=w*te,Gt+=w*Le,bt+=w*ee,xt+=w*Jt,Bt+=w*Fe,_t+=w*Zt,Pt+=w*kt,jt+=w*He,$t+=w*re,w=H[5],St+=w*Yt,Pe+=w*Ht,zt+=w*Re,Dt+=w*Qt,Ft+=w*Vt,Et+=w*Me,At+=w*Xt,Gt+=w*te,bt+=w*Le,xt+=w*ee,Bt+=w*Jt,_t+=w*Fe,Pt+=w*Zt,jt+=w*kt,$t+=w*He,Nt+=w*re,w=H[6],Pe+=w*Yt,zt+=w*Ht,Dt+=w*Re,Ft+=w*Qt,Et+=w*Vt,At+=w*Me,Gt+=w*Xt,bt+=w*te,xt+=w*Le,Bt+=w*ee,_t+=w*Jt,Pt+=w*Fe,jt+=w*Zt,$t+=w*kt,Nt+=w*He,le+=w*re,w=H[7],zt+=w*Yt,Dt+=w*Ht,Ft+=w*Re,Et+=w*Qt,At+=w*Vt,Gt+=w*Me,bt+=w*Xt,xt+=w*te,Bt+=w*Le,_t+=w*ee,Pt+=w*Jt,jt+=w*Fe,$t+=w*Zt,Nt+=w*kt,le+=w*He,Rt+=w*re,w=H[8],Dt+=w*Yt,Ft+=w*Ht,Et+=w*Re,At+=w*Qt,Gt+=w*Vt,bt+=w*Me,xt+=w*Xt,Bt+=w*te,_t+=w*Le,Pt+=w*ee,jt+=w*Jt,$t+=w*Fe,Nt+=w*Zt,le+=w*kt,Rt+=w*He,Tt+=w*re,w=H[9],Ft+=w*Yt,Et+=w*Ht,At+=w*Re,Gt+=w*Qt,bt+=w*Vt,xt+=w*Me,Bt+=w*Xt,_t+=w*te,Pt+=w*Le,jt+=w*ee,$t+=w*Jt,Nt+=w*Fe,le+=w*Zt,Rt+=w*kt,Tt+=w*He,nr+=w*re,w=H[10],Et+=w*Yt,At+=w*Ht,Gt+=w*Re,bt+=w*Qt,xt+=w*Vt,Bt+=w*Me,_t+=w*Xt,Pt+=w*te,jt+=w*Le,$t+=w*ee,Nt+=w*Jt,le+=w*Fe,Rt+=w*Zt,Tt+=w*kt,nr+=w*He,de+=w*re,w=H[11],At+=w*Yt,Gt+=w*Ht,bt+=w*Re,xt+=w*Qt,Bt+=w*Vt,_t+=w*Me,Pt+=w*Xt,jt+=w*te,$t+=w*Le,Nt+=w*ee,le+=w*Jt,Rt+=w*Fe,Tt+=w*Zt,nr+=w*kt,de+=w*He,Ee+=w*re,w=H[12],Gt+=w*Yt,bt+=w*Ht,xt+=w*Re,Bt+=w*Qt,_t+=w*Vt,Pt+=w*Me,jt+=w*Xt,$t+=w*te,Nt+=w*Le,le+=w*ee,Rt+=w*Jt,Tt+=w*Fe,nr+=w*Zt,de+=w*kt,Ee+=w*He,ir+=w*re,w=H[13],bt+=w*Yt,xt+=w*Ht,Bt+=w*Re,_t+=w*Qt,Pt+=w*Vt,jt+=w*Me,$t+=w*Xt,Nt+=w*te,le+=w*Le,Rt+=w*ee,Tt+=w*Jt,nr+=w*Fe,de+=w*Zt,Ee+=w*kt,ir+=w*He,Ie+=w*re,w=H[14],xt+=w*Yt,Bt+=w*Ht,_t+=w*Re,Pt+=w*Qt,jt+=w*Vt,$t+=w*Me,Nt+=w*Xt,le+=w*te,Rt+=w*Le,Tt+=w*ee,nr+=w*Jt,de+=w*Fe,Ee+=w*Zt,ir+=w*kt,Ie+=w*He,Oe+=w*re,w=H[15],Bt+=w*Yt,_t+=w*Ht,Pt+=w*Re,jt+=w*Qt,$t+=w*Vt,Nt+=w*Me,le+=w*Xt,Rt+=w*te,Tt+=w*Le,nr+=w*ee,de+=w*Jt,Ee+=w*Fe,ir+=w*Zt,Ie+=w*kt,Oe+=w*He,Vr+=w*re,it+=38*_t,ht+=38*Pt,lt+=38*jt,Ot+=38*$t,Mt+=38*Nt,St+=38*le,Pe+=38*Rt,zt+=38*Tt,Dt+=38*nr,Ft+=38*de,Et+=38*Ee,At+=38*ir,Gt+=38*Ie,bt+=38*Oe,xt+=38*Vr,k=1,w=it+k+65535,k=Math.floor(w/65536),it=w-k*65536,w=ht+k+65535,k=Math.floor(w/65536),ht=w-k*65536,w=lt+k+65535,k=Math.floor(w/65536),lt=w-k*65536,w=Ot+k+65535,k=Math.floor(w/65536),Ot=w-k*65536,w=Mt+k+65535,k=Math.floor(w/65536),Mt=w-k*65536,w=St+k+65535,k=Math.floor(w/65536),St=w-k*65536,w=Pe+k+65535,k=Math.floor(w/65536),Pe=w-k*65536,w=zt+k+65535,k=Math.floor(w/65536),zt=w-k*65536,w=Dt+k+65535,k=Math.floor(w/65536),Dt=w-k*65536,w=Ft+k+65535,k=Math.floor(w/65536),Ft=w-k*65536,w=Et+k+65535,k=Math.floor(w/65536),Et=w-k*65536,w=At+k+65535,k=Math.floor(w/65536),At=w-k*65536,w=Gt+k+65535,k=Math.floor(w/65536),Gt=w-k*65536,w=bt+k+65535,k=Math.floor(w/65536),bt=w-k*65536,w=xt+k+65535,k=Math.floor(w/65536),xt=w-k*65536,w=Bt+k+65535,k=Math.floor(w/65536),Bt=w-k*65536,it+=k-1+37*(k-1),k=1,w=it+k+65535,k=Math.floor(w/65536),it=w-k*65536,w=ht+k+65535,k=Math.floor(w/65536),ht=w-k*65536,w=lt+k+65535,k=Math.floor(w/65536),lt=w-k*65536,w=Ot+k+65535,k=Math.floor(w/65536),Ot=w-k*65536,w=Mt+k+65535,k=Math.floor(w/65536),Mt=w-k*65536,w=St+k+65535,k=Math.floor(w/65536),St=w-k*65536,w=Pe+k+65535,k=Math.floor(w/65536),Pe=w-k*65536,w=zt+k+65535,k=Math.floor(w/65536),zt=w-k*65536,w=Dt+k+65535,k=Math.floor(w/65536),Dt=w-k*65536,w=Ft+k+65535,k=Math.floor(w/65536),Ft=w-k*65536,w=Et+k+65535,k=Math.floor(w/65536),Et=w-k*65536,w=At+k+65535,k=Math.floor(w/65536),At=w-k*65536,w=Gt+k+65535,k=Math.floor(w/65536),Gt=w-k*65536,w=bt+k+65535,k=Math.floor(w/65536),bt=w-k*65536,w=xt+k+65535,k=Math.floor(w/65536),xt=w-k*65536,w=Bt+k+65535,k=Math.floor(w/65536),Bt=w-k*65536,it+=k-1+37*(k-1),q[0]=it,q[1]=ht,q[2]=lt,q[3]=Ot,q[4]=Mt,q[5]=St,q[6]=Pe,q[7]=zt,q[8]=Dt,q[9]=Ft,q[10]=Et,q[11]=At,q[12]=Gt,q[13]=bt,q[14]=xt,q[15]=Bt}function $(q,H){m(q,H,H)}function et(q,H){const V=i();let w;for(w=0;w<16;w++)V[w]=H[w];for(w=253;w>=0;w--)$(V,V),w!==2&&w!==4&&m(V,V,H);for(w=0;w<16;w++)q[w]=V[w]}function tt(q,H){const V=i();let w;for(w=0;w<16;w++)V[w]=H[w];for(w=250;w>=0;w--)$(V,V),w!==1&&m(V,V,H);for(w=0;w<16;w++)q[w]=V[w]}function nt(q,H){const V=i(),w=i(),k=i(),it=i(),ht=i(),lt=i(),Ot=i(),Mt=i(),St=i();j(V,q[1],q[0]),j(St,H[1],H[0]),m(V,V,St),U(w,q[0],q[1]),U(St,H[0],H[1]),m(w,w,St),m(k,q[3],H[3]),m(k,k,h),m(it,q[2],H[2]),U(it,it,it),j(ht,w,V),j(lt,it,k),U(Ot,it,k),U(Mt,w,V),m(q[0],ht,lt),m(q[1],Mt,Ot),m(q[2],Ot,lt),m(q[3],ht,Mt)}function dt(q,H,V){for(let w=0;w<4;w++)F(q[w],H[w],V)}function d(q,H){const V=i(),w=i(),k=i();et(k,H[2]),m(V,H[0],k),m(w,H[1],k),W(q,w),q[31]^=z(V)<<7}function p(q,H,V){x(q[0],c),x(q[1],l),x(q[2],l),x(q[3],c);for(let w=255;w>=0;--w){const k=V[w/8|0]>>(w&7)&1;dt(q,H,k),nt(H,q),nt(q,q),dt(q,H,k)}}function b(q,H){const V=[i(),i(),i(),i()];x(V[0],g),x(V[1],_),x(V[2],l),m(V[3],g,_),p(q,V,H)}function C(q){if(q.length!==e.SEED_LENGTH)throw new Error(`ed25519: seed must be ${e.SEED_LENGTH} bytes`);const H=(0,r.hash)(q);H[0]&=248,H[31]&=127,H[31]|=64;const V=new Uint8Array(32),w=[i(),i(),i(),i()];b(w,H),d(V,w);const k=new Uint8Array(64);return k.set(q),k.set(V,32),{publicKey:V,secretKey:k}}e.generateKeyPairFromSeed=C;function O(q){const H=(0,t.randomBytes)(32,q),V=C(H);return(0,n.wipe)(H),V}e.generateKeyPair=O;function N(q){if(q.length!==e.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${e.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(q.subarray(32))}e.extractPublicKeyFromSecretKey=N;const L=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 D(q,H){let V,w,k,it;for(w=63;w>=32;--w){for(V=0,k=w-32,it=w-12;k<it;++k)H[k]+=V-16*H[w]*L[k-(w-32)],V=Math.floor((H[k]+128)/256),H[k]-=V*256;H[k]+=V,H[w]=0}for(V=0,k=0;k<32;k++)H[k]+=V-(H[31]>>4)*L[k],V=H[k]>>8,H[k]&=255;for(k=0;k<32;k++)H[k]-=V*L[k];for(w=0;w<32;w++)H[w+1]+=H[w]>>8,q[w]=H[w]&255}function v(q){const H=new Float64Array(64);for(let V=0;V<64;V++)H[V]=q[V];for(let V=0;V<64;V++)q[V]=0;D(q,H)}function T(q,H){const V=new Float64Array(64),w=[i(),i(),i(),i()],k=(0,r.hash)(q.subarray(0,32));k[0]&=248,k[31]&=127,k[31]|=64;const it=new Uint8Array(64);it.set(k.subarray(32),32);const ht=new r.SHA512;ht.update(it.subarray(32)),ht.update(H);const lt=ht.digest();ht.clean(),v(lt),b(w,lt),d(it,w),ht.reset(),ht.update(it.subarray(0,32)),ht.update(q.subarray(32)),ht.update(H);const Ot=ht.digest();v(Ot);for(let Mt=0;Mt<32;Mt++)V[Mt]=lt[Mt];for(let Mt=0;Mt<32;Mt++)for(let St=0;St<32;St++)V[Mt+St]+=Ot[Mt]*k[St];return D(it.subarray(32),V),it}e.sign=T;function ot(q,H){const V=i(),w=i(),k=i(),it=i(),ht=i(),lt=i(),Ot=i();return x(q[2],l),P(q[1],H),$(k,q[1]),m(it,k,f),j(k,k,q[2]),U(it,q[2],it),$(ht,it),$(lt,ht),m(Ot,lt,ht),m(V,Ot,k),m(V,V,it),tt(V,V),m(V,V,k),m(V,V,it),m(V,V,it),m(q[0],V,it),$(w,q[0]),m(w,w,it),B(w,k)&&m(q[0],q[0],E),$(w,q[0]),m(w,w,it),B(w,k)?-1:(z(q[0])===H[31]>>7&&j(q[0],c,q[0]),m(q[3],q[0],q[1]),0)}function pt(q,H,V){const w=new Uint8Array(32),k=[i(),i(),i(),i()],it=[i(),i(),i(),i()];if(V.length!==e.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${e.SIGNATURE_LENGTH} bytes`);if(ot(it,q))return!1;const ht=new r.SHA512;ht.update(V.subarray(0,32)),ht.update(q),ht.update(H);const lt=ht.digest();return v(lt),p(k,it,lt),b(it,V.subarray(32)),nt(k,it),d(w,k),!Y(V,w)}e.verify=pt;function A(q){let H=[i(),i(),i(),i()];if(ot(H,q))throw new Error("Ed25519: invalid public key");let V=i(),w=i(),k=H[1];U(V,l,k),j(w,l,k),et(w,w),m(V,V,w);let it=new Uint8Array(32);return W(it,V),it}e.convertPublicKeyToX25519=A;function rt(q){const H=(0,r.hash)(q.subarray(0,32));H[0]&=248,H[31]&=127,H[31]|=64;const V=new Uint8Array(H.subarray(0,32));return(0,n.wipe)(H),V}e.convertSecretKeyToX25519=rt}(Kf);const nx="EdDSA",ix="JWT",Gm=".",Ym="base64url",sx="utf8",ox="utf8",ax=":",cx="did",lx="key",Qm="base58btc",ux="z",hx="K36",fx=32;function Wf(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Jm(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Wf(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function dx(e,t){t||(t=e.reduce((i,o)=>i+o.length,0));const r=Jm(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return Wf(r)}function Zm(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Xm=Zm("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Vf=Zm("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=Jm(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),tv={utf8:Xm,"utf-8":Xm,hex:Bo.base16,latin1:Vf,ascii:Vf,binary:Vf,...Bo};function Gf(e,t="utf8"){const r=tv[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function Yf(e,t="utf8"){const r=tv[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Wf(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function Wl(e){return Gf(Yf(zi(e),sx),Ym)}function ev(e){const t=Yf(hx,Qm),r=ux+Gf(dx([t,e]),Qm);return[cx,lx,r].join(ax)}function px(e){return Gf(e,Ym)}function gx(e){return Yf([Wl(e.header),Wl(e.payload)].join(Gm),ox)}function mx(e){return[Wl(e.header),Wl(e.payload),px(e.signature)].join(Gm)}function rv(e=Lo.randomBytes(fx)){return Kf.generateKeyPairFromSeed(e)}async function vx(e,t,r,n,i=yt.fromMiliseconds(Date.now())){const o={alg:nx,typ:ix},c=ev(n.publicKey),l=i+r,f={iss:c,sub:e,aud:t,iat:i,exp:l},h=gx({header:o,payload:f}),g=Kf.sign(n.secretKey,h);return mx({header:o,payload:f,signature:g})}function wx(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function nv(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const iv=nv("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Qf=nv("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=wx(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),yx={utf8:iv,"utf-8":iv,hex:Bo.base16,latin1:Qf,ascii:Qf,binary:Qf,...Bo};function bx(e,t="utf8"){const r=yx[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}const _x="PARSE_ERROR",Ex="INVALID_REQUEST",Ax="METHOD_NOT_FOUND",xx="INVALID_PARAMS",sv="INTERNAL_ERROR",Jf="SERVER_ERROR",Ix=[-32700,-32600,-32601,-32602,-32603],gc={[_x]:{code:-32700,message:"Parse error"},[Ex]:{code:-32600,message:"Invalid Request"},[Ax]:{code:-32601,message:"Method not found"},[xx]:{code:-32602,message:"Invalid params"},[sv]:{code:-32603,message:"Internal error"},[Jf]:{code:-32e3,message:"Server error"}},ov=Jf;function Sx(e){return Ix.includes(e)}function av(e){return Object.keys(gc).includes(e)?gc[e]:gc[ov]}function Cx(e){const t=Object.values(gc).find(r=>r.code===e);return t||gc[ov]}function cv(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}var lv={};/*! *****************************************************************************
|
|
30
|
+
Approved: ${C.toString()}`))}),a.forEach(_=>{i||(Bo(n[_].methods,s[_].methods)?Bo(n[_].events,s[_].events)||(i=Ue("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${_}`)):i=Ue("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${_}`))}),i}function lD(t){const e={};return Object.keys(t).forEach(r=>{var i;r.includes(":")?e[r]=t[r]:(i=t[r].chains)==null||i.forEach(n=>{e[n]={methods:t[r].methods,events:t[r].events}})}),e}function zm(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function dD(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const i=Za(t[r].accounts);i?.forEach(n=>{e[n]={accounts:t[r].accounts.filter(s=>s.includes(`${n}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function pD(t,e){return $d(t,!1)&&t<=e.max&&t>=e.min}function Hm(){const t=ru();return new Promise(e=>{switch(t){case Bi.browser:e(gD());break;case Bi.reactNative:e(vD());break;case Bi.node:e(mD());break;default:e(!0)}})}function gD(){return tu()&&navigator?.onLine}async function vD(){if(eu()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t?.isConnected}return!0}function mD(){return!0}function bD(t){switch(ru()){case Bi.browser:yD(t);break;case Bi.reactNative:wD(t);break}}function yD(t){!eu()&&tu()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function wD(t){eu()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(e=>t(e?.isConnected))}const Rd={};class mu{static get(e){return Rd[e]}static set(e,r){Rd[e]=r}static delete(e){delete Rd[e]}}const _D=/"(?:_|\\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*:/,AD=/"(?: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*:/,ED=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function xD(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){SD(t);return}return e}function SD(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function uh(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 i=r.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;if(i==="undefined")return;if(i==="null")return null;if(i==="nan")return Number.NaN;if(i==="infinity")return Number.POSITIVE_INFINITY;if(i==="-infinity")return Number.NEGATIVE_INFINITY}if(!ED.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(_D.test(t)||AD.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,xD)}return JSON.parse(t)}catch(i){if(e.strict)throw i;return t}}function ID(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Rr(t,...e){try{return ID(t(...e))}catch(r){return Promise.reject(r)}}function MD(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function CD(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function fh(t){if(MD(t))return String(t);if(CD(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return fh(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Km(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const Td="base64:";function DD(t){if(typeof t=="string")return t;Km();const e=Buffer.from(t).toString("base64");return Td+e}function PD(t){return typeof t!="string"||!t.startsWith(Td)?t:(Km(),Buffer.from(t.slice(Td.length),"base64"))}function Ai(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function OD(...t){return Ai(t.join(":"))}function hh(t){return t=Ai(t),t?t+":":""}function lV(t){return t}const $D="memory",ND=()=>{const t=new Map;return{name:$D,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 RD(t={}){const e={mounts:{"":t.driver||ND()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=p=>{for(const y of e.mountpoints)if(p.startsWith(y))return{base:y,relativeKey:p.slice(y.length),driver:e.mounts[y]};return{base:"",relativeKey:p,driver:e.mounts[""]}},i=(p,y)=>e.mountpoints.filter(_=>_.startsWith(p)||y&&p.startsWith(_)).map(_=>({relativeBase:p.length>_.length?p.slice(_.length):void 0,mountpoint:_,driver:e.mounts[_]})),n=(p,y)=>{if(e.watching){y=Ai(y);for(const _ of e.watchListeners)_(p,y)}},s=async()=>{if(!e.watching){e.watching=!0;for(const p in e.mounts)e.unwatch[p]=await Wm(e.mounts[p],n,p)}},a=async()=>{if(e.watching){for(const p in e.unwatch)await e.unwatch[p]();e.unwatch={},e.watching=!1}},u=(p,y,_)=>{const C=new Map,I=M=>{let B=C.get(M.base);return B||(B={driver:M.driver,base:M.base,items:[]},C.set(M.base,B)),B};for(const M of p){const B=typeof M=="string",W=Ai(B?M:M.key),Y=B?void 0:M.value,q=B||!M.options?y:{...y,...M.options},V=r(W);I(V).items.push({key:W,value:Y,relativeKey:V.relativeKey,options:q})}return Promise.all([...C.values()].map(M=>_(M))).then(M=>M.flat())},d={hasItem(p,y={}){p=Ai(p);const{relativeKey:_,driver:C}=r(p);return Rr(C.hasItem,_,y)},getItem(p,y={}){p=Ai(p);const{relativeKey:_,driver:C}=r(p);return Rr(C.getItem,_,y).then(I=>uh(I))},getItems(p,y){return u(p,y,_=>_.driver.getItems?Rr(_.driver.getItems,_.items.map(C=>({key:C.relativeKey,options:C.options})),y).then(C=>C.map(I=>({key:OD(_.base,I.key),value:uh(I.value)}))):Promise.all(_.items.map(C=>Rr(_.driver.getItem,C.relativeKey,C.options).then(I=>({key:C.key,value:uh(I)})))))},getItemRaw(p,y={}){p=Ai(p);const{relativeKey:_,driver:C}=r(p);return C.getItemRaw?Rr(C.getItemRaw,_,y):Rr(C.getItem,_,y).then(I=>PD(I))},async setItem(p,y,_={}){if(y===void 0)return d.removeItem(p);p=Ai(p);const{relativeKey:C,driver:I}=r(p);I.setItem&&(await Rr(I.setItem,C,fh(y),_),I.watch||n("update",p))},async setItems(p,y){await u(p,y,async _=>{_.driver.setItems&&await Rr(_.driver.setItems,_.items.map(C=>({key:C.relativeKey,value:fh(C.value),options:C.options})),y),_.driver.setItem&&await Promise.all(_.items.map(C=>Rr(_.driver.setItem,C.relativeKey,fh(C.value),C.options)))})},async setItemRaw(p,y,_={}){if(y===void 0)return d.removeItem(p,_);p=Ai(p);const{relativeKey:C,driver:I}=r(p);if(I.setItemRaw)await Rr(I.setItemRaw,C,y,_);else if(I.setItem)await Rr(I.setItem,C,DD(y),_);else return;I.watch||n("update",p)},async removeItem(p,y={}){typeof y=="boolean"&&(y={removeMeta:y}),p=Ai(p);const{relativeKey:_,driver:C}=r(p);C.removeItem&&(await Rr(C.removeItem,_,y),(y.removeMeta||y.removeMata)&&await Rr(C.removeItem,_+"$",y),C.watch||n("remove",p))},async getMeta(p,y={}){typeof y=="boolean"&&(y={nativeOnly:y}),p=Ai(p);const{relativeKey:_,driver:C}=r(p),I=Object.create(null);if(C.getMeta&&Object.assign(I,await Rr(C.getMeta,_,y)),!y.nativeOnly){const M=await Rr(C.getItem,_+"$",y).then(B=>uh(B));M&&typeof M=="object"&&(typeof M.atime=="string"&&(M.atime=new Date(M.atime)),typeof M.mtime=="string"&&(M.mtime=new Date(M.mtime)),Object.assign(I,M))}return I},setMeta(p,y,_={}){return this.setItem(p+"$",y,_)},removeMeta(p,y={}){return this.removeItem(p+"$",y)},async getKeys(p,y={}){p=hh(p);const _=i(p,!0);let C=[];const I=[];for(const M of _){const W=(await Rr(M.driver.getKeys,M.relativeBase,y)).map(Y=>M.mountpoint+Ai(Y)).filter(Y=>!C.some(q=>Y.startsWith(q)));I.push(...W),C=[M.mountpoint,...C.filter(Y=>!Y.startsWith(M.mountpoint))]}return p?I.filter(M=>M.startsWith(p)&&!M.endsWith("$")):I.filter(M=>!M.endsWith("$"))},async clear(p,y={}){p=hh(p),await Promise.all(i(p,!1).map(async _=>{if(_.driver.clear)return Rr(_.driver.clear,_.relativeBase,y);if(_.driver.removeItem){const C=await _.driver.getKeys(_.relativeBase||"",y);return Promise.all(C.map(I=>_.driver.removeItem(I,y)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(p=>Vm(p)))},async watch(p){return await s(),e.watchListeners.push(p),async()=>{e.watchListeners=e.watchListeners.filter(y=>y!==p),e.watchListeners.length===0&&await a()}},async unwatch(){e.watchListeners=[],await a()},mount(p,y){if(p=hh(p),p&&e.mounts[p])throw new Error(`already mounted at ${p}`);return p&&(e.mountpoints.push(p),e.mountpoints.sort((_,C)=>C.length-_.length)),e.mounts[p]=y,e.watching&&Promise.resolve(Wm(y,n,p)).then(_=>{e.unwatch[p]=_}).catch(console.error),d},async unmount(p,y=!0){p=hh(p),!(!p||!e.mounts[p])&&(e.watching&&p in e.unwatch&&(e.unwatch[p](),delete e.unwatch[p]),y&&await Vm(e.mounts[p]),e.mountpoints=e.mountpoints.filter(_=>_!==p),delete e.mounts[p])},getMount(p=""){p=Ai(p)+":";const y=r(p);return{driver:y.driver,base:y.base}},getMounts(p="",y={}){return p=Ai(p),i(p,y.parents).map(C=>({driver:C.driver,base:C.mountpoint}))}};return d}function Wm(t,e,r){return t.watch?t.watch((i,n)=>e(i,r+n)):()=>{}}async function Vm(t){typeof t.dispose=="function"&&await Rr(t.dispose)}function zo(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function Gm(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const i=zo(r);return(n,s)=>i.then(a=>s(a.transaction(e,n).objectStore(e)))}let Fd;function bu(){return Fd||(Fd=Gm("keyval-store","keyval")),Fd}function Ym(t,e=bu()){return e("readonly",r=>zo(r.get(t)))}function TD(t,e,r=bu()){return r("readwrite",i=>(i.put(e,t),zo(i.transaction)))}function FD(t,e=bu()){return e("readwrite",r=>(r.delete(t),zo(r.transaction)))}function LD(t=bu()){return t("readwrite",e=>(e.clear(),zo(e.transaction)))}function BD(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},zo(t.transaction)}function UD(t=bu()){return t("readonly",e=>{if(e.getAllKeys)return zo(e.getAllKeys());const r=[];return BD(e,i=>r.push(i.key)).then(()=>r)})}const kD="idb-keyval";var jD=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=n=>e+n;let i;return t.dbName&&t.storeName&&(i=Gm(t.dbName,t.storeName)),{name:kD,options:t,async hasItem(n){return!(typeof await Ym(r(n),i)>"u")},async getItem(n){return await Ym(r(n),i)??null},setItem(n,s){return TD(r(n),s,i)},removeItem(n){return FD(r(n),i)},getKeys(){return UD(i)},clear(){return LD(i)}}};const qD="WALLET_CONNECT_V2_INDEXED_DB",zD="keyvaluestorage";class HD{constructor(){this.indexedDb=RD({driver:jD({dbName:qD,storeName:zD})})}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,Is(r))}async removeItem(e){await this.indexedDb.removeItem(e)}}var Ld=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},lh={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,i){this[r]=String(i)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(i){r[i]=void 0,delete r[i]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Ld<"u"&&Ld.localStorage?lh.exports=Ld.localStorage:typeof window<"u"&&window.localStorage?lh.exports=window.localStorage:lh.exports=new e})();function KD(t){var e;return[t[0],Ua((e=t[1])!=null?e:"")]}class WD{constructor(){this.localStorage=lh.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(KD)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return Ua(r)}async setItem(e,r){this.localStorage.setItem(e,Is(r))}async removeItem(e){this.localStorage.removeItem(e)}}const VD="wc_storage_version",Jm=1,GD=async(t,e,r)=>{const i=VD,n=await e.getItem(i);if(n&&n>=Jm){r(e);return}const s=await t.getKeys();if(!s.length){r(e);return}const a=[];for(;s.length;){const u=s.shift();if(!u)continue;const d=u.toLowerCase();if(d.includes("wc@")||d.includes("walletconnect")||d.includes("wc_")||d.includes("wallet_connect")){const p=await t.getItem(u);await e.setItem(u,p),a.push(u)}}await e.setItem(i,Jm),r(e),YD(t,a)},YD=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};class JD{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new WD;this.storage=e;try{const r=new HD;GD(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)})}}class Ho{}class QD extends Ho{constructor(e){super()}}const Qm=He.FIVE_SECONDS,yu={pulse:"heartbeat_pulse"};class Bd extends QD{constructor(e){super(e),this.events=new Br.exports.EventEmitter,this.interval=Qm,this.interval=e?.interval||Qm}static async init(e){const r=new Bd(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}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 initialize(){this.intervalRef=setInterval(()=>this.pulse(),He.toMiliseconds(this.interval))}pulse(){this.events.emit(yu.pulse)}}function ZD(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var XD=eP;function eP(t,e,r){var i=r&&r.stringify||ZD,n=1;if(typeof t=="object"&&t!==null){var s=e.length+n;if(s===1)return t;var a=new Array(s);a[0]=i(t);for(var u=1;u<s;u++)a[u]=i(e[u]);return a.join(" ")}if(typeof t!="string")return t;var d=e.length;if(d===0)return t;for(var p="",y=1-n,_=-1,C=t&&t.length||0,I=0;I<C;){if(t.charCodeAt(I)===37&&I+1<C){switch(_=_>-1?_:0,t.charCodeAt(I+1)){case 100:case 102:if(y>=d||e[y]==null)break;_<I&&(p+=t.slice(_,I)),p+=Number(e[y]),_=I+2,I++;break;case 105:if(y>=d||e[y]==null)break;_<I&&(p+=t.slice(_,I)),p+=Math.floor(Number(e[y])),_=I+2,I++;break;case 79:case 111:case 106:if(y>=d||e[y]===void 0)break;_<I&&(p+=t.slice(_,I));var M=typeof e[y];if(M==="string"){p+="'"+e[y]+"'",_=I+2,I++;break}if(M==="function"){p+=e[y].name||"<anonymous>",_=I+2,I++;break}p+=i(e[y]),_=I+2,I++;break;case 115:if(y>=d)break;_<I&&(p+=t.slice(_,I)),p+=String(e[y]),_=I+2,I++;break;case 37:_<I&&(p+=t.slice(_,I)),p+="%",_=I+2,I++,y--;break}++y}++I}return _===-1?t:(_<C&&(p+=t.slice(_)),p)}const Zm=XD;var cs=us;const wu=fP().console||{},tP={mapHttpRequest:ph,mapHttpResponse:ph,wrapRequestSerializer:kd,wrapResponseSerializer:kd,wrapErrorSerializer:kd,req:ph,res:ph,err:oP};function rP(t,e){return Array.isArray(t)?t.filter(function(i){return i!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function us(t){t=t||{},t.browser=t.browser||{};const e=t.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");const r=t.browser.write||wu;t.browser.write&&(t.browser.asObject=!0);const i=t.serializers||{},n=rP(t.browser.serialize,i);let s=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(s=!1);const a=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const u=t.level||"info",d=Object.create(r);d.log||(d.log=_u),Object.defineProperty(d,"levelVal",{get:y}),Object.defineProperty(d,"level",{get:_,set:C});const p={transmit:e,serialize:n,asObject:t.browser.asObject,levels:a,timestamp:aP(t)};d.levels=us.levels,d.level=u,d.setMaxListeners=d.getMaxListeners=d.emit=d.addListener=d.on=d.prependListener=d.once=d.prependOnceListener=d.removeListener=d.removeAllListeners=d.listeners=d.listenerCount=d.eventNames=d.write=d.flush=_u,d.serializers=i,d._serialize=n,d._stdErrSerialize=s,d.child=I,e&&(d._logEvent=Ud());function y(){return this.level==="silent"?1/0:this.levels.values[this.level]}function _(){return this._level}function C(M){if(M!=="silent"&&!this.levels.values[M])throw Error("unknown level "+M);this._level=M,Xa(p,d,"error","log"),Xa(p,d,"fatal","error"),Xa(p,d,"warn","error"),Xa(p,d,"info","log"),Xa(p,d,"debug","log"),Xa(p,d,"trace","log")}function I(M,B){if(!M)throw new Error("missing bindings for child Pino");B=B||{},n&&M.serializers&&(B.serializers=M.serializers);const W=B.serializers;if(n&&W){var Y=Object.assign({},i,W),q=t.browser.serialize===!0?Object.keys(Y):n;delete M.serializers,dh([M],q,Y,this._stdErrSerialize)}function V(U){this._childLevel=(U._childLevel|0)+1,this.error=ec(U,M,"error"),this.fatal=ec(U,M,"fatal"),this.warn=ec(U,M,"warn"),this.info=ec(U,M,"info"),this.debug=ec(U,M,"debug"),this.trace=ec(U,M,"trace"),Y&&(this.serializers=Y,this._serialize=q),e&&(this._logEvent=Ud([].concat(U._logEvent.bindings,M)))}return V.prototype=this,new V(this)}return d}us.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"}},us.stdSerializers=tP,us.stdTimeFunctions=Object.assign({},{nullTime:Xm,epochTime:eb,unixTime:cP,isoTime:uP});function Xa(t,e,r,i){const n=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?_u:n[r]?n[r]:wu[r]||wu[i]||_u,iP(t,e,r)}function iP(t,e,r){!t.transmit&&e[r]===_u||(e[r]=function(i){return function(){const s=t.timestamp(),a=new Array(arguments.length),u=Object.getPrototypeOf&&Object.getPrototypeOf(this)===wu?wu:this;for(var d=0;d<a.length;d++)a[d]=arguments[d];if(t.serialize&&!t.asObject&&dh(a,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?i.call(u,nP(this,r,a,s)):i.apply(u,a),t.transmit){const p=t.transmit.level||e.level,y=us.levels.values[p],_=us.levels.values[r];if(_<y)return;sP(this,{ts:s,methodLevel:r,methodValue:_,transmitLevel:p,transmitValue:us.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},a)}}}(e[r]))}function nP(t,e,r,i){t._serialize&&dh(r,t._serialize,t.serializers,t._stdErrSerialize);const n=r.slice();let s=n[0];const a={};i&&(a.time=i),a.level=us.levels.values[e];let u=(t._childLevel|0)+1;if(u<1&&(u=1),s!==null&&typeof s=="object"){for(;u--&&typeof n[0]=="object";)Object.assign(a,n.shift());s=n.length?Zm(n.shift(),n):void 0}else typeof s=="string"&&(s=Zm(n.shift(),n));return s!==void 0&&(a.msg=s),a}function dh(t,e,r,i){for(const n in t)if(i&&t[n]instanceof Error)t[n]=us.stdSerializers.err(t[n]);else if(typeof t[n]=="object"&&!Array.isArray(t[n]))for(const s in t[n])e&&e.indexOf(s)>-1&&s in r&&(t[n][s]=r[s](t[n][s]))}function ec(t,e,r){return function(){const i=new Array(1+arguments.length);i[0]=e;for(var n=1;n<i.length;n++)i[n]=arguments[n-1];return t[r].apply(this,i)}}function sP(t,e,r){const i=e.send,n=e.ts,s=e.methodLevel,a=e.methodValue,u=e.val,d=t._logEvent.bindings;dh(r,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=n,t._logEvent.messages=r.filter(function(p){return d.indexOf(p)===-1}),t._logEvent.level.label=s,t._logEvent.level.value=a,i(s,t._logEvent,u),t._logEvent=Ud(d)}function Ud(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function oP(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const r in t)e[r]===void 0&&(e[r]=t[r]);return e}function aP(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?Xm:eb}function ph(){return{}}function kd(t){return t}function _u(){}function Xm(){return!1}function eb(){return Date.now()}function cP(){return Math.round(Date.now()/1e3)}function uP(){return new Date(Date.now()).toISOString()}function fP(){function t(e){return typeof e<"u"&&e}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 t(self)||t(window)||t(this)||{}}}const hP={level:"info"},Au="custom_context",jd=1e3*1024;class lP{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class tb{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new lP(e);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}}class rb{constructor(e,r=jd){this.level=e??"error",this.levelValue=cs.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new tb(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===cs.levels.values.error?console.error(e):r===cs.levels.values.warn?console.warn(e):r===cs.levels.values.debug?console.debug(e):r===cs.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Is({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new tb(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Is({extraMetadata:e})),new Blob(r,{type:"application/json"})}}class dP{constructor(e,r=jd){this.baseChunkLogger=new rb(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),i=document.createElement("a");i.href=r,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}}class pP{constructor(e,r=jd){this.baseChunkLogger=new rb(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var gP=Object.defineProperty,vP=Object.defineProperties,mP=Object.getOwnPropertyDescriptors,ib=Object.getOwnPropertySymbols,bP=Object.prototype.hasOwnProperty,yP=Object.prototype.propertyIsEnumerable,nb=(t,e,r)=>e in t?gP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gh=(t,e)=>{for(var r in e||(e={}))bP.call(e,r)&&nb(t,r,e[r]);if(ib)for(var r of ib(e))yP.call(e,r)&&nb(t,r,e[r]);return t},vh=(t,e)=>vP(t,mP(e));function mh(t){return vh(gh({},t),{level:t?.level||hP.level})}function wP(t,e=Au){return t[e]||""}function _P(t,e,r=Au){return t[r]=e,t}function Ei(t,e=Au){let r="";return typeof t.bindings>"u"?r=wP(t,e):r=t.bindings().context||"",r}function AP(t,e,r=Au){const i=Ei(t,r);return i.trim()?`${i}/${e}`:e}function xi(t,e,r=Au){const i=AP(t,e,r),n=t.child({context:i});return _P(n,i,r)}function EP(t){var e,r;const i=new dP((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:cs(vh(gh({},t.opts),{level:"trace",browser:vh(gh({},(r=t.opts)==null?void 0:r.browser),{write:n=>i.write(n)})})),chunkLoggerController:i}}function xP(t){var e;const r=new pP((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:cs(vh(gh({},t.opts),{level:"trace"})),chunkLoggerController:r}}function SP(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?EP(t):xP(t)}class IP extends Ho{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class MP extends Ho{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class CP{constructor(e,r){this.logger=e,this.core=r}}class DP extends Ho{constructor(e,r){super(),this.relayer=e,this.logger=r}}class PP extends Ho{constructor(e){super()}}class OP{constructor(e,r,i,n){this.core=e,this.logger=r,this.name=i}}class $P extends Ho{constructor(e,r){super(),this.relayer=e,this.logger=r}}class NP extends Ho{constructor(e,r){super(),this.core=e,this.logger=r}}class RP{constructor(e,r,i){this.core=e,this.logger=r,this.store=i}}class TP{constructor(e,r){this.projectId=e,this.logger=r}}class FP{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class LP{constructor(e){this.client=e}}var qd={},sb={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=_t,r=Fi;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var i=function(){function u(){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 u.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},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},u.prototype.update=function(d,p){if(p===void 0&&(p=d.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var y=0;if(this._bytesHashed+=p,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&p>0;)this._buffer[this._bufferLength++]=d[y++],p--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(p>=this.blockSize&&(y=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,d,y,p),p%=this.blockSize);p>0;)this._buffer[this._bufferLength++]=d[y++],p--;return this},u.prototype.finish=function(d){if(!this._finished){var p=this._bytesHashed,y=this._bufferLength,_=p/536870912|0,C=p<<3,I=p%128<112?128:256;this._buffer[y]=128;for(var M=y+1;M<I-8;M++)this._buffer[M]=0;e.writeUint32BE(_,this._buffer,I-8),e.writeUint32BE(C,this._buffer,I-4),s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,I),this._finished=!0}for(var M=0;M<this.digestLength/8;M++)e.writeUint32BE(this._stateHi[M],d,M*8),e.writeUint32BE(this._stateLo[M],d,M*8+4);return this},u.prototype.digest=function(){var d=new Uint8Array(this.digestLength);return this.finish(d),d},u.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}},u.prototype.restoreState=function(d){return this._stateHi.set(d.stateHi),this._stateLo.set(d.stateLo),this._bufferLength=d.bufferLength,d.buffer&&this._buffer.set(d.buffer),this._bytesHashed=d.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(d){r.wipe(d.stateHi),r.wipe(d.stateLo),d.buffer&&r.wipe(d.buffer),d.bufferLength=0,d.bytesHashed=0},u}();t.SHA512=i;var n=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 s(u,d,p,y,_,C,I){for(var M=p[0],B=p[1],W=p[2],Y=p[3],q=p[4],V=p[5],U=p[6],z=p[7],K=y[0],A=y[1],j=y[2],ee=y[3],re=y[4],k=y[5],w=y[6],f=y[7],h,g,E,D,P,x,v,b;I>=128;){for(var L=0;L<16;L++){var X=8*L+C;u[L]=e.readUint32BE(_,X),d[L]=e.readUint32BE(_,X+4)}for(var L=0;L<80;L++){var ce=M,O=B,ie=W,N=Y,F=q,R=V,l=U,$=z,Z=K,ae=A,ue=j,ve=ee,ge=re,Ee=k,Ye=w,De=f;if(h=z,g=f,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=(q>>>14|re<<32-14)^(q>>>18|re<<32-18)^(re>>>41-32|q<<32-(41-32)),g=(re>>>14|q<<32-14)^(re>>>18|q<<32-18)^(q>>>41-32|re<<32-(41-32)),P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,h=q&V^~q&U,g=re&k^~re&w,P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,h=n[L*2],g=n[L*2+1],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,h=u[L%16],g=d[L%16],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,E=v&65535|b<<16,D=P&65535|x<<16,h=E,g=D,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=(M>>>28|K<<32-28)^(K>>>34-32|M<<32-(34-32))^(K>>>39-32|M<<32-(39-32)),g=(K>>>28|M<<32-28)^(M>>>34-32|K<<32-(34-32))^(M>>>39-32|K<<32-(39-32)),P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,h=M&B^M&W^B&W,g=K&A^K&j^A&j,P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,$=v&65535|b<<16,De=P&65535|x<<16,h=N,g=ve,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=E,g=D,P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,N=v&65535|b<<16,ve=P&65535|x<<16,B=ce,W=O,Y=ie,q=N,V=F,U=R,z=l,M=$,A=Z,j=ae,ee=ue,re=ve,k=ge,w=Ee,f=Ye,K=De,L%16===15)for(var X=0;X<16;X++)h=u[X],g=d[X],P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=u[(X+9)%16],g=d[(X+9)%16],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,E=u[(X+1)%16],D=d[(X+1)%16],h=(E>>>1|D<<32-1)^(E>>>8|D<<32-8)^E>>>7,g=(D>>>1|E<<32-1)^(D>>>8|E<<32-8)^(D>>>7|E<<32-7),P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,E=u[(X+14)%16],D=d[(X+14)%16],h=(E>>>19|D<<32-19)^(D>>>61-32|E<<32-(61-32))^E>>>6,g=(D>>>19|E<<32-19)^(E>>>61-32|D<<32-(61-32))^(D>>>6|E<<32-6),P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,u[X]=v&65535|b<<16,d[X]=P&65535|x<<16}h=M,g=K,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[0],g=y[0],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[0]=M=v&65535|b<<16,y[0]=K=P&65535|x<<16,h=B,g=A,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[1],g=y[1],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[1]=B=v&65535|b<<16,y[1]=A=P&65535|x<<16,h=W,g=j,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[2],g=y[2],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[2]=W=v&65535|b<<16,y[2]=j=P&65535|x<<16,h=Y,g=ee,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[3],g=y[3],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[3]=Y=v&65535|b<<16,y[3]=ee=P&65535|x<<16,h=q,g=re,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[4],g=y[4],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[4]=q=v&65535|b<<16,y[4]=re=P&65535|x<<16,h=V,g=k,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[5],g=y[5],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[5]=V=v&65535|b<<16,y[5]=k=P&65535|x<<16,h=U,g=w,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[6],g=y[6],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[6]=U=v&65535|b<<16,y[6]=w=P&65535|x<<16,h=z,g=f,P=g&65535,x=g>>>16,v=h&65535,b=h>>>16,h=p[7],g=y[7],P+=g&65535,x+=g>>>16,v+=h&65535,b+=h>>>16,x+=P>>>16,v+=x>>>16,b+=v>>>16,p[7]=z=v&65535|b<<16,y[7]=f=P&65535|x<<16,C+=128,I-=128}return C}function a(u){var d=new i;d.update(u);var p=d.digest();return d.clean(),p}t.hash=a})(sb),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=Oo,r=sb,i=Fi;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function n(N){const F=new Float64Array(16);if(N)for(let R=0;R<N.length;R++)F[R]=N[R];return F}const s=new Uint8Array(32);s[0]=9;const a=n(),u=n([1]),d=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),p=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),y=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),_=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),C=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function I(N,F){for(let R=0;R<16;R++)N[R]=F[R]|0}function M(N){let F=1;for(let R=0;R<16;R++){let l=N[R]+F+65535;F=Math.floor(l/65536),N[R]=l-F*65536}N[0]+=F-1+37*(F-1)}function B(N,F,R){const l=~(R-1);for(let $=0;$<16;$++){const Z=l&(N[$]^F[$]);N[$]^=Z,F[$]^=Z}}function W(N,F){const R=n(),l=n();for(let $=0;$<16;$++)l[$]=F[$];M(l),M(l),M(l);for(let $=0;$<2;$++){R[0]=l[0]-65517;for(let ae=1;ae<15;ae++)R[ae]=l[ae]-65535-(R[ae-1]>>16&1),R[ae-1]&=65535;R[15]=l[15]-32767-(R[14]>>16&1);const Z=R[15]>>16&1;R[14]&=65535,B(l,R,1-Z)}for(let $=0;$<16;$++)N[2*$]=l[$]&255,N[2*$+1]=l[$]>>8}function Y(N,F){let R=0;for(let l=0;l<32;l++)R|=N[l]^F[l];return(1&R-1>>>8)-1}function q(N,F){const R=new Uint8Array(32),l=new Uint8Array(32);return W(R,N),W(l,F),Y(R,l)}function V(N){const F=new Uint8Array(32);return W(F,N),F[0]&1}function U(N,F){for(let R=0;R<16;R++)N[R]=F[2*R]+(F[2*R+1]<<8);N[15]&=32767}function z(N,F,R){for(let l=0;l<16;l++)N[l]=F[l]+R[l]}function K(N,F,R){for(let l=0;l<16;l++)N[l]=F[l]-R[l]}function A(N,F,R){let l,$,Z=0,ae=0,ue=0,ve=0,ge=0,Ee=0,Ye=0,De=0,Re=0,xe=0,ye=0,Me=0,Pe=0,pe=0,Se=0,_e=0,me=0,Te=0,Ce=0,Ae=0,ke=0,qe=0,Ie=0,Ke=0,ut=0,Je=0,gt=0,ht=0,ot=0,St=0,Ct=0,Oe=R[0],Ve=R[1],Ze=R[2],$e=R[3],Qe=R[4],Ge=R[5],Fe=R[6],nt=R[7],Xe=R[8],Le=R[9],et=R[10],rt=R[11],Ne=R[12],We=R[13],st=R[14],Be=R[15];l=F[0],Z+=l*Oe,ae+=l*Ve,ue+=l*Ze,ve+=l*$e,ge+=l*Qe,Ee+=l*Ge,Ye+=l*Fe,De+=l*nt,Re+=l*Xe,xe+=l*Le,ye+=l*et,Me+=l*rt,Pe+=l*Ne,pe+=l*We,Se+=l*st,_e+=l*Be,l=F[1],ae+=l*Oe,ue+=l*Ve,ve+=l*Ze,ge+=l*$e,Ee+=l*Qe,Ye+=l*Ge,De+=l*Fe,Re+=l*nt,xe+=l*Xe,ye+=l*Le,Me+=l*et,Pe+=l*rt,pe+=l*Ne,Se+=l*We,_e+=l*st,me+=l*Be,l=F[2],ue+=l*Oe,ve+=l*Ve,ge+=l*Ze,Ee+=l*$e,Ye+=l*Qe,De+=l*Ge,Re+=l*Fe,xe+=l*nt,ye+=l*Xe,Me+=l*Le,Pe+=l*et,pe+=l*rt,Se+=l*Ne,_e+=l*We,me+=l*st,Te+=l*Be,l=F[3],ve+=l*Oe,ge+=l*Ve,Ee+=l*Ze,Ye+=l*$e,De+=l*Qe,Re+=l*Ge,xe+=l*Fe,ye+=l*nt,Me+=l*Xe,Pe+=l*Le,pe+=l*et,Se+=l*rt,_e+=l*Ne,me+=l*We,Te+=l*st,Ce+=l*Be,l=F[4],ge+=l*Oe,Ee+=l*Ve,Ye+=l*Ze,De+=l*$e,Re+=l*Qe,xe+=l*Ge,ye+=l*Fe,Me+=l*nt,Pe+=l*Xe,pe+=l*Le,Se+=l*et,_e+=l*rt,me+=l*Ne,Te+=l*We,Ce+=l*st,Ae+=l*Be,l=F[5],Ee+=l*Oe,Ye+=l*Ve,De+=l*Ze,Re+=l*$e,xe+=l*Qe,ye+=l*Ge,Me+=l*Fe,Pe+=l*nt,pe+=l*Xe,Se+=l*Le,_e+=l*et,me+=l*rt,Te+=l*Ne,Ce+=l*We,Ae+=l*st,ke+=l*Be,l=F[6],Ye+=l*Oe,De+=l*Ve,Re+=l*Ze,xe+=l*$e,ye+=l*Qe,Me+=l*Ge,Pe+=l*Fe,pe+=l*nt,Se+=l*Xe,_e+=l*Le,me+=l*et,Te+=l*rt,Ce+=l*Ne,Ae+=l*We,ke+=l*st,qe+=l*Be,l=F[7],De+=l*Oe,Re+=l*Ve,xe+=l*Ze,ye+=l*$e,Me+=l*Qe,Pe+=l*Ge,pe+=l*Fe,Se+=l*nt,_e+=l*Xe,me+=l*Le,Te+=l*et,Ce+=l*rt,Ae+=l*Ne,ke+=l*We,qe+=l*st,Ie+=l*Be,l=F[8],Re+=l*Oe,xe+=l*Ve,ye+=l*Ze,Me+=l*$e,Pe+=l*Qe,pe+=l*Ge,Se+=l*Fe,_e+=l*nt,me+=l*Xe,Te+=l*Le,Ce+=l*et,Ae+=l*rt,ke+=l*Ne,qe+=l*We,Ie+=l*st,Ke+=l*Be,l=F[9],xe+=l*Oe,ye+=l*Ve,Me+=l*Ze,Pe+=l*$e,pe+=l*Qe,Se+=l*Ge,_e+=l*Fe,me+=l*nt,Te+=l*Xe,Ce+=l*Le,Ae+=l*et,ke+=l*rt,qe+=l*Ne,Ie+=l*We,Ke+=l*st,ut+=l*Be,l=F[10],ye+=l*Oe,Me+=l*Ve,Pe+=l*Ze,pe+=l*$e,Se+=l*Qe,_e+=l*Ge,me+=l*Fe,Te+=l*nt,Ce+=l*Xe,Ae+=l*Le,ke+=l*et,qe+=l*rt,Ie+=l*Ne,Ke+=l*We,ut+=l*st,Je+=l*Be,l=F[11],Me+=l*Oe,Pe+=l*Ve,pe+=l*Ze,Se+=l*$e,_e+=l*Qe,me+=l*Ge,Te+=l*Fe,Ce+=l*nt,Ae+=l*Xe,ke+=l*Le,qe+=l*et,Ie+=l*rt,Ke+=l*Ne,ut+=l*We,Je+=l*st,gt+=l*Be,l=F[12],Pe+=l*Oe,pe+=l*Ve,Se+=l*Ze,_e+=l*$e,me+=l*Qe,Te+=l*Ge,Ce+=l*Fe,Ae+=l*nt,ke+=l*Xe,qe+=l*Le,Ie+=l*et,Ke+=l*rt,ut+=l*Ne,Je+=l*We,gt+=l*st,ht+=l*Be,l=F[13],pe+=l*Oe,Se+=l*Ve,_e+=l*Ze,me+=l*$e,Te+=l*Qe,Ce+=l*Ge,Ae+=l*Fe,ke+=l*nt,qe+=l*Xe,Ie+=l*Le,Ke+=l*et,ut+=l*rt,Je+=l*Ne,gt+=l*We,ht+=l*st,ot+=l*Be,l=F[14],Se+=l*Oe,_e+=l*Ve,me+=l*Ze,Te+=l*$e,Ce+=l*Qe,Ae+=l*Ge,ke+=l*Fe,qe+=l*nt,Ie+=l*Xe,Ke+=l*Le,ut+=l*et,Je+=l*rt,gt+=l*Ne,ht+=l*We,ot+=l*st,St+=l*Be,l=F[15],_e+=l*Oe,me+=l*Ve,Te+=l*Ze,Ce+=l*$e,Ae+=l*Qe,ke+=l*Ge,qe+=l*Fe,Ie+=l*nt,Ke+=l*Xe,ut+=l*Le,Je+=l*et,gt+=l*rt,ht+=l*Ne,ot+=l*We,St+=l*st,Ct+=l*Be,Z+=38*me,ae+=38*Te,ue+=38*Ce,ve+=38*Ae,ge+=38*ke,Ee+=38*qe,Ye+=38*Ie,De+=38*Ke,Re+=38*ut,xe+=38*Je,ye+=38*gt,Me+=38*ht,Pe+=38*ot,pe+=38*St,Se+=38*Ct,$=1,l=Z+$+65535,$=Math.floor(l/65536),Z=l-$*65536,l=ae+$+65535,$=Math.floor(l/65536),ae=l-$*65536,l=ue+$+65535,$=Math.floor(l/65536),ue=l-$*65536,l=ve+$+65535,$=Math.floor(l/65536),ve=l-$*65536,l=ge+$+65535,$=Math.floor(l/65536),ge=l-$*65536,l=Ee+$+65535,$=Math.floor(l/65536),Ee=l-$*65536,l=Ye+$+65535,$=Math.floor(l/65536),Ye=l-$*65536,l=De+$+65535,$=Math.floor(l/65536),De=l-$*65536,l=Re+$+65535,$=Math.floor(l/65536),Re=l-$*65536,l=xe+$+65535,$=Math.floor(l/65536),xe=l-$*65536,l=ye+$+65535,$=Math.floor(l/65536),ye=l-$*65536,l=Me+$+65535,$=Math.floor(l/65536),Me=l-$*65536,l=Pe+$+65535,$=Math.floor(l/65536),Pe=l-$*65536,l=pe+$+65535,$=Math.floor(l/65536),pe=l-$*65536,l=Se+$+65535,$=Math.floor(l/65536),Se=l-$*65536,l=_e+$+65535,$=Math.floor(l/65536),_e=l-$*65536,Z+=$-1+37*($-1),$=1,l=Z+$+65535,$=Math.floor(l/65536),Z=l-$*65536,l=ae+$+65535,$=Math.floor(l/65536),ae=l-$*65536,l=ue+$+65535,$=Math.floor(l/65536),ue=l-$*65536,l=ve+$+65535,$=Math.floor(l/65536),ve=l-$*65536,l=ge+$+65535,$=Math.floor(l/65536),ge=l-$*65536,l=Ee+$+65535,$=Math.floor(l/65536),Ee=l-$*65536,l=Ye+$+65535,$=Math.floor(l/65536),Ye=l-$*65536,l=De+$+65535,$=Math.floor(l/65536),De=l-$*65536,l=Re+$+65535,$=Math.floor(l/65536),Re=l-$*65536,l=xe+$+65535,$=Math.floor(l/65536),xe=l-$*65536,l=ye+$+65535,$=Math.floor(l/65536),ye=l-$*65536,l=Me+$+65535,$=Math.floor(l/65536),Me=l-$*65536,l=Pe+$+65535,$=Math.floor(l/65536),Pe=l-$*65536,l=pe+$+65535,$=Math.floor(l/65536),pe=l-$*65536,l=Se+$+65535,$=Math.floor(l/65536),Se=l-$*65536,l=_e+$+65535,$=Math.floor(l/65536),_e=l-$*65536,Z+=$-1+37*($-1),N[0]=Z,N[1]=ae,N[2]=ue,N[3]=ve,N[4]=ge,N[5]=Ee,N[6]=Ye,N[7]=De,N[8]=Re,N[9]=xe,N[10]=ye,N[11]=Me,N[12]=Pe,N[13]=pe,N[14]=Se,N[15]=_e}function j(N,F){A(N,F,F)}function ee(N,F){const R=n();let l;for(l=0;l<16;l++)R[l]=F[l];for(l=253;l>=0;l--)j(R,R),l!==2&&l!==4&&A(R,R,F);for(l=0;l<16;l++)N[l]=R[l]}function re(N,F){const R=n();let l;for(l=0;l<16;l++)R[l]=F[l];for(l=250;l>=0;l--)j(R,R),l!==1&&A(R,R,F);for(l=0;l<16;l++)N[l]=R[l]}function k(N,F){const R=n(),l=n(),$=n(),Z=n(),ae=n(),ue=n(),ve=n(),ge=n(),Ee=n();K(R,N[1],N[0]),K(Ee,F[1],F[0]),A(R,R,Ee),z(l,N[0],N[1]),z(Ee,F[0],F[1]),A(l,l,Ee),A($,N[3],F[3]),A($,$,p),A(Z,N[2],F[2]),z(Z,Z,Z),K(ae,l,R),K(ue,Z,$),z(ve,Z,$),z(ge,l,R),A(N[0],ae,ue),A(N[1],ge,ve),A(N[2],ve,ue),A(N[3],ae,ge)}function w(N,F,R){for(let l=0;l<4;l++)B(N[l],F[l],R)}function f(N,F){const R=n(),l=n(),$=n();ee($,F[2]),A(R,F[0],$),A(l,F[1],$),W(N,l),N[31]^=V(R)<<7}function h(N,F,R){I(N[0],a),I(N[1],u),I(N[2],u),I(N[3],a);for(let l=255;l>=0;--l){const $=R[l/8|0]>>(l&7)&1;w(N,F,$),k(F,N),k(N,N),w(N,F,$)}}function g(N,F){const R=[n(),n(),n(),n()];I(R[0],y),I(R[1],_),I(R[2],u),A(R[3],y,_),h(N,R,F)}function E(N){if(N.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const F=(0,r.hash)(N);F[0]&=248,F[31]&=127,F[31]|=64;const R=new Uint8Array(32),l=[n(),n(),n(),n()];g(l,F),f(R,l);const $=new Uint8Array(64);return $.set(N),$.set(R,32),{publicKey:R,secretKey:$}}t.generateKeyPairFromSeed=E;function D(N){const F=(0,e.randomBytes)(32,N),R=E(F);return(0,i.wipe)(F),R}t.generateKeyPair=D;function P(N){if(N.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(N.subarray(32))}t.extractPublicKeyFromSecretKey=P;const x=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 v(N,F){let R,l,$,Z;for(l=63;l>=32;--l){for(R=0,$=l-32,Z=l-12;$<Z;++$)F[$]+=R-16*F[l]*x[$-(l-32)],R=Math.floor((F[$]+128)/256),F[$]-=R*256;F[$]+=R,F[l]=0}for(R=0,$=0;$<32;$++)F[$]+=R-(F[31]>>4)*x[$],R=F[$]>>8,F[$]&=255;for($=0;$<32;$++)F[$]-=R*x[$];for(l=0;l<32;l++)F[l+1]+=F[l]>>8,N[l]=F[l]&255}function b(N){const F=new Float64Array(64);for(let R=0;R<64;R++)F[R]=N[R];for(let R=0;R<64;R++)N[R]=0;v(N,F)}function L(N,F){const R=new Float64Array(64),l=[n(),n(),n(),n()],$=(0,r.hash)(N.subarray(0,32));$[0]&=248,$[31]&=127,$[31]|=64;const Z=new Uint8Array(64);Z.set($.subarray(32),32);const ae=new r.SHA512;ae.update(Z.subarray(32)),ae.update(F);const ue=ae.digest();ae.clean(),b(ue),g(l,ue),f(Z,l),ae.reset(),ae.update(Z.subarray(0,32)),ae.update(N.subarray(32)),ae.update(F);const ve=ae.digest();b(ve);for(let ge=0;ge<32;ge++)R[ge]=ue[ge];for(let ge=0;ge<32;ge++)for(let Ee=0;Ee<32;Ee++)R[ge+Ee]+=ve[ge]*$[Ee];return v(Z.subarray(32),R),Z}t.sign=L;function X(N,F){const R=n(),l=n(),$=n(),Z=n(),ae=n(),ue=n(),ve=n();return I(N[2],u),U(N[1],F),j($,N[1]),A(Z,$,d),K($,$,N[2]),z(Z,N[2],Z),j(ae,Z),j(ue,ae),A(ve,ue,ae),A(R,ve,$),A(R,R,Z),re(R,R),A(R,R,$),A(R,R,Z),A(R,R,Z),A(N[0],R,Z),j(l,N[0]),A(l,l,Z),q(l,$)&&A(N[0],N[0],C),j(l,N[0]),A(l,l,Z),q(l,$)?-1:(V(N[0])===F[31]>>7&&K(N[0],a,N[0]),A(N[3],N[0],N[1]),0)}function ce(N,F,R){const l=new Uint8Array(32),$=[n(),n(),n(),n()],Z=[n(),n(),n(),n()];if(R.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(X(Z,N))return!1;const ae=new r.SHA512;ae.update(R.subarray(0,32)),ae.update(N),ae.update(F);const ue=ae.digest();return b(ue),h($,Z,ue),g(Z,R.subarray(32)),k($,Z),f(l,$),!Y(R,l)}t.verify=ce;function O(N){let F=[n(),n(),n(),n()];if(X(F,N))throw new Error("Ed25519: invalid public key");let R=n(),l=n(),$=F[1];z(R,u,$),K(l,u,$),ee(l,l),A(R,R,l);let Z=new Uint8Array(32);return W(Z,R),Z}t.convertPublicKeyToX25519=O;function ie(N){const F=(0,r.hash)(N.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const R=new Uint8Array(F.subarray(0,32));return(0,i.wipe)(F),R}t.convertSecretKeyToX25519=ie}(qd);const BP="EdDSA",UP="JWT",ob=".",ab="base64url",kP="utf8",jP="utf8",qP=":",zP="did",HP="key",cb="base58btc",KP="z",WP="K36",VP=32;function zd(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function ub(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?zd(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function GP(t,e){e||(e=t.reduce((n,s)=>n+s.length,0));const r=ub(e);let i=0;for(const n of t)r.set(n,i),i+=n.length;return zd(r)}function fb(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const hb=fb("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Hd=fb("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=ub(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),lb={utf8:hb,"utf-8":hb,hex:Ia.base16,latin1:Hd,ascii:Hd,binary:Hd,...Ia};function Kd(t,e="utf8"){const r=lb[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)}function Wd(t,e="utf8"){const r=lb[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?zd(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function bh(t){return Kd(Wd(Is(t),kP),ab)}function db(t){const e=Wd(WP,cb),r=KP+Kd(GP([e,t]),cb);return[zP,HP,r].join(qP)}function YP(t){return Kd(t,ab)}function JP(t){return Wd([bh(t.header),bh(t.payload)].join(ob),jP)}function QP(t){return[bh(t.header),bh(t.payload),YP(t.signature)].join(ob)}function pb(t=Oo.randomBytes(VP)){return qd.generateKeyPairFromSeed(t)}async function ZP(t,e,r,i,n=He.fromMiliseconds(Date.now())){const s={alg:BP,typ:UP},a=db(i.publicKey),u=n+r,d={iss:a,sub:t,aud:e,iat:n,exp:u},p=JP({header:s,payload:d}),y=qd.sign(i.secretKey,p);return QP({header:s,payload:d,signature:y})}function XP(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function gb(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const vb=gb("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Vd=gb("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=XP(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),eO={utf8:vb,"utf-8":vb,hex:Ia.base16,latin1:Vd,ascii:Vd,binary:Vd,...Ia};function tO(t,e="utf8"){const r=eO[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)}const rO="PARSE_ERROR",iO="INVALID_REQUEST",nO="METHOD_NOT_FOUND",sO="INVALID_PARAMS",mb="INTERNAL_ERROR",Gd="SERVER_ERROR",oO=[-32700,-32600,-32601,-32602,-32603],Eu={[rO]:{code:-32700,message:"Parse error"},[iO]:{code:-32600,message:"Invalid Request"},[nO]:{code:-32601,message:"Method not found"},[sO]:{code:-32602,message:"Invalid params"},[mb]:{code:-32603,message:"Internal error"},[Gd]:{code:-32e3,message:"Server error"}},bb=Gd;function aO(t){return oO.includes(t)}function yb(t){return Object.keys(Eu).includes(t)?Eu[t]:Eu[bb]}function cO(t){const e=Object.values(Eu).find(r=>r.code===t);return e||Eu[bb]}function wb(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var _b={};/*! *****************************************************************************
|
|
31
31
|
Copyright (c) Microsoft Corporation.
|
|
32
32
|
|
|
33
33
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -40,84 +40,84 @@
|
|
|
40
40
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
41
41
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
42
42
|
PERFORMANCE OF THIS SOFTWARE.
|
|
43
|
-
***************************************************************************** */var Zf=function(e,t){return Zf=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])},Zf(e,t)};function Dx(e,t){Zf(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Xf=function(){return Xf=Object.assign||function(t){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)&&(t[o]=r[o])}return t},Xf.apply(this,arguments)};function Ox(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function Px(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(o=(i<3?c(o):i>3?c(t,r,o):c(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function Mx(e,t){return function(r,n){t(r,n,e)}}function $x(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Nx(e,t,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(g){try{h(n.next(g))}catch(_){c(_)}}function f(g){try{h(n.throw(g))}catch(_){c(_)}}function h(g){g.done?o(g.value):i(g.value).then(l,f)}h((n=n.apply(e,t||[])).next())})}function Tx(e,t){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(g){return f([h,g])}}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=t.call(e,r)}catch(g){h=[6,g],i=0}finally{n=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function Rx(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}function Lx(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function t0(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function uv(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],c;try{for(;(t===void 0||t-- >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 Bx(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(uv(arguments[t]));return e}function Ux(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],c=0,l=o.length;c<l;c++,i++)n[i]=o[c];return n}function mc(e){return this instanceof mc?(this.v=e,this):new mc(e)}function Fx(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(E){n[E]&&(i[E]=function(x){return new Promise(function(I,F){o.push([E,x,I,F])>1||l(E,x)})})}function l(E,x){try{f(n[E](x))}catch(I){_(o[0][3],I)}}function f(E){E.value instanceof mc?Promise.resolve(E.value.v).then(h,g):_(o[0][2],E)}function h(E){l("next",E)}function g(E){l("throw",E)}function _(E,x){E(x),o.shift(),o.length&&l(o[0][0],o[0][1])}}function jx(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,o){t[i]=e[i]?function(c){return(r=!r)?{value:mc(e[i](c)),done:i==="return"}:o?o(c):c}:o}}function kx(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof t0=="function"?t0(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(c){return new Promise(function(l,f){c=e[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 qx(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function zx(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function Hx(e){return e&&e.__esModule?e:{default:e}}function Kx(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function Wx(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}var Vx=Object.freeze({__proto__:null,__extends:Dx,get __assign(){return Xf},__rest:Ox,__decorate:Px,__param:Mx,__metadata:$x,__awaiter:Nx,__generator:Tx,__createBinding:Rx,__exportStar:Lx,__values:t0,__read:uv,__spread:Bx,__spreadArrays:Ux,__await:mc,__asyncGenerator:Fx,__asyncDelegator:jx,__asyncValues:kx,__makeTemplateObject:qx,__importStar:zx,__importDefault:Hx,__classPrivateFieldGet:Kx,__classPrivateFieldSet:Wx}),Gx=ol(Vx),Hi={},hv;function Yx(){if(hv)return Hi;hv=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.isBrowserCryptoAvailable=Hi.getSubtleCrypto=Hi.getBrowerCrypto=void 0;function e(){return jr?.crypto||jr?.msCrypto||{}}Hi.getBrowerCrypto=e;function t(){const n=e();return n.subtle||n.webkitSubtle}Hi.getSubtleCrypto=t;function r(){return!!e()&&!!t()}return Hi.isBrowserCryptoAvailable=r,Hi}var Ki={},fv;function Qx(){if(fv)return Ki;fv=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.isBrowser=Ki.isNode=Ki.isReactNative=void 0;function e(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Ki.isReactNative=e;function t(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Ki.isNode=t;function r(){return!e()&&!t()}return Ki.isBrowser=r,Ki}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Gx;t.__exportStar(Yx(),e),t.__exportStar(Qx(),e)})(lv);function fs(e=3){const t=Date.now()*Math.pow(10,e),r=Math.floor(Math.random()*Math.pow(10,e));return t+r}function Ys(e=6){return BigInt(fs(e))}function ea(e,t,r){return{id:r||fs(),jsonrpc:"2.0",method:e,params:t}}function Vl(e,t){return{id:e,jsonrpc:"2.0",result:t}}function Gl(e,t,r){return{id:e,jsonrpc:"2.0",error:Jx(t,r)}}function Jx(e,t){return typeof e>"u"?av(sv):(typeof e=="string"&&(e=Object.assign(Object.assign({},av(Jf)),{message:e})),typeof t<"u"&&(e.data=t),Sx(e.code)&&(e=Cx(e.code)),e)}class Zx{}class Xx extends Zx{constructor(){super()}}class t9 extends Xx{constructor(t){super()}}const e9="^https?:",r9="^wss?:";function n9(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(!(!t||!t.length))return t[0]}function dv(e,t){const r=n9(e);return typeof r>"u"?!1:new RegExp(t).test(r)}function pv(e){return dv(e,e9)}function gv(e){return dv(e,r9)}function i9(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}function mv(e){return typeof e=="object"&&"id"in e&&"jsonrpc"in e&&e.jsonrpc==="2.0"}function e0(e){return mv(e)&&"method"in e}function Yl(e){return mv(e)&&(_i(e)||Pn(e))}function _i(e){return"result"in e}function Pn(e){return"error"in e}class Ei extends t9{constructor(t){super(t),this.events=new Cr.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async request(t,r){return this.requestStrict(ea(t.method,t.params||[],t.id||Ys().toString()),r)}async requestStrict(t,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(o){i(o)}this.events.on(`${t.id}`,o=>{Pn(o)?i(o.error):n(o.result)});try{await this.connection.send(t,r)}catch(o){i(o)}})}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),Yl(t)?this.events.emit(`${t.id}`,t):this.events.emit("message",{type:t.method,data:t.params})}onClose(t){t&&t.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${t.code} ${t.reason?`(${t.reason})`:""}`)),this.events.emit("disconnect")}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),typeof t=="string"&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",t=>this.onClose(t)),this.connection.on("error",t=>this.events.emit("error",t)),this.connection.on("register_error",t=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const s9=()=>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"),o9=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",vv=e=>e.split("?")[0],wv=10,a9=s9();class c9{constructor(t){if(this.url=t,this.events=new Cr.exports.EventEmitter,this.registering=!1,!gv(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async open(t=this.url){await this.register(t)}async close(){return new Promise((t,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),t()},this.socket.close()})}async send(t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(zi(t))}catch(r){this.onError(t.id,r)}}register(t=this.url){if(!gv(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);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=t,this.registering=!0,new Promise((r,n)=>{const i=new URLSearchParams(t).get("origin"),o=lv.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!i9(t)},c=new a9(t,[],o);o9()?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(t){t.onmessage=r=>this.onPayload(r),t.onclose=r=>this.onClose(r),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;const r=typeof t.data=="string"?uc(t.data):t.data;this.events.emit("payload",r)}onError(t,r){const n=this.parseError(r),i=n.message||n.toString(),o=Gl(t,i);this.events.emit("payload",o)}parseError(t,r=this.url){return cv(t,vv(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>wv&&this.events.setMaxListeners(wv)}emitError(t){const r=this.parseError(new Error(t?.message||`WebSocket connection failed for host: ${vv(this.url)}`));return this.events.emit("register_error",r),r}}var r0={exports:{}};(function(e,t){var r=200,n="__lodash_hash_undefined__",i=1,o=2,c=9007199254740991,l="[object Arguments]",f="[object Array]",h="[object AsyncFunction]",g="[object Boolean]",_="[object Date]",E="[object Error]",x="[object Function]",I="[object GeneratorFunction]",F="[object Map]",W="[object Number]",Y="[object Null]",B="[object Object]",z="[object Promise]",P="[object Proxy]",U="[object RegExp]",j="[object Set]",m="[object String]",$="[object Symbol]",et="[object Undefined]",tt="[object WeakMap]",nt="[object ArrayBuffer]",dt="[object DataView]",d="[object Float32Array]",p="[object Float64Array]",b="[object Int8Array]",C="[object Int16Array]",O="[object Int32Array]",N="[object Uint8Array]",L="[object Uint8ClampedArray]",D="[object Uint16Array]",v="[object Uint32Array]",T=/[\\^$.*+?()[\]{}|]/g,ot=/^\[object .+?Constructor\]$/,pt=/^(?:0|[1-9]\d*)$/,A={};A[d]=A[p]=A[b]=A[C]=A[O]=A[N]=A[L]=A[D]=A[v]=!0,A[l]=A[f]=A[nt]=A[g]=A[dt]=A[_]=A[E]=A[x]=A[F]=A[W]=A[B]=A[U]=A[j]=A[m]=A[tt]=!1;var rt=typeof jr=="object"&&jr&&jr.Object===Object&&jr,q=typeof self=="object"&&self&&self.Object===Object&&self,H=rt||q||Function("return this")(),V=t&&!t.nodeType&&t,w=V&&!0&&e&&!e.nodeType&&e,k=w&&w.exports===V,it=k&&rt.process,ht=function(){try{return it&&it.binding&&it.binding("util")}catch{}}(),lt=ht&&ht.isTypedArray;function Ot(K,J){for(var ft=-1,It=K==null?0:K.length,Ge=0,oe=[];++ft<It;){var Xe=K[ft];J(Xe,ft,K)&&(oe[Ge++]=Xe)}return oe}function Mt(K,J){for(var ft=-1,It=J.length,Ge=K.length;++ft<It;)K[Ge+ft]=J[ft];return K}function St(K,J){for(var ft=-1,It=K==null?0:K.length;++ft<It;)if(J(K[ft],ft,K))return!0;return!1}function Pe(K,J){for(var ft=-1,It=Array(K);++ft<K;)It[ft]=J(ft);return It}function zt(K){return function(J){return K(J)}}function Dt(K,J){return K.has(J)}function Ft(K,J){return K?.[J]}function Et(K){var J=-1,ft=Array(K.size);return K.forEach(function(It,Ge){ft[++J]=[Ge,It]}),ft}function At(K,J){return function(ft){return K(J(ft))}}function Gt(K){var J=-1,ft=Array(K.size);return K.forEach(function(It){ft[++J]=It}),ft}var bt=Array.prototype,xt=Function.prototype,Bt=Object.prototype,_t=H["__core-js_shared__"],Pt=xt.toString,jt=Bt.hasOwnProperty,$t=function(){var K=/[^.]+$/.exec(_t&&_t.keys&&_t.keys.IE_PROTO||"");return K?"Symbol(src)_1."+K:""}(),Nt=Bt.toString,le=RegExp("^"+Pt.call(jt).replace(T,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rt=k?H.Buffer:void 0,Tt=H.Symbol,nr=H.Uint8Array,de=Bt.propertyIsEnumerable,Ee=bt.splice,ir=Tt?Tt.toStringTag:void 0,Ie=Object.getOwnPropertySymbols,Oe=Rt?Rt.isBuffer:void 0,Vr=At(Object.keys,Object),Yt=bn(H,"DataView"),Ht=bn(H,"Map"),Re=bn(H,"Promise"),Qt=bn(H,"Set"),Vt=bn(H,"WeakMap"),Me=bn(Object,"create"),Xt=Ji(Yt),te=Ji(Ht),Le=Ji(Re),ee=Ji(Qt),Jt=Ji(Vt),Fe=Tt?Tt.prototype:void 0,Zt=Fe?Fe.valueOf:void 0;function kt(K){var J=-1,ft=K==null?0:K.length;for(this.clear();++J<ft;){var It=K[J];this.set(It[0],It[1])}}function He(){this.__data__=Me?Me(null):{},this.size=0}function re(K){var J=this.has(K)&&delete this.__data__[K];return this.size-=J?1:0,J}function je(K){var J=this.__data__;if(Me){var ft=J[K];return ft===n?void 0:ft}return jt.call(J,K)?J[K]:void 0}function ei(K){var J=this.__data__;return Me?J[K]!==void 0:jt.call(J,K)}function ke(K,J){var ft=this.__data__;return this.size+=this.has(K)?0:1,ft[K]=Me&&J===void 0?n:J,this}kt.prototype.clear=He,kt.prototype.delete=re,kt.prototype.get=je,kt.prototype.has=ei,kt.prototype.set=ke;function ve(K){var J=-1,ft=K==null?0:K.length;for(this.clear();++J<ft;){var It=K[J];this.set(It[0],It[1])}}function Tn(){this.__data__=[],this.size=0}function Rn(K){var J=this.__data__,ft=bo(J,K);if(ft<0)return!1;var It=J.length-1;return ft==It?J.pop():Ee.call(J,ft,1),--this.size,!0}function Ln(K){var J=this.__data__,ft=bo(J,K);return ft<0?void 0:J[ft][1]}function Bn(K){return bo(this.__data__,K)>-1}function Un(K,J){var ft=this.__data__,It=bo(ft,K);return It<0?(++this.size,ft.push([K,J])):ft[It][1]=J,this}ve.prototype.clear=Tn,ve.prototype.delete=Rn,ve.prototype.get=Ln,ve.prototype.has=Bn,ve.prototype.set=Un;function xr(K){var J=-1,ft=K==null?0:K.length;for(this.clear();++J<ft;){var It=K[J];this.set(It[0],It[1])}}function Pi(){this.size=0,this.__data__={hash:new kt,map:new(Ht||ve),string:new kt}}function fo(K){var J=Ds(this,K).delete(K);return this.size-=J?1:0,J}function Mi(K){return Ds(this,K).get(K)}function po(K){return Ds(this,K).has(K)}function go(K,J){var ft=Ds(this,K),It=ft.size;return ft.set(K,J),this.size+=ft.size==It?0:1,this}xr.prototype.clear=Pi,xr.prototype.delete=fo,xr.prototype.get=Mi,xr.prototype.has=po,xr.prototype.set=go;function $i(K){var J=-1,ft=K==null?0:K.length;for(this.__data__=new xr;++J<ft;)this.add(K[J])}function Ss(K){return this.__data__.set(K,n),this}function Cs(K){return this.__data__.has(K)}$i.prototype.add=$i.prototype.push=Ss,$i.prototype.has=Cs;function Gr(K){var J=this.__data__=new ve(K);this.size=J.size}function mo(){this.__data__=new ve,this.size=0}function vo(K){var J=this.__data__,ft=J.delete(K);return this.size=J.size,ft}function wo(K){return this.__data__.get(K)}function yo(K){return this.__data__.has(K)}function $u(K,J){var ft=this.__data__;if(ft instanceof ve){var It=ft.__data__;if(!Ht||It.length<r-1)return It.push([K,J]),this.size=++ft.size,this;ft=this.__data__=new xr(It)}return ft.set(K,J),this.size=ft.size,this}Gr.prototype.clear=mo,Gr.prototype.delete=vo,Gr.prototype.get=wo,Gr.prototype.has=yo,Gr.prototype.set=$u;function Nu(K,J){var ft=Ia(K),It=!ft&&Ku(K),Ge=!ft&&!It&&zc(K),oe=!ft&&!It&&!Ge&&Gu(K),Xe=ft||It||Ge||oe,gr=Xe?Pe(K.length,String):[],Se=gr.length;for(var Ye in K)(J||jt.call(K,Ye))&&!(Xe&&(Ye=="length"||Ge&&(Ye=="offset"||Ye=="parent")||oe&&(Ye=="buffer"||Ye=="byteLength"||Ye=="byteOffset")||ju(Ye,Se)))&&gr.push(Ye);return gr}function bo(K,J){for(var ft=K.length;ft--;)if(Hu(K[ft][0],J))return ft;return-1}function kc(K,J,ft){var It=J(K);return Ia(K)?It:Mt(It,ft(K))}function _o(K){return K==null?K===void 0?et:Y:ir&&ir in Object(K)?Uu(K):Nd(K)}function qc(K){return Ao(K)&&_o(K)==l}function Eo(K,J,ft,It,Ge){return K===J?!0:K==null||J==null||!Ao(K)&&!Ao(J)?K!==K&&J!==J:Tu(K,J,ft,It,Eo,Ge)}function Tu(K,J,ft,It,Ge,oe){var Xe=Ia(K),gr=Ia(J),Se=Xe?f:Ni(K),Ye=gr?f:Ni(J);Se=Se==l?B:Se,Ye=Ye==l?B:Ye;var fr=Se==B,ln=Ye==B,mr=Se==Ye;if(mr&&zc(K)){if(!zc(J))return!1;Xe=!0,fr=!1}if(mr&&!fr)return oe||(oe=new Gr),Xe||Gu(K)?Aa(K,J,ft,It,Ge,oe):$d(K,J,Se,ft,It,Ge,oe);if(!(ft&i)){var tr=fr&&jt.call(K,"__wrapped__"),Yr=ln&&jt.call(J,"__wrapped__");if(tr||Yr){var ri=tr?K.value():K,Fn=Yr?J.value():J;return oe||(oe=new Gr),Ge(ri,Fn,ft,It,oe)}}return mr?(oe||(oe=new Gr),Bu(K,J,ft,It,Ge,oe)):!1}function Md(K){if(!Vu(K)||qu(K))return!1;var J=Sa(K)?le:ot;return J.test(Ji(K))}function Ru(K){return Ao(K)&&Wu(K.length)&&!!A[_o(K)]}function Lu(K){if(!zu(K))return Vr(K);var J=[];for(var ft in Object(K))jt.call(K,ft)&&ft!="constructor"&&J.push(ft);return J}function Aa(K,J,ft,It,Ge,oe){var Xe=ft&i,gr=K.length,Se=J.length;if(gr!=Se&&!(Xe&&Se>gr))return!1;var Ye=oe.get(K);if(Ye&&oe.get(J))return Ye==J;var fr=-1,ln=!0,mr=ft&o?new $i:void 0;for(oe.set(K,J),oe.set(J,K);++fr<gr;){var tr=K[fr],Yr=J[fr];if(It)var ri=Xe?It(Yr,tr,fr,J,K,oe):It(tr,Yr,fr,K,J,oe);if(ri!==void 0){if(ri)continue;ln=!1;break}if(mr){if(!St(J,function(Fn,Ti){if(!Dt(mr,Ti)&&(tr===Fn||Ge(tr,Fn,ft,It,oe)))return mr.push(Ti)})){ln=!1;break}}else if(!(tr===Yr||Ge(tr,Yr,ft,It,oe))){ln=!1;break}}return oe.delete(K),oe.delete(J),ln}function $d(K,J,ft,It,Ge,oe,Xe){switch(ft){case dt:if(K.byteLength!=J.byteLength||K.byteOffset!=J.byteOffset)return!1;K=K.buffer,J=J.buffer;case nt:return!(K.byteLength!=J.byteLength||!oe(new nr(K),new nr(J)));case g:case _:case W:return Hu(+K,+J);case E:return K.name==J.name&&K.message==J.message;case U:case m:return K==J+"";case F:var gr=Et;case j:var Se=It&i;if(gr||(gr=Gt),K.size!=J.size&&!Se)return!1;var Ye=Xe.get(K);if(Ye)return Ye==J;It|=o,Xe.set(K,J);var fr=Aa(gr(K),gr(J),It,Ge,oe,Xe);return Xe.delete(K),fr;case $:if(Zt)return Zt.call(K)==Zt.call(J)}return!1}function Bu(K,J,ft,It,Ge,oe){var Xe=ft&i,gr=xa(K),Se=gr.length,Ye=xa(J),fr=Ye.length;if(Se!=fr&&!Xe)return!1;for(var ln=Se;ln--;){var mr=gr[ln];if(!(Xe?mr in J:jt.call(J,mr)))return!1}var tr=oe.get(K);if(tr&&oe.get(J))return tr==J;var Yr=!0;oe.set(K,J),oe.set(J,K);for(var ri=Xe;++ln<Se;){mr=gr[ln];var Fn=K[mr],Ti=J[mr];if(It)var Hc=Xe?It(Ti,Fn,mr,J,K,oe):It(Fn,Ti,mr,K,J,oe);if(!(Hc===void 0?Fn===Ti||Ge(Fn,Ti,ft,It,oe):Hc)){Yr=!1;break}ri||(ri=mr=="constructor")}if(Yr&&!ri){var xo=K.constructor,Ir=J.constructor;xo!=Ir&&"constructor"in K&&"constructor"in J&&!(typeof xo=="function"&&xo instanceof xo&&typeof Ir=="function"&&Ir instanceof Ir)&&(Yr=!1)}return oe.delete(K),oe.delete(J),Yr}function xa(K){return kc(K,Ld,Fu)}function Ds(K,J){var ft=K.__data__;return ku(J)?ft[typeof J=="string"?"string":"hash"]:ft.map}function bn(K,J){var ft=Ft(K,J);return Md(ft)?ft:void 0}function Uu(K){var J=jt.call(K,ir),ft=K[ir];try{K[ir]=void 0;var It=!0}catch{}var Ge=Nt.call(K);return It&&(J?K[ir]=ft:delete K[ir]),Ge}var Fu=Ie?function(K){return K==null?[]:(K=Object(K),Ot(Ie(K),function(J){return de.call(K,J)}))}:Ve,Ni=_o;(Yt&&Ni(new Yt(new ArrayBuffer(1)))!=dt||Ht&&Ni(new Ht)!=F||Re&&Ni(Re.resolve())!=z||Qt&&Ni(new Qt)!=j||Vt&&Ni(new Vt)!=tt)&&(Ni=function(K){var J=_o(K),ft=J==B?K.constructor:void 0,It=ft?Ji(ft):"";if(It)switch(It){case Xt:return dt;case te:return F;case Le:return z;case ee:return j;case Jt:return tt}return J});function ju(K,J){return J=J??c,!!J&&(typeof K=="number"||pt.test(K))&&K>-1&&K%1==0&&K<J}function ku(K){var J=typeof K;return J=="string"||J=="number"||J=="symbol"||J=="boolean"?K!=="__proto__":K===null}function qu(K){return!!$t&&$t in K}function zu(K){var J=K&&K.constructor,ft=typeof J=="function"&&J.prototype||Bt;return K===ft}function Nd(K){return Nt.call(K)}function Ji(K){if(K!=null){try{return Pt.call(K)}catch{}try{return K+""}catch{}}return""}function Hu(K,J){return K===J||K!==K&&J!==J}var Ku=qc(function(){return arguments}())?qc:function(K){return Ao(K)&&jt.call(K,"callee")&&!de.call(K,"callee")},Ia=Array.isArray;function Td(K){return K!=null&&Wu(K.length)&&!Sa(K)}var zc=Oe||Ke;function Rd(K,J){return Eo(K,J)}function Sa(K){if(!Vu(K))return!1;var J=_o(K);return J==x||J==I||J==h||J==P}function Wu(K){return typeof K=="number"&&K>-1&&K%1==0&&K<=c}function Vu(K){var J=typeof K;return K!=null&&(J=="object"||J=="function")}function Ao(K){return K!=null&&typeof K=="object"}var Gu=lt?zt(lt):Ru;function Ld(K){return Td(K)?Nu(K):Lu(K)}function Ve(){return[]}function Ke(){return!1}e.exports=Rd})(r0,r0.exports);var l9=r0.exports;function u9(e,t){return t=t||{},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(g){return l[g.toLowerCase()]},has:function(g){return g.toLowerCase()in l}}}};for(var h in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(g,_,E){o.push(_=_.toLowerCase()),c.push([_,E]),l[_]=l[_]?l[_]+","+E:E}),r(f())},i.onerror=n,i.withCredentials=t.credentials=="include",t.headers)i.setRequestHeader(h,t.headers[h]);i.send(t.body||null)})}var h9=Object.freeze({__proto__:null,default:u9}),yv=ol(h9),f9=self.fetch||(self.fetch=yv.default||yv),d9=Object.defineProperty,bv=Object.getOwnPropertySymbols,p9=Object.prototype.hasOwnProperty,g9=Object.prototype.propertyIsEnumerable,_v=(e,t,r)=>t in e?d9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Kr=(e,t)=>{for(var r in t||(t={}))p9.call(t,r)&&_v(e,r,t[r]);if(bv)for(var r of bv(t))g9.call(t,r)&&_v(e,r,t[r]);return e};function m9(e,t){if(e.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<e.length;i++){var o=e.charAt(i),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=i}var l=e.length,f=e.charAt(0),h=Math.log(l)/Math.log(256),g=Math.log(256)/Math.log(l);function _(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var F=0,W=0,Y=0,B=I.length;Y!==B&&I[Y]===0;)Y++,F++;for(var z=(B-Y)*g+1>>>0,P=new Uint8Array(z);Y!==B;){for(var U=I[Y],j=0,m=z-1;(U!==0||j<W)&&m!==-1;m--,j++)U+=256*P[m]>>>0,P[m]=U%l>>>0,U=U/l>>>0;if(U!==0)throw new Error("Non-zero carry");W=j,Y++}for(var $=z-W;$!==z&&P[$]===0;)$++;for(var et=f.repeat(F);$<z;++$)et+=e.charAt(P[$]);return et}function E(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var F=0;if(I[F]!==" "){for(var W=0,Y=0;I[F]===f;)W++,F++;for(var B=(I.length-F)*h+1>>>0,z=new Uint8Array(B);I[F];){var P=r[I.charCodeAt(F)];if(P===255)return;for(var U=0,j=B-1;(P!==0||U<Y)&&j!==-1;j--,U++)P+=l*z[j]>>>0,z[j]=P%256>>>0,P=P/256>>>0;if(P!==0)throw new Error("Non-zero carry");Y=U,F++}if(I[F]!==" "){for(var m=B-Y;m!==B&&z[m]===0;)m++;for(var $=new Uint8Array(W+(B-m)),et=W;m!==B;)$[et++]=z[m++];return $}}}function x(I){var F=E(I);if(F)return F;throw new Error(`Non-${t} character`)}return{encode:_,decodeUnsafe:E,decode:x}}var v9=m9,w9=v9;const Ev=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},y9=e=>new TextEncoder().encode(e),b9=e=>new TextDecoder().decode(e);class _9{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class E9{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Av(this,t)}}class A9{constructor(t){this.decoders=t}or(t){return Av(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Av=(e,t)=>new A9(Kr(Kr({},e.decoders||{[e.prefix]:e}),t.decoders||{[t.prefix]:t}));class x9{constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new _9(t,r,n),this.decoder=new E9(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Ql=({name:e,prefix:t,encode:r,decode:n})=>new x9(e,t,r,n),vc=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=w9(r,t);return Ql({prefix:e,name:t,encode:n,decode:o=>Ev(i(o))})},I9=(e,t,r,n)=>{const i={};for(let g=0;g<t.length;++g)i[t[g]]=g;let o=e.length;for(;e[o-1]==="=";)--o;const c=new Uint8Array(o*r/8|0);let l=0,f=0,h=0;for(let g=0;g<o;++g){const _=i[e[g]];if(_===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|_,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},S9=(e,t,r)=>{const n=t[t.length-1]==="=",i=(1<<r)-1;let o="",c=0,l=0;for(let f=0;f<e.length;++f)for(l=l<<8|e[f],c+=8;c>r;)c-=r,o+=t[i&l>>c];if(c&&(o+=t[i&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},$r=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Ql({prefix:t,name:e,encode(i){return S9(i,n,r)},decode(i){return I9(i,n,r,e)}}),C9=Ql({prefix:"\0",name:"identity",encode:e=>b9(e),decode:e=>y9(e)});var D9=Object.freeze({__proto__:null,identity:C9});const O9=$r({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var P9=Object.freeze({__proto__:null,base2:O9});const M9=$r({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var $9=Object.freeze({__proto__:null,base8:M9});const N9=vc({prefix:"9",name:"base10",alphabet:"0123456789"});var T9=Object.freeze({__proto__:null,base10:N9});const R9=$r({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),L9=$r({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var B9=Object.freeze({__proto__:null,base16:R9,base16upper:L9});const U9=$r({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),F9=$r({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),j9=$r({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),k9=$r({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),q9=$r({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),z9=$r({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),H9=$r({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),K9=$r({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),W9=$r({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var V9=Object.freeze({__proto__:null,base32:U9,base32upper:F9,base32pad:j9,base32padupper:k9,base32hex:q9,base32hexupper:z9,base32hexpad:H9,base32hexpadupper:K9,base32z:W9});const G9=vc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Y9=vc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Q9=Object.freeze({__proto__:null,base36:G9,base36upper:Y9});const J9=vc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Z9=vc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var X9=Object.freeze({__proto__:null,base58btc:J9,base58flickr:Z9});const tI=$r({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),eI=$r({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),rI=$r({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),nI=$r({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var iI=Object.freeze({__proto__:null,base64:tI,base64pad:eI,base64url:rI,base64urlpad:nI});const xv=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}"),sI=xv.reduce((e,t,r)=>(e[r]=t,e),[]),oI=xv.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function aI(e){return e.reduce((t,r)=>(t+=sI[r],t),"")}function cI(e){const t=[];for(const r of e){const n=oI[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const lI=Ql({prefix:"\u{1F680}",name:"base256emoji",encode:aI,decode:cI});var uI=Object.freeze({__proto__:null,base256emoji:lI}),hI=Sv,Iv=128,fI=127,dI=~fI,pI=Math.pow(2,31);function Sv(e,t,r){t=t||[],r=r||0;for(var n=r;e>=pI;)t[r++]=e&255|Iv,e/=128;for(;e&dI;)t[r++]=e&255|Iv,e>>>=7;return t[r]=e|0,Sv.bytes=r-n+1,t}var gI=n0,mI=128,Cv=127;function n0(e,n){var r=0,n=n||0,i=0,o=n,c,l=e.length;do{if(o>=l)throw n0.bytes=0,new RangeError("Could not decode varint");c=e[o++],r+=i<28?(c&Cv)<<i:(c&Cv)*Math.pow(2,i),i+=7}while(c>=mI);return n0.bytes=o-n,r}var vI=Math.pow(2,7),wI=Math.pow(2,14),yI=Math.pow(2,21),bI=Math.pow(2,28),_I=Math.pow(2,35),EI=Math.pow(2,42),AI=Math.pow(2,49),xI=Math.pow(2,56),II=Math.pow(2,63),SI=function(e){return e<vI?1:e<wI?2:e<yI?3:e<bI?4:e<_I?5:e<EI?6:e<AI?7:e<xI?8:e<II?9:10},CI={encode:hI,decode:gI,encodingLength:SI},Dv=CI;const Ov=(e,t,r=0)=>(Dv.encode(e,t,r),t),Pv=e=>Dv.encodingLength(e),i0=(e,t)=>{const r=t.byteLength,n=Pv(e),i=n+Pv(r),o=new Uint8Array(i+r);return Ov(e,o,0),Ov(r,o,n),o.set(t,i),new DI(e,r,t,o)};class DI{constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}}const Mv=({name:e,code:t,encode:r})=>new OI(e,t,r);class OI{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){const r=this.encode(t);return r instanceof Uint8Array?i0(this.code,r):r.then(n=>i0(this.code,n))}else throw Error("Unknown type, must be binary type")}}const $v=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),PI=Mv({name:"sha2-256",code:18,encode:$v("SHA-256")}),MI=Mv({name:"sha2-512",code:19,encode:$v("SHA-512")});var $I=Object.freeze({__proto__:null,sha256:PI,sha512:MI});const Nv=0,NI="identity",Tv=Ev;var TI=Object.freeze({__proto__:null,identity:{code:Nv,name:NI,encode:Tv,digest:e=>i0(Nv,Tv(e))}});new TextEncoder,new TextDecoder;const Rv=Kr(Kr(Kr(Kr(Kr(Kr(Kr(Kr(Kr(Kr({},D9),P9),$9),T9),B9),V9),Q9),X9),iI),uI);Kr(Kr({},$I),TI);function RI(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function Lv(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Bv=Lv("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),s0=Lv("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=RI(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),LI=Kr({utf8:Bv,"utf-8":Bv,hex:Rv.base16,latin1:s0,ascii:s0,binary:s0},Rv);function BI(e,t="utf8"){const r=LI[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}const Uv="wc",UI=2,o0="core",ds=`${Uv}@2:${o0}:`,FI={name:o0,logger:"error"},jI={database:":memory:"},kI="crypto",Fv="client_ed25519_seed",qI=yt.ONE_DAY,zI="keychain",HI="0.3",KI="messages",WI="0.3",VI=yt.SIX_HOURS,GI="publisher",jv="irn",YI="error",kv="wss://relay.walletconnect.org",QI="relayer",on={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"},JI="_subscription",Mn={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},ZI=.1,XI="2.14.0",tS=1e4,eS="0.3",rS="WALLETCONNECT_CLIENT_ID",Ai={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},nS="subscription",iS="0.3",sS=yt.FIVE_SECONDS*1e3,oS="pairing",aS="0.3",wc={wc_pairingDelete:{req:{ttl:yt.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:yt.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:yt.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:yt.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:yt.ONE_DAY,prompt:!1,tag:0},res:{ttl:yt.ONE_DAY,prompt:!1,tag:0}}},ra={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},ti={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},cS="history",lS="0.3",uS="expirer",$n={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},hS="0.3",a0="verify-api",fS="https://verify.walletconnect.com",qv="https://verify.walletconnect.org",yc=qv,dS=[fS,qv],pS="echo",gS="https://echo.walletconnect.com";class mS{constructor(t,r){this.core=t,this.logger=r,this.keychain=new Map,this.name=zI,this.version=HI,this.initialized=!1,this.storagePrefix=ds,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}=mt("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=t,this.logger=sn(r,this.name)}get context(){return nn(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(t){await this.core.storage.setItem(this.storageKey,tg(t))}async getKeyChain(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?eg(t):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:t}=mt("NOT_INITIALIZED",this.name);throw new Error(t)}}}class vS{constructor(t,r,n){this.core=t,this.logger=r,this.name=kI,this.randomSessionIdentifier=$f(),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=rv(i);return ev(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=FE();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const o=await this.getClientSeed(),c=rv(o),l=this.randomSessionIdentifier;return await vx(l,i,qI,c)},this.generateSharedKey=(i,o,c)=>{this.isInitialized();const l=this.getPrivateKey(i),f=jE(l,o);return this.setSymKey(f,c)},this.setSymKey=async(i,o)=>{this.isInitialized();const c=o||Tl(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=ym(c),f=zi(o);if(bm(l)){const E=l.senderPublicKey,x=l.receiverPublicKey;i=await this.generateSharedKey(E,x)}const h=this.getSymKey(i),{type:g,senderPublicKey:_}=l;return qE({type:g,symKey:h,message:f,senderPublicKey:_})},this.decode=async(i,o,c)=>{this.isInitialized();const l=KE(o,c);if(bm(l)){const f=l.receiverPublicKey,h=l.senderPublicKey;i=await this.generateSharedKey(f,h)}try{const f=this.getSymKey(i),h=zE({symKey:f,encoded:o});return uc(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=Rl(i);return ic(o.type)},this.getPayloadSenderPublicKey=i=>{const o=Rl(i);return o.senderPublicKey?bx(o.senderPublicKey,zr):void 0},this.core=t,this.logger=sn(r,this.name),this.keychain=n||new mS(this.core,this.logger)}get context(){return nn(this.logger)}async setPrivateKey(t,r){return await this.keychain.set(t,r),t}getPrivateKey(t){return this.keychain.get(t)}async getClientSeed(){let t="";try{t=this.keychain.get(Fv)}catch{t=$f(),await this.keychain.set(Fv,t)}return BI(t,"base16")}getSymKey(t){return this.keychain.get(t)}isInitialized(){if(!this.initialized){const{message:t}=mt("NOT_INITIALIZED",this.name);throw new Error(t)}}}class wS extends V7{constructor(t,r){super(t,r),this.logger=t,this.core=r,this.messages=new Map,this.name=KI,this.version=WI,this.initialized=!1,this.storagePrefix=ds,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=Ws(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=Ws(i);return typeof o[c]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=sn(t,this.name),this.core=r}get context(){return nn(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(t){await this.core.storage.setItem(this.storageKey,tg(t))}async getRelayerMessages(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?eg(t):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:t}=mt("NOT_INITIALIZED",this.name);throw new Error(t)}}}class yS extends G7{constructor(t,r){super(t,r),this.relayer=t,this.logger=r,this.events=new Cr.exports.EventEmitter,this.name=GI,this.queue=new Map,this.publishTimeout=yt.toMiliseconds(yt.ONE_MINUTE),this.failedPublishTimeout=yt.toMiliseconds(yt.ONE_SECOND),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}});const l=o?.ttl||VI,f=Nf(o),h=o?.prompt||!1,g=o?.tag||0,_=o?.id||Ys().toString(),E={topic:n,message:i,opts:{ttl:l,relay:f,prompt:h,tag:g,id:_}},x=`Failed to publish payload, please try again. id:${_} tag:${g}`,I=Date.now();let F,W=1;try{for(;F===void 0;){if(Date.now()-I>this.publishTimeout)throw new Error(x);this.logger.trace({id:_,attempts:W},`publisher.publish - attempt ${W}`),F=await await jo(this.rpcPublish(n,i,l,f,h,g,_).catch(Y=>this.logger.warn(Y)),this.publishTimeout,x),W++,F||await new Promise(Y=>setTimeout(Y,this.failedPublishTimeout))}this.relayer.events.emit(on.publish,E),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:_,topic:n,message:i,opts:o}})}catch(Y){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(Y),(c=o?.internal)!=null&&c.throwOnFailedPublish)throw Y;this.queue.set(_,E)}},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=t,this.logger=sn(r,this.name),this.registerEventListeners()}get context(){return nn(this.logger)}rpcPublish(t,r,n,i,o,c,l){var f,h,g,_;const E={method:sc(i.protocol).publish,params:{topic:t,message:r,ttl:n,prompt:o,tag:c},id:l};return Hr((f=E.params)==null?void 0:f.prompt)&&((h=E.params)==null||delete h.prompt),Hr((g=E.params)==null?void 0:g.tag)&&((_=E.params)==null||delete _.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:E}),this.relayer.request(E)}removeRequestFromQueue(t){this.queue.delete(t)}checkQueue(){this.queue.forEach(async t=>{const{topic:r,message:n,opts:i}=t;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(hc.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(on.connection_stalled);return}this.checkQueue()}),this.relayer.on(on.message_ack,t=>{this.removeRequestFromQueue(t.id.toString())})}}class bS{constructor(){this.map=new Map,this.set=(t,r)=>{const n=this.get(t);this.exists(t,r)||this.map.set(t,[...n,r])},this.get=t=>this.map.get(t)||[],this.exists=(t,r)=>this.get(t).includes(r),this.delete=(t,r)=>{if(typeof r>"u"){this.map.delete(t);return}if(!this.map.has(t))return;const n=this.get(t);if(!this.exists(t,r))return;const i=n.filter(o=>o!==r);if(!i.length){this.map.delete(t);return}this.map.set(t,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var _S=Object.defineProperty,ES=Object.defineProperties,AS=Object.getOwnPropertyDescriptors,zv=Object.getOwnPropertySymbols,xS=Object.prototype.hasOwnProperty,IS=Object.prototype.propertyIsEnumerable,Hv=(e,t,r)=>t in e?_S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bc=(e,t)=>{for(var r in t||(t={}))xS.call(t,r)&&Hv(e,r,t[r]);if(zv)for(var r of zv(t))IS.call(t,r)&&Hv(e,r,t[r]);return e},c0=(e,t)=>ES(e,AS(t));class SS extends J7{constructor(t,r){super(t,r),this.relayer=t,this.logger=r,this.subscriptions=new Map,this.topicMap=new bS,this.events=new Cr.exports.EventEmitter,this.name=nS,this.version=iS,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=ds,this.subscribeTimeout=yt.toMiliseconds(yt.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],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=Nf(i),c={topic:n,relay:o};this.pending.set(n,c);const l=await this.rpcSubscribe(n,o);return typeof l=="string"&&(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=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((o,c)=>{const l=new yt.Watch;l.start(i);const f=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(f),l.stop(i),o(!0)),l.elapsed(i)>=sS&&(clearInterval(f),l.stop(i),c(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.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=t,this.logger=sn(r,this.name),this.clientId=""}get context(){return nn(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(t,r){let n=!1;try{n=this.getSubscription(t).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(t,r){const n=this.topicMap.get(t);await Promise.all(n.map(async i=>await this.unsubscribeById(t,i,r)))}async unsubscribeById(t,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:r,opts:n}});try{const i=Nf(n);await this.rpcUnsubscribe(t,r,i);const o=Ue("USER_DISCONNECTED",`${this.name}, ${t}`);await this.onUnsubscribe(t,r,o),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(t,r){const n={method:sc(r.protocol).subscribe,params:{topic:t}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await jo(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)?Ws(t+this.clientId):null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(on.connection_stalled)}return null}async rpcBatchSubscribe(t){if(!t.length)return;const r=t[0].relay,n={method:sc(r.protocol).batchSubscribe,params:{topics:t.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).catch(i=>this.logger.warn(i)),this.subscribeTimeout)}catch{this.relayer.events.emit(on.connection_stalled)}}async rpcBatchFetchMessages(t){if(!t.length)return;const r=t[0].relay,n={method:sc(r.protocol).batchFetchMessages,params:{topics:t.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await jo(this.relayer.request(n).catch(o=>this.logger.warn(o)),this.subscribeTimeout)}catch{this.relayer.events.emit(on.connection_stalled)}return i}rpcUnsubscribe(t,r,n){const i={method:sc(n.protocol).unsubscribe,params:{topic:t,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(t,r){this.setSubscription(t,c0(bc({},r),{id:t})),this.pending.delete(r.topic)}onBatchSubscribe(t){t.length&&t.forEach(r=>{this.setSubscription(r.id,bc({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(t,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,t)&&this.deleteSubscription(r,n),await this.relayer.messages.del(t)}async setRelayerSubscriptions(t){await this.relayer.core.storage.setItem(this.storageKey,t)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(t,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:t,subscription:r}),this.addSubscription(t,r)}addSubscription(t,r){this.subscriptions.set(t,bc({},r)),this.topicMap.set(r.topic,t),this.events.emit(Ai.created,r)}getSubscription(t){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:t});const r=this.subscriptions.get(t);if(!r){const{message:n}=mt("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(n)}return r}deleteSubscription(t,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:t,reason:r});const n=this.getSubscription(t);this.subscriptions.delete(t),this.topicMap.delete(n.topic,t),this.events.emit(Ai.deleted,c0(bc({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Ai.sync)}async reset(){if(this.cached.length){const t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<t;r++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchFetchMessages(n),await this.batchSubscribe(n)}}this.events.emit(Ai.resubscribed)}async restore(){try{const t=await this.getRelayerSubscriptions();if(typeof t>"u"||!t.length)return;if(this.subscriptions.size){const{message:r}=mt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=t,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(t){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(t)}}async batchSubscribe(t){if(!t.length)return;const r=await this.rpcBatchSubscribe(t);wi(r)&&this.onBatchSubscribe(r.map((n,i)=>c0(bc({},t[i]),{id:n})))}async batchFetchMessages(t){if(!t.length)return;this.logger.trace(`Fetching batch messages for ${t.length} subscriptions`);const r=await this.rpcBatchFetchMessages(t);r&&r.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(r.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const t=[];this.pending.forEach(r=>{t.push(r)}),await this.batchSubscribe(t),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(hc.pulse,async()=>{await this.checkPending()}),this.events.on(Ai.created,async t=>{const r=Ai.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),await this.persist()}),this.events.on(Ai.deleted,async t=>{const r=Ai.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:t}=mt("NOT_INITIALIZED",this.name);throw new Error(t)}}async restartToComplete(){this.restartInProgress&&await new Promise(t=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),t())},this.pollingInterval)})}}var CS=Object.defineProperty,Kv=Object.getOwnPropertySymbols,DS=Object.prototype.hasOwnProperty,OS=Object.prototype.propertyIsEnumerable,Wv=(e,t,r)=>t in e?CS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,PS=(e,t)=>{for(var r in t||(t={}))DS.call(t,r)&&Wv(e,r,t[r]);if(Kv)for(var r of Kv(t))OS.call(t,r)&&Wv(e,r,t[r]);return e};class MS extends Y7{constructor(t){super(t),this.protocol="wc",this.version=2,this.events=new Cr.exports.EventEmitter,this.name=QI,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=yt.toMiliseconds(yt.THIRTY_SECONDS+yt.ONE_SECOND),this.request=async r=>{var n,i;this.logger.debug("Publishing Request Payload");const o=r.id||Ys().toString();await this.toEstablishConnection();try{const c=this.provider.request(r);this.requestsInFlight.set(o,{promise:c,request:r}),this.logger.trace({id:o,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - attempt to publish...");const l=await new Promise(async(f,h)=>{const g=()=>{h(new Error(`relayer.request - publish interrupted, id: ${o}`))};this.provider.on(Mn.disconnect,g);const _=await c;this.provider.off(Mn.disconnect,g),f(_)});return this.logger.trace({id:o,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - published"),l}catch(c){throw this.logger.debug(`Failed to Publish Request: ${o}`),c}finally{this.requestsInFlight.delete(o)}},this.resetPingTimeout=()=>{if(Va())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n,i;(i=(n=(r=this.provider)==null?void 0:r.connection)==null?void 0:n.socket)==null||i.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(on.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(on.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Mn.payload,this.onPayloadHandler),this.provider.on(Mn.connect,this.onConnectHandler),this.provider.on(Mn.disconnect,this.onDisconnectHandler),this.provider.on(Mn.error,this.onProviderErrorHandler)},this.core=t.core,this.logger=typeof t.logger<"u"&&typeof t.logger!="string"?sn(t.logger,this.name):yi(Kl({level:t.logger||YI})),this.messages=new wS(this.logger,t.core),this.subscriber=new SS(this,this.logger),this.publisher=new yS(this,this.logger),this.relayUrl=t?.relayUrl||kv,this.projectId=t.projectId,this.bundleId=D8(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),await this.transportOpen(),this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&this.subscriber.pending.size===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},tS)}get context(){return nn(this.logger)}get connected(){var t,r,n;return((n=(r=(t=this.provider)==null?void 0:t.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1}get connecting(){var t,r,n;return((n=(r=(t=this.provider)==null?void 0:t.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0}async publish(t,r,n){this.isInitialized(),await this.publisher.publish(t,r,n),await this.recordMessageEvent({topic:t,message:r,publishedAt:Date.now()})}async subscribe(t,r){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(t))==null?void 0:n[0])||"",o;const c=l=>{l.topic===t&&(this.subscriber.off(Ai.created,c),o())};return await Promise.all([new Promise(l=>{o=l,this.subscriber.on(Ai.created,c)}),new Promise(async l=>{i=await this.subscriber.subscribe(t,r)||i,l()})]),i}async unsubscribe(t,r){this.isInitialized(),await this.subscriber.unsubscribe(t,r)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(t=>t.promise))}catch(t){this.logger.warn(t)}this.hasExperiencedNetworkDisruption||this.connected?await jo(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(t){await this.confirmOnlineStateOrThrow(),t&&t!==this.relayUrl&&(this.relayUrl=t,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(r,n)=>{const i=()=>{this.provider.off(Mn.disconnect,i),n(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(Mn.disconnect,i),await jo(this.provider.connect(),yt.toMiliseconds(yt.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>{n(o)}),this.subscriber.start().catch(o=>{this.logger.error(o),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){this.logger.error(r);const n=r;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(n.message))throw r}finally{this.connectionAttemptInProgress=!1}}async restartTransport(t){this.connectionAttemptInProgress||(this.relayUrl=t||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await $m())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(t){if(t?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=t.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.trace(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i)}this.logger.trace(`Batch of ${r.length} message events processed`)}startPingTimeout(){var t,r,n,i,o;if(Va())try{(r=(t=this.provider)==null?void 0:t.connection)!=null&&r.socket&&((o=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||o.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(c){this.logger.warn(c)}}isConnectionStalled(t){return this.staleConnectionErrors.some(r=>t.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const t=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Ei(new c9(T8({sdkVersion:XI,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:t,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(t){const{topic:r,message:n}=t;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(t){const{topic:r,message:n}=t;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(t){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:t}),e0(t)){if(!t.method.endsWith(JI))return;const r=t.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(PS({type:"event",event:r.id},c)),this.events.emit(r.id,c),await this.acknowledgePayload(t),await this.onMessageEvent(c)}else Yl(t)&&this.events.emit(on.message_ack,t)}async onMessageEvent(t){await this.shouldIgnoreMessageEvent(t)||(this.events.emit(on.message,t),await this.recordMessageEvent(t))}async acknowledgePayload(t){const r=Vl(t.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Mn.payload,this.onPayloadHandler),this.provider.off(Mn.connect,this.onConnectHandler),this.provider.off(Mn.disconnect,this.onDisconnectHandler),this.provider.off(Mn.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let t=await $m();RA(async r=>{t!==r&&(t=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(on.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&setTimeout(async()=>{await this.transportOpen().catch(t=>this.logger.error(t))},yt.toMiliseconds(ZI))}isInitialized(){if(!this.initialized){const{message:t}=mt("NOT_INITIALIZED",this.name);throw new Error(t)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(t=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),t())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var $S=Object.defineProperty,Vv=Object.getOwnPropertySymbols,NS=Object.prototype.hasOwnProperty,TS=Object.prototype.propertyIsEnumerable,Gv=(e,t,r)=>t in e?$S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yv=(e,t)=>{for(var r in t||(t={}))NS.call(t,r)&&Gv(e,r,t[r]);if(Vv)for(var r of Vv(t))TS.call(t,r)&&Gv(e,r,t[r]);return e};class Qs extends Q7{constructor(t,r,n,i=ds,o=void 0){super(t,r,n,i),this.core=t,this.logger=r,this.name=n,this.map=new Map,this.version=eS,this.cached=[],this.initialized=!1,this.storagePrefix=ds,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!Hr(c)?this.map.set(this.getKey(c),c):fA(c)?this.map.set(c.id,c):dA(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=>l9(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=Yv(Yv({},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),this.addToRecentlyDeleted(c),await this.persist())},this.logger=sn(r,this.name),this.storagePrefix=i,this.getKey=o}get context(){return nn(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())}addToRecentlyDeleted(t){this.recentlyDeleted.push(t),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(t){await this.core.storage.setItem(this.storageKey,t)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(t){const r=this.map.get(t);if(!r){if(this.recentlyDeleted.includes(t)){const{message:i}=mt("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${t}`);throw this.logger.error(i),new Error(i)}const{message:n}=mt("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const t=await this.getDataStore();if(typeof t>"u"||!t.length)return;if(this.map.size){const{message:r}=mt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=t,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(t){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(t)}}isInitialized(){if(!this.initialized){const{message:t}=mt("NOT_INITIALIZED",this.name);throw new Error(t)}}}class RS{constructor(t,r){this.core=t,this.logger=r,this.name=oS,this.version=aS,this.events=new Cr.exports,this.initialized=!1,this.storagePrefix=ds,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 n=>{this.isInitialized();const i=$f(),o=await this.core.crypto.setSymKey(i),c=Or(yt.FIVE_MINUTES),l={protocol:jv},f={topic:o,expiry:c,relay:l,active:!1},h=rA({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:i,relay:l,expiryTimestamp:c,methods:n?.methods});return this.core.expirer.set(o,c),await this.pairings.set(o,f),await this.core.relayer.subscribe(o),{topic:o,uri:h}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:o,relay:c,expiryTimestamp:l,methods:f}=xm(n.uri);let h;if(this.pairings.keys.includes(i)&&(h=this.pairings.get(i),h.active))throw new Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);const g=l||Or(yt.FIVE_MINUTES),_={topic:i,relay:c,expiry:g,active:!1,methods:f};return this.core.expirer.set(i,g),await this.pairings.set(i,_),n.activatePairing&&await this.activate({topic:i}),this.events.emit(ra.create,_),this.core.crypto.keychain.has(i)||await this.core.crypto.setSymKey(o,i),await this.core.relayer.subscribe(i,{relay:c}),_},this.activate=async({topic:n})=>{this.isInitialized();const i=Or(yt.THIRTY_DAYS);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry: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}=qs();this.events.once(we("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",Ue("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,o)=>{const c=ea(i,o),l=await this.core.crypto.encode(n,c),f=wc[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=Vl(n,o),l=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=wc[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=Gl(n,o),l=await this.core.crypto.encode(i,c),f=await this.core.history.get(i,n),h=wc[f.request.method]?wc[f.request.method].res:wc.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,Ue("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=>cs(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(ra.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(()=>{_i(i)?this.events.emit(we("pairing_ping",o),{}):Pn(i)&&this.events.emit(we("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(ra.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=Ue("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(Ue("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{var i;if(!en(n)){const{message:c}=mt("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(c)}if(!hA(n.uri)){const{message:c}=mt("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(c)}const o=xm(n.uri);if(!((i=o?.relay)!=null&&i.protocol)){const{message:c}=mt("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(c)}if(!(o!=null&&o.symKey)){const{message:c}=mt("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(c)}if(o!=null&&o.expiryTimestamp&&yt.toMiliseconds(o?.expiryTimestamp)<Date.now()){const{message:c}=mt("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(c)}},this.isValidPing=async n=>{if(!en(n)){const{message:o}=mt("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!en(n)){const{message:o}=mt("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(o)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ur(n,!1)){const{message:i}=mt("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=mt("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(cs(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=mt("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=t,this.logger=sn(r,this.name),this.pairings=new Qs(this.core,this.logger,this.name,this.storagePrefix)}get context(){return nn(this.logger)}isInitialized(){if(!this.initialized){const{message:t}=mt("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){this.core.relayer.on(on.message,async t=>{const{topic:r,message:n}=t;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{e0(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):Yl(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($n.expired,async t=>{const{topic:r}=ng(t.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(ra.expire,{topic:r}))})}}class LS extends W7{constructor(t,r){super(t,r),this.core=t,this.logger=r,this.records=new Map,this.events=new Cr.exports.EventEmitter,this.name=cS,this.version=lS,this.cached=[],this.initialized=!1,this.storagePrefix=ds,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:Or(yt.THIRTY_DAYS)};this.records.set(c.id,c),this.persist(),this.events.emit(ti.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=Pn(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(ti.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(ti.deleted,o)}}),this.persist()},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=sn(r,this.name)}get context(){return nn(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 t=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:ea(r.request.method,r.request.params,r.id),chainId:r.chainId};return t.push(n)}),t}async setJsonRpcRecords(t){await this.core.storage.setItem(this.storageKey,t)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(t){this.isInitialized();const r=this.records.get(t);if(!r){const{message:n}=mt("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(ti.sync)}async restore(){try{const t=await this.getJsonRpcRecords();if(typeof t>"u"||!t.length)return;if(this.records.size){const{message:r}=mt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=t,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}}registerEventListeners(){this.events.on(ti.created,t=>{const r=ti.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:t})}),this.events.on(ti.updated,t=>{const r=ti.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:t})}),this.events.on(ti.deleted,t=>{const r=ti.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:t})}),this.core.heartbeat.on(hc.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let t=!1;this.records.forEach(r=>{yt.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(ti.deleted,r,!1),t=!0)}),t&&this.persist()}catch(t){this.logger.warn(t)}}isInitialized(){if(!this.initialized){const{message:t}=mt("NOT_INITIALIZED",this.name);throw new Error(t)}}}class BS extends Z7{constructor(t,r){super(t,r),this.core=t,this.logger=r,this.expirations=new Map,this.events=new Cr.exports.EventEmitter,this.name=uS,this.version=hS,this.cached=[],this.initialized=!1,this.storagePrefix=ds,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($n.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($n.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=sn(r,this.name)}get context(){return nn(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(t){if(typeof t=="string")return R8(t);if(typeof t=="number")return L8(t);const{message:r}=mt("UNKNOWN_TYPE",`Target type: ${typeof t}`);throw new Error(r)}async setExpirations(t){await this.core.storage.setItem(this.storageKey,t)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit($n.sync)}async restore(){try{const t=await this.getExpirations();if(typeof t>"u"||!t.length)return;if(this.expirations.size){const{message:r}=mt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=t,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(t){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(t)}}getExpiration(t){const r=this.expirations.get(t);if(!r){const{message:n}=mt("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(t,r){const{expiry:n}=r;yt.toMiliseconds(n)-Date.now()<=0&&this.expire(t,r)}expire(t,r){this.expirations.delete(t),this.events.emit($n.expired,{target:t,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((t,r)=>this.checkExpiry(r,t))}registerEventListeners(){this.core.heartbeat.on(hc.pulse,()=>this.checkExpirations()),this.events.on($n.created,t=>{const r=$n.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),this.persist()}),this.events.on($n.expired,t=>{const r=$n.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),this.persist()}),this.events.on($n.deleted,t=>{const r=$n.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),this.persist()})}isInitialized(){if(!this.initialized){const{message:t}=mt("NOT_INITIALIZED",this.name);throw new Error(t)}}}class US extends X7{constructor(t,r){super(t,r),this.projectId=t,this.logger=r,this.name=a0,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||Uo()||!Fo())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),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);return this.fetchAttestation(n.attestationId,i)},this.fetchAttestation=async(n,i)=>{this.logger.info(`resolving attestation: ${n} from url: ${i}`);const o=this.startAbortTimer(yt.ONE_SECOND*5),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.onInit(),window.removeEventListener("message",i),n())};await Promise.race([new Promise(o=>{const c=document.getElementById(a0);if(c)return this.iframe=c,this.onInit(),o();window.addEventListener("message",i);const l=document.createElement("iframe");l.id=a0,l.src=`${this.verifyUrl}/${this.projectId}`,l.style.display="none",document.body.append(l),this.iframe=l,n=o}),new Promise((o,c)=>setTimeout(()=>{window.removeEventListener("message",i),c("verify iframe load timeout")},yt.toMiliseconds(yt.FIVE_SECONDS)))])},this.onInit=()=>{this.initialized=!0,this.processQueue()},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=n=>{let i=n||yc;return dS.includes(i)||(this.logger.info(`verify url: ${i}, not included in trusted list, assigning default: ${yc}`),i=yc),i},this.logger=sn(r,this.name),this.verifyUrl=yc,this.abortController=new AbortController,this.isDevEnv=Va()&&process.env.IS_VITEST}get context(){return nn(this.logger)}startAbortTimer(t){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),yt.toMiliseconds(t))}}class FS extends tx{constructor(t,r){super(t,r),this.projectId=t,this.logger=r,this.context=pS,this.registerDeviceToken=async n=>{const{clientId:i,token:o,notificationType:c,enableEncrypted:l=!1}=n,f=`${gS}/${this.projectId}/clients`;await f9(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:c,token:o,always_raw:l})})},this.logger=sn(r,this.context)}}var jS=Object.defineProperty,Qv=Object.getOwnPropertySymbols,kS=Object.prototype.hasOwnProperty,qS=Object.prototype.propertyIsEnumerable,Jv=(e,t,r)=>t in e?jS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zv=(e,t)=>{for(var r in t||(t={}))kS.call(t,r)&&Jv(e,r,t[r]);if(Qv)for(var r of Qv(t))qS.call(t,r)&&Jv(e,r,t[r]);return e};class l0 extends K7{constructor(t){var r;super(t),this.protocol=Uv,this.version=UI,this.name=o0,this.events=new Cr.exports.EventEmitter,this.initialized=!1,this.on=(c,l)=>this.events.on(c,l),this.once=(c,l)=>this.events.once(c,l),this.off=(c,l)=>this.events.off(c,l),this.removeListener=(c,l)=>this.events.removeListener(c,l),this.projectId=t?.projectId,this.relayUrl=t?.relayUrl||kv,this.customStoragePrefix=t!=null&&t.customStoragePrefix?`:${t.customStoragePrefix}`:"";const n=Kl({level:typeof t?.logger=="string"&&t.logger?t.logger:FI.logger}),{logger:i,chunkLoggerController:o}=H7({opts:n,maxSizeInBytes:t?.maxLogBlobSizeInBytes,loggerOverride:t?.logger});this.logChunkController=o,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var c,l;(c=this.logChunkController)!=null&&c.downloadLogsBlobInBrowser&&((l=this.logChunkController)==null||l.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=sn(i,this.name),this.heartbeat=new kf,this.crypto=new vS(this,this.logger,t?.keychain),this.history=new LS(this,this.logger),this.expirer=new BS(this,this.logger),this.storage=t!=null&&t.storage?t.storage:new g7(Zv(Zv({},jI),t?.storageOptions)),this.relayer=new MS({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new RS(this,this.logger),this.verify=new US(this.projectId||"",this.logger),this.echoClient=new FS(this.projectId||"",this.logger)}static async init(t){const r=new l0(t);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(rS,n),r}get context(){return nn(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var t;return(t=this.logChunkController)==null?void 0:t.logsToBlob({clientId:await this.crypto.getClientId()})}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(t){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,t),this.logger.error(t.message),t}}}const zS=l0,Xv="wc",tw=2,ew="client",u0=`${Xv}@${tw}:${ew}:`,h0={name:ew,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},rw="WALLETCONNECT_DEEPLINK_CHOICE",HS="proposal",nw="Proposal expired",KS="session",na=yt.SEVEN_DAYS,WS="engine",Nr={wc_sessionPropose:{req:{ttl:yt.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:yt.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:yt.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:yt.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:yt.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:yt.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:yt.ONE_DAY,prompt:!1,tag:1104},res:{ttl:yt.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:yt.ONE_DAY,prompt:!1,tag:1106},res:{ttl:yt.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:yt.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:yt.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:yt.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:yt.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:yt.ONE_DAY,prompt:!1,tag:1112},res:{ttl:yt.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:yt.ONE_DAY,prompt:!1,tag:1114},res:{ttl:yt.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:yt.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:yt.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:yt.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:yt.FIVE_MINUTES,prompt:!1,tag:1119}}},f0={min:yt.FIVE_MINUTES,max:yt.SEVEN_DAYS},xi={idle:"IDLE",active:"ACTIVE"},VS="request",GS=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],YS="wc",QS="auth",JS="authKeys",ZS="pairingTopics",XS="requests",Jl=`${YS}@${1.5}:${QS}:`,Zl=`${Jl}:PUB_KEY`;var tC=Object.defineProperty,eC=Object.defineProperties,rC=Object.getOwnPropertyDescriptors,iw=Object.getOwnPropertySymbols,nC=Object.prototype.hasOwnProperty,iC=Object.prototype.propertyIsEnumerable,sw=(e,t,r)=>t in e?tC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vr=(e,t)=>{for(var r in t||(t={}))nC.call(t,r)&&sw(e,r,t[r]);if(iw)for(var r of iw(t))iC.call(t,r)&&sw(e,r,t[r]);return e},Js=(e,t)=>eC(e,rC(t));class sC extends rx{constructor(t){super(t),this.name=WS,this.events=new Cr.exports,this.initialized=!1,this.requestQueue={state:xi.idle,queue:[]},this.sessionRequestQueue={state:xi.idle,queue:[]},this.requestQueueDelay=yt.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Nr)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},yt.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const n=Js(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,g,_=!1;try{h&&(_=this.client.core.pairing.pairings.get(h).active)}catch(P){throw this.client.logger.error(`connect() -> pairing.get(${h}) failed`),P}if(!h||!_){const{topic:P,uri:U}=await this.client.core.pairing.create();h=P,g=U}if(!h){const{message:P}=mt("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(P)}const E=await this.client.core.crypto.generateKeyPair(),x=Nr.wc_sessionPropose.req.ttl||yt.FIVE_MINUTES,I=Or(x),F=vr({requiredNamespaces:o,optionalNamespaces:c,relays:f??[{protocol:jv}],proposer:{publicKey:E,metadata:this.client.metadata},expiryTimestamp:I,pairingTopic:h},l&&{sessionProperties:l}),{reject:W,resolve:Y,done:B}=qs(x,nw);this.events.once(we("session_connect"),async({error:P,session:U})=>{if(P)W(P);else if(U){U.self.publicKey=E;const j=Js(vr({},U),{pairingTopic:F.pairingTopic,requiredNamespaces:F.requiredNamespaces,optionalNamespaces:F.optionalNamespaces});await this.client.session.set(U.topic,j),await this.setExpiry(U.topic,U.expiry),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:U.peer.metadata}),this.cleanupDuplicatePairings(j),Y(j)}});const z=await this.sendRequest({topic:h,method:"wc_sessionPropose",params:F,throwOnFailedPublish:!0});return await this.setProposal(z,vr({id:z},F)),{uri:g,approval:B}},this.pair=async r=>{await this.isInitialized();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}},this.approve=async r=>{await this.isInitialized();try{await this.isValidApprove(r)}catch(B){throw this.client.logger.error("approve() -> isValidApprove() failed"),B}const{id:n,relayProtocol:i,namespaces:o,sessionProperties:c,sessionConfig:l}=r;let f;try{f=this.client.proposal.get(n)}catch(B){throw this.client.logger.error(`approve() -> proposal.get(${n}) failed`),B}const{pairingTopic:h,proposer:g,requiredNamespaces:_,optionalNamespaces:E}=f,x=await this.client.core.crypto.generateKeyPair(),I=g.publicKey,F=await this.client.core.crypto.generateSharedKey(x,I),W=vr(vr({relay:{protocol:i??"irn"},namespaces:o,controller:{publicKey:x,metadata:this.client.metadata},expiry:Or(na)},c&&{sessionProperties:c}),l&&{sessionConfig:l});await this.client.core.relayer.subscribe(F);const Y=Js(vr({},W),{topic:F,requiredNamespaces:_,optionalNamespaces:E,pairingTopic:h,acknowledged:!1,self:W.controller,peer:{publicKey:g.publicKey,metadata:g.metadata},controller:x});await this.client.session.set(F,Y);try{await this.sendResult({id:n,topic:h,result:{relay:{protocol:i??"irn"},responderPublicKey:x},throwOnFailedPublish:!0}),await this.sendRequest({topic:F,method:"wc_sessionSettle",params:W,throwOnFailedPublish:!0})}catch(B){throw this.client.logger.error(B),this.client.session.delete(F,Ue("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(F),B}return await this.client.core.pairing.updateMetadata({topic:h,metadata:g.metadata}),await this.client.proposal.delete(n,Ue("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:h}),await this.setExpiry(F,Or(na)),{topic:F,acknowledged:()=>new Promise(B=>setTimeout(()=>B(this.client.session.get(F)),500))}},this.reject=async r=>{await this.isInitialized();try{await this.isValidReject(r)}catch(c){throw this.client.logger.error("reject() -> isValidReject() failed"),c}const{id:n,reason:i}=r;let o;try{o=this.client.proposal.get(n).pairingTopic}catch(c){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),c}o&&(await this.sendError({id:n,topic:o,error:i,rpcOpts:Nr.wc_sessionPropose.reject}),await this.client.proposal.delete(n,Ue("USER_DISCONNECTED")))},this.update=async r=>{await this.isInitialized();try{await this.isValidUpdate(r)}catch(_){throw this.client.logger.error("update() -> isValidUpdate() failed"),_}const{topic:n,namespaces:i}=r,{done:o,resolve:c,reject:l}=qs(),f=fs(),h=Ys().toString(),g=this.client.session.get(n).namespaces;return this.events.once(we("session_update",f),({error:_})=>{_?l(_):c()}),await this.client.session.update(n,{namespaces:i}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:f,relayRpcId:h}).catch(_=>{this.client.logger.error(_),this.client.session.update(n,{namespaces:g}),l(_)}),{acknowledged:o}},this.extend=async r=>{await this.isInitialized();try{await this.isValidExtend(r)}catch(f){throw this.client.logger.error("extend() -> isValidExtend() failed"),f}const{topic:n}=r,i=fs(),{done:o,resolve:c,reject:l}=qs();return this.events.once(we("session_extend",i),({error:f})=>{f?l(f):c()}),await this.setExpiry(n,Or(na)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(f=>{l(f)}),{acknowledged:o}},this.request=async r=>{await this.isInitialized();try{await this.isValidRequest(r)}catch(x){throw this.client.logger.error("request() -> isValidRequest() failed"),x}const{chainId:n,request:i,topic:o,expiry:c=Nr.wc_sessionRequest.req.ttl}=r,l=this.client.session.get(o),f=fs(),h=Ys().toString(),{done:g,resolve:_,reject:E}=qs(c,"Request expired. Please try again.");return this.events.once(we("session_request",f),({error:x,result:I})=>{x?E(x):_(I)}),await Promise.all([new Promise(async x=>{await this.sendRequest({clientRpcId:f,relayRpcId:h,topic:o,method:"wc_sessionRequest",params:{request:Js(vr({},i),{expiryTimestamp:Or(c)}),chainId:n},expiry:c,throwOnFailedPublish:!0}).catch(I=>E(I)),this.client.events.emit("session_request_sent",{topic:o,request:i,chainId:n,id:f}),x()}),new Promise(async x=>{var I;if(!((I=l.sessionConfig)!=null&&I.disableDeepLink)){const F=await U8(this.client.core.storage,rw);B8({id:f,topic:o,wcDeepLink:F})}x()}),g()]).then(x=>x[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:o}=i;_i(i)?await this.sendResult({id:o,topic:n,result:i.result,throwOnFailedPublish:!0}):Pn(i)&&await this.sendError({id:o,topic:n,error:i.error}),this.cleanupAfterResponse(r)},this.ping=async r=>{await this.isInitialized();try{await this.isValidPing(r)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=fs(),o=Ys().toString(),{done:c,resolve:l,reject:f}=qs();this.events.once(we("session_ping",i),({error:h})=>{h?f(h):l()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:o}),c()])}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,c=Ys().toString();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:o},throwOnFailedPublish:!0,relayRpcId:c})},this.disconnect=async r=>{await this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:Ue("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=mt("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>lA(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async r=>{this.isInitialized(),this.isValidAuthenticate(r);const{chains:n,statement:i="",uri:o,domain:c,nonce:l,type:f,exp:h,nbf:g,methods:_=[],expiry:E}=r,x=[...r.resources||[]],{topic:I,uri:F}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"]});this.client.logger.info({message:"Generated new pairing",pairing:{topic:I,uri:F}});const W=await this.client.core.crypto.generateKeyPair(),Y=Tl(W);if(await Promise.all([this.client.auth.authKeys.set(Zl,{responseTopic:Y,publicKey:W}),this.client.auth.pairingTopics.set(Y,{topic:Y,pairingTopic:I})]),await this.client.core.relayer.subscribe(Y),this.client.logger.info(`sending request to new pairing topic: ${I}`),_.length>0){const{namespace:d}=Wa(n[0]);let p=NE(d,"request",_);Nl(x)&&(p=RE(p,x.pop())),x.push(p)}const B=E&&E>Nr.wc_sessionAuthenticate.req.ttl?E:Nr.wc_sessionAuthenticate.req.ttl,z={authPayload:{type:f??"caip122",chains:n,statement:i,aud:o,domain:c,version:"1",nonce:l,iat:new Date().toISOString(),exp:h,nbf:g,resources:x},requester:{publicKey:W,metadata:this.client.metadata},expiryTimestamp:Or(B)},P={eip155:{chains:n,methods:[...new Set(["personal_sign",..._])],events:["chainChanged","accountsChanged"]}},U={requiredNamespaces:{},optionalNamespaces:P,relays:[{protocol:"irn"}],pairingTopic:I,proposer:{publicKey:W,metadata:this.client.metadata},expiryTimestamp:Or(Nr.wc_sessionPropose.req.ttl)},{done:j,resolve:m,reject:$}=qs(B,"Request expired"),et=async({error:d,session:p})=>{if(this.events.off(we("session_request",nt),tt),d)$(d);else if(p){p.self.publicKey=W,await this.client.session.set(p.topic,p),await this.setExpiry(p.topic,p.expiry),I&&await this.client.core.pairing.updateMetadata({topic:I,metadata:p.peer.metadata});const b=this.client.session.get(p.topic);await this.deleteProposal(dt),m({session:b})}},tt=async d=>{if(await this.deletePendingAuthRequest(nt,{message:"fulfilled",code:0}),d.error){const D=Ue("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return d.error.code===D.code?void 0:(this.events.off(we("session_connect"),et),$(d.error.message))}await this.deleteProposal(dt),this.events.off(we("session_connect"),et);const{cacaos:p,responder:b}=d.result,C=[],O=[];for(const D of p){await hm({cacao:D,projectId:this.client.core.projectId})||(this.client.logger.error(D,"Signature verification failed"),$(Ue("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:v}=D,T=Nl(v.resources),ot=[um(v.iss)],pt=$l(v.iss);if(T){const A=pm(T),rt=gm(T);C.push(...A),ot.push(...rt)}for(const A of ot)O.push(`${A}:${pt}`)}const N=await this.client.core.crypto.generateSharedKey(W,b.publicKey);let L;C.length>0&&(L={topic:N,acknowledged:!0,self:{publicKey:W,metadata:this.client.metadata},peer:b,controller:b.publicKey,expiry:Or(na),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:I,namespaces:Im([...new Set(C)],[...new Set(O)])},await this.client.core.relayer.subscribe(N),await this.client.session.set(N,L),I&&await this.client.core.pairing.updateMetadata({topic:I,metadata:b.metadata}),L=this.client.session.get(N)),m({auths:p,session:L})},nt=fs(),dt=fs();this.events.once(we("session_connect"),et),this.events.once(we("session_request",nt),tt);try{await Promise.all([this.sendRequest({topic:I,method:"wc_sessionAuthenticate",params:z,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:nt}),this.sendRequest({topic:I,method:"wc_sessionPropose",params:U,expiry:Nr.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:dt})])}catch(d){throw this.events.off(we("session_connect"),et),this.events.off(we("session_request",nt),tt),d}return await this.setProposal(dt,vr({id:dt},U)),await this.setAuthRequest(nt,{request:Js(vr({},z),{verifyContext:{}}),pairingTopic:I}),{uri:F,response:j}},this.approveSessionAuthenticate=async r=>{this.isInitialized();const{id:n,auths:i}=r,o=this.getPendingAuthRequest(n);if(!o)throw new Error(`Could not find pending auth request with id ${n}`);const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),f=Tl(c),h={type:qi,receiverPublicKey:c,senderPublicKey:l},g=[],_=[];for(const I of i){if(!await hm({cacao:I,projectId:this.client.core.projectId})){const z=Ue("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:f,error:z,encodeOpts:h}),new Error(z.message)}const{p:F}=I,W=Nl(F.resources),Y=[um(F.iss)],B=$l(F.iss);if(W){const z=pm(W),P=gm(W);g.push(...z),Y.push(...P)}for(const z of Y)_.push(`${z}:${B}`)}const E=await this.client.core.crypto.generateSharedKey(l,c);let x;return g?.length>0&&(x={topic:E,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:Or(na),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:Im([...new Set(g)],[...new Set(_)])},await this.client.core.relayer.subscribe(E),await this.client.session.set(E,x),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})),await this.sendResult({topic:f,id:n,result:{cacaos:i,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:h,throwOnFailedPublish:!0}),await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),{session:x}},this.rejectSessionAuthenticate=async r=>{await this.isInitialized();const{id:n,reason:i}=r,o=this.getPendingAuthRequest(n);if(!o)throw new Error(`Could not find pending auth request with id ${n}`);const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),f=Tl(c),h={type:qi,receiverPublicKey:c,senderPublicKey:l};await this.sendError({id:n,topic:f,error:i,encodeOpts:h,rpcOpts:Nr.wc_sessionAuthenticate.reject}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,Ue("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return fm(n,i)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},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=>{var n;const{topic:i,expirerHasDeleted:o=!1,emitEvent:c=!0,id:l=0}=r,{self:f}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,Ue("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(f.publicKey)&&await this.client.core.crypto.deleteKeyPair(f.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),o||this.client.core.expirer.del(i),this.client.core.storage.removeItem(rw).catch(h=>this.client.logger.warn(h)),this.getPendingSessionRequests().forEach(h=>{h.topic===i&&this.deletePendingSessionRequest(h.id,Ue("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=xi.idle),c&&this.client.events.emit("session_delete",{id:l,topic:i})},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,Ue("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},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.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(o=>o.id!==r),i&&(this.sessionRequestQueue.state=xi.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,Or(Nr.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:o}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:o,verifyContext:i.verifyContext})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:o,verifyContext:c}=r,l=o.request.expiryTimestamp||Or(Nr.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,l),await this.client.pendingRequest.set(n,{id:n,topic:i,params:o,verifyContext:c})},this.sendRequest=async r=>{const{topic:n,method:i,params:o,expiry:c,relayRpcId:l,clientRpcId:f,throwOnFailedPublish:h}=r,g=ea(i,o,f);if(Fo()&&GS.includes(i)){const x=Ws(JSON.stringify(g));this.client.core.verify.register({attestationId:x})}let _;try{_=await this.client.core.crypto.encode(n,g)}catch(x){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),x}const E=Nr[i].req;return c&&(E.ttl=c),l&&(E.id=l),this.client.core.history.set(n,g),h?(E.internal=Js(vr({},E.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,_,E)):this.client.core.relayer.publish(n,_,E).catch(x=>this.client.logger.error(x)),g.id},this.sendResult=async r=>{const{id:n,topic:i,result:o,throwOnFailedPublish:c,encodeOpts:l}=r,f=Vl(n,o);let h;try{h=await this.client.core.crypto.encode(i,f,l)}catch(E){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),E}let g;try{g=await this.client.core.history.get(i,n)}catch(E){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),E}const _=Nr[g.request.method].res;c?(_.internal=Js(vr({},_.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,h,_)):this.client.core.relayer.publish(i,h,_).catch(E=>this.client.logger.error(E)),await this.client.core.history.resolve(f)},this.sendError=async r=>{const{id:n,topic:i,error:o,encodeOpts:c,rpcOpts:l}=r,f=Gl(n,o);let h;try{h=await this.client.core.crypto.encode(i,f,c)}catch(E){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),E}let g;try{g=await this.client.core.history.get(i,n)}catch(E){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),E}const _=l||Nr[g.request.method].res;this.client.core.relayer.publish(i,h,_),await this.client.core.history.resolve(f)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let o=!1;cs(i.expiry)&&(o=!0),this.client.core.crypto.keychain.has(i.topic)||(o=!0),o&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{cs(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic: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===xi.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=xi.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=xi.idle},this.processRequest=async r=>{const{topic:n,payload:i}=r,o=i.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:o}))switch(o){case"wc_sessionPropose":return await this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return await this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,i);case"wc_sessionPing":return await this.onSessionPingRequest(n,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return await this.onSessionRequest(n,i);case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest(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);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=mt("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.shouldIgnorePairingRequest=r=>{const{topic:n,requestMethod:i}=r,o=this.expectedPairingMethodMap.get(n);return!o||o.includes(i)?!1:!!(o.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:o}=n;try{this.isValidConnect(vr({},n.params));const c=i.expiryTimestamp||Or(Nr.wc_sessionPropose.req.ttl),l=vr({id:o,pairingTopic:r,expiryTimestamp:c},i);await this.setProposal(o,l);const f=Ws(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({id:o,topic:r,error:c,rpcOpts:Nr.wc_sessionPropose.autoReject}),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(_i(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 g=await this.client.core.relayer.subscribe(h);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:g}),await this.client.core.pairing.activate({topic:r})}else if(Pn(n)){await this.client.proposal.delete(i,Ue("USER_DISCONNECTED"));const o=we("session_connect");if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(we("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,sessionProperties:g,sessionConfig:_}=n.params,E=vr(vr({topic:r,relay:c,expiry:f,namespaces:h,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:l.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:l.publicKey,metadata:l.metadata}},g&&{sessionProperties:g}),_&&{sessionConfig:_});await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0});const x=we("session_connect");if(this.events.listenerCount(x)===0)throw new Error(`emitting ${x} without any listeners 997`);this.events.emit(we("session_connect"),{session:E})}catch(c){await this.sendError({id:i,topic:r,error:c}),this.client.logger.error(c)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;_i(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(we("session_approve",i),{})):Pn(n)&&(await this.client.session.delete(r,Ue("USER_DISCONNECTED")),this.events.emit(we("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:o}=n;try{const c=`${r}_session_update`,l=cc.get(c);if(l&&this.isRequestOutOfSync(l,o)){this.client.logger.info(`Discarding out of sync request - ${o}`),this.sendError({id:o,topic:r,error:Ue("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(vr({topic:r},i));try{cc.set(c,o),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:o,topic:r,result:!0,throwOnFailedPublish:!0})}catch(f){throw cc.delete(c),f}this.client.events.emit("session_update",{id:o,topic:r,params:i})}catch(c){await this.sendError({id:o,topic:r,error: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,o=we("session_update",i);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);_i(n)?this.events.emit(we("session_update",i),{}):Pn(n)&&this.events.emit(we("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Or(na)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,o=we("session_extend",i);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);_i(n)?this.events.emit(we("session_extend",i),{}):Pn(n)&&this.events.emit(we("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,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,o=we("session_ping",i);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);setTimeout(()=>{_i(n)?this.events.emit(we("session_ping",i),{}):Pn(n)&&this.events.emit(we("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(on.publish,async()=>{o(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:Ue("USER_DISCONNECTED")})])}catch(o){this.client.logger.error(o)}},this.onSessionRequest=async(r,n)=>{var i;const{id:o,params:c}=n;try{await this.isValidRequest(vr({topic:r},c));const l=Ws(JSON.stringify(ea("wc_sessionRequest",c,o))),f=this.client.session.get(r),h=await this.getVerifyContext(l,f.peer.metadata),g={id:o,topic:r,params:c,verifyContext:h};await this.setPendingSessionRequest(g),(i=this.client.signConfig)!=null&&i.disableRequestQueue?this.emitSessionRequest(g):(this.addSessionRequestToSessionRequestQueue(g),this.processSessionRequestQueue())}catch(l){await this.sendError({id:o,topic:r,error:l}),this.client.logger.error(l)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,o=we("session_request",i);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);_i(n)?this.events.emit(we("session_request",i),{result:n.result}):Pn(n)&&this.events.emit(we("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:o}=n;try{const c=`${r}_session_event_${o.event.name}`,l=cc.get(c);if(l&&this.isRequestOutOfSync(l,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(vr({topic:r},o)),this.client.events.emit("session_event",{id:i,topic:r,params:o}),cc.set(c,i)}catch(c){await this.sendError({id:i,topic:r,error:c}),this.client.logger.error(c)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),_i(n)?this.events.emit(we("session_request",i),{result:n.result}):Pn(n)&&this.events.emit(we("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async(r,n)=>{try{const{requester:i,authPayload:o,expiryTimestamp:c}=n.params,l=Ws(JSON.stringify(n)),f=await this.getVerifyContext(l,this.client.metadata),h={requester:i,pairingTopic:r,id:n.id,authPayload:o,verifyContext:f,expiryTimestamp:c};await this.setAuthRequest(n.id,{request:h,pairingTopic:r}),this.client.events.emit("session_authenticate",{topic:r,params:n.params,id:n.id,verifyContext:f})}catch(i){this.client.logger.error(i);const o=n.params.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),l={type:qi,receiverPublicKey:o,senderPublicKey:c};await this.sendError({id:n.id,topic:r,error:i,encodeOpts:l,rpcOpts:Nr.wc_sessionAuthenticate.autoReject})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=xi.idle,this.processSessionRequestQueue()},yt.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(o=>o.topic===r&&o.request.method==="wc_sessionRequest").forEach(o=>{const c=o.request.id,l=we("session_request",c);if(this.events.listenerCount(l)===0)throw new Error(`emitting ${l} without any listeners`);this.events.emit(we("session_request",o.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===xi.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=xi.active,this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest(r.topic,ea("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id))},this.isValidConnect=async r=>{if(!en(r)){const{message:f}=mt("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(Hr(n)||await this.isValidPairingTopic(n),!_A(l,!0)){const{message:f}=mt("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(f)}!Hr(i)&&ac(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Hr(o)&&ac(o)!==0&&this.validateNamespaces(o,"optionalNamespaces"),Hr(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=bA(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!en(r))throw new Error(mt("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:o,sessionProperties:c}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const l=this.client.proposal.get(n),f=Lf(i,"approve()");if(f)throw new Error(f.message);const h=Pm(l.requiredNamespaces,i,"approve()");if(h)throw new Error(h.message);if(!ur(o,!0)){const{message:g}=mt("MISSING_OR_INVALID",`approve() relayProtocol: ${o}`);throw new Error(g)}Hr(c)||this.validateSessionProps(c,"sessionProperties")},this.isValidReject=async r=>{if(!en(r)){const{message:o}=mt("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(o)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!AA(i)){const{message:o}=mt("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidSessionSettleRequest=r=>{if(!en(r)){const{message:h}=mt("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(h)}const{relay:n,controller:i,namespaces:o,expiry:c}=r;if(!Dm(n)){const{message:h}=mt("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(h)}const l=pA(i,"onSessionSettleRequest()");if(l)throw new Error(l.message);const f=Lf(o,"onSessionSettleRequest()");if(f)throw new Error(f.message);if(cs(c)){const{message:h}=mt("EXPIRED","onSessionSettleRequest()");throw new Error(h)}},this.isValidUpdate=async r=>{if(!en(r)){const{message:f}=mt("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(f)}const{topic:n,namespaces:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const o=this.client.session.get(n),c=Lf(i,"update()");if(c)throw new Error(c.message);const l=Pm(o.requiredNamespaces,i,"update()");if(l)throw new Error(l.message)},this.isValidExtend=async r=>{if(!en(r)){const{message:i}=mt("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!en(r)){const{message:f}=mt("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(f)}const{topic:n,request:i,chainId:o,expiry:c}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:l}=this.client.session.get(n);if(!Om(l,o)){const{message:f}=mt("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(f)}if(!xA(i)){const{message:f}=mt("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(f)}if(!CA(l,o,i.method)){const{message:f}=mt("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(f)}if(c&&!MA(c,f0)){const{message:f}=mt("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${f0.min} and ${f0.max}`);throw new Error(f)}},this.isValidRespond=async r=>{var n;if(!en(r)){const{message:c}=mt("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(c)}const{topic:i,response:o}=r;try{await this.isValidSessionTopic(i)}catch(c){throw(n=r?.response)!=null&&n.id&&this.cleanupAfterResponse(r),c}if(!IA(o)){const{message:c}=mt("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(o)}`);throw new Error(c)}},this.isValidPing=async r=>{if(!en(r)){const{message:i}=mt("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!en(r)){const{message:l}=mt("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(!Om(c,o)){const{message:l}=mt("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(l)}if(!SA(i)){const{message:l}=mt("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}if(!DA(c,o,i.name)){const{message:l}=mt("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(l)}},this.isValidDisconnect=async r=>{if(!en(r)){const{message:i}=mt("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidAuthenticate=r=>{const{chains:n,uri:i,domain:o,nonce:c}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!ur(i,!1))throw new Error("uri is required parameter");if(!ur(o,!1))throw new Error("domain is required parameter");if(!ur(c,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(f=>Wa(f).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:l}=Wa(n[0]);if(l!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async(r,n)=>{const i={verified:{verifyUrl:n.verifyUrl||yc,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(!ur(i,!1)){const{message:o}=mt("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(o)}})},this.getPendingAuthRequest=r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0},this.addToRecentlyDeleted=(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const o=this.recentlyDeletedLimit/2;for(const c of this.recentlyDeletedMap.keys()){if(i++>=o)break;this.recentlyDeletedMap.delete(c)}}},this.checkRecentlyDeleted=r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=mt("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}}}async isInitialized(){if(!this.initialized){const{message:t}=mt("NOT_INITIALIZED",this.name);throw new Error(t)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(on.message,t=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(t):this.onRelayMessage(t)})}async onRelayMessage(t){const{topic:r,message:n}=t,{publicKey:i}=this.client.auth.authKeys.keys.includes(Zl)?this.client.auth.authKeys.get(Zl):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(r,n,{receiverPublicKey:i});try{e0(o)?(this.client.core.history.set(r,o),this.onRelayEventRequest({topic:r,payload:o})):Yl(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:r,payload:o}),this.client.core.history.delete(r,o.id)):this.onRelayEventUnknownPayload({topic:r,payload:o})}catch(c){this.client.logger.error(c)}}registerExpirerEvents(){this.client.core.expirer.on($n.expired,async t=>{const{topic:r,id:n}=ng(t.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,mt("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,mt("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!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(ra.create,t=>this.onPairingCreated(t)),this.client.core.pairing.events.on(ra.delete,t=>{this.addToRecentlyDeleted(t.topic,"pairing")})}isValidPairingTopic(t){if(!ur(t,!1)){const{message:r}=mt("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:r}=mt("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw new Error(r)}if(cs(this.client.core.pairing.pairings.get(t).expiry)){const{message:r}=mt("EXPIRED",`pairing topic: ${t}`);throw new Error(r)}}async isValidSessionTopic(t){if(!ur(t,!1)){const{message:r}=mt("MISSING_OR_INVALID",`session topic should be a string: ${t}`);throw new Error(r)}if(this.checkRecentlyDeleted(t),!this.client.session.keys.includes(t)){const{message:r}=mt("NO_MATCHING_KEY",`session topic doesn't exist: ${t}`);throw new Error(r)}if(cs(this.client.session.get(t).expiry)){await this.deleteSession({topic:t});const{message:r}=mt("EXPIRED",`session topic: ${t}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(t)){const{message:r}=mt("MISSING_OR_INVALID",`session topic does not exist in keychain: ${t}`);throw await this.deleteSession({topic:t}),new Error(r)}}async isValidSessionOrPairingTopic(t){if(this.checkRecentlyDeleted(t),this.client.session.keys.includes(t))await this.isValidSessionTopic(t);else if(this.client.core.pairing.pairings.keys.includes(t))this.isValidPairingTopic(t);else if(ur(t,!1)){const{message:r}=mt("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${t}`);throw new Error(r)}else{const{message:r}=mt("MISSING_OR_INVALID",`session or pairing topic should be a string: ${t}`);throw new Error(r)}}async isValidProposalId(t){if(!EA(t)){const{message:r}=mt("MISSING_OR_INVALID",`proposal id should be a number: ${t}`);throw new Error(r)}if(!this.client.proposal.keys.includes(t)){const{message:r}=mt("NO_MATCHING_KEY",`proposal id doesn't exist: ${t}`);throw new Error(r)}if(cs(this.client.proposal.get(t).expiryTimestamp)){await this.deleteProposal(t);const{message:r}=mt("EXPIRED",`proposal id: ${t}`);throw new Error(r)}}}class oC extends Qs{constructor(t,r){super(t,r,HS,u0),this.core=t,this.logger=r}}class aC extends Qs{constructor(t,r){super(t,r,KS,u0),this.core=t,this.logger=r}}class cC extends Qs{constructor(t,r){super(t,r,VS,u0,n=>n.id),this.core=t,this.logger=r}}class lC extends Qs{constructor(t,r){super(t,r,JS,Jl,()=>Zl),this.core=t,this.logger=r}}class uC extends Qs{constructor(t,r){super(t,r,ZS,Jl),this.core=t,this.logger=r}}class hC extends Qs{constructor(t,r){super(t,r,XS,Jl,n=>n.id),this.core=t,this.logger=r}}class fC{constructor(t,r){this.core=t,this.logger=r,this.authKeys=new lC(this.core,this.logger),this.pairingTopics=new uC(this.core,this.logger),this.requests=new hC(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class d0 extends ex{constructor(t){super(t),this.protocol=Xv,this.version=tw,this.name=h0.name,this.events=new Cr.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.authenticate=async n=>{try{return await this.engine.authenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.formatAuthMessage=n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}},this.approveSessionAuthenticate=async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.rejectSessionAuthenticate=async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.name=t?.name||h0.name,this.metadata=t?.metadata||P8(),this.signConfig=t?.signConfig;const r=typeof t?.logger<"u"&&typeof t?.logger!="string"?t.logger:yi(Kl({level:t?.logger||h0.logger}));this.core=t?.core||new zS(t),this.logger=sn(r,this.name),this.session=new aC(this.core,this.logger),this.proposal=new oC(this.core,this.logger),this.pendingRequest=new cC(this.core,this.logger),this.engine=new sC(this),this.auth=new fC(this.core,this.logger)}static async init(t){const r=new d0(t);return await r.initialize(),r}get context(){return nn(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(),await this.auth.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(t){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(t.message),t}}}var p0={exports:{}};(function(e,t){var r=typeof self<"u"?self:jr,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(p){return p&&DataView.prototype.isPrototypeOf(p)}if(l.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],g=ArrayBuffer.isView||function(p){return p&&h.indexOf(Object.prototype.toString.call(p))>-1};function _(p){if(typeof p!="string"&&(p=String(p)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(p))throw new TypeError("Invalid character in header field name");return p.toLowerCase()}function E(p){return typeof p!="string"&&(p=String(p)),p}function x(p){var b={next:function(){var C=p.shift();return{done:C===void 0,value:C}}};return l.iterable&&(b[Symbol.iterator]=function(){return b}),b}function I(p){this.map={},p instanceof I?p.forEach(function(b,C){this.append(C,b)},this):Array.isArray(p)?p.forEach(function(b){this.append(b[0],b[1])},this):p&&Object.getOwnPropertyNames(p).forEach(function(b){this.append(b,p[b])},this)}I.prototype.append=function(p,b){p=_(p),b=E(b);var C=this.map[p];this.map[p]=C?C+", "+b:b},I.prototype.delete=function(p){delete this.map[_(p)]},I.prototype.get=function(p){return p=_(p),this.has(p)?this.map[p]:null},I.prototype.has=function(p){return this.map.hasOwnProperty(_(p))},I.prototype.set=function(p,b){this.map[_(p)]=E(b)},I.prototype.forEach=function(p,b){for(var C in this.map)this.map.hasOwnProperty(C)&&p.call(b,this.map[C],C,this)},I.prototype.keys=function(){var p=[];return this.forEach(function(b,C){p.push(C)}),x(p)},I.prototype.values=function(){var p=[];return this.forEach(function(b){p.push(b)}),x(p)},I.prototype.entries=function(){var p=[];return this.forEach(function(b,C){p.push([C,b])}),x(p)},l.iterable&&(I.prototype[Symbol.iterator]=I.prototype.entries);function F(p){if(p.bodyUsed)return Promise.reject(new TypeError("Already read"));p.bodyUsed=!0}function W(p){return new Promise(function(b,C){p.onload=function(){b(p.result)},p.onerror=function(){C(p.error)}})}function Y(p){var b=new FileReader,C=W(b);return b.readAsArrayBuffer(p),C}function B(p){var b=new FileReader,C=W(b);return b.readAsText(p),C}function z(p){for(var b=new Uint8Array(p),C=new Array(b.length),O=0;O<b.length;O++)C[O]=String.fromCharCode(b[O]);return C.join("")}function P(p){if(p.slice)return p.slice(0);var b=new Uint8Array(p.byteLength);return b.set(new Uint8Array(p)),b.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(p){this._bodyInit=p,p?typeof p=="string"?this._bodyText=p:l.blob&&Blob.prototype.isPrototypeOf(p)?this._bodyBlob=p:l.formData&&FormData.prototype.isPrototypeOf(p)?this._bodyFormData=p:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(p)?this._bodyText=p.toString():l.arrayBuffer&&l.blob&&f(p)?(this._bodyArrayBuffer=P(p.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(p)||g(p))?this._bodyArrayBuffer=P(p):this._bodyText=p=Object.prototype.toString.call(p):this._bodyText="",this.headers.get("content-type")||(typeof p=="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(p)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var p=F(this);if(p)return p;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?F(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Y)}),this.text=function(){var p=F(this);if(p)return p;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(z(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(et)}),this.json=function(){return this.text().then(JSON.parse)},this}var j=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(p){var b=p.toUpperCase();return j.indexOf(b)>-1?b:p}function $(p,b){b=b||{};var C=b.body;if(p instanceof $){if(p.bodyUsed)throw new TypeError("Already read");this.url=p.url,this.credentials=p.credentials,b.headers||(this.headers=new I(p.headers)),this.method=p.method,this.mode=p.mode,this.signal=p.signal,!C&&p._bodyInit!=null&&(C=p._bodyInit,p.bodyUsed=!0)}else this.url=String(p);if(this.credentials=b.credentials||this.credentials||"same-origin",(b.headers||!this.headers)&&(this.headers=new I(b.headers)),this.method=m(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.signal=b.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&C)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(C)}$.prototype.clone=function(){return new $(this,{body:this._bodyInit})};function et(p){var b=new FormData;return p.trim().split("&").forEach(function(C){if(C){var O=C.split("="),N=O.shift().replace(/\+/g," "),L=O.join("=").replace(/\+/g," ");b.append(decodeURIComponent(N),decodeURIComponent(L))}}),b}function tt(p){var b=new I,C=p.replace(/\r?\n[\t ]+/g," ");return C.split(/\r?\n/).forEach(function(O){var N=O.split(":"),L=N.shift().trim();if(L){var D=N.join(":").trim();b.append(L,D)}}),b}U.call($.prototype);function nt(p,b){b||(b={}),this.type="default",this.status=b.status===void 0?200:b.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in b?b.statusText:"OK",this.headers=new I(b.headers),this.url=b.url||"",this._initBody(p)}U.call(nt.prototype),nt.prototype.clone=function(){return new nt(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new I(this.headers),url:this.url})},nt.error=function(){var p=new nt(null,{status:0,statusText:""});return p.type="error",p};var dt=[301,302,303,307,308];nt.redirect=function(p,b){if(dt.indexOf(b)===-1)throw new RangeError("Invalid status code");return new nt(null,{status:b,headers:{location:p}})},c.DOMException=o.DOMException;try{new c.DOMException}catch{c.DOMException=function(b,C){this.message=b,this.name=C;var O=Error(b);this.stack=O.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function d(p,b){return new Promise(function(C,O){var N=new $(p,b);if(N.signal&&N.signal.aborted)return O(new c.DOMException("Aborted","AbortError"));var L=new XMLHttpRequest;function D(){L.abort()}L.onload=function(){var v={status:L.status,statusText:L.statusText,headers:tt(L.getAllResponseHeaders()||"")};v.url="responseURL"in L?L.responseURL:v.headers.get("X-Request-URL");var T="response"in L?L.response:L.responseText;C(new nt(T,v))},L.onerror=function(){O(new TypeError("Network request failed"))},L.ontimeout=function(){O(new TypeError("Network request failed"))},L.onabort=function(){O(new c.DOMException("Aborted","AbortError"))},L.open(N.method,N.url,!0),N.credentials==="include"?L.withCredentials=!0:N.credentials==="omit"&&(L.withCredentials=!1),"responseType"in L&&l.blob&&(L.responseType="blob"),N.headers.forEach(function(v,T){L.setRequestHeader(T,v)}),N.signal&&(N.signal.addEventListener("abort",D),L.onreadystatechange=function(){L.readyState===4&&N.signal.removeEventListener("abort",D)}),L.send(typeof N._bodyInit>"u"?null:N._bodyInit)})}return d.polyfill=!0,o.fetch||(o.fetch=d,o.Headers=I,o.Request=$,o.Response=nt),c.Headers=I,c.Request=$,c.Response=nt,c.fetch=d,Object.defineProperty(c,"__esModule",{value:!0}),c})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t})(p0,p0.exports);var ow=e3(p0.exports),dC=Object.defineProperty,pC=Object.defineProperties,gC=Object.getOwnPropertyDescriptors,aw=Object.getOwnPropertySymbols,mC=Object.prototype.hasOwnProperty,vC=Object.prototype.propertyIsEnumerable,cw=(e,t,r)=>t in e?dC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lw=(e,t)=>{for(var r in t||(t={}))mC.call(t,r)&&cw(e,r,t[r]);if(aw)for(var r of aw(t))vC.call(t,r)&&cw(e,r,t[r]);return e},uw=(e,t)=>pC(e,gC(t));const wC={Accept:"application/json","Content-Type":"application/json"},yC="POST",hw={headers:wC,method:yC},fw=10;class Wi{constructor(t,r=!1){if(this.url=t,this.disableProviderPing=r,this.events=new Cr.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!pv(t))throw new Error(`Provided URL is not compatible with HTTP connection: ${t}`);this.url=t,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async open(t=this.url){await this.register(t)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(t){this.isAvailable||await this.register();try{const r=zi(t),n=await(await ow(this.url,uw(lw({},hw),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(t.id,r)}}async register(t=this.url){if(!pv(t))throw new Error(`Provided URL is not compatible with HTTP connection: ${t}`);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=t,this.registering=!0;try{if(!this.disableProviderPing){const r=zi({id:1,jsonrpc:"2.0",method:"test",params:[]});await ow(t,uw(lw({},hw),{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(t){if(typeof t.data>"u")return;const r=typeof t.data=="string"?uc(t.data):t.data;this.events.emit("payload",r)}onError(t,r){const n=this.parseError(r),i=n.message||n.toString(),o=Gl(t,i);this.events.emit("payload",o)}parseError(t,r=this.url){return cv(t,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>fw&&this.events.setMaxListeners(fw)}}const dw="error",bC="wss://relay.walletconnect.com",_C="wc",EC="universal_provider",pw=`${_C}@2:${EC}:`,AC="https://rpc.walletconnect.com/v1/",ia="generic",Ii={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var _c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},g0={exports:{}};/**
|
|
43
|
+
***************************************************************************** */var Yd=function(t,e){return Yd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},Yd(t,e)};function uO(t,e){Yd(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Jd=function(){return Jd=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Jd.apply(this,arguments)};function fO(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function hO(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var u=t.length-1;u>=0;u--)(a=t[u])&&(s=(n<3?a(s):n>3?a(e,r,s):a(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s}function lO(t,e){return function(r,i){e(r,i,t)}}function dO(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function pO(t,e,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function u(y){try{p(i.next(y))}catch(_){a(_)}}function d(y){try{p(i.throw(y))}catch(_){a(_)}}function p(y){y.done?s(y.value):n(y.value).then(u,d)}p((i=i.apply(t,e||[])).next())})}function gO(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(p){return function(y){return d([p,y])}}function d(p){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=p[0]&2?n.return:p[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,p[1])).done)return s;switch(n=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,n=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){r.label=p[1];break}if(p[0]===6&&r.label<s[1]){r.label=s[1],s=p;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(p);break}s[2]&&r.ops.pop(),r.trys.pop();continue}p=e.call(t,r)}catch(y){p=[6,y],n=0}finally{i=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function vO(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}function mO(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Qd(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ab(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(u){a={error:u}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s}function bO(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ab(arguments[e]));return t}function yO(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],a=0,u=s.length;a<u;a++,n++)i[n]=s[a];return i}function xu(t){return this instanceof xu?(this.v=t,this):new xu(t)}function wO(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(C){i[C]&&(n[C]=function(I){return new Promise(function(M,B){s.push([C,I,M,B])>1||u(C,I)})})}function u(C,I){try{d(i[C](I))}catch(M){_(s[0][3],M)}}function d(C){C.value instanceof xu?Promise.resolve(C.value.v).then(p,y):_(s[0][2],C)}function p(C){u("next",C)}function y(C){u("throw",C)}function _(C,I){C(I),s.shift(),s.length&&u(s[0][0],s[0][1])}}function _O(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,s){e[n]=t[n]?function(a){return(r=!r)?{value:xu(t[n](a)),done:n==="return"}:s?s(a):a}:s}}function AO(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 Qd=="function"?Qd(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(s){r[s]=t[s]&&function(a){return new Promise(function(u,d){a=t[s](a),n(u,d,a.done,a.value)})}}function n(s,a,u,d){Promise.resolve(d).then(function(p){s({value:p,done:u})},a)}}function EO(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function xO(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 SO(t){return t&&t.__esModule?t:{default:t}}function IO(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function MO(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 CO=Object.freeze({__proto__:null,__extends:uO,get __assign(){return Jd},__rest:fO,__decorate:hO,__param:lO,__metadata:dO,__awaiter:pO,__generator:gO,__createBinding:vO,__exportStar:mO,__values:Qd,__read:Ab,__spread:bO,__spreadArrays:yO,__await:xu,__asyncGenerator:wO,__asyncDelegator:_O,__asyncValues:AO,__makeTemplateObject:EO,__importStar:xO,__importDefault:SO,__classPrivateFieldGet:IO,__classPrivateFieldSet:MO}),DO=o0(CO),$s={},Eb;function PO(){if(Eb)return $s;Eb=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.isBrowserCryptoAvailable=$s.getSubtleCrypto=$s.getBrowerCrypto=void 0;function t(){return Gr?.crypto||Gr?.msCrypto||{}}$s.getBrowerCrypto=t;function e(){const i=t();return i.subtle||i.webkitSubtle}$s.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return $s.isBrowserCryptoAvailable=r,$s}var Ns={},xb;function OO(){if(xb)return Ns;xb=1,Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.isBrowser=Ns.isNode=Ns.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Ns.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Ns.isNode=e;function r(){return!t()&&!e()}return Ns.isBrowser=r,Ns}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=DO;e.__exportStar(PO(),t),e.__exportStar(OO(),t)})(_b);function no(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Ko(t=6){return BigInt(no(t))}function tc(t,e,r){return{id:r||no(),jsonrpc:"2.0",method:t,params:e}}function yh(t,e){return{id:t,jsonrpc:"2.0",result:e}}function wh(t,e,r){return{id:t,jsonrpc:"2.0",error:$O(e,r)}}function $O(t,e){return typeof t>"u"?yb(mb):(typeof t=="string"&&(t=Object.assign(Object.assign({},yb(Gd)),{message:t})),typeof e<"u"&&(t.data=e),aO(t.code)&&(t=cO(t.code)),t)}class NO{}class RO extends NO{constructor(){super()}}class TO extends RO{constructor(e){super()}}const FO="^https?:",LO="^wss?:";function BO(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Sb(t,e){const r=BO(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Ib(t){return Sb(t,FO)}function Mb(t){return Sb(t,LO)}function UO(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Cb(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function Zd(t){return Cb(t)&&"method"in t}function _h(t){return Cb(t)&&(fs(t)||rn(t))}function fs(t){return"result"in t}function rn(t){return"error"in t}class In extends TO{constructor(e){super(e),this.events=new Br.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(tc(e.method,e.params||[],e.id||Ko().toString()),r)}async requestStrict(e,r){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{rn(s)?n(s.error):i(s.result)});try{await this.connection.send(e,r)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),_h(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 kO=()=>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"),jO=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Db=t=>t.split("?")[0],Pb=10,qO=kO();class zO{constructor(e){if(this.url=e,this.events=new Br.exports.EventEmitter,this.registering=!1,!Mb(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=i=>{this.onClose(i),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Is(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!Mb(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((i,n)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),n(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return n(new Error("WebSocket connection is missing or invalid"));i(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,i)=>{const n=new URLSearchParams(e).get("origin"),s=_b.isReactNative()?{headers:{origin:n}}:{rejectUnauthorized:!UO(e)},a=new qO(e,[],s);jO()?a.onerror=u=>{const d=u;i(this.emitError(d.error))}:a.on("error",u=>{i(this.emitError(u))}),a.onopen=()=>{this.onOpen(a),r(a)}})}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"?Ua(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const i=this.parseError(r),n=i.message||i.toString(),s=wh(e,n);this.events.emit("payload",s)}parseError(e,r=this.url){return wb(e,Db(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Pb&&this.events.setMaxListeners(Pb)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${Db(this.url)}`));return this.events.emit("register_error",r),r}}var Xd={exports:{}};(function(t,e){var r=200,i="__lodash_hash_undefined__",n=1,s=2,a=9007199254740991,u="[object Arguments]",d="[object Array]",p="[object AsyncFunction]",y="[object Boolean]",_="[object Date]",C="[object Error]",I="[object Function]",M="[object GeneratorFunction]",B="[object Map]",W="[object Number]",Y="[object Null]",q="[object Object]",V="[object Promise]",U="[object Proxy]",z="[object RegExp]",K="[object Set]",A="[object String]",j="[object Symbol]",ee="[object Undefined]",re="[object WeakMap]",k="[object ArrayBuffer]",w="[object DataView]",f="[object Float32Array]",h="[object Float64Array]",g="[object Int8Array]",E="[object Int16Array]",D="[object Int32Array]",P="[object Uint8Array]",x="[object Uint8ClampedArray]",v="[object Uint16Array]",b="[object Uint32Array]",L=/[\\^$.*+?()[\]{}|]/g,X=/^\[object .+?Constructor\]$/,ce=/^(?:0|[1-9]\d*)$/,O={};O[f]=O[h]=O[g]=O[E]=O[D]=O[P]=O[x]=O[v]=O[b]=!0,O[u]=O[d]=O[k]=O[y]=O[w]=O[_]=O[C]=O[I]=O[B]=O[W]=O[q]=O[z]=O[K]=O[A]=O[re]=!1;var ie=typeof Gr=="object"&&Gr&&Gr.Object===Object&&Gr,N=typeof self=="object"&&self&&self.Object===Object&&self,F=ie||N||Function("return this")(),R=e&&!e.nodeType&&e,l=R&&!0&&t&&!t.nodeType&&t,$=l&&l.exports===R,Z=$&&ie.process,ae=function(){try{return Z&&Z.binding&&Z.binding("util")}catch{}}(),ue=ae&&ae.isTypedArray;function ve(J,ne){for(var be=-1,tt=J==null?0:J.length,er=0,yt=[];++be<tt;){var ar=J[be];ne(ar,be,J)&&(yt[er++]=ar)}return yt}function ge(J,ne){for(var be=-1,tt=ne.length,er=J.length;++be<tt;)J[er+be]=ne[be];return J}function Ee(J,ne){for(var be=-1,tt=J==null?0:J.length;++be<tt;)if(ne(J[be],be,J))return!0;return!1}function Ye(J,ne){for(var be=-1,tt=Array(J);++be<J;)tt[be]=ne(be);return tt}function De(J){return function(ne){return J(ne)}}function Re(J,ne){return J.has(ne)}function xe(J,ne){return J?.[ne]}function ye(J){var ne=-1,be=Array(J.size);return J.forEach(function(tt,er){be[++ne]=[er,tt]}),be}function Me(J,ne){return function(be){return J(ne(be))}}function Pe(J){var ne=-1,be=Array(J.size);return J.forEach(function(tt){be[++ne]=tt}),be}var pe=Array.prototype,Se=Function.prototype,_e=Object.prototype,me=F["__core-js_shared__"],Te=Se.toString,Ce=_e.hasOwnProperty,Ae=function(){var J=/[^.]+$/.exec(me&&me.keys&&me.keys.IE_PROTO||"");return J?"Symbol(src)_1."+J:""}(),ke=_e.toString,qe=RegExp("^"+Te.call(Ce).replace(L,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=$?F.Buffer:void 0,Ke=F.Symbol,ut=F.Uint8Array,Je=_e.propertyIsEnumerable,gt=pe.splice,ht=Ke?Ke.toStringTag:void 0,ot=Object.getOwnPropertySymbols,St=Ie?Ie.isBuffer:void 0,Ct=Me(Object.keys,Object),Oe=zi(F,"DataView"),Ve=zi(F,"Map"),Ze=zi(F,"Promise"),$e=zi(F,"Set"),Qe=zi(F,"WeakMap"),Ge=zi(Object,"create"),Fe=Bs(Oe),nt=Bs(Ve),Xe=Bs(Ze),Le=Bs($e),et=Bs(Qe),rt=Ke?Ke.prototype:void 0,Ne=rt?rt.valueOf:void 0;function We(J){var ne=-1,be=J==null?0:J.length;for(this.clear();++ne<be;){var tt=J[ne];this.set(tt[0],tt[1])}}function st(){this.__data__=Ge?Ge(null):{},this.size=0}function Be(J){var ne=this.has(J)&&delete this.__data__[J];return this.size-=ne?1:0,ne}function qt(J){var ne=this.__data__;if(Ge){var be=ne[J];return be===i?void 0:be}return Ce.call(ne,J)?ne[J]:void 0}function zt(J){var ne=this.__data__;return Ge?ne[J]!==void 0:Ce.call(ne,J)}function lt(J,ne){var be=this.__data__;return this.size+=this.has(J)?0:1,be[J]=Ge&&ne===void 0?i:ne,this}We.prototype.clear=st,We.prototype.delete=Be,We.prototype.get=qt,We.prototype.has=zt,We.prototype.set=lt;function At(J){var ne=-1,be=J==null?0:J.length;for(this.clear();++ne<be;){var tt=J[ne];this.set(tt[0],tt[1])}}function Xr(){this.__data__=[],this.size=0}function ei(J){var ne=this.__data__,be=fa(ne,J);if(be<0)return!1;var tt=ne.length-1;return be==tt?ne.pop():gt.call(ne,be,1),--this.size,!0}function ti(J){var ne=this.__data__,be=fa(ne,J);return be<0?void 0:ne[be][1]}function ri(J){return fa(this.__data__,J)>-1}function ii(J,ne){var be=this.__data__,tt=fa(be,J);return tt<0?(++this.size,be.push([J,ne])):be[tt][1]=ne,this}At.prototype.clear=Xr,At.prototype.delete=ei,At.prototype.get=ti,At.prototype.has=ri,At.prototype.set=ii;function gr(J){var ne=-1,be=J==null?0:J.length;for(this.clear();++ne<be;){var tt=J[ne];this.set(tt[0],tt[1])}}function Ci(){this.size=0,this.__data__={hash:new We,map:new(Ve||At),string:new We}}function Pn(J){var ne=bo(this,J).delete(J);return this.size-=ne?1:0,ne}function Di(J){return bo(this,J).get(J)}function On(J){return bo(this,J).has(J)}function $n(J,ne){var be=bo(this,J),tt=be.size;return be.set(J,ne),this.size+=be.size==tt?0:1,this}gr.prototype.clear=Ci,gr.prototype.delete=Pn,gr.prototype.get=Di,gr.prototype.has=On,gr.prototype.set=$n;function Pi(J){var ne=-1,be=J==null?0:J.length;for(this.__data__=new gr;++ne<be;)this.add(J[ne])}function an(J){return this.__data__.set(J,i),this}function cn(J){return this.__data__.has(J)}Pi.prototype.add=Pi.prototype.push=an,Pi.prototype.has=cn;function Mr(J){var ne=this.__data__=new At(J);this.size=ne.size}function Nn(){this.__data__=new At,this.size=0}function Rn(J){var ne=this.__data__,be=ne.delete(J);return this.size=ne.size,be}function Tn(J){return this.__data__.get(J)}function ua(J){return this.__data__.has(J)}function nl(J,ne){var be=this.__data__;if(be instanceof At){var tt=be.__data__;if(!Ve||tt.length<r-1)return tt.push([J,ne]),this.size=++be.size,this;be=this.__data__=new gr(tt)}return be.set(J,ne),this.size=be.size,this}Mr.prototype.clear=Nn,Mr.prototype.delete=Rn,Mr.prototype.get=Tn,Mr.prototype.has=ua,Mr.prototype.set=nl;function sl(J,ne){var be=Ic(J),tt=!be&&ml(J),er=!be&&!tt&&Qu(J),yt=!be&&!tt&&!er&&wl(J),ar=be||tt||er||yt,Er=ar?Ye(J.length,String):[],Ut=Er.length;for(var tr in J)(ne||Ce.call(J,tr))&&!(ar&&(tr=="length"||er&&(tr=="offset"||tr=="parent")||yt&&(tr=="buffer"||tr=="byteLength"||tr=="byteOffset")||ll(tr,Ut)))&&Er.push(tr);return Er}function fa(J,ne){for(var be=J.length;be--;)if(vl(J[be][0],ne))return be;return-1}function Yu(J,ne,be){var tt=ne(J);return Ic(J)?tt:ge(tt,be(J))}function ha(J){return J==null?J===void 0?ee:Y:ht&&ht in Object(J)?fl(J):Dp(J)}function Ju(J){return da(J)&&ha(J)==u}function la(J,ne,be,tt,er){return J===ne?!0:J==null||ne==null||!da(J)&&!da(ne)?J!==J&&ne!==ne:ol(J,ne,be,tt,la,er)}function ol(J,ne,be,tt,er,yt){var ar=Ic(J),Er=Ic(ne),Ut=ar?d:bs(J),tr=Er?d:bs(ne);Ut=Ut==u?q:Ut,tr=tr==u?q:tr;var wr=Ut==q,Oi=tr==q,xr=Ut==tr;if(xr&&Qu(J)){if(!Qu(ne))return!1;ar=!0,wr=!1}if(xr&&!wr)return yt||(yt=new Mr),ar||wl(J)?xc(J,ne,be,tt,er,yt):Cp(J,ne,Ut,be,tt,er,yt);if(!(be&n)){var cr=wr&&Ce.call(J,"__wrapped__"),di=Oi&&Ce.call(ne,"__wrapped__");if(cr||di){var Fn=cr?J.value():J,un=di?ne.value():ne;return yt||(yt=new Mr),er(Fn,un,be,tt,yt)}}return xr?(yt||(yt=new Mr),ul(J,ne,be,tt,er,yt)):!1}function Mp(J){if(!yl(J)||pl(J))return!1;var ne=Mc(J)?qe:X;return ne.test(Bs(J))}function al(J){return da(J)&&bl(J.length)&&!!O[ha(J)]}function cl(J){if(!gl(J))return Ct(J);var ne=[];for(var be in Object(J))Ce.call(J,be)&&be!="constructor"&&ne.push(be);return ne}function xc(J,ne,be,tt,er,yt){var ar=be&n,Er=J.length,Ut=ne.length;if(Er!=Ut&&!(ar&&Ut>Er))return!1;var tr=yt.get(J);if(tr&&yt.get(ne))return tr==ne;var wr=-1,Oi=!0,xr=be&s?new Pi:void 0;for(yt.set(J,ne),yt.set(ne,J);++wr<Er;){var cr=J[wr],di=ne[wr];if(tt)var Fn=ar?tt(di,cr,wr,ne,J,yt):tt(cr,di,wr,J,ne,yt);if(Fn!==void 0){if(Fn)continue;Oi=!1;break}if(xr){if(!Ee(ne,function(un,ys){if(!Re(xr,ys)&&(cr===un||er(cr,un,be,tt,yt)))return xr.push(ys)})){Oi=!1;break}}else if(!(cr===di||er(cr,di,be,tt,yt))){Oi=!1;break}}return yt.delete(J),yt.delete(ne),Oi}function Cp(J,ne,be,tt,er,yt,ar){switch(be){case w:if(J.byteLength!=ne.byteLength||J.byteOffset!=ne.byteOffset)return!1;J=J.buffer,ne=ne.buffer;case k:return!(J.byteLength!=ne.byteLength||!yt(new ut(J),new ut(ne)));case y:case _:case W:return vl(+J,+ne);case C:return J.name==ne.name&&J.message==ne.message;case z:case A:return J==ne+"";case B:var Er=ye;case K:var Ut=tt&n;if(Er||(Er=Pe),J.size!=ne.size&&!Ut)return!1;var tr=ar.get(J);if(tr)return tr==ne;tt|=s,ar.set(J,ne);var wr=xc(Er(J),Er(ne),tt,er,yt,ar);return ar.delete(J),wr;case j:if(Ne)return Ne.call(J)==Ne.call(ne)}return!1}function ul(J,ne,be,tt,er,yt){var ar=be&n,Er=Sc(J),Ut=Er.length,tr=Sc(ne),wr=tr.length;if(Ut!=wr&&!ar)return!1;for(var Oi=Ut;Oi--;){var xr=Er[Oi];if(!(ar?xr in ne:Ce.call(ne,xr)))return!1}var cr=yt.get(J);if(cr&&yt.get(ne))return cr==ne;var di=!0;yt.set(J,ne),yt.set(ne,J);for(var Fn=ar;++Oi<Ut;){xr=Er[Oi];var un=J[xr],ys=ne[xr];if(tt)var Zu=ar?tt(ys,un,xr,ne,J,yt):tt(un,ys,xr,J,ne,yt);if(!(Zu===void 0?un===ys||er(un,ys,be,tt,yt):Zu)){di=!1;break}Fn||(Fn=xr=="constructor")}if(di&&!Fn){var pa=J.constructor,Fr=ne.constructor;pa!=Fr&&"constructor"in J&&"constructor"in ne&&!(typeof pa=="function"&&pa instanceof pa&&typeof Fr=="function"&&Fr instanceof Fr)&&(di=!1)}return yt.delete(J),yt.delete(ne),di}function Sc(J){return Yu(J,$p,hl)}function bo(J,ne){var be=J.__data__;return dl(ne)?be[typeof ne=="string"?"string":"hash"]:be.map}function zi(J,ne){var be=xe(J,ne);return Mp(be)?be:void 0}function fl(J){var ne=Ce.call(J,ht),be=J[ht];try{J[ht]=void 0;var tt=!0}catch{}var er=ke.call(J);return tt&&(ne?J[ht]=be:delete J[ht]),er}var hl=ot?function(J){return J==null?[]:(J=Object(J),ve(ot(J),function(ne){return Je.call(J,ne)}))}:Xt,bs=ha;(Oe&&bs(new Oe(new ArrayBuffer(1)))!=w||Ve&&bs(new Ve)!=B||Ze&&bs(Ze.resolve())!=V||$e&&bs(new $e)!=K||Qe&&bs(new Qe)!=re)&&(bs=function(J){var ne=ha(J),be=ne==q?J.constructor:void 0,tt=be?Bs(be):"";if(tt)switch(tt){case Fe:return w;case nt:return B;case Xe:return V;case Le:return K;case et:return re}return ne});function ll(J,ne){return ne=ne??a,!!ne&&(typeof J=="number"||ce.test(J))&&J>-1&&J%1==0&&J<ne}function dl(J){var ne=typeof J;return ne=="string"||ne=="number"||ne=="symbol"||ne=="boolean"?J!=="__proto__":J===null}function pl(J){return!!Ae&&Ae in J}function gl(J){var ne=J&&J.constructor,be=typeof ne=="function"&&ne.prototype||_e;return J===be}function Dp(J){return ke.call(J)}function Bs(J){if(J!=null){try{return Te.call(J)}catch{}try{return J+""}catch{}}return""}function vl(J,ne){return J===ne||J!==J&&ne!==ne}var ml=Ju(function(){return arguments}())?Ju:function(J){return da(J)&&Ce.call(J,"callee")&&!Je.call(J,"callee")},Ic=Array.isArray;function Pp(J){return J!=null&&bl(J.length)&&!Mc(J)}var Qu=St||Zt;function Op(J,ne){return la(J,ne)}function Mc(J){if(!yl(J))return!1;var ne=ha(J);return ne==I||ne==M||ne==p||ne==U}function bl(J){return typeof J=="number"&&J>-1&&J%1==0&&J<=a}function yl(J){var ne=typeof J;return J!=null&&(ne=="object"||ne=="function")}function da(J){return J!=null&&typeof J=="object"}var wl=ue?De(ue):al;function $p(J){return Pp(J)?sl(J):cl(J)}function Xt(){return[]}function Zt(){return!1}t.exports=Op})(Xd,Xd.exports);var HO=Xd.exports,KO=Object.defineProperty,Ob=Object.getOwnPropertySymbols,WO=Object.prototype.hasOwnProperty,VO=Object.prototype.propertyIsEnumerable,$b=(t,e,r)=>e in t?KO(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,hi=(t,e)=>{for(var r in e||(e={}))WO.call(e,r)&&$b(t,r,e[r]);if(Ob)for(var r of Ob(e))VO.call(e,r)&&$b(t,r,e[r]);return t};function GO(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=n}var u=t.length,d=t.charAt(0),p=Math.log(u)/Math.log(256),y=Math.log(256)/Math.log(u);function _(M){if(M instanceof Uint8Array||(ArrayBuffer.isView(M)?M=new Uint8Array(M.buffer,M.byteOffset,M.byteLength):Array.isArray(M)&&(M=Uint8Array.from(M))),!(M instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(M.length===0)return"";for(var B=0,W=0,Y=0,q=M.length;Y!==q&&M[Y]===0;)Y++,B++;for(var V=(q-Y)*y+1>>>0,U=new Uint8Array(V);Y!==q;){for(var z=M[Y],K=0,A=V-1;(z!==0||K<W)&&A!==-1;A--,K++)z+=256*U[A]>>>0,U[A]=z%u>>>0,z=z/u>>>0;if(z!==0)throw new Error("Non-zero carry");W=K,Y++}for(var j=V-W;j!==V&&U[j]===0;)j++;for(var ee=d.repeat(B);j<V;++j)ee+=t.charAt(U[j]);return ee}function C(M){if(typeof M!="string")throw new TypeError("Expected String");if(M.length===0)return new Uint8Array;var B=0;if(M[B]!==" "){for(var W=0,Y=0;M[B]===d;)W++,B++;for(var q=(M.length-B)*p+1>>>0,V=new Uint8Array(q);M[B];){var U=r[M.charCodeAt(B)];if(U===255)return;for(var z=0,K=q-1;(U!==0||z<Y)&&K!==-1;K--,z++)U+=u*V[K]>>>0,V[K]=U%256>>>0,U=U/256>>>0;if(U!==0)throw new Error("Non-zero carry");Y=z,B++}if(M[B]!==" "){for(var A=q-Y;A!==q&&V[A]===0;)A++;for(var j=new Uint8Array(W+(q-A)),ee=W;A!==q;)j[ee++]=V[A++];return j}}}function I(M){var B=C(M);if(B)return B;throw new Error(`Non-${e} character`)}return{encode:_,decodeUnsafe:C,decode:I}}var YO=GO,JO=YO;const Nb=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")},QO=t=>new TextEncoder().encode(t),ZO=t=>new TextDecoder().decode(t);class XO{constructor(e,r,i){this.name=e,this.prefix=r,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class e${constructor(e,r,i){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=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Rb(this,e)}}class t${constructor(e){this.decoders=e}or(e){return Rb(this,e)}decode(e){const r=e[0],i=this.decoders[r];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Rb=(t,e)=>new t$(hi(hi({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class r${constructor(e,r,i,n){this.name=e,this.prefix=r,this.baseEncode=i,this.baseDecode=n,this.encoder=new XO(e,r,i),this.decoder=new e$(e,r,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Ah=({name:t,prefix:e,encode:r,decode:i})=>new r$(t,e,r,i),Su=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=JO(r,e);return Ah({prefix:t,name:e,encode:i,decode:s=>Nb(n(s))})},i$=(t,e,r,i)=>{const n={};for(let y=0;y<e.length;++y)n[e[y]]=y;let s=t.length;for(;t[s-1]==="=";)--s;const a=new Uint8Array(s*r/8|0);let u=0,d=0,p=0;for(let y=0;y<s;++y){const _=n[t[y]];if(_===void 0)throw new SyntaxError(`Non-${i} character`);d=d<<r|_,u+=r,u>=8&&(u-=8,a[p++]=255&d>>u)}if(u>=r||255&d<<8-u)throw new SyntaxError("Unexpected end of data");return a},n$=(t,e,r)=>{const i=e[e.length-1]==="=",n=(1<<r)-1;let s="",a=0,u=0;for(let d=0;d<t.length;++d)for(u=u<<8|t[d],a+=8;a>r;)a-=r,s+=e[n&u>>a];if(a&&(s+=e[n&u<<r-a]),i)for(;s.length*r&7;)s+="=";return s},Kr=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>Ah({prefix:e,name:t,encode(n){return n$(n,i,r)},decode(n){return i$(n,i,r,t)}}),s$=Ah({prefix:"\0",name:"identity",encode:t=>ZO(t),decode:t=>QO(t)});var o$=Object.freeze({__proto__:null,identity:s$});const a$=Kr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var c$=Object.freeze({__proto__:null,base2:a$});const u$=Kr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var f$=Object.freeze({__proto__:null,base8:u$});const h$=Su({prefix:"9",name:"base10",alphabet:"0123456789"});var l$=Object.freeze({__proto__:null,base10:h$});const d$=Kr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),p$=Kr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var g$=Object.freeze({__proto__:null,base16:d$,base16upper:p$});const v$=Kr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),m$=Kr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),b$=Kr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),y$=Kr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),w$=Kr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),_$=Kr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),A$=Kr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),E$=Kr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),x$=Kr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var S$=Object.freeze({__proto__:null,base32:v$,base32upper:m$,base32pad:b$,base32padupper:y$,base32hex:w$,base32hexupper:_$,base32hexpad:A$,base32hexpadupper:E$,base32z:x$});const I$=Su({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),M$=Su({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var C$=Object.freeze({__proto__:null,base36:I$,base36upper:M$});const D$=Su({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),P$=Su({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var O$=Object.freeze({__proto__:null,base58btc:D$,base58flickr:P$});const $$=Kr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),N$=Kr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),R$=Kr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),T$=Kr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var F$=Object.freeze({__proto__:null,base64:$$,base64pad:N$,base64url:R$,base64urlpad:T$});const Tb=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}"),L$=Tb.reduce((t,e,r)=>(t[r]=e,t),[]),B$=Tb.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function U$(t){return t.reduce((e,r)=>(e+=L$[r],e),"")}function k$(t){const e=[];for(const r of t){const i=B$[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(i)}return new Uint8Array(e)}const j$=Ah({prefix:"\u{1F680}",name:"base256emoji",encode:U$,decode:k$});var q$=Object.freeze({__proto__:null,base256emoji:j$}),z$=Lb,Fb=128,H$=127,K$=~H$,W$=Math.pow(2,31);function Lb(t,e,r){e=e||[],r=r||0;for(var i=r;t>=W$;)e[r++]=t&255|Fb,t/=128;for(;t&K$;)e[r++]=t&255|Fb,t>>>=7;return e[r]=t|0,Lb.bytes=r-i+1,e}var V$=e1,G$=128,Bb=127;function e1(t,i){var r=0,i=i||0,n=0,s=i,a,u=t.length;do{if(s>=u)throw e1.bytes=0,new RangeError("Could not decode varint");a=t[s++],r+=n<28?(a&Bb)<<n:(a&Bb)*Math.pow(2,n),n+=7}while(a>=G$);return e1.bytes=s-i,r}var Y$=Math.pow(2,7),J$=Math.pow(2,14),Q$=Math.pow(2,21),Z$=Math.pow(2,28),X$=Math.pow(2,35),eN=Math.pow(2,42),tN=Math.pow(2,49),rN=Math.pow(2,56),iN=Math.pow(2,63),nN=function(t){return t<Y$?1:t<J$?2:t<Q$?3:t<Z$?4:t<X$?5:t<eN?6:t<tN?7:t<rN?8:t<iN?9:10},sN={encode:z$,decode:V$,encodingLength:nN},Ub=sN;const kb=(t,e,r=0)=>(Ub.encode(t,e,r),e),jb=t=>Ub.encodingLength(t),t1=(t,e)=>{const r=e.byteLength,i=jb(t),n=i+jb(r),s=new Uint8Array(n+r);return kb(t,s,0),kb(r,s,i),s.set(e,n),new oN(t,r,e,s)};class oN{constructor(e,r,i,n){this.code=e,this.size=r,this.digest=i,this.bytes=n}}const qb=({name:t,code:e,encode:r})=>new aN(t,e,r);class aN{constructor(e,r,i){this.name=e,this.code=r,this.encode=i}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?t1(this.code,r):r.then(i=>t1(this.code,i))}else throw Error("Unknown type, must be binary type")}}const zb=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),cN=qb({name:"sha2-256",code:18,encode:zb("SHA-256")}),uN=qb({name:"sha2-512",code:19,encode:zb("SHA-512")});var fN=Object.freeze({__proto__:null,sha256:cN,sha512:uN});const Hb=0,hN="identity",Kb=Nb;var lN=Object.freeze({__proto__:null,identity:{code:Hb,name:hN,encode:Kb,digest:t=>t1(Hb,Kb(t))}});new TextEncoder,new TextDecoder;const Wb=hi(hi(hi(hi(hi(hi(hi(hi(hi(hi({},o$),c$),f$),l$),g$),S$),C$),O$),F$),q$);hi(hi({},fN),lN);function dN(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Vb(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const Gb=Vb("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),r1=Vb("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=dN(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),pN=hi({utf8:Gb,"utf-8":Gb,hex:Wb.base16,latin1:r1,ascii:r1,binary:r1},Wb);function gN(t,e="utf8"){const r=pN[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,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}const Yb="wc",Jb=2,i1="core",Rs=`${Yb}@2:${i1}:`,vN={name:i1,logger:"error"},mN={database:":memory:"},bN="crypto",Qb="client_ed25519_seed",yN=He.ONE_DAY,wN="keychain",_N="0.3",AN="messages",EN="0.3",xN=He.SIX_HOURS,SN="publisher",Zb="irn",IN="error",Xb="wss://relay.walletconnect.org",MN="relayer",Si={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"},CN="_subscription",nn={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},DN=.1,PN="2.15.0",ON=1e4,$N="0.3",NN="WALLETCONNECT_CLIENT_ID",hs={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},RN="subscription",TN="0.3",FN=He.FIVE_SECONDS*1e3,LN="pairing",BN="0.3",Iu={wc_pairingDelete:{req:{ttl:He.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:He.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:He.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:He.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:He.ONE_DAY,prompt:!1,tag:0},res:{ttl:He.ONE_DAY,prompt:!1,tag:0}}},rc={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Mn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},UN="history",kN="0.3",jN="expirer",sn={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},qN="0.3",zN="verify-api",HN="https://verify.walletconnect.com",e6="https://verify.walletconnect.org",Mu=e6,KN=`${Mu}/v2`,WN=[HN,e6],VN="echo",GN="https://echo.walletconnect.com";class YN{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=wN,this.version=_N,this.initialized=!1,this.storagePrefix=Rs,this.init=async()=>{if(!this.initialized){const i=await this.getKeyChain();typeof i<"u"&&(this.keychain=i),this.initialized=!0}},this.has=i=>(this.isInitialized(),this.keychain.has(i)),this.set=async(i,n)=>{this.isInitialized(),this.keychain.set(i,n),await this.persist()},this.get=i=>{this.isInitialized();const n=this.keychain.get(i);if(typeof n>"u"){const{message:s}=Ue("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(s)}return n},this.del=async i=>{this.isInitialized(),this.keychain.delete(i),await this.persist()},this.core=e,this.logger=xi(r,this.name)}get context(){return Ei(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Fv(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Lv(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=Ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class JN{constructor(e,r,i){this.core=e,this.logger=r,this.name=bN,this.randomSessionIdentifier=Dd(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=n=>(this.isInitialized(),this.keychain.has(n)),this.getClientId=async()=>{this.isInitialized();const n=await this.getClientSeed(),s=pb(n);return db(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const n=bC();return this.setPrivateKey(n.publicKey,n.privateKey)},this.signJWT=async n=>{this.isInitialized();const s=await this.getClientSeed(),a=pb(s),u=this.randomSessionIdentifier;return await ZP(u,n,yN,a)},this.generateSharedKey=(n,s,a)=>{this.isInitialized();const u=this.getPrivateKey(n),d=yC(u,s);return this.setSymKey(d,a)},this.setSymKey=async(n,s)=>{this.isInitialized();const a=s||oh(n);return await this.keychain.set(a,n),a},this.deleteKeyPair=async n=>{this.isInitialized(),await this.keychain.del(n)},this.deleteSymKey=async n=>{this.isInitialized(),await this.keychain.del(n)},this.encode=async(n,s,a)=>{this.isInitialized();const u=Om(a),d=Is(s);if($m(u)){const C=u.senderPublicKey,I=u.receiverPublicKey;n=await this.generateSharedKey(C,I)}const p=this.getSymKey(n),{type:y,senderPublicKey:_}=u;return _C({type:y,symKey:p,message:d,senderPublicKey:_})},this.decode=async(n,s,a)=>{this.isInitialized();const u=xC(s,a);if($m(u)){const d=u.receiverPublicKey,p=u.senderPublicKey;n=await this.generateSharedKey(d,p)}try{const d=this.getSymKey(n),p=AC({symKey:d,encoded:s});return Ua(p)}catch(d){this.logger.error(`Failed to decode message from topic: '${n}', clientId: '${await this.getClientId()}'`),this.logger.error(d)}},this.getPayloadType=n=>{const s=ah(n);return du(s.type)},this.getPayloadSenderPublicKey=n=>{const s=ah(n);return s.senderPublicKey?tO(s.senderPublicKey,ui):void 0},this.core=e,this.logger=xi(r,this.name),this.keychain=i||new YN(this.core,this.logger)}get context(){return Ei(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(Qb)}catch{e=Dd(),await this.keychain.set(Qb,e)}return gN(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=Ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class QN extends CP{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=AN,this.version=EN,this.initialized=!1,this.storagePrefix=Rs,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const i=await this.getRelayerMessages();typeof i<"u"&&(this.messages=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(i){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(i)}finally{this.initialized=!0}}},this.set=async(i,n)=>{this.isInitialized();const s=io(n);let a=this.messages.get(i);return typeof a>"u"&&(a={}),typeof a[s]<"u"||(a[s]=n,this.messages.set(i,a),await this.persist()),s},this.get=i=>{this.isInitialized();let n=this.messages.get(i);return typeof n>"u"&&(n={}),n},this.has=(i,n)=>{this.isInitialized();const s=this.get(i),a=io(n);return typeof s[a]<"u"},this.del=async i=>{this.isInitialized(),this.messages.delete(i),await this.persist()},this.logger=xi(e,this.name),this.core=r}get context(){return Ei(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Fv(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Lv(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=Ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class ZN extends DP{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new Br.exports.EventEmitter,this.name=SN,this.queue=new Map,this.publishTimeout=He.toMiliseconds(He.ONE_MINUTE),this.failedPublishTimeout=He.toMiliseconds(He.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(i,n,s)=>{var a;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:i,message:n,opts:s}});const u=s?.ttl||xN,d=Pd(s),p=s?.prompt||!1,y=s?.tag||0,_=s?.id||Ko().toString(),C={topic:i,message:n,opts:{ttl:u,relay:d,prompt:p,tag:y,id:_,attestation:s?.attestation}},I=`Failed to publish payload, please try again. id:${_} tag:${y}`,M=Date.now();let B,W=1;try{for(;B===void 0;){if(Date.now()-M>this.publishTimeout)throw new Error(I);this.logger.trace({id:_,attempts:W},`publisher.publish - attempt ${W}`),B=await await ka(this.rpcPublish(i,n,u,d,p,y,_,s?.attestation).catch(Y=>this.logger.warn(Y)),this.publishTimeout,I),W++,B||await new Promise(Y=>setTimeout(Y,this.failedPublishTimeout))}this.relayer.events.emit(Si.publish,C),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:_,topic:i,message:n,opts:s}})}catch(Y){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(Y),(a=s?.internal)!=null&&a.throwOnFailedPublish)throw Y;this.queue.set(_,C)}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.relayer=e,this.logger=xi(r,this.name),this.registerEventListeners()}get context(){return Ei(this.logger)}rpcPublish(e,r,i,n,s,a,u,d){var p,y,_,C;const I={method:pu(n.protocol).publish,params:{topic:e,message:r,ttl:i,prompt:s,tag:a,attestation:d},id:u};return fi((p=I.params)==null?void 0:p.prompt)&&((y=I.params)==null||delete y.prompt),fi((_=I.params)==null?void 0:_.tag)&&((C=I.params)==null||delete C.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:I}),this.relayer.request(I)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:i,opts:n}=e;await this.publish(r,i,n)})}registerEventListeners(){this.relayer.core.heartbeat.on(yu.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Si.connection_stalled);return}this.checkQueue()}),this.relayer.on(Si.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class XN{constructor(){this.map=new Map,this.set=(e,r)=>{const i=this.get(e);this.exists(e,r)||this.map.set(e,[...i,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 i=this.get(e);if(!this.exists(e,r))return;const n=i.filter(s=>s!==r);if(!n.length){this.map.delete(e);return}this.map.set(e,n)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var eR=Object.defineProperty,tR=Object.defineProperties,rR=Object.getOwnPropertyDescriptors,t6=Object.getOwnPropertySymbols,iR=Object.prototype.hasOwnProperty,nR=Object.prototype.propertyIsEnumerable,r6=(t,e,r)=>e in t?eR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Cu=(t,e)=>{for(var r in e||(e={}))iR.call(e,r)&&r6(t,r,e[r]);if(t6)for(var r of t6(e))nR.call(e,r)&&r6(t,r,e[r]);return t},n1=(t,e)=>tR(t,rR(e));class sR extends $P{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new XN,this.events=new Br.exports.EventEmitter,this.name=RN,this.version=TN,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Rs,this.subscribeTimeout=He.toMiliseconds(He.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(i,n)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}});try{const s=Pd(n),a={topic:i,relay:s};this.pending.set(i,a);const u=await this.rpcSubscribe(i,s);return typeof u=="string"&&(this.onSubscribe(u,a),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}})),u}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(i,n)=>{await this.restartToComplete(),this.isInitialized(),typeof n?.id<"u"?await this.unsubscribeById(i,n.id,n):await this.unsubscribeByTopic(i,n)},this.isSubscribed=async i=>{if(this.topics.includes(i))return!0;const n=`${this.pendingSubscriptionWatchLabel}_${i}`;return await new Promise((s,a)=>{const u=new He.Watch;u.start(n);const d=setInterval(()=>{!this.pending.has(i)&&this.topics.includes(i)&&(clearInterval(d),u.stop(n),s(!0)),u.elapsed(n)>=FN&&(clearInterval(d),u.stop(n),a(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=xi(r,this.name),this.clientId=""}get context(){return Ei(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 i=!1;try{i=this.getSubscription(e).topic===r}catch{}return i}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const i=this.topicMap.get(e);await Promise.all(i.map(async n=>await this.unsubscribeById(e,n,r)))}async unsubscribeById(e,r,i){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:i}});try{const n=Pd(i);await this.rpcUnsubscribe(e,r,n);const s=Yt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:i}})}catch(n){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(n),n}}async rpcSubscribe(e,r){const i={method:pu(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await ka(this.relayer.request(i).catch(n=>this.logger.warn(n)),this.subscribeTimeout)?io(e+this.clientId):null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Si.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,i={method:pu(r.protocol).batchSubscribe,params:{topics:e.map(n=>n.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await ka(this.relayer.request(i).catch(n=>this.logger.warn(n)),this.subscribeTimeout)}catch{this.relayer.events.emit(Si.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,i={method:pu(r.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});let n;try{n=await await ka(this.relayer.request(i).catch(s=>this.logger.warn(s)),this.subscribeTimeout)}catch{this.relayer.events.emit(Si.connection_stalled)}return n}rpcUnsubscribe(e,r,i){const n={method:pu(i.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,r){this.setSubscription(e,n1(Cu({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,Cu({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,i){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,i),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){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,Cu({},r)),this.topicMap.set(r.topic,e),this.events.emit(hs.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:i}=Ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const i=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(i.topic,e),this.events.emit(hs.deleted,n1(Cu({},i),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(hs.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<e;r++){const i=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchFetchMessages(i),await this.batchSubscribe(i)}}this.events.emit(hs.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=Ue("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);as(r)&&this.onBatchSubscribe(r.map((i,n)=>n1(Cu({},e[n]),{id:i})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(r.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(yu.pulse,async()=>{await this.checkPending()}),this.events.on(hs.created,async e=>{const r=hs.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(hs.deleted,async e=>{const r=hs.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}=Ue("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 oR=Object.defineProperty,i6=Object.getOwnPropertySymbols,aR=Object.prototype.hasOwnProperty,cR=Object.prototype.propertyIsEnumerable,n6=(t,e,r)=>e in t?oR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,uR=(t,e)=>{for(var r in e||(e={}))aR.call(e,r)&&n6(t,r,e[r]);if(i6)for(var r of i6(e))cR.call(e,r)&&n6(t,r,e[r]);return t};class fR extends PP{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Br.exports.EventEmitter,this.name=MN,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=He.toMiliseconds(He.THIRTY_SECONDS+He.ONE_SECOND),this.request=async r=>{var i,n;this.logger.debug("Publishing Request Payload");const s=r.id||Ko().toString();await this.toEstablishConnection();try{const a=this.provider.request(r);this.requestsInFlight.set(s,{promise:a,request:r}),this.logger.trace({id:s,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - attempt to publish...");const u=await new Promise(async(d,p)=>{const y=()=>{p(new Error(`relayer.request - publish interrupted, id: ${s}`))};this.provider.on(nn.disconnect,y);const _=await a;this.provider.off(nn.disconnect,y),d(_)});return this.logger.trace({id:s,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - published"),u}catch(a){throw this.logger.debug(`Failed to Publish Request: ${s}`),a}finally{this.requestsInFlight.delete(s)}},this.resetPingTimeout=()=>{if(Xc())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,i,n;(n=(i=(r=this.provider)==null?void 0:r.connection)==null?void 0:i.socket)==null||n.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(Si.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Si.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(nn.payload,this.onPayloadHandler),this.provider.on(nn.connect,this.onConnectHandler),this.provider.on(nn.disconnect,this.onDisconnectHandler),this.provider.on(nn.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?xi(e.logger,this.name):cs(mh({level:e.logger||IN})),this.messages=new QN(this.logger,e.core),this.subscriber=new sR(this,this.logger),this.publisher=new ZN(this,this.logger),this.relayUrl=e?.relayUrl||Xb,this.projectId=e.projectId,this.bundleId=aE(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),await this.transportOpen(),this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&this.subscriber.pending.size===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},ON)}get context(){return Ei(this.logger)}get connected(){var e,r,i;return((i=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:i.readyState)===1}get connecting(){var e,r,i;return((i=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:i.readyState)===0}async publish(e,r,i){this.isInitialized(),await this.publisher.publish(e,r,i),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){var i;this.isInitialized();let n=((i=this.subscriber.topicMap.get(e))==null?void 0:i[0])||"",s;const a=u=>{u.topic===e&&(this.subscriber.off(hs.created,a),s())};return await Promise.all([new Promise(u=>{s=u,this.subscriber.on(hs.created,a)}),new Promise(async u=>{n=await this.subscriber.subscribe(e,r)||n,u()})]),n}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 transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await ka(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(r,i)=>{const n=()=>{this.provider.off(nn.disconnect,n),i(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(nn.disconnect,n),await ka(this.provider.connect(),He.toMiliseconds(He.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(s=>{i(s)}),this.subscriber.start().catch(s=>{this.logger.error(s),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){this.logger.error(r);const i=r;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(i.message))throw r}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Hm())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((i,n)=>i.publishedAt-n.publishedAt);this.logger.trace(`Batch of ${r.length} message events sorted`);for(const i of r)try{await this.onMessageEvent(i)}catch(n){this.logger.warn(n)}this.logger.trace(`Batch of ${r.length} message events processed`)}startPingTimeout(){var e,r,i,n,s;if(Xc())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((s=(n=(i=this.provider)==null?void 0:i.connection)==null?void 0:n.socket)==null||s.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(a){this.logger.warn(a)}}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 In(new zO(dE({sdkVersion:PN,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:i}=e;await this.messages.set(r,i)}async shouldIgnoreMessageEvent(e){const{topic:r,message:i}=e;if(!i||i.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${i}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const n=this.messages.has(r,i);return n&&this.logger.debug(`Ignoring duplicate message: ${i}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Zd(e)){if(!e.method.endsWith(CN))return;const r=e.params,{topic:i,message:n,publishedAt:s,attestation:a}=r.data,u={topic:i,message:n,publishedAt:s,attestation:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(uR({type:"event",event:r.id},u)),this.events.emit(r.id,u),await this.acknowledgePayload(e),await this.onMessageEvent(u)}else _h(e)&&this.events.emit(Si.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Si.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=yh(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(nn.payload,this.onPayloadHandler),this.provider.off(nn.connect,this.onConnectHandler),this.provider.off(nn.disconnect,this.onDisconnectHandler),this.provider.off(nn.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await Hm();bD(async r=>{e!==r&&(e=r,r?await this.restartTransport().catch(i=>this.logger.error(i)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(Si.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},He.toMiliseconds(DN))}isInitialized(){if(!this.initialized){const{message:e}=Ue("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var hR=Object.defineProperty,s6=Object.getOwnPropertySymbols,lR=Object.prototype.hasOwnProperty,dR=Object.prototype.propertyIsEnumerable,o6=(t,e,r)=>e in t?hR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,a6=(t,e)=>{for(var r in e||(e={}))lR.call(e,r)&&o6(t,r,e[r]);if(s6)for(var r of s6(e))dR.call(e,r)&&o6(t,r,e[r]);return t};class Wo extends OP{constructor(e,r,i,n=Rs,s=void 0){super(e,r,i,n),this.core=e,this.logger=r,this.name=i,this.map=new Map,this.version=$N,this.cached=[],this.initialized=!1,this.storagePrefix=Rs,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(a=>{this.getKey&&a!==null&&!fi(a)?this.map.set(this.getKey(a),a):YC(a)?this.map.set(a.id,a):JC(a)&&this.map.set(a.topic,a)}),this.cached=[],this.initialized=!0)},this.set=async(a,u)=>{this.isInitialized(),this.map.has(a)?await this.update(a,u):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:a,value:u}),this.map.set(a,u),await this.persist())},this.get=a=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:a}),this.getData(a)),this.getAll=a=>(this.isInitialized(),a?this.values.filter(u=>Object.keys(a).every(d=>HO(u[d],a[d]))):this.values),this.update=async(a,u)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:a,update:u});const d=a6(a6({},this.getData(a)),u);this.map.set(a,d),await this.persist()},this.delete=async(a,u)=>{this.isInitialized(),this.map.has(a)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:a,reason:u}),this.map.delete(a),this.addToRecentlyDeleted(a),await this.persist())},this.logger=xi(r,this.name),this.storagePrefix=n,this.getKey=s}get context(){return Ei(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())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}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){if(this.recentlyDeleted.includes(e)){const{message:n}=Ue("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}const{message:i}=Ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}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}=Ue("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}=Ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class pR{constructor(e,r){this.core=e,this.logger=r,this.name=LN,this.version=BN,this.events=new Br.exports,this.initialized=!1,this.storagePrefix=Rs,this.ignoredPayloadTypes=[Os],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:i})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...i])]},this.create=async i=>{this.isInitialized();const n=Dd(),s=await this.core.crypto.setSymKey(n),a=jr(He.FIVE_MINUTES),u={protocol:Zb},d={topic:s,expiry:a,relay:u,active:!1},p=UC({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:n,relay:u,expiryTimestamp:a,methods:i?.methods});return this.core.expirer.set(s,a),await this.pairings.set(s,d),await this.core.relayer.subscribe(s),{topic:s,uri:p}},this.pair=async i=>{this.isInitialized(),this.isValidPair(i);const{topic:n,symKey:s,relay:a,expiryTimestamp:u,methods:d}=Fm(i.uri);let p;if(this.pairings.keys.includes(n)&&(p=this.pairings.get(n),p.active))throw new Error(`Pairing already exists: ${n}. Please try again with a new connection URI.`);const y=u||jr(He.FIVE_MINUTES),_={topic:n,relay:a,expiry:y,active:!1,methods:d};return this.core.expirer.set(n,y),await this.pairings.set(n,_),i.activatePairing&&await this.activate({topic:n}),this.events.emit(rc.create,_),this.core.crypto.keychain.has(n)||await this.core.crypto.setSymKey(s,n),await this.core.relayer.subscribe(n,{relay:a}),_},this.activate=async({topic:i})=>{this.isInitialized();const n=jr(He.THIRTY_DAYS);this.core.expirer.set(i,n),await this.pairings.update(i,{active:!0,expiry:n})},this.ping=async i=>{this.isInitialized(),await this.isValidPing(i);const{topic:n}=i;if(this.pairings.keys.includes(n)){const s=await this.sendRequest(n,"wc_pairingPing",{}),{done:a,resolve:u,reject:d}=Uo();this.events.once($t("pairing_ping",s),({error:p})=>{p?d(p):u()}),await a()}},this.updateExpiry=async({topic:i,expiry:n})=>{this.isInitialized(),await this.pairings.update(i,{expiry:n})},this.updateMetadata=async({topic:i,metadata:n})=>{this.isInitialized(),await this.pairings.update(i,{peerMetadata:n})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:n}=i;this.pairings.keys.includes(n)&&(await this.sendRequest(n,"wc_pairingDelete",Yt("USER_DISCONNECTED")),await this.deletePairing(n))},this.sendRequest=async(i,n,s)=>{const a=tc(n,s),u=await this.core.crypto.encode(i,a),d=Iu[n].req;return this.core.history.set(i,a),this.core.relayer.publish(i,u,d),a.id},this.sendResult=async(i,n,s)=>{const a=yh(i,s),u=await this.core.crypto.encode(n,a),d=await this.core.history.get(n,i),p=Iu[d.request.method].res;await this.core.relayer.publish(n,u,p),await this.core.history.resolve(a)},this.sendError=async(i,n,s)=>{const a=wh(i,s),u=await this.core.crypto.encode(n,a),d=await this.core.history.get(n,i),p=Iu[d.request.method]?Iu[d.request.method].res:Iu.unregistered_method.res;await this.core.relayer.publish(n,u,p),await this.core.history.resolve(a)},this.deletePairing=async(i,n)=>{await this.core.relayer.unsubscribe(i),await Promise.all([this.pairings.delete(i,Yt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(i),n?Promise.resolve():this.core.expirer.del(i)])},this.cleanup=async()=>{const i=this.pairings.getAll().filter(n=>Xs(n.expiry));await Promise.all(i.map(n=>this.deletePairing(n.topic)))},this.onRelayEventRequest=i=>{const{topic:n,payload:s}=i;switch(s.method){case"wc_pairingPing":return this.onPairingPingRequest(n,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(n,s);default:return this.onUnknownRpcMethodRequest(n,s)}},this.onRelayEventResponse=async i=>{const{topic:n,payload:s}=i,a=(await this.core.history.get(n,s.id)).request.method;switch(a){case"wc_pairingPing":return this.onPairingPingResponse(n,s);default:return this.onUnknownRpcMethodResponse(a)}},this.onPairingPingRequest=async(i,n)=>{const{id:s}=n;try{this.isValidPing({topic:i}),await this.sendResult(s,i,!0),this.events.emit(rc.ping,{id:s,topic:i})}catch(a){await this.sendError(s,i,a),this.logger.error(a)}},this.onPairingPingResponse=(i,n)=>{const{id:s}=n;setTimeout(()=>{fs(n)?this.events.emit($t("pairing_ping",s),{}):rn(n)&&this.events.emit($t("pairing_ping",s),{error:n.error})},500)},this.onPairingDeleteRequest=async(i,n)=>{const{id:s}=n;try{this.isValidDisconnect({topic:i}),await this.deletePairing(i),this.events.emit(rc.delete,{id:s,topic:i})}catch(a){await this.sendError(s,i,a),this.logger.error(a)}},this.onUnknownRpcMethodRequest=async(i,n)=>{const{id:s,method:a}=n;try{if(this.registeredMethods.includes(a))return;const u=Yt("WC_METHOD_UNSUPPORTED",a);await this.sendError(s,i,u),this.logger.error(u)}catch(u){await this.sendError(s,i,u),this.logger.error(u)}},this.onUnknownRpcMethodResponse=i=>{this.registeredMethods.includes(i)||this.logger.error(Yt("WC_METHOD_UNSUPPORTED",i))},this.isValidPair=i=>{var n;if(!_i(i)){const{message:a}=Ue("MISSING_OR_INVALID",`pair() params: ${i}`);throw new Error(a)}if(!GC(i.uri)){const{message:a}=Ue("MISSING_OR_INVALID",`pair() uri: ${i.uri}`);throw new Error(a)}const s=Fm(i.uri);if(!((n=s?.relay)!=null&&n.protocol)){const{message:a}=Ue("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(a)}if(!(s!=null&&s.symKey)){const{message:a}=Ue("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(a)}if(s!=null&&s.expiryTimestamp&&He.toMiliseconds(s?.expiryTimestamp)<Date.now()){const{message:a}=Ue("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(a)}},this.isValidPing=async i=>{if(!_i(i)){const{message:s}=Ue("MISSING_OR_INVALID",`ping() params: ${i}`);throw new Error(s)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidDisconnect=async i=>{if(!_i(i)){const{message:s}=Ue("MISSING_OR_INVALID",`disconnect() params: ${i}`);throw new Error(s)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidPairingTopic=async i=>{if(!br(i,!1)){const{message:n}=Ue("MISSING_OR_INVALID",`pairing topic should be a string: ${i}`);throw new Error(n)}if(!this.pairings.keys.includes(i)){const{message:n}=Ue("NO_MATCHING_KEY",`pairing topic doesn't exist: ${i}`);throw new Error(n)}if(Xs(this.pairings.get(i).expiry)){await this.deletePairing(i);const{message:n}=Ue("EXPIRED",`pairing topic: ${i}`);throw new Error(n)}},this.core=e,this.logger=xi(r,this.name),this.pairings=new Wo(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Ei(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=Ue("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Si.message,async e=>{const{topic:r,message:i}=e;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i)))return;const n=await this.core.crypto.decode(r,i);try{Zd(n)?(this.core.history.set(r,n),this.onRelayEventRequest({topic:r,payload:n})):_h(n)&&(await this.core.history.resolve(n),await this.onRelayEventResponse({topic:r,payload:n}),this.core.history.delete(r,n.id))}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(sn.expired,async e=>{const{topic:r}=Uv(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(rc.expire,{topic:r}))})}}class gR extends MP{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new Br.exports.EventEmitter,this.name=UN,this.version=kN,this.cached=[],this.initialized=!1,this.storagePrefix=Rs,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.records.set(i.id,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(i,n,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:i,request:n,chainId:s}),this.records.has(n.id))return;const a={id:n.id,topic:i,request:{method:n.method,params:n.params||null},chainId:s,expiry:jr(He.THIRTY_DAYS)};this.records.set(a.id,a),this.persist(),this.events.emit(Mn.created,a)},this.resolve=async i=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:i}),!this.records.has(i.id))return;const n=await this.getRecord(i.id);typeof n.response>"u"&&(n.response=rn(i)?{error:i.error}:{result:i.result},this.records.set(n.id,n),this.persist(),this.events.emit(Mn.updated,n))},this.get=async(i,n)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:i,id:n}),await this.getRecord(n)),this.delete=(i,n)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:n}),this.values.forEach(s=>{if(s.topic===i){if(typeof n<"u"&&s.id!==n)return;this.records.delete(s.id),this.events.emit(Mn.deleted,s)}}),this.persist()},this.exists=async(i,n)=>(this.isInitialized(),this.records.has(n)?(await this.getRecord(n)).topic===i:!1),this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=xi(r,this.name)}get context(){return Ei(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 i={topic:r.topic,request:tc(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(i)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:i}=Ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Mn.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=Ue("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(Mn.created,e=>{const r=Mn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Mn.updated,e=>{const r=Mn.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Mn.deleted,e=>{const r=Mn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(yu.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{He.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(Mn.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}class vR extends NP{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new Br.exports.EventEmitter,this.name=jN,this.version=qN,this.cached=[],this.initialized=!1,this.storagePrefix=Rs,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.expirations.set(i.target,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=i=>{try{const n=this.formatTarget(i);return typeof this.getExpiration(n)<"u"}catch{return!1}},this.set=(i,n)=>{this.isInitialized();const s=this.formatTarget(i),a={target:s,expiry:n};this.expirations.set(s,a),this.checkExpiry(s,a),this.events.emit(sn.created,{target:s,expiration:a})},this.get=i=>{this.isInitialized();const n=this.formatTarget(i);return this.getExpiration(n)},this.del=i=>{if(this.isInitialized(),this.has(i)){const n=this.formatTarget(i),s=this.getExpiration(n);this.expirations.delete(n),this.events.emit(sn.deleted,{target:n,expiration:s})}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=xi(r,this.name)}get context(){return Ei(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 pE(e);if(typeof e=="number")return gE(e);const{message:r}=Ue("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(sn.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=Ue("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:i}=Ue("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(i),new Error(i)}return r}checkExpiry(e,r){const{expiry:i}=r;He.toMiliseconds(i)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(sn.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(yu.pulse,()=>this.checkExpirations()),this.events.on(sn.created,e=>{const r=sn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(sn.expired,e=>{const r=sn.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(sn.deleted,e=>{const r=sn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ue("NOT_INITIALIZED",this.name);throw new Error(e)}}}var or={};Object.defineProperty(or,"__esModule",{value:!0}),or.getLocalStorage=or.getLocalStorageOrThrow=or.getCrypto=or.getCryptoOrThrow=or.getLocation=or.getLocationOrThrow=or.getNavigator=or.getNavigatorOrThrow=c6=or.getDocument=or.getDocumentOrThrow=or.getFromWindowOrThrow=or.getFromWindow=void 0;function Vo(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}or.getFromWindow=Vo;function ic(t){const e=Vo(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}or.getFromWindowOrThrow=ic;function mR(){return ic("document")}or.getDocumentOrThrow=mR;function bR(){return Vo("document")}var c6=or.getDocument=bR;function yR(){return ic("navigator")}or.getNavigatorOrThrow=yR;function wR(){return Vo("navigator")}or.getNavigator=wR;function _R(){return ic("location")}or.getLocationOrThrow=_R;function AR(){return Vo("location")}or.getLocation=AR;function ER(){return ic("crypto")}or.getCryptoOrThrow=ER;function xR(){return Vo("crypto")}or.getCrypto=xR;function SR(){return ic("localStorage")}or.getLocalStorageOrThrow=SR;function IR(){return Vo("localStorage")}or.getLocalStorage=IR;class MR extends RP{constructor(e,r,i){super(e,r,i),this.core=e,this.logger=r,this.store=i,this.name=zN,this.verifyUrlV2=KN,this.storagePrefix=Rs,this.version=Jb,this.init=async()=>{var n;this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&He.toMiliseconds((n=this.publicKey)==null?void 0:n.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()),this.publicKey||await this.fetchAndPersistPublicKey()},this.register=async n=>{if(!tu())return;const{id:s,decryptedId:a}=n,u=`${this.verifyUrlV2}/attestation?projectId=${this.core.projectId}`;let d="";try{const p=await fetch(u,{method:"POST",body:JSON.stringify({id:s,decryptedId:a})}),{srcdoc:y}=await p.json();d=y,this.logger.debug("srcdoc fetched",d)}catch(p){this.logger.warn(p);return}try{const p=c6(),y=this.startAbortTimer(He.ONE_SECOND*3),_=await new Promise(C=>{const I=()=>{throw window.removeEventListener("message",B),p.body.removeChild(M),new Error("attestation aborted")};this.abortController.signal.addEventListener("abort",I,{signal:this.abortController.signal});const M=p.createElement("iframe");M.srcdoc=d,M.style.display="none";const B=W=>{if(!W.data)return;const Y=JSON.parse(W.data);Y.type==="verify_attestation"&&(clearInterval(y),p.body.removeChild(M),this.abortController.signal.removeEventListener("abort",I),window.removeEventListener("message",B),C(Y.attestation===null?"":Y.attestation))};p.body.appendChild(M),window.addEventListener("message",B,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",_),_}catch(p){this.logger.warn(p)}return""},this.resolve=async n=>{if(this.isDevEnv)return"";const{attestationId:s,hash:a}=n;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){const d=await this.isValidJwtAttestation(s);if(d)return d}if(!a)return;const u=this.getVerifyUrl(n?.verifyUrl);return this.fetchAttestation(a,u)},this.fetchAttestation=async(n,s)=>{this.logger.debug(`resolving attestation: ${n} from url: ${s}`);const a=this.startAbortTimer(He.ONE_SECOND*5),u=await fetch(`${s}/attestation/${n}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(a),u.status===200?await u.json():void 0},this.getVerifyUrl=n=>{let s=n||Mu;return WN.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${Mu}`),s=Mu),s},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV2}`);const n=this.startAbortTimer(He.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV2}/public-key`,{signal:this.abortController.signal});return clearTimeout(n),await s.json()}catch(n){this.logger.warn(n)}},this.persistPublicKey=async n=>{this.logger.debug("persisting public key to local storage",n),await this.store.setItem(this.storeKey,n),this.publicKey=n},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async n=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(n,s)}catch(u){this.logger.error(u),this.logger.warn("error validating attestation")}const a=await this.fetchAndPersistPublicKey();try{if(a)return this.validateAttestation(n,a)}catch(u){this.logger.error(u),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const a=await this.fetchPublicKey();a&&(await this.persistPublicKey(a),s(a))});const n=await this.fetchPromise;return this.fetchPromise=void 0,n},this.validateAttestation=(n,s)=>{const a=CC(n,s.publicKey),u={hasExpired:He.toMiliseconds(a.exp)<Date.now(),payload:a};if(u.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:u.payload.origin,isScam:u.payload.isScam}},this.logger=xi(r,this.name),this.abortController=new AbortController,this.isDevEnv=Xc()&&process.env.IS_VITEST,this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return Ei(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),He.toMiliseconds(e))}}class CR extends TP{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=VN,this.registerDeviceToken=async i=>{const{clientId:n,token:s,notificationType:a,enableEncrypted:u=!1}=i,d=`${GN}/${this.projectId}/clients`;await fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:n,type:a,token:s,always_raw:u})})},this.logger=xi(r,this.context)}}var DR=Object.defineProperty,u6=Object.getOwnPropertySymbols,PR=Object.prototype.hasOwnProperty,OR=Object.prototype.propertyIsEnumerable,f6=(t,e,r)=>e in t?DR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,h6=(t,e)=>{for(var r in e||(e={}))PR.call(e,r)&&f6(t,r,e[r]);if(u6)for(var r of u6(e))OR.call(e,r)&&f6(t,r,e[r]);return t};class s1 extends IP{constructor(e){var r;super(e),this.protocol=Yb,this.version=Jb,this.name=i1,this.events=new Br.exports.EventEmitter,this.initialized=!1,this.on=(a,u)=>this.events.on(a,u),this.once=(a,u)=>this.events.once(a,u),this.off=(a,u)=>this.events.off(a,u),this.removeListener=(a,u)=>this.events.removeListener(a,u),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||Xb,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=mh({level:typeof e?.logger=="string"&&e.logger?e.logger:vN.logger}),{logger:n,chunkLoggerController:s}=SP({opts:i,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=s,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var a,u;(a=this.logChunkController)!=null&&a.downloadLogsBlobInBrowser&&((u=this.logChunkController)==null||u.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=xi(n,this.name),this.heartbeat=new Bd,this.crypto=new JN(this,this.logger,e?.keychain),this.history=new gR(this,this.logger),this.expirer=new vR(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new JD(h6(h6({},mN),e?.storageOptions)),this.relayer=new fR({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new pR(this,this.logger),this.verify=new MR(this,this.logger,this.storage),this.echoClient=new CR(this.projectId||"",this.logger)}static async init(e){const r=new s1(e);await r.initialize();const i=await r.crypto.getClientId();return await r.storage.setItem(NN,i),r}get context(){return Ei(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}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 $R=s1,l6="wc",d6=2,p6="client",o1=`${l6}@${d6}:${p6}:`,a1={name:p6,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},g6="WALLETCONNECT_DEEPLINK_CHOICE",NR="proposal",v6="Proposal expired",RR="session",nc=He.SEVEN_DAYS,TR="engine",Wr={wc_sessionPropose:{req:{ttl:He.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:He.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:He.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:He.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:He.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:He.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:He.ONE_DAY,prompt:!1,tag:1104},res:{ttl:He.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:He.ONE_DAY,prompt:!1,tag:1106},res:{ttl:He.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:He.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:He.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:He.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:He.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:He.ONE_DAY,prompt:!1,tag:1112},res:{ttl:He.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:He.ONE_DAY,prompt:!1,tag:1114},res:{ttl:He.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:He.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:He.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:He.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:He.FIVE_MINUTES,prompt:!1,tag:1119}}},c1={min:He.FIVE_MINUTES,max:He.SEVEN_DAYS},ls={idle:"IDLE",active:"ACTIVE"},FR="request",LR=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],BR="wc",UR="auth",kR="authKeys",jR="pairingTopics",qR="requests",Eh=`${BR}@${1.5}:${UR}:`,xh=`${Eh}:PUB_KEY`;var zR=Object.defineProperty,HR=Object.defineProperties,KR=Object.getOwnPropertyDescriptors,m6=Object.getOwnPropertySymbols,WR=Object.prototype.hasOwnProperty,VR=Object.prototype.propertyIsEnumerable,b6=(t,e,r)=>e in t?zR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sr=(t,e)=>{for(var r in e||(e={}))WR.call(e,r)&&b6(t,r,e[r]);if(m6)for(var r of m6(e))VR.call(e,r)&&b6(t,r,e[r]);return t},Go=(t,e)=>HR(t,KR(e));class GR extends LP{constructor(e){super(e),this.name=TR,this.events=new Br.exports,this.initialized=!1,this.requestQueue={state:ls.idle,queue:[]},this.sessionRequestQueue={state:ls.idle,queue:[]},this.requestQueueDelay=He.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Wr)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},He.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const i=Go(Sr({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(i);const{pairingTopic:n,requiredNamespaces:s,optionalNamespaces:a,sessionProperties:u,relays:d}=i;let p=n,y,_=!1;try{p&&(_=this.client.core.pairing.pairings.get(p).active)}catch(U){throw this.client.logger.error(`connect() -> pairing.get(${p}) failed`),U}if(!p||!_){const{topic:U,uri:z}=await this.client.core.pairing.create();p=U,y=z}if(!p){const{message:U}=Ue("NO_MATCHING_KEY",`connect() pairing topic: ${p}`);throw new Error(U)}const C=await this.client.core.crypto.generateKeyPair(),I=Wr.wc_sessionPropose.req.ttl||He.FIVE_MINUTES,M=jr(I),B=Sr({requiredNamespaces:s,optionalNamespaces:a,relays:d??[{protocol:Zb}],proposer:{publicKey:C,metadata:this.client.metadata},expiryTimestamp:M,pairingTopic:p},u&&{sessionProperties:u}),{reject:W,resolve:Y,done:q}=Uo(I,v6);this.events.once($t("session_connect"),async({error:U,session:z})=>{if(U)W(U);else if(z){z.self.publicKey=C;const K=Go(Sr({},z),{pairingTopic:B.pairingTopic,requiredNamespaces:B.requiredNamespaces,optionalNamespaces:B.optionalNamespaces});await this.client.session.set(z.topic,K),await this.setExpiry(z.topic,z.expiry),p&&await this.client.core.pairing.updateMetadata({topic:p,metadata:z.peer.metadata}),this.cleanupDuplicatePairings(K),Y(K)}});const V=await this.sendRequest({topic:p,method:"wc_sessionPropose",params:B,throwOnFailedPublish:!0});return await this.setProposal(V,Sr({id:V},B)),{uri:y,approval:q}},this.pair=async r=>{await this.isInitialized();try{return await this.client.core.pairing.pair(r)}catch(i){throw this.client.logger.error("pair() failed"),i}},this.approve=async r=>{await this.isInitialized();try{await this.isValidApprove(r)}catch(q){throw this.client.logger.error("approve() -> isValidApprove() failed"),q}const{id:i,relayProtocol:n,namespaces:s,sessionProperties:a,sessionConfig:u}=r;let d;try{d=this.client.proposal.get(i)}catch(q){throw this.client.logger.error(`approve() -> proposal.get(${i}) failed`),q}const{pairingTopic:p,proposer:y,requiredNamespaces:_,optionalNamespaces:C}=d,I=await this.client.core.crypto.generateKeyPair(),M=y.publicKey,B=await this.client.core.crypto.generateSharedKey(I,M),W=Sr(Sr({relay:{protocol:n??"irn"},namespaces:s,controller:{publicKey:I,metadata:this.client.metadata},expiry:jr(nc)},a&&{sessionProperties:a}),u&&{sessionConfig:u});await this.client.core.relayer.subscribe(B);const Y=Go(Sr({},W),{topic:B,requiredNamespaces:_,optionalNamespaces:C,pairingTopic:p,acknowledged:!1,self:W.controller,peer:{publicKey:y.publicKey,metadata:y.metadata},controller:I});await this.client.session.set(B,Y);try{await this.sendRequest({topic:B,method:"wc_sessionSettle",params:W,throwOnFailedPublish:!0}),await this.sendResult({id:i,topic:p,result:{relay:{protocol:n??"irn"},responderPublicKey:I},throwOnFailedPublish:!0})}catch(q){throw this.client.logger.error(q),this.client.session.delete(B,Yt("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(B),q}return await this.client.core.pairing.updateMetadata({topic:p,metadata:y.metadata}),await this.client.proposal.delete(i,Yt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:p}),await this.setExpiry(B,jr(nc)),{topic:B,acknowledged:()=>Promise.resolve(this.client.session.get(B))}},this.reject=async r=>{await this.isInitialized();try{await this.isValidReject(r)}catch(a){throw this.client.logger.error("reject() -> isValidReject() failed"),a}const{id:i,reason:n}=r;let s;try{s=this.client.proposal.get(i).pairingTopic}catch(a){throw this.client.logger.error(`reject() -> proposal.get(${i}) failed`),a}s&&(await this.sendError({id:i,topic:s,error:n,rpcOpts:Wr.wc_sessionPropose.reject}),await this.client.proposal.delete(i,Yt("USER_DISCONNECTED")))},this.update=async r=>{await this.isInitialized();try{await this.isValidUpdate(r)}catch(_){throw this.client.logger.error("update() -> isValidUpdate() failed"),_}const{topic:i,namespaces:n}=r,{done:s,resolve:a,reject:u}=Uo(),d=no(),p=Ko().toString(),y=this.client.session.get(i).namespaces;return this.events.once($t("session_update",d),({error:_})=>{_?u(_):a()}),await this.client.session.update(i,{namespaces:n}),await this.sendRequest({topic:i,method:"wc_sessionUpdate",params:{namespaces:n},throwOnFailedPublish:!0,clientRpcId:d,relayRpcId:p}).catch(_=>{this.client.logger.error(_),this.client.session.update(i,{namespaces:y}),u(_)}),{acknowledged:s}},this.extend=async r=>{await this.isInitialized();try{await this.isValidExtend(r)}catch(d){throw this.client.logger.error("extend() -> isValidExtend() failed"),d}const{topic:i}=r,n=no(),{done:s,resolve:a,reject:u}=Uo();return this.events.once($t("session_extend",n),({error:d})=>{d?u(d):a()}),await this.setExpiry(i,jr(nc)),this.sendRequest({topic:i,method:"wc_sessionExtend",params:{},clientRpcId:n,throwOnFailedPublish:!0}).catch(d=>{u(d)}),{acknowledged:s}},this.request=async r=>{await this.isInitialized();try{await this.isValidRequest(r)}catch(I){throw this.client.logger.error("request() -> isValidRequest() failed"),I}const{chainId:i,request:n,topic:s,expiry:a=Wr.wc_sessionRequest.req.ttl}=r,u=this.client.session.get(s),d=no(),p=Ko().toString(),{done:y,resolve:_,reject:C}=Uo(a,"Request expired. Please try again.");return this.events.once($t("session_request",d),({error:I,result:M})=>{I?C(I):_(M)}),await Promise.all([new Promise(async I=>{await this.sendRequest({clientRpcId:d,relayRpcId:p,topic:s,method:"wc_sessionRequest",params:{request:Go(Sr({},n),{expiryTimestamp:jr(a)}),chainId:i},expiry:a,throwOnFailedPublish:!0}).catch(M=>C(M)),this.client.events.emit("session_request_sent",{topic:s,request:n,chainId:i,id:d}),I()}),new Promise(async I=>{var M;if(!((M=u.sessionConfig)!=null&&M.disableDeepLink)){const B=await mE(this.client.core.storage,g6);vE({id:d,topic:s,wcDeepLink:B})}I()}),y()]).then(I=>I[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:i,response:n}=r,{id:s}=n;fs(n)?await this.sendResult({id:s,topic:i,result:n.result,throwOnFailedPublish:!0}):rn(n)&&await this.sendError({id:s,topic:i,error:n.error}),this.cleanupAfterResponse(r)},this.ping=async r=>{await this.isInitialized();try{await this.isValidPing(r)}catch(n){throw this.client.logger.error("ping() -> isValidPing() failed"),n}const{topic:i}=r;if(this.client.session.keys.includes(i)){const n=no(),s=Ko().toString(),{done:a,resolve:u,reject:d}=Uo();this.events.once($t("session_ping",n),({error:p})=>{p?d(p):u()}),await Promise.all([this.sendRequest({topic:i,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:n,relayRpcId:s}),a()])}else this.client.core.pairing.pairings.keys.includes(i)&&await this.client.core.pairing.ping({topic:i})},this.emit=async r=>{await this.isInitialized(),await this.isValidEmit(r);const{topic:i,event:n,chainId:s}=r,a=Ko().toString();await this.sendRequest({topic:i,method:"wc_sessionEvent",params:{event:n,chainId:s},throwOnFailedPublish:!0,relayRpcId:a})},this.disconnect=async r=>{await this.isInitialized(),await this.isValidDisconnect(r);const{topic:i}=r;if(this.client.session.keys.includes(i))await this.sendRequest({topic:i,method:"wc_sessionDelete",params:Yt("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:i,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(i))await this.client.core.pairing.disconnect({topic:i});else{const{message:n}=Ue("MISMATCHED_TOPIC",`Session or pairing topic not found: ${i}`);throw new Error(n)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(i=>WC(i,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async r=>{this.isInitialized(),this.isValidAuthenticate(r);const{chains:i,statement:n="",uri:s,domain:a,nonce:u,type:d,exp:p,nbf:y,methods:_=[],expiry:C}=r,I=[...r.resources||[]],{topic:M,uri:B}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"]});this.client.logger.info({message:"Generated new pairing",pairing:{topic:M,uri:B}});const W=await this.client.core.crypto.generateKeyPair(),Y=oh(W);if(await Promise.all([this.client.auth.authKeys.set(xh,{responseTopic:Y,publicKey:W}),this.client.auth.pairingTopics.set(Y,{topic:Y,pairingTopic:M})]),await this.client.core.relayer.subscribe(Y),this.client.logger.info(`sending request to new pairing topic: ${M}`),_.length>0){const{namespace:f}=Zc(i[0]);let h=lI(f,"request",_);th(I)&&(h=pI(h,I.pop())),I.push(h)}const q=C&&C>Wr.wc_sessionAuthenticate.req.ttl?C:Wr.wc_sessionAuthenticate.req.ttl,V={authPayload:{type:d??"caip122",chains:i,statement:n,aud:s,domain:a,version:"1",nonce:u,iat:new Date().toISOString(),exp:p,nbf:y,resources:I},requester:{publicKey:W,metadata:this.client.metadata},expiryTimestamp:jr(q)},U={eip155:{chains:i,methods:[...new Set(["personal_sign",..._])],events:["chainChanged","accountsChanged"]}},z={requiredNamespaces:{},optionalNamespaces:U,relays:[{protocol:"irn"}],pairingTopic:M,proposer:{publicKey:W,metadata:this.client.metadata},expiryTimestamp:jr(Wr.wc_sessionPropose.req.ttl)},{done:K,resolve:A,reject:j}=Uo(q,"Request expired"),ee=async({error:f,session:h})=>{if(this.events.off($t("session_request",k),re),f)j(f);else if(h){h.self.publicKey=W,await this.client.session.set(h.topic,h),await this.setExpiry(h.topic,h.expiry),M&&await this.client.core.pairing.updateMetadata({topic:M,metadata:h.peer.metadata});const g=this.client.session.get(h.topic);await this.deleteProposal(w),A({session:g})}},re=async f=>{if(await this.deletePendingAuthRequest(k,{message:"fulfilled",code:0}),f.error){const v=Yt("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return f.error.code===v.code?void 0:(this.events.off($t("session_connect"),ee),j(f.error.message))}await this.deleteProposal(w),this.events.off($t("session_connect"),ee);const{cacaos:h,responder:g}=f.result,E=[],D=[];for(const v of h){await V3({cacao:v,projectId:this.client.core.projectId})||(this.client.logger.error(v,"Signature verification failed"),j(Yt("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:b}=v,L=th(b.resources),X=[W3(b.iss)],ce=eh(b.iss);if(L){const O=J3(L),ie=Q3(L);E.push(...O),X.push(...ie)}for(const O of X)D.push(`${O}:${ce}`)}const P=await this.client.core.crypto.generateSharedKey(W,g.publicKey);let x;E.length>0&&(x={topic:P,acknowledged:!0,self:{publicKey:W,metadata:this.client.metadata},peer:g,controller:g.publicKey,expiry:jr(nc),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:M,namespaces:Lm([...new Set(E)],[...new Set(D)])},await this.client.core.relayer.subscribe(P),await this.client.session.set(P,x),M&&await this.client.core.pairing.updateMetadata({topic:M,metadata:g.metadata}),x=this.client.session.get(P)),A({auths:h,session:x})},k=no(),w=no();this.events.once($t("session_connect"),ee),this.events.once($t("session_request",k),re);try{await Promise.all([this.sendRequest({topic:M,method:"wc_sessionAuthenticate",params:V,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:k}),this.sendRequest({topic:M,method:"wc_sessionPropose",params:z,expiry:Wr.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:w})])}catch(f){throw this.events.off($t("session_connect"),ee),this.events.off($t("session_request",k),re),f}return await this.setProposal(w,Sr({id:w},z)),await this.setAuthRequest(k,{request:Go(Sr({},V),{verifyContext:{}}),pairingTopic:M}),{uri:B,response:K}},this.approveSessionAuthenticate=async r=>{this.isInitialized();const{id:i,auths:n}=r,s=this.getPendingAuthRequest(i);if(!s)throw new Error(`Could not find pending auth request with id ${i}`);const a=s.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),d=oh(a),p={type:Os,receiverPublicKey:a,senderPublicKey:u},y=[],_=[];for(const M of n){if(!await V3({cacao:M,projectId:this.client.core.projectId})){const V=Yt("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:i,topic:d,error:V,encodeOpts:p}),new Error(V.message)}const{p:B}=M,W=th(B.resources),Y=[W3(B.iss)],q=eh(B.iss);if(W){const V=J3(W),U=Q3(W);y.push(...V),Y.push(...U)}for(const V of Y)_.push(`${V}:${q}`)}const C=await this.client.core.crypto.generateSharedKey(u,a);let I;return y?.length>0&&(I={topic:C,acknowledged:!0,self:{publicKey:u,metadata:this.client.metadata},peer:{publicKey:a,metadata:s.requester.metadata},controller:a,expiry:jr(nc),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:s.pairingTopic,namespaces:Lm([...new Set(y)],[...new Set(_)])},await this.client.core.relayer.subscribe(C),await this.client.session.set(C,I),await this.client.core.pairing.updateMetadata({topic:s.pairingTopic,metadata:s.requester.metadata})),await this.sendResult({topic:d,id:i,result:{cacaos:n,responder:{publicKey:u,metadata:this.client.metadata}},encodeOpts:p,throwOnFailedPublish:!0}),await this.client.auth.requests.delete(i,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:s.pairingTopic}),{session:I}},this.rejectSessionAuthenticate=async r=>{await this.isInitialized();const{id:i,reason:n}=r,s=this.getPendingAuthRequest(i);if(!s)throw new Error(`Could not find pending auth request with id ${i}`);const a=s.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),d=oh(a),p={type:Os,receiverPublicKey:a,senderPublicKey:u};await this.sendError({id:i,topic:d,error:n,encodeOpts:p,rpcOpts:Wr.wc_sessionAuthenticate.reject}),await this.client.auth.requests.delete(i,{message:"rejected",code:0}),await this.client.proposal.delete(i,Yt("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:i,iss:n}=r;return G3(i,n)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const i=this.client.core.pairing.pairings.get(r.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter(s=>{var a,u;return((a=s.peerMetadata)==null?void 0:a.url)&&((u=s.peerMetadata)==null?void 0:u.url)===r.peer.metadata.url&&s.topic&&s.topic!==i.topic});if(n.length===0)return;this.client.logger.info(`Cleaning up ${n.length} duplicate pairing(s)`),await Promise.all(n.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(i){this.client.logger.error(i)}},this.deleteSession=async r=>{var i;const{topic:n,expirerHasDeleted:s=!1,emitEvent:a=!0,id:u=0}=r,{self:d}=this.client.session.get(n);await this.client.core.relayer.unsubscribe(n),await this.client.session.delete(n,Yt("USER_DISCONNECTED")),this.addToRecentlyDeleted(n,"session"),this.client.core.crypto.keychain.has(d.publicKey)&&await this.client.core.crypto.deleteKeyPair(d.publicKey),this.client.core.crypto.keychain.has(n)&&await this.client.core.crypto.deleteSymKey(n),s||this.client.core.expirer.del(n),this.client.core.storage.removeItem(g6).catch(p=>this.client.logger.warn(p)),this.getPendingSessionRequests().forEach(p=>{p.topic===n&&this.deletePendingSessionRequest(p.id,Yt("USER_DISCONNECTED"))}),n===((i=this.sessionRequestQueue.queue[0])==null?void 0:i.topic)&&(this.sessionRequestQueue.state=ls.idle),a&&this.client.events.emit("session_delete",{id:u,topic:n})},this.deleteProposal=async(r,i)=>{await Promise.all([this.client.proposal.delete(r,Yt("USER_DISCONNECTED")),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,i,n=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,i),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==r),n&&(this.sessionRequestQueue.state=ls.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,i,n=!1)=>{await Promise.all([this.client.auth.requests.delete(r,i),n?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,i)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,i),await this.client.session.update(r,{expiry:i}))},this.setProposal=async(r,i)=>{this.client.core.expirer.set(r,jr(Wr.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,i)},this.setAuthRequest=async(r,i)=>{const{request:n,pairingTopic:s}=i;this.client.core.expirer.set(r,n.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:n.authPayload,requester:n.requester,expiryTimestamp:n.expiryTimestamp,id:r,pairingTopic:s,verifyContext:n.verifyContext})},this.setPendingSessionRequest=async r=>{const{id:i,topic:n,params:s,verifyContext:a}=r,u=s.request.expiryTimestamp||jr(Wr.wc_sessionRequest.req.ttl);this.client.core.expirer.set(i,u),await this.client.pendingRequest.set(i,{id:i,topic:n,params:s,verifyContext:a})},this.sendRequest=async r=>{const{topic:i,method:n,params:s,expiry:a,relayRpcId:u,clientRpcId:d,throwOnFailedPublish:p}=r,y=tc(n,s,d);let _;try{_=await this.client.core.crypto.encode(i,y)}catch(M){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${i} failed`),M}let C;if(LR.includes(n)){const M=io(JSON.stringify(y)),B=io(_);C=await this.client.core.verify.register({id:B,decryptedId:M})}const I=Wr[n].req;return I.attestation=C,a&&(I.ttl=a),u&&(I.id=u),this.client.core.history.set(i,y),p?(I.internal=Go(Sr({},I.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,_,I)):this.client.core.relayer.publish(i,_,I).catch(M=>this.client.logger.error(M)),y.id},this.sendResult=async r=>{const{id:i,topic:n,result:s,throwOnFailedPublish:a,encodeOpts:u}=r,d=yh(i,s);let p;try{p=await this.client.core.crypto.encode(n,d,u)}catch(C){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${n} failed`),C}let y;try{y=await this.client.core.history.get(n,i)}catch(C){throw this.client.logger.error(`sendResult() -> history.get(${n}, ${i}) failed`),C}const _=Wr[y.request.method].res;a?(_.internal=Go(Sr({},_.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,p,_)):this.client.core.relayer.publish(n,p,_).catch(C=>this.client.logger.error(C)),await this.client.core.history.resolve(d)},this.sendError=async r=>{const{id:i,topic:n,error:s,encodeOpts:a,rpcOpts:u}=r,d=wh(i,s);let p;try{p=await this.client.core.crypto.encode(n,d,a)}catch(C){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),C}let y;try{y=await this.client.core.history.get(n,i)}catch(C){throw this.client.logger.error(`sendError() -> history.get(${n}, ${i}) failed`),C}const _=u||Wr[y.request.method].res;this.client.core.relayer.publish(n,p,_),await this.client.core.history.resolve(d)},this.cleanup=async()=>{const r=[],i=[];this.client.session.getAll().forEach(n=>{let s=!1;Xs(n.expiry)&&(s=!0),this.client.core.crypto.keychain.has(n.topic)||(s=!0),s&&r.push(n.topic)}),this.client.proposal.getAll().forEach(n=>{Xs(n.expiryTimestamp)&&i.push(n.id)}),await Promise.all([...r.map(n=>this.deleteSession({topic:n})),...i.map(n=>this.deleteProposal(n))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===ls.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=ls.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(i){this.client.logger.warn(i)}}this.requestQueue.state=ls.idle},this.processRequest=async r=>{const{topic:i,payload:n,attestation:s}=r,a=n.method;if(!this.shouldIgnorePairingRequest({topic:i,requestMethod:a}))switch(a){case"wc_sessionPropose":return await this.onSessionProposeRequest(i,n,s);case"wc_sessionSettle":return await this.onSessionSettleRequest(i,n);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(i,n);case"wc_sessionExtend":return await this.onSessionExtendRequest(i,n);case"wc_sessionPing":return await this.onSessionPingRequest(i,n);case"wc_sessionDelete":return await this.onSessionDeleteRequest(i,n);case"wc_sessionRequest":return await this.onSessionRequest(i,n,s);case"wc_sessionEvent":return await this.onSessionEventRequest(i,n);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest(i,n,s);default:return this.client.logger.info(`Unsupported request method ${a}`)}},this.onRelayEventResponse=async r=>{const{topic:i,payload:n}=r,s=(await this.client.core.history.get(i,n.id)).request.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeResponse(i,n);case"wc_sessionSettle":return this.onSessionSettleResponse(i,n);case"wc_sessionUpdate":return this.onSessionUpdateResponse(i,n);case"wc_sessionExtend":return this.onSessionExtendResponse(i,n);case"wc_sessionPing":return this.onSessionPingResponse(i,n);case"wc_sessionRequest":return this.onSessionRequestResponse(i,n);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(i,n);default:return this.client.logger.info(`Unsupported response method ${s}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:i}=r,{message:n}=Ue("MISSING_OR_INVALID",`Decoded payload on topic ${i} is not identifiable as a JSON-RPC request or a response.`);throw new Error(n)},this.shouldIgnorePairingRequest=r=>{const{topic:i,requestMethod:n}=r,s=this.expectedPairingMethodMap.get(i);return!s||s.includes(n)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async(r,i,n)=>{const{params:s,id:a}=i;try{this.isValidConnect(Sr({},i.params));const u=s.expiryTimestamp||jr(Wr.wc_sessionPropose.req.ttl),d=Sr({id:a,pairingTopic:r,expiryTimestamp:u},s);await this.setProposal(a,d);const p=await this.getVerifyContext({attestationId:n,hash:io(JSON.stringify(i)),metadata:d.proposer.metadata});this.client.events.emit("session_proposal",{id:a,params:d,verifyContext:p})}catch(u){await this.sendError({id:a,topic:r,error:u,rpcOpts:Wr.wc_sessionPropose.autoReject}),this.client.logger.error(u)}},this.onSessionProposeResponse=async(r,i)=>{const{id:n}=i;if(fs(i)){const{result:s}=i;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:s});const a=this.client.proposal.get(n);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const u=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:u});const d=s.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:d});const p=await this.client.core.crypto.generateSharedKey(u,d);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:p});const y=await this.client.core.relayer.subscribe(p);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:y}),await this.client.core.pairing.activate({topic:r})}else if(rn(i)){await this.client.proposal.delete(n,Yt("USER_DISCONNECTED"));const s=$t("session_connect");if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners, 954`);this.events.emit($t("session_connect"),{error:i.error})}},this.onSessionSettleRequest=async(r,i)=>{const{id:n,params:s}=i;try{this.isValidSessionSettleRequest(s);const{relay:a,controller:u,expiry:d,namespaces:p,sessionProperties:y,sessionConfig:_}=i.params,C=Sr(Sr({topic:r,relay:a,expiry:d,namespaces:p,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:u.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:u.publicKey,metadata:u.metadata}},y&&{sessionProperties:y}),_&&{sessionConfig:_}),I=$t("session_connect");if(this.events.listenerCount(I)===0)throw new Error(`emitting ${I} without any listeners 997`);this.events.emit($t("session_connect"),{session:C}),await this.sendResult({id:i.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(a){await this.sendError({id:n,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionSettleResponse=async(r,i)=>{const{id:n}=i;fs(i)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit($t("session_approve",n),{})):rn(i)&&(await this.client.session.delete(r,Yt("USER_DISCONNECTED")),this.events.emit($t("session_approve",n),{error:i.error}))},this.onSessionUpdateRequest=async(r,i)=>{const{params:n,id:s}=i;try{const a=`${r}_session_update`,u=mu.get(a);if(u&&this.isRequestOutOfSync(u,s)){this.client.logger.info(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:Yt("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(Sr({topic:r},n));try{mu.set(a,s),await this.client.session.update(r,{namespaces:n.namespaces}),await this.sendResult({id:s,topic:r,result:!0,throwOnFailedPublish:!0})}catch(d){throw mu.delete(a),d}this.client.events.emit("session_update",{id:s,topic:r,params:n})}catch(a){await this.sendError({id:s,topic:r,error:a}),this.client.logger.error(a)}},this.isRequestOutOfSync=(r,i)=>parseInt(i.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,i)=>{const{id:n}=i,s=$t("session_update",n);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);fs(i)?this.events.emit($t("session_update",n),{}):rn(i)&&this.events.emit($t("session_update",n),{error:i.error})},this.onSessionExtendRequest=async(r,i)=>{const{id:n}=i;try{this.isValidExtend({topic:r}),await this.setExpiry(r,jr(nc)),await this.sendResult({id:n,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:n,topic:r})}catch(s){await this.sendError({id:n,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,i)=>{const{id:n}=i,s=$t("session_extend",n);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);fs(i)?this.events.emit($t("session_extend",n),{}):rn(i)&&this.events.emit($t("session_extend",n),{error:i.error})},this.onSessionPingRequest=async(r,i)=>{const{id:n}=i;try{this.isValidPing({topic:r}),await this.sendResult({id:n,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:n,topic:r})}catch(s){await this.sendError({id:n,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionPingResponse=(r,i)=>{const{id:n}=i,s=$t("session_ping",n);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);setTimeout(()=>{fs(i)?this.events.emit($t("session_ping",n),{}):rn(i)&&this.events.emit($t("session_ping",n),{error:i.error})},500)},this.onSessionDeleteRequest=async(r,i)=>{const{id:n}=i;try{this.isValidDisconnect({topic:r,reason:i.params}),await Promise.all([new Promise(s=>{this.client.core.relayer.once(Si.publish,async()=>{s(await this.deleteSession({topic:r,id:n}))})}),this.sendResult({id:n,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:Yt("USER_DISCONNECTED")})])}catch(s){this.client.logger.error(s)}},this.onSessionRequest=async(r,i,n)=>{var s;const{id:a,params:u}=i;try{await this.isValidRequest(Sr({topic:r},u));const d=this.client.session.get(r),p=await this.getVerifyContext({attestationId:n,hash:io(JSON.stringify(tc("wc_sessionRequest",u,a))),metadata:d.peer.metadata}),y={id:a,topic:r,params:u,verifyContext:p};await this.setPendingSessionRequest(y),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(y):(this.addSessionRequestToSessionRequestQueue(y),this.processSessionRequestQueue())}catch(d){await this.sendError({id:a,topic:r,error:d}),this.client.logger.error(d)}},this.onSessionRequestResponse=(r,i)=>{const{id:n}=i,s=$t("session_request",n);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);fs(i)?this.events.emit($t("session_request",n),{result:i.result}):rn(i)&&this.events.emit($t("session_request",n),{error:i.error})},this.onSessionEventRequest=async(r,i)=>{const{id:n,params:s}=i;try{const a=`${r}_session_event_${s.event.name}`,u=mu.get(a);if(u&&this.isRequestOutOfSync(u,n)){this.client.logger.info(`Discarding out of sync request - ${n}`);return}this.isValidEmit(Sr({topic:r},s)),this.client.events.emit("session_event",{id:n,topic:r,params:s}),mu.set(a,n)}catch(a){await this.sendError({id:n,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionAuthenticateResponse=(r,i)=>{const{id:n}=i;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:i}),fs(i)?this.events.emit($t("session_request",n),{result:i.result}):rn(i)&&this.events.emit($t("session_request",n),{error:i.error})},this.onSessionAuthenticateRequest=async(r,i,n)=>{try{const{requester:s,authPayload:a,expiryTimestamp:u}=i.params,d=await this.getVerifyContext({attestationId:n,hash:io(JSON.stringify(i)),metadata:this.client.metadata}),p={requester:s,pairingTopic:r,id:i.id,authPayload:a,verifyContext:d,expiryTimestamp:u};await this.setAuthRequest(i.id,{request:p,pairingTopic:r}),this.client.events.emit("session_authenticate",{topic:r,params:i.params,id:i.id,verifyContext:d})}catch(s){this.client.logger.error(s);const a=i.params.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),d={type:Os,receiverPublicKey:a,senderPublicKey:u};await this.sendError({id:i.id,topic:r,error:s,encodeOpts:d,rpcOpts:Wr.wc_sessionAuthenticate.autoReject})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=ls.idle,this.processSessionRequestQueue()},He.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:i})=>{const n=this.client.core.history.pending;n.length>0&&n.filter(s=>s.topic===r&&s.request.method==="wc_sessionRequest").forEach(s=>{const a=s.request.id,u=$t("session_request",a);if(this.events.listenerCount(u)===0)throw new Error(`emitting ${u} without any listeners`);this.events.emit($t("session_request",s.request.id),{error:i})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===ls.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=ls.active,this.emitSessionRequest(r)}catch(i){this.client.logger.error(i)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const i=this.client.proposal.getAll().find(n=>n.pairingTopic===r.topic);i&&this.onSessionProposeRequest(r.topic,tc("wc_sessionPropose",{requiredNamespaces:i.requiredNamespaces,optionalNamespaces:i.optionalNamespaces,relays:i.relays,proposer:i.proposer,sessionProperties:i.sessionProperties},i.id))},this.isValidConnect=async r=>{if(!_i(r)){const{message:d}=Ue("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(d)}const{pairingTopic:i,requiredNamespaces:n,optionalNamespaces:s,sessionProperties:a,relays:u}=r;if(fi(i)||await this.isValidPairingTopic(i),!nD(u,!0)){const{message:d}=Ue("MISSING_OR_INVALID",`connect() relays: ${u}`);throw new Error(d)}!fi(n)&&vu(n)!==0&&this.validateNamespaces(n,"requiredNamespaces"),!fi(s)&&vu(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),fi(a)||this.validateSessionProps(a,"sessionProperties")},this.validateNamespaces=(r,i)=>{const n=iD(r,"connect()",i);if(n)throw new Error(n.message)},this.isValidApprove=async r=>{if(!_i(r))throw new Error(Ue("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:i,namespaces:n,relayProtocol:s,sessionProperties:a}=r;this.checkRecentlyDeleted(i),await this.isValidProposalId(i);const u=this.client.proposal.get(i),d=Nd(n,"approve()");if(d)throw new Error(d.message);const p=qm(u.requiredNamespaces,n,"approve()");if(p)throw new Error(p.message);if(!br(s,!0)){const{message:y}=Ue("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(y)}fi(a)||this.validateSessionProps(a,"sessionProperties")},this.isValidReject=async r=>{if(!_i(r)){const{message:s}=Ue("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:i,reason:n}=r;if(this.checkRecentlyDeleted(i),await this.isValidProposalId(i),!oD(n)){const{message:s}=Ue("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(n)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!_i(r)){const{message:p}=Ue("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(p)}const{relay:i,controller:n,namespaces:s,expiry:a}=r;if(!km(i)){const{message:p}=Ue("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(p)}const u=QC(n,"onSessionSettleRequest()");if(u)throw new Error(u.message);const d=Nd(s,"onSessionSettleRequest()");if(d)throw new Error(d.message);if(Xs(a)){const{message:p}=Ue("EXPIRED","onSessionSettleRequest()");throw new Error(p)}},this.isValidUpdate=async r=>{if(!_i(r)){const{message:d}=Ue("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(d)}const{topic:i,namespaces:n}=r;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const s=this.client.session.get(i),a=Nd(n,"update()");if(a)throw new Error(a.message);const u=qm(s.requiredNamespaces,n,"update()");if(u)throw new Error(u.message)},this.isValidExtend=async r=>{if(!_i(r)){const{message:n}=Ue("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(n)}const{topic:i}=r;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i)},this.isValidRequest=async r=>{if(!_i(r)){const{message:d}=Ue("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(d)}const{topic:i,request:n,chainId:s,expiry:a}=r;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const{namespaces:u}=this.client.session.get(i);if(!jm(u,s)){const{message:d}=Ue("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(d)}if(!aD(n)){const{message:d}=Ue("MISSING_OR_INVALID",`request() ${JSON.stringify(n)}`);throw new Error(d)}if(!fD(u,s,n.method)){const{message:d}=Ue("MISSING_OR_INVALID",`request() method: ${n.method}`);throw new Error(d)}if(a&&!pD(a,c1)){const{message:d}=Ue("MISSING_OR_INVALID",`request() expiry: ${a}. Expiry must be a number (in seconds) between ${c1.min} and ${c1.max}`);throw new Error(d)}},this.isValidRespond=async r=>{var i;if(!_i(r)){const{message:a}=Ue("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(a)}const{topic:n,response:s}=r;try{await this.isValidSessionTopic(n)}catch(a){throw(i=r?.response)!=null&&i.id&&this.cleanupAfterResponse(r),a}if(!cD(s)){const{message:a}=Ue("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(a)}},this.isValidPing=async r=>{if(!_i(r)){const{message:n}=Ue("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(n)}const{topic:i}=r;await this.isValidSessionOrPairingTopic(i)},this.isValidEmit=async r=>{if(!_i(r)){const{message:u}=Ue("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(u)}const{topic:i,event:n,chainId:s}=r;await this.isValidSessionTopic(i);const{namespaces:a}=this.client.session.get(i);if(!jm(a,s)){const{message:u}=Ue("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(u)}if(!uD(n)){const{message:u}=Ue("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(u)}if(!hD(a,s,n.name)){const{message:u}=Ue("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(u)}},this.isValidDisconnect=async r=>{if(!_i(r)){const{message:n}=Ue("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(n)}const{topic:i}=r;await this.isValidSessionOrPairingTopic(i)},this.isValidAuthenticate=r=>{const{chains:i,uri:n,domain:s,nonce:a}=r;if(!Array.isArray(i)||i.length===0)throw new Error("chains is required and must be a non-empty array");if(!br(n,!1))throw new Error("uri is required parameter");if(!br(s,!1))throw new Error("domain is required parameter");if(!br(a,!1))throw new Error("nonce is required parameter");if([...new Set(i.map(d=>Zc(d).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:u}=Zc(i[0]);if(u!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async r=>{const{attestationId:i,hash:n,metadata:s}=r,a={verified:{verifyUrl:s.verifyUrl||Mu,validation:"UNKNOWN",origin:s.url||""}};try{const u=await this.client.core.verify.resolve({attestationId:i,hash:n,verifyUrl:s.verifyUrl});u&&(a.verified.origin=u.origin,a.verified.isScam=u.isScam,a.verified.validation=u.origin===new URL(s.url).origin?"VALID":"INVALID")}catch(u){this.client.logger.warn(u)}return this.client.logger.debug(`Verify context: ${JSON.stringify(a)}`),a},this.validateSessionProps=(r,i)=>{Object.values(r).forEach(n=>{if(!br(n,!1)){const{message:s}=Ue("MISSING_OR_INVALID",`${i} must be in Record<string, string> format. Received: ${JSON.stringify(n)}`);throw new Error(s)}})},this.getPendingAuthRequest=r=>{const i=this.client.auth.requests.get(r);return typeof i=="object"?i:void 0},this.addToRecentlyDeleted=(r,i)=>{if(this.recentlyDeletedMap.set(r,i),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let n=0;const s=this.recentlyDeletedLimit/2;for(const a of this.recentlyDeletedMap.keys()){if(n++>=s)break;this.recentlyDeletedMap.delete(a)}}},this.checkRecentlyDeleted=r=>{const i=this.recentlyDeletedMap.get(r);if(i){const{message:n}=Ue("MISSING_OR_INVALID",`Record was recently deleted - ${i}: ${r}`);throw new Error(n)}}}async isInitialized(){if(!this.initialized){const{message:e}=Ue("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Si.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:r,message:i,attestation:n}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(xh)?this.client.auth.authKeys.get(xh):{responseTopic:void 0,publicKey:void 0},a=await this.client.core.crypto.decode(r,i,{receiverPublicKey:s});try{Zd(a)?(this.client.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a,attestation:n})):_h(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a}),this.client.core.history.delete(r,a.id)):this.onRelayEventUnknownPayload({topic:r,payload:a})}catch(u){this.client.logger.error(u)}}registerExpirerEvents(){this.client.core.expirer.on(sn.expired,async e=>{const{topic:r,id:i}=Uv(e.target);if(i&&this.client.pendingRequest.keys.includes(i))return await this.deletePendingSessionRequest(i,Ue("EXPIRED"),!0);if(i&&this.client.auth.requests.keys.includes(i))return await this.deletePendingAuthRequest(i,Ue("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):i&&(await this.deleteProposal(i,!0),this.client.events.emit("proposal_expire",{id:i}))})}registerPairingEvents(){this.client.core.pairing.events.on(rc.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(rc.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!br(e,!1)){const{message:r}=Ue("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}=Ue("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(Xs(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=Ue("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!br(e,!1)){const{message:r}=Ue("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=Ue("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(Xs(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=Ue("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=Ue("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),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(br(e,!1)){const{message:r}=Ue("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=Ue("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!sD(e)){const{message:r}=Ue("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=Ue("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(Xs(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=Ue("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class YR extends Wo{constructor(e,r){super(e,r,NR,o1),this.core=e,this.logger=r}}class JR extends Wo{constructor(e,r){super(e,r,RR,o1),this.core=e,this.logger=r}}class QR extends Wo{constructor(e,r){super(e,r,FR,o1,i=>i.id),this.core=e,this.logger=r}}class ZR extends Wo{constructor(e,r){super(e,r,kR,Eh,()=>xh),this.core=e,this.logger=r}}class XR extends Wo{constructor(e,r){super(e,r,jR,Eh),this.core=e,this.logger=r}}class eT extends Wo{constructor(e,r){super(e,r,qR,Eh,i=>i.id),this.core=e,this.logger=r}}class tT{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new ZR(this.core,this.logger),this.pairingTopics=new XR(this.core,this.logger),this.requests=new eT(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class u1 extends FP{constructor(e){super(e),this.protocol=l6,this.version=d6,this.name=a1.name,this.events=new Br.exports.EventEmitter,this.on=(i,n)=>this.events.on(i,n),this.once=(i,n)=>this.events.once(i,n),this.off=(i,n)=>this.events.off(i,n),this.removeListener=(i,n)=>this.events.removeListener(i,n),this.removeAllListeners=i=>this.events.removeAllListeners(i),this.connect=async i=>{try{return await this.engine.connect(i)}catch(n){throw this.logger.error(n.message),n}},this.pair=async i=>{try{return await this.engine.pair(i)}catch(n){throw this.logger.error(n.message),n}},this.approve=async i=>{try{return await this.engine.approve(i)}catch(n){throw this.logger.error(n.message),n}},this.reject=async i=>{try{return await this.engine.reject(i)}catch(n){throw this.logger.error(n.message),n}},this.update=async i=>{try{return await this.engine.update(i)}catch(n){throw this.logger.error(n.message),n}},this.extend=async i=>{try{return await this.engine.extend(i)}catch(n){throw this.logger.error(n.message),n}},this.request=async i=>{try{return await this.engine.request(i)}catch(n){throw this.logger.error(n.message),n}},this.respond=async i=>{try{return await this.engine.respond(i)}catch(n){throw this.logger.error(n.message),n}},this.ping=async i=>{try{return await this.engine.ping(i)}catch(n){throw this.logger.error(n.message),n}},this.emit=async i=>{try{return await this.engine.emit(i)}catch(n){throw this.logger.error(n.message),n}},this.disconnect=async i=>{try{return await this.engine.disconnect(i)}catch(n){throw this.logger.error(n.message),n}},this.find=i=>{try{return this.engine.find(i)}catch(n){throw this.logger.error(n.message),n}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(i){throw this.logger.error(i.message),i}},this.authenticate=async i=>{try{return await this.engine.authenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.formatAuthMessage=i=>{try{return this.engine.formatAuthMessage(i)}catch(n){throw this.logger.error(n.message),n}},this.approveSessionAuthenticate=async i=>{try{return await this.engine.approveSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.rejectSessionAuthenticate=async i=>{try{return await this.engine.rejectSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.name=e?.name||a1.name,this.metadata=e?.metadata||uE(),this.signConfig=e?.signConfig;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:cs(mh({level:e?.logger||a1.logger}));this.core=e?.core||new $R(e),this.logger=xi(r,this.name),this.session=new JR(this.core,this.logger),this.proposal=new YR(this.core,this.logger),this.pendingRequest=new QR(this.core,this.logger),this.engine=new GR(this),this.auth=new tT(this.core,this.logger)}static async init(e){const r=new u1(e);return await r.initialize(),r}get context(){return Ei(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(),await this.auth.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var f1={exports:{}};(function(t,e){var r=typeof self<"u"?self:Gr,i=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(a){var u={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function d(h){return h&&DataView.prototype.isPrototypeOf(h)}if(u.arrayBuffer)var p=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],y=ArrayBuffer.isView||function(h){return h&&p.indexOf(Object.prototype.toString.call(h))>-1};function _(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(h))throw new TypeError("Invalid character in header field name");return h.toLowerCase()}function C(h){return typeof h!="string"&&(h=String(h)),h}function I(h){var g={next:function(){var E=h.shift();return{done:E===void 0,value:E}}};return u.iterable&&(g[Symbol.iterator]=function(){return g}),g}function M(h){this.map={},h instanceof M?h.forEach(function(g,E){this.append(E,g)},this):Array.isArray(h)?h.forEach(function(g){this.append(g[0],g[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(g){this.append(g,h[g])},this)}M.prototype.append=function(h,g){h=_(h),g=C(g);var E=this.map[h];this.map[h]=E?E+", "+g:g},M.prototype.delete=function(h){delete this.map[_(h)]},M.prototype.get=function(h){return h=_(h),this.has(h)?this.map[h]:null},M.prototype.has=function(h){return this.map.hasOwnProperty(_(h))},M.prototype.set=function(h,g){this.map[_(h)]=C(g)},M.prototype.forEach=function(h,g){for(var E in this.map)this.map.hasOwnProperty(E)&&h.call(g,this.map[E],E,this)},M.prototype.keys=function(){var h=[];return this.forEach(function(g,E){h.push(E)}),I(h)},M.prototype.values=function(){var h=[];return this.forEach(function(g){h.push(g)}),I(h)},M.prototype.entries=function(){var h=[];return this.forEach(function(g,E){h.push([E,g])}),I(h)},u.iterable&&(M.prototype[Symbol.iterator]=M.prototype.entries);function B(h){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}function W(h){return new Promise(function(g,E){h.onload=function(){g(h.result)},h.onerror=function(){E(h.error)}})}function Y(h){var g=new FileReader,E=W(g);return g.readAsArrayBuffer(h),E}function q(h){var g=new FileReader,E=W(g);return g.readAsText(h),E}function V(h){for(var g=new Uint8Array(h),E=new Array(g.length),D=0;D<g.length;D++)E[D]=String.fromCharCode(g[D]);return E.join("")}function U(h){if(h.slice)return h.slice(0);var g=new Uint8Array(h.byteLength);return g.set(new Uint8Array(h)),g.buffer}function z(){return this.bodyUsed=!1,this._initBody=function(h){this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:u.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:u.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():u.arrayBuffer&&u.blob&&d(h)?(this._bodyArrayBuffer=U(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||y(h))?this._bodyArrayBuffer=U(h):this._bodyText=h=Object.prototype.toString.call(h):this._bodyText="",this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var h=B(this);if(h)return h;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?B(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Y)}),this.text=function(){var h=B(this);if(h)return h;if(this._bodyBlob)return q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(V(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(ee)}),this.json=function(){return this.text().then(JSON.parse)},this}var K=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function A(h){var g=h.toUpperCase();return K.indexOf(g)>-1?g:h}function j(h,g){g=g||{};var E=g.body;if(h instanceof j){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,g.headers||(this.headers=new M(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!E&&h._bodyInit!=null&&(E=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=g.credentials||this.credentials||"same-origin",(g.headers||!this.headers)&&(this.headers=new M(g.headers)),this.method=A(g.method||this.method||"GET"),this.mode=g.mode||this.mode||null,this.signal=g.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&E)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(E)}j.prototype.clone=function(){return new j(this,{body:this._bodyInit})};function ee(h){var g=new FormData;return h.trim().split("&").forEach(function(E){if(E){var D=E.split("="),P=D.shift().replace(/\+/g," "),x=D.join("=").replace(/\+/g," ");g.append(decodeURIComponent(P),decodeURIComponent(x))}}),g}function re(h){var g=new M,E=h.replace(/\r?\n[\t ]+/g," ");return E.split(/\r?\n/).forEach(function(D){var P=D.split(":"),x=P.shift().trim();if(x){var v=P.join(":").trim();g.append(x,v)}}),g}z.call(j.prototype);function k(h,g){g||(g={}),this.type="default",this.status=g.status===void 0?200:g.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in g?g.statusText:"OK",this.headers=new M(g.headers),this.url=g.url||"",this._initBody(h)}z.call(k.prototype),k.prototype.clone=function(){return new k(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new M(this.headers),url:this.url})},k.error=function(){var h=new k(null,{status:0,statusText:""});return h.type="error",h};var w=[301,302,303,307,308];k.redirect=function(h,g){if(w.indexOf(g)===-1)throw new RangeError("Invalid status code");return new k(null,{status:g,headers:{location:h}})},a.DOMException=s.DOMException;try{new a.DOMException}catch{a.DOMException=function(g,E){this.message=g,this.name=E;var D=Error(g);this.stack=D.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function f(h,g){return new Promise(function(E,D){var P=new j(h,g);if(P.signal&&P.signal.aborted)return D(new a.DOMException("Aborted","AbortError"));var x=new XMLHttpRequest;function v(){x.abort()}x.onload=function(){var b={status:x.status,statusText:x.statusText,headers:re(x.getAllResponseHeaders()||"")};b.url="responseURL"in x?x.responseURL:b.headers.get("X-Request-URL");var L="response"in x?x.response:x.responseText;E(new k(L,b))},x.onerror=function(){D(new TypeError("Network request failed"))},x.ontimeout=function(){D(new TypeError("Network request failed"))},x.onabort=function(){D(new a.DOMException("Aborted","AbortError"))},x.open(P.method,P.url,!0),P.credentials==="include"?x.withCredentials=!0:P.credentials==="omit"&&(x.withCredentials=!1),"responseType"in x&&u.blob&&(x.responseType="blob"),P.headers.forEach(function(b,L){x.setRequestHeader(L,b)}),P.signal&&(P.signal.addEventListener("abort",v),x.onreadystatechange=function(){x.readyState===4&&P.signal.removeEventListener("abort",v)}),x.send(typeof P._bodyInit>"u"?null:P._bodyInit)})}return f.polyfill=!0,s.fetch||(s.fetch=f,s.Headers=M,s.Request=j,s.Response=k),a.Headers=M,a.Request=j,a.Response=k,a.fetch=f,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=i;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,t.exports=e})(f1,f1.exports);var y6=Fg(f1.exports),rT=Object.defineProperty,iT=Object.defineProperties,nT=Object.getOwnPropertyDescriptors,w6=Object.getOwnPropertySymbols,sT=Object.prototype.hasOwnProperty,oT=Object.prototype.propertyIsEnumerable,_6=(t,e,r)=>e in t?rT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A6=(t,e)=>{for(var r in e||(e={}))sT.call(e,r)&&_6(t,r,e[r]);if(w6)for(var r of w6(e))oT.call(e,r)&&_6(t,r,e[r]);return t},E6=(t,e)=>iT(t,nT(e));const aT={Accept:"application/json","Content-Type":"application/json"},cT="POST",x6={headers:aT,method:cT},S6=10;class ds{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new Br.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Ib(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){this.isAvailable||await this.register();try{const r=Is(e),i=await(await y6(this.url,E6(A6({},x6),{body:r}))).json();this.onPayload({data:i})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!Ib(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((i,n)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),n(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return n(new Error("HTTP connection is missing or invalid"));i()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Is({id:1,jsonrpc:"2.0",method:"test",params:[]});await y6(e,E6(A6({},x6),{body:r}))}this.onOpen()}catch(r){const i=this.parseError(r);throw this.events.emit("register_error",i),this.onClose(),i}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Ua(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const i=this.parseError(r),n=i.message||i.toString(),s=wh(e,n);this.events.emit("payload",s)}parseError(e,r=this.url){return wb(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>S6&&this.events.setMaxListeners(S6)}}const I6="error",uT="wss://relay.walletconnect.com",fT="wc",hT="universal_provider",M6=`${fT}@2:${hT}:`,lT="https://rpc.walletconnect.com/v1/",sc="generic",Cn={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Du=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},h1={exports:{}};/**
|
|
44
44
|
* @license
|
|
45
45
|
* Lodash <https://lodash.com/>
|
|
46
46
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
47
47
|
* Released under MIT license <https://lodash.com/license>
|
|
48
48
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
49
49
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
50
|
-
*/(function(e,t){(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,g="__lodash_placeholder__",_=1,E=2,x=4,I=1,F=2,W=1,Y=2,B=4,z=8,P=16,U=32,j=64,m=128,$=256,et=512,tt=30,nt="...",dt=800,d=16,p=1,b=2,C=3,O=1/0,N=9007199254740991,L=17976931348623157e292,D=0/0,v=4294967295,T=v-1,ot=v>>>1,pt=[["ary",m],["bind",W],["bindKey",Y],["curry",z],["curryRight",P],["flip",et],["partial",U],["partialRight",j],["rearg",$]],A="[object Arguments]",rt="[object Array]",q="[object AsyncFunction]",H="[object Boolean]",V="[object Date]",w="[object DOMException]",k="[object Error]",it="[object Function]",ht="[object GeneratorFunction]",lt="[object Map]",Ot="[object Number]",Mt="[object Null]",St="[object Object]",Pe="[object Promise]",zt="[object Proxy]",Dt="[object RegExp]",Ft="[object Set]",Et="[object String]",At="[object Symbol]",Gt="[object Undefined]",bt="[object WeakMap]",xt="[object WeakSet]",Bt="[object ArrayBuffer]",_t="[object DataView]",Pt="[object Float32Array]",jt="[object Float64Array]",$t="[object Int8Array]",Nt="[object Int16Array]",le="[object Int32Array]",Rt="[object Uint8Array]",Tt="[object Uint8ClampedArray]",nr="[object Uint16Array]",de="[object Uint32Array]",Ee=/\b__p \+= '';/g,ir=/\b(__p \+=) '' \+/g,Ie=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Oe=/&(?:amp|lt|gt|quot|#39);/g,Vr=/[&<>"']/g,Yt=RegExp(Oe.source),Ht=RegExp(Vr.source),Re=/<%-([\s\S]+?)%>/g,Qt=/<%([\s\S]+?)%>/g,Vt=/<%=([\s\S]+?)%>/g,Me=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xt=/^\w*$/,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Le=/[\\^$.*+?()[\]{}|]/g,ee=RegExp(Le.source),Jt=/^\s+/,Fe=/\s/,Zt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,kt=/\{\n\/\* \[wrapped with (.+)\] \*/,He=/,? & /,re=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,je=/[()=,{}\[\]\/\s]/,ei=/\\(\\)?/g,ke=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ve=/\w*$/,Tn=/^[-+]0x[0-9a-f]+$/i,Rn=/^0b[01]+$/i,Ln=/^\[object .+?Constructor\]$/,Bn=/^0o[0-7]+$/i,Un=/^(?:0|[1-9]\d*)$/,xr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Pi=/($^)/,fo=/['\n\r\u2028\u2029\\]/g,Mi="\\ud800-\\udfff",po="\\u0300-\\u036f",go="\\ufe20-\\ufe2f",$i="\\u20d0-\\u20ff",Ss=po+go+$i,Cs="\\u2700-\\u27bf",Gr="a-z\\xdf-\\xf6\\xf8-\\xff",mo="\\xac\\xb1\\xd7\\xf7",vo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",wo="\\u2000-\\u206f",yo=" \\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",$u="A-Z\\xc0-\\xd6\\xd8-\\xde",Nu="\\ufe0e\\ufe0f",bo=mo+vo+wo+yo,kc="['\u2019]",_o="["+Mi+"]",qc="["+bo+"]",Eo="["+Ss+"]",Tu="\\d+",Md="["+Cs+"]",Ru="["+Gr+"]",Lu="[^"+Mi+bo+Tu+Cs+Gr+$u+"]",Aa="\\ud83c[\\udffb-\\udfff]",$d="(?:"+Eo+"|"+Aa+")",Bu="[^"+Mi+"]",xa="(?:\\ud83c[\\udde6-\\uddff]){2}",Ds="[\\ud800-\\udbff][\\udc00-\\udfff]",bn="["+$u+"]",Uu="\\u200d",Fu="(?:"+Ru+"|"+Lu+")",Ni="(?:"+bn+"|"+Lu+")",ju="(?:"+kc+"(?:d|ll|m|re|s|t|ve))?",ku="(?:"+kc+"(?:D|LL|M|RE|S|T|VE))?",qu=$d+"?",zu="["+Nu+"]?",Nd="(?:"+Uu+"(?:"+[Bu,xa,Ds].join("|")+")"+zu+qu+")*",Ji="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Hu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ku=zu+qu+Nd,Ia="(?:"+[Md,xa,Ds].join("|")+")"+Ku,Td="(?:"+[Bu+Eo+"?",Eo,xa,Ds,_o].join("|")+")",zc=RegExp(kc,"g"),Rd=RegExp(Eo,"g"),Sa=RegExp(Aa+"(?="+Aa+")|"+Td+Ku,"g"),Wu=RegExp([bn+"?"+Ru+"+"+ju+"(?="+[qc,bn,"$"].join("|")+")",Ni+"+"+ku+"(?="+[qc,bn+Fu,"$"].join("|")+")",bn+"?"+Fu+"+"+ju,bn+"+"+ku,Hu,Ji,Tu,Ia].join("|"),"g"),Vu=RegExp("["+Uu+Mi+Ss+Nu+"]"),Ao=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gu=["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"],Ld=-1,Ve={};Ve[Pt]=Ve[jt]=Ve[$t]=Ve[Nt]=Ve[le]=Ve[Rt]=Ve[Tt]=Ve[nr]=Ve[de]=!0,Ve[A]=Ve[rt]=Ve[Bt]=Ve[H]=Ve[_t]=Ve[V]=Ve[k]=Ve[it]=Ve[lt]=Ve[Ot]=Ve[St]=Ve[Dt]=Ve[Ft]=Ve[Et]=Ve[bt]=!1;var Ke={};Ke[A]=Ke[rt]=Ke[Bt]=Ke[_t]=Ke[H]=Ke[V]=Ke[Pt]=Ke[jt]=Ke[$t]=Ke[Nt]=Ke[le]=Ke[lt]=Ke[Ot]=Ke[St]=Ke[Dt]=Ke[Ft]=Ke[Et]=Ke[At]=Ke[Rt]=Ke[Tt]=Ke[nr]=Ke[de]=!0,Ke[k]=Ke[it]=Ke[bt]=!1;var K={\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"},J={"&":"&","<":"<",">":">",'"':""","'":"'"},ft={"&":"&","<":"<",">":">",""":'"',"'":"'"},It={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ge=parseFloat,oe=parseInt,Xe=typeof _c=="object"&&_c&&_c.Object===Object&&_c,gr=typeof self=="object"&&self&&self.Object===Object&&self,Se=Xe||gr||Function("return this")(),Ye=t&&!t.nodeType&&t,fr=Ye&&!0&&e&&!e.nodeType&&e,ln=fr&&fr.exports===Ye,mr=ln&&Xe.process,tr=function(){try{var Z=fr&&fr.require&&fr.require("util").types;return Z||mr&&mr.binding&&mr.binding("util")}catch{}}(),Yr=tr&&tr.isArrayBuffer,ri=tr&&tr.isDate,Fn=tr&&tr.isMap,Ti=tr&&tr.isRegExp,Hc=tr&&tr.isSet,xo=tr&&tr.isTypedArray;function Ir(Z,at,st){switch(st.length){case 0:return Z.call(at);case 1:return Z.call(at,st[0]);case 2:return Z.call(at,st[0],st[1]);case 3:return Z.call(at,st[0],st[1],st[2])}return Z.apply(at,st)}function F$(Z,at,st,Ct){for(var ie=-1,Ne=Z==null?0:Z.length;++ie<Ne;){var yr=Z[ie];at(Ct,yr,st(yr),Z)}return Ct}function jn(Z,at){for(var st=-1,Ct=Z==null?0:Z.length;++st<Ct&&at(Z[st],st,Z)!==!1;);return Z}function j$(Z,at){for(var st=Z==null?0:Z.length;st--&&at(Z[st],st,Z)!==!1;);return Z}function ry(Z,at){for(var st=-1,Ct=Z==null?0:Z.length;++st<Ct;)if(!at(Z[st],st,Z))return!1;return!0}function Os(Z,at){for(var st=-1,Ct=Z==null?0:Z.length,ie=0,Ne=[];++st<Ct;){var yr=Z[st];at(yr,st,Z)&&(Ne[ie++]=yr)}return Ne}function Yu(Z,at){var st=Z==null?0:Z.length;return!!st&&Ca(Z,at,0)>-1}function Bd(Z,at,st){for(var Ct=-1,ie=Z==null?0:Z.length;++Ct<ie;)if(st(at,Z[Ct]))return!0;return!1}function er(Z,at){for(var st=-1,Ct=Z==null?0:Z.length,ie=Array(Ct);++st<Ct;)ie[st]=at(Z[st],st,Z);return ie}function Ps(Z,at){for(var st=-1,Ct=at.length,ie=Z.length;++st<Ct;)Z[ie+st]=at[st];return Z}function Ud(Z,at,st,Ct){var ie=-1,Ne=Z==null?0:Z.length;for(Ct&&Ne&&(st=Z[++ie]);++ie<Ne;)st=at(st,Z[ie],ie,Z);return st}function k$(Z,at,st,Ct){var ie=Z==null?0:Z.length;for(Ct&&ie&&(st=Z[--ie]);ie--;)st=at(st,Z[ie],ie,Z);return st}function Fd(Z,at){for(var st=-1,Ct=Z==null?0:Z.length;++st<Ct;)if(at(Z[st],st,Z))return!0;return!1}var q$=jd("length");function z$(Z){return Z.split("")}function H$(Z){return Z.match(re)||[]}function ny(Z,at,st){var Ct;return st(Z,function(ie,Ne,yr){if(at(ie,Ne,yr))return Ct=Ne,!1}),Ct}function Qu(Z,at,st,Ct){for(var ie=Z.length,Ne=st+(Ct?1:-1);Ct?Ne--:++Ne<ie;)if(at(Z[Ne],Ne,Z))return Ne;return-1}function Ca(Z,at,st){return at===at?rN(Z,at,st):Qu(Z,iy,st)}function K$(Z,at,st,Ct){for(var ie=st-1,Ne=Z.length;++ie<Ne;)if(Ct(Z[ie],at))return ie;return-1}function iy(Z){return Z!==Z}function sy(Z,at){var st=Z==null?0:Z.length;return st?qd(Z,at)/st:D}function jd(Z){return function(at){return at==null?r:at[Z]}}function kd(Z){return function(at){return Z==null?r:Z[at]}}function oy(Z,at,st,Ct,ie){return ie(Z,function(Ne,yr,Qe){st=Ct?(Ct=!1,Ne):at(st,Ne,yr,Qe)}),st}function W$(Z,at){var st=Z.length;for(Z.sort(at);st--;)Z[st]=Z[st].value;return Z}function qd(Z,at){for(var st,Ct=-1,ie=Z.length;++Ct<ie;){var Ne=at(Z[Ct]);Ne!==r&&(st=st===r?Ne:st+Ne)}return st}function zd(Z,at){for(var st=-1,Ct=Array(Z);++st<Z;)Ct[st]=at(st);return Ct}function V$(Z,at){return er(at,function(st){return[st,Z[st]]})}function ay(Z){return Z&&Z.slice(0,hy(Z)+1).replace(Jt,"")}function _n(Z){return function(at){return Z(at)}}function Hd(Z,at){return er(at,function(st){return Z[st]})}function Kc(Z,at){return Z.has(at)}function cy(Z,at){for(var st=-1,Ct=Z.length;++st<Ct&&Ca(at,Z[st],0)>-1;);return st}function ly(Z,at){for(var st=Z.length;st--&&Ca(at,Z[st],0)>-1;);return st}function G$(Z,at){for(var st=Z.length,Ct=0;st--;)Z[st]===at&&++Ct;return Ct}var Y$=kd(K),Q$=kd(J);function J$(Z){return"\\"+It[Z]}function Z$(Z,at){return Z==null?r:Z[at]}function Da(Z){return Vu.test(Z)}function X$(Z){return Ao.test(Z)}function tN(Z){for(var at,st=[];!(at=Z.next()).done;)st.push(at.value);return st}function Kd(Z){var at=-1,st=Array(Z.size);return Z.forEach(function(Ct,ie){st[++at]=[ie,Ct]}),st}function uy(Z,at){return function(st){return Z(at(st))}}function Ms(Z,at){for(var st=-1,Ct=Z.length,ie=0,Ne=[];++st<Ct;){var yr=Z[st];(yr===at||yr===g)&&(Z[st]=g,Ne[ie++]=st)}return Ne}function Ju(Z){var at=-1,st=Array(Z.size);return Z.forEach(function(Ct){st[++at]=Ct}),st}function eN(Z){var at=-1,st=Array(Z.size);return Z.forEach(function(Ct){st[++at]=[Ct,Ct]}),st}function rN(Z,at,st){for(var Ct=st-1,ie=Z.length;++Ct<ie;)if(Z[Ct]===at)return Ct;return-1}function nN(Z,at,st){for(var Ct=st+1;Ct--;)if(Z[Ct]===at)return Ct;return Ct}function Oa(Z){return Da(Z)?sN(Z):q$(Z)}function ni(Z){return Da(Z)?oN(Z):z$(Z)}function hy(Z){for(var at=Z.length;at--&&Fe.test(Z.charAt(at)););return at}var iN=kd(ft);function sN(Z){for(var at=Sa.lastIndex=0;Sa.test(Z);)++at;return at}function oN(Z){return Z.match(Sa)||[]}function aN(Z){return Z.match(Wu)||[]}var cN=function Z(at){at=at==null?Se:Pa.defaults(Se.Object(),at,Pa.pick(Se,Gu));var st=at.Array,Ct=at.Date,ie=at.Error,Ne=at.Function,yr=at.Math,Qe=at.Object,Wd=at.RegExp,lN=at.String,kn=at.TypeError,Zu=st.prototype,uN=Ne.prototype,Ma=Qe.prototype,Xu=at["__core-js_shared__"],th=uN.toString,qe=Ma.hasOwnProperty,hN=0,fy=function(){var s=/[^.]+$/.exec(Xu&&Xu.keys&&Xu.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),eh=Ma.toString,fN=th.call(Qe),dN=Se._,pN=Wd("^"+th.call(qe).replace(Le,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rh=ln?at.Buffer:r,$s=at.Symbol,nh=at.Uint8Array,dy=rh?rh.allocUnsafe:r,ih=uy(Qe.getPrototypeOf,Qe),py=Qe.create,gy=Ma.propertyIsEnumerable,sh=Zu.splice,my=$s?$s.isConcatSpreadable:r,Wc=$s?$s.iterator:r,Io=$s?$s.toStringTag:r,oh=function(){try{var s=Po(Qe,"defineProperty");return s({},"",{}),s}catch{}}(),gN=at.clearTimeout!==Se.clearTimeout&&at.clearTimeout,mN=Ct&&Ct.now!==Se.Date.now&&Ct.now,vN=at.setTimeout!==Se.setTimeout&&at.setTimeout,ah=yr.ceil,ch=yr.floor,Vd=Qe.getOwnPropertySymbols,wN=rh?rh.isBuffer:r,vy=at.isFinite,yN=Zu.join,bN=uy(Qe.keys,Qe),br=yr.max,Ur=yr.min,_N=Ct.now,EN=at.parseInt,wy=yr.random,AN=Zu.reverse,Gd=Po(at,"DataView"),Vc=Po(at,"Map"),Yd=Po(at,"Promise"),$a=Po(at,"Set"),Gc=Po(at,"WeakMap"),Yc=Po(Qe,"create"),lh=Gc&&new Gc,Na={},xN=Mo(Gd),IN=Mo(Vc),SN=Mo(Yd),CN=Mo($a),DN=Mo(Gc),uh=$s?$s.prototype:r,Qc=uh?uh.valueOf:r,yy=uh?uh.toString:r;function M(s){if(cr(s)&&!ae(s)&&!(s instanceof Ae)){if(s instanceof qn)return s;if(qe.call(s,"__wrapped__"))return bb(s)}return new qn(s)}var Ta=function(){function s(){}return function(a){if(!sr(a))return{};if(py)return py(a);s.prototype=a;var u=new s;return s.prototype=r,u}}();function hh(){}function qn(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=r}M.templateSettings={escape:Re,evaluate:Qt,interpolate:Vt,variable:"",imports:{_:M}},M.prototype=hh.prototype,M.prototype.constructor=M,qn.prototype=Ta(hh.prototype),qn.prototype.constructor=qn;function Ae(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function ON(){var s=new Ae(this.__wrapped__);return s.__actions__=un(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=un(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=un(this.__views__),s}function PN(){if(this.__filtered__){var s=new Ae(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function MN(){var s=this.__wrapped__.value(),a=this.__dir__,u=ae(s),y=a<0,S=u?s.length:0,R=zT(0,S,this.__views__),G=R.start,Q=R.end,X=Q-G,ct=y?Q:G-1,ut=this.__iteratees__,gt=ut.length,wt=0,Lt=Ur(X,this.__takeCount__);if(!u||!y&&S==X&&Lt==X)return zy(s,this.__actions__);var Kt=[];t:for(;X--&&wt<Lt;){ct+=a;for(var pe=-1,Wt=s[ct];++pe<gt;){var ye=ut[pe],Ce=ye.iteratee,xn=ye.type,Zr=Ce(Wt);if(xn==b)Wt=Zr;else if(!Zr){if(xn==p)continue t;break t}}Kt[wt++]=Wt}return Kt}Ae.prototype=Ta(hh.prototype),Ae.prototype.constructor=Ae;function So(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var y=s[a];this.set(y[0],y[1])}}function $N(){this.__data__=Yc?Yc(null):{},this.size=0}function NN(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function TN(s){var a=this.__data__;if(Yc){var u=a[s];return u===f?r:u}return qe.call(a,s)?a[s]:r}function RN(s){var a=this.__data__;return Yc?a[s]!==r:qe.call(a,s)}function LN(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Yc&&a===r?f:a,this}So.prototype.clear=$N,So.prototype.delete=NN,So.prototype.get=TN,So.prototype.has=RN,So.prototype.set=LN;function Zi(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var y=s[a];this.set(y[0],y[1])}}function BN(){this.__data__=[],this.size=0}function UN(s){var a=this.__data__,u=fh(a,s);if(u<0)return!1;var y=a.length-1;return u==y?a.pop():sh.call(a,u,1),--this.size,!0}function FN(s){var a=this.__data__,u=fh(a,s);return u<0?r:a[u][1]}function jN(s){return fh(this.__data__,s)>-1}function kN(s,a){var u=this.__data__,y=fh(u,s);return y<0?(++this.size,u.push([s,a])):u[y][1]=a,this}Zi.prototype.clear=BN,Zi.prototype.delete=UN,Zi.prototype.get=FN,Zi.prototype.has=jN,Zi.prototype.set=kN;function Xi(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var y=s[a];this.set(y[0],y[1])}}function qN(){this.size=0,this.__data__={hash:new So,map:new(Vc||Zi),string:new So}}function zN(s){var a=xh(this,s).delete(s);return this.size-=a?1:0,a}function HN(s){return xh(this,s).get(s)}function KN(s){return xh(this,s).has(s)}function WN(s,a){var u=xh(this,s),y=u.size;return u.set(s,a),this.size+=u.size==y?0:1,this}Xi.prototype.clear=qN,Xi.prototype.delete=zN,Xi.prototype.get=HN,Xi.prototype.has=KN,Xi.prototype.set=WN;function Co(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new Xi;++a<u;)this.add(s[a])}function VN(s){return this.__data__.set(s,f),this}function GN(s){return this.__data__.has(s)}Co.prototype.add=Co.prototype.push=VN,Co.prototype.has=GN;function ii(s){var a=this.__data__=new Zi(s);this.size=a.size}function YN(){this.__data__=new Zi,this.size=0}function QN(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function JN(s){return this.__data__.get(s)}function ZN(s){return this.__data__.has(s)}function XN(s,a){var u=this.__data__;if(u instanceof Zi){var y=u.__data__;if(!Vc||y.length<i-1)return y.push([s,a]),this.size=++u.size,this;u=this.__data__=new Xi(y)}return u.set(s,a),this.size=u.size,this}ii.prototype.clear=YN,ii.prototype.delete=QN,ii.prototype.get=JN,ii.prototype.has=ZN,ii.prototype.set=XN;function by(s,a){var u=ae(s),y=!u&&$o(s),S=!u&&!y&&Bs(s),R=!u&&!y&&!S&&Ua(s),G=u||y||S||R,Q=G?zd(s.length,lN):[],X=Q.length;for(var ct in s)(a||qe.call(s,ct))&&!(G&&(ct=="length"||S&&(ct=="offset"||ct=="parent")||R&&(ct=="buffer"||ct=="byteLength"||ct=="byteOffset")||ns(ct,X)))&&Q.push(ct);return Q}function _y(s){var a=s.length;return a?s[op(0,a-1)]:r}function tT(s,a){return Ih(un(s),Do(a,0,s.length))}function eT(s){return Ih(un(s))}function Qd(s,a,u){(u!==r&&!si(s[a],u)||u===r&&!(a in s))&&ts(s,a,u)}function Jc(s,a,u){var y=s[a];(!(qe.call(s,a)&&si(y,u))||u===r&&!(a in s))&&ts(s,a,u)}function fh(s,a){for(var u=s.length;u--;)if(si(s[u][0],a))return u;return-1}function rT(s,a,u,y){return Ns(s,function(S,R,G){a(y,S,u(S),G)}),y}function Ey(s,a){return s&&Li(a,Sr(a),s)}function nT(s,a){return s&&Li(a,fn(a),s)}function ts(s,a,u){a=="__proto__"&&oh?oh(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function Jd(s,a){for(var u=-1,y=a.length,S=st(y),R=s==null;++u<y;)S[u]=R?r:Mp(s,a[u]);return S}function Do(s,a,u){return s===s&&(u!==r&&(s=s<=u?s:u),a!==r&&(s=s>=a?s:a)),s}function zn(s,a,u,y,S,R){var G,Q=a&_,X=a&E,ct=a&x;if(u&&(G=S?u(s,y,S,R):u(s)),G!==r)return G;if(!sr(s))return s;var ut=ae(s);if(ut){if(G=KT(s),!Q)return un(s,G)}else{var gt=Fr(s),wt=gt==it||gt==ht;if(Bs(s))return Wy(s,Q);if(gt==St||gt==A||wt&&!S){if(G=X||wt?{}:hb(s),!Q)return X?TT(s,nT(G,s)):NT(s,Ey(G,s))}else{if(!Ke[gt])return S?s:{};G=WT(s,gt,Q)}}R||(R=new ii);var Lt=R.get(s);if(Lt)return Lt;R.set(s,G),jb(s)?s.forEach(function(Wt){G.add(zn(Wt,a,u,Wt,s,R))}):Ub(s)&&s.forEach(function(Wt,ye){G.set(ye,zn(Wt,a,u,ye,s,R))});var Kt=ct?X?vp:mp:X?fn:Sr,pe=ut?r:Kt(s);return jn(pe||s,function(Wt,ye){pe&&(ye=Wt,Wt=s[ye]),Jc(G,ye,zn(Wt,a,u,ye,s,R))}),G}function iT(s){var a=Sr(s);return function(u){return Ay(u,s,a)}}function Ay(s,a,u){var y=u.length;if(s==null)return!y;for(s=Qe(s);y--;){var S=u[y],R=a[S],G=s[S];if(G===r&&!(S in s)||!R(G))return!1}return!0}function xy(s,a,u){if(typeof s!="function")throw new kn(c);return il(function(){s.apply(r,u)},a)}function Zc(s,a,u,y){var S=-1,R=Yu,G=!0,Q=s.length,X=[],ct=a.length;if(!Q)return X;u&&(a=er(a,_n(u))),y?(R=Bd,G=!1):a.length>=i&&(R=Kc,G=!1,a=new Co(a));t:for(;++S<Q;){var ut=s[S],gt=u==null?ut:u(ut);if(ut=y||ut!==0?ut:0,G&>===gt){for(var wt=ct;wt--;)if(a[wt]===gt)continue t;X.push(ut)}else R(a,gt,y)||X.push(ut)}return X}var Ns=Jy(Ri),Iy=Jy(Xd,!0);function sT(s,a){var u=!0;return Ns(s,function(y,S,R){return u=!!a(y,S,R),u}),u}function dh(s,a,u){for(var y=-1,S=s.length;++y<S;){var R=s[y],G=a(R);if(G!=null&&(Q===r?G===G&&!An(G):u(G,Q)))var Q=G,X=R}return X}function oT(s,a,u,y){var S=s.length;for(u=fe(u),u<0&&(u=-u>S?0:S+u),y=y===r||y>S?S:fe(y),y<0&&(y+=S),y=u>y?0:qb(y);u<y;)s[u++]=a;return s}function Sy(s,a){var u=[];return Ns(s,function(y,S,R){a(y,S,R)&&u.push(y)}),u}function Tr(s,a,u,y,S){var R=-1,G=s.length;for(u||(u=GT),S||(S=[]);++R<G;){var Q=s[R];a>0&&u(Q)?a>1?Tr(Q,a-1,u,y,S):Ps(S,Q):y||(S[S.length]=Q)}return S}var Zd=Zy(),Cy=Zy(!0);function Ri(s,a){return s&&Zd(s,a,Sr)}function Xd(s,a){return s&&Cy(s,a,Sr)}function ph(s,a){return Os(a,function(u){return is(s[u])})}function Oo(s,a){a=Rs(a,s);for(var u=0,y=a.length;s!=null&&u<y;)s=s[Bi(a[u++])];return u&&u==y?s:r}function Dy(s,a,u){var y=a(s);return ae(s)?y:Ps(y,u(s))}function Qr(s){return s==null?s===r?Gt:Mt:Io&&Io in Qe(s)?qT(s):eR(s)}function tp(s,a){return s>a}function aT(s,a){return s!=null&&qe.call(s,a)}function cT(s,a){return s!=null&&a in Qe(s)}function lT(s,a,u){return s>=Ur(a,u)&&s<br(a,u)}function ep(s,a,u){for(var y=u?Bd:Yu,S=s[0].length,R=s.length,G=R,Q=st(R),X=1/0,ct=[];G--;){var ut=s[G];G&&a&&(ut=er(ut,_n(a))),X=Ur(ut.length,X),Q[G]=!u&&(a||S>=120&&ut.length>=120)?new Co(G&&ut):r}ut=s[0];var gt=-1,wt=Q[0];t:for(;++gt<S&&ct.length<X;){var Lt=ut[gt],Kt=a?a(Lt):Lt;if(Lt=u||Lt!==0?Lt:0,!(wt?Kc(wt,Kt):y(ct,Kt,u))){for(G=R;--G;){var pe=Q[G];if(!(pe?Kc(pe,Kt):y(s[G],Kt,u)))continue t}wt&&wt.push(Kt),ct.push(Lt)}}return ct}function uT(s,a,u,y){return Ri(s,function(S,R,G){a(y,u(S),R,G)}),y}function Xc(s,a,u){a=Rs(a,s),s=gb(s,a);var y=s==null?s:s[Bi(Kn(a))];return y==null?r:Ir(y,s,u)}function Oy(s){return cr(s)&&Qr(s)==A}function hT(s){return cr(s)&&Qr(s)==Bt}function fT(s){return cr(s)&&Qr(s)==V}function tl(s,a,u,y,S){return s===a?!0:s==null||a==null||!cr(s)&&!cr(a)?s!==s&&a!==a:dT(s,a,u,y,tl,S)}function dT(s,a,u,y,S,R){var G=ae(s),Q=ae(a),X=G?rt:Fr(s),ct=Q?rt:Fr(a);X=X==A?St:X,ct=ct==A?St:ct;var ut=X==St,gt=ct==St,wt=X==ct;if(wt&&Bs(s)){if(!Bs(a))return!1;G=!0,ut=!1}if(wt&&!ut)return R||(R=new ii),G||Ua(s)?cb(s,a,u,y,S,R):jT(s,a,X,u,y,S,R);if(!(u&I)){var Lt=ut&&qe.call(s,"__wrapped__"),Kt=gt&&qe.call(a,"__wrapped__");if(Lt||Kt){var pe=Lt?s.value():s,Wt=Kt?a.value():a;return R||(R=new ii),S(pe,Wt,u,y,R)}}return wt?(R||(R=new ii),kT(s,a,u,y,S,R)):!1}function pT(s){return cr(s)&&Fr(s)==lt}function rp(s,a,u,y){var S=u.length,R=S,G=!y;if(s==null)return!R;for(s=Qe(s);S--;){var Q=u[S];if(G&&Q[2]?Q[1]!==s[Q[0]]:!(Q[0]in s))return!1}for(;++S<R;){Q=u[S];var X=Q[0],ct=s[X],ut=Q[1];if(G&&Q[2]){if(ct===r&&!(X in s))return!1}else{var gt=new ii;if(y)var wt=y(ct,ut,X,s,a,gt);if(!(wt===r?tl(ut,ct,I|F,y,gt):wt))return!1}}return!0}function Py(s){if(!sr(s)||QT(s))return!1;var a=is(s)?pN:Ln;return a.test(Mo(s))}function gT(s){return cr(s)&&Qr(s)==Dt}function mT(s){return cr(s)&&Fr(s)==Ft}function vT(s){return cr(s)&&Mh(s.length)&&!!Ve[Qr(s)]}function My(s){return typeof s=="function"?s:s==null?dn:typeof s=="object"?ae(s)?Ty(s[0],s[1]):Ny(s):Xb(s)}function np(s){if(!nl(s))return bN(s);var a=[];for(var u in Qe(s))qe.call(s,u)&&u!="constructor"&&a.push(u);return a}function wT(s){if(!sr(s))return tR(s);var a=nl(s),u=[];for(var y in s)y=="constructor"&&(a||!qe.call(s,y))||u.push(y);return u}function ip(s,a){return s<a}function $y(s,a){var u=-1,y=hn(s)?st(s.length):[];return Ns(s,function(S,R,G){y[++u]=a(S,R,G)}),y}function Ny(s){var a=yp(s);return a.length==1&&a[0][2]?db(a[0][0],a[0][1]):function(u){return u===s||rp(u,s,a)}}function Ty(s,a){return _p(s)&&fb(a)?db(Bi(s),a):function(u){var y=Mp(u,s);return y===r&&y===a?$p(u,s):tl(a,y,I|F)}}function gh(s,a,u,y,S){s!==a&&Zd(a,function(R,G){if(S||(S=new ii),sr(R))yT(s,a,G,u,gh,y,S);else{var Q=y?y(Ap(s,G),R,G+"",s,a,S):r;Q===r&&(Q=R),Qd(s,G,Q)}},fn)}function yT(s,a,u,y,S,R,G){var Q=Ap(s,u),X=Ap(a,u),ct=G.get(X);if(ct){Qd(s,u,ct);return}var ut=R?R(Q,X,u+"",s,a,G):r,gt=ut===r;if(gt){var wt=ae(X),Lt=!wt&&Bs(X),Kt=!wt&&!Lt&&Ua(X);ut=X,wt||Lt||Kt?ae(Q)?ut=Q:dr(Q)?ut=un(Q):Lt?(gt=!1,ut=Wy(X,!0)):Kt?(gt=!1,ut=Vy(X,!0)):ut=[]:sl(X)||$o(X)?(ut=Q,$o(Q)?ut=zb(Q):(!sr(Q)||is(Q))&&(ut=hb(X))):gt=!1}gt&&(G.set(X,ut),S(ut,X,y,R,G),G.delete(X)),Qd(s,u,ut)}function Ry(s,a){var u=s.length;if(u)return a+=a<0?u:0,ns(a,u)?s[a]:r}function Ly(s,a,u){a.length?a=er(a,function(R){return ae(R)?function(G){return Oo(G,R.length===1?R[0]:R)}:R}):a=[dn];var y=-1;a=er(a,_n(qt()));var S=$y(s,function(R,G,Q){var X=er(a,function(ct){return ct(R)});return{criteria:X,index:++y,value:R}});return W$(S,function(R,G){return $T(R,G,u)})}function bT(s,a){return By(s,a,function(u,y){return $p(s,y)})}function By(s,a,u){for(var y=-1,S=a.length,R={};++y<S;){var G=a[y],Q=Oo(s,G);u(Q,G)&&el(R,Rs(G,s),Q)}return R}function _T(s){return function(a){return Oo(a,s)}}function sp(s,a,u,y){var S=y?K$:Ca,R=-1,G=a.length,Q=s;for(s===a&&(a=un(a)),u&&(Q=er(s,_n(u)));++R<G;)for(var X=0,ct=a[R],ut=u?u(ct):ct;(X=S(Q,ut,X,y))>-1;)Q!==s&&sh.call(Q,X,1),sh.call(s,X,1);return s}function Uy(s,a){for(var u=s?a.length:0,y=u-1;u--;){var S=a[u];if(u==y||S!==R){var R=S;ns(S)?sh.call(s,S,1):lp(s,S)}}return s}function op(s,a){return s+ch(wy()*(a-s+1))}function ET(s,a,u,y){for(var S=-1,R=br(ah((a-s)/(u||1)),0),G=st(R);R--;)G[y?R:++S]=s,s+=u;return G}function ap(s,a){var u="";if(!s||a<1||a>N)return u;do a%2&&(u+=s),a=ch(a/2),a&&(s+=s);while(a);return u}function ge(s,a){return xp(pb(s,a,dn),s+"")}function AT(s){return _y(Fa(s))}function xT(s,a){var u=Fa(s);return Ih(u,Do(a,0,u.length))}function el(s,a,u,y){if(!sr(s))return s;a=Rs(a,s);for(var S=-1,R=a.length,G=R-1,Q=s;Q!=null&&++S<R;){var X=Bi(a[S]),ct=u;if(X==="__proto__"||X==="constructor"||X==="prototype")return s;if(S!=G){var ut=Q[X];ct=y?y(ut,X,Q):r,ct===r&&(ct=sr(ut)?ut:ns(a[S+1])?[]:{})}Jc(Q,X,ct),Q=Q[X]}return s}var Fy=lh?function(s,a){return lh.set(s,a),s}:dn,IT=oh?function(s,a){return oh(s,"toString",{configurable:!0,enumerable:!1,value:Tp(a),writable:!0})}:dn;function ST(s){return Ih(Fa(s))}function Hn(s,a,u){var y=-1,S=s.length;a<0&&(a=-a>S?0:S+a),u=u>S?S:u,u<0&&(u+=S),S=a>u?0:u-a>>>0,a>>>=0;for(var R=st(S);++y<S;)R[y]=s[y+a];return R}function CT(s,a){var u;return Ns(s,function(y,S,R){return u=a(y,S,R),!u}),!!u}function mh(s,a,u){var y=0,S=s==null?y:s.length;if(typeof a=="number"&&a===a&&S<=ot){for(;y<S;){var R=y+S>>>1,G=s[R];G!==null&&!An(G)&&(u?G<=a:G<a)?y=R+1:S=R}return S}return cp(s,a,dn,u)}function cp(s,a,u,y){var S=0,R=s==null?0:s.length;if(R===0)return 0;a=u(a);for(var G=a!==a,Q=a===null,X=An(a),ct=a===r;S<R;){var ut=ch((S+R)/2),gt=u(s[ut]),wt=gt!==r,Lt=gt===null,Kt=gt===gt,pe=An(gt);if(G)var Wt=y||Kt;else ct?Wt=Kt&&(y||wt):Q?Wt=Kt&&wt&&(y||!Lt):X?Wt=Kt&&wt&&!Lt&&(y||!pe):Lt||pe?Wt=!1:Wt=y?gt<=a:gt<a;Wt?S=ut+1:R=ut}return Ur(R,T)}function jy(s,a){for(var u=-1,y=s.length,S=0,R=[];++u<y;){var G=s[u],Q=a?a(G):G;if(!u||!si(Q,X)){var X=Q;R[S++]=G===0?0:G}}return R}function ky(s){return typeof s=="number"?s:An(s)?D:+s}function En(s){if(typeof s=="string")return s;if(ae(s))return er(s,En)+"";if(An(s))return yy?yy.call(s):"";var a=s+"";return a=="0"&&1/s==-O?"-0":a}function Ts(s,a,u){var y=-1,S=Yu,R=s.length,G=!0,Q=[],X=Q;if(u)G=!1,S=Bd;else if(R>=i){var ct=a?null:UT(s);if(ct)return Ju(ct);G=!1,S=Kc,X=new Co}else X=a?[]:Q;t:for(;++y<R;){var ut=s[y],gt=a?a(ut):ut;if(ut=u||ut!==0?ut:0,G&>===gt){for(var wt=X.length;wt--;)if(X[wt]===gt)continue t;a&&X.push(gt),Q.push(ut)}else S(X,gt,u)||(X!==Q&&X.push(gt),Q.push(ut))}return Q}function lp(s,a){return a=Rs(a,s),s=gb(s,a),s==null||delete s[Bi(Kn(a))]}function qy(s,a,u,y){return el(s,a,u(Oo(s,a)),y)}function vh(s,a,u,y){for(var S=s.length,R=y?S:-1;(y?R--:++R<S)&&a(s[R],R,s););return u?Hn(s,y?0:R,y?R+1:S):Hn(s,y?R+1:0,y?S:R)}function zy(s,a){var u=s;return u instanceof Ae&&(u=u.value()),Ud(a,function(y,S){return S.func.apply(S.thisArg,Ps([y],S.args))},u)}function up(s,a,u){var y=s.length;if(y<2)return y?Ts(s[0]):[];for(var S=-1,R=st(y);++S<y;)for(var G=s[S],Q=-1;++Q<y;)Q!=S&&(R[S]=Zc(R[S]||G,s[Q],a,u));return Ts(Tr(R,1),a,u)}function Hy(s,a,u){for(var y=-1,S=s.length,R=a.length,G={};++y<S;){var Q=y<R?a[y]:r;u(G,s[y],Q)}return G}function hp(s){return dr(s)?s:[]}function fp(s){return typeof s=="function"?s:dn}function Rs(s,a){return ae(s)?s:_p(s,a)?[s]:yb(Be(s))}var DT=ge;function Ls(s,a,u){var y=s.length;return u=u===r?y:u,!a&&u>=y?s:Hn(s,a,u)}var Ky=gN||function(s){return Se.clearTimeout(s)};function Wy(s,a){if(a)return s.slice();var u=s.length,y=dy?dy(u):new s.constructor(u);return s.copy(y),y}function dp(s){var a=new s.constructor(s.byteLength);return new nh(a).set(new nh(s)),a}function OT(s,a){var u=a?dp(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function PT(s){var a=new s.constructor(s.source,ve.exec(s));return a.lastIndex=s.lastIndex,a}function MT(s){return Qc?Qe(Qc.call(s)):{}}function Vy(s,a){var u=a?dp(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function Gy(s,a){if(s!==a){var u=s!==r,y=s===null,S=s===s,R=An(s),G=a!==r,Q=a===null,X=a===a,ct=An(a);if(!Q&&!ct&&!R&&s>a||R&&G&&X&&!Q&&!ct||y&&G&&X||!u&&X||!S)return 1;if(!y&&!R&&!ct&&s<a||ct&&u&&S&&!y&&!R||Q&&u&&S||!G&&S||!X)return-1}return 0}function $T(s,a,u){for(var y=-1,S=s.criteria,R=a.criteria,G=S.length,Q=u.length;++y<G;){var X=Gy(S[y],R[y]);if(X){if(y>=Q)return X;var ct=u[y];return X*(ct=="desc"?-1:1)}}return s.index-a.index}function Yy(s,a,u,y){for(var S=-1,R=s.length,G=u.length,Q=-1,X=a.length,ct=br(R-G,0),ut=st(X+ct),gt=!y;++Q<X;)ut[Q]=a[Q];for(;++S<G;)(gt||S<R)&&(ut[u[S]]=s[S]);for(;ct--;)ut[Q++]=s[S++];return ut}function Qy(s,a,u,y){for(var S=-1,R=s.length,G=-1,Q=u.length,X=-1,ct=a.length,ut=br(R-Q,0),gt=st(ut+ct),wt=!y;++S<ut;)gt[S]=s[S];for(var Lt=S;++X<ct;)gt[Lt+X]=a[X];for(;++G<Q;)(wt||S<R)&&(gt[Lt+u[G]]=s[S++]);return gt}function un(s,a){var u=-1,y=s.length;for(a||(a=st(y));++u<y;)a[u]=s[u];return a}function Li(s,a,u,y){var S=!u;u||(u={});for(var R=-1,G=a.length;++R<G;){var Q=a[R],X=y?y(u[Q],s[Q],Q,u,s):r;X===r&&(X=s[Q]),S?ts(u,Q,X):Jc(u,Q,X)}return u}function NT(s,a){return Li(s,bp(s),a)}function TT(s,a){return Li(s,lb(s),a)}function wh(s,a){return function(u,y){var S=ae(u)?F$:rT,R=a?a():{};return S(u,s,qt(y,2),R)}}function Ra(s){return ge(function(a,u){var y=-1,S=u.length,R=S>1?u[S-1]:r,G=S>2?u[2]:r;for(R=s.length>3&&typeof R=="function"?(S--,R):r,G&&Jr(u[0],u[1],G)&&(R=S<3?r:R,S=1),a=Qe(a);++y<S;){var Q=u[y];Q&&s(a,Q,y,R)}return a})}function Jy(s,a){return function(u,y){if(u==null)return u;if(!hn(u))return s(u,y);for(var S=u.length,R=a?S:-1,G=Qe(u);(a?R--:++R<S)&&y(G[R],R,G)!==!1;);return u}}function Zy(s){return function(a,u,y){for(var S=-1,R=Qe(a),G=y(a),Q=G.length;Q--;){var X=G[s?Q:++S];if(u(R[X],X,R)===!1)break}return a}}function RT(s,a,u){var y=a&W,S=rl(s);function R(){var G=this&&this!==Se&&this instanceof R?S:s;return G.apply(y?u:this,arguments)}return R}function Xy(s){return function(a){a=Be(a);var u=Da(a)?ni(a):r,y=u?u[0]:a.charAt(0),S=u?Ls(u,1).join(""):a.slice(1);return y[s]()+S}}function La(s){return function(a){return Ud(Jb(Qb(a).replace(zc,"")),s,"")}}function rl(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=Ta(s.prototype),y=s.apply(u,a);return sr(y)?y:u}}function LT(s,a,u){var y=rl(s);function S(){for(var R=arguments.length,G=st(R),Q=R,X=Ba(S);Q--;)G[Q]=arguments[Q];var ct=R<3&&G[0]!==X&&G[R-1]!==X?[]:Ms(G,X);if(R-=ct.length,R<u)return ib(s,a,yh,S.placeholder,r,G,ct,r,r,u-R);var ut=this&&this!==Se&&this instanceof S?y:s;return Ir(ut,this,G)}return S}function tb(s){return function(a,u,y){var S=Qe(a);if(!hn(a)){var R=qt(u,3);a=Sr(a),u=function(Q){return R(S[Q],Q,S)}}var G=s(a,u,y);return G>-1?S[R?a[G]:G]:r}}function eb(s){return rs(function(a){var u=a.length,y=u,S=qn.prototype.thru;for(s&&a.reverse();y--;){var R=a[y];if(typeof R!="function")throw new kn(c);if(S&&!G&&Ah(R)=="wrapper")var G=new qn([],!0)}for(y=G?y:u;++y<u;){R=a[y];var Q=Ah(R),X=Q=="wrapper"?wp(R):r;X&&Ep(X[0])&&X[1]==(m|z|U|$)&&!X[4].length&&X[9]==1?G=G[Ah(X[0])].apply(G,X[3]):G=R.length==1&&Ep(R)?G[Q]():G.thru(R)}return function(){var ct=arguments,ut=ct[0];if(G&&ct.length==1&&ae(ut))return G.plant(ut).value();for(var gt=0,wt=u?a[gt].apply(this,ct):ut;++gt<u;)wt=a[gt].call(this,wt);return wt}})}function yh(s,a,u,y,S,R,G,Q,X,ct){var ut=a&m,gt=a&W,wt=a&Y,Lt=a&(z|P),Kt=a&et,pe=wt?r:rl(s);function Wt(){for(var ye=arguments.length,Ce=st(ye),xn=ye;xn--;)Ce[xn]=arguments[xn];if(Lt)var Zr=Ba(Wt),In=G$(Ce,Zr);if(y&&(Ce=Yy(Ce,y,S,Lt)),R&&(Ce=Qy(Ce,R,G,Lt)),ye-=In,Lt&&ye<ct){var pr=Ms(Ce,Zr);return ib(s,a,yh,Wt.placeholder,u,Ce,pr,Q,X,ct-ye)}var oi=gt?u:this,os=wt?oi[s]:s;return ye=Ce.length,Q?Ce=rR(Ce,Q):Kt&&ye>1&&Ce.reverse(),ut&&X<ye&&(Ce.length=X),this&&this!==Se&&this instanceof Wt&&(os=pe||rl(os)),os.apply(oi,Ce)}return Wt}function rb(s,a){return function(u,y){return uT(u,s,a(y),{})}}function bh(s,a){return function(u,y){var S;if(u===r&&y===r)return a;if(u!==r&&(S=u),y!==r){if(S===r)return y;typeof u=="string"||typeof y=="string"?(u=En(u),y=En(y)):(u=ky(u),y=ky(y)),S=s(u,y)}return S}}function pp(s){return rs(function(a){return a=er(a,_n(qt())),ge(function(u){var y=this;return s(a,function(S){return Ir(S,y,u)})})})}function _h(s,a){a=a===r?" ":En(a);var u=a.length;if(u<2)return u?ap(a,s):a;var y=ap(a,ah(s/Oa(a)));return Da(a)?Ls(ni(y),0,s).join(""):y.slice(0,s)}function BT(s,a,u,y){var S=a&W,R=rl(s);function G(){for(var Q=-1,X=arguments.length,ct=-1,ut=y.length,gt=st(ut+X),wt=this&&this!==Se&&this instanceof G?R:s;++ct<ut;)gt[ct]=y[ct];for(;X--;)gt[ct++]=arguments[++Q];return Ir(wt,S?u:this,gt)}return G}function nb(s){return function(a,u,y){return y&&typeof y!="number"&&Jr(a,u,y)&&(u=y=r),a=ss(a),u===r?(u=a,a=0):u=ss(u),y=y===r?a<u?1:-1:ss(y),ET(a,u,y,s)}}function Eh(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=Wn(a),u=Wn(u)),s(a,u)}}function ib(s,a,u,y,S,R,G,Q,X,ct){var ut=a&z,gt=ut?G:r,wt=ut?r:G,Lt=ut?R:r,Kt=ut?r:R;a|=ut?U:j,a&=~(ut?j:U),a&B||(a&=~(W|Y));var pe=[s,a,S,Lt,gt,Kt,wt,Q,X,ct],Wt=u.apply(r,pe);return Ep(s)&&mb(Wt,pe),Wt.placeholder=y,vb(Wt,s,a)}function gp(s){var a=yr[s];return function(u,y){if(u=Wn(u),y=y==null?0:Ur(fe(y),292),y&&vy(u)){var S=(Be(u)+"e").split("e"),R=a(S[0]+"e"+(+S[1]+y));return S=(Be(R)+"e").split("e"),+(S[0]+"e"+(+S[1]-y))}return a(u)}}var UT=$a&&1/Ju(new $a([,-0]))[1]==O?function(s){return new $a(s)}:Bp;function sb(s){return function(a){var u=Fr(a);return u==lt?Kd(a):u==Ft?eN(a):V$(a,s(a))}}function es(s,a,u,y,S,R,G,Q){var X=a&Y;if(!X&&typeof s!="function")throw new kn(c);var ct=y?y.length:0;if(ct||(a&=~(U|j),y=S=r),G=G===r?G:br(fe(G),0),Q=Q===r?Q:fe(Q),ct-=S?S.length:0,a&j){var ut=y,gt=S;y=S=r}var wt=X?r:wp(s),Lt=[s,a,u,y,S,ut,gt,R,G,Q];if(wt&&XT(Lt,wt),s=Lt[0],a=Lt[1],u=Lt[2],y=Lt[3],S=Lt[4],Q=Lt[9]=Lt[9]===r?X?0:s.length:br(Lt[9]-ct,0),!Q&&a&(z|P)&&(a&=~(z|P)),!a||a==W)var Kt=RT(s,a,u);else a==z||a==P?Kt=LT(s,a,Q):(a==U||a==(W|U))&&!S.length?Kt=BT(s,a,u,y):Kt=yh.apply(r,Lt);var pe=wt?Fy:mb;return vb(pe(Kt,Lt),s,a)}function ob(s,a,u,y){return s===r||si(s,Ma[u])&&!qe.call(y,u)?a:s}function ab(s,a,u,y,S,R){return sr(s)&&sr(a)&&(R.set(a,s),gh(s,a,r,ab,R),R.delete(a)),s}function FT(s){return sl(s)?r:s}function cb(s,a,u,y,S,R){var G=u&I,Q=s.length,X=a.length;if(Q!=X&&!(G&&X>Q))return!1;var ct=R.get(s),ut=R.get(a);if(ct&&ut)return ct==a&&ut==s;var gt=-1,wt=!0,Lt=u&F?new Co:r;for(R.set(s,a),R.set(a,s);++gt<Q;){var Kt=s[gt],pe=a[gt];if(y)var Wt=G?y(pe,Kt,gt,a,s,R):y(Kt,pe,gt,s,a,R);if(Wt!==r){if(Wt)continue;wt=!1;break}if(Lt){if(!Fd(a,function(ye,Ce){if(!Kc(Lt,Ce)&&(Kt===ye||S(Kt,ye,u,y,R)))return Lt.push(Ce)})){wt=!1;break}}else if(!(Kt===pe||S(Kt,pe,u,y,R))){wt=!1;break}}return R.delete(s),R.delete(a),wt}function jT(s,a,u,y,S,R,G){switch(u){case _t:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case Bt:return!(s.byteLength!=a.byteLength||!R(new nh(s),new nh(a)));case H:case V:case Ot:return si(+s,+a);case k:return s.name==a.name&&s.message==a.message;case Dt:case Et:return s==a+"";case lt:var Q=Kd;case Ft:var X=y&I;if(Q||(Q=Ju),s.size!=a.size&&!X)return!1;var ct=G.get(s);if(ct)return ct==a;y|=F,G.set(s,a);var ut=cb(Q(s),Q(a),y,S,R,G);return G.delete(s),ut;case At:if(Qc)return Qc.call(s)==Qc.call(a)}return!1}function kT(s,a,u,y,S,R){var G=u&I,Q=mp(s),X=Q.length,ct=mp(a),ut=ct.length;if(X!=ut&&!G)return!1;for(var gt=X;gt--;){var wt=Q[gt];if(!(G?wt in a:qe.call(a,wt)))return!1}var Lt=R.get(s),Kt=R.get(a);if(Lt&&Kt)return Lt==a&&Kt==s;var pe=!0;R.set(s,a),R.set(a,s);for(var Wt=G;++gt<X;){wt=Q[gt];var ye=s[wt],Ce=a[wt];if(y)var xn=G?y(Ce,ye,wt,a,s,R):y(ye,Ce,wt,s,a,R);if(!(xn===r?ye===Ce||S(ye,Ce,u,y,R):xn)){pe=!1;break}Wt||(Wt=wt=="constructor")}if(pe&&!Wt){var Zr=s.constructor,In=a.constructor;Zr!=In&&"constructor"in s&&"constructor"in a&&!(typeof Zr=="function"&&Zr instanceof Zr&&typeof In=="function"&&In instanceof In)&&(pe=!1)}return R.delete(s),R.delete(a),pe}function rs(s){return xp(pb(s,r,Ab),s+"")}function mp(s){return Dy(s,Sr,bp)}function vp(s){return Dy(s,fn,lb)}var wp=lh?function(s){return lh.get(s)}:Bp;function Ah(s){for(var a=s.name+"",u=Na[a],y=qe.call(Na,a)?u.length:0;y--;){var S=u[y],R=S.func;if(R==null||R==s)return S.name}return a}function Ba(s){var a=qe.call(M,"placeholder")?M:s;return a.placeholder}function qt(){var s=M.iteratee||Rp;return s=s===Rp?My:s,arguments.length?s(arguments[0],arguments[1]):s}function xh(s,a){var u=s.__data__;return YT(a)?u[typeof a=="string"?"string":"hash"]:u.map}function yp(s){for(var a=Sr(s),u=a.length;u--;){var y=a[u],S=s[y];a[u]=[y,S,fb(S)]}return a}function Po(s,a){var u=Z$(s,a);return Py(u)?u:r}function qT(s){var a=qe.call(s,Io),u=s[Io];try{s[Io]=r;var y=!0}catch{}var S=eh.call(s);return y&&(a?s[Io]=u:delete s[Io]),S}var bp=Vd?function(s){return s==null?[]:(s=Qe(s),Os(Vd(s),function(a){return gy.call(s,a)}))}:Up,lb=Vd?function(s){for(var a=[];s;)Ps(a,bp(s)),s=ih(s);return a}:Up,Fr=Qr;(Gd&&Fr(new Gd(new ArrayBuffer(1)))!=_t||Vc&&Fr(new Vc)!=lt||Yd&&Fr(Yd.resolve())!=Pe||$a&&Fr(new $a)!=Ft||Gc&&Fr(new Gc)!=bt)&&(Fr=function(s){var a=Qr(s),u=a==St?s.constructor:r,y=u?Mo(u):"";if(y)switch(y){case xN:return _t;case IN:return lt;case SN:return Pe;case CN:return Ft;case DN:return bt}return a});function zT(s,a,u){for(var y=-1,S=u.length;++y<S;){var R=u[y],G=R.size;switch(R.type){case"drop":s+=G;break;case"dropRight":a-=G;break;case"take":a=Ur(a,s+G);break;case"takeRight":s=br(s,a-G);break}}return{start:s,end:a}}function HT(s){var a=s.match(kt);return a?a[1].split(He):[]}function ub(s,a,u){a=Rs(a,s);for(var y=-1,S=a.length,R=!1;++y<S;){var G=Bi(a[y]);if(!(R=s!=null&&u(s,G)))break;s=s[G]}return R||++y!=S?R:(S=s==null?0:s.length,!!S&&Mh(S)&&ns(G,S)&&(ae(s)||$o(s)))}function KT(s){var a=s.length,u=new s.constructor(a);return a&&typeof s[0]=="string"&&qe.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function hb(s){return typeof s.constructor=="function"&&!nl(s)?Ta(ih(s)):{}}function WT(s,a,u){var y=s.constructor;switch(a){case Bt:return dp(s);case H:case V:return new y(+s);case _t:return OT(s,u);case Pt:case jt:case $t:case Nt:case le:case Rt:case Tt:case nr:case de:return Vy(s,u);case lt:return new y;case Ot:case Et:return new y(s);case Dt:return PT(s);case Ft:return new y;case At:return MT(s)}}function VT(s,a){var u=a.length;if(!u)return s;var y=u-1;return a[y]=(u>1?"& ":"")+a[y],a=a.join(u>2?", ":" "),s.replace(Zt,`{
|
|
51
|
-
/* [wrapped with `+
|
|
52
|
-
`)}function GT(s){return ae(s)||$o(s)||!!(my&&s&&s[my])}function ns(s,a){var u=typeof s;return a=a??N,!!a&&(u=="number"||u!="symbol"&&Un.test(s))&&s>-1&&s%1==0&&s<a}function Jr(s,a,u){if(!sr(u))return!1;var y=typeof a;return(y=="number"?hn(u)&&ns(a,u.length):y=="string"&&a in u)?si(u[a],s):!1}function _p(s,a){if(ae(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||An(s)?!0:Xt.test(s)||!Me.test(s)||a!=null&&s in Qe(a)}function YT(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function Ep(s){var a=Ah(s),u=M[a];if(typeof u!="function"||!(a in Ae.prototype))return!1;if(s===u)return!0;var y=wp(u);return!!y&&s===y[0]}function QT(s){return!!fy&&fy in s}var JT=Xu?is:Fp;function nl(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||Ma;return s===u}function fb(s){return s===s&&!sr(s)}function db(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==r||s in Qe(u))}}function ZT(s){var a=Oh(s,function(y){return u.size===h&&u.clear(),y}),u=a.cache;return a}function XT(s,a){var u=s[1],y=a[1],S=u|y,R=S<(W|Y|m),G=y==m&&u==z||y==m&&u==$&&s[7].length<=a[8]||y==(m|$)&&a[7].length<=a[8]&&u==z;if(!(R||G))return s;y&W&&(s[2]=a[2],S|=u&W?0:B);var Q=a[3];if(Q){var X=s[3];s[3]=X?Yy(X,Q,a[4]):Q,s[4]=X?Ms(s[3],g):a[4]}return Q=a[5],Q&&(X=s[5],s[5]=X?Qy(X,Q,a[6]):Q,s[6]=X?Ms(s[5],g):a[6]),Q=a[7],Q&&(s[7]=Q),y&m&&(s[8]=s[8]==null?a[8]:Ur(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=S,s}function tR(s){var a=[];if(s!=null)for(var u in Qe(s))a.push(u);return a}function eR(s){return eh.call(s)}function pb(s,a,u){return a=br(a===r?s.length-1:a,0),function(){for(var y=arguments,S=-1,R=br(y.length-a,0),G=st(R);++S<R;)G[S]=y[a+S];S=-1;for(var Q=st(a+1);++S<a;)Q[S]=y[S];return Q[a]=u(G),Ir(s,this,Q)}}function gb(s,a){return a.length<2?s:Oo(s,Hn(a,0,-1))}function rR(s,a){for(var u=s.length,y=Ur(a.length,u),S=un(s);y--;){var R=a[y];s[y]=ns(R,u)?S[R]:r}return s}function Ap(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var mb=wb(Fy),il=vN||function(s,a){return Se.setTimeout(s,a)},xp=wb(IT);function vb(s,a,u){var y=a+"";return xp(s,VT(y,nR(HT(y),u)))}function wb(s){var a=0,u=0;return function(){var y=_N(),S=d-(y-u);if(u=y,S>0){if(++a>=dt)return arguments[0]}else a=0;return s.apply(r,arguments)}}function Ih(s,a){var u=-1,y=s.length,S=y-1;for(a=a===r?y:a;++u<a;){var R=op(u,S),G=s[R];s[R]=s[u],s[u]=G}return s.length=a,s}var yb=ZT(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(te,function(u,y,S,R){a.push(S?R.replace(ei,"$1"):y||u)}),a});function Bi(s){if(typeof s=="string"||An(s))return s;var a=s+"";return a=="0"&&1/s==-O?"-0":a}function Mo(s){if(s!=null){try{return th.call(s)}catch{}try{return s+""}catch{}}return""}function nR(s,a){return jn(pt,function(u){var y="_."+u[0];a&u[1]&&!Yu(s,y)&&s.push(y)}),s.sort()}function bb(s){if(s instanceof Ae)return s.clone();var a=new qn(s.__wrapped__,s.__chain__);return a.__actions__=un(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function iR(s,a,u){(u?Jr(s,a,u):a===r)?a=1:a=br(fe(a),0);var y=s==null?0:s.length;if(!y||a<1)return[];for(var S=0,R=0,G=st(ah(y/a));S<y;)G[R++]=Hn(s,S,S+=a);return G}function sR(s){for(var a=-1,u=s==null?0:s.length,y=0,S=[];++a<u;){var R=s[a];R&&(S[y++]=R)}return S}function oR(){var s=arguments.length;if(!s)return[];for(var a=st(s-1),u=arguments[0],y=s;y--;)a[y-1]=arguments[y];return Ps(ae(u)?un(u):[u],Tr(a,1))}var aR=ge(function(s,a){return dr(s)?Zc(s,Tr(a,1,dr,!0)):[]}),cR=ge(function(s,a){var u=Kn(a);return dr(u)&&(u=r),dr(s)?Zc(s,Tr(a,1,dr,!0),qt(u,2)):[]}),lR=ge(function(s,a){var u=Kn(a);return dr(u)&&(u=r),dr(s)?Zc(s,Tr(a,1,dr,!0),r,u):[]});function uR(s,a,u){var y=s==null?0:s.length;return y?(a=u||a===r?1:fe(a),Hn(s,a<0?0:a,y)):[]}function hR(s,a,u){var y=s==null?0:s.length;return y?(a=u||a===r?1:fe(a),a=y-a,Hn(s,0,a<0?0:a)):[]}function fR(s,a){return s&&s.length?vh(s,qt(a,3),!0,!0):[]}function dR(s,a){return s&&s.length?vh(s,qt(a,3),!0):[]}function pR(s,a,u,y){var S=s==null?0:s.length;return S?(u&&typeof u!="number"&&Jr(s,a,u)&&(u=0,y=S),oT(s,a,u,y)):[]}function _b(s,a,u){var y=s==null?0:s.length;if(!y)return-1;var S=u==null?0:fe(u);return S<0&&(S=br(y+S,0)),Qu(s,qt(a,3),S)}function Eb(s,a,u){var y=s==null?0:s.length;if(!y)return-1;var S=y-1;return u!==r&&(S=fe(u),S=u<0?br(y+S,0):Ur(S,y-1)),Qu(s,qt(a,3),S,!0)}function Ab(s){var a=s==null?0:s.length;return a?Tr(s,1):[]}function gR(s){var a=s==null?0:s.length;return a?Tr(s,O):[]}function mR(s,a){var u=s==null?0:s.length;return u?(a=a===r?1:fe(a),Tr(s,a)):[]}function vR(s){for(var a=-1,u=s==null?0:s.length,y={};++a<u;){var S=s[a];y[S[0]]=S[1]}return y}function xb(s){return s&&s.length?s[0]:r}function wR(s,a,u){var y=s==null?0:s.length;if(!y)return-1;var S=u==null?0:fe(u);return S<0&&(S=br(y+S,0)),Ca(s,a,S)}function yR(s){var a=s==null?0:s.length;return a?Hn(s,0,-1):[]}var bR=ge(function(s){var a=er(s,hp);return a.length&&a[0]===s[0]?ep(a):[]}),_R=ge(function(s){var a=Kn(s),u=er(s,hp);return a===Kn(u)?a=r:u.pop(),u.length&&u[0]===s[0]?ep(u,qt(a,2)):[]}),ER=ge(function(s){var a=Kn(s),u=er(s,hp);return a=typeof a=="function"?a:r,a&&u.pop(),u.length&&u[0]===s[0]?ep(u,r,a):[]});function AR(s,a){return s==null?"":yN.call(s,a)}function Kn(s){var a=s==null?0:s.length;return a?s[a-1]:r}function xR(s,a,u){var y=s==null?0:s.length;if(!y)return-1;var S=y;return u!==r&&(S=fe(u),S=S<0?br(y+S,0):Ur(S,y-1)),a===a?nN(s,a,S):Qu(s,iy,S,!0)}function IR(s,a){return s&&s.length?Ry(s,fe(a)):r}var SR=ge(Ib);function Ib(s,a){return s&&s.length&&a&&a.length?sp(s,a):s}function CR(s,a,u){return s&&s.length&&a&&a.length?sp(s,a,qt(u,2)):s}function DR(s,a,u){return s&&s.length&&a&&a.length?sp(s,a,r,u):s}var OR=rs(function(s,a){var u=s==null?0:s.length,y=Jd(s,a);return Uy(s,er(a,function(S){return ns(S,u)?+S:S}).sort(Gy)),y});function PR(s,a){var u=[];if(!(s&&s.length))return u;var y=-1,S=[],R=s.length;for(a=qt(a,3);++y<R;){var G=s[y];a(G,y,s)&&(u.push(G),S.push(y))}return Uy(s,S),u}function Ip(s){return s==null?s:AN.call(s)}function MR(s,a,u){var y=s==null?0:s.length;return y?(u&&typeof u!="number"&&Jr(s,a,u)?(a=0,u=y):(a=a==null?0:fe(a),u=u===r?y:fe(u)),Hn(s,a,u)):[]}function $R(s,a){return mh(s,a)}function NR(s,a,u){return cp(s,a,qt(u,2))}function TR(s,a){var u=s==null?0:s.length;if(u){var y=mh(s,a);if(y<u&&si(s[y],a))return y}return-1}function RR(s,a){return mh(s,a,!0)}function LR(s,a,u){return cp(s,a,qt(u,2),!0)}function BR(s,a){var u=s==null?0:s.length;if(u){var y=mh(s,a,!0)-1;if(si(s[y],a))return y}return-1}function UR(s){return s&&s.length?jy(s):[]}function FR(s,a){return s&&s.length?jy(s,qt(a,2)):[]}function jR(s){var a=s==null?0:s.length;return a?Hn(s,1,a):[]}function kR(s,a,u){return s&&s.length?(a=u||a===r?1:fe(a),Hn(s,0,a<0?0:a)):[]}function qR(s,a,u){var y=s==null?0:s.length;return y?(a=u||a===r?1:fe(a),a=y-a,Hn(s,a<0?0:a,y)):[]}function zR(s,a){return s&&s.length?vh(s,qt(a,3),!1,!0):[]}function HR(s,a){return s&&s.length?vh(s,qt(a,3)):[]}var KR=ge(function(s){return Ts(Tr(s,1,dr,!0))}),WR=ge(function(s){var a=Kn(s);return dr(a)&&(a=r),Ts(Tr(s,1,dr,!0),qt(a,2))}),VR=ge(function(s){var a=Kn(s);return a=typeof a=="function"?a:r,Ts(Tr(s,1,dr,!0),r,a)});function GR(s){return s&&s.length?Ts(s):[]}function YR(s,a){return s&&s.length?Ts(s,qt(a,2)):[]}function QR(s,a){return a=typeof a=="function"?a:r,s&&s.length?Ts(s,r,a):[]}function Sp(s){if(!(s&&s.length))return[];var a=0;return s=Os(s,function(u){if(dr(u))return a=br(u.length,a),!0}),zd(a,function(u){return er(s,jd(u))})}function Sb(s,a){if(!(s&&s.length))return[];var u=Sp(s);return a==null?u:er(u,function(y){return Ir(a,r,y)})}var JR=ge(function(s,a){return dr(s)?Zc(s,a):[]}),ZR=ge(function(s){return up(Os(s,dr))}),XR=ge(function(s){var a=Kn(s);return dr(a)&&(a=r),up(Os(s,dr),qt(a,2))}),tL=ge(function(s){var a=Kn(s);return a=typeof a=="function"?a:r,up(Os(s,dr),r,a)}),eL=ge(Sp);function rL(s,a){return Hy(s||[],a||[],Jc)}function nL(s,a){return Hy(s||[],a||[],el)}var iL=ge(function(s){var a=s.length,u=a>1?s[a-1]:r;return u=typeof u=="function"?(s.pop(),u):r,Sb(s,u)});function Cb(s){var a=M(s);return a.__chain__=!0,a}function sL(s,a){return a(s),s}function Sh(s,a){return a(s)}var oL=rs(function(s){var a=s.length,u=a?s[0]:0,y=this.__wrapped__,S=function(R){return Jd(R,s)};return a>1||this.__actions__.length||!(y instanceof Ae)||!ns(u)?this.thru(S):(y=y.slice(u,+u+(a?1:0)),y.__actions__.push({func:Sh,args:[S],thisArg:r}),new qn(y,this.__chain__).thru(function(R){return a&&!R.length&&R.push(r),R}))});function aL(){return Cb(this)}function cL(){return new qn(this.value(),this.__chain__)}function lL(){this.__values__===r&&(this.__values__=kb(this.value()));var s=this.__index__>=this.__values__.length,a=s?r:this.__values__[this.__index__++];return{done:s,value:a}}function uL(){return this}function hL(s){for(var a,u=this;u instanceof hh;){var y=bb(u);y.__index__=0,y.__values__=r,a?S.__wrapped__=y:a=y;var S=y;u=u.__wrapped__}return S.__wrapped__=s,a}function fL(){var s=this.__wrapped__;if(s instanceof Ae){var a=s;return this.__actions__.length&&(a=new Ae(this)),a=a.reverse(),a.__actions__.push({func:Sh,args:[Ip],thisArg:r}),new qn(a,this.__chain__)}return this.thru(Ip)}function dL(){return zy(this.__wrapped__,this.__actions__)}var pL=wh(function(s,a,u){qe.call(s,u)?++s[u]:ts(s,u,1)});function gL(s,a,u){var y=ae(s)?ry:sT;return u&&Jr(s,a,u)&&(a=r),y(s,qt(a,3))}function mL(s,a){var u=ae(s)?Os:Sy;return u(s,qt(a,3))}var vL=tb(_b),wL=tb(Eb);function yL(s,a){return Tr(Ch(s,a),1)}function bL(s,a){return Tr(Ch(s,a),O)}function _L(s,a,u){return u=u===r?1:fe(u),Tr(Ch(s,a),u)}function Db(s,a){var u=ae(s)?jn:Ns;return u(s,qt(a,3))}function Ob(s,a){var u=ae(s)?j$:Iy;return u(s,qt(a,3))}var EL=wh(function(s,a,u){qe.call(s,u)?s[u].push(a):ts(s,u,[a])});function AL(s,a,u,y){s=hn(s)?s:Fa(s),u=u&&!y?fe(u):0;var S=s.length;return u<0&&(u=br(S+u,0)),$h(s)?u<=S&&s.indexOf(a,u)>-1:!!S&&Ca(s,a,u)>-1}var xL=ge(function(s,a,u){var y=-1,S=typeof a=="function",R=hn(s)?st(s.length):[];return Ns(s,function(G){R[++y]=S?Ir(a,G,u):Xc(G,a,u)}),R}),IL=wh(function(s,a,u){ts(s,u,a)});function Ch(s,a){var u=ae(s)?er:$y;return u(s,qt(a,3))}function SL(s,a,u,y){return s==null?[]:(ae(a)||(a=a==null?[]:[a]),u=y?r:u,ae(u)||(u=u==null?[]:[u]),Ly(s,a,u))}var CL=wh(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function DL(s,a,u){var y=ae(s)?Ud:oy,S=arguments.length<3;return y(s,qt(a,4),u,S,Ns)}function OL(s,a,u){var y=ae(s)?k$:oy,S=arguments.length<3;return y(s,qt(a,4),u,S,Iy)}function PL(s,a){var u=ae(s)?Os:Sy;return u(s,Ph(qt(a,3)))}function ML(s){var a=ae(s)?_y:AT;return a(s)}function $L(s,a,u){(u?Jr(s,a,u):a===r)?a=1:a=fe(a);var y=ae(s)?tT:xT;return y(s,a)}function NL(s){var a=ae(s)?eT:ST;return a(s)}function TL(s){if(s==null)return 0;if(hn(s))return $h(s)?Oa(s):s.length;var a=Fr(s);return a==lt||a==Ft?s.size:np(s).length}function RL(s,a,u){var y=ae(s)?Fd:CT;return u&&Jr(s,a,u)&&(a=r),y(s,qt(a,3))}var LL=ge(function(s,a){if(s==null)return[];var u=a.length;return u>1&&Jr(s,a[0],a[1])?a=[]:u>2&&Jr(a[0],a[1],a[2])&&(a=[a[0]]),Ly(s,Tr(a,1),[])}),Dh=mN||function(){return Se.Date.now()};function BL(s,a){if(typeof a!="function")throw new kn(c);return s=fe(s),function(){if(--s<1)return a.apply(this,arguments)}}function Pb(s,a,u){return a=u?r:a,a=s&&a==null?s.length:a,es(s,m,r,r,r,r,a)}function Mb(s,a){var u;if(typeof a!="function")throw new kn(c);return s=fe(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=r),u}}var Cp=ge(function(s,a,u){var y=W;if(u.length){var S=Ms(u,Ba(Cp));y|=U}return es(s,y,a,u,S)}),$b=ge(function(s,a,u){var y=W|Y;if(u.length){var S=Ms(u,Ba($b));y|=U}return es(a,y,s,u,S)});function Nb(s,a,u){a=u?r:a;var y=es(s,z,r,r,r,r,r,a);return y.placeholder=Nb.placeholder,y}function Tb(s,a,u){a=u?r:a;var y=es(s,P,r,r,r,r,r,a);return y.placeholder=Tb.placeholder,y}function Rb(s,a,u){var y,S,R,G,Q,X,ct=0,ut=!1,gt=!1,wt=!0;if(typeof s!="function")throw new kn(c);a=Wn(a)||0,sr(u)&&(ut=!!u.leading,gt="maxWait"in u,R=gt?br(Wn(u.maxWait)||0,a):R,wt="trailing"in u?!!u.trailing:wt);function Lt(pr){var oi=y,os=S;return y=S=r,ct=pr,G=s.apply(os,oi),G}function Kt(pr){return ct=pr,Q=il(ye,a),ut?Lt(pr):G}function pe(pr){var oi=pr-X,os=pr-ct,t3=a-oi;return gt?Ur(t3,R-os):t3}function Wt(pr){var oi=pr-X,os=pr-ct;return X===r||oi>=a||oi<0||gt&&os>=R}function ye(){var pr=Dh();if(Wt(pr))return Ce(pr);Q=il(ye,pe(pr))}function Ce(pr){return Q=r,wt&&y?Lt(pr):(y=S=r,G)}function xn(){Q!==r&&Ky(Q),ct=0,y=X=S=Q=r}function Zr(){return Q===r?G:Ce(Dh())}function In(){var pr=Dh(),oi=Wt(pr);if(y=arguments,S=this,X=pr,oi){if(Q===r)return Kt(X);if(gt)return Ky(Q),Q=il(ye,a),Lt(X)}return Q===r&&(Q=il(ye,a)),G}return In.cancel=xn,In.flush=Zr,In}var UL=ge(function(s,a){return xy(s,1,a)}),FL=ge(function(s,a,u){return xy(s,Wn(a)||0,u)});function jL(s){return es(s,et)}function Oh(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new kn(c);var u=function(){var y=arguments,S=a?a.apply(this,y):y[0],R=u.cache;if(R.has(S))return R.get(S);var G=s.apply(this,y);return u.cache=R.set(S,G)||R,G};return u.cache=new(Oh.Cache||Xi),u}Oh.Cache=Xi;function Ph(s){if(typeof s!="function")throw new kn(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 kL(s){return Mb(2,s)}var qL=DT(function(s,a){a=a.length==1&&ae(a[0])?er(a[0],_n(qt())):er(Tr(a,1),_n(qt()));var u=a.length;return ge(function(y){for(var S=-1,R=Ur(y.length,u);++S<R;)y[S]=a[S].call(this,y[S]);return Ir(s,this,y)})}),Dp=ge(function(s,a){var u=Ms(a,Ba(Dp));return es(s,U,r,a,u)}),Lb=ge(function(s,a){var u=Ms(a,Ba(Lb));return es(s,j,r,a,u)}),zL=rs(function(s,a){return es(s,$,r,r,r,a)});function HL(s,a){if(typeof s!="function")throw new kn(c);return a=a===r?a:fe(a),ge(s,a)}function KL(s,a){if(typeof s!="function")throw new kn(c);return a=a==null?0:br(fe(a),0),ge(function(u){var y=u[a],S=Ls(u,0,a);return y&&Ps(S,y),Ir(s,this,S)})}function WL(s,a,u){var y=!0,S=!0;if(typeof s!="function")throw new kn(c);return sr(u)&&(y="leading"in u?!!u.leading:y,S="trailing"in u?!!u.trailing:S),Rb(s,a,{leading:y,maxWait:a,trailing:S})}function VL(s){return Pb(s,1)}function GL(s,a){return Dp(fp(a),s)}function YL(){if(!arguments.length)return[];var s=arguments[0];return ae(s)?s:[s]}function QL(s){return zn(s,x)}function JL(s,a){return a=typeof a=="function"?a:r,zn(s,x,a)}function ZL(s){return zn(s,_|x)}function XL(s,a){return a=typeof a=="function"?a:r,zn(s,_|x,a)}function tB(s,a){return a==null||Ay(s,a,Sr(a))}function si(s,a){return s===a||s!==s&&a!==a}var eB=Eh(tp),rB=Eh(function(s,a){return s>=a}),$o=Oy(function(){return arguments}())?Oy:function(s){return cr(s)&&qe.call(s,"callee")&&!gy.call(s,"callee")},ae=st.isArray,nB=Yr?_n(Yr):hT;function hn(s){return s!=null&&Mh(s.length)&&!is(s)}function dr(s){return cr(s)&&hn(s)}function iB(s){return s===!0||s===!1||cr(s)&&Qr(s)==H}var Bs=wN||Fp,sB=ri?_n(ri):fT;function oB(s){return cr(s)&&s.nodeType===1&&!sl(s)}function aB(s){if(s==null)return!0;if(hn(s)&&(ae(s)||typeof s=="string"||typeof s.splice=="function"||Bs(s)||Ua(s)||$o(s)))return!s.length;var a=Fr(s);if(a==lt||a==Ft)return!s.size;if(nl(s))return!np(s).length;for(var u in s)if(qe.call(s,u))return!1;return!0}function cB(s,a){return tl(s,a)}function lB(s,a,u){u=typeof u=="function"?u:r;var y=u?u(s,a):r;return y===r?tl(s,a,r,u):!!y}function Op(s){if(!cr(s))return!1;var a=Qr(s);return a==k||a==w||typeof s.message=="string"&&typeof s.name=="string"&&!sl(s)}function uB(s){return typeof s=="number"&&vy(s)}function is(s){if(!sr(s))return!1;var a=Qr(s);return a==it||a==ht||a==q||a==zt}function Bb(s){return typeof s=="number"&&s==fe(s)}function Mh(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=N}function sr(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function cr(s){return s!=null&&typeof s=="object"}var Ub=Fn?_n(Fn):pT;function hB(s,a){return s===a||rp(s,a,yp(a))}function fB(s,a,u){return u=typeof u=="function"?u:r,rp(s,a,yp(a),u)}function dB(s){return Fb(s)&&s!=+s}function pB(s){if(JT(s))throw new ie(o);return Py(s)}function gB(s){return s===null}function mB(s){return s==null}function Fb(s){return typeof s=="number"||cr(s)&&Qr(s)==Ot}function sl(s){if(!cr(s)||Qr(s)!=St)return!1;var a=ih(s);if(a===null)return!0;var u=qe.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&th.call(u)==fN}var Pp=Ti?_n(Ti):gT;function vB(s){return Bb(s)&&s>=-N&&s<=N}var jb=Hc?_n(Hc):mT;function $h(s){return typeof s=="string"||!ae(s)&&cr(s)&&Qr(s)==Et}function An(s){return typeof s=="symbol"||cr(s)&&Qr(s)==At}var Ua=xo?_n(xo):vT;function wB(s){return s===r}function yB(s){return cr(s)&&Fr(s)==bt}function bB(s){return cr(s)&&Qr(s)==xt}var _B=Eh(ip),EB=Eh(function(s,a){return s<=a});function kb(s){if(!s)return[];if(hn(s))return $h(s)?ni(s):un(s);if(Wc&&s[Wc])return tN(s[Wc]());var a=Fr(s),u=a==lt?Kd:a==Ft?Ju:Fa;return u(s)}function ss(s){if(!s)return s===0?s:0;if(s=Wn(s),s===O||s===-O){var a=s<0?-1:1;return a*L}return s===s?s:0}function fe(s){var a=ss(s),u=a%1;return a===a?u?a-u:a:0}function qb(s){return s?Do(fe(s),0,v):0}function Wn(s){if(typeof s=="number")return s;if(An(s))return D;if(sr(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=sr(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=ay(s);var u=Rn.test(s);return u||Bn.test(s)?oe(s.slice(2),u?2:8):Tn.test(s)?D:+s}function zb(s){return Li(s,fn(s))}function AB(s){return s?Do(fe(s),-N,N):s===0?s:0}function Be(s){return s==null?"":En(s)}var xB=Ra(function(s,a){if(nl(a)||hn(a)){Li(a,Sr(a),s);return}for(var u in a)qe.call(a,u)&&Jc(s,u,a[u])}),Hb=Ra(function(s,a){Li(a,fn(a),s)}),Nh=Ra(function(s,a,u,y){Li(a,fn(a),s,y)}),IB=Ra(function(s,a,u,y){Li(a,Sr(a),s,y)}),SB=rs(Jd);function CB(s,a){var u=Ta(s);return a==null?u:Ey(u,a)}var DB=ge(function(s,a){s=Qe(s);var u=-1,y=a.length,S=y>2?a[2]:r;for(S&&Jr(a[0],a[1],S)&&(y=1);++u<y;)for(var R=a[u],G=fn(R),Q=-1,X=G.length;++Q<X;){var ct=G[Q],ut=s[ct];(ut===r||si(ut,Ma[ct])&&!qe.call(s,ct))&&(s[ct]=R[ct])}return s}),OB=ge(function(s){return s.push(r,ab),Ir(Kb,r,s)});function PB(s,a){return ny(s,qt(a,3),Ri)}function MB(s,a){return ny(s,qt(a,3),Xd)}function $B(s,a){return s==null?s:Zd(s,qt(a,3),fn)}function NB(s,a){return s==null?s:Cy(s,qt(a,3),fn)}function TB(s,a){return s&&Ri(s,qt(a,3))}function RB(s,a){return s&&Xd(s,qt(a,3))}function LB(s){return s==null?[]:ph(s,Sr(s))}function BB(s){return s==null?[]:ph(s,fn(s))}function Mp(s,a,u){var y=s==null?r:Oo(s,a);return y===r?u:y}function UB(s,a){return s!=null&&ub(s,a,aT)}function $p(s,a){return s!=null&&ub(s,a,cT)}var FB=rb(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=eh.call(a)),s[a]=u},Tp(dn)),jB=rb(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=eh.call(a)),qe.call(s,a)?s[a].push(u):s[a]=[u]},qt),kB=ge(Xc);function Sr(s){return hn(s)?by(s):np(s)}function fn(s){return hn(s)?by(s,!0):wT(s)}function qB(s,a){var u={};return a=qt(a,3),Ri(s,function(y,S,R){ts(u,a(y,S,R),y)}),u}function zB(s,a){var u={};return a=qt(a,3),Ri(s,function(y,S,R){ts(u,S,a(y,S,R))}),u}var HB=Ra(function(s,a,u){gh(s,a,u)}),Kb=Ra(function(s,a,u,y){gh(s,a,u,y)}),KB=rs(function(s,a){var u={};if(s==null)return u;var y=!1;a=er(a,function(R){return R=Rs(R,s),y||(y=R.length>1),R}),Li(s,vp(s),u),y&&(u=zn(u,_|E|x,FT));for(var S=a.length;S--;)lp(u,a[S]);return u});function WB(s,a){return Wb(s,Ph(qt(a)))}var VB=rs(function(s,a){return s==null?{}:bT(s,a)});function Wb(s,a){if(s==null)return{};var u=er(vp(s),function(y){return[y]});return a=qt(a),By(s,u,function(y,S){return a(y,S[0])})}function GB(s,a,u){a=Rs(a,s);var y=-1,S=a.length;for(S||(S=1,s=r);++y<S;){var R=s==null?r:s[Bi(a[y])];R===r&&(y=S,R=u),s=is(R)?R.call(s):R}return s}function YB(s,a,u){return s==null?s:el(s,a,u)}function QB(s,a,u,y){return y=typeof y=="function"?y:r,s==null?s:el(s,a,u,y)}var Vb=sb(Sr),Gb=sb(fn);function JB(s,a,u){var y=ae(s),S=y||Bs(s)||Ua(s);if(a=qt(a,4),u==null){var R=s&&s.constructor;S?u=y?new R:[]:sr(s)?u=is(R)?Ta(ih(s)):{}:u={}}return(S?jn:Ri)(s,function(G,Q,X){return a(u,G,Q,X)}),u}function ZB(s,a){return s==null?!0:lp(s,a)}function XB(s,a,u){return s==null?s:qy(s,a,fp(u))}function tU(s,a,u,y){return y=typeof y=="function"?y:r,s==null?s:qy(s,a,fp(u),y)}function Fa(s){return s==null?[]:Hd(s,Sr(s))}function eU(s){return s==null?[]:Hd(s,fn(s))}function rU(s,a,u){return u===r&&(u=a,a=r),u!==r&&(u=Wn(u),u=u===u?u:0),a!==r&&(a=Wn(a),a=a===a?a:0),Do(Wn(s),a,u)}function nU(s,a,u){return a=ss(a),u===r?(u=a,a=0):u=ss(u),s=Wn(s),lT(s,a,u)}function iU(s,a,u){if(u&&typeof u!="boolean"&&Jr(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=ss(s),a===r?(a=s,s=0):a=ss(a)),s>a){var y=s;s=a,a=y}if(u||s%1||a%1){var S=wy();return Ur(s+S*(a-s+Ge("1e-"+((S+"").length-1))),a)}return op(s,a)}var sU=La(function(s,a,u){return a=a.toLowerCase(),s+(u?Yb(a):a)});function Yb(s){return Np(Be(s).toLowerCase())}function Qb(s){return s=Be(s),s&&s.replace(xr,Y$).replace(Rd,"")}function oU(s,a,u){s=Be(s),a=En(a);var y=s.length;u=u===r?y:Do(fe(u),0,y);var S=u;return u-=a.length,u>=0&&s.slice(u,S)==a}function aU(s){return s=Be(s),s&&Ht.test(s)?s.replace(Vr,Q$):s}function cU(s){return s=Be(s),s&&ee.test(s)?s.replace(Le,"\\$&"):s}var lU=La(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),uU=La(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),hU=Xy("toLowerCase");function fU(s,a,u){s=Be(s),a=fe(a);var y=a?Oa(s):0;if(!a||y>=a)return s;var S=(a-y)/2;return _h(ch(S),u)+s+_h(ah(S),u)}function dU(s,a,u){s=Be(s),a=fe(a);var y=a?Oa(s):0;return a&&y<a?s+_h(a-y,u):s}function pU(s,a,u){s=Be(s),a=fe(a);var y=a?Oa(s):0;return a&&y<a?_h(a-y,u)+s:s}function gU(s,a,u){return u||a==null?a=0:a&&(a=+a),EN(Be(s).replace(Jt,""),a||0)}function mU(s,a,u){return(u?Jr(s,a,u):a===r)?a=1:a=fe(a),ap(Be(s),a)}function vU(){var s=arguments,a=Be(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var wU=La(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function yU(s,a,u){return u&&typeof u!="number"&&Jr(s,a,u)&&(a=u=r),u=u===r?v:u>>>0,u?(s=Be(s),s&&(typeof a=="string"||a!=null&&!Pp(a))&&(a=En(a),!a&&Da(s))?Ls(ni(s),0,u):s.split(a,u)):[]}var bU=La(function(s,a,u){return s+(u?" ":"")+Np(a)});function _U(s,a,u){return s=Be(s),u=u==null?0:Do(fe(u),0,s.length),a=En(a),s.slice(u,u+a.length)==a}function EU(s,a,u){var y=M.templateSettings;u&&Jr(s,a,u)&&(a=r),s=Be(s),a=Nh({},a,y,ob);var S=Nh({},a.imports,y.imports,ob),R=Sr(S),G=Hd(S,R),Q,X,ct=0,ut=a.interpolate||Pi,gt="__p += '",wt=Wd((a.escape||Pi).source+"|"+ut.source+"|"+(ut===Vt?ke:Pi).source+"|"+(a.evaluate||Pi).source+"|$","g"),Lt="//# sourceURL="+(qe.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ld+"]")+`
|
|
53
|
-
`;
|
|
54
|
-
__e(`+
|
|
55
|
-
'`),
|
|
56
|
-
`+
|
|
57
|
-
__p += '`),
|
|
58
|
-
((__t = (`+
|
|
59
|
-
'`),
|
|
60
|
-
`;var
|
|
61
|
-
`+
|
|
50
|
+
*/(function(t,e){(function(){var r,i="4.17.21",n=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",u="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",p=500,y="__lodash_placeholder__",_=1,C=2,I=4,M=1,B=2,W=1,Y=2,q=4,V=8,U=16,z=32,K=64,A=128,j=256,ee=512,re=30,k="...",w=800,f=16,h=1,g=2,E=3,D=1/0,P=9007199254740991,x=17976931348623157e292,v=0/0,b=4294967295,L=b-1,X=b>>>1,ce=[["ary",A],["bind",W],["bindKey",Y],["curry",V],["curryRight",U],["flip",ee],["partial",z],["partialRight",K],["rearg",j]],O="[object Arguments]",ie="[object Array]",N="[object AsyncFunction]",F="[object Boolean]",R="[object Date]",l="[object DOMException]",$="[object Error]",Z="[object Function]",ae="[object GeneratorFunction]",ue="[object Map]",ve="[object Number]",ge="[object Null]",Ee="[object Object]",Ye="[object Promise]",De="[object Proxy]",Re="[object RegExp]",xe="[object Set]",ye="[object String]",Me="[object Symbol]",Pe="[object Undefined]",pe="[object WeakMap]",Se="[object WeakSet]",_e="[object ArrayBuffer]",me="[object DataView]",Te="[object Float32Array]",Ce="[object Float64Array]",Ae="[object Int8Array]",ke="[object Int16Array]",qe="[object Int32Array]",Ie="[object Uint8Array]",Ke="[object Uint8ClampedArray]",ut="[object Uint16Array]",Je="[object Uint32Array]",gt=/\b__p \+= '';/g,ht=/\b(__p \+=) '' \+/g,ot=/(__e\(.*?\)|\b__t\)) \+\n'';/g,St=/&(?:amp|lt|gt|quot|#39);/g,Ct=/[&<>"']/g,Oe=RegExp(St.source),Ve=RegExp(Ct.source),Ze=/<%-([\s\S]+?)%>/g,$e=/<%([\s\S]+?)%>/g,Qe=/<%=([\s\S]+?)%>/g,Ge=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fe=/^\w*$/,nt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/[\\^$.*+?()[\]{}|]/g,Le=RegExp(Xe.source),et=/^\s+/,rt=/\s/,Ne=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,We=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,Be=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,qt=/[()=,{}\[\]\/\s]/,zt=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,At=/\w*$/,Xr=/^[-+]0x[0-9a-f]+$/i,ei=/^0b[01]+$/i,ti=/^\[object .+?Constructor\]$/,ri=/^0o[0-7]+$/i,ii=/^(?:0|[1-9]\d*)$/,gr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ci=/($^)/,Pn=/['\n\r\u2028\u2029\\]/g,Di="\\ud800-\\udfff",On="\\u0300-\\u036f",$n="\\ufe20-\\ufe2f",Pi="\\u20d0-\\u20ff",an=On+$n+Pi,cn="\\u2700-\\u27bf",Mr="a-z\\xdf-\\xf6\\xf8-\\xff",Nn="\\xac\\xb1\\xd7\\xf7",Rn="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Tn="\\u2000-\\u206f",ua=" \\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",nl="A-Z\\xc0-\\xd6\\xd8-\\xde",sl="\\ufe0e\\ufe0f",fa=Nn+Rn+Tn+ua,Yu="['\u2019]",ha="["+Di+"]",Ju="["+fa+"]",la="["+an+"]",ol="\\d+",Mp="["+cn+"]",al="["+Mr+"]",cl="[^"+Di+fa+ol+cn+Mr+nl+"]",xc="\\ud83c[\\udffb-\\udfff]",Cp="(?:"+la+"|"+xc+")",ul="[^"+Di+"]",Sc="(?:\\ud83c[\\udde6-\\uddff]){2}",bo="[\\ud800-\\udbff][\\udc00-\\udfff]",zi="["+nl+"]",fl="\\u200d",hl="(?:"+al+"|"+cl+")",bs="(?:"+zi+"|"+cl+")",ll="(?:"+Yu+"(?:d|ll|m|re|s|t|ve))?",dl="(?:"+Yu+"(?:D|LL|M|RE|S|T|VE))?",pl=Cp+"?",gl="["+sl+"]?",Dp="(?:"+fl+"(?:"+[ul,Sc,bo].join("|")+")"+gl+pl+")*",Bs="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ml=gl+pl+Dp,Ic="(?:"+[Mp,Sc,bo].join("|")+")"+ml,Pp="(?:"+[ul+la+"?",la,Sc,bo,ha].join("|")+")",Qu=RegExp(Yu,"g"),Op=RegExp(la,"g"),Mc=RegExp(xc+"(?="+xc+")|"+Pp+ml,"g"),bl=RegExp([zi+"?"+al+"+"+ll+"(?="+[Ju,zi,"$"].join("|")+")",bs+"+"+dl+"(?="+[Ju,zi+hl,"$"].join("|")+")",zi+"?"+hl+"+"+ll,zi+"+"+dl,vl,Bs,ol,Ic].join("|"),"g"),yl=RegExp("["+fl+Di+an+sl+"]"),da=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,wl=["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"],$p=-1,Xt={};Xt[Te]=Xt[Ce]=Xt[Ae]=Xt[ke]=Xt[qe]=Xt[Ie]=Xt[Ke]=Xt[ut]=Xt[Je]=!0,Xt[O]=Xt[ie]=Xt[_e]=Xt[F]=Xt[me]=Xt[R]=Xt[$]=Xt[Z]=Xt[ue]=Xt[ve]=Xt[Ee]=Xt[Re]=Xt[xe]=Xt[ye]=Xt[pe]=!1;var Zt={};Zt[O]=Zt[ie]=Zt[_e]=Zt[me]=Zt[F]=Zt[R]=Zt[Te]=Zt[Ce]=Zt[Ae]=Zt[ke]=Zt[qe]=Zt[ue]=Zt[ve]=Zt[Ee]=Zt[Re]=Zt[xe]=Zt[ye]=Zt[Me]=Zt[Ie]=Zt[Ke]=Zt[ut]=Zt[Je]=!0,Zt[$]=Zt[Z]=Zt[pe]=!1;var J={\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"},ne={"&":"&","<":"<",">":">",'"':""","'":"'"},be={"&":"&","<":"<",">":">",""":'"',"'":"'"},tt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},er=parseFloat,yt=parseInt,ar=typeof Du=="object"&&Du&&Du.Object===Object&&Du,Er=typeof self=="object"&&self&&self.Object===Object&&self,Ut=ar||Er||Function("return this")(),tr=e&&!e.nodeType&&e,wr=tr&&!0&&t&&!t.nodeType&&t,Oi=wr&&wr.exports===tr,xr=Oi&&ar.process,cr=function(){try{var se=wr&&wr.require&&wr.require("util").types;return se||xr&&xr.binding&&xr.binding("util")}catch{}}(),di=cr&&cr.isArrayBuffer,Fn=cr&&cr.isDate,un=cr&&cr.isMap,ys=cr&&cr.isRegExp,Zu=cr&&cr.isSet,pa=cr&&cr.isTypedArray;function Fr(se,he,fe){switch(fe.length){case 0:return se.call(he);case 1:return se.call(he,fe[0]);case 2:return se.call(he,fe[0],fe[1]);case 3:return se.call(he,fe[0],fe[1],fe[2])}return se.apply(he,fe)}function Dk(se,he,fe,it){for(var mt=-1,Kt=se==null?0:se.length;++mt<Kt;){var Cr=se[mt];he(it,Cr,fe(Cr),se)}return it}function fn(se,he){for(var fe=-1,it=se==null?0:se.length;++fe<it&&he(se[fe],fe,se)!==!1;);return se}function Pk(se,he){for(var fe=se==null?0:se.length;fe--&&he(se[fe],fe,se)!==!1;);return se}function gy(se,he){for(var fe=-1,it=se==null?0:se.length;++fe<it;)if(!he(se[fe],fe,se))return!1;return!0}function yo(se,he){for(var fe=-1,it=se==null?0:se.length,mt=0,Kt=[];++fe<it;){var Cr=se[fe];he(Cr,fe,se)&&(Kt[mt++]=Cr)}return Kt}function _l(se,he){var fe=se==null?0:se.length;return!!fe&&Cc(se,he,0)>-1}function Np(se,he,fe){for(var it=-1,mt=se==null?0:se.length;++it<mt;)if(fe(he,se[it]))return!0;return!1}function ur(se,he){for(var fe=-1,it=se==null?0:se.length,mt=Array(it);++fe<it;)mt[fe]=he(se[fe],fe,se);return mt}function wo(se,he){for(var fe=-1,it=he.length,mt=se.length;++fe<it;)se[mt+fe]=he[fe];return se}function Rp(se,he,fe,it){var mt=-1,Kt=se==null?0:se.length;for(it&&Kt&&(fe=se[++mt]);++mt<Kt;)fe=he(fe,se[mt],mt,se);return fe}function Ok(se,he,fe,it){var mt=se==null?0:se.length;for(it&&mt&&(fe=se[--mt]);mt--;)fe=he(fe,se[mt],mt,se);return fe}function Tp(se,he){for(var fe=-1,it=se==null?0:se.length;++fe<it;)if(he(se[fe],fe,se))return!0;return!1}var $k=Fp("length");function Nk(se){return se.split("")}function Rk(se){return se.match(Be)||[]}function vy(se,he,fe){var it;return fe(se,function(mt,Kt,Cr){if(he(mt,Kt,Cr))return it=Kt,!1}),it}function Al(se,he,fe,it){for(var mt=se.length,Kt=fe+(it?1:-1);it?Kt--:++Kt<mt;)if(he(se[Kt],Kt,se))return Kt;return-1}function Cc(se,he,fe){return he===he?Wk(se,he,fe):Al(se,my,fe)}function Tk(se,he,fe,it){for(var mt=fe-1,Kt=se.length;++mt<Kt;)if(it(se[mt],he))return mt;return-1}function my(se){return se!==se}function by(se,he){var fe=se==null?0:se.length;return fe?Bp(se,he)/fe:v}function Fp(se){return function(he){return he==null?r:he[se]}}function Lp(se){return function(he){return se==null?r:se[he]}}function yy(se,he,fe,it,mt){return mt(se,function(Kt,Cr,rr){fe=it?(it=!1,Kt):he(fe,Kt,Cr,rr)}),fe}function Fk(se,he){var fe=se.length;for(se.sort(he);fe--;)se[fe]=se[fe].value;return se}function Bp(se,he){for(var fe,it=-1,mt=se.length;++it<mt;){var Kt=he(se[it]);Kt!==r&&(fe=fe===r?Kt:fe+Kt)}return fe}function Up(se,he){for(var fe=-1,it=Array(se);++fe<se;)it[fe]=he(fe);return it}function Lk(se,he){return ur(he,function(fe){return[fe,se[fe]]})}function wy(se){return se&&se.slice(0,xy(se)+1).replace(et,"")}function Hi(se){return function(he){return se(he)}}function kp(se,he){return ur(he,function(fe){return se[fe]})}function Xu(se,he){return se.has(he)}function _y(se,he){for(var fe=-1,it=se.length;++fe<it&&Cc(he,se[fe],0)>-1;);return fe}function Ay(se,he){for(var fe=se.length;fe--&&Cc(he,se[fe],0)>-1;);return fe}function Bk(se,he){for(var fe=se.length,it=0;fe--;)se[fe]===he&&++it;return it}var Uk=Lp(J),kk=Lp(ne);function jk(se){return"\\"+tt[se]}function qk(se,he){return se==null?r:se[he]}function Dc(se){return yl.test(se)}function zk(se){return da.test(se)}function Hk(se){for(var he,fe=[];!(he=se.next()).done;)fe.push(he.value);return fe}function jp(se){var he=-1,fe=Array(se.size);return se.forEach(function(it,mt){fe[++he]=[mt,it]}),fe}function Ey(se,he){return function(fe){return se(he(fe))}}function _o(se,he){for(var fe=-1,it=se.length,mt=0,Kt=[];++fe<it;){var Cr=se[fe];(Cr===he||Cr===y)&&(se[fe]=y,Kt[mt++]=fe)}return Kt}function El(se){var he=-1,fe=Array(se.size);return se.forEach(function(it){fe[++he]=it}),fe}function Kk(se){var he=-1,fe=Array(se.size);return se.forEach(function(it){fe[++he]=[it,it]}),fe}function Wk(se,he,fe){for(var it=fe-1,mt=se.length;++it<mt;)if(se[it]===he)return it;return-1}function Vk(se,he,fe){for(var it=fe+1;it--;)if(se[it]===he)return it;return it}function Pc(se){return Dc(se)?Yk(se):$k(se)}function Ln(se){return Dc(se)?Jk(se):Nk(se)}function xy(se){for(var he=se.length;he--&&rt.test(se.charAt(he)););return he}var Gk=Lp(be);function Yk(se){for(var he=Mc.lastIndex=0;Mc.test(se);)++he;return he}function Jk(se){return se.match(Mc)||[]}function Qk(se){return se.match(bl)||[]}var Zk=function se(he){he=he==null?Ut:Oc.defaults(Ut.Object(),he,Oc.pick(Ut,wl));var fe=he.Array,it=he.Date,mt=he.Error,Kt=he.Function,Cr=he.Math,rr=he.Object,qp=he.RegExp,Xk=he.String,hn=he.TypeError,xl=fe.prototype,ej=Kt.prototype,$c=rr.prototype,Sl=he["__core-js_shared__"],Il=ej.toString,Jt=$c.hasOwnProperty,tj=0,Sy=function(){var o=/[^.]+$/.exec(Sl&&Sl.keys&&Sl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Ml=$c.toString,rj=Il.call(rr),ij=Ut._,nj=qp("^"+Il.call(Jt).replace(Xe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Cl=Oi?he.Buffer:r,Ao=he.Symbol,Dl=he.Uint8Array,Iy=Cl?Cl.allocUnsafe:r,Pl=Ey(rr.getPrototypeOf,rr),My=rr.create,Cy=$c.propertyIsEnumerable,Ol=xl.splice,Dy=Ao?Ao.isConcatSpreadable:r,ef=Ao?Ao.iterator:r,ga=Ao?Ao.toStringTag:r,$l=function(){try{var o=wa(rr,"defineProperty");return o({},"",{}),o}catch{}}(),sj=he.clearTimeout!==Ut.clearTimeout&&he.clearTimeout,oj=it&&it.now!==Ut.Date.now&&it.now,aj=he.setTimeout!==Ut.setTimeout&&he.setTimeout,Nl=Cr.ceil,Rl=Cr.floor,zp=rr.getOwnPropertySymbols,cj=Cl?Cl.isBuffer:r,Py=he.isFinite,uj=xl.join,fj=Ey(rr.keys,rr),Dr=Cr.max,ni=Cr.min,hj=it.now,lj=he.parseInt,Oy=Cr.random,dj=xl.reverse,Hp=wa(he,"DataView"),tf=wa(he,"Map"),Kp=wa(he,"Promise"),Nc=wa(he,"Set"),rf=wa(he,"WeakMap"),nf=wa(rr,"create"),Tl=rf&&new rf,Rc={},pj=_a(Hp),gj=_a(tf),vj=_a(Kp),mj=_a(Nc),bj=_a(rf),Fl=Ao?Ao.prototype:r,sf=Fl?Fl.valueOf:r,$y=Fl?Fl.toString:r;function H(o){if(vr(o)&&!wt(o)&&!(o instanceof Lt)){if(o instanceof ln)return o;if(Jt.call(o,"__wrapped__"))return Nw(o)}return new ln(o)}var Tc=function(){function o(){}return function(c){if(!hr(c))return{};if(My)return My(c);o.prototype=c;var m=new o;return o.prototype=r,m}}();function Ll(){}function ln(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=r}H.templateSettings={escape:Ze,evaluate:$e,interpolate:Qe,variable:"",imports:{_:H}},H.prototype=Ll.prototype,H.prototype.constructor=H,ln.prototype=Tc(Ll.prototype),ln.prototype.constructor=ln;function Lt(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=b,this.__views__=[]}function yj(){var o=new Lt(this.__wrapped__);return o.__actions__=$i(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=$i(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=$i(this.__views__),o}function wj(){if(this.__filtered__){var o=new Lt(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function _j(){var o=this.__wrapped__.value(),c=this.__dir__,m=wt(o),S=c<0,T=m?o.length:0,G=Nq(0,T,this.__views__),Q=G.start,te=G.end,oe=te-Q,le=S?te:Q-1,de=this.__iteratees__,we=de.length,ze=0,at=ni(oe,this.__takeCount__);if(!m||!S&&T==oe&&at==oe)return rw(o,this.__actions__);var dt=[];e:for(;oe--&&ze<at;){le+=c;for(var Mt=-1,pt=o[le];++Mt<we;){var Nt=de[Mt],kt=Nt.iteratee,Vi=Nt.type,vi=kt(pt);if(Vi==g)pt=vi;else if(!vi){if(Vi==h)continue e;break e}}dt[ze++]=pt}return dt}Lt.prototype=Tc(Ll.prototype),Lt.prototype.constructor=Lt;function va(o){var c=-1,m=o==null?0:o.length;for(this.clear();++c<m;){var S=o[c];this.set(S[0],S[1])}}function Aj(){this.__data__=nf?nf(null):{},this.size=0}function Ej(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function xj(o){var c=this.__data__;if(nf){var m=c[o];return m===d?r:m}return Jt.call(c,o)?c[o]:r}function Sj(o){var c=this.__data__;return nf?c[o]!==r:Jt.call(c,o)}function Ij(o,c){var m=this.__data__;return this.size+=this.has(o)?0:1,m[o]=nf&&c===r?d:c,this}va.prototype.clear=Aj,va.prototype.delete=Ej,va.prototype.get=xj,va.prototype.has=Sj,va.prototype.set=Ij;function Us(o){var c=-1,m=o==null?0:o.length;for(this.clear();++c<m;){var S=o[c];this.set(S[0],S[1])}}function Mj(){this.__data__=[],this.size=0}function Cj(o){var c=this.__data__,m=Bl(c,o);if(m<0)return!1;var S=c.length-1;return m==S?c.pop():Ol.call(c,m,1),--this.size,!0}function Dj(o){var c=this.__data__,m=Bl(c,o);return m<0?r:c[m][1]}function Pj(o){return Bl(this.__data__,o)>-1}function Oj(o,c){var m=this.__data__,S=Bl(m,o);return S<0?(++this.size,m.push([o,c])):m[S][1]=c,this}Us.prototype.clear=Mj,Us.prototype.delete=Cj,Us.prototype.get=Dj,Us.prototype.has=Pj,Us.prototype.set=Oj;function ks(o){var c=-1,m=o==null?0:o.length;for(this.clear();++c<m;){var S=o[c];this.set(S[0],S[1])}}function $j(){this.size=0,this.__data__={hash:new va,map:new(tf||Us),string:new va}}function Nj(o){var c=Jl(this,o).delete(o);return this.size-=c?1:0,c}function Rj(o){return Jl(this,o).get(o)}function Tj(o){return Jl(this,o).has(o)}function Fj(o,c){var m=Jl(this,o),S=m.size;return m.set(o,c),this.size+=m.size==S?0:1,this}ks.prototype.clear=$j,ks.prototype.delete=Nj,ks.prototype.get=Rj,ks.prototype.has=Tj,ks.prototype.set=Fj;function ma(o){var c=-1,m=o==null?0:o.length;for(this.__data__=new ks;++c<m;)this.add(o[c])}function Lj(o){return this.__data__.set(o,d),this}function Bj(o){return this.__data__.has(o)}ma.prototype.add=ma.prototype.push=Lj,ma.prototype.has=Bj;function Bn(o){var c=this.__data__=new Us(o);this.size=c.size}function Uj(){this.__data__=new Us,this.size=0}function kj(o){var c=this.__data__,m=c.delete(o);return this.size=c.size,m}function jj(o){return this.__data__.get(o)}function qj(o){return this.__data__.has(o)}function zj(o,c){var m=this.__data__;if(m instanceof Us){var S=m.__data__;if(!tf||S.length<n-1)return S.push([o,c]),this.size=++m.size,this;m=this.__data__=new ks(S)}return m.set(o,c),this.size=m.size,this}Bn.prototype.clear=Uj,Bn.prototype.delete=kj,Bn.prototype.get=jj,Bn.prototype.has=qj,Bn.prototype.set=zj;function Ny(o,c){var m=wt(o),S=!m&&Aa(o),T=!m&&!S&&Mo(o),G=!m&&!S&&!T&&Uc(o),Q=m||S||T||G,te=Q?Up(o.length,Xk):[],oe=te.length;for(var le in o)(c||Jt.call(o,le))&&!(Q&&(le=="length"||T&&(le=="offset"||le=="parent")||G&&(le=="buffer"||le=="byteLength"||le=="byteOffset")||Hs(le,oe)))&&te.push(le);return te}function Ry(o){var c=o.length;return c?o[rg(0,c-1)]:r}function Hj(o,c){return Ql($i(o),ba(c,0,o.length))}function Kj(o){return Ql($i(o))}function Wp(o,c,m){(m!==r&&!Un(o[c],m)||m===r&&!(c in o))&&js(o,c,m)}function of(o,c,m){var S=o[c];(!(Jt.call(o,c)&&Un(S,m))||m===r&&!(c in o))&&js(o,c,m)}function Bl(o,c){for(var m=o.length;m--;)if(Un(o[m][0],c))return m;return-1}function Wj(o,c,m,S){return Eo(o,function(T,G,Q){c(S,T,m(T),Q)}),S}function Ty(o,c){return o&&_s(c,Lr(c),o)}function Vj(o,c){return o&&_s(c,Ri(c),o)}function js(o,c,m){c=="__proto__"&&$l?$l(o,c,{configurable:!0,enumerable:!0,value:m,writable:!0}):o[c]=m}function Vp(o,c){for(var m=-1,S=c.length,T=fe(S),G=o==null;++m<S;)T[m]=G?r:Mg(o,c[m]);return T}function ba(o,c,m){return o===o&&(m!==r&&(o=o<=m?o:m),c!==r&&(o=o>=c?o:c)),o}function dn(o,c,m,S,T,G){var Q,te=c&_,oe=c&C,le=c&I;if(m&&(Q=T?m(o,S,T,G):m(o)),Q!==r)return Q;if(!hr(o))return o;var de=wt(o);if(de){if(Q=Tq(o),!te)return $i(o,Q)}else{var we=si(o),ze=we==Z||we==ae;if(Mo(o))return sw(o,te);if(we==Ee||we==O||ze&&!T){if(Q=oe||ze?{}:xw(o),!te)return oe?xq(o,Vj(Q,o)):Eq(o,Ty(Q,o))}else{if(!Zt[we])return T?o:{};Q=Fq(o,we,te)}}G||(G=new Bn);var at=G.get(o);if(at)return at;G.set(o,Q),Xw(o)?o.forEach(function(pt){Q.add(dn(pt,c,m,pt,o,G))}):Qw(o)&&o.forEach(function(pt,Nt){Q.set(Nt,dn(pt,c,m,Nt,o,G))});var dt=le?oe?dg:lg:oe?Ri:Lr,Mt=de?r:dt(o);return fn(Mt||o,function(pt,Nt){Mt&&(Nt=pt,pt=o[Nt]),of(Q,Nt,dn(pt,c,m,Nt,o,G))}),Q}function Gj(o){var c=Lr(o);return function(m){return Fy(m,o,c)}}function Fy(o,c,m){var S=m.length;if(o==null)return!S;for(o=rr(o);S--;){var T=m[S],G=c[T],Q=o[T];if(Q===r&&!(T in o)||!G(Q))return!1}return!0}function Ly(o,c,m){if(typeof o!="function")throw new hn(a);return df(function(){o.apply(r,m)},c)}function af(o,c,m,S){var T=-1,G=_l,Q=!0,te=o.length,oe=[],le=c.length;if(!te)return oe;m&&(c=ur(c,Hi(m))),S?(G=Np,Q=!1):c.length>=n&&(G=Xu,Q=!1,c=new ma(c));e:for(;++T<te;){var de=o[T],we=m==null?de:m(de);if(de=S||de!==0?de:0,Q&&we===we){for(var ze=le;ze--;)if(c[ze]===we)continue e;oe.push(de)}else G(c,we,S)||oe.push(de)}return oe}var Eo=fw(ws),By=fw(Yp,!0);function Yj(o,c){var m=!0;return Eo(o,function(S,T,G){return m=!!c(S,T,G),m}),m}function Ul(o,c,m){for(var S=-1,T=o.length;++S<T;){var G=o[S],Q=c(G);if(Q!=null&&(te===r?Q===Q&&!Wi(Q):m(Q,te)))var te=Q,oe=G}return oe}function Jj(o,c,m,S){var T=o.length;for(m=It(m),m<0&&(m=-m>T?0:T+m),S=S===r||S>T?T:It(S),S<0&&(S+=T),S=m>S?0:t4(S);m<S;)o[m++]=c;return o}function Uy(o,c){var m=[];return Eo(o,function(S,T,G){c(S,T,G)&&m.push(S)}),m}function Vr(o,c,m,S,T){var G=-1,Q=o.length;for(m||(m=Bq),T||(T=[]);++G<Q;){var te=o[G];c>0&&m(te)?c>1?Vr(te,c-1,m,S,T):wo(T,te):S||(T[T.length]=te)}return T}var Gp=hw(),ky=hw(!0);function ws(o,c){return o&&Gp(o,c,Lr)}function Yp(o,c){return o&&ky(o,c,Lr)}function kl(o,c){return yo(c,function(m){return Ks(o[m])})}function ya(o,c){c=So(c,o);for(var m=0,S=c.length;o!=null&&m<S;)o=o[As(c[m++])];return m&&m==S?o:r}function jy(o,c,m){var S=c(o);return wt(o)?S:wo(S,m(o))}function pi(o){return o==null?o===r?Pe:ge:ga&&ga in rr(o)?$q(o):Kq(o)}function Jp(o,c){return o>c}function Qj(o,c){return o!=null&&Jt.call(o,c)}function Zj(o,c){return o!=null&&c in rr(o)}function Xj(o,c,m){return o>=ni(c,m)&&o<Dr(c,m)}function Qp(o,c,m){for(var S=m?Np:_l,T=o[0].length,G=o.length,Q=G,te=fe(G),oe=1/0,le=[];Q--;){var de=o[Q];Q&&c&&(de=ur(de,Hi(c))),oe=ni(de.length,oe),te[Q]=!m&&(c||T>=120&&de.length>=120)?new ma(Q&&de):r}de=o[0];var we=-1,ze=te[0];e:for(;++we<T&&le.length<oe;){var at=de[we],dt=c?c(at):at;if(at=m||at!==0?at:0,!(ze?Xu(ze,dt):S(le,dt,m))){for(Q=G;--Q;){var Mt=te[Q];if(!(Mt?Xu(Mt,dt):S(o[Q],dt,m)))continue e}ze&&ze.push(dt),le.push(at)}}return le}function eq(o,c,m,S){return ws(o,function(T,G,Q){c(S,m(T),G,Q)}),S}function cf(o,c,m){c=So(c,o),o=Cw(o,c);var S=o==null?o:o[As(gn(c))];return S==null?r:Fr(S,o,m)}function qy(o){return vr(o)&&pi(o)==O}function tq(o){return vr(o)&&pi(o)==_e}function rq(o){return vr(o)&&pi(o)==R}function uf(o,c,m,S,T){return o===c?!0:o==null||c==null||!vr(o)&&!vr(c)?o!==o&&c!==c:iq(o,c,m,S,uf,T)}function iq(o,c,m,S,T,G){var Q=wt(o),te=wt(c),oe=Q?ie:si(o),le=te?ie:si(c);oe=oe==O?Ee:oe,le=le==O?Ee:le;var de=oe==Ee,we=le==Ee,ze=oe==le;if(ze&&Mo(o)){if(!Mo(c))return!1;Q=!0,de=!1}if(ze&&!de)return G||(G=new Bn),Q||Uc(o)?_w(o,c,m,S,T,G):Pq(o,c,oe,m,S,T,G);if(!(m&M)){var at=de&&Jt.call(o,"__wrapped__"),dt=we&&Jt.call(c,"__wrapped__");if(at||dt){var Mt=at?o.value():o,pt=dt?c.value():c;return G||(G=new Bn),T(Mt,pt,m,S,G)}}return ze?(G||(G=new Bn),Oq(o,c,m,S,T,G)):!1}function nq(o){return vr(o)&&si(o)==ue}function Zp(o,c,m,S){var T=m.length,G=T,Q=!S;if(o==null)return!G;for(o=rr(o);T--;){var te=m[T];if(Q&&te[2]?te[1]!==o[te[0]]:!(te[0]in o))return!1}for(;++T<G;){te=m[T];var oe=te[0],le=o[oe],de=te[1];if(Q&&te[2]){if(le===r&&!(oe in o))return!1}else{var we=new Bn;if(S)var ze=S(le,de,oe,o,c,we);if(!(ze===r?uf(de,le,M|B,S,we):ze))return!1}}return!0}function zy(o){if(!hr(o)||kq(o))return!1;var c=Ks(o)?nj:ti;return c.test(_a(o))}function sq(o){return vr(o)&&pi(o)==Re}function oq(o){return vr(o)&&si(o)==xe}function aq(o){return vr(o)&&i0(o.length)&&!!Xt[pi(o)]}function Hy(o){return typeof o=="function"?o:o==null?Ti:typeof o=="object"?wt(o)?Vy(o[0],o[1]):Wy(o):l4(o)}function Xp(o){if(!lf(o))return fj(o);var c=[];for(var m in rr(o))Jt.call(o,m)&&m!="constructor"&&c.push(m);return c}function cq(o){if(!hr(o))return Hq(o);var c=lf(o),m=[];for(var S in o)S=="constructor"&&(c||!Jt.call(o,S))||m.push(S);return m}function eg(o,c){return o<c}function Ky(o,c){var m=-1,S=Ni(o)?fe(o.length):[];return Eo(o,function(T,G,Q){S[++m]=c(T,G,Q)}),S}function Wy(o){var c=gg(o);return c.length==1&&c[0][2]?Iw(c[0][0],c[0][1]):function(m){return m===o||Zp(m,o,c)}}function Vy(o,c){return mg(o)&&Sw(c)?Iw(As(o),c):function(m){var S=Mg(m,o);return S===r&&S===c?Cg(m,o):uf(c,S,M|B)}}function jl(o,c,m,S,T){o!==c&&Gp(c,function(G,Q){if(T||(T=new Bn),hr(G))uq(o,c,Q,m,jl,S,T);else{var te=S?S(yg(o,Q),G,Q+"",o,c,T):r;te===r&&(te=G),Wp(o,Q,te)}},Ri)}function uq(o,c,m,S,T,G,Q){var te=yg(o,m),oe=yg(c,m),le=Q.get(oe);if(le){Wp(o,m,le);return}var de=G?G(te,oe,m+"",o,c,Q):r,we=de===r;if(we){var ze=wt(oe),at=!ze&&Mo(oe),dt=!ze&&!at&&Uc(oe);de=oe,ze||at||dt?wt(te)?de=te:_r(te)?de=$i(te):at?(we=!1,de=sw(oe,!0)):dt?(we=!1,de=ow(oe,!0)):de=[]:pf(oe)||Aa(oe)?(de=te,Aa(te)?de=r4(te):(!hr(te)||Ks(te))&&(de=xw(oe))):we=!1}we&&(Q.set(oe,de),T(de,oe,S,G,Q),Q.delete(oe)),Wp(o,m,de)}function Gy(o,c){var m=o.length;if(m)return c+=c<0?m:0,Hs(c,m)?o[c]:r}function Yy(o,c,m){c.length?c=ur(c,function(G){return wt(G)?function(Q){return ya(Q,G.length===1?G[0]:G)}:G}):c=[Ti];var S=-1;c=ur(c,Hi(ft()));var T=Ky(o,function(G,Q,te){var oe=ur(c,function(le){return le(G)});return{criteria:oe,index:++S,value:G}});return Fk(T,function(G,Q){return Aq(G,Q,m)})}function fq(o,c){return Jy(o,c,function(m,S){return Cg(o,S)})}function Jy(o,c,m){for(var S=-1,T=c.length,G={};++S<T;){var Q=c[S],te=ya(o,Q);m(te,Q)&&ff(G,So(Q,o),te)}return G}function hq(o){return function(c){return ya(c,o)}}function tg(o,c,m,S){var T=S?Tk:Cc,G=-1,Q=c.length,te=o;for(o===c&&(c=$i(c)),m&&(te=ur(o,Hi(m)));++G<Q;)for(var oe=0,le=c[G],de=m?m(le):le;(oe=T(te,de,oe,S))>-1;)te!==o&&Ol.call(te,oe,1),Ol.call(o,oe,1);return o}function Qy(o,c){for(var m=o?c.length:0,S=m-1;m--;){var T=c[m];if(m==S||T!==G){var G=T;Hs(T)?Ol.call(o,T,1):sg(o,T)}}return o}function rg(o,c){return o+Rl(Oy()*(c-o+1))}function lq(o,c,m,S){for(var T=-1,G=Dr(Nl((c-o)/(m||1)),0),Q=fe(G);G--;)Q[S?G:++T]=o,o+=m;return Q}function ig(o,c){var m="";if(!o||c<1||c>P)return m;do c%2&&(m+=o),c=Rl(c/2),c&&(o+=o);while(c);return m}function Dt(o,c){return wg(Mw(o,c,Ti),o+"")}function dq(o){return Ry(kc(o))}function pq(o,c){var m=kc(o);return Ql(m,ba(c,0,m.length))}function ff(o,c,m,S){if(!hr(o))return o;c=So(c,o);for(var T=-1,G=c.length,Q=G-1,te=o;te!=null&&++T<G;){var oe=As(c[T]),le=m;if(oe==="__proto__"||oe==="constructor"||oe==="prototype")return o;if(T!=Q){var de=te[oe];le=S?S(de,oe,te):r,le===r&&(le=hr(de)?de:Hs(c[T+1])?[]:{})}of(te,oe,le),te=te[oe]}return o}var Zy=Tl?function(o,c){return Tl.set(o,c),o}:Ti,gq=$l?function(o,c){return $l(o,"toString",{configurable:!0,enumerable:!1,value:Pg(c),writable:!0})}:Ti;function vq(o){return Ql(kc(o))}function pn(o,c,m){var S=-1,T=o.length;c<0&&(c=-c>T?0:T+c),m=m>T?T:m,m<0&&(m+=T),T=c>m?0:m-c>>>0,c>>>=0;for(var G=fe(T);++S<T;)G[S]=o[S+c];return G}function mq(o,c){var m;return Eo(o,function(S,T,G){return m=c(S,T,G),!m}),!!m}function ql(o,c,m){var S=0,T=o==null?S:o.length;if(typeof c=="number"&&c===c&&T<=X){for(;S<T;){var G=S+T>>>1,Q=o[G];Q!==null&&!Wi(Q)&&(m?Q<=c:Q<c)?S=G+1:T=G}return T}return ng(o,c,Ti,m)}function ng(o,c,m,S){var T=0,G=o==null?0:o.length;if(G===0)return 0;c=m(c);for(var Q=c!==c,te=c===null,oe=Wi(c),le=c===r;T<G;){var de=Rl((T+G)/2),we=m(o[de]),ze=we!==r,at=we===null,dt=we===we,Mt=Wi(we);if(Q)var pt=S||dt;else le?pt=dt&&(S||ze):te?pt=dt&&ze&&(S||!at):oe?pt=dt&&ze&&!at&&(S||!Mt):at||Mt?pt=!1:pt=S?we<=c:we<c;pt?T=de+1:G=de}return ni(G,L)}function Xy(o,c){for(var m=-1,S=o.length,T=0,G=[];++m<S;){var Q=o[m],te=c?c(Q):Q;if(!m||!Un(te,oe)){var oe=te;G[T++]=Q===0?0:Q}}return G}function ew(o){return typeof o=="number"?o:Wi(o)?v:+o}function Ki(o){if(typeof o=="string")return o;if(wt(o))return ur(o,Ki)+"";if(Wi(o))return $y?$y.call(o):"";var c=o+"";return c=="0"&&1/o==-D?"-0":c}function xo(o,c,m){var S=-1,T=_l,G=o.length,Q=!0,te=[],oe=te;if(m)Q=!1,T=Np;else if(G>=n){var le=c?null:Cq(o);if(le)return El(le);Q=!1,T=Xu,oe=new ma}else oe=c?[]:te;e:for(;++S<G;){var de=o[S],we=c?c(de):de;if(de=m||de!==0?de:0,Q&&we===we){for(var ze=oe.length;ze--;)if(oe[ze]===we)continue e;c&&oe.push(we),te.push(de)}else T(oe,we,m)||(oe!==te&&oe.push(we),te.push(de))}return te}function sg(o,c){return c=So(c,o),o=Cw(o,c),o==null||delete o[As(gn(c))]}function tw(o,c,m,S){return ff(o,c,m(ya(o,c)),S)}function zl(o,c,m,S){for(var T=o.length,G=S?T:-1;(S?G--:++G<T)&&c(o[G],G,o););return m?pn(o,S?0:G,S?G+1:T):pn(o,S?G+1:0,S?T:G)}function rw(o,c){var m=o;return m instanceof Lt&&(m=m.value()),Rp(c,function(S,T){return T.func.apply(T.thisArg,wo([S],T.args))},m)}function og(o,c,m){var S=o.length;if(S<2)return S?xo(o[0]):[];for(var T=-1,G=fe(S);++T<S;)for(var Q=o[T],te=-1;++te<S;)te!=T&&(G[T]=af(G[T]||Q,o[te],c,m));return xo(Vr(G,1),c,m)}function iw(o,c,m){for(var S=-1,T=o.length,G=c.length,Q={};++S<T;){var te=S<G?c[S]:r;m(Q,o[S],te)}return Q}function ag(o){return _r(o)?o:[]}function cg(o){return typeof o=="function"?o:Ti}function So(o,c){return wt(o)?o:mg(o,c)?[o]:$w(Gt(o))}var bq=Dt;function Io(o,c,m){var S=o.length;return m=m===r?S:m,!c&&m>=S?o:pn(o,c,m)}var nw=sj||function(o){return Ut.clearTimeout(o)};function sw(o,c){if(c)return o.slice();var m=o.length,S=Iy?Iy(m):new o.constructor(m);return o.copy(S),S}function ug(o){var c=new o.constructor(o.byteLength);return new Dl(c).set(new Dl(o)),c}function yq(o,c){var m=c?ug(o.buffer):o.buffer;return new o.constructor(m,o.byteOffset,o.byteLength)}function wq(o){var c=new o.constructor(o.source,At.exec(o));return c.lastIndex=o.lastIndex,c}function _q(o){return sf?rr(sf.call(o)):{}}function ow(o,c){var m=c?ug(o.buffer):o.buffer;return new o.constructor(m,o.byteOffset,o.length)}function aw(o,c){if(o!==c){var m=o!==r,S=o===null,T=o===o,G=Wi(o),Q=c!==r,te=c===null,oe=c===c,le=Wi(c);if(!te&&!le&&!G&&o>c||G&&Q&&oe&&!te&&!le||S&&Q&&oe||!m&&oe||!T)return 1;if(!S&&!G&&!le&&o<c||le&&m&&T&&!S&&!G||te&&m&&T||!Q&&T||!oe)return-1}return 0}function Aq(o,c,m){for(var S=-1,T=o.criteria,G=c.criteria,Q=T.length,te=m.length;++S<Q;){var oe=aw(T[S],G[S]);if(oe){if(S>=te)return oe;var le=m[S];return oe*(le=="desc"?-1:1)}}return o.index-c.index}function cw(o,c,m,S){for(var T=-1,G=o.length,Q=m.length,te=-1,oe=c.length,le=Dr(G-Q,0),de=fe(oe+le),we=!S;++te<oe;)de[te]=c[te];for(;++T<Q;)(we||T<G)&&(de[m[T]]=o[T]);for(;le--;)de[te++]=o[T++];return de}function uw(o,c,m,S){for(var T=-1,G=o.length,Q=-1,te=m.length,oe=-1,le=c.length,de=Dr(G-te,0),we=fe(de+le),ze=!S;++T<de;)we[T]=o[T];for(var at=T;++oe<le;)we[at+oe]=c[oe];for(;++Q<te;)(ze||T<G)&&(we[at+m[Q]]=o[T++]);return we}function $i(o,c){var m=-1,S=o.length;for(c||(c=fe(S));++m<S;)c[m]=o[m];return c}function _s(o,c,m,S){var T=!m;m||(m={});for(var G=-1,Q=c.length;++G<Q;){var te=c[G],oe=S?S(m[te],o[te],te,m,o):r;oe===r&&(oe=o[te]),T?js(m,te,oe):of(m,te,oe)}return m}function Eq(o,c){return _s(o,vg(o),c)}function xq(o,c){return _s(o,Aw(o),c)}function Hl(o,c){return function(m,S){var T=wt(m)?Dk:Wj,G=c?c():{};return T(m,o,ft(S,2),G)}}function Fc(o){return Dt(function(c,m){var S=-1,T=m.length,G=T>1?m[T-1]:r,Q=T>2?m[2]:r;for(G=o.length>3&&typeof G=="function"?(T--,G):r,Q&&gi(m[0],m[1],Q)&&(G=T<3?r:G,T=1),c=rr(c);++S<T;){var te=m[S];te&&o(c,te,S,G)}return c})}function fw(o,c){return function(m,S){if(m==null)return m;if(!Ni(m))return o(m,S);for(var T=m.length,G=c?T:-1,Q=rr(m);(c?G--:++G<T)&&S(Q[G],G,Q)!==!1;);return m}}function hw(o){return function(c,m,S){for(var T=-1,G=rr(c),Q=S(c),te=Q.length;te--;){var oe=Q[o?te:++T];if(m(G[oe],oe,G)===!1)break}return c}}function Sq(o,c,m){var S=c&W,T=hf(o);function G(){var Q=this&&this!==Ut&&this instanceof G?T:o;return Q.apply(S?m:this,arguments)}return G}function lw(o){return function(c){c=Gt(c);var m=Dc(c)?Ln(c):r,S=m?m[0]:c.charAt(0),T=m?Io(m,1).join(""):c.slice(1);return S[o]()+T}}function Lc(o){return function(c){return Rp(f4(u4(c).replace(Qu,"")),o,"")}}function hf(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var m=Tc(o.prototype),S=o.apply(m,c);return hr(S)?S:m}}function Iq(o,c,m){var S=hf(o);function T(){for(var G=arguments.length,Q=fe(G),te=G,oe=Bc(T);te--;)Q[te]=arguments[te];var le=G<3&&Q[0]!==oe&&Q[G-1]!==oe?[]:_o(Q,oe);if(G-=le.length,G<m)return mw(o,c,Kl,T.placeholder,r,Q,le,r,r,m-G);var de=this&&this!==Ut&&this instanceof T?S:o;return Fr(de,this,Q)}return T}function dw(o){return function(c,m,S){var T=rr(c);if(!Ni(c)){var G=ft(m,3);c=Lr(c),m=function(te){return G(T[te],te,T)}}var Q=o(c,m,S);return Q>-1?T[G?c[Q]:Q]:r}}function pw(o){return zs(function(c){var m=c.length,S=m,T=ln.prototype.thru;for(o&&c.reverse();S--;){var G=c[S];if(typeof G!="function")throw new hn(a);if(T&&!Q&&Yl(G)=="wrapper")var Q=new ln([],!0)}for(S=Q?S:m;++S<m;){G=c[S];var te=Yl(G),oe=te=="wrapper"?pg(G):r;oe&&bg(oe[0])&&oe[1]==(A|V|z|j)&&!oe[4].length&&oe[9]==1?Q=Q[Yl(oe[0])].apply(Q,oe[3]):Q=G.length==1&&bg(G)?Q[te]():Q.thru(G)}return function(){var le=arguments,de=le[0];if(Q&&le.length==1&&wt(de))return Q.plant(de).value();for(var we=0,ze=m?c[we].apply(this,le):de;++we<m;)ze=c[we].call(this,ze);return ze}})}function Kl(o,c,m,S,T,G,Q,te,oe,le){var de=c&A,we=c&W,ze=c&Y,at=c&(V|U),dt=c&ee,Mt=ze?r:hf(o);function pt(){for(var Nt=arguments.length,kt=fe(Nt),Vi=Nt;Vi--;)kt[Vi]=arguments[Vi];if(at)var vi=Bc(pt),Gi=Bk(kt,vi);if(S&&(kt=cw(kt,S,T,at)),G&&(kt=uw(kt,G,Q,at)),Nt-=Gi,at&&Nt<le){var Ar=_o(kt,vi);return mw(o,c,Kl,pt.placeholder,m,kt,Ar,te,oe,le-Nt)}var kn=we?m:this,Vs=ze?kn[o]:o;return Nt=kt.length,te?kt=Wq(kt,te):dt&&Nt>1&&kt.reverse(),de&&oe<Nt&&(kt.length=oe),this&&this!==Ut&&this instanceof pt&&(Vs=Mt||hf(Vs)),Vs.apply(kn,kt)}return pt}function gw(o,c){return function(m,S){return eq(m,o,c(S),{})}}function Wl(o,c){return function(m,S){var T;if(m===r&&S===r)return c;if(m!==r&&(T=m),S!==r){if(T===r)return S;typeof m=="string"||typeof S=="string"?(m=Ki(m),S=Ki(S)):(m=ew(m),S=ew(S)),T=o(m,S)}return T}}function fg(o){return zs(function(c){return c=ur(c,Hi(ft())),Dt(function(m){var S=this;return o(c,function(T){return Fr(T,S,m)})})})}function Vl(o,c){c=c===r?" ":Ki(c);var m=c.length;if(m<2)return m?ig(c,o):c;var S=ig(c,Nl(o/Pc(c)));return Dc(c)?Io(Ln(S),0,o).join(""):S.slice(0,o)}function Mq(o,c,m,S){var T=c&W,G=hf(o);function Q(){for(var te=-1,oe=arguments.length,le=-1,de=S.length,we=fe(de+oe),ze=this&&this!==Ut&&this instanceof Q?G:o;++le<de;)we[le]=S[le];for(;oe--;)we[le++]=arguments[++te];return Fr(ze,T?m:this,we)}return Q}function vw(o){return function(c,m,S){return S&&typeof S!="number"&&gi(c,m,S)&&(m=S=r),c=Ws(c),m===r?(m=c,c=0):m=Ws(m),S=S===r?c<m?1:-1:Ws(S),lq(c,m,S,o)}}function Gl(o){return function(c,m){return typeof c=="string"&&typeof m=="string"||(c=vn(c),m=vn(m)),o(c,m)}}function mw(o,c,m,S,T,G,Q,te,oe,le){var de=c&V,we=de?Q:r,ze=de?r:Q,at=de?G:r,dt=de?r:G;c|=de?z:K,c&=~(de?K:z),c&q||(c&=~(W|Y));var Mt=[o,c,T,at,we,dt,ze,te,oe,le],pt=m.apply(r,Mt);return bg(o)&&Dw(pt,Mt),pt.placeholder=S,Pw(pt,o,c)}function hg(o){var c=Cr[o];return function(m,S){if(m=vn(m),S=S==null?0:ni(It(S),292),S&&Py(m)){var T=(Gt(m)+"e").split("e"),G=c(T[0]+"e"+(+T[1]+S));return T=(Gt(G)+"e").split("e"),+(T[0]+"e"+(+T[1]-S))}return c(m)}}var Cq=Nc&&1/El(new Nc([,-0]))[1]==D?function(o){return new Nc(o)}:Ng;function bw(o){return function(c){var m=si(c);return m==ue?jp(c):m==xe?Kk(c):Lk(c,o(c))}}function qs(o,c,m,S,T,G,Q,te){var oe=c&Y;if(!oe&&typeof o!="function")throw new hn(a);var le=S?S.length:0;if(le||(c&=~(z|K),S=T=r),Q=Q===r?Q:Dr(It(Q),0),te=te===r?te:It(te),le-=T?T.length:0,c&K){var de=S,we=T;S=T=r}var ze=oe?r:pg(o),at=[o,c,m,S,T,de,we,G,Q,te];if(ze&&zq(at,ze),o=at[0],c=at[1],m=at[2],S=at[3],T=at[4],te=at[9]=at[9]===r?oe?0:o.length:Dr(at[9]-le,0),!te&&c&(V|U)&&(c&=~(V|U)),!c||c==W)var dt=Sq(o,c,m);else c==V||c==U?dt=Iq(o,c,te):(c==z||c==(W|z))&&!T.length?dt=Mq(o,c,m,S):dt=Kl.apply(r,at);var Mt=ze?Zy:Dw;return Pw(Mt(dt,at),o,c)}function yw(o,c,m,S){return o===r||Un(o,$c[m])&&!Jt.call(S,m)?c:o}function ww(o,c,m,S,T,G){return hr(o)&&hr(c)&&(G.set(c,o),jl(o,c,r,ww,G),G.delete(c)),o}function Dq(o){return pf(o)?r:o}function _w(o,c,m,S,T,G){var Q=m&M,te=o.length,oe=c.length;if(te!=oe&&!(Q&&oe>te))return!1;var le=G.get(o),de=G.get(c);if(le&&de)return le==c&&de==o;var we=-1,ze=!0,at=m&B?new ma:r;for(G.set(o,c),G.set(c,o);++we<te;){var dt=o[we],Mt=c[we];if(S)var pt=Q?S(Mt,dt,we,c,o,G):S(dt,Mt,we,o,c,G);if(pt!==r){if(pt)continue;ze=!1;break}if(at){if(!Tp(c,function(Nt,kt){if(!Xu(at,kt)&&(dt===Nt||T(dt,Nt,m,S,G)))return at.push(kt)})){ze=!1;break}}else if(!(dt===Mt||T(dt,Mt,m,S,G))){ze=!1;break}}return G.delete(o),G.delete(c),ze}function Pq(o,c,m,S,T,G,Q){switch(m){case me:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case _e:return!(o.byteLength!=c.byteLength||!G(new Dl(o),new Dl(c)));case F:case R:case ve:return Un(+o,+c);case $:return o.name==c.name&&o.message==c.message;case Re:case ye:return o==c+"";case ue:var te=jp;case xe:var oe=S&M;if(te||(te=El),o.size!=c.size&&!oe)return!1;var le=Q.get(o);if(le)return le==c;S|=B,Q.set(o,c);var de=_w(te(o),te(c),S,T,G,Q);return Q.delete(o),de;case Me:if(sf)return sf.call(o)==sf.call(c)}return!1}function Oq(o,c,m,S,T,G){var Q=m&M,te=lg(o),oe=te.length,le=lg(c),de=le.length;if(oe!=de&&!Q)return!1;for(var we=oe;we--;){var ze=te[we];if(!(Q?ze in c:Jt.call(c,ze)))return!1}var at=G.get(o),dt=G.get(c);if(at&&dt)return at==c&&dt==o;var Mt=!0;G.set(o,c),G.set(c,o);for(var pt=Q;++we<oe;){ze=te[we];var Nt=o[ze],kt=c[ze];if(S)var Vi=Q?S(kt,Nt,ze,c,o,G):S(Nt,kt,ze,o,c,G);if(!(Vi===r?Nt===kt||T(Nt,kt,m,S,G):Vi)){Mt=!1;break}pt||(pt=ze=="constructor")}if(Mt&&!pt){var vi=o.constructor,Gi=c.constructor;vi!=Gi&&"constructor"in o&&"constructor"in c&&!(typeof vi=="function"&&vi instanceof vi&&typeof Gi=="function"&&Gi instanceof Gi)&&(Mt=!1)}return G.delete(o),G.delete(c),Mt}function zs(o){return wg(Mw(o,r,Fw),o+"")}function lg(o){return jy(o,Lr,vg)}function dg(o){return jy(o,Ri,Aw)}var pg=Tl?function(o){return Tl.get(o)}:Ng;function Yl(o){for(var c=o.name+"",m=Rc[c],S=Jt.call(Rc,c)?m.length:0;S--;){var T=m[S],G=T.func;if(G==null||G==o)return T.name}return c}function Bc(o){var c=Jt.call(H,"placeholder")?H:o;return c.placeholder}function ft(){var o=H.iteratee||Og;return o=o===Og?Hy:o,arguments.length?o(arguments[0],arguments[1]):o}function Jl(o,c){var m=o.__data__;return Uq(c)?m[typeof c=="string"?"string":"hash"]:m.map}function gg(o){for(var c=Lr(o),m=c.length;m--;){var S=c[m],T=o[S];c[m]=[S,T,Sw(T)]}return c}function wa(o,c){var m=qk(o,c);return zy(m)?m:r}function $q(o){var c=Jt.call(o,ga),m=o[ga];try{o[ga]=r;var S=!0}catch{}var T=Ml.call(o);return S&&(c?o[ga]=m:delete o[ga]),T}var vg=zp?function(o){return o==null?[]:(o=rr(o),yo(zp(o),function(c){return Cy.call(o,c)}))}:Rg,Aw=zp?function(o){for(var c=[];o;)wo(c,vg(o)),o=Pl(o);return c}:Rg,si=pi;(Hp&&si(new Hp(new ArrayBuffer(1)))!=me||tf&&si(new tf)!=ue||Kp&&si(Kp.resolve())!=Ye||Nc&&si(new Nc)!=xe||rf&&si(new rf)!=pe)&&(si=function(o){var c=pi(o),m=c==Ee?o.constructor:r,S=m?_a(m):"";if(S)switch(S){case pj:return me;case gj:return ue;case vj:return Ye;case mj:return xe;case bj:return pe}return c});function Nq(o,c,m){for(var S=-1,T=m.length;++S<T;){var G=m[S],Q=G.size;switch(G.type){case"drop":o+=Q;break;case"dropRight":c-=Q;break;case"take":c=ni(c,o+Q);break;case"takeRight":o=Dr(o,c-Q);break}}return{start:o,end:c}}function Rq(o){var c=o.match(We);return c?c[1].split(st):[]}function Ew(o,c,m){c=So(c,o);for(var S=-1,T=c.length,G=!1;++S<T;){var Q=As(c[S]);if(!(G=o!=null&&m(o,Q)))break;o=o[Q]}return G||++S!=T?G:(T=o==null?0:o.length,!!T&&i0(T)&&Hs(Q,T)&&(wt(o)||Aa(o)))}function Tq(o){var c=o.length,m=new o.constructor(c);return c&&typeof o[0]=="string"&&Jt.call(o,"index")&&(m.index=o.index,m.input=o.input),m}function xw(o){return typeof o.constructor=="function"&&!lf(o)?Tc(Pl(o)):{}}function Fq(o,c,m){var S=o.constructor;switch(c){case _e:return ug(o);case F:case R:return new S(+o);case me:return yq(o,m);case Te:case Ce:case Ae:case ke:case qe:case Ie:case Ke:case ut:case Je:return ow(o,m);case ue:return new S;case ve:case ye:return new S(o);case Re:return wq(o);case xe:return new S;case Me:return _q(o)}}function Lq(o,c){var m=c.length;if(!m)return o;var S=m-1;return c[S]=(m>1?"& ":"")+c[S],c=c.join(m>2?", ":" "),o.replace(Ne,`{
|
|
51
|
+
/* [wrapped with `+c+`] */
|
|
52
|
+
`)}function Bq(o){return wt(o)||Aa(o)||!!(Dy&&o&&o[Dy])}function Hs(o,c){var m=typeof o;return c=c??P,!!c&&(m=="number"||m!="symbol"&&ii.test(o))&&o>-1&&o%1==0&&o<c}function gi(o,c,m){if(!hr(m))return!1;var S=typeof c;return(S=="number"?Ni(m)&&Hs(c,m.length):S=="string"&&c in m)?Un(m[c],o):!1}function mg(o,c){if(wt(o))return!1;var m=typeof o;return m=="number"||m=="symbol"||m=="boolean"||o==null||Wi(o)?!0:Fe.test(o)||!Ge.test(o)||c!=null&&o in rr(c)}function Uq(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function bg(o){var c=Yl(o),m=H[c];if(typeof m!="function"||!(c in Lt.prototype))return!1;if(o===m)return!0;var S=pg(m);return!!S&&o===S[0]}function kq(o){return!!Sy&&Sy in o}var jq=Sl?Ks:Tg;function lf(o){var c=o&&o.constructor,m=typeof c=="function"&&c.prototype||$c;return o===m}function Sw(o){return o===o&&!hr(o)}function Iw(o,c){return function(m){return m==null?!1:m[o]===c&&(c!==r||o in rr(m))}}function qq(o){var c=t0(o,function(S){return m.size===p&&m.clear(),S}),m=c.cache;return c}function zq(o,c){var m=o[1],S=c[1],T=m|S,G=T<(W|Y|A),Q=S==A&&m==V||S==A&&m==j&&o[7].length<=c[8]||S==(A|j)&&c[7].length<=c[8]&&m==V;if(!(G||Q))return o;S&W&&(o[2]=c[2],T|=m&W?0:q);var te=c[3];if(te){var oe=o[3];o[3]=oe?cw(oe,te,c[4]):te,o[4]=oe?_o(o[3],y):c[4]}return te=c[5],te&&(oe=o[5],o[5]=oe?uw(oe,te,c[6]):te,o[6]=oe?_o(o[5],y):c[6]),te=c[7],te&&(o[7]=te),S&A&&(o[8]=o[8]==null?c[8]:ni(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=T,o}function Hq(o){var c=[];if(o!=null)for(var m in rr(o))c.push(m);return c}function Kq(o){return Ml.call(o)}function Mw(o,c,m){return c=Dr(c===r?o.length-1:c,0),function(){for(var S=arguments,T=-1,G=Dr(S.length-c,0),Q=fe(G);++T<G;)Q[T]=S[c+T];T=-1;for(var te=fe(c+1);++T<c;)te[T]=S[T];return te[c]=m(Q),Fr(o,this,te)}}function Cw(o,c){return c.length<2?o:ya(o,pn(c,0,-1))}function Wq(o,c){for(var m=o.length,S=ni(c.length,m),T=$i(o);S--;){var G=c[S];o[S]=Hs(G,m)?T[G]:r}return o}function yg(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var Dw=Ow(Zy),df=aj||function(o,c){return Ut.setTimeout(o,c)},wg=Ow(gq);function Pw(o,c,m){var S=c+"";return wg(o,Lq(S,Vq(Rq(S),m)))}function Ow(o){var c=0,m=0;return function(){var S=hj(),T=f-(S-m);if(m=S,T>0){if(++c>=w)return arguments[0]}else c=0;return o.apply(r,arguments)}}function Ql(o,c){var m=-1,S=o.length,T=S-1;for(c=c===r?S:c;++m<c;){var G=rg(m,T),Q=o[G];o[G]=o[m],o[m]=Q}return o.length=c,o}var $w=qq(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(nt,function(m,S,T,G){c.push(T?G.replace(zt,"$1"):S||m)}),c});function As(o){if(typeof o=="string"||Wi(o))return o;var c=o+"";return c=="0"&&1/o==-D?"-0":c}function _a(o){if(o!=null){try{return Il.call(o)}catch{}try{return o+""}catch{}}return""}function Vq(o,c){return fn(ce,function(m){var S="_."+m[0];c&m[1]&&!_l(o,S)&&o.push(S)}),o.sort()}function Nw(o){if(o instanceof Lt)return o.clone();var c=new ln(o.__wrapped__,o.__chain__);return c.__actions__=$i(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function Gq(o,c,m){(m?gi(o,c,m):c===r)?c=1:c=Dr(It(c),0);var S=o==null?0:o.length;if(!S||c<1)return[];for(var T=0,G=0,Q=fe(Nl(S/c));T<S;)Q[G++]=pn(o,T,T+=c);return Q}function Yq(o){for(var c=-1,m=o==null?0:o.length,S=0,T=[];++c<m;){var G=o[c];G&&(T[S++]=G)}return T}function Jq(){var o=arguments.length;if(!o)return[];for(var c=fe(o-1),m=arguments[0],S=o;S--;)c[S-1]=arguments[S];return wo(wt(m)?$i(m):[m],Vr(c,1))}var Qq=Dt(function(o,c){return _r(o)?af(o,Vr(c,1,_r,!0)):[]}),Zq=Dt(function(o,c){var m=gn(c);return _r(m)&&(m=r),_r(o)?af(o,Vr(c,1,_r,!0),ft(m,2)):[]}),Xq=Dt(function(o,c){var m=gn(c);return _r(m)&&(m=r),_r(o)?af(o,Vr(c,1,_r,!0),r,m):[]});function ez(o,c,m){var S=o==null?0:o.length;return S?(c=m||c===r?1:It(c),pn(o,c<0?0:c,S)):[]}function tz(o,c,m){var S=o==null?0:o.length;return S?(c=m||c===r?1:It(c),c=S-c,pn(o,0,c<0?0:c)):[]}function rz(o,c){return o&&o.length?zl(o,ft(c,3),!0,!0):[]}function iz(o,c){return o&&o.length?zl(o,ft(c,3),!0):[]}function nz(o,c,m,S){var T=o==null?0:o.length;return T?(m&&typeof m!="number"&&gi(o,c,m)&&(m=0,S=T),Jj(o,c,m,S)):[]}function Rw(o,c,m){var S=o==null?0:o.length;if(!S)return-1;var T=m==null?0:It(m);return T<0&&(T=Dr(S+T,0)),Al(o,ft(c,3),T)}function Tw(o,c,m){var S=o==null?0:o.length;if(!S)return-1;var T=S-1;return m!==r&&(T=It(m),T=m<0?Dr(S+T,0):ni(T,S-1)),Al(o,ft(c,3),T,!0)}function Fw(o){var c=o==null?0:o.length;return c?Vr(o,1):[]}function sz(o){var c=o==null?0:o.length;return c?Vr(o,D):[]}function oz(o,c){var m=o==null?0:o.length;return m?(c=c===r?1:It(c),Vr(o,c)):[]}function az(o){for(var c=-1,m=o==null?0:o.length,S={};++c<m;){var T=o[c];S[T[0]]=T[1]}return S}function Lw(o){return o&&o.length?o[0]:r}function cz(o,c,m){var S=o==null?0:o.length;if(!S)return-1;var T=m==null?0:It(m);return T<0&&(T=Dr(S+T,0)),Cc(o,c,T)}function uz(o){var c=o==null?0:o.length;return c?pn(o,0,-1):[]}var fz=Dt(function(o){var c=ur(o,ag);return c.length&&c[0]===o[0]?Qp(c):[]}),hz=Dt(function(o){var c=gn(o),m=ur(o,ag);return c===gn(m)?c=r:m.pop(),m.length&&m[0]===o[0]?Qp(m,ft(c,2)):[]}),lz=Dt(function(o){var c=gn(o),m=ur(o,ag);return c=typeof c=="function"?c:r,c&&m.pop(),m.length&&m[0]===o[0]?Qp(m,r,c):[]});function dz(o,c){return o==null?"":uj.call(o,c)}function gn(o){var c=o==null?0:o.length;return c?o[c-1]:r}function pz(o,c,m){var S=o==null?0:o.length;if(!S)return-1;var T=S;return m!==r&&(T=It(m),T=T<0?Dr(S+T,0):ni(T,S-1)),c===c?Vk(o,c,T):Al(o,my,T,!0)}function gz(o,c){return o&&o.length?Gy(o,It(c)):r}var vz=Dt(Bw);function Bw(o,c){return o&&o.length&&c&&c.length?tg(o,c):o}function mz(o,c,m){return o&&o.length&&c&&c.length?tg(o,c,ft(m,2)):o}function bz(o,c,m){return o&&o.length&&c&&c.length?tg(o,c,r,m):o}var yz=zs(function(o,c){var m=o==null?0:o.length,S=Vp(o,c);return Qy(o,ur(c,function(T){return Hs(T,m)?+T:T}).sort(aw)),S});function wz(o,c){var m=[];if(!(o&&o.length))return m;var S=-1,T=[],G=o.length;for(c=ft(c,3);++S<G;){var Q=o[S];c(Q,S,o)&&(m.push(Q),T.push(S))}return Qy(o,T),m}function _g(o){return o==null?o:dj.call(o)}function _z(o,c,m){var S=o==null?0:o.length;return S?(m&&typeof m!="number"&&gi(o,c,m)?(c=0,m=S):(c=c==null?0:It(c),m=m===r?S:It(m)),pn(o,c,m)):[]}function Az(o,c){return ql(o,c)}function Ez(o,c,m){return ng(o,c,ft(m,2))}function xz(o,c){var m=o==null?0:o.length;if(m){var S=ql(o,c);if(S<m&&Un(o[S],c))return S}return-1}function Sz(o,c){return ql(o,c,!0)}function Iz(o,c,m){return ng(o,c,ft(m,2),!0)}function Mz(o,c){var m=o==null?0:o.length;if(m){var S=ql(o,c,!0)-1;if(Un(o[S],c))return S}return-1}function Cz(o){return o&&o.length?Xy(o):[]}function Dz(o,c){return o&&o.length?Xy(o,ft(c,2)):[]}function Pz(o){var c=o==null?0:o.length;return c?pn(o,1,c):[]}function Oz(o,c,m){return o&&o.length?(c=m||c===r?1:It(c),pn(o,0,c<0?0:c)):[]}function $z(o,c,m){var S=o==null?0:o.length;return S?(c=m||c===r?1:It(c),c=S-c,pn(o,c<0?0:c,S)):[]}function Nz(o,c){return o&&o.length?zl(o,ft(c,3),!1,!0):[]}function Rz(o,c){return o&&o.length?zl(o,ft(c,3)):[]}var Tz=Dt(function(o){return xo(Vr(o,1,_r,!0))}),Fz=Dt(function(o){var c=gn(o);return _r(c)&&(c=r),xo(Vr(o,1,_r,!0),ft(c,2))}),Lz=Dt(function(o){var c=gn(o);return c=typeof c=="function"?c:r,xo(Vr(o,1,_r,!0),r,c)});function Bz(o){return o&&o.length?xo(o):[]}function Uz(o,c){return o&&o.length?xo(o,ft(c,2)):[]}function kz(o,c){return c=typeof c=="function"?c:r,o&&o.length?xo(o,r,c):[]}function Ag(o){if(!(o&&o.length))return[];var c=0;return o=yo(o,function(m){if(_r(m))return c=Dr(m.length,c),!0}),Up(c,function(m){return ur(o,Fp(m))})}function Uw(o,c){if(!(o&&o.length))return[];var m=Ag(o);return c==null?m:ur(m,function(S){return Fr(c,r,S)})}var jz=Dt(function(o,c){return _r(o)?af(o,c):[]}),qz=Dt(function(o){return og(yo(o,_r))}),zz=Dt(function(o){var c=gn(o);return _r(c)&&(c=r),og(yo(o,_r),ft(c,2))}),Hz=Dt(function(o){var c=gn(o);return c=typeof c=="function"?c:r,og(yo(o,_r),r,c)}),Kz=Dt(Ag);function Wz(o,c){return iw(o||[],c||[],of)}function Vz(o,c){return iw(o||[],c||[],ff)}var Gz=Dt(function(o){var c=o.length,m=c>1?o[c-1]:r;return m=typeof m=="function"?(o.pop(),m):r,Uw(o,m)});function kw(o){var c=H(o);return c.__chain__=!0,c}function Yz(o,c){return c(o),o}function Zl(o,c){return c(o)}var Jz=zs(function(o){var c=o.length,m=c?o[0]:0,S=this.__wrapped__,T=function(G){return Vp(G,o)};return c>1||this.__actions__.length||!(S instanceof Lt)||!Hs(m)?this.thru(T):(S=S.slice(m,+m+(c?1:0)),S.__actions__.push({func:Zl,args:[T],thisArg:r}),new ln(S,this.__chain__).thru(function(G){return c&&!G.length&&G.push(r),G}))});function Qz(){return kw(this)}function Zz(){return new ln(this.value(),this.__chain__)}function Xz(){this.__values__===r&&(this.__values__=e4(this.value()));var o=this.__index__>=this.__values__.length,c=o?r:this.__values__[this.__index__++];return{done:o,value:c}}function eH(){return this}function tH(o){for(var c,m=this;m instanceof Ll;){var S=Nw(m);S.__index__=0,S.__values__=r,c?T.__wrapped__=S:c=S;var T=S;m=m.__wrapped__}return T.__wrapped__=o,c}function rH(){var o=this.__wrapped__;if(o instanceof Lt){var c=o;return this.__actions__.length&&(c=new Lt(this)),c=c.reverse(),c.__actions__.push({func:Zl,args:[_g],thisArg:r}),new ln(c,this.__chain__)}return this.thru(_g)}function iH(){return rw(this.__wrapped__,this.__actions__)}var nH=Hl(function(o,c,m){Jt.call(o,m)?++o[m]:js(o,m,1)});function sH(o,c,m){var S=wt(o)?gy:Yj;return m&&gi(o,c,m)&&(c=r),S(o,ft(c,3))}function oH(o,c){var m=wt(o)?yo:Uy;return m(o,ft(c,3))}var aH=dw(Rw),cH=dw(Tw);function uH(o,c){return Vr(Xl(o,c),1)}function fH(o,c){return Vr(Xl(o,c),D)}function hH(o,c,m){return m=m===r?1:It(m),Vr(Xl(o,c),m)}function jw(o,c){var m=wt(o)?fn:Eo;return m(o,ft(c,3))}function qw(o,c){var m=wt(o)?Pk:By;return m(o,ft(c,3))}var lH=Hl(function(o,c,m){Jt.call(o,m)?o[m].push(c):js(o,m,[c])});function dH(o,c,m,S){o=Ni(o)?o:kc(o),m=m&&!S?It(m):0;var T=o.length;return m<0&&(m=Dr(T+m,0)),n0(o)?m<=T&&o.indexOf(c,m)>-1:!!T&&Cc(o,c,m)>-1}var pH=Dt(function(o,c,m){var S=-1,T=typeof c=="function",G=Ni(o)?fe(o.length):[];return Eo(o,function(Q){G[++S]=T?Fr(c,Q,m):cf(Q,c,m)}),G}),gH=Hl(function(o,c,m){js(o,m,c)});function Xl(o,c){var m=wt(o)?ur:Ky;return m(o,ft(c,3))}function vH(o,c,m,S){return o==null?[]:(wt(c)||(c=c==null?[]:[c]),m=S?r:m,wt(m)||(m=m==null?[]:[m]),Yy(o,c,m))}var mH=Hl(function(o,c,m){o[m?0:1].push(c)},function(){return[[],[]]});function bH(o,c,m){var S=wt(o)?Rp:yy,T=arguments.length<3;return S(o,ft(c,4),m,T,Eo)}function yH(o,c,m){var S=wt(o)?Ok:yy,T=arguments.length<3;return S(o,ft(c,4),m,T,By)}function wH(o,c){var m=wt(o)?yo:Uy;return m(o,r0(ft(c,3)))}function _H(o){var c=wt(o)?Ry:dq;return c(o)}function AH(o,c,m){(m?gi(o,c,m):c===r)?c=1:c=It(c);var S=wt(o)?Hj:pq;return S(o,c)}function EH(o){var c=wt(o)?Kj:vq;return c(o)}function xH(o){if(o==null)return 0;if(Ni(o))return n0(o)?Pc(o):o.length;var c=si(o);return c==ue||c==xe?o.size:Xp(o).length}function SH(o,c,m){var S=wt(o)?Tp:mq;return m&&gi(o,c,m)&&(c=r),S(o,ft(c,3))}var IH=Dt(function(o,c){if(o==null)return[];var m=c.length;return m>1&&gi(o,c[0],c[1])?c=[]:m>2&&gi(c[0],c[1],c[2])&&(c=[c[0]]),Yy(o,Vr(c,1),[])}),e0=oj||function(){return Ut.Date.now()};function MH(o,c){if(typeof c!="function")throw new hn(a);return o=It(o),function(){if(--o<1)return c.apply(this,arguments)}}function zw(o,c,m){return c=m?r:c,c=o&&c==null?o.length:c,qs(o,A,r,r,r,r,c)}function Hw(o,c){var m;if(typeof c!="function")throw new hn(a);return o=It(o),function(){return--o>0&&(m=c.apply(this,arguments)),o<=1&&(c=r),m}}var Eg=Dt(function(o,c,m){var S=W;if(m.length){var T=_o(m,Bc(Eg));S|=z}return qs(o,S,c,m,T)}),Kw=Dt(function(o,c,m){var S=W|Y;if(m.length){var T=_o(m,Bc(Kw));S|=z}return qs(c,S,o,m,T)});function Ww(o,c,m){c=m?r:c;var S=qs(o,V,r,r,r,r,r,c);return S.placeholder=Ww.placeholder,S}function Vw(o,c,m){c=m?r:c;var S=qs(o,U,r,r,r,r,r,c);return S.placeholder=Vw.placeholder,S}function Gw(o,c,m){var S,T,G,Q,te,oe,le=0,de=!1,we=!1,ze=!0;if(typeof o!="function")throw new hn(a);c=vn(c)||0,hr(m)&&(de=!!m.leading,we="maxWait"in m,G=we?Dr(vn(m.maxWait)||0,c):G,ze="trailing"in m?!!m.trailing:ze);function at(Ar){var kn=S,Vs=T;return S=T=r,le=Ar,Q=o.apply(Vs,kn),Q}function dt(Ar){return le=Ar,te=df(Nt,c),de?at(Ar):Q}function Mt(Ar){var kn=Ar-oe,Vs=Ar-le,d4=c-kn;return we?ni(d4,G-Vs):d4}function pt(Ar){var kn=Ar-oe,Vs=Ar-le;return oe===r||kn>=c||kn<0||we&&Vs>=G}function Nt(){var Ar=e0();if(pt(Ar))return kt(Ar);te=df(Nt,Mt(Ar))}function kt(Ar){return te=r,ze&&S?at(Ar):(S=T=r,Q)}function Vi(){te!==r&&nw(te),le=0,S=oe=T=te=r}function vi(){return te===r?Q:kt(e0())}function Gi(){var Ar=e0(),kn=pt(Ar);if(S=arguments,T=this,oe=Ar,kn){if(te===r)return dt(oe);if(we)return nw(te),te=df(Nt,c),at(oe)}return te===r&&(te=df(Nt,c)),Q}return Gi.cancel=Vi,Gi.flush=vi,Gi}var CH=Dt(function(o,c){return Ly(o,1,c)}),DH=Dt(function(o,c,m){return Ly(o,vn(c)||0,m)});function PH(o){return qs(o,ee)}function t0(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new hn(a);var m=function(){var S=arguments,T=c?c.apply(this,S):S[0],G=m.cache;if(G.has(T))return G.get(T);var Q=o.apply(this,S);return m.cache=G.set(T,Q)||G,Q};return m.cache=new(t0.Cache||ks),m}t0.Cache=ks;function r0(o){if(typeof o!="function")throw new hn(a);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function OH(o){return Hw(2,o)}var $H=bq(function(o,c){c=c.length==1&&wt(c[0])?ur(c[0],Hi(ft())):ur(Vr(c,1),Hi(ft()));var m=c.length;return Dt(function(S){for(var T=-1,G=ni(S.length,m);++T<G;)S[T]=c[T].call(this,S[T]);return Fr(o,this,S)})}),xg=Dt(function(o,c){var m=_o(c,Bc(xg));return qs(o,z,r,c,m)}),Yw=Dt(function(o,c){var m=_o(c,Bc(Yw));return qs(o,K,r,c,m)}),NH=zs(function(o,c){return qs(o,j,r,r,r,c)});function RH(o,c){if(typeof o!="function")throw new hn(a);return c=c===r?c:It(c),Dt(o,c)}function TH(o,c){if(typeof o!="function")throw new hn(a);return c=c==null?0:Dr(It(c),0),Dt(function(m){var S=m[c],T=Io(m,0,c);return S&&wo(T,S),Fr(o,this,T)})}function FH(o,c,m){var S=!0,T=!0;if(typeof o!="function")throw new hn(a);return hr(m)&&(S="leading"in m?!!m.leading:S,T="trailing"in m?!!m.trailing:T),Gw(o,c,{leading:S,maxWait:c,trailing:T})}function LH(o){return zw(o,1)}function BH(o,c){return xg(cg(c),o)}function UH(){if(!arguments.length)return[];var o=arguments[0];return wt(o)?o:[o]}function kH(o){return dn(o,I)}function jH(o,c){return c=typeof c=="function"?c:r,dn(o,I,c)}function qH(o){return dn(o,_|I)}function zH(o,c){return c=typeof c=="function"?c:r,dn(o,_|I,c)}function HH(o,c){return c==null||Fy(o,c,Lr(c))}function Un(o,c){return o===c||o!==o&&c!==c}var KH=Gl(Jp),WH=Gl(function(o,c){return o>=c}),Aa=qy(function(){return arguments}())?qy:function(o){return vr(o)&&Jt.call(o,"callee")&&!Cy.call(o,"callee")},wt=fe.isArray,VH=di?Hi(di):tq;function Ni(o){return o!=null&&i0(o.length)&&!Ks(o)}function _r(o){return vr(o)&&Ni(o)}function GH(o){return o===!0||o===!1||vr(o)&&pi(o)==F}var Mo=cj||Tg,YH=Fn?Hi(Fn):rq;function JH(o){return vr(o)&&o.nodeType===1&&!pf(o)}function QH(o){if(o==null)return!0;if(Ni(o)&&(wt(o)||typeof o=="string"||typeof o.splice=="function"||Mo(o)||Uc(o)||Aa(o)))return!o.length;var c=si(o);if(c==ue||c==xe)return!o.size;if(lf(o))return!Xp(o).length;for(var m in o)if(Jt.call(o,m))return!1;return!0}function ZH(o,c){return uf(o,c)}function XH(o,c,m){m=typeof m=="function"?m:r;var S=m?m(o,c):r;return S===r?uf(o,c,r,m):!!S}function Sg(o){if(!vr(o))return!1;var c=pi(o);return c==$||c==l||typeof o.message=="string"&&typeof o.name=="string"&&!pf(o)}function eK(o){return typeof o=="number"&&Py(o)}function Ks(o){if(!hr(o))return!1;var c=pi(o);return c==Z||c==ae||c==N||c==De}function Jw(o){return typeof o=="number"&&o==It(o)}function i0(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=P}function hr(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function vr(o){return o!=null&&typeof o=="object"}var Qw=un?Hi(un):nq;function tK(o,c){return o===c||Zp(o,c,gg(c))}function rK(o,c,m){return m=typeof m=="function"?m:r,Zp(o,c,gg(c),m)}function iK(o){return Zw(o)&&o!=+o}function nK(o){if(jq(o))throw new mt(s);return zy(o)}function sK(o){return o===null}function oK(o){return o==null}function Zw(o){return typeof o=="number"||vr(o)&&pi(o)==ve}function pf(o){if(!vr(o)||pi(o)!=Ee)return!1;var c=Pl(o);if(c===null)return!0;var m=Jt.call(c,"constructor")&&c.constructor;return typeof m=="function"&&m instanceof m&&Il.call(m)==rj}var Ig=ys?Hi(ys):sq;function aK(o){return Jw(o)&&o>=-P&&o<=P}var Xw=Zu?Hi(Zu):oq;function n0(o){return typeof o=="string"||!wt(o)&&vr(o)&&pi(o)==ye}function Wi(o){return typeof o=="symbol"||vr(o)&&pi(o)==Me}var Uc=pa?Hi(pa):aq;function cK(o){return o===r}function uK(o){return vr(o)&&si(o)==pe}function fK(o){return vr(o)&&pi(o)==Se}var hK=Gl(eg),lK=Gl(function(o,c){return o<=c});function e4(o){if(!o)return[];if(Ni(o))return n0(o)?Ln(o):$i(o);if(ef&&o[ef])return Hk(o[ef]());var c=si(o),m=c==ue?jp:c==xe?El:kc;return m(o)}function Ws(o){if(!o)return o===0?o:0;if(o=vn(o),o===D||o===-D){var c=o<0?-1:1;return c*x}return o===o?o:0}function It(o){var c=Ws(o),m=c%1;return c===c?m?c-m:c:0}function t4(o){return o?ba(It(o),0,b):0}function vn(o){if(typeof o=="number")return o;if(Wi(o))return v;if(hr(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=hr(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=wy(o);var m=ei.test(o);return m||ri.test(o)?yt(o.slice(2),m?2:8):Xr.test(o)?v:+o}function r4(o){return _s(o,Ri(o))}function dK(o){return o?ba(It(o),-P,P):o===0?o:0}function Gt(o){return o==null?"":Ki(o)}var pK=Fc(function(o,c){if(lf(c)||Ni(c)){_s(c,Lr(c),o);return}for(var m in c)Jt.call(c,m)&&of(o,m,c[m])}),i4=Fc(function(o,c){_s(c,Ri(c),o)}),s0=Fc(function(o,c,m,S){_s(c,Ri(c),o,S)}),gK=Fc(function(o,c,m,S){_s(c,Lr(c),o,S)}),vK=zs(Vp);function mK(o,c){var m=Tc(o);return c==null?m:Ty(m,c)}var bK=Dt(function(o,c){o=rr(o);var m=-1,S=c.length,T=S>2?c[2]:r;for(T&&gi(c[0],c[1],T)&&(S=1);++m<S;)for(var G=c[m],Q=Ri(G),te=-1,oe=Q.length;++te<oe;){var le=Q[te],de=o[le];(de===r||Un(de,$c[le])&&!Jt.call(o,le))&&(o[le]=G[le])}return o}),yK=Dt(function(o){return o.push(r,ww),Fr(n4,r,o)});function wK(o,c){return vy(o,ft(c,3),ws)}function _K(o,c){return vy(o,ft(c,3),Yp)}function AK(o,c){return o==null?o:Gp(o,ft(c,3),Ri)}function EK(o,c){return o==null?o:ky(o,ft(c,3),Ri)}function xK(o,c){return o&&ws(o,ft(c,3))}function SK(o,c){return o&&Yp(o,ft(c,3))}function IK(o){return o==null?[]:kl(o,Lr(o))}function MK(o){return o==null?[]:kl(o,Ri(o))}function Mg(o,c,m){var S=o==null?r:ya(o,c);return S===r?m:S}function CK(o,c){return o!=null&&Ew(o,c,Qj)}function Cg(o,c){return o!=null&&Ew(o,c,Zj)}var DK=gw(function(o,c,m){c!=null&&typeof c.toString!="function"&&(c=Ml.call(c)),o[c]=m},Pg(Ti)),PK=gw(function(o,c,m){c!=null&&typeof c.toString!="function"&&(c=Ml.call(c)),Jt.call(o,c)?o[c].push(m):o[c]=[m]},ft),OK=Dt(cf);function Lr(o){return Ni(o)?Ny(o):Xp(o)}function Ri(o){return Ni(o)?Ny(o,!0):cq(o)}function $K(o,c){var m={};return c=ft(c,3),ws(o,function(S,T,G){js(m,c(S,T,G),S)}),m}function NK(o,c){var m={};return c=ft(c,3),ws(o,function(S,T,G){js(m,T,c(S,T,G))}),m}var RK=Fc(function(o,c,m){jl(o,c,m)}),n4=Fc(function(o,c,m,S){jl(o,c,m,S)}),TK=zs(function(o,c){var m={};if(o==null)return m;var S=!1;c=ur(c,function(G){return G=So(G,o),S||(S=G.length>1),G}),_s(o,dg(o),m),S&&(m=dn(m,_|C|I,Dq));for(var T=c.length;T--;)sg(m,c[T]);return m});function FK(o,c){return s4(o,r0(ft(c)))}var LK=zs(function(o,c){return o==null?{}:fq(o,c)});function s4(o,c){if(o==null)return{};var m=ur(dg(o),function(S){return[S]});return c=ft(c),Jy(o,m,function(S,T){return c(S,T[0])})}function BK(o,c,m){c=So(c,o);var S=-1,T=c.length;for(T||(T=1,o=r);++S<T;){var G=o==null?r:o[As(c[S])];G===r&&(S=T,G=m),o=Ks(G)?G.call(o):G}return o}function UK(o,c,m){return o==null?o:ff(o,c,m)}function kK(o,c,m,S){return S=typeof S=="function"?S:r,o==null?o:ff(o,c,m,S)}var o4=bw(Lr),a4=bw(Ri);function jK(o,c,m){var S=wt(o),T=S||Mo(o)||Uc(o);if(c=ft(c,4),m==null){var G=o&&o.constructor;T?m=S?new G:[]:hr(o)?m=Ks(G)?Tc(Pl(o)):{}:m={}}return(T?fn:ws)(o,function(Q,te,oe){return c(m,Q,te,oe)}),m}function qK(o,c){return o==null?!0:sg(o,c)}function zK(o,c,m){return o==null?o:tw(o,c,cg(m))}function HK(o,c,m,S){return S=typeof S=="function"?S:r,o==null?o:tw(o,c,cg(m),S)}function kc(o){return o==null?[]:kp(o,Lr(o))}function KK(o){return o==null?[]:kp(o,Ri(o))}function WK(o,c,m){return m===r&&(m=c,c=r),m!==r&&(m=vn(m),m=m===m?m:0),c!==r&&(c=vn(c),c=c===c?c:0),ba(vn(o),c,m)}function VK(o,c,m){return c=Ws(c),m===r?(m=c,c=0):m=Ws(m),o=vn(o),Xj(o,c,m)}function GK(o,c,m){if(m&&typeof m!="boolean"&&gi(o,c,m)&&(c=m=r),m===r&&(typeof c=="boolean"?(m=c,c=r):typeof o=="boolean"&&(m=o,o=r)),o===r&&c===r?(o=0,c=1):(o=Ws(o),c===r?(c=o,o=0):c=Ws(c)),o>c){var S=o;o=c,c=S}if(m||o%1||c%1){var T=Oy();return ni(o+T*(c-o+er("1e-"+((T+"").length-1))),c)}return rg(o,c)}var YK=Lc(function(o,c,m){return c=c.toLowerCase(),o+(m?c4(c):c)});function c4(o){return Dg(Gt(o).toLowerCase())}function u4(o){return o=Gt(o),o&&o.replace(gr,Uk).replace(Op,"")}function JK(o,c,m){o=Gt(o),c=Ki(c);var S=o.length;m=m===r?S:ba(It(m),0,S);var T=m;return m-=c.length,m>=0&&o.slice(m,T)==c}function QK(o){return o=Gt(o),o&&Ve.test(o)?o.replace(Ct,kk):o}function ZK(o){return o=Gt(o),o&&Le.test(o)?o.replace(Xe,"\\$&"):o}var XK=Lc(function(o,c,m){return o+(m?"-":"")+c.toLowerCase()}),eW=Lc(function(o,c,m){return o+(m?" ":"")+c.toLowerCase()}),tW=lw("toLowerCase");function rW(o,c,m){o=Gt(o),c=It(c);var S=c?Pc(o):0;if(!c||S>=c)return o;var T=(c-S)/2;return Vl(Rl(T),m)+o+Vl(Nl(T),m)}function iW(o,c,m){o=Gt(o),c=It(c);var S=c?Pc(o):0;return c&&S<c?o+Vl(c-S,m):o}function nW(o,c,m){o=Gt(o),c=It(c);var S=c?Pc(o):0;return c&&S<c?Vl(c-S,m)+o:o}function sW(o,c,m){return m||c==null?c=0:c&&(c=+c),lj(Gt(o).replace(et,""),c||0)}function oW(o,c,m){return(m?gi(o,c,m):c===r)?c=1:c=It(c),ig(Gt(o),c)}function aW(){var o=arguments,c=Gt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var cW=Lc(function(o,c,m){return o+(m?"_":"")+c.toLowerCase()});function uW(o,c,m){return m&&typeof m!="number"&&gi(o,c,m)&&(c=m=r),m=m===r?b:m>>>0,m?(o=Gt(o),o&&(typeof c=="string"||c!=null&&!Ig(c))&&(c=Ki(c),!c&&Dc(o))?Io(Ln(o),0,m):o.split(c,m)):[]}var fW=Lc(function(o,c,m){return o+(m?" ":"")+Dg(c)});function hW(o,c,m){return o=Gt(o),m=m==null?0:ba(It(m),0,o.length),c=Ki(c),o.slice(m,m+c.length)==c}function lW(o,c,m){var S=H.templateSettings;m&&gi(o,c,m)&&(c=r),o=Gt(o),c=s0({},c,S,yw);var T=s0({},c.imports,S.imports,yw),G=Lr(T),Q=kp(T,G),te,oe,le=0,de=c.interpolate||Ci,we="__p += '",ze=qp((c.escape||Ci).source+"|"+de.source+"|"+(de===Qe?lt:Ci).source+"|"+(c.evaluate||Ci).source+"|$","g"),at="//# sourceURL="+(Jt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$p+"]")+`
|
|
53
|
+
`;o.replace(ze,function(pt,Nt,kt,Vi,vi,Gi){return kt||(kt=Vi),we+=o.slice(le,Gi).replace(Pn,jk),Nt&&(te=!0,we+=`' +
|
|
54
|
+
__e(`+Nt+`) +
|
|
55
|
+
'`),vi&&(oe=!0,we+=`';
|
|
56
|
+
`+vi+`;
|
|
57
|
+
__p += '`),kt&&(we+=`' +
|
|
58
|
+
((__t = (`+kt+`)) == null ? '' : __t) +
|
|
59
|
+
'`),le=Gi+pt.length,pt}),we+=`';
|
|
60
|
+
`;var dt=Jt.call(c,"variable")&&c.variable;if(!dt)we=`with (obj) {
|
|
61
|
+
`+we+`
|
|
62
62
|
}
|
|
63
|
-
`;else if(
|
|
64
|
-
`+(
|
|
65
|
-
`)+"var __t, __p = ''"+(
|
|
63
|
+
`;else if(qt.test(dt))throw new mt(u);we=(oe?we.replace(gt,""):we).replace(ht,"$1").replace(ot,"$1;"),we="function("+(dt||"obj")+`) {
|
|
64
|
+
`+(dt?"":`obj || (obj = {});
|
|
65
|
+
`)+"var __t, __p = ''"+(te?", __e = _.escape":"")+(oe?`, __j = Array.prototype.join;
|
|
66
66
|
function print() { __p += __j.call(arguments, '') }
|
|
67
67
|
`:`;
|
|
68
|
-
`)+
|
|
69
|
-
}`;var pe=Zb(function(){return Ne(R,Lt+"return "+gt).apply(r,G)});if(pe.source=gt,Op(pe))throw pe;return pe}function AU(s){return Be(s).toLowerCase()}function xU(s){return Be(s).toUpperCase()}function IU(s,a,u){if(s=Be(s),s&&(u||a===r))return ay(s);if(!s||!(a=En(a)))return s;var y=ni(s),S=ni(a),R=cy(y,S),G=ly(y,S)+1;return Ls(y,R,G).join("")}function SU(s,a,u){if(s=Be(s),s&&(u||a===r))return s.slice(0,hy(s)+1);if(!s||!(a=En(a)))return s;var y=ni(s),S=ly(y,ni(a))+1;return Ls(y,0,S).join("")}function CU(s,a,u){if(s=Be(s),s&&(u||a===r))return s.replace(Jt,"");if(!s||!(a=En(a)))return s;var y=ni(s),S=cy(y,ni(a));return Ls(y,S).join("")}function DU(s,a){var u=tt,y=nt;if(sr(a)){var S="separator"in a?a.separator:S;u="length"in a?fe(a.length):u,y="omission"in a?En(a.omission):y}s=Be(s);var R=s.length;if(Da(s)){var G=ni(s);R=G.length}if(u>=R)return s;var Q=u-Oa(y);if(Q<1)return y;var X=G?Ls(G,0,Q).join(""):s.slice(0,Q);if(S===r)return X+y;if(G&&(Q+=X.length-Q),Pp(S)){if(s.slice(Q).search(S)){var ct,ut=X;for(S.global||(S=Wd(S.source,Be(ve.exec(S))+"g")),S.lastIndex=0;ct=S.exec(ut);)var gt=ct.index;X=X.slice(0,gt===r?Q:gt)}}else if(s.indexOf(En(S),Q)!=Q){var wt=X.lastIndexOf(S);wt>-1&&(X=X.slice(0,wt))}return X+y}function OU(s){return s=Be(s),s&&Yt.test(s)?s.replace(Oe,iN):s}var PU=La(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),Np=Xy("toUpperCase");function Jb(s,a,u){return s=Be(s),a=u?r:a,a===r?X$(s)?aN(s):H$(s):s.match(a)||[]}var Zb=ge(function(s,a){try{return Ir(s,r,a)}catch(u){return Op(u)?u:new ie(u)}}),MU=rs(function(s,a){return jn(a,function(u){u=Bi(u),ts(s,u,Cp(s[u],s))}),s});function $U(s){var a=s==null?0:s.length,u=qt();return s=a?er(s,function(y){if(typeof y[1]!="function")throw new kn(c);return[u(y[0]),y[1]]}):[],ge(function(y){for(var S=-1;++S<a;){var R=s[S];if(Ir(R[0],this,y))return Ir(R[1],this,y)}})}function NU(s){return iT(zn(s,_))}function Tp(s){return function(){return s}}function TU(s,a){return s==null||s!==s?a:s}var RU=eb(),LU=eb(!0);function dn(s){return s}function Rp(s){return My(typeof s=="function"?s:zn(s,_))}function BU(s){return Ny(zn(s,_))}function UU(s,a){return Ty(s,zn(a,_))}var FU=ge(function(s,a){return function(u){return Xc(u,s,a)}}),jU=ge(function(s,a){return function(u){return Xc(s,u,a)}});function Lp(s,a,u){var y=Sr(a),S=ph(a,y);u==null&&!(sr(a)&&(S.length||!y.length))&&(u=a,a=s,s=this,S=ph(a,Sr(a)));var R=!(sr(u)&&"chain"in u)||!!u.chain,G=is(s);return jn(S,function(Q){var X=a[Q];s[Q]=X,G&&(s.prototype[Q]=function(){var ct=this.__chain__;if(R||ct){var ut=s(this.__wrapped__),gt=ut.__actions__=un(this.__actions__);return gt.push({func:X,args:arguments,thisArg:s}),ut.__chain__=ct,ut}return X.apply(s,Ps([this.value()],arguments))})}),s}function kU(){return Se._===this&&(Se._=dN),this}function Bp(){}function qU(s){return s=fe(s),ge(function(a){return Ry(a,s)})}var zU=pp(er),HU=pp(ry),KU=pp(Fd);function Xb(s){return _p(s)?jd(Bi(s)):_T(s)}function WU(s){return function(a){return s==null?r:Oo(s,a)}}var VU=nb(),GU=nb(!0);function Up(){return[]}function Fp(){return!1}function YU(){return{}}function QU(){return""}function JU(){return!0}function ZU(s,a){if(s=fe(s),s<1||s>N)return[];var u=v,y=Ur(s,v);a=qt(a),s-=v;for(var S=zd(y,a);++u<s;)a(u);return S}function XU(s){return ae(s)?er(s,Bi):An(s)?[s]:un(yb(Be(s)))}function tF(s){var a=++hN;return Be(s)+a}var eF=bh(function(s,a){return s+a},0),rF=gp("ceil"),nF=bh(function(s,a){return s/a},1),iF=gp("floor");function sF(s){return s&&s.length?dh(s,dn,tp):r}function oF(s,a){return s&&s.length?dh(s,qt(a,2),tp):r}function aF(s){return sy(s,dn)}function cF(s,a){return sy(s,qt(a,2))}function lF(s){return s&&s.length?dh(s,dn,ip):r}function uF(s,a){return s&&s.length?dh(s,qt(a,2),ip):r}var hF=bh(function(s,a){return s*a},1),fF=gp("round"),dF=bh(function(s,a){return s-a},0);function pF(s){return s&&s.length?qd(s,dn):0}function gF(s,a){return s&&s.length?qd(s,qt(a,2)):0}return M.after=BL,M.ary=Pb,M.assign=xB,M.assignIn=Hb,M.assignInWith=Nh,M.assignWith=IB,M.at=SB,M.before=Mb,M.bind=Cp,M.bindAll=MU,M.bindKey=$b,M.castArray=YL,M.chain=Cb,M.chunk=iR,M.compact=sR,M.concat=oR,M.cond=$U,M.conforms=NU,M.constant=Tp,M.countBy=pL,M.create=CB,M.curry=Nb,M.curryRight=Tb,M.debounce=Rb,M.defaults=DB,M.defaultsDeep=OB,M.defer=UL,M.delay=FL,M.difference=aR,M.differenceBy=cR,M.differenceWith=lR,M.drop=uR,M.dropRight=hR,M.dropRightWhile=fR,M.dropWhile=dR,M.fill=pR,M.filter=mL,M.flatMap=yL,M.flatMapDeep=bL,M.flatMapDepth=_L,M.flatten=Ab,M.flattenDeep=gR,M.flattenDepth=mR,M.flip=jL,M.flow=RU,M.flowRight=LU,M.fromPairs=vR,M.functions=LB,M.functionsIn=BB,M.groupBy=EL,M.initial=yR,M.intersection=bR,M.intersectionBy=_R,M.intersectionWith=ER,M.invert=FB,M.invertBy=jB,M.invokeMap=xL,M.iteratee=Rp,M.keyBy=IL,M.keys=Sr,M.keysIn=fn,M.map=Ch,M.mapKeys=qB,M.mapValues=zB,M.matches=BU,M.matchesProperty=UU,M.memoize=Oh,M.merge=HB,M.mergeWith=Kb,M.method=FU,M.methodOf=jU,M.mixin=Lp,M.negate=Ph,M.nthArg=qU,M.omit=KB,M.omitBy=WB,M.once=kL,M.orderBy=SL,M.over=zU,M.overArgs=qL,M.overEvery=HU,M.overSome=KU,M.partial=Dp,M.partialRight=Lb,M.partition=CL,M.pick=VB,M.pickBy=Wb,M.property=Xb,M.propertyOf=WU,M.pull=SR,M.pullAll=Ib,M.pullAllBy=CR,M.pullAllWith=DR,M.pullAt=OR,M.range=VU,M.rangeRight=GU,M.rearg=zL,M.reject=PL,M.remove=PR,M.rest=HL,M.reverse=Ip,M.sampleSize=$L,M.set=YB,M.setWith=QB,M.shuffle=NL,M.slice=MR,M.sortBy=LL,M.sortedUniq=UR,M.sortedUniqBy=FR,M.split=yU,M.spread=KL,M.tail=jR,M.take=kR,M.takeRight=qR,M.takeRightWhile=zR,M.takeWhile=HR,M.tap=sL,M.throttle=WL,M.thru=Sh,M.toArray=kb,M.toPairs=Vb,M.toPairsIn=Gb,M.toPath=XU,M.toPlainObject=zb,M.transform=JB,M.unary=VL,M.union=KR,M.unionBy=WR,M.unionWith=VR,M.uniq=GR,M.uniqBy=YR,M.uniqWith=QR,M.unset=ZB,M.unzip=Sp,M.unzipWith=Sb,M.update=XB,M.updateWith=tU,M.values=Fa,M.valuesIn=eU,M.without=JR,M.words=Jb,M.wrap=GL,M.xor=ZR,M.xorBy=XR,M.xorWith=tL,M.zip=eL,M.zipObject=rL,M.zipObjectDeep=nL,M.zipWith=iL,M.entries=Vb,M.entriesIn=Gb,M.extend=Hb,M.extendWith=Nh,Lp(M,M),M.add=eF,M.attempt=Zb,M.camelCase=sU,M.capitalize=Yb,M.ceil=rF,M.clamp=rU,M.clone=QL,M.cloneDeep=ZL,M.cloneDeepWith=XL,M.cloneWith=JL,M.conformsTo=tB,M.deburr=Qb,M.defaultTo=TU,M.divide=nF,M.endsWith=oU,M.eq=si,M.escape=aU,M.escapeRegExp=cU,M.every=gL,M.find=vL,M.findIndex=_b,M.findKey=PB,M.findLast=wL,M.findLastIndex=Eb,M.findLastKey=MB,M.floor=iF,M.forEach=Db,M.forEachRight=Ob,M.forIn=$B,M.forInRight=NB,M.forOwn=TB,M.forOwnRight=RB,M.get=Mp,M.gt=eB,M.gte=rB,M.has=UB,M.hasIn=$p,M.head=xb,M.identity=dn,M.includes=AL,M.indexOf=wR,M.inRange=nU,M.invoke=kB,M.isArguments=$o,M.isArray=ae,M.isArrayBuffer=nB,M.isArrayLike=hn,M.isArrayLikeObject=dr,M.isBoolean=iB,M.isBuffer=Bs,M.isDate=sB,M.isElement=oB,M.isEmpty=aB,M.isEqual=cB,M.isEqualWith=lB,M.isError=Op,M.isFinite=uB,M.isFunction=is,M.isInteger=Bb,M.isLength=Mh,M.isMap=Ub,M.isMatch=hB,M.isMatchWith=fB,M.isNaN=dB,M.isNative=pB,M.isNil=mB,M.isNull=gB,M.isNumber=Fb,M.isObject=sr,M.isObjectLike=cr,M.isPlainObject=sl,M.isRegExp=Pp,M.isSafeInteger=vB,M.isSet=jb,M.isString=$h,M.isSymbol=An,M.isTypedArray=Ua,M.isUndefined=wB,M.isWeakMap=yB,M.isWeakSet=bB,M.join=AR,M.kebabCase=lU,M.last=Kn,M.lastIndexOf=xR,M.lowerCase=uU,M.lowerFirst=hU,M.lt=_B,M.lte=EB,M.max=sF,M.maxBy=oF,M.mean=aF,M.meanBy=cF,M.min=lF,M.minBy=uF,M.stubArray=Up,M.stubFalse=Fp,M.stubObject=YU,M.stubString=QU,M.stubTrue=JU,M.multiply=hF,M.nth=IR,M.noConflict=kU,M.noop=Bp,M.now=Dh,M.pad=fU,M.padEnd=dU,M.padStart=pU,M.parseInt=gU,M.random=iU,M.reduce=DL,M.reduceRight=OL,M.repeat=mU,M.replace=vU,M.result=GB,M.round=fF,M.runInContext=Z,M.sample=ML,M.size=TL,M.snakeCase=wU,M.some=RL,M.sortedIndex=$R,M.sortedIndexBy=NR,M.sortedIndexOf=TR,M.sortedLastIndex=RR,M.sortedLastIndexBy=LR,M.sortedLastIndexOf=BR,M.startCase=bU,M.startsWith=_U,M.subtract=dF,M.sum=pF,M.sumBy=gF,M.template=EU,M.times=ZU,M.toFinite=ss,M.toInteger=fe,M.toLength=qb,M.toLower=AU,M.toNumber=Wn,M.toSafeInteger=AB,M.toString=Be,M.toUpper=xU,M.trim=IU,M.trimEnd=SU,M.trimStart=CU,M.truncate=DU,M.unescape=OU,M.uniqueId=tF,M.upperCase=PU,M.upperFirst=Np,M.each=Db,M.eachRight=Ob,M.first=xb,Lp(M,function(){var s={};return Ri(M,function(a,u){qe.call(M.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),M.VERSION=n,jn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){M[s].placeholder=M}),jn(["drop","take"],function(s,a){Ae.prototype[s]=function(u){u=u===r?1:br(fe(u),0);var y=this.__filtered__&&!a?new Ae(this):this.clone();return y.__filtered__?y.__takeCount__=Ur(u,y.__takeCount__):y.__views__.push({size:Ur(u,v),type:s+(y.__dir__<0?"Right":"")}),y},Ae.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),jn(["filter","map","takeWhile"],function(s,a){var u=a+1,y=u==p||u==C;Ae.prototype[s]=function(S){var R=this.clone();return R.__iteratees__.push({iteratee:qt(S,3),type:u}),R.__filtered__=R.__filtered__||y,R}}),jn(["head","last"],function(s,a){var u="take"+(a?"Right":"");Ae.prototype[s]=function(){return this[u](1).value()[0]}}),jn(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");Ae.prototype[s]=function(){return this.__filtered__?new Ae(this):this[u](1)}}),Ae.prototype.compact=function(){return this.filter(dn)},Ae.prototype.find=function(s){return this.filter(s).head()},Ae.prototype.findLast=function(s){return this.reverse().find(s)},Ae.prototype.invokeMap=ge(function(s,a){return typeof s=="function"?new Ae(this):this.map(function(u){return Xc(u,s,a)})}),Ae.prototype.reject=function(s){return this.filter(Ph(qt(s)))},Ae.prototype.slice=function(s,a){s=fe(s);var u=this;return u.__filtered__&&(s>0||a<0)?new Ae(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==r&&(a=fe(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},Ae.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Ae.prototype.toArray=function(){return this.take(v)},Ri(Ae.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),y=/^(?:head|last)$/.test(a),S=M[y?"take"+(a=="last"?"Right":""):a],R=y||/^find/.test(a);S&&(M.prototype[a]=function(){var G=this.__wrapped__,Q=y?[1]:arguments,X=G instanceof Ae,ct=Q[0],ut=X||ae(G),gt=function(ye){var Ce=S.apply(M,Ps([ye],Q));return y&&wt?Ce[0]:Ce};ut&&u&&typeof ct=="function"&&ct.length!=1&&(X=ut=!1);var wt=this.__chain__,Lt=!!this.__actions__.length,Kt=R&&!wt,pe=X&&!Lt;if(!R&&ut){G=pe?G:new Ae(this);var Wt=s.apply(G,Q);return Wt.__actions__.push({func:Sh,args:[gt],thisArg:r}),new qn(Wt,wt)}return Kt&&pe?s.apply(this,Q):(Wt=this.thru(gt),Kt?y?Wt.value()[0]:Wt.value():Wt)})}),jn(["pop","push","shift","sort","splice","unshift"],function(s){var a=Zu[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",y=/^(?:pop|shift)$/.test(s);M.prototype[s]=function(){var S=arguments;if(y&&!this.__chain__){var R=this.value();return a.apply(ae(R)?R:[],S)}return this[u](function(G){return a.apply(ae(G)?G:[],S)})}}),Ri(Ae.prototype,function(s,a){var u=M[a];if(u){var y=u.name+"";qe.call(Na,y)||(Na[y]=[]),Na[y].push({name:a,func:u})}}),Na[yh(r,Y).name]=[{name:"wrapper",func:r}],Ae.prototype.clone=ON,Ae.prototype.reverse=PN,Ae.prototype.value=MN,M.prototype.at=oL,M.prototype.chain=aL,M.prototype.commit=cL,M.prototype.next=lL,M.prototype.plant=hL,M.prototype.reverse=fL,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=dL,M.prototype.first=M.prototype.head,Wc&&(M.prototype[Wc]=uL),M},Pa=cN();fr?((fr.exports=Pa)._=Pa,Ye._=Pa):Se._=Pa}).call(_c)})(g0,g0.exports);var xC=Object.defineProperty,IC=Object.defineProperties,SC=Object.getOwnPropertyDescriptors,gw=Object.getOwnPropertySymbols,CC=Object.prototype.hasOwnProperty,DC=Object.prototype.propertyIsEnumerable,mw=(e,t,r)=>t in e?xC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xl=(e,t)=>{for(var r in t||(t={}))CC.call(t,r)&&mw(e,r,t[r]);if(gw)for(var r of gw(t))DC.call(t,r)&&mw(e,r,t[r]);return e},OC=(e,t)=>IC(e,SC(t));function Vi(e,t,r){var n;const i=Wa(e);return((n=t.rpcMap)==null?void 0:n[i.reference])||`${AC}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function Zs(e){return e.includes(":")?e.split(":")[1]:e}function vw(e){return e.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function PC(e,t){const r=Object.keys(t.namespaces).filter(i=>i.includes(e));if(!r.length)return[];const n=[];return r.forEach(i=>{const o=t.namespaces[i].accounts;n.push(...o)}),n}function m0(e={},t={}){const r=ww(e),n=ww(t);return g0.exports.merge(r,n)}function ww(e){var t,r,n,i;const o={};if(!ac(e))return o;for(const[c,l]of Object.entries(e)){const f=Tf(c)?[c]:l.chains,h=l.methods||[],g=l.events||[],_=l.rpcMap||{},E=oc(c);o[E]=OC(Xl(Xl({},o[E]),l),{chains:wl(f,(t=o[E])==null?void 0:t.chains),methods:wl(h,(r=o[E])==null?void 0:r.methods),events:wl(g,(n=o[E])==null?void 0:n.events),rpcMap:Xl(Xl({},_),(i=o[E])==null?void 0:i.rpcMap)})}return o}function MC(e){return e.includes(":")?e.split(":")[2]:e}function yw(e){const t={};for(const[r,n]of Object.entries(e)){const i=n.methods||[],o=n.events||[],c=n.accounts||[],l=Tf(r)?[r]:n.chains?n.chains:vw(n.accounts);t[r]={chains:l,methods:i,events:o,accounts:c}}return t}function v0(e){return typeof e=="number"?e:e.includes("0x")?parseInt(e,16):(e=e.includes(":")?e.split(":")[1]:e,isNaN(Number(e))?e:Number(e))}const bw={},We=e=>bw[e],w0=(e,t)=>{bw[e]=t};class $C{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=We("events"),this.client=We("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Vi(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ei(new Wi(n,We("disableProviderPing")))}}var NC=Object.defineProperty,TC=Object.defineProperties,RC=Object.getOwnPropertyDescriptors,_w=Object.getOwnPropertySymbols,LC=Object.prototype.hasOwnProperty,BC=Object.prototype.propertyIsEnumerable,Ew=(e,t,r)=>t in e?NC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Aw=(e,t)=>{for(var r in t||(t={}))LC.call(t,r)&&Ew(e,r,t[r]);if(_w)for(var r of _w(t))BC.call(t,r)&&Ew(e,r,t[r]);return e},xw=(e,t)=>TC(e,RC(t));class UC{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=We("events"),this.client=We("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(t)}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(parseInt(t),r),this.chainId=parseInt(t),this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,r){const n=r||Vi(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ei(new Wi(n,We("disableProviderPing")))}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(Zs(r));t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}async handleSwitchChain(t){var r,n;let i=t.request.params?(r=t.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:t.topic,request:{method:t.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(t){return this.namespace.chains.includes(`${this.name}:${t}`)}async getCapabilities(t){var r,n,i;const o=(n=(r=t.request)==null?void 0:r.params)==null?void 0:n[0];if(!o)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const c=this.client.session.get(t.topic),l=((i=c?.sessionProperties)==null?void 0:i.capabilities)||{};if(l!=null&&l[o])return l?.[o];const f=await this.client.request(t);try{await this.client.session.update(t.topic,{sessionProperties:xw(Aw({},c.sessionProperties||{}),{capabilities:xw(Aw({},l||{}),{[o]:f})})})}catch(h){console.warn("Failed to update session with capabilities",h)}return f}}class FC{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=We("events"),this.client=We("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Vi(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ei(new Wi(n,We("disableProviderPing")))}}class jC{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=We("events"),this.client=We("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Vi(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ei(new Wi(n,We("disableProviderPing")))}}class kC{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=We("events"),this.client=We("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=Zs(r);t[i]=this.createHttpProvider(i,n)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}getCardanoRPCUrl(t){const r=this.namespace.rpcMap;if(r)return r[t]}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||this.getCardanoRPCUrl(t);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ei(new Wi(n,We("disableProviderPing")))}}class qC{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=We("events"),this.client=We("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Vi(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ei(new Wi(n,We("disableProviderPing")))}}class zC{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=We("events"),this.client=We("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=Zs(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Vi(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ei(new Wi(n,We("disableProviderPing")))}}class HC{constructor(t){this.name="near",this.namespace=t.namespace,this.events=We("events"),this.client=We("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){if(this.chainId=t,!this.httpProviders[t]){const n=r||Vi(`${this.name}:${t}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,n)}this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;t[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Vi(t,this.namespace);return typeof n>"u"?void 0:new Ei(new Wi(n,We("disableProviderPing")))}}class KC{constructor(t){this.name=ia,this.namespace=t.namespace,this.events=We("events"),this.client=We("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(t.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(t.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(t.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(t.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider(t.chainId).request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var t,r;const n={};return(r=(t=this.namespace)==null?void 0:t.accounts)==null||r.forEach(i=>{const o=Wa(i);n[`${o.namespace}:${o.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(t){const r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Vi(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ei(new Wi(n,We("disableProviderPing")))}}var WC=Object.defineProperty,VC=Object.defineProperties,GC=Object.getOwnPropertyDescriptors,Iw=Object.getOwnPropertySymbols,YC=Object.prototype.hasOwnProperty,QC=Object.prototype.propertyIsEnumerable,Sw=(e,t,r)=>t in e?WC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tu=(e,t)=>{for(var r in t||(t={}))YC.call(t,r)&&Sw(e,r,t[r]);if(Iw)for(var r of Iw(t))QC.call(t,r)&&Sw(e,r,t[r]);return e},y0=(e,t)=>VC(e,GC(t));class b0{constructor(t){this.events=new Cr.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof t?.logger<"u"&&typeof t?.logger!="string"?t.logger:yi(Kl({level:t?.logger||dw})),this.disableProviderPing=t?.disableProviderPing||!1}static async init(t){const r=new b0(t);return await r.initialize(),r}async request(t,r,n){const[i,o]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:tu({},t),chainId:`${i}:${o}`,topic:this.session.topic,expiry:n})}sendAsync(t,r,n,i){const o=new Date().getTime();this.request(t,n,i).then(c=>r(null,Vl(o,c))).catch(c=>r(c,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 t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:Ue("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}async authenticate(t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(t),await this.cleanupPendingPairings();const{uri:r,response:n}=await this.client.authenticate(t);r&&(this.uri=r,this.events.emit("display_uri",r));const i=await n();if(this.session=i.session,this.session){const o=yw(this.session.namespaces);this.namespaces=m0(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return i}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}removeListener(t,r){this.events.removeListener(t,r)}off(t,r){this.events.off(t,r)}get isWalletConnect(){return!0}async pair(t){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:t,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;const c=yw(o.namespaces);this.namespaces=m0(this.namespaces,c),this.persist("namespaces",this.namespaces)}).catch(o=>{if(o.message!==nw)throw o;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,r){try{if(!this.session)return;const[n,i]=this.validateChain(t),o=this.getProvider(n);o.name===ia?o.setDefaultChain(`${n}:${i}`,r):o.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(wi(r)){for(const n of r)t.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 t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await d0.init({logger:this.providerOpts.logger||dw,relayUrl:this.providerOpts.relayUrl||bC,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 t=[...new Set(Object.keys(this.session.namespaces).map(r=>oc(r)))];w0("client",this.client),w0("events",this.events),w0("disableProviderPing",this.disableProviderPing),t.forEach(r=>{if(!this.session)return;const n=PC(r,this.session),i=vw(n),o=m0(this.namespaces,this.optionalNamespaces),c=y0(tu({},o[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new UC({namespace:c});break;case"solana":this.rpcProviders[r]=new FC({namespace:c});break;case"cosmos":this.rpcProviders[r]=new jC({namespace:c});break;case"polkadot":this.rpcProviders[r]=new $C({namespace:c});break;case"cip34":this.rpcProviders[r]=new kC({namespace:c});break;case"elrond":this.rpcProviders[r]=new qC({namespace:c});break;case"multiversx":this.rpcProviders[r]=new zC({namespace:c});break;case"near":this.rpcProviders[r]=new HC({namespace:c});break;default:this.rpcProviders[ia]?this.rpcProviders[ia].updateNamespace(c):this.rpcProviders[ia]=new KC({namespace:c})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{this.events.emit("session_ping",t)}),this.client.on("session_event",t=>{const{params:r}=t,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&wi(i)&&this.events.emit("accountsChanged",i.map(MC))}else if(n.name==="chainChanged"){const i=r.chainId,o=r.event.data,c=oc(i),l=v0(i)!==v0(o)?`${c}:${v0(o)}`:i;this.onChainChanged(l)}else this.events.emit(n.name,n.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:r})=>{var n;const{namespaces:i}=r,o=(n=this.client)==null?void 0:n.session.get(t);this.session=y0(tu({},o),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:r})}),this.client.on("session_delete",async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",y0(tu({},Ue("USER_DISCONNECTED")),{data:t.topic}))}),this.on(Ii.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(t,!0)})}getProvider(t){return this.rpcProviders[t]||this.rpcProviders[ia]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var r;this.getProvider(t).updateNamespace((r=this.session)==null?void 0:r.namespaces[t])})}setNamespaces(t){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=t;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(t){const[r,n]=t?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(c=>oc(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=oc(Object.keys(this.namespaces)[0]),o=this.rpcProviders[i].getDefaultChain();return[i,o]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(t);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}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(t,r){this.client.core.storage.setItem(`${pw}/${t}`,r)}async getFromStore(t){return await this.client.core.storage.getItem(`${pw}/${t}`)}}const JC=b0,ZC="wc",XC="ethereum_provider",tD=`${ZC}@2:${XC}:`,eD="https://rpc.walletconnect.com/v1/",eu=["eth_sendTransaction","personal_sign"],Cw=["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","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],ru=["chainChanged","accountsChanged"],Dw=["chainChanged","accountsChanged","message","disconnect","connect"];var rD=Object.defineProperty,nD=Object.defineProperties,iD=Object.getOwnPropertyDescriptors,Ow=Object.getOwnPropertySymbols,sD=Object.prototype.hasOwnProperty,oD=Object.prototype.propertyIsEnumerable,Pw=(e,t,r)=>t in e?rD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sa=(e,t)=>{for(var r in t||(t={}))sD.call(t,r)&&Pw(e,r,t[r]);if(Ow)for(var r of Ow(t))oD.call(t,r)&&Pw(e,r,t[r]);return e},_0=(e,t)=>nD(e,iD(t));function nu(e){return Number(e[0].split(":")[1])}function iu(e){return`0x${e.toString(16)}`}function aD(e){const{chains:t,optionalChains:r,methods:n,optionalMethods:i,events:o,optionalEvents:c,rpcMap:l}=e;if(!wi(t))throw new Error("Invalid chains");const f={chains:t,methods:n||eu,events:o||ru,rpcMap:sa({},t.length?{[nu(t)]:l[nu(t)]}:{})},h=o?.filter(x=>!ru.includes(x)),g=n?.filter(x=>!eu.includes(x));if(!r&&!c&&!i&&!(h!=null&&h.length)&&!(g!=null&&g.length))return{required:t.length?f:void 0};const _=h?.length&&g?.length||!r,E={chains:[...new Set(_?f.chains.concat(r||[]):r)],methods:[...new Set(f.methods.concat(i!=null&&i.length?i:Cw))],events:[...new Set(f.events.concat(c!=null&&c.length?c:Dw))],rpcMap:l};return{required:t.length?f:void 0,optional:r.length?E:void 0}}class su{constructor(){this.events=new Cr.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=tD,this.on=(t,r)=>(this.events.on(t,r),this),this.once=(t,r)=>(this.events.once(t,r),this),this.removeListener=(t,r)=>(this.events.removeListener(t,r),this),this.off=(t,r)=>(this.events.off(t,r),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){const r=new su;return await r.initialize(t),r}async request(t,r){return await this.signer.request(t,this.formatChainId(this.chainId),r)}sendAsync(t,r,n){this.signer.sendAsync(t,r,this.formatChainId(this.chainId),n)}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(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);const{required:r,optional:n}=aD(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(_0(sa({namespaces:sa({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:t?.pairingTopic})).then(h=>{c(h)}).catch(h=>{l(new Error(h.message))})});if(!i)return;const o=Y1(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:iu(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async authenticate(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:t?.chains});try{const r=await new Promise(async(i,o)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(_0(sa({},t),{chains:this.rpc.chains})).then(l=>{i(l)}).catch(l=>{o(new Error(l.message))})}),n=r.session;if(n){const i=Y1(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:i),this.setAccounts(i),this.events.emit("connect",{chainId:iu(this.chainId)})}return r}catch(r){throw this.signer.logger.error(r),r}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",t=>{const{params:r}=t,{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",t)}),this.signer.on("chainChanged",t=>{const r=parseInt(t);this.chainId=r,this.events.emit("chainChanged",iu(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",_0(sa({},Ue("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",t=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:t})),this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return typeof t=="string"?t.startsWith(`${this.namespace}:`):!1}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){const r=t.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",iu(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const r=this.parseChainId(t);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(t){const[r,n,i]=t.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(t){this.accounts=t.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var r,n;const i=(r=t?.chains)!=null?r:[],o=(n=t?.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?t?.methods||eu:[],f=i.length?t?.events||ru:[],h=t?.optionalMethods||[],g=t?.optionalEvents||[],_=t?.rpcMap||this.buildRpcMap(c,t.projectId),E=t?.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:g,rpcMap:_,showQrModal:!!(t!=null&&t.showQrModal),qrModalOptions:E,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,r){const n={};return t.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?nu(this.rpc.chains):nu(this.rpc.optionalChains),this.signer=await JC.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await Promise.resolve().then(function(){return PD});r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(sa({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:r,optionalChains:n,rpcMap:i}=t;r&&wi(r)&&(this.rpc.chains=r.map(o=>this.formatChainId(o)),r.forEach(o=>{this.rpc.rpcMap[o]=i?.[o]||this.getRpcUrl(o)})),n&&wi(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(t,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[t])||`${eD}?chainId=eip155:${t}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:r?.accounts),this.setAccounts(r?.accounts)}catch(t){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(t),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return typeof t=="string"||t instanceof String?[this.parseAccount(t)]:t.map(r=>this.parseAccount(r))}}const cD=su,lD=Symbol(),Mw=Object.getPrototypeOf,E0=new WeakMap,uD=e=>e&&(E0.has(e)?E0.get(e):Mw(e)===Object.prototype||Mw(e)===Array.prototype),hD=e=>uD(e)&&e[lD]||null,$w=(e,t=!0)=>{E0.set(e,t)},A0=e=>typeof e=="object"&&e!==null,ps=new WeakMap,ou=new WeakSet,fD=(e=Object.is,t=(h,g)=>new Proxy(h,g),r=h=>A0(h)&&!ou.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,g,_=n)=>{const E=i.get(h);if(E?.[0]===g)return E[1];const x=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h));return $w(x,!0),i.set(h,[g,x]),Reflect.ownKeys(h).forEach(I=>{if(Object.getOwnPropertyDescriptor(x,I))return;const F=Reflect.get(h,I),W={value:F,enumerable:!0,configurable:!0};if(ou.has(F))$w(F,!1);else if(F instanceof Promise)delete W.value,W.get=()=>_(F);else if(ps.has(F)){const[Y,B]=ps.get(F);W.value=o(Y,B(),_)}Object.defineProperty(x,I,W)}),Object.preventExtensions(x)},c=new WeakMap,l=[1,1],f=h=>{if(!A0(h))throw new Error("object required");const g=c.get(h);if(g)return g;let _=l[0];const E=new Set,x=(et,tt=++l[0])=>{_!==tt&&(_=tt,E.forEach(nt=>nt(et,tt)))};let I=l[1];const F=(et=++l[1])=>(I!==et&&!E.size&&(I=et,Y.forEach(([tt])=>{const nt=tt[1](et);nt>_&&(_=nt)})),_),W=et=>(tt,nt)=>{const dt=[...tt];dt[1]=[et,...dt[1]],x(dt,nt)},Y=new Map,B=(et,tt)=>{if(Y.has(et))throw new Error("prop listener already exists");if(E.size){const nt=tt[3](W(et));Y.set(et,[tt,nt])}else Y.set(et,[tt])},z=et=>{var tt;const nt=Y.get(et);nt&&(Y.delete(et),(tt=nt[1])==null||tt.call(nt))},P=et=>(E.add(et),E.size===1&&Y.forEach(([nt,dt],d)=>{if(dt)throw new Error("remove already exists");const p=nt[3](W(d));Y.set(d,[nt,p])}),()=>{E.delete(et),E.size===0&&Y.forEach(([nt,dt],d)=>{dt&&(dt(),Y.set(d,[nt]))})}),U=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h)),m=t(U,{deleteProperty(et,tt){const nt=Reflect.get(et,tt);z(tt);const dt=Reflect.deleteProperty(et,tt);return dt&&x(["delete",[tt],nt]),dt},set(et,tt,nt,dt){const d=Reflect.has(et,tt),p=Reflect.get(et,tt,dt);if(d&&(e(p,nt)||c.has(nt)&&e(p,c.get(nt))))return!0;z(tt),A0(nt)&&(nt=hD(nt)||nt);let b=nt;if(nt instanceof Promise)nt.then(C=>{nt.status="fulfilled",nt.value=C,x(["resolve",[tt],C])}).catch(C=>{nt.status="rejected",nt.reason=C,x(["reject",[tt],C])});else{!ps.has(nt)&&r(nt)&&(b=f(nt));const C=!ou.has(b)&&ps.get(b);C&&B(tt,C)}return Reflect.set(et,tt,b,dt),x(["set",[tt],nt,p]),!0}});c.set(h,m);const $=[U,F,o,P];return ps.set(m,$),Reflect.ownKeys(h).forEach(et=>{const tt=Object.getOwnPropertyDescriptor(h,et);"value"in tt&&(m[et]=h[et],delete tt.value,delete tt.writable),Object.defineProperty(U,et,tt)}),m})=>[f,ps,ou,e,t,r,n,i,o,c,l],[dD]=fD();function gs(e={}){return dD(e)}function Xs(e,t,r){const n=ps.get(e);n||console.warn("Please use proxy object");let i;const o=[],c=n[3];let l=!1;const h=c(g=>{if(o.push(g),r){t(o.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,l&&t(o.splice(0))}))});return l=!0,()=>{l=!1,h()}}function pD(e,t){const r=ps.get(e);r||console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),t)}const Ar=gs({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),rr={state:Ar,subscribe(e){return Xs(Ar,()=>e(Ar))},push(e,t){e!==Ar.view&&(Ar.view=e,t&&(Ar.data=t),Ar.history.push(e))},reset(e){Ar.view=e,Ar.history=[e]},replace(e){Ar.history.length>1&&(Ar.history[Ar.history.length-1]=e,Ar.view=e)},goBack(){if(Ar.history.length>1){Ar.history.pop();const[e]=Ar.history.slice(-1);Ar.view=e}},setData(e){Ar.data=e}},Ut={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",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 Ut.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return Ut.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,r){if(Ut.isHttpUrl(e))return this.formatUniversalUrl(e,t,r);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(t);return`${n}wc?uri=${i}`},formatUniversalUrl(e,t,r){if(!Ut.isHttpUrl(e))return this.formatNativeUrl(e,t,r);let n=e;n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(t);return`${n}wc?uri=${i}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(Ut.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(Ut.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(Ut.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(Ut.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=rr.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},gD=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Br=gs({enabled:gD,userSessionId:"",events:[],connectedWalletId:void 0}),Nw={state:Br,subscribe(e){return Xs(Br.events,()=>e(pD(Br.events[Br.events.length-1])))},initialize(){Br.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(Br.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){Br.connectedWalletId=e},click(e){if(Br.enabled){const t={type:"CLICK",name:e.name,userSessionId:Br.userSessionId,timestamp:Date.now(),data:e};Br.events.push(t)}},track(e){if(Br.enabled){const t={type:"TRACK",name:e.name,userSessionId:Br.userSessionId,timestamp:Date.now(),data:e};Br.events.push(t)}},view(e){if(Br.enabled){const t={type:"VIEW",name:e.name,userSessionId:Br.userSessionId,timestamp:Date.now(),data:e};Br.events.push(t)}}},Si=gs({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),hr={state:Si,subscribe(e){return Xs(Si,()=>e(Si))},setChains(e){Si.chains=e},setWalletConnectUri(e){Si.walletConnectUri=e},setIsCustomDesktop(e){Si.isCustomDesktop=e},setIsCustomMobile(e){Si.isCustomMobile=e},setIsDataLoaded(e){Si.isDataLoaded=e},setIsUiLoaded(e){Si.isUiLoaded=e},setIsAuth(e){Si.isAuth=e}},au=gs({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),wn={state:au,subscribe(e){return Xs(au,()=>e(au))},setConfig(e){var t,r;Nw.initialize(),hr.setChains(e.chains),hr.setIsAuth(!!e.enableAuthMode),hr.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),hr.setIsCustomDesktop(!!((r=e.desktopWallets)!=null&&r.length)),Ut.setModalVersionInStorage(),Object.assign(au,e)}};var mD=Object.defineProperty,Tw=Object.getOwnPropertySymbols,vD=Object.prototype.hasOwnProperty,wD=Object.prototype.propertyIsEnumerable,Rw=(e,t,r)=>t in e?mD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yD=(e,t)=>{for(var r in t||(t={}))vD.call(t,r)&&Rw(e,r,t[r]);if(Tw)for(var r of Tw(t))wD.call(t,r)&&Rw(e,r,t[r]);return e};const x0="https://explorer-api.walletconnect.com",I0="wcm",S0="js-2.6.2";async function cu(e,t){const r=yD({sdkType:I0,sdkVersion:S0},t),n=new URL(e,x0);return n.searchParams.append("projectId",wn.state.projectId),Object.entries(r).forEach(([i,o])=>{o&&n.searchParams.append(i,String(o))}),(await fetch(n)).json()}const to={async getDesktopListings(e){return cu("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return cu("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return cu("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return cu("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${x0}/w3m/v1/getWalletImage/${e}?projectId=${wn.state.projectId}&sdkType=${I0}&sdkVersion=${S0}`},getAssetImageUrl(e){return`${x0}/w3m/v1/getAssetImage/${e}?projectId=${wn.state.projectId}&sdkType=${I0}&sdkVersion=${S0}`}};var bD=Object.defineProperty,Lw=Object.getOwnPropertySymbols,_D=Object.prototype.hasOwnProperty,ED=Object.prototype.propertyIsEnumerable,Bw=(e,t,r)=>t in e?bD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,AD=(e,t)=>{for(var r in t||(t={}))_D.call(t,r)&&Bw(e,r,t[r]);if(Lw)for(var r of Lw(t))ED.call(t,r)&&Bw(e,r,t[r]);return e};const Uw=Ut.isMobile(),Ci=gs({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),an={state:Ci,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=wn.state;if(e==="NONE"||t==="ALL"&&!e)return Ci.recomendedWallets;if(Ut.isArray(e)){const r={recommendedIds:e.join(",")},{listings:n}=await to.getAllListings(r),i=Object.values(n);i.sort((o,c)=>{const l=e.indexOf(o.id),f=e.indexOf(c.id);return l-f}),Ci.recomendedWallets=i}else{const{chains:r,isAuth:n}=hr.state,i=r?.join(","),o=Ut.isArray(t),c={page:1,sdks:n?"auth_v1":void 0,entries:Ut.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:o?t.join(","):void 0},{listings:l}=Uw?await to.getMobileListings(c):await to.getDesktopListings(c);Ci.recomendedWallets=Object.values(l)}return Ci.recomendedWallets},async getWallets(e){const t=AD({},e),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=wn.state,{recomendedWallets:i}=Ci;if(n==="ALL")return Ci.wallets;i.length?t.excludedIds=i.map(_=>_.id).join(","):Ut.isArray(r)&&(t.excludedIds=r.join(",")),Ut.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),hr.state.isAuth&&(t.sdks="auth_v1");const{page:o,search:c}=e,{listings:l,total:f}=Uw?await to.getMobileListings(t):await to.getDesktopListings(t),h=Object.values(l),g=c?"search":"wallets";return Ci[g]={listings:[...Ci[g].listings,...h],total:f,page:o??1},{listings:h,total:f}},getWalletImageUrl(e){return to.getWalletImageUrl(e)},getAssetImageUrl(e){return to.getAssetImageUrl(e)},resetSearch(){Ci.search={listings:[],total:0,page:1}}},oa=gs({open:!1}),eo={state:oa,subscribe(e){return Xs(oa,()=>e(oa))},async open(e){return new Promise(t=>{const{isUiLoaded:r,isDataLoaded:n}=hr.state;if(Ut.removeWalletConnectDeepLink(),hr.setWalletConnectUri(e?.uri),hr.setChains(e?.chains),rr.reset("ConnectWallet"),r&&n)oa.open=!0,t();else{const i=setInterval(()=>{const o=hr.state;o.isUiLoaded&&o.isDataLoaded&&(clearInterval(i),oa.open=!0,t())},200)}})},close(){oa.open=!1}};var xD=Object.defineProperty,Fw=Object.getOwnPropertySymbols,ID=Object.prototype.hasOwnProperty,SD=Object.prototype.propertyIsEnumerable,jw=(e,t,r)=>t in e?xD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,CD=(e,t)=>{for(var r in t||(t={}))ID.call(t,r)&&jw(e,r,t[r]);if(Fw)for(var r of Fw(t))SD.call(t,r)&&jw(e,r,t[r]);return e};function DD(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const Ec=gs({themeMode:DD()?"dark":"light"}),ms={state:Ec,subscribe(e){return Xs(Ec,()=>e(Ec))},setThemeConfig(e){const{themeMode:t,themeVariables:r}=e;t&&(Ec.themeMode=t),r&&(Ec.themeVariables=CD({},r))}},ro=gs({open:!1,message:"",variant:"success"}),vs={state:ro,subscribe(e){return Xs(ro,()=>e(ro))},openToast(e,t){ro.open=!0,ro.message=e,ro.variant=t},closeToast(){ro.open=!1}};class OD{constructor(t){this.openModal=eo.open,this.closeModal=eo.close,this.subscribeModal=eo.subscribe,this.setTheme=ms.setThemeConfig,ms.setThemeConfig(t),wn.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return U$});const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),hr.setIsUiLoaded(!0)}}}var PD=Object.freeze({__proto__:null,WalletConnectModal:OD});/**
|
|
68
|
+
`)+we+`return __p
|
|
69
|
+
}`;var Mt=h4(function(){return Kt(G,at+"return "+we).apply(r,Q)});if(Mt.source=we,Sg(Mt))throw Mt;return Mt}function dW(o){return Gt(o).toLowerCase()}function pW(o){return Gt(o).toUpperCase()}function gW(o,c,m){if(o=Gt(o),o&&(m||c===r))return wy(o);if(!o||!(c=Ki(c)))return o;var S=Ln(o),T=Ln(c),G=_y(S,T),Q=Ay(S,T)+1;return Io(S,G,Q).join("")}function vW(o,c,m){if(o=Gt(o),o&&(m||c===r))return o.slice(0,xy(o)+1);if(!o||!(c=Ki(c)))return o;var S=Ln(o),T=Ay(S,Ln(c))+1;return Io(S,0,T).join("")}function mW(o,c,m){if(o=Gt(o),o&&(m||c===r))return o.replace(et,"");if(!o||!(c=Ki(c)))return o;var S=Ln(o),T=_y(S,Ln(c));return Io(S,T).join("")}function bW(o,c){var m=re,S=k;if(hr(c)){var T="separator"in c?c.separator:T;m="length"in c?It(c.length):m,S="omission"in c?Ki(c.omission):S}o=Gt(o);var G=o.length;if(Dc(o)){var Q=Ln(o);G=Q.length}if(m>=G)return o;var te=m-Pc(S);if(te<1)return S;var oe=Q?Io(Q,0,te).join(""):o.slice(0,te);if(T===r)return oe+S;if(Q&&(te+=oe.length-te),Ig(T)){if(o.slice(te).search(T)){var le,de=oe;for(T.global||(T=qp(T.source,Gt(At.exec(T))+"g")),T.lastIndex=0;le=T.exec(de);)var we=le.index;oe=oe.slice(0,we===r?te:we)}}else if(o.indexOf(Ki(T),te)!=te){var ze=oe.lastIndexOf(T);ze>-1&&(oe=oe.slice(0,ze))}return oe+S}function yW(o){return o=Gt(o),o&&Oe.test(o)?o.replace(St,Gk):o}var wW=Lc(function(o,c,m){return o+(m?" ":"")+c.toUpperCase()}),Dg=lw("toUpperCase");function f4(o,c,m){return o=Gt(o),c=m?r:c,c===r?zk(o)?Qk(o):Rk(o):o.match(c)||[]}var h4=Dt(function(o,c){try{return Fr(o,r,c)}catch(m){return Sg(m)?m:new mt(m)}}),_W=zs(function(o,c){return fn(c,function(m){m=As(m),js(o,m,Eg(o[m],o))}),o});function AW(o){var c=o==null?0:o.length,m=ft();return o=c?ur(o,function(S){if(typeof S[1]!="function")throw new hn(a);return[m(S[0]),S[1]]}):[],Dt(function(S){for(var T=-1;++T<c;){var G=o[T];if(Fr(G[0],this,S))return Fr(G[1],this,S)}})}function EW(o){return Gj(dn(o,_))}function Pg(o){return function(){return o}}function xW(o,c){return o==null||o!==o?c:o}var SW=pw(),IW=pw(!0);function Ti(o){return o}function Og(o){return Hy(typeof o=="function"?o:dn(o,_))}function MW(o){return Wy(dn(o,_))}function CW(o,c){return Vy(o,dn(c,_))}var DW=Dt(function(o,c){return function(m){return cf(m,o,c)}}),PW=Dt(function(o,c){return function(m){return cf(o,m,c)}});function $g(o,c,m){var S=Lr(c),T=kl(c,S);m==null&&!(hr(c)&&(T.length||!S.length))&&(m=c,c=o,o=this,T=kl(c,Lr(c)));var G=!(hr(m)&&"chain"in m)||!!m.chain,Q=Ks(o);return fn(T,function(te){var oe=c[te];o[te]=oe,Q&&(o.prototype[te]=function(){var le=this.__chain__;if(G||le){var de=o(this.__wrapped__),we=de.__actions__=$i(this.__actions__);return we.push({func:oe,args:arguments,thisArg:o}),de.__chain__=le,de}return oe.apply(o,wo([this.value()],arguments))})}),o}function OW(){return Ut._===this&&(Ut._=ij),this}function Ng(){}function $W(o){return o=It(o),Dt(function(c){return Gy(c,o)})}var NW=fg(ur),RW=fg(gy),TW=fg(Tp);function l4(o){return mg(o)?Fp(As(o)):hq(o)}function FW(o){return function(c){return o==null?r:ya(o,c)}}var LW=vw(),BW=vw(!0);function Rg(){return[]}function Tg(){return!1}function UW(){return{}}function kW(){return""}function jW(){return!0}function qW(o,c){if(o=It(o),o<1||o>P)return[];var m=b,S=ni(o,b);c=ft(c),o-=b;for(var T=Up(S,c);++m<o;)c(m);return T}function zW(o){return wt(o)?ur(o,As):Wi(o)?[o]:$i($w(Gt(o)))}function HW(o){var c=++tj;return Gt(o)+c}var KW=Wl(function(o,c){return o+c},0),WW=hg("ceil"),VW=Wl(function(o,c){return o/c},1),GW=hg("floor");function YW(o){return o&&o.length?Ul(o,Ti,Jp):r}function JW(o,c){return o&&o.length?Ul(o,ft(c,2),Jp):r}function QW(o){return by(o,Ti)}function ZW(o,c){return by(o,ft(c,2))}function XW(o){return o&&o.length?Ul(o,Ti,eg):r}function eV(o,c){return o&&o.length?Ul(o,ft(c,2),eg):r}var tV=Wl(function(o,c){return o*c},1),rV=hg("round"),iV=Wl(function(o,c){return o-c},0);function nV(o){return o&&o.length?Bp(o,Ti):0}function sV(o,c){return o&&o.length?Bp(o,ft(c,2)):0}return H.after=MH,H.ary=zw,H.assign=pK,H.assignIn=i4,H.assignInWith=s0,H.assignWith=gK,H.at=vK,H.before=Hw,H.bind=Eg,H.bindAll=_W,H.bindKey=Kw,H.castArray=UH,H.chain=kw,H.chunk=Gq,H.compact=Yq,H.concat=Jq,H.cond=AW,H.conforms=EW,H.constant=Pg,H.countBy=nH,H.create=mK,H.curry=Ww,H.curryRight=Vw,H.debounce=Gw,H.defaults=bK,H.defaultsDeep=yK,H.defer=CH,H.delay=DH,H.difference=Qq,H.differenceBy=Zq,H.differenceWith=Xq,H.drop=ez,H.dropRight=tz,H.dropRightWhile=rz,H.dropWhile=iz,H.fill=nz,H.filter=oH,H.flatMap=uH,H.flatMapDeep=fH,H.flatMapDepth=hH,H.flatten=Fw,H.flattenDeep=sz,H.flattenDepth=oz,H.flip=PH,H.flow=SW,H.flowRight=IW,H.fromPairs=az,H.functions=IK,H.functionsIn=MK,H.groupBy=lH,H.initial=uz,H.intersection=fz,H.intersectionBy=hz,H.intersectionWith=lz,H.invert=DK,H.invertBy=PK,H.invokeMap=pH,H.iteratee=Og,H.keyBy=gH,H.keys=Lr,H.keysIn=Ri,H.map=Xl,H.mapKeys=$K,H.mapValues=NK,H.matches=MW,H.matchesProperty=CW,H.memoize=t0,H.merge=RK,H.mergeWith=n4,H.method=DW,H.methodOf=PW,H.mixin=$g,H.negate=r0,H.nthArg=$W,H.omit=TK,H.omitBy=FK,H.once=OH,H.orderBy=vH,H.over=NW,H.overArgs=$H,H.overEvery=RW,H.overSome=TW,H.partial=xg,H.partialRight=Yw,H.partition=mH,H.pick=LK,H.pickBy=s4,H.property=l4,H.propertyOf=FW,H.pull=vz,H.pullAll=Bw,H.pullAllBy=mz,H.pullAllWith=bz,H.pullAt=yz,H.range=LW,H.rangeRight=BW,H.rearg=NH,H.reject=wH,H.remove=wz,H.rest=RH,H.reverse=_g,H.sampleSize=AH,H.set=UK,H.setWith=kK,H.shuffle=EH,H.slice=_z,H.sortBy=IH,H.sortedUniq=Cz,H.sortedUniqBy=Dz,H.split=uW,H.spread=TH,H.tail=Pz,H.take=Oz,H.takeRight=$z,H.takeRightWhile=Nz,H.takeWhile=Rz,H.tap=Yz,H.throttle=FH,H.thru=Zl,H.toArray=e4,H.toPairs=o4,H.toPairsIn=a4,H.toPath=zW,H.toPlainObject=r4,H.transform=jK,H.unary=LH,H.union=Tz,H.unionBy=Fz,H.unionWith=Lz,H.uniq=Bz,H.uniqBy=Uz,H.uniqWith=kz,H.unset=qK,H.unzip=Ag,H.unzipWith=Uw,H.update=zK,H.updateWith=HK,H.values=kc,H.valuesIn=KK,H.without=jz,H.words=f4,H.wrap=BH,H.xor=qz,H.xorBy=zz,H.xorWith=Hz,H.zip=Kz,H.zipObject=Wz,H.zipObjectDeep=Vz,H.zipWith=Gz,H.entries=o4,H.entriesIn=a4,H.extend=i4,H.extendWith=s0,$g(H,H),H.add=KW,H.attempt=h4,H.camelCase=YK,H.capitalize=c4,H.ceil=WW,H.clamp=WK,H.clone=kH,H.cloneDeep=qH,H.cloneDeepWith=zH,H.cloneWith=jH,H.conformsTo=HH,H.deburr=u4,H.defaultTo=xW,H.divide=VW,H.endsWith=JK,H.eq=Un,H.escape=QK,H.escapeRegExp=ZK,H.every=sH,H.find=aH,H.findIndex=Rw,H.findKey=wK,H.findLast=cH,H.findLastIndex=Tw,H.findLastKey=_K,H.floor=GW,H.forEach=jw,H.forEachRight=qw,H.forIn=AK,H.forInRight=EK,H.forOwn=xK,H.forOwnRight=SK,H.get=Mg,H.gt=KH,H.gte=WH,H.has=CK,H.hasIn=Cg,H.head=Lw,H.identity=Ti,H.includes=dH,H.indexOf=cz,H.inRange=VK,H.invoke=OK,H.isArguments=Aa,H.isArray=wt,H.isArrayBuffer=VH,H.isArrayLike=Ni,H.isArrayLikeObject=_r,H.isBoolean=GH,H.isBuffer=Mo,H.isDate=YH,H.isElement=JH,H.isEmpty=QH,H.isEqual=ZH,H.isEqualWith=XH,H.isError=Sg,H.isFinite=eK,H.isFunction=Ks,H.isInteger=Jw,H.isLength=i0,H.isMap=Qw,H.isMatch=tK,H.isMatchWith=rK,H.isNaN=iK,H.isNative=nK,H.isNil=oK,H.isNull=sK,H.isNumber=Zw,H.isObject=hr,H.isObjectLike=vr,H.isPlainObject=pf,H.isRegExp=Ig,H.isSafeInteger=aK,H.isSet=Xw,H.isString=n0,H.isSymbol=Wi,H.isTypedArray=Uc,H.isUndefined=cK,H.isWeakMap=uK,H.isWeakSet=fK,H.join=dz,H.kebabCase=XK,H.last=gn,H.lastIndexOf=pz,H.lowerCase=eW,H.lowerFirst=tW,H.lt=hK,H.lte=lK,H.max=YW,H.maxBy=JW,H.mean=QW,H.meanBy=ZW,H.min=XW,H.minBy=eV,H.stubArray=Rg,H.stubFalse=Tg,H.stubObject=UW,H.stubString=kW,H.stubTrue=jW,H.multiply=tV,H.nth=gz,H.noConflict=OW,H.noop=Ng,H.now=e0,H.pad=rW,H.padEnd=iW,H.padStart=nW,H.parseInt=sW,H.random=GK,H.reduce=bH,H.reduceRight=yH,H.repeat=oW,H.replace=aW,H.result=BK,H.round=rV,H.runInContext=se,H.sample=_H,H.size=xH,H.snakeCase=cW,H.some=SH,H.sortedIndex=Az,H.sortedIndexBy=Ez,H.sortedIndexOf=xz,H.sortedLastIndex=Sz,H.sortedLastIndexBy=Iz,H.sortedLastIndexOf=Mz,H.startCase=fW,H.startsWith=hW,H.subtract=iV,H.sum=nV,H.sumBy=sV,H.template=lW,H.times=qW,H.toFinite=Ws,H.toInteger=It,H.toLength=t4,H.toLower=dW,H.toNumber=vn,H.toSafeInteger=dK,H.toString=Gt,H.toUpper=pW,H.trim=gW,H.trimEnd=vW,H.trimStart=mW,H.truncate=bW,H.unescape=yW,H.uniqueId=HW,H.upperCase=wW,H.upperFirst=Dg,H.each=jw,H.eachRight=qw,H.first=Lw,$g(H,function(){var o={};return ws(H,function(c,m){Jt.call(H.prototype,m)||(o[m]=c)}),o}(),{chain:!1}),H.VERSION=i,fn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){H[o].placeholder=H}),fn(["drop","take"],function(o,c){Lt.prototype[o]=function(m){m=m===r?1:Dr(It(m),0);var S=this.__filtered__&&!c?new Lt(this):this.clone();return S.__filtered__?S.__takeCount__=ni(m,S.__takeCount__):S.__views__.push({size:ni(m,b),type:o+(S.__dir__<0?"Right":"")}),S},Lt.prototype[o+"Right"]=function(m){return this.reverse()[o](m).reverse()}}),fn(["filter","map","takeWhile"],function(o,c){var m=c+1,S=m==h||m==E;Lt.prototype[o]=function(T){var G=this.clone();return G.__iteratees__.push({iteratee:ft(T,3),type:m}),G.__filtered__=G.__filtered__||S,G}}),fn(["head","last"],function(o,c){var m="take"+(c?"Right":"");Lt.prototype[o]=function(){return this[m](1).value()[0]}}),fn(["initial","tail"],function(o,c){var m="drop"+(c?"":"Right");Lt.prototype[o]=function(){return this.__filtered__?new Lt(this):this[m](1)}}),Lt.prototype.compact=function(){return this.filter(Ti)},Lt.prototype.find=function(o){return this.filter(o).head()},Lt.prototype.findLast=function(o){return this.reverse().find(o)},Lt.prototype.invokeMap=Dt(function(o,c){return typeof o=="function"?new Lt(this):this.map(function(m){return cf(m,o,c)})}),Lt.prototype.reject=function(o){return this.filter(r0(ft(o)))},Lt.prototype.slice=function(o,c){o=It(o);var m=this;return m.__filtered__&&(o>0||c<0)?new Lt(m):(o<0?m=m.takeRight(-o):o&&(m=m.drop(o)),c!==r&&(c=It(c),m=c<0?m.dropRight(-c):m.take(c-o)),m)},Lt.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Lt.prototype.toArray=function(){return this.take(b)},ws(Lt.prototype,function(o,c){var m=/^(?:filter|find|map|reject)|While$/.test(c),S=/^(?:head|last)$/.test(c),T=H[S?"take"+(c=="last"?"Right":""):c],G=S||/^find/.test(c);T&&(H.prototype[c]=function(){var Q=this.__wrapped__,te=S?[1]:arguments,oe=Q instanceof Lt,le=te[0],de=oe||wt(Q),we=function(Nt){var kt=T.apply(H,wo([Nt],te));return S&&ze?kt[0]:kt};de&&m&&typeof le=="function"&&le.length!=1&&(oe=de=!1);var ze=this.__chain__,at=!!this.__actions__.length,dt=G&&!ze,Mt=oe&&!at;if(!G&&de){Q=Mt?Q:new Lt(this);var pt=o.apply(Q,te);return pt.__actions__.push({func:Zl,args:[we],thisArg:r}),new ln(pt,ze)}return dt&&Mt?o.apply(this,te):(pt=this.thru(we),dt?S?pt.value()[0]:pt.value():pt)})}),fn(["pop","push","shift","sort","splice","unshift"],function(o){var c=xl[o],m=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",S=/^(?:pop|shift)$/.test(o);H.prototype[o]=function(){var T=arguments;if(S&&!this.__chain__){var G=this.value();return c.apply(wt(G)?G:[],T)}return this[m](function(Q){return c.apply(wt(Q)?Q:[],T)})}}),ws(Lt.prototype,function(o,c){var m=H[c];if(m){var S=m.name+"";Jt.call(Rc,S)||(Rc[S]=[]),Rc[S].push({name:c,func:m})}}),Rc[Kl(r,Y).name]=[{name:"wrapper",func:r}],Lt.prototype.clone=yj,Lt.prototype.reverse=wj,Lt.prototype.value=_j,H.prototype.at=Jz,H.prototype.chain=Qz,H.prototype.commit=Zz,H.prototype.next=Xz,H.prototype.plant=tH,H.prototype.reverse=rH,H.prototype.toJSON=H.prototype.valueOf=H.prototype.value=iH,H.prototype.first=H.prototype.head,ef&&(H.prototype[ef]=eH),H},Oc=Zk();wr?((wr.exports=Oc)._=Oc,tr._=Oc):Ut._=Oc}).call(Du)})(h1,h1.exports);var dT=Object.defineProperty,pT=Object.defineProperties,gT=Object.getOwnPropertyDescriptors,C6=Object.getOwnPropertySymbols,vT=Object.prototype.hasOwnProperty,mT=Object.prototype.propertyIsEnumerable,D6=(t,e,r)=>e in t?dT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sh=(t,e)=>{for(var r in e||(e={}))vT.call(e,r)&&D6(t,r,e[r]);if(C6)for(var r of C6(e))mT.call(e,r)&&D6(t,r,e[r]);return t},bT=(t,e)=>pT(t,gT(e));function Dn(t,e,r){var i;const n=Zc(t);return((i=e.rpcMap)==null?void 0:i[n.reference])||`${lT}?chainId=${n.namespace}:${n.reference}&projectId=${r}`}function Yo(t){return t.includes(":")?t.split(":")[1]:t}function P6(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function yT(t,e){const r=Object.keys(e.namespaces).filter(n=>n.includes(t));if(!r.length)return[];const i=[];return r.forEach(n=>{const s=e.namespaces[n].accounts;i.push(...s)}),i}function l1(t={},e={}){const r=O6(t),i=O6(e);return h1.exports.merge(r,i)}function O6(t){var e,r,i,n;const s={};if(!vu(t))return s;for(const[a,u]of Object.entries(t)){const d=Od(a)?[a]:u.chains,p=u.methods||[],y=u.events||[],_=u.rpcMap||{},C=gu(a);s[C]=bT(Sh(Sh({},s[C]),u),{chains:kf(d,(e=s[C])==null?void 0:e.chains),methods:kf(p,(r=s[C])==null?void 0:r.methods),events:kf(y,(i=s[C])==null?void 0:i.events),rpcMap:Sh(Sh({},_),(n=s[C])==null?void 0:n.rpcMap)})}return s}function wT(t){return t.includes(":")?t.split(":")[2]:t}function $6(t){const e={};for(const[r,i]of Object.entries(t)){const n=i.methods||[],s=i.events||[],a=i.accounts||[],u=Od(r)?[r]:i.chains?i.chains:P6(i.accounts);e[r]={chains:u,methods:n,events:s,accounts:a}}return e}function d1(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const N6={},Wt=t=>N6[t],p1=(t,e)=>{N6[t]=e};class _T{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Wt("events"),this.client=Wt("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(Cn.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 i;const n=Yo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[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 i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Dn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new In(new ds(i,Wt("disableProviderPing")))}}var AT=Object.defineProperty,ET=Object.defineProperties,xT=Object.getOwnPropertyDescriptors,R6=Object.getOwnPropertySymbols,ST=Object.prototype.hasOwnProperty,IT=Object.prototype.propertyIsEnumerable,T6=(t,e,r)=>e in t?AT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,F6=(t,e)=>{for(var r in e||(e={}))ST.call(e,r)&&T6(t,r,e[r]);if(R6)for(var r of R6(e))IT.call(e,r)&&T6(t,r,e[r]);return t},L6=(t,e)=>ET(t,xT(e));class MT{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Wt("events"),this.client=Wt("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());case"wallet_getCapabilities":return await this.getCapabilities(e)}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(Cn.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 i=r||Dn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new In(new ds(i,Wt("disableProviderPing")))}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;const n=parseInt(Yo(r));e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[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,i;let n=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";n=n.startsWith("0x")?n:`0x${n}`;const s=parseInt(n,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:n}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. 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}`)}async getCapabilities(e){var r,i,n;const s=(i=(r=e.request)==null?void 0:r.params)==null?void 0:i[0];if(!s)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const a=this.client.session.get(e.topic),u=((n=a?.sessionProperties)==null?void 0:n.capabilities)||{};if(u!=null&&u[s])return u?.[s];const d=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:L6(F6({},a.sessionProperties||{}),{capabilities:L6(F6({},u||{}),{[s]:d})})})}catch(p){console.warn("Failed to update session with capabilities",p)}return d}}class CT{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Wt("events"),this.client=Wt("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(Cn.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 i;const n=Yo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[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 i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Dn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new In(new ds(i,Wt("disableProviderPing")))}}class DT{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Wt("events"),this.client=Wt("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(Cn.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 i;const n=Yo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[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 i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Dn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new In(new ds(i,Wt("disableProviderPing")))}}class PT{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Wt("events"),this.client=Wt("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){if(!this.httpProviders[e]){const i=r||Dn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.chainId=e,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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 i;e[r]=this.createHttpProvider(r,(i=this.namespace.rpcMap)==null?void 0:i[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 i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Dn(e,this.namespace,this.client.core.projectId);return typeof i>"u"?void 0:new In(new ds(i,Wt("disableProviderPing")))}}class OT{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Wt("events"),this.client=Wt("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(Cn.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 i=this.getCardanoRPCUrl(r),n=Yo(r);e[n]=this.createHttpProvider(n,i)}),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 i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||this.getCardanoRPCUrl(e);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new In(new ds(i,Wt("disableProviderPing")))}}class $T{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Wt("events"),this.client=Wt("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(Cn.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 i;const n=Yo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[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 i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Dn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new In(new ds(i,Wt("disableProviderPing")))}}class NT{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Wt("events"),this.client=Wt("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(Cn.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 i;const n=Yo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[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 i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Dn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new In(new ds(i,Wt("disableProviderPing")))}}class RT{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Wt("events"),this.client=Wt("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 i=r||Dn(`${this.name}:${e}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.events.emit(Cn.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 i;e[r]=this.createHttpProvider(r,(i=this.namespace.rpcMap)==null?void 0:i[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 i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Dn(e,this.namespace);return typeof i>"u"?void 0:new In(new ds(i,Wt("disableProviderPing")))}}class TT{constructor(e){this.name=sc,this.namespace=e.namespace,this.events=Wt("events"),this.client=Wt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Cn.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(){var e,r;const i={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(n=>{const s=Zc(n);i[`${s.namespace}:${s.reference}`]=this.createHttpProvider(n)}),i}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Dn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new In(new ds(i,Wt("disableProviderPing")))}}var FT=Object.defineProperty,LT=Object.defineProperties,BT=Object.getOwnPropertyDescriptors,B6=Object.getOwnPropertySymbols,UT=Object.prototype.hasOwnProperty,kT=Object.prototype.propertyIsEnumerable,U6=(t,e,r)=>e in t?FT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ih=(t,e)=>{for(var r in e||(e={}))UT.call(e,r)&&U6(t,r,e[r]);if(B6)for(var r of B6(e))kT.call(e,r)&&U6(t,r,e[r]);return t},g1=(t,e)=>LT(t,BT(e));class v1{constructor(e){this.events=new Br.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:cs(mh({level:e?.logger||I6})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const r=new v1(e);return await r.initialize(),r}async request(e,r,i){const[n,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:Ih({},e),chainId:`${n}:${s}`,topic:this.session.topic,expiry:i})}sendAsync(e,r,i,n){const s=new Date().getTime();this.request(e,i,n).then(a=>r(null,yh(s,a))).catch(a=>r(a,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)}async authenticate(e){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:r,response:i}=await this.client.authenticate(e);r&&(this.uri=r,this.events.emit("display_uri",r));const n=await i();if(this.session=n.session,this.session){const s=$6(this.session.namespaces);this.namespaces=l1(this.namespaces,s),this.persist("namespaces",this.namespaces),this.onConnect()}return n}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:i,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await n().then(s=>{this.session=s;const a=$6(s.namespaces);this.namespaces=l1(this.namespaces,a),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==v6)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[i,n]=this.validateChain(e),s=this.getProvider(i);s.name===sc?s.setDefaultChain(`${i}:${n}`,r):s.setDefaultChain(n,r)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(as(r)){for(const i of r)e.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${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 u1.init({logger:this.providerOpts.logger||I6,relayUrl:this.providerOpts.relayUrl||uT,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=>gu(r)))];p1("client",this.client),p1("events",this.events),p1("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const i=yT(r,this.session),n=P6(i),s=l1(this.namespaces,this.optionalNamespaces),a=g1(Ih({},s[r]),{accounts:i,chains:n});switch(r){case"eip155":this.rpcProviders[r]=new MT({namespace:a});break;case"algorand":this.rpcProviders[r]=new PT({namespace:a});break;case"solana":this.rpcProviders[r]=new CT({namespace:a});break;case"cosmos":this.rpcProviders[r]=new DT({namespace:a});break;case"polkadot":this.rpcProviders[r]=new _T({namespace:a});break;case"cip34":this.rpcProviders[r]=new OT({namespace:a});break;case"elrond":this.rpcProviders[r]=new $T({namespace:a});break;case"multiversx":this.rpcProviders[r]=new NT({namespace:a});break;case"near":this.rpcProviders[r]=new RT({namespace:a});break;default:this.rpcProviders[sc]?this.rpcProviders[sc].updateNamespace(a):this.rpcProviders[sc]=new TT({namespace:a})}})}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:i}=r;if(i.name==="accountsChanged"){const n=i.data;n&&as(n)&&this.events.emit("accountsChanged",n.map(wT))}else if(i.name==="chainChanged"){const n=r.chainId,s=r.event.data,a=gu(n),u=d1(n)!==d1(s)?`${a}:${d1(s)}`:n;this.onChainChanged(u)}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var i;const{namespaces:n}=r,s=(i=this.client)==null?void 0:i.session.get(e);this.session=g1(Ih({},s),{namespaces:n}),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",g1(Ih({},Yt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Cn.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[sc]}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:i,sessionProperties:n}=e;r&&Object.keys(r).length&&(this.namespaces=r),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=n,this.persist("namespaces",r),this.persist("optionalNamespaces",i)}validateChain(e){const[r,i]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,i];if(r&&!Object.keys(this.namespaces||{}).map(a=>gu(a)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&i)return[r,i];const n=gu(Object.keys(this.namespaces)[0]),s=this.rpcProviders[n].getDefaultChain();return[n,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[i,n]=this.validateChain(e);n&&(r||this.getProvider(i).setDefaultChain(n),this.namespaces[i]?this.namespaces[i].defaultChain=n:this.namespaces[`${i}:${n}`]?this.namespaces[`${i}:${n}`].defaultChain=n:this.namespaces[`${i}:${n}`]={defaultChain:n},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",n))}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(`${M6}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${M6}/${e}`)}}const jT=v1,qT="wc",zT="ethereum_provider",HT=`${qT}@2:${zT}:`,KT="https://rpc.walletconnect.com/v1/",Mh=["eth_sendTransaction","personal_sign"],k6=["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","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],Ch=["chainChanged","accountsChanged"],j6=["chainChanged","accountsChanged","message","disconnect","connect"];var WT=Object.defineProperty,VT=Object.defineProperties,GT=Object.getOwnPropertyDescriptors,q6=Object.getOwnPropertySymbols,YT=Object.prototype.hasOwnProperty,JT=Object.prototype.propertyIsEnumerable,z6=(t,e,r)=>e in t?WT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,oc=(t,e)=>{for(var r in e||(e={}))YT.call(e,r)&&z6(t,r,e[r]);if(q6)for(var r of q6(e))JT.call(e,r)&&z6(t,r,e[r]);return t},m1=(t,e)=>VT(t,GT(e));function Dh(t){return Number(t[0].split(":")[1])}function Ph(t){return`0x${t.toString(16)}`}function QT(t){const{chains:e,optionalChains:r,methods:i,optionalMethods:n,events:s,optionalEvents:a,rpcMap:u}=t;if(!as(e))throw new Error("Invalid chains");const d={chains:e,methods:i||Mh,events:s||Ch,rpcMap:oc({},e.length?{[Dh(e)]:u[Dh(e)]}:{})},p=s?.filter(I=>!Ch.includes(I)),y=i?.filter(I=>!Mh.includes(I));if(!r&&!a&&!n&&!(p!=null&&p.length)&&!(y!=null&&y.length))return{required:e.length?d:void 0};const _=p?.length&&y?.length||!r,C={chains:[...new Set(_?d.chains.concat(r||[]):r)],methods:[...new Set(d.methods.concat(n!=null&&n.length?n:k6))],events:[...new Set(d.events.concat(a!=null&&a.length?a:j6))],rpcMap:u};return{required:e.length?d:void 0,optional:r.length?C:void 0}}class Oh{constructor(){this.events=new Br.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=HT,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 Oh;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,i){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),i)}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:i}=QT(this.rpc);try{const n=await new Promise(async(a,u)=>{var d;this.rpc.showQrModal&&((d=this.modal)==null||d.subscribeModal(p=>{!p.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),u(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(m1(oc({namespaces:oc({},r&&{[this.namespace]:r})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e?.pairingTopic})).then(p=>{a(p)}).catch(p=>{u(new Error(p.message))})});if(!n)return;const s=Ov(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:Ph(this.chainId)})}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async authenticate(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e?.chains});try{const r=await new Promise(async(n,s)=>{var a;this.rpc.showQrModal&&((a=this.modal)==null||a.subscribeModal(u=>{!u.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),s(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(m1(oc({},e),{chains:this.rpc.chains})).then(u=>{n(u)}).catch(u=>{s(new Error(u.message))})}),i=r.session;if(i){const n=Ov(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:n),this.setAccounts(n),this.events.emit("connect",{chainId:Ph(this.chainId)})}return r}catch(r){throw this.signer.logger.error(r),r}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:i}=r;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",Ph(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",m1(oc({},Yt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,i;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(i=this.modal)==null||i.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",Ph(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,i,n]=e.split(":");return{chainId:`${r}:${i}`,address:n}}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,i;const n=(r=e?.chains)!=null?r:[],s=(i=e?.optionalChains)!=null?i:[],a=n.concat(s);if(!a.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const u=n.length?e?.methods||Mh:[],d=n.length?e?.events||Ch:[],p=e?.optionalMethods||[],y=e?.optionalEvents||[],_=e?.rpcMap||this.buildRpcMap(a,e.projectId),C=e?.qrModalOptions||void 0;return{chains:n?.map(I=>this.formatChainId(I)),optionalChains:s.map(I=>this.formatChainId(I)),methods:u,events:d,optionalMethods:p,optionalEvents:y,rpcMap:_,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:C,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const i={};return e.forEach(n=>{i[n]=this.getRpcUrl(n,r)}),i}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Dh(this.rpc.chains):Dh(this.rpc.optionalChains),this.signer=await jT.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:i}=await Promise.resolve().then(function(){return wF});r=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(oc({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:i,rpcMap:n}=e;r&&as(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=n?.[s]||this.getRpcUrl(s)})),i&&as(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i?.map(s=>this.formatChainId(s)),i.forEach(s=>{this.rpc.rpcMap[s]=n?.[s]||this.getRpcUrl(s)}))}getRpcUrl(e,r){var i;return((i=this.rpc.rpcMap)==null?void 0:i[e])||`${KT}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{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)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}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 ZT=Oh,XT=Symbol(),H6=Object.getPrototypeOf,b1=new WeakMap,eF=t=>t&&(b1.has(t)?b1.get(t):H6(t)===Object.prototype||H6(t)===Array.prototype),tF=t=>eF(t)&&t[XT]||null,K6=(t,e=!0)=>{b1.set(t,e)},y1=t=>typeof t=="object"&&t!==null,so=new WeakMap,$h=new WeakSet,rF=(t=Object.is,e=(p,y)=>new Proxy(p,y),r=p=>y1(p)&&!$h.has(p)&&(Array.isArray(p)||!(Symbol.iterator in p))&&!(p instanceof WeakMap)&&!(p instanceof WeakSet)&&!(p instanceof Error)&&!(p instanceof Number)&&!(p instanceof Date)&&!(p instanceof String)&&!(p instanceof RegExp)&&!(p instanceof ArrayBuffer),i=p=>{switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:throw p}},n=new WeakMap,s=(p,y,_=i)=>{const C=n.get(p);if(C?.[0]===y)return C[1];const I=Array.isArray(p)?[]:Object.create(Object.getPrototypeOf(p));return K6(I,!0),n.set(p,[y,I]),Reflect.ownKeys(p).forEach(M=>{if(Object.getOwnPropertyDescriptor(I,M))return;const B=Reflect.get(p,M),W={value:B,enumerable:!0,configurable:!0};if($h.has(B))K6(B,!1);else if(B instanceof Promise)delete W.value,W.get=()=>_(B);else if(so.has(B)){const[Y,q]=so.get(B);W.value=s(Y,q(),_)}Object.defineProperty(I,M,W)}),Object.preventExtensions(I)},a=new WeakMap,u=[1,1],d=p=>{if(!y1(p))throw new Error("object required");const y=a.get(p);if(y)return y;let _=u[0];const C=new Set,I=(ee,re=++u[0])=>{_!==re&&(_=re,C.forEach(k=>k(ee,re)))};let M=u[1];const B=(ee=++u[1])=>(M!==ee&&!C.size&&(M=ee,Y.forEach(([re])=>{const k=re[1](ee);k>_&&(_=k)})),_),W=ee=>(re,k)=>{const w=[...re];w[1]=[ee,...w[1]],I(w,k)},Y=new Map,q=(ee,re)=>{if(Y.has(ee))throw new Error("prop listener already exists");if(C.size){const k=re[3](W(ee));Y.set(ee,[re,k])}else Y.set(ee,[re])},V=ee=>{var re;const k=Y.get(ee);k&&(Y.delete(ee),(re=k[1])==null||re.call(k))},U=ee=>(C.add(ee),C.size===1&&Y.forEach(([k,w],f)=>{if(w)throw new Error("remove already exists");const h=k[3](W(f));Y.set(f,[k,h])}),()=>{C.delete(ee),C.size===0&&Y.forEach(([k,w],f)=>{w&&(w(),Y.set(f,[k]))})}),z=Array.isArray(p)?[]:Object.create(Object.getPrototypeOf(p)),A=e(z,{deleteProperty(ee,re){const k=Reflect.get(ee,re);V(re);const w=Reflect.deleteProperty(ee,re);return w&&I(["delete",[re],k]),w},set(ee,re,k,w){const f=Reflect.has(ee,re),h=Reflect.get(ee,re,w);if(f&&(t(h,k)||a.has(k)&&t(h,a.get(k))))return!0;V(re),y1(k)&&(k=tF(k)||k);let g=k;if(k instanceof Promise)k.then(E=>{k.status="fulfilled",k.value=E,I(["resolve",[re],E])}).catch(E=>{k.status="rejected",k.reason=E,I(["reject",[re],E])});else{!so.has(k)&&r(k)&&(g=d(k));const E=!$h.has(g)&&so.get(g);E&&q(re,E)}return Reflect.set(ee,re,g,w),I(["set",[re],k,h]),!0}});a.set(p,A);const j=[z,B,s,U];return so.set(A,j),Reflect.ownKeys(p).forEach(ee=>{const re=Object.getOwnPropertyDescriptor(p,ee);"value"in re&&(A[ee]=p[ee],delete re.value,delete re.writable),Object.defineProperty(z,ee,re)}),A})=>[d,so,$h,t,e,r,i,n,s,a,u],[iF]=rF();function oo(t={}){return iF(t)}function Jo(t,e,r){const i=so.get(t);i||console.warn("Please use proxy object");let n;const s=[],a=i[3];let u=!1;const p=a(y=>{if(s.push(y),r){e(s.splice(0));return}n||(n=Promise.resolve().then(()=>{n=void 0,u&&e(s.splice(0))}))});return u=!0,()=>{u=!1,p()}}function nF(t,e){const r=so.get(t);r||console.warn("Please use proxy object");const[i,n,s]=r;return s(i,n(),e)}const Tr=oo({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),fr={state:Tr,subscribe(t){return Jo(Tr,()=>t(Tr))},push(t,e){t!==Tr.view&&(Tr.view=t,e&&(Tr.data=e),Tr.history.push(t))},reset(t){Tr.view=t,Tr.history=[t]},replace(t){Tr.history.length>1&&(Tr.history[Tr.history.length-1]=t,Tr.view=t)},goBack(){if(Tr.history.length>1){Tr.history.pop();const[t]=Tr.history.slice(-1);Tr.view=t}},setData(t){Tr.data=t}},ct={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",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 ct.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return ct.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(ct.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let i=t;i.includes("://")||(i=t.replaceAll("/","").replaceAll(":",""),i=`${i}://`),i.endsWith("/")||(i=`${i}/`),this.setWalletConnectDeepLink(i,r);const n=encodeURIComponent(e);return`${i}wc?uri=${n}`},formatUniversalUrl(t,e,r){if(!ct.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let i=t;i.endsWith("/")||(i=`${i}/`),this.setWalletConnectDeepLink(i,r);const n=encodeURIComponent(e);return`${i}wc?uri=${n}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){try{localStorage.setItem(ct.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(t){try{const[e]=t.split("?");localStorage.setItem(ct.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(ct.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(ct.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var t;const e=(t=fr.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},sF=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Zr=oo({enabled:sF,userSessionId:"",events:[],connectedWalletId:void 0}),W6={state:Zr,subscribe(t){return Jo(Zr.events,()=>t(nF(Zr.events[Zr.events.length-1])))},initialize(){Zr.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(Zr.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Zr.connectedWalletId=t},click(t){if(Zr.enabled){const e={type:"CLICK",name:t.name,userSessionId:Zr.userSessionId,timestamp:Date.now(),data:t};Zr.events.push(e)}},track(t){if(Zr.enabled){const e={type:"TRACK",name:t.name,userSessionId:Zr.userSessionId,timestamp:Date.now(),data:t};Zr.events.push(e)}},view(t){if(Zr.enabled){const e={type:"VIEW",name:t.name,userSessionId:Zr.userSessionId,timestamp:Date.now(),data:t};Zr.events.push(e)}}},ps=oo({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),yr={state:ps,subscribe(t){return Jo(ps,()=>t(ps))},setChains(t){ps.chains=t},setWalletConnectUri(t){ps.walletConnectUri=t},setIsCustomDesktop(t){ps.isCustomDesktop=t},setIsCustomMobile(t){ps.isCustomMobile=t},setIsDataLoaded(t){ps.isDataLoaded=t},setIsUiLoaded(t){ps.isUiLoaded=t},setIsAuth(t){ps.isAuth=t}},Nh=oo({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),ji={state:Nh,subscribe(t){return Jo(Nh,()=>t(Nh))},setConfig(t){var e,r;W6.initialize(),yr.setChains(t.chains),yr.setIsAuth(!!t.enableAuthMode),yr.setIsCustomMobile(!!((e=t.mobileWallets)!=null&&e.length)),yr.setIsCustomDesktop(!!((r=t.desktopWallets)!=null&&r.length)),ct.setModalVersionInStorage(),Object.assign(Nh,t)}};var oF=Object.defineProperty,V6=Object.getOwnPropertySymbols,aF=Object.prototype.hasOwnProperty,cF=Object.prototype.propertyIsEnumerable,G6=(t,e,r)=>e in t?oF(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,uF=(t,e)=>{for(var r in e||(e={}))aF.call(e,r)&&G6(t,r,e[r]);if(V6)for(var r of V6(e))cF.call(e,r)&&G6(t,r,e[r]);return t};const w1="https://explorer-api.walletconnect.com",_1="wcm",A1="js-2.6.2";async function Rh(t,e){const r=uF({sdkType:_1,sdkVersion:A1},e),i=new URL(t,w1);return i.searchParams.append("projectId",ji.state.projectId),Object.entries(r).forEach(([n,s])=>{s&&i.searchParams.append(n,String(s))}),(await fetch(i)).json()}const Qo={async getDesktopListings(t){return Rh("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return Rh("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return Rh("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return Rh("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${w1}/w3m/v1/getWalletImage/${t}?projectId=${ji.state.projectId}&sdkType=${_1}&sdkVersion=${A1}`},getAssetImageUrl(t){return`${w1}/w3m/v1/getAssetImage/${t}?projectId=${ji.state.projectId}&sdkType=${_1}&sdkVersion=${A1}`}};var fF=Object.defineProperty,Y6=Object.getOwnPropertySymbols,hF=Object.prototype.hasOwnProperty,lF=Object.prototype.propertyIsEnumerable,J6=(t,e,r)=>e in t?fF(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,dF=(t,e)=>{for(var r in e||(e={}))hF.call(e,r)&&J6(t,r,e[r]);if(Y6)for(var r of Y6(e))lF.call(e,r)&&J6(t,r,e[r]);return t};const Q6=ct.isMobile(),gs=oo({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ii={state:gs,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=ji.state;if(t==="NONE"||e==="ALL"&&!t)return gs.recomendedWallets;if(ct.isArray(t)){const r={recommendedIds:t.join(",")},{listings:i}=await Qo.getAllListings(r),n=Object.values(i);n.sort((s,a)=>{const u=t.indexOf(s.id),d=t.indexOf(a.id);return u-d}),gs.recomendedWallets=n}else{const{chains:r,isAuth:i}=yr.state,n=r?.join(","),s=ct.isArray(e),a={page:1,sdks:i?"auth_v1":void 0,entries:ct.RECOMMENDED_WALLET_AMOUNT,chains:n,version:2,excludedIds:s?e.join(","):void 0},{listings:u}=Q6?await Qo.getMobileListings(a):await Qo.getDesktopListings(a);gs.recomendedWallets=Object.values(u)}return gs.recomendedWallets},async getWallets(t){const e=dF({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:i}=ji.state,{recomendedWallets:n}=gs;if(i==="ALL")return gs.wallets;n.length?e.excludedIds=n.map(_=>_.id).join(","):ct.isArray(r)&&(e.excludedIds=r.join(",")),ct.isArray(i)&&(e.excludedIds=[e.excludedIds,i].filter(Boolean).join(",")),yr.state.isAuth&&(e.sdks="auth_v1");const{page:s,search:a}=t,{listings:u,total:d}=Q6?await Qo.getMobileListings(e):await Qo.getDesktopListings(e),p=Object.values(u),y=a?"search":"wallets";return gs[y]={listings:[...gs[y].listings,...p],total:d,page:s??1},{listings:p,total:d}},getWalletImageUrl(t){return Qo.getWalletImageUrl(t)},getAssetImageUrl(t){return Qo.getAssetImageUrl(t)},resetSearch(){gs.search={listings:[],total:0,page:1}}},ac=oo({open:!1}),Zo={state:ac,subscribe(t){return Jo(ac,()=>t(ac))},async open(t){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:i}=yr.state;if(ct.removeWalletConnectDeepLink(),yr.setWalletConnectUri(t?.uri),yr.setChains(t?.chains),fr.reset("ConnectWallet"),r&&i)ac.open=!0,e();else{const n=setInterval(()=>{const s=yr.state;s.isUiLoaded&&s.isDataLoaded&&(clearInterval(n),ac.open=!0,e())},200)}})},close(){ac.open=!1}};var pF=Object.defineProperty,Z6=Object.getOwnPropertySymbols,gF=Object.prototype.hasOwnProperty,vF=Object.prototype.propertyIsEnumerable,X6=(t,e,r)=>e in t?pF(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mF=(t,e)=>{for(var r in e||(e={}))gF.call(e,r)&&X6(t,r,e[r]);if(Z6)for(var r of Z6(e))vF.call(e,r)&&X6(t,r,e[r]);return t};function bF(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const Pu=oo({themeMode:bF()?"dark":"light"}),ao={state:Pu,subscribe(t){return Jo(Pu,()=>t(Pu))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(Pu.themeMode=e),r&&(Pu.themeVariables=mF({},r))}},Xo=oo({open:!1,message:"",variant:"success"}),co={state:Xo,subscribe(t){return Jo(Xo,()=>t(Xo))},openToast(t,e){Xo.open=!0,Xo.message=t,Xo.variant=e},closeToast(){Xo.open=!1}};class yF{constructor(e){this.openModal=Zo.open,this.closeModal=Zo.close,this.subscribeModal=Zo.subscribe,this.setTheme=ao.setThemeConfig,ao.setThemeConfig(e),ji.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return Ck});const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),yr.setIsUiLoaded(!0)}}}var wF=Object.freeze({__proto__:null,WalletConnectModal:yF});/**
|
|
70
70
|
* @license
|
|
71
71
|
* Copyright 2019 Google LLC
|
|
72
72
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
73
|
-
*/const
|
|
73
|
+
*/const Th=window,E1=Th.ShadowRoot&&(Th.ShadyCSS===void 0||Th.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,x1=Symbol(),e5=new WeakMap;class t5{constructor(e,r,i){if(this._$cssResult$=!0,i!==x1)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(E1&&e===void 0){const i=r!==void 0&&r.length===1;i&&(e=e5.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&e5.set(r,e))}return e}toString(){return this.cssText}}const _F=t=>new t5(typeof t=="string"?t:t+"",void 0,x1),Ht=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new t5(r,t,x1)},AF=(t,e)=>{E1?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const i=document.createElement("style"),n=Th.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)})},r5=E1?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const i of e.cssRules)r+=i.cssText;return _F(r)})(t):t;/**
|
|
74
74
|
* @license
|
|
75
75
|
* Copyright 2017 Google LLC
|
|
76
76
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
77
|
-
*/var
|
|
77
|
+
*/var S1;const Fh=window,i5=Fh.trustedTypes,EF=i5?i5.emptyScript:"",n5=Fh.reactiveElementPolyfillSupport,I1={toAttribute(t,e){switch(e){case Boolean:t=t?EF: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}},s5=(t,e)=>e!==t&&(e==e||t==t),M1={attribute:!0,type:String,converter:I1,reflect:!1,hasChanged:s5},C1="finalized";class cc extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}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,i)=>{const n=this._$Ep(i,r);n!==void 0&&(this._$Ev.set(n,i),e.push(n))}),e}static createProperty(e,r=M1){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(n){const s=this[e];this[r]=n,this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||M1}static finalize(){if(this.hasOwnProperty(C1))return!1;this[C1]=!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,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const n of i)this.createProperty(n,r[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)r.unshift(r5(n))}else e!==void 0&&r.push(r5(e));return r}static _$Ep(e,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){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,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.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 AF(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 i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=M1){var n;const s=this.constructor._$Ep(e,i);if(s!==void 0&&i.reflect===!0){const a=(((n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?i.converter:I1).toAttribute(r,i.type);this._$El=e,a==null?this.removeAttribute(s):this.setAttribute(s,a),this._$El=null}}_$AK(e,r){var i;const n=this.constructor,s=n._$Ev.get(e);if(s!==void 0&&this._$El!==s){const a=n.getPropertyOptions(s),u=typeof a.converter=="function"?{fromAttribute:a.converter}:((i=a.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?a.converter:I1;this._$El=s,this[s]=u.fromAttribute(r,a.type),this._$El=null}}requestUpdate(e,r,i){let n=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||s5)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(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((n,s)=>this[s]=n),this._$Ei=void 0);let r=!1;const i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var s;return(s=n.hostUpdate)===null||s===void 0?void 0:s.call(n)}),this.update(i)):this._$Ek()}catch(n){throw r=!1,this._$Ek(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var n;return(n=i.hostUpdated)===null||n===void 0?void 0:n.call(i)}),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,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}cc[C1]=!0,cc.elementProperties=new Map,cc.elementStyles=[],cc.shadowRootOptions={mode:"open"},n5?.({ReactiveElement:cc}),((S1=Fh.reactiveElementVersions)!==null&&S1!==void 0?S1:Fh.reactiveElementVersions=[]).push("1.6.3");/**
|
|
78
78
|
* @license
|
|
79
79
|
* Copyright 2017 Google LLC
|
|
80
80
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
81
|
-
*/var
|
|
82
|
-
\f\r]`,
|
|
83
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
81
|
+
*/var D1;const Lh=window,uc=Lh.trustedTypes,o5=uc?uc.createPolicy("lit-html",{createHTML:t=>t}):void 0,P1="$lit$",uo=`lit$${(Math.random()+"").slice(9)}$`,a5="?"+uo,xF=`<${a5}>`,ea=document,Ou=()=>ea.createComment(""),$u=t=>t===null||typeof t!="object"&&typeof t!="function",c5=Array.isArray,SF=t=>c5(t)||typeof t?.[Symbol.iterator]=="function",O1=`[
|
|
82
|
+
\f\r]`,Nu=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,u5=/-->/g,f5=/>/g,ta=RegExp(`>|${O1}(?:([^\\s"'>=/]+)(${O1}*=${O1}*(?:[^
|
|
83
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),h5=/'/g,l5=/"/g,d5=/^(?:script|style|textarea|title)$/i,p5=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),je=p5(1),pr=p5(2),ra=Symbol.for("lit-noChange"),Ir=Symbol.for("lit-nothing"),g5=new WeakMap,ia=ea.createTreeWalker(ea,129,null,!1);function v5(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return o5!==void 0?o5.createHTML(e):e}const IF=(t,e)=>{const r=t.length-1,i=[];let n,s=e===2?"<svg>":"",a=Nu;for(let u=0;u<r;u++){const d=t[u];let p,y,_=-1,C=0;for(;C<d.length&&(a.lastIndex=C,y=a.exec(d),y!==null);)C=a.lastIndex,a===Nu?y[1]==="!--"?a=u5:y[1]!==void 0?a=f5:y[2]!==void 0?(d5.test(y[2])&&(n=RegExp("</"+y[2],"g")),a=ta):y[3]!==void 0&&(a=ta):a===ta?y[0]===">"?(a=n??Nu,_=-1):y[1]===void 0?_=-2:(_=a.lastIndex-y[2].length,p=y[1],a=y[3]===void 0?ta:y[3]==='"'?l5:h5):a===l5||a===h5?a=ta:a===u5||a===f5?a=Nu:(a=ta,n=void 0);const I=a===ta&&t[u+1].startsWith("/>")?" ":"";s+=a===Nu?d+xF:_>=0?(i.push(p),d.slice(0,_)+P1+d.slice(_)+uo+I):d+uo+(_===-2?(i.push(void 0),u):I)}return[v5(t,s+(t[r]||"<?>")+(e===2?"</svg>":"")),i]};class Ru{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,a=0;const u=e.length-1,d=this.parts,[p,y]=IF(e,r);if(this.el=Ru.createElement(p,i),ia.currentNode=this.el.content,r===2){const _=this.el.content,C=_.firstChild;C.remove(),_.append(...C.childNodes)}for(;(n=ia.nextNode())!==null&&d.length<u;){if(n.nodeType===1){if(n.hasAttributes()){const _=[];for(const C of n.getAttributeNames())if(C.endsWith(P1)||C.startsWith(uo)){const I=y[a++];if(_.push(C),I!==void 0){const M=n.getAttribute(I.toLowerCase()+P1).split(uo),B=/([.?@])?(.*)/.exec(I);d.push({type:1,index:s,name:B[2],strings:M,ctor:B[1]==="."?CF:B[1]==="?"?PF:B[1]==="@"?OF:Bh})}else d.push({type:6,index:s})}for(const C of _)n.removeAttribute(C)}if(d5.test(n.tagName)){const _=n.textContent.split(uo),C=_.length-1;if(C>0){n.textContent=uc?uc.emptyScript:"";for(let I=0;I<C;I++)n.append(_[I],Ou()),ia.nextNode(),d.push({type:2,index:++s});n.append(_[C],Ou())}}}else if(n.nodeType===8)if(n.data===a5)d.push({type:2,index:s});else{let _=-1;for(;(_=n.data.indexOf(uo,_+1))!==-1;)d.push({type:7,index:s}),_+=uo.length-1}s++}}static createElement(e,r){const i=ea.createElement("template");return i.innerHTML=e,i}}function fc(t,e,r=t,i){var n,s,a,u;if(e===ra)return e;let d=i!==void 0?(n=r._$Co)===null||n===void 0?void 0:n[i]:r._$Cl;const p=$u(e)?void 0:e._$litDirective$;return d?.constructor!==p&&((s=d?._$AO)===null||s===void 0||s.call(d,!1),p===void 0?d=void 0:(d=new p(t),d._$AT(t,r,i)),i!==void 0?((a=(u=r)._$Co)!==null&&a!==void 0?a:u._$Co=[])[i]=d:r._$Cl=d),d!==void 0&&(e=fc(t,d._$AS(t,e.values),d,i)),e}class MF{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:i},parts:n}=this._$AD,s=((r=e?.creationScope)!==null&&r!==void 0?r:ea).importNode(i,!0);ia.currentNode=s;let a=ia.nextNode(),u=0,d=0,p=n[0];for(;p!==void 0;){if(u===p.index){let y;p.type===2?y=new Tu(a,a.nextSibling,this,e):p.type===1?y=new p.ctor(a,p.name,p.strings,this,e):p.type===6&&(y=new $F(a,this,e)),this._$AV.push(y),p=n[++d]}u!==p?.index&&(a=ia.nextNode(),u++)}return ia.currentNode=ea,s}v(e){let r=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}}class Tu{constructor(e,r,i,n){var s;this.type=2,this._$AH=Ir,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=n,this._$Cp=(s=n?.isConnected)===null||s===void 0||s}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=fc(this,e,r),$u(e)?e===Ir||e==null||e===""?(this._$AH!==Ir&&this._$AR(),this._$AH=Ir):e!==this._$AH&&e!==ra&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):SF(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!==Ir&&$u(this._$AH)?this._$AA.nextSibling.data=e:this.$(ea.createTextNode(e)),this._$AH=e}g(e){var r;const{values:i,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Ru.createElement(v5(n.h,n.h[0]),this.options)),n);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===s)this._$AH.v(i);else{const a=new MF(s,this),u=a.u(this.options);a.v(i),this.$(u),this._$AH=a}}_$AC(e){let r=g5.get(e.strings);return r===void 0&&g5.set(e.strings,r=new Ru(e)),r}T(e){c5(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let i,n=0;for(const s of e)n===r.length?r.push(i=new Tu(this.k(Ou()),this.k(Ou()),this,this.options)):i=r[n],i._$AI(s),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,r);e&&e!==this._$AB;){const n=e.nextSibling;e.remove(),e=n}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}}class Bh{constructor(e,r,i,n,s){this.type=1,this._$AH=Ir,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Ir}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,n){const s=this.strings;let a=!1;if(s===void 0)e=fc(this,e,r,0),a=!$u(e)||e!==this._$AH&&e!==ra,a&&(this._$AH=e);else{const u=e;let d,p;for(e=s[0],d=0;d<s.length-1;d++)p=fc(this,u[i+d],r,d),p===ra&&(p=this._$AH[d]),a||(a=!$u(p)||p!==this._$AH[d]),p===Ir?e=Ir:e!==Ir&&(e+=(p??"")+s[d+1]),this._$AH[d]=p}a&&!n&&this.j(e)}j(e){e===Ir?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class CF extends Bh{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ir?void 0:e}}const DF=uc?uc.emptyScript:"";class PF extends Bh{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Ir?this.element.setAttribute(this.name,DF):this.element.removeAttribute(this.name)}}class OF extends Bh{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){var i;if((e=(i=fc(this,e,r,0))!==null&&i!==void 0?i:Ir)===ra)return;const n=this._$AH,s=e===Ir&&n!==Ir||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,a=e!==Ir&&(n===Ir||s);s&&this.element.removeEventListener(this.name,this,n),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,i;typeof this._$AH=="function"?this._$AH.call((i=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&i!==void 0?i:this.element,e):this._$AH.handleEvent(e)}}class $F{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){fc(this,e)}}const m5=Lh.litHtmlPolyfillSupport;m5?.(Ru,Tu),((D1=Lh.litHtmlVersions)!==null&&D1!==void 0?D1:Lh.litHtmlVersions=[]).push("2.8.0");const NF=(t,e,r)=>{var i,n;const s=(i=r?.renderBefore)!==null&&i!==void 0?i:e;let a=s._$litPart$;if(a===void 0){const u=(n=r?.renderBefore)!==null&&n!==void 0?n:null;s._$litPart$=a=new Tu(e.insertBefore(Ou(),u),u,void 0,r??{})}return a._$AI(t),a};/**
|
|
84
84
|
* @license
|
|
85
85
|
* Copyright 2017 Google LLC
|
|
86
86
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
87
|
-
*/var
|
|
87
|
+
*/var $1,N1;class Ot extends cc{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=NF(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 ra}}Ot.finalized=!0,Ot._$litElement$=!0,($1=globalThis.litElementHydrateSupport)===null||$1===void 0||$1.call(globalThis,{LitElement:Ot});const b5=globalThis.litElementPolyfillSupport;b5?.({LitElement:Ot}),((N1=globalThis.litElementVersions)!==null&&N1!==void 0?N1:globalThis.litElementVersions=[]).push("3.3.3");/**
|
|
88
88
|
* @license
|
|
89
89
|
* Copyright 2017 Google LLC
|
|
90
90
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
91
|
-
*/const
|
|
91
|
+
*/const jt=t=>e=>typeof e=="function"?((r,i)=>(customElements.define(r,i),i))(t,e):((r,i)=>{const{kind:n,elements:s}=i;return{kind:n,elements:s,finisher(a){customElements.define(r,a)}}})(t,e);/**
|
|
92
92
|
* @license
|
|
93
93
|
* Copyright 2017 Google LLC
|
|
94
94
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
95
|
-
*/const
|
|
95
|
+
*/const RF=(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)}},TF=(t,e,r)=>{e.constructor.createProperty(r,t)};function xt(t){return(e,r)=>r!==void 0?TF(t,e,r):RF(t,e)}/**
|
|
96
96
|
* @license
|
|
97
97
|
* Copyright 2017 Google LLC
|
|
98
98
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
99
|
-
*/function
|
|
99
|
+
*/function Mi(t){return xt({...t,state:!0})}/**
|
|
100
100
|
* @license
|
|
101
101
|
* Copyright 2021 Google LLC
|
|
102
102
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
103
|
-
*/var
|
|
103
|
+
*/var R1;((R1=window.HTMLSlotElement)===null||R1===void 0?void 0:R1.prototype.assignedElements)!=null;/**
|
|
104
104
|
* @license
|
|
105
105
|
* Copyright 2017 Google LLC
|
|
106
106
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
107
|
-
*/const
|
|
107
|
+
*/const FF={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},LF=t=>(...e)=>({_$litDirective$:t,values:e});class BF{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/**
|
|
108
108
|
* @license
|
|
109
109
|
* Copyright 2018 Google LLC
|
|
110
110
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
111
|
-
*/const Gi=VD(class extends GD{constructor(e){var t;if(super(e),e.type!==WD.ATTRIBUTE||e.name!=="class"||((t=e.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){var r,n;if(this.it===void 0){this.it=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in t)t[o]&&!(!((r=this.nt)===null||r===void 0)&&r.has(o))&&this.it.add(o);return this.render(t)}const i=e.element.classList;this.it.forEach(o=>{o in t||(i.remove(o),this.it.delete(o))});for(const o in t){const c=!!t[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 so}});function YD(e,t){e.indexOf(t)===-1&&e.push(t)}const o2=(e,t,r)=>Math.min(Math.max(r,e),t),Nn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},du=e=>typeof e=="number",ua=e=>Array.isArray(e)&&!du(e[0]),QD=(e,t,r)=>{const n=t-e;return((r-e)%n+n)%n+e};function JD(e,t){return ua(e)?e[QD(0,e.length,t)]:e}const a2=(e,t,r)=>-r*e+r*t+e,c2=()=>{},ys=e=>e,F0=(e,t,r)=>t-e===0?1:(r-e)/(t-e);function l2(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=F0(0,t,n);e.push(a2(r,1,i))}}function ZD(e){const t=[0];return l2(t,e-1),t}function XD(e,t=ZD(e.length),r=ys){const n=e.length,i=n-t.length;return i>0&&l2(t,i),o=>{let c=0;for(;c<n-2&&!(o<t[c+1]);c++);let l=o2(0,1,F0(t[c],t[c+1],o));return l=JD(r,c)(l),a2(e[c],e[c+1],l)}}const u2=e=>Array.isArray(e)&&du(e[0]),j0=e=>typeof e=="object"&&!!e.createAnimation,ao=e=>typeof e=="function",tO=e=>typeof e=="string",Dc={ms:e=>e*1e3,s:e=>e/1e3},h2=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,eO=1e-7,rO=12;function nO(e,t,r,n,i){let o,c,l=0;do c=t+(r-t)/2,o=h2(c,n,i)-e,o>0?r=c:t=c;while(Math.abs(o)>eO&&++l<rO);return c}function Oc(e,t,r,n){if(e===t&&r===n)return ys;const i=o=>nO(o,0,1,e,r);return o=>o===0||o===1?o:h2(i(o),t,n)}const iO=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e,i=t==="end"?Math.floor(n):Math.ceil(n);return o2(0,1,i/e)},f2={ease:Oc(.25,.1,.25,1),"ease-in":Oc(.42,0,1,1),"ease-in-out":Oc(.42,0,.58,1),"ease-out":Oc(0,0,.58,1)},sO=/\((.*?)\)/;function d2(e){if(ao(e))return e;if(u2(e))return Oc(...e);if(f2[e])return f2[e];if(e.startsWith("steps")){const t=sO.exec(e);if(t){const r=t[1].split(",");return iO(parseFloat(r[0]),r[1].trim())}}return ys}class p2{constructor(t,r=[0,1],{easing:n,duration:i=Nn.duration,delay:o=Nn.delay,endDelay:c=Nn.endDelay,repeat:l=Nn.repeat,offset:f,direction:h="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=ys,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((_,E)=>{this.resolve=_,this.reject=E}),n=n||Nn.easing,j0(n)){const _=n.createAnimation(r);n=_.easing,r=_.keyframes||r,i=_.duration||i}this.repeat=l,this.easing=ua(n)?ys:d2(n),this.updateDuration(i);const g=XD(r,f,ua(n)?n.map(d2):ys);this.tick=_=>{var E;o=o;let x=0;this.pauseTime!==void 0?x=this.pauseTime:x=(_-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 I=x/this.duration;let F=Math.floor(I),W=I%1;!W&&I>=1&&(W=1),W===1&&F--;const Y=F%2;(h==="reverse"||h==="alternate"&&Y||h==="alternate-reverse"&&!Y)&&(W=1-W);const B=x>=this.totalDuration?1:Math.min(W,1),z=g(this.easing(B));t(z),this.pauseTime===void 0&&(this.playState==="finished"||x>=this.totalDuration+c)?(this.playState="finished",(E=this.resolve)===null||E===void 0||E.call(this,z)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),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 t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}var k0=function(){};process.env.NODE_ENV!=="production"&&(k0=function(e,t){if(!e)throw new Error(t)});class oO{setAnimation(t){this.animation=t,t?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const q0=new WeakMap;function g2(e){return q0.has(e)||q0.set(e,{transforms:[],values:new Map}),q0.get(e)}function aO(e,t){return e.has(t)||e.set(t,new oO),e.get(t)}const cO=["","X","Y","Z"],lO=["translate","scale","rotate","skew"],pu={x:"translateX",y:"translateY",z:"translateZ"},m2={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},uO={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:m2,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:ys},skew:m2},Pc=new Map,z0=e=>`--motion-${e}`,gu=["x","y","z"];lO.forEach(e=>{cO.forEach(t=>{gu.push(e+t),Pc.set(z0(e+t),uO[e])})});const hO=(e,t)=>gu.indexOf(e)-gu.indexOf(t),fO=new Set(gu),v2=e=>fO.has(e),dO=(e,t)=>{pu[t]&&(t=pu[t]);const{transforms:r}=g2(e);YD(r,t),e.style.transform=pO(r)},pO=e=>e.sort(hO).reduce(gO,"").trim(),gO=(e,t)=>`${e} ${t}(var(${z0(t)}))`,H0=e=>e.startsWith("--"),w2=new Set;function mO(e){if(!w2.has(e)){w2.add(e);try{const{syntax:t,initialValue:r}=Pc.has(e)?Pc.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:r})}catch{}}}const K0=(e,t)=>document.createElement("div").animate(e,t),y2={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{K0({opacity:[1]})}catch{return!1}return!0},finished:()=>!!K0({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{K0({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},W0={},ha={};for(const e in y2)ha[e]=()=>(W0[e]===void 0&&(W0[e]=y2[e]()),W0[e]);const vO=.015,wO=(e,t)=>{let r="";const n=Math.round(t/vO);for(let i=0;i<n;i++)r+=e(F0(0,n-1,i))+", ";return r.substring(0,r.length-2)},b2=(e,t)=>ao(e)?ha.linearEasing()?`linear(${wO(e,t)})`:Nn.easing:u2(e)?yO(e):e,yO=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;function bO(e,t){for(let r=0;r<e.length;r++)e[r]===null&&(e[r]=r?e[r-1]:t());return e}const _O=e=>Array.isArray(e)?e:[e];function V0(e){return pu[e]&&(e=pu[e]),v2(e)?z0(e):e}const mu={get:(e,t)=>{t=V0(t);let r=H0(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!r&&r!==0){const n=Pc.get(t);n&&(r=n.initialValue)}return r},set:(e,t,r)=>{t=V0(t),H0(t)?e.style.setProperty(t,r):e.style[t]=r}};function _2(e,t=!0){if(!(!e||e.playState==="finished"))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function EO(e,t){var r;let n=t?.toDefaultUnit||ys;const i=e[e.length-1];if(tO(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 AO(){return window.__MOTION_DEV_TOOLS_RECORD}function xO(e,t,r,n={},i){const o=AO(),c=n.record!==!1&&o;let l,{duration:f=Nn.duration,delay:h=Nn.delay,endDelay:g=Nn.endDelay,repeat:_=Nn.repeat,easing:E=Nn.easing,persist:x=!1,direction:I,offset:F,allowWebkitAcceleration:W=!1}=n;const Y=g2(e),B=v2(t);let z=ha.waapi();B&&dO(e,t);const P=V0(t),U=aO(Y.values,P),j=Pc.get(P);return _2(U.animation,!(j0(E)&&U.generator)&&n.record!==!1),()=>{const m=()=>{var tt,nt;return(nt=(tt=mu.get(e,P))!==null&&tt!==void 0?tt:j?.initialValue)!==null&&nt!==void 0?nt:0};let $=bO(_O(r),m);const et=EO($,j);if(j0(E)){const tt=E.createAnimation($,t!=="opacity",m,P,U);E=tt.easing,$=tt.keyframes||$,f=tt.duration||f}if(H0(P)&&(ha.cssRegisterProperty()?mO(P):z=!1),B&&!ha.linearEasing()&&(ao(E)||ua(E)&&E.some(ao))&&(z=!1),z){j&&($=$.map(dt=>du(dt)?j.toDefaultUnit(dt):dt)),$.length===1&&(!ha.partialKeyframes()||c)&&$.unshift(m());const tt={delay:Dc.ms(h),duration:Dc.ms(f),endDelay:Dc.ms(g),easing:ua(E)?void 0:b2(E,f),direction:I,iterations:_+1,fill:"both"};l=e.animate({[P]:$,offset:F,easing:ua(E)?E.map(dt=>b2(dt,f)):void 0},tt),l.finished||(l.finished=new Promise((dt,d)=>{l.onfinish=dt,l.oncancel=d}));const nt=$[$.length-1];l.finished.then(()=>{x||(mu.set(e,P,nt),l.cancel())}).catch(c2),W||(l.playbackRate=1.000001)}else if(i&&B)$=$.map(tt=>typeof tt=="string"?parseFloat(tt):tt),$.length===1&&$.unshift(parseFloat(m())),l=new i(tt=>{mu.set(e,P,et?et(tt):tt)},$,Object.assign(Object.assign({},n),{duration:f,easing:E}));else{const tt=$[$.length-1];mu.set(e,P,j&&du(tt)?j.toDefaultUnit(tt):tt)}return c&&o(e,t,$,{duration:f,delay:h,easing:E,repeat:_,offset:F},"motion-one"),U.setAnimation(l),l}}const IO=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function E2(e,t){var r;return typeof e=="string"?t?((r=t[e])!==null&&r!==void 0||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}const SO=e=>e(),A2=(e,t,r=Nn.duration)=>new Proxy({animations:e.map(SO).filter(Boolean),duration:r,options:t},DO),CO=e=>e.animations[0],DO={get:(e,t)=>{const r=CO(e);switch(t){case"duration":return e.duration;case"currentTime":return Dc.s(r?.[t]||0);case"playbackRate":case"playState":return r?.[t];case"finished":return e.finished||(e.finished=Promise.all(e.animations.map(OO)).catch(c2)),e.finished;case"stop":return()=>{e.animations.forEach(n=>_2(n))};case"forEachNative":return n=>{e.animations.forEach(i=>n(i,e))};default:return typeof r?.[t]>"u"?void 0:()=>e.animations.forEach(n=>n[t]())}},set:(e,t,r)=>{switch(t){case"currentTime":r=Dc.ms(r);case"playbackRate":for(let n=0;n<e.animations.length;n++)e.animations[n][t]=r;return!0}return!1}},OO=e=>e.finished;function PO(e,t,r){return ao(e)?e(t,r):e}function MO(e){return function(r,n,i={}){r=E2(r);const o=r.length;k0(!!o,"No valid element provided."),k0(!!n,"No keyframes defined.");const c=[];for(let l=0;l<o;l++){const f=r[l];for(const h in n){const g=IO(i,h);g.delay=PO(g.delay,l,o);const _=xO(f,h,n[h],g,e);c.push(_)}}return A2(c,i,i.duration)}}const $O=MO(p2);function NO(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}typeof SuppressedError=="function"&&SuppressedError;const TO={any:0,all:1};function RO(e,t,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=E2(e),c=new WeakMap,l=h=>{h.forEach(g=>{const _=c.get(g.target);if(g.isIntersecting!==!!_)if(g.isIntersecting){const E=t(g);ao(E)?c.set(g.target,E):f.unobserve(g.target)}else _&&(_(g),c.delete(g.target))})},f=new IntersectionObserver(l,{root:r,rootMargin:n,threshold:typeof i=="number"?i:TO[i]});return o.forEach(h=>f.observe(h)),()=>f.disconnect()}function G0(e,t,r){e.dispatchEvent(new CustomEvent(t,{detail:{originalEvent:r}}))}function x2(e,t,r){e.dispatchEvent(new CustomEvent(t,{detail:{originalEntry:r}}))}const LO={isActive:e=>!!e.inView,subscribe:(e,{enable:t,disable:r},{inViewOptions:n={}})=>{const{once:i}=n,o=NO(n,["once"]);return RO(e,c=>{if(t(),x2(e,"viewenter",c),!i)return l=>{r(),x2(e,"viewleave",l)}},o)}},I2=(e,t,r)=>n=>{n.pointerType&&n.pointerType!=="mouse"||(r(),G0(e,t,n))};[...Object.keys({inView:LO,hover:{isActive:e=>!!e.hover,subscribe:(e,{enable:t,disable:r})=>{const n=I2(e,"hoverstart",t),i=I2(e,"hoverend",r);return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",i),()=>{e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",i)}}},press:{isActive:e=>!!e.press,subscribe:(e,{enable:t,disable:r})=>{const n=o=>{r(),G0(e,"pressend",o),window.removeEventListener("pointerup",n)},i=o=>{t(),G0(e,"pressstart",o),window.addEventListener("pointerup",n)};return e.addEventListener("pointerdown",i),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",n)}}}})];function BO(e,t={}){return A2([()=>{const r=new p2(e,[0,1],t);return r.finished.catch(()=>{}),r}],t,t.duration)}function co(e,t,r){return(ao(e)?BO:$O)(e,t,r)}/**
|
|
111
|
+
*/const Ts=LF(class extends BF{constructor(t){var e;if(super(t),t.type!==FF.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,i;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!(!((r=this.nt)===null||r===void 0)&&r.has(s))&&this.it.add(s);return this.render(e)}const n=t.element.classList;this.it.forEach(s=>{s in e||(n.remove(s),this.it.delete(s))});for(const s in e){const a=!!e[s];a===this.it.has(s)||!((i=this.nt)===null||i===void 0)&&i.has(s)||(a?(n.add(s),this.it.add(s)):(n.remove(s),this.it.delete(s)))}return ra}});function UF(t,e){t.indexOf(e)===-1&&t.push(e)}const y5=(t,e,r)=>Math.min(Math.max(r,t),e),on={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Uh=t=>typeof t=="number",hc=t=>Array.isArray(t)&&!Uh(t[0]),kF=(t,e,r)=>{const i=e-t;return((r-t)%i+i)%i+t};function jF(t,e){return hc(t)?t[kF(0,t.length,e)]:t}const w5=(t,e,r)=>-r*t+r*e+t,_5=()=>{},fo=t=>t,T1=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function A5(t,e){const r=t[t.length-1];for(let i=1;i<=e;i++){const n=T1(0,e,i);t.push(w5(r,1,n))}}function qF(t){const e=[0];return A5(e,t-1),e}function zF(t,e=qF(t.length),r=fo){const i=t.length,n=i-e.length;return n>0&&A5(e,n),s=>{let a=0;for(;a<i-2&&!(s<e[a+1]);a++);let u=y5(0,1,T1(e[a],e[a+1],s));return u=jF(r,a)(u),w5(t[a],t[a+1],u)}}const E5=t=>Array.isArray(t)&&Uh(t[0]),F1=t=>typeof t=="object"&&!!t.createAnimation,na=t=>typeof t=="function",HF=t=>typeof t=="string",Fu={ms:t=>t*1e3,s:t=>t/1e3},x5=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,KF=1e-7,WF=12;function VF(t,e,r,i,n){let s,a,u=0;do a=e+(r-e)/2,s=x5(a,i,n)-t,s>0?r=a:e=a;while(Math.abs(s)>KF&&++u<WF);return a}function Lu(t,e,r,i){if(t===e&&r===i)return fo;const n=s=>VF(s,0,1,t,r);return s=>s===0||s===1?s:x5(n(s),e,i)}const GF=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const i=r*t,n=e==="end"?Math.floor(i):Math.ceil(i);return y5(0,1,n/t)},S5={ease:Lu(.25,.1,.25,1),"ease-in":Lu(.42,0,1,1),"ease-in-out":Lu(.42,0,.58,1),"ease-out":Lu(0,0,.58,1)},YF=/\((.*?)\)/;function I5(t){if(na(t))return t;if(E5(t))return Lu(...t);if(S5[t])return S5[t];if(t.startsWith("steps")){const e=YF.exec(t);if(e){const r=e[1].split(",");return GF(parseFloat(r[0]),r[1].trim())}}return fo}class M5{constructor(e,r=[0,1],{easing:i,duration:n=on.duration,delay:s=on.delay,endDelay:a=on.endDelay,repeat:u=on.repeat,offset:d,direction:p="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=fo,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((_,C)=>{this.resolve=_,this.reject=C}),i=i||on.easing,F1(i)){const _=i.createAnimation(r);i=_.easing,r=_.keyframes||r,n=_.duration||n}this.repeat=u,this.easing=hc(i)?fo:I5(i),this.updateDuration(n);const y=zF(r,d,hc(i)?i.map(I5):fo);this.tick=_=>{var C;s=s;let I=0;this.pauseTime!==void 0?I=this.pauseTime:I=(_-this.startTime)*this.rate,this.t=I,I/=1e3,I=Math.max(I-s,0),this.playState==="finished"&&this.pauseTime===void 0&&(I=this.totalDuration);const M=I/this.duration;let B=Math.floor(M),W=M%1;!W&&M>=1&&(W=1),W===1&&B--;const Y=B%2;(p==="reverse"||p==="alternate"&&Y||p==="alternate-reverse"&&!Y)&&(W=1-W);const q=I>=this.totalDuration?1:Math.min(W,1),V=y(this.easing(q));e(V),this.pauseTime===void 0&&(this.playState==="finished"||I>=this.totalDuration+a)?(this.playState="finished",(C=this.resolve)===null||C===void 0||C.call(this,V)):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 L1=function(){};process.env.NODE_ENV!=="production"&&(L1=function(t,e){if(!t)throw new Error(e)});class JF{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const B1=new WeakMap;function C5(t){return B1.has(t)||B1.set(t,{transforms:[],values:new Map}),B1.get(t)}function QF(t,e){return t.has(e)||t.set(e,new JF),t.get(e)}const ZF=["","X","Y","Z"],XF=["translate","scale","rotate","skew"],kh={x:"translateX",y:"translateY",z:"translateZ"},D5={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},eL={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:D5,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:fo},skew:D5},Bu=new Map,U1=t=>`--motion-${t}`,jh=["x","y","z"];XF.forEach(t=>{ZF.forEach(e=>{jh.push(t+e),Bu.set(U1(t+e),eL[t])})});const tL=(t,e)=>jh.indexOf(t)-jh.indexOf(e),rL=new Set(jh),P5=t=>rL.has(t),iL=(t,e)=>{kh[e]&&(e=kh[e]);const{transforms:r}=C5(t);UF(r,e),t.style.transform=nL(r)},nL=t=>t.sort(tL).reduce(sL,"").trim(),sL=(t,e)=>`${t} ${e}(var(${U1(e)}))`,k1=t=>t.startsWith("--"),O5=new Set;function oL(t){if(!O5.has(t)){O5.add(t);try{const{syntax:e,initialValue:r}=Bu.has(t)?Bu.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const j1=(t,e)=>document.createElement("div").animate(t,e),$5={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{j1({opacity:[1]})}catch{return!1}return!0},finished:()=>!!j1({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{j1({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},q1={},lc={};for(const t in $5)lc[t]=()=>(q1[t]===void 0&&(q1[t]=$5[t]()),q1[t]);const aL=.015,cL=(t,e)=>{let r="";const i=Math.round(e/aL);for(let n=0;n<i;n++)r+=t(T1(0,i-1,n))+", ";return r.substring(0,r.length-2)},N5=(t,e)=>na(t)?lc.linearEasing()?`linear(${cL(t,e)})`:on.easing:E5(t)?uL(t):t,uL=([t,e,r,i])=>`cubic-bezier(${t}, ${e}, ${r}, ${i})`;function fL(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const hL=t=>Array.isArray(t)?t:[t];function z1(t){return kh[t]&&(t=kh[t]),P5(t)?U1(t):t}const qh={get:(t,e)=>{e=z1(e);let r=k1(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const i=Bu.get(e);i&&(r=i.initialValue)}return r},set:(t,e,r)=>{e=z1(e),k1(e)?t.style.setProperty(e,r):t.style[e]=r}};function R5(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function lL(t,e){var r;let i=e?.toDefaultUnit||fo;const n=t[t.length-1];if(HF(n)){const s=((r=n.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";s&&(i=a=>a+s)}return i}function dL(){return window.__MOTION_DEV_TOOLS_RECORD}function pL(t,e,r,i={},n){const s=dL(),a=i.record!==!1&&s;let u,{duration:d=on.duration,delay:p=on.delay,endDelay:y=on.endDelay,repeat:_=on.repeat,easing:C=on.easing,persist:I=!1,direction:M,offset:B,allowWebkitAcceleration:W=!1}=i;const Y=C5(t),q=P5(e);let V=lc.waapi();q&&iL(t,e);const U=z1(e),z=QF(Y.values,U),K=Bu.get(U);return R5(z.animation,!(F1(C)&&z.generator)&&i.record!==!1),()=>{const A=()=>{var re,k;return(k=(re=qh.get(t,U))!==null&&re!==void 0?re:K?.initialValue)!==null&&k!==void 0?k:0};let j=fL(hL(r),A);const ee=lL(j,K);if(F1(C)){const re=C.createAnimation(j,e!=="opacity",A,U,z);C=re.easing,j=re.keyframes||j,d=re.duration||d}if(k1(U)&&(lc.cssRegisterProperty()?oL(U):V=!1),q&&!lc.linearEasing()&&(na(C)||hc(C)&&C.some(na))&&(V=!1),V){K&&(j=j.map(w=>Uh(w)?K.toDefaultUnit(w):w)),j.length===1&&(!lc.partialKeyframes()||a)&&j.unshift(A());const re={delay:Fu.ms(p),duration:Fu.ms(d),endDelay:Fu.ms(y),easing:hc(C)?void 0:N5(C,d),direction:M,iterations:_+1,fill:"both"};u=t.animate({[U]:j,offset:B,easing:hc(C)?C.map(w=>N5(w,d)):void 0},re),u.finished||(u.finished=new Promise((w,f)=>{u.onfinish=w,u.oncancel=f}));const k=j[j.length-1];u.finished.then(()=>{I||(qh.set(t,U,k),u.cancel())}).catch(_5),W||(u.playbackRate=1.000001)}else if(n&&q)j=j.map(re=>typeof re=="string"?parseFloat(re):re),j.length===1&&j.unshift(parseFloat(A())),u=new n(re=>{qh.set(t,U,ee?ee(re):re)},j,Object.assign(Object.assign({},i),{duration:d,easing:C}));else{const re=j[j.length-1];qh.set(t,U,K&&Uh(re)?K.toDefaultUnit(re):re)}return a&&s(t,e,j,{duration:d,delay:p,easing:C,repeat:_,offset:B},"motion-one"),z.setAnimation(u),u}}const gL=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function T5(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 vL=t=>t(),F5=(t,e,r=on.duration)=>new Proxy({animations:t.map(vL).filter(Boolean),duration:r,options:e},bL),mL=t=>t.animations[0],bL={get:(t,e)=>{const r=mL(t);switch(e){case"duration":return t.duration;case"currentTime":return Fu.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(yL)).catch(_5)),t.finished;case"stop":return()=>{t.animations.forEach(i=>R5(i))};case"forEachNative":return i=>{t.animations.forEach(n=>i(n,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(i=>i[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=Fu.ms(r);case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=r;return!0}return!1}},yL=t=>t.finished;function wL(t,e,r){return na(t)?t(e,r):t}function _L(t){return function(r,i,n={}){r=T5(r);const s=r.length;L1(!!s,"No valid element provided."),L1(!!i,"No keyframes defined.");const a=[];for(let u=0;u<s;u++){const d=r[u];for(const p in i){const y=gL(n,p);y.delay=wL(y.delay,u,s);const _=pL(d,p,i[p],y,t);a.push(_)}}return F5(a,n,n.duration)}}const AL=_L(M5);function EL(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}typeof SuppressedError=="function"&&SuppressedError;const xL={any:0,all:1};function SL(t,e,{root:r,margin:i,amount:n="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const s=T5(t),a=new WeakMap,u=p=>{p.forEach(y=>{const _=a.get(y.target);if(y.isIntersecting!==!!_)if(y.isIntersecting){const C=e(y);na(C)?a.set(y.target,C):d.unobserve(y.target)}else _&&(_(y),a.delete(y.target))})},d=new IntersectionObserver(u,{root:r,rootMargin:i,threshold:typeof n=="number"?n:xL[n]});return s.forEach(p=>d.observe(p)),()=>d.disconnect()}function H1(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function L5(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const IL={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:i={}})=>{const{once:n}=i,s=EL(i,["once"]);return SL(t,a=>{if(e(),L5(t,"viewenter",a),!n)return u=>{r(),L5(t,"viewleave",u)}},s)}},B5=(t,e,r)=>i=>{i.pointerType&&i.pointerType!=="mouse"||(r(),H1(t,e,i))};[...Object.keys({inView:IL,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const i=B5(t,"hoverstart",e),n=B5(t,"hoverend",r);return t.addEventListener("pointerenter",i),t.addEventListener("pointerleave",n),()=>{t.removeEventListener("pointerenter",i),t.removeEventListener("pointerleave",n)}}},press:{isActive:t=>!!t.press,subscribe:(t,{enable:e,disable:r})=>{const i=s=>{r(),H1(t,"pressend",s),window.removeEventListener("pointerup",i)},n=s=>{e(),H1(t,"pressstart",s),window.addEventListener("pointerup",i)};return t.addEventListener("pointerdown",n),()=>{t.removeEventListener("pointerdown",n),window.removeEventListener("pointerup",i)}}}})];function ML(t,e={}){return F5([()=>{const r=new M5(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function sa(t,e,r){return(na(t)?ML:AL)(t,e,r)}/**
|
|
112
112
|
* @license
|
|
113
113
|
* Copyright 2018 Google LLC
|
|
114
114
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
115
|
-
*/const
|
|
116
|
-
]))+`;
|
|
117
|
-
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),
|
|
118
|
-
Suggested mode is: `+
|
|
115
|
+
*/const li=t=>t??Ir;var Uu={},CL=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},U5={},qi={};let K1;const DL=[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];qi.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},qi.getSymbolTotalCodewords=function(e){return DL[e]},qi.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},qi.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');K1=e},qi.isKanjiModeEnabled=function(){return typeof K1<"u"},qi.toSJIS=function(e){return K1(e)};var zh={};(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(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,n){if(t.isValid(i))return i;try{return e(i)}catch{return n}}})(zh);function k5(){this.buffer=[],this.length=0}k5.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 PL=k5;function ku(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)}ku.prototype.set=function(t,e,r,i){const n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=!0)},ku.prototype.get=function(t,e){return this.data[t*this.size+e]},ku.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},ku.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var OL=ku,j5={};(function(t){const e=qi.getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];const n=Math.floor(i/7)+2,s=e(i),a=s===145?26:Math.ceil((s-13)/(2*n-2))*2,u=[s-7];for(let d=1;d<n-1;d++)u[d]=u[d-1]-a;return u.push(6),u.reverse()},t.getPositions=function(i){const n=[],s=t.getRowColCoords(i),a=s.length;for(let u=0;u<a;u++)for(let d=0;d<a;d++)u===0&&d===0||u===0&&d===a-1||u===a-1&&d===0||n.push([s[u],s[d]]);return n}})(j5);var q5={};const $L=qi.getSymbolSize,z5=7;q5.getPositions=function(e){const r=$L(e);return[[0,0],[r-z5,0],[0,r-z5]]};var H5={};(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(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(n){const s=n.size;let a=0,u=0,d=0,p=null,y=null;for(let _=0;_<s;_++){u=d=0,p=y=null;for(let C=0;C<s;C++){let I=n.get(_,C);I===p?u++:(u>=5&&(a+=e.N1+(u-5)),p=I,u=1),I=n.get(C,_),I===y?d++:(d>=5&&(a+=e.N1+(d-5)),y=I,d=1)}u>=5&&(a+=e.N1+(u-5)),d>=5&&(a+=e.N1+(d-5))}return a},t.getPenaltyN2=function(n){const s=n.size;let a=0;for(let u=0;u<s-1;u++)for(let d=0;d<s-1;d++){const p=n.get(u,d)+n.get(u,d+1)+n.get(u+1,d)+n.get(u+1,d+1);(p===4||p===0)&&a++}return a*e.N2},t.getPenaltyN3=function(n){const s=n.size;let a=0,u=0,d=0;for(let p=0;p<s;p++){u=d=0;for(let y=0;y<s;y++)u=u<<1&2047|n.get(p,y),y>=10&&(u===1488||u===93)&&a++,d=d<<1&2047|n.get(y,p),y>=10&&(d===1488||d===93)&&a++}return a*e.N3},t.getPenaltyN4=function(n){let s=0;const a=n.data.length;for(let d=0;d<a;d++)s+=n.data[d];return Math.abs(Math.ceil(s*100/a/5)-10)*e.N4};function r(i,n,s){switch(i){case t.Patterns.PATTERN000:return(n+s)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(n+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return n*s%2+n*s%3===0;case t.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case t.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.applyMask=function(n,s){const a=s.size;for(let u=0;u<a;u++)for(let d=0;d<a;d++)s.isReserved(d,u)||s.xor(d,u,r(n,d,u))},t.getBestMask=function(n,s){const a=Object.keys(t.Patterns).length;let u=0,d=1/0;for(let p=0;p<a;p++){s(p),t.applyMask(p,n);const y=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(p,n),y<d&&(d=y,u=p)}return u}})(H5);var Hh={};const ho=zh,Kh=[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],Wh=[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];Hh.getBlocksCount=function(e,r){switch(r){case ho.L:return Kh[(e-1)*4+0];case ho.M:return Kh[(e-1)*4+1];case ho.Q:return Kh[(e-1)*4+2];case ho.H:return Kh[(e-1)*4+3];default:return}},Hh.getTotalCodewordsCount=function(e,r){switch(r){case ho.L:return Wh[(e-1)*4+0];case ho.M:return Wh[(e-1)*4+1];case ho.Q:return Wh[(e-1)*4+2];case ho.H:return Wh[(e-1)*4+3];default:return}};var K5={},Vh={};const ju=new Uint8Array(512),Gh=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)ju[r]=e,Gh[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)ju[r]=ju[r-255]})(),Vh.log=function(e){if(e<1)throw new Error("log("+e+")");return Gh[e]},Vh.exp=function(e){return ju[e]},Vh.mul=function(e,r){return e===0||r===0?0:ju[Gh[e]+Gh[r]]},function(t){const e=Vh;t.mul=function(i,n){const s=new Uint8Array(i.length+n.length-1);for(let a=0;a<i.length;a++)for(let u=0;u<n.length;u++)s[a+u]^=e.mul(i[a],n[u]);return s},t.mod=function(i,n){let s=new Uint8Array(i);for(;s.length-n.length>=0;){const a=s[0];for(let d=0;d<n.length;d++)s[d]^=e.mul(n[d],a);let u=0;for(;u<s.length&&s[u]===0;)u++;s=s.slice(u)}return s},t.generateECPolynomial=function(i){let n=new Uint8Array([1]);for(let s=0;s<i;s++)n=t.mul(n,new Uint8Array([1,e.exp(s)]));return n}}(K5);const W5=K5;function W1(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}W1.prototype.initialize=function(e){this.degree=e,this.genPoly=W5.generateECPolynomial(this.degree)},W1.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 i=W5.mod(r,this.genPoly),n=this.degree-i.length;if(n>0){const s=new Uint8Array(this.degree);return s.set(i,n),s}return i};var NL=W1,V5={},lo={},V1={};V1.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var vs={};const G5="[0-9]+",RL="[A-Z $%*+\\-./:]+";let qu="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";qu=qu.replace(/u/g,"\\u");const TL="(?:(?![A-Z0-9 $%*+\\-./:]|"+qu+`)(?:.|[\r
|
|
116
|
+
]))+`;vs.KANJI=new RegExp(qu,"g"),vs.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),vs.BYTE=new RegExp(TL,"g"),vs.NUMERIC=new RegExp(G5,"g"),vs.ALPHANUMERIC=new RegExp(RL,"g");const FL=new RegExp("^"+qu+"$"),LL=new RegExp("^"+G5+"$"),BL=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");vs.testKanji=function(e){return FL.test(e)},vs.testNumeric=function(e){return LL.test(e)},vs.testAlphanumeric=function(e){return BL.test(e)},function(t){const e=V1,r=vs;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(s,a){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?s.ccBits[0]:a<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return r.testNumeric(s)?t.NUMERIC:r.testAlphanumeric(s)?t.ALPHANUMERIC:r.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.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: "+n)}}t.from=function(s,a){if(t.isValid(s))return s;try{return i(s)}catch{return a}}}(lo),function(t){const e=qi,r=Hh,i=zh,n=lo,s=V1,a=7973,u=e.getBCHDigit(a);function d(C,I,M){for(let B=1;B<=40;B++)if(I<=t.getCapacity(B,M,C))return B}function p(C,I){return n.getCharCountIndicator(C,I)+4}function y(C,I){let M=0;return C.forEach(function(B){const W=p(B.mode,I);M+=W+B.getBitsLength()}),M}function _(C,I){for(let M=1;M<=40;M++)if(y(C,M)<=t.getCapacity(M,I,n.MIXED))return M}t.from=function(I,M){return s.isValid(I)?parseInt(I,10):M},t.getCapacity=function(I,M,B){if(!s.isValid(I))throw new Error("Invalid QR Code version");typeof B>"u"&&(B=n.BYTE);const W=e.getSymbolTotalCodewords(I),Y=r.getTotalCodewordsCount(I,M),q=(W-Y)*8;if(B===n.MIXED)return q;const V=q-p(B,I);switch(B){case n.NUMERIC:return Math.floor(V/10*3);case n.ALPHANUMERIC:return Math.floor(V/11*2);case n.KANJI:return Math.floor(V/13);case n.BYTE:default:return Math.floor(V/8)}},t.getBestVersionForData=function(I,M){let B;const W=i.from(M,i.M);if(Array.isArray(I)){if(I.length>1)return _(I,W);if(I.length===0)return 1;B=I[0]}else B=I;return d(B.mode,B.getLength(),W)},t.getEncodedBits=function(I){if(!s.isValid(I)||I<7)throw new Error("Invalid QR Code version");let M=I<<12;for(;e.getBCHDigit(M)-u>=0;)M^=a<<e.getBCHDigit(M)-u;return I<<12|M}}(V5);var Y5={};const G1=qi,J5=1335,UL=21522,Q5=G1.getBCHDigit(J5);Y5.getEncodedBits=function(e,r){const i=e.bit<<3|r;let n=i<<10;for(;G1.getBCHDigit(n)-Q5>=0;)n^=J5<<G1.getBCHDigit(n)-Q5;return(i<<10|n)^UL};var Z5={};const kL=lo;function dc(t){this.mode=kL.NUMERIC,this.data=t.toString()}dc.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},dc.prototype.getLength=function(){return this.data.length},dc.prototype.getBitsLength=function(){return dc.getBitsLength(this.data.length)},dc.prototype.write=function(e){let r,i,n;for(r=0;r+3<=this.data.length;r+=3)i=this.data.substr(r,3),n=parseInt(i,10),e.put(n,10);const s=this.data.length-r;s>0&&(i=this.data.substr(r),n=parseInt(i,10),e.put(n,s*3+1))};var jL=dc;const qL=lo,Y1=["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 pc(t){this.mode=qL.ALPHANUMERIC,this.data=t}pc.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},pc.prototype.getLength=function(){return this.data.length},pc.prototype.getBitsLength=function(){return pc.getBitsLength(this.data.length)},pc.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let i=Y1.indexOf(this.data[r])*45;i+=Y1.indexOf(this.data[r+1]),e.put(i,11)}this.data.length%2&&e.put(Y1.indexOf(this.data[r]),6)};var zL=pc,HL=function(e){for(var r=[],i=e.length,n=0;n<i;n++){var s=e.charCodeAt(n);if(s>=55296&&s<=56319&&i>n+1){var a=e.charCodeAt(n+1);a>=56320&&a<=57343&&(s=(s-55296)*1024+a-56320+65536,n+=1)}if(s<128){r.push(s);continue}if(s<2048){r.push(s>>6|192),r.push(s&63|128);continue}if(s<55296||s>=57344&&s<65536){r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128);continue}if(s>=65536&&s<=1114111){r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const KL=HL,WL=lo;function gc(t){this.mode=WL.BYTE,typeof t=="string"&&(t=KL(t)),this.data=new Uint8Array(t)}gc.getBitsLength=function(e){return e*8},gc.prototype.getLength=function(){return this.data.length},gc.prototype.getBitsLength=function(){return gc.getBitsLength(this.data.length)},gc.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var VL=gc;const GL=lo,YL=qi;function vc(t){this.mode=GL.KANJI,this.data=t}vc.getBitsLength=function(e){return e*13},vc.prototype.getLength=function(){return this.data.length},vc.prototype.getBitsLength=function(){return vc.getBitsLength(this.data.length)},vc.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=YL.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]+`
|
|
117
|
+
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var JL=vc,X5={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,i,n){var s={},a={};a[i]=0;var u=e.PriorityQueue.make();u.push(i,0);for(var d,p,y,_,C,I,M,B,W;!u.empty();){d=u.pop(),p=d.value,_=d.cost,C=r[p]||{};for(y in C)C.hasOwnProperty(y)&&(I=C[y],M=_+I,B=a[y],W=typeof a[y]>"u",(W||B>M)&&(a[y]=M,u.push(y,M),s[y]=p))}if(typeof n<"u"&&typeof a[n]>"u"){var Y=["Could not find a path from ",i," to ",n,"."].join("");throw new Error(Y)}return s},extract_shortest_path_from_predecessor_list:function(r,i){for(var n=[],s=i;s;)n.push(s),r[s],s=r[s];return n.reverse(),n},find_path:function(r,i,n){var s=e.single_source_shortest_paths(r,i,n);return e.extract_shortest_path_from_predecessor_list(s,n)},PriorityQueue:{make:function(r){var i=e.PriorityQueue,n={},s;r=r||{};for(s in i)i.hasOwnProperty(s)&&(n[s]=i[s]);return n.queue=[],n.sorter=r.sorter||i.default_sorter,n},default_sorter:function(r,i){return r.cost-i.cost},push:function(r,i){var n={value:r,cost:i};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(X5),function(t){const e=lo,r=jL,i=zL,n=VL,s=JL,a=vs,u=qi,d=X5.exports;function p(Y){return unescape(encodeURIComponent(Y)).length}function y(Y,q,V){const U=[];let z;for(;(z=Y.exec(V))!==null;)U.push({data:z[0],index:z.index,mode:q,length:z[0].length});return U}function _(Y){const q=y(a.NUMERIC,e.NUMERIC,Y),V=y(a.ALPHANUMERIC,e.ALPHANUMERIC,Y);let U,z;return u.isKanjiModeEnabled()?(U=y(a.BYTE,e.BYTE,Y),z=y(a.KANJI,e.KANJI,Y)):(U=y(a.BYTE_KANJI,e.BYTE,Y),z=[]),q.concat(V,U,z).sort(function(A,j){return A.index-j.index}).map(function(A){return{data:A.data,mode:A.mode,length:A.length}})}function C(Y,q){switch(q){case e.NUMERIC:return r.getBitsLength(Y);case e.ALPHANUMERIC:return i.getBitsLength(Y);case e.KANJI:return s.getBitsLength(Y);case e.BYTE:return n.getBitsLength(Y)}}function I(Y){return Y.reduce(function(q,V){const U=q.length-1>=0?q[q.length-1]:null;return U&&U.mode===V.mode?(q[q.length-1].data+=V.data,q):(q.push(V),q)},[])}function M(Y){const q=[];for(let V=0;V<Y.length;V++){const U=Y[V];switch(U.mode){case e.NUMERIC:q.push([U,{data:U.data,mode:e.ALPHANUMERIC,length:U.length},{data:U.data,mode:e.BYTE,length:U.length}]);break;case e.ALPHANUMERIC:q.push([U,{data:U.data,mode:e.BYTE,length:U.length}]);break;case e.KANJI:q.push([U,{data:U.data,mode:e.BYTE,length:p(U.data)}]);break;case e.BYTE:q.push([{data:U.data,mode:e.BYTE,length:p(U.data)}])}}return q}function B(Y,q){const V={},U={start:{}};let z=["start"];for(let K=0;K<Y.length;K++){const A=Y[K],j=[];for(let ee=0;ee<A.length;ee++){const re=A[ee],k=""+K+ee;j.push(k),V[k]={node:re,lastCount:0},U[k]={};for(let w=0;w<z.length;w++){const f=z[w];V[f]&&V[f].node.mode===re.mode?(U[f][k]=C(V[f].lastCount+re.length,re.mode)-C(V[f].lastCount,re.mode),V[f].lastCount+=re.length):(V[f]&&(V[f].lastCount=re.length),U[f][k]=C(re.length,re.mode)+4+e.getCharCountIndicator(re.mode,q))}}z=j}for(let K=0;K<z.length;K++)U[z[K]].end=0;return{map:U,table:V}}function W(Y,q){let V;const U=e.getBestModeForData(Y);if(V=e.from(q,U),V!==e.BYTE&&V.bit<U.bit)throw new Error('"'+Y+'" cannot be encoded with mode '+e.toString(V)+`.
|
|
118
|
+
Suggested mode is: `+e.toString(U));switch(V===e.KANJI&&!u.isKanjiModeEnabled()&&(V=e.BYTE),V){case e.NUMERIC:return new r(Y);case e.ALPHANUMERIC:return new i(Y);case e.KANJI:return new s(Y);case e.BYTE:return new n(Y)}}t.fromArray=function(q){return q.reduce(function(V,U){return typeof U=="string"?V.push(W(U,null)):U.data&&V.push(W(U.data,U.mode)),V},[])},t.fromString=function(q,V){const U=_(q,u.isKanjiModeEnabled()),z=M(U),K=B(z,V),A=d.find_path(K.map,"start","end"),j=[];for(let ee=1;ee<A.length-1;ee++)j.push(K.table[A[ee]].node);return t.fromArray(I(j))},t.rawSplit=function(q){return t.fromArray(_(q,u.isKanjiModeEnabled()))}}(Z5);const Yh=qi,J1=zh,QL=PL,ZL=OL,XL=j5,eB=q5,Q1=H5,Z1=Hh,tB=NL,Jh=V5,rB=Y5,iB=lo,X1=Z5;function nB(t,e){const r=t.size,i=eB.getPositions(e);for(let n=0;n<i.length;n++){const s=i[n][0],a=i[n][1];for(let u=-1;u<=7;u++)if(!(s+u<=-1||r<=s+u))for(let d=-1;d<=7;d++)a+d<=-1||r<=a+d||(u>=0&&u<=6&&(d===0||d===6)||d>=0&&d<=6&&(u===0||u===6)||u>=2&&u<=4&&d>=2&&d<=4?t.set(s+u,a+d,!0,!0):t.set(s+u,a+d,!1,!0))}}function sB(t){const e=t.size;for(let r=8;r<e-8;r++){const i=r%2===0;t.set(r,6,i,!0),t.set(6,r,i,!0)}}function oB(t,e){const r=XL.getPositions(e);for(let i=0;i<r.length;i++){const n=r[i][0],s=r[i][1];for(let a=-2;a<=2;a++)for(let u=-2;u<=2;u++)a===-2||a===2||u===-2||u===2||a===0&&u===0?t.set(n+a,s+u,!0,!0):t.set(n+a,s+u,!1,!0)}}function aB(t,e){const r=t.size,i=Jh.getEncodedBits(e);let n,s,a;for(let u=0;u<18;u++)n=Math.floor(u/3),s=u%3+r-8-3,a=(i>>u&1)===1,t.set(n,s,a,!0),t.set(s,n,a,!0)}function ep(t,e,r){const i=t.size,n=rB.getEncodedBits(e,r);let s,a;for(s=0;s<15;s++)a=(n>>s&1)===1,s<6?t.set(s,8,a,!0):s<8?t.set(s+1,8,a,!0):t.set(i-15+s,8,a,!0),s<8?t.set(8,i-s-1,a,!0):s<9?t.set(8,15-s-1+1,a,!0):t.set(8,15-s-1,a,!0);t.set(i-8,8,1,!0)}function cB(t,e){const r=t.size;let i=-1,n=r-1,s=7,a=0;for(let u=r-1;u>0;u-=2)for(u===6&&u--;;){for(let d=0;d<2;d++)if(!t.isReserved(n,u-d)){let p=!1;a<e.length&&(p=(e[a]>>>s&1)===1),t.set(n,u-d,p),s--,s===-1&&(a++,s=7)}if(n+=i,n<0||r<=n){n-=i,i=-i;break}}}function uB(t,e,r){const i=new QL;r.forEach(function(d){i.put(d.mode.bit,4),i.put(d.getLength(),iB.getCharCountIndicator(d.mode,t)),d.write(i)});const n=Yh.getSymbolTotalCodewords(t),s=Z1.getTotalCodewordsCount(t,e),a=(n-s)*8;for(i.getLengthInBits()+4<=a&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const u=(a-i.getLengthInBits())/8;for(let d=0;d<u;d++)i.put(d%2?17:236,8);return fB(i,t,e)}function fB(t,e,r){const i=Yh.getSymbolTotalCodewords(e),n=Z1.getTotalCodewordsCount(e,r),s=i-n,a=Z1.getBlocksCount(e,r),u=i%a,d=a-u,p=Math.floor(i/a),y=Math.floor(s/a),_=y+1,C=p-y,I=new tB(C);let M=0;const B=new Array(a),W=new Array(a);let Y=0;const q=new Uint8Array(t.buffer);for(let A=0;A<a;A++){const j=A<d?y:_;B[A]=q.slice(M,M+j),W[A]=I.encode(B[A]),M+=j,Y=Math.max(Y,j)}const V=new Uint8Array(i);let U=0,z,K;for(z=0;z<Y;z++)for(K=0;K<a;K++)z<B[K].length&&(V[U++]=B[K][z]);for(z=0;z<C;z++)for(K=0;K<a;K++)V[U++]=W[K][z];return V}function hB(t,e,r,i){let n;if(Array.isArray(t))n=X1.fromArray(t);else if(typeof t=="string"){let p=e;if(!p){const y=X1.rawSplit(t);p=Jh.getBestVersionForData(y,r)}n=X1.fromString(t,p||40)}else throw new Error("Invalid data");const s=Jh.getBestVersionForData(n,r);if(!s)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=s;else if(e<s)throw new Error(`
|
|
119
119
|
The chosen QR Code version cannot contain this amount of data.
|
|
120
|
-
Minimum version required to store current data is: `+
|
|
121
|
-
`);const
|
|
122
|
-
`;return typeof n=="function"&&n(null,E),E};const xP=UO,ad=S2,H2=k2,IP=q2;function cd(e,t,r,n,i){const o=[].slice.call(arguments,1),c=o.length,l=typeof o[c-1]=="function";if(!l&&!xP())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=t,t=n=void 0):c===3&&(t.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=t,t=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(r=t,t=n=void 0):c===2&&!t.getContext&&(n=r,r=t,t=void 0),new Promise(function(f,h){try{const g=ad.create(r,n);f(e(g,t,n))}catch(g){h(g)}})}try{const f=ad.create(r,n);i(null,e(f,t,n))}catch(f){i(f)}}Mc.create=ad.create,Mc.toCanvas=cd.bind(null,H2.render),Mc.toDataURL=cd.bind(null,H2.renderToDataURL),Mc.toString=cd.bind(null,function(e,t,r){return IP.render(e,r)});var SP=Object.defineProperty,K2=Object.getOwnPropertySymbols,CP=Object.prototype.hasOwnProperty,DP=Object.prototype.propertyIsEnumerable,W2=(e,t,r)=>t in e?SP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ld=(e,t)=>{for(var r in t||(t={}))CP.call(t,r)&&W2(e,r,t[r]);if(K2)for(var r of K2(t))DP.call(t,r)&&W2(e,r,t[r]);return e};function OP(){var e;const t=(e=ms.state.themeMode)!=null?e:"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)"}}[t];return{"--wcm-color-fg-1":r.foreground[1],"--wcm-color-fg-2":r.foreground[2],"--wcm-color-fg-3":r.foreground[3],"--wcm-color-bg-1":r.background[1],"--wcm-color-bg-2":r.background[2],"--wcm-color-bg-3":r.background[3],"--wcm-color-overlay":r.overlay}}function V2(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const xe={getPreset(e){return V2()[e]},setTheme(){const e=document.querySelector(":root"),{themeVariables:t}=ms.state;if(e){const r=ld(ld(ld({},OP()),V2()),t);Object.entries(r).forEach(([n,i])=>e.style.setProperty(n,i))}},globalCss:$e`*,::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 wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},PP=$e`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var MP=Object.defineProperty,$P=Object.getOwnPropertyDescriptor,ma=(e,t,r,n)=>{for(var i=n>1?void 0:n?$P(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&MP(t,r,i),i};let Es=class extends me{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const e={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let t="inverse";return this.variant==="ghost"&&(t="secondary"),this.variant==="outline"&&(t="accent"),vt`<button class="${Gi(e)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wcm-text variant="small-regular" color="${t}"><slot></slot></wcm-text>${this.iconRight}</button>`}};Es.styles=[xe.globalCss,PP],ma([he({type:Boolean})],Es.prototype,"disabled",2),ma([he()],Es.prototype,"iconLeft",2),ma([he()],Es.prototype,"iconRight",2),ma([he()],Es.prototype,"onClick",2),ma([he()],Es.prototype,"variant",2),Es=ma([De("wcm-button")],Es);const NP=$e`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-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(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var TP=Object.defineProperty,RP=Object.getOwnPropertyDescriptor,ud=(e,t,r,n)=>{for(var i=n>1?void 0:n?RP(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&TP(t,r,i),i};let Rc=class extends me{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const e={"wcm-secondary":this.variant==="secondary"};return vt`<button ?disabled="${this.disabled}" class="${Gi(e)}"><slot></slot></button>`}};Rc.styles=[xe.globalCss,NP],ud([he({type:Boolean})],Rc.prototype,"disabled",2),ud([he()],Rc.prototype,"variant",2),Rc=ud([De("wcm-button-big")],Rc);const LP=$e`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var BP=Object.defineProperty,UP=Object.getOwnPropertyDescriptor,FP=(e,t,r,n)=>{for(var i=n>1?void 0:n?UP(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&BP(t,r,i),i};let hd=class extends me{render(){return vt`<div><slot></slot></div>`}};hd.styles=[xe.globalCss,LP],hd=FP([De("wcm-info-footer")],hd);const Te={CROSS_ICON:ar`<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:ar`<svg width="178" height="29" viewBox="0 0 178 29" id="wcm-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:ar`<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:ar`<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:ar`<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:ar`<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:ar`<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:ar`<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:ar`<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:ar`<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:ar`<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:ar`<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:ar`<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:ar`<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:ar`<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>`,SEARCH_ICON:ar`<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>`,WALLET_PLACEHOLDER:ar`<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>`,GLOBE_ICON:ar`<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>`},jP=$e`.wcm-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(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var kP=Object.defineProperty,qP=Object.getOwnPropertyDescriptor,zP=(e,t,r,n)=>{for(var i=n>1?void 0:n?qP(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&kP(t,r,i),i};let fd=class extends me{render(){return vt`<div class="wcm-toolbar-placeholder"></div><div class="wcm-toolbar">${Te.WALLET_CONNECT_LOGO} <button @click="${eo.close}">${Te.CROSS_ICON}</button></div>`}};fd.styles=[xe.globalCss,jP],fd=zP([De("wcm-modal-backcard")],fd);const HP=$e`main{padding:20px;padding-top:0;width:100%}`;var KP=Object.defineProperty,WP=Object.getOwnPropertyDescriptor,VP=(e,t,r,n)=>{for(var i=n>1?void 0:n?WP(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&KP(t,r,i),i};let dd=class extends me{render(){return vt`<main><slot></slot></main>`}};dd.styles=[xe.globalCss,HP],dd=VP([De("wcm-modal-content")],dd);const GP=$e`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var YP=Object.defineProperty,QP=Object.getOwnPropertyDescriptor,JP=(e,t,r,n)=>{for(var i=n>1?void 0:n?QP(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&YP(t,r,i),i};let pd=class extends me{render(){return vt`<footer><slot></slot></footer>`}};pd.styles=[xe.globalCss,GP],pd=JP([De("wcm-modal-footer")],pd);const ZP=$e`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var XP=Object.defineProperty,tM=Object.getOwnPropertyDescriptor,Lc=(e,t,r,n)=>{for(var i=n>1?void 0:n?tM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&XP(t,r,i),i};let lo=class extends me{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return vt`<button class="wcm-back-btn" @click="${rr.goBack}">${Te.BACK_ICON}</button>`}actionBtnTemplate(){return vt`<button class="wcm-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const e={"wcm-border":this.border},t=rr.state.history.length>1,r=this.title?vt`<wcm-text variant="big-bold">${this.title}</wcm-text>`:vt`<slot></slot>`;return vt`<header class="${Gi(e)}">${t?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};lo.styles=[xe.globalCss,ZP],Lc([he()],lo.prototype,"title",2),Lc([he()],lo.prototype,"onAction",2),Lc([he()],lo.prototype,"actionIcon",2),Lc([he({type:Boolean})],lo.prototype,"border",2),lo=Lc([De("wcm-modal-header")],lo);const ne={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(e,t){const r=e.renderRoot.querySelector(t);if(!r)throw new Error(`${t} not found`);return r},getWalletIcon({id:e,image_id:t}){const{walletImages:r}=wn.state;return r!=null&&r[e]?r[e]:t?an.getWalletImageUrl(t):""},getWalletName(e,t=!1){return t&&e.length>8?`${e.substring(0,8)}..`:e},isMobileAnimation(){return window.innerWidth<=ne.MOBILE_BREAKPOINT},async preloadImage(e){const t=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.crossOrigin="anonymous",i.src=e});return Promise.race([t,Ut.wait(3e3)])},getErrorMessage(e){return e instanceof Error?e.message:"Unknown Error"},debounce(e,t=500){let r;return(...n)=>{function i(){e(...n)}r&&clearTimeout(r),r=setTimeout(i,t)}},handleMobileLinking(e){const{walletConnectUri:t}=hr.state,{mobile:r,name:n}=e,i=r?.native,o=r?.universal;ne.setRecentWallet(e);function c(l){let f="";i?f=Ut.formatUniversalUrl(i,l,n):o&&(f=Ut.formatNativeUrl(o,l,n)),Ut.openHref(f,"_self")}t&&c(t)},handleAndroidLinking(){const{walletConnectUri:e}=hr.state;e&&(Ut.setWalletConnectAndroidDeepLink(e),Ut.openHref(e,"_self"))},async handleUriCopy(){const{walletConnectUri:e}=hr.state;if(e)try{await navigator.clipboard.writeText(e),vs.openToast("Link copied","success")}catch{vs.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:e}=wn.state,t=Object.values(e??{});return Object.values(t)},truncate(e,t=8){return e.length<=t?e:`${e.substring(0,4)}...${e.substring(e.length-4)}`},setRecentWallet(e){try{localStorage.setItem(ne.WCM_RECENT_WALLET_DATA,JSON.stringify(e))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const e=localStorage.getItem(ne.WCM_RECENT_WALLET_DATA);return e?JSON.parse(e):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(e,t){return e.toUpperCase().includes(t.toUpperCase())},openWalletExplorerUrl(){Ut.openHref(ne.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:e,mobile:t}=Ut.getWalletRouterData(),r=!!e?.native,n=!!e?.universal,i=!!t?.native||!!t?.universal;return{isDesktop:r,isMobile:i,isWeb:n}},goToConnectingView(e){rr.setData({Wallet:e});const t=Ut.isMobile(),{isDesktop:r,isWeb:n,isMobile:i}=ne.getCachedRouterWalletPlatforms();t?i?rr.push("MobileConnecting"):n?rr.push("WebConnecting"):rr.push("InstallWallet"):r?rr.push("DesktopConnecting"):n?rr.push("WebConnecting"):i?rr.push("MobileQrcodeConnecting"):rr.push("InstallWallet")}},eM=$e`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var rM=Object.defineProperty,nM=Object.getOwnPropertyDescriptor,gd=(e,t,r,n)=>{for(var i=n>1?void 0:n?nM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&rM(t,r,i),i};let Bc=class extends me{constructor(){super(),this.view=rr.state.view,this.prevView=rr.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=rr.subscribe(e=>{this.view!==e.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([e])=>{const t=`${e.contentRect.height}px`;this.oldHeight!=="0px"&&co(this.routerEl,{height:[this.oldHeight,t]},{duration:.2}),this.oldHeight=t}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var e,t;(e=this.unsubscribe)==null||e.call(this),(t=this.resizeObserver)==null||t.disconnect()}get routerEl(){return ne.getShadowRootElement(this,".wcm-router")}get contentEl(){return ne.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return vt`<wcm-connect-wallet-view></wcm-connect-wallet-view>`;case"DesktopConnecting":return vt`<wcm-desktop-connecting-view></wcm-desktop-connecting-view>`;case"MobileConnecting":return vt`<wcm-mobile-connecting-view></wcm-mobile-connecting-view>`;case"WebConnecting":return vt`<wcm-web-connecting-view></wcm-web-connecting-view>`;case"MobileQrcodeConnecting":return vt`<wcm-mobile-qr-connecting-view></wcm-mobile-qr-connecting-view>`;case"WalletExplorer":return vt`<wcm-wallet-explorer-view></wcm-wallet-explorer-view>`;case"Qrcode":return vt`<wcm-qrcode-view></wcm-qrcode-view>`;case"InstallWallet":return vt`<wcm-install-wallet-view></wcm-install-wallet-view>`;default:return vt`<div>Not Found</div>`}}async onChangeRoute(){await co(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=rr.state.view,co(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return vt`<div class="wcm-router"><div class="wcm-content">${this.viewTemplate()}</div></div>`}};Bc.styles=[xe.globalCss,eM],gd([cn()],Bc.prototype,"view",2),gd([cn()],Bc.prototype,"prevView",2),Bc=gd([De("wcm-modal-router")],Bc);const iM=$e`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(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var sM=Object.defineProperty,oM=Object.getOwnPropertyDescriptor,G2=(e,t,r,n)=>{for(var i=n>1?void 0:n?oM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&sM(t,r,i),i};let Iu=class extends me{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=vs.subscribe(e=>{e.open?(this.open=!0,this.timeout=setTimeout(()=>vs.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var e;(e=this.unsubscribe)==null||e.call(this),clearTimeout(this.timeout),vs.closeToast()}render(){const{message:e,variant:t}=vs.state,r={"wcm-success":t==="success","wcm-error":t==="error"};return this.open?vt`<div class="${Gi(r)}">${t==="success"?Te.CHECKMARK_ICON:null} ${t==="error"?Te.CROSS_ICON:null}<wcm-text variant="small-regular">${e}</wcm-text></div>`:null}};Iu.styles=[xe.globalCss,iM],G2([cn()],Iu.prototype,"open",2),Iu=G2([De("wcm-modal-toast")],Iu);const aM=.1,Y2=2.5,Yi=7;function md(e,t,r){return e===t?!1:(e-t<0?t-e:e-t)<=r+aM}function cM(e,t){const r=Array.prototype.slice.call(Mc.create(e,{errorCorrectionLevel:t}).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 lM={generate(e,t,r){const n="#141414",i="#ffffff",o=[],c=cM(e,"Q"),l=t/c.length,f=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];f.forEach(({x:I,y:F})=>{const W=(c.length-Yi)*l*I,Y=(c.length-Yi)*l*F,B=.45;for(let z=0;z<f.length;z+=1){const P=l*(Yi-z*2);o.push(ar`<rect fill="${z%2===0?n:i}" height="${P}" rx="${P*B}" ry="${P*B}" width="${P}" x="${W+l*z}" y="${Y+l*z}">`)}});const h=Math.floor((r+25)/l),g=c.length/2-h/2,_=c.length/2+h/2-1,E=[];c.forEach((I,F)=>{I.forEach((W,Y)=>{if(c[F][Y]&&!(F<Yi&&Y<Yi||F>c.length-(Yi+1)&&Y<Yi||F<Yi&&Y>c.length-(Yi+1))&&!(F>g&&F<_&&Y>g&&Y<_)){const B=F*l+l/2,z=Y*l+l/2;E.push([B,z])}})});const x={};return E.forEach(([I,F])=>{x[I]?x[I].push(F):x[I]=[F]}),Object.entries(x).map(([I,F])=>{const W=F.filter(Y=>F.every(B=>!md(Y,B,l)));return[Number(I),W]}).forEach(([I,F])=>{F.forEach(W=>{o.push(ar`<circle cx="${I}" cy="${W}" fill="${n}" r="${l/Y2}">`)})}),Object.entries(x).filter(([I,F])=>F.length>1).map(([I,F])=>{const W=F.filter(Y=>F.some(B=>md(Y,B,l)));return[Number(I),W]}).map(([I,F])=>{F.sort((Y,B)=>Y<B?-1:1);const W=[];for(const Y of F){const B=W.find(z=>z.some(P=>md(Y,P,l)));B?B.push(Y):W.push([Y])}return[I,W.map(Y=>[Y[0],Y[Y.length-1]])]}).forEach(([I,F])=>{F.forEach(([W,Y])=>{o.push(ar`<line x1="${I}" x2="${I}" y1="${W}" y2="${Y}" stroke="${n}" stroke-width="${l/(Y2/2)}" stroke-linecap="round">`)})}),o}},uM=$e`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var hM=Object.defineProperty,fM=Object.getOwnPropertyDescriptor,va=(e,t,r,n)=>{for(var i=n>1?void 0:n?fM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&hM(t,r,i),i};let Qi=class extends me{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const e=ms.state.themeMode==="light"?this.size:this.size-36;return ar`<svg height="${e}" width="${e}">${lM.generate(this.uri,e,e/4)}</svg>`}render(){const e={"wcm-dark":ms.state.themeMode==="dark"};return vt`<div style="${`width: ${this.size}px`}" class="${Gi(e)}">${this.walletId||this.imageUrl?vt`<wcm-wallet-image walletId="${Wr(this.walletId)}" imageId="${Wr(this.imageId)}" imageUrl="${Wr(this.imageUrl)}"></wcm-wallet-image>`:Te.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Qi.styles=[xe.globalCss,uM],va([he()],Qi.prototype,"uri",2),va([he({type:Number})],Qi.prototype,"size",2),va([he()],Qi.prototype,"imageId",2),va([he()],Qi.prototype,"walletId",2),va([he()],Qi.prototype,"imageUrl",2),Qi=va([De("wcm-qrcode")],Qi);const dM=$e`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-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(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-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(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var pM=Object.defineProperty,gM=Object.getOwnPropertyDescriptor,Q2=(e,t,r,n)=>{for(var i=n>1?void 0:n?gM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&pM(t,r,i),i};let Su=class extends me{constructor(){super(...arguments),this.onChange=()=>null}render(){return vt`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Te.SEARCH_ICON}`}};Su.styles=[xe.globalCss,dM],Q2([he()],Su.prototype,"onChange",2),Su=Q2([De("wcm-search-input")],Su);const mM=$e`@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(--wcm-accent-color)}`;var vM=Object.defineProperty,wM=Object.getOwnPropertyDescriptor,yM=(e,t,r,n)=>{for(var i=n>1?void 0:n?wM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&vM(t,r,i),i};let vd=class extends me{render(){return vt`<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>`}};vd.styles=[xe.globalCss,mM],vd=yM([De("wcm-spinner")],vd);const bM=$e`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var _M=Object.defineProperty,EM=Object.getOwnPropertyDescriptor,wd=(e,t,r,n)=>{for(var i=n>1?void 0:n?EM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&_M(t,r,i),i};let Uc=class extends me{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const e={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return vt`<span><slot class="${Gi(e)}"></slot></span>`}};Uc.styles=[xe.globalCss,bM],wd([he()],Uc.prototype,"variant",2),wd([he()],Uc.prototype,"color",2),Uc=wd([De("wcm-text")],Uc);const AM=$e`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var xM=Object.defineProperty,IM=Object.getOwnPropertyDescriptor,As=(e,t,r,n)=>{for(var i=n>1?void 0:n?IM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&xM(t,r,i),i};let Oi=class extends me{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?vt`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wcm-text>`:this.installed?vt`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wcm-text>`:null}handleClick(){Nw.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var e;return vt`<button @click="${this.handleClick.bind(this)}"><div><wcm-wallet-image walletId="${this.walletId}" imageId="${Wr(this.imageId)}"></wcm-wallet-image><wcm-text variant="xsmall-regular">${(e=this.label)!=null?e:ne.getWalletName(this.name,!0)}</wcm-text>${this.sublabelTemplate()}</div></button>`}};Oi.styles=[xe.globalCss,AM],As([he()],Oi.prototype,"onClick",2),As([he()],Oi.prototype,"name",2),As([he()],Oi.prototype,"walletId",2),As([he()],Oi.prototype,"label",2),As([he()],Oi.prototype,"imageId",2),As([he({type:Boolean})],Oi.prototype,"installed",2),As([he({type:Boolean})],Oi.prototype,"recent",2),Oi=As([De("wcm-wallet-button")],Oi);const SM=$e`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-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(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var CM=Object.defineProperty,DM=Object.getOwnPropertyDescriptor,Cu=(e,t,r,n)=>{for(var i=n>1?void 0:n?DM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&CM(t,r,i),i};let wa=class extends me{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var e;const t=(e=this.imageUrl)!=null&&e.length?this.imageUrl:ne.getWalletIcon({id:this.walletId,image_id:this.imageId});return vt`${t.length?vt`<div><img crossorigin="anonymous" src="${t}" alt="${this.id}"></div>`:Te.WALLET_PLACEHOLDER}`}};wa.styles=[xe.globalCss,SM],Cu([he()],wa.prototype,"walletId",2),Cu([he()],wa.prototype,"imageId",2),Cu([he()],wa.prototype,"imageUrl",2),wa=Cu([De("wcm-wallet-image")],wa);var OM=Object.defineProperty,PM=Object.getOwnPropertyDescriptor,J2=(e,t,r,n)=>{for(var i=n>1?void 0:n?PM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&OM(t,r,i),i};let yd=class extends me{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(e){try{e!=null&&e.length&&await Promise.all(e.map(async t=>ne.preloadImage(t)))}catch{console.info("Unsuccessful attempt at preloading some images",e)}}async preloadListings(){if(wn.state.enableExplorer){await an.getRecomendedWallets(),hr.setIsDataLoaded(!0);const{recomendedWallets:e}=an.state,t=e.map(r=>ne.getWalletIcon(r));await this.loadImages(t)}else hr.setIsDataLoaded(!0)}async preloadCustomImages(){const e=ne.getCustomImageUrls();await this.loadImages(e)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(e){console.error(e),vs.openToast("Failed preloading","error")}}};J2([cn()],yd.prototype,"preload",2),yd=J2([De("wcm-explorer-context")],yd);var MM=Object.defineProperty,$M=Object.getOwnPropertyDescriptor,NM=(e,t,r,n)=>{for(var i=n>1?void 0:n?$M(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&MM(t,r,i),i};let Z2=class extends me{constructor(){super(),this.unsubscribeTheme=void 0,xe.setTheme(),this.unsubscribeTheme=ms.subscribe(xe.setTheme)}disconnectedCallback(){var e;(e=this.unsubscribeTheme)==null||e.call(this)}};Z2=NM([De("wcm-theme-context")],Z2);const TM=$e`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var RM=Object.defineProperty,LM=Object.getOwnPropertyDescriptor,BM=(e,t,r,n)=>{for(var i=n>1?void 0:n?LM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&RM(t,r,i),i};let bd=class extends me{onGoToQrcode(){rr.push("Qrcode")}render(){const{recomendedWallets:e}=an.state,t=[...e,...e],r=Ut.RECOMMENDED_WALLET_AMOUNT*2;return vt`<wcm-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Te.QRCODE_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-title">${Te.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">WalletConnect</wcm-text></div><div class="wcm-slider"><div class="wcm-track">${[...Array(r)].map((n,i)=>{const o=t[i%t.length];return o?vt`<wcm-wallet-image walletId="${o.id}" imageId="${o.image_id}"></wcm-wallet-image>`:Te.WALLET_PLACEHOLDER})}</div><wcm-button-big @click="${ne.handleAndroidLinking}"><wcm-text variant="medium-regular" color="inverse">Select Wallet</wcm-text></wcm-button-big></div></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wcm-text></wcm-info-footer>`}};bd.styles=[xe.globalCss,TM],bd=BM([De("wcm-android-wallet-selection")],bd);const UM=$e`@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(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var FM=Object.defineProperty,jM=Object.getOwnPropertyDescriptor,ya=(e,t,r,n)=>{for(var i=n>1?void 0:n?jM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&FM(t,r,i),i};let xs=class extends me{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var e,t;const r=(t=(e=ms.state.themeVariables)==null?void 0:e["--wcm-wallet-icon-large-border-radius"])!=null?t:xe.getPreset("--wcm-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 vt`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wcm-loader" x="2" y="2" width="106" height="106" rx="${n}"/><use xlink:href="#wcm-loader" stroke-dasharray="106 ${i}" stroke-dashoffset="${o}"></use></svg>`}render(){const e={"wcm-error":this.isError,"wcm-stale":this.isStale};return vt`<div class="${Gi(e)}">${this.svgLoaderTemplate()}<wcm-wallet-image walletId="${Wr(this.walletId)}" imageId="${Wr(this.imageId)}"></wcm-wallet-image></div><wcm-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</wcm-text>`}};xs.styles=[xe.globalCss,UM],ya([he()],xs.prototype,"walletId",2),ya([he()],xs.prototype,"imageId",2),ya([he({type:Boolean})],xs.prototype,"isError",2),ya([he({type:Boolean})],xs.prototype,"isStale",2),ya([he()],xs.prototype,"label",2),xs=ya([De("wcm-connector-waiting")],xs);const ba={manualWallets(){var e,t;const{mobileWallets:r,desktopWallets:n}=wn.state,i=(e=ba.recentWallet())==null?void 0:e.id,o=Ut.isMobile()?r:n,c=o?.filter(l=>i!==l.id);return(t=Ut.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?t:[]},recentWallet(){return ne.getRecentWallet()},recomendedWallets(e=!1){var t;const r=e||(t=ba.recentWallet())==null?void 0:t.id,{recomendedWallets:n}=an.state;return n.filter(i=>r!==i.id)}},Is={onConnecting(e){ne.goToConnectingView(e)},manualWalletsTemplate(){return ba.manualWallets().map(e=>vt`<wcm-wallet-button walletId="${e.id}" name="${e.name}" .onClick="${()=>this.onConnecting(e)}"></wcm-wallet-button>`)},recomendedWalletsTemplate(e=!1){return ba.recomendedWallets(e).map(t=>vt`<wcm-wallet-button name="${t.name}" walletId="${t.id}" imageId="${t.image_id}" .onClick="${()=>this.onConnecting(t)}"></wcm-wallet-button>`)},recentWalletTemplate(){const e=ba.recentWallet();if(e)return vt`<wcm-wallet-button name="${e.name}" walletId="${e.id}" imageId="${Wr(e.image_id)}" .recent="${!0}" .onClick="${()=>this.onConnecting(e)}"></wcm-wallet-button>`}},kM=$e`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var qM=Object.defineProperty,zM=Object.getOwnPropertyDescriptor,HM=(e,t,r,n)=>{for(var i=n>1?void 0:n?zM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&qM(t,r,i),i};let _d=class extends me{render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=wn.state,r=e!=="ALL"&&t,n=Is.manualWalletsTemplate(),i=Is.recomendedWalletsTemplate();let o=[Is.recentWalletTemplate(),...n,...i];o=o.filter(Boolean);const c=o.length>4||r;let l=[];c?l=o.slice(0,3):l=o;const f=!!l.length;return vt`<wcm-modal-header .border="${!0}" title="Connect your wallet" .onAction="${ne.handleUriCopy}" .actionIcon="${Te.COPY_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-mobile-title"><div class="wcm-subtitle">${Te.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">Mobile</wcm-text></div><div class="wcm-subtitle">${Te.SCAN_ICON}<wcm-text variant="small-regular" color="secondary">Scan with your wallet</wcm-text></div></div><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>${f?vt`<wcm-modal-footer><div class="wcm-desktop-title">${Te.DESKTOP_ICON}<wcm-text variant="small-regular" color="accent">Desktop</wcm-text></div><div class="wcm-grid">${l} ${c?vt`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-footer>`:null}`}};_d.styles=[xe.globalCss,kM],_d=HM([De("wcm-desktop-wallet-selection")],_d);const KM=$e`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-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 WM=Object.defineProperty,VM=Object.getOwnPropertyDescriptor,GM=(e,t,r,n)=>{for(var i=n>1?void 0:n?VM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&WM(t,r,i),i};let Ed=class extends me{render(){const{termsOfServiceUrl:e,privacyPolicyUrl:t}=wn.state;return e??t?vt`<div><wcm-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${e?vt`<a href="${e}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${e&&t?"and":null} ${t?vt`<a href="${t}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</wcm-text></div>`:null}};Ed.styles=[xe.globalCss,KM],Ed=GM([De("wcm-legal-notice")],Ed);const YM=$e`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var QM=Object.defineProperty,JM=Object.getOwnPropertyDescriptor,ZM=(e,t,r,n)=>{for(var i=n>1?void 0:n?JM(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&QM(t,r,i),i};let Ad=class extends me{onQrcode(){rr.push("Qrcode")}render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=wn.state,r=e!=="ALL"&&t,n=Is.manualWalletsTemplate(),i=Is.recomendedWalletsTemplate();let o=[Is.recentWalletTemplate(),...n,...i];o=o.filter(Boolean);const c=o.length>8||r;let l=[];c?l=o.slice(0,7):l=o;const f=!!l.length;return vt`<wcm-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Te.QRCODE_ICON}"></wcm-modal-header>${f?vt`<wcm-modal-content><div>${l} ${c?vt`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-content>`:null}`}};Ad.styles=[xe.globalCss,YM],Ad=ZM([De("wcm-mobile-wallet-selection")],Ad);const XM=$e`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-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(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var t$=Object.defineProperty,e$=Object.getOwnPropertyDescriptor,xd=(e,t,r,n)=>{for(var i=n>1?void 0:n?e$(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&t$(t,r,i),i};let _a=class extends me{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=eo.subscribe(e=>{e.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var e;(e=this.unsubscribeModal)==null||e.call(this)}get overlayEl(){return ne.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return ne.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(e){document.querySelector("body")&&(e?document.getElementById("wcm-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="wcm-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(e){e.target===e.currentTarget&&eo.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const e=ne.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},t=.1,r=.2;await Promise.all([co(this.overlayEl,{opacity:[0,1]},{delay:t,duration:r}).finished,co(this.containerEl,e,{delay:t,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const e=ne.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},t=.2;await Promise.all([co(this.overlayEl,{opacity:[1,0]},{duration:t}).finished,co(this.containerEl,e,{duration:t}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",e=>{var t;e.key==="Escape"?eo.close():e.key==="Tab"&&((t=e.target)!=null&&t.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0}render(){const e={"wcm-overlay":!0,"wcm-active":this.active};return vt`<wcm-explorer-context></wcm-explorer-context><wcm-theme-context></wcm-theme-context><div id="wcm-modal" class="${Gi(e)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wcm-container" tabindex="0">${this.open?vt`<wcm-modal-backcard></wcm-modal-backcard><div class="wcm-card"><wcm-modal-router></wcm-modal-router><wcm-modal-toast></wcm-modal-toast></div>`:null}</div></div>`}};_a.styles=[xe.globalCss,XM],xd([cn()],_a.prototype,"open",2),xd([cn()],_a.prototype,"active",2),_a=xd([De("wcm-modal")],_a);const r$=$e`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var n$=Object.defineProperty,i$=Object.getOwnPropertyDescriptor,Fc=(e,t,r,n)=>{for(var i=n>1?void 0:n?i$(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&n$(t,r,i),i};let uo=class extends me{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){Ut.isMobile()?rr.replace("MobileConnecting"):rr.replace("MobileQrcodeConnecting")}onDesktop(){rr.replace("DesktopConnecting")}onWeb(){rr.replace("WebConnecting")}render(){return vt`<div>${this.isRetry?vt`<slot></slot>`:null} ${this.isMobile?vt`<wcm-button .onClick="${this.onMobile}" .iconLeft="${Te.MOBILE_ICON}" variant="outline">Mobile</wcm-button>`:null} ${this.isDesktop?vt`<wcm-button .onClick="${this.onDesktop}" .iconLeft="${Te.DESKTOP_ICON}" variant="outline">Desktop</wcm-button>`:null} ${this.isWeb?vt`<wcm-button .onClick="${this.onWeb}" .iconLeft="${Te.GLOBE_ICON}" variant="outline">Web</wcm-button>`:null}</div>`}};uo.styles=[xe.globalCss,r$],Fc([he({type:Boolean})],uo.prototype,"isMobile",2),Fc([he({type:Boolean})],uo.prototype,"isDesktop",2),Fc([he({type:Boolean})],uo.prototype,"isWeb",2),Fc([he({type:Boolean})],uo.prototype,"isRetry",2),uo=Fc([De("wcm-platform-selection")],uo);const s$=$e`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var o$=Object.defineProperty,a$=Object.getOwnPropertyDescriptor,c$=(e,t,r,n)=>{for(var i=n>1?void 0:n?a$(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&o$(t,r,i),i};let Id=class extends me{onClick(){rr.push("WalletExplorer")}render(){const{recomendedWallets:e}=an.state,t=ba.manualWallets(),r=[...e,...t].reverse().slice(0,4);return vt`<button @click="${this.onClick}"><div class="wcm-icons">${r.map(n=>{const i=ne.getWalletIcon(n);if(i)return vt`<img crossorigin="anonymous" src="${i}">`;const o=ne.getWalletIcon({id:n.id});return o?vt`<img crossorigin="anonymous" src="${o}">`:Te.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>Te.WALLET_PLACEHOLDER)}</div><wcm-text variant="xsmall-regular">View All</wcm-text></button>`}};Id.styles=[xe.globalCss,s$],Id=c$([De("wcm-view-all-wallets-button")],Id);const l$=$e`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var u$=Object.defineProperty,h$=Object.getOwnPropertyDescriptor,Du=(e,t,r,n)=>{for(var i=n>1?void 0:n?h$(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&u$(t,r,i),i};let Ea=class extends me{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:e}=hr.state;this.uri=e},0)}get overlayEl(){return ne.getShadowRootElement(this,".wcm-qr-container")}render(){return vt`<div class="wcm-qr-container">${this.uri?vt`<wcm-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${Wr(this.walletId)}" imageId="${Wr(this.imageId)}"></wcm-qrcode>`:vt`<wcm-spinner></wcm-spinner>`}</div>`}};Ea.styles=[xe.globalCss,l$],Du([he()],Ea.prototype,"walletId",2),Du([he()],Ea.prototype,"imageId",2),Du([cn()],Ea.prototype,"uri",2),Ea=Du([De("wcm-walletconnect-qr")],Ea);var f$=Object.defineProperty,d$=Object.getOwnPropertyDescriptor,p$=(e,t,r,n)=>{for(var i=n>1?void 0:n?d$(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&f$(t,r,i),i};let Sd=class extends me{viewTemplate(){return Ut.isAndroid()?vt`<wcm-android-wallet-selection></wcm-android-wallet-selection>`:Ut.isMobile()?vt`<wcm-mobile-wallet-selection></wcm-mobile-wallet-selection>`:vt`<wcm-desktop-wallet-selection></wcm-desktop-wallet-selection>`}render(){return vt`${this.viewTemplate()}<wcm-legal-notice></wcm-legal-notice>`}};Sd.styles=[xe.globalCss],Sd=p$([De("wcm-connect-wallet-view")],Sd);const g$=$e`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var m$=Object.defineProperty,v$=Object.getOwnPropertyDescriptor,X2=(e,t,r,n)=>{for(var i=n>1?void 0:n?v$(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&m$(t,r,i),i};let Ou=class extends me{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(e){const{desktop:t,name:r}=Ut.getWalletRouterData(),n=t?.native;if(n){const i=Ut.formatNativeUrl(n,e,r);Ut.openHref(i,"_self")}}openDesktopApp(){const{walletConnectUri:e}=hr.state,t=Ut.getWalletRouterData();ne.setRecentWallet(t),e&&this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=Ut.getWalletRouterData(),{isMobile:n,isWeb:i}=ne.getCachedRouterWalletPlatforms();return vt`<wcm-modal-header title="${e}" .onAction="${ne.handleUriCopy}" .actionIcon="${Te.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${t}" imageId="${Wr(r)}" label="${`Continue in ${e}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Connection can continue loading if ${e} is not installed on your device`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isWeb="${i}" .isRetry="${!0}"><wcm-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${Te.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};Ou.styles=[xe.globalCss,g$],X2([cn()],Ou.prototype,"isError",2),Ou=X2([De("wcm-desktop-connecting-view")],Ou);const w$=$e`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var y$=Object.defineProperty,b$=Object.getOwnPropertyDescriptor,_$=(e,t,r,n)=>{for(var i=n>1?void 0:n?b$(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&y$(t,r,i),i};let Cd=class extends me{onInstall(e){e&&Ut.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,homepage:n}=Ut.getWalletRouterData();return vt`<wcm-modal-header title="${e}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${t}" imageId="${Wr(r)}" label="Not Detected" .isStale="${!0}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Download ${e} to continue. If multiple browser extensions are installed, disable non ${e} ones and try again`}</wcm-text><wcm-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${Te.ARROW_DOWN_ICON}">Download</wcm-button></wcm-info-footer>`}};Cd.styles=[xe.globalCss,w$],Cd=_$([De("wcm-install-wallet-view")],Cd);const E$=$e`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var A$=Object.defineProperty,x$=Object.getOwnPropertyDescriptor,ty=(e,t,r,n)=>{for(var i=n>1?void 0:n?x$(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&A$(t,r,i),i};let Pu=class extends me{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(e,t=!1){const{mobile:r,name:n}=Ut.getWalletRouterData(),i=r?.native,o=r?.universal;if(i&&!t){const c=Ut.formatNativeUrl(i,e,n);Ut.openHref(c,"_self")}else if(o){const c=Ut.formatUniversalUrl(o,e,n);Ut.openHref(c,"_self")}}openMobileApp(e=!1){const{walletConnectUri:t}=hr.state,r=Ut.getWalletRouterData();ne.setRecentWallet(r),t&&this.onFormatAndRedirect(t,e)}onGoToAppStore(e){e&&Ut.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,app:n,mobile:i}=Ut.getWalletRouterData(),{isWeb:o}=ne.getCachedRouterWalletPlatforms(),c=n?.ios,l=i?.universal;return vt`<wcm-modal-header title="${e}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${t}" imageId="${Wr(r)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer class="wcm-note"><wcm-platform-selection .isWeb="${o}" .isRetry="${!0}"><wcm-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Te.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection>${l?vt`<wcm-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></wcm-text>`:null}</wcm-info-footer><wcm-info-footer class="wcm-app-store"><div><wcm-wallet-image walletId="${t}" imageId="${Wr(r)}"></wcm-wallet-image><wcm-text>${`Get ${e}`}</wcm-text></div><wcm-button .iconRight="${Te.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(c)}" variant="ghost">App Store</wcm-button></wcm-info-footer>`}};Pu.styles=[xe.globalCss,E$],ty([cn()],Pu.prototype,"isError",2),Pu=ty([De("wcm-mobile-connecting-view")],Pu);const I$=$e`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var S$=Object.defineProperty,C$=Object.getOwnPropertyDescriptor,D$=(e,t,r,n)=>{for(var i=n>1?void 0:n?C$(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&S$(t,r,i),i};let Dd=class extends me{render(){const{name:e,id:t,image_id:r}=Ut.getWalletRouterData(),{isDesktop:n,isWeb:i}=ne.getCachedRouterWalletPlatforms();return vt`<wcm-modal-header title="${e}" .onAction="${ne.handleUriCopy}" .actionIcon="${Te.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr walletId="${t}" imageId="${Wr(r)}"></wcm-walletconnect-qr></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${e} app`}</wcm-text><wcm-platform-selection .isDesktop="${n}" .isWeb="${i}"></wcm-platform-selection></wcm-info-footer>`}};Dd.styles=[xe.globalCss,I$],Dd=D$([De("wcm-mobile-qr-connecting-view")],Dd);var O$=Object.defineProperty,P$=Object.getOwnPropertyDescriptor,M$=(e,t,r,n)=>{for(var i=n>1?void 0:n?P$(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&O$(t,r,i),i};let Od=class extends me{render(){return vt`<wcm-modal-header title="Scan the code" .onAction="${ne.handleUriCopy}" .actionIcon="${Te.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>`}};Od.styles=[xe.globalCss],Od=M$([De("wcm-qrcode-view")],Od);const $$=$e`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var N$=Object.defineProperty,T$=Object.getOwnPropertyDescriptor,jc=(e,t,r,n)=>{for(var i=n>1?void 0:n?T$(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&N$(t,r,i),i};const Pd=40;let ho=class extends me{constructor(){super(...arguments),this.loading=!an.state.wallets.listings.length,this.firstFetch=!an.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=ne.debounce(e=>{e.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=e,an.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),an.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var e;(e=this.intersectionObserver)==null||e.disconnect()}get placeholderEl(){return ne.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([e])=>{e.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:e,search:t}=an.state,{listings:r,total:n}=this.search?t:e;return n<=Pd||r.length>=n}async fetchWallets(){var e;const{wallets:t,search:r}=an.state,{listings:n,total:i,page:o}=this.search?r:t;if(!this.endReached&&(this.firstFetch||i>Pd&&n.length<i))try{this.loading=!0;const c=(e=hr.state.chains)==null?void 0:e.join(","),{listings:l}=await an.getWallets({page:this.firstFetch?1:o+1,entries:Pd,search:this.search,version:2,chains:c}),f=l.map(h=>ne.getWalletIcon(h));await Promise.all([...f.map(async h=>ne.preloadImage(h)),Ut.wait(300)]),this.endReached=this.isLastPage()}catch(c){console.error(c),vs.openToast(ne.getErrorMessage(c),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(e){Ut.isAndroid()?ne.handleMobileLinking(e):ne.goToConnectingView(e)}onSearchChange(e){const{value:t}=e.target;this.searchDebounce(t)}render(){const{wallets:e,search:t}=an.state,{listings:r}=this.search?t:e,n=this.loading&&!r.length,i=this.search.length>=3;let o=Is.manualWalletsTemplate(),c=Is.recomendedWalletsTemplate(!0);i&&(o=o.filter(({values:h})=>ne.caseSafeIncludes(h[0],this.search)),c=c.filter(({values:h})=>ne.caseSafeIncludes(h[0],this.search)));const l=!this.loading&&!r.length&&!c.length,f={"wcm-loading":n,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":l};return vt`<wcm-modal-header><wcm-search-input .onChange="${this.onSearchChange.bind(this)}"></wcm-search-input></wcm-modal-header><wcm-modal-content class="${Gi(f)}"><div class="wcm-grid">${n?null:o} ${n?null:c} ${n?null:r.map(h=>vt`${h?vt`<wcm-wallet-button imageId="${h.image_id}" name="${h.name}" walletId="${h.id}" .onClick="${()=>this.onConnect(h)}"></wcm-wallet-button>`:null}`)}</div><div class="wcm-placeholder-block">${l?vt`<wcm-text variant="big-bold" color="secondary">No results found</wcm-text>`:null} ${!l&&this.loading?vt`<wcm-spinner></wcm-spinner>`:null}</div></wcm-modal-content>`}};ho.styles=[xe.globalCss,$$],jc([cn()],ho.prototype,"loading",2),jc([cn()],ho.prototype,"firstFetch",2),jc([cn()],ho.prototype,"search",2),jc([cn()],ho.prototype,"endReached",2),ho=jc([De("wcm-wallet-explorer-view")],ho);const R$=$e`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var L$=Object.defineProperty,B$=Object.getOwnPropertyDescriptor,ey=(e,t,r,n)=>{for(var i=n>1?void 0:n?B$(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&L$(t,r,i),i};let Mu=class extends me{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(e){const{desktop:t,name:r}=Ut.getWalletRouterData(),n=t?.universal;if(n){const i=Ut.formatUniversalUrl(n,e,r);Ut.openHref(i,"_blank")}}openWebWallet(){const{walletConnectUri:e}=hr.state,t=Ut.getWalletRouterData();ne.setRecentWallet(t),e&&this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=Ut.getWalletRouterData(),{isMobile:n,isDesktop:i}=ne.getCachedRouterWalletPlatforms(),o=Ut.isMobile();return vt`<wcm-modal-header title="${e}" .onAction="${ne.handleUriCopy}" .actionIcon="${Te.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${t}" imageId="${Wr(r)}" label="${`Continue in ${e}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`${e} web app has opened in a new tab. Go there, accept the connection, and come back`}</wcm-text><wcm-platform-selection .isMobile="${n}" .isDesktop="${o?!1:i}" .isRetry="${!0}"><wcm-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${Te.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};Mu.styles=[xe.globalCss,R$],ey([cn()],Mu.prototype,"isError",2),Mu=ey([De("wcm-web-connecting-view")],Mu);var U$=Object.freeze({__proto__:null,get WcmModal(){return _a},get WcmQrCode(){return Qi}});Vn.EthereumProvider=cD,Vn.OPTIONAL_EVENTS=Dw,Vn.OPTIONAL_METHODS=Cw,Vn.REQUIRED_EVENTS=ru,Vn.REQUIRED_METHODS=eu,Vn.default=su,Object.defineProperty(Vn,"__esModule",{value:!0})});
|
|
120
|
+
Minimum version required to store current data is: `+s+`.
|
|
121
|
+
`);const a=uB(e,r,n),u=Yh.getSymbolSize(e),d=new ZL(u);return nB(d,e),sB(d),oB(d,e),ep(d,r,0),e>=7&&aB(d,e),cB(d,a),isNaN(i)&&(i=Q1.getBestMask(d,ep.bind(null,d,r))),Q1.applyMask(i,d),ep(d,r,i),{modules:d,version:e,errorCorrectionLevel:r,maskPattern:i,segments:n}}U5.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let i=J1.M,n,s;return typeof r<"u"&&(i=J1.from(r.errorCorrectionLevel,J1.M),n=Jh.from(r.version),s=Q1.from(r.maskPattern),r.toSJISFunc&&Yh.setToSJISFunction(r.toSJISFunc)),hB(e,n,i,s)};var ey={},tp={};(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 i=r.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+r);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(s){return[s,s]}))),i.length===6&&i.push("F","F");const n=parseInt(i.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+i.slice(0,6).join("")}}t.getOptions=function(i){i||(i={}),i.color||(i.color={});const n=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,s=i.width&&i.width>=21?i.width:void 0,a=i.scale||4;return{width:s,scale:s?4:a,margin:n,color:{dark:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},t.getScale=function(i,n){return n.width&&n.width>=i+n.margin*2?n.width/(i+n.margin*2):n.scale},t.getImageWidth=function(i,n){const s=t.getScale(i,n);return Math.floor((i+n.margin*2)*s)},t.qrToImageData=function(i,n,s){const a=n.modules.size,u=n.modules.data,d=t.getScale(a,s),p=Math.floor((a+s.margin*2)*d),y=s.margin*d,_=[s.color.light,s.color.dark];for(let C=0;C<p;C++)for(let I=0;I<p;I++){let M=(C*p+I)*4,B=s.color.light;if(C>=y&&I>=y&&C<p-y&&I<p-y){const W=Math.floor((C-y)/d),Y=Math.floor((I-y)/d);B=_[u[W*a+Y]?1:0]}i[M++]=B.r,i[M++]=B.g,i[M++]=B.b,i[M]=B.a}}})(tp),function(t){const e=tp;function r(n,s,a){n.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=a,s.width=a,s.style.height=a+"px",s.style.width=a+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(s,a,u){let d=u,p=a;typeof d>"u"&&(!a||!a.getContext)&&(d=a,a=void 0),a||(p=i()),d=e.getOptions(d);const y=e.getImageWidth(s.modules.size,d),_=p.getContext("2d"),C=_.createImageData(y,y);return e.qrToImageData(C.data,s,d),r(_,p,y),_.putImageData(C,0,0),p},t.renderToDataURL=function(s,a,u){let d=u;typeof d>"u"&&(!a||!a.getContext)&&(d=a,a=void 0),d||(d={});const p=t.render(s,a,d),y=d.type||"image/png",_=d.rendererOpts||{};return p.toDataURL(y,_.quality)}}(ey);var ty={};const lB=tp;function ry(t,e){const r=t.a/255,i=e+'="'+t.hex+'"';return r<1?i+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':i}function rp(t,e,r){let i=t+e;return typeof r<"u"&&(i+=" "+r),i}function dB(t,e,r){let i="",n=0,s=!1,a=0;for(let u=0;u<t.length;u++){const d=Math.floor(u%e),p=Math.floor(u/e);!d&&!s&&(s=!0),t[u]?(a++,u>0&&d>0&&t[u-1]||(i+=s?rp("M",d+r,.5+p+r):rp("m",n,0),n=0,s=!1),d+1<e&&t[u+1]||(i+=rp("h",a),a=0)):n++}return i}ty.render=function(e,r,i){const n=lB.getOptions(r),s=e.modules.size,a=e.modules.data,u=s+n.margin*2,d=n.color.light.a?"<path "+ry(n.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",p="<path "+ry(n.color.dark,"stroke")+' d="'+dB(a,s,n.margin)+'"/>',y='viewBox="0 0 '+u+" "+u+'"',C='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+y+' shape-rendering="crispEdges">'+d+p+`</svg>
|
|
122
|
+
`;return typeof i=="function"&&i(null,C),C};const pB=CL,ip=U5,iy=ey,gB=ty;function np(t,e,r,i,n){const s=[].slice.call(arguments,1),a=s.length,u=typeof s[a-1]=="function";if(!u&&!pB())throw new Error("Callback required as last argument");if(u){if(a<2)throw new Error("Too few arguments provided");a===2?(n=r,r=e,e=i=void 0):a===3&&(e.getContext&&typeof n>"u"?(n=i,i=void 0):(n=i,i=r,r=e,e=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(r=e,e=i=void 0):a===2&&!e.getContext&&(i=r,r=e,e=void 0),new Promise(function(d,p){try{const y=ip.create(r,i);d(t(y,e,i))}catch(y){p(y)}})}try{const d=ip.create(r,i);n(null,t(d,e,i))}catch(d){n(d)}}Uu.create=ip.create,Uu.toCanvas=np.bind(null,iy.render),Uu.toDataURL=np.bind(null,iy.renderToDataURL),Uu.toString=np.bind(null,function(t,e,r){return gB.render(t,r)});var vB=Object.defineProperty,ny=Object.getOwnPropertySymbols,mB=Object.prototype.hasOwnProperty,bB=Object.prototype.propertyIsEnumerable,sy=(t,e,r)=>e in t?vB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,sp=(t,e)=>{for(var r in e||(e={}))mB.call(e,r)&&sy(t,r,e[r]);if(ny)for(var r of ny(e))bB.call(e,r)&&sy(t,r,e[r]);return t};function yB(){var t;const e=(t=ao.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{"--wcm-color-fg-1":r.foreground[1],"--wcm-color-fg-2":r.foreground[2],"--wcm-color-fg-3":r.foreground[3],"--wcm-color-bg-1":r.background[1],"--wcm-color-bg-2":r.background[2],"--wcm-color-bg-3":r.background[3],"--wcm-color-overlay":r.overlay}}function oy(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const Bt={getPreset(t){return oy()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=ao.state;if(t){const r=sp(sp(sp({},yB()),oy()),e);Object.entries(r).forEach(([i,n])=>t.style.setProperty(i,n))}},globalCss:Ht`*,::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 wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},wB=Ht`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var _B=Object.defineProperty,AB=Object.getOwnPropertyDescriptor,mc=(t,e,r,i)=>{for(var n=i>1?void 0:i?AB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&_B(e,r,n),n};let po=class extends Ot{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),je`<button class="${Ts(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wcm-text variant="small-regular" color="${e}"><slot></slot></wcm-text>${this.iconRight}</button>`}};po.styles=[Bt.globalCss,wB],mc([xt({type:Boolean})],po.prototype,"disabled",2),mc([xt()],po.prototype,"iconLeft",2),mc([xt()],po.prototype,"iconRight",2),mc([xt()],po.prototype,"onClick",2),mc([xt()],po.prototype,"variant",2),po=mc([jt("wcm-button")],po);const EB=Ht`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-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(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var xB=Object.defineProperty,SB=Object.getOwnPropertyDescriptor,op=(t,e,r,i)=>{for(var n=i>1?void 0:i?SB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&xB(e,r,n),n};let zu=class extends Ot{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"wcm-secondary":this.variant==="secondary"};return je`<button ?disabled="${this.disabled}" class="${Ts(t)}"><slot></slot></button>`}};zu.styles=[Bt.globalCss,EB],op([xt({type:Boolean})],zu.prototype,"disabled",2),op([xt()],zu.prototype,"variant",2),zu=op([jt("wcm-button-big")],zu);const IB=Ht`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var MB=Object.defineProperty,CB=Object.getOwnPropertyDescriptor,DB=(t,e,r,i)=>{for(var n=i>1?void 0:i?CB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&MB(e,r,n),n};let ap=class extends Ot{render(){return je`<div><slot></slot></div>`}};ap.styles=[Bt.globalCss,IB],ap=DB([jt("wcm-info-footer")],ap);const Vt={CROSS_ICON:pr`<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:pr`<svg width="178" height="29" viewBox="0 0 178 29" id="wcm-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:pr`<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:pr`<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:pr`<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:pr`<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:pr`<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:pr`<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:pr`<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:pr`<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:pr`<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:pr`<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:pr`<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:pr`<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:pr`<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>`,SEARCH_ICON:pr`<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>`,WALLET_PLACEHOLDER:pr`<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>`,GLOBE_ICON:pr`<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>`},PB=Ht`.wcm-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(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var OB=Object.defineProperty,$B=Object.getOwnPropertyDescriptor,NB=(t,e,r,i)=>{for(var n=i>1?void 0:i?$B(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&OB(e,r,n),n};let cp=class extends Ot{render(){return je`<div class="wcm-toolbar-placeholder"></div><div class="wcm-toolbar">${Vt.WALLET_CONNECT_LOGO} <button @click="${Zo.close}">${Vt.CROSS_ICON}</button></div>`}};cp.styles=[Bt.globalCss,PB],cp=NB([jt("wcm-modal-backcard")],cp);const RB=Ht`main{padding:20px;padding-top:0;width:100%}`;var TB=Object.defineProperty,FB=Object.getOwnPropertyDescriptor,LB=(t,e,r,i)=>{for(var n=i>1?void 0:i?FB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&TB(e,r,n),n};let up=class extends Ot{render(){return je`<main><slot></slot></main>`}};up.styles=[Bt.globalCss,RB],up=LB([jt("wcm-modal-content")],up);const BB=Ht`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var UB=Object.defineProperty,kB=Object.getOwnPropertyDescriptor,jB=(t,e,r,i)=>{for(var n=i>1?void 0:i?kB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&UB(e,r,n),n};let fp=class extends Ot{render(){return je`<footer><slot></slot></footer>`}};fp.styles=[Bt.globalCss,BB],fp=jB([jt("wcm-modal-footer")],fp);const qB=Ht`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var zB=Object.defineProperty,HB=Object.getOwnPropertyDescriptor,Hu=(t,e,r,i)=>{for(var n=i>1?void 0:i?HB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&zB(e,r,n),n};let oa=class extends Ot{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return je`<button class="wcm-back-btn" @click="${fr.goBack}">${Vt.BACK_ICON}</button>`}actionBtnTemplate(){return je`<button class="wcm-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"wcm-border":this.border},e=fr.state.history.length>1,r=this.title?je`<wcm-text variant="big-bold">${this.title}</wcm-text>`:je`<slot></slot>`;return je`<header class="${Ts(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};oa.styles=[Bt.globalCss,qB],Hu([xt()],oa.prototype,"title",2),Hu([xt()],oa.prototype,"onAction",2),Hu([xt()],oa.prototype,"actionIcon",2),Hu([xt({type:Boolean})],oa.prototype,"border",2),oa=Hu([jt("wcm-modal-header")],oa);const vt={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",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}=ji.state;return r!=null&&r[t]?r[t]:e?Ii.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e&&t.length>8?`${t.substring(0,8)}..`:t},isMobileAnimation(){return window.innerWidth<=vt.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,i)=>{const n=new Image;n.onload=r,n.onerror=i,n.crossOrigin="anonymous",n.src=t});return Promise.race([e,ct.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...i)=>{function n(){t(...i)}r&&clearTimeout(r),r=setTimeout(n,e)}},handleMobileLinking(t){const{walletConnectUri:e}=yr.state,{mobile:r,name:i}=t,n=r?.native,s=r?.universal;vt.setRecentWallet(t);function a(u){let d="";n?d=ct.formatUniversalUrl(n,u,i):s&&(d=ct.formatNativeUrl(s,u,i)),ct.openHref(d,"_self")}e&&a(e)},handleAndroidLinking(){const{walletConnectUri:t}=yr.state;t&&(ct.setWalletConnectAndroidDeepLink(t),ct.openHref(t,"_self"))},async handleUriCopy(){const{walletConnectUri:t}=yr.state;if(t)try{await navigator.clipboard.writeText(t),co.openToast("Link copied","success")}catch{co.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:t}=ji.state,e=Object.values(t??{});return Object.values(e)},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},setRecentWallet(t){try{localStorage.setItem(vt.WCM_RECENT_WALLET_DATA,JSON.stringify(t))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const t=localStorage.getItem(vt.WCM_RECENT_WALLET_DATA);return t?JSON.parse(t):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){ct.openHref(vt.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:t,mobile:e}=ct.getWalletRouterData(),r=!!t?.native,i=!!t?.universal,n=!!e?.native||!!e?.universal;return{isDesktop:r,isMobile:n,isWeb:i}},goToConnectingView(t){fr.setData({Wallet:t});const e=ct.isMobile(),{isDesktop:r,isWeb:i,isMobile:n}=vt.getCachedRouterWalletPlatforms();e?n?fr.push("MobileConnecting"):i?fr.push("WebConnecting"):fr.push("InstallWallet"):r?fr.push("DesktopConnecting"):i?fr.push("WebConnecting"):n?fr.push("MobileQrcodeConnecting"):fr.push("InstallWallet")}},KB=Ht`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var WB=Object.defineProperty,VB=Object.getOwnPropertyDescriptor,hp=(t,e,r,i)=>{for(var n=i>1?void 0:i?VB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&WB(e,r,n),n};let Ku=class extends Ot{constructor(){super(),this.view=fr.state.view,this.prevView=fr.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=fr.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&sa(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 vt.getShadowRootElement(this,".wcm-router")}get contentEl(){return vt.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return je`<wcm-connect-wallet-view></wcm-connect-wallet-view>`;case"DesktopConnecting":return je`<wcm-desktop-connecting-view></wcm-desktop-connecting-view>`;case"MobileConnecting":return je`<wcm-mobile-connecting-view></wcm-mobile-connecting-view>`;case"WebConnecting":return je`<wcm-web-connecting-view></wcm-web-connecting-view>`;case"MobileQrcodeConnecting":return je`<wcm-mobile-qr-connecting-view></wcm-mobile-qr-connecting-view>`;case"WalletExplorer":return je`<wcm-wallet-explorer-view></wcm-wallet-explorer-view>`;case"Qrcode":return je`<wcm-qrcode-view></wcm-qrcode-view>`;case"InstallWallet":return je`<wcm-install-wallet-view></wcm-install-wallet-view>`;default:return je`<div>Not Found</div>`}}async onChangeRoute(){await sa(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=fr.state.view,sa(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return je`<div class="wcm-router"><div class="wcm-content">${this.viewTemplate()}</div></div>`}};Ku.styles=[Bt.globalCss,KB],hp([Mi()],Ku.prototype,"view",2),hp([Mi()],Ku.prototype,"prevView",2),Ku=hp([jt("wcm-modal-router")],Ku);const GB=Ht`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(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var YB=Object.defineProperty,JB=Object.getOwnPropertyDescriptor,ay=(t,e,r,i)=>{for(var n=i>1?void 0:i?JB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&YB(e,r,n),n};let Qh=class extends Ot{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=co.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>co.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),co.closeToast()}render(){const{message:t,variant:e}=co.state,r={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?je`<div class="${Ts(r)}">${e==="success"?Vt.CHECKMARK_ICON:null} ${e==="error"?Vt.CROSS_ICON:null}<wcm-text variant="small-regular">${t}</wcm-text></div>`:null}};Qh.styles=[Bt.globalCss,GB],ay([Mi()],Qh.prototype,"open",2),Qh=ay([jt("wcm-modal-toast")],Qh);const QB=.1,cy=2.5,Fs=7;function lp(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+QB}function ZB(t,e){const r=Array.prototype.slice.call(Uu.create(t,{errorCorrectionLevel:e}).modules.data,0),i=Math.sqrt(r.length);return r.reduce((n,s,a)=>(a%i===0?n.push([s]):n[n.length-1].push(s))&&n,[])}const XB={generate(t,e,r){const i="#141414",n="#ffffff",s=[],a=ZB(t,"Q"),u=e/a.length,d=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];d.forEach(({x:M,y:B})=>{const W=(a.length-Fs)*u*M,Y=(a.length-Fs)*u*B,q=.45;for(let V=0;V<d.length;V+=1){const U=u*(Fs-V*2);s.push(pr`<rect fill="${V%2===0?i:n}" height="${U}" rx="${U*q}" ry="${U*q}" width="${U}" x="${W+u*V}" y="${Y+u*V}">`)}});const p=Math.floor((r+25)/u),y=a.length/2-p/2,_=a.length/2+p/2-1,C=[];a.forEach((M,B)=>{M.forEach((W,Y)=>{if(a[B][Y]&&!(B<Fs&&Y<Fs||B>a.length-(Fs+1)&&Y<Fs||B<Fs&&Y>a.length-(Fs+1))&&!(B>y&&B<_&&Y>y&&Y<_)){const q=B*u+u/2,V=Y*u+u/2;C.push([q,V])}})});const I={};return C.forEach(([M,B])=>{I[M]?I[M].push(B):I[M]=[B]}),Object.entries(I).map(([M,B])=>{const W=B.filter(Y=>B.every(q=>!lp(Y,q,u)));return[Number(M),W]}).forEach(([M,B])=>{B.forEach(W=>{s.push(pr`<circle cx="${M}" cy="${W}" fill="${i}" r="${u/cy}">`)})}),Object.entries(I).filter(([M,B])=>B.length>1).map(([M,B])=>{const W=B.filter(Y=>B.some(q=>lp(Y,q,u)));return[Number(M),W]}).map(([M,B])=>{B.sort((Y,q)=>Y<q?-1:1);const W=[];for(const Y of B){const q=W.find(V=>V.some(U=>lp(Y,U,u)));q?q.push(Y):W.push([Y])}return[M,W.map(Y=>[Y[0],Y[Y.length-1]])]}).forEach(([M,B])=>{B.forEach(([W,Y])=>{s.push(pr`<line x1="${M}" x2="${M}" y1="${W}" y2="${Y}" stroke="${i}" stroke-width="${u/(cy/2)}" stroke-linecap="round">`)})}),s}},eU=Ht`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var tU=Object.defineProperty,rU=Object.getOwnPropertyDescriptor,bc=(t,e,r,i)=>{for(var n=i>1?void 0:i?rU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&tU(e,r,n),n};let Ls=class extends Ot{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const t=ao.state.themeMode==="light"?this.size:this.size-36;return pr`<svg height="${t}" width="${t}">${XB.generate(this.uri,t,t/4)}</svg>`}render(){const t={"wcm-dark":ao.state.themeMode==="dark"};return je`<div style="${`width: ${this.size}px`}" class="${Ts(t)}">${this.walletId||this.imageUrl?je`<wcm-wallet-image walletId="${li(this.walletId)}" imageId="${li(this.imageId)}" imageUrl="${li(this.imageUrl)}"></wcm-wallet-image>`:Vt.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Ls.styles=[Bt.globalCss,eU],bc([xt()],Ls.prototype,"uri",2),bc([xt({type:Number})],Ls.prototype,"size",2),bc([xt()],Ls.prototype,"imageId",2),bc([xt()],Ls.prototype,"walletId",2),bc([xt()],Ls.prototype,"imageUrl",2),Ls=bc([jt("wcm-qrcode")],Ls);const iU=Ht`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-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(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-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(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var nU=Object.defineProperty,sU=Object.getOwnPropertyDescriptor,uy=(t,e,r,i)=>{for(var n=i>1?void 0:i?sU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&nU(e,r,n),n};let Zh=class extends Ot{constructor(){super(...arguments),this.onChange=()=>null}render(){return je`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Vt.SEARCH_ICON}`}};Zh.styles=[Bt.globalCss,iU],uy([xt()],Zh.prototype,"onChange",2),Zh=uy([jt("wcm-search-input")],Zh);const oU=Ht`@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(--wcm-accent-color)}`;var aU=Object.defineProperty,cU=Object.getOwnPropertyDescriptor,uU=(t,e,r,i)=>{for(var n=i>1?void 0:i?cU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&aU(e,r,n),n};let dp=class extends Ot{render(){return je`<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>`}};dp.styles=[Bt.globalCss,oU],dp=uU([jt("wcm-spinner")],dp);const fU=Ht`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var hU=Object.defineProperty,lU=Object.getOwnPropertyDescriptor,pp=(t,e,r,i)=>{for(var n=i>1?void 0:i?lU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&hU(e,r,n),n};let Wu=class extends Ot{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return je`<span><slot class="${Ts(t)}"></slot></span>`}};Wu.styles=[Bt.globalCss,fU],pp([xt()],Wu.prototype,"variant",2),pp([xt()],Wu.prototype,"color",2),Wu=pp([jt("wcm-text")],Wu);const dU=Ht`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var pU=Object.defineProperty,gU=Object.getOwnPropertyDescriptor,go=(t,e,r,i)=>{for(var n=i>1?void 0:i?gU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&pU(e,r,n),n};let ms=class extends Ot{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?je`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wcm-text>`:this.installed?je`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wcm-text>`:null}handleClick(){W6.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return je`<button @click="${this.handleClick.bind(this)}"><div><wcm-wallet-image walletId="${this.walletId}" imageId="${li(this.imageId)}"></wcm-wallet-image><wcm-text variant="xsmall-regular">${(t=this.label)!=null?t:vt.getWalletName(this.name,!0)}</wcm-text>${this.sublabelTemplate()}</div></button>`}};ms.styles=[Bt.globalCss,dU],go([xt()],ms.prototype,"onClick",2),go([xt()],ms.prototype,"name",2),go([xt()],ms.prototype,"walletId",2),go([xt()],ms.prototype,"label",2),go([xt()],ms.prototype,"imageId",2),go([xt({type:Boolean})],ms.prototype,"installed",2),go([xt({type:Boolean})],ms.prototype,"recent",2),ms=go([jt("wcm-wallet-button")],ms);const vU=Ht`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-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(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var mU=Object.defineProperty,bU=Object.getOwnPropertyDescriptor,Xh=(t,e,r,i)=>{for(var n=i>1?void 0:i?bU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&mU(e,r,n),n};let yc=class extends Ot{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:vt.getWalletIcon({id:this.walletId,image_id:this.imageId});return je`${e.length?je`<div><img crossorigin="anonymous" src="${e}" alt="${this.id}"></div>`:Vt.WALLET_PLACEHOLDER}`}};yc.styles=[Bt.globalCss,vU],Xh([xt()],yc.prototype,"walletId",2),Xh([xt()],yc.prototype,"imageId",2),Xh([xt()],yc.prototype,"imageUrl",2),yc=Xh([jt("wcm-wallet-image")],yc);var yU=Object.defineProperty,wU=Object.getOwnPropertyDescriptor,fy=(t,e,r,i)=>{for(var n=i>1?void 0:i?wU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&yU(e,r,n),n};let gp=class extends Ot{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>vt.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){if(ji.state.enableExplorer){await Ii.getRecomendedWallets(),yr.setIsDataLoaded(!0);const{recomendedWallets:t}=Ii.state,e=t.map(r=>vt.getWalletIcon(r));await this.loadImages(e)}else yr.setIsDataLoaded(!0)}async preloadCustomImages(){const t=vt.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),co.openToast("Failed preloading","error")}}};fy([Mi()],gp.prototype,"preload",2),gp=fy([jt("wcm-explorer-context")],gp);var _U=Object.defineProperty,AU=Object.getOwnPropertyDescriptor,EU=(t,e,r,i)=>{for(var n=i>1?void 0:i?AU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&_U(e,r,n),n};let hy=class extends Ot{constructor(){super(),this.unsubscribeTheme=void 0,Bt.setTheme(),this.unsubscribeTheme=ao.subscribe(Bt.setTheme)}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}};hy=EU([jt("wcm-theme-context")],hy);const xU=Ht`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var SU=Object.defineProperty,IU=Object.getOwnPropertyDescriptor,MU=(t,e,r,i)=>{for(var n=i>1?void 0:i?IU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&SU(e,r,n),n};let vp=class extends Ot{onGoToQrcode(){fr.push("Qrcode")}render(){const{recomendedWallets:t}=Ii.state,e=[...t,...t],r=ct.RECOMMENDED_WALLET_AMOUNT*2;return je`<wcm-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Vt.QRCODE_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-title">${Vt.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">WalletConnect</wcm-text></div><div class="wcm-slider"><div class="wcm-track">${[...Array(r)].map((i,n)=>{const s=e[n%e.length];return s?je`<wcm-wallet-image walletId="${s.id}" imageId="${s.image_id}"></wcm-wallet-image>`:Vt.WALLET_PLACEHOLDER})}</div><wcm-button-big @click="${vt.handleAndroidLinking}"><wcm-text variant="medium-regular" color="inverse">Select Wallet</wcm-text></wcm-button-big></div></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wcm-text></wcm-info-footer>`}};vp.styles=[Bt.globalCss,xU],vp=MU([jt("wcm-android-wallet-selection")],vp);const CU=Ht`@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(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var DU=Object.defineProperty,PU=Object.getOwnPropertyDescriptor,wc=(t,e,r,i)=>{for(var n=i>1?void 0:i?PU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&DU(e,r,n),n};let vo=class extends Ot{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=ao.state.themeVariables)==null?void 0:t["--wcm-wallet-icon-large-border-radius"])!=null?e:Bt.getPreset("--wcm-wallet-icon-large-border-radius");let i=0;r.includes("%")?i=88/100*parseInt(r,10):i=parseInt(r,10),i*=1.17;const n=317-i*1.57,s=425-i*1.8;return je`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wcm-loader" x="2" y="2" width="106" height="106" rx="${i}"/><use xlink:href="#wcm-loader" stroke-dasharray="106 ${n}" stroke-dashoffset="${s}"></use></svg>`}render(){const t={"wcm-error":this.isError,"wcm-stale":this.isStale};return je`<div class="${Ts(t)}">${this.svgLoaderTemplate()}<wcm-wallet-image walletId="${li(this.walletId)}" imageId="${li(this.imageId)}"></wcm-wallet-image></div><wcm-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</wcm-text>`}};vo.styles=[Bt.globalCss,CU],wc([xt()],vo.prototype,"walletId",2),wc([xt()],vo.prototype,"imageId",2),wc([xt({type:Boolean})],vo.prototype,"isError",2),wc([xt({type:Boolean})],vo.prototype,"isStale",2),wc([xt()],vo.prototype,"label",2),vo=wc([jt("wcm-connector-waiting")],vo);const _c={manualWallets(){var t,e;const{mobileWallets:r,desktopWallets:i}=ji.state,n=(t=_c.recentWallet())==null?void 0:t.id,s=ct.isMobile()?r:i,a=s?.filter(u=>n!==u.id);return(e=ct.isMobile()?a?.map(({id:u,name:d,links:p})=>({id:u,name:d,mobile:p,links:p})):a?.map(({id:u,name:d,links:p})=>({id:u,name:d,desktop:p,links:p})))!=null?e:[]},recentWallet(){return vt.getRecentWallet()},recomendedWallets(t=!1){var e;const r=t||(e=_c.recentWallet())==null?void 0:e.id,{recomendedWallets:i}=Ii.state;return i.filter(n=>r!==n.id)}},mo={onConnecting(t){vt.goToConnectingView(t)},manualWalletsTemplate(){return _c.manualWallets().map(t=>je`<wcm-wallet-button walletId="${t.id}" name="${t.name}" .onClick="${()=>this.onConnecting(t)}"></wcm-wallet-button>`)},recomendedWalletsTemplate(t=!1){return _c.recomendedWallets(t).map(e=>je`<wcm-wallet-button name="${e.name}" walletId="${e.id}" imageId="${e.image_id}" .onClick="${()=>this.onConnecting(e)}"></wcm-wallet-button>`)},recentWalletTemplate(){const t=_c.recentWallet();if(t)return je`<wcm-wallet-button name="${t.name}" walletId="${t.id}" imageId="${li(t.image_id)}" .recent="${!0}" .onClick="${()=>this.onConnecting(t)}"></wcm-wallet-button>`}},OU=Ht`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var $U=Object.defineProperty,NU=Object.getOwnPropertyDescriptor,RU=(t,e,r,i)=>{for(var n=i>1?void 0:i?NU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&$U(e,r,n),n};let mp=class extends Ot{render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=ji.state,r=t!=="ALL"&&e,i=mo.manualWalletsTemplate(),n=mo.recomendedWalletsTemplate();let s=[mo.recentWalletTemplate(),...i,...n];s=s.filter(Boolean);const a=s.length>4||r;let u=[];a?u=s.slice(0,3):u=s;const d=!!u.length;return je`<wcm-modal-header .border="${!0}" title="Connect your wallet" .onAction="${vt.handleUriCopy}" .actionIcon="${Vt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-mobile-title"><div class="wcm-subtitle">${Vt.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">Mobile</wcm-text></div><div class="wcm-subtitle">${Vt.SCAN_ICON}<wcm-text variant="small-regular" color="secondary">Scan with your wallet</wcm-text></div></div><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>${d?je`<wcm-modal-footer><div class="wcm-desktop-title">${Vt.DESKTOP_ICON}<wcm-text variant="small-regular" color="accent">Desktop</wcm-text></div><div class="wcm-grid">${u} ${a?je`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-footer>`:null}`}};mp.styles=[Bt.globalCss,OU],mp=RU([jt("wcm-desktop-wallet-selection")],mp);const TU=Ht`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-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 FU=Object.defineProperty,LU=Object.getOwnPropertyDescriptor,BU=(t,e,r,i)=>{for(var n=i>1?void 0:i?LU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&FU(e,r,n),n};let bp=class extends Ot{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=ji.state;return t??e?je`<div><wcm-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${t?je`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?je`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</wcm-text></div>`:null}};bp.styles=[Bt.globalCss,TU],bp=BU([jt("wcm-legal-notice")],bp);const UU=Ht`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var kU=Object.defineProperty,jU=Object.getOwnPropertyDescriptor,qU=(t,e,r,i)=>{for(var n=i>1?void 0:i?jU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&kU(e,r,n),n};let yp=class extends Ot{onQrcode(){fr.push("Qrcode")}render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=ji.state,r=t!=="ALL"&&e,i=mo.manualWalletsTemplate(),n=mo.recomendedWalletsTemplate();let s=[mo.recentWalletTemplate(),...i,...n];s=s.filter(Boolean);const a=s.length>8||r;let u=[];a?u=s.slice(0,7):u=s;const d=!!u.length;return je`<wcm-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Vt.QRCODE_ICON}"></wcm-modal-header>${d?je`<wcm-modal-content><div>${u} ${a?je`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-content>`:null}`}};yp.styles=[Bt.globalCss,UU],yp=qU([jt("wcm-mobile-wallet-selection")],yp);const zU=Ht`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-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(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var HU=Object.defineProperty,KU=Object.getOwnPropertyDescriptor,wp=(t,e,r,i)=>{for(var n=i>1?void 0:i?KU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&HU(e,r,n),n};let Ac=class extends Ot{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Zo.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return vt.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return vt.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("wcm-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="wcm-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(t){t.target===t.currentTarget&&Zo.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=vt.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,r=.2;await Promise.all([sa(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,sa(this.containerEl,t,{delay:e,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=vt.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([sa(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,sa(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"?Zo.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}render(){const t={"wcm-overlay":!0,"wcm-active":this.active};return je`<wcm-explorer-context></wcm-explorer-context><wcm-theme-context></wcm-theme-context><div id="wcm-modal" class="${Ts(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wcm-container" tabindex="0">${this.open?je`<wcm-modal-backcard></wcm-modal-backcard><div class="wcm-card"><wcm-modal-router></wcm-modal-router><wcm-modal-toast></wcm-modal-toast></div>`:null}</div></div>`}};Ac.styles=[Bt.globalCss,zU],wp([Mi()],Ac.prototype,"open",2),wp([Mi()],Ac.prototype,"active",2),Ac=wp([jt("wcm-modal")],Ac);const WU=Ht`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var VU=Object.defineProperty,GU=Object.getOwnPropertyDescriptor,Vu=(t,e,r,i)=>{for(var n=i>1?void 0:i?GU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&VU(e,r,n),n};let aa=class extends Ot{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){ct.isMobile()?fr.replace("MobileConnecting"):fr.replace("MobileQrcodeConnecting")}onDesktop(){fr.replace("DesktopConnecting")}onWeb(){fr.replace("WebConnecting")}render(){return je`<div>${this.isRetry?je`<slot></slot>`:null} ${this.isMobile?je`<wcm-button .onClick="${this.onMobile}" .iconLeft="${Vt.MOBILE_ICON}" variant="outline">Mobile</wcm-button>`:null} ${this.isDesktop?je`<wcm-button .onClick="${this.onDesktop}" .iconLeft="${Vt.DESKTOP_ICON}" variant="outline">Desktop</wcm-button>`:null} ${this.isWeb?je`<wcm-button .onClick="${this.onWeb}" .iconLeft="${Vt.GLOBE_ICON}" variant="outline">Web</wcm-button>`:null}</div>`}};aa.styles=[Bt.globalCss,WU],Vu([xt({type:Boolean})],aa.prototype,"isMobile",2),Vu([xt({type:Boolean})],aa.prototype,"isDesktop",2),Vu([xt({type:Boolean})],aa.prototype,"isWeb",2),Vu([xt({type:Boolean})],aa.prototype,"isRetry",2),aa=Vu([jt("wcm-platform-selection")],aa);const YU=Ht`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var JU=Object.defineProperty,QU=Object.getOwnPropertyDescriptor,ZU=(t,e,r,i)=>{for(var n=i>1?void 0:i?QU(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&JU(e,r,n),n};let _p=class extends Ot{onClick(){fr.push("WalletExplorer")}render(){const{recomendedWallets:t}=Ii.state,e=_c.manualWallets(),r=[...t,...e].reverse().slice(0,4);return je`<button @click="${this.onClick}"><div class="wcm-icons">${r.map(i=>{const n=vt.getWalletIcon(i);if(n)return je`<img crossorigin="anonymous" src="${n}">`;const s=vt.getWalletIcon({id:i.id});return s?je`<img crossorigin="anonymous" src="${s}">`:Vt.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>Vt.WALLET_PLACEHOLDER)}</div><wcm-text variant="xsmall-regular">View All</wcm-text></button>`}};_p.styles=[Bt.globalCss,YU],_p=ZU([jt("wcm-view-all-wallets-button")],_p);const XU=Ht`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var ek=Object.defineProperty,tk=Object.getOwnPropertyDescriptor,el=(t,e,r,i)=>{for(var n=i>1?void 0:i?tk(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&ek(e,r,n),n};let Ec=class extends Ot{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:t}=yr.state;this.uri=t},0)}get overlayEl(){return vt.getShadowRootElement(this,".wcm-qr-container")}render(){return je`<div class="wcm-qr-container">${this.uri?je`<wcm-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${li(this.walletId)}" imageId="${li(this.imageId)}"></wcm-qrcode>`:je`<wcm-spinner></wcm-spinner>`}</div>`}};Ec.styles=[Bt.globalCss,XU],el([xt()],Ec.prototype,"walletId",2),el([xt()],Ec.prototype,"imageId",2),el([Mi()],Ec.prototype,"uri",2),Ec=el([jt("wcm-walletconnect-qr")],Ec);var rk=Object.defineProperty,ik=Object.getOwnPropertyDescriptor,nk=(t,e,r,i)=>{for(var n=i>1?void 0:i?ik(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&rk(e,r,n),n};let Ap=class extends Ot{viewTemplate(){return ct.isAndroid()?je`<wcm-android-wallet-selection></wcm-android-wallet-selection>`:ct.isMobile()?je`<wcm-mobile-wallet-selection></wcm-mobile-wallet-selection>`:je`<wcm-desktop-wallet-selection></wcm-desktop-wallet-selection>`}render(){return je`${this.viewTemplate()}<wcm-legal-notice></wcm-legal-notice>`}};Ap.styles=[Bt.globalCss],Ap=nk([jt("wcm-connect-wallet-view")],Ap);const sk=Ht`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var ok=Object.defineProperty,ak=Object.getOwnPropertyDescriptor,ly=(t,e,r,i)=>{for(var n=i>1?void 0:i?ak(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&ok(e,r,n),n};let tl=class extends Ot{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(t){const{desktop:e,name:r}=ct.getWalletRouterData(),i=e?.native;if(i){const n=ct.formatNativeUrl(i,t,r);ct.openHref(n,"_self")}}openDesktopApp(){const{walletConnectUri:t}=yr.state,e=ct.getWalletRouterData();vt.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=ct.getWalletRouterData(),{isMobile:i,isWeb:n}=vt.getCachedRouterWalletPlatforms();return je`<wcm-modal-header title="${t}" .onAction="${vt.handleUriCopy}" .actionIcon="${Vt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${li(r)}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Connection can continue loading if ${t} is not installed on your device`}</wcm-text><wcm-platform-selection .isMobile="${i}" .isWeb="${n}" .isRetry="${!0}"><wcm-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${Vt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};tl.styles=[Bt.globalCss,sk],ly([Mi()],tl.prototype,"isError",2),tl=ly([jt("wcm-desktop-connecting-view")],tl);const ck=Ht`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var uk=Object.defineProperty,fk=Object.getOwnPropertyDescriptor,hk=(t,e,r,i)=>{for(var n=i>1?void 0:i?fk(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&uk(e,r,n),n};let Ep=class extends Ot{onInstall(t){t&&ct.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:i}=ct.getWalletRouterData();return je`<wcm-modal-header title="${t}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${li(r)}" label="Not Detected" .isStale="${!0}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}</wcm-text><wcm-button .onClick="${()=>this.onInstall(i)}" .iconLeft="${Vt.ARROW_DOWN_ICON}">Download</wcm-button></wcm-info-footer>`}};Ep.styles=[Bt.globalCss,ck],Ep=hk([jt("wcm-install-wallet-view")],Ep);const lk=Ht`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var dk=Object.defineProperty,pk=Object.getOwnPropertyDescriptor,dy=(t,e,r,i)=>{for(var n=i>1?void 0:i?pk(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&dk(e,r,n),n};let rl=class extends Ot{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(t,e=!1){const{mobile:r,name:i}=ct.getWalletRouterData(),n=r?.native,s=r?.universal;if(n&&!e){const a=ct.formatNativeUrl(n,t,i);ct.openHref(a,"_self")}else if(s){const a=ct.formatUniversalUrl(s,t,i);ct.openHref(a,"_self")}}openMobileApp(t=!1){const{walletConnectUri:e}=yr.state,r=ct.getWalletRouterData();vt.setRecentWallet(r),e&&this.onFormatAndRedirect(e,t)}onGoToAppStore(t){t&&ct.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:i,mobile:n}=ct.getWalletRouterData(),{isWeb:s}=vt.getCachedRouterWalletPlatforms(),a=i?.ios,u=n?.universal;return je`<wcm-modal-header title="${t}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${li(r)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer class="wcm-note"><wcm-platform-selection .isWeb="${s}" .isRetry="${!0}"><wcm-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Vt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection>${u?je`<wcm-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></wcm-text>`:null}</wcm-info-footer><wcm-info-footer class="wcm-app-store"><div><wcm-wallet-image walletId="${e}" imageId="${li(r)}"></wcm-wallet-image><wcm-text>${`Get ${t}`}</wcm-text></div><wcm-button .iconRight="${Vt.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(a)}" variant="ghost">App Store</wcm-button></wcm-info-footer>`}};rl.styles=[Bt.globalCss,lk],dy([Mi()],rl.prototype,"isError",2),rl=dy([jt("wcm-mobile-connecting-view")],rl);const gk=Ht`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var vk=Object.defineProperty,mk=Object.getOwnPropertyDescriptor,bk=(t,e,r,i)=>{for(var n=i>1?void 0:i?mk(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&vk(e,r,n),n};let xp=class extends Ot{render(){const{name:t,id:e,image_id:r}=ct.getWalletRouterData(),{isDesktop:i,isWeb:n}=vt.getCachedRouterWalletPlatforms();return je`<wcm-modal-header title="${t}" .onAction="${vt.handleUriCopy}" .actionIcon="${Vt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr walletId="${e}" imageId="${li(r)}"></wcm-walletconnect-qr></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${t} app`}</wcm-text><wcm-platform-selection .isDesktop="${i}" .isWeb="${n}"></wcm-platform-selection></wcm-info-footer>`}};xp.styles=[Bt.globalCss,gk],xp=bk([jt("wcm-mobile-qr-connecting-view")],xp);var yk=Object.defineProperty,wk=Object.getOwnPropertyDescriptor,_k=(t,e,r,i)=>{for(var n=i>1?void 0:i?wk(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&yk(e,r,n),n};let Sp=class extends Ot{render(){return je`<wcm-modal-header title="Scan the code" .onAction="${vt.handleUriCopy}" .actionIcon="${Vt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>`}};Sp.styles=[Bt.globalCss],Sp=_k([jt("wcm-qrcode-view")],Sp);const Ak=Ht`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var Ek=Object.defineProperty,xk=Object.getOwnPropertyDescriptor,Gu=(t,e,r,i)=>{for(var n=i>1?void 0:i?xk(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&Ek(e,r,n),n};const Ip=40;let ca=class extends Ot{constructor(){super(...arguments),this.loading=!Ii.state.wallets.listings.length,this.firstFetch=!Ii.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=vt.debounce(t=>{t.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=t,Ii.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),Ii.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return vt.getShadowRootElement(this,".wcm-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}=Ii.state,{listings:r,total:i}=this.search?e:t;return i<=Ip||r.length>=i}async fetchWallets(){var t;const{wallets:e,search:r}=Ii.state,{listings:i,total:n,page:s}=this.search?r:e;if(!this.endReached&&(this.firstFetch||n>Ip&&i.length<n))try{this.loading=!0;const a=(t=yr.state.chains)==null?void 0:t.join(","),{listings:u}=await Ii.getWallets({page:this.firstFetch?1:s+1,entries:Ip,search:this.search,version:2,chains:a}),d=u.map(p=>vt.getWalletIcon(p));await Promise.all([...d.map(async p=>vt.preloadImage(p)),ct.wait(300)]),this.endReached=this.isLastPage()}catch(a){console.error(a),co.openToast(vt.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){ct.isAndroid()?vt.handleMobileLinking(t):vt.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=Ii.state,{listings:r}=this.search?e:t,i=this.loading&&!r.length,n=this.search.length>=3;let s=mo.manualWalletsTemplate(),a=mo.recomendedWalletsTemplate(!0);n&&(s=s.filter(({values:p})=>vt.caseSafeIncludes(p[0],this.search)),a=a.filter(({values:p})=>vt.caseSafeIncludes(p[0],this.search)));const u=!this.loading&&!r.length&&!a.length,d={"wcm-loading":i,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":u};return je`<wcm-modal-header><wcm-search-input .onChange="${this.onSearchChange.bind(this)}"></wcm-search-input></wcm-modal-header><wcm-modal-content class="${Ts(d)}"><div class="wcm-grid">${i?null:s} ${i?null:a} ${i?null:r.map(p=>je`${p?je`<wcm-wallet-button imageId="${p.image_id}" name="${p.name}" walletId="${p.id}" .onClick="${()=>this.onConnect(p)}"></wcm-wallet-button>`:null}`)}</div><div class="wcm-placeholder-block">${u?je`<wcm-text variant="big-bold" color="secondary">No results found</wcm-text>`:null} ${!u&&this.loading?je`<wcm-spinner></wcm-spinner>`:null}</div></wcm-modal-content>`}};ca.styles=[Bt.globalCss,Ak],Gu([Mi()],ca.prototype,"loading",2),Gu([Mi()],ca.prototype,"firstFetch",2),Gu([Mi()],ca.prototype,"search",2),Gu([Mi()],ca.prototype,"endReached",2),ca=Gu([jt("wcm-wallet-explorer-view")],ca);const Sk=Ht`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var Ik=Object.defineProperty,Mk=Object.getOwnPropertyDescriptor,py=(t,e,r,i)=>{for(var n=i>1?void 0:i?Mk(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&Ik(e,r,n),n};let il=class extends Ot{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(t){const{desktop:e,name:r}=ct.getWalletRouterData(),i=e?.universal;if(i){const n=ct.formatUniversalUrl(i,t,r);ct.openHref(n,"_blank")}}openWebWallet(){const{walletConnectUri:t}=yr.state,e=ct.getWalletRouterData();vt.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=ct.getWalletRouterData(),{isMobile:i,isDesktop:n}=vt.getCachedRouterWalletPlatforms(),s=ct.isMobile();return je`<wcm-modal-header title="${t}" .onAction="${vt.handleUriCopy}" .actionIcon="${Vt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${li(r)}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}</wcm-text><wcm-platform-selection .isMobile="${i}" .isDesktop="${s?!1:n}" .isRetry="${!0}"><wcm-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${Vt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};il.styles=[Bt.globalCss,Sk],py([Mi()],il.prototype,"isError",2),il=py([jt("wcm-web-connecting-view")],il);var Ck=Object.freeze({__proto__:null,get WcmModal(){return Ac},get WcmQrCode(){return Ls}});mn.EthereumProvider=ZT,mn.OPTIONAL_EVENTS=j6,mn.OPTIONAL_METHODS=k6,mn.REQUIRED_EVENTS=Ch,mn.REQUIRED_METHODS=Mh,mn.default=Oh,Object.defineProperty(mn,"__esModule",{value:!0})});
|
|
123
123
|
//# sourceMappingURL=index.umd.js.map
|