magic-sdk 13.3.0 → 13.4.0-b537cbc

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/magic.js CHANGED
@@ -1,6 +1,69 @@
1
- "use strict";var Magic=(()=>{var Un=Object.create;var Ce=Object.defineProperty;var Bn=Object.getOwnPropertyDescriptor;var Fn=Object.getOwnPropertyNames,Xt=Object.getOwnPropertySymbols,Gn=Object.getPrototypeOf,zt=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable;var qt=(e,t,n)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jt=(e,t)=>{for(var n in t||(t={}))zt.call(t,n)&&qt(e,n,t[n]);if(Xt)for(var n of Xt(t))jn.call(t,n)&&qt(e,n,t[n]);return e};var xe=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var Qt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zt=(e,t)=>{for(var n in t)Ce(e,n,{get:t[n],enumerable:!0})},er=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Fn(t))!zt.call(e,s)&&s!==n&&Ce(e,s,{get:()=>t[s],enumerable:!(o=Bn(t,s))||o.enumerable});return e};var tr=(e,t,n)=>(n=e!=null?Un(Gn(e)):{},er(t||!e||!e.__esModule?Ce(n,"default",{value:e,enumerable:!0}):n,e)),kn=e=>er(Ce({},"__esModule",{value:!0}),e);var Re=(e,t,n)=>new Promise((o,s)=>{var c=m=>{try{p(n.next(m))}catch(v){s(v)}},g=m=>{try{p(n.throw(m))}catch(v){s(v)}},p=m=>m.done?o(m.value):Promise.resolve(m.value).then(c,g);p((n=n.apply(e,t)).next())});var Fr=Qt((Br,Nt)=>{(function(e){if(typeof Br=="object"&&typeof Nt<"u")Nt.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t=this,t.localforage=e()}})(function(){var e,t,n;return function o(s,c,g){function p(y,N){if(!c[y]){if(!s[y]){var I=typeof xe=="function"&&xe;if(!N&&I)return I(y,!0);if(m)return m(y,!0);var T=new Error("Cannot find module '"+y+"'");throw T.code="MODULE_NOT_FOUND",T}var P=c[y]={exports:{}};s[y][0].call(P.exports,function(U){var L=s[y][1][U];return p(L||U)},P,P.exports,o,s,c,g)}return c[y].exports}for(var m=typeof xe=="function"&&xe,v=0;v<g.length;v++)p(g[v]);return p}({1:[function(o,s,c){(function(g){"use strict";var p=g.MutationObserver||g.WebKitMutationObserver,m;if(p){var v=0,y=new p(U),N=g.document.createTextNode("");y.observe(N,{characterData:!0}),m=function(){N.data=v=++v%2}}else if(!g.setImmediate&&typeof g.MessageChannel<"u"){var I=new g.MessageChannel;I.port1.onmessage=U,m=function(){I.port2.postMessage(0)}}else"document"in g&&"onreadystatechange"in g.document.createElement("script")?m=function(){var G=g.document.createElement("script");G.onreadystatechange=function(){U(),G.onreadystatechange=null,G.parentNode.removeChild(G),G=null},g.document.documentElement.appendChild(G)}:m=function(){setTimeout(U,0)};var T,P=[];function U(){T=!0;for(var G,J,D=P.length;D;){for(J=P,P=[],G=-1;++G<D;)J[G]();D=P.length}T=!1}s.exports=L;function L(G){P.push(G)===1&&!T&&m()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(o,s,c){"use strict";var g=o(1);function p(){}var m={},v=["REJECTED"],y=["FULFILLED"],N=["PENDING"];s.exports=I;function I(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=N,this.queue=[],this.outcome=void 0,S!==p&&L(this,S)}I.prototype.catch=function(S){return this.then(null,S)},I.prototype.then=function(S,j){if(typeof S!="function"&&this.state===y||typeof j!="function"&&this.state===v)return this;var x=new this.constructor(p);if(this.state!==N){var Y=this.state===y?S:j;P(x,Y,this.outcome)}else this.queue.push(new T(x,S,j));return x};function T(S,j,x){this.promise=S,typeof j=="function"&&(this.onFulfilled=j,this.callFulfilled=this.otherCallFulfilled),typeof x=="function"&&(this.onRejected=x,this.callRejected=this.otherCallRejected)}T.prototype.callFulfilled=function(S){m.resolve(this.promise,S)},T.prototype.otherCallFulfilled=function(S){P(this.promise,this.onFulfilled,S)},T.prototype.callRejected=function(S){m.reject(this.promise,S)},T.prototype.otherCallRejected=function(S){P(this.promise,this.onRejected,S)};function P(S,j,x){g(function(){var Y;try{Y=j(x)}catch(Q){return m.reject(S,Q)}Y===S?m.reject(S,new TypeError("Cannot resolve promise with itself")):m.resolve(S,Y)})}m.resolve=function(S,j){var x=G(U,j);if(x.status==="error")return m.reject(S,x.value);var Y=x.value;if(Y)L(S,Y);else{S.state=y,S.outcome=j;for(var Q=-1,ie=S.queue.length;++Q<ie;)S.queue[Q].callFulfilled(j)}return S},m.reject=function(S,j){S.state=v,S.outcome=j;for(var x=-1,Y=S.queue.length;++x<Y;)S.queue[x].callRejected(j);return S};function U(S){var j=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof j=="function")return function(){j.apply(S,arguments)}}function L(S,j){var x=!1;function Y(se){x||(x=!0,m.reject(S,se))}function Q(se){x||(x=!0,m.resolve(S,se))}function ie(){j(Q,Y)}var ae=G(ie);ae.status==="error"&&Y(ae.value)}function G(S,j){var x={};try{x.value=S(j),x.status="success"}catch(Y){x.status="error",x.value=Y}return x}I.resolve=J;function J(S){return S instanceof this?S:m.resolve(new this(p),S)}I.reject=D;function D(S){var j=new this(p);return m.reject(j,S)}I.all=pe;function pe(S){var j=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=S.length,Y=!1;if(!x)return this.resolve([]);for(var Q=new Array(x),ie=0,ae=-1,se=new this(p);++ae<x;)ce(S[ae],ae);return se;function ce(ye,d){j.resolve(ye).then(_,function(A){Y||(Y=!0,m.reject(se,A))});function _(A){Q[d]=A,++ie===x&&!Y&&(Y=!0,m.resolve(se,Q))}}}I.race=ne;function ne(S){var j=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=S.length,Y=!1;if(!x)return this.resolve([]);for(var Q=-1,ie=new this(p);++Q<x;)ae(S[Q]);return ie;function ae(se){j.resolve(se).then(function(ce){Y||(Y=!0,m.resolve(ie,ce))},function(ce){Y||(Y=!0,m.reject(ie,ce))})}}},{1:1}],3:[function(o,s,c){(function(g){"use strict";typeof g.Promise!="function"&&(g.Promise=o(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(o,s,c){"use strict";var g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};function p(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function m(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var v=m();function y(){try{if(!v||!v.open)return!1;var r=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),a=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!r||a)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function N(r,a){r=r||[],a=a||{};try{return new Blob(r,a)}catch(u){if(u.name!=="TypeError")throw u;for(var i=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,l=new i,f=0;f<r.length;f+=1)l.append(r[f]);return l.getBlob(a.type)}}typeof Promise>"u"&&o(3);var I=Promise;function T(r,a){a&&r.then(function(i){a(null,i)},function(i){a(i)})}function P(r,a,i){typeof a=="function"&&r.then(a),typeof i=="function"&&r.catch(i)}function U(r){return typeof r!="string"&&(console.warn(r+" used as a key, but it is not a string."),r=String(r)),r}function L(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var G="local-forage-detect-blob-support",J=void 0,D={},pe=Object.prototype.toString,ne="readonly",S="readwrite";function j(r){for(var a=r.length,i=new ArrayBuffer(a),l=new Uint8Array(i),f=0;f<a;f++)l[f]=r.charCodeAt(f);return i}function x(r){return new I(function(a){var i=r.transaction(G,S),l=N([""]);i.objectStore(G).put(l,"key"),i.onabort=function(f){f.preventDefault(),f.stopPropagation(),a(!1)},i.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),u=navigator.userAgent.match(/Edge\//);a(u||!f||parseInt(f[1],10)>=43)}}).catch(function(){return!1})}function Y(r){return typeof J=="boolean"?I.resolve(J):x(r).then(function(a){return J=a,J})}function Q(r){var a=D[r.name],i={};i.promise=new I(function(l,f){i.resolve=l,i.reject=f}),a.deferredOperations.push(i),a.dbReady?a.dbReady=a.dbReady.then(function(){return i.promise}):a.dbReady=i.promise}function ie(r){var a=D[r.name],i=a.deferredOperations.pop();if(i)return i.resolve(),i.promise}function ae(r,a){var i=D[r.name],l=i.deferredOperations.pop();if(l)return l.reject(a),l.promise}function se(r,a){return new I(function(i,l){if(D[r.name]=D[r.name]||Z(),r.db)if(a)Q(r),r.db.close();else return i(r.db);var f=[r.name];a&&f.push(r.version);var u=v.open.apply(v,f);a&&(u.onupgradeneeded=function(h){var E=u.result;try{E.createObjectStore(r.storeName),h.oldVersion<=1&&E.createObjectStore(G)}catch(b){if(b.name==="ConstraintError")console.warn('The database "'+r.name+'" has been upgraded from version '+h.oldVersion+" to version "+h.newVersion+', but the storage "'+r.storeName+'" already exists.');else throw b}}),u.onerror=function(h){h.preventDefault(),l(u.error)},u.onsuccess=function(){var h=u.result;h.onversionchange=function(E){E.target.close()},i(h),ie(r)}})}function ce(r){return se(r,!1)}function ye(r){return se(r,!0)}function d(r,a){if(!r.db)return!0;var i=!r.db.objectStoreNames.contains(r.storeName),l=r.version<r.db.version,f=r.version>r.db.version;if(l&&(r.version!==a&&console.warn('The database "'+r.name+`" can't be downgraded from version `+r.db.version+" to version "+r.version+"."),r.version=r.db.version),f||i){if(i){var u=r.db.version+1;u>r.version&&(r.version=u)}return!0}return!1}function _(r){return new I(function(a,i){var l=new FileReader;l.onerror=i,l.onloadend=function(f){var u=btoa(f.target.result||"");a({__local_forage_encoded_blob:!0,data:u,type:r.type})},l.readAsBinaryString(r)})}function A(r){var a=j(atob(r.data));return N([a],{type:r.type})}function M(r){return r&&r.__local_forage_encoded_blob}function $(r){var a=this,i=a._initReady().then(function(){var l=D[a._dbInfo.name];if(l&&l.dbReady)return l.dbReady});return P(i,r,r),i}function C(r){Q(r);for(var a=D[r.name],i=a.forages,l=0;l<i.length;l++){var f=i[l];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null)}return r.db=null,ce(r).then(function(u){return r.db=u,d(r)?ye(r):u}).then(function(u){r.db=a.db=u;for(var h=0;h<i.length;h++)i[h]._dbInfo.db=u}).catch(function(u){throw ae(r,u),u})}function k(r,a,i,l){l===void 0&&(l=1);try{var f=r.db.transaction(r.storeName,a);i(null,f)}catch(u){if(l>0&&(!r.db||u.name==="InvalidStateError"||u.name==="NotFoundError"))return I.resolve().then(function(){if(!r.db||u.name==="NotFoundError"&&!r.db.objectStoreNames.contains(r.storeName)&&r.version<=r.db.version)return r.db&&(r.version=r.db.version+1),ye(r)}).then(function(){return C(r).then(function(){k(r,a,i,l-1)})}).catch(i);i(u)}}function Z(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function be(r){var a=this,i={db:null};if(r)for(var l in r)i[l]=r[l];var f=D[i.name];f||(f=Z(),D[i.name]=f),f.forages.push(a),a._initReady||(a._initReady=a.ready,a.ready=$);var u=[];function h(){return I.resolve()}for(var E=0;E<f.forages.length;E++){var b=f.forages[E];b!==a&&u.push(b._initReady().catch(h))}var w=f.forages.slice(0);return I.all(u).then(function(){return i.db=f.db,ce(i)}).then(function(R){return i.db=R,d(i,a._defaultConfig.version)?ye(i):R}).then(function(R){i.db=f.db=R,a._dbInfo=i;for(var O=0;O<w.length;O++){var B=w[O];B!==a&&(B._dbInfo.db=i.db,B._dbInfo.version=i.version)}})}function Ee(r,a){var i=this;r=U(r);var l=new I(function(f,u){i.ready().then(function(){k(i._dbInfo,ne,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),w=b.get(r);w.onsuccess=function(){var R=w.result;R===void 0&&(R=null),M(R)&&(R=A(R)),f(R)},w.onerror=function(){u(w.error)}}catch(R){u(R)}})}).catch(u)});return T(l,a),l}function $e(r,a){var i=this,l=new I(function(f,u){i.ready().then(function(){k(i._dbInfo,ne,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),w=b.openCursor(),R=1;w.onsuccess=function(){var O=w.result;if(O){var B=O.value;M(B)&&(B=A(B));var W=r(B,O.key,R++);W!==void 0?f(W):O.continue()}else f()},w.onerror=function(){u(w.error)}}catch(O){u(O)}})}).catch(u)});return T(l,a),l}function kr(r,a,i){var l=this;r=U(r);var f=new I(function(u,h){var E;l.ready().then(function(){return E=l._dbInfo,pe.call(a)==="[object Blob]"?Y(E.db).then(function(b){return b?a:_(a)}):a}).then(function(b){k(l._dbInfo,S,function(w,R){if(w)return h(w);try{var O=R.objectStore(l._dbInfo.storeName);b===null&&(b=void 0);var B=O.put(b,r);R.oncomplete=function(){b===void 0&&(b=null),u(b)},R.onabort=R.onerror=function(){var W=B.error?B.error:B.transaction.error;h(W)}}catch(W){h(W)}})}).catch(h)});return T(f,i),f}function Wr(r,a){var i=this;r=U(r);var l=new I(function(f,u){i.ready().then(function(){k(i._dbInfo,S,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),w=b.delete(r);E.oncomplete=function(){f()},E.onerror=function(){u(w.error)},E.onabort=function(){var R=w.error?w.error:w.transaction.error;u(R)}}catch(R){u(R)}})}).catch(u)});return T(l,a),l}function Yr(r){var a=this,i=new I(function(l,f){a.ready().then(function(){k(a._dbInfo,S,function(u,h){if(u)return f(u);try{var E=h.objectStore(a._dbInfo.storeName),b=E.clear();h.oncomplete=function(){l()},h.onabort=h.onerror=function(){var w=b.error?b.error:b.transaction.error;f(w)}}catch(w){f(w)}})}).catch(f)});return T(i,r),i}function Hr(r){var a=this,i=new I(function(l,f){a.ready().then(function(){k(a._dbInfo,ne,function(u,h){if(u)return f(u);try{var E=h.objectStore(a._dbInfo.storeName),b=E.count();b.onsuccess=function(){l(b.result)},b.onerror=function(){f(b.error)}}catch(w){f(w)}})}).catch(f)});return T(i,r),i}function Kr(r,a){var i=this,l=new I(function(f,u){if(r<0){f(null);return}i.ready().then(function(){k(i._dbInfo,ne,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),w=!1,R=b.openKeyCursor();R.onsuccess=function(){var O=R.result;if(!O){f(null);return}r===0||w?f(O.key):(w=!0,O.advance(r))},R.onerror=function(){u(R.error)}}catch(O){u(O)}})}).catch(u)});return T(l,a),l}function Vr(r){var a=this,i=new I(function(l,f){a.ready().then(function(){k(a._dbInfo,ne,function(u,h){if(u)return f(u);try{var E=h.objectStore(a._dbInfo.storeName),b=E.openKeyCursor(),w=[];b.onsuccess=function(){var R=b.result;if(!R){l(w);return}w.push(R.key),R.continue()},b.onerror=function(){f(b.error)}}catch(R){f(R)}})}).catch(f)});return T(i,r),i}function Xr(r,a){a=L.apply(this,arguments);var i=this.config();r=typeof r!="function"&&r||{},r.name||(r.name=r.name||i.name,r.storeName=r.storeName||i.storeName);var l=this,f;if(!r.name)f=I.reject("Invalid arguments");else{var u=r.name===i.name&&l._dbInfo.db,h=u?I.resolve(l._dbInfo.db):ce(r).then(function(E){var b=D[r.name],w=b.forages;b.db=E;for(var R=0;R<w.length;R++)w[R]._dbInfo.db=E;return E});r.storeName?f=h.then(function(E){if(!!E.objectStoreNames.contains(r.storeName)){var b=E.version+1;Q(r);var w=D[r.name],R=w.forages;E.close();for(var O=0;O<R.length;O++){var B=R[O];B._dbInfo.db=null,B._dbInfo.version=b}var W=new I(function(H,q){var V=v.open(r.name,b);V.onerror=function(ue){var De=V.result;De.close(),q(ue)},V.onupgradeneeded=function(){var ue=V.result;ue.deleteObjectStore(r.storeName)},V.onsuccess=function(){var ue=V.result;ue.close(),H(ue)}});return W.then(function(H){w.db=H;for(var q=0;q<R.length;q++){var V=R[q];V._dbInfo.db=H,ie(V._dbInfo)}}).catch(function(H){throw(ae(r,H)||I.resolve()).catch(function(){}),H})}}):f=h.then(function(E){Q(r);var b=D[r.name],w=b.forages;E.close();for(var R=0;R<w.length;R++){var O=w[R];O._dbInfo.db=null}var B=new I(function(W,H){var q=v.deleteDatabase(r.name);q.onerror=function(){var V=q.result;V&&V.close(),H(q.error)},q.onblocked=function(){console.warn('dropInstance blocked for database "'+r.name+'" until all open connections are closed')},q.onsuccess=function(){var V=q.result;V&&V.close(),W(V)}});return B.then(function(W){b.db=W;for(var H=0;H<w.length;H++){var q=w[H];ie(q._dbInfo)}}).catch(function(W){throw(ae(r,W)||I.resolve()).catch(function(){}),W})})}return T(f,a),f}var qr={_driver:"asyncStorage",_initStorage:be,_support:y(),iterate:$e,getItem:Ee,setItem:kr,removeItem:Wr,clear:Yr,length:Hr,key:Kr,keys:Vr,dropInstance:Xr};function zr(){return typeof openDatabase=="function"}var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jr="~~local_forage_type~",Ot=/^~~local_forage_type~([^~]+)~/,He="__lfsc__:",ut=He.length,ct="arbf",lt="blob",Lt="si08",Mt="ui08",$t="uic8",Pt="si16",Dt="si32",Ct="ur16",xt="ui32",Ut="fl32",Bt="fl64",Ft=ut+ct.length,Gt=Object.prototype.toString;function jt(r){var a=r.length*.75,i=r.length,l,f=0,u,h,E,b;r[r.length-1]==="="&&(a--,r[r.length-2]==="="&&a--);var w=new ArrayBuffer(a),R=new Uint8Array(w);for(l=0;l<i;l+=4)u=me.indexOf(r[l]),h=me.indexOf(r[l+1]),E=me.indexOf(r[l+2]),b=me.indexOf(r[l+3]),R[f++]=u<<2|h>>4,R[f++]=(h&15)<<4|E>>2,R[f++]=(E&3)<<6|b&63;return w}function ft(r){var a=new Uint8Array(r),i="",l;for(l=0;l<a.length;l+=3)i+=me[a[l]>>2],i+=me[(a[l]&3)<<4|a[l+1]>>4],i+=me[(a[l+1]&15)<<2|a[l+2]>>6],i+=me[a[l+2]&63];return a.length%3===2?i=i.substring(0,i.length-1)+"=":a.length%3===1&&(i=i.substring(0,i.length-2)+"=="),i}function Qr(r,a){var i="";if(r&&(i=Gt.call(r)),r&&(i==="[object ArrayBuffer]"||r.buffer&&Gt.call(r.buffer)==="[object ArrayBuffer]")){var l,f=He;r instanceof ArrayBuffer?(l=r,f+=ct):(l=r.buffer,i==="[object Int8Array]"?f+=Lt:i==="[object Uint8Array]"?f+=Mt:i==="[object Uint8ClampedArray]"?f+=$t:i==="[object Int16Array]"?f+=Pt:i==="[object Uint16Array]"?f+=Ct:i==="[object Int32Array]"?f+=Dt:i==="[object Uint32Array]"?f+=xt:i==="[object Float32Array]"?f+=Ut:i==="[object Float64Array]"?f+=Bt:a(new Error("Failed to get type for BinaryArray"))),a(f+ft(l))}else if(i==="[object Blob]"){var u=new FileReader;u.onload=function(){var h=Jr+r.type+"~"+ft(this.result);a(He+lt+h)},u.readAsArrayBuffer(r)}else try{a(JSON.stringify(r))}catch(h){console.error("Couldn't convert value into a JSON string: ",r),a(null,h)}}function Zr(r){if(r.substring(0,ut)!==He)return JSON.parse(r);var a=r.substring(Ft),i=r.substring(ut,Ft),l;if(i===lt&&Ot.test(a)){var f=a.match(Ot);l=f[1],a=a.substring(f[0].length)}var u=jt(a);switch(i){case ct:return u;case lt:return N([u],{type:l});case Lt:return new Int8Array(u);case Mt:return new Uint8Array(u);case $t:return new Uint8ClampedArray(u);case Pt:return new Int16Array(u);case Ct:return new Uint16Array(u);case Dt:return new Int32Array(u);case xt:return new Uint32Array(u);case Ut:return new Float32Array(u);case Bt:return new Float64Array(u);default:throw new Error("Unkown type: "+i)}}var dt={serialize:Qr,deserialize:Zr,stringToBuffer:jt,bufferToString:ft};function kt(r,a,i,l){r.executeSql("CREATE TABLE IF NOT EXISTS "+a.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],i,l)}function en(r){var a=this,i={db:null};if(r)for(var l in r)i[l]=typeof r[l]!="string"?r[l].toString():r[l];var f=new I(function(u,h){try{i.db=openDatabase(i.name,String(i.version),i.description,i.size)}catch(E){return h(E)}i.db.transaction(function(E){kt(E,i,function(){a._dbInfo=i,u()},function(b,w){h(w)})},h)});return i.serializer=dt,f}function ve(r,a,i,l,f,u){r.executeSql(i,l,f,function(h,E){E.code===E.SYNTAX_ERR?h.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[a.storeName],function(b,w){w.rows.length?u(b,E):kt(b,a,function(){b.executeSql(i,l,f,u)},u)},u):u(h,E)},u)}function tn(r,a){var i=this;r=U(r);var l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"SELECT * FROM "+h.storeName+" WHERE key = ? LIMIT 1",[r],function(b,w){var R=w.rows.length?w.rows.item(0).value:null;R&&(R=h.serializer.deserialize(R)),f(R)},function(b,w){u(w)})})}).catch(u)});return T(l,a),l}function rn(r,a){var i=this,l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"SELECT * FROM "+h.storeName,[],function(b,w){for(var R=w.rows,O=R.length,B=0;B<O;B++){var W=R.item(B),H=W.value;if(H&&(H=h.serializer.deserialize(H)),H=r(H,W.key,B+1),H!==void 0){f(H);return}}f()},function(b,w){u(w)})})}).catch(u)});return T(l,a),l}function Wt(r,a,i,l){var f=this;r=U(r);var u=new I(function(h,E){f.ready().then(function(){a===void 0&&(a=null);var b=a,w=f._dbInfo;w.serializer.serialize(a,function(R,O){O?E(O):w.db.transaction(function(B){ve(B,w,"INSERT OR REPLACE INTO "+w.storeName+" (key, value) VALUES (?, ?)",[r,R],function(){h(b)},function(W,H){E(H)})},function(B){if(B.code===B.QUOTA_ERR){if(l>0){h(Wt.apply(f,[r,b,i,l-1]));return}E(B)}})})}).catch(E)});return T(u,i),u}function nn(r,a,i){return Wt.apply(this,[r,a,i,1])}function on(r,a){var i=this;r=U(r);var l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"DELETE FROM "+h.storeName+" WHERE key = ?",[r],function(){f()},function(b,w){u(w)})})}).catch(u)});return T(l,a),l}function an(r){var a=this,i=new I(function(l,f){a.ready().then(function(){var u=a._dbInfo;u.db.transaction(function(h){ve(h,u,"DELETE FROM "+u.storeName,[],function(){l()},function(E,b){f(b)})})}).catch(f)});return T(i,r),i}function sn(r){var a=this,i=new I(function(l,f){a.ready().then(function(){var u=a._dbInfo;u.db.transaction(function(h){ve(h,u,"SELECT COUNT(key) as c FROM "+u.storeName,[],function(E,b){var w=b.rows.item(0).c;l(w)},function(E,b){f(b)})})}).catch(f)});return T(i,r),i}function un(r,a){var i=this,l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"SELECT key FROM "+h.storeName+" WHERE id = ? LIMIT 1",[r+1],function(b,w){var R=w.rows.length?w.rows.item(0).key:null;f(R)},function(b,w){u(w)})})}).catch(u)});return T(l,a),l}function cn(r){var a=this,i=new I(function(l,f){a.ready().then(function(){var u=a._dbInfo;u.db.transaction(function(h){ve(h,u,"SELECT key FROM "+u.storeName,[],function(E,b){for(var w=[],R=0;R<b.rows.length;R++)w.push(b.rows.item(R).key);l(w)},function(E,b){f(b)})})}).catch(f)});return T(i,r),i}function ln(r){return new I(function(a,i){r.transaction(function(l){l.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,u){for(var h=[],E=0;E<u.rows.length;E++)h.push(u.rows.item(E).name);a({db:r,storeNames:h})},function(f,u){i(u)})},function(l){i(l)})})}function fn(r,a){a=L.apply(this,arguments);var i=this.config();r=typeof r!="function"&&r||{},r.name||(r.name=r.name||i.name,r.storeName=r.storeName||i.storeName);var l=this,f;return r.name?f=new I(function(u){var h;r.name===i.name?h=l._dbInfo.db:h=openDatabase(r.name,"","",0),r.storeName?u({db:h,storeNames:[r.storeName]}):u(ln(h))}).then(function(u){return new I(function(h,E){u.db.transaction(function(b){function w(W){return new I(function(H,q){b.executeSql("DROP TABLE IF EXISTS "+W,[],function(){H()},function(V,ue){q(ue)})})}for(var R=[],O=0,B=u.storeNames.length;O<B;O++)R.push(w(u.storeNames[O]));I.all(R).then(function(){h()}).catch(function(W){E(W)})},function(b){E(b)})})}):f=I.reject("Invalid arguments"),T(f,a),f}var dn={_driver:"webSQLStorage",_initStorage:en,_support:zr(),iterate:rn,getItem:tn,setItem:nn,removeItem:on,clear:an,length:sn,key:un,keys:cn,dropInstance:fn};function hn(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Yt(r,a){var i=r.name+"/";return r.storeName!==a.storeName&&(i+=r.storeName+"/"),i}function pn(){var r="_localforage_support_test";try{return localStorage.setItem(r,!0),localStorage.removeItem(r),!1}catch{return!0}}function mn(){return!pn()||localStorage.length>0}function vn(r){var a=this,i={};if(r)for(var l in r)i[l]=r[l];return i.keyPrefix=Yt(r,a._defaultConfig),mn()?(a._dbInfo=i,i.serializer=dt,I.resolve()):I.reject()}function gn(r){var a=this,i=a.ready().then(function(){for(var l=a._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var u=localStorage.key(f);u.indexOf(l)===0&&localStorage.removeItem(u)}});return T(i,r),i}function yn(r,a){var i=this;r=U(r);var l=i.ready().then(function(){var f=i._dbInfo,u=localStorage.getItem(f.keyPrefix+r);return u&&(u=f.serializer.deserialize(u)),u});return T(l,a),l}function En(r,a){var i=this,l=i.ready().then(function(){for(var f=i._dbInfo,u=f.keyPrefix,h=u.length,E=localStorage.length,b=1,w=0;w<E;w++){var R=localStorage.key(w);if(R.indexOf(u)===0){var O=localStorage.getItem(R);if(O&&(O=f.serializer.deserialize(O)),O=r(O,R.substring(h),b++),O!==void 0)return O}}});return T(l,a),l}function _n(r,a){var i=this,l=i.ready().then(function(){var f=i._dbInfo,u;try{u=localStorage.key(r)}catch{u=null}return u&&(u=u.substring(f.keyPrefix.length)),u});return T(l,a),l}function In(r){var a=this,i=a.ready().then(function(){for(var l=a._dbInfo,f=localStorage.length,u=[],h=0;h<f;h++){var E=localStorage.key(h);E.indexOf(l.keyPrefix)===0&&u.push(E.substring(l.keyPrefix.length))}return u});return T(i,r),i}function bn(r){var a=this,i=a.keys().then(function(l){return l.length});return T(i,r),i}function wn(r,a){var i=this;r=U(r);var l=i.ready().then(function(){var f=i._dbInfo;localStorage.removeItem(f.keyPrefix+r)});return T(l,a),l}function Rn(r,a,i){var l=this;r=U(r);var f=l.ready().then(function(){a===void 0&&(a=null);var u=a;return new I(function(h,E){var b=l._dbInfo;b.serializer.serialize(a,function(w,R){if(R)E(R);else try{localStorage.setItem(b.keyPrefix+r,w),h(u)}catch(O){(O.name==="QuotaExceededError"||O.name==="NS_ERROR_DOM_QUOTA_REACHED")&&E(O),E(O)}})})});return T(f,i),f}function An(r,a){if(a=L.apply(this,arguments),r=typeof r!="function"&&r||{},!r.name){var i=this.config();r.name=r.name||i.name,r.storeName=r.storeName||i.storeName}var l=this,f;return r.name?f=new I(function(u){r.storeName?u(Yt(r,l._defaultConfig)):u(r.name+"/")}).then(function(u){for(var h=localStorage.length-1;h>=0;h--){var E=localStorage.key(h);E.indexOf(u)===0&&localStorage.removeItem(E)}}):f=I.reject("Invalid arguments"),T(f,a),f}var Sn={_driver:"localStorageWrapper",_initStorage:vn,_support:hn(),iterate:En,getItem:yn,setItem:Rn,removeItem:wn,clear:gn,length:bn,key:_n,keys:In,dropInstance:An},Nn=function(a,i){return a===i||typeof a=="number"&&typeof i=="number"&&isNaN(a)&&isNaN(i)},Tn=function(a,i){for(var l=a.length,f=0;f<l;){if(Nn(a[f],i))return!0;f++}return!1},Ht=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"},Pe={},Kt={},we={INDEXEDDB:qr,WEBSQL:dn,LOCALSTORAGE:Sn},On=[we.INDEXEDDB._driver,we.WEBSQL._driver,we.LOCALSTORAGE._driver],Ke=["dropInstance"],ht=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ke),Ln={description:"",driver:On.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Mn(r,a){r[a]=function(){var i=arguments;return r.ready().then(function(){return r[a].apply(r,i)})}}function pt(){for(var r=1;r<arguments.length;r++){var a=arguments[r];if(a)for(var i in a)a.hasOwnProperty(i)&&(Ht(a[i])?arguments[0][i]=a[i].slice():arguments[0][i]=a[i])}return arguments[0]}var $n=function(){function r(a){p(this,r);for(var i in we)if(we.hasOwnProperty(i)){var l=we[i],f=l._driver;this[i]=f,Pe[f]||this.defineDriver(l)}this._defaultConfig=pt({},Ln),this._config=pt({},this._defaultConfig,a),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return r.prototype.config=function(i){if((typeof i>"u"?"undefined":g(i))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var l in i){if(l==="storeName"&&(i[l]=i[l].replace(/\W/g,"_")),l==="version"&&typeof i[l]!="number")return new Error("Database version must be a number.");this._config[l]=i[l]}return"driver"in i&&i.driver?this.setDriver(this._config.driver):!0}else return typeof i=="string"?this._config[i]:this._config},r.prototype.defineDriver=function(i,l,f){var u=new I(function(h,E){try{var b=i._driver,w=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!i._driver){E(w);return}for(var R=ht.concat("_initStorage"),O=0,B=R.length;O<B;O++){var W=R[O],H=!Tn(Ke,W);if((H||i[W])&&typeof i[W]!="function"){E(w);return}}var q=function(){for(var De=function(Cn){return function(){var xn=new Error("Method "+Cn+" is not implemented by the current driver"),Vt=I.reject(xn);return T(Vt,arguments[arguments.length-1]),Vt}},mt=0,Dn=Ke.length;mt<Dn;mt++){var vt=Ke[mt];i[vt]||(i[vt]=De(vt))}};q();var V=function(De){Pe[b]&&console.info("Redefining LocalForage driver: "+b),Pe[b]=i,Kt[b]=De,h()};"_support"in i?i._support&&typeof i._support=="function"?i._support().then(V,E):V(!!i._support):V(!0)}catch(ue){E(ue)}});return P(u,l,f),u},r.prototype.driver=function(){return this._driver||null},r.prototype.getDriver=function(i,l,f){var u=Pe[i]?I.resolve(Pe[i]):I.reject(new Error("Driver not found."));return P(u,l,f),u},r.prototype.getSerializer=function(i){var l=I.resolve(dt);return P(l,i),l},r.prototype.ready=function(i){var l=this,f=l._driverSet.then(function(){return l._ready===null&&(l._ready=l._initDriver()),l._ready});return P(f,i,i),f},r.prototype.setDriver=function(i,l,f){var u=this;Ht(i)||(i=[i]);var h=this._getSupportedDrivers(i);function E(){u._config.driver=u.driver()}function b(O){return u._extend(O),E(),u._ready=u._initStorage(u._config),u._ready}function w(O){return function(){var B=0;function W(){for(;B<O.length;){var H=O[B];return B++,u._dbInfo=null,u._ready=null,u.getDriver(H).then(b).catch(W)}E();var q=new Error("No available storage method found.");return u._driverSet=I.reject(q),u._driverSet}return W()}}var R=this._driverSet!==null?this._driverSet.catch(function(){return I.resolve()}):I.resolve();return this._driverSet=R.then(function(){var O=h[0];return u._dbInfo=null,u._ready=null,u.getDriver(O).then(function(B){u._driver=B._driver,E(),u._wrapLibraryMethodsWithReady(),u._initDriver=w(h)})}).catch(function(){E();var O=new Error("No available storage method found.");return u._driverSet=I.reject(O),u._driverSet}),P(this._driverSet,l,f),this._driverSet},r.prototype.supports=function(i){return!!Kt[i]},r.prototype._extend=function(i){pt(this,i)},r.prototype._getSupportedDrivers=function(i){for(var l=[],f=0,u=i.length;f<u;f++){var h=i[f];this.supports(h)&&l.push(h)}return l},r.prototype._wrapLibraryMethodsWithReady=function(){for(var i=0,l=ht.length;i<l;i++)Mn(this,ht[i])},r.prototype.createInstance=function(i){return new r(i)},r}(),Pn=new $n;s.exports=Pn},{3:3}]},{},[4])(4)})});var jr=Qt((ot,Gr)=>{(function(e,t){typeof ot=="object"&&typeof Gr<"u"?t(ot):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],t):t(e.LocalforageDriverMemory={})})(typeof self<"u"?self:ot,function(e){"use strict";var t="localforage-driver-memory";function n(d){var _=typeof Symbol=="function"&&d[Symbol.iterator],A=0;return _?_.call(d):{next:function(){return d&&A>=d.length&&(d=void 0),{value:d&&d[A++],done:!d}}}}function o(d,_){d=d||[],_=_||{};try{return new Blob(d,_)}catch(C){if(C.name!=="TypeError")throw C;for(var A=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,M=new A,$=0;$<d.length;$+=1)M.append(d[$]);return M.getBlob(_.type)}}var s=/^~~local_forage_type~([^~]+)~/,c=9,g=c+4,p=Object.prototype.toString;function m(d){var _=d.length*.75,A=d.length;d[d.length-1]==="="&&(_--,d[d.length-2]==="="&&_--);for(var M=new ArrayBuffer(_),$=new Uint8Array(M),C=0,k=0;C<A;C+=4){var Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[C]),be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[C+1]),Ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[C+2]),$e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[C+3]);$[k++]=Z<<2|be>>4,$[k++]=(be&15)<<4|Ee>>2,$[k++]=(Ee&3)<<6|$e&63}return M}function v(d){for(var _=new Uint8Array(d),A="",M=0;M<_.length;M+=3)A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_[M]>>2],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(_[M]&3)<<4|_[M+1]>>4],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(_[M+1]&15)<<2|_[M+2]>>6],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_[M+2]&63];return _.length%3===2?A=A.substring(0,A.length-1)+"=":_.length%3===1&&(A=A.substring(0,A.length-2)+"=="),A}function y(d,_){var A="";if(d&&(A=p.call(d)),d&&(A==="[object ArrayBuffer]"||d.buffer&&p.call(d.buffer)==="[object ArrayBuffer]")){var M=void 0,$="__lfsc__:";d instanceof ArrayBuffer?(M=d,$+="arbf"):(M=d.buffer,A==="[object Int8Array]"?$+="si08":A==="[object Uint8Array]"?$+="ui08":A==="[object Uint8ClampedArray]"?$+="uic8":A==="[object Int16Array]"?$+="si16":A==="[object Uint16Array]"?$+="ur16":A==="[object Int32Array]"?$+="si32":A==="[object Uint32Array]"?$+="ui32":A==="[object Float32Array]"?$+="fl32":A==="[object Float64Array]"?$+="fl64":_(new Error("Failed to get type for BinaryArray"))),_($+v(M))}else if(A==="[object Blob]"){var C=new FileReader;C.onload=function(){var k="~~local_forage_type~"+d.type+"~"+v(this.result);_("__lfsc__:blob"+k)},C.readAsArrayBuffer(d)}else try{_(JSON.stringify(d))}catch(k){console.error("Couldn't convert value into a JSON string: ",d),_(null,k)}}function N(d){if(d.substring(0,c)!=="__lfsc__:")return JSON.parse(d);var _=d.substring(g),A=d.substring(c,g),M;if(A==="blob"&&s.test(_)){var $=_.match(s);M=$[1],_=_.substring($[0].length)}var C=m(_);switch(A){case"arbf":return C;case"blob":return o([C],{type:M});case"si08":return new Int8Array(C);case"ui08":return new Uint8Array(C);case"uic8":return new Uint8ClampedArray(C);case"si16":return new Int16Array(C);case"ur16":return new Uint16Array(C);case"si32":return new Int32Array(C);case"ui32":return new Uint32Array(C);case"fl32":return new Float32Array(C);case"fl64":return new Float64Array(C);default:throw new Error("Unkown type: "+A)}}function I(d){var _,A;if(d===null||typeof d!="object"||"isActiveClone"in d)return d;var M=d instanceof Date?new Date(d):d.constructor();try{for(var $=n(Object.keys(d)),C=$.next();!C.done;C=$.next()){var k=C.value;Object.prototype.hasOwnProperty.call(d,k)&&(d.isActiveClone=null,M[k]=I(d[k]),delete d.isActiveClone)}}catch(Z){_={error:Z}}finally{try{C&&!C.done&&(A=$.return)&&A.call($)}finally{if(_)throw _.error}}return M}function T(d,_){return(d.name||_.name)+"/"+(d.storeName||_.storeName)+"/"}function P(d,_){_&&d.then(function(A){_(null,A)},function(A){_(A)})}function U(){for(var d=[],_=0;_<arguments.length;_++)d[_]=arguments[_];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function L(d,_){var A=this;if(_=U.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var M=this.config();d.name=d.name||M.name,d.storeName=d.storeName||M.storeName}var $;return d.name?$=new Promise(function(C){d.storeName?C(T(d,A._defaultConfig)):C(d.name+"/")}):$=Promise.reject("Invalid arguments"),{promise:$,callback:_}}function G(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}var J={bufferToString:v,deserialize:N,serialize:y,stringToBuffer:m},D={},pe=function(){function d(_){this.kp=_,this.data={}}return d.resolve=function(_){return D[_]||(D[_]=new d(_)),D[_]},d.prototype.clear=function(){this.data={}},d.prototype.drop=function(){this.clear(),delete D[this.kp]},d.prototype.get=function(_){return this.data[_]},d.prototype.key=function(_){return this.keys()[_]},d.prototype.keys=function(){return Object.keys(this.data)},d.prototype.rm=function(_){delete this.data[_]},d.prototype.set=function(_,A){this.data[_]=A},d}();function ne(d){var _=d?I(d):{},A=T(_,this._defaultConfig),M=pe.resolve(A);return this._dbInfo=_,this._dbInfo.serializer=J,this._dbInfo.keyPrefix=A,this._dbInfo.mStore=M,Promise.resolve()}function S(d){var _=this,A=this.ready().then(function(){_._dbInfo.mStore.clear()});return P(A,d),A}function j(d,_){var A=L.apply(this,arguments),M=A.promise,$=A.callback,C=M.then(function(k){pe.resolve(k).drop()});return P(C,$),M}function x(d,_){var A=this;d=G(d);var M=this.ready().then(function(){var $=A._dbInfo.mStore.get(d);return $==null?null:A._dbInfo.serializer.deserialize($)});return P(M,_),M}function Y(d,_){var A=this,M=this.ready().then(function(){for(var $=A._dbInfo.mStore,C=$.keys(),k=0;k<C.length;k++){var Z=$.get(C[k]);if(Z&&(Z=A._dbInfo.serializer.deserialize(Z)),Z=d(Z,C[k],k+1),Z!==void 0)return Z}});return P(M,_),M}function Q(d,_){var A=this,M=this.ready().then(function(){var $;try{$=A._dbInfo.mStore.key(d),$===void 0&&($=null)}catch{$=null}return $});return P(M,_),M}function ie(d){var _=this,A=this.ready().then(function(){return _._dbInfo.mStore.keys()});return P(A,d),A}function ae(d){var _=this.keys().then(function(A){return A.length});return P(_,d),_}function se(d,_){var A=this;d=G(d);var M=this.ready().then(function(){A._dbInfo.mStore.rm(d)});return P(M,_),M}function ce(d,_,A){var M=this;d=G(d);var $=this.ready().then(function(){_===void 0&&(_=null);var C=_;return new Promise(function(k,Z){M._dbInfo.serializer.serialize(_,function(be,Ee){if(Ee)Z(Ee);else try{M._dbInfo.mStore.set(d,be),k(C)}catch($e){Z($e)}})})});return P($,A),$}var ye=!0;e._support=ye,e._driver=t,e._initStorage=ne,e.clear=S,e.dropInstance=j,e.getItem=x,e.iterate=Y,e.key=Q,e.keys=ie,e.length=ae,e.removeItem=se,e.setItem=ce,Object.defineProperty(e,"__esModule",{value:!0})})});var Fo={};Zt(Fo,{default:()=>Bo});var le=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(le||{}),Ae=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e))(Ae||{}),Se=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))(Se||{}),F=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="mc_get_wallet_info",e.ShowUI="mc_wallet",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.UpdatePhoneNumber="magic_auth_update_phone_number",e.UpdatePhoneNumberTestMode="magic_auth_update_phone_number_testing_mode",e))(F||{}),fe=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e))(fe||{}),_e=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(_e||{}),rr=(e=>(e.Harmony="HARMONY",e))(rr||{});var Wn=Object.create,nt=Object.defineProperty,Yn=Object.defineProperties,Hn=Object.getOwnPropertyDescriptor,Kn=Object.getOwnPropertyDescriptors,Vn=Object.getOwnPropertyNames,nr=Object.getOwnPropertySymbols,Xn=Object.getPrototypeOf,gr=Object.prototype.hasOwnProperty,qn=Object.prototype.propertyIsEnumerable,ir=(e,t,n)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yr=(e,t)=>{for(var n in t||(t={}))gr.call(t,n)&&ir(e,n,t[n]);if(nr)for(var n of nr(t))qn.call(t,n)&&ir(e,n,t[n]);return e},zn=(e,t)=>Yn(e,Kn(t)),Jn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Qn=(e,t)=>{for(var n in t)nt(e,n,{get:t[n],enumerable:!0})},Zn=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Vn(t))!gr.call(e,s)&&s!==n&&nt(e,s,{get:()=>t[s],enumerable:!(o=Hn(t,s))||o.enumerable});return e},ei=(e,t,n)=>(n=e!=null?Wn(Xn(e)):{},Zn(t||!e||!e.__esModule?nt(n,"default",{value:e,enumerable:!0}):n,e)),de=(e,t,n)=>new Promise((o,s)=>{var c=m=>{try{p(n.next(m))}catch(v){s(v)}},g=m=>{try{p(n.throw(m))}catch(v){s(v)}},p=m=>m.done?o(m.value):Promise.resolve(m.value).then(c,g);p((n=n.apply(e,t)).next())}),ti=Jn((e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty,o="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(o=!1));function c(v,y,N){this.fn=v,this.context=y,this.once=N||!1}function g(v,y,N,I,T){if(typeof N!="function")throw new TypeError("The listener must be a function");var P=new c(N,I||v,T),U=o?o+y:y;return v._events[U]?v._events[U].fn?v._events[U]=[v._events[U],P]:v._events[U].push(P):(v._events[U]=P,v._eventsCount++),v}function p(v,y){--v._eventsCount===0?v._events=new s:delete v._events[y]}function m(){this._events=new s,this._eventsCount=0}m.prototype.eventNames=function(){var v=[],y,N;if(this._eventsCount===0)return v;for(N in y=this._events)n.call(y,N)&&v.push(o?N.slice(1):N);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(y)):v},m.prototype.listeners=function(v){var y=o?o+v:v,N=this._events[y];if(!N)return[];if(N.fn)return[N.fn];for(var I=0,T=N.length,P=new Array(T);I<T;I++)P[I]=N[I].fn;return P},m.prototype.listenerCount=function(v){var y=o?o+v:v,N=this._events[y];return N?N.fn?1:N.length:0},m.prototype.emit=function(v,y,N,I,T,P){var U=o?o+v:v;if(!this._events[U])return!1;var L=this._events[U],G=arguments.length,J,D;if(L.fn){switch(L.once&&this.removeListener(v,L.fn,void 0,!0),G){case 1:return L.fn.call(L.context),!0;case 2:return L.fn.call(L.context,y),!0;case 3:return L.fn.call(L.context,y,N),!0;case 4:return L.fn.call(L.context,y,N,I),!0;case 5:return L.fn.call(L.context,y,N,I,T),!0;case 6:return L.fn.call(L.context,y,N,I,T,P),!0}for(D=1,J=new Array(G-1);D<G;D++)J[D-1]=arguments[D];L.fn.apply(L.context,J)}else{var pe=L.length,ne;for(D=0;D<pe;D++)switch(L[D].once&&this.removeListener(v,L[D].fn,void 0,!0),G){case 1:L[D].fn.call(L[D].context);break;case 2:L[D].fn.call(L[D].context,y);break;case 3:L[D].fn.call(L[D].context,y,N);break;case 4:L[D].fn.call(L[D].context,y,N,I);break;default:if(!J)for(ne=1,J=new Array(G-1);ne<G;ne++)J[ne-1]=arguments[ne];L[D].fn.apply(L[D].context,J)}}return!0},m.prototype.on=function(v,y,N){return g(this,v,y,N,!1)},m.prototype.once=function(v,y,N){return g(this,v,y,N,!0)},m.prototype.removeListener=function(v,y,N,I){var T=o?o+v:v;if(!this._events[T])return this;if(!y)return p(this,T),this;var P=this._events[T];if(P.fn)P.fn===y&&(!I||P.once)&&(!N||P.context===N)&&p(this,T);else{for(var U=0,L=[],G=P.length;U<G;U++)(P[U].fn!==y||I&&!P[U].once||N&&P[U].context!==N)&&L.push(P[U]);L.length?this._events[T]=L.length===1?L[0]:L:p(this,T)}return this},m.prototype.removeAllListeners=function(v){var y;return v?(y=o?o+v:v,this._events[y]&&p(this,y)):(this._events=new s,this._eventsCount=0),this},m.prototype.off=m.prototype.removeListener,m.prototype.addListener=m.prototype.on,m.prefixed=o,m.EventEmitter=m,typeof t<"u"&&(t.exports=m)});function ri(e){let t={exports:{}};return e(t,t.exports),t.exports}var ni=Number.MAX_SAFE_INTEGER||9007199254740991,_t={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:ni,MAX_SAFE_COMPONENT_LENGTH:16},ii=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},K=ii,We=ri(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:n}=_t,o=(t=e.exports={}).re=[],s=t.src=[],c=t.t={},g=0,p=(m,v,y)=>{let N=g++;K(N,v),c[m]=N,s[N]=v,o[N]=new RegExp(v,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","[0-9]+"),p("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),p("MAINVERSION",`(${s[c.NUMERICIDENTIFIER]})\\.(${s[c.NUMERICIDENTIFIER]})\\.(${s[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${s[c.NUMERICIDENTIFIERLOOSE]})\\.(${s[c.NUMERICIDENTIFIERLOOSE]})\\.(${s[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${s[c.NUMERICIDENTIFIER]}|${s[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${s[c.NUMERICIDENTIFIERLOOSE]}|${s[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${s[c.PRERELEASEIDENTIFIER]}(?:\\.${s[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${s[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER","[0-9A-Za-z-]+"),p("BUILD",`(?:\\+(${s[c.BUILDIDENTIFIER]}(?:\\.${s[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${s[c.MAINVERSION]}${s[c.PRERELEASE]}?${s[c.BUILD]}?`),p("FULL",`^${s[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${s[c.MAINVERSIONLOOSE]}${s[c.PRERELEASELOOSE]}?${s[c.BUILD]}?`),p("LOOSE",`^${s[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${s[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${s[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${s[c.XRANGEIDENTIFIER]})(?:\\.(${s[c.XRANGEIDENTIFIER]})(?:\\.(${s[c.XRANGEIDENTIFIER]})(?:${s[c.PRERELEASE]})?${s[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${s[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[c.XRANGEIDENTIFIERLOOSE]})(?:${s[c.PRERELEASELOOSE]})?${s[c.BUILD]}?)?)?`),p("XRANGE",`^${s[c.GTLT]}\\s*${s[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${s[c.GTLT]}\\s*${s[c.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",s[c.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${s[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${s[c.LONETILDE]}${s[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${s[c.LONETILDE]}${s[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${s[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${s[c.LONECARET]}${s[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${s[c.LONECARET]}${s[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${s[c.GTLT]}\\s*(${s[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${s[c.GTLT]}\\s*(${s[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${s[c.GTLT]}\\s*(${s[c.LOOSEPLAIN]}|${s[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${s[c.XRANGEPLAIN]})\\s+-\\s+(${s[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${s[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0.0.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),or=/^[0-9]+$/,Er=(e,t)=>{let n=or.test(e),o=or.test(t);return n&&o&&(e=+e,t=+t),e===t?0:n&&!o?-1:o&&!n?1:e<t?-1:1},oi=(e,t)=>Er(t,e),ai={compareIdentifiers:Er,rcompareIdentifiers:oi},{MAX_LENGTH:ar,MAX_SAFE_INTEGER:Ve}=_t,{re:sr,t:ur}=We,{compareIdentifiers:Ue}=ai,ee=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof ee){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>ar)throw new TypeError(`version is longer than ${ar} characters`);K("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?sr[ur.LOOSE]:sr[ur.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ve||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ve||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ve||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<Ve)return s}return o}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(K("SemVer.compare",this.version,this.options,e),!(e instanceof ee)){if(typeof e=="string"&&e===this.version)return 0;e=new ee(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof ee||(e=new ee(e,this.options)),Ue(this.major,e.major)||Ue(this.minor,e.minor)||Ue(this.patch,e.patch)}comparePre(e){if(e instanceof ee||(e=new ee(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],o=e.prerelease[t];if(K("prerelease compare",t,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n!==o)return Ue(n,o)}while(++t)}compareBuild(e){e instanceof ee||(e=new ee(e,this.options));let t=0;do{let n=this.build[t],o=e.build[t];if(K("prerelease compare",t,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n!==o)return Ue(n,o)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);n===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},si=(e,t,n)=>new ee(e,n).compare(new ee(t,n)),Le=si,ui=(e,t,n)=>Le(e,t,n)===0,ci=ui,li=(e,t,n)=>Le(e,t,n)!==0,fi=li,di=(e,t,n)=>Le(e,t,n)>0,hi=di,pi=(e,t,n)=>Le(e,t,n)>=0,mi=pi,vi=(e,t,n)=>Le(e,t,n)<0,gi=vi,yi=(e,t,n)=>Le(e,t,n)<=0,Ei=yi,_i=(e,t,n,o)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return ci(e,n,o);case"!=":return fi(e,n,o);case">":return hi(e,n,o);case">=":return mi(e,n,o);case"<":return gi(e,n,o);case"<=":return Ei(e,n,o);default:throw new TypeError(`Invalid operator: ${t}`)}},gt=_i,Be=Symbol("SemVer ANY"),Ge=class{static get ANY(){return Be}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Ge){if(e.loose===!!t.loose)return e;e=e.value}K("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Be?this.value="":this.value=this.operator+this.semver.version,K("comp",this)}parse(e){let t=this.options.loose?cr[lr.COMPARATORLOOSE]:cr[lr.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new ee(n[2],this.options.loose):this.semver=Be}toString(){return this.value}test(e){if(K("Comparator.test",e,this.options.loose),this.semver===Be||e===Be)return!0;if(typeof e=="string")try{e=new ee(e,this.options)}catch(t){return!1}return gt(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ge))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new Te(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new Te(this.value,t).test(e.semver);let n=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),o=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),s=this.semver.version===e.semver.version,c=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),g=gt(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),p=gt(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||o||s&&c||g||p}},{re:cr,t:lr}=We,Te=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Te)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Te(e.raw,t);if(e instanceof Ge)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let n=t?re[te.HYPHENRANGELOOSE]:re[te.HYPHENRANGE];e=e.replace(n,Pi(this.options.includePrerelease)),K("hyphen replace",e),e=e.replace(re[te.COMPARATORTRIM],Ii),K("comparator trim",e,re[te.COMPARATORTRIM]),e=(e=(e=e.replace(re[te.TILDETRIM],bi)).replace(re[te.CARETTRIM],wi)).split(/\s+/).join(" ");let o=t?re[te.COMPARATORLOOSE]:re[te.COMPARATOR];return e.split(" ").map(s=>Ri(s,this.options)).join(" ").split(/\s+/).map(s=>$i(s,this.options)).filter(this.options.loose?s=>!!s.match(o):()=>!0).map(s=>new Ge(s,this.options))}intersects(e,t){if(!(e instanceof Te))throw new TypeError("a Range is required");return this.set.some(n=>fr(n,t)&&e.set.some(o=>fr(o,t)&&n.every(s=>o.every(c=>s.intersects(c,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new ee(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Di(this.set[t],e,this.options))return!0;return!1}},{re,t:te,comparatorTrimReplace:Ii,tildeTrimReplace:bi,caretTrimReplace:wi}=We,fr=(e,t)=>{let n=!0,o=e.slice(),s=o.pop();for(;n&&o.length;)n=o.every(c=>s.intersects(c,t)),s=o.pop();return n},Ri=(e,t)=>(K("comp",e,t),e=Ni(e,t),K("caret",e),e=Ai(e,t),K("tildes",e),e=Oi(e,t),K("xrange",e),e=Mi(e,t),K("stars",e),e),oe=e=>!e||e.toLowerCase()==="x"||e==="*",Ai=(e,t)=>e.trim().split(/\s+/).map(n=>Si(n,t)).join(" "),Si=(e,t)=>{let n=t.loose?re[te.TILDELOOSE]:re[te.TILDE];return e.replace(n,(o,s,c,g,p)=>{let m;return K("tilde",e,o,s,c,g,p),oe(s)?m="":oe(c)?m=`>=${s}.0.0 <${+s+1}.0.0-0`:oe(g)?m=`>=${s}.${c}.0 <${s}.${+c+1}.0-0`:p?(K("replaceTilde pr",p),m=`>=${s}.${c}.${g}-${p} <${s}.${+c+1}.0-0`):m=`>=${s}.${c}.${g} <${s}.${+c+1}.0-0`,K("tilde return",m),m})},Ni=(e,t)=>e.trim().split(/\s+/).map(n=>Ti(n,t)).join(" "),Ti=(e,t)=>{K("caret",e,t);let n=t.loose?re[te.CARETLOOSE]:re[te.CARET],o=t.includePrerelease?"-0":"";return e.replace(n,(s,c,g,p,m)=>{let v;return K("caret",e,s,c,g,p,m),oe(c)?v="":oe(g)?v=`>=${c}.0.0${o} <${+c+1}.0.0-0`:oe(p)?v=c==="0"?`>=${c}.${g}.0${o} <${c}.${+g+1}.0-0`:`>=${c}.${g}.0${o} <${+c+1}.0.0-0`:m?(K("replaceCaret pr",m),v=c==="0"?g==="0"?`>=${c}.${g}.${p}-${m} <${c}.${g}.${+p+1}-0`:`>=${c}.${g}.${p}-${m} <${c}.${+g+1}.0-0`:`>=${c}.${g}.${p}-${m} <${+c+1}.0.0-0`):(K("no pr"),v=c==="0"?g==="0"?`>=${c}.${g}.${p}${o} <${c}.${g}.${+p+1}-0`:`>=${c}.${g}.${p}${o} <${c}.${+g+1}.0-0`:`>=${c}.${g}.${p} <${+c+1}.0.0-0`),K("caret return",v),v})},Oi=(e,t)=>(K("replaceXRanges",e,t),e.split(/\s+/).map(n=>Li(n,t)).join(" ")),Li=(e,t)=>{e=e.trim();let n=t.loose?re[te.XRANGELOOSE]:re[te.XRANGE];return e.replace(n,(o,s,c,g,p,m)=>{K("xRange",e,o,s,c,g,p,m);let v=oe(c),y=v||oe(g),N=y||oe(p),I=N;return s==="="&&I&&(s=""),m=t.includePrerelease?"-0":"",v?o=s===">"||s==="<"?"<0.0.0-0":"*":s&&I?(y&&(g=0),p=0,s===">"?(s=">=",y?(c=+c+1,g=0,p=0):(g=+g+1,p=0)):s==="<="&&(s="<",y?c=+c+1:g=+g+1),s==="<"&&(m="-0"),o=`${s+c}.${g}.${p}${m}`):y?o=`>=${c}.0.0${m} <${+c+1}.0.0-0`:N&&(o=`>=${c}.${g}.0${m} <${c}.${+g+1}.0-0`),K("xRange return",o),o})},Mi=(e,t)=>(K("replaceStars",e,t),e.trim().replace(re[te.STAR],"")),$i=(e,t)=>(K("replaceGTE0",e,t),e.trim().replace(re[t.includePrerelease?te.GTE0PRE:te.GTE0],"")),Pi=e=>(t,n,o,s,c,g,p,m,v,y,N,I,T)=>`${n=oe(o)?"":oe(s)?`>=${o}.0.0${e?"-0":""}`:oe(c)?`>=${o}.${s}.0${e?"-0":""}`:g?`>=${n}`:`>=${n}${e?"-0":""}`} ${m=oe(v)?"":oe(y)?`<${+v+1}.0.0-0`:oe(N)?`<${v}.${+y+1}.0-0`:I?`<=${v}.${y}.${N}-${I}`:e?`<${v}.${y}.${+N+1}-0`:`<=${m}`}`.trim(),Di=(e,t,n)=>{for(let o=0;o<e.length;o++)if(!e[o].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let o=0;o<e.length;o++)if(K(e[o].semver),e[o].semver!==Ge.ANY&&e[o].semver.prerelease.length>0){let s=e[o].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0},Ci=(e,t,n)=>{try{t=new Te(t,n)}catch(o){return!1}return t.test(e)},{MAX_LENGTH:xi}=_t,{re:dr,t:hr}=We,Ui=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof ee)return e;if(typeof e!="string"||e.length>xi||!(t.loose?dr[hr.LOOSE]:dr[hr.FULL]).test(e))return null;try{return new ee(e,t)}catch(n){return null}},Bi=Ui,{re:Xe,t:qe}=We,Fi=(e,t)=>{if(e instanceof ee)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let n=null;if((t=t||{}).rtl){let o;for(;(o=Xe[qe.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&o.index+o[0].length===n.index+n[0].length||(n=o),Xe[qe.COERCERTL].lastIndex=o.index+o[1].length+o[2].length;Xe[qe.COERCERTL].lastIndex=-1}else n=e.match(Xe[qe.COERCE]);return n===null?null:Bi(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function Gi(e){return String.fromCharCode(parseInt(e.slice(1),16))}function ji(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function ki(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,Gi))}function Wi(e){return decodeURIComponent(Array.from(atob(e),ji).join(""))}function _r(e){return ki(JSON.stringify(e))}function Yi(e){return JSON.parse(Wi(e))}function Fe(e){return typeof e=="undefined"}function Hi(e){return e===null}function Ir(e){return Hi(e)||Fe(e)}function Ki(e){return Ir(e)?!1:!Fe(e.jsonrpc)&&!Fe(e.id)&&(!Fe(e.result)||!Fe(e.error))}function Vi(e){return Ir(e)?!1:typeof e=="number"&&Object.values(Se).includes(e)}function yt(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var z={};function br(e,t){return Object.assign(z,t),e}var Xi={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},he=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,he.prototype)}},Oe=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=Vi(t)?t:Se.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,Object.setPrototypeOf(this,Oe.prototype)}},Ye=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},it=class extends Error{constructor(e,t,n,o){super(`Magic Extension Error (${e.name}): [${t}] ${n}`),this.code=t,this.rawMessage=n,this.data=o,this.__proto__=Error,Object.setPrototypeOf(this,it.prototype)}},Ze=class{constructor(e,t,n){this.code=t,this.rawMessage=n,this.message=`Magic Extension Warning (${e.name}): [${t}] ${n}`}log(){console.warn(this.message)}};function qi(){return new he(le.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function wr(){return new he(le.ModalNotReady,"Modal is not ready.")}function zi(){return new he(le.MalformedResponse,"Response from the Magic iframe is malformed.")}function Ji(e){return new he(le.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function Qi(e){let t=`Some extensions are incompatible with \`${z.sdkName}@${z.version}\`:`;return e.filter(n=>typeof n.compat!="undefined"&&n.compat!==null).forEach(n=>{let o=n.compat[z.sdkName];typeof o=="string"?t+=`
2
- - Extension \`${n.name}\` supports version(s) \`${o}\``:o||(t+=`
3
- - Extension \`${n.name}\` does not support ${z.platform} environments.`)}),new he(le.IncompatibleExtensions,t)}function Zi(e){let t=n=>{let o=n+1,s=o%10,c=o%100;return s===1&&c!==11?`${o}st`:s===2&&c!==12?`${o}nd`:s===3&&c!==13?`${o}rd`:`${o}th`};return new he(le.InvalidArgument,`Invalid ${t(e.argument)} argument given to \`${e.procedure}\`.
4
- Expected: \`${e.expected}\`
5
- Received: \`${e.received}\``)}function Rr(){return new Ye(Ae.DuplicateIframe,"Duplicate iframes found.")}function eo(){return new Ye(Ae.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function to(){return new Ye(Ae.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${z.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function*ro(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}var no=ro();function Ar(){return no.next().value}var Sr=Symbol("Payload pre-processed by Magic SDK");function Nr(e){return Object.defineProperty(e,Sr,{value:!0,enumerable:!1}),e}function io(e){return!!e[Sr]}function et(e){var t,n,o;return io(e)||(e.jsonrpc=(t=e.jsonrpc)!=null?t:"2.0",e.id=Ar(),e.method=(n=e.method)!=null?n:"noop",e.params=(o=e.params)!=null?o:[],Nr(e)),e}function X(e,t=[]){return Nr({params:t,method:e,jsonrpc:"2.0",id:Ar()})}var It=class{constructor(e){e instanceof It?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):Ki(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return typeof this._error!="undefined"&&this._error!==null}get hasResult(){return typeof this._result!="undefined"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},oo=ei(ti()),ao=class extends oo.default{};function Tr(){let e=new ao;return{emitter:e,createChainingEmitterMethod:(t,n)=>(...o)=>(e[t].apply(e,o),n),createBoundEmitterMethod:t=>(...n)=>e[t].apply(e,n)}}var Or=Symbol("isPromiEvent");function bt(e){return!!e[Or]}function Lr(e){let t=Mr(e),{createBoundEmitterMethod:n,createChainingEmitterMethod:o}=Tr(),s=Symbol("Promise.then"),c=Symbol("Promise.catch"),g=Symbol("Promise.finally"),p=(y,N)=>(...I)=>{let T=N[y].apply(N,I);return m(T)},m=y=>Object.assign(y,{[Or]:!0,[s]:y[s]||y.then,[c]:y[c]||y.catch,[g]:y[g]||y.finally,then:p(s,y),catch:p(c,y),finally:p(g,y),on:o("on",y),once:o("once",y),addListener:o("addListener",y),off:o("off",y),removeListener:o("removeListener",y),removeAllListeners:o("removeAllListeners",y),emit:n("emit"),eventNames:n("eventNames"),listeners:n("listeners"),listenerCount:n("listenerCount")}),v=m(t.then(y=>(v.emit("done",y),v.emit("settled"),y),y=>{throw v.emit("error",y),v.emit("settled"),y}));return v}function Mr(e){return new Promise((t,n)=>{let o=e(t,n);Promise.resolve(o).catch(n)})}var Me=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(_e.MAGIC_HANDLE_REQUEST,et(e)),n=Lr((s,c)=>{t.then(g=>{if(o(),g.hasError)c(new Oe(g.payload.error));else if(g.hasResult)s(g.payload.result);else throw zi()}).catch(g=>{o(),c(g)})}),o=this.overlay.on(fe.MAGIC_HANDLE_EVENT,s=>{var c;let{response:g}=s.data;if(g.id===e.id&&((c=g.result)==null?void 0:c.event)){let{event:p,params:m=[]}=g.result;n.emit(p,...m)}});return n}createIntermediaryEvent(e,t){return n=>{let o=X(F.IntermediaryEvent,[{payloadId:t,eventType:e,args:n}]);this.request(o)}}},so=class extends Me{loginWithMagicLink(e){let{email:t,showUI:n=!0,redirectURI:o}=e,s=X(this.sdk.testMode?F.LoginWithMagicLinkTestMode:F.LoginWithMagicLink,[{email:t,showUI:n,redirectURI:o}]);return this.request(s)}loginWithSMS(e){let{phoneNumber:t}=e,n=X(this.sdk.testMode?F.LoginWithSmsTestMode:F.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(n)}loginWithEmailOTP(e){let{email:t}=e,n=X(this.sdk.testMode?F.LoginWithEmailOTPTestMode:F.LoginWithEmailOTP,[{email:t,showUI:!0}]);return this.request(n)}loginWithCredential(e){let t=e!=null?e:"";if(!e&&z.platform==="web"){t=window.location.search;let o=window.location.origin+window.location.pathname;window.history.replaceState(null,"",o)}let n=X(this.sdk.testMode?F.LoginWithCredentialTestMode:F.LoginWithCredential,[t]);return this.request(n)}},$r={};Qn($r,{clear:()=>uo,getItem:()=>je,iterate:()=>ho,key:()=>lo,keys:()=>fo,length:()=>co,removeItem:()=>Et,setItem:()=>tt});var ze;function ge(e){return(...t)=>de(this,null,function*(){return ze||(ze=yield z.configureStorage()),yield ze.ready(),ze[e](...t)})}var je=ge("getItem"),tt=ge("setItem"),Et=ge("removeItem"),uo=ge("clear"),co=ge("length"),lo=ge("key"),fo=ge("keys"),ho=ge("iterate");function po(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&191|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var wt="STORE_KEY_PRIVATE_KEY",rt="STORE_KEY_PUBLIC_JWK",Rt="ECDSA",Pr="P-256",mo={name:Rt,namedCurve:Pr},vo={name:Rt,namedCurve:Pr};function Dr(){Et(rt),Et(wt)}function go(){return de(this,null,function*(){let e=yield yo();if(!e){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:t}=window.crypto,n=yield je(wt);if(!n||!t){console.info("unable to find private key or webcrypto unsupported");return}let o={iat:Math.floor(new Date().getTime()/1e3),jti:po()},s={typ:"dpop+jwt",alg:"ES256",jwk:e},c={protected:pr(JSON.stringify(s)),claims:pr(JSON.stringify(o))},g=Io(`${c.protected}.${c.claims}`),p={name:Rt,hash:{name:"SHA-256"}},m=wo(new Uint8Array(yield t.sign(p,n,g)));return`${c.protected}.${c.claims}.${m}`})}function yo(){return de(this,null,function*(){if(!_o()){console.info("webcrypto is not supported");return}return(yield je(rt))||(yield Eo()),je(rt)})}function Eo(){return de(this,null,function*(){let e=null,{subtle:t}=window.crypto,n=yield t.generateKey(mo,!0,["sign"]),o=yield t.exportKey("jwk",n.privateKey);e=yield t.exportKey("jwk",n.publicKey);let s=yield t.importKey("jwk",o,vo,!1,["sign"]);yield tt(wt,s),yield tt(rt,e)})}function _o(){let e=typeof window!="undefined"&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}function pr(e){return Cr(bo(e))}function Io(e){return new TextEncoder().encode(e)}function Cr(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function bo(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode(parseInt(n,16)))}function wo(e){let t="";return e.forEach(n=>{t+=String.fromCharCode(n)}),Cr(t)}var Ro=class extends Me{getIdToken(e){let t=X(this.sdk.testMode?F.GetIdTokenTestMode:F.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=X(this.sdk.testMode?F.GenerateIdTokenTestMode:F.GenerateIdToken,[e]);return this.request(t)}getMetadata(){let e=X(this.sdk.testMode?F.GetMetadataTestMode:F.GetMetadata);return this.request(e)}updateEmail(e){let{email:t,showUI:n=!0}=e,o=X(this.sdk.testMode?F.UpdateEmailTestMode:F.UpdateEmail,[{email:t,showUI:n}]);return this.request(o)}isLoggedIn(){let e=X(this.sdk.testMode?F.IsLoggedInTestMode:F.IsLoggedIn);return this.request(e)}logout(){Dr();let e=X(this.sdk.testMode?F.LogoutTestMode:F.Logout);return this.request(e)}showSettings(){let e=X(this.sdk.testMode?F.UserSettingsTestMode:F.UserSettings);return this.request(e)}updatePhoneNumber(){let e=X(this.sdk.testMode?F.UpdatePhoneNumberTestMode:F.UpdatePhoneNumber);return this.request(e)}},Ao=class extends Me{connectWithUI(){let e=X(F.RequestAccounts);return this.request(e)}showUI(){let e=X(F.ShowUI);return this.request(e)}getInfo(){let e=X(F.GetInfo);return this.request(e)}requestUserInfoWithUI(e){let t=X(F.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}disconnect(){Dr();let e=X(F.Disconnect);return this.request(e)}},{createBoundEmitterMethod:Je,createChainingEmitterMethod:Ne}=Tr(),So=class extends Me{constructor(){super(...arguments),this.isMagic=!0,this.on=Ne("on",this),this.once=Ne("once",this),this.addListener=Ne("addListener",this),this.off=Ne("off",this),this.removeListener=Ne("removeListener",this),this.removeAllListeners=Ne("removeAllListeners",this),this.emit=Je("emit"),this.eventNames=Je("eventNames"),this.listeners=Je("listeners"),this.listenerCount=Je("listenerCount")}sendAsync(e,t){if(!t)throw Zi({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:t===null?"null":typeof t});if(Array.isArray(e))this.overlay.post(_e.MAGIC_HANDLE_REQUEST,e.map(n=>{let o=et(n);return this.prefixPayloadMethodForTestMode(o),o})).then(n=>{t(null,n.map(o=>zn(yr({},o.payload),{error:o.hasError?new Oe(o.payload.error):null})))});else{let n=et(e);this.prefixPayloadMethodForTestMode(n),this.overlay.post(_e.MAGIC_HANDLE_REQUEST,n).then(o=>{t(o.hasError?new Oe(o.payload.error):null,o.payload)})}}send(e,t){if(typeof e=="string"){let o=X(e,Array.isArray(t)?t:[]);return this.request(o)}if(Array.isArray(e)||!!t){this.sendAsync(e,t);return}let n=eo();return n.log(),new It(e).applyError({code:-32603,message:n.rawMessage}).payload}enable(){let e=X("eth_accounts");return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){let t="testMode/eth/";this.sdk.testMode&&(e.method=`${t}${e.method}`)}};function ke(e,t){return t?new URL(e,t):new URL(e)}var mr=["request","overlay","sdk"];function No(e){let t=Object.getPrototypeOf(e),n=[t];for(;t!==Me.prototype;)t=Object.getPrototypeOf(t),n.push(t);return n}var xr=class extends Me{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Lr,isPromiEvent:bt,encodeJSON:_r,decodeJSON:Yi,createJsonRpcRequestPayload:X,standardizeJsonRpcRequestPayload:et,storage:$r};let e=[this,...No(this)];mr.forEach(t=>{let n=e.map(g=>Object.getOwnPropertyDescriptor(g,t)),o=n.findIndex(g=>!!g),s=o>0,c=n[o];c&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:c,isPrototypeField:s}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw Ji(t)}}))})}init(e){this.__is_initialized__||(mr.forEach(t=>{if(this.__sdk_access_field_descriptors__.has(t)){let{descriptor:n,isPrototypeField:o}=this.__sdk_access_field_descriptors__.get(t);o?delete this[t]:Object.defineProperty(this,t,n)}}),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:n,useInstead:o}=e,s=o?` Use \`${o}\` instead.`:"",c=`\`${t}\` will be removed from this Extension in version \`${n}\`.${s}`;return new Ze(this,"DEPRECATION_NOTICE",c)}createWarning(e,t){return new Ze(this,e,t)}createError(e,t,n){return new it(this,e,t,n)}},To=class extends xr{},Ie=class extends xr{};Ie.Internal=To,Ie.Anonymous="anonymous extension";function vr(e){return e.compat&&e.compat[z.sdkName]!=null?typeof e.compat[z.sdkName]=="string"?Ci(Fi(z.version),e.compat[z.sdkName]):!!e.compat[z.sdkName]:!0}function Oo(e){var t;let n=(t=e==null?void 0:e.extensions)!=null?t:[],o={},s=[];if(Array.isArray(n)?n.forEach(c=>{vr(c)?(c.init(this),(c.name||c.name!==Ie.Anonymous)&&(this[c.name]=c),c instanceof Ie.Internal&&(yt(c.config)||(o[c.name]=c.config))):s.push(c)}):Object.keys(n).forEach(c=>{if(vr(n[c])){n[c].init(this);let g=n[c];this[c]=g,g instanceof Ie.Internal&&(yt(g.config)||(o[n[c].name]=g.config))}else s.push(n[c])}),s.length)throw Qi(s);return o}var Qe=class{constructor(e,t){this.apiKey=e;var n;if(!e)throw qi();z.platform==="react-native"&&(t==null?void 0:t.endpoint)&&to().log();let{defaultEndpoint:o,version:s}=z;this.testMode=!!(t!=null&&t.testMode),this.endpoint=ke((n=t==null?void 0:t.endpoint)!=null?n:o).origin,this.auth=new so(this),this.user=new Ro(this),this.wallet=new Ao(this),this.rpcProvider=new So(this);let c=Oo.call(this,t);this.parameters=_r(yr({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?void 0:t.network,host:ke(this.endpoint).host,sdk:Xi[z.sdkName],version:s,ext:yt(c)?void 0:c,locale:(t==null?void 0:t.locale)||"en_US"},z.bundleId?{bundleId:z.bundleId}:{}))}get overlay(){if(!Qe.__overlays__.has(this.parameters)){let e=new z.ViewController(this.endpoint,this.parameters);e.init(),Qe.__overlays__.set(this.parameters,e)}return Qe.__overlays__.get(this.parameters)}preload(){return de(this,null,function*(){yield this.overlay.ready})}},At=Qe;At.__overlays__=new Map;function Lo(e,t){return t&&Array.isArray(e)?e.find(n=>n.id===t):e}function Mo(e,t){var n;let o=(n=t.data.response)==null?void 0:n.id,s=Lo(e,o);if(o&&s){let c=new It(s).applyResult(t.data.response.result).applyError(t.data.response.error);return{id:o,response:c}}return{}}function $o(e,t){return de(this,null,function*(){let n=yield je("rt"),o;if(z.platform==="web")try{o=yield go()}catch(s){console.error("webcrypto error",s)}return o?n?{msgType:e,payload:t,jwt:o,rt:n}:{msgType:e,payload:t,jwt:o}:{msgType:e,payload:t}})}function Po(e){return de(this,null,function*(){!e.data.rt||(yield tt("rt",e.data.rt))})}var Ur=class{constructor(e,t){this.endpoint=e,this.parameters=t,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(e,t){return de(this,null,function*(){return Mr(n=>de(this,null,function*(){yield this.ready;let o=[],s=Array.isArray(t)?t.map(m=>m.id):[],c=yield $o(`${e}-${this.parameters}`,t);yield this._post(c);let g=m=>v=>{let{id:y,response:N}=Mo(t,v);Po(v),y&&N&&Array.isArray(t)&&s.includes(y)?(o.push(N),o.length===t.length&&(m(),n(o))):y&&N&&!Array.isArray(t)&&y===t.id&&(m(),n(N))},p=this.on(fe.MAGIC_HANDLE_RESPONSE,g(()=>p()))}))})}on(e,t){let n=t.bind(window),o=s=>{s.data.msgType===`${e}-${this.parameters}`&&n(s)};return this.messageHandlers.add(o),()=>this.messageHandlers.delete(o)}waitForReady(){return new Promise(e=>{this.on(fe.MAGIC_OVERLAY_READY,()=>e())})}listen(){this.on(fe.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(fe.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}};var St={};Zt(St,{EthChainType:()=>rr,Extension:()=>Ie,ExtensionError:()=>it,ExtensionWarning:()=>Ze,MagicIncomingWindowMessage:()=>fe,MagicOutgoingWindowMessage:()=>_e,MagicPayloadMethod:()=>F,RPCError:()=>Oe,RPCErrorCode:()=>Se,SDKError:()=>he,SDKErrorCode:()=>le,SDKWarning:()=>Ye,SDKWarningCode:()=>Ae,isPromiEvent:()=>bt});var st=tr(Fr()),Tt=tr(jr());var Do={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function Co(e){for(let[t,n]of Object.entries(Do))e.style[t]=n}function xo(e){let t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find(n=>n.src.includes(e)))}var at=class extends Ur{constructor(){super(...arguments);this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(n=>{let o=()=>{if(xo(encodeURIComponent(this.parameters)))Rr().log();else{let s=document.createElement("iframe");s.classList.add("magic-iframe"),s.dataset.magicIframeLabel=ke(this.endpoint).host,s.title="Secure Modal",s.src=ke(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,Co(s),document.body.appendChild(s),n(s)}};["loaded","interactive","complete"].includes(document.readyState)?o():window.addEventListener("load",o,!1)}),window.addEventListener("message",n=>{var o;if(n.origin===this.endpoint&&n.data&&n.data.msgType&&this.messageHandlers.size){n.data.response=(o=n.data.response)!=null?o:{};for(let s of this.messageHandlers.values())s(n)}})}showOverlay(){return Re(this,null,function*(){let n=yield this.iframe;n.style.display="block",this.activeElement=document.activeElement,n.focus()})}hideOverlay(){return Re(this,null,function*(){var o;let n=yield this.iframe;n.style.display="none",(o=this.activeElement)!=null&&o.focus&&this.activeElement.focus(),this.activeElement=null})}_post(n){return Re(this,null,function*(){let o=yield this.iframe;if(o&&o.contentWindow)o.contentWindow.postMessage(n,this.endpoint);else throw wr()})}};var Uo=Object.assign(br(At,{platform:"web",sdkName:"magic-sdk",version:"13.3.0",defaultEndpoint:"https://auth.magic.link/",ViewController:at,configureStorage:()=>Re(void 0,null,function*(){let e=st.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(Tt),yield e.setDriver([st.default.INDEXEDDB,st.default.LOCALSTORAGE,Tt._driver]),e})}),Jt({},St)),Bo=Uo;return kn(Fo);})();
1
+ "use strict";var Magic=(()=>{var YV=Object.create;var zl=Object.defineProperty;var ZV=Object.getOwnPropertyDescriptor;var JV=Object.getOwnPropertyNames,e8=Object.getOwnPropertySymbols,QV=Object.getPrototypeOf,r8=Object.prototype.hasOwnProperty,XV=Object.prototype.propertyIsEnumerable;var t8=(t,e,r)=>e in t?zl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n8=(t,e)=>{for(var r in e||(e={}))r8.call(e,r)&&t8(t,r,e[r]);if(e8)for(var r of e8(e))XV.call(e,r)&&t8(t,r,e[r]);return t};var Rs=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var ie=(t,e)=>()=>(t&&(e=t(t=0)),e);var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ir=(t,e)=>{for(var r in e)zl(t,r,{get:e[r],enumerable:!0})},i0=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of JV(e))!r8.call(t,i)&&i!==r&&zl(t,i,{get:()=>e[i],enumerable:!(n=ZV(e,i))||n.enumerable});return t},gn=(t,e,r)=>(i0(t,e,"default"),r&&i0(r,e,"default")),ke=(t,e,r)=>(r=t!=null?YV(QV(t)):{},i0(e||!t||!t.__esModule?zl(r,"default",{value:t,enumerable:!0}):r,t)),or=t=>i0(zl({},"__esModule",{value:!0}),t);var lc=(t,e,r)=>new Promise((n,i)=>{var o=c=>{try{a(r.next(c))}catch(u){i(u)}},s=c=>{try{a(r.throw(c))}catch(u){i(u)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,s);a((r=r.apply(t,e)).next())});var s8=_((kCe,o8)=>{"use strict";function eG(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}o8.exports=tG;function tG(t,e,r){var n=r&&r.stringify||eG,i=1;if(typeof t=="object"&&t!==null){var o=e.length+i;if(o===1)return t;var s=new Array(o);s[0]=n(t);for(var a=1;a<o;a++)s[a]=n(e[a]);return s.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var u="",l=1-i,h=-1,d=t&&t.length||0,m=0;m<d;){if(t.charCodeAt(m)===37&&m+1<d){switch(h=h>-1?h:0,t.charCodeAt(m+1)){case 100:case 102:if(l>=c||e[l]==null)break;h<m&&(u+=t.slice(h,m)),u+=Number(e[l]),h=m+2,m++;break;case 105:if(l>=c||e[l]==null)break;h<m&&(u+=t.slice(h,m)),u+=Math.floor(Number(e[l])),h=m+2,m++;break;case 79:case 111:case 106:if(l>=c||e[l]===void 0)break;h<m&&(u+=t.slice(h,m));var v=typeof e[l];if(v==="string"){u+="'"+e[l]+"'",h=m+2,m++;break}if(v==="function"){u+=e[l].name||"<anonymous>",h=m+2,m++;break}u+=n(e[l]),h=m+2,m++;break;case 115:if(l>=c)break;h<m&&(u+=t.slice(h,m)),u+=String(e[l]),h=m+2,m++;break;case 37:h<m&&(u+=t.slice(h,m)),u+="%",h=m+2,m++,l--;break}++l}++m}return h===-1?t:(h<d&&(u+=t.slice(h)),u)}});var Kl=_((LCe,l8)=>{"use strict";var a8=s8();l8.exports=ui;var Vl=fG().console||{},rG={mapHttpRequest:o0,mapHttpResponse:o0,wrapRequestSerializer:Kv,wrapResponseSerializer:Kv,wrapErrorSerializer:Kv,req:o0,res:o0,err:aG};function nG(t,e){return Array.isArray(t)?t.filter(function(n){return n!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function ui(t){t=t||{},t.browser=t.browser||{};let e=t.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");let r=t.browser.write||Vl;t.browser.write&&(t.browser.asObject=!0);let n=t.serializers||{},i=nG(t.browser.serialize,n),o=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);let s=["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");let a=t.level||"info",c=Object.create(r);c.log||(c.log=Gl),Object.defineProperty(c,"levelVal",{get:l}),Object.defineProperty(c,"level",{get:h,set:d});let u={transmit:e,serialize:i,asObject:t.browser.asObject,levels:s,timestamp:cG(t)};c.levels=ui.levels,c.level=a,c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=Gl,c.serializers=n,c._serialize=i,c._stdErrSerialize=o,c.child=m,e&&(c._logEvent=Yv());function l(){return this.level==="silent"?1/0:this.levels.values[this.level]}function h(){return this._level}function d(v){if(v!=="silent"&&!this.levels.values[v])throw Error("unknown level "+v);this._level=v,dc(u,c,"error","log"),dc(u,c,"fatal","error"),dc(u,c,"warn","error"),dc(u,c,"info","log"),dc(u,c,"debug","log"),dc(u,c,"trace","log")}function m(v,x){if(!v)throw new Error("missing bindings for child Pino");x=x||{},i&&v.serializers&&(x.serializers=v.serializers);let O=x.serializers;if(i&&O){var I=Object.assign({},n,O),j=t.browser.serialize===!0?Object.keys(I):i;delete v.serializers,s0([v],j,I,this._stdErrSerialize)}function k(B){this._childLevel=(B._childLevel|0)+1,this.error=pc(B,v,"error"),this.fatal=pc(B,v,"fatal"),this.warn=pc(B,v,"warn"),this.info=pc(B,v,"info"),this.debug=pc(B,v,"debug"),this.trace=pc(B,v,"trace"),I&&(this.serializers=I,this._serialize=j),e&&(this._logEvent=Yv([].concat(B._logEvent.bindings,v)))}return k.prototype=this,new k(this)}return c}ui.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"}};ui.stdSerializers=rG;ui.stdTimeFunctions=Object.assign({},{nullTime:c8,epochTime:u8,unixTime:uG,isoTime:lG});function dc(t,e,r,n){let i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?Gl:i[r]?i[r]:Vl[r]||Vl[n]||Gl,iG(t,e,r)}function iG(t,e,r){!t.transmit&&e[r]===Gl||(e[r]=function(n){return function(){let o=t.timestamp(),s=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Vl?Vl:this;for(var c=0;c<s.length;c++)s[c]=arguments[c];if(t.serialize&&!t.asObject&&s0(s,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?n.call(a,oG(this,r,s,o)):n.apply(a,s),t.transmit){let u=t.transmit.level||e.level,l=ui.levels.values[u],h=ui.levels.values[r];if(h<l)return;sG(this,{ts:o,methodLevel:r,methodValue:h,transmitLevel:u,transmitValue:ui.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},s)}}}(e[r]))}function oG(t,e,r,n){t._serialize&&s0(r,t._serialize,t.serializers,t._stdErrSerialize);let i=r.slice(),o=i[0],s={};n&&(s.time=n),s.level=ui.levels.values[e];let a=(t._childLevel|0)+1;if(a<1&&(a=1),o!==null&&typeof o=="object"){for(;a--&&typeof i[0]=="object";)Object.assign(s,i.shift());o=i.length?a8(i.shift(),i):void 0}else typeof o=="string"&&(o=a8(i.shift(),i));return o!==void 0&&(s.msg=o),s}function s0(t,e,r,n){for(let i in t)if(n&&t[i]instanceof Error)t[i]=ui.stdSerializers.err(t[i]);else if(typeof t[i]=="object"&&!Array.isArray(t[i]))for(let o in t[i])e&&e.indexOf(o)>-1&&o in r&&(t[i][o]=r[o](t[i][o]))}function pc(t,e,r){return function(){let n=new Array(1+arguments.length);n[0]=e;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return t[r].apply(this,n)}}function sG(t,e,r){let n=e.send,i=e.ts,o=e.methodLevel,s=e.methodValue,a=e.val,c=t._logEvent.bindings;s0(r,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=i,t._logEvent.messages=r.filter(function(u){return c.indexOf(u)===-1}),t._logEvent.level.label=o,t._logEvent.level.value=s,n(o,t._logEvent,a),t._logEvent=Yv(c)}function Yv(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function aG(t){let e={type:t.constructor.name,msg:t.message,stack:t.stack};for(let r in t)e[r]===void 0&&(e[r]=t[r]);return e}function cG(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?c8:u8}function o0(){return{}}function Kv(t){return t}function Gl(){}function c8(){return!1}function u8(){return Date.now()}function uG(){return Math.round(Date.now()/1e3)}function lG(){return new Date(Date.now()).toISOString()}function fG(){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)||{}}}});var yn=_((jCe,Zv)=>{"use strict";var gc=typeof Reflect=="object"?Reflect:null,f8=gc&&typeof gc.apply=="function"?gc.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},a0;gc&&typeof gc.ownKeys=="function"?a0=gc.ownKeys:Object.getOwnPropertySymbols?a0=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:a0=function(e){return Object.getOwnPropertyNames(e)};function hG(t){console&&console.warn&&console.warn(t)}var d8=Number.isNaN||function(e){return e!==e};function it(){it.init.call(this)}Zv.exports=it;Zv.exports.once=mG;it.EventEmitter=it;it.prototype._events=void 0;it.prototype._eventsCount=0;it.prototype._maxListeners=void 0;var h8=10;function c0(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(it,"defaultMaxListeners",{enumerable:!0,get:function(){return h8},set:function(t){if(typeof t!="number"||t<0||d8(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");h8=t}});it.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};it.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||d8(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 p8(t){return t._maxListeners===void 0?it.defaultMaxListeners:t._maxListeners}it.prototype.getMaxListeners=function(){return p8(this)};it.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var s;if(r.length>0&&(s=r[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(c===void 0)return!1;if(typeof c=="function")f8(c,this,r);else for(var u=c.length,l=b8(c,u),n=0;n<u;++n)f8(l[n],this,r);return!0};function g8(t,e,r,n){var i,o,s;if(c0(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),i=p8(t),i>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,hG(a)}return t}it.prototype.addListener=function(e,r){return g8(this,e,r,!1)};it.prototype.on=it.prototype.addListener;it.prototype.prependListener=function(e,r){return g8(this,e,r,!0)};function dG(){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 m8(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=dG.bind(n);return i.listener=r,n.wrapFn=i,i}it.prototype.once=function(e,r){return c0(r),this.on(e,m8(this,e,r)),this};it.prototype.prependOnceListener=function(e,r){return c0(r),this.prependListener(e,m8(this,e,r)),this};it.prototype.removeListener=function(e,r){var n,i,o,s,a;if(c0(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){a=n[s].listener,o=s;break}if(o<0)return this;o===0?n.shift():pG(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};it.prototype.off=it.prototype.removeListener;it.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),s;for(i=0;i<o.length;++i)s=o[i],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function y8(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?gG(i):b8(i,i.length)}it.prototype.listeners=function(e){return y8(this,e,!0)};it.prototype.rawListeners=function(e){return y8(this,e,!1)};it.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):v8.call(t,e)};it.prototype.listenerCount=v8;function v8(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}it.prototype.eventNames=function(){return this._eventsCount>0?a0(this._events):[]};function b8(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function pG(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function gG(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function mG(t,e){return new Promise(function(r,n){function i(s){t.removeListener(e,o),n(s)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}_8(t,e,o,{once:!0}),e!=="error"&&yG(t,i,{once:!0})})}function yG(t,e,r){typeof t.on=="function"&&_8(t,"error",e,r)}function _8(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var Qv=_((BCe,l0)=>{var w8,E8,S8,x8,O8,C8,A8,I8,M8,u0,Jv,R8,T8,mc,P8,D8,N8,k8,L8,j8,B8,q8,F8;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){t(r(e,r(n)))}):typeof l0=="object"&&typeof l0.exports=="object"?t(r(e,r(l0.exports))):t(r(e));function r(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(o,s){return n[o]=i?i(o,s):s}}})(function(t){var e=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])};w8=function(r,n){e(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},E8=Object.assign||function(r){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},S8=function(r,n){var i={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(r);s<o.length;s++)n.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(r,o[s])&&(i[o[s]]=r[o[s]]);return i},x8=function(r,n,i,o){var s=arguments.length,a=s<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,i):o,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,n,i,o);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(s<3?c(a):s>3?c(n,i,a):c(n,i))||a);return s>3&&a&&Object.defineProperty(n,i,a),a},O8=function(r,n){return function(i,o){n(i,o,r)}},C8=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},A8=function(r,n,i,o){function s(a){return a instanceof i?a:new i(function(c){c(a)})}return new(i||(i=Promise))(function(a,c){function u(d){try{h(o.next(d))}catch(m){c(m)}}function l(d){try{h(o.throw(d))}catch(m){c(m)}}function h(d){d.done?a(d.value):s(d.value).then(u,l)}h((o=o.apply(r,n||[])).next())})},I8=function(r,n){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(d){return l([h,d])}}function l(h){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,s&&(a=h[0]&2?s.return:h[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,h[1])).done)return a;switch(s=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return i.label++,{value:h[1],done:!1};case 5:i.label++,s=h[1],h=[0];continue;case 7:h=i.ops.pop(),i.trys.pop();continue;default:if(a=i.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){i=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){i.label=h[1];break}if(h[0]===6&&i.label<a[1]){i.label=a[1],a=h;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(h);break}a[2]&&i.ops.pop(),i.trys.pop();continue}h=n.call(r,i)}catch(d){h=[6,d],s=0}finally{o=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},F8=function(r,n,i,o){o===void 0&&(o=i),r[o]=n[i]},M8=function(r,n){for(var i in r)i!=="default"&&!n.hasOwnProperty(i)&&(n[i]=r[i])},u0=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],o=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},Jv=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var o=i.call(r),s,a=[],c;try{for(;(n===void 0||n-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(u){c={error:u}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(c)throw c.error}}return a},R8=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Jv(arguments[n]));return r},T8=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var o=Array(r),s=0,n=0;n<i;n++)for(var a=arguments[n],c=0,u=a.length;c<u;c++,s++)o[s]=a[c];return o},mc=function(r){return this instanceof mc?(this.v=r,this):new mc(r)},P8=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(r,n||[]),s,a=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(v){o[v]&&(s[v]=function(x){return new Promise(function(O,I){a.push([v,x,O,I])>1||u(v,x)})})}function u(v,x){try{l(o[v](x))}catch(O){m(a[0][3],O)}}function l(v){v.value instanceof mc?Promise.resolve(v.value.v).then(h,d):m(a[0][2],v)}function h(v){u("next",v)}function d(v){u("throw",v)}function m(v,x){v(x),a.shift(),a.length&&u(a[0][0],a[0][1])}},D8=function(r){var n,i;return n={},o("next"),o("throw",function(s){throw s}),o("return"),n[Symbol.iterator]=function(){return this},n;function o(s,a){n[s]=r[s]?function(c){return(i=!i)?{value:mc(r[s](c)),done:s==="return"}:a?a(c):c}:a}},N8=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof u0=="function"?u0(r):r[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(a){i[a]=r[a]&&function(c){return new Promise(function(u,l){c=r[a](c),s(u,l,c.done,c.value)})}}function s(a,c,u,l){Promise.resolve(l).then(function(h){a({value:h,done:u})},c)}},k8=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r},L8=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)Object.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n.default=r,n},j8=function(r){return r&&r.__esModule?r:{default:r}},B8=function(r,n){if(!n.has(r))throw new TypeError("attempted to get private field on non-instance");return n.get(r)},q8=function(r,n,i){if(!n.has(r))throw new TypeError("attempted to set private field on non-instance");return n.set(r,i),i},t("__extends",w8),t("__assign",E8),t("__rest",S8),t("__decorate",x8),t("__param",O8),t("__metadata",C8),t("__awaiter",A8),t("__generator",I8),t("__exportStar",M8),t("__createBinding",F8),t("__values",u0),t("__read",Jv),t("__spread",R8),t("__spreadArrays",T8),t("__await",mc),t("__asyncGenerator",P8),t("__asyncDelegator",D8),t("__asyncValues",N8),t("__makeTemplateObject",k8),t("__importStar",L8),t("__importDefault",j8),t("__classPrivateFieldGet",B8),t("__classPrivateFieldSet",q8)})});var Xv=_(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});function vG(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}f0.safeJsonParse=vG;function bG(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}f0.safeJsonStringify=bG});var U8=_((FCe,h0)=>{"use strict";(function(){"use strict";let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){let r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof global<"u"&&global.localStorage?h0.exports=global.localStorage:typeof window<"u"&&window.localStorage?h0.exports=window.localStorage:h0.exports=new e})()});var $8=_(d0=>{"use strict";Object.defineProperty(d0,"__esModule",{value:!0});d0.IKeyValueStorage=void 0;var eb=class{};d0.IKeyValueStorage=eb});var W8=_(p0=>{"use strict";Object.defineProperty(p0,"__esModule",{value:!0});p0.parseEntry=void 0;var _G=Xv();function wG(t){var e;return[t[0],_G.safeJsonParse((e=t[1])!==null&&e!==void 0?e:"")]}p0.parseEntry=wG});var z8=_(g0=>{"use strict";Object.defineProperty(g0,"__esModule",{value:!0});var H8=Qv();H8.__exportStar($8(),g0);H8.__exportStar(W8(),g0)});var G8=_(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.KeyValueStorage=void 0;var yc=Qv(),V8=Xv(),EG=yc.__importDefault(U8()),SG=z8(),m0=class{constructor(){this.localStorage=EG.default}getKeys(){return yc.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return yc.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(SG.parseEntry)})}getItem(e){return yc.__awaiter(this,void 0,void 0,function*(){let r=this.localStorage.getItem(e);if(r!==null)return V8.safeJsonParse(r)})}setItem(e,r){return yc.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,V8.safeJsonStringify(r))})}removeItem(e){return yc.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}};Yl.KeyValueStorage=m0;Yl.default=m0});var Zl=_((zCe,v0)=>{var K8,Y8,Z8,J8,Q8,X8,eO,tO,rO,y0,tb,nO,iO,vc,oO,sO,aO,cO,uO,lO,fO,hO,dO;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){t(r(e,r(n)))}):typeof v0=="object"&&typeof v0.exports=="object"?t(r(e,r(v0.exports))):t(r(e));function r(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(o,s){return n[o]=i?i(o,s):s}}})(function(t){var e=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])};K8=function(r,n){e(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},Y8=Object.assign||function(r){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},Z8=function(r,n){var i={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(r);s<o.length;s++)n.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(r,o[s])&&(i[o[s]]=r[o[s]]);return i},J8=function(r,n,i,o){var s=arguments.length,a=s<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,i):o,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,n,i,o);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(s<3?c(a):s>3?c(n,i,a):c(n,i))||a);return s>3&&a&&Object.defineProperty(n,i,a),a},Q8=function(r,n){return function(i,o){n(i,o,r)}},X8=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},eO=function(r,n,i,o){function s(a){return a instanceof i?a:new i(function(c){c(a)})}return new(i||(i=Promise))(function(a,c){function u(d){try{h(o.next(d))}catch(m){c(m)}}function l(d){try{h(o.throw(d))}catch(m){c(m)}}function h(d){d.done?a(d.value):s(d.value).then(u,l)}h((o=o.apply(r,n||[])).next())})},tO=function(r,n){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(d){return l([h,d])}}function l(h){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,s&&(a=h[0]&2?s.return:h[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,h[1])).done)return a;switch(s=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return i.label++,{value:h[1],done:!1};case 5:i.label++,s=h[1],h=[0];continue;case 7:h=i.ops.pop(),i.trys.pop();continue;default:if(a=i.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){i=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){i.label=h[1];break}if(h[0]===6&&i.label<a[1]){i.label=a[1],a=h;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(h);break}a[2]&&i.ops.pop(),i.trys.pop();continue}h=n.call(r,i)}catch(d){h=[6,d],s=0}finally{o=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},dO=function(r,n,i,o){o===void 0&&(o=i),r[o]=n[i]},rO=function(r,n){for(var i in r)i!=="default"&&!n.hasOwnProperty(i)&&(n[i]=r[i])},y0=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],o=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},tb=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var o=i.call(r),s,a=[],c;try{for(;(n===void 0||n-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(u){c={error:u}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(c)throw c.error}}return a},nO=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(tb(arguments[n]));return r},iO=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var o=Array(r),s=0,n=0;n<i;n++)for(var a=arguments[n],c=0,u=a.length;c<u;c++,s++)o[s]=a[c];return o},vc=function(r){return this instanceof vc?(this.v=r,this):new vc(r)},oO=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(r,n||[]),s,a=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(v){o[v]&&(s[v]=function(x){return new Promise(function(O,I){a.push([v,x,O,I])>1||u(v,x)})})}function u(v,x){try{l(o[v](x))}catch(O){m(a[0][3],O)}}function l(v){v.value instanceof vc?Promise.resolve(v.value.v).then(h,d):m(a[0][2],v)}function h(v){u("next",v)}function d(v){u("throw",v)}function m(v,x){v(x),a.shift(),a.length&&u(a[0][0],a[0][1])}},sO=function(r){var n,i;return n={},o("next"),o("throw",function(s){throw s}),o("return"),n[Symbol.iterator]=function(){return this},n;function o(s,a){n[s]=r[s]?function(c){return(i=!i)?{value:vc(r[s](c)),done:s==="return"}:a?a(c):c}:a}},aO=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof y0=="function"?y0(r):r[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(a){i[a]=r[a]&&function(c){return new Promise(function(u,l){c=r[a](c),s(u,l,c.done,c.value)})}}function s(a,c,u,l){Promise.resolve(l).then(function(h){a({value:h,done:u})},c)}},cO=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r},uO=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)Object.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n.default=r,n},lO=function(r){return r&&r.__esModule?r:{default:r}},fO=function(r,n){if(!n.has(r))throw new TypeError("attempted to get private field on non-instance");return n.get(r)},hO=function(r,n,i){if(!n.has(r))throw new TypeError("attempted to set private field on non-instance");return n.set(r,i),i},t("__extends",K8),t("__assign",Y8),t("__rest",Z8),t("__decorate",J8),t("__param",Q8),t("__metadata",X8),t("__awaiter",eO),t("__generator",tO),t("__exportStar",rO),t("__createBinding",dO),t("__values",y0),t("__read",tb),t("__spread",nO),t("__spreadArrays",iO),t("__await",vc),t("__asyncGenerator",oO),t("__asyncDelegator",sO),t("__asyncValues",aO),t("__makeTemplateObject",cO),t("__importStar",uO),t("__importDefault",lO),t("__classPrivateFieldGet",fO),t("__classPrivateFieldSet",hO)})});var Jl=_((VCe,_0)=>{var pO,gO,mO,yO,vO,bO,_O,wO,EO,b0,rb,SO,xO,bc,OO,CO,AO,IO,MO,RO,TO,PO,DO;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){t(r(e,r(n)))}):typeof _0=="object"&&typeof _0.exports=="object"?t(r(e,r(_0.exports))):t(r(e));function r(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(o,s){return n[o]=i?i(o,s):s}}})(function(t){var e=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])};pO=function(r,n){e(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},gO=Object.assign||function(r){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},mO=function(r,n){var i={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(r);s<o.length;s++)n.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(r,o[s])&&(i[o[s]]=r[o[s]]);return i},yO=function(r,n,i,o){var s=arguments.length,a=s<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,i):o,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,n,i,o);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(s<3?c(a):s>3?c(n,i,a):c(n,i))||a);return s>3&&a&&Object.defineProperty(n,i,a),a},vO=function(r,n){return function(i,o){n(i,o,r)}},bO=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},_O=function(r,n,i,o){function s(a){return a instanceof i?a:new i(function(c){c(a)})}return new(i||(i=Promise))(function(a,c){function u(d){try{h(o.next(d))}catch(m){c(m)}}function l(d){try{h(o.throw(d))}catch(m){c(m)}}function h(d){d.done?a(d.value):s(d.value).then(u,l)}h((o=o.apply(r,n||[])).next())})},wO=function(r,n){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(d){return l([h,d])}}function l(h){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,s&&(a=h[0]&2?s.return:h[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,h[1])).done)return a;switch(s=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return i.label++,{value:h[1],done:!1};case 5:i.label++,s=h[1],h=[0];continue;case 7:h=i.ops.pop(),i.trys.pop();continue;default:if(a=i.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){i=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){i.label=h[1];break}if(h[0]===6&&i.label<a[1]){i.label=a[1],a=h;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(h);break}a[2]&&i.ops.pop(),i.trys.pop();continue}h=n.call(r,i)}catch(d){h=[6,d],s=0}finally{o=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},DO=function(r,n,i,o){o===void 0&&(o=i),r[o]=n[i]},EO=function(r,n){for(var i in r)i!=="default"&&!n.hasOwnProperty(i)&&(n[i]=r[i])},b0=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],o=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},rb=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var o=i.call(r),s,a=[],c;try{for(;(n===void 0||n-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(u){c={error:u}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(c)throw c.error}}return a},SO=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(rb(arguments[n]));return r},xO=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var o=Array(r),s=0,n=0;n<i;n++)for(var a=arguments[n],c=0,u=a.length;c<u;c++,s++)o[s]=a[c];return o},bc=function(r){return this instanceof bc?(this.v=r,this):new bc(r)},OO=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(r,n||[]),s,a=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(v){o[v]&&(s[v]=function(x){return new Promise(function(O,I){a.push([v,x,O,I])>1||u(v,x)})})}function u(v,x){try{l(o[v](x))}catch(O){m(a[0][3],O)}}function l(v){v.value instanceof bc?Promise.resolve(v.value.v).then(h,d):m(a[0][2],v)}function h(v){u("next",v)}function d(v){u("throw",v)}function m(v,x){v(x),a.shift(),a.length&&u(a[0][0],a[0][1])}},CO=function(r){var n,i;return n={},o("next"),o("throw",function(s){throw s}),o("return"),n[Symbol.iterator]=function(){return this},n;function o(s,a){n[s]=r[s]?function(c){return(i=!i)?{value:bc(r[s](c)),done:s==="return"}:a?a(c):c}:a}},AO=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof b0=="function"?b0(r):r[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(a){i[a]=r[a]&&function(c){return new Promise(function(u,l){c=r[a](c),s(u,l,c.done,c.value)})}}function s(a,c,u,l){Promise.resolve(l).then(function(h){a({value:h,done:u})},c)}},IO=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r},MO=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)Object.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n.default=r,n},RO=function(r){return r&&r.__esModule?r:{default:r}},TO=function(r,n){if(!n.has(r))throw new TypeError("attempted to get private field on non-instance");return n.get(r)},PO=function(r,n,i){if(!n.has(r))throw new TypeError("attempted to set private field on non-instance");return n.set(r,i),i},t("__extends",pO),t("__assign",gO),t("__rest",mO),t("__decorate",yO),t("__param",vO),t("__metadata",bO),t("__awaiter",_O),t("__generator",wO),t("__exportStar",EO),t("__createBinding",DO),t("__values",b0),t("__read",rb),t("__spread",SO),t("__spreadArrays",xO),t("__await",bc),t("__asyncGenerator",OO),t("__asyncDelegator",CO),t("__asyncValues",AO),t("__makeTemplateObject",IO),t("__importStar",MO),t("__importDefault",RO),t("__classPrivateFieldGet",TO),t("__classPrivateFieldSet",PO)})});var NO=_(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});w0.delay=void 0;function xG(t){return new Promise(e=>{setTimeout(()=>{e(!0)},t)})}w0.delay=xG});var kO=_(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.ONE_THOUSAND=_c.ONE_HUNDRED=void 0;_c.ONE_HUNDRED=100;_c.ONE_THOUSAND=1e3});var LO=_(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.ONE_YEAR=le.FOUR_WEEKS=le.THREE_WEEKS=le.TWO_WEEKS=le.ONE_WEEK=le.THIRTY_DAYS=le.SEVEN_DAYS=le.FIVE_DAYS=le.THREE_DAYS=le.ONE_DAY=le.TWENTY_FOUR_HOURS=le.TWELVE_HOURS=le.SIX_HOURS=le.THREE_HOURS=le.ONE_HOUR=le.SIXTY_MINUTES=le.THIRTY_MINUTES=le.TEN_MINUTES=le.FIVE_MINUTES=le.ONE_MINUTE=le.SIXTY_SECONDS=le.THIRTY_SECONDS=le.TEN_SECONDS=le.FIVE_SECONDS=le.ONE_SECOND=void 0;le.ONE_SECOND=1;le.FIVE_SECONDS=5;le.TEN_SECONDS=10;le.THIRTY_SECONDS=30;le.SIXTY_SECONDS=60;le.ONE_MINUTE=le.SIXTY_SECONDS;le.FIVE_MINUTES=le.ONE_MINUTE*5;le.TEN_MINUTES=le.ONE_MINUTE*10;le.THIRTY_MINUTES=le.ONE_MINUTE*30;le.SIXTY_MINUTES=le.ONE_MINUTE*60;le.ONE_HOUR=le.SIXTY_MINUTES;le.THREE_HOURS=le.ONE_HOUR*3;le.SIX_HOURS=le.ONE_HOUR*6;le.TWELVE_HOURS=le.ONE_HOUR*12;le.TWENTY_FOUR_HOURS=le.ONE_HOUR*24;le.ONE_DAY=le.TWENTY_FOUR_HOURS;le.THREE_DAYS=le.ONE_DAY*3;le.FIVE_DAYS=le.ONE_DAY*5;le.SEVEN_DAYS=le.ONE_DAY*7;le.THIRTY_DAYS=le.ONE_DAY*30;le.ONE_WEEK=le.SEVEN_DAYS;le.TWO_WEEKS=le.ONE_WEEK*2;le.THREE_WEEKS=le.ONE_WEEK*3;le.FOUR_WEEKS=le.ONE_WEEK*4;le.ONE_YEAR=le.ONE_DAY*365});var nb=_(E0=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});var jO=Jl();jO.__exportStar(kO(),E0);jO.__exportStar(LO(),E0)});var qO=_(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.fromMiliseconds=wc.toMiliseconds=void 0;var BO=nb();function OG(t){return t*BO.ONE_THOUSAND}wc.toMiliseconds=OG;function CG(t){return Math.floor(t/BO.ONE_THOUSAND)}wc.fromMiliseconds=CG});var UO=_(S0=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});var FO=Jl();FO.__exportStar(NO(),S0);FO.__exportStar(qO(),S0)});var $O=_(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.Watch=void 0;var x0=class{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw new Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){let r=this.get(e);if(typeof r.elapsed<"u")throw new Error(`Watch already stopped for label: ${e}`);let n=Date.now()-r.started;this.timestamps.set(e,{started:r.started,elapsed:n})}get(e){let r=this.timestamps.get(e);if(typeof r>"u")throw new Error(`No timestamp found for label: ${e}`);return r}elapsed(e){let r=this.get(e);return r.elapsed||Date.now()-r.started}};Ql.Watch=x0;Ql.default=x0});var WO=_(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});O0.IWatch=void 0;var ib=class{};O0.IWatch=ib});var HO=_(ob=>{"use strict";Object.defineProperty(ob,"__esModule",{value:!0});var AG=Jl();AG.__exportStar(WO(),ob)});var Ps=_(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});var C0=Jl();C0.__exportStar(UO(),Ec);C0.__exportStar($O(),Ec);C0.__exportStar(HO(),Ec);C0.__exportStar(nb(),Ec)});var li,zO=ie(()=>{li=class{}});var VO={};ir(VO,{IEvents:()=>li});var sb=ie(()=>{zO()});var GO=_(A0=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});A0.IHeartBeat=void 0;var IG=(sb(),or(VO)),ab=class extends IG.IEvents{constructor(e){super()}};A0.IHeartBeat=ab});var ub=_(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var MG=Zl();MG.__exportStar(GO(),cb)});var KO=_(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.HEARTBEAT_EVENTS=Sc.HEARTBEAT_INTERVAL=void 0;var RG=Ps();Sc.HEARTBEAT_INTERVAL=RG.FIVE_SECONDS;Sc.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"}});var fb=_(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});var TG=Zl();TG.__exportStar(KO(),lb)});var YO=_(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});I0.HeartBeat=void 0;var hb=Zl(),PG=yn(),DG=Ps(),NG=ub(),db=fb(),Xl=class extends NG.IHeartBeat{constructor(e){super(e),this.events=new PG.EventEmitter,this.interval=db.HEARTBEAT_INTERVAL,this.interval=e?.interval||db.HEARTBEAT_INTERVAL}static init(e){return hb.__awaiter(this,void 0,void 0,function*(){let r=new Xl(e);return yield r.init(),r})}init(){return hb.__awaiter(this,void 0,void 0,function*(){yield 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)}initialize(){return hb.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),DG.toMiliseconds(this.interval))})}pulse(){this.events.emit(db.HEARTBEAT_EVENTS.pulse)}};I0.HeartBeat=Xl});var ZO=_(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});var pb=Zl();pb.__exportStar(YO(),ef);pb.__exportStar(ub(),ef);pb.__exportStar(fb(),ef)});var y7=_((fAe,R0)=>{var JO,QO,XO,e7,t7,r7,n7,i7,o7,M0,gb,s7,a7,xc,c7,u7,l7,f7,h7,d7,p7,g7,m7;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){t(r(e,r(n)))}):typeof R0=="object"&&typeof R0.exports=="object"?t(r(e,r(R0.exports))):t(r(e));function r(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(o,s){return n[o]=i?i(o,s):s}}})(function(t){var e=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])};JO=function(r,n){e(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},QO=Object.assign||function(r){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},XO=function(r,n){var i={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(r);s<o.length;s++)n.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(r,o[s])&&(i[o[s]]=r[o[s]]);return i},e7=function(r,n,i,o){var s=arguments.length,a=s<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,i):o,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,n,i,o);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(s<3?c(a):s>3?c(n,i,a):c(n,i))||a);return s>3&&a&&Object.defineProperty(n,i,a),a},t7=function(r,n){return function(i,o){n(i,o,r)}},r7=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},n7=function(r,n,i,o){function s(a){return a instanceof i?a:new i(function(c){c(a)})}return new(i||(i=Promise))(function(a,c){function u(d){try{h(o.next(d))}catch(m){c(m)}}function l(d){try{h(o.throw(d))}catch(m){c(m)}}function h(d){d.done?a(d.value):s(d.value).then(u,l)}h((o=o.apply(r,n||[])).next())})},i7=function(r,n){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(d){return l([h,d])}}function l(h){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,s&&(a=h[0]&2?s.return:h[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,h[1])).done)return a;switch(s=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return i.label++,{value:h[1],done:!1};case 5:i.label++,s=h[1],h=[0];continue;case 7:h=i.ops.pop(),i.trys.pop();continue;default:if(a=i.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){i=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){i.label=h[1];break}if(h[0]===6&&i.label<a[1]){i.label=a[1],a=h;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(h);break}a[2]&&i.ops.pop(),i.trys.pop();continue}h=n.call(r,i)}catch(d){h=[6,d],s=0}finally{o=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},m7=function(r,n,i,o){o===void 0&&(o=i),r[o]=n[i]},o7=function(r,n){for(var i in r)i!=="default"&&!n.hasOwnProperty(i)&&(n[i]=r[i])},M0=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],o=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},gb=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var o=i.call(r),s,a=[],c;try{for(;(n===void 0||n-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(u){c={error:u}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(c)throw c.error}}return a},s7=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(gb(arguments[n]));return r},a7=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var o=Array(r),s=0,n=0;n<i;n++)for(var a=arguments[n],c=0,u=a.length;c<u;c++,s++)o[s]=a[c];return o},xc=function(r){return this instanceof xc?(this.v=r,this):new xc(r)},c7=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(r,n||[]),s,a=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(v){o[v]&&(s[v]=function(x){return new Promise(function(O,I){a.push([v,x,O,I])>1||u(v,x)})})}function u(v,x){try{l(o[v](x))}catch(O){m(a[0][3],O)}}function l(v){v.value instanceof xc?Promise.resolve(v.value.v).then(h,d):m(a[0][2],v)}function h(v){u("next",v)}function d(v){u("throw",v)}function m(v,x){v(x),a.shift(),a.length&&u(a[0][0],a[0][1])}},u7=function(r){var n,i;return n={},o("next"),o("throw",function(s){throw s}),o("return"),n[Symbol.iterator]=function(){return this},n;function o(s,a){n[s]=r[s]?function(c){return(i=!i)?{value:xc(r[s](c)),done:s==="return"}:a?a(c):c}:a}},l7=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof M0=="function"?M0(r):r[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(a){i[a]=r[a]&&function(c){return new Promise(function(u,l){c=r[a](c),s(u,l,c.done,c.value)})}}function s(a,c,u,l){Promise.resolve(l).then(function(h){a({value:h,done:u})},c)}},f7=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r},h7=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)Object.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n.default=r,n},d7=function(r){return r&&r.__esModule?r:{default:r}},p7=function(r,n){if(!n.has(r))throw new TypeError("attempted to get private field on non-instance");return n.get(r)},g7=function(r,n,i){if(!n.has(r))throw new TypeError("attempted to set private field on non-instance");return n.set(r,i),i},t("__extends",JO),t("__assign",QO),t("__rest",XO),t("__decorate",e7),t("__param",t7),t("__metadata",r7),t("__awaiter",n7),t("__generator",i7),t("__exportStar",o7),t("__createBinding",m7),t("__values",M0),t("__read",gb),t("__spread",s7),t("__spreadArrays",a7),t("__await",xc),t("__asyncGenerator",c7),t("__asyncDelegator",u7),t("__asyncValues",l7),t("__makeTemplateObject",f7),t("__importStar",h7),t("__importDefault",d7),t("__classPrivateFieldGet",p7),t("__classPrivateFieldSet",g7)})});var mb=_(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.PINO_CUSTOM_CONTEXT_KEY=Oc.PINO_LOGGER_DEFAULTS=void 0;Oc.PINO_LOGGER_DEFAULTS={level:"info"};Oc.PINO_CUSTOM_CONTEXT_KEY="custom_context"});var E7=_(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.generateChildLogger=nn.formatChildLoggerContext=nn.getLoggerContext=nn.setBrowserLoggerContext=nn.getBrowserLoggerContext=nn.getDefaultLoggerOptions=void 0;var Cc=mb();function kG(t){return Object.assign(Object.assign({},t),{level:t?.level||Cc.PINO_LOGGER_DEFAULTS.level})}nn.getDefaultLoggerOptions=kG;function v7(t,e=Cc.PINO_CUSTOM_CONTEXT_KEY){return t[e]||""}nn.getBrowserLoggerContext=v7;function b7(t,e,r=Cc.PINO_CUSTOM_CONTEXT_KEY){return t[r]=e,t}nn.setBrowserLoggerContext=b7;function _7(t,e=Cc.PINO_CUSTOM_CONTEXT_KEY){let r="";return typeof t.bindings>"u"?r=v7(t,e):r=t.bindings().context||"",r}nn.getLoggerContext=_7;function w7(t,e,r=Cc.PINO_CUSTOM_CONTEXT_KEY){let n=_7(t,r);return n.trim()?`${n}/${e}`:e}nn.formatChildLoggerContext=w7;function LG(t,e,r=Cc.PINO_CUSTOM_CONTEXT_KEY){let n=w7(t,e,r),i=t.child({context:n});return b7(i,n,r)}nn.generateChildLogger=LG});var T0=_(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.pino=void 0;var yb=y7(),jG=yb.__importDefault(Kl());Object.defineProperty(Ac,"pino",{enumerable:!0,get:function(){return jG.default}});yb.__exportStar(mb(),Ac);yb.__exportStar(E7(),Ac)});var O7=_($0=>{"use strict";Object.defineProperty($0,"__esModule",{value:!0});$0.BrowserRandomSource=void 0;var x7=65536,vb=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let 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.");let r=new Uint8Array(e);for(let n=0;n<r.length;n+=x7)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,x7)));return r}};$0.BrowserRandomSource=vb});var Rn=_(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});function BG(t){for(var e=0;e<t.length;e++)t[e]=0;return t}bb.wipe=BG});var C7=_(()=>{});var A7=_(W0=>{"use strict";Object.defineProperty(W0,"__esModule",{value:!0});W0.NodeRandomSource=void 0;var qG=Rn(),_b=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Rs<"u"){let e=C7();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");let n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,qG.wipe)(r),n}};W0.NodeRandomSource=_b});var I7=_(H0=>{"use strict";Object.defineProperty(H0,"__esModule",{value:!0});H0.SystemRandomSource=void 0;var FG=O7(),UG=A7(),wb=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new FG.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new UG.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)}};H0.SystemRandomSource=wb});var M7=_(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});function $G(t,e){var r=t>>>16&65535,n=t&65535,i=e>>>16&65535,o=e&65535;return n*o+(r*o+n*i<<16>>>0)|0}vn.mul=Math.imul||$G;function WG(t,e){return t+e|0}vn.add=WG;function HG(t,e){return t-e|0}vn.sub=HG;function zG(t,e){return t<<e|t>>>32-e}vn.rotl=zG;function VG(t,e){return t<<32-e|t>>>e}vn.rotr=VG;function GG(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}vn.isInteger=Number.isInteger||GG;vn.MAX_SAFE_INTEGER=9007199254740991;vn.isSafeInteger=function(t){return vn.isInteger(t)&&t>=-vn.MAX_SAFE_INTEGER&&t<=vn.MAX_SAFE_INTEGER}});var Ic=_(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});var R7=M7();function KG(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}je.readInt16BE=KG;function YG(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}je.readUint16BE=YG;function ZG(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}je.readInt16LE=ZG;function JG(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}je.readUint16LE=JG;function T7(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}je.writeUint16BE=T7;je.writeInt16BE=T7;function P7(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}je.writeUint16LE=P7;je.writeInt16LE=P7;function Eb(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}je.readInt32BE=Eb;function Sb(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}je.readUint32BE=Sb;function xb(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}je.readInt32LE=xb;function Ob(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}je.readUint32LE=Ob;function z0(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}je.writeUint32BE=z0;je.writeInt32BE=z0;function V0(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}je.writeUint32LE=V0;je.writeInt32LE=V0;function QG(t,e){e===void 0&&(e=0);var r=Eb(t,e),n=Eb(t,e+4);return r*4294967296+n-(n>>31)*4294967296}je.readInt64BE=QG;function XG(t,e){e===void 0&&(e=0);var r=Sb(t,e),n=Sb(t,e+4);return r*4294967296+n}je.readUint64BE=XG;function eK(t,e){e===void 0&&(e=0);var r=xb(t,e),n=xb(t,e+4);return n*4294967296+r-(r>>31)*4294967296}je.readInt64LE=eK;function tK(t,e){e===void 0&&(e=0);var r=Ob(t,e),n=Ob(t,e+4);return n*4294967296+r}je.readUint64LE=tK;function D7(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),z0(t/4294967296>>>0,e,r),z0(t>>>0,e,r+4),e}je.writeUint64BE=D7;je.writeInt64BE=D7;function N7(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),V0(t>>>0,e,r),V0(t/4294967296>>>0,e,r+4),e}je.writeUint64LE=N7;je.writeInt64LE=N7;function rK(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=t/8+r-1;o>=r;o--)n+=e[o]*i,i*=256;return n}je.readUintBE=rK;function nK(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+t/8;o++)n+=e[o]*i,i*=256;return n}je.readUintLE=nK;function iK(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!R7.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,o=t/8+n-1;o>=n;o--)r[o]=e/i&255,i*=256;return r}je.writeUintBE=iK;function oK(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!R7.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,o=n;o<n+t/8;o++)r[o]=e/i&255,i*=256;return r}je.writeUintLE=oK;function sK(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}je.readFloat32BE=sK;function aK(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}je.readFloat32LE=aK;function cK(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}je.readFloat64BE=cK;function uK(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}je.readFloat64LE=uK;function lK(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}je.writeFloat32BE=lK;function fK(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}je.writeFloat32LE=fK;function hK(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}je.writeFloat64BE=hK;function dK(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}je.writeFloat64LE=dK});var tf=_(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.randomStringForEntropy=Tr.randomString=Tr.randomUint32=Tr.randomBytes=Tr.defaultRandomSource=void 0;var pK=I7(),gK=Ic(),k7=Rn();Tr.defaultRandomSource=new pK.SystemRandomSource;function Cb(t,e=Tr.defaultRandomSource){return e.randomBytes(t)}Tr.randomBytes=Cb;function mK(t=Tr.defaultRandomSource){let e=Cb(4,t),r=(0,gK.readUint32LE)(e);return(0,k7.wipe)(e),r}Tr.randomUint32=mK;var L7="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function j7(t,e=L7,r=Tr.defaultRandomSource){if(e.length<2)throw new Error("randomString charset is too short");if(e.length>256)throw new Error("randomString charset is too long");let n="",i=e.length,o=256-256%i;for(;t>0;){let s=Cb(Math.ceil(t*256/o),r);for(let a=0;a<s.length&&t>0;a++){let c=s[a];c<o&&(n+=e.charAt(c%i),t--)}(0,k7.wipe)(s)}return n}Tr.randomString=j7;function yK(t,e=L7,r=Tr.defaultRandomSource){let n=Math.ceil(t/(Math.log(e.length)/Math.LN2));return j7(n,e,r)}Tr.randomStringForEntropy=yK});var F7=_(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});var Rc=Ic(),Mc=Rn();ro.DIGEST_LENGTH=64;ro.BLOCK_SIZE=128;var q7=function(){function t(){this.digestLength=ro.DIGEST_LENGTH,this.blockSize=ro.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 t.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},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){Mc.wipe(this._buffer),Mc.wipe(this._tempHi),Mc.wipe(this._tempLo),this.reset()},t.prototype.update=function(e,r){if(r===void 0&&(r=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<ro.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(Ab(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=Ab(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},t.prototype.finish=function(e){if(!this._finished){var r=this._bytesHashed,n=this._bufferLength,i=r/536870912|0,o=r<<3,s=r%128<112?128:256;this._buffer[n]=128;for(var a=n+1;a<s-8;a++)this._buffer[a]=0;Rc.writeUint32BE(i,this._buffer,s-8),Rc.writeUint32BE(o,this._buffer,s-4),Ab(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,s),this._finished=!0}for(var a=0;a<this.digestLength/8;a++)Rc.writeUint32BE(this._stateHi[a],e,a*8),Rc.writeUint32BE(this._stateLo[a],e,a*8+4);return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.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}},t.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},t.prototype.cleanSavedState=function(e){Mc.wipe(e.stateHi),Mc.wipe(e.stateLo),e.buffer&&Mc.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},t}();ro.SHA512=q7;var B7=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 Ab(t,e,r,n,i,o,s){for(var a=r[0],c=r[1],u=r[2],l=r[3],h=r[4],d=r[5],m=r[6],v=r[7],x=n[0],O=n[1],I=n[2],j=n[3],k=n[4],B=n[5],V=n[6],q=n[7],P,L,H,M,N,F,E,f;s>=128;){for(var g=0;g<16;g++){var y=8*g+o;t[g]=Rc.readUint32BE(i,y),e[g]=Rc.readUint32BE(i,y+4)}for(var g=0;g<80;g++){var b=a,w=c,R=u,T=l,S=h,p=d,A=m,Y=v,Z=x,G=O,X=I,ae=j,fe=k,Ee=B,he=V,de=q;if(P=v,L=q,N=L&65535,F=L>>>16,E=P&65535,f=P>>>16,P=(h>>>14|k<<32-14)^(h>>>18|k<<32-18)^(k>>>41-32|h<<32-(41-32)),L=(k>>>14|h<<32-14)^(k>>>18|h<<32-18)^(h>>>41-32|k<<32-(41-32)),N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,P=h&d^~h&m,L=k&B^~k&V,N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,P=B7[g*2],L=B7[g*2+1],N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,P=t[g%16],L=e[g%16],N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,F+=N>>>16,E+=F>>>16,f+=E>>>16,H=E&65535|f<<16,M=N&65535|F<<16,P=H,L=M,N=L&65535,F=L>>>16,E=P&65535,f=P>>>16,P=(a>>>28|x<<32-28)^(x>>>34-32|a<<32-(34-32))^(x>>>39-32|a<<32-(39-32)),L=(x>>>28|a<<32-28)^(a>>>34-32|x<<32-(34-32))^(a>>>39-32|x<<32-(39-32)),N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,P=a&c^a&u^c&u,L=x&O^x&I^O&I,N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,F+=N>>>16,E+=F>>>16,f+=E>>>16,Y=E&65535|f<<16,de=N&65535|F<<16,P=T,L=ae,N=L&65535,F=L>>>16,E=P&65535,f=P>>>16,P=H,L=M,N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,F+=N>>>16,E+=F>>>16,f+=E>>>16,T=E&65535|f<<16,ae=N&65535|F<<16,c=b,u=w,l=R,h=T,d=S,m=p,v=A,a=Y,O=Z,I=G,j=X,k=ae,B=fe,V=Ee,q=he,x=de,g%16===15)for(var y=0;y<16;y++)P=t[y],L=e[y],N=L&65535,F=L>>>16,E=P&65535,f=P>>>16,P=t[(y+9)%16],L=e[(y+9)%16],N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,H=t[(y+1)%16],M=e[(y+1)%16],P=(H>>>1|M<<32-1)^(H>>>8|M<<32-8)^H>>>7,L=(M>>>1|H<<32-1)^(M>>>8|H<<32-8)^(M>>>7|H<<32-7),N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,H=t[(y+14)%16],M=e[(y+14)%16],P=(H>>>19|M<<32-19)^(M>>>61-32|H<<32-(61-32))^H>>>6,L=(M>>>19|H<<32-19)^(H>>>61-32|M<<32-(61-32))^(M>>>6|H<<32-6),N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,F+=N>>>16,E+=F>>>16,f+=E>>>16,t[y]=E&65535|f<<16,e[y]=N&65535|F<<16}P=a,L=x,N=L&65535,F=L>>>16,E=P&65535,f=P>>>16,P=r[0],L=n[0],N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,F+=N>>>16,E+=F>>>16,f+=E>>>16,r[0]=a=E&65535|f<<16,n[0]=x=N&65535|F<<16,P=c,L=O,N=L&65535,F=L>>>16,E=P&65535,f=P>>>16,P=r[1],L=n[1],N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,F+=N>>>16,E+=F>>>16,f+=E>>>16,r[1]=c=E&65535|f<<16,n[1]=O=N&65535|F<<16,P=u,L=I,N=L&65535,F=L>>>16,E=P&65535,f=P>>>16,P=r[2],L=n[2],N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,F+=N>>>16,E+=F>>>16,f+=E>>>16,r[2]=u=E&65535|f<<16,n[2]=I=N&65535|F<<16,P=l,L=j,N=L&65535,F=L>>>16,E=P&65535,f=P>>>16,P=r[3],L=n[3],N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,F+=N>>>16,E+=F>>>16,f+=E>>>16,r[3]=l=E&65535|f<<16,n[3]=j=N&65535|F<<16,P=h,L=k,N=L&65535,F=L>>>16,E=P&65535,f=P>>>16,P=r[4],L=n[4],N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,F+=N>>>16,E+=F>>>16,f+=E>>>16,r[4]=h=E&65535|f<<16,n[4]=k=N&65535|F<<16,P=d,L=B,N=L&65535,F=L>>>16,E=P&65535,f=P>>>16,P=r[5],L=n[5],N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,F+=N>>>16,E+=F>>>16,f+=E>>>16,r[5]=d=E&65535|f<<16,n[5]=B=N&65535|F<<16,P=m,L=V,N=L&65535,F=L>>>16,E=P&65535,f=P>>>16,P=r[6],L=n[6],N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,F+=N>>>16,E+=F>>>16,f+=E>>>16,r[6]=m=E&65535|f<<16,n[6]=V=N&65535|F<<16,P=v,L=q,N=L&65535,F=L>>>16,E=P&65535,f=P>>>16,P=r[7],L=n[7],N+=L&65535,F+=L>>>16,E+=P&65535,f+=P>>>16,F+=N>>>16,E+=F>>>16,f+=E>>>16,r[7]=v=E&65535|f<<16,n[7]=q=N&65535|F<<16,o+=128,s-=128}return o}function vK(t){var e=new q7;e.update(t);var r=e.digest();return e.clean(),r}ro.hash=vK});var eC=_(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.convertSecretKeyToX25519=Je.convertPublicKeyToX25519=Je.verify=Je.sign=Je.extractPublicKeyFromSecretKey=Je.generateKeyPair=Je.generateKeyPairFromSeed=Je.SEED_LENGTH=Je.SECRET_KEY_LENGTH=Je.PUBLIC_KEY_LENGTH=Je.SIGNATURE_LENGTH=void 0;var bK=tf(),rf=F7(),z7=Rn();Je.SIGNATURE_LENGTH=64;Je.PUBLIC_KEY_LENGTH=32;Je.SECRET_KEY_LENGTH=64;Je.SEED_LENGTH=32;function be(t){let e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}var _K=new Uint8Array(32);_K[0]=9;var Rb=be(),Tc=be([1]),wK=be([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),EK=be([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),U7=be([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),$7=be([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),SK=be([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Uo(t,e){for(let r=0;r<16;r++)t[r]=e[r]|0}function Ib(t){let e=1;for(let r=0;r<16;r++){let n=t[r]+e+65535;e=Math.floor(n/65536),t[r]=n-e*65536}t[0]+=e-1+37*(e-1)}function V7(t,e,r){let n=~(r-1);for(let i=0;i<16;i++){let o=n&(t[i]^e[i]);t[i]^=o,e[i]^=o}}function nf(t,e){let r=be(),n=be();for(let i=0;i<16;i++)n[i]=e[i];Ib(n),Ib(n),Ib(n);for(let i=0;i<2;i++){r[0]=n[0]-65517;for(let s=1;s<15;s++)r[s]=n[s]-65535-(r[s-1]>>16&1),r[s-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);let o=r[15]>>16&1;r[14]&=65535,V7(n,r,1-o)}for(let i=0;i<16;i++)t[2*i]=n[i]&255,t[2*i+1]=n[i]>>8}function G7(t,e){let r=0;for(let n=0;n<32;n++)r|=t[n]^e[n];return(1&r-1>>>8)-1}function W7(t,e){let r=new Uint8Array(32),n=new Uint8Array(32);return nf(r,t),nf(n,e),G7(r,n)}function K7(t){let e=new Uint8Array(32);return nf(e,t),e[0]&1}function xK(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}function Ns(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}function Ls(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}function ot(t,e,r){let n,i,o=0,s=0,a=0,c=0,u=0,l=0,h=0,d=0,m=0,v=0,x=0,O=0,I=0,j=0,k=0,B=0,V=0,q=0,P=0,L=0,H=0,M=0,N=0,F=0,E=0,f=0,g=0,y=0,b=0,w=0,R=0,T=r[0],S=r[1],p=r[2],A=r[3],Y=r[4],Z=r[5],G=r[6],X=r[7],ae=r[8],fe=r[9],Ee=r[10],he=r[11],de=r[12],Te=r[13],ye=r[14],ve=r[15];n=e[0],o+=n*T,s+=n*S,a+=n*p,c+=n*A,u+=n*Y,l+=n*Z,h+=n*G,d+=n*X,m+=n*ae,v+=n*fe,x+=n*Ee,O+=n*he,I+=n*de,j+=n*Te,k+=n*ye,B+=n*ve,n=e[1],s+=n*T,a+=n*S,c+=n*p,u+=n*A,l+=n*Y,h+=n*Z,d+=n*G,m+=n*X,v+=n*ae,x+=n*fe,O+=n*Ee,I+=n*he,j+=n*de,k+=n*Te,B+=n*ye,V+=n*ve,n=e[2],a+=n*T,c+=n*S,u+=n*p,l+=n*A,h+=n*Y,d+=n*Z,m+=n*G,v+=n*X,x+=n*ae,O+=n*fe,I+=n*Ee,j+=n*he,k+=n*de,B+=n*Te,V+=n*ye,q+=n*ve,n=e[3],c+=n*T,u+=n*S,l+=n*p,h+=n*A,d+=n*Y,m+=n*Z,v+=n*G,x+=n*X,O+=n*ae,I+=n*fe,j+=n*Ee,k+=n*he,B+=n*de,V+=n*Te,q+=n*ye,P+=n*ve,n=e[4],u+=n*T,l+=n*S,h+=n*p,d+=n*A,m+=n*Y,v+=n*Z,x+=n*G,O+=n*X,I+=n*ae,j+=n*fe,k+=n*Ee,B+=n*he,V+=n*de,q+=n*Te,P+=n*ye,L+=n*ve,n=e[5],l+=n*T,h+=n*S,d+=n*p,m+=n*A,v+=n*Y,x+=n*Z,O+=n*G,I+=n*X,j+=n*ae,k+=n*fe,B+=n*Ee,V+=n*he,q+=n*de,P+=n*Te,L+=n*ye,H+=n*ve,n=e[6],h+=n*T,d+=n*S,m+=n*p,v+=n*A,x+=n*Y,O+=n*Z,I+=n*G,j+=n*X,k+=n*ae,B+=n*fe,V+=n*Ee,q+=n*he,P+=n*de,L+=n*Te,H+=n*ye,M+=n*ve,n=e[7],d+=n*T,m+=n*S,v+=n*p,x+=n*A,O+=n*Y,I+=n*Z,j+=n*G,k+=n*X,B+=n*ae,V+=n*fe,q+=n*Ee,P+=n*he,L+=n*de,H+=n*Te,M+=n*ye,N+=n*ve,n=e[8],m+=n*T,v+=n*S,x+=n*p,O+=n*A,I+=n*Y,j+=n*Z,k+=n*G,B+=n*X,V+=n*ae,q+=n*fe,P+=n*Ee,L+=n*he,H+=n*de,M+=n*Te,N+=n*ye,F+=n*ve,n=e[9],v+=n*T,x+=n*S,O+=n*p,I+=n*A,j+=n*Y,k+=n*Z,B+=n*G,V+=n*X,q+=n*ae,P+=n*fe,L+=n*Ee,H+=n*he,M+=n*de,N+=n*Te,F+=n*ye,E+=n*ve,n=e[10],x+=n*T,O+=n*S,I+=n*p,j+=n*A,k+=n*Y,B+=n*Z,V+=n*G,q+=n*X,P+=n*ae,L+=n*fe,H+=n*Ee,M+=n*he,N+=n*de,F+=n*Te,E+=n*ye,f+=n*ve,n=e[11],O+=n*T,I+=n*S,j+=n*p,k+=n*A,B+=n*Y,V+=n*Z,q+=n*G,P+=n*X,L+=n*ae,H+=n*fe,M+=n*Ee,N+=n*he,F+=n*de,E+=n*Te,f+=n*ye,g+=n*ve,n=e[12],I+=n*T,j+=n*S,k+=n*p,B+=n*A,V+=n*Y,q+=n*Z,P+=n*G,L+=n*X,H+=n*ae,M+=n*fe,N+=n*Ee,F+=n*he,E+=n*de,f+=n*Te,g+=n*ye,y+=n*ve,n=e[13],j+=n*T,k+=n*S,B+=n*p,V+=n*A,q+=n*Y,P+=n*Z,L+=n*G,H+=n*X,M+=n*ae,N+=n*fe,F+=n*Ee,E+=n*he,f+=n*de,g+=n*Te,y+=n*ye,b+=n*ve,n=e[14],k+=n*T,B+=n*S,V+=n*p,q+=n*A,P+=n*Y,L+=n*Z,H+=n*G,M+=n*X,N+=n*ae,F+=n*fe,E+=n*Ee,f+=n*he,g+=n*de,y+=n*Te,b+=n*ye,w+=n*ve,n=e[15],B+=n*T,V+=n*S,q+=n*p,P+=n*A,L+=n*Y,H+=n*Z,M+=n*G,N+=n*X,F+=n*ae,E+=n*fe,f+=n*Ee,g+=n*he,y+=n*de,b+=n*Te,w+=n*ye,R+=n*ve,o+=38*V,s+=38*q,a+=38*P,c+=38*L,u+=38*H,l+=38*M,h+=38*N,d+=38*F,m+=38*E,v+=38*f,x+=38*g,O+=38*y,I+=38*b,j+=38*w,k+=38*R,i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-i*65536,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=l+i+65535,i=Math.floor(n/65536),l=n-i*65536,n=h+i+65535,i=Math.floor(n/65536),h=n-i*65536,n=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=j+i+65535,i=Math.floor(n/65536),j=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,o+=i-1+37*(i-1),i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-i*65536,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=l+i+65535,i=Math.floor(n/65536),l=n-i*65536,n=h+i+65535,i=Math.floor(n/65536),h=n-i*65536,n=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=j+i+65535,i=Math.floor(n/65536),j=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,o+=i-1+37*(i-1),t[0]=o,t[1]=s,t[2]=a,t[3]=c,t[4]=u,t[5]=l,t[6]=h,t[7]=d,t[8]=m,t[9]=v,t[10]=x,t[11]=O,t[12]=I,t[13]=j,t[14]=k,t[15]=B}function ks(t,e){ot(t,e,e)}function Y7(t,e){let r=be(),n;for(n=0;n<16;n++)r[n]=e[n];for(n=253;n>=0;n--)ks(r,r),n!==2&&n!==4&&ot(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}function OK(t,e){let r=be(),n;for(n=0;n<16;n++)r[n]=e[n];for(n=250;n>=0;n--)ks(r,r),n!==1&&ot(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}function Tb(t,e){let r=be(),n=be(),i=be(),o=be(),s=be(),a=be(),c=be(),u=be(),l=be();Ls(r,t[1],t[0]),Ls(l,e[1],e[0]),ot(r,r,l),Ns(n,t[0],t[1]),Ns(l,e[0],e[1]),ot(n,n,l),ot(i,t[3],e[3]),ot(i,i,EK),ot(o,t[2],e[2]),Ns(o,o,o),Ls(s,n,r),Ls(a,o,i),Ns(c,o,i),Ns(u,n,r),ot(t[0],s,a),ot(t[1],u,c),ot(t[2],c,a),ot(t[3],s,u)}function H7(t,e,r){for(let n=0;n<4;n++)V7(t[n],e[n],r)}function Db(t,e){let r=be(),n=be(),i=be();Y7(i,e[2]),ot(r,e[0],i),ot(n,e[1],i),nf(t,n),t[31]^=K7(r)<<7}function Z7(t,e,r){Uo(t[0],Rb),Uo(t[1],Tc),Uo(t[2],Tc),Uo(t[3],Rb);for(let n=255;n>=0;--n){let i=r[n/8|0]>>(n&7)&1;H7(t,e,i),Tb(e,t),Tb(t,t),H7(t,e,i)}}function Nb(t,e){let r=[be(),be(),be(),be()];Uo(r[0],U7),Uo(r[1],$7),Uo(r[2],Tc),ot(r[3],U7,$7),Z7(t,r,e)}function J7(t){if(t.length!==Je.SEED_LENGTH)throw new Error(`ed25519: seed must be ${Je.SEED_LENGTH} bytes`);let e=(0,rf.hash)(t);e[0]&=248,e[31]&=127,e[31]|=64;let r=new Uint8Array(32),n=[be(),be(),be(),be()];Nb(n,e),Db(r,n);let i=new Uint8Array(64);return i.set(t),i.set(r,32),{publicKey:r,secretKey:i}}Je.generateKeyPairFromSeed=J7;function CK(t){let e=(0,bK.randomBytes)(32,t),r=J7(e);return(0,z7.wipe)(e),r}Je.generateKeyPair=CK;function AK(t){if(t.length!==Je.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${Je.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(t.subarray(32))}Je.extractPublicKeyFromSecretKey=AK;var Mb=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 Q7(t,e){let r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)e[i]+=r-16*e[n]*Mb[i-(n-32)],r=Math.floor((e[i]+128)/256),e[i]-=r*256;e[i]+=r,e[n]=0}for(r=0,i=0;i<32;i++)e[i]+=r-(e[31]>>4)*Mb[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=r*Mb[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,t[n]=e[n]&255}function Pb(t){let e=new Float64Array(64);for(let r=0;r<64;r++)e[r]=t[r];for(let r=0;r<64;r++)t[r]=0;Q7(t,e)}function IK(t,e){let r=new Float64Array(64),n=[be(),be(),be(),be()],i=(0,rf.hash)(t.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;let o=new Uint8Array(64);o.set(i.subarray(32),32);let s=new rf.SHA512;s.update(o.subarray(32)),s.update(e);let a=s.digest();s.clean(),Pb(a),Nb(n,a),Db(o,n),s.reset(),s.update(o.subarray(0,32)),s.update(t.subarray(32)),s.update(e);let c=s.digest();Pb(c);for(let u=0;u<32;u++)r[u]=a[u];for(let u=0;u<32;u++)for(let l=0;l<32;l++)r[u+l]+=c[u]*i[l];return Q7(o.subarray(32),r),o}Je.sign=IK;function X7(t,e){let r=be(),n=be(),i=be(),o=be(),s=be(),a=be(),c=be();return Uo(t[2],Tc),xK(t[1],e),ks(i,t[1]),ot(o,i,wK),Ls(i,i,t[2]),Ns(o,t[2],o),ks(s,o),ks(a,s),ot(c,a,s),ot(r,c,i),ot(r,r,o),OK(r,r),ot(r,r,i),ot(r,r,o),ot(r,r,o),ot(t[0],r,o),ks(n,t[0]),ot(n,n,o),W7(n,i)&&ot(t[0],t[0],SK),ks(n,t[0]),ot(n,n,o),W7(n,i)?-1:(K7(t[0])===e[31]>>7&&Ls(t[0],Rb,t[0]),ot(t[3],t[0],t[1]),0)}function MK(t,e,r){let n=new Uint8Array(32),i=[be(),be(),be(),be()],o=[be(),be(),be(),be()];if(r.length!==Je.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${Je.SIGNATURE_LENGTH} bytes`);if(X7(o,t))return!1;let s=new rf.SHA512;s.update(r.subarray(0,32)),s.update(t),s.update(e);let a=s.digest();return Pb(a),Z7(i,o,a),Nb(o,r.subarray(32)),Tb(i,o),Db(n,i),!G7(r,n)}Je.verify=MK;function RK(t){let e=[be(),be(),be(),be()];if(X7(e,t))throw new Error("Ed25519: invalid public key");let r=be(),n=be(),i=e[1];Ns(r,Tc,i),Ls(n,Tc,i),Y7(n,n),ot(r,r,n);let o=new Uint8Array(32);return nf(o,r),o}Je.convertPublicKeyToX25519=RK;function TK(t){let e=(0,rf.hash)(t.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;let r=new Uint8Array(e.subarray(0,32));return(0,z7.wipe)(e),r}Je.convertSecretKeyToX25519=TK});var jC=_(r1=>{"use strict";Object.defineProperty(r1,"__esModule",{value:!0});var Pr=Ic(),o_=Rn(),zY=20;function VY(t,e,r){for(var n=1634760805,i=857760878,o=2036477234,s=1797285236,a=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],u=r[11]<<24|r[10]<<16|r[9]<<8|r[8],l=r[15]<<24|r[14]<<16|r[13]<<8|r[12],h=r[19]<<24|r[18]<<16|r[17]<<8|r[16],d=r[23]<<24|r[22]<<16|r[21]<<8|r[20],m=r[27]<<24|r[26]<<16|r[25]<<8|r[24],v=r[31]<<24|r[30]<<16|r[29]<<8|r[28],x=e[3]<<24|e[2]<<16|e[1]<<8|e[0],O=e[7]<<24|e[6]<<16|e[5]<<8|e[4],I=e[11]<<24|e[10]<<16|e[9]<<8|e[8],j=e[15]<<24|e[14]<<16|e[13]<<8|e[12],k=n,B=i,V=o,q=s,P=a,L=c,H=u,M=l,N=h,F=d,E=m,f=v,g=x,y=O,b=I,w=j,R=0;R<zY;R+=2)k=k+P|0,g^=k,g=g>>>32-16|g<<16,N=N+g|0,P^=N,P=P>>>32-12|P<<12,B=B+L|0,y^=B,y=y>>>32-16|y<<16,F=F+y|0,L^=F,L=L>>>32-12|L<<12,V=V+H|0,b^=V,b=b>>>32-16|b<<16,E=E+b|0,H^=E,H=H>>>32-12|H<<12,q=q+M|0,w^=q,w=w>>>32-16|w<<16,f=f+w|0,M^=f,M=M>>>32-12|M<<12,V=V+H|0,b^=V,b=b>>>32-8|b<<8,E=E+b|0,H^=E,H=H>>>32-7|H<<7,q=q+M|0,w^=q,w=w>>>32-8|w<<8,f=f+w|0,M^=f,M=M>>>32-7|M<<7,B=B+L|0,y^=B,y=y>>>32-8|y<<8,F=F+y|0,L^=F,L=L>>>32-7|L<<7,k=k+P|0,g^=k,g=g>>>32-8|g<<8,N=N+g|0,P^=N,P=P>>>32-7|P<<7,k=k+L|0,w^=k,w=w>>>32-16|w<<16,E=E+w|0,L^=E,L=L>>>32-12|L<<12,B=B+H|0,g^=B,g=g>>>32-16|g<<16,f=f+g|0,H^=f,H=H>>>32-12|H<<12,V=V+M|0,y^=V,y=y>>>32-16|y<<16,N=N+y|0,M^=N,M=M>>>32-12|M<<12,q=q+P|0,b^=q,b=b>>>32-16|b<<16,F=F+b|0,P^=F,P=P>>>32-12|P<<12,V=V+M|0,y^=V,y=y>>>32-8|y<<8,N=N+y|0,M^=N,M=M>>>32-7|M<<7,q=q+P|0,b^=q,b=b>>>32-8|b<<8,F=F+b|0,P^=F,P=P>>>32-7|P<<7,B=B+H|0,g^=B,g=g>>>32-8|g<<8,f=f+g|0,H^=f,H=H>>>32-7|H<<7,k=k+L|0,w^=k,w=w>>>32-8|w<<8,E=E+w|0,L^=E,L=L>>>32-7|L<<7;Pr.writeUint32LE(k+n|0,t,0),Pr.writeUint32LE(B+i|0,t,4),Pr.writeUint32LE(V+o|0,t,8),Pr.writeUint32LE(q+s|0,t,12),Pr.writeUint32LE(P+a|0,t,16),Pr.writeUint32LE(L+c|0,t,20),Pr.writeUint32LE(H+u|0,t,24),Pr.writeUint32LE(M+l|0,t,28),Pr.writeUint32LE(N+h|0,t,32),Pr.writeUint32LE(F+d|0,t,36),Pr.writeUint32LE(E+m|0,t,40),Pr.writeUint32LE(f+v|0,t,44),Pr.writeUint32LE(g+x|0,t,48),Pr.writeUint32LE(y+O|0,t,52),Pr.writeUint32LE(b+I|0,t,56),Pr.writeUint32LE(w+j|0,t,60)}function LC(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var o,s;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),s=o.length-e.length,o.set(e,s)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=e,s=i}for(var a=new Uint8Array(64),c=0;c<r.length;c+=64){VY(a,o,t);for(var u=c;u<c+64&&u<r.length;u++)n[u]=r[u]^a[u-c];KY(o,0,s)}return o_.wipe(a),i===0&&o_.wipe(o),n}r1.streamXOR=LC;function GY(t,e,r,n){return n===void 0&&(n=0),o_.wipe(r),LC(t,e,r,r,n)}r1.stream=GY;function KY(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}});var n1=_(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});function YY(t,e,r){return~(t-1)&e|t-1&r}qc.select=YY;function ZY(t,e){return(t|0)-(e|0)-1>>>31&1}qc.lessOrEqual=ZY;function BC(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}qc.compare=BC;function JY(t,e){return t.length===0||e.length===0?!1:BC(t,e)!==0}qc.equal=JY});var FC=_(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});var QY=n1(),i1=Rn();io.DIGEST_LENGTH=16;var qC=function(){function t(e){this.digestLength=io.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 r=e[0]|e[1]<<8;this._r[0]=r&8191;var n=e[2]|e[3]<<8;this._r[1]=(r>>>13|n<<3)&8191;var i=e[4]|e[5]<<8;this._r[2]=(n>>>10|i<<6)&7939;var o=e[6]|e[7]<<8;this._r[3]=(i>>>7|o<<9)&8191;var s=e[8]|e[9]<<8;this._r[4]=(o>>>4|s<<12)&255,this._r[5]=s>>>1&8190;var a=e[10]|e[11]<<8;this._r[6]=(s>>>14|a<<2)&8191;var c=e[12]|e[13]<<8;this._r[7]=(a>>>11|c<<5)&8065;var u=e[14]|e[15]<<8;this._r[8]=(c>>>8|u<<8)&8191,this._r[9]=u>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return t.prototype._blocks=function(e,r,n){for(var i=this._fin?0:2048,o=this._h[0],s=this._h[1],a=this._h[2],c=this._h[3],u=this._h[4],l=this._h[5],h=this._h[6],d=this._h[7],m=this._h[8],v=this._h[9],x=this._r[0],O=this._r[1],I=this._r[2],j=this._r[3],k=this._r[4],B=this._r[5],V=this._r[6],q=this._r[7],P=this._r[8],L=this._r[9];n>=16;){var H=e[r+0]|e[r+1]<<8;o+=H&8191;var M=e[r+2]|e[r+3]<<8;s+=(H>>>13|M<<3)&8191;var N=e[r+4]|e[r+5]<<8;a+=(M>>>10|N<<6)&8191;var F=e[r+6]|e[r+7]<<8;c+=(N>>>7|F<<9)&8191;var E=e[r+8]|e[r+9]<<8;u+=(F>>>4|E<<12)&8191,l+=E>>>1&8191;var f=e[r+10]|e[r+11]<<8;h+=(E>>>14|f<<2)&8191;var g=e[r+12]|e[r+13]<<8;d+=(f>>>11|g<<5)&8191;var y=e[r+14]|e[r+15]<<8;m+=(g>>>8|y<<8)&8191,v+=y>>>5|i;var b=0,w=b;w+=o*x,w+=s*(5*L),w+=a*(5*P),w+=c*(5*q),w+=u*(5*V),b=w>>>13,w&=8191,w+=l*(5*B),w+=h*(5*k),w+=d*(5*j),w+=m*(5*I),w+=v*(5*O),b+=w>>>13,w&=8191;var R=b;R+=o*O,R+=s*x,R+=a*(5*L),R+=c*(5*P),R+=u*(5*q),b=R>>>13,R&=8191,R+=l*(5*V),R+=h*(5*B),R+=d*(5*k),R+=m*(5*j),R+=v*(5*I),b+=R>>>13,R&=8191;var T=b;T+=o*I,T+=s*O,T+=a*x,T+=c*(5*L),T+=u*(5*P),b=T>>>13,T&=8191,T+=l*(5*q),T+=h*(5*V),T+=d*(5*B),T+=m*(5*k),T+=v*(5*j),b+=T>>>13,T&=8191;var S=b;S+=o*j,S+=s*I,S+=a*O,S+=c*x,S+=u*(5*L),b=S>>>13,S&=8191,S+=l*(5*P),S+=h*(5*q),S+=d*(5*V),S+=m*(5*B),S+=v*(5*k),b+=S>>>13,S&=8191;var p=b;p+=o*k,p+=s*j,p+=a*I,p+=c*O,p+=u*x,b=p>>>13,p&=8191,p+=l*(5*L),p+=h*(5*P),p+=d*(5*q),p+=m*(5*V),p+=v*(5*B),b+=p>>>13,p&=8191;var A=b;A+=o*B,A+=s*k,A+=a*j,A+=c*I,A+=u*O,b=A>>>13,A&=8191,A+=l*x,A+=h*(5*L),A+=d*(5*P),A+=m*(5*q),A+=v*(5*V),b+=A>>>13,A&=8191;var Y=b;Y+=o*V,Y+=s*B,Y+=a*k,Y+=c*j,Y+=u*I,b=Y>>>13,Y&=8191,Y+=l*O,Y+=h*x,Y+=d*(5*L),Y+=m*(5*P),Y+=v*(5*q),b+=Y>>>13,Y&=8191;var Z=b;Z+=o*q,Z+=s*V,Z+=a*B,Z+=c*k,Z+=u*j,b=Z>>>13,Z&=8191,Z+=l*I,Z+=h*O,Z+=d*x,Z+=m*(5*L),Z+=v*(5*P),b+=Z>>>13,Z&=8191;var G=b;G+=o*P,G+=s*q,G+=a*V,G+=c*B,G+=u*k,b=G>>>13,G&=8191,G+=l*j,G+=h*I,G+=d*O,G+=m*x,G+=v*(5*L),b+=G>>>13,G&=8191;var X=b;X+=o*L,X+=s*P,X+=a*q,X+=c*V,X+=u*B,b=X>>>13,X&=8191,X+=l*k,X+=h*j,X+=d*I,X+=m*O,X+=v*x,b+=X>>>13,X&=8191,b=(b<<2)+b|0,b=b+w|0,w=b&8191,b=b>>>13,R+=b,o=w,s=R,a=T,c=S,u=p,l=A,h=Y,d=Z,m=G,v=X,r+=16,n-=16}this._h[0]=o,this._h[1]=s,this._h[2]=a,this._h[3]=c,this._h[4]=u,this._h[5]=l,this._h[6]=h,this._h[7]=d,this._h[8]=m,this._h[9]=v},t.prototype.finish=function(e,r){r===void 0&&(r=0);var n=new Uint16Array(10),i,o,s,a;if(this._leftover){for(a=this._leftover,this._buffer[a++]=1;a<16;a++)this._buffer[a]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(i=this._h[1]>>>13,this._h[1]&=8191,a=2;a<10;a++)this._h[a]+=i,i=this._h[a]>>>13,this._h[a]&=8191;for(this._h[0]+=i*5,i=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=i,i=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=i,n[0]=this._h[0]+5,i=n[0]>>>13,n[0]&=8191,a=1;a<10;a++)n[a]=this._h[a]+i,i=n[a]>>>13,n[a]&=8191;for(n[9]-=1<<13,o=(i^1)-1,a=0;a<10;a++)n[a]&=o;for(o=~o,a=0;a<10;a++)this._h[a]=this._h[a]&o|n[a];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,s=this._h[0]+this._pad[0],this._h[0]=s&65535,a=1;a<8;a++)s=(this._h[a]+this._pad[a]|0)+(s>>>16)|0,this._h[a]=s&65535;return e[r+0]=this._h[0]>>>0,e[r+1]=this._h[0]>>>8,e[r+2]=this._h[1]>>>0,e[r+3]=this._h[1]>>>8,e[r+4]=this._h[2]>>>0,e[r+5]=this._h[2]>>>8,e[r+6]=this._h[3]>>>0,e[r+7]=this._h[3]>>>8,e[r+8]=this._h[4]>>>0,e[r+9]=this._h[4]>>>8,e[r+10]=this._h[5]>>>0,e[r+11]=this._h[5]>>>8,e[r+12]=this._h[6]>>>0,e[r+13]=this._h[6]>>>8,e[r+14]=this._h[7]>>>0,e[r+15]=this._h[7]>>>8,this._finished=!0,this},t.prototype.update=function(e){var r=0,n=e.length,i;if(this._leftover){i=16-this._leftover,i>n&&(i=n);for(var o=0;o<i;o++)this._buffer[this._leftover+o]=e[r+o];if(n-=i,r+=i,this._leftover+=i,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(n>=16&&(i=n-n%16,this._blocks(e,r,i),r+=i,n-=i),n){for(var o=0;o<n;o++)this._buffer[this._leftover+o]=e[r+o];this._leftover+=n}return this},t.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},t.prototype.clean=function(){return i1.wipe(this._buffer),i1.wipe(this._r),i1.wipe(this._h),i1.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();io.Poly1305=qC;function XY(t,e){var r=new qC(t);r.update(e);var n=r.digest();return r.clean(),n}io.oneTimeAuth=XY;function eZ(t,e){return t.length!==io.DIGEST_LENGTH||e.length!==io.DIGEST_LENGTH?!1:QY.equal(t,e)}io.equal=eZ});var WC=_(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});var o1=jC(),tZ=FC(),lf=Rn(),UC=Ic(),rZ=n1();oo.KEY_LENGTH=32;oo.NONCE_LENGTH=12;oo.TAG_LENGTH=16;var $C=new Uint8Array(16),nZ=function(){function t(e){if(this.nonceLength=oo.NONCE_LENGTH,this.tagLength=oo.TAG_LENGTH,e.length!==oo.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return t.prototype.seal=function(e,r,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var o=new Uint8Array(16);o.set(e,o.length-e.length);var s=new Uint8Array(32);o1.stream(this._key,o,s,4);var a=r.length+this.tagLength,c;if(i){if(i.length!==a)throw new Error("ChaCha20Poly1305: incorrect destination length");c=i}else c=new Uint8Array(a);return o1.streamXOR(this._key,o,r,c,4),this._authenticate(c.subarray(c.length-this.tagLength,c.length),s,c.subarray(0,c.length-this.tagLength),n),lf.wipe(o),c},t.prototype.open=function(e,r,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(r.length<this.tagLength)return null;var o=new Uint8Array(16);o.set(e,o.length-e.length);var s=new Uint8Array(32);o1.stream(this._key,o,s,4);var a=new Uint8Array(this.tagLength);if(this._authenticate(a,s,r.subarray(0,r.length-this.tagLength),n),!rZ.equal(a,r.subarray(r.length-this.tagLength,r.length)))return null;var c=r.length-this.tagLength,u;if(i){if(i.length!==c)throw new Error("ChaCha20Poly1305: incorrect destination length");u=i}else u=new Uint8Array(c);return o1.streamXOR(this._key,o,r.subarray(0,r.length-this.tagLength),u,4),lf.wipe(o),u},t.prototype.clean=function(){return lf.wipe(this._key),this},t.prototype._authenticate=function(e,r,n,i){var o=new tZ.Poly1305(r);i&&(o.update(i),i.length%16>0&&o.update($C.subarray(i.length%16))),o.update(n),n.length%16>0&&o.update($C.subarray(n.length%16));var s=new Uint8Array(8);i&&UC.writeUint64LE(i.length,s),o.update(s),UC.writeUint64LE(n.length,s),o.update(s);for(var a=o.digest(),c=0;c<a.length;c++)e[c]=a[c];o.clean(),lf.wipe(a),lf.wipe(s)},t}();oo.ChaCha20Poly1305=nZ});var HC=_(s_=>{"use strict";Object.defineProperty(s_,"__esModule",{value:!0});function iZ(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}s_.isSerializableHash=iZ});var VC=_(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});var hi=HC(),oZ=n1(),sZ=Rn(),zC=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),hi.isSerializableHash(this._inner)&&hi.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),sZ.wipe(n)}return t.prototype.reset=function(){if(!hi.isSerializableHash(this._inner)||!hi.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(){hi.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),hi.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(!hi.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(!hi.isSerializableHash(this._inner)||!hi.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(!hi.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();ff.HMAC=zC;function aZ(t,e,r){var n=new zC(t,e);n.update(r);var i=n.digest();return n.clean(),i}ff.hmac=aZ;ff.equal=oZ.equal});var YC=_(a_=>{"use strict";Object.defineProperty(a_,"__esModule",{value:!0});var GC=VC(),KC=Rn(),cZ=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var o=GC.hmac(this._hash,n,r);this._hmac=new GC.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),KC.wipe(this._buffer),KC.wipe(this._counter),this._bufpos=0},t}();a_.HKDF=cZ});var JC=_(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});var a1=Ic(),s1=Rn();Wo.DIGEST_LENGTH=32;Wo.BLOCK_SIZE=64;var ZC=function(){function t(){this.digestLength=Wo.DIGEST_LENGTH,this.blockSize=Wo.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 t.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},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){s1.wipe(this._buffer),s1.wipe(this._temp),this.reset()},t.prototype.update=function(e,r){if(r===void 0&&(r=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(c_(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=c_(this._temp,this._state,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},t.prototype.finish=function(e){if(!this._finished){var r=this._bytesHashed,n=this._bufferLength,i=r/536870912|0,o=r<<3,s=r%64<56?64:128;this._buffer[n]=128;for(var a=n+1;a<s-8;a++)this._buffer[a]=0;a1.writeUint32BE(i,this._buffer,s-8),a1.writeUint32BE(o,this._buffer,s-4),c_(this._temp,this._state,this._buffer,0,s),this._finished=!0}for(var a=0;a<this.digestLength/4;a++)a1.writeUint32BE(this._state[a],e,a*4);return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.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}},t.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},t.prototype.cleanSavedState=function(e){s1.wipe(e.state),e.buffer&&s1.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},t}();Wo.SHA256=ZC;var uZ=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 c_(t,e,r,n,i){for(;i>=64;){for(var o=e[0],s=e[1],a=e[2],c=e[3],u=e[4],l=e[5],h=e[6],d=e[7],m=0;m<16;m++){var v=n+m*4;t[m]=a1.readUint32BE(r,v)}for(var m=16;m<64;m++){var x=t[m-2],O=(x>>>17|x<<32-17)^(x>>>19|x<<32-19)^x>>>10;x=t[m-15];var I=(x>>>7|x<<32-7)^(x>>>18|x<<32-18)^x>>>3;t[m]=(O+t[m-7]|0)+(I+t[m-16]|0)}for(var m=0;m<64;m++){var O=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&l^~u&h)|0)+(d+(uZ[m]+t[m]|0)|0)|0,I=((o>>>2|o<<32-2)^(o>>>13|o<<32-13)^(o>>>22|o<<32-22))+(o&s^o&a^s&a)|0;d=h,h=l,l=u,u=c+O|0,c=a,a=s,s=o,o=O+I|0}e[0]+=o,e[1]+=s,e[2]+=a,e[3]+=c,e[4]+=u,e[5]+=l,e[6]+=h,e[7]+=d,n+=64,i-=64}return n}function lZ(t){var e=new ZC;e.update(t);var r=e.digest();return e.clean(),r}Wo.hash=lZ});var tA=_(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.sharedKey=Qt.generateKeyPair=Qt.generateKeyPairFromSeed=Qt.scalarMultBase=Qt.scalarMult=Qt.SHARED_KEY_LENGTH=Qt.SECRET_KEY_LENGTH=Qt.PUBLIC_KEY_LENGTH=void 0;var fZ=tf(),hZ=Rn();Qt.PUBLIC_KEY_LENGTH=32;Qt.SECRET_KEY_LENGTH=32;Qt.SHARED_KEY_LENGTH=32;function di(t){let e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}var QC=new Uint8Array(32);QC[0]=9;var dZ=di([56129,1]);function u_(t){let e=1;for(let r=0;r<16;r++){let n=t[r]+e+65535;e=Math.floor(n/65536),t[r]=n-e*65536}t[0]+=e-1+37*(e-1)}function hf(t,e,r){let n=~(r-1);for(let i=0;i<16;i++){let o=n&(t[i]^e[i]);t[i]^=o,e[i]^=o}}function pZ(t,e){let r=di(),n=di();for(let i=0;i<16;i++)n[i]=e[i];u_(n),u_(n),u_(n);for(let i=0;i<2;i++){r[0]=n[0]-65517;for(let s=1;s<15;s++)r[s]=n[s]-65535-(r[s-1]>>16&1),r[s-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);let o=r[15]>>16&1;r[14]&=65535,hf(n,r,1-o)}for(let i=0;i<16;i++)t[2*i]=n[i]&255,t[2*i+1]=n[i]>>8}function gZ(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}function c1(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}function u1(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}function so(t,e,r){let n,i,o=0,s=0,a=0,c=0,u=0,l=0,h=0,d=0,m=0,v=0,x=0,O=0,I=0,j=0,k=0,B=0,V=0,q=0,P=0,L=0,H=0,M=0,N=0,F=0,E=0,f=0,g=0,y=0,b=0,w=0,R=0,T=r[0],S=r[1],p=r[2],A=r[3],Y=r[4],Z=r[5],G=r[6],X=r[7],ae=r[8],fe=r[9],Ee=r[10],he=r[11],de=r[12],Te=r[13],ye=r[14],ve=r[15];n=e[0],o+=n*T,s+=n*S,a+=n*p,c+=n*A,u+=n*Y,l+=n*Z,h+=n*G,d+=n*X,m+=n*ae,v+=n*fe,x+=n*Ee,O+=n*he,I+=n*de,j+=n*Te,k+=n*ye,B+=n*ve,n=e[1],s+=n*T,a+=n*S,c+=n*p,u+=n*A,l+=n*Y,h+=n*Z,d+=n*G,m+=n*X,v+=n*ae,x+=n*fe,O+=n*Ee,I+=n*he,j+=n*de,k+=n*Te,B+=n*ye,V+=n*ve,n=e[2],a+=n*T,c+=n*S,u+=n*p,l+=n*A,h+=n*Y,d+=n*Z,m+=n*G,v+=n*X,x+=n*ae,O+=n*fe,I+=n*Ee,j+=n*he,k+=n*de,B+=n*Te,V+=n*ye,q+=n*ve,n=e[3],c+=n*T,u+=n*S,l+=n*p,h+=n*A,d+=n*Y,m+=n*Z,v+=n*G,x+=n*X,O+=n*ae,I+=n*fe,j+=n*Ee,k+=n*he,B+=n*de,V+=n*Te,q+=n*ye,P+=n*ve,n=e[4],u+=n*T,l+=n*S,h+=n*p,d+=n*A,m+=n*Y,v+=n*Z,x+=n*G,O+=n*X,I+=n*ae,j+=n*fe,k+=n*Ee,B+=n*he,V+=n*de,q+=n*Te,P+=n*ye,L+=n*ve,n=e[5],l+=n*T,h+=n*S,d+=n*p,m+=n*A,v+=n*Y,x+=n*Z,O+=n*G,I+=n*X,j+=n*ae,k+=n*fe,B+=n*Ee,V+=n*he,q+=n*de,P+=n*Te,L+=n*ye,H+=n*ve,n=e[6],h+=n*T,d+=n*S,m+=n*p,v+=n*A,x+=n*Y,O+=n*Z,I+=n*G,j+=n*X,k+=n*ae,B+=n*fe,V+=n*Ee,q+=n*he,P+=n*de,L+=n*Te,H+=n*ye,M+=n*ve,n=e[7],d+=n*T,m+=n*S,v+=n*p,x+=n*A,O+=n*Y,I+=n*Z,j+=n*G,k+=n*X,B+=n*ae,V+=n*fe,q+=n*Ee,P+=n*he,L+=n*de,H+=n*Te,M+=n*ye,N+=n*ve,n=e[8],m+=n*T,v+=n*S,x+=n*p,O+=n*A,I+=n*Y,j+=n*Z,k+=n*G,B+=n*X,V+=n*ae,q+=n*fe,P+=n*Ee,L+=n*he,H+=n*de,M+=n*Te,N+=n*ye,F+=n*ve,n=e[9],v+=n*T,x+=n*S,O+=n*p,I+=n*A,j+=n*Y,k+=n*Z,B+=n*G,V+=n*X,q+=n*ae,P+=n*fe,L+=n*Ee,H+=n*he,M+=n*de,N+=n*Te,F+=n*ye,E+=n*ve,n=e[10],x+=n*T,O+=n*S,I+=n*p,j+=n*A,k+=n*Y,B+=n*Z,V+=n*G,q+=n*X,P+=n*ae,L+=n*fe,H+=n*Ee,M+=n*he,N+=n*de,F+=n*Te,E+=n*ye,f+=n*ve,n=e[11],O+=n*T,I+=n*S,j+=n*p,k+=n*A,B+=n*Y,V+=n*Z,q+=n*G,P+=n*X,L+=n*ae,H+=n*fe,M+=n*Ee,N+=n*he,F+=n*de,E+=n*Te,f+=n*ye,g+=n*ve,n=e[12],I+=n*T,j+=n*S,k+=n*p,B+=n*A,V+=n*Y,q+=n*Z,P+=n*G,L+=n*X,H+=n*ae,M+=n*fe,N+=n*Ee,F+=n*he,E+=n*de,f+=n*Te,g+=n*ye,y+=n*ve,n=e[13],j+=n*T,k+=n*S,B+=n*p,V+=n*A,q+=n*Y,P+=n*Z,L+=n*G,H+=n*X,M+=n*ae,N+=n*fe,F+=n*Ee,E+=n*he,f+=n*de,g+=n*Te,y+=n*ye,b+=n*ve,n=e[14],k+=n*T,B+=n*S,V+=n*p,q+=n*A,P+=n*Y,L+=n*Z,H+=n*G,M+=n*X,N+=n*ae,F+=n*fe,E+=n*Ee,f+=n*he,g+=n*de,y+=n*Te,b+=n*ye,w+=n*ve,n=e[15],B+=n*T,V+=n*S,q+=n*p,P+=n*A,L+=n*Y,H+=n*Z,M+=n*G,N+=n*X,F+=n*ae,E+=n*fe,f+=n*Ee,g+=n*he,y+=n*de,b+=n*Te,w+=n*ye,R+=n*ve,o+=38*V,s+=38*q,a+=38*P,c+=38*L,u+=38*H,l+=38*M,h+=38*N,d+=38*F,m+=38*E,v+=38*f,x+=38*g,O+=38*y,I+=38*b,j+=38*w,k+=38*R,i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-i*65536,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=l+i+65535,i=Math.floor(n/65536),l=n-i*65536,n=h+i+65535,i=Math.floor(n/65536),h=n-i*65536,n=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=j+i+65535,i=Math.floor(n/65536),j=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,o+=i-1+37*(i-1),i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-i*65536,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=l+i+65535,i=Math.floor(n/65536),l=n-i*65536,n=h+i+65535,i=Math.floor(n/65536),h=n-i*65536,n=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=j+i+65535,i=Math.floor(n/65536),j=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,o+=i-1+37*(i-1),t[0]=o,t[1]=s,t[2]=a,t[3]=c,t[4]=u,t[5]=l,t[6]=h,t[7]=d,t[8]=m,t[9]=v,t[10]=x,t[11]=O,t[12]=I,t[13]=j,t[14]=k,t[15]=B}function df(t,e){so(t,e,e)}function mZ(t,e){let r=di();for(let n=0;n<16;n++)r[n]=e[n];for(let n=253;n>=0;n--)df(r,r),n!==2&&n!==4&&so(r,r,e);for(let n=0;n<16;n++)t[n]=r[n]}function l_(t,e){let r=new Uint8Array(32),n=new Float64Array(80),i=di(),o=di(),s=di(),a=di(),c=di(),u=di();for(let m=0;m<31;m++)r[m]=t[m];r[31]=t[31]&127|64,r[0]&=248,gZ(n,e);for(let m=0;m<16;m++)o[m]=n[m];i[0]=a[0]=1;for(let m=254;m>=0;--m){let v=r[m>>>3]>>>(m&7)&1;hf(i,o,v),hf(s,a,v),c1(c,i,s),u1(i,i,s),c1(s,o,a),u1(o,o,a),df(a,c),df(u,i),so(i,s,i),so(s,o,c),c1(c,i,s),u1(i,i,s),df(o,i),u1(s,a,u),so(i,s,dZ),c1(i,i,a),so(s,s,i),so(i,a,u),so(a,o,n),df(o,c),hf(i,o,v),hf(s,a,v)}for(let m=0;m<16;m++)n[m+16]=i[m],n[m+32]=s[m],n[m+48]=o[m],n[m+64]=a[m];let l=n.subarray(32),h=n.subarray(16);mZ(l,l),so(h,h,l);let d=new Uint8Array(32);return pZ(d,h),d}Qt.scalarMult=l_;function XC(t){return l_(t,QC)}Qt.scalarMultBase=XC;function eA(t){if(t.length!==Qt.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${Qt.SECRET_KEY_LENGTH} bytes`);let e=new Uint8Array(t);return{publicKey:XC(e),secretKey:e}}Qt.generateKeyPairFromSeed=eA;function yZ(t){let e=(0,fZ.randomBytes)(32,t),r=eA(e);return(0,hZ.wipe)(e),r}Qt.generateKeyPair=yZ;function vZ(t,e,r=!1){if(t.length!==Qt.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==Qt.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");let n=l_(t,e);if(r){let i=0;for(let o=0;o<n.length;o++)i|=n[o];if(i===0)throw new Error("X25519: invalid shared key")}return n}Qt.sharedKey=vZ});var h_=_(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.getLocalStorage=Lt.getLocalStorageOrThrow=Lt.getCrypto=Lt.getCryptoOrThrow=Lt.getLocation=Lt.getLocationOrThrow=Lt.getNavigator=Lt.getNavigatorOrThrow=Lt.getDocument=Lt.getDocumentOrThrow=Lt.getFromWindowOrThrow=Lt.getFromWindow=void 0;function Bs(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}Lt.getFromWindow=Bs;function Fc(t){let e=Bs(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Lt.getFromWindowOrThrow=Fc;function PZ(){return Fc("document")}Lt.getDocumentOrThrow=PZ;function DZ(){return Bs("document")}Lt.getDocument=DZ;function NZ(){return Fc("navigator")}Lt.getNavigatorOrThrow=NZ;function kZ(){return Bs("navigator")}Lt.getNavigator=kZ;function LZ(){return Fc("location")}Lt.getLocationOrThrow=LZ;function jZ(){return Bs("location")}Lt.getLocation=jZ;function BZ(){return Fc("crypto")}Lt.getCryptoOrThrow=BZ;function qZ(){return Bs("crypto")}Lt.getCrypto=qZ;function FZ(){return Fc("localStorage")}Lt.getLocalStorageOrThrow=FZ;function UZ(){return Bs("localStorage")}Lt.getLocalStorage=UZ});var lA=_(h1=>{"use strict";Object.defineProperty(h1,"__esModule",{value:!0});h1.getWindowMetadata=void 0;var uA=h_();function $Z(){let t,e;try{t=uA.getDocumentOrThrow(),e=uA.getLocationOrThrow()}catch{return null}function r(){let h=t.getElementsByTagName("link"),d=[];for(let m=0;m<h.length;m++){let v=h[m],x=v.getAttribute("rel");if(x&&x.toLowerCase().indexOf("icon")>-1){let O=v.getAttribute("href");if(O)if(O.toLowerCase().indexOf("https:")===-1&&O.toLowerCase().indexOf("http:")===-1&&O.indexOf("//")!==0){let I=e.protocol+"//"+e.host;if(O.indexOf("/")===0)I+=O;else{let j=e.pathname.split("/");j.pop(),I+=j.join("/")+"/"+O}d.push(I)}else if(O.indexOf("//")===0){let I=e.protocol+O;d.push(I)}else d.push(O)}}return d}function n(...h){let d=t.getElementsByTagName("meta");for(let m=0;m<d.length;m++){let v=d[m],x=["itemprop","property","name"].map(O=>v.getAttribute(O)).filter(O=>O?h.includes(O):!1);if(x.length&&x){let O=v.getAttribute("content");if(O)return O}}return""}function i(){let h=n("name","og:site_name","og:title","twitter:title");return h||(h=t.title),h}function o(){return n("description","og:description","twitter:description","keywords")}let s=i(),a=o(),c=e.origin,u=r();return{description:a,url:c,icons:u,name:s}}h1.getWindowMetadata=$Z});var hA=_((w9e,fA)=>{"use strict";fA.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)});var yA=_((E9e,mA)=>{"use strict";var gA="%[a-f0-9]{2}",dA=new RegExp("("+gA+")|([^%]+?)","gi"),pA=new RegExp("("+gA+")+","gi");function d_(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],d_(r),d_(n))}function WZ(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(dA)||[],r=1;r<e.length;r++)t=d_(e,r).join(""),e=t.match(dA)||[];return t}}function HZ(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=pA.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=WZ(r[0]);n!==r[0]&&(e[r[0]]=n)}r=pA.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),o=0;o<i.length;o++){var s=i[o];t=t.replace(new RegExp(s,"g"),e[s])}return t}mA.exports=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 HZ(t)}}});var bA=_((S9e,vA)=>{"use strict";vA.exports=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];let r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]}});var wA=_((x9e,_A)=>{"use strict";_A.exports=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),o=0;o<n.length;o++){var s=n[o],a=t[s];(i?e.indexOf(s)!==-1:e(s,a,t))&&(r[s]=a)}return r}});var MA=_(on=>{"use strict";var zZ=hA(),VZ=yA(),SA=bA(),GZ=wA(),KZ=t=>t==null,p_=Symbol("encodeFragmentIdentifier");function YZ(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{let i=r.length;return n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[rr(e,t),"[",i,"]"].join("")]:[...r,[rr(e,t),"[",rr(i,t),"]=",rr(n,t)].join("")]};case"bracket":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[rr(e,t),"[]"].join("")]:[...r,[rr(e,t),"[]=",rr(n,t)].join("")];case"colon-list-separator":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[rr(e,t),":list="].join("")]:[...r,[rr(e,t),":list=",rr(n,t)].join("")];case"comma":case"separator":case"bracket-separator":{let e=t.arrayFormat==="bracket-separator"?"[]=":"=";return r=>(n,i)=>i===void 0||t.skipNull&&i===null||t.skipEmptyString&&i===""?n:(i=i===null?"":i,n.length===0?[[rr(r,t),e,rr(i,t)].join("")]:[[n,rr(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,rr(e,t)]:[...r,[rr(e,t),"=",rr(n,t)].join("")]}}function ZZ(t){let e;switch(t.arrayFormat){case"index":return(r,n,i)=>{if(e=/\[(\d*)\]$/.exec(r),r=r.replace(/\[\d*\]$/,""),!e){i[r]=n;return}i[r]===void 0&&(i[r]={}),i[r][e[1]]=n};case"bracket":return(r,n,i)=>{if(e=/(\[\])$/.exec(r),r=r.replace(/\[\]$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[].concat(i[r],n)};case"colon-list-separator":return(r,n,i)=>{if(e=/(:list)$/.exec(r),r=r.replace(/:list$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[].concat(i[r],n)};case"comma":case"separator":return(r,n,i)=>{let o=typeof n=="string"&&n.includes(t.arrayFormatSeparator),s=typeof n=="string"&&!o&&ao(n,t).includes(t.arrayFormatSeparator);n=s?ao(n,t):n;let a=o||s?n.split(t.arrayFormatSeparator).map(c=>ao(c,t)):n===null?n:ao(n,t);i[r]=a};case"bracket-separator":return(r,n,i)=>{let o=/(\[\])$/.test(r);if(r=r.replace(/\[\]$/,""),!o){i[r]=n&&ao(n,t);return}let s=n===null?[]:n.split(t.arrayFormatSeparator).map(a=>ao(a,t));if(i[r]===void 0){i[r]=s;return}i[r]=[].concat(i[r],s)};default:return(r,n,i)=>{if(i[r]===void 0){i[r]=n;return}i[r]=[].concat(i[r],n)}}}function xA(t){if(typeof t!="string"||t.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function rr(t,e){return e.encode?e.strict?zZ(t):encodeURIComponent(t):t}function ao(t,e){return e.decode?VZ(t):t}function OA(t){return Array.isArray(t)?t.sort():typeof t=="object"?OA(Object.keys(t)).sort((e,r)=>Number(e)-Number(r)).map(e=>t[e]):t}function CA(t){let e=t.indexOf("#");return e!==-1&&(t=t.slice(0,e)),t}function JZ(t){let e="",r=t.indexOf("#");return r!==-1&&(e=t.slice(r)),e}function AA(t){t=CA(t);let e=t.indexOf("?");return e===-1?"":t.slice(e+1)}function EA(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&typeof t=="string"&&t.trim()!==""?t=Number(t):e.parseBooleans&&t!==null&&(t.toLowerCase()==="true"||t.toLowerCase()==="false")&&(t=t.toLowerCase()==="true"),t}function IA(t,e){e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e),xA(e.arrayFormatSeparator);let r=ZZ(e),n=Object.create(null);if(typeof t!="string"||(t=t.trim().replace(/^[?#&]/,""),!t))return n;for(let i of t.split("&")){if(i==="")continue;let[o,s]=SA(e.decode?i.replace(/\+/g," "):i,"=");s=s===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?s:ao(s,e),r(ao(o,e),s,n)}for(let i of Object.keys(n)){let o=n[i];if(typeof o=="object"&&o!==null)for(let s of Object.keys(o))o[s]=EA(o[s],e);else n[i]=EA(o,e)}return e.sort===!1?n:(e.sort===!0?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((i,o)=>{let s=n[o];return Boolean(s)&&typeof s=="object"&&!Array.isArray(s)?i[o]=OA(s):i[o]=s,i},Object.create(null))}on.extract=AA;on.parse=IA;on.stringify=(t,e)=>{if(!t)return"";e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e),xA(e.arrayFormatSeparator);let r=s=>e.skipNull&&KZ(t[s])||e.skipEmptyString&&t[s]==="",n=YZ(e),i={};for(let s of Object.keys(t))r(s)||(i[s]=t[s]);let o=Object.keys(i);return e.sort!==!1&&o.sort(e.sort),o.map(s=>{let a=t[s];return a===void 0?"":a===null?rr(s,e):Array.isArray(a)?a.length===0&&e.arrayFormat==="bracket-separator"?rr(s,e)+"[]":a.reduce(n(s),[]).join("&"):rr(s,e)+"="+rr(a,e)}).filter(s=>s.length>0).join("&")};on.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);let[r,n]=SA(t,"#");return Object.assign({url:r.split("?")[0]||"",query:IA(AA(t),e)},e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:ao(n,e)}:{})};on.stringifyUrl=(t,e)=>{e=Object.assign({encode:!0,strict:!0,[p_]:!0},e);let r=CA(t.url).split("?")[0]||"",n=on.extract(t.url),i=on.parse(n,{sort:!1}),o=Object.assign(i,t.query),s=on.stringify(o,e);s&&(s=`?${s}`);let a=JZ(t.url);return t.fragmentIdentifier&&(a=`#${e[p_]?rr(t.fragmentIdentifier,e):t.fragmentIdentifier}`),`${r}${s}${a}`};on.pick=(t,e,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[p_]:!1},r);let{url:n,query:i,fragmentIdentifier:o}=on.parseUrl(t,r);return on.stringifyUrl({url:n,query:GZ(i,e),fragmentIdentifier:o},r)};on.exclude=(t,e,r)=>{let n=Array.isArray(e)?i=>!e.includes(i):(i,o)=>!e(i,o);return on.pick(t,n,r)}});var GI=_((rMe,C1)=>{var AI,II,MI,RI,TI,PI,DI,NI,kI,O1,D_,LI,jI,Wc,BI,qI,FI,UI,$I,WI,HI,zI,VI;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){t(r(e,r(n)))}):typeof C1=="object"&&typeof C1.exports=="object"?t(r(e,r(C1.exports))):t(r(e));function r(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(o,s){return n[o]=i?i(o,s):s}}})(function(t){var e=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])};AI=function(r,n){e(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},II=Object.assign||function(r){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},MI=function(r,n){var i={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(r);s<o.length;s++)n.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(r,o[s])&&(i[o[s]]=r[o[s]]);return i},RI=function(r,n,i,o){var s=arguments.length,a=s<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,i):o,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,n,i,o);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(s<3?c(a):s>3?c(n,i,a):c(n,i))||a);return s>3&&a&&Object.defineProperty(n,i,a),a},TI=function(r,n){return function(i,o){n(i,o,r)}},PI=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},DI=function(r,n,i,o){function s(a){return a instanceof i?a:new i(function(c){c(a)})}return new(i||(i=Promise))(function(a,c){function u(d){try{h(o.next(d))}catch(m){c(m)}}function l(d){try{h(o.throw(d))}catch(m){c(m)}}function h(d){d.done?a(d.value):s(d.value).then(u,l)}h((o=o.apply(r,n||[])).next())})},NI=function(r,n){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(d){return l([h,d])}}function l(h){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,s&&(a=h[0]&2?s.return:h[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,h[1])).done)return a;switch(s=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return i.label++,{value:h[1],done:!1};case 5:i.label++,s=h[1],h=[0];continue;case 7:h=i.ops.pop(),i.trys.pop();continue;default:if(a=i.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){i=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){i.label=h[1];break}if(h[0]===6&&i.label<a[1]){i.label=a[1],a=h;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(h);break}a[2]&&i.ops.pop(),i.trys.pop();continue}h=n.call(r,i)}catch(d){h=[6,d],s=0}finally{o=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},VI=function(r,n,i,o){o===void 0&&(o=i),r[o]=n[i]},kI=function(r,n){for(var i in r)i!=="default"&&!n.hasOwnProperty(i)&&(n[i]=r[i])},O1=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],o=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},D_=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var o=i.call(r),s,a=[],c;try{for(;(n===void 0||n-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(u){c={error:u}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(c)throw c.error}}return a},LI=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(D_(arguments[n]));return r},jI=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var o=Array(r),s=0,n=0;n<i;n++)for(var a=arguments[n],c=0,u=a.length;c<u;c++,s++)o[s]=a[c];return o},Wc=function(r){return this instanceof Wc?(this.v=r,this):new Wc(r)},BI=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(r,n||[]),s,a=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(v){o[v]&&(s[v]=function(x){return new Promise(function(O,I){a.push([v,x,O,I])>1||u(v,x)})})}function u(v,x){try{l(o[v](x))}catch(O){m(a[0][3],O)}}function l(v){v.value instanceof Wc?Promise.resolve(v.value.v).then(h,d):m(a[0][2],v)}function h(v){u("next",v)}function d(v){u("throw",v)}function m(v,x){v(x),a.shift(),a.length&&u(a[0][0],a[0][1])}},qI=function(r){var n,i;return n={},o("next"),o("throw",function(s){throw s}),o("return"),n[Symbol.iterator]=function(){return this},n;function o(s,a){n[s]=r[s]?function(c){return(i=!i)?{value:Wc(r[s](c)),done:s==="return"}:a?a(c):c}:a}},FI=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof O1=="function"?O1(r):r[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(a){i[a]=r[a]&&function(c){return new Promise(function(u,l){c=r[a](c),s(u,l,c.done,c.value)})}}function s(a,c,u,l){Promise.resolve(l).then(function(h){a({value:h,done:u})},c)}},UI=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r},$I=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)Object.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n.default=r,n},WI=function(r){return r&&r.__esModule?r:{default:r}},HI=function(r,n){if(!n.has(r))throw new TypeError("attempted to get private field on non-instance");return n.get(r)},zI=function(r,n,i){if(!n.has(r))throw new TypeError("attempted to set private field on non-instance");return n.set(r,i),i},t("__extends",AI),t("__assign",II),t("__rest",MI),t("__decorate",RI),t("__param",TI),t("__metadata",PI),t("__awaiter",DI),t("__generator",NI),t("__exportStar",kI),t("__createBinding",VI),t("__values",O1),t("__read",D_),t("__spread",LI),t("__spreadArrays",jI),t("__await",Wc),t("__asyncGenerator",BI),t("__asyncDelegator",qI),t("__asyncValues",FI),t("__makeTemplateObject",UI),t("__importStar",$I),t("__importDefault",WI),t("__classPrivateFieldGet",HI),t("__classPrivateFieldSet",zI)})});var YI=_(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.isBrowserCryptoAvailable=zo.getSubtleCrypto=zo.getBrowerCrypto=void 0;function N_(){return(global==null?void 0:global.crypto)||(global==null?void 0:global.msCrypto)||{}}zo.getBrowerCrypto=N_;function KI(){let t=N_();return t.subtle||t.webkitSubtle}zo.getSubtleCrypto=KI;function RJ(){return!!N_()&&!!KI()}zo.isBrowserCryptoAvailable=RJ});var QI=_(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.isBrowser=Vo.isNode=Vo.isReactNative=void 0;function ZI(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Vo.isReactNative=ZI;function JI(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Vo.isNode=JI;function TJ(){return!ZI()&&!JI()}Vo.isBrowser=TJ});var k_=_(A1=>{"use strict";Object.defineProperty(A1,"__esModule",{value:!0});var XI=GI();XI.__exportStar(YI(),A1);XI.__exportStar(QI(),A1)});var a9=_((jMe,s9)=>{"use strict";s9.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var V9=_((Sf,Kc)=>{var $J=200,Z_="__lodash_hash_undefined__",F1=1,S9=2,x9=9007199254740991,D1="[object Arguments]",W_="[object Array]",WJ="[object AsyncFunction]",O9="[object Boolean]",C9="[object Date]",A9="[object Error]",I9="[object Function]",HJ="[object GeneratorFunction]",N1="[object Map]",M9="[object Number]",zJ="[object Null]",Gc="[object Object]",h9="[object Promise]",VJ="[object Proxy]",R9="[object RegExp]",k1="[object Set]",T9="[object String]",GJ="[object Symbol]",KJ="[object Undefined]",H_="[object WeakMap]",P9="[object ArrayBuffer]",L1="[object DataView]",YJ="[object Float32Array]",ZJ="[object Float64Array]",JJ="[object Int8Array]",QJ="[object Int16Array]",XJ="[object Int32Array]",eQ="[object Uint8Array]",tQ="[object Uint8ClampedArray]",rQ="[object Uint16Array]",nQ="[object Uint32Array]",iQ=/[\\^$.*+?()[\]{}|]/g,oQ=/^\[object .+?Constructor\]$/,sQ=/^(?:0|[1-9]\d*)$/,Ft={};Ft[YJ]=Ft[ZJ]=Ft[JJ]=Ft[QJ]=Ft[XJ]=Ft[eQ]=Ft[tQ]=Ft[rQ]=Ft[nQ]=!0;Ft[D1]=Ft[W_]=Ft[P9]=Ft[O9]=Ft[L1]=Ft[C9]=Ft[A9]=Ft[I9]=Ft[N1]=Ft[M9]=Ft[Gc]=Ft[R9]=Ft[k1]=Ft[T9]=Ft[H_]=!1;var D9=typeof global=="object"&&global&&global.Object===Object&&global,aQ=typeof self=="object"&&self&&self.Object===Object&&self,ho=D9||aQ||Function("return this")(),N9=typeof Sf=="object"&&Sf&&!Sf.nodeType&&Sf,d9=N9&&typeof Kc=="object"&&Kc&&!Kc.nodeType&&Kc,k9=d9&&d9.exports===N9,F_=k9&&D9.process,p9=function(){try{return F_&&F_.binding&&F_.binding("util")}catch{}}(),g9=p9&&p9.isTypedArray;function cQ(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}function uQ(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function lQ(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function fQ(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function hQ(t){return function(e){return t(e)}}function dQ(t,e){return t.has(e)}function pQ(t,e){return t?.[e]}function gQ(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function mQ(t,e){return function(r){return t(e(r))}}function yQ(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var vQ=Array.prototype,bQ=Function.prototype,U1=Object.prototype,U_=ho["__core-js_shared__"],L9=bQ.toString,mi=U1.hasOwnProperty,m9=function(){var t=/[^.]+$/.exec(U_&&U_.keys&&U_.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),j9=U1.toString,_Q=RegExp("^"+L9.call(mi).replace(iQ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),y9=k9?ho.Buffer:void 0,j1=ho.Symbol,v9=ho.Uint8Array,B9=U1.propertyIsEnumerable,wQ=vQ.splice,Ws=j1?j1.toStringTag:void 0,b9=Object.getOwnPropertySymbols,EQ=y9?y9.isBuffer:void 0,SQ=mQ(Object.keys,Object),z_=Yc(ho,"DataView"),xf=Yc(ho,"Map"),V_=Yc(ho,"Promise"),G_=Yc(ho,"Set"),K_=Yc(ho,"WeakMap"),Of=Yc(Object,"create"),xQ=Vs(z_),OQ=Vs(xf),CQ=Vs(V_),AQ=Vs(G_),IQ=Vs(K_),_9=j1?j1.prototype:void 0,$_=_9?_9.valueOf:void 0;function Hs(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function MQ(){this.__data__=Of?Of(null):{},this.size=0}function RQ(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function TQ(t){var e=this.__data__;if(Of){var r=e[t];return r===Z_?void 0:r}return mi.call(e,t)?e[t]:void 0}function PQ(t){var e=this.__data__;return Of?e[t]!==void 0:mi.call(e,t)}function DQ(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Of&&e===void 0?Z_:e,this}Hs.prototype.clear=MQ;Hs.prototype.delete=RQ;Hs.prototype.get=TQ;Hs.prototype.has=PQ;Hs.prototype.set=DQ;function po(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function NQ(){this.__data__=[],this.size=0}function kQ(t){var e=this.__data__,r=$1(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():wQ.call(e,r,1),--this.size,!0}function LQ(t){var e=this.__data__,r=$1(e,t);return r<0?void 0:e[r][1]}function jQ(t){return $1(this.__data__,t)>-1}function BQ(t,e){var r=this.__data__,n=$1(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}po.prototype.clear=NQ;po.prototype.delete=kQ;po.prototype.get=LQ;po.prototype.has=jQ;po.prototype.set=BQ;function zs(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function qQ(){this.size=0,this.__data__={hash:new Hs,map:new(xf||po),string:new Hs}}function FQ(t){var e=W1(this,t).delete(t);return this.size-=e?1:0,e}function UQ(t){return W1(this,t).get(t)}function $Q(t){return W1(this,t).has(t)}function WQ(t,e){var r=W1(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}zs.prototype.clear=qQ;zs.prototype.delete=FQ;zs.prototype.get=UQ;zs.prototype.has=$Q;zs.prototype.set=WQ;function B1(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new zs;++e<r;)this.add(t[e])}function HQ(t){return this.__data__.set(t,Z_),this}function zQ(t){return this.__data__.has(t)}B1.prototype.add=B1.prototype.push=HQ;B1.prototype.has=zQ;function Yo(t){var e=this.__data__=new po(t);this.size=e.size}function VQ(){this.__data__=new po,this.size=0}function GQ(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function KQ(t){return this.__data__.get(t)}function YQ(t){return this.__data__.has(t)}function ZQ(t,e){var r=this.__data__;if(r instanceof po){var n=r.__data__;if(!xf||n.length<$J-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new zs(n)}return r.set(t,e),this.size=r.size,this}Yo.prototype.clear=VQ;Yo.prototype.delete=GQ;Yo.prototype.get=KQ;Yo.prototype.has=YQ;Yo.prototype.set=ZQ;function JQ(t,e){var r=q1(t),n=!r&&hX(t),i=!r&&!n&&Y_(t),o=!r&&!n&&!i&&z9(t),s=r||n||i||o,a=s?fQ(t.length,String):[],c=a.length;for(var u in t)(e||mi.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||aX(u,c)))&&a.push(u);return a}function $1(t,e){for(var r=t.length;r--;)if(U9(t[r][0],e))return r;return-1}function QQ(t,e,r){var n=e(t);return q1(t)?n:uQ(n,r(t))}function Af(t){return t==null?t===void 0?KJ:zJ:Ws&&Ws in Object(t)?oX(t):fX(t)}function w9(t){return Cf(t)&&Af(t)==D1}function q9(t,e,r,n,i){return t===e?!0:t==null||e==null||!Cf(t)&&!Cf(e)?t!==t&&e!==e:XQ(t,e,r,n,q9,i)}function XQ(t,e,r,n,i,o){var s=q1(t),a=q1(e),c=s?W_:Ko(t),u=a?W_:Ko(e);c=c==D1?Gc:c,u=u==D1?Gc:u;var l=c==Gc,h=u==Gc,d=c==u;if(d&&Y_(t)){if(!Y_(e))return!1;s=!0,l=!1}if(d&&!l)return o||(o=new Yo),s||z9(t)?F9(t,e,r,n,i,o):nX(t,e,c,r,n,i,o);if(!(r&F1)){var m=l&&mi.call(t,"__wrapped__"),v=h&&mi.call(e,"__wrapped__");if(m||v){var x=m?t.value():t,O=v?e.value():e;return o||(o=new Yo),i(x,O,r,n,o)}}return d?(o||(o=new Yo),iX(t,e,r,n,i,o)):!1}function eX(t){if(!H9(t)||uX(t))return!1;var e=$9(t)?_Q:oQ;return e.test(Vs(t))}function tX(t){return Cf(t)&&W9(t.length)&&!!Ft[Af(t)]}function rX(t){if(!lX(t))return SQ(t);var e=[];for(var r in Object(t))mi.call(t,r)&&r!="constructor"&&e.push(r);return e}function F9(t,e,r,n,i,o){var s=r&F1,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var u=o.get(t);if(u&&o.get(e))return u==e;var l=-1,h=!0,d=r&S9?new B1:void 0;for(o.set(t,e),o.set(e,t);++l<a;){var m=t[l],v=e[l];if(n)var x=s?n(v,m,l,e,t,o):n(m,v,l,t,e,o);if(x!==void 0){if(x)continue;h=!1;break}if(d){if(!lQ(e,function(O,I){if(!dQ(d,I)&&(m===O||i(m,O,r,n,o)))return d.push(I)})){h=!1;break}}else if(!(m===v||i(m,v,r,n,o))){h=!1;break}}return o.delete(t),o.delete(e),h}function nX(t,e,r,n,i,o,s){switch(r){case L1:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case P9:return!(t.byteLength!=e.byteLength||!o(new v9(t),new v9(e)));case O9:case C9:case M9:return U9(+t,+e);case A9:return t.name==e.name&&t.message==e.message;case R9:case T9:return t==e+"";case N1:var a=gQ;case k1:var c=n&F1;if(a||(a=yQ),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=S9,s.set(t,e);var l=F9(a(t),a(e),n,i,o,s);return s.delete(t),l;case GJ:if($_)return $_.call(t)==$_.call(e)}return!1}function iX(t,e,r,n,i,o){var s=r&F1,a=E9(t),c=a.length,u=E9(e),l=u.length;if(c!=l&&!s)return!1;for(var h=c;h--;){var d=a[h];if(!(s?d in e:mi.call(e,d)))return!1}var m=o.get(t);if(m&&o.get(e))return m==e;var v=!0;o.set(t,e),o.set(e,t);for(var x=s;++h<c;){d=a[h];var O=t[d],I=e[d];if(n)var j=s?n(I,O,d,e,t,o):n(O,I,d,t,e,o);if(!(j===void 0?O===I||i(O,I,r,n,o):j)){v=!1;break}x||(x=d=="constructor")}if(v&&!x){var k=t.constructor,B=e.constructor;k!=B&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof B=="function"&&B instanceof B)&&(v=!1)}return o.delete(t),o.delete(e),v}function E9(t){return QQ(t,gX,sX)}function W1(t,e){var r=t.__data__;return cX(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Yc(t,e){var r=pQ(t,e);return eX(r)?r:void 0}function oX(t){var e=mi.call(t,Ws),r=t[Ws];try{t[Ws]=void 0;var n=!0}catch{}var i=j9.call(t);return n&&(e?t[Ws]=r:delete t[Ws]),i}var sX=b9?function(t){return t==null?[]:(t=Object(t),cQ(b9(t),function(e){return B9.call(t,e)}))}:mX,Ko=Af;(z_&&Ko(new z_(new ArrayBuffer(1)))!=L1||xf&&Ko(new xf)!=N1||V_&&Ko(V_.resolve())!=h9||G_&&Ko(new G_)!=k1||K_&&Ko(new K_)!=H_)&&(Ko=function(t){var e=Af(t),r=e==Gc?t.constructor:void 0,n=r?Vs(r):"";if(n)switch(n){case xQ:return L1;case OQ:return N1;case CQ:return h9;case AQ:return k1;case IQ:return H_}return e});function aX(t,e){return e=e??x9,!!e&&(typeof t=="number"||sQ.test(t))&&t>-1&&t%1==0&&t<e}function cX(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function uX(t){return!!m9&&m9 in t}function lX(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||U1;return t===r}function fX(t){return j9.call(t)}function Vs(t){if(t!=null){try{return L9.call(t)}catch{}try{return t+""}catch{}}return""}function U9(t,e){return t===e||t!==t&&e!==e}var hX=w9(function(){return arguments}())?w9:function(t){return Cf(t)&&mi.call(t,"callee")&&!B9.call(t,"callee")},q1=Array.isArray;function dX(t){return t!=null&&W9(t.length)&&!$9(t)}var Y_=EQ||yX;function pX(t,e){return q9(t,e)}function $9(t){if(!H9(t))return!1;var e=Af(t);return e==I9||e==HJ||e==WJ||e==VJ}function W9(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=x9}function H9(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Cf(t){return t!=null&&typeof t=="object"}var z9=g9?hQ(g9):tX;function gX(t){return dX(t)?JQ(t):rX(t)}function mX(){return[]}function yX(){return!1}Kc.exports=pX});var DM=_((yo,PM)=>{var TM=typeof self<"u"?self:yo,Y1=function(){function t(){this.fetch=!1,this.DOMException=TM.DOMException}return t.prototype=TM,new t}();(function(t){var e=function(r){var n={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};function i(M){return M&&DataView.prototype.isPrototypeOf(M)}if(n.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(M){return M&&o.indexOf(Object.prototype.toString.call(M))>-1};function a(M){if(typeof M!="string"&&(M=String(M)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(M))throw new TypeError("Invalid character in header field name");return M.toLowerCase()}function c(M){return typeof M!="string"&&(M=String(M)),M}function u(M){var N={next:function(){var F=M.shift();return{done:F===void 0,value:F}}};return n.iterable&&(N[Symbol.iterator]=function(){return N}),N}function l(M){this.map={},M instanceof l?M.forEach(function(N,F){this.append(F,N)},this):Array.isArray(M)?M.forEach(function(N){this.append(N[0],N[1])},this):M&&Object.getOwnPropertyNames(M).forEach(function(N){this.append(N,M[N])},this)}l.prototype.append=function(M,N){M=a(M),N=c(N);var F=this.map[M];this.map[M]=F?F+", "+N:N},l.prototype.delete=function(M){delete this.map[a(M)]},l.prototype.get=function(M){return M=a(M),this.has(M)?this.map[M]:null},l.prototype.has=function(M){return this.map.hasOwnProperty(a(M))},l.prototype.set=function(M,N){this.map[a(M)]=c(N)},l.prototype.forEach=function(M,N){for(var F in this.map)this.map.hasOwnProperty(F)&&M.call(N,this.map[F],F,this)},l.prototype.keys=function(){var M=[];return this.forEach(function(N,F){M.push(F)}),u(M)},l.prototype.values=function(){var M=[];return this.forEach(function(N){M.push(N)}),u(M)},l.prototype.entries=function(){var M=[];return this.forEach(function(N,F){M.push([F,N])}),u(M)},n.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);function h(M){if(M.bodyUsed)return Promise.reject(new TypeError("Already read"));M.bodyUsed=!0}function d(M){return new Promise(function(N,F){M.onload=function(){N(M.result)},M.onerror=function(){F(M.error)}})}function m(M){var N=new FileReader,F=d(N);return N.readAsArrayBuffer(M),F}function v(M){var N=new FileReader,F=d(N);return N.readAsText(M),F}function x(M){for(var N=new Uint8Array(M),F=new Array(N.length),E=0;E<N.length;E++)F[E]=String.fromCharCode(N[E]);return F.join("")}function O(M){if(M.slice)return M.slice(0);var N=new Uint8Array(M.byteLength);return N.set(new Uint8Array(M)),N.buffer}function I(){return this.bodyUsed=!1,this._initBody=function(M){this._bodyInit=M,M?typeof M=="string"?this._bodyText=M:n.blob&&Blob.prototype.isPrototypeOf(M)?this._bodyBlob=M:n.formData&&FormData.prototype.isPrototypeOf(M)?this._bodyFormData=M:n.searchParams&&URLSearchParams.prototype.isPrototypeOf(M)?this._bodyText=M.toString():n.arrayBuffer&&n.blob&&i(M)?(this._bodyArrayBuffer=O(M.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(M)||s(M))?this._bodyArrayBuffer=O(M):this._bodyText=M=Object.prototype.toString.call(M):this._bodyText="",this.headers.get("content-type")||(typeof M=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n.searchParams&&URLSearchParams.prototype.isPrototypeOf(M)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var M=h(this);if(M)return M;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var M=h(this);if(M)return M;if(this._bodyBlob)return v(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(x(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},n.formData&&(this.formData=function(){return this.text().then(V)}),this.json=function(){return this.text().then(JSON.parse)},this}var j=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function k(M){var N=M.toUpperCase();return j.indexOf(N)>-1?N:M}function B(M,N){N=N||{};var F=N.body;if(M instanceof B){if(M.bodyUsed)throw new TypeError("Already read");this.url=M.url,this.credentials=M.credentials,N.headers||(this.headers=new l(M.headers)),this.method=M.method,this.mode=M.mode,this.signal=M.signal,!F&&M._bodyInit!=null&&(F=M._bodyInit,M.bodyUsed=!0)}else this.url=String(M);if(this.credentials=N.credentials||this.credentials||"same-origin",(N.headers||!this.headers)&&(this.headers=new l(N.headers)),this.method=k(N.method||this.method||"GET"),this.mode=N.mode||this.mode||null,this.signal=N.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&F)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(F)}B.prototype.clone=function(){return new B(this,{body:this._bodyInit})};function V(M){var N=new FormData;return M.trim().split("&").forEach(function(F){if(F){var E=F.split("="),f=E.shift().replace(/\+/g," "),g=E.join("=").replace(/\+/g," ");N.append(decodeURIComponent(f),decodeURIComponent(g))}}),N}function q(M){var N=new l,F=M.replace(/\r?\n[\t ]+/g," ");return F.split(/\r?\n/).forEach(function(E){var f=E.split(":"),g=f.shift().trim();if(g){var y=f.join(":").trim();N.append(g,y)}}),N}I.call(B.prototype);function P(M,N){N||(N={}),this.type="default",this.status=N.status===void 0?200:N.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in N?N.statusText:"OK",this.headers=new l(N.headers),this.url=N.url||"",this._initBody(M)}I.call(P.prototype),P.prototype.clone=function(){return new P(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},P.error=function(){var M=new P(null,{status:0,statusText:""});return M.type="error",M};var L=[301,302,303,307,308];P.redirect=function(M,N){if(L.indexOf(N)===-1)throw new RangeError("Invalid status code");return new P(null,{status:N,headers:{location:M}})},r.DOMException=t.DOMException;try{new r.DOMException}catch{r.DOMException=function(N,F){this.message=N,this.name=F;var E=Error(N);this.stack=E.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function H(M,N){return new Promise(function(F,E){var f=new B(M,N);if(f.signal&&f.signal.aborted)return E(new r.DOMException("Aborted","AbortError"));var g=new XMLHttpRequest;function y(){g.abort()}g.onload=function(){var b={status:g.status,statusText:g.statusText,headers:q(g.getAllResponseHeaders()||"")};b.url="responseURL"in g?g.responseURL:b.headers.get("X-Request-URL");var w="response"in g?g.response:g.responseText;F(new P(w,b))},g.onerror=function(){E(new TypeError("Network request failed"))},g.ontimeout=function(){E(new TypeError("Network request failed"))},g.onabort=function(){E(new r.DOMException("Aborted","AbortError"))},g.open(f.method,f.url,!0),f.credentials==="include"?g.withCredentials=!0:f.credentials==="omit"&&(g.withCredentials=!1),"responseType"in g&&n.blob&&(g.responseType="blob"),f.headers.forEach(function(b,w){g.setRequestHeader(w,b)}),f.signal&&(f.signal.addEventListener("abort",y),g.onreadystatechange=function(){g.readyState===4&&f.signal.removeEventListener("abort",y)}),g.send(typeof f._bodyInit>"u"?null:f._bodyInit)})}return H.polyfill=!0,t.fetch||(t.fetch=H,t.Headers=l,t.Request=B,t.Response=P),r.Headers=l,r.Request=B,r.Response=P,r.fetch=H,Object.defineProperty(r,"__esModule",{value:!0}),r}({})})(Y1);Y1.fetch.ponyfill=!0;delete Y1.fetch.polyfill;var Xc=Y1;yo=Xc.fetch;yo.default=Xc.fetch;yo.fetch=Xc.fetch;yo.Headers=Xc.Headers;yo.Request=Xc.Request;yo.Response=Xc.Response;PM.exports=yo});var dRe,zte,GM,Tw,Vte,KM,Pw,YM=ie(()=>{dRe=Symbol(),zte=Symbol(),GM=Object.getPrototypeOf,Tw=new WeakMap,Vte=t=>t&&(Tw.has(t)?Tw.get(t):GM(t)===Object.prototype||GM(t)===Array.prototype),KM=t=>Vte(t)&&t[zte]||null,Pw=(t,e=!0)=>{Tw.set(t,e)}});function vo(t={}){return Kte(t)}function tu(t,e,r){let n=Ks.get(t);(Jo.env&&Jo.env.MODE)!=="production"&&!n&&console.warn("Please use proxy object");let i,o=[],s=n[3],a=!1,u=s(l=>{if(o.push(l),r){e(o.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(o.splice(0))}))});return a=!0,()=>{a=!1,u()}}function Yte(t,e){let r=Ks.get(t);(Jo.env&&Jo.env.MODE)!=="production"&&!r&&console.warn("Please use proxy object");let[n,i,o]=r;return o(n,i(),e)}var Jo,Dw,Ks,J1,Gte,Kte,ZM=ie(()=>{YM();Jo={},Dw=t=>typeof t=="object"&&t!==null,Ks=new WeakMap,J1=new WeakSet,Gte=(t=Object.is,e=(u,l)=>new Proxy(u,l),r=u=>Dw(u)&&!J1.has(u)&&(Array.isArray(u)||!(Symbol.iterator in u))&&!(u instanceof WeakMap)&&!(u instanceof WeakSet)&&!(u instanceof Error)&&!(u instanceof Number)&&!(u instanceof Date)&&!(u instanceof String)&&!(u instanceof RegExp)&&!(u instanceof ArrayBuffer),n=u=>{switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:throw u}},i=new WeakMap,o=(u,l,h=n)=>{let d=i.get(u);if(d?.[0]===l)return d[1];let m=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u));return Pw(m,!0),i.set(u,[l,m]),Reflect.ownKeys(u).forEach(v=>{let x=Reflect.get(u,v);J1.has(x)?(Pw(x,!1),m[v]=x):x instanceof Promise?Object.defineProperty(m,v,{get(){return h(x)}}):Ks.has(x)?m[v]=Yte(x,h):m[v]=x}),Object.freeze(m)},s=new WeakMap,a=[1,1],c=u=>{if(!Dw(u))throw new Error("object required");let l=s.get(u);if(l)return l;let h=a[0],d=new Set,m=(H,M=++a[0])=>{h!==M&&(h=M,d.forEach(N=>N(H,M)))},v=a[1],x=(H=++a[1])=>(v!==H&&!d.size&&(v=H,I.forEach(([M])=>{let N=M[1](H);N>h&&(h=N)})),h),O=H=>(M,N)=>{let F=[...M];F[1]=[H,...F[1]],m(F,N)},I=new Map,j=(H,M)=>{if((Jo.env&&Jo.env.MODE)!=="production"&&I.has(H))throw new Error("prop listener already exists");if(d.size){let N=M[3](O(H));I.set(H,[M,N])}else I.set(H,[M])},k=H=>{var M;let N=I.get(H);N&&(I.delete(H),(M=N[1])==null||M.call(N))},B=H=>(d.add(H),d.size===1&&I.forEach(([N,F],E)=>{if((Jo.env&&Jo.env.MODE)!=="production"&&F)throw new Error("remove already exists");let f=N[3](O(E));I.set(E,[N,f])}),()=>{d.delete(H),d.size===0&&I.forEach(([N,F],E)=>{F&&(F(),I.set(E,[N]))})}),V=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u)),P=e(V,{deleteProperty(H,M){let N=Reflect.get(H,M);k(M);let F=Reflect.deleteProperty(H,M);return F&&m(["delete",[M],N]),F},set(H,M,N,F){var E;let f=Reflect.has(H,M),g=Reflect.get(H,M,F);if(f&&t(g,N))return!0;k(M),Dw(N)&&(N=KM(N)||N);let y=N;if(!((E=Object.getOwnPropertyDescriptor(H,M))!=null&&E.set))if(N instanceof Promise)N.then(b=>{N.status="fulfilled",N.value=b,m(["resolve",[M],b])}).catch(b=>{N.status="rejected",N.reason=b,m(["reject",[M],b])});else{!Ks.has(N)&&r(N)&&(y=vo(N));let b=!J1.has(y)&&Ks.get(y);b&&j(M,b)}return Reflect.set(H,M,y,F),m(["set",[M],N,g]),!0}});s.set(u,P);let L=[V,x,o,B];return Ks.set(P,L),Reflect.ownKeys(u).forEach(H=>{let M=Object.getOwnPropertyDescriptor(u,H);M.get||M.set?Object.defineProperty(V,H,M):P[H]=u[H]}),P})=>[c,Ks,J1,t,e,r,n,i,o,s,a],[Kte]=Gte()});var XM=_(Q1=>{"use strict";Q1.byteLength=Jte;Q1.toByteArray=Xte;Q1.fromByteArray=rre;var bi=[],Dn=[],Zte=typeof Uint8Array<"u"?Uint8Array:Array,Nw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ys=0,JM=Nw.length;Ys<JM;++Ys)bi[Ys]=Nw[Ys],Dn[Nw.charCodeAt(Ys)]=Ys;var Ys,JM;Dn["-".charCodeAt(0)]=62;Dn["_".charCodeAt(0)]=63;function QM(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Jte(t){var e=QM(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Qte(t,e,r){return(e+r)*3/4-r}function Xte(t){var e,r=QM(t),n=r[0],i=r[1],o=new Zte(Qte(t,n,i)),s=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=Dn[t.charCodeAt(c)]<<18|Dn[t.charCodeAt(c+1)]<<12|Dn[t.charCodeAt(c+2)]<<6|Dn[t.charCodeAt(c+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=Dn[t.charCodeAt(c)]<<2|Dn[t.charCodeAt(c+1)]>>4,o[s++]=e&255),i===1&&(e=Dn[t.charCodeAt(c)]<<10|Dn[t.charCodeAt(c+1)]<<4|Dn[t.charCodeAt(c+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function ere(t){return bi[t>>18&63]+bi[t>>12&63]+bi[t>>6&63]+bi[t&63]}function tre(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(ere(n));return i.join("")}function rre(t){for(var e,r=t.length,n=r%3,i=[],o=16383,s=0,a=r-n;s<a;s+=o)i.push(tre(t,s,s+o>a?a:s+o));return n===1?(e=t[r-1],i.push(bi[e>>2]+bi[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(bi[e>>10]+bi[e>>4&63]+bi[e<<2&63]+"=")),i.join("")}});var eR=_(kw=>{kw.read=function(t,e,r,n,i){var o,s,a=i*8-n-1,c=(1<<a)-1,u=c>>1,l=-7,h=r?i-1:0,d=r?-1:1,m=t[e+h];for(h+=d,o=m&(1<<-l)-1,m>>=-l,l+=a;l>0;o=o*256+t[e+h],h+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=s*256+t[e+h],h+=d,l-=8);if(o===0)o=1-u;else{if(o===c)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-u}return(m?-1:1)*s*Math.pow(2,o-n)};kw.write=function(t,e,r,n,i,o){var s,a,c,u=o*8-i-1,l=(1<<u)-1,h=l>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,v=n?1:-1,x=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+h>=1?e+=d/c:e+=d*Math.pow(2,1-h),e*c>=2&&(s++,c/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s=s+h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+m]=a&255,m+=v,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+m]=s&255,m+=v,s/=256,u-=8);t[r+m-v]|=x*128}});var su=_(ou=>{"use strict";var Lw=XM(),nu=eR(),tR=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ou.Buffer=K;ou.SlowBuffer=cre;ou.INSPECT_MAX_BYTES=50;var X1=2147483647;ou.kMaxLength=X1;K.TYPED_ARRAY_SUPPORT=nre();!K.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function nre(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(K.prototype,"parent",{enumerable:!0,get:function(){if(!!K.isBuffer(this))return this.buffer}});Object.defineProperty(K.prototype,"offset",{enumerable:!0,get:function(){if(!!K.isBuffer(this))return this.byteOffset}});function bo(t){if(t>X1)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,K.prototype),e}function K(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Fw(t)}return oR(t,e,r)}K.poolSize=8192;function oR(t,e,r){if(typeof t=="string")return ore(t,e);if(ArrayBuffer.isView(t))return sre(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(_i(t,ArrayBuffer)||t&&_i(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(_i(t,SharedArrayBuffer)||t&&_i(t.buffer,SharedArrayBuffer)))return Bw(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return K.from(n,e,r);let i=are(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return K.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}K.from=function(t,e,r){return oR(t,e,r)};Object.setPrototypeOf(K.prototype,Uint8Array.prototype);Object.setPrototypeOf(K,Uint8Array);function sR(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function ire(t,e,r){return sR(t),t<=0?bo(t):e!==void 0?typeof r=="string"?bo(t).fill(e,r):bo(t).fill(e):bo(t)}K.alloc=function(t,e,r){return ire(t,e,r)};function Fw(t){return sR(t),bo(t<0?0:Uw(t)|0)}K.allocUnsafe=function(t){return Fw(t)};K.allocUnsafeSlow=function(t){return Fw(t)};function ore(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!K.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=aR(t,e)|0,n=bo(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function jw(t){let e=t.length<0?0:Uw(t.length)|0,r=bo(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function sre(t){if(_i(t,Uint8Array)){let e=new Uint8Array(t);return Bw(e.buffer,e.byteOffset,e.byteLength)}return jw(t)}function Bw(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,K.prototype),n}function are(t){if(K.isBuffer(t)){let e=Uw(t.length)|0,r=bo(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Ww(t.length)?bo(0):jw(t);if(t.type==="Buffer"&&Array.isArray(t.data))return jw(t.data)}function Uw(t){if(t>=X1)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+X1.toString(16)+" bytes");return t|0}function cre(t){return+t!=t&&(t=0),K.alloc(+t)}K.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==K.prototype};K.compare=function(e,r){if(_i(e,Uint8Array)&&(e=K.from(e,e.offset,e.byteLength)),_i(r,Uint8Array)&&(r=K.from(r,r.offset,r.byteLength)),!K.isBuffer(e)||!K.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,i=r.length;for(let o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};K.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};K.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return K.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let i=K.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){let s=e[n];if(_i(s,Uint8Array))o+s.length>i.length?(K.isBuffer(s)||(s=K.from(s)),s.copy(i,o)):Uint8Array.prototype.set.call(i,s,o);else if(K.isBuffer(s))s.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return i};function aR(t,e){if(K.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||_i(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return qw(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return mR(t).length;default:if(i)return n?-1:qw(t).length;e=(""+e).toLowerCase(),i=!0}}K.byteLength=aR;function ure(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return bre(this,e,r);case"utf8":case"utf-8":return uR(this,e,r);case"ascii":return yre(this,e,r);case"latin1":case"binary":return vre(this,e,r);case"base64":return gre(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _re(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}K.prototype._isBuffer=!0;function Zs(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}K.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)Zs(this,r,r+1);return this};K.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)Zs(this,r,r+3),Zs(this,r+1,r+2);return this};K.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)Zs(this,r,r+7),Zs(this,r+1,r+6),Zs(this,r+2,r+5),Zs(this,r+3,r+4);return this};K.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?uR(this,0,e):ure.apply(this,arguments)};K.prototype.toLocaleString=K.prototype.toString;K.prototype.equals=function(e){if(!K.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:K.compare(this,e)===0};K.prototype.inspect=function(){let e="",r=ou.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};tR&&(K.prototype[tR]=K.prototype.inspect);K.prototype.compare=function(e,r,n,i,o){if(_i(e,Uint8Array)&&(e=K.from(e,e.offset,e.byteLength)),!K.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;let s=o-i,a=n-r,c=Math.min(s,a),u=this.slice(i,o),l=e.slice(r,n);for(let h=0;h<c;++h)if(u[h]!==l[h]){s=u[h],a=l[h];break}return s<a?-1:a<s?1:0};function cR(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Ww(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=K.from(e,n)),K.isBuffer(e))return e.length===0?-1:rR(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):rR(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function rR(t,e,r,n,i){let o=1,s=t.length,a=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,a/=2,r/=2}function c(l,h){return o===1?l[h]:l.readUInt16BE(h*o)}let u;if(i){let l=-1;for(u=r;u<s;u++)if(c(t,u)===c(e,l===-1?0:u-l)){if(l===-1&&(l=u),u-l+1===a)return l*o}else l!==-1&&(u-=u-l),l=-1}else for(r+a>s&&(r=s-a),u=r;u>=0;u--){let l=!0;for(let h=0;h<a;h++)if(c(t,u+h)!==c(e,h)){l=!1;break}if(l)return u}return-1}K.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};K.prototype.indexOf=function(e,r,n){return cR(this,e,r,n,!0)};K.prototype.lastIndexOf=function(e,r,n){return cR(this,e,r,n,!1)};function lre(t,e,r,n){r=Number(r)||0;let i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let o=e.length;n>o/2&&(n=o/2);let s;for(s=0;s<n;++s){let a=parseInt(e.substr(s*2,2),16);if(Ww(a))return s;t[r+s]=a}return s}function fre(t,e,r,n){return eg(qw(e,t.length-r),t,r,n)}function hre(t,e,r,n){return eg(xre(e),t,r,n)}function dre(t,e,r,n){return eg(mR(e),t,r,n)}function pre(t,e,r,n){return eg(Ore(e,t.length-r),t,r,n)}K.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return lre(this,e,r,n);case"utf8":case"utf-8":return fre(this,e,r,n);case"ascii":case"latin1":case"binary":return hre(this,e,r,n);case"base64":return dre(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pre(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};K.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function gre(t,e,r){return e===0&&r===t.length?Lw.fromByteArray(t):Lw.fromByteArray(t.slice(e,r))}function uR(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){let c,u,l,h;switch(a){case 1:o<128&&(s=o);break;case 2:c=t[i+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(s=h));break;case 3:c=t[i+1],u=t[i+2],(c&192)===128&&(u&192)===128&&(h=(o&15)<<12|(c&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:c=t[i+1],u=t[i+2],l=t[i+3],(c&192)===128&&(u&192)===128&&(l&192)===128&&(h=(o&15)<<18|(c&63)<<12|(u&63)<<6|l&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return mre(n)}var nR=4096;function mre(t){let e=t.length;if(e<=nR)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=nR));return r}function yre(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function vre(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function bre(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=e;o<r;++o)i+=Cre[t[o]];return i}function _re(t,e,r){let n=t.slice(e,r),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}K.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let i=this.subarray(e,r);return Object.setPrototypeOf(i,K.prototype),i};function br(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}K.prototype.readUintLE=K.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||br(e,r,this.length);let i=this[e],o=1,s=0;for(;++s<r&&(o*=256);)i+=this[e+s]*o;return i};K.prototype.readUintBE=K.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||br(e,r,this.length);let i=this[e+--r],o=1;for(;r>0&&(o*=256);)i+=this[e+--r]*o;return i};K.prototype.readUint8=K.prototype.readUInt8=function(e,r){return e=e>>>0,r||br(e,1,this.length),this[e]};K.prototype.readUint16LE=K.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||br(e,2,this.length),this[e]|this[e+1]<<8};K.prototype.readUint16BE=K.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||br(e,2,this.length),this[e]<<8|this[e+1]};K.prototype.readUint32LE=K.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||br(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};K.prototype.readUint32BE=K.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||br(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};K.prototype.readBigUInt64LE=Qo(function(e){e=e>>>0,iu(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Df(e,this.length-8);let i=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});K.prototype.readBigUInt64BE=Qo(function(e){e=e>>>0,iu(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Df(e,this.length-8);let i=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});K.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||br(e,r,this.length);let i=this[e],o=1,s=0;for(;++s<r&&(o*=256);)i+=this[e+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};K.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||br(e,r,this.length);let i=r,o=1,s=this[e+--i];for(;i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};K.prototype.readInt8=function(e,r){return e=e>>>0,r||br(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};K.prototype.readInt16LE=function(e,r){e=e>>>0,r||br(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};K.prototype.readInt16BE=function(e,r){e=e>>>0,r||br(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};K.prototype.readInt32LE=function(e,r){return e=e>>>0,r||br(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};K.prototype.readInt32BE=function(e,r){return e=e>>>0,r||br(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};K.prototype.readBigInt64LE=Qo(function(e){e=e>>>0,iu(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Df(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});K.prototype.readBigInt64BE=Qo(function(e){e=e>>>0,iu(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Df(e,this.length-8);let i=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});K.prototype.readFloatLE=function(e,r){return e=e>>>0,r||br(e,4,this.length),nu.read(this,e,!0,23,4)};K.prototype.readFloatBE=function(e,r){return e=e>>>0,r||br(e,4,this.length),nu.read(this,e,!1,23,4)};K.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||br(e,8,this.length),nu.read(this,e,!0,52,8)};K.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||br(e,8,this.length),nu.read(this,e,!1,52,8)};function cn(t,e,r,n,i,o){if(!K.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}K.prototype.writeUintLE=K.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;cn(this,e,r,n,a,0)}let o=1,s=0;for(this[r]=e&255;++s<n&&(o*=256);)this[r+s]=e/o&255;return r+n};K.prototype.writeUintBE=K.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;cn(this,e,r,n,a,0)}let o=n-1,s=1;for(this[r+o]=e&255;--o>=0&&(s*=256);)this[r+o]=e/s&255;return r+n};K.prototype.writeUint8=K.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||cn(this,e,r,1,255,0),this[r]=e&255,r+1};K.prototype.writeUint16LE=K.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||cn(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};K.prototype.writeUint16BE=K.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||cn(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};K.prototype.writeUint32LE=K.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||cn(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};K.prototype.writeUint32BE=K.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||cn(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function lR(t,e,r,n,i){gR(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,r}function fR(t,e,r,n,i){gR(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s=s>>8,t[r+2]=s,s=s>>8,t[r+1]=s,s=s>>8,t[r]=s,r+8}K.prototype.writeBigUInt64LE=Qo(function(e,r=0){return lR(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});K.prototype.writeBigUInt64BE=Qo(function(e,r=0){return fR(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});K.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let c=Math.pow(2,8*n-1);cn(this,e,r,n,c-1,-c)}let o=0,s=1,a=0;for(this[r]=e&255;++o<n&&(s*=256);)e<0&&a===0&&this[r+o-1]!==0&&(a=1),this[r+o]=(e/s>>0)-a&255;return r+n};K.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let c=Math.pow(2,8*n-1);cn(this,e,r,n,c-1,-c)}let o=n-1,s=1,a=0;for(this[r+o]=e&255;--o>=0&&(s*=256);)e<0&&a===0&&this[r+o+1]!==0&&(a=1),this[r+o]=(e/s>>0)-a&255;return r+n};K.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||cn(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};K.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||cn(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};K.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||cn(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};K.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||cn(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};K.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||cn(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};K.prototype.writeBigInt64LE=Qo(function(e,r=0){return lR(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});K.prototype.writeBigInt64BE=Qo(function(e,r=0){return fR(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function hR(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function dR(t,e,r,n,i){return e=+e,r=r>>>0,i||hR(t,e,r,4,34028234663852886e22,-34028234663852886e22),nu.write(t,e,r,n,23,4),r+4}K.prototype.writeFloatLE=function(e,r,n){return dR(this,e,r,!0,n)};K.prototype.writeFloatBE=function(e,r,n){return dR(this,e,r,!1,n)};function pR(t,e,r,n,i){return e=+e,r=r>>>0,i||hR(t,e,r,8,17976931348623157e292,-17976931348623157e292),nu.write(t,e,r,n,52,8),r+8}K.prototype.writeDoubleLE=function(e,r,n){return pR(this,e,r,!0,n)};K.prototype.writeDoubleBE=function(e,r,n){return pR(this,e,r,!1,n)};K.prototype.copy=function(e,r,n,i){if(!K.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);let o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),o};K.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!K.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){let s=e.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<n;++o)this[o]=e;else{let s=K.isBuffer(e)?e:K.from(e,i),a=s.length;if(a===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=s[o%a]}return this};var ru={};function $w(t,e,r){ru[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}$w("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);$w("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);$w("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=iR(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=iR(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function iR(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function wre(t,e,r){iu(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Df(e,t.length-(r+1))}function gR(t,e,r,n,i,o){if(t>r||t<e){let s=typeof e=="bigint"?"n":"",a;throw o>3?e===0||e===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${e}${s} and <= ${r}${s}`,new ru.ERR_OUT_OF_RANGE("value",a,t)}wre(n,i,o)}function iu(t,e){if(typeof t!="number")throw new ru.ERR_INVALID_ARG_TYPE(e,"number",t)}function Df(t,e,r){throw Math.floor(t)!==t?(iu(t,r),new ru.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new ru.ERR_BUFFER_OUT_OF_BOUNDS:new ru.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Ere=/[^+/0-9A-Za-z-_]/g;function Sre(t){if(t=t.split("=")[0],t=t.trim().replace(Ere,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function qw(t,e){e=e||1/0;let r,n=t.length,i=null,o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function xre(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Ore(t,e){let r,n,i,o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function mR(t){return Lw.toByteArray(Sre(t))}function eg(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function _i(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Ww(t){return t!==t}var Cre=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Qo(t){return typeof BigInt>"u"?Are:t}function Are(){throw new Error("BigInt not supported")}});function Ire(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}function Mre(t){let e=Object.fromEntries(Object.entries(t).filter(([r,n])=>typeof n<"u"&&n!==null&&n!=="").map(([r,n])=>[r,n.toString()]));return new URLSearchParams(e).toString()}function rg(){let{projectId:t}=Kt.state;if(!t)throw new Error("projectId is required to work with explorer api");return t}var vR,st,se,Nf,Wt,Fe,kf,Kt,yR,tg,Js,sr,En,Ue,au,ar,Qs,Gr,Hw=ie(()=>{ZM();vR=ke(su(),1),st=vo({selectedChain:void 0,chains:void 0,standaloneChains:void 0,standaloneUri:void 0,address:void 0,profileName:void 0,profileAvatar:void 0,profileLoading:!1,balanceLoading:!1,balance:void 0,isConnected:!1,isStandalone:!1,isCustomDesktop:!1,isCustomMobile:!1,isExplorer:!1,isDataLoaded:!1,isUiLoaded:!1}),se={state:st,subscribe(t){return tu(st,()=>t(st))},setChains(t){st.chains=t},setStandaloneChains(t){st.standaloneChains=t},setStandaloneUri(t){st.standaloneUri=t},getSelectedChain(){let t=Wt.client().getNetwork().chain;return t&&(st.selectedChain=t),st.selectedChain},setSelectedChain(t){st.selectedChain=t},setIsStandalone(t){st.isStandalone=t},setIsCustomDesktop(t){st.isCustomDesktop=t},setIsCustomMobile(t){st.isCustomMobile=t},setIsExplorer(t){st.isExplorer=t},getAccount(){let t=Wt.client().getAccount();st.address=t.address,st.isConnected=t.isConnected},setAddress(t){st.address=t},setIsConnected(t){st.isConnected=t},setProfileName(t){st.profileName=t},setProfileAvatar(t){st.profileAvatar=t},setProfileLoading(t){st.profileLoading=t},setBalanceLoading(t){st.balanceLoading=t},setBalance(t){st.balance=t},setIsDataLoaded(t){st.isDataLoaded=t},setIsUiLoaded(t){st.isUiLoaded=t},resetEnsProfile(){st.profileName=void 0,st.profileAvatar=void 0},resetBalance(){st.balance=void 0},resetAccount(){st.address=void 0,se.resetEnsProfile(),se.resetBalance()}},Nf=vo({initialized:!1,ethereumClient:void 0}),Wt={setEthereumClient(t){!Nf.initialized&&t&&(Nf.ethereumClient=t,se.setChains(t.chains),Nf.initialized=!0)},client(){if(Nf.ethereumClient)return Nf.ethereumClient;throw new Error("ClientCtrl has no client set")}},Fe={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",isMobile(){return typeof window<"u"?Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return Fe.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isEmptyObject(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.getOwnPropertyNames(t).length===0&&Object.getOwnPropertySymbols(t).length===0},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},formatNativeUrl(t,e,r){if(Fe.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),this.setWalletConnectDeepLink(n,r);let i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!Fe.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;t.endsWith("/")&&(n=t.slice(0,-1)),this.setWalletConnectDeepLink(n,r);let i=encodeURIComponent(e);return`${n}/wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e="_self"){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){localStorage.setItem(Fe.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))},setWalletConnectAndroidDeepLink(t){let[e]=t.split("?");localStorage.setItem(Fe.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))},removeWalletConnectDeepLink(){localStorage.removeItem(Fe.WALLETCONNECT_DEEPLINK_CHOICE)},isNull(t){return t===null},getWalletConnectVersion(){let{isStandalone:t}=se.state,e=1;return t||(e=Wt.client().walletConnectVersion),e}};kf=vo({projectId:void 0,themeMode:Ire()?"dark":"light",themeColor:"default",themeBackground:Fe.isMobile()?"themeColor":"gradient",themeZIndex:89,mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chainImages:void 0,tokenImages:void 0,standaloneChains:void 0,enableStandaloneMode:!1,enableNetworkView:!1,defaultChain:void 0,explorerAllowList:void 0,explorerDenyList:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Kt={state:kf,subscribe(t){return tu(kf,()=>t(kf))},setConfig(t){var e,r,n,i;if(se.setStandaloneChains(t.standaloneChains),se.setIsStandalone(Boolean((e=t.standaloneChains)==null?void 0:e.length)||Boolean(t.enableStandaloneMode)),se.setIsCustomMobile(Boolean((r=t.mobileWallets)==null?void 0:r.length)),se.setIsCustomDesktop(Boolean((n=t.desktopWallets)==null?void 0:n.length)),se.setIsExplorer(Boolean((i=t.projectId)==null?void 0:i.length)),t.defaultChain)se.setSelectedChain(t.defaultChain);else if(!se.state.isStandalone){let o=Wt.client().getDefaultChain();se.setSelectedChain(o)}Object.assign(kf,t)},setThemeConfig(t){Object.assign(kf,t)}},yR="https://explorer-api.walletconnect.com";tg={async fetchWallets(t,e){let r=Mre(e),n=`${yR}/v3/wallets?projectId=${t}&${r}`;return(await fetch(n)).json()},formatImageUrl(t,e){return`${yR}/v3/logo/lg/${e}?projectId=${t}`}},Js=vo({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},previewWallets:[],recomendedWallets:[]});sr={state:Js,async getPreviewWallets(t){let{listings:e}=await tg.fetchWallets(rg(),t);return Js.previewWallets=Object.values(e),Js.previewWallets},async getRecomendedWallets(){let{listings:t}=await tg.fetchWallets(rg(),{page:1,entries:6});Js.recomendedWallets=Object.values(t)},async getPaginatedWallets(t){let{page:e,search:r}=t,{listings:n,total:i}=await tg.fetchWallets(rg(),t),o=Object.values(n),s=r?"search":"wallets";return Js[s]={listings:[...Js[s].listings,...o],total:i,page:e??1},{listings:o,total:i}},getImageUrl(t){return tg.formatImageUrl(rg(),t)},resetSearch(){Js.search={listings:[],total:0,page:1}}},En=vo({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Ue={state:En,subscribe(t){return tu(En,()=>t(En))},push(t,e){t!==En.view&&(En.view=t,e&&(En.data=e),En.history.push(t))},replace(t){En.view=t,En.history=[t]},goBack(){if(En.history.length>1){En.history.pop();let[t]=En.history.slice(-1);En.view=t}}},au=vo({open:!1}),ar={state:au,subscribe(t){return tu(au,()=>t(au))},async open(t){return new Promise(e=>{let{isConnected:r,isStandalone:n,isUiLoaded:i,isDataLoaded:o}=se.state,{enableNetworkView:s}=Kt.state;if(n?(se.setStandaloneUri(t?.uri),se.setStandaloneChains(t?.standaloneChains),Ue.replace("ConnectWallet")):t!=null&&t.route?Ue.replace(t.route):r?Ue.replace("Account"):s?Ue.replace("SelectNetwork"):Ue.replace("ConnectWallet"),i&&o)au.open=!0,e();else{let a=setInterval(()=>{se.state.isUiLoaded&&se.state.isDataLoaded&&(clearInterval(a),au.open=!0,e())},200)}})},close(){au.open=!1}},Qs=vo({open:!1,message:"",variant:"success"}),Gr={state:Qs,subscribe(t){return tu(Qs,()=>t(Qs))},openToast(t,e){Qs.open=!0,Qs.message=t,Qs.variant=e},closeToast(){Qs.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=vR.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}))});var ng,ig,zw,bR,Lf,_R,Ce,Vw,og,Gw=ie(()=>{ng=window,ig=ng.ShadowRoot&&(ng.ShadyCSS===void 0||ng.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,zw=Symbol(),bR=new WeakMap,Lf=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==zw)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(ig&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=bR.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&bR.set(r,e))}return e}toString(){return this.cssText}},_R=t=>new Lf(typeof t=="string"?t:t+"",void 0,zw),Ce=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((n,i,o)=>n+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1],t[0]);return new Lf(r,t,zw)},Vw=(t,e)=>{ig?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let n=document.createElement("style"),i=ng.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},og=ig?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return _R(r)})(t):t});var Kw,sg,wR,Rre,ER,Zw,SR,Yw,_o,ag=ie(()=>{Gw();Gw();sg=window,wR=sg.trustedTypes,Rre=wR?wR.emptyScript:"",ER=sg.reactiveElementPolyfillSupport,Zw={toAttribute(t,e){switch(e){case Boolean:t=t?Rre: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}},SR=(t,e)=>e!==t&&(e==e||t==t),Yw={attribute:!0,type:String,converter:Zw,reflect:!1,hasChanged:SR},_o=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((r,n)=>{let i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=Yw){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){let o=this[e];this[r]=i,this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Yw}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;let 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")){let r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(og(i))}else e!==void 0&&r.push(og(e));return r}static _$Ep(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;let r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Vw(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=Yw){var i;let o=this.constructor._$Ep(e,n);if(o!==void 0&&n.reflect===!0){let s=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:Zw).toAttribute(r,n.type);this._$El=e,s==null?this.removeAttribute(o):this.setAttribute(o,s),this._$El=null}}_$AK(e,r){var n;let i=this.constructor,o=i._$Ev.get(e);if(o!==void 0&&this._$El!==o){let s=i.getPropertyOptions(o),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((n=s.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?s.converter:Zw;this._$El=o,this[o]=a.fromAttribute(r,s.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||SR)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,o)=>this[o]=i),this._$Ei=void 0);let r=!1,n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var o;return(o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};_o.finalized=!0,_o.elementProperties=new Map,_o.elementStyles=[],_o.shadowRootOptions={mode:"open"},ER?.({ReactiveElement:_o}),((Kw=sg.reactiveElementVersions)!==null&&Kw!==void 0?Kw:sg.reactiveElementVersions=[]).push("1.6.1")});function fu(t,e,r=t,n){var i,o,s,a;if(e===wo)return e;let c=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl,u=qf(e)?void 0:e._$litDirective$;return c?.constructor!==u&&((o=c?._$AO)===null||o===void 0||o.call(c,!1),u===void 0?c=void 0:(c=new u(t),c._$AT(t,r,n)),n!==void 0?((s=(a=r)._$Co)!==null&&s!==void 0?s:a._$Co=[])[n]=c:r._$Cl=c),c!==void 0&&(e=fu(t,c._$AS(t,e.values),c,n)),e}var Jw,cg,uu,xR,Xo,TR,Tre,lu,Bf,qf,PR,Pre,jf,OR,CR,Xs,AR,IR,DR,NR,J,Pe,wo,cr,MR,cu,Dre,ea,Qw,ta,hu,Xw,Nre,e2,t2,r2,RR,kR,ra=ie(()=>{cg=window,uu=cg.trustedTypes,xR=uu?uu.createPolicy("lit-html",{createHTML:t=>t}):void 0,Xo=`lit$${(Math.random()+"").slice(9)}$`,TR="?"+Xo,Tre=`<${TR}>`,lu=document,Bf=(t="")=>lu.createComment(t),qf=t=>t===null||typeof t!="object"&&typeof t!="function",PR=Array.isArray,Pre=t=>PR(t)||typeof t?.[Symbol.iterator]=="function",jf=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,OR=/-->/g,CR=/>/g,Xs=RegExp(`>|[
2
+ \f\r](?:([^\\s"'>=/]+)([
3
+ \f\r]*=[
4
+ \f\r]*(?:[^
5
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),AR=/'/g,IR=/"/g,DR=/^(?:script|style|textarea|title)$/i,NR=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),J=NR(1),Pe=NR(2),wo=Symbol.for("lit-noChange"),cr=Symbol.for("lit-nothing"),MR=new WeakMap,cu=lu.createTreeWalker(lu,129,null,!1),Dre=(t,e)=>{let r=t.length-1,n=[],i,o=e===2?"<svg>":"",s=jf;for(let c=0;c<r;c++){let u=t[c],l,h,d=-1,m=0;for(;m<u.length&&(s.lastIndex=m,h=s.exec(u),h!==null);)m=s.lastIndex,s===jf?h[1]==="!--"?s=OR:h[1]!==void 0?s=CR:h[2]!==void 0?(DR.test(h[2])&&(i=RegExp("</"+h[2],"g")),s=Xs):h[3]!==void 0&&(s=Xs):s===Xs?h[0]===">"?(s=i??jf,d=-1):h[1]===void 0?d=-2:(d=s.lastIndex-h[2].length,l=h[1],s=h[3]===void 0?Xs:h[3]==='"'?IR:AR):s===IR||s===AR?s=Xs:s===OR||s===CR?s=jf:(s=Xs,i=void 0);let v=s===Xs&&t[c+1].startsWith("/>")?" ":"";o+=s===jf?u+Tre:d>=0?(n.push(l),u.slice(0,d)+"$lit$"+u.slice(d)+Xo+v):u+Xo+(d===-2?(n.push(void 0),c):v)}let a=o+(t[r]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[xR!==void 0?xR.createHTML(a):a,n]},ea=class{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let o=0,s=0,a=e.length-1,c=this.parts,[u,l]=Dre(e,r);if(this.el=ea.createElement(u,n),cu.currentNode=this.el.content,r===2){let h=this.el.content,d=h.firstChild;d.remove(),h.append(...d.childNodes)}for(;(i=cu.nextNode())!==null&&c.length<a;){if(i.nodeType===1){if(i.hasAttributes()){let h=[];for(let d of i.getAttributeNames())if(d.endsWith("$lit$")||d.startsWith(Xo)){let m=l[s++];if(h.push(d),m!==void 0){let v=i.getAttribute(m.toLowerCase()+"$lit$").split(Xo),x=/([.?@])?(.*)/.exec(m);c.push({type:1,index:o,name:x[2],strings:v,ctor:x[1]==="."?Xw:x[1]==="?"?e2:x[1]==="@"?t2:hu})}else c.push({type:6,index:o})}for(let d of h)i.removeAttribute(d)}if(DR.test(i.tagName)){let h=i.textContent.split(Xo),d=h.length-1;if(d>0){i.textContent=uu?uu.emptyScript:"";for(let m=0;m<d;m++)i.append(h[m],Bf()),cu.nextNode(),c.push({type:2,index:++o});i.append(h[d],Bf())}}}else if(i.nodeType===8)if(i.data===TR)c.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(Xo,h+1))!==-1;)c.push({type:7,index:o}),h+=Xo.length-1}o++}}static createElement(e,r){let n=lu.createElement("template");return n.innerHTML=e,n}};Qw=class{constructor(e,r){this.u=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(e){var r;let{el:{content:n},parts:i}=this._$AD,o=((r=e?.creationScope)!==null&&r!==void 0?r:lu).importNode(n,!0);cu.currentNode=o;let s=cu.nextNode(),a=0,c=0,u=i[0];for(;u!==void 0;){if(a===u.index){let l;u.type===2?l=new ta(s,s.nextSibling,this,e):u.type===1?l=new u.ctor(s,u.name,u.strings,this,e):u.type===6&&(l=new r2(s,this,e)),this.u.push(l),u=i[++c]}a!==u?.index&&(s=cu.nextNode(),a++)}return o}p(e){let r=0;for(let n of this.u)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},ta=class{constructor(e,r,n,i){var o;this.type=2,this._$AH=cr,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cm=(o=i?.isConnected)===null||o===void 0||o}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cm}get parentNode(){let e=this._$AA.parentNode,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=fu(this,e,r),qf(e)?e===cr||e==null||e===""?(this._$AH!==cr&&this._$AR(),this._$AH=cr):e!==this._$AH&&e!==wo&&this.g(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Pre(e)?this.k(e):this.g(e)}O(e,r=this._$AB){return this._$AA.parentNode.insertBefore(e,r)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==cr&&qf(this._$AH)?this._$AA.nextSibling.data=e:this.T(lu.createTextNode(e)),this._$AH=e}$(e){var r;let{values:n,_$litType$:i}=e,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=ea.createElement(i.h,this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===o)this._$AH.p(n);else{let s=new Qw(o,this),a=s.v(this.options);s.p(n),this.T(a),this._$AH=s}}_$AC(e){let r=MR.get(e.strings);return r===void 0&&MR.set(e.strings,r=new ea(e)),r}k(e){PR(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let o of e)i===r.length?r.push(n=new ta(this.O(Bf()),this.O(Bf()),this,this.options)):n=r[i],n._$AI(o),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cm=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}},hu=class{constructor(e,r,n,i,o){this.type=1,this._$AH=cr,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=cr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){let o=this.strings,s=!1;if(o===void 0)e=fu(this,e,r,0),s=!qf(e)||e!==this._$AH&&e!==wo,s&&(this._$AH=e);else{let a=e,c,u;for(e=o[0],c=0;c<o.length-1;c++)u=fu(this,a[n+c],r,c),u===wo&&(u=this._$AH[c]),s||(s=!qf(u)||u!==this._$AH[c]),u===cr?e=cr:e!==cr&&(e+=(u??"")+o[c+1]),this._$AH[c]=u}s&&!i&&this.j(e)}j(e){e===cr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Xw=class extends hu{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===cr?void 0:e}},Nre=uu?uu.emptyScript:"",e2=class extends hu{constructor(){super(...arguments),this.type=4}j(e){e&&e!==cr?this.element.setAttribute(this.name,Nre):this.element.removeAttribute(this.name)}},t2=class extends hu{constructor(e,r,n,i,o){super(e,r,n,i,o),this.type=5}_$AI(e,r=this){var n;if((e=(n=fu(this,e,r,0))!==null&&n!==void 0?n:cr)===wo)return;let i=this._$AH,o=e===cr&&i!==cr||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==cr&&(i===cr||o);o&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}},r2=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){fu(this,e)}},RR=cg.litHtmlPolyfillSupport;RR?.(ea,ta),((Jw=cg.litHtmlVersions)!==null&&Jw!==void 0?Jw:cg.litHtmlVersions=[]).push("2.6.1");kR=(t,e,r)=>{var n,i;let o=(n=r?.renderBefore)!==null&&n!==void 0?n:e,s=o._$litPart$;if(s===void 0){let a=(i=r?.renderBefore)!==null&&i!==void 0?i:null;o._$litPart$=s=new ta(e.insertBefore(Bf(),a),a,void 0,r??{})}return s._$AI(t),s}});var n2,i2,_e,LR,jR=ie(()=>{ag();ag();ra();ra();_e=class extends _o{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=kR(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 wo}};_e.finalized=!0,_e._$litElement$=!0,(n2=globalThis.litElementHydrateSupport)===null||n2===void 0||n2.call(globalThis,{LitElement:_e});LR=globalThis.litElementPolyfillSupport;LR?.({LitElement:_e});((i2=globalThis.litElementVersions)!==null&&i2!==void 0?i2:globalThis.litElementVersions=[]).push("3.2.2")});var BR=ie(()=>{});var qR=ie(()=>{ag();ra();jR();BR()});var Oe,FR=ie(()=>{Oe=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{let{kind:i,elements:o}=n;return{kind:i,elements:o,finisher(s){customElements.define(r,s)}}})(t,e)});function Ae(t){return(e,r)=>r!==void 0?((n,i,o)=>{i.constructor.createProperty(o,n)})(t,e,r):kre(t,e)}var kre,o2=ie(()=>{kre=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}}});function Ve(t){return Ae({...t,state:!0})}var UR=ie(()=>{o2();});var na=ie(()=>{});var $R=ie(()=>{na();});var WR=ie(()=>{na();});var HR=ie(()=>{na();});var zR=ie(()=>{na();});var s2,XRe,a2=ie(()=>{na();XRe=((s2=window.HTMLSlotElement)===null||s2===void 0?void 0:s2.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE)});var VR=ie(()=>{na();a2();});var GR=ie(()=>{FR();o2();UR();$R();WR();HR();zR();a2();VR()});var KR,YR,ug,ZR=ie(()=>{KR={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},YR=t=>(...e)=>({_$litDirective$:t,values:e}),ug=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}});var Kr,JR=ie(()=>{ra();ZR();Kr=YR(class extends ug{constructor(t){var e;if(super(t),t.type!==KR.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,n;if(this.nt===void 0){this.nt=new Set,t.strings!==void 0&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(let o in e)e[o]&&!(!((r=this.st)===null||r===void 0)&&r.has(o))&&this.nt.add(o);return this.render(e)}let i=t.element.classList;this.nt.forEach(o=>{o in e||(i.remove(o),this.nt.delete(o))});for(let o in e){let s=!!e[o];s===this.nt.has(o)||((n=this.st)===null||n===void 0?void 0:n.has(o))||(s?(i.add(o),this.nt.add(o)):(i.remove(o),this.nt.delete(o)))}return wo}})});var QR=ie(()=>{JR()});function c2(t,e){t.indexOf(e)===-1&&t.push(e)}var XR=ie(()=>{});var Uf,u2=ie(()=>{Uf=(t,e,r)=>Math.min(Math.max(r,t),e)});var Cr,eT=ie(()=>{Cr={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"}});var Yn,lg=ie(()=>{Yn=t=>typeof t=="number"});var wi,l2=ie(()=>{lg();wi=t=>Array.isArray(t)&&!Yn(t[0])});var tT,rT=ie(()=>{tT=(t,e,r)=>{let n=e-t;return((r-t)%n+n)%n+t}});function nT(t,e){return wi(t)?t[tT(0,t.length,e)]:t}var iT=ie(()=>{l2();rT()});var fg,f2=ie(()=>{fg=(t,e,r)=>-r*t+r*e+t});var $f,mr,h2=ie(()=>{$f=()=>{},mr=t=>t});var ia,hg=ie(()=>{ia=(t,e,r)=>e-t===0?1:(r-t)/(e-t)});function d2(t,e){let r=t[t.length-1];for(let n=1;n<=e;n++){let i=ia(0,e,n);t.push(fg(r,1,i))}}function oT(t){let e=[0];return d2(e,t-1),e}var sT=ie(()=>{f2();hg()});function p2(t,e=oT(t.length),r=mr){let n=t.length,i=n-e.length;return i>0&&d2(e,i),o=>{let s=0;for(;s<n-2&&!(o<e[s+1]);s++);let a=Uf(0,1,ia(e[s],e[s+1],o));return a=nT(r,s)(a),fg(t[s],t[s+1],a)}}var aT=ie(()=>{f2();h2();sT();hg();iT();u2()});var Wf,cT=ie(()=>{lg();Wf=t=>Array.isArray(t)&&Yn(t[0])});var du,uT=ie(()=>{du=t=>typeof t=="object"&&Boolean(t.createAnimation)});var Nn,lT=ie(()=>{Nn=t=>typeof t=="function"});var Hf,fT=ie(()=>{Hf=t=>typeof t=="string"});var Ei,hT=ie(()=>{Ei={ms:t=>t*1e3,s:t=>t/1e3}});function g2(t,e){return e?t*(1e3/e):0}var dT=ie(()=>{});var kr=ie(()=>{XR();u2();eT();aT();cT();uT();l2();lT();lg();fT();h2();hg();hT();dT()});function Bre(t,e,r,n,i){let o,s,a=0;do s=e+(r-e)/2,o=pT(s,n,i)-t,o>0?r=s:e=s;while(Math.abs(o)>Lre&&++a<jre);return s}function oa(t,e,r,n){if(t===e&&r===n)return mr;let i=o=>Bre(o,0,1,t,r);return o=>o===0||o===1?o:pT(i(o),e,n)}var pT,Lre,jre,gT=ie(()=>{kr();pT=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,Lre=1e-7,jre=12});var m2,mT=ie(()=>{kr();m2=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);let n=r*t,i=e==="end"?Math.floor(n):Math.ceil(n);return Uf(0,1,i/t)}});var yT=ie(()=>{gT();mT()});function y2(t){if(Nn(t))return t;if(Wf(t))return oa(...t);if(vT[t])return vT[t];if(t.startsWith("steps")){let e=qre.exec(t);if(e){let r=e[1].split(",");return m2(parseFloat(r[0]),r[1].trim())}}return mr}var vT,qre,bT=ie(()=>{yT();kr();vT={ease:oa(.25,.1,.25,1),"ease-in":oa(.42,0,1,1),"ease-in-out":oa(.42,0,.58,1),"ease-out":oa(0,0,.58,1)},qre=/\((.*?)\)/});var sa,_T=ie(()=>{kr();bT();sa=class{constructor(e,r=[0,1],{easing:n,duration:i=Cr.duration,delay:o=Cr.delay,endDelay:s=Cr.endDelay,repeat:a=Cr.repeat,offset:c,direction:u="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=mr,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((h,d)=>{this.resolve=h,this.reject=d}),n=n||Cr.easing,du(n)){let h=n.createAnimation(r);n=h.easing,r=h.keyframes||r,i=h.duration||i}this.repeat=a,this.easing=wi(n)?mr:y2(n),this.updateDuration(i);let l=p2(r,c,wi(n)?n.map(y2):mr);this.tick=h=>{var d;o=o;let m=0;this.pauseTime!==void 0?m=this.pauseTime:m=(h-this.startTime)*this.rate,this.t=m,m/=1e3,m=Math.max(m-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(m=this.totalDuration);let v=m/this.duration,x=Math.floor(v),O=v%1;!O&&v>=1&&(O=1),O===1&&x--;let I=x%2;(u==="reverse"||u==="alternate"&&I||u==="alternate-reverse"&&!I)&&(O=1-O);let j=m>=this.totalDuration?1:Math.min(O,1),k=l(this.easing(j));e(k),this.pauseTime===void 0&&(this.playState==="finished"||m>=this.totalDuration+s)?(this.playState="finished",(d=this.resolve)===null||d===void 0||d.call(this,k)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){let 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 v2=ie(()=>{_T()});var b2,wT=ie(()=>{b2=function(){}});var zf,ET=ie(()=>{zf=class{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}});var _2=ie(()=>{ET()});function dg(t){return w2.has(t)||w2.set(t,{transforms:[],values:new Map}),w2.get(t)}function ST(t,e){return t.has(e)||t.set(e,new zf),t.get(e)}var w2,E2=ie(()=>{_2();w2=new WeakMap});var Fre,Ure,Vf,xT,$re,Si,gg,pg,Wre,Hre,mg,OT,zre,Vre,pu=ie(()=>{kr();E2();Fre=["","X","Y","Z"],Ure=["translate","scale","rotate","skew"],Vf={x:"translateX",y:"translateY",z:"translateZ"},xT={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},$re={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:xT,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:mr},skew:xT},Si=new Map,gg=t=>`--motion-${t}`,pg=["x","y","z"];Ure.forEach(t=>{Fre.forEach(e=>{pg.push(t+e),Si.set(gg(t+e),$re[t])})});Wre=(t,e)=>pg.indexOf(t)-pg.indexOf(e),Hre=new Set(pg),mg=t=>Hre.has(t),OT=(t,e)=>{Vf[e]&&(e=Vf[e]);let{transforms:r}=dg(t);c2(r,e),t.style.transform=zre(r)},zre=t=>t.sort(Wre).reduce(Vre,"").trim(),Vre=(t,e)=>`${t} ${e}(var(${gg(e)}))`});function AT(t){if(!CT.has(t)){CT.add(t);try{let{syntax:e,initialValue:r}=Si.has(t)?Si.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}var Gf,CT,S2=ie(()=>{pu();Gf=t=>t.startsWith("--"),CT=new Set});var x2,IT,O2,es,C2=ie(()=>{x2=(t,e)=>document.createElement("div").animate(t,e),IT={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{x2({opacity:[1]})}catch{return!1}return!0},finished:()=>Boolean(x2({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{x2({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},O2={},es={};for(let t in IT)es[t]=()=>(O2[t]===void 0&&(O2[t]=IT[t]()),O2[t])});var Gre,Kre,A2,Yre,MT=ie(()=>{kr();C2();Gre=.015,Kre=(t,e)=>{let r="",n=Math.round(e/Gre);for(let i=0;i<n;i++)r+=t(ia(0,n-1,i))+", ";return r.substring(0,r.length-2)},A2=(t,e)=>Nn(t)?es.linearEasing()?`linear(${Kre(t,e)})`:Cr.easing:Wf(t)?Yre(t):t,Yre=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`});function RT(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}var TT,PT=ie(()=>{TT=t=>Array.isArray(t)?t:[t]});function aa(t){return Vf[t]&&(t=Vf[t]),mg(t)?gg(t):t}var yg=ie(()=>{pu()});var Kf,DT=ie(()=>{S2();yg();pu();Kf={get:(t,e)=>{e=aa(e);let r=Gf(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){let n=Si.get(e);n&&(r=n.initialValue)}return r},set:(t,e,r)=>{e=aa(e),Gf(e)?t.style.setProperty(e,r):t.style[e]=r}}});function vg(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}var I2=ie(()=>{});function bg(t,e){var r;let n=e?.toDefaultUnit||mr,i=t[t.length-1];if(Hf(i)){let o=((r=i.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";o&&(n=s=>s+o)}return n}var M2=ie(()=>{kr()});function Zre(){return window.__MOTION_DEV_TOOLS_RECORD}function NT(t,e,r,n={},i){let o=Zre(),s=n.record!==!1&&o,a,{duration:c=Cr.duration,delay:u=Cr.delay,endDelay:l=Cr.endDelay,repeat:h=Cr.repeat,easing:d=Cr.easing,persist:m=!1,direction:v,offset:x,allowWebkitAcceleration:O=!1}=n,I=dg(t),j=mg(e),k=es.waapi();j&&OT(t,e);let B=aa(e),V=ST(I.values,B),q=Si.get(B);return vg(V.animation,!(du(d)&&V.generator)&&n.record!==!1),()=>{let P=()=>{var M,N;return(N=(M=Kf.get(t,B))!==null&&M!==void 0?M:q?.initialValue)!==null&&N!==void 0?N:0},L=RT(TT(r),P),H=bg(L,q);if(du(d)){let M=d.createAnimation(L,e!=="opacity",P,B,V);d=M.easing,L=M.keyframes||L,c=M.duration||c}if(Gf(B)&&(es.cssRegisterProperty()?AT(B):k=!1),j&&!es.linearEasing()&&(Nn(d)||wi(d)&&d.some(Nn))&&(k=!1),k){q&&(L=L.map(F=>Yn(F)?q.toDefaultUnit(F):F)),L.length===1&&(!es.partialKeyframes()||s)&&L.unshift(P());let M={delay:Ei.ms(u),duration:Ei.ms(c),endDelay:Ei.ms(l),easing:wi(d)?void 0:A2(d,c),direction:v,iterations:h+1,fill:"both"};a=t.animate({[B]:L,offset:x,easing:wi(d)?d.map(F=>A2(F,c)):void 0},M),a.finished||(a.finished=new Promise((F,E)=>{a.onfinish=F,a.oncancel=E}));let N=L[L.length-1];a.finished.then(()=>{m||(Kf.set(t,B,N),a.cancel())}).catch($f),O||(a.playbackRate=1.000001)}else if(i&&j)L=L.map(M=>typeof M=="string"?parseFloat(M):M),L.length===1&&L.unshift(parseFloat(P())),a=new i(M=>{Kf.set(t,B,H?H(M):M)},L,Object.assign(Object.assign({},n),{duration:c,easing:d}));else{let M=L[L.length-1];Kf.set(t,B,q&&Yn(M)?q.toDefaultUnit(M):M)}return s&&o(t,e,L,{duration:c,delay:u,easing:d,repeat:h,offset:x},"motion-one"),V.setAnimation(a),a}}var kT=ie(()=>{E2();S2();kr();pu();MT();C2();PT();DT();yg();I2();M2()});var LT,jT=ie(()=>{LT=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t)});function BT(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||[])}var qT=ie(()=>{});var Jre,Yf,Qre,Xre,ene,R2=ie(()=>{kr();I2();Jre=t=>t(),Yf=(t,e,r=Cr.duration)=>new Proxy({animations:t.map(Jre).filter(Boolean),duration:r,options:e},Xre),Qre=t=>t.animations[0],Xre={get:(t,e)=>{let r=Qre(t);switch(e){case"duration":return t.duration;case"currentTime":return Ei.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(ene)).catch($f)),t.finished;case"stop":return()=>{t.animations.forEach(n=>vg(n))};case"forEachNative":return n=>{t.animations.forEach(i=>n(i,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(n=>n[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=Ei.ms(r);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=r;return!0}return!1}},ene=t=>t.finished});function FT(t,e,r){return Nn(t)?t(e,r):t}var UT=ie(()=>{kr()});function $T(t){return function(r,n,i={}){r=BT(r);let o=r.length;b2(Boolean(o),"No valid element provided."),b2(Boolean(n),"No keyframes defined.");let s=[];for(let a=0;a<o;a++){let c=r[a];for(let u in n){let l=LT(i,u);l.delay=FT(l.delay,a,o);let h=NT(c,u,n[u],l,t);s.push(h)}}return Yf(s,i,i.duration)}}var WT=ie(()=>{wT();kT();jT();qT();R2();UT()});var T2,HT=ie(()=>{v2();WT();T2=$T(sa)});var Sg=_((MDe,Eg)=>{var zT,VT,GT,KT,YT,ZT,JT,QT,XT,eP,tP,rP,nP,_g,P2,iP,oP,sP,gu,aP,cP,uP,lP,fP,hP,dP,pP,gP,wg;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){t(r(e,r(n)))}):typeof Eg=="object"&&typeof Eg.exports=="object"?t(r(e,r(Eg.exports))):t(r(e));function r(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(o,s){return n[o]=i?i(o,s):s}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])};zT=function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function o(){this.constructor=n}n.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)},VT=Object.assign||function(n){for(var i,o=1,s=arguments.length;o<s;o++){i=arguments[o];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])}return n},GT=function(n,i){var o={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&i.indexOf(s)<0&&(o[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(n);a<s.length;a++)i.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(n,s[a])&&(o[s[a]]=n[s[a]]);return o},KT=function(n,i,o,s){var a=arguments.length,c=a<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,o):s,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(n,i,o,s);else for(var l=n.length-1;l>=0;l--)(u=n[l])&&(c=(a<3?u(c):a>3?u(i,o,c):u(i,o))||c);return a>3&&c&&Object.defineProperty(i,o,c),c},YT=function(n,i){return function(o,s){i(o,s,n)}},ZT=function(n,i,o,s,a,c){function u(B){if(B!==void 0&&typeof B!="function")throw new TypeError("Function expected");return B}for(var l=s.kind,h=l==="getter"?"get":l==="setter"?"set":"value",d=!i&&n?s.static?n:n.prototype:null,m=i||(d?Object.getOwnPropertyDescriptor(d,s.name):{}),v,x=!1,O=o.length-1;O>=0;O--){var I={};for(var j in s)I[j]=j==="access"?{}:s[j];for(var j in s.access)I.access[j]=s.access[j];I.addInitializer=function(B){if(x)throw new TypeError("Cannot add initializers after decoration has completed");c.push(u(B||null))};var k=(0,o[O])(l==="accessor"?{get:m.get,set:m.set}:m[h],I);if(l==="accessor"){if(k===void 0)continue;if(k===null||typeof k!="object")throw new TypeError("Object expected");(v=u(k.get))&&(m.get=v),(v=u(k.set))&&(m.set=v),(v=u(k.init))&&a.push(v)}else(v=u(k))&&(l==="field"?a.push(v):m[h]=v)}d&&Object.defineProperty(d,s.name,m),x=!0},JT=function(n,i,o){for(var s=arguments.length>2,a=0;a<i.length;a++)o=s?i[a].call(n,o):i[a].call(n);return s?o:void 0},QT=function(n){return typeof n=="symbol"?n:"".concat(n)},XT=function(n,i,o){return typeof i=="symbol"&&(i=i.description?"[".concat(i.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:o?"".concat(o," ",i):i})},eP=function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},tP=function(n,i,o,s){function a(c){return c instanceof o?c:new o(function(u){u(c)})}return new(o||(o=Promise))(function(c,u){function l(m){try{d(s.next(m))}catch(v){u(v)}}function h(m){try{d(s.throw(m))}catch(v){u(v)}}function d(m){m.done?c(m.value):a(m.value).then(l,h)}d((s=s.apply(n,i||[])).next())})},rP=function(n,i){var o={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},s,a,c,u;return u={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function l(d){return function(m){return h([d,m])}}function h(d){if(s)throw new TypeError("Generator is already executing.");for(;u&&(u=0,d[0]&&(o=0)),o;)try{if(s=1,a&&(c=d[0]&2?a.return:d[0]?a.throw||((c=a.return)&&c.call(a),0):a.next)&&!(c=c.call(a,d[1])).done)return c;switch(a=0,c&&(d=[d[0]&2,c.value]),d[0]){case 0:case 1:c=d;break;case 4:return o.label++,{value:d[1],done:!1};case 5:o.label++,a=d[1],d=[0];continue;case 7:d=o.ops.pop(),o.trys.pop();continue;default:if(c=o.trys,!(c=c.length>0&&c[c.length-1])&&(d[0]===6||d[0]===2)){o=0;continue}if(d[0]===3&&(!c||d[1]>c[0]&&d[1]<c[3])){o.label=d[1];break}if(d[0]===6&&o.label<c[1]){o.label=c[1],c=d;break}if(c&&o.label<c[2]){o.label=c[2],o.ops.push(d);break}c[2]&&o.ops.pop(),o.trys.pop();continue}d=i.call(n,o)}catch(m){d=[6,m],a=0}finally{s=c=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},nP=function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&wg(i,n,o)},wg=Object.create?function(n,i,o,s){s===void 0&&(s=o);var a=Object.getOwnPropertyDescriptor(i,o);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,s,a)}:function(n,i,o,s){s===void 0&&(s=o),n[s]=i[o]},_g=function(n){var i=typeof Symbol=="function"&&Symbol.iterator,o=i&&n[i],s=0;if(o)return o.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},P2=function(n,i){var o=typeof Symbol=="function"&&n[Symbol.iterator];if(!o)return n;var s=o.call(n),a,c=[],u;try{for(;(i===void 0||i-- >0)&&!(a=s.next()).done;)c.push(a.value)}catch(l){u={error:l}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(u)throw u.error}}return c},iP=function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(P2(arguments[i]));return n},oP=function(){for(var n=0,i=0,o=arguments.length;i<o;i++)n+=arguments[i].length;for(var s=Array(n),a=0,i=0;i<o;i++)for(var c=arguments[i],u=0,l=c.length;u<l;u++,a++)s[a]=c[u];return s},sP=function(n,i,o){if(o||arguments.length===2)for(var s=0,a=i.length,c;s<a;s++)(c||!(s in i))&&(c||(c=Array.prototype.slice.call(i,0,s)),c[s]=i[s]);return n.concat(c||Array.prototype.slice.call(i))},gu=function(n){return this instanceof gu?(this.v=n,this):new gu(n)},aP=function(n,i,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=o.apply(n,i||[]),a,c=[];return a={},u("next"),u("throw"),u("return"),a[Symbol.asyncIterator]=function(){return this},a;function u(x){s[x]&&(a[x]=function(O){return new Promise(function(I,j){c.push([x,O,I,j])>1||l(x,O)})})}function l(x,O){try{h(s[x](O))}catch(I){v(c[0][3],I)}}function h(x){x.value instanceof gu?Promise.resolve(x.value.v).then(d,m):v(c[0][2],x)}function d(x){l("next",x)}function m(x){l("throw",x)}function v(x,O){x(O),c.shift(),c.length&&l(c[0][0],c[0][1])}},cP=function(n){var i,o;return i={},s("next"),s("throw",function(a){throw a}),s("return"),i[Symbol.iterator]=function(){return this},i;function s(a,c){i[a]=n[a]?function(u){return(o=!o)?{value:gu(n[a](u)),done:!1}:c?c(u):u}:c}},uP=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],o;return i?i.call(n):(n=typeof _g=="function"?_g(n):n[Symbol.iterator](),o={},s("next"),s("throw"),s("return"),o[Symbol.asyncIterator]=function(){return this},o);function s(c){o[c]=n[c]&&function(u){return new Promise(function(l,h){u=n[c](u),a(l,h,u.done,u.value)})}}function a(c,u,l,h){Promise.resolve(h).then(function(d){c({value:d,done:l})},u)}},lP=function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n};var r=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};fP=function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var o in n)o!=="default"&&Object.prototype.hasOwnProperty.call(n,o)&&wg(i,n,o);return r(i,n),i},hP=function(n){return n&&n.__esModule?n:{default:n}},dP=function(n,i,o,s){if(o==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!s:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?s:o==="a"?s.call(n):s?s.value:i.get(n)},pP=function(n,i,o,s,a){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!a:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?a.call(n,o):a?a.value=o:i.set(n,o),o},gP=function(n,i){if(i===null||typeof i!="object"&&typeof i!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?i===n:n.has(i)},t("__extends",zT),t("__assign",VT),t("__rest",GT),t("__decorate",KT),t("__param",YT),t("__esDecorate",ZT),t("__runInitializers",JT),t("__propKey",QT),t("__setFunctionName",XT),t("__metadata",eP),t("__awaiter",tP),t("__generator",rP),t("__exportStar",nP),t("__createBinding",wg),t("__values",_g),t("__read",P2),t("__spread",iP),t("__spreadArrays",oP),t("__spreadArray",sP),t("__await",gu),t("__asyncGenerator",aP),t("__asyncDelegator",cP),t("__asyncValues",uP),t("__makeTemplateObject",lP),t("__importStar",fP),t("__importDefault",hP),t("__classPrivateFieldGet",dP),t("__classPrivateFieldSet",pP),t("__classPrivateFieldIn",gP)})});function Zf(t,e,r){let n=Math.max(e-tne,0);return g2(r-t(n),e-n)}var tne,D2=ie(()=>{kr();tne=5});var ts,N2=ie(()=>{ts={stiffness:100,damping:10,mass:1}});var mP,yP=ie(()=>{N2();mP=(t=ts.stiffness,e=ts.damping,r=ts.mass)=>e/(2*Math.sqrt(t*r))});function vP(t,e,r){return t<e&&r>=e||t>e&&r<=e}var bP=ie(()=>{});var k2,_P=ie(()=>{kr();N2();yP();bP();D2();k2=({stiffness:t=ts.stiffness,damping:e=ts.damping,mass:r=ts.mass,from:n=0,to:i=1,velocity:o=0,restSpeed:s=2,restDistance:a=.5}={})=>{o=o?Ei.s(o):0;let c={done:!1,hasReachedTarget:!1,current:n,target:i},u=i-n,l=Math.sqrt(t/r)/1e3,h=mP(t,e,r),d;if(h<1){let m=l*Math.sqrt(1-h*h);d=v=>i-Math.exp(-h*l*v)*((-o+h*l*u)/m*Math.sin(m*v)+u*Math.cos(m*v))}else d=m=>i-Math.exp(-l*m)*(u+(-o+l*u)*m);return m=>{c.current=d(m);let v=m===0?o:Zf(d,m,c.current),x=Math.abs(v)<=s,O=Math.abs(i-c.current)<=a;return c.done=x&&O,c.hasReachedTarget=vP(n,i,c.current),c}}});function j2(t,e=mr){let r,n=L2,i=t(0),o=[e(i.current)];for(;!i.done&&n<rne;)i=t(n),o.push(e(i.done?i.target:i.current)),r===void 0&&i.hasReachedTarget&&(r=n),n+=L2;let s=n-L2;return o.length===1&&o.push(i.current),{keyframes:o,duration:s/1e3,overshootDuration:(r??s)/1e3}}var L2,rne,wP=ie(()=>{kr();L2=10,rne=1e4});var B2=ie(()=>{_P();wP();D2()});function EP(t){return Yn(t)&&!isNaN(t)}function q2(t){return Hf(t)?parseFloat(t):t}function SP(t){let e=new WeakMap;return(r={})=>{let n=new Map,i=(s=0,a=100,c=0,u=!1)=>{let l=`${s}-${a}-${c}-${u}`;return n.has(l)||n.set(l,t(Object.assign({from:s,to:a,velocity:c,restSpeed:u?.05:2,restDistance:u?.01:.5},r))),n.get(l)},o=(s,a)=>(e.has(s)||e.set(s,j2(s,a)),e.get(s));return{createAnimation:(s,a=!0,c,u,l)=>{let h,d,m,v=0,x=mr,O=s.length;if(a){x=bg(s,u?Si.get(aa(u)):void 0);let I=s[O-1];if(m=q2(I),O>1&&s[0]!==null)d=q2(s[0]);else{let j=l?.generator;if(j){let{animation:k,generatorStartTime:B}=l,V=k?.startTime||B||0,q=k?.currentTime||performance.now()-V,P=j(q).current;d=P,v=Zf(L=>j(L).current,q,P)}else c&&(d=q2(c()))}}if(EP(d)&&EP(m)){let I=i(d,m,v,u?.includes("scale"));h=Object.assign(Object.assign({},o(I,x)),{easing:"linear"}),l&&(l.generator=I,l.generatorStartTime=performance.now())}if(!h){let I=o(i(0,100));h={easing:"ease",duration:I.overshootDuration}}return h}}}}var xP=ie(()=>{B2();kr();M2();pu();yg()});var mu,OP=ie(()=>{B2();xP();mu=SP(k2)});var F2=ie(()=>{HT();OP();R2()});function nne(t,e={}){return Yf([()=>{let r=new sa(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function xi(t,e,r){return(Nn(t)?nne:T2)(t,e,r)}var CP=ie(()=>{F2();kr();v2()});var AP=ie(()=>{F2();_2();CP()});var un,IP=ie(()=>{ra();un=t=>t??cr});var MP=ie(()=>{IP()});var TP=_((bNe,RP)=>{RP.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var rs=_(ca=>{var U2,ine=[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];ca.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};ca.getSymbolTotalCodewords=function(e){return ine[e]};ca.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};ca.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');U2=e};ca.isKanjiModeEnabled=function(){return typeof U2<"u"};ca.toSJIS=function(e){return U2(e)}});var xg=_(kn=>{kn.L={bit:1};kn.M={bit:0};kn.Q={bit:3};kn.H={bit:2};function one(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return kn.L;case"m":case"medium":return kn.M;case"q":case"quartile":return kn.Q;case"h":case"high":return kn.H;default:throw new Error("Unknown EC Level: "+t)}}kn.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};kn.from=function(e,r){if(kn.isValid(e))return e;try{return one(e)}catch{return r}}});var NP=_((ENe,DP)=>{function PP(){this.buffer=[],this.length=0}PP.prototype={get:function(t){let 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){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};DP.exports=PP});var LP=_((SNe,kP)=>{function Jf(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)}Jf.prototype.set=function(t,e,r,n){let i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)};Jf.prototype.get=function(t,e){return this.data[t*this.size+e]};Jf.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};Jf.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};kP.exports=Jf});var jP=_(Og=>{var sne=rs().getSymbolSize;Og.getRowColCoords=function(e){if(e===1)return[];let r=Math.floor(e/7)+2,n=sne(e),i=n===145?26:Math.ceil((n-13)/(2*r-2))*2,o=[n-7];for(let s=1;s<r-1;s++)o[s]=o[s-1]-i;return o.push(6),o.reverse()};Og.getPositions=function(e){let r=[],n=Og.getRowColCoords(e),i=n.length;for(let o=0;o<i;o++)for(let s=0;s<i;s++)o===0&&s===0||o===0&&s===i-1||o===i-1&&s===0||r.push([n[o],n[s]]);return r}});var FP=_(qP=>{var ane=rs().getSymbolSize,BP=7;qP.getPositions=function(e){let r=ane(e);return[[0,0],[r-BP,0],[0,r-BP]]}});var UP=_(Bt=>{Bt.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var ua={N1:3,N2:3,N3:40,N4:10};Bt.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};Bt.from=function(e){return Bt.isValid(e)?parseInt(e,10):void 0};Bt.getPenaltyN1=function(e){let r=e.size,n=0,i=0,o=0,s=null,a=null;for(let c=0;c<r;c++){i=o=0,s=a=null;for(let u=0;u<r;u++){let l=e.get(c,u);l===s?i++:(i>=5&&(n+=ua.N1+(i-5)),s=l,i=1),l=e.get(u,c),l===a?o++:(o>=5&&(n+=ua.N1+(o-5)),a=l,o=1)}i>=5&&(n+=ua.N1+(i-5)),o>=5&&(n+=ua.N1+(o-5))}return n};Bt.getPenaltyN2=function(e){let r=e.size,n=0;for(let i=0;i<r-1;i++)for(let o=0;o<r-1;o++){let s=e.get(i,o)+e.get(i,o+1)+e.get(i+1,o)+e.get(i+1,o+1);(s===4||s===0)&&n++}return n*ua.N2};Bt.getPenaltyN3=function(e){let r=e.size,n=0,i=0,o=0;for(let s=0;s<r;s++){i=o=0;for(let a=0;a<r;a++)i=i<<1&2047|e.get(s,a),a>=10&&(i===1488||i===93)&&n++,o=o<<1&2047|e.get(a,s),a>=10&&(o===1488||o===93)&&n++}return n*ua.N3};Bt.getPenaltyN4=function(e){let r=0,n=e.data.length;for(let o=0;o<n;o++)r+=e.data[o];return Math.abs(Math.ceil(r*100/n/5)-10)*ua.N4};function cne(t,e,r){switch(t){case Bt.Patterns.PATTERN000:return(e+r)%2===0;case Bt.Patterns.PATTERN001:return e%2===0;case Bt.Patterns.PATTERN010:return r%3===0;case Bt.Patterns.PATTERN011:return(e+r)%3===0;case Bt.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2===0;case Bt.Patterns.PATTERN101:return e*r%2+e*r%3===0;case Bt.Patterns.PATTERN110:return(e*r%2+e*r%3)%2===0;case Bt.Patterns.PATTERN111:return(e*r%3+(e+r)%2)%2===0;default:throw new Error("bad maskPattern:"+t)}}Bt.applyMask=function(e,r){let n=r.size;for(let i=0;i<n;i++)for(let o=0;o<n;o++)r.isReserved(o,i)||r.xor(o,i,cne(e,o,i))};Bt.getBestMask=function(e,r){let n=Object.keys(Bt.Patterns).length,i=0,o=1/0;for(let s=0;s<n;s++){r(s),Bt.applyMask(s,e);let a=Bt.getPenaltyN1(e)+Bt.getPenaltyN2(e)+Bt.getPenaltyN3(e)+Bt.getPenaltyN4(e);Bt.applyMask(s,e),a<o&&(o=a,i=s)}return i}});var W2=_($2=>{var ns=xg(),Cg=[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],Ag=[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];$2.getBlocksCount=function(e,r){switch(r){case ns.L:return Cg[(e-1)*4+0];case ns.M:return Cg[(e-1)*4+1];case ns.Q:return Cg[(e-1)*4+2];case ns.H:return Cg[(e-1)*4+3];default:return}};$2.getTotalCodewordsCount=function(e,r){switch(r){case ns.L:return Ag[(e-1)*4+0];case ns.M:return Ag[(e-1)*4+1];case ns.Q:return Ag[(e-1)*4+2];case ns.H:return Ag[(e-1)*4+3];default:return}}});var $P=_(Mg=>{var Qf=new Uint8Array(512),Ig=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)Qf[r]=e,Ig[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)Qf[r]=Qf[r-255]})();Mg.log=function(e){if(e<1)throw new Error("log("+e+")");return Ig[e]};Mg.exp=function(e){return Qf[e]};Mg.mul=function(e,r){return e===0||r===0?0:Qf[Ig[e]+Ig[r]]}});var WP=_(Xf=>{var H2=$P();Xf.mul=function(e,r){let n=new Uint8Array(e.length+r.length-1);for(let i=0;i<e.length;i++)for(let o=0;o<r.length;o++)n[i+o]^=H2.mul(e[i],r[o]);return n};Xf.mod=function(e,r){let n=new Uint8Array(e);for(;n.length-r.length>=0;){let i=n[0];for(let s=0;s<r.length;s++)n[s]^=H2.mul(r[s],i);let o=0;for(;o<n.length&&n[o]===0;)o++;n=n.slice(o)}return n};Xf.generateECPolynomial=function(e){let r=new Uint8Array([1]);for(let n=0;n<e;n++)r=Xf.mul(r,new Uint8Array([1,H2.exp(n)]));return r}});var VP=_((RNe,zP)=>{var HP=WP();function z2(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}z2.prototype.initialize=function(e){this.degree=e,this.genPoly=HP.generateECPolynomial(this.degree)};z2.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let r=new Uint8Array(e.length+this.degree);r.set(e);let n=HP.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){let o=new Uint8Array(this.degree);return o.set(n,i),o}return n};zP.exports=z2});var V2=_(GP=>{GP.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}});var G2=_(Eo=>{var KP="[0-9]+",une="[A-Z $%*+\\-./:]+",eh="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";eh=eh.replace(/u/g,"\\u");var lne="(?:(?![A-Z0-9 $%*+\\-./:]|"+eh+`)(?:.|[\r
6
+ ]))+`;Eo.KANJI=new RegExp(eh,"g");Eo.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Eo.BYTE=new RegExp(lne,"g");Eo.NUMERIC=new RegExp(KP,"g");Eo.ALPHANUMERIC=new RegExp(une,"g");var fne=new RegExp("^"+eh+"$"),hne=new RegExp("^"+KP+"$"),dne=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Eo.testKanji=function(e){return fne.test(e)};Eo.testNumeric=function(e){return hne.test(e)};Eo.testAlphanumeric=function(e){return dne.test(e)}});var is=_(ur=>{var pne=V2(),K2=G2();ur.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]};ur.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]};ur.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]};ur.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]};ur.MIXED={bit:-1};ur.getCharCountIndicator=function(e,r){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!pne.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?e.ccBits[0]:r<27?e.ccBits[1]:e.ccBits[2]};ur.getBestModeForData=function(e){return K2.testNumeric(e)?ur.NUMERIC:K2.testAlphanumeric(e)?ur.ALPHANUMERIC:K2.testKanji(e)?ur.KANJI:ur.BYTE};ur.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")};ur.isValid=function(e){return e&&e.bit&&e.ccBits};function gne(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return ur.NUMERIC;case"alphanumeric":return ur.ALPHANUMERIC;case"kanji":return ur.KANJI;case"byte":return ur.BYTE;default:throw new Error("Unknown mode: "+t)}}ur.from=function(e,r){if(ur.isValid(e))return e;try{return gne(e)}catch{return r}}});var XP=_(la=>{var Rg=rs(),mne=W2(),YP=xg(),os=is(),Y2=V2(),JP=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,ZP=Rg.getBCHDigit(JP);function yne(t,e,r){for(let n=1;n<=40;n++)if(e<=la.getCapacity(n,r,t))return n}function QP(t,e){return os.getCharCountIndicator(t,e)+4}function vne(t,e){let r=0;return t.forEach(function(n){r+=QP(n.mode,e)+n.getBitsLength()}),r}function bne(t,e){for(let r=1;r<=40;r++)if(vne(t,r)<=la.getCapacity(r,e,os.MIXED))return r}la.from=function(e,r){return Y2.isValid(e)?parseInt(e,10):r};la.getCapacity=function(e,r,n){if(!Y2.isValid(e))throw new Error("Invalid QR Code version");typeof n>"u"&&(n=os.BYTE);let i=Rg.getSymbolTotalCodewords(e),o=mne.getTotalCodewordsCount(e,r),s=(i-o)*8;if(n===os.MIXED)return s;let a=s-QP(n,e);switch(n){case os.NUMERIC:return Math.floor(a/10*3);case os.ALPHANUMERIC:return Math.floor(a/11*2);case os.KANJI:return Math.floor(a/13);case os.BYTE:default:return Math.floor(a/8)}};la.getBestVersionForData=function(e,r){let n,i=YP.from(r,YP.M);if(Array.isArray(e)){if(e.length>1)return bne(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return yne(n.mode,n.getLength(),i)};la.getEncodedBits=function(e){if(!Y2.isValid(e)||e<7)throw new Error("Invalid QR Code version");let r=e<<12;for(;Rg.getBCHDigit(r)-ZP>=0;)r^=JP<<Rg.getBCHDigit(r)-ZP;return e<<12|r}});var nD=_(rD=>{var Z2=rs(),tD=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,_ne=1<<14|1<<12|1<<10|1<<4|1<<1,eD=Z2.getBCHDigit(tD);rD.getEncodedBits=function(e,r){let n=e.bit<<3|r,i=n<<10;for(;Z2.getBCHDigit(i)-eD>=0;)i^=tD<<Z2.getBCHDigit(i)-eD;return(n<<10|i)^_ne}});var oD=_((LNe,iD)=>{var wne=is();function yu(t){this.mode=wne.NUMERIC,this.data=t.toString()}yu.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};yu.prototype.getLength=function(){return this.data.length};yu.prototype.getBitsLength=function(){return yu.getBitsLength(this.data.length)};yu.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);let o=this.data.length-r;o>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,o*3+1))};iD.exports=yu});var aD=_((jNe,sD)=>{var Ene=is(),J2=["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 vu(t){this.mode=Ene.ALPHANUMERIC,this.data=t}vu.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};vu.prototype.getLength=function(){return this.data.length};vu.prototype.getBitsLength=function(){return vu.getBitsLength(this.data.length)};vu.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=J2.indexOf(this.data[r])*45;n+=J2.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(J2.indexOf(this.data[r]),6)};sD.exports=vu});var uD=_((BNe,cD)=>{"use strict";cD.exports=function(e){for(var r=[],n=e.length,i=0;i<n;i++){var o=e.charCodeAt(i);if(o>=55296&&o<=56319&&n>i+1){var s=e.charCodeAt(i+1);s>=56320&&s<=57343&&(o=(o-55296)*1024+s-56320+65536,i+=1)}if(o<128){r.push(o);continue}if(o<2048){r.push(o>>6|192),r.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){r.push(o>>12|224),r.push(o>>6&63|128),r.push(o&63|128);continue}if(o>=65536&&o<=1114111){r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer}});var fD=_((qNe,lD)=>{var Sne=uD(),xne=is();function bu(t){this.mode=xne.BYTE,typeof t=="string"&&(t=Sne(t)),this.data=new Uint8Array(t)}bu.getBitsLength=function(e){return e*8};bu.prototype.getLength=function(){return this.data.length};bu.prototype.getBitsLength=function(){return bu.getBitsLength(this.data.length)};bu.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};lD.exports=bu});var dD=_((FNe,hD)=>{var One=is(),Cne=rs();function _u(t){this.mode=One.KANJI,this.data=t}_u.getBitsLength=function(e){return e*13};_u.prototype.getLength=function(){return this.data.length};_u.prototype.getBitsLength=function(){return _u.getBitsLength(this.data.length)};_u.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=Cne.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]+`
7
+ Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};hD.exports=_u});var pD=_((UNe,Q2)=>{"use strict";var th={single_source_shortest_paths:function(t,e,r){var n={},i={};i[e]=0;var o=th.PriorityQueue.make();o.push(e,0);for(var s,a,c,u,l,h,d,m,v;!o.empty();){s=o.pop(),a=s.value,u=s.cost,l=t[a]||{};for(c in l)l.hasOwnProperty(c)&&(h=l[c],d=u+h,m=i[c],v=typeof i[c]>"u",(v||m>d)&&(i[c]=d,o.push(c,d),n[c]=a))}if(typeof r<"u"&&typeof i[r]>"u"){var x=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(x)}return n},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e,i;n;)r.push(n),i=t[n],n=t[n];return r.reverse(),r},find_path:function(t,e,r){var n=th.single_source_shortest_paths(t,e,r);return th.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(t){var e=th.PriorityQueue,r={},n;t=t||{};for(n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return r.queue=[],r.sorter=t.sorter||e.default_sorter,r},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof Q2<"u"&&(Q2.exports=th)});var ED=_(wu=>{var Qe=is(),yD=oD(),vD=aD(),bD=fD(),_D=dD(),rh=G2(),Tg=rs(),Ane=pD();function gD(t){return unescape(encodeURIComponent(t)).length}function nh(t,e,r){let n=[],i;for(;(i=t.exec(r))!==null;)n.push({data:i[0],index:i.index,mode:e,length:i[0].length});return n}function wD(t){let e=nh(rh.NUMERIC,Qe.NUMERIC,t),r=nh(rh.ALPHANUMERIC,Qe.ALPHANUMERIC,t),n,i;return Tg.isKanjiModeEnabled()?(n=nh(rh.BYTE,Qe.BYTE,t),i=nh(rh.KANJI,Qe.KANJI,t)):(n=nh(rh.BYTE_KANJI,Qe.BYTE,t),i=[]),e.concat(r,n,i).sort(function(s,a){return s.index-a.index}).map(function(s){return{data:s.data,mode:s.mode,length:s.length}})}function X2(t,e){switch(e){case Qe.NUMERIC:return yD.getBitsLength(t);case Qe.ALPHANUMERIC:return vD.getBitsLength(t);case Qe.KANJI:return _D.getBitsLength(t);case Qe.BYTE:return bD.getBitsLength(t)}}function Ine(t){return t.reduce(function(e,r){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===r.mode?(e[e.length-1].data+=r.data,e):(e.push(r),e)},[])}function Mne(t){let e=[];for(let r=0;r<t.length;r++){let n=t[r];switch(n.mode){case Qe.NUMERIC:e.push([n,{data:n.data,mode:Qe.ALPHANUMERIC,length:n.length},{data:n.data,mode:Qe.BYTE,length:n.length}]);break;case Qe.ALPHANUMERIC:e.push([n,{data:n.data,mode:Qe.BYTE,length:n.length}]);break;case Qe.KANJI:e.push([n,{data:n.data,mode:Qe.BYTE,length:gD(n.data)}]);break;case Qe.BYTE:e.push([{data:n.data,mode:Qe.BYTE,length:gD(n.data)}])}}return e}function Rne(t,e){let r={},n={start:{}},i=["start"];for(let o=0;o<t.length;o++){let s=t[o],a=[];for(let c=0;c<s.length;c++){let u=s[c],l=""+o+c;a.push(l),r[l]={node:u,lastCount:0},n[l]={};for(let h=0;h<i.length;h++){let d=i[h];r[d]&&r[d].node.mode===u.mode?(n[d][l]=X2(r[d].lastCount+u.length,u.mode)-X2(r[d].lastCount,u.mode),r[d].lastCount+=u.length):(r[d]&&(r[d].lastCount=u.length),n[d][l]=X2(u.length,u.mode)+4+Qe.getCharCountIndicator(u.mode,e))}}i=a}for(let o=0;o<i.length;o++)n[i[o]].end=0;return{map:n,table:r}}function mD(t,e){let r,n=Qe.getBestModeForData(t);if(r=Qe.from(e,n),r!==Qe.BYTE&&r.bit<n.bit)throw new Error('"'+t+'" cannot be encoded with mode '+Qe.toString(r)+`.
8
+ Suggested mode is: `+Qe.toString(n));switch(r===Qe.KANJI&&!Tg.isKanjiModeEnabled()&&(r=Qe.BYTE),r){case Qe.NUMERIC:return new yD(t);case Qe.ALPHANUMERIC:return new vD(t);case Qe.KANJI:return new _D(t);case Qe.BYTE:return new bD(t)}}wu.fromArray=function(e){return e.reduce(function(r,n){return typeof n=="string"?r.push(mD(n,null)):n.data&&r.push(mD(n.data,n.mode)),r},[])};wu.fromString=function(e,r){let n=wD(e,Tg.isKanjiModeEnabled()),i=Mne(n),o=Rne(i,r),s=Ane.find_path(o.map,"start","end"),a=[];for(let c=1;c<s.length-1;c++)a.push(o.table[s[c]].node);return wu.fromArray(Ine(a))};wu.rawSplit=function(e){return wu.fromArray(wD(e,Tg.isKanjiModeEnabled()))}});var xD=_(SD=>{var Dg=rs(),e3=xg(),Tne=NP(),Pne=LP(),Dne=jP(),Nne=FP(),n3=UP(),i3=W2(),kne=VP(),Pg=XP(),Lne=nD(),jne=is(),t3=ED();function Bne(t,e){let r=t.size,n=Nne.getPositions(e);for(let i=0;i<n.length;i++){let o=n[i][0],s=n[i][1];for(let a=-1;a<=7;a++)if(!(o+a<=-1||r<=o+a))for(let c=-1;c<=7;c++)s+c<=-1||r<=s+c||(a>=0&&a<=6&&(c===0||c===6)||c>=0&&c<=6&&(a===0||a===6)||a>=2&&a<=4&&c>=2&&c<=4?t.set(o+a,s+c,!0,!0):t.set(o+a,s+c,!1,!0))}}function qne(t){let e=t.size;for(let r=8;r<e-8;r++){let n=r%2===0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}function Fne(t,e){let r=Dne.getPositions(e);for(let n=0;n<r.length;n++){let i=r[n][0],o=r[n][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?t.set(i+s,o+a,!0,!0):t.set(i+s,o+a,!1,!0)}}function Une(t,e){let r=t.size,n=Pg.getEncodedBits(e),i,o,s;for(let a=0;a<18;a++)i=Math.floor(a/3),o=a%3+r-8-3,s=(n>>a&1)===1,t.set(i,o,s,!0),t.set(o,i,s,!0)}function r3(t,e,r){let n=t.size,i=Lne.getEncodedBits(e,r),o,s;for(o=0;o<15;o++)s=(i>>o&1)===1,o<6?t.set(o,8,s,!0):o<8?t.set(o+1,8,s,!0):t.set(n-15+o,8,s,!0),o<8?t.set(8,n-o-1,s,!0):o<9?t.set(8,15-o-1+1,s,!0):t.set(8,15-o-1,s,!0);t.set(n-8,8,1,!0)}function $ne(t,e){let r=t.size,n=-1,i=r-1,o=7,s=0;for(let a=r-1;a>0;a-=2)for(a===6&&a--;;){for(let c=0;c<2;c++)if(!t.isReserved(i,a-c)){let u=!1;s<e.length&&(u=(e[s]>>>o&1)===1),t.set(i,a-c,u),o--,o===-1&&(s++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function Wne(t,e,r){let n=new Tne;r.forEach(function(c){n.put(c.mode.bit,4),n.put(c.getLength(),jne.getCharCountIndicator(c.mode,t)),c.write(n)});let i=Dg.getSymbolTotalCodewords(t),o=i3.getTotalCodewordsCount(t,e),s=(i-o)*8;for(n.getLengthInBits()+4<=s&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);let a=(s-n.getLengthInBits())/8;for(let c=0;c<a;c++)n.put(c%2?17:236,8);return Hne(n,t,e)}function Hne(t,e,r){let n=Dg.getSymbolTotalCodewords(e),i=i3.getTotalCodewordsCount(e,r),o=n-i,s=i3.getBlocksCount(e,r),a=n%s,c=s-a,u=Math.floor(n/s),l=Math.floor(o/s),h=l+1,d=u-l,m=new kne(d),v=0,x=new Array(s),O=new Array(s),I=0,j=new Uint8Array(t.buffer);for(let P=0;P<s;P++){let L=P<c?l:h;x[P]=j.slice(v,v+L),O[P]=m.encode(x[P]),v+=L,I=Math.max(I,L)}let k=new Uint8Array(n),B=0,V,q;for(V=0;V<I;V++)for(q=0;q<s;q++)V<x[q].length&&(k[B++]=x[q][V]);for(V=0;V<d;V++)for(q=0;q<s;q++)k[B++]=O[q][V];return k}function zne(t,e,r,n){let i;if(Array.isArray(t))i=t3.fromArray(t);else if(typeof t=="string"){let u=e;if(!u){let l=t3.rawSplit(t);u=Pg.getBestVersionForData(l,r)}i=t3.fromString(t,u||40)}else throw new Error("Invalid data");let o=Pg.getBestVersionForData(i,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=o;else if(e<o)throw new Error(`
9
+ The chosen QR Code version cannot contain this amount of data.
10
+ Minimum version required to store current data is: `+o+`.
11
+ `);let s=Wne(e,r,i),a=Dg.getSymbolSize(e),c=new Pne(a);return Bne(c,e),qne(c),Fne(c,e),r3(c,r,0),e>=7&&Une(c,e),$ne(c,s),isNaN(n)&&(n=n3.getBestMask(c,r3.bind(null,c,r))),n3.applyMask(n,c),r3(c,r,n),{modules:c,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}SD.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=e3.M,i,o;return typeof r<"u"&&(n=e3.from(r.errorCorrectionLevel,e3.M),i=Pg.from(r.version),o=n3.from(r.maskPattern),r.toSJISFunc&&Dg.setToSJISFunction(r.toSJISFunc)),zne(e,i,n,o)}});var o3=_(fa=>{function OD(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||e.length===5||e.length>8)throw new Error("Invalid hex color: "+t);(e.length===3||e.length===4)&&(e=Array.prototype.concat.apply([],e.map(function(n){return[n,n]}))),e.length===6&&e.push("F","F");let r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+e.slice(0,6).join("")}}fa.getOptions=function(e){e||(e={}),e.color||(e.color={});let r=typeof e.margin>"u"||e.margin===null||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:n,scale:n?4:i,margin:r,color:{dark:OD(e.color.dark||"#000000ff"),light:OD(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}};fa.getScale=function(e,r){return r.width&&r.width>=e+r.margin*2?r.width/(e+r.margin*2):r.scale};fa.getImageWidth=function(e,r){let n=fa.getScale(e,r);return Math.floor((e+r.margin*2)*n)};fa.qrToImageData=function(e,r,n){let i=r.modules.size,o=r.modules.data,s=fa.getScale(i,n),a=Math.floor((i+n.margin*2)*s),c=n.margin*s,u=[n.color.light,n.color.dark];for(let l=0;l<a;l++)for(let h=0;h<a;h++){let d=(l*a+h)*4,m=n.color.light;if(l>=c&&h>=c&&l<a-c&&h<a-c){let v=Math.floor((l-c)/s),x=Math.floor((h-c)/s);m=u[o[v*i+x]?1:0]}e[d++]=m.r,e[d++]=m.g,e[d++]=m.b,e[d]=m.a}}});var CD=_(Ng=>{var s3=o3();function Vne(t,e,r){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=r,e.width=r,e.style.height=r+"px",e.style.width=r+"px"}function Gne(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}Ng.render=function(e,r,n){let i=n,o=r;typeof i>"u"&&(!r||!r.getContext)&&(i=r,r=void 0),r||(o=Gne()),i=s3.getOptions(i);let s=s3.getImageWidth(e.modules.size,i),a=o.getContext("2d"),c=a.createImageData(s,s);return s3.qrToImageData(c.data,e,i),Vne(a,o,s),a.putImageData(c,0,0),o};Ng.renderToDataURL=function(e,r,n){let i=n;typeof i>"u"&&(!r||!r.getContext)&&(i=r,r=void 0),i||(i={});let o=Ng.render(e,r,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}});var MD=_(ID=>{var Kne=o3();function AD(t,e){let r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function a3(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function Yne(t,e,r){let n="",i=0,o=!1,s=0;for(let a=0;a<t.length;a++){let c=Math.floor(a%e),u=Math.floor(a/e);!c&&!o&&(o=!0),t[a]?(s++,a>0&&c>0&&t[a-1]||(n+=o?a3("M",c+r,.5+u+r):a3("m",i,0),i=0,o=!1),c+1<e&&t[a+1]||(n+=a3("h",s),s=0)):i++}return n}ID.render=function(e,r,n){let i=Kne.getOptions(r),o=e.modules.size,s=e.modules.data,a=o+i.margin*2,c=i.color.light.a?"<path "+AD(i.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",u="<path "+AD(i.color.dark,"stroke")+' d="'+Yne(s,o,i.margin)+'"/>',l='viewBox="0 0 '+a+" "+a+'"',h=i.width?'width="'+i.width+'" height="'+i.width+'" ':"",d='<svg xmlns="http://www.w3.org/2000/svg" '+h+l+' shape-rendering="crispEdges">'+c+u+`</svg>
12
+ `;return typeof n=="function"&&n(null,d),d}});var TD=_(ih=>{var Zne=TP(),c3=xD(),RD=CD(),Jne=MD();function u3(t,e,r,n,i){let o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!Zne())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(i=r,r=e,e=n=void 0):s===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(r=e,e=n=void 0):s===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(c,u){try{let l=c3.create(r,n);c(t(l,e,n))}catch(l){u(l)}})}try{let c=c3.create(r,n);i(null,t(c,e,n))}catch(c){i(c)}}ih.create=c3.create;ih.toCanvas=u3.bind(null,RD.render);ih.toDataURL=u3.bind(null,RD.renderToDataURL);ih.toString=u3.bind(null,function(t,e,r){return Jne.render(t,r)})});var JD={};ir(JD,{W3mAccountButton:()=>_h,W3mConnectButton:()=>va,W3mCoreButton:()=>ba,W3mModal:()=>_a,W3mNetworkSwitch:()=>wa});function kD(){return{default:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(51,150,255)",background:"rgb(232,242,252)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(71,161,255)",background:"rgb(21,38,55)"}},magenta:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(198,83,128)",background:"rgb(244,221,230)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(203,77,140)",background:"rgb(57,35,43)"}},blue:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(61,92,245)",background:"rgb(232,235,252)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(81,109,251)",background:"rgb(28,33,59)"}},orange:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(234,140,46)",background:"rgb(244,236,221)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(255,166,76)",background:"rgb(57,50,34)"}},green:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(38,181,98)",background:"rgb(218,246,218)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(38,217,98)",background:"rgb(35,52,40)"}},purple:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(121,76,255)",background:"rgb(225,218,246)"},dark:{inverse:"rgb(255,255,255)",foreground:"rgb(144,110,247)",background:"rgb(36,31,51)"}},teal:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(43,182,182)",background:"rgb(217,242,238)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(54,226,226)",background:"rgb(29,48,52)"}},blackWhite:{light:{inverse:"rgb(255,255,255)",foreground:"rgb(20,20,20)",background:"rgb(255,255,255)"},dark:{inverse:"rgb(0,0,0)",foreground:"rgb(255,255,255)",background:"rgb(20,20,20)"}}}}function tie(){return{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"}}}function rie(){return{default:{1:"#B6B9C9",2:"#C653C6",3:"#794DFF",4:"#2EB8B8"},blue:{1:"#E8EBFD",2:"#C653C6",3:"#2DD2C5",4:"#3D5CF5"},magenta:{1:"#F4DDE6",2:"#E0D452",3:"#F09475",4:"#D1618D"},orange:{1:"#F4ECDD",2:"#B4EB47",3:"#3075E8",4:"#EB9947"},green:{1:"#DAF6DA",2:"#E06B92",3:"#99E54D",4:"#26B562"},purple:{1:"#E1DAF6",2:"#EB9947",3:"#E06B92",4:"#794DFF"},teal:{1:"#D9F2EE",2:"#F09475",3:"#794DFF",4:"#2EB8B8"},blackWhite:{1:"#E3E8E8",2:"#98AEAE",3:"#516767",4:"#242E2E"}}}function hie(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]}function LD(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g3(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+Vie}function Gie(t,e){let r=Array.prototype.slice.call(ZD.default.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,o,s)=>(s%n===0?i.push([o]):i[i.length-1].push(o))&&i,[])}var ZD,Qne,PD,Xne,eie,DD,ND,me,nie,iie,oie,kg,Eu,sie,aie,cie,oh,ha,uie,lie,fie,l3,sh,k3,die,Re,pie,Ci,Ea,gie,mie,jD,yie,vie,BD,bie,ue,_ie,wie,Eie,f3,qD,ah,Sie,xie,Oie,Cie,h3,Aie,Iie,Mie,Rie,d3,Tie,Pie,Die,ch,da,Nie,kie,Lie,p3,uh,jie,Bie,qie,FD,Lg,Fie,Uie,$ie,jg,Su,Wie,Hie,zie,UD,Bg,Vie,$D,So,Kie,Yie,Zie,Jie,lh,pa,Qie,Xie,eoe,WD,qg,toe,roe,noe,ioe,m3,ooe,soe,aoe,y3,fh,coe,uoe,loe,HD,Fg,foe,hoe,doe,ss,Oi,poe,goe,moe,v3,hh,yoe,voe,boe,zD,_h,_oe,woe,Eoe,b3,dh,Soe,xoe,Ooe,ph,ga,Coe,Aoe,Ioe,Moe,_3,Roe,Toe,Poe,gh,ma,Doe,Noe,koe,w3,mh,Loe,joe,Boe,Ug,va,qoe,Foe,yh,ba,Zn,Uoe,$oe,Woe,Hoe,E3,zoe,Voe,Goe,Koe,S3,Yoe,Zoe,Joe,Qoe,x3,Xoe,ese,tse,$g,_a,rse,nse,ise,Wg,wa,ose,sse,ase,cse,O3,use,lse,fse,VD,Hg,hse,dse,pse,gse,C3,mse,yse,vse,A3,bse,_se,wse,GD,zg,Ese,Sse,xse,Ose,I3,Cse,Ase,Ise,Mse,M3,Rse,Tse,Pse,R3,vh,Dse,Nse,kse,Lse,T3,jse,Bse,qse,P3,Fse,Use,$se,Wse,D3,Hse,zse,Vse,KD,Vg,Gse,Kse,Yse,bh,N3,ya,Zse,Jse,Qse,YD,Gg,QD=ie(()=>{qR();GR();Hw();QR();ra();AP();MP();ZD=ke(TD(),1),Qne=Object.defineProperty,PD=Object.getOwnPropertySymbols,Xne=Object.prototype.hasOwnProperty,eie=Object.prototype.propertyIsEnumerable,DD=(t,e,r)=>e in t?Qne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ND=(t,e)=>{for(var r in e||(e={}))Xne.call(e,r)&&DD(t,r,e[r]);if(PD)for(var r of PD(e))eie.call(e,r)&&DD(t,r,e[r]);return t};me={color(){var t,e;let r=(t=Kt.state.themeColor)!=null?t:"default",n=(e=Kt.state.themeMode)!=null?e:"dark",i=kD()[r][n],o=tie()[n],s=rie()[r];return{foreground:ND({accent:i.foreground,inverse:i.inverse},o.foreground),background:ND({accent:i.background},o.background),gradient:s,overlay:o.overlay,error:"rgb(242, 90, 103)"}},setTheme(){let t=document.querySelector(":root"),{themeZIndex:e}=Kt.state;if(t){let r={"--color-fg-accent":me.color().foreground.accent,"--color-fg-inverse":me.color().foreground.inverse,"--color-fg-1":me.color().foreground[1],"--color-fg-2":me.color().foreground[2],"--color-fg-3":me.color().foreground[3],"--color-bg-1":me.color().background[1],"--color-bg-2":me.color().background[2],"--color-bg-3":me.color().background[3],"--color-overlay":me.color().overlay,"--color-err":me.color().error,"--color-success":kD().green.light.foreground,"--gradient-1":me.color().gradient[1],"--gradient-2":me.color().gradient[2],"--gradient-3":me.color().gradient[3],"--gradient-4":me.color().gradient[4],"--modal-z-index":`${e}`};Object.entries(r).forEach(([n,i])=>t.style.setProperty(n,i))}},globalCss:Ce`*,::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}button::after{content:'';position:absolute;inset:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button w3m-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--color-fg-inverse);background:var(--color-fg-accent)}`},nie=Ce`button{display:flex;border-radius:10px;flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--color-overlay)}button>div{display:flex;justify-content:center;align-items:center;width:32px;height:32px;box-shadow:inset 0 0 0 1px var(--color-overlay);background-color:var(--color-fg-accent);border-radius:50%;margin-bottom:4px}button path{fill:var(--color-fg-inverse)}`,iie=Object.defineProperty,oie=Object.getOwnPropertyDescriptor,kg=(t,e,r,n)=>{for(var i=n>1?void 0:n?oie(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&iie(e,r,i),i},Eu=class extends _e{constructor(){super(...arguments),this.icon=void 0,this.label="",this.onClick=()=>null}render(){return J`<button @click="${this.onClick}"><div>${this.icon}</div><w3m-text variant="xsmall-normal" color="accent">${this.label}</w3m-text></button>`}};Eu.styles=[me.globalCss,nie],kg([Ae()],Eu.prototype,"icon",2),kg([Ae()],Eu.prototype,"label",2),kg([Ae()],Eu.prototype,"onClick",2),Eu=kg([Oe("w3m-box-button")],Eu);sie=Ce`button{border-radius:28px;height:28px;padding:0 10px;background-color:var(--color-fg-accent)}button path{fill:var(--color-fg-inverse)}button::after{border-radius:inherit;border:1px solid var(--color-overlay)}button:disabled::after{background-color:transparent}.w3m-icon-left svg{margin-right:5px}.w3m-icon-right svg{margin-left:5px}button:hover::after{background-color:var(--color-overlay)}button:disabled{background-color:var(--color-bg-3)}`,aie=Object.defineProperty,cie=Object.getOwnPropertyDescriptor,oh=(t,e,r,n)=>{for(var i=n>1?void 0:n?cie(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&aie(e,r,i),i},ha=class extends _e{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null}render(){let t={"w3m-icon-left":this.iconLeft!==void 0,"w3m-icon-right":this.iconRight!==void 0};return J`<button class="${Kr(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<w3m-text variant="small-normal" color="inverse"><slot></slot></w3m-text>${this.iconRight}</button>`}};ha.styles=[me.globalCss,sie],oh([Ae()],ha.prototype,"disabled",2),oh([Ae()],ha.prototype,"iconLeft",2),oh([Ae()],ha.prototype,"iconRight",2),oh([Ae()],ha.prototype,"onClick",2),ha=oh([Oe("w3m-button")],ha);uie=Ce`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:10px;color:var(--color-fg-inverse);background-color:var(--color-fg-accent)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--color-overlay)}button:hover::after{background-color:var(--color-overlay)}button:disabled{padding-bottom:0;background-color:var(--color-bg-3);color:var(--color-fg-3)}.w3m-secondary{color:var(--color-fg-accent);background-color:transparent}.w3m-secondary::after{display:none}`,lie=Object.defineProperty,fie=Object.getOwnPropertyDescriptor,l3=(t,e,r,n)=>{for(var i=n>1?void 0:n?fie(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&lie(e,r,i),i},sh=class extends _e{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){let t={"w3m-secondary":this.variant==="secondary"};return J`<button ?disabled="${this.disabled}" class="${Kr(t)}"><slot></slot></button>`}};sh.styles=[me.globalCss,uie],l3([Ae()],sh.prototype,"disabled",2),l3([Ae()],sh.prototype,"variant",2),sh=l3([Oe("w3m-button-big")],sh);k3=class{constructor(...e){this.angle=0,this.t=1253106,this.last=0,this.height=500,this.amp=300,this.seed=15,this.freqX=14e-5,this.freqY=29e-5,this.freqDelta=1e-5,this.activeColors=[1,1,1,1],this.isMetaKey=!1,this.playing=!1,LD(this,"resize",()=>{this.width=window.innerWidth,this.minigl.setSize(this.width,this.height),this.minigl.setOrthographicCamera(),this.xSegCount=Math.ceil(this.width*this.conf.density[0]),this.ySegCount=Math.ceil(this.height*this.conf.density[1]),this.mesh.geometry.setTopology(this.xSegCount,this.ySegCount),this.mesh.geometry.setSize(this.width,this.height),this.mesh.material.uniforms.u_shadow_power.value=this.width<550?5:6}),LD(this,"animate",r=>{if(this.playing){if(this.shouldSkipFrame(r)||(this.t+=Math.min(r-this.last,1e3/15),this.last=r,this.mesh.material.uniforms.u_time.value=this.t,this.minigl.render()),this.last!==0&&this.isStatic)return this.minigl.render();requestAnimationFrame(this.animate)}})}play(e){this.el=e,this.connect()}stop(){this.playing=!1}async connect(){this.shaderFiles={vertex:"varying vec3 v_color;void main(){float time=u_time*u_global.noiseSpeed;vec2 noiseCoord=resolution*uvNorm*u_global.noiseFreq;vec2 st=1.-uvNorm.xy;float tilt=resolution.y/2.0*uvNorm.y;float incline=resolution.x*uvNorm.x/2.0*u_vertDeform.incline;float offset=resolution.x/2.0*u_vertDeform.incline*mix(u_vertDeform.offsetBottom,u_vertDeform.offsetTop,uv.y);float noise=snoise(vec3(noiseCoord.x*u_vertDeform.noiseFreq.x+time*u_vertDeform.noiseFlow,noiseCoord.y*u_vertDeform.noiseFreq.y,time*u_vertDeform.noiseSpeed+u_vertDeform.noiseSeed))*u_vertDeform.noiseAmp;noise*=1.0-pow(abs(uvNorm.y),2.0);noise=max(0.0,noise);vec3 pos=vec3(position.x,position.y+tilt+incline+noise-offset,position.z);if(u_active_colors[0]==1.){v_color=u_baseColor;}for(int i=0;i<u_waveLayers_length;i++){if(u_active_colors[i+1]==1.){WaveLayers layer=u_waveLayers[i];float noise=smoothstep(layer.noiseFloor,layer.noiseCeil,snoise(vec3(noiseCoord.x*layer.noiseFreq.x+time*layer.noiseFlow,noiseCoord.y*layer.noiseFreq.y,time*layer.noiseSpeed+layer.noiseSeed))/2.0+0.5);v_color=blendNormal(v_color,layer.color,pow(noise,4.));}}gl_Position=projectionMatrix*modelViewMatrix*vec4(pos,1.0);}",noise:`
13
+ // MIT License: Copyright (C) 2011 Ashima Arts. All rights reserved. https://github.com/ashima/webgl-noise, https://github.com/stegu/webgl-noise
14
+ vec3 mod289(vec3 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 mod289(vec4 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 permute(vec4 x){return mod289(((x*34.0)+1.0)*x);}vec4 taylorInvSqrt(vec4 r){return 1.79284291400159-0.85373472095314*r;}float snoise(vec3 v){const vec2 C=vec2(1.0/6.0,1.0/3.0);const vec4 D=vec4(0.0,0.5,1.0,2.0);vec3 i=floor(v+dot(v,C.yyy));vec3 x0=v-i+dot(i,C.xxx);vec3 g=step(x0.yzx,x0.xyz);vec3 l=1.0-g;vec3 i1=min(g.xyz,l.zxy);vec3 i2=max(g.xyz,l.zxy);vec3 x1=x0-i1+C.xxx;vec3 x2=x0-i2+C.yyy;vec3 x3=x0-D.yyy;i=mod289(i);vec4 p=permute(permute(permute(i.z+vec4(0.0,i1.z,i2.z,1.0))+i.y+vec4(0.0,i1.y,i2.y,1.0))+i.x+vec4(0.0,i1.x,i2.x,1.0));float n_=0.142857142857;vec3 ns=n_*D.wyz-D.xzx;vec4 j=p-49.0*floor(p*ns.z*ns.z);vec4 x_=floor(j*ns.z);vec4 y_=floor(j-7.0*x_);vec4 x=x_*ns.x+ns.yyyy;vec4 y=y_*ns.x+ns.yyyy;vec4 h=1.0-abs(x)-abs(y);vec4 b0=vec4(x.xy,y.xy);vec4 b1=vec4(x.zw,y.zw);vec4 s0=floor(b0)*2.0+1.0;vec4 s1=floor(b1)*2.0+1.0;vec4 sh=-step(h,vec4(0.0));vec4 a0=b0.xzyw+s0.xzyw*sh.xxyy;vec4 a1=b1.xzyw+s1.xzyw*sh.zzww;vec3 p0=vec3(a0.xy,h.x);vec3 p1=vec3(a0.zw,h.y);vec3 p2=vec3(a1.xy,h.z);vec3 p3=vec3(a1.zw,h.w);vec4 norm=taylorInvSqrt(vec4(dot(p0,p0),dot(p1,p1),dot(p2,p2),dot(p3,p3)));p0*=norm.x;p1*=norm.y;p2*=norm.z;p3*=norm.w;vec4 m=max(0.6-vec4(dot(x0,x0),dot(x1,x1),dot(x2,x2),dot(x3,x3)),0.0);m=m*m;return 42.0*dot(m*m,vec4(dot(p0,x0),dot(p1,x1),dot(p2,x2),dot(p3,x3)));}`,blend:`
15
+ // MIT Licence: Copyright (C) 2015 Jamie Owen. All rights reserved. https://github.com/jamieowen/glsl-blend
16
+ vec3 blendNormal(vec3 base, vec3 blend){return blend;}vec3 blendNormal(vec3 base,vec3 blend,float opacity){return (blendNormal(base,blend)*opacity+base*(1.0-opacity));}float blendScreen(float base,float blend){return 1.0-((1.0-base)*(1.0-blend));}vec3 blendScreen(vec3 base,vec3 blend){return vec3(blendScreen(base.r,blend.r),blendScreen(base.g,blend.g),blendScreen(base.b,blend.b));}vec3 blendScreen(vec3 base,vec3 blend,float opacity){return (blendScreen(base, blend)*opacity+base*(1.0-opacity));}vec3 blendMultiply(vec3 base,vec3 blend){return base*blend;}vec3 blendMultiply(vec3 base,vec3 blend,float opacity){return (blendMultiply(base,blend)*opacity+base*(1.0-opacity));}float blendOverlay(float base,float blend){return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));}vec3 blendOverlay(vec3 base,vec3 blend){return vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b));}vec3 blendOverlay(vec3 base,vec3 blend,float opacity){return (blendOverlay(base,blend)*opacity+base*(1.0-opacity));}vec3 blendHardLight(vec3 base,vec3 blend){return blendOverlay(blend,base);}vec3 blendHardLight(vec3 base,vec3 blend,float opacity){return (blendHardLight(base,blend)*opacity+base*(1.0-opacity));}float blendSoftLight(float base,float blend){return (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend));}vec3 blendSoftLight(vec3 base,vec3 blend){return vec3(blendSoftLight(base.r,blend.r),blendSoftLight(base.g,blend.g),blendSoftLight(base.b,blend.b));}vec3 blendSoftLight(vec3 base,vec3 blend,float opacity){return (blendSoftLight(base,blend)*opacity+base*(1.0-opacity));}float blendColorDodge(float base,float blend){return (blend==1.0)?blend:min(base/(1.0-blend),1.0);}vec3 blendColorDodge(vec3 base,vec3 blend){return vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodge(base.b,blend.b));}vec3 blendColorDodge(vec3 base,vec3 blend,float opacity){return (blendColorDodge(base, blend)*opacity+base*(1.0-opacity));}float blendColorBurn(float base,float blend){return (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0);}vec3 blendColorBurn(vec3 base,vec3 blend){return vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b));}vec3 blendColorBurn(vec3 base,vec3 blend,float opacity){return (blendColorBurn(base, blend)*opacity+base*(1.0-opacity));}float blendVividLight(float base,float blend){return (blend<0.5)?blendColorBurn(base,(2.0*blend)):blendColorDodge(base,(2.0*(blend-0.5)));}vec3 blendVividLight(vec3 base,vec3 blend){return vec3(blendVividLight(base.r,blend.r),blendVividLight(base.g,blend.g),blendVividLight(base.b,blend.b));}vec3 blendVividLight(vec3 base,vec3 blend,float opacity){return (blendVividLight(base,blend)*opacity+base*(1.0-opacity));}float blendLighten(float base,float blend){return max(blend,base);}vec3 blendLighten(vec3 base,vec3 blend){return vec3(blendLighten(base.r,blend.r),blendLighten(base.g,blend.g),blendLighten(base.b,blend.b));}vec3 blendLighten(vec3 base,vec3 blend,float opacity){return (blendLighten(base,blend)*opacity+base*(1.0-opacity));}float blendLinearBurn(float base,float blend){return max(base+blend-1.0,0.0);}vec3 blendLinearBurn(vec3 base,vec3 blend){return max(base+blend-vec3(1.0),vec3(0.0));}vec3 blendLinearBurn(vec3 base,vec3 blend,float opacity){return (blendLinearBurn(base, blend)*opacity+base*(1.0-opacity));}float blendLinearDodge(float base,float blend){return min(base+blend,1.0);}vec3 blendLinearDodge(vec3 base,vec3 blend){return min(base+blend,vec3(1.0));}vec3 blendLinearDodge(vec3 base,vec3 blend,float opacity){return (blendLinearDodge(base,blend)*opacity+base*(1.0-opacity));}float blendLinearLight(float base,float blend){return blend<0.5?blendLinearBurn(base,(2.0*blend)):blendLinearDodge(base,(2.0*(blend-0.5)));}vec3 blendLinearLight(vec3 base,vec3 blend){return vec3(blendLinearLight(base.r,blend.r),blendLinearLight(base.g,blend.g),blendLinearLight(base.b,blend.b));}vec3 blendLinearLight(vec3 base,vec3 blend,float opacity){return (blendLinearLight(base,blend)*opacity+base*(1.0-opacity));}`,fragment:"varying vec3 v_color;void main(){vec3 color=v_color;if(u_darken_top==1.0){vec2 st=gl_FragCoord.xy/resolution.xy;color.g-=pow(st.y+sin(-12.0)*st.x,u_shadow_power)*0.4;}gl_FragColor=vec4(color,1.0);}"},this.conf={density:[.06,.16]},this.minigl=new die(this.el,null,null,!0),requestAnimationFrame(()=>{this.el&&(this.computedCanvasStyle=getComputedStyle(this.el),this.waitForCssVars())})}initMaterial(){this.uniforms={u_time:new this.minigl.Uniform({value:0}),u_shadow_power:new this.minigl.Uniform({value:5}),u_darken_top:new this.minigl.Uniform({value:this.el.dataset.jsDarkenTop===""?1:0}),u_active_colors:new this.minigl.Uniform({value:this.activeColors,type:"vec4"}),u_global:new this.minigl.Uniform({value:{noiseFreq:new this.minigl.Uniform({value:[this.freqX,this.freqY],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:5e-6})},type:"struct"}),u_vertDeform:new this.minigl.Uniform({value:{incline:new this.minigl.Uniform({value:Math.sin(this.angle)/Math.cos(this.angle)}),offsetTop:new this.minigl.Uniform({value:-.5}),offsetBottom:new this.minigl.Uniform({value:-.5}),noiseFreq:new this.minigl.Uniform({value:[3,4],type:"vec2"}),noiseAmp:new this.minigl.Uniform({value:this.amp}),noiseSpeed:new this.minigl.Uniform({value:10}),noiseFlow:new this.minigl.Uniform({value:3}),noiseSeed:new this.minigl.Uniform({value:this.seed})},type:"struct",excludeFrom:"fragment"}),u_baseColor:new this.minigl.Uniform({value:this.sectionColors[0],type:"vec3",excludeFrom:"fragment"}),u_waveLayers:new this.minigl.Uniform({value:[],excludeFrom:"fragment",type:"array"})};for(let e=1;e<this.sectionColors.length;e+=1)this.uniforms.u_waveLayers.value.push(new this.minigl.Uniform({value:{color:new this.minigl.Uniform({value:this.sectionColors[e],type:"vec3"}),noiseFreq:new this.minigl.Uniform({value:[2+e/this.sectionColors.length,3+e/this.sectionColors.length],type:"vec2"}),noiseSpeed:new this.minigl.Uniform({value:11+.3*e}),noiseFlow:new this.minigl.Uniform({value:6.5+.3*e}),noiseSeed:new this.minigl.Uniform({value:this.seed+10*e}),noiseFloor:new this.minigl.Uniform({value:.1}),noiseCeil:new this.minigl.Uniform({value:.63+.07*e})},type:"struct"}));return this.vertexShader=[this.shaderFiles.noise,this.shaderFiles.blend,this.shaderFiles.vertex].join(""),new this.minigl.Material(this.vertexShader,this.shaderFiles.fragment,this.uniforms)}initMesh(){this.material=this.initMaterial(),this.geometry=new this.minigl.PlaneGeometry,this.mesh=new this.minigl.Mesh(this.geometry,this.material)}shouldSkipFrame(e){return!!window.document.hidden||parseInt(e,10)%2==0||void 0}updateFrequency(e){this.freqX+=e,this.freqY+=e}toggleColor(e){this.activeColors[e]=this.activeColors[e]===0?1:0}init(){this.playing=!0,this.initGradientColors(),this.initMesh(),this.resize(),requestAnimationFrame(this.animate)}waitForCssVars(){this.computedCanvasStyle&&this.computedCanvasStyle.getPropertyValue("--gradient-1").indexOf("#")!==-1?this.init():this.init()}initGradientColors(){this.sectionColors=["--gradient-1","--gradient-2","--gradient-3","--gradient-4"].map(e=>{let r=this.computedCanvasStyle.getPropertyValue(e).trim();return r.length===4&&(r=`#${r.substr(1).split("").map(n=>n+n).join("")}`),r&&`0x${r.substr(1)}`}).filter(Boolean).map(hie)}};die=class{constructor(t,e,r){let n=this;n.canvas=t,n.gl=n.canvas.getContext("webgl",{antialias:!0}),n.meshes=[];let i=n.gl;e&&r&&this.setSize(e,r),Object.defineProperties(n,{Material:{enumerable:!1,value:class{constructor(s,a,c={}){let u=this;function l(m,v){let x=i.createShader(m);return i.shaderSource(x,v),i.compileShader(x),i.getShaderParameter(x,i.COMPILE_STATUS)||console.error(i.getShaderInfoLog(x)),x}function h(m,v){return Object.entries(m).map(([x,O])=>O.getDeclaration(x,v)).join("")}u.uniforms=c,u.uniformInstances=[];let d="precision highp float;";u.vertexSource=`${d} attribute vec4 position;attribute vec2 uv;attribute vec2 uvNorm;${h(n.commonUniforms,"vertex")} ${h(c,"vertex")} ${s}`,u.Source=`${d} ${h(n.commonUniforms,"fragment")} ${h(c,"fragment")} ${a} `,u.vertexShader=l(i.VERTEX_SHADER,u.vertexSource),u.fragmentShader=l(i.FRAGMENT_SHADER,u.Source),u.program=i.createProgram(),i.attachShader(u.program,u.vertexShader),i.attachShader(u.program,u.fragmentShader),i.linkProgram(u.program),i.getProgramParameter(u.program,i.LINK_STATUS)||console.error(i.getProgramInfoLog(u.program)),i.useProgram(u.program),u.attachUniforms(void 0,n.commonUniforms),u.attachUniforms(void 0,u.uniforms)}attachUniforms(s,a){let c=this;s===void 0?Object.entries(a).forEach(([u,l])=>{c.attachUniforms(u,l)}):a.type=="array"?a.value.forEach((u,l)=>c.attachUniforms(`${s}[${l}]`,u)):a.type=="struct"?Object.entries(a.value).forEach(([u,l])=>c.attachUniforms(`${s}.${u}`,l)):c.uniformInstances.push({uniform:a,location:i.getUniformLocation(c.program,s)})}}},Uniform:{enumerable:!1,value:class{constructor(s){this.type="float",Object.assign(this,s),this.typeFn={float:"1f",int:"1i",vec2:"2fv",vec3:"3fv",vec4:"4fv",mat4:"Matrix4fv"}[this.type]||"1f",this.update()}update(s){this.value!==void 0&&i[`uniform${this.typeFn}`](s,this.typeFn.indexOf("Matrix")===0?this.transpose:this.value,this.typeFn.indexOf("Matrix")===0?this.value:null)}getDeclaration(s,a,c){let u=this;if(u.excludeFrom!==a){if(u.type==="array")return u.value[0].getDeclaration(s,a,u.value.length)+`const int ${s}_length=${u.value.length};`;if(u.type==="struct"){let l=s.replace("u_","");return l=l.charAt(0).toUpperCase()+l.slice(1),`uniform struct ${l} {`+Object.entries(u.value).map(([h,d])=>d.getDeclaration(h,a).replace(/^uniform/,"")).join("")+`} ${s}${c>0?`[${c}]`:""};`}return`uniform ${u.type} ${s}${c>0?`[${c}]`:""};`}}}},PlaneGeometry:{enumerable:!1,value:class{constructor(s,a,c,u,l){i.createBuffer(),this.attributes={position:new n.Attribute({target:i.ARRAY_BUFFER,size:3}),uv:new n.Attribute({target:i.ARRAY_BUFFER,size:2}),uvNorm:new n.Attribute({target:i.ARRAY_BUFFER,size:2}),index:new n.Attribute({target:i.ELEMENT_ARRAY_BUFFER,size:3,type:i.UNSIGNED_SHORT})},this.setTopology(c,u),this.setSize(s,a,l)}setTopology(s=1,a=1){let c=this;c.xSegCount=s,c.ySegCount=a,c.vertexCount=(c.xSegCount+1)*(c.ySegCount+1),c.quadCount=c.xSegCount*c.ySegCount*2,c.attributes.uv.values=new Float32Array(2*c.vertexCount),c.attributes.uvNorm.values=new Float32Array(2*c.vertexCount),c.attributes.index.values=new Uint16Array(3*c.quadCount);for(let u=0;u<=c.ySegCount;u++)for(let l=0;l<=c.xSegCount;l++){let h=u*(c.xSegCount+1)+l;if(c.attributes.uv.values[2*h]=l/c.xSegCount,c.attributes.uv.values[2*h+1]=1-u/c.ySegCount,c.attributes.uvNorm.values[2*h]=l/c.xSegCount*2-1,c.attributes.uvNorm.values[2*h+1]=1-u/c.ySegCount*2,l<c.xSegCount&&u<c.ySegCount){let d=u*c.xSegCount+l;c.attributes.index.values[6*d]=h,c.attributes.index.values[6*d+1]=h+1+c.xSegCount,c.attributes.index.values[6*d+2]=h+1,c.attributes.index.values[6*d+3]=h+1,c.attributes.index.values[6*d+4]=h+1+c.xSegCount,c.attributes.index.values[6*d+5]=h+2+c.xSegCount}}c.attributes.uv.update(),c.attributes.uvNorm.update(),c.attributes.index.update()}setSize(s=1,a=1,c="xz"){let u=this;u.width=s,u.height=a,u.orientation=c,u.attributes.position.values&&u.attributes.position.values.length===3*u.vertexCount||(u.attributes.position.values=new Float32Array(3*u.vertexCount));let l=s/-2,h=a/-2,d=s/u.xSegCount,m=a/u.ySegCount;for(let v=0;v<=u.ySegCount;v++){let x=h+v*m;for(let O=0;O<=u.xSegCount;O++){let I=l+O*d,j=v*(u.xSegCount+1)+O;u.attributes.position.values[3*j+"xyz".indexOf(c[0])]=I,u.attributes.position.values[3*j+"xyz".indexOf(c[1])]=-x}}u.attributes.position.update()}}},Mesh:{enumerable:!1,value:class{constructor(s,a){let c=this;c.geometry=s,c.material=a,c.attributeInstances=[],Object.entries(c.geometry.attributes).forEach(([u,l])=>{c.attributeInstances.push({attribute:l,location:l.attach(u,c.material.program)})}),n.meshes.push(c)}draw(){i.useProgram(this.material.program),this.material.uniformInstances.forEach(({uniform:s,location:a})=>s.update(a)),this.attributeInstances.forEach(({attribute:s,location:a})=>s.use(a)),i.drawElements(i.TRIANGLES,this.geometry.attributes.index.values.length,i.UNSIGNED_SHORT,0)}remove(){n.meshes=n.meshes.filter(s=>s!=this)}}},Attribute:{enumerable:!1,value:class{constructor(s){this.type=i.FLOAT,this.normalized=!1,this.buffer=i.createBuffer(),Object.assign(this,s),this.update()}update(){this.values!==void 0&&(i.bindBuffer(this.target,this.buffer),i.bufferData(this.target,this.values,i.STATIC_DRAW))}attach(s,a){let c=i.getAttribLocation(a,s);return this.target===i.ARRAY_BUFFER&&(i.enableVertexAttribArray(c),i.vertexAttribPointer(c,this.size,this.type,this.normalized,0,0)),c}use(s){i.bindBuffer(this.target,this.buffer),this.target===i.ARRAY_BUFFER&&(i.enableVertexAttribArray(s),i.vertexAttribPointer(s,this.size,this.type,this.normalized,0,0))}}}});let o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];n.commonUniforms={projectionMatrix:new n.Uniform({type:"mat4",value:o}),modelViewMatrix:new n.Uniform({type:"mat4",value:o}),resolution:new n.Uniform({type:"vec2",value:[1,1]}),aspectRatio:new n.Uniform({type:"float",value:1})}}setSize(t=640,e=480){this.width=t,this.height=e,this.canvas.width=t,this.canvas.height=e,this.gl.viewport(0,0,t,e),this.commonUniforms.resolution.value=[t,e],this.commonUniforms.aspectRatio.value=t/e}setOrthographicCamera(t=0,e=0,r=0,n=-2e3,i=2e3){this.commonUniforms.projectionMatrix.value=[2/this.width,0,0,0,0,2/this.height,0,0,0,0,2/(n-i),0,t,e,r,1]}render(){this.gl.clearColor(0,0,0,0),this.gl.clearDepth(1),this.meshes.forEach(t=>t.draw())}},Re={CROSS_ICON:Pe`<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>`,NOISE_TEXTURE:Pe`<svg id="w3m-transparent-noise"><filter id="w3m-noise"><feTurbulence type="fractalNoise" baseFrequency="0.8"/></filter><rect width="100%" height="100%" filter="url(#w3m-noise)"/></svg>`,WALLET_CONNECT_LOGO:Pe`<svg width="178" height="29" viewBox="0 0 178 29" id="w3m-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:Pe`<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:Pe`<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:Pe`<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:Pe`<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:Pe`<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:Pe`<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:Pe`<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:Pe`<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:Pe`<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:Pe`<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:Pe`<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:Pe`<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:Pe`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,HELP_ETH_IMG:Pe`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#j)"><rect width="60" height="60" rx="30" fill="#987DE8"/><path fill-rule="evenodd" clip-rule="evenodd" d="m15.48 28.367 11.966-19.3c1.174-1.892 3.927-1.892 5.1 0l11.97 19.306a6 6 0 0 1 .9 3.142v.028a6 6 0 0 1-1.154 3.56L33.227 50.208c-1.599 2.188-4.864 2.188-6.461 0L15.733 35.095a6 6 0 0 1-1.154-3.538v-.029a6 6 0 0 1 .9-3.161Z" fill="#fff"/><path d="M30.84 10.112a.992.992 0 0 0-.844-.464V24.5l12.598 5.53c.081-.466-.001-.963-.27-1.398L30.84 10.112Z" fill="#643CDD"/><path d="M29.996 9.648a.991.991 0 0 0-.845.465l-11.489 18.53a1.991 1.991 0 0 0-.264 1.387l12.598-5.53V9.648Z" fill="#BDADEB"/><path d="M29.996 50.544a.994.994 0 0 0 .808-.41l11.235-15.38c.307-.434-.193-.988-.658-.72L31.49 39.71a2.998 2.998 0 0 1-1.494.398v10.437Z" fill="#643CDD"/><path d="M17.966 34.762 29.19 50.134c.2.274.503.41.807.41V40.108a2.998 2.998 0 0 1-1.493-.398l-9.884-5.676c-.468-.27-.971.292-.653.728Z" fill="#BDADEB"/><path d="M42.594 30.03 29.996 24.5v13.138a3 3 0 0 0 1.495-.399l10.149-5.83c.525-.31.856-.823.954-1.38Z" fill="#401AB3"/><path d="M29.996 37.638V24.462l-12.598 5.566c.098.564.437 1.083.974 1.392l10.13 5.82c.462.265.978.398 1.494.398Z" fill="#7C5AE2"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="29.5"/><defs><clipPath id="j"><rect width="60" height="60" rx="30" fill="#fff"/></clipPath></defs></svg>`,HELP_PAINTING_IMG:Pe`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#k)"><rect width="60" height="60" rx="3" fill="#C653C6"/><path d="M52.094 47.344c0-4.246-1.436-9.557-5.885-12.4a2.876 2.876 0 0 0-1.615-3.891v-.819a4.037 4.037 0 0 0-1.34-3.007 4.75 4.75 0 0 0-2.41-6.252v-5.506c0-6.248-5.065-11.313-11.313-11.313-6.247 0-11.312 5.065-11.312 11.313v2.152a3.343 3.343 0 0 0-1.18 5.045 4.738 4.738 0 0 0-1.633 3.584 4.73 4.73 0 0 0 .956 2.858 5.218 5.218 0 0 0-2.358 6.815c-3.06 4.129-6.098 8.298-6.098 15.64 0 2.668.364 4.856.731 6.385.184.765.368 1.366.509 1.78a12.721 12.721 0 0 0 .225.611l.015.037.005.011.001.004v.002h.001l.92-.393-.92.394.26.606h38.26l.291-.49-.86-.51.86.51v-.001l.002-.002.002-.005.01-.017.035-.06.127-.225c.108-.195.26-.477.441-.835.363-.714.845-1.732 1.328-2.953.959-2.427 1.945-5.725 1.945-9.068Z" fill="#E87DE8" stroke="#fff" stroke-width="2"/><path fill-rule="evenodd" clip-rule="evenodd" d="M26.5 29.5c-3-.5-5.5-3-5.503-7l.002-7c0-.466 0-.698.026-.893a3 3 0 0 1 2.582-2.582c.195-.026.428-.026.893-.026 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.398 0 2.097 0 2.648.229a3 3 0 0 1 1.624 1.623c.228.552.228 1.25.228 2.649v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.495 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z" fill="#fff"/></g><rect class="help-img-highlight" x=".5" y=".5" width="59" height="59" rx="2.5"/><defs><clipPath id="k"><rect width="60" height="60" rx="3" fill="#fff"/></clipPath></defs></svg>`,HELP_CHART_IMG:Pe`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#l)"><path d="M0 25.01C0 15.76 0 11.133 1.97 7.678a15 15 0 0 1 5.598-5.597C11.023.11 15.648.11 24.9.11h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.597C60 11.133 60 15.758 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a15 15 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a14.999 14.999 0 0 1-5.597-5.598C0 49.087 0 44.462 0 35.21v-10.2Z" fill="#1DC956"/><path d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z" stroke="#fff" stroke-opacity=".1"/><path d="M16.109 60c-3.833-.179-6.41-.645-8.541-1.86a15 15 0 0 1-5.598-5.598C.553 50.057.155 46.967.043 41.985l4.146-1.382a4 4 0 0 0 2.48-2.39l4.654-12.409a2 2 0 0 1 2.505-1.195l2.526.842a2 2 0 0 0 2.422-1.003l2.968-5.938c.81-1.62 3.185-1.415 3.705.32l3.774 12.581a2 2 0 0 0 3.025 1.09l3.342-2.228c.27-.18.49-.422.646-.706l5.297-9.712a2 2 0 0 1 1.428-1.016l4.134-.689a2 2 0 0 1 1.61.437l3.892 3.243a2 2 0 0 0 2.694-.122l4.633-4.632C60 19.28 60 21.88 60 25.01v10.2c0 9.252 0 13.877-1.97 17.332a14.998 14.998 0 0 1-5.598 5.598c-2.131 1.215-4.708 1.681-8.54 1.86H16.108Z" fill="#2BEE6C"/><path d="M.072 43.03a112.37 112.37 0 0 1-.048-2.093l3.85-1.283a3 3 0 0 0 1.86-1.793l4.653-12.408a3 3 0 0 1 3.758-1.793l2.526.842a1 1 0 0 0 1.21-.501l2.97-5.938c1.214-2.43 4.775-2.123 5.556.48l3.774 12.58a1 1 0 0 0 1.513.545l3.341-2.227a1 1 0 0 0 .323-.353l5.298-9.712a3 3 0 0 1 2.14-1.523l4.135-.69a3 3 0 0 1 2.414.655l3.892 3.244a1 1 0 0 0 1.347-.061l5.28-5.28c.046.845.077 1.752.097 2.732l-3.962 3.962a3 3 0 0 1-4.042.183l-3.893-3.243a1 1 0 0 0-.804-.218l-4.135.689a1 1 0 0 0-.714.507l-5.297 9.712c-.233.427-.565.79-.97 1.06l-3.34 2.228a3 3 0 0 1-4.538-1.635l-3.775-12.58c-.26-.868-1.447-.97-1.852-.16l-2.969 5.937a3 3 0 0 1-3.632 1.505l-2.526-.842a1 1 0 0 0-1.252.597L7.606 38.564a5 5 0 0 1-3.1 2.988L.072 43.029Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z" fill="#2BEE6C"/><path d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" fill="#fff"/><path d="M45 .283v59.654c-.63.042-1.294.074-2 .098V.185c.706.025 1.37.056 2 .098Z" fill="#fff"/><path class="help-img-highlight" d="M.5 25.01c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.289a14.5 14.5 0 0 1 5.412-5.41c1.639-.936 3.579-1.418 6.289-1.661C16.822.61 20.265.61 24.9.61h10.2c4.635 0 8.078 0 10.795.245 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.579 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.795-.244 2.71-.726 4.65-1.66 6.29a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.412C1.47 50.655.988 48.716.745 46.005.5 43.288.5 39.845.5 35.21v-10.2Z"/></g><defs><clipPath id="l"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_KEY_IMG:Pe`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#m)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M39.192 29.192c5.077-5.077 5.077-13.308 0-18.385-5.076-5.077-13.308-5.077-18.384 0-5.077 5.077-5.077 13.308 0 18.385l1.287 1.291c1.137 1.142 1.706 1.712 2.097 2.387.267.462.472.957.608 1.473.2.755.2 1.56.2 3.171V48.75c0 1.077 0 1.615.134 2.119a4 4 0 0 0 .407.984c.262.45.643.831 1.404 1.592l.294.295c.654.654.982.981 1.365 1.086.26.07.533.07.792 0 .383-.105.71-.432 1.365-1.086l3.478-3.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.478-.479c-.655-.654-.982-.981-1.087-1.365a1.5 1.5 0 0 1 0-.791c.105-.384.432-.711 1.087-1.365l.478-.479c.655-.654.982-.981 1.087-1.365a1.5 1.5 0 0 0 0-.791c-.105-.384-.432-.711-1.087-1.365l-.492-.493c-.65-.65-.974-.974-1.08-1.355a1.5 1.5 0 0 1-.003-.788c.102-.382.425-.71 1.069-1.364l5.46-5.547Z"/><circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="m"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,HELP_USER_IMG:Pe`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#n)"><rect width="60" height="60" fill="#00ACE6" rx="30"/><path fill="#1AC6FF" stroke="#fff" stroke-width="2" d="M59 73c0 16.016-12.984 29-29 29S1 89.016 1 73c0-16.017 11-29 29-29s29 12.983 29 29ZM18.69 19.902a11 11 0 0 1 9.281-8.692 14.842 14.842 0 0 1 4.058 0 11 11 0 0 1 9.28 8.692c.178.866.322 1.75.44 2.625.132.977.132 1.968 0 2.945a39.467 39.467 0 0 1-.44 2.625 11 11 0 0 1-9.28 8.692 14.862 14.862 0 0 1-4.058 0 11 11 0 0 1-9.28-8.692 39.467 39.467 0 0 1-.44-2.625 11.004 11.004 0 0 1 0-2.945c.118-.876.262-1.759.44-2.625Z"/><circle cx="24.5" cy="23.5" r="1.5" fill="#fff"/><circle cx="35.5" cy="23.5" r="1.5" fill="#fff"/><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m31 20-3 8h4"/></g><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/><defs><clipPath id="n"><rect width="60" height="60" fill="#fff" rx="30"/></clipPath></defs></svg>`,HELP_LOCK_IMG:Pe`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#C653C6" rx="3"/><path fill="#fff" d="M20.034 15.216C20 15.607 20 16.07 20 17v2.808c0 1.13 0 1.696-.2 2.11a1.78 1.78 0 0 1-.584.714c-.366.28-1.051.42-2.423.7a7.076 7.076 0 0 0-1.597.511 9.001 9.001 0 0 0-4.353 4.353C10 30.005 10 32.336 10 37c0 4.663 0 6.995.843 8.804a9.001 9.001 0 0 0 4.353 4.353C17.005 51 19.336 51 24 51h12c4.663 0 6.995 0 8.804-.843a9.001 9.001 0 0 0 4.353-4.353C50 43.995 50 41.664 50 37c0-4.663 0-6.995-.843-8.804a9.001 9.001 0 0 0-4.353-4.353 7.076 7.076 0 0 0-1.597-.511c-1.372-.28-2.057-.42-2.423-.7a1.78 1.78 0 0 1-.583-.715C40 21.505 40 20.94 40 19.809V17c0-.929 0-1.393-.034-1.784a9 9 0 0 0-8.182-8.182C31.393 7 30.93 7 30 7s-1.393 0-1.784.034a9 9 0 0 0-8.182 8.182Z"/><path fill="#E87DE8" d="M22 17c0-.929 0-1.393.044-1.784a7 7 0 0 1 6.172-6.172C28.606 9 29.071 9 30 9s1.393 0 1.784.044a7 7 0 0 1 6.172 6.172c.044.39.044.855.044 1.784v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.394-.077-1.78a4 4 0 0 0-3.143-3.143C31.394 12 30.93 12 30 12s-1.394 0-1.78.077a4 4 0 0 0-3.143 3.143C25 15.606 25 16.07 25 17v4.5a1.5 1.5 0 0 1-3 0V17Z"/><path fill="#E87DE8" fill-rule="evenodd" d="M12 36.62c0-4.317 0-6.476.92-8.088a7 7 0 0 1 2.612-2.612c1.612-.92 3.77-.92 8.088-.92h6.855c.469 0 .703 0 .906.017 2.73.222 4.364 2.438 4.619 4.983.27-2.698 2.111-5 5.015-5A6.985 6.985 0 0 1 48 31.985v5.395c0 4.317 0 6.476-.92 8.088a7 7 0 0 1-2.612 2.612c-1.612.92-3.77.92-8.088.92h-5.855c-.469 0-.703 0-.906-.017-2.73-.222-4.364-2.438-4.619-4.983-.258 2.583-1.943 4.818-4.714 4.99-.155.01-.335.01-.694.01-.55 0-.825 0-1.057-.015a7 7 0 0 1-6.52-6.52C12 42.233 12 41.958 12 41.408V36.62Zm21.24-.273a4 4 0 1 0-6.478 0c.985 1.36 1.479 2.039 1.564 2.229.178.398.176.818.174 1.247V42.5a1.5 1.5 0 0 0 3 0v-2.677c-.002-.429-.004-.85.174-1.247.085-.19.579-.87 1.565-2.229Z" clip-rule="evenodd"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_COMPAS_IMG:Pe`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#1DC956" rx="30"/><circle cx="30" cy="29.999" r="3" fill="#fff"/><path fill="#2BEE6C" stroke="#fff" stroke-width="2" d="m45.316 17.9-.88-.425.88.424a7.9 7.9 0 0 1 .026-.053c.093-.192.21-.432.26-.687l-.819-.162.819.162a2 2 0 0 0-.239-1.405c-.132-.224-.32-.412-.472-.562a8.415 8.415 0 0 1-.042-.042l-.042-.042c-.15-.151-.338-.34-.562-.472l-.508.862.508-.862a2 2 0 0 0-1.405-.239c-.255.05-.495.167-.687.26l-.053.026-15.05 7.246-.108.052c-1.131.545-1.843.887-2.456 1.374a6.994 6.994 0 0 0-1.13 1.13c-.487.613-.83 1.325-1.375 2.457l-.051.108-7.247 15.05-.025.053c-.094.192-.21.431-.26.686a2 2 0 0 0 .239 1.406l.855-.505-.856.505c.133.224.321.411.473.562l.042.042.041.042c.15.151.338.34.563.472a2 2 0 0 0 1.405.239l-.195-.981.195.98c.255-.05.494-.166.686-.26l.054-.025-.419-.87.419.87 15.05-7.247.107-.051c1.132-.545 1.844-.888 2.457-1.374a7.002 7.002 0 0 0 1.13-1.13c.487-.614.83-1.325 1.374-2.457l.052-.108 7.246-15.05Z"/><path fill="#1DC956" d="m33.376 32.723-2.669-3.43-14.85 14.849.206.205a1 1 0 0 0 1.141.194l15.105-7.273a3 3 0 0 0 1.067-4.545Z"/><path fill="#86F999" d="m26.624 27.276 2.669 3.43 14.85-14.849-.206-.205a1 1 0 0 0-1.141-.194L27.69 22.731a3 3 0 0 0-1.067 4.545Z"/><circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="29.5"/></svg>`,HELP_NOUN_IMG:Pe`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><rect width="60" height="60" fill="#794CFF" rx="3"/><path fill="#987DE8" stroke="#fff" stroke-width="2" d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z"/><path fill="#fff" d="M37.5 25h10v10h-10z"/><path fill="#4019B2" d="M42.5 25h5v10h-5z"/><path fill="#fff" d="M19.5 25h10v10h-10z"/><path fill="#4019B2" d="M24.5 25h5v10h-5z"/><path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z"/><rect class="help-img-highlight" width="59" height="59" x=".5" y=".5" rx="2.5"/></svg>`,HELP_DAO_IMG:Pe`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#o)"><path fill="#EB8B47" d="M0 24.9c0-9.252 0-13.878 1.97-17.332A15 15 0 0 1 7.569 1.97C11.023 0 15.648 0 24.9 0h10.2c9.251 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.022 60 15.648 60 24.899v10.2c0 9.252 0 13.878-1.97 17.332a15.001 15.001 0 0 1-5.598 5.598c-3.455 1.97-8.08 1.97-17.332 1.97H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.351 0 35.1V24.9Z"/><path class="help-img-highlight" d="M.5 24.9c0-4.635 0-8.078.244-10.795.244-2.71.726-4.65 1.66-6.29a14.5 14.5 0 0 1 5.412-5.41C9.455 1.468 11.395.986 14.105.743 16.822.5 20.265.5 24.9.5h10.2c4.635 0 8.078 0 10.795.244 2.71.243 4.65.725 6.29 1.66a14.5 14.5 0 0 1 5.41 5.411c.935 1.64 1.417 3.58 1.66 6.29.244 2.717.245 6.16.245 10.794v10.2c0 4.635 0 8.078-.244 10.796-.244 2.71-.726 4.65-1.66 6.289a14.5 14.5 0 0 1-5.412 5.41c-1.639.936-3.579 1.418-6.289 1.661-2.717.244-6.16.244-10.795.244H24.9c-4.635 0-8.078 0-10.795-.244-2.71-.243-4.65-.725-6.29-1.66a14.5 14.5 0 0 1-5.41-5.411c-.935-1.64-1.417-3.58-1.66-6.29C.5 43.178.5 39.734.5 35.1V24.9Z"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M19 52c5.523 0 10-4.477 10-10s-4.477-10-10-10S9 36.477 9 42s4.477 10 10 10Z"/><path fill="#fff" fill-rule="evenodd" d="M42.844 8.326a1 1 0 0 0-1.687 0L28.978 27.463A1 1 0 0 0 29.822 29h24.357a1 1 0 0 0 .843-1.537L42.844 8.326Z" clip-rule="evenodd"/><path fill="#FF974C" fill-rule="evenodd" d="M42.335 11.646c.324.115.571.504 1.066 1.28l7.332 11.523c.562.883.843 1.325.792 1.69a1 1 0 0 1-.342.623c-.28.238-.803.238-1.85.238H34.667c-1.047 0-1.57 0-1.85-.238a1 1 0 0 1-.342-.623c-.051-.365.23-.806.792-1.69l7.332-11.523c.495-.776.742-1.165 1.066-1.28a1 1 0 0 1 .67 0ZM35 27a7 7 0 0 0 7-7 7 7 0 0 0 7 7H35Z" clip-rule="evenodd"/><path fill="#FF974C" stroke="#fff" stroke-width="2" d="M10.106 9.357c-.109.32-.107.682-.106.975V25.668c-.001.293-.003.654.106.975a2 2 0 0 0 1.251 1.25c.32.11.682.108.975.107H19c5.523 0 10-4.477 10-10S24.523 8 19 8h-6.668c-.293-.001-.654-.003-.975.106a2 2 0 0 0-1.25 1.251Z"/><circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/><circle cx="19" cy="41.999" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2"/></g><defs><clipPath id="o"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,SEARCH_ICON:Pe`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,HELP_ICON:Pe`<svg width="11" height="17" viewBox="0 0 11 17"><path fill="#fff" d="M5.22 2.97c-1.07 0-2.25.843-2.25 2.25a.75.75 0 0 1-1.5 0c0-2.393 2.019-3.75 3.75-3.75 1.73 0 3.75 1.357 3.75 3.75 0 1.64-1.038 2.466-1.785 3.057-.802.635-1.215.984-1.215 1.693a.75.75 0 1 1-1.5 0c0-1.466.985-2.24 1.681-2.788l.103-.081C7.007 6.504 7.47 6.08 7.47 5.22c0-1.407-1.181-2.25-2.25-2.25ZM5.22 14.97a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"/></svg>`,WALLET_ICON:Pe`<svg width="15" height="14" fill="none" viewBox="0 0 15 14"><path fill="#fff" fill-rule="evenodd" d="M.64 9.2v-3h.001c.009-1.857.07-2.886.525-3.682a4 4 0 0 1 1.492-1.493C3.58.5 4.813.5 7.28.5h3.735c.58 0 .871 0 1.114.04A3 3 0 0 1 14.6 3.011c.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041h-.777c.178.307.302.648.362 1.011.04.243.04.533.04 1.114 0 .58 0 .871-.04 1.114a3 3 0 0 1-2.471 2.47c-.243.041-.533.041-1.114.041H4.507A3.867 3.867 0 0 1 .64 9.633V9.2ZM7.28 2h3.735c.64 0 .779.005.87.02a1.5 1.5 0 0 1 1.235 1.236c.015.09.02.229.02.869s-.005.779-.02.87a1.5 1.5 0 0 1-1.236 1.235c-.09.015-.229.02-.869.02H4.023c-.697 0-1.345.21-1.883.572V6.25h.001c.004-.791.015-1.383.059-1.867.056-.629.157-.926.269-1.122a2.5 2.5 0 0 1 .932-.933c.197-.111.494-.212 1.123-.268C5.173 2 6.019 2 7.28 2Zm-.265 5.75H4.023c-1.04 0-1.883.843-1.883 1.883A2.367 2.367 0 0 0 4.507 12h2.508c.64 0 .779-.005.87-.02a1.5 1.5 0 0 0 1.235-1.236c.015-.09.02-.229.02-.869s-.005-.779-.02-.87A1.5 1.5 0 0 0 7.884 7.77c-.09-.015-.228-.02-.869-.02Z" clip-rule="evenodd"/></svg>`,NETWORK_PLACEHOLDER:Pe`<svg width="28" height="28" fill="none" viewBox="0 0 28 28"><mask id="p" width="26" height="28" x="1" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#D9D9D9" d="M12 1.172a4 4 0 0 1 4 0l8.124 4.69a4 4 0 0 1 2 3.465v9.381a4 4 0 0 1-2 3.464L16 26.862a4 4 0 0 1-4 0l-8.124-4.69a4 4 0 0 1-2-3.464V9.327a4 4 0 0 1 2-3.464L12 1.173Z"/></mask><g mask="url(#p)"><path id="network-placeholder-fill" fill="#fff" d="M0 0h28v28H0z"/><path id="network-placeholder-dash" stroke="#000" stroke-dasharray="2 2" d="m8.953 2.931 2.032-1.173.25.433 1.015-.586c.269-.155.553-.271.844-.35l-.13-.483a4.003 4.003 0 0 1 2.071 0l-.13.483c.293.079.576.195.845.35l1.016.586.25-.433 2.03 1.173-.25.433 2.032 1.173.25-.433 2.03 1.172-.25.433 1.016.587c.269.155.512.342.725.556l.354-.354a4.003 4.003 0 0 1 1.035 1.794l-.483.129c.078.292.12.596.12.906v1.172h.5v2.346h-.5v2.345h.5v2.345h-.5v1.173c0 .31-.042.614-.12.906l.483.13a4.003 4.003 0 0 1-1.035 1.793l-.354-.354a3.498 3.498 0 0 1-.725.556l-1.015.586.25.434-2.031 1.172-.25-.433-2.031 1.173.25.433-2.031 1.172-.25-.433-1.016.587a3.494 3.494 0 0 1-.844.35l.13.482a4.003 4.003 0 0 1-2.071 0l.13-.483a3.496 3.496 0 0 1-.845-.35l-1.015-.586-.25.433-2.032-1.172.25-.433-2.03-1.173-.25.433L4.89 22.76l.25-.434-1.015-.586a3.498 3.498 0 0 1-.725-.556l-.354.354a4.003 4.003 0 0 1-1.035-1.794l.483-.13a3.497 3.497 0 0 1-.12-.905v-1.173h-.5V15.19h.5v-2.345h-.5v-2.346h.5V9.327c0-.31.042-.614.12-.906l-.483-.13a4.003 4.003 0 0 1 1.035-1.793l.354.354c.213-.214.456-.401.725-.556l1.015-.587-.25-.433 2.031-1.172.25.433 2.031-1.173-.25-.433Z"/><path fill="#798686" stroke="#fff" d="M14.243 13.563 14 13.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.538.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.538-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#9EA9A9" stroke="#fff" d="M14.243 8.563 14 8.428l-.243.135-6.388 3.549-.024.013c-.432.24-.79.44-1.053.622-.266.184-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.316.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722l-.468-.177.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.316-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-6.388-3.55Z"/><path fill="#C9CFCF" stroke="#fff" d="m22.344 9.53-.468-.176.468.177a1.5 1.5 0 0 0 0-1.062l-.468.177.468-.177c-.12-.317-.37-.537-.636-.722-.263-.183-.62-.382-1.053-.622l-.024-.013-3.163-1.758-.09-.05c-1.163-.645-1.856-1.03-2.606-1.161a4.5 4.5 0 0 0-1.544 0c-.75.13-1.443.516-2.607 1.162l-.088.05-3.164 1.757-.024.013c-.432.24-.79.44-1.053.622-.266.185-.516.405-.636.722a1.5 1.5 0 0 0 0 1.062c.12.317.37.537.636.722.263.183.62.382 1.053.622l.024.013 3.164 1.758.088.049c1.164.646 1.857 1.032 2.607 1.162.51.09 1.033.09 1.544 0 .75-.13 1.443-.516 2.606-1.162l.09-.05 3.163-1.757.024-.013c.432-.24.79-.44 1.053-.622.266-.184.516-.405.636-.722Z"/></g></svg>`,WALLET_PLACEHOLDER:Pe`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,TOKEN_PLACEHOLDER:Pe`<svg width="60" height="60" viewBox="0 0 60 60" fill="none"><rect id="token-placeholder-fill" width="58" height="58" x="1" y="1" fill="#fff" rx="29"/><path fill="#3B4040" stroke="#fff" stroke-width="2" d="M32 10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v5.566c0 .357.192.685.495.875a16.001 16.001 0 0 1 4.256 3.894c.667.88.33 2.113-.627 2.665l-2.494 1.44c-.956.552-2.166.204-2.913-.609a9.12 9.12 0 1 0 .064 12.267c.739-.82 1.945-1.181 2.907-.64l2.509 1.415c.962.542 1.312 1.77.654 2.658a16 16 0 0 1-4.356 4.028c-.303.19-.495.518-.495.875V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-2.992c0-.602-.528-1.065-1.13-1.032-.579.032-1.16.032-1.74 0-.602-.032-1.13.43-1.13 1.032V50a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-5.566c0-.357-.192-.685-.495-.875a16 16 0 0 1 0-27.118c.303-.19.495-.517.495-.875V10a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2.992c0 .601.528 1.064 1.13 1.032.58-.032 1.161-.032 1.74 0 .602.033 1.13-.43 1.13-1.032V10Z"/><rect id="token-placeholder-dash" width="58" height="58" x="1" y="1" stroke="#000" stroke-dasharray="6 6" stroke-width="2" rx="29"/></svg>`,ACCOUNT_COPY:Pe`<svg width="14" height="14" fill="none" viewBox="0 0 14 14"><path fill="#fff" fill-rule="evenodd" d="M4.003 4.005c.012-1.225.074-1.936.391-2.491a3 3 0 0 1 1.12-1.12C6.204 0 7.136 0 9 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C14 2.204 14 3.136 14 5s0 2.795-.394 3.486a3 3 0 0 1-1.12 1.12c-.555.317-1.266.379-2.491.391l.002.003c-.012 1.222-.075 1.932-.391 2.486a3 3 0 0 1-1.12 1.12C7.796 14 6.864 14 5 14s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C0 11.796 0 10.864 0 9s0-2.795.394-3.486a3 3 0 0 1 1.12-1.12c.554-.316 1.264-.379 2.486-.391l.003.002ZM9 8.5c-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.045-.08-.113-.243-.154-.693C5.501 6.58 5.5 5.959 5.5 5c0-.959.001-1.58.043-2.05.04-.45.109-.613.154-.693a1.5 1.5 0 0 1 .56-.56c.08-.045.243-.113.693-.154C7.42 1.501 8.041 1.5 9 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.045.08.113.243.154.693.042.47.043 1.091.043 2.05 0 .959-.001 1.58-.043 2.05-.04.45-.109.613-.154.693a1.5 1.5 0 0 1-.56.56c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043ZM4 5.503a13.77 13.77 0 0 0-1.05.04c-.45.04-.613.109-.693.154a1.5 1.5 0 0 0-.56.56c-.045.08-.113.243-.154.693C1.501 7.42 1.5 8.041 1.5 9c0 .959.001 1.58.043 2.05.04.45.109.613.154.693a1.5 1.5 0 0 0 .56.56c.08.045.243.113.693.154.47.042 1.091.043 2.05.043.959 0 1.58-.001 2.05-.043.45-.04.613-.109.693-.154a1.5 1.5 0 0 0 .56-.56c.045-.08.113-.242.154-.693.025-.283.035-.619.04-1.05-1.534-.003-2.358-.037-2.983-.394a3 3 0 0 1-1.12-1.12c-.357-.625-.39-1.449-.394-2.983Z" clip-rule="evenodd"/></svg>`,ACCOUNT_DISCONNECT:Pe`<svg width="16" height="14" fill="none" viewBox="0 0 16 14"><path fill="#fff" d="M9.677 1.5h-2.61c-1.261 0-2.107.001-2.757.06-.629.056-.926.157-1.122.268a2.5 2.5 0 0 0-.933.933c-.112.196-.212.493-.269 1.122-.058.65-.06 1.496-.06 2.757v.72c0 1.26.002 2.107.06 2.756.057.63.157.927.27 1.123a2.5 2.5 0 0 0 .932.933c.196.111.493.212 1.122.268.65.059 1.496.06 2.757.06h2.61a.75.75 0 1 1 0 1.5h-2.61c-2.467 0-3.7 0-4.622-.525a4 4 0 0 1-1.493-1.493C.427 11.06.427 9.827.427 7.36v-.72c0-2.467 0-3.7.525-4.622A4 4 0 0 1 2.445.525C3.366 0 4.6 0 7.067 0h2.61a.75.75 0 1 1 0 1.5Z"/><path fill="#fff" d="M10.896 11.03a.75.75 0 0 1 0-1.06l1.793-1.793a.25.25 0 0 0-.176-.427H8.177a.75.75 0 0 1 0-1.5h4.336a.25.25 0 0 0 .176-.427L10.896 4.03a.75.75 0 0 1 1.061-1.06l3.323 3.323a1 1 0 0 1 0 1.414l-3.323 3.323a.75.75 0 0 1-1.06 0Z"/></svg>`},pie={1:"692ed6ba-e569-459a-556a-776476829e00",42161:"600a9a04-c1b9-42ca-6785-9b4b6ff85200",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900"},Ci=(t=>(t.metaMask="metaMask",t.trust="trust",t.phantom="phantom",t.brave="brave",t.spotEthWallet="spotEthWallet",t.exodus="exodus",t.tokenPocket="tokenPocket",t.frame="frame",t.tally="tally",t.coinbaseWallet="coinbaseWallet",t.core="core",t.bitkeep="bitkeep",t.mathWallet="mathWallet",t.opera="opera",t.tokenary="tokenary",t["1inch"]="1inch",t.kuCoinWallet="kuCoinWallet",t.ledger="ledger",t))(Ci||{}),Ea={injectedPreset:{metaMask:{name:"MetaMask",icon:"619537c0-2ff3-4c78-9ed8-a05e7567f300",url:"https://metamask.io",isMobile:!0,isInjected:!0},trust:{name:"Trust",icon:"0528ee7e-16d1-4089-21e3-bbfb41933100",url:"https://trustwallet.com",isMobile:!0,isInjected:!0},spotEthWallet:{name:"Spot",icon:"1bf33a89-b049-4a1c-d1f6-4dd7419ee400",url:"https://www.spot-wallet.com",isMobile:!0,isInjected:!0},phantom:{name:"Phantom",icon:"62471a22-33cb-4e65-5b54-c3d9ea24b900",url:"https://phantom.app",isInjected:!0},core:{name:"Core",icon:"35f9c46e-cc57-4aa7-315d-e6ccb2a1d600",url:"https://core.app",isMobile:!0,isInjected:!0},bitkeep:{name:"BitKeep",icon:"3f7075d0-4ab7-4db5-404d-3e4c05e6fe00",url:"https://bitkeep.com",isMobile:!0,isInjected:!0},tokenPocket:{name:"TokenPocket",icon:"f3119826-4ef5-4d31-4789-d4ae5c18e400",url:"https://www.tokenpocket.pro",isMobile:!0,isInjected:!0},mathWallet:{name:"MathWallet",icon:"26a8f588-3231-4411-60ce-5bb6b805a700",url:"https://mathwallet.org",isMobile:!0,isInjected:!0},exodus:{name:"Exodus",icon:"4c16cad4-cac9-4643-6726-c696efaf5200",url:"https://www.exodus.com",isMobile:!0,isDesktop:!0,isInjected:!0},kuCoinWallet:{name:"KuCoin Wallet",icon:"1e47340b-8fd7-4ad6-17e7-b2bd651fae00",url:"https://kuwallet.com",isMobile:!0,isInjected:!0},ledger:{name:"Ledger",icon:"a7f416de-aa03-4c5e-3280-ab49269aef00",url:"https://www.ledger.com",isDesktop:!0},brave:{name:"Brave",icon:"125e828e-9936-4451-a8f2-949c119b7400",url:"https://brave.com/wallet",isInjected:!0},frame:{name:"Frame",icon:"cd492418-ea85-4ef1-aeed-1c9e20b58900",url:"https://frame.sh",isInjected:!0},tally:{name:"Tally",icon:"98d2620c-9fc8-4a1c-31bc-78d59d00a300",url:"https://tallyho.org",isInjected:!0},coinbaseWallet:{name:"Coinbase",icon:"f8068a7f-83d7-4190-1f94-78154a12c600",url:"https://www.coinbase.com/wallet",isInjected:!0},opera:{name:"Opera",icon:"877fa1a4-304d-4d45-ca8e-f76d1a556f00",url:"https://www.opera.com/crypto",isInjected:!0},tokenary:{name:"Tokenary",icon:"5e481041-dc3c-4a81-373a-76bbde91b800",url:"https://tokenary.io",isDesktop:!0,isInjected:!0},["1inch"]:{name:"1inch Wallet",icon:"dce1ee99-403f-44a9-9f94-20de30616500",url:"https://1inch.io/wallet",isMobile:!0}},getInjectedId(t){if(t.toUpperCase()!=="INJECTED"&&t.length)return t;let{ethereum:e,spotEthWallet:r,coinbaseWalletExtension:n}=window;return e?e.isTrust||e.isTrustWallet?"trust":e.isPhantom?"phantom":e.isBraveWallet?"brave":r?"spotEthWallet":e.isExodus?"exodus":e.isTokenPocket?"tokenPocket":e.isFrame?"frame":e.isTally?"tally":n?"coinbaseWallet":e.isAvalanche?"core":e.isBitKeep?"bitkeep":e.isMathWallet?"mathWallet":e.isOpera?"opera":e.isTokenary?"tokenary":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch":e.isKuCoinWallet?"kuCoinWallet":e.isMetaMask?"metaMask":"injected":"metaMask"},getInjectedName(t){var e,r;if(t.length&&t.toUpperCase()!=="INJECTED")return t;let n=Ea.getInjectedId("");return(r=(e=Ea.injectedPreset[n])==null?void 0:e.name)!=null?r:"Injected"}},gie={ETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},WETH:{icon:"692ed6ba-e569-459a-556a-776476829e00"},AVAX:{icon:"30c46e53-e989-45fb-4549-be3bd4eb3b00"},FTM:{icon:"06b26297-fe0c-4733-5d6b-ffa5498aac00"},BNB:{icon:"93564157-2e8e-4ce7-81df-b264dbee9b00"},MATIC:{icon:"41d04d42-da3b-4453-8506-668cc0727900"},OP:{icon:"ab9c186a-c52f-464b-2906-ca59d760a400"}},mie=Object.defineProperty,jD=Object.getOwnPropertySymbols,yie=Object.prototype.hasOwnProperty,vie=Object.prototype.propertyIsEnumerable,BD=(t,e,r)=>e in t?mie(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bie=(t,e)=>{for(var r in e||(e={}))yie.call(e,r)&&BD(t,r,e[r]);if(jD)for(var r of jD(e))vie.call(e,r)&&BD(t,r,e[r]);return t},ue={MOBILE_BREAKPOINT:600,W3M_RECENT_WALLET:"W3M_RECENT_WALLET",rejectStandaloneButtonComponent(){let{isStandalone:t}=se.state;if(t)throw new Error("Web3Modal button components are not available in standalone mode.")},getShadowRootElement(t,e){let r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletId(t){return Ea.getInjectedId(t)},getWalletIcon(t){var e,r;let n=(e=Ea.injectedPreset[t])==null?void 0:e.icon,{projectId:i,walletImages:o}=Kt.state;return(r=o?.[t])!=null?r:i&&n?sr.getImageUrl(n):""},getWalletName(t,e=!1){let r=Ea.getInjectedName(t);return e?r.split(" ")[0]:r},getChainIcon(t){var e;let r=pie[t],{projectId:n,chainImages:i}=Kt.state;return(e=i?.[t])!=null?e:n&&r?sr.getImageUrl(r):""},getTokenIcon(t){var e,r;let n=(e=gie[t])==null?void 0:e.icon,{projectId:i,tokenImages:o}=Kt.state;return(r=o?.[t])!=null?r:i&&n?sr.getImageUrl(n):""},isMobileAnimation(){return window.innerWidth<=ue.MOBILE_BREAKPOINT},async preloadImage(t){return new Promise((e,r)=>{let n=new Image;n.onload=e,n.onerror=r,n.src=t})},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},async handleMobileLinking(t){let{standaloneUri:e,selectedChain:r}=se.state,{links:n,name:i}=t;function o(s){let a="";n!=null&&n.universal?a=Fe.formatUniversalUrl(n.universal,s,i):n!=null&&n.native&&(a=Fe.formatNativeUrl(n.native,s,i)),Fe.openHref(a)}e?o(e):(await Wt.client().connectWalletConnect(s=>{o(s)},r?.id),ar.close()),ue.setRecentWallet(t)},async handleAndroidLinking(){let{standaloneUri:t,selectedChain:e}=se.state;t?Fe.openHref(t):(await Wt.client().connectWalletConnect(r=>{Fe.setWalletConnectAndroidDeepLink(r),Fe.openHref(r)},e?.id),ar.close())},async handleUriCopy(){let{standaloneUri:t}=se.state;if(t)await navigator.clipboard.writeText(t);else{let e=Wt.client().walletConnectUri;await navigator.clipboard.writeText(e)}Gr.openToast("Link copied","success")},async handleConnectorConnection(t,e){try{let{selectedChain:r}=se.state;await Wt.client().connectConnector(t,r?.id),ar.close()}catch(r){e?e():Gr.openToast(ue.getErrorMessage(r),"error")}},getCustomWallets(){var t;let{desktopWallets:e,mobileWallets:r}=Kt.state;return(t=Fe.isMobile()?r:e)!=null?t:[]},getCustomImageUrls(){let{chainImages:t,walletImages:e}=Kt.state,r=Object.values(t??{}),n=Object.values(e??{});return Object.values([...r,...n])},getConnectorImageUrls(){return Wt.client().getConnectors().map(({id:t})=>Ea.getInjectedId(t)).map(t=>ue.getWalletIcon(t))},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},generateAvatarColors(t){var e;let r=(e=t.match(/.{1,7}/g))==null?void 0:e.splice(0,5),n=[];r?.forEach(o=>{let s=0;for(let c=0;c<o.length;c+=1)s=o.charCodeAt(c)+((s<<5)-s),s=s&s;let a=[0,0,0];for(let c=0;c<3;c+=1){let u=s>>c*8&255;a[c]=u}n.push(`rgb(${a[0]}, ${a[1]}, ${a[2]})`)});let i=document.querySelector(":root");if(i){let o={"--color-av-1":n[0],"--color-av-2":n[1],"--color-av-3":n[2],"--color-av-4":n[3],"--color-av-5":n[4]};Object.entries(o).forEach(([s,a])=>i.style.setProperty(s,a))}},setRecentWallet(t){localStorage.setItem(ue.W3M_RECENT_WALLET,JSON.stringify(t))},getRecentWallet(){let t=localStorage.getItem(ue.W3M_RECENT_WALLET);if(t)return JSON.parse(t)},getExtensionWallets(){let t=[];for(let[e,r]of Object.entries(Ea.injectedPreset))e!==Ci.coinbaseWallet&&r&&r.isInjected&&!r.isDesktop&&t.push(bie({id:e},r));return t},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())}},_ie=Ce`#w3m-transparent-noise,.w3m-canvas,.w3m-color-placeholder,.w3m-gradient-placeholder,.w3m-highlight{inset:0;position:absolute;display:block;pointer-events:none;width:100%;height:100px;border-radius:8px 8px 0 0;transform:translateY(-5px)}.w3m-gradient-placeholder{background:linear-gradient(var(--gradient-1),var(--gradient-2),var(--gradient-3),var(--gradient-4))}.w3m-color-placeholder{background-color:var(--color-fg-accent)}.w3m-highlight{border:1px solid var(--color-overlay)}.w3m-canvas{opacity:0;transition:opacity 2s ease;box-shadow:0 8px 28px -6px rgba(10,16,31,.12),0 18px 88px -4px rgba(10,16,31,.14)}.w3m-canvas-visible{opacity:1}#w3m-transparent-noise{mix-blend-mode:multiply;opacity:.35}.w3m-toolbar{height:28px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.w3m-toolbar img,.w3m-toolbar svg{height:28px;object-position:left center;object-fit:contain}#w3m-wc-logo path{fill:var(--color-fg-inverse)}.w3m-action-btn{width:28px;height:28px;border-radius:50%;border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:background-color,.2s ease;background-color:var(--color-bg-1);box-shadow:0 0 0 1px var(--color-overlay),0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08)}.w3m-action-btn:hover{background-color:var(--color-bg-2)}.w3m-action-btn svg{display:block;object-position:center}.w3m-action-btn path{fill:var(--color-fg-1)}.w3m-actions{display:flex}.w3m-actions button:first-child{margin-right:16px}.w3m-help-active button:first-child{background-color:var(--color-fg-1)}.w3m-help-active button:first-child path{fill:var(--color-bg-1)}`,wie=Object.defineProperty,Eie=Object.getOwnPropertyDescriptor,f3=(t,e,r,n)=>{for(var i=n>1?void 0:n?Eie(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&wie(e,r,i),i},qD=new k3,ah=class extends _e{constructor(){super(),this.open=!1,this.isHelp=!1,this.unsubscribeRouter=void 0,this.playTimeout=void 0,this.unsubscribeRouter=Ue.subscribe(t=>{this.isHelp=t.view==="Help"})}firstUpdated(){let{themeBackground:t}=Kt.state;t==="gradient"&&(this.playTimeout=setTimeout(()=>{qD.play(this.canvasEl),this.open=!0},800))}disconnectedCallback(){var t;(t=this.unsubscribeRouter)==null||t.call(this),clearTimeout(this.playTimeout),qD.stop()}get canvasEl(){return ue.getShadowRootElement(this,".w3m-canvas")}onHelp(){Ue.push("Help")}render(){let{themeBackground:t}=Kt.state,e={"w3m-canvas":!0,"w3m-canvas-visible":this.open},r={"w3m-actions":!0,"w3m-help-active":this.isHelp};return J`${t==="themeColor"?J`<div class="w3m-color-placeholder"></div>`:null} ${t==="gradient"?J`<div class="w3m-gradient-placeholder"></div><canvas class="${Kr(e)}"></canvas>${Re.NOISE_TEXTURE}`:null}<div class="w3m-highlight"></div><div class="w3m-toolbar">${Re.WALLET_CONNECT_LOGO}<div class="${Kr(r)}"><button class="w3m-action-btn" @click="${this.onHelp}">${Re.HELP_ICON}</button> <button class="w3m-action-btn" @click="${ar.close}">${Re.CROSS_ICON}</button></div></div>`}};ah.styles=[me.globalCss,_ie],f3([Ve()],ah.prototype,"open",2),f3([Ve()],ah.prototype,"isHelp",2),ah=f3([Oe("w3m-modal-backcard")],ah);Sie=Ce`main{padding:20px;padding-top:0;width:100%}`,xie=Object.defineProperty,Oie=Object.getOwnPropertyDescriptor,Cie=(t,e,r,n)=>{for(var i=n>1?void 0:n?Oie(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&xie(e,r,i),i},h3=class extends _e{render(){return J`<main><slot></slot></main>`}};h3.styles=[me.globalCss,Sie],h3=Cie([Oe("w3m-modal-content")],h3);Aie=Ce`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--color-bg-2)}`,Iie=Object.defineProperty,Mie=Object.getOwnPropertyDescriptor,Rie=(t,e,r,n)=>{for(var i=n>1?void 0:n?Mie(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Iie(e,r,i),i},d3=class extends _e{render(){return J`<footer><slot></slot></footer>`}};d3.styles=[me.globalCss,Aie],d3=Rie([Oe("w3m-modal-footer")],d3);Tie=Ce`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.w3m-border{border-bottom:1px solid var(--color-bg-2);margin-bottom:20px}header button{padding:15px 20px;transition:opacity .2s ease}@media(hover:hover){header button:hover{opacity:.5}}.w3m-back-btn{position:absolute;left:0}.w3m-action-btn{position:absolute;right:0}path{fill:var(--color-fg-accent)}`,Pie=Object.defineProperty,Die=Object.getOwnPropertyDescriptor,ch=(t,e,r,n)=>{for(var i=n>1?void 0:n?Die(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Pie(e,r,i),i},da=class extends _e{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return J`<button class="w3m-back-btn" @click="${Ue.goBack}">${Re.BACK_ICON}</button>`}actionBtnTemplate(){return J`<button class="w3m-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){let t={"w3m-border":this.border},e=Ue.state.history.length>1,r=this.title?J`<w3m-text variant="large-bold">${this.title}</w3m-text>`:J`<slot></slot>`;return J`<header class="${Kr(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};da.styles=[me.globalCss,Tie],ch([Ae()],da.prototype,"title",2),ch([Ae()],da.prototype,"onAction",2),ch([Ae()],da.prototype,"actionIcon",2),ch([Ae()],da.prototype,"border",2),da=ch([Oe("w3m-modal-header")],da);Nie=Ce`.w3m-router{overflow:hidden;will-change:transform}.w3m-content{display:flex;flex-direction:column}`,kie=Object.defineProperty,Lie=Object.getOwnPropertyDescriptor,p3=(t,e,r,n)=>{for(var i=n>1?void 0:n?Lie(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&kie(e,r,i),i},uh=class extends _e{constructor(){super(),this.view=Ue.state.view,this.prevView=Ue.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=Ue.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{let e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&(xi(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),xi(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.03})),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 ue.getShadowRootElement(this,".w3m-router")}get contentEl(){return ue.getShadowRootElement(this,".w3m-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return J`<w3m-connect-wallet-view></w3m-connect-wallet-view>`;case"SelectNetwork":return J`<w3m-select-network-view></w3m-select-network-view>`;case"InjectedConnector":return J`<w3m-injected-connector-view></w3m-injected-connector-view>`;case"InstallConnector":return J`<w3m-install-connector-view></w3m-install-connector-view>`;case"GetWallet":return J`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"DesktopConnector":return J`<w3m-desktop-connector-view></w3m-desktop-connector-view>`;case"WalletExplorer":return J`<w3m-wallet-explorer-view></w3m-wallet-explorer-view>`;case"Qrcode":return J`<w3m-qrcode-view></w3m-qrcode-view>`;case"Help":return J`<w3m-help-view></w3m-help-view>`;case"WalletFilter":return J`<w3m-wallet-filter-view></w3m-wallet-filter-view>`;case"Account":return J`<w3m-account-view></w3m-account-view>`;case"SwitchNetwork":return J`<w3m-switch-network-view></w3m-switch-network-view>`;default:return J`<div>Not Found</div>`}}async onChangeRoute(){await xi(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15}).finished,this.view=Ue.state.view}render(){return J`<div class="w3m-router"><div class="w3m-content">${this.viewTemplate()}</div></div>`}};uh.styles=[me.globalCss,Nie],p3([Ve()],uh.prototype,"view",2),p3([Ve()],uh.prototype,"prevView",2),uh=p3([Oe("w3m-modal-router")],uh);jie=Ce`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:10px 15px;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:36px;border:1px solid var(--color-overlay);background-color:var(--color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--color-bg-3)}}.w3m-success path{fill:var(--color-fg-accent)}.w3m-error path{fill:var(--color-err)}`,Bie=Object.defineProperty,qie=Object.getOwnPropertyDescriptor,FD=(t,e,r,n)=>{for(var i=n>1?void 0:n?qie(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Bie(e,r,i),i},Lg=class extends _e{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Gr.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Gr.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Gr.closeToast()}render(){let{message:t,variant:e}=Gr.state,r={"w3m-success":e==="success","w3m-error":e==="error"};return this.open?J`<div class="${Kr(r)}">${e==="success"?Re.CHECKMARK_ICON:null} ${e==="error"?Re.CROSS_ICON:null}<w3m-text variant="small-normal">${t}</w3m-text></div>`:null}};Lg.styles=[me.globalCss,jie],FD([Ve()],Lg.prototype,"open",2),Lg=FD([Oe("w3m-modal-toast")],Lg);Fie=Ce`button{padding:5px;border-radius:10px;transition:all .2s ease;display:flex;flex-direction:column;align-items:center;justify-content:center;width:80px;height:90px}w3m-network-image{width:54px;height:59px}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;margin-top:5px}button:hover{background-color:var(--color-overlay)}`,Uie=Object.defineProperty,$ie=Object.getOwnPropertyDescriptor,jg=(t,e,r,n)=>{for(var i=n>1?void 0:n?$ie(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Uie(e,r,i),i},Su=class extends _e{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.chainId=""}render(){return J`<button @click="${this.onClick}"><w3m-network-image chainId="${this.chainId}"></w3m-network-image><w3m-text variant="xsmall-normal">${this.name}</w3m-text></button>`}};Su.styles=[me.globalCss,Fie],jg([Ae()],Su.prototype,"onClick",2),jg([Ae()],Su.prototype,"name",2),jg([Ae()],Su.prototype,"chainId",2),Su=jg([Oe("w3m-network-button")],Su);Wie=Ce`div{width:inherit;height:inherit}.polygon-stroke{stroke:var(--color-overlay)}svg{width:100%;height:100%;margin:0}#network-placeholder-fill{fill:var(--color-bg-3)}#network-placeholder-dash{stroke:var(--color-overlay)}`,Hie=Object.defineProperty,zie=Object.getOwnPropertyDescriptor,UD=(t,e,r,n)=>{for(var i=n>1?void 0:n?zie(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Hie(e,r,i),i},Bg=class extends _e{constructor(){super(...arguments),this.chainId=""}render(){let t=ue.getChainIcon(this.chainId);return t?J`<div><svg width="54" height="59" viewBox="0 0 54 59" fill="none"><defs><clipPath id="polygon"><path d="M17.033 4.964c3.852-2.262 5.778-3.393 7.84-3.77a11.807 11.807 0 0 1 4.254 0c2.062.377 3.988 1.508 7.84 3.77l6.066 3.562c3.852 2.263 5.777 3.394 7.13 5.022a12.268 12.268 0 0 1 2.127 3.747c.71 2.006.71 4.268.71 8.793v7.124c0 4.525 0 6.787-.71 8.793a12.268 12.268 0 0 1-2.126 3.747c-1.354 1.628-3.28 2.76-7.131 5.022l-6.066 3.562c-3.852 2.262-5.778 3.393-7.84 3.771a11.814 11.814 0 0 1-4.254 0c-2.062-.378-3.988-1.509-7.84-3.77l-6.066-3.563c-3.852-2.263-5.778-3.394-7.13-5.022a12.268 12.268 0 0 1-2.127-3.747C1 40 1 37.737 1 33.212v-7.124c0-4.525 0-6.787.71-8.793a12.268 12.268 0 0 1 2.127-3.747c1.352-1.628 3.278-2.76 7.13-5.022l6.066-3.562Z"/></clipPath></defs><image clip-path="url(#polygon)" href="${t}" width="58" height="59" x="-2" y="0"/><path class="polygon-stroke" d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z" stroke="#fff"/></svg></div>`:J`${Re.NETWORK_PLACEHOLDER}`}};Bg.styles=[me.globalCss,Wie],UD([Ae()],Bg.prototype,"chainId",2),Bg=UD([Oe("w3m-network-image")],Bg);Vie=.1,$D=2.5,So=7;Kie={generate(t,e,r,n){let i=n==="light"?"#141414":"#fff",o=n==="light"?"#fff":"#141414",s=[],a=Gie(t,"Q"),c=e/a.length,u=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];u.forEach(({x,y:O})=>{let I=(a.length-So)*c*x,j=(a.length-So)*c*O,k=.32;for(let B=0;B<u.length;B+=1){let V=c*(So-B*2);s.push(Pe`<rect fill="${B%2===0?i:o}" height="${V}" rx="${V*k}" ry="${V*k}" width="${V}" x="${I+c*B}" y="${j+c*B}">`)}});let l=Math.floor((r+25)/c),h=a.length/2-l/2,d=a.length/2+l/2-1,m=[];a.forEach((x,O)=>{x.forEach((I,j)=>{if(a[O][j]&&!(O<So&&j<So||O>a.length-(So+1)&&j<So||O<So&&j>a.length-(So+1))&&!(O>h&&O<d&&j>h&&j<d)){let k=O*c+c/2,B=j*c+c/2;m.push([k,B])}})});let v={};return m.forEach(([x,O])=>{v[x]?v[x].push(O):v[x]=[O]}),Object.entries(v).map(([x,O])=>{let I=O.filter(j=>O.every(k=>!g3(j,k,c)));return[Number(x),I]}).forEach(([x,O])=>{O.forEach(I=>{s.push(Pe`<circle cx="${x}" cy="${I}" fill="${i}" r="${c/$D}">`)})}),Object.entries(v).filter(([x,O])=>O.length>1).map(([x,O])=>{let I=O.filter(j=>O.some(k=>g3(j,k,c)));return[Number(x),I]}).map(([x,O])=>{O.sort((j,k)=>j<k?-1:1);let I=[];for(let j of O){let k=I.find(B=>B.some(V=>g3(j,V,c)));k?k.push(j):I.push([j])}return[x,I.map(j=>[j[0],j[j.length-1]])]}).forEach(([x,O])=>{O.forEach(([I,j])=>{s.push(Pe`<line x1="${x}" x2="${x}" y1="${I}" y2="${j}" stroke="${i}" stroke-width="${c/($D/2)}" stroke-linecap="round">`)})}),s}},Yie=Ce`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;width:100%;aspect-ratio:1/1;animation:fadeIn ease .2s}svg:first-child,w3m-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{transform:translateY(-50%) translateX(-50%)}w3m-wallet-image{width:25%;height:25%;border-radius:15px}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--color-fg-accent)}svg:first-child path:last-child{stroke:var(--color-overlay)}`,Zie=Object.defineProperty,Jie=Object.getOwnPropertyDescriptor,lh=(t,e,r,n)=>{for(var i=n>1?void 0:n?Jie(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Zie(e,r,i),i},pa=class extends _e{constructor(){super(...arguments),this.uri="",this.size=0,this.logoSrc="",this.walletId=""}svgTemplate(){var t;let e=(t=Kt.state.themeMode)!=null?t:"light";return Pe`<svg height="${this.size}" width="${this.size}">${Kie.generate(this.uri,this.size,this.size/4,e)}</svg>`}render(){return J`<div>${this.walletId||this.logoSrc?J`<w3m-wallet-image walletId="${un(this.walletId)}" src="${un(this.logoSrc)}"></w3m-wallet-image>`:Re.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};pa.styles=[me.globalCss,Yie],lh([Ae()],pa.prototype,"uri",2),lh([Ae({type:Number})],pa.prototype,"size",2),lh([Ae()],pa.prototype,"logoSrc",2),lh([Ae()],pa.prototype,"walletId",2),pa=lh([Oe("w3m-qrcode")],pa);Qie=Ce`:host{position:relative;height:28px;width:75%}input{width:100%;height:100%;line-height:28px!important;border-radius:28px;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:transparent;position:absolute;background-color:var(--color-bg-3);box-shadow:inset 0 0 0 1px var(--color-overlay)}input::placeholder{color:transparent}svg{margin-right:4px}.w3m-placeholder{top:0;left:50%;transform:translateX(-50%);transition:.2s all ease;pointer-events:none;display:flex;align-items:center;justify-content:center;height:100%;width:fit-content;position:relative}input:focus-within+.w3m-placeholder,input:not(:placeholder-shown)+.w3m-placeholder{transform:translateX(10px);left:0}w3m-text{opacity:1;transition:.2s opacity ease}input:focus-within+.w3m-placeholder w3m-text,input:not(:placeholder-shown)+.w3m-placeholder w3m-text{opacity:0}input:focus-within,input:not(:placeholder-shown){color:var(--color-fg-1)}input:focus-within{box-shadow:inset 0 0 0 1px var(--color-fg-accent)}path{fill:var(--color-fg-2)}`,Xie=Object.defineProperty,eoe=Object.getOwnPropertyDescriptor,WD=(t,e,r,n)=>{for(var i=n>1?void 0:n?eoe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Xie(e,r,i),i},qg=class extends _e{constructor(){super(...arguments),this.onChange=()=>null}render(){let t=Fe.isMobile()?"Search mobile wallets":"Search desktop wallets";return J`<input type="text" @input="${this.onChange}" placeholder="${t}"><div class="w3m-placeholder">${Re.SEARCH_ICON}<w3m-text color="secondary" variant="medium-thin">${t}</w3m-text></div>`}};qg.styles=[me.globalCss,Qie],WD([Ae()],qg.prototype,"onChange",2),qg=WD([Oe("w3m-search-input")],qg);toe=Ce`@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(--color-fg-accent)}`,roe=Object.defineProperty,noe=Object.getOwnPropertyDescriptor,ioe=(t,e,r,n)=>{for(var i=n>1?void 0:n?noe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&roe(e,r,i),i},m3=class extends _e{render(){return J`<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>`}};m3.styles=[me.globalCss,toe],m3=ioe([Oe("w3m-spinner")],m3);ooe=Ce`span{font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'tnum' on,'lnum' on,'case' on}.w3m-xxsmall-bold{font-weight:700;font-size:10px;line-height:12px;letter-spacing:.02em;text-transform:uppercase}.w3m-xsmall-normal{font-weight:600;font-size:12px;line-height:14px;letter-spacing:-.03em}.w3m-small-thin{font-weight:500;font-size:14px;line-height:16px;letter-spacing:-.03em}.w3m-small-normal{font-weight:600;font-size:14px;line-height:16px;letter-spacing:-.03em}.w3m-medium-thin{font-weight:500;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-medium-normal{font-weight:600;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-medium-bold{font-weight:700;font-size:16px;line-height:20px;letter-spacing:-.03em}.w3m-large-bold{font-weight:600;font-size:20px;line-height:24px;letter-spacing:-.03em}:host(*){color:var(--color-fg-1)}.w3m-color-primary{color:var(--color-fg-1)}.w3m-color-secondary{color:var(--color-fg-2)}.w3m-color-tertiary{color:var(--color-fg-3)}.w3m-color-inverse{color:var(--color-fg-inverse)}.w3m-color-accnt{color:var(--color-fg-accent)}.w3m-color-error{color:var(--color-err)}`,soe=Object.defineProperty,aoe=Object.getOwnPropertyDescriptor,y3=(t,e,r,n)=>{for(var i=n>1?void 0:n?aoe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&soe(e,r,i),i},fh=class extends _e{constructor(){super(...arguments),this.variant="medium-normal",this.color="primary"}render(){let t={"w3m-large-bold":this.variant==="large-bold","w3m-medium-bold":this.variant==="medium-bold","w3m-medium-normal":this.variant==="medium-normal","w3m-medium-thin":this.variant==="medium-thin","w3m-small-normal":this.variant==="small-normal","w3m-small-thin":this.variant==="small-thin","w3m-xsmall-normal":this.variant==="xsmall-normal","w3m-xxsmall-bold":this.variant==="xxsmall-bold","w3m-color-primary":this.color==="primary","w3m-color-secondary":this.color==="secondary","w3m-color-tertiary":this.color==="tertiary","w3m-color-inverse":this.color==="inverse","w3m-color-accnt":this.color==="accent","w3m-color-error":this.color==="error"};return J`<span class="${Kr(t)}"><slot></slot></span>`}};fh.styles=[me.globalCss,ooe],y3([Ae()],fh.prototype,"variant",2),y3([Ae()],fh.prototype,"color",2),fh=y3([Oe("w3m-text")],fh);coe=Ce`div{overflow:hidden;position:relative;border-radius:50%}div::after{content:'';position:absolute;inset:0;border-radius:50%;border:1px solid var(--color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}svg{width:100%;height:100%}#token-placeholder-fill{fill:var(--color-bg-3)}#token-placeholder-dash{stroke:var(--color-overlay)}`,uoe=Object.defineProperty,loe=Object.getOwnPropertyDescriptor,HD=(t,e,r,n)=>{for(var i=n>1?void 0:n?loe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&uoe(e,r,i),i},Fg=class extends _e{constructor(){super(...arguments),this.symbol=void 0}render(){var t;let e=ue.getTokenIcon((t=this.symbol)!=null?t:"");return e?J`<div><img src="${e}" alt="${this.id}"></div>`:Re.TOKEN_PLACEHOLDER}};Fg.styles=[me.globalCss,coe],HD([Ae()],Fg.prototype,"symbol",2),Fg=HD([Oe("w3m-token-image")],Fg);foe=Ce`button{transition:all .2s ease;width:100%;height:100%;border-radius:10px;display:flex;align-items:flex-start}button:hover{background-color:var(--color-overlay)}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}w3m-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}w3m-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:15px;margin-bottom:5px}.w3m-sublabel{margin-top:2px}`,hoe=Object.defineProperty,doe=Object.getOwnPropertyDescriptor,ss=(t,e,r,n)=>{for(var i=n>1?void 0:n?doe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&hoe(e,r,i),i},Oi=class extends _e{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.src=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?J`<w3m-text class="w3m-sublabel" variant="xxsmall-bold" color="tertiary">RECENT</w3m-text>`:this.installed?J`<w3m-text class="w3m-sublabel" variant="xxsmall-bold" color="tertiary">INSTALLED</w3m-text>`:null}render(){var t;return J`<button @click="${this.onClick}"><div><w3m-wallet-image walletId="${this.walletId}" .src="${this.src}"></w3m-wallet-image><w3m-text variant="xsmall-normal">${(t=this.label)!=null?t:ue.getWalletName(this.name,!0)}</w3m-text>${this.sublabelTemplate()}</div></button>`}};Oi.styles=[me.globalCss,foe],ss([Ae()],Oi.prototype,"onClick",2),ss([Ae()],Oi.prototype,"name",2),ss([Ae()],Oi.prototype,"walletId",2),ss([Ae()],Oi.prototype,"label",2),ss([Ae()],Oi.prototype,"src",2),ss([Ae()],Oi.prototype,"installed",2),ss([Ae()],Oi.prototype,"recent",2),Oi=ss([Oe("w3m-wallet-button")],Oi);poe=Ce`div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;inset:0;border-radius:inherit;border:1px solid var(--color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--color-bg-3)}#wallet-placeholder-dash{stroke:var(--color-overlay)}`,goe=Object.defineProperty,moe=Object.getOwnPropertyDescriptor,v3=(t,e,r,n)=>{for(var i=n>1?void 0:n?moe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&goe(e,r,i),i},hh=class extends _e{constructor(){super(...arguments),this.walletId=void 0,this.src=void 0}render(){var t;let e=ue.getWalletId((t=this.walletId)!=null?t:""),r=ue.getWalletId(e),n=this.src?this.src:ue.getWalletIcon(r);return J`${n.length?J`<div><img src="${n}" alt="${this.id}"></div>`:Re.WALLET_PLACEHOLDER}`}};hh.styles=[me.globalCss,poe],v3([Ae()],hh.prototype,"walletId",2),v3([Ae()],hh.prototype,"src",2),hh=v3([Oe("w3m-wallet-image")],hh);yoe=Ce`:host{all:initial}div{display:flex;align-items:center;background-color:var(--color-overlay);box-shadow:inset 0 0 0 1px var(--color-overlay);border-radius:10px;padding:4px 4px 4px 8px}div button{border-radius:16px;padding:4px 8px 4px 4px;height:auto;margin-left:10px;color:var(--color-fg-inverse);background-color:var(--color-fg-accent)}button::after{content:'';inset:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--color-overlay)}button:hover::after{background-color:var(--color-overlay)}w3m-avatar{margin-right:6px}w3m-button-big w3m-avatar{margin-left:-5px}`,voe=Object.defineProperty,boe=Object.getOwnPropertyDescriptor,zD=(t,e,r,n)=>{for(var i=n>1?void 0:n?boe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&voe(e,r,i),i},_h=class extends _e{constructor(){super(),this.balance="hide",ue.rejectStandaloneButtonComponent()}onOpen(){let{isStandalone:t}=se.state;t||ar.open({route:"Account"})}accountTemplate(){return J`<w3m-avatar></w3m-avatar><w3m-address-text></w3m-address-text>`}render(){return this.balance==="show"?J`<div><w3m-balance></w3m-balance><button @click="${this.onOpen}">${this.accountTemplate()}</button></div>`:J`<w3m-button-big @click="${this.onOpen}">${this.accountTemplate()}</w3m-button-big>`}};_h.styles=[me.globalCss,yoe],zD([Ae()],_h.prototype,"balance",2),_h=zD([Oe("w3m-account-button")],_h);_oe=Ce`button{display:flex;border-radius:10px;flex-direction:column;transition:background-color .2s ease;justify-content:center;padding:5px;width:100px}button:hover{background-color:var(--color-overlay)}button:disabled{pointer-events:none}w3m-network-image{width:32px;height:32px}w3m-text{margin-top:4px}`,woe=Object.defineProperty,Eoe=Object.getOwnPropertyDescriptor,b3=(t,e,r,n)=>{for(var i=n>1?void 0:n?Eoe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&woe(e,r,i),i},dh=class extends _e{constructor(){super(),this.chainId="",this.label="",this.unsubscribeNetwork=void 0;let{selectedChain:t}=se.state;this.chainId=t?.id.toString(),this.label=t?.name,this.unsubscribeNetwork=se.subscribe(({selectedChain:e})=>{this.chainId=e?.id.toString(),this.label=e?.name})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onClick(){Ue.push("SelectNetwork")}render(){let{chains:t}=se.state,e=t&&t.length>1;return J`<button @click="${this.onClick}" ?disabled="${!e}"><w3m-network-image chainId="${un(this.chainId)}"></w3m-network-image><w3m-text variant="xsmall-normal" color="accent">${this.label}</w3m-text></button>`}};dh.styles=[me.globalCss,_oe],b3([Ve()],dh.prototype,"chainId",2),b3([Ve()],dh.prototype,"label",2),dh=b3([Oe("w3m-account-network-button")],dh);Soe=Ce`@keyframes slide{0%{background-position:0 0}100%{background-position:200px 0}}w3m-text{padding:1px 0}.w3m-loading{background:linear-gradient(270deg,var(--color-fg-1) 36.33%,var(--color-fg-3) 42.07%,var(--color-fg-1) 83.3%);background-size:200px 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation-name:slide;animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear}`,xoe=Object.defineProperty,Ooe=Object.getOwnPropertyDescriptor,ph=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ooe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&xoe(e,r,i),i},ga=class extends _e{constructor(){super(),this.address=void 0,this.name=void 0,this.loading=!0,this.variant="button",this.unsubscribeAccount=void 0,this.address=se.state.address,this.name=se.state.profileName,this.loading=Boolean(se.state.profileLoading),this.unsubscribeAccount=se.subscribe(({address:t,profileName:e,profileLoading:r})=>{this.address=t,this.name=e,this.loading=Boolean(r)})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){var t;let e=this.variant==="button",r={"w3m-loading":this.loading};return J`<w3m-text class="${Kr(r)}" variant="${e?"medium-normal":"large-bold"}" color="${e?"inverse":"primary"}">${this.name?this.name:ue.truncate((t=this.address)!=null?t:"")}</w3m-text>`}};ga.styles=[me.globalCss,Soe],ph([Ve()],ga.prototype,"address",2),ph([Ve()],ga.prototype,"name",2),ph([Ve()],ga.prototype,"loading",2),ph([Ae()],ga.prototype,"variant",2),ga=ph([Oe("w3m-address-text")],ga);Coe=Ce`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 10),0,0)}}.w3m-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px}.w3m-slider::after,.w3m-slider::before{content:'';height:100%;width:50px;z-index:2;position:absolute;background:linear-gradient(to right,var(--color-bg-1) 0,transparent 100%);top:0}.w3m-slider::before{left:0}.w3m-slider::after{right:0;transform:rotateZ(180deg)}.w3m-track{display:flex;width:calc(70px * 20);animation:scroll 20s linear infinite}.w3m-action{padding:30px 0 10px 0;display:flex;justify-content:center;align-items:center;flex-direction:column}.w3m-action w3m-button-big:last-child{margin-top:10px}w3m-wallet-image{width:60px;height:60px;margin:0 5px;box-shadow:0 2px 4px -2px rgba(0,0,0,.12),0 4px 4px -2px rgba(0,0,0,.08);border-radius:15px}`,Aoe=Object.defineProperty,Ioe=Object.getOwnPropertyDescriptor,Moe=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ioe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Aoe(e,r,i),i},_3=class extends _e{onGoToQrcode(){Ue.push("Qrcode")}onGoToGetWallet(){Ue.push("GetWallet")}render(){let{previewWallets:t}=sr.state,e=t.length,r=[...t,...t];return J`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Re.QRCODE_ICON}"></w3m-modal-header><w3m-modal-content>${e?J`<div class="w3m-slider"><div class="w3m-track">${r.map(({image_url:n})=>J`<w3m-wallet-image src="${n.lg}"></w3m-wallet-image>`)}</div></div>`:null}<div class="w3m-action"><w3m-button-big @click="${ue.handleAndroidLinking}"><w3m-text variant="medium-normal" color="inverse">Select Wallet</w3m-text></w3m-button-big><w3m-button-big variant="secondary" @click="${this.onGoToGetWallet}"><w3m-text variant="medium-normal" color="accent">I don’t have a wallet</w3m-text></w3m-button-big></div></w3m-modal-content>`}};_3.styles=[me.globalCss,Coe],_3=Moe([Oe("w3m-android-wallet-selection")],_3);Roe=Ce`@keyframes slide{0%{transform:translateX(-50px)}100%{transform:translateX(200px)}}.w3m-placeholder,img{border-radius:50%;box-shadow:inset 0 0 0 1px var(--color-overlay);display:block;position:relative;overflow:hidden!important;background-color:var(--color-av-1);background-image:radial-gradient(at 66% 77%,var(--color-av-2) 0,transparent 50%),radial-gradient(at 29% 97%,var(--color-av-3) 0,transparent 50%),radial-gradient(at 99% 86%,var(--color-av-4) 0,transparent 50%),radial-gradient(at 29% 88%,var(--color-av-5) 0,transparent 50%);transform:translateZ(0)}.w3m-loader{width:50px;height:100%;background:linear-gradient(270deg,transparent 0,rgba(255,255,255,.4) 30%,transparent 100%);animation-name:slide;animation-duration:1.5s;transform:translateX(-50px);animation-iteration-count:infinite;animation-timing-function:linear;animation-delay:.55s}.w3m-small{width:24px;height:24px}.w3m-medium{width:60px;height:60px}`,Toe=Object.defineProperty,Poe=Object.getOwnPropertyDescriptor,gh=(t,e,r,n)=>{for(var i=n>1?void 0:n?Poe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Toe(e,r,i),i},ma=class extends _e{constructor(){super(),this.address=void 0,this.avatar=void 0,this.loading=!0,this.size="small",this.unsubscribeAccount=void 0,this.address=se.state.address,this.avatar=se.state.profileAvatar,this.loading=Boolean(se.state.profileLoading),this.unsubscribeAccount=se.subscribe(({address:t,profileAvatar:e,profileLoading:r})=>{this.address=t,this.avatar=e,this.loading=Boolean(r)})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){let t={"w3m-placeholder":!0,"w3m-small":this.size==="small","w3m-medium":this.size==="medium"};return this.avatar?J`<img class="${Kr(t)}" src="${this.avatar}">`:this.address?(ue.generateAvatarColors(this.address),J`<div class="${Kr(t)}">${this.loading?J`<div class="w3m-loader"></div>`:null}</div>`):null}};ma.styles=[me.globalCss,Roe],gh([Ve()],ma.prototype,"address",2),gh([Ve()],ma.prototype,"avatar",2),gh([Ve()],ma.prototype,"loading",2),gh([Ae()],ma.prototype,"size",2),ma=gh([Oe("w3m-avatar")],ma);Doe=Ce`div{display:flex;align-items:center}w3m-token-image{width:28px;height:28px;margin-right:6px}`,Noe=Object.defineProperty,koe=Object.getOwnPropertyDescriptor,w3=(t,e,r,n)=>{for(var i=n>1?void 0:n?koe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Noe(e,r,i),i},mh=class extends _e{constructor(){var t,e;super(),this.symbol=void 0,this.amount=void 0,this.unsubscribeAccount=void 0,this.symbol=(t=se.state.balance)==null?void 0:t.symbol,this.amount=(e=se.state.balance)==null?void 0:e.amount,this.unsubscribeAccount=se.subscribe(({balance:r})=>{this.symbol=r?.symbol,this.amount=r?.amount})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){let t="_._";return this.amount==="0.0"&&(t=0),this.amount&&this.amount.length>6&&(t=parseFloat(this.amount).toFixed(3)),J`<div><w3m-token-image symbol="${un(this.symbol)}"></w3m-token-image><w3m-text variant="medium-normal" color="primary">${t} ${this.symbol}</w3m-text></div>`}};mh.styles=[me.globalCss,Doe],w3([Ve()],mh.prototype,"symbol",2),w3([Ve()],mh.prototype,"amount",2),mh=w3([Oe("w3m-balance")],mh);Loe=Ce`:host{all:initial}svg{width:28px;height:20px;margin:-1px 3px 0 -5px}svg path{fill:var(--color-fg-inverse)}button:disabled svg path{fill:var(--color-fg-3)}w3m-spinner{margin:0 10px 0 0}`,joe=Object.defineProperty,Boe=Object.getOwnPropertyDescriptor,Ug=(t,e,r,n)=>{for(var i=n>1?void 0:n?Boe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&joe(e,r,i),i},va=class extends _e{constructor(){super(),this.loading=!1,this.label="Connect Wallet",this.icon="show",this.modalUnsub=void 0,ue.rejectStandaloneButtonComponent(),this.modalUnsub=ar.subscribe(t=>{t.open&&(this.loading=!0),t.open||(this.loading=!1)})}disconnectedCallback(){var t;(t=this.modalUnsub)==null||t.call(this)}iconTemplate(){return this.icon==="show"?Re.WALLET_CONNECT_ICON:null}onOpen(){this.loading=!0;let{enableNetworkView:t}=Kt.state,{chains:e,selectedChain:r}=se.state,n=e?.length&&e.length>1;t||n&&!r?ar.open({route:"SelectNetwork"}):ar.open({route:"ConnectWallet"})}render(){return J`<w3m-button-big .disabled="${this.loading}" @click="${this.onOpen}">${this.loading?J`<w3m-spinner></w3m-spinner><w3m-text variant="medium-normal" color="accent">Connecting...</w3m-text>`:J`${this.iconTemplate()}<w3m-text variant="medium-normal" color="inverse">${this.label}</w3m-text>`}</w3m-button-big>`}};va.styles=[me.globalCss,Loe],Ug([Ve()],va.prototype,"loading",2),Ug([Ae()],va.prototype,"label",2),Ug([Ae()],va.prototype,"icon",2),va=Ug([Oe("w3m-connect-button")],va);qoe=Object.defineProperty,Foe=Object.getOwnPropertyDescriptor,yh=(t,e,r,n)=>{for(var i=n>1?void 0:n?Foe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&qoe(e,r,i),i},ba=class extends _e{constructor(){super(),this.isConnected=!1,this.label="Connect Wallet",this.icon="show",this.balance="hide",this.unsubscribeAccount=void 0,ue.rejectStandaloneButtonComponent(),this.isConnected=se.state.isConnected,this.unsubscribeAccount=se.subscribe(({isConnected:t})=>{this.isConnected=t})}disconnectedCallback(){var t;(t=this.unsubscribeAccount)==null||t.call(this)}render(){return this.isConnected?J`<w3m-account-button balance="${un(this.balance)}"></w3m-account-button>`:J`<w3m-connect-button label="${un(this.label)}" icon="${un(this.icon)}"></w3m-connect-button>`}};yh([Ve()],ba.prototype,"isConnected",2),yh([Ae()],ba.prototype,"label",2),yh([Ae()],ba.prototype,"icon",2),yh([Ae()],ba.prototype,"balance",2),ba=yh([Oe("w3m-core-button")],ba);Zn={allowedExplorerListings(t){let{explorerAllowList:e,explorerDenyList:r}=Kt.state,n=[...t];return e!=null&&e.length&&(n=n.filter(i=>e.includes(i.id))),r!=null&&r.length&&(n=n.filter(i=>!r.includes(i.id))),n},walletsWithInjected(t){let e=[...t??[]];if(window.ethereum){let r=ue.getWalletName("");e=e.filter(({name:n})=>!ue.caseSafeIncludes(n,r))}return e},connectorWallets(){let{isStandalone:t}=se.state;if(t)return[];let e=Wt.client().getConnectors();return!window.ethereum&&Fe.isMobile()&&(e=e.filter(({id:r})=>r!=="injected"&&r!==Ci.metaMask)),e},walletTemplatesWithRecent(t,e){let r=[...t];if(e){let n=ue.getRecentWallet();r=r.filter(i=>!i.values.includes(n?.name)),r.splice(1,0,e)}return r},deduplicateExplorerListingsFromConnectors(t){let{isStandalone:e}=se.state;if(e)return t;let r=Wt.client().getConnectors().map(({name:n})=>n.toUpperCase());return t.filter(({name:n})=>!r.includes(n.toUpperCase()))}},Uoe=Ce`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.w3m-desktop-title,.w3m-mobile-title{display:flex;align-items:center}.w3m-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.w3m-desktop-title{margin-bottom:10px;padding:0 10px}.w3m-subtitle{display:flex;align-items:center}.w3m-subtitle:last-child path{fill:var(--color-fg-3)}.w3m-desktop-title svg,.w3m-mobile-title svg{margin-right:6px}.w3m-desktop-title path,.w3m-mobile-title path{fill:var(--color-fg-accent)}`,$oe=Object.defineProperty,Woe=Object.getOwnPropertyDescriptor,Hoe=(t,e,r,n)=>{for(var i=n>1?void 0:n?Woe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&$oe(e,r,i),i},E3=class extends _e{onDesktopWallet(t){Ue.push("DesktopConnector",{DesktopConnector:t})}onInjectedWallet(){Ue.push("InjectedConnector")}onInstallConnector(){Ue.push("InstallConnector",{InstallConnector:{id:"metaMask",name:"MetaMask",isMobile:!0,url:"https://metamask.io"}})}async onConnectorWallet(t){window.ethereum?t==="injected"||t===Ci.metaMask?this.onInjectedWallet():await ue.handleConnectorConnection(t):this.onInstallConnector()}desktopWalletsTemplate(){let{desktopWallets:t}=Kt.state;return t?.map(({id:e,name:r,links:{universal:n,native:i}})=>J`<w3m-wallet-button walletId="${e}" name="${r}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n,native:i})}"></w3m-wallet-button>`)}previewWalletsTemplate(){let t=Zn.allowedExplorerListings(sr.state.previewWallets);return t=Zn.deduplicateExplorerListingsFromConnectors(t),t.map(({name:e,desktop:{universal:r,native:n},homepage:i,image_url:o,id:s})=>J`<w3m-wallet-button src="${o.lg}" name="${e}" .onClick="${()=>this.onDesktopWallet({walletId:s,name:e,native:n,universal:r||i,icon:o.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){return Zn.connectorWallets().map(({id:t,name:e,ready:r})=>J`<w3m-wallet-button .installed="${["injected","metaMask"].includes(t)&&r}" name="${e}" walletId="${t}" .onClick="${async()=>this.onConnectorWallet(t)}"></w3m-wallet-button>`)}recentWalletTemplate(){let t=ue.getRecentWallet();if(!t)return;let{id:e,name:r,links:n,image:i}=t;return J`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${un(e)}" src="${un(i)}" .onClick="${()=>this.onDesktopWallet({name:r,walletId:e,universal:n?.universal,native:n?.native,icon:i})}"></w3m-wallet-button>`}render(){let{standaloneUri:t}=se.state,e=this.desktopWalletsTemplate(),r=this.previewWalletsTemplate(),n=this.connectorWalletsTemplate(),i=this.recentWalletTemplate(),o=e??r,s=[...n,...o];s=Zn.walletTemplatesWithRecent(s,i);let a=t?o:s,c=a.length>4,u=[];c?u=a.filter(h=>!h.values.includes(Ci.coinbaseWallet)).slice(0,3):u=a;let l=Boolean(u.length);return J`<w3m-modal-header border="${!0}" title="Connect your wallet" .onAction="${ue.handleUriCopy}" .actionIcon="${Re.COPY_ICON}"></w3m-modal-header><w3m-modal-content><div class="w3m-mobile-title"><div class="w3m-subtitle">${Re.MOBILE_ICON}<w3m-text variant="small-normal" color="accent">Mobile</w3m-text></div><div class="w3m-subtitle">${Re.SCAN_ICON}<w3m-text variant="small-normal" color="secondary">Scan with your wallet</w3m-text></div></div><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>${l?J`<w3m-modal-footer><div class="w3m-desktop-title">${Re.DESKTOP_ICON}<w3m-text variant="small-normal" color="accent">Desktop</w3m-text></div><div class="w3m-grid">${u} ${c?J`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}</div></w3m-modal-footer>`:null}`}};E3.styles=[me.globalCss,Uoe],E3=Hoe([Oe("w3m-desktop-wallet-selection")],E3);zoe=Ce`div{background-color:var(--color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--color-bg-3);text-align:center}a{color:var(--color-fg-accent);text-decoration:none;transition:opacity .2s ease-in-out}a:hover{opacity:.8}`,Voe=Object.defineProperty,Goe=Object.getOwnPropertyDescriptor,Koe=(t,e,r,n)=>{for(var i=n>1?void 0:n?Goe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Voe(e,r,i),i},S3=class extends _e{render(){let{termsOfServiceUrl:t,privacyPolicyUrl:e}=Kt.state;return t??e?J`<div><w3m-text variant="small-normal" color="secondary">By connecting your wallet, you agree to our<br>${t?J`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?J`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</w3m-text></div>`:null}};S3.styles=[me.globalCss,zoe],S3=Koe([Oe("w3m-legal-notice")],S3);Yoe=Ce`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`,Zoe=Object.defineProperty,Joe=Object.getOwnPropertyDescriptor,Qoe=(t,e,r,n)=>{for(var i=n>1?void 0:n?Joe(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Zoe(e,r,i),i},x3=class extends _e{onGoToQrcode(){Ue.push("Qrcode")}async onConnectorWallet(t){await ue.handleConnectorConnection(t)}mobileWalletsTemplate(){let{mobileWallets:t}=Kt.state,e=Zn.walletsWithInjected(t);if(e.length)return e.map(({id:r,name:n,links:{universal:i,native:o}})=>J`<w3m-wallet-button name="${n}" walletId="${r}" .onClick="${async()=>ue.handleMobileLinking({links:{native:o,universal:i},name:n,id:r})}"></w3m-wallet-button>`)}previewWalletsTemplate(){let{previewWallets:t}=sr.state,e=Zn.walletsWithInjected(t);return e=Zn.allowedExplorerListings(e),e=Zn.deduplicateExplorerListingsFromConnectors(e),e.map(({image_url:r,name:n,mobile:{native:i,universal:o},id:s})=>J`<w3m-wallet-button name="${n}" src="${r.lg}" .onClick="${async()=>ue.handleMobileLinking({links:{native:i,universal:o},name:n,id:s,image:r.lg})}"></w3m-wallet-button>`)}connectorWalletsTemplate(){let t=Zn.connectorWallets();return window.ethereum||(t=t.filter(({id:e})=>e!=="injected"&&e!==Ci.metaMask)),t.map(({name:e,id:r,ready:n})=>J`<w3m-wallet-button .installed="${["injected","metaMask"].includes(r)&&n}" name="${e}" walletId="${r}" .onClick="${async()=>this.onConnectorWallet(r)}"></w3m-wallet-button>`)}recentWalletTemplate(){let t=ue.getRecentWallet();if(!t)return;let{id:e,name:r,links:n,image:i}=t;return J`<w3m-wallet-button .recent="${!0}" name="${r}" walletId="${un(e)}" src="${un(i)}" .onClick="${async()=>ue.handleMobileLinking({name:r,id:e,links:n,image:i})}"></w3m-wallet-button>`}render(){let{standaloneUri:t}=se.state,e=this.connectorWalletsTemplate(),r=this.mobileWalletsTemplate(),n=this.previewWalletsTemplate(),i=this.recentWalletTemplate(),o=r??n,s=[...e,...o];s=Zn.walletTemplatesWithRecent(s,i);let a=t?o:s,c=a.length>8,u=[];c?u=a.filter(m=>!m.values.includes(Ci.coinbaseWallet)).slice(0,7):u=a;let l=u.slice(0,4),h=u.slice(4,8),d=Boolean(u.length);return J`<w3m-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Re.QRCODE_ICON}"></w3m-modal-header>${d?J`<w3m-modal-content><div class="w3m-grid">${l} ${h.length?J`${h} ${c?J`<w3m-view-all-wallets-button></w3m-view-all-wallets-button>`:null}`:null}</div></w3m-modal-content>`:null}`}};x3.styles=[me.globalCss,Yoe],x3=Qoe([Oe("w3m-mobile-wallet-selection")],x3);Xoe=Ce`:host{all:initial}.w3m-overlay{inset:0;position:fixed;z-index:var(--modal-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3);opacity:0;pointer-events:none}.w3m-open{pointer-events:auto}.w3m-container{position:relative;max-width:360px;width:100%;outline:0}.w3m-card{width:100%;position:relative;transform:translateY(5px);border-radius:30px;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(--color-overlay);background-color:var(--color-bg-1);color:var(--color-fg-1)}@media(max-width:600px){.w3m-container{max-width:440px}.w3m-card{border-radius:40px 40px 0 0}.w3m-overlay{align-items:flex-end}}@media(max-width:600px){.w3m-container{max-width:440px}.w3m-card{transform:translateY(5px);border-radius:40px 40px 0 0}.w3m-overlay{align-items:flex-end}}`,ese=Object.defineProperty,tse=Object.getOwnPropertyDescriptor,$g=(t,e,r,n)=>{for(var i=n>1?void 0:n?tse(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&ese(e,r,i),i},_a=class extends _e{constructor(){if(super(),this.open=!1,this.preload=!0,this.activeChainId=void 0,this.unsubscribeModal=void 0,this.unsubscribeConfig=void 0,this.unwatchAccount=void 0,this.unwatchNetwork=void 0,this.abortController=void 0,me.setTheme(),this.unsubscribeConfig=Kt.subscribe(me.setTheme),this.unsubscribeModal=ar.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()}),!se.state.isStandalone){se.getAccount();let t=se.getSelectedChain();this.activeChainId=t?.id,this.fetchEnsProfile(),this.fetchBalance(),this.unwatchNetwork=Wt.client().watchNetwork(e=>{let r=e.chain;r&&this.activeChainId!==r.id&&(se.setSelectedChain(r),this.activeChainId=r.id,se.resetBalance(),this.fetchBalance())}),this.unwatchAccount=Wt.client().watchAccount(e=>{let{address:r}=se.state;e.address!==r&&(this.fetchEnsProfile(e.address),this.fetchBalance(e.address)),se.setAddress(e.address),se.setIsConnected(e.isConnected)})}this.preloadModalData()}disconnectedCallback(){var t,e,r,n;(t=this.unsubscribeModal)==null||t.call(this),(e=this.unsubscribeConfig)==null||e.call(this),(r=this.unwatchAccount)==null||r.call(this),(n=this.unwatchNetwork)==null||n.call(this)}get overlayEl(){return ue.getShadowRootElement(this,".w3m-overlay")}get containerEl(){return ue.getShadowRootElement(this,".w3m-container")}async fetchEnsProfile(t){try{se.setProfileLoading(!0);let e=t??se.state.address,{id:r}=Wt.client().getDefaultChain();if(e&&r===1){let[n,i]=await Promise.all([Wt.client().fetchEnsName({address:e,chainId:1}),Wt.client().fetchEnsAvatar({address:e,chainId:1})]);i&&await ue.preloadImage(i),se.setProfileName(n),se.setProfileAvatar(i)}}catch(e){Gr.openToast(ue.getErrorMessage(e),"error")}finally{se.setProfileLoading(!1)}}async fetchBalance(t){try{se.setBalanceLoading(!0);let e=t??se.state.address;if(e){let r=await Wt.client().fetchBalance({address:e});se.setBalance({amount:r.formatted,symbol:r.symbol})}}catch(e){Gr.openToast(ue.getErrorMessage(e),"error")}finally{se.setBalanceLoading(!1)}}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("w3m-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="w3m-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}async preloadExplorerData(){var t;let{standaloneChains:e,chains:r,isExplorer:n}=se.state;if(n){let i=e?.join(",");await Promise.all([sr.getPreviewWallets({page:1,entries:10,chains:i,device:Fe.isMobile()?"mobile":"desktop",version:Fe.getWalletConnectVersion()}),sr.getRecomendedWallets()]),se.setIsDataLoaded(!0);let{previewWallets:o,recomendedWallets:s}=sr.state,a=(t=r?.map(u=>ue.getChainIcon(u.id)))!=null?t:[],c=[...o,...s].map(u=>u.image_url.lg);await this.preloadExplorerImages([...a,...c])}else se.setIsDataLoaded(!0)}async preloadExplorerImages(t){t.length&&await Promise.all(t.map(async e=>ue.preloadImage(e)))}async preloadCustomImages(){let t=ue.getCustomImageUrls();t.length&&await Promise.all(t.map(async e=>ue.preloadImage(e)))}async preloadConnectorImages(){let t=ue.getConnectorImageUrls();t.length&&await Promise.all(t.map(async e=>ue.preloadImage(e)))}async preloadModalData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadExplorerData(),this.preloadCustomImages(),this.preloadConnectorImages()]))}catch{Gr.openToast("Failed preloading","error")}}onCloseModal(t){t.target===t.currentTarget&&ar.close()}async onOpenModalEvent(){await this.preloadModalData(),this.toggleBodyScroll(!1);let t=.2;await xi(this.containerEl,{y:0},{duration:0}).finished,xi(this.overlayEl,{opacity:[0,1]},{duration:.2,delay:t}),xi(this.containerEl,ue.isMobileAnimation()?{y:["50vh",0]}:{scale:[.98,1]},{scale:{easing:mu({velocity:.4})},y:{easing:mu({mass:.5})},delay:t}),this.addKeyboardEvents(),this.open=!0}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents(),await Promise.all([xi(this.containerEl,ue.isMobileAnimation()?{y:[0,"50vh"]}:{scale:[1,.98]},{scale:{easing:mu({velocity:0})},y:{easing:mu({mass:.5})}}).finished,xi(this.overlayEl,{opacity:[1,0]},{duration:.2}).finished]),this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?ar.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("W3M-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}render(){let t={"w3m-overlay":!0,"w3m-open":this.open};return J`<div id="w3m-modal" class="${Kr(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="w3m-container" tabindex="0">${this.open?J`<w3m-modal-backcard></w3m-modal-backcard><div class="w3m-card"><w3m-modal-router></w3m-modal-router><w3m-modal-toast></w3m-modal-toast></div>`:null}</div></div>`}};_a.styles=[me.globalCss,Xoe],$g([Ve()],_a.prototype,"open",2),$g([Ve()],_a.prototype,"preload",2),$g([Ve()],_a.prototype,"activeChainId",2),_a=$g([Oe("w3m-modal")],_a);rse=Ce`:host{all:initial}w3m-network-image{margin-left:-6px;margin-right:6px;width:28px;height:28px}`,nse=Object.defineProperty,ise=Object.getOwnPropertyDescriptor,Wg=(t,e,r,n)=>{for(var i=n>1?void 0:n?ise(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&nse(e,r,i),i},wa=class extends _e{constructor(){super(),this.chainId="",this.label="",this.wrongNetwork=!1,this.unsubscribeNetwork=void 0,ue.rejectStandaloneButtonComponent();let{selectedChain:t}=se.state;this.onSetChainData(t),this.unsubscribeNetwork=se.subscribe(({selectedChain:e})=>{this.onSetChainData(e)})}disconnectedCallback(){var t;(t=this.unsubscribeNetwork)==null||t.call(this)}onSetChainData(t){if(t){let{chains:e}=se.state,r=e?.map(n=>n.id);this.chainId=t.id.toString(),this.wrongNetwork=!(r!=null&&r.includes(t.id)),this.label=this.wrongNetwork?"Wrong Network":t.name}}onClick(){ar.open({route:"SelectNetwork"})}render(){var t;let{chains:e}=se.state,r=e&&e.length>1;return J`<w3m-button-big @click="${this.onClick}" ?disabled="${!r}"><w3m-network-image chainId="${un(this.chainId)}"></w3m-network-image><w3m-text variant="medium-normal" color="inverse">${(t=this.label)!=null&&t.length?this.label:"Select Network"}</w3m-text></w3m-button-big>`}};wa.styles=[me.globalCss,rse],Wg([Ve()],wa.prototype,"chainId",2),Wg([Ve()],wa.prototype,"label",2),Wg([Ve()],wa.prototype,"wrongNetwork",2),wa=Wg([Oe("w3m-network-switch")],wa);ose=Ce`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:10px;transition:background-color .2s ease;height:100%;justify-content:flex-start}.w3m-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:15px;justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--color-bg-2);box-shadow:inset 0 0 0 1px var(--color-overlay)}button:hover{background-color:var(--color-overlay)}.w3m-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:8px;border:1px solid var(--color-overlay)}.w3m-icons svg{width:21px;height:21px}.w3m-icons img:nth-child(1),.w3m-icons img:nth-child(2),.w3m-icons svg:nth-child(1),.w3m-icons svg:nth-child(2){margin-bottom:4px}w3m-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--color-bg-3)}#wallet-placeholder-dash{stroke:var(--color-overlay)}`,sse=Object.defineProperty,ase=Object.getOwnPropertyDescriptor,cse=(t,e,r,n)=>{for(var i=n>1?void 0:n?ase(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&sse(e,r,i),i},O3=class extends _e{onClick(t,e){t?Ue.push("WalletExplorer"):e&&Ue.push("WalletFilter")}render(){let{previewWallets:t}=sr.state,e=ue.getCustomWallets(),r=[...t].reverse().slice(0,4),n=[...e].reverse().slice(0,4),i=Boolean(r.length),o=Boolean(n.length);return J`<button @click="${()=>this.onClick(i,o)}"><div class="w3m-icons">${i?r.map(s=>J`<img src="${s.image_url.lg}">`):null} ${o?n.map(s=>{let a=ue.getWalletId(s.id),c=ue.getWalletIcon(a);return c?J`<img src="${c}">`:Re.WALLET_PLACEHOLDER}):null}</div><w3m-text variant="xsmall-normal">View All</w3m-text></button>`}};O3.styles=[me.globalCss,ose],O3=cse([Oe("w3m-view-all-wallets-button")],O3);use=Ce`.w3m-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`,lse=Object.defineProperty,fse=Object.getOwnPropertyDescriptor,VD=(t,e,r,n)=>{for(var i=n>1?void 0:n?fse(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&lse(e,r,i),i},Hg=class extends _e{constructor(){super(),this.uri="",this.createConnectionAndWait()}get overlayEl(){return ue.getShadowRootElement(this,".w3m-qr-container")}async createConnectionAndWait(t=0){var e;try{let{standaloneUri:r}=se.state;r?setTimeout(()=>this.uri=r,0):(await Wt.client().connectWalletConnect(n=>this.uri=n,(e=se.state.selectedChain)==null?void 0:e.id),ar.close())}catch{Gr.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}render(){return J`<div class="w3m-qr-container">${this.uri?J`<w3m-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}"></w3m-qrcode>`:J`<w3m-spinner></w3m-spinner>`}</div>`}};Hg.styles=[me.globalCss,use],VD([Ve()],Hg.prototype,"uri",2),Hg=VD([Oe("w3m-walletconnect-qr")],Hg);hse=Ce`.w3m-profile{display:flex;justify-content:space-between;align-items:flex-start;padding-top:20px}.w3m-connection-badge{background-color:var(--color-bg-2);box-shadow:inset 0 0 0 1px var(--color-overlay);padding:6px 10px 6px 26px;position:relative;border-radius:28px}.w3m-connection-badge::before{content:'';position:absolute;width:10px;height:10px;left:10px;background-color:var(--color-success);border-radius:50%;top:50%;margin-top:-5px;box-shadow:0 1px 4px 1px var(--color-success),inset 0 0 0 1px var(--color-overlay)}.w3m-footer{display:flex;justify-content:space-between}w3m-address-text{margin-top:10px;display:block}.w3m-balance{border-top:1px solid var(--color-bg-2);padding:11px 20px}`,dse=Object.defineProperty,pse=Object.getOwnPropertyDescriptor,gse=(t,e,r,n)=>{for(var i=n>1?void 0:n?pse(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&dse(e,r,i),i},C3=class extends _e{onDisconnect(){ar.close(),Wt.client().disconnect(),se.resetAccount()}async onCopyAddress(){var t;await navigator.clipboard.writeText((t=se.state.address)!=null?t:""),Gr.openToast("Address copied","success")}render(){return J`<w3m-modal-content><div class="w3m-profile"><div class="w3m-info"><w3m-avatar size="medium"></w3m-avatar><w3m-address-text variant="modal"></w3m-address-text></div><div class="w3m-connection-badge"><w3m-text variant="small-normal" color="secondary">Connected</w3m-text></div></div></w3m-modal-content><div class="w3m-balance"><w3m-balance></w3m-balance></div><w3m-modal-footer><div class="w3m-footer"><w3m-account-network-button></w3m-account-network-button><w3m-box-button label="Copy Address" .onClick="${this.onCopyAddress}" .icon="${Re.ACCOUNT_COPY}"></w3m-box-button><w3m-box-button label="Disconnect" .onClick="${this.onDisconnect}" .icon="${Re.ACCOUNT_DISCONNECT}"></w3m-box-button></div></w3m-modal-footer>`}};C3.styles=[me.globalCss,hse],C3=gse([Oe("w3m-account-view")],C3);mse=Object.defineProperty,yse=Object.getOwnPropertyDescriptor,vse=(t,e,r,n)=>{for(var i=n>1?void 0:n?yse(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&mse(e,r,i),i},A3=class extends _e{viewTemplate(){return Fe.isAndroid()?J`<w3m-android-wallet-selection></w3m-android-wallet-selection>`:Fe.isMobile()?J`<w3m-mobile-wallet-selection></w3m-mobile-wallet-selection>`:J`<w3m-desktop-wallet-selection></w3m-desktop-wallet-selection>`}render(){return J`${this.viewTemplate()}<w3m-legal-notice></w3m-legal-notice>`}};A3.styles=[me.globalCss],A3=vse([Oe("w3m-connect-wallet-view")],A3);bse=Ce`.w3m-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}w3m-spinner{margin-right:10px}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}.w3m-install-actions{display:flex}.w3m-install-actions w3m-button{margin:0 5px;opacity:1}`,_se=Object.defineProperty,wse=Object.getOwnPropertyDescriptor,GD=(t,e,r,n)=>{for(var i=n>1?void 0:n?wse(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&_se(e,r,i),i},zg=class extends _e{constructor(){super(),this.uri="",this.createConnectionAndWait()}getRouterData(){var t;let e=(t=Ue.state.data)==null?void 0:t.DesktopConnector;if(!e)throw new Error("Missing router data");return e}onFormatAndRedirect(t){let{native:e,universal:r,name:n}=this.getRouterData();if(e){let i=Fe.formatNativeUrl(e,t,n);Fe.openHref(i)}else if(r){let i=Fe.formatUniversalUrl(r,t,n);Fe.openHref(i,"_blank")}}async createConnectionAndWait(t=0){var e;let{standaloneUri:r}=se.state;if(r)this.onFormatAndRedirect(r);else try{await Wt.client().connectWalletConnect(c=>{this.uri=c,this.onFormatAndRedirect(c)},(e=se.state.selectedChain)==null?void 0:e.id);let{name:n,walletId:i,native:o,universal:s,icon:a}=this.getRouterData();ue.setRecentWallet({name:n,id:i,links:{native:o,universal:s},image:a}),ar.close()}catch{Gr.openToast("Connection request declined","error"),t<2&&this.createConnectionAndWait(t+1)}}onConnectWithMobile(){Ue.push("Qrcode")}onGoToWallet(){let{universal:t,name:e}=this.getRouterData();if(t){let r=Fe.formatUniversalUrl(t,this.uri,e);Fe.openHref(r,"_blank")}}render(){let{name:t,icon:e,universal:r,walletId:n}=this.getRouterData(),i=ue.getWalletName(t);return J`<w3m-modal-header title="${i}"></w3m-modal-header><w3m-modal-content><div class="w3m-wrapper">${e?J`<w3m-wallet-image src="${e}" size="lg"></w3m-wallet-image>`:J`<w3m-wallet-image size="lg" walletid="${un(n)}"></w3m-wallet-image>`}<div class="w3m-connecting-title"><w3m-spinner></w3m-spinner><w3m-text variant="large-bold" color="secondary">${`Continue in ${i}...`}</w3m-text></div><div class="w3m-install-actions"><w3m-button .onClick="${async()=>this.createConnectionAndWait()}" .iconRight="${Re.RETRY_ICON}">Retry</w3m-button>${r?J`<w3m-button .onClick="${this.onGoToWallet.bind(this)}" .iconLeft="${Re.ARROW_UP_RIGHT_ICON}">Go to Wallet</w3m-button>`:J`<w3m-button .onClick="${this.onConnectWithMobile}" .iconLeft="${Re.MOBILE_ICON}">Connect with Mobile</w3m-button>`}</div></div></w3m-modal-content>`}};zg.styles=[me.globalCss,bse],GD([Ve()],zg.prototype,"uri",2),zg=GD([Oe("w3m-desktop-connector-view")],zg);Ese=Ce`.w3m-info-text{margin:5px 0 15px;max-width:320px;text-align:center}.w3m-wallet-item{margin:0 -20px 0 0;padding-right:20px;display:flex;align-items:center;border-bottom:1px solid var(--color-bg-2)}.w3m-wallet-item:last-child{margin-bottom:-20px;border-bottom:0}.w3m-wallet-content{margin-left:20px;height:60px;display:flex;flex:1;align-items:center;justify-content:space-between}.w3m-footer-actions{display:flex;flex-direction:column;align-items:center;padding:20px 0;border-top:1px solid var(--color-bg-2)}w3m-wallet-image{display:block;width:40px;height:40px;border-radius:10px}`,Sse=Object.defineProperty,xse=Object.getOwnPropertyDescriptor,Ose=(t,e,r,n)=>{for(var i=n>1?void 0:n?xse(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Sse(e,r,i),i},I3=class extends _e{constructor(){super(...arguments),this.explorerUrl="https://explorer.walletconnect.com/"}onGet(t){Fe.openHref(t,"_blank")}onExplore(){Fe.openHref(this.explorerUrl,"_blank")}render(){let{recomendedWallets:t}=sr.state,e=ue.getCustomWallets().slice(0,6),r=t.length,n=e.length;return J`<w3m-modal-header title="Get a wallet"></w3m-modal-header><w3m-modal-content>${r?t.map(({name:i,image_url:o,homepage:s})=>J`<div class="w3m-wallet-item"><w3m-wallet-image src="${o.lg}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-normal">${i}</w3m-text><w3m-button .iconRight="${Re.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(s)}">Get</w3m-button></div></div>`):null} ${n?e.map(({name:i,id:o,links:s})=>J`<div class="w3m-wallet-item"><w3m-wallet-image walletId="${o}"></w3m-wallet-image><div class="w3m-wallet-content"><w3m-text variant="medium-normal">${i}</w3m-text><w3m-button .iconRight="${Re.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGet(s.universal)}">Get</w3m-button></div></div>`):null}</w3m-modal-content><div class="w3m-footer-actions"><w3m-text variant="medium-normal">Not what you're looking for?</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With hundreds of wallets out there, there's something for everyone</w3m-text><w3m-button .onClick="${this.onExplore.bind(this)}" .iconRight="${Re.ARROW_UP_RIGHT_ICON}">Explore Wallets</w3m-button></div>`}};I3.styles=[me.globalCss,Ese],I3=Ose([Oe("w3m-get-wallet-view")],I3);Cse=Ce`.w3m-footer-actions{display:flex;justify-content:center}.w3m-footer-actions w3m-button{margin:0 5px}.w3m-info-container{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.w3m-info-container:last-child{margin-bottom:0}.w3m-info-text{margin-top:5px;text-align:center}.w3m-images svg{margin:0 2px 5px;width:55px;height:55px}.help-img-highlight{stroke:var(--color-overlay)}`,Ase=Object.defineProperty,Ise=Object.getOwnPropertyDescriptor,Mse=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ise(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Ase(e,r,i),i},M3=class extends _e{constructor(){super(...arguments),this.learnUrl="https://ethereum.org/en/wallets/"}onGet(){Ue.push("GetWallet")}onLearnMore(){Fe.openHref(this.learnUrl,"_blank")}render(){return J`<w3m-modal-header title="What is a wallet?"></w3m-modal-header><w3m-modal-content><div class="w3m-info-container"><div class="w3m-images">${Re.HELP_CHART_IMG} ${Re.HELP_PAINTING_IMG} ${Re.HELP_ETH_IMG}</div><w3m-text variant="medium-normal">A home for your digital assets</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs.</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Re.HELP_KEY_IMG} ${Re.HELP_USER_IMG} ${Re.HELP_LOCK_IMG}</div><w3m-text variant="medium-normal">One login for all of web3</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">Log in to any app by connecting your wallet. Say goodbye to countless passwords!</w3m-text></div><div class="w3m-info-container"><div class="w3m-images">${Re.HELP_COMPAS_IMG} ${Re.HELP_NOUN_IMG} ${Re.HELP_DAO_IMG}</div><w3m-text variant="medium-normal">Your gateway to a new web</w3m-text><w3m-text variant="small-thin" color="secondary" class="w3m-info-text">With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more.</w3m-text></div><div class="w3m-footer-actions"><w3m-button .onClick="${this.onGet.bind(this)}" .iconLeft="${Re.WALLET_ICON}">Get a Wallet</w3m-button><w3m-button .onClick="${this.onLearnMore.bind(this)}" .iconRight="${Re.ARROW_UP_RIGHT_ICON}">Learn More</w3m-button></div></w3m-modal-content>`}};M3.styles=[me.globalCss,Cse],M3=Mse([Oe("w3m-help-view")],M3);Rse=Ce`.w3m-injected-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:20px}w3m-spinner{margin-right:10px}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-injected-error w3m-button{opacity:1}`,Tse=Object.defineProperty,Pse=Object.getOwnPropertyDescriptor,R3=(t,e,r,n)=>{for(var i=n>1?void 0:n?Pse(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Tse(e,r,i),i},vh=class extends _e{constructor(){super(),this.connecting=!0,this.error=!1,this.connector=Wt.client().getConnectorById("injected"),this.onConnect()}async onConnect(){let{ready:t}=this.connector;t&&(this.error=!1,this.connecting=!0,await ue.handleConnectorConnection("injected",()=>{this.error=!0,this.connecting=!1}))}render(){let t=ue.getWalletName(this.connector.name),e=ue.getWalletId(this.connector.id),r={"w3m-injected-wrapper":!0,"w3m-injected-error":this.error};return J`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><div class="${Kr(r)}"><w3m-wallet-image walletId="${e}" size="lg"></w3m-wallet-image><div class="w3m-connecting-title">${this.connecting?J`<w3m-spinner></w3m-spinner>`:null}<w3m-text variant="large-bold" color="${this.error?"error":"secondary"}">${this.error?"Connection declined":`Continue in ${t}...`}</w3m-text></div><w3m-button .onClick="${this.onConnect.bind(this)}" .disabled="${!this.error}" .iconRight="${Re.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};vh.styles=[me.globalCss,Rse],R3([Ve()],vh.prototype,"connecting",2),R3([Ve()],vh.prototype,"error",2),vh=R3([Oe("w3m-injected-connector-view")],vh);Dse=Ce`.w3m-injected-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}.w3m-install-title{display:flex;align-items:center;justify-content:center;flex-direction:column}.w3m-install-title w3m-text:last-child{margin-top:10px;max-width:240px}.w3m-install-actions{display:flex;margin-top:15px;align-items:center;flex-direction:column}@media(max-width:355px){.w3m-install-actions{flex-direction:column;align-items:center}}w3m-wallet-image{border-radius:15px;width:25%;aspect-ratio:1/1;margin-bottom:20px}w3m-button{opacity:0}.w3m-install-actions w3m-button{margin:5px;opacity:1}.w3m-info-text{text-align:center}`,Nse=Object.defineProperty,kse=Object.getOwnPropertyDescriptor,Lse=(t,e,r,n)=>{for(var i=n>1?void 0:n?kse(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Nse(e,r,i),i},T3=class extends _e{getRouterData(){var t;let e=(t=Ue.state.data)==null?void 0:t.InstallConnector;if(!e)throw new Error("Missing router data");return e}onInstall(){let{url:t}=this.getRouterData();Fe.openHref(t,"_blank")}onMobile(){let{name:t}=this.getRouterData();Ue.push("ConnectWallet"),Gr.openToast(`Scan the code with ${t}`,"success")}render(){let{name:t,id:e,isMobile:r}=this.getRouterData();return J`<w3m-modal-header title="${t}"></w3m-modal-header><w3m-modal-content><div class="w3m-injected-wrapper"><w3m-wallet-image walletId="${e}" size="lg"></w3m-wallet-image><div class="w3m-install-title"><w3m-text variant="large-bold">Install ${t}</w3m-text><w3m-text color="secondary" variant="medium-thin" class="w3m-info-text">To connect ${t}, install the browser extension.</w3m-text></div><div class="w3m-install-actions"><w3m-button .onClick="${this.onInstall.bind(this)}" .iconLeft="${Re.ARROW_DOWN_ICON}">Install Extension</w3m-button>${r?J`<w3m-button .onClick="${this.onMobile.bind(this)}" .iconLeft="${Re.MOBILE_ICON}">${t} Mobile</w3m-button>`:null}</div></div></w3m-modal-content>`}};T3.styles=[me.globalCss,Dse],T3=Lse([Oe("w3m-install-connector-view")],T3);jse=Object.defineProperty,Bse=Object.getOwnPropertyDescriptor,qse=(t,e,r,n)=>{for(var i=n>1?void 0:n?Bse(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&jse(e,r,i),i},P3=class extends _e{render(){return J`<w3m-modal-header title="Scan the code" .onAction="${ue.handleUriCopy}" .actionIcon="${Re.COPY_ICON}"></w3m-modal-header><w3m-modal-content><w3m-walletconnect-qr></w3m-walletconnect-qr></w3m-modal-content>`}};P3.styles=[me.globalCss],P3=qse([Oe("w3m-qrcode-view")],P3);Fse=Ce`.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);margin:-5px -10px;justify-content:space-between}`,Use=Object.defineProperty,$se=Object.getOwnPropertyDescriptor,Wse=(t,e,r,n)=>{for(var i=n>1?void 0:n?$se(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Use(e,r,i),i},D3=class extends _e{onSelectChain(t){let{isConnected:e,selectedChain:r}=se.state;e?r?.id===t.id?Ue.replace("Account"):Ue.push("SwitchNetwork",{SwitchNetwork:t}):(Ue.push("ConnectWallet"),se.setSelectedChain(t))}render(){let{chains:t}=se.state;return J`<w3m-modal-header title="Select network"></w3m-modal-header><w3m-modal-content><div class="w3m-grid">${t?.map(e=>J`<w3m-network-button name="${e.name}" chainId="${e.id}" .onClick="${()=>this.onSelectChain(e)}">${e.name}</w3m-network-button>`)}</div></w3m-modal-content>`}};D3.styles=[me.globalCss,Fse],D3=Wse([Oe("w3m-select-network-view")],D3);Hse=Ce`.w3m-wrapper{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;flex-direction:column}.w3m-connecting-title{display:flex;align-items:center;justify-content:center;margin-bottom:16px}w3m-spinner{margin-right:10px}w3m-network-image{width:96px;height:96px;margin-bottom:20px}w3m-button{opacity:0}.w3m-error w3m-button{opacity:1}`,zse=Object.defineProperty,Vse=Object.getOwnPropertyDescriptor,KD=(t,e,r,n)=>{for(var i=n>1?void 0:n?Vse(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&zse(e,r,i),i},Vg=class extends _e{constructor(){super(),this.error=!1,this.onSwitchNetwork()}getRouterData(){var t;let e=(t=Ue.state.data)==null?void 0:t.SwitchNetwork;if(!e)throw new Error("Missing router data");return e}async onSwitchNetwork(){try{this.error=!1;let t=this.getRouterData();await Wt.client().switchNetwork({chainId:t.id}),se.setSelectedChain(t),Ue.replace("Account")}catch{this.error=!0}}render(){let{id:t,name:e}=this.getRouterData(),r={"w3m-wrapper":!0,"w3m-error":this.error};return J`<w3m-modal-header title="${`Connect to ${e}`}"></w3m-modal-header><w3m-modal-content><div class="${Kr(r)}"><w3m-network-image chainId="${t}"></w3m-network-image><div class="w3m-connecting-title">${this.error?null:J`<w3m-spinner></w3m-spinner>`}<w3m-text variant="large-bold" color="${this.error?"error":"secondary"}">${this.error?"Connection declined":"Approve in your wallet"}</w3m-text></div><w3m-button .onClick="${this.onSwitchNetwork.bind(this)}" .disabled="${!this.error}" .iconRight="${Re.RETRY_ICON}">Try Again</w3m-button></div></w3m-modal-content>`}};Vg.styles=[me.globalCss,Hse],KD([Ve()],Vg.prototype,"error",2),Vg=KD([Oe("w3m-switch-network-view")],Vg);Gse=Ce`w3m-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--color-bg-1);background:linear-gradient(var(--color-bg-1),rgba(255,255,255,0))}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.w3m-empty,.w3m-loading{display:flex}.w3m-loading .w3m-placeholder-block{height:100%}.w3m-end-reached .w3m-placeholder-block{height:0;opacity:0}.w3m-empty .w3m-placeholder-block{opacity:1;height:100%}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`,Kse=Object.defineProperty,Yse=Object.getOwnPropertyDescriptor,bh=(t,e,r,n)=>{for(var i=n>1?void 0:n?Yse(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Kse(e,r,i),i},N3=40,ya=class extends _e{constructor(){super(...arguments),this.loading=!sr.state.wallets.listings.length,this.firstFetch=!sr.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=ue.debounce(t=>{t.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=t,sr.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),sr.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return ue.getShadowRootElement(this,".w3m-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){let{wallets:t,search:e}=sr.state,{listings:r,total:n}=this.search?e:t;return n<=N3||r.length>=n}async fetchWallets(){var t;let{wallets:e,search:r}=sr.state,n=ue.getExtensionWallets(),{listings:i,total:o,page:s}=this.search?r:e;if(!this.endReached&&(this.firstFetch||o>N3&&i.length<o))try{this.loading=!0;let a=(t=se.state.standaloneChains)==null?void 0:t.join(","),{listings:c}=await sr.getPaginatedWallets({page:this.firstFetch?1:s+1,entries:N3,device:Fe.isMobile()?"mobile":"desktop",search:this.search,version:Fe.getWalletConnectVersion(),chains:a}),u=c.map(({image_url:h})=>h.lg),l=n.map(({id:h})=>ue.getWalletIcon(h));await Promise.all([...u.map(async h=>ue.preloadImage(h)),...l.map(async h=>ue.preloadImage(h)),Fe.wait(300)]),this.endReached=this.isLastPage()}catch(a){Gr.openToast(ue.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}async onConnectPlatform(t){if(Fe.isMobile()){let{id:e,image_url:r}=t,{native:n,universal:i}=t.mobile;await ue.handleMobileLinking({links:{native:n,universal:i},name:t.name,id:e,image:r.lg})}else Ue.push("DesktopConnector",{DesktopConnector:{name:t.name,icon:t.image_url.lg,universal:t.desktop.universal||t.homepage,native:t.desktop.native}})}onConnectExtension(t){ue.getWalletId("")===t.id?Ue.push("InjectedConnector"):Ue.push("InstallConnector",{InstallConnector:t})}onSearchChange(t){let{value:e}=t.target;this.searchDebounce(e)}coinbaseConnectorTemplate(){try{let t=Wt.client().getConnectorById(Ci.coinbaseWallet);return J`<w3m-wallet-button name="${t.name}" walletId="${t.id}" .onClick="${async()=>ue.handleConnectorConnection(Ci.coinbaseWallet)}"></w3m-wallet-button>`}catch{return null}}render(){let{wallets:t,search:e}=sr.state,{isStandalone:r}=se.state,{listings:n}=this.search?e:t;n=Zn.allowedExplorerListings(n);let i=this.loading&&!n.length,o=this.search.length>=3,s=!i&&(!o||ue.caseSafeIncludes(Ci.coinbaseWallet,this.search)),a=!r&&!Fe.isMobile()?ue.getExtensionWallets():[];o&&(a=a.filter(({name:h})=>ue.caseSafeIncludes(h,this.search)));let c=!this.loading&&!n.length&&!a.length&&!s,u=Math.max(a.length,n.length),l={"w3m-loading":i,"w3m-end-reached":this.endReached||!this.loading,"w3m-empty":c};return J`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content class="${Kr(l)}"><div class="w3m-grid">${i?null:[...Array(u)].map((h,d)=>J`${a[d]?J`<w3m-wallet-button name="${a[d].name}" walletId="${a[d].id}" .onClick="${()=>this.onConnectExtension(a[d])}"></w3m-wallet-button>`:null} ${n[d]?J`<w3m-wallet-button src="${n[d].image_url.lg}" name="${n[d].name}" walletId="${n[d].id}" .onClick="${async()=>this.onConnectPlatform(n[d])}"></w3m-wallet-button>`:null}`)} ${s?this.coinbaseConnectorTemplate():null}</div><div class="w3m-placeholder-block">${c?J`<w3m-text variant="large-bold" color="secondary">No results found</w3m-text>`:null} ${!c&&this.loading?J`<w3m-spinner></w3m-spinner>`:null}</div></w3m-modal-content>`}};ya.styles=[me.globalCss,Gse],bh([Ve()],ya.prototype,"loading",2),bh([Ve()],ya.prototype,"firstFetch",2),bh([Ve()],ya.prototype,"search",2),bh([Ve()],ya.prototype,"endReached",2),ya=bh([Oe("w3m-wallet-explorer-view")],ya);Zse=Ce`w3m-modal-content{display:flex;max-height:55vh;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}w3m-modal-content::after,w3m-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}w3m-modal-content::before{box-shadow:0 -1px 0 0 var(--color-bg-1);background:linear-gradient(var(--color-bg-1),transparent)}w3m-modal-content::after{box-shadow:0 1px 0 0 var(--color-bg-1);background:linear-gradient(transparent,var(--color-bg-1));top:calc(100% - 20px)}w3m-modal-content::-webkit-scrollbar{display:none}.w3m-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px}w3m-wallet-button{margin:calc((100% - 60px)/ 3) 0}`,Jse=Object.defineProperty,Qse=Object.getOwnPropertyDescriptor,YD=(t,e,r,n)=>{for(var i=n>1?void 0:n?Qse(e,r):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(n?s(e,r,i):s(i))||i);return n&&i&&Jse(e,r,i),i},Gg=class extends _e{constructor(){super(...arguments),this.search=""}async onConnectPlatform({name:t,universal:e,native:r,walletId:n}){Fe.isMobile()?await ue.handleMobileLinking({links:{native:r,universal:e},name:t,id:n}):Ue.push("DesktopConnector",{DesktopConnector:{name:t,walletId:n,universal:e,native:r}})}onSearchChange(t){let{value:e}=t.target;this.search=e}render(){let t=ue.getCustomWallets(),e=this.search.length?t.filter(r=>ue.caseSafeIncludes(r.name,this.search)):t;return J`<w3m-modal-header><w3m-search-input .onChange="${this.onSearchChange.bind(this)}"></w3m-search-input></w3m-modal-header><w3m-modal-content><div class="w3m-grid">${e.map(({id:r,name:n,links:{native:i,universal:o}})=>J`<w3m-wallet-button walletId="${r}" name="${n}" .onClick="${async()=>this.onConnectPlatform({name:n,universal:o,native:i,walletId:r})}"></w3m-wallet-button>`)}</div></w3m-modal-content>`}};Gg.styles=[me.globalCss,Zse],YD([Ve()],Gg.prototype,"search",2),Gg=YD([Oe("w3m-wallet-filter-view")],Gg)});var tN=_(Yg=>{"use strict";Object.defineProperty(Yg,"__esModule",{value:!0});Yg.walletLogo=void 0;var nae=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Yg.walletLogo=nae});var rN=_(Zg=>{"use strict";Object.defineProperty(Zg,"__esModule",{value:!0});Zg.ScopedLocalStorage=void 0;var L3=class{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){let e=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){let i=localStorage.key(n);typeof i=="string"&&i.startsWith(e)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}};Zg.ScopedLocalStorage=L3});var wh=_(B3=>{"use strict";Object.defineProperty(B3,"__esModule",{value:!0});var iae=yn();function nN(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function oae(t){let e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}var j3=class extends iae.EventEmitter{emit(e,...r){let n=e==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let s;if(r.length>0&&([s]=r),s instanceof Error)throw s;let a=new Error(`Unhandled error.${s?` (${s.message})`:""}`);throw a.context=s,a}let o=i[e];if(o===void 0)return!1;if(typeof o=="function")nN(o,this,r);else{let s=o.length,a=oae(o);for(let c=0;c<s;c+=1)nN(a[c],this,r)}return!0}};B3.default=j3});var iN=_(()=>{});var Eh=_((oN,q3)=>{(function(t,e){"use strict";function r(E,f){if(!E)throw new Error(f||"Assertion failed")}function n(E,f){E.super_=f;var g=function(){};g.prototype=f.prototype,E.prototype=new g,E.prototype.constructor=E}function i(E,f,g){if(i.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((f==="le"||f==="be")&&(g=f,f=10),this._init(E||0,f||10,g||"be"))}typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=iN().Buffer}catch{}i.isBN=function(f){return f instanceof i?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===i.wordSize&&Array.isArray(f.words)},i.max=function(f,g){return f.cmp(g)>0?f:g},i.min=function(f,g){return f.cmp(g)<0?f:g},i.prototype._init=function(f,g,y){if(typeof f=="number")return this._initNumber(f,g,y);if(typeof f=="object")return this._initArray(f,g,y);g==="hex"&&(g=16),r(g===(g|0)&&g>=2&&g<=36),f=f.toString().replace(/\s+/g,"");var b=0;f[0]==="-"&&(b++,this.negative=1),b<f.length&&(g===16?this._parseHex(f,b,y):(this._parseBase(f,g,b),y==="le"&&this._initArray(this.toArray(),g,y)))},i.prototype._initNumber=function(f,g,y){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):(r(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),g,y)},i.prototype._initArray=function(f,g,y){if(r(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 b=0;b<this.length;b++)this.words[b]=0;var w,R,T=0;if(y==="be")for(b=f.length-1,w=0;b>=0;b-=3)R=f[b]|f[b-1]<<8|f[b-2]<<16,this.words[w]|=R<<T&67108863,this.words[w+1]=R>>>26-T&67108863,T+=24,T>=26&&(T-=26,w++);else if(y==="le")for(b=0,w=0;b<f.length;b+=3)R=f[b]|f[b+1]<<8|f[b+2]<<16,this.words[w]|=R<<T&67108863,this.words[w+1]=R>>>26-T&67108863,T+=24,T>=26&&(T-=26,w++);return this._strip()};function s(E,f){var g=E.charCodeAt(f);if(g>=48&&g<=57)return g-48;if(g>=65&&g<=70)return g-55;if(g>=97&&g<=102)return g-87;r(!1,"Invalid character in "+E)}function a(E,f,g){var y=s(E,g);return g-1>=f&&(y|=s(E,g-1)<<4),y}i.prototype._parseHex=function(f,g,y){this.length=Math.ceil((f.length-g)/6),this.words=new Array(this.length);for(var b=0;b<this.length;b++)this.words[b]=0;var w=0,R=0,T;if(y==="be")for(b=f.length-1;b>=g;b-=2)T=a(f,g,b)<<w,this.words[R]|=T&67108863,w>=18?(w-=18,R+=1,this.words[R]|=T>>>26):w+=8;else{var S=f.length-g;for(b=S%2===0?g+1:g;b<f.length;b+=2)T=a(f,g,b)<<w,this.words[R]|=T&67108863,w>=18?(w-=18,R+=1,this.words[R]|=T>>>26):w+=8}this._strip()};function c(E,f,g,y){for(var b=0,w=0,R=Math.min(E.length,g),T=f;T<R;T++){var S=E.charCodeAt(T)-48;b*=y,S>=49?w=S-49+10:S>=17?w=S-17+10:w=S,r(S>=0&&w<y,"Invalid character"),b+=w}return b}i.prototype._parseBase=function(f,g,y){this.words=[0],this.length=1;for(var b=0,w=1;w<=67108863;w*=g)b++;b--,w=w/g|0;for(var R=f.length-y,T=R%b,S=Math.min(R,R-T)+y,p=0,A=y;A<S;A+=b)p=c(f,A,A+b,g),this.imuln(w),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(T!==0){var Y=1;for(p=c(f,A,f.length,g),A=0;A<T;A++)Y*=g;this.imuln(Y),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this._strip()},i.prototype.copy=function(f){f.words=new Array(this.length);for(var g=0;g<this.length;g++)f.words[g]=this.words[g];f.length=this.length,f.negative=this.negative,f.red=this.red};function u(E,f){E.words=f.words,E.length=f.length,E.negative=f.negative,E.red=f.red}if(i.prototype._move=function(f){u(f,this)},i.prototype.clone=function(){var f=new i(null);return this.copy(f),f},i.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch{i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","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"],d=[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];i.prototype.toString=function(f,g){f=f||10,g=g|0||1;var y;if(f===16||f==="hex"){y="";for(var b=0,w=0,R=0;R<this.length;R++){var T=this.words[R],S=((T<<b|w)&16777215).toString(16);w=T>>>24-b&16777215,b+=2,b>=26&&(b-=26,R--),w!==0||R!==this.length-1?y=h[6-S.length]+S+y:y=S+y}for(w!==0&&(y=w.toString(16)+y);y.length%g!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(f===(f|0)&&f>=2&&f<=36){var p=d[f],A=m[f];y="";var Y=this.clone();for(Y.negative=0;!Y.isZero();){var Z=Y.modrn(A).toString(f);Y=Y.idivn(A),Y.isZero()?y=Z+y:y=h[p-Z.length]+Z+y}for(this.isZero()&&(y="0"+y);y.length%g!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(f,g){return this.toArrayLike(o,f,g)}),i.prototype.toArray=function(f,g){return this.toArrayLike(Array,f,g)};var v=function(f,g){return f.allocUnsafe?f.allocUnsafe(g):new f(g)};i.prototype.toArrayLike=function(f,g,y){this._strip();var b=this.byteLength(),w=y||Math.max(1,b);r(b<=w,"byte array longer than desired length"),r(w>0,"Requested array length <= 0");var R=v(f,w),T=g==="le"?"LE":"BE";return this["_toArrayLike"+T](R,b),R},i.prototype._toArrayLikeLE=function(f,g){for(var y=0,b=0,w=0,R=0;w<this.length;w++){var T=this.words[w]<<R|b;f[y++]=T&255,y<f.length&&(f[y++]=T>>8&255),y<f.length&&(f[y++]=T>>16&255),R===6?(y<f.length&&(f[y++]=T>>24&255),b=0,R=0):(b=T>>>24,R+=2)}if(y<f.length)for(f[y++]=b;y<f.length;)f[y++]=0},i.prototype._toArrayLikeBE=function(f,g){for(var y=f.length-1,b=0,w=0,R=0;w<this.length;w++){var T=this.words[w]<<R|b;f[y--]=T&255,y>=0&&(f[y--]=T>>8&255),y>=0&&(f[y--]=T>>16&255),R===6?(y>=0&&(f[y--]=T>>24&255),b=0,R=0):(b=T>>>24,R+=2)}if(y>=0)for(f[y--]=b;y>=0;)f[y--]=0},Math.clz32?i.prototype._countBits=function(f){return 32-Math.clz32(f)}:i.prototype._countBits=function(f){var g=f,y=0;return g>=4096&&(y+=13,g>>>=13),g>=64&&(y+=7,g>>>=7),g>=8&&(y+=4,g>>>=4),g>=2&&(y+=2,g>>>=2),y+g},i.prototype._zeroBits=function(f){if(f===0)return 26;var g=f,y=0;return(g&8191)===0&&(y+=13,g>>>=13),(g&127)===0&&(y+=7,g>>>=7),(g&15)===0&&(y+=4,g>>>=4),(g&3)===0&&(y+=2,g>>>=2),(g&1)===0&&y++,y},i.prototype.bitLength=function(){var f=this.words[this.length-1],g=this._countBits(f);return(this.length-1)*26+g};function x(E){for(var f=new Array(E.bitLength()),g=0;g<f.length;g++){var y=g/26|0,b=g%26;f[g]=E.words[y]>>>b&1}return f}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,g=0;g<this.length;g++){var y=this._zeroBits(this.words[g]);if(f+=y,y!==26)break}return f},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},i.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var g=0;g<f.length;g++)this.words[g]=this.words[g]|f.words[g];return this._strip()},i.prototype.ior=function(f){return r((this.negative|f.negative)===0),this.iuor(f)},i.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},i.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},i.prototype.iuand=function(f){var g;this.length>f.length?g=f:g=this;for(var y=0;y<g.length;y++)this.words[y]=this.words[y]&f.words[y];return this.length=g.length,this._strip()},i.prototype.iand=function(f){return r((this.negative|f.negative)===0),this.iuand(f)},i.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},i.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},i.prototype.iuxor=function(f){var g,y;this.length>f.length?(g=this,y=f):(g=f,y=this);for(var b=0;b<y.length;b++)this.words[b]=g.words[b]^y.words[b];if(this!==g)for(;b<g.length;b++)this.words[b]=g.words[b];return this.length=g.length,this._strip()},i.prototype.ixor=function(f){return r((this.negative|f.negative)===0),this.iuxor(f)},i.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},i.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},i.prototype.inotn=function(f){r(typeof f=="number"&&f>=0);var g=Math.ceil(f/26)|0,y=f%26;this._expand(g),y>0&&g--;for(var b=0;b<g;b++)this.words[b]=~this.words[b]&67108863;return y>0&&(this.words[b]=~this.words[b]&67108863>>26-y),this._strip()},i.prototype.notn=function(f){return this.clone().inotn(f)},i.prototype.setn=function(f,g){r(typeof f=="number"&&f>=0);var y=f/26|0,b=f%26;return this._expand(y+1),g?this.words[y]=this.words[y]|1<<b:this.words[y]=this.words[y]&~(1<<b),this._strip()},i.prototype.iadd=function(f){var g;if(this.negative!==0&&f.negative===0)return this.negative=0,g=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,g=this.isub(f),f.negative=1,g._normSign();var y,b;this.length>f.length?(y=this,b=f):(y=f,b=this);for(var w=0,R=0;R<b.length;R++)g=(y.words[R]|0)+(b.words[R]|0)+w,this.words[R]=g&67108863,w=g>>>26;for(;w!==0&&R<y.length;R++)g=(y.words[R]|0)+w,this.words[R]=g&67108863,w=g>>>26;if(this.length=y.length,w!==0)this.words[this.length]=w,this.length++;else if(y!==this)for(;R<y.length;R++)this.words[R]=y.words[R];return this},i.prototype.add=function(f){var g;return f.negative!==0&&this.negative===0?(f.negative=0,g=this.sub(f),f.negative^=1,g):f.negative===0&&this.negative!==0?(this.negative=0,g=f.sub(this),this.negative=1,g):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},i.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var g=this.iadd(f);return f.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var y=this.cmp(f);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var b,w;y>0?(b=this,w=f):(b=f,w=this);for(var R=0,T=0;T<w.length;T++)g=(b.words[T]|0)-(w.words[T]|0)+R,R=g>>26,this.words[T]=g&67108863;for(;R!==0&&T<b.length;T++)g=(b.words[T]|0)+R,R=g>>26,this.words[T]=g&67108863;if(R===0&&T<b.length&&b!==this)for(;T<b.length;T++)this.words[T]=b.words[T];return this.length=Math.max(this.length,T),b!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(f){return this.clone().isub(f)};function O(E,f,g){g.negative=f.negative^E.negative;var y=E.length+f.length|0;g.length=y,y=y-1|0;var b=E.words[0]|0,w=f.words[0]|0,R=b*w,T=R&67108863,S=R/67108864|0;g.words[0]=T;for(var p=1;p<y;p++){for(var A=S>>>26,Y=S&67108863,Z=Math.min(p,f.length-1),G=Math.max(0,p-E.length+1);G<=Z;G++){var X=p-G|0;b=E.words[X]|0,w=f.words[G]|0,R=b*w+Y,A+=R/67108864|0,Y=R&67108863}g.words[p]=Y|0,S=A|0}return S!==0?g.words[p]=S|0:g.length--,g._strip()}var I=function(f,g,y){var b=f.words,w=g.words,R=y.words,T=0,S,p,A,Y=b[0]|0,Z=Y&8191,G=Y>>>13,X=b[1]|0,ae=X&8191,fe=X>>>13,Ee=b[2]|0,he=Ee&8191,de=Ee>>>13,Te=b[3]|0,ye=Te&8191,ve=Te>>>13,tn=b[4]|0,qt=tn&8191,mt=tn>>>13,si=b[5]|0,at=si&8191,ct=si>>>13,Bi=b[6]|0,yt=Bi&8191,vt=Bi>>>13,Po=b[7]|0,bt=Po&8191,_t=Po>>>13,qi=b[8]|0,ut=qi&8191,lt=qi>>>13,Fi=b[9]|0,ft=Fi&8191,ht=Fi>>>13,Ui=w[0]|0,rt=Ui&8191,wt=Ui>>>13,Do=w[1]|0,nt=Do&8191,dt=Do>>>13,No=w[2]|0,Ke=No&8191,Et=No>>>13,ko=w[3]|0,pt=ko&8191,St=ko>>>13,Lo=w[4]|0,xt=Lo&8191,Ot=Lo>>>13,jo=w[5]|0,Ct=jo&8191,At=jo>>>13,Bo=w[6]|0,It=Bo&8191,Mt=Bo>>>13,$i=w[7]|0,Rt=$i&8191,Tt=$i>>>13,qo=w[8]|0,Pt=qo&8191,Dt=qo>>>13,Fo=w[9]|0,Nt=Fo&8191,kt=Fo>>>13;y.negative=f.negative^g.negative,y.length=19,S=Math.imul(Z,rt),p=Math.imul(Z,wt),p=p+Math.imul(G,rt)|0,A=Math.imul(G,wt);var Wi=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,S=Math.imul(ae,rt),p=Math.imul(ae,wt),p=p+Math.imul(fe,rt)|0,A=Math.imul(fe,wt),S=S+Math.imul(Z,nt)|0,p=p+Math.imul(Z,dt)|0,p=p+Math.imul(G,nt)|0,A=A+Math.imul(G,dt)|0;var Hi=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(Hi>>>26)|0,Hi&=67108863,S=Math.imul(he,rt),p=Math.imul(he,wt),p=p+Math.imul(de,rt)|0,A=Math.imul(de,wt),S=S+Math.imul(ae,nt)|0,p=p+Math.imul(ae,dt)|0,p=p+Math.imul(fe,nt)|0,A=A+Math.imul(fe,dt)|0,S=S+Math.imul(Z,Ke)|0,p=p+Math.imul(Z,Et)|0,p=p+Math.imul(G,Ke)|0,A=A+Math.imul(G,Et)|0;var zi=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(zi>>>26)|0,zi&=67108863,S=Math.imul(ye,rt),p=Math.imul(ye,wt),p=p+Math.imul(ve,rt)|0,A=Math.imul(ve,wt),S=S+Math.imul(he,nt)|0,p=p+Math.imul(he,dt)|0,p=p+Math.imul(de,nt)|0,A=A+Math.imul(de,dt)|0,S=S+Math.imul(ae,Ke)|0,p=p+Math.imul(ae,Et)|0,p=p+Math.imul(fe,Ke)|0,A=A+Math.imul(fe,Et)|0,S=S+Math.imul(Z,pt)|0,p=p+Math.imul(Z,St)|0,p=p+Math.imul(G,pt)|0,A=A+Math.imul(G,St)|0;var Vi=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,S=Math.imul(qt,rt),p=Math.imul(qt,wt),p=p+Math.imul(mt,rt)|0,A=Math.imul(mt,wt),S=S+Math.imul(ye,nt)|0,p=p+Math.imul(ye,dt)|0,p=p+Math.imul(ve,nt)|0,A=A+Math.imul(ve,dt)|0,S=S+Math.imul(he,Ke)|0,p=p+Math.imul(he,Et)|0,p=p+Math.imul(de,Ke)|0,A=A+Math.imul(de,Et)|0,S=S+Math.imul(ae,pt)|0,p=p+Math.imul(ae,St)|0,p=p+Math.imul(fe,pt)|0,A=A+Math.imul(fe,St)|0,S=S+Math.imul(Z,xt)|0,p=p+Math.imul(Z,Ot)|0,p=p+Math.imul(G,xt)|0,A=A+Math.imul(G,Ot)|0;var Gi=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,S=Math.imul(at,rt),p=Math.imul(at,wt),p=p+Math.imul(ct,rt)|0,A=Math.imul(ct,wt),S=S+Math.imul(qt,nt)|0,p=p+Math.imul(qt,dt)|0,p=p+Math.imul(mt,nt)|0,A=A+Math.imul(mt,dt)|0,S=S+Math.imul(ye,Ke)|0,p=p+Math.imul(ye,Et)|0,p=p+Math.imul(ve,Ke)|0,A=A+Math.imul(ve,Et)|0,S=S+Math.imul(he,pt)|0,p=p+Math.imul(he,St)|0,p=p+Math.imul(de,pt)|0,A=A+Math.imul(de,St)|0,S=S+Math.imul(ae,xt)|0,p=p+Math.imul(ae,Ot)|0,p=p+Math.imul(fe,xt)|0,A=A+Math.imul(fe,Ot)|0,S=S+Math.imul(Z,Ct)|0,p=p+Math.imul(Z,At)|0,p=p+Math.imul(G,Ct)|0,A=A+Math.imul(G,At)|0;var Ki=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(Ki>>>26)|0,Ki&=67108863,S=Math.imul(yt,rt),p=Math.imul(yt,wt),p=p+Math.imul(vt,rt)|0,A=Math.imul(vt,wt),S=S+Math.imul(at,nt)|0,p=p+Math.imul(at,dt)|0,p=p+Math.imul(ct,nt)|0,A=A+Math.imul(ct,dt)|0,S=S+Math.imul(qt,Ke)|0,p=p+Math.imul(qt,Et)|0,p=p+Math.imul(mt,Ke)|0,A=A+Math.imul(mt,Et)|0,S=S+Math.imul(ye,pt)|0,p=p+Math.imul(ye,St)|0,p=p+Math.imul(ve,pt)|0,A=A+Math.imul(ve,St)|0,S=S+Math.imul(he,xt)|0,p=p+Math.imul(he,Ot)|0,p=p+Math.imul(de,xt)|0,A=A+Math.imul(de,Ot)|0,S=S+Math.imul(ae,Ct)|0,p=p+Math.imul(ae,At)|0,p=p+Math.imul(fe,Ct)|0,A=A+Math.imul(fe,At)|0,S=S+Math.imul(Z,It)|0,p=p+Math.imul(Z,Mt)|0,p=p+Math.imul(G,It)|0,A=A+Math.imul(G,Mt)|0;var Yi=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(Yi>>>26)|0,Yi&=67108863,S=Math.imul(bt,rt),p=Math.imul(bt,wt),p=p+Math.imul(_t,rt)|0,A=Math.imul(_t,wt),S=S+Math.imul(yt,nt)|0,p=p+Math.imul(yt,dt)|0,p=p+Math.imul(vt,nt)|0,A=A+Math.imul(vt,dt)|0,S=S+Math.imul(at,Ke)|0,p=p+Math.imul(at,Et)|0,p=p+Math.imul(ct,Ke)|0,A=A+Math.imul(ct,Et)|0,S=S+Math.imul(qt,pt)|0,p=p+Math.imul(qt,St)|0,p=p+Math.imul(mt,pt)|0,A=A+Math.imul(mt,St)|0,S=S+Math.imul(ye,xt)|0,p=p+Math.imul(ye,Ot)|0,p=p+Math.imul(ve,xt)|0,A=A+Math.imul(ve,Ot)|0,S=S+Math.imul(he,Ct)|0,p=p+Math.imul(he,At)|0,p=p+Math.imul(de,Ct)|0,A=A+Math.imul(de,At)|0,S=S+Math.imul(ae,It)|0,p=p+Math.imul(ae,Mt)|0,p=p+Math.imul(fe,It)|0,A=A+Math.imul(fe,Mt)|0,S=S+Math.imul(Z,Rt)|0,p=p+Math.imul(Z,Tt)|0,p=p+Math.imul(G,Rt)|0,A=A+Math.imul(G,Tt)|0;var ai=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(ai>>>26)|0,ai&=67108863,S=Math.imul(ut,rt),p=Math.imul(ut,wt),p=p+Math.imul(lt,rt)|0,A=Math.imul(lt,wt),S=S+Math.imul(bt,nt)|0,p=p+Math.imul(bt,dt)|0,p=p+Math.imul(_t,nt)|0,A=A+Math.imul(_t,dt)|0,S=S+Math.imul(yt,Ke)|0,p=p+Math.imul(yt,Et)|0,p=p+Math.imul(vt,Ke)|0,A=A+Math.imul(vt,Et)|0,S=S+Math.imul(at,pt)|0,p=p+Math.imul(at,St)|0,p=p+Math.imul(ct,pt)|0,A=A+Math.imul(ct,St)|0,S=S+Math.imul(qt,xt)|0,p=p+Math.imul(qt,Ot)|0,p=p+Math.imul(mt,xt)|0,A=A+Math.imul(mt,Ot)|0,S=S+Math.imul(ye,Ct)|0,p=p+Math.imul(ye,At)|0,p=p+Math.imul(ve,Ct)|0,A=A+Math.imul(ve,At)|0,S=S+Math.imul(he,It)|0,p=p+Math.imul(he,Mt)|0,p=p+Math.imul(de,It)|0,A=A+Math.imul(de,Mt)|0,S=S+Math.imul(ae,Rt)|0,p=p+Math.imul(ae,Tt)|0,p=p+Math.imul(fe,Rt)|0,A=A+Math.imul(fe,Tt)|0,S=S+Math.imul(Z,Pt)|0,p=p+Math.imul(Z,Dt)|0,p=p+Math.imul(G,Pt)|0,A=A+Math.imul(G,Dt)|0;var pn=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(pn>>>26)|0,pn&=67108863,S=Math.imul(ft,rt),p=Math.imul(ft,wt),p=p+Math.imul(ht,rt)|0,A=Math.imul(ht,wt),S=S+Math.imul(ut,nt)|0,p=p+Math.imul(ut,dt)|0,p=p+Math.imul(lt,nt)|0,A=A+Math.imul(lt,dt)|0,S=S+Math.imul(bt,Ke)|0,p=p+Math.imul(bt,Et)|0,p=p+Math.imul(_t,Ke)|0,A=A+Math.imul(_t,Et)|0,S=S+Math.imul(yt,pt)|0,p=p+Math.imul(yt,St)|0,p=p+Math.imul(vt,pt)|0,A=A+Math.imul(vt,St)|0,S=S+Math.imul(at,xt)|0,p=p+Math.imul(at,Ot)|0,p=p+Math.imul(ct,xt)|0,A=A+Math.imul(ct,Ot)|0,S=S+Math.imul(qt,Ct)|0,p=p+Math.imul(qt,At)|0,p=p+Math.imul(mt,Ct)|0,A=A+Math.imul(mt,At)|0,S=S+Math.imul(ye,It)|0,p=p+Math.imul(ye,Mt)|0,p=p+Math.imul(ve,It)|0,A=A+Math.imul(ve,Mt)|0,S=S+Math.imul(he,Rt)|0,p=p+Math.imul(he,Tt)|0,p=p+Math.imul(de,Rt)|0,A=A+Math.imul(de,Tt)|0,S=S+Math.imul(ae,Pt)|0,p=p+Math.imul(ae,Dt)|0,p=p+Math.imul(fe,Pt)|0,A=A+Math.imul(fe,Dt)|0,S=S+Math.imul(Z,Nt)|0,p=p+Math.imul(Z,kt)|0,p=p+Math.imul(G,Nt)|0,A=A+Math.imul(G,kt)|0;var ci=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(ci>>>26)|0,ci&=67108863,S=Math.imul(ft,nt),p=Math.imul(ft,dt),p=p+Math.imul(ht,nt)|0,A=Math.imul(ht,dt),S=S+Math.imul(ut,Ke)|0,p=p+Math.imul(ut,Et)|0,p=p+Math.imul(lt,Ke)|0,A=A+Math.imul(lt,Et)|0,S=S+Math.imul(bt,pt)|0,p=p+Math.imul(bt,St)|0,p=p+Math.imul(_t,pt)|0,A=A+Math.imul(_t,St)|0,S=S+Math.imul(yt,xt)|0,p=p+Math.imul(yt,Ot)|0,p=p+Math.imul(vt,xt)|0,A=A+Math.imul(vt,Ot)|0,S=S+Math.imul(at,Ct)|0,p=p+Math.imul(at,At)|0,p=p+Math.imul(ct,Ct)|0,A=A+Math.imul(ct,At)|0,S=S+Math.imul(qt,It)|0,p=p+Math.imul(qt,Mt)|0,p=p+Math.imul(mt,It)|0,A=A+Math.imul(mt,Mt)|0,S=S+Math.imul(ye,Rt)|0,p=p+Math.imul(ye,Tt)|0,p=p+Math.imul(ve,Rt)|0,A=A+Math.imul(ve,Tt)|0,S=S+Math.imul(he,Pt)|0,p=p+Math.imul(he,Dt)|0,p=p+Math.imul(de,Pt)|0,A=A+Math.imul(de,Dt)|0,S=S+Math.imul(ae,Nt)|0,p=p+Math.imul(ae,kt)|0,p=p+Math.imul(fe,Nt)|0,A=A+Math.imul(fe,kt)|0;var rn=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(rn>>>26)|0,rn&=67108863,S=Math.imul(ft,Ke),p=Math.imul(ft,Et),p=p+Math.imul(ht,Ke)|0,A=Math.imul(ht,Et),S=S+Math.imul(ut,pt)|0,p=p+Math.imul(ut,St)|0,p=p+Math.imul(lt,pt)|0,A=A+Math.imul(lt,St)|0,S=S+Math.imul(bt,xt)|0,p=p+Math.imul(bt,Ot)|0,p=p+Math.imul(_t,xt)|0,A=A+Math.imul(_t,Ot)|0,S=S+Math.imul(yt,Ct)|0,p=p+Math.imul(yt,At)|0,p=p+Math.imul(vt,Ct)|0,A=A+Math.imul(vt,At)|0,S=S+Math.imul(at,It)|0,p=p+Math.imul(at,Mt)|0,p=p+Math.imul(ct,It)|0,A=A+Math.imul(ct,Mt)|0,S=S+Math.imul(qt,Rt)|0,p=p+Math.imul(qt,Tt)|0,p=p+Math.imul(mt,Rt)|0,A=A+Math.imul(mt,Tt)|0,S=S+Math.imul(ye,Pt)|0,p=p+Math.imul(ye,Dt)|0,p=p+Math.imul(ve,Pt)|0,A=A+Math.imul(ve,Dt)|0,S=S+Math.imul(he,Nt)|0,p=p+Math.imul(he,kt)|0,p=p+Math.imul(de,Nt)|0,A=A+Math.imul(de,kt)|0;var Zi=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,S=Math.imul(ft,pt),p=Math.imul(ft,St),p=p+Math.imul(ht,pt)|0,A=Math.imul(ht,St),S=S+Math.imul(ut,xt)|0,p=p+Math.imul(ut,Ot)|0,p=p+Math.imul(lt,xt)|0,A=A+Math.imul(lt,Ot)|0,S=S+Math.imul(bt,Ct)|0,p=p+Math.imul(bt,At)|0,p=p+Math.imul(_t,Ct)|0,A=A+Math.imul(_t,At)|0,S=S+Math.imul(yt,It)|0,p=p+Math.imul(yt,Mt)|0,p=p+Math.imul(vt,It)|0,A=A+Math.imul(vt,Mt)|0,S=S+Math.imul(at,Rt)|0,p=p+Math.imul(at,Tt)|0,p=p+Math.imul(ct,Rt)|0,A=A+Math.imul(ct,Tt)|0,S=S+Math.imul(qt,Pt)|0,p=p+Math.imul(qt,Dt)|0,p=p+Math.imul(mt,Pt)|0,A=A+Math.imul(mt,Dt)|0,S=S+Math.imul(ye,Nt)|0,p=p+Math.imul(ye,kt)|0,p=p+Math.imul(ve,Nt)|0,A=A+Math.imul(ve,kt)|0;var In=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(In>>>26)|0,In&=67108863,S=Math.imul(ft,xt),p=Math.imul(ft,Ot),p=p+Math.imul(ht,xt)|0,A=Math.imul(ht,Ot),S=S+Math.imul(ut,Ct)|0,p=p+Math.imul(ut,At)|0,p=p+Math.imul(lt,Ct)|0,A=A+Math.imul(lt,At)|0,S=S+Math.imul(bt,It)|0,p=p+Math.imul(bt,Mt)|0,p=p+Math.imul(_t,It)|0,A=A+Math.imul(_t,Mt)|0,S=S+Math.imul(yt,Rt)|0,p=p+Math.imul(yt,Tt)|0,p=p+Math.imul(vt,Rt)|0,A=A+Math.imul(vt,Tt)|0,S=S+Math.imul(at,Pt)|0,p=p+Math.imul(at,Dt)|0,p=p+Math.imul(ct,Pt)|0,A=A+Math.imul(ct,Dt)|0,S=S+Math.imul(qt,Nt)|0,p=p+Math.imul(qt,kt)|0,p=p+Math.imul(mt,Nt)|0,A=A+Math.imul(mt,kt)|0;var Kn=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,S=Math.imul(ft,Ct),p=Math.imul(ft,At),p=p+Math.imul(ht,Ct)|0,A=Math.imul(ht,At),S=S+Math.imul(ut,It)|0,p=p+Math.imul(ut,Mt)|0,p=p+Math.imul(lt,It)|0,A=A+Math.imul(lt,Mt)|0,S=S+Math.imul(bt,Rt)|0,p=p+Math.imul(bt,Tt)|0,p=p+Math.imul(_t,Rt)|0,A=A+Math.imul(_t,Tt)|0,S=S+Math.imul(yt,Pt)|0,p=p+Math.imul(yt,Dt)|0,p=p+Math.imul(vt,Pt)|0,A=A+Math.imul(vt,Dt)|0,S=S+Math.imul(at,Nt)|0,p=p+Math.imul(at,kt)|0,p=p+Math.imul(ct,Nt)|0,A=A+Math.imul(ct,kt)|0;var Fl=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(Fl>>>26)|0,Fl&=67108863,S=Math.imul(ft,It),p=Math.imul(ft,Mt),p=p+Math.imul(ht,It)|0,A=Math.imul(ht,Mt),S=S+Math.imul(ut,Rt)|0,p=p+Math.imul(ut,Tt)|0,p=p+Math.imul(lt,Rt)|0,A=A+Math.imul(lt,Tt)|0,S=S+Math.imul(bt,Pt)|0,p=p+Math.imul(bt,Dt)|0,p=p+Math.imul(_t,Pt)|0,A=A+Math.imul(_t,Dt)|0,S=S+Math.imul(yt,Nt)|0,p=p+Math.imul(yt,kt)|0,p=p+Math.imul(vt,Nt)|0,A=A+Math.imul(vt,kt)|0;var Ul=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(Ul>>>26)|0,Ul&=67108863,S=Math.imul(ft,Rt),p=Math.imul(ft,Tt),p=p+Math.imul(ht,Rt)|0,A=Math.imul(ht,Tt),S=S+Math.imul(ut,Pt)|0,p=p+Math.imul(ut,Dt)|0,p=p+Math.imul(lt,Pt)|0,A=A+Math.imul(lt,Dt)|0,S=S+Math.imul(bt,Nt)|0,p=p+Math.imul(bt,kt)|0,p=p+Math.imul(_t,Nt)|0,A=A+Math.imul(_t,kt)|0;var Ms=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+(Ms>>>26)|0,Ms&=67108863,S=Math.imul(ft,Pt),p=Math.imul(ft,Dt),p=p+Math.imul(ht,Pt)|0,A=Math.imul(ht,Dt),S=S+Math.imul(ut,Nt)|0,p=p+Math.imul(ut,kt)|0,p=p+Math.imul(lt,Nt)|0,A=A+Math.imul(lt,kt)|0;var $l=(T+S|0)+((p&8191)<<13)|0;T=(A+(p>>>13)|0)+($l>>>26)|0,$l&=67108863,S=Math.imul(ft,Nt),p=Math.imul(ft,kt),p=p+Math.imul(ht,Nt)|0,A=Math.imul(ht,kt);var Wl=(T+S|0)+((p&8191)<<13)|0;return T=(A+(p>>>13)|0)+(Wl>>>26)|0,Wl&=67108863,R[0]=Wi,R[1]=Hi,R[2]=zi,R[3]=Vi,R[4]=Gi,R[5]=Ki,R[6]=Yi,R[7]=ai,R[8]=pn,R[9]=ci,R[10]=rn,R[11]=Zi,R[12]=In,R[13]=Kn,R[14]=Fl,R[15]=Ul,R[16]=Ms,R[17]=$l,R[18]=Wl,T!==0&&(R[19]=T,y.length++),y};Math.imul||(I=O);function j(E,f,g){g.negative=f.negative^E.negative,g.length=E.length+f.length;for(var y=0,b=0,w=0;w<g.length-1;w++){var R=b;b=0;for(var T=y&67108863,S=Math.min(w,f.length-1),p=Math.max(0,w-E.length+1);p<=S;p++){var A=w-p,Y=E.words[A]|0,Z=f.words[p]|0,G=Y*Z,X=G&67108863;R=R+(G/67108864|0)|0,X=X+T|0,T=X&67108863,R=R+(X>>>26)|0,b+=R>>>26,R&=67108863}g.words[w]=T,y=R,R=b}return y!==0?g.words[w]=y:g.length--,g._strip()}function k(E,f,g){return j(E,f,g)}i.prototype.mulTo=function(f,g){var y,b=this.length+f.length;return this.length===10&&f.length===10?y=I(this,f,g):b<63?y=O(this,f,g):b<1024?y=j(this,f,g):y=k(this,f,g),y};function B(E,f){this.x=E,this.y=f}B.prototype.makeRBT=function(f){for(var g=new Array(f),y=i.prototype._countBits(f)-1,b=0;b<f;b++)g[b]=this.revBin(b,y,f);return g},B.prototype.revBin=function(f,g,y){if(f===0||f===y-1)return f;for(var b=0,w=0;w<g;w++)b|=(f&1)<<g-w-1,f>>=1;return b},B.prototype.permute=function(f,g,y,b,w,R){for(var T=0;T<R;T++)b[T]=g[f[T]],w[T]=y[f[T]]},B.prototype.transform=function(f,g,y,b,w,R){this.permute(R,f,g,y,b,w);for(var T=1;T<w;T<<=1)for(var S=T<<1,p=Math.cos(2*Math.PI/S),A=Math.sin(2*Math.PI/S),Y=0;Y<w;Y+=S)for(var Z=p,G=A,X=0;X<T;X++){var ae=y[Y+X],fe=b[Y+X],Ee=y[Y+X+T],he=b[Y+X+T],de=Z*Ee-G*he;he=Z*he+G*Ee,Ee=de,y[Y+X]=ae+Ee,b[Y+X]=fe+he,y[Y+X+T]=ae-Ee,b[Y+X+T]=fe-he,X!==S&&(de=p*Z-A*G,G=p*G+A*Z,Z=de)}},B.prototype.guessLen13b=function(f,g){var y=Math.max(g,f)|1,b=y&1,w=0;for(y=y/2|0;y;y=y>>>1)w++;return 1<<w+1+b},B.prototype.conjugate=function(f,g,y){if(!(y<=1))for(var b=0;b<y/2;b++){var w=f[b];f[b]=f[y-b-1],f[y-b-1]=w,w=g[b],g[b]=-g[y-b-1],g[y-b-1]=-w}},B.prototype.normalize13b=function(f,g){for(var y=0,b=0;b<g/2;b++){var w=Math.round(f[2*b+1]/g)*8192+Math.round(f[2*b]/g)+y;f[b]=w&67108863,w<67108864?y=0:y=w/67108864|0}return f},B.prototype.convert13b=function(f,g,y,b){for(var w=0,R=0;R<g;R++)w=w+(f[R]|0),y[2*R]=w&8191,w=w>>>13,y[2*R+1]=w&8191,w=w>>>13;for(R=2*g;R<b;++R)y[R]=0;r(w===0),r((w&-8192)===0)},B.prototype.stub=function(f){for(var g=new Array(f),y=0;y<f;y++)g[y]=0;return g},B.prototype.mulp=function(f,g,y){var b=2*this.guessLen13b(f.length,g.length),w=this.makeRBT(b),R=this.stub(b),T=new Array(b),S=new Array(b),p=new Array(b),A=new Array(b),Y=new Array(b),Z=new Array(b),G=y.words;G.length=b,this.convert13b(f.words,f.length,T,b),this.convert13b(g.words,g.length,A,b),this.transform(T,R,S,p,b,w),this.transform(A,R,Y,Z,b,w);for(var X=0;X<b;X++){var ae=S[X]*Y[X]-p[X]*Z[X];p[X]=S[X]*Z[X]+p[X]*Y[X],S[X]=ae}return this.conjugate(S,p,b),this.transform(S,p,G,R,b,w),this.conjugate(G,R,b),this.normalize13b(G,b),y.negative=f.negative^g.negative,y.length=f.length+g.length,y._strip()},i.prototype.mul=function(f){var g=new i(null);return g.words=new Array(this.length+f.length),this.mulTo(f,g)},i.prototype.mulf=function(f){var g=new i(null);return g.words=new Array(this.length+f.length),k(this,f,g)},i.prototype.imul=function(f){return this.clone().mulTo(f,this)},i.prototype.imuln=function(f){var g=f<0;g&&(f=-f),r(typeof f=="number"),r(f<67108864);for(var y=0,b=0;b<this.length;b++){var w=(this.words[b]|0)*f,R=(w&67108863)+(y&67108863);y>>=26,y+=w/67108864|0,y+=R>>>26,this.words[b]=R&67108863}return y!==0&&(this.words[b]=y,this.length++),g?this.ineg():this},i.prototype.muln=function(f){return this.clone().imuln(f)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(f){var g=x(f);if(g.length===0)return new i(1);for(var y=this,b=0;b<g.length&&g[b]===0;b++,y=y.sqr());if(++b<g.length)for(var w=y.sqr();b<g.length;b++,w=w.sqr())g[b]!==0&&(y=y.mul(w));return y},i.prototype.iushln=function(f){r(typeof f=="number"&&f>=0);var g=f%26,y=(f-g)/26,b=67108863>>>26-g<<26-g,w;if(g!==0){var R=0;for(w=0;w<this.length;w++){var T=this.words[w]&b,S=(this.words[w]|0)-T<<g;this.words[w]=S|R,R=T>>>26-g}R&&(this.words[w]=R,this.length++)}if(y!==0){for(w=this.length-1;w>=0;w--)this.words[w+y]=this.words[w];for(w=0;w<y;w++)this.words[w]=0;this.length+=y}return this._strip()},i.prototype.ishln=function(f){return r(this.negative===0),this.iushln(f)},i.prototype.iushrn=function(f,g,y){r(typeof f=="number"&&f>=0);var b;g?b=(g-g%26)/26:b=0;var w=f%26,R=Math.min((f-w)/26,this.length),T=67108863^67108863>>>w<<w,S=y;if(b-=R,b=Math.max(0,b),S){for(var p=0;p<R;p++)S.words[p]=this.words[p];S.length=R}if(R!==0)if(this.length>R)for(this.length-=R,p=0;p<this.length;p++)this.words[p]=this.words[p+R];else this.words[0]=0,this.length=1;var A=0;for(p=this.length-1;p>=0&&(A!==0||p>=b);p--){var Y=this.words[p]|0;this.words[p]=A<<26-w|Y>>>w,A=Y&T}return S&&A!==0&&(S.words[S.length++]=A),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(f,g,y){return r(this.negative===0),this.iushrn(f,g,y)},i.prototype.shln=function(f){return this.clone().ishln(f)},i.prototype.ushln=function(f){return this.clone().iushln(f)},i.prototype.shrn=function(f){return this.clone().ishrn(f)},i.prototype.ushrn=function(f){return this.clone().iushrn(f)},i.prototype.testn=function(f){r(typeof f=="number"&&f>=0);var g=f%26,y=(f-g)/26,b=1<<g;if(this.length<=y)return!1;var w=this.words[y];return!!(w&b)},i.prototype.imaskn=function(f){r(typeof f=="number"&&f>=0);var g=f%26,y=(f-g)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(g!==0&&y++,this.length=Math.min(y,this.length),g!==0){var b=67108863^67108863>>>g<<g;this.words[this.length-1]&=b}return this._strip()},i.prototype.maskn=function(f){return this.clone().imaskn(f)},i.prototype.iaddn=function(f){return r(typeof f=="number"),r(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)},i.prototype._iaddn=function(f){this.words[0]+=f;for(var g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},i.prototype.isubn=function(f){if(r(typeof f=="number"),r(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 g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this._strip()},i.prototype.addn=function(f){return this.clone().iaddn(f)},i.prototype.subn=function(f){return this.clone().isubn(f)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(f,g,y){var b=f.length+y,w;this._expand(b);var R,T=0;for(w=0;w<f.length;w++){R=(this.words[w+y]|0)+T;var S=(f.words[w]|0)*g;R-=S&67108863,T=(R>>26)-(S/67108864|0),this.words[w+y]=R&67108863}for(;w<this.length-y;w++)R=(this.words[w+y]|0)+T,T=R>>26,this.words[w+y]=R&67108863;if(T===0)return this._strip();for(r(T===-1),T=0,w=0;w<this.length;w++)R=-(this.words[w]|0)+T,T=R>>26,this.words[w]=R&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(f,g){var y=this.length-f.length,b=this.clone(),w=f,R=w.words[w.length-1]|0,T=this._countBits(R);y=26-T,y!==0&&(w=w.ushln(y),b.iushln(y),R=w.words[w.length-1]|0);var S=b.length-w.length,p;if(g!=="mod"){p=new i(null),p.length=S+1,p.words=new Array(p.length);for(var A=0;A<p.length;A++)p.words[A]=0}var Y=b.clone()._ishlnsubmul(w,1,S);Y.negative===0&&(b=Y,p&&(p.words[S]=1));for(var Z=S-1;Z>=0;Z--){var G=(b.words[w.length+Z]|0)*67108864+(b.words[w.length+Z-1]|0);for(G=Math.min(G/R|0,67108863),b._ishlnsubmul(w,G,Z);b.negative!==0;)G--,b.negative=0,b._ishlnsubmul(w,1,Z),b.isZero()||(b.negative^=1);p&&(p.words[Z]=G)}return p&&p._strip(),b._strip(),g!=="div"&&y!==0&&b.iushrn(y),{div:p||null,mod:b}},i.prototype.divmod=function(f,g,y){if(r(!f.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var b,w,R;return this.negative!==0&&f.negative===0?(R=this.neg().divmod(f,g),g!=="mod"&&(b=R.div.neg()),g!=="div"&&(w=R.mod.neg(),y&&w.negative!==0&&w.iadd(f)),{div:b,mod:w}):this.negative===0&&f.negative!==0?(R=this.divmod(f.neg(),g),g!=="mod"&&(b=R.div.neg()),{div:b,mod:R.mod}):(this.negative&f.negative)!==0?(R=this.neg().divmod(f.neg(),g),g!=="div"&&(w=R.mod.neg(),y&&w.negative!==0&&w.isub(f)),{div:R.div,mod:w}):f.length>this.length||this.cmp(f)<0?{div:new i(0),mod:this}:f.length===1?g==="div"?{div:this.divn(f.words[0]),mod:null}:g==="mod"?{div:null,mod:new i(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new i(this.modrn(f.words[0]))}:this._wordDiv(f,g)},i.prototype.div=function(f){return this.divmod(f,"div",!1).div},i.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},i.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},i.prototype.divRound=function(f){var g=this.divmod(f);if(g.mod.isZero())return g.div;var y=g.div.negative!==0?g.mod.isub(f):g.mod,b=f.ushrn(1),w=f.andln(1),R=y.cmp(b);return R<0||w===1&&R===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},i.prototype.modrn=function(f){var g=f<0;g&&(f=-f),r(f<=67108863);for(var y=(1<<26)%f,b=0,w=this.length-1;w>=0;w--)b=(y*b+(this.words[w]|0))%f;return g?-b:b},i.prototype.modn=function(f){return this.modrn(f)},i.prototype.idivn=function(f){var g=f<0;g&&(f=-f),r(f<=67108863);for(var y=0,b=this.length-1;b>=0;b--){var w=(this.words[b]|0)+y*67108864;this.words[b]=w/f|0,y=w%f}return this._strip(),g?this.ineg():this},i.prototype.divn=function(f){return this.clone().idivn(f)},i.prototype.egcd=function(f){r(f.negative===0),r(!f.isZero());var g=this,y=f.clone();g.negative!==0?g=g.umod(f):g=g.clone();for(var b=new i(1),w=new i(0),R=new i(0),T=new i(1),S=0;g.isEven()&&y.isEven();)g.iushrn(1),y.iushrn(1),++S;for(var p=y.clone(),A=g.clone();!g.isZero();){for(var Y=0,Z=1;(g.words[0]&Z)===0&&Y<26;++Y,Z<<=1);if(Y>0)for(g.iushrn(Y);Y-- >0;)(b.isOdd()||w.isOdd())&&(b.iadd(p),w.isub(A)),b.iushrn(1),w.iushrn(1);for(var G=0,X=1;(y.words[0]&X)===0&&G<26;++G,X<<=1);if(G>0)for(y.iushrn(G);G-- >0;)(R.isOdd()||T.isOdd())&&(R.iadd(p),T.isub(A)),R.iushrn(1),T.iushrn(1);g.cmp(y)>=0?(g.isub(y),b.isub(R),w.isub(T)):(y.isub(g),R.isub(b),T.isub(w))}return{a:R,b:T,gcd:y.iushln(S)}},i.prototype._invmp=function(f){r(f.negative===0),r(!f.isZero());var g=this,y=f.clone();g.negative!==0?g=g.umod(f):g=g.clone();for(var b=new i(1),w=new i(0),R=y.clone();g.cmpn(1)>0&&y.cmpn(1)>0;){for(var T=0,S=1;(g.words[0]&S)===0&&T<26;++T,S<<=1);if(T>0)for(g.iushrn(T);T-- >0;)b.isOdd()&&b.iadd(R),b.iushrn(1);for(var p=0,A=1;(y.words[0]&A)===0&&p<26;++p,A<<=1);if(p>0)for(y.iushrn(p);p-- >0;)w.isOdd()&&w.iadd(R),w.iushrn(1);g.cmp(y)>=0?(g.isub(y),b.isub(w)):(y.isub(g),w.isub(b))}var Y;return g.cmpn(1)===0?Y=b:Y=w,Y.cmpn(0)<0&&Y.iadd(f),Y},i.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var g=this.clone(),y=f.clone();g.negative=0,y.negative=0;for(var b=0;g.isEven()&&y.isEven();b++)g.iushrn(1),y.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;y.isEven();)y.iushrn(1);var w=g.cmp(y);if(w<0){var R=g;g=y,y=R}else if(w===0||y.cmpn(1)===0)break;g.isub(y)}while(!0);return y.iushln(b)},i.prototype.invm=function(f){return this.egcd(f).a.umod(f)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(f){return this.words[0]&f},i.prototype.bincn=function(f){r(typeof f=="number");var g=f%26,y=(f-g)/26,b=1<<g;if(this.length<=y)return this._expand(y+1),this.words[y]|=b,this;for(var w=b,R=y;w!==0&&R<this.length;R++){var T=this.words[R]|0;T+=w,w=T>>>26,T&=67108863,this.words[R]=T}return w!==0&&(this.words[R]=w,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(f){var g=f<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this._strip();var y;if(this.length>1)y=1;else{g&&(f=-f),r(f<=67108863,"Number is too big");var b=this.words[0]|0;y=b===f?0:b<f?-1:1}return this.negative!==0?-y|0:y},i.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var g=this.ucmp(f);return this.negative!==0?-g|0:g},i.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var g=0,y=this.length-1;y>=0;y--){var b=this.words[y]|0,w=f.words[y]|0;if(b!==w){b<w?g=-1:b>w&&(g=1);break}}return g},i.prototype.gtn=function(f){return this.cmpn(f)===1},i.prototype.gt=function(f){return this.cmp(f)===1},i.prototype.gten=function(f){return this.cmpn(f)>=0},i.prototype.gte=function(f){return this.cmp(f)>=0},i.prototype.ltn=function(f){return this.cmpn(f)===-1},i.prototype.lt=function(f){return this.cmp(f)===-1},i.prototype.lten=function(f){return this.cmpn(f)<=0},i.prototype.lte=function(f){return this.cmp(f)<=0},i.prototype.eqn=function(f){return this.cmpn(f)===0},i.prototype.eq=function(f){return this.cmp(f)===0},i.red=function(f){return new N(f)},i.prototype.toRed=function(f){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(f){return this.red=f,this},i.prototype.forceRed=function(f){return r(!this.red,"Already a number in reduction context"),this._forceRed(f)},i.prototype.redAdd=function(f){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},i.prototype.redIAdd=function(f){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},i.prototype.redSub=function(f){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},i.prototype.redISub=function(f){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},i.prototype.redShl=function(f){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},i.prototype.redMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},i.prototype.redIMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(f){return r(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var V={k256:null,p224:null,p192:null,p25519:null};function q(E,f){this.name=E,this.p=new i(f,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var f=new i(null);return f.words=new Array(Math.ceil(this.n/13)),f},q.prototype.ireduce=function(f){var g=f,y;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),y=g.bitLength();while(y>this.n);var b=y<this.n?-1:g.ucmp(this.p);return b===0?(g.words[0]=0,g.length=1):b>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},q.prototype.split=function(f,g){f.iushrn(this.n,0,g)},q.prototype.imulK=function(f){return f.imul(this.k)};function P(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(P,q),P.prototype.split=function(f,g){for(var y=4194303,b=Math.min(f.length,9),w=0;w<b;w++)g.words[w]=f.words[w];if(g.length=b,f.length<=9){f.words[0]=0,f.length=1;return}var R=f.words[9];for(g.words[g.length++]=R&y,w=10;w<f.length;w++){var T=f.words[w]|0;f.words[w-10]=(T&y)<<4|R>>>22,R=T}R>>>=22,f.words[w-10]=R,R===0&&f.length>10?f.length-=10:f.length-=9},P.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var g=0,y=0;y<f.length;y++){var b=f.words[y]|0;g+=b*977,f.words[y]=g&67108863,g=b*64+(g/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function L(){q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(L,q);function H(){q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(H,q);function M(){q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(M,q),M.prototype.imulK=function(f){for(var g=0,y=0;y<f.length;y++){var b=(f.words[y]|0)*19+g,w=b&67108863;b>>>=26,f.words[y]=w,g=b}return g!==0&&(f.words[f.length++]=g),f},i._prime=function(f){if(V[f])return V[f];var g;if(f==="k256")g=new P;else if(f==="p224")g=new L;else if(f==="p192")g=new H;else if(f==="p25519")g=new M;else throw new Error("Unknown prime "+f);return V[f]=g,g};function N(E){if(typeof E=="string"){var f=i._prime(E);this.m=f.p,this.prime=f}else r(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}N.prototype._verify1=function(f){r(f.negative===0,"red works only with positives"),r(f.red,"red works only with red numbers")},N.prototype._verify2=function(f,g){r((f.negative|g.negative)===0,"red works only with positives"),r(f.red&&f.red===g.red,"red works only with red numbers")},N.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(u(f,f.umod(this.m)._forceRed(this)),f)},N.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},N.prototype.add=function(f,g){this._verify2(f,g);var y=f.add(g);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},N.prototype.iadd=function(f,g){this._verify2(f,g);var y=f.iadd(g);return y.cmp(this.m)>=0&&y.isub(this.m),y},N.prototype.sub=function(f,g){this._verify2(f,g);var y=f.sub(g);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},N.prototype.isub=function(f,g){this._verify2(f,g);var y=f.isub(g);return y.cmpn(0)<0&&y.iadd(this.m),y},N.prototype.shl=function(f,g){return this._verify1(f),this.imod(f.ushln(g))},N.prototype.imul=function(f,g){return this._verify2(f,g),this.imod(f.imul(g))},N.prototype.mul=function(f,g){return this._verify2(f,g),this.imod(f.mul(g))},N.prototype.isqr=function(f){return this.imul(f,f.clone())},N.prototype.sqr=function(f){return this.mul(f,f)},N.prototype.sqrt=function(f){if(f.isZero())return f.clone();var g=this.m.andln(3);if(r(g%2===1),g===3){var y=this.m.add(new i(1)).iushrn(2);return this.pow(f,y)}for(var b=this.m.subn(1),w=0;!b.isZero()&&b.andln(1)===0;)w++,b.iushrn(1);r(!b.isZero());var R=new i(1).toRed(this),T=R.redNeg(),S=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new i(2*p*p).toRed(this);this.pow(p,S).cmp(T)!==0;)p.redIAdd(T);for(var A=this.pow(p,b),Y=this.pow(f,b.addn(1).iushrn(1)),Z=this.pow(f,b),G=w;Z.cmp(R)!==0;){for(var X=Z,ae=0;X.cmp(R)!==0;ae++)X=X.redSqr();r(ae<G);var fe=this.pow(A,new i(1).iushln(G-ae-1));Y=Y.redMul(fe),A=fe.redSqr(),Z=Z.redMul(A),G=ae}return Y},N.prototype.invm=function(f){var g=f._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},N.prototype.pow=function(f,g){if(g.isZero())return new i(1).toRed(this);if(g.cmpn(1)===0)return f.clone();var y=4,b=new Array(1<<y);b[0]=new i(1).toRed(this),b[1]=f;for(var w=2;w<b.length;w++)b[w]=this.mul(b[w-1],f);var R=b[0],T=0,S=0,p=g.bitLength()%26;for(p===0&&(p=26),w=g.length-1;w>=0;w--){for(var A=g.words[w],Y=p-1;Y>=0;Y--){var Z=A>>Y&1;if(R!==b[0]&&(R=this.sqr(R)),Z===0&&T===0){S=0;continue}T<<=1,T|=Z,S++,!(S!==y&&(w!==0||Y!==0))&&(R=this.mul(R,b[T]),S=0,T=0)}p=26}return R},N.prototype.convertTo=function(f){var g=f.umod(this.m);return g===f?g.clone():g},N.prototype.convertFrom=function(f){var g=f.clone();return g.red=null,g},i.mont=function(f){return new F(f)};function F(E){N.call(this,E),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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(F,N),F.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},F.prototype.convertFrom=function(f){var g=this.imod(f.mul(this.rinv));return g.red=null,g},F.prototype.imul=function(f,g){if(f.isZero()||g.isZero())return f.words[0]=0,f.length=1,f;var y=f.imul(g),b=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=y.isub(b).iushrn(this.shift),R=w;return w.cmp(this.m)>=0?R=w.isub(this.m):w.cmpn(0)<0&&(R=w.iadd(this.m)),R._forceRed(this)},F.prototype.mul=function(f,g){if(f.isZero()||g.isZero())return new i(0)._forceRed(this);var y=f.mul(g),b=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=y.isub(b).iushrn(this.shift),R=w;return w.cmp(this.m)>=0?R=w.isub(this.m):w.cmpn(0)<0&&(R=w.iadd(this.m)),R._forceRed(this)},F.prototype.invm=function(f){var g=this.imod(f._invmp(this.m).mul(this.r2));return g._forceRed(this)}})(typeof q3>"u"||q3,oN)});var $3=_((oLe,lN)=>{lN.exports=Sh;Sh.default=Sh;Sh.stable=cN;Sh.stableStringify=cN;var Jg="[...]",sN="[Circular]",xa=[],Sa=[];function aN(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Sh(t,e,r,n){typeof n>"u"&&(n=aN()),F3(t,"",0,[],void 0,0,n);var i;try{Sa.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,uN(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;xa.length!==0;){var o=xa.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function xu(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),xa.push([n,r,e,i])):Sa.push([e,r,t]):(n[r]=t,xa.push([n,r,e]))}function F3(t,e,r,n,i,o,s){o+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){xu(sN,t,e,i);return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){xu(Jg,t,e,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){xu(Jg,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)F3(t[a],a,a,n,t,o,s);else{var c=Object.keys(t);for(a=0;a<c.length;a++){var u=c[a];F3(t[u],u,a,n,t,o,s)}}n.pop()}}function sae(t,e){return t<e?-1:t>e?1:0}function cN(t,e,r,n){typeof n>"u"&&(n=aN());var i=U3(t,"",0,[],void 0,0,n)||t,o;try{Sa.length===0?o=JSON.stringify(i,e,r):o=JSON.stringify(i,uN(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;xa.length!==0;){var s=xa.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function U3(t,e,r,n,i,o,s){o+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){xu(sN,t,e,i);return}try{if(typeof t.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){xu(Jg,t,e,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){xu(Jg,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)U3(t[a],a,a,n,t,o,s);else{var c={},u=Object.keys(t).sort(sae);for(a=0;a<u.length;a++){var l=u[a];U3(t[l],l,a,n,t,o,s),c[l]=t[l]}if(typeof i<"u")xa.push([i,e,t]),i[e]=c;else return c}n.pop()}}function uN(t){return t=typeof t<"u"?t:function(e,r){return r},function(e,r){if(Sa.length>0)for(var n=0;n<Sa.length;n++){var i=Sa[n];if(i[1]===e&&i[0]===r){r=i[2],Sa.splice(n,1);break}}return t.call(this,e,r)}}});var Xg=_(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.EthereumProviderError=Ou.EthereumRpcError=void 0;var aae=$3(),Qg=class extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}serialize(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return aae.default(this.serialize(),uae,2)}};Ou.EthereumRpcError=Qg;var W3=class extends Qg{constructor(e,r,n){if(!cae(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}};Ou.EthereumProviderError=W3;function cae(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function uae(t,e){if(e!=="[Circular]")return e}});var em=_(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.errorValues=Cu.errorCodes=void 0;Cu.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Cu.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}});var V3=_(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.serializeError=Jn.isValidCode=Jn.getMessageFromCode=Jn.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var tm=em(),lae=Xg(),fN=tm.errorCodes.rpc.internal,fae="Unspecified error message. This is a bug, please report it.",hae={code:fN,message:z3(fN)};Jn.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function z3(t,e=fae){if(Number.isInteger(t)){let r=t.toString();if(H3(tm.errorValues,r))return tm.errorValues[r].message;if(pN(t))return Jn.JSON_RPC_SERVER_ERROR_MESSAGE}return e}Jn.getMessageFromCode=z3;function dN(t){if(!Number.isInteger(t))return!1;let e=t.toString();return!!(tm.errorValues[e]||pN(t))}Jn.isValidCode=dN;function dae(t,{fallbackError:e=hae,shouldIncludeStack:r=!1}={}){var n,i;if(!e||!Number.isInteger(e.code)||typeof e.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(t instanceof lae.EthereumRpcError)return t.serialize();let o={};if(t&&typeof t=="object"&&!Array.isArray(t)&&H3(t,"code")&&dN(t.code)){let a=t;o.code=a.code,a.message&&typeof a.message=="string"?(o.message=a.message,H3(a,"data")&&(o.data=a.data)):(o.message=z3(o.code),o.data={originalError:hN(t)})}else{o.code=e.code;let a=(n=t)===null||n===void 0?void 0:n.message;o.message=a&&typeof a=="string"?a:e.message,o.data={originalError:hN(t)}}let s=(i=t)===null||i===void 0?void 0:i.stack;return r&&t&&s&&typeof s=="string"&&(o.stack=s),o}Jn.serializeError=dae;function pN(t){return t>=-32099&&t<=-32e3}function hN(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function H3(t,e){return Object.prototype.hasOwnProperty.call(t,e)}});var yN=_(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.ethErrors=void 0;var G3=Xg(),gN=V3(),Lr=em();rm.ethErrors={rpc:{parse:t=>Ln(Lr.errorCodes.rpc.parse,t),invalidRequest:t=>Ln(Lr.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Ln(Lr.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Ln(Lr.errorCodes.rpc.methodNotFound,t),internal:t=>Ln(Lr.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");let{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ln(e,t)},invalidInput:t=>Ln(Lr.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Ln(Lr.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Ln(Lr.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Ln(Lr.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Ln(Lr.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Ln(Lr.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>xh(Lr.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>xh(Lr.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>xh(Lr.errorCodes.provider.unsupportedMethod,t),disconnected:t=>xh(Lr.errorCodes.provider.disconnected,t),chainDisconnected:t=>xh(Lr.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");let{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new G3.EthereumProviderError(e,r,n)}}};function Ln(t,e){let[r,n]=mN(e);return new G3.EthereumRpcError(t,r||gN.getMessageFromCode(t),n)}function xh(t,e){let[r,n]=mN(e);return new G3.EthereumProviderError(t,r||gN.getMessageFromCode(t),n)}function mN(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){let{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}});var nm=_(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.getMessageFromCode=ln.serializeError=ln.EthereumProviderError=ln.EthereumRpcError=ln.ethErrors=ln.errorCodes=void 0;var vN=Xg();Object.defineProperty(ln,"EthereumRpcError",{enumerable:!0,get:function(){return vN.EthereumRpcError}});Object.defineProperty(ln,"EthereumProviderError",{enumerable:!0,get:function(){return vN.EthereumProviderError}});var bN=V3();Object.defineProperty(ln,"serializeError",{enumerable:!0,get:function(){return bN.serializeError}});Object.defineProperty(ln,"getMessageFromCode",{enumerable:!0,get:function(){return bN.getMessageFromCode}});var pae=yN();Object.defineProperty(ln,"ethErrors",{enumerable:!0,get:function(){return pae.ethErrors}});var gae=em();Object.defineProperty(ln,"errorCodes",{enumerable:!0,get:function(){return gae.errorCodes}})});var om=_(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.EVENTS=void 0;im.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"}});var Au=_(K3=>{"use strict";Object.defineProperty(K3,"__esModule",{value:!0});function mae(t){return typeof t=="function"}K3.isFunction=mae});var Oh=_(Z3=>{"use strict";Object.defineProperty(Z3,"__esModule",{value:!0});var Y3=!1;Z3.config={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;console.warn(`DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at:
17
+ `+e.stack)}else Y3&&console.log("RxJS: Back to a better error behavior. Thank you. <3");Y3=t},get useDeprecatedSynchronousErrorHandling(){return Y3}}});var sm=_(J3=>{"use strict";Object.defineProperty(J3,"__esModule",{value:!0});function yae(t){setTimeout(function(){throw t},0)}J3.hostReportError=yae});var X3=_(Q3=>{"use strict";Object.defineProperty(Q3,"__esModule",{value:!0});var vae=Oh(),bae=sm();Q3.empty={closed:!0,next:function(t){},error:function(t){if(vae.config.useDeprecatedSynchronousErrorHandling)throw t;bae.hostReportError(t)},complete:function(){}}});var Yr=_(e5=>{"use strict";Object.defineProperty(e5,"__esModule",{value:!0});e5.isArray=function(){return Array.isArray||function(t){return t&&typeof t.length=="number"}}()});var am=_(t5=>{"use strict";Object.defineProperty(t5,"__esModule",{value:!0});function _ae(t){return t!==null&&typeof t=="object"}t5.isObject=_ae});var n5=_(r5=>{"use strict";Object.defineProperty(r5,"__esModule",{value:!0});var wae=function(){function t(e){return Error.call(this),this.message=e?e.length+` errors occurred during unsubscription:
18
+ `+e.map(function(r,n){return n+1+") "+r.toString()}).join(`
19
+ `):"",this.name="UnsubscriptionError",this.errors=e,this}return t.prototype=Object.create(Error.prototype),t}();r5.UnsubscriptionError=wae});var yr=_(i5=>{"use strict";Object.defineProperty(i5,"__esModule",{value:!0});var Eae=Yr(),Sae=am(),xae=Au(),cm=n5(),Oae=function(){function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,n=r._parentOrParents,i=r._ctorUnsubscribe,o=r._unsubscribe,s=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(n!==null)for(var a=0;a<n.length;++a){var c=n[a];c.remove(this)}if(xae.isFunction(o)){i&&(this._unsubscribe=void 0);try{o.call(this)}catch(h){e=h instanceof cm.UnsubscriptionError?_N(h.errors):[h]}}if(Eae.isArray(s))for(var a=-1,u=s.length;++a<u;){var l=s[a];if(Sae.isObject(l))try{l.unsubscribe()}catch(d){e=e||[],d instanceof cm.UnsubscriptionError?e=e.concat(_N(d.errors)):e.push(d)}}if(e)throw new cm.UnsubscriptionError(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||typeof r.unsubscribe!="function")return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;r=new t,r._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=r._parentOrParents;if(i===null)r._parentOrParents=this;else if(i instanceof t){if(i===this)return r;r._parentOrParents=[i,this]}else if(i.indexOf(this)===-1)i.push(this);else return r;var o=this._subscriptions;return o===null?this._subscriptions=[r]:o.push(r),r},t.prototype.remove=function(e){var r=this._subscriptions;if(r){var n=r.indexOf(e);n!==-1&&r.splice(n,1)}},t.EMPTY=function(e){return e.closed=!0,e}(new t),t}();i5.Subscription=Oae;function _N(t){return t.reduce(function(e,r){return e.concat(r instanceof cm.UnsubscriptionError?r.errors:r)},[])}});var um=_(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.rxSubscriber=function(){return typeof Symbol=="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}();Ch.$$rxSubscriber=Ch.rxSubscriber});var Se=_(Mu=>{"use strict";var EN=Mu&&Mu.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Mu,"__esModule",{value:!0});var wN=Au(),o5=X3(),Cae=yr(),Aae=um(),Iu=Oh(),lm=sm(),SN=function(t){EN(e,t);function e(r,n,i){var o=t.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=o5.empty;break;case 1:if(!r){o.destination=o5.empty;break}if(typeof r=="object"){r instanceof e?(o.syncErrorThrowable=r.syncErrorThrowable,o.destination=r,r.add(o)):(o.syncErrorThrowable=!0,o.destination=new s5(o,r));break}default:o.syncErrorThrowable=!0,o.destination=new s5(o,r,n,i);break}return o}return e.prototype[Aae.rxSubscriber]=function(){return this},e.create=function(r,n,i){var o=new e(r,n,i);return o.syncErrorThrowable=!1,o},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var r=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=r,this},e}(Cae.Subscription);Mu.Subscriber=SN;var s5=function(t){EN(e,t);function e(r,n,i,o){var s=t.call(this)||this;s._parentSubscriber=r;var a,c=s;return wN.isFunction(n)?a=n:n&&(a=n.next,i=n.error,o=n.complete,n!==o5.empty&&(c=Object.create(n),wN.isFunction(c.unsubscribe)&&s.add(c.unsubscribe.bind(c)),c.unsubscribe=s.unsubscribe.bind(s))),s._context=c,s._next=a,s._error=i,s._complete=o,s}return e.prototype.next=function(r){if(!this.isStopped&&this._next){var n=this._parentSubscriber;!Iu.config.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?this.__tryOrUnsub(this._next,r):this.__tryOrSetError(n,this._next,r)&&this.unsubscribe()}},e.prototype.error=function(r){if(!this.isStopped){var n=this._parentSubscriber,i=Iu.config.useDeprecatedSynchronousErrorHandling;if(this._error)!i||!n.syncErrorThrowable?(this.__tryOrUnsub(this._error,r),this.unsubscribe()):(this.__tryOrSetError(n,this._error,r),this.unsubscribe());else if(n.syncErrorThrowable)i?(n.syncErrorValue=r,n.syncErrorThrown=!0):lm.hostReportError(r),this.unsubscribe();else{if(this.unsubscribe(),i)throw r;lm.hostReportError(r)}}},e.prototype.complete=function(){var r=this;if(!this.isStopped){var n=this._parentSubscriber;if(this._complete){var i=function(){return r._complete.call(r._context)};!Iu.config.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?(this.__tryOrUnsub(i),this.unsubscribe()):(this.__tryOrSetError(n,i),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(r,n){try{r.call(this._context,n)}catch(i){if(this.unsubscribe(),Iu.config.useDeprecatedSynchronousErrorHandling)throw i;lm.hostReportError(i)}},e.prototype.__tryOrSetError=function(r,n,i){if(!Iu.config.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,i)}catch(o){return Iu.config.useDeprecatedSynchronousErrorHandling?(r.syncErrorValue=o,r.syncErrorThrown=!0,!0):(lm.hostReportError(o),!0)}return!1},e.prototype._unsubscribe=function(){var r=this._parentSubscriber;this._context=null,this._parentSubscriber=null,r.unsubscribe()},e}(SN);Mu.SafeSubscriber=s5});var fm=_(a5=>{"use strict";Object.defineProperty(a5,"__esModule",{value:!0});var Iae=Se();function Mae(t){for(;t;){var e=t,r=e.closed,n=e.destination,i=e.isStopped;if(r||i)return!1;n&&n instanceof Iae.Subscriber?t=n:t=null}return!0}a5.canReportError=Mae});var ON=_(u5=>{"use strict";Object.defineProperty(u5,"__esModule",{value:!0});var c5=Se(),xN=um(),Rae=X3();function Tae(t,e,r){if(t){if(t instanceof c5.Subscriber)return t;if(t[xN.rxSubscriber])return t[xN.rxSubscriber]()}return!t&&!e&&!r?new c5.Subscriber(Rae.empty):new c5.Subscriber(t,e,r)}u5.toSubscriber=Tae});var Oa=_(l5=>{"use strict";Object.defineProperty(l5,"__esModule",{value:!0});l5.observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}()});var as=_(f5=>{"use strict";Object.defineProperty(f5,"__esModule",{value:!0});function Pae(t){return t}f5.identity=Pae});var dm=_(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});var Dae=as();function Nae(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return CN(t)}hm.pipe=Nae;function CN(t){return t.length===0?Dae.identity:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}hm.pipeFromArray=CN});var Ge=_(h5=>{"use strict";Object.defineProperty(h5,"__esModule",{value:!0});var kae=fm(),Lae=ON(),jae=Oa(),Bae=dm(),pm=Oh(),qae=function(){function t(e){this._isScalar=!1,e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this.operator,o=Lae.toSubscriber(e,r,n);if(i?o.add(i.call(o,this.source)):o.add(this.source||pm.config.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),pm.config.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){pm.config.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=r),kae.canReportError(e)?e.error(r):console.warn(r)}},t.prototype.forEach=function(e,r){var n=this;return r=AN(r),new r(function(i,o){var s;s=n.subscribe(function(a){try{e(a)}catch(c){o(c),s&&s.unsubscribe()}},o,i)})},t.prototype._subscribe=function(e){var r=this.source;return r&&r.subscribe(e)},t.prototype[jae.observable]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.length===0?this:Bae.pipeFromArray(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=AN(e),new e(function(n,i){var o;r.subscribe(function(s){return o=s},function(s){return i(s)},function(){return n(o)})})},t.create=function(e){return new t(e)},t}();h5.Observable=qae;function AN(t){if(t||(t=pm.config.Promise||Promise),!t)throw new Error("no Promise impl found");return t}});var Ah=_(d5=>{"use strict";Object.defineProperty(d5,"__esModule",{value:!0});var Fae=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}();d5.ObjectUnsubscribedError=Fae});var p5=_(Ih=>{"use strict";var Uae=Ih&&Ih.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ih,"__esModule",{value:!0});var $ae=yr(),Wae=function(t){Uae(e,t);function e(r,n){var i=t.call(this)||this;return i.subject=r,i.subscriber=n,i.closed=!1,i}return e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var r=this.subject,n=r.observers;if(this.subject=null,!(!n||n.length===0||r.isStopped||r.closed)){var i=n.indexOf(this.subscriber);i!==-1&&n.splice(i,1)}}},e}($ae.Subscription);Ih.SubjectSubscription=Wae});var jr=_(Ca=>{"use strict";var y5=Ca&&Ca.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ca,"__esModule",{value:!0});var IN=Ge(),Hae=Se(),g5=yr(),Mh=Ah(),zae=p5(),Vae=um(),MN=function(t){y5(e,t);function e(r){var n=t.call(this,r)||this;return n.destination=r,n}return e}(Hae.Subscriber);Ca.SubjectSubscriber=MN;var RN=function(t){y5(e,t);function e(){var r=t.call(this)||this;return r.observers=[],r.closed=!1,r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype[Vae.rxSubscriber]=function(){return new MN(this)},e.prototype.lift=function(r){var n=new m5(this,this);return n.operator=r,n},e.prototype.next=function(r){if(this.closed)throw new Mh.ObjectUnsubscribedError;if(!this.isStopped)for(var n=this.observers,i=n.length,o=n.slice(),s=0;s<i;s++)o[s].next(r)},e.prototype.error=function(r){if(this.closed)throw new Mh.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=r,this.isStopped=!0;for(var n=this.observers,i=n.length,o=n.slice(),s=0;s<i;s++)o[s].error(r);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new Mh.ObjectUnsubscribedError;this.isStopped=!0;for(var r=this.observers,n=r.length,i=r.slice(),o=0;o<n;o++)i[o].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(r){if(this.closed)throw new Mh.ObjectUnsubscribedError;return t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){if(this.closed)throw new Mh.ObjectUnsubscribedError;return this.hasError?(r.error(this.thrownError),g5.Subscription.EMPTY):this.isStopped?(r.complete(),g5.Subscription.EMPTY):(this.observers.push(r),new zae.SubjectSubscription(this,r))},e.prototype.asObservable=function(){var r=new IN.Observable;return r.source=this,r},e.create=function(r,n){return new m5(r,n)},e}(IN.Observable);Ca.Subject=RN;var m5=function(t){y5(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n=this.destination;n&&n.next&&n.next(r)},e.prototype.error=function(r){var n=this.destination;n&&n.error&&this.destination.error(r)},e.prototype.complete=function(){var r=this.destination;r&&r.complete&&this.destination.complete()},e.prototype._subscribe=function(r){var n=this.source;return n?this.source.subscribe(r):g5.Subscription.EMPTY},e}(RN);Ca.AnonymousSubject=m5});var gm=_(Rh=>{"use strict";var Gae=Rh&&Rh.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Rh,"__esModule",{value:!0});var Kae=Se();function Yae(){return function(e){return e.lift(new Zae(e))}}Rh.refCount=Yae;var Zae=function(){function t(e){this.connectable=e}return t.prototype.call=function(e,r){var n=this.connectable;n._refCount++;var i=new Jae(e,n),o=r.subscribe(i);return i.closed||(i.connection=n.connect()),o},t}(),Jae=function(t){Gae(e,t);function e(r,n){var i=t.call(this,r)||this;return i.connectable=n,i}return e.prototype._unsubscribe=function(){var r=this.connectable;if(!r){this.connection=null;return}this.connectable=null;var n=r._refCount;if(n<=0){this.connection=null;return}if(r._refCount=n-1,n>1){this.connection=null;return}var i=this.connection,o=r._connection;this.connection=null,o&&(!i||o===i)&&o.unsubscribe()},e}(Kae.Subscriber)});var b5=_(Ru=>{"use strict";var v5=Ru&&Ru.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ru,"__esModule",{value:!0});var Qae=jr(),Xae=Ge(),ece=Se(),TN=yr(),tce=gm(),PN=function(t){v5(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subjectFactory=n,i._refCount=0,i._isComplete=!1,i}return e.prototype._subscribe=function(r){return this.getSubject().subscribe(r)},e.prototype.getSubject=function(){var r=this._subject;return(!r||r.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var r=this._connection;return r||(this._isComplete=!1,r=this._connection=new TN.Subscription,r.add(this.source.subscribe(new rce(this.getSubject(),this))),r.closed&&(this._connection=null,r=TN.Subscription.EMPTY)),r},e.prototype.refCount=function(){return tce.refCount()(this)},e}(Xae.Observable);Ru.ConnectableObservable=PN;Ru.connectableObservableDescriptor=function(){var t=PN.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}();var rce=function(t){v5(e,t);function e(r,n){var i=t.call(this,r)||this;return i.connectable=n,i}return e.prototype._error=function(r){this._unsubscribe(),t.prototype._error.call(this,r)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var r=this.connectable;if(r){this.connectable=null;var n=r._connection;r._refCount=0,r._subject=null,r._connection=null,n&&n.unsubscribe()}},e}(Qae.SubjectSubscriber),PLe=function(){function t(e){this.connectable=e}return t.prototype.call=function(e,r){var n=this.connectable;n._refCount++;var i=new nce(e,n),o=r.subscribe(i);return i.closed||(i.connection=n.connect()),o},t}(),nce=function(t){v5(e,t);function e(r,n){var i=t.call(this,r)||this;return i.connectable=n,i}return e.prototype._unsubscribe=function(){var r=this.connectable;if(!r){this.connection=null;return}this.connectable=null;var n=r._refCount;if(n<=0){this.connection=null;return}if(r._refCount=n-1,n>1){this.connection=null;return}var i=this.connection,o=r._connection;this.connection=null,o&&(!i||o===i)&&o.unsubscribe()},e}(ece.Subscriber)});var w5=_(Tu=>{"use strict";var mm=Tu&&Tu.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Tu,"__esModule",{value:!0});var DN=Se(),NN=yr(),ice=Ge(),oce=jr();function sce(t,e,r,n){return function(i){return i.lift(new ace(t,e,r,n))}}Tu.groupBy=sce;var ace=function(){function t(e,r,n,i){this.keySelector=e,this.elementSelector=r,this.durationSelector=n,this.subjectSelector=i}return t.prototype.call=function(e,r){return r.subscribe(new cce(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),cce=function(t){mm(e,t);function e(r,n,i,o,s){var a=t.call(this,r)||this;return a.keySelector=n,a.elementSelector=i,a.durationSelector=o,a.subjectSelector=s,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return e.prototype._next=function(r){var n;try{n=this.keySelector(r)}catch(i){this.error(i);return}this._group(r,n)},e.prototype._group=function(r,n){var i=this.groups;i||(i=this.groups=new Map);var o=i.get(n),s;if(this.elementSelector)try{s=this.elementSelector(r)}catch(u){this.error(u)}else s=r;if(!o){o=this.subjectSelector?this.subjectSelector():new oce.Subject,i.set(n,o);var a=new _5(n,o,this);if(this.destination.next(a),this.durationSelector){var c=void 0;try{c=this.durationSelector(new _5(n,o))}catch(u){this.error(u);return}this.add(c.subscribe(new uce(n,o,this)))}}o.closed||o.next(s)},e.prototype._error=function(r){var n=this.groups;n&&(n.forEach(function(i,o){i.error(r)}),n.clear()),this.destination.error(r)},e.prototype._complete=function(){var r=this.groups;r&&(r.forEach(function(n,i){n.complete()}),r.clear()),this.destination.complete()},e.prototype.removeGroup=function(r){this.groups.delete(r)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,this.count===0&&t.prototype.unsubscribe.call(this))},e}(DN.Subscriber),uce=function(t){mm(e,t);function e(r,n,i){var o=t.call(this,n)||this;return o.key=r,o.group=n,o.parent=i,o}return e.prototype._next=function(r){this.complete()},e.prototype._unsubscribe=function(){var r=this,n=r.parent,i=r.key;this.key=this.parent=null,n&&n.removeGroup(i)},e}(DN.Subscriber),_5=function(t){mm(e,t);function e(r,n,i){var o=t.call(this)||this;return o.key=r,o.groupSubject=n,o.refCountSubscription=i,o}return e.prototype._subscribe=function(r){var n=new NN.Subscription,i=this,o=i.refCountSubscription,s=i.groupSubject;return o&&!o.closed&&n.add(new lce(o)),n.add(s.subscribe(r)),n},e}(ice.Observable);Tu.GroupedObservable=_5;var lce=function(t){mm(e,t);function e(r){var n=t.call(this)||this;return n.parent=r,r.count++,n}return e.prototype.unsubscribe=function(){var r=this.parent;!r.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),r.count-=1,r.count===0&&r.attemptedToUnsubscribe&&r.unsubscribe())},e}(NN.Subscription)});var E5=_(Th=>{"use strict";var fce=Th&&Th.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Th,"__esModule",{value:!0});var hce=jr(),dce=Ah(),pce=function(t){fce(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return n&&!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new dce.ObjectUnsubscribedError;return this._value},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(hce.Subject);Th.BehaviorSubject=pce});var kN=_(Ph=>{"use strict";var gce=Ph&&Ph.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ph,"__esModule",{value:!0});var mce=yr(),yce=function(t){gce(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},e}(mce.Subscription);Ph.Action=yce});var Pu=_(Dh=>{"use strict";var vce=Dh&&Dh.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Dh,"__esModule",{value:!0});var bce=kN(),_ce=function(t){vce(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),this.closed)return this;this.state=r;var i=this.id,o=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(o,i,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(o,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&this.delay===i&&this.pending===!1)return n;clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,o=void 0;try{this.work(r)}catch(s){i=!0,o=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),o},e.prototype._unsubscribe=function(){var r=this.id,n=this.scheduler,i=n.actions,o=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,o!==-1&&i.splice(o,1),r!=null&&(this.id=this.recycleAsyncId(n,r,null)),this.delay=null},e}(bce.Action);Dh.AsyncAction=_ce});var LN=_(Nh=>{"use strict";var wce=Nh&&Nh.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Nh,"__esModule",{value:!0});var Ece=Pu(),Sce=function(t){wce(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?t.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},e.prototype.execute=function(r,n){return n>0||this.closed?t.prototype.execute.call(this,r,n):this._execute(r,n)},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0?t.prototype.requestAsyncId.call(this,r,n,i):r.flush(this)},e}(Ece.AsyncAction);Nh.QueueAction=Sce});var x5=_(S5=>{"use strict";Object.defineProperty(S5,"__esModule",{value:!0});var xce=function(){function t(e,r){r===void 0&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.SchedulerAction(this,e).schedule(n,r)},t.now=function(){return Date.now()},t}();S5.Scheduler=xce});var Du=_(kh=>{"use strict";var Oce=kh&&kh.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(kh,"__esModule",{value:!0});var jN=x5(),Cce=function(t){Oce(e,t);function e(r,n){n===void 0&&(n=jN.Scheduler.now);var i=t.call(this,r,function(){return e.delegate&&e.delegate!==i?e.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return e.prototype.schedule=function(r,n,i){return n===void 0&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,i):t.prototype.schedule.call(this,r,n,i)},e.prototype.flush=function(r){var n=this.actions;if(this.active){n.push(r);return}var i;this.active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this.active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(jN.Scheduler);kh.AsyncScheduler=Cce});var BN=_(Lh=>{"use strict";var Ace=Lh&&Lh.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Lh,"__esModule",{value:!0});var Ice=Du(),Mce=function(t){Ace(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ice.AsyncScheduler);Lh.QueueScheduler=Mce});var O5=_(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});var Rce=LN(),Tce=BN();jh.queueScheduler=new Tce.QueueScheduler(Rce.QueueAction);jh.queue=jh.queueScheduler});var Qn=_(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});var qN=Ge();Bh.EMPTY=new qN.Observable(function(t){return t.complete()});function Pce(t){return t?Dce(t):Bh.EMPTY}Bh.empty=Pce;function Dce(t){return new qN.Observable(function(e){return t.schedule(function(){return e.complete()})})}});var Xn=_(C5=>{"use strict";Object.defineProperty(C5,"__esModule",{value:!0});function Nce(t){return t&&typeof t.schedule=="function"}C5.isScheduler=Nce});var I5=_(A5=>{"use strict";Object.defineProperty(A5,"__esModule",{value:!0});A5.subscribeToArray=function(t){return function(e){for(var r=0,n=t.length;r<n&&!e.closed;r++)e.next(t[r]);e.complete()}}});var ym=_(M5=>{"use strict";Object.defineProperty(M5,"__esModule",{value:!0});var kce=Ge(),Lce=yr();function jce(t,e){return new kce.Observable(function(r){var n=new Lce.Subscription,i=0;return n.add(e.schedule(function(){if(i===t.length){r.complete();return}r.next(t[i++]),r.closed||n.add(this.schedule())})),n})}M5.scheduleArray=jce});var Nu=_(R5=>{"use strict";Object.defineProperty(R5,"__esModule",{value:!0});var Bce=Ge(),qce=I5(),Fce=ym();function Uce(t,e){return e?Fce.scheduleArray(t,e):new Bce.Observable(qce.subscribeToArray(t))}R5.fromArray=Uce});var qh=_(T5=>{"use strict";Object.defineProperty(T5,"__esModule",{value:!0});var $ce=Xn(),Wce=Nu(),Hce=ym();function zce(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return $ce.isScheduler(r)?(t.pop(),Hce.scheduleArray(t,r)):Wce.fromArray(t)}T5.of=zce});var vm=_(P5=>{"use strict";Object.defineProperty(P5,"__esModule",{value:!0});var FN=Ge();function Vce(t,e){return e?new FN.Observable(function(r){return e.schedule(Gce,0,{error:t,subscriber:r})}):new FN.Observable(function(r){return r.error(t)})}P5.throwError=Vce;function Gce(t){var e=t.error,r=t.subscriber;r.error(e)}});var Uh=_(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});var Kce=Qn(),Yce=qh(),Zce=vm(),Jce;(function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"})(Jce=Fh.NotificationKind||(Fh.NotificationKind={}));var Qce=function(){function t(e,r,n){this.kind=e,this.value=r,this.error=n,this.hasValue=e==="N"}return t.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},t.prototype.do=function(e,r,n){var i=this.kind;switch(i){case"N":return e&&e(this.value);case"E":return r&&r(this.error);case"C":return n&&n()}},t.prototype.accept=function(e,r,n){return e&&typeof e.next=="function"?this.observe(e):this.do(e,r,n)},t.prototype.toObservable=function(){var e=this.kind;switch(e){case"N":return Yce.of(this.value);case"E":return Zce.throwError(this.error);case"C":return Kce.empty()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return typeof e<"u"?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();Fh.Notification=Qce});var N5=_(cs=>{"use strict";var Xce=cs&&cs.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(cs,"__esModule",{value:!0});var eue=Se(),D5=Uh();function tue(t,e){return e===void 0&&(e=0),function(n){return n.lift(new UN(t,e))}}cs.observeOn=tue;var UN=function(){function t(e,r){r===void 0&&(r=0),this.scheduler=e,this.delay=r}return t.prototype.call=function(e,r){return r.subscribe(new $N(e,this.scheduler,this.delay))},t}();cs.ObserveOnOperator=UN;var $N=function(t){Xce(e,t);function e(r,n,i){i===void 0&&(i=0);var o=t.call(this,r)||this;return o.scheduler=n,o.delay=i,o}return e.dispatch=function(r){var n=r.notification,i=r.destination;n.observe(i),this.unsubscribe()},e.prototype.scheduleMessage=function(r){var n=this.destination;n.add(this.scheduler.schedule(e.dispatch,this.delay,new WN(r,this.destination)))},e.prototype._next=function(r){this.scheduleMessage(D5.Notification.createNext(r))},e.prototype._error=function(r){this.scheduleMessage(D5.Notification.createError(r)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(D5.Notification.createComplete()),this.unsubscribe()},e}(eue.Subscriber);cs.ObserveOnSubscriber=$N;var WN=function(){function t(e,r){this.notification=e,this.destination=r}return t}();cs.ObserveOnMessage=WN});var bm=_($h=>{"use strict";var rue=$h&&$h.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty($h,"__esModule",{value:!0});var nue=jr(),iue=O5(),oue=yr(),sue=N5(),aue=Ah(),cue=p5(),uue=function(t){rue(e,t);function e(r,n,i){r===void 0&&(r=Number.POSITIVE_INFINITY),n===void 0&&(n=Number.POSITIVE_INFINITY);var o=t.call(this)||this;return o.scheduler=i,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=r<1?1:r,o._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return e.prototype.nextInfiniteTimeWindow=function(r){if(!this.isStopped){var n=this._events;n.push(r),n.length>this._bufferSize&&n.shift()}t.prototype.next.call(this,r)},e.prototype.nextTimeWindow=function(r){this.isStopped||(this._events.push(new lue(this._getNow(),r)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){var n=this._infiniteTimeWindow,i=n?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,s=i.length,a;if(this.closed)throw new aue.ObjectUnsubscribedError;if(this.isStopped||this.hasError?a=oue.Subscription.EMPTY:(this.observers.push(r),a=new cue.SubjectSubscription(this,r)),o&&r.add(r=new sue.ObserveOnSubscriber(r,o)),n)for(var c=0;c<s&&!r.closed;c++)r.next(i[c]);else for(var c=0;c<s&&!r.closed;c++)r.next(i[c].value);return this.hasError?r.error(this.thrownError):this.isStopped&&r.complete(),a},e.prototype._getNow=function(){return(this.scheduler||iue.queue).now()},e.prototype._trimBufferThenGetEvents=function(){for(var r=this._getNow(),n=this._bufferSize,i=this._windowTime,o=this._events,s=o.length,a=0;a<s&&!(r-o[a].time<i);)a++;return s>n&&(a=Math.max(a,s-n)),a>0&&o.splice(0,a),o},e}(nue.Subject);$h.ReplaySubject=uue;var lue=function(){function t(e,r){this.time=e,this.value=r}return t}()});var Hh=_(Wh=>{"use strict";var fue=Wh&&Wh.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Wh,"__esModule",{value:!0});var hue=jr(),HN=yr(),due=function(t){fue(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.value=null,r.hasNext=!1,r.hasCompleted=!1,r}return e.prototype._subscribe=function(r){return this.hasError?(r.error(this.thrownError),HN.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(r.next(this.value),r.complete(),HN.Subscription.EMPTY):t.prototype._subscribe.call(this,r)},e.prototype.next=function(r){this.hasCompleted||(this.value=r,this.hasNext=!0)},e.prototype.error=function(r){this.hasCompleted||t.prototype.error.call(this,r)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(hue.Subject);Wh.AsyncSubject=due});var VN=_(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});var pue=1,gue=function(){return Promise.resolve()}(),_m={};function zN(t){return t in _m?(delete _m[t],!0):!1}wm.Immediate={setImmediate:function(t){var e=pue++;return _m[e]=!0,gue.then(function(){return zN(e)&&t()}),e},clearImmediate:function(t){zN(t)}};wm.TestTools={pending:function(){return Object.keys(_m).length}}});var KN=_(zh=>{"use strict";var mue=zh&&zh.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(zh,"__esModule",{value:!0});var GN=VN(),yue=Pu(),vue=function(t){mue(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=GN.Immediate.setImmediate(r.flush.bind(r,null))))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(GN.Immediate.clearImmediate(n),r.scheduled=void 0)},e}(yue.AsyncAction);zh.AsapAction=vue});var YN=_(Vh=>{"use strict";var bue=Vh&&Vh.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Vh,"__esModule",{value:!0});var _ue=Du(),wue=function(t){bue(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,o=-1,s=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++o<s&&(r=n.shift()));if(this.active=!1,i){for(;++o<s&&(r=n.shift());)r.unsubscribe();throw i}},e}(_ue.AsyncScheduler);Vh.AsapScheduler=wue});var k5=_(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});var Eue=KN(),Sue=YN();Gh.asapScheduler=new Sue.AsapScheduler(Eue.AsapAction);Gh.asap=Gh.asapScheduler});var Zr=_(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});var xue=Pu(),Oue=Du();Kh.asyncScheduler=new Oue.AsyncScheduler(xue.AsyncAction);Kh.async=Kh.asyncScheduler});var ZN=_(Yh=>{"use strict";var Cue=Yh&&Yh.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Yh,"__esModule",{value:!0});var Aue=Pu(),Iue=function(t){Cue(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=requestAnimationFrame(function(){return r.flush(null)})))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(cancelAnimationFrame(n),r.scheduled=void 0)},e}(Aue.AsyncAction);Yh.AnimationFrameAction=Iue});var JN=_(Zh=>{"use strict";var Mue=Zh&&Zh.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Zh,"__esModule",{value:!0});var Rue=Du(),Tue=function(t){Mue(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,o=-1,s=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++o<s&&(r=n.shift()));if(this.active=!1,i){for(;++o<s&&(r=n.shift());)r.unsubscribe();throw i}},e}(Rue.AsyncScheduler);Zh.AnimationFrameScheduler=Tue});var QN=_(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});var Pue=ZN(),Due=JN();Jh.animationFrameScheduler=new Due.AnimationFrameScheduler(Pue.AnimationFrameAction);Jh.animationFrame=Jh.animationFrameScheduler});var tk=_(ku=>{"use strict";var XN=ku&&ku.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ku,"__esModule",{value:!0});var Nue=Pu(),kue=Du(),Lue=function(t){XN(e,t);function e(r,n){r===void 0&&(r=ek),n===void 0&&(n=Number.POSITIVE_INFINITY);var i=t.call(this,r,function(){return i.frame})||this;return i.maxFrames=n,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var r=this,n=r.actions,i=r.maxFrames,o,s;(s=n[0])&&s.delay<=i&&(n.shift(),this.frame=s.delay,!(o=s.execute(s.state,s.delay))););if(o){for(;s=n.shift();)s.unsubscribe();throw o}},e.frameTimeFactor=10,e}(kue.AsyncScheduler);ku.VirtualTimeScheduler=Lue;var ek=function(t){XN(e,t);function e(r,n,i){i===void 0&&(i=r.index+=1);var o=t.call(this,r,n)||this;return o.scheduler=r,o.work=n,o.index=i,o.active=!0,o.index=r.index=i,o}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),!this.id)return t.prototype.schedule.call(this,r,n);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(r,n)},e.prototype.requestAsyncId=function(r,n,i){i===void 0&&(i=0),this.delay=r.frame+i;var o=r.actions;return o.push(this),o.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(r,n,i){i===void 0&&(i=0)},e.prototype._execute=function(r,n){if(this.active===!0)return t.prototype._execute.call(this,r,n)},e.sortActions=function(r,n){return r.delay===n.delay?r.index===n.index?0:r.index>n.index?1:-1:r.delay>n.delay?1:-1},e}(Nue.AsyncAction);ku.VirtualAction=ek});var Em=_(L5=>{"use strict";Object.defineProperty(L5,"__esModule",{value:!0});function jue(){}L5.noop=jue});var rk=_(j5=>{"use strict";Object.defineProperty(j5,"__esModule",{value:!0});var Bue=Ge();function que(t){return!!t&&(t instanceof Bue.Observable||typeof t.lift=="function"&&typeof t.subscribe=="function")}j5.isObservable=que});var Lu=_(B5=>{"use strict";Object.defineProperty(B5,"__esModule",{value:!0});var Fue=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}();B5.ArgumentOutOfRangeError=Fue});var ju=_(q5=>{"use strict";Object.defineProperty(q5,"__esModule",{value:!0});var Uue=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}();q5.EmptyError=Uue});var U5=_(F5=>{"use strict";Object.defineProperty(F5,"__esModule",{value:!0});var $ue=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}();F5.TimeoutError=$ue});var Sn=_(Bu=>{"use strict";var Wue=Bu&&Bu.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Bu,"__esModule",{value:!0});var Hue=Se();function zue(t,e){return function(n){if(typeof t!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new nk(t,e))}}Bu.map=zue;var nk=function(){function t(e,r){this.project=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new Vue(e,this.project,this.thisArg))},t}();Bu.MapOperator=nk;var Vue=function(t){Wue(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.project=n,o.count=0,o.thisArg=i||o,o}return e.prototype._next=function(r){var n;try{n=this.project.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(Hue.Subscriber)});var sk=_($5=>{"use strict";Object.defineProperty($5,"__esModule",{value:!0});var Gue=Ge(),ik=Hh(),Kue=Sn(),Yue=fm(),Zue=Yr(),Jue=Xn();function ok(t,e,r){if(e)if(Jue.isScheduler(e))r=e;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return ok(t,r).apply(void 0,n).pipe(Kue.map(function(o){return Zue.isArray(o)?e.apply(void 0,o):e(o)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=this,s,a={context:o,subject:s,callbackFunc:t,scheduler:r};return new Gue.Observable(function(c){if(r){var l={args:n,subscriber:c,params:a};return r.schedule(Que,0,l)}else{if(!s){s=new ik.AsyncSubject;var u=function(){for(var h=[],d=0;d<arguments.length;d++)h[d]=arguments[d];s.next(h.length<=1?h[0]:h),s.complete()};try{t.apply(o,n.concat([u]))}catch(h){Yue.canReportError(s)?s.error(h):console.warn(h)}}return s.subscribe(c)}})}}$5.bindCallback=ok;function Que(t){var e=this,r=this,n=t.args,i=t.subscriber,o=t.params,s=o.callbackFunc,a=o.context,c=o.scheduler,u=o.subject;if(!u){u=o.subject=new ik.AsyncSubject;var l=function(){for(var h=[],d=0;d<arguments.length;d++)h[d]=arguments[d];var m=h.length<=1?h[0]:h;e.add(c.schedule(Xue,0,{value:m,subject:u}))};try{s.apply(a,n.concat([l]))}catch(h){u.error(h)}}this.add(u.subscribe(i))}function Xue(t){var e=t.value,r=t.subject;r.next(e),r.complete()}});var lk=_(W5=>{"use strict";Object.defineProperty(W5,"__esModule",{value:!0});var ele=Ge(),ck=Hh(),tle=Sn(),rle=fm(),nle=Xn(),ile=Yr();function uk(t,e,r){if(e)if(nle.isScheduler(e))r=e;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return uk(t,r).apply(void 0,n).pipe(tle.map(function(o){return ile.isArray(o)?e.apply(void 0,o):e(o)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o={subject:void 0,args:n,callbackFunc:t,scheduler:r,context:this};return new ele.Observable(function(s){var a=o.context,c=o.subject;if(r)return r.schedule(ole,0,{params:o,subscriber:s,context:a});if(!c){c=o.subject=new ck.AsyncSubject;var u=function(){for(var l=[],h=0;h<arguments.length;h++)l[h]=arguments[h];var d=l.shift();if(d){c.error(d);return}c.next(l.length<=1?l[0]:l),c.complete()};try{t.apply(a,n.concat([u]))}catch(l){rle.canReportError(c)?c.error(l):console.warn(l)}}return c.subscribe(s)})}}W5.bindNodeCallback=uk;function ole(t){var e=this,r=t.params,n=t.subscriber,i=t.context,o=r.callbackFunc,s=r.args,a=r.scheduler,c=r.subject;if(!c){c=r.subject=new ck.AsyncSubject;var u=function(){for(var l=[],h=0;h<arguments.length;h++)l[h]=arguments[h];var d=l.shift();if(d)e.add(a.schedule(ak,0,{err:d,subject:c}));else{var m=l.length<=1?l[0]:l;e.add(a.schedule(sle,0,{value:m,subject:c}))}};try{o.apply(i,s.concat([u]))}catch(l){this.add(a.schedule(ak,0,{err:l,subject:c}))}}this.add(c.subscribe(n))}function sle(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function ak(t){var e=t.err,r=t.subject;r.error(e)}});var us=_(Qh=>{"use strict";var ale=Qh&&Qh.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Qh,"__esModule",{value:!0});var cle=Se(),ule=function(t){ale(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(r,n,i,o,s){this.destination.next(n)},e.prototype.notifyError=function(r,n){this.destination.error(r)},e.prototype.notifyComplete=function(r){this.destination.complete()},e}(cle.Subscriber);Qh.OuterSubscriber=ule});var fk=_(Xh=>{"use strict";var lle=Xh&&Xh.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Xh,"__esModule",{value:!0});var fle=Se(),hle=function(t){lle(e,t);function e(r,n,i){var o=t.call(this)||this;return o.parent=r,o.outerValue=n,o.outerIndex=i,o.index=0,o}return e.prototype._next=function(r){this.parent.notifyNext(this.outerValue,r,this.outerIndex,this.index++,this)},e.prototype._error=function(r){this.parent.notifyError(r,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(fle.Subscriber);Xh.InnerSubscriber=hle});var hk=_(H5=>{"use strict";Object.defineProperty(H5,"__esModule",{value:!0});var dle=sm();H5.subscribeToPromise=function(t){return function(e){return t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,dle.hostReportError),e}}});var Fu=_(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});function dk(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}qu.getSymbolIterator=dk;qu.iterator=dk();qu.$$iterator=qu.iterator});var pk=_(z5=>{"use strict";Object.defineProperty(z5,"__esModule",{value:!0});var ple=Fu();z5.subscribeToIterable=function(t){return function(e){var r=t[ple.iterator]();do{var n=void 0;try{n=r.next()}catch(i){return e.error(i),e}if(n.done){e.complete();break}if(e.next(n.value),e.closed)break}while(!0);return typeof r.return=="function"&&e.add(function(){r.return&&r.return()}),e}}});var gk=_(V5=>{"use strict";Object.defineProperty(V5,"__esModule",{value:!0});var gle=Oa();V5.subscribeToObservable=function(t){return function(e){var r=t[gle.observable]();if(typeof r.subscribe!="function")throw new TypeError("Provided object does not correctly implement Symbol.observable");return r.subscribe(e)}}});var K5=_(G5=>{"use strict";Object.defineProperty(G5,"__esModule",{value:!0});G5.isArrayLike=function(t){return t&&typeof t.length=="number"&&typeof t!="function"}});var Z5=_(Y5=>{"use strict";Object.defineProperty(Y5,"__esModule",{value:!0});function mle(t){return!!t&&typeof t.subscribe!="function"&&typeof t.then=="function"}Y5.isPromise=mle});var ed=_(J5=>{"use strict";Object.defineProperty(J5,"__esModule",{value:!0});var yle=I5(),vle=hk(),ble=pk(),_le=gk(),wle=K5(),Ele=Z5(),Sle=am(),xle=Fu(),Ole=Oa();J5.subscribeTo=function(t){if(!!t&&typeof t[Ole.observable]=="function")return _le.subscribeToObservable(t);if(wle.isArrayLike(t))return yle.subscribeToArray(t);if(Ele.isPromise(t))return vle.subscribeToPromise(t);if(!!t&&typeof t[xle.iterator]=="function")return ble.subscribeToIterable(t);var e=Sle.isObject(t)?"an invalid object":"'"+t+"'",r="You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(r)}});var ls=_(Q5=>{"use strict";Object.defineProperty(Q5,"__esModule",{value:!0});var Cle=fk(),Ale=ed(),Ile=Ge();function Mle(t,e,r,n,i){if(i===void 0&&(i=new Cle.InnerSubscriber(t,r,n)),!i.closed)return e instanceof Ile.Observable?e.subscribe(i):Ale.subscribeTo(e)(i)}Q5.subscribeToResult=Mle});var Sm=_(Aa=>{"use strict";var Rle=Aa&&Aa.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Aa,"__esModule",{value:!0});var Tle=Xn(),Ple=Yr(),Dle=us(),Nle=ls(),kle=Nu(),mk={};function Lle(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=void 0,n=void 0;return Tle.isScheduler(t[t.length-1])&&(n=t.pop()),typeof t[t.length-1]=="function"&&(r=t.pop()),t.length===1&&Ple.isArray(t[0])&&(t=t[0]),kle.fromArray(t,n).lift(new yk(r))}Aa.combineLatest=Lle;var yk=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new vk(e,this.resultSelector))},t}();Aa.CombineLatestOperator=yk;var vk=function(t){Rle(e,t);function e(r,n){var i=t.call(this,r)||this;return i.resultSelector=n,i.active=0,i.values=[],i.observables=[],i}return e.prototype._next=function(r){this.values.push(mk),this.observables.push(r)},e.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{this.active=n,this.toRespond=n;for(var i=0;i<n;i++){var o=r[i];this.add(Nle.subscribeToResult(this,o,void 0,i))}}},e.prototype.notifyComplete=function(r){(this.active-=1)===0&&this.destination.complete()},e.prototype.notifyNext=function(r,n,i){var o=this.values,s=o[i],a=this.toRespond?s===mk?--this.toRespond:this.toRespond:0;o[i]=n,a===0&&(this.resultSelector?this._tryResultSelector(o):this.destination.next(o.slice()))},e.prototype._tryResultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(Dle.OuterSubscriber);Aa.CombineLatestSubscriber=vk});var bk=_(X5=>{"use strict";Object.defineProperty(X5,"__esModule",{value:!0});var jle=Ge(),Ble=yr(),qle=Oa();function Fle(t,e){return new jle.Observable(function(r){var n=new Ble.Subscription;return n.add(e.schedule(function(){var i=t[qle.observable]();n.add(i.subscribe({next:function(o){n.add(e.schedule(function(){return r.next(o)}))},error:function(o){n.add(e.schedule(function(){return r.error(o)}))},complete:function(){n.add(e.schedule(function(){return r.complete()}))}}))})),n})}X5.scheduleObservable=Fle});var _k=_(e4=>{"use strict";Object.defineProperty(e4,"__esModule",{value:!0});var Ule=Ge(),$le=yr();function Wle(t,e){return new Ule.Observable(function(r){var n=new $le.Subscription;return n.add(e.schedule(function(){return t.then(function(i){n.add(e.schedule(function(){r.next(i),n.add(e.schedule(function(){return r.complete()}))}))},function(i){n.add(e.schedule(function(){return r.error(i)}))})})),n})}e4.schedulePromise=Wle});var wk=_(t4=>{"use strict";Object.defineProperty(t4,"__esModule",{value:!0});var Hle=Ge(),zle=yr(),Vle=Fu();function Gle(t,e){if(!t)throw new Error("Iterable cannot be null");return new Hle.Observable(function(r){var n=new zle.Subscription,i;return n.add(function(){i&&typeof i.return=="function"&&i.return()}),n.add(e.schedule(function(){i=t[Vle.iterator](),n.add(e.schedule(function(){if(!r.closed){var o,s;try{var a=i.next();o=a.value,s=a.done}catch(c){r.error(c);return}s?r.complete():(r.next(o),this.schedule())}}))})),n})}t4.scheduleIterable=Gle});var Ek=_(r4=>{"use strict";Object.defineProperty(r4,"__esModule",{value:!0});var Kle=Oa();function Yle(t){return t&&typeof t[Kle.observable]=="function"}r4.isInteropObservable=Yle});var Sk=_(n4=>{"use strict";Object.defineProperty(n4,"__esModule",{value:!0});var Zle=Fu();function Jle(t){return t&&typeof t[Zle.iterator]=="function"}n4.isIterable=Jle});var o4=_(i4=>{"use strict";Object.defineProperty(i4,"__esModule",{value:!0});var Qle=bk(),Xle=_k(),efe=ym(),tfe=wk(),rfe=Ek(),nfe=Z5(),ife=K5(),ofe=Sk();function sfe(t,e){if(t!=null){if(rfe.isInteropObservable(t))return Qle.scheduleObservable(t,e);if(nfe.isPromise(t))return Xle.schedulePromise(t,e);if(ife.isArrayLike(t))return efe.scheduleArray(t,e);if(ofe.isIterable(t)||typeof t=="string")return tfe.scheduleIterable(t,e)}throw new TypeError((t!==null&&typeof t||t)+" is not observable")}i4.scheduled=sfe});var ei=_(s4=>{"use strict";Object.defineProperty(s4,"__esModule",{value:!0});var xk=Ge(),afe=ed(),cfe=o4();function ufe(t,e){return e?cfe.scheduled(t,e):t instanceof xk.Observable?t:new xk.Observable(afe.subscribeTo(t))}s4.from=ufe});var Yt=_(xo=>{"use strict";var xm=xo&&xo.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(xo,"__esModule",{value:!0});var Om=Se(),lfe=Ge(),ffe=ed(),hfe=function(t){xm(e,t);function e(r){var n=t.call(this)||this;return n.parent=r,n}return e.prototype._next=function(r){this.parent.notifyNext(r)},e.prototype._error=function(r){this.parent.notifyError(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(Om.Subscriber);xo.SimpleInnerSubscriber=hfe;var dfe=function(t){xm(e,t);function e(r,n,i){var o=t.call(this)||this;return o.parent=r,o.outerValue=n,o.outerIndex=i,o}return e.prototype._next=function(r){this.parent.notifyNext(this.outerValue,r,this.outerIndex,this)},e.prototype._error=function(r){this.parent.notifyError(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(Om.Subscriber);xo.ComplexInnerSubscriber=dfe;var pfe=function(t){xm(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyError=function(r){this.destination.error(r)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(Om.Subscriber);xo.SimpleOuterSubscriber=pfe;var gfe=function(t){xm(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(r,n,i,o){this.destination.next(n)},e.prototype.notifyError=function(r){this.destination.error(r)},e.prototype.notifyComplete=function(r){this.destination.complete()},e}(Om.Subscriber);xo.ComplexOuterSubscriber=gfe;function mfe(t,e){if(!e.closed){if(t instanceof lfe.Observable)return t.subscribe(e);var r;try{r=ffe.subscribeTo(t)(e)}catch(n){e.error(n)}return r}}xo.innerSubscribe=mfe});var td=_(fs=>{"use strict";var yfe=fs&&fs.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(fs,"__esModule",{value:!0});var vfe=Sn(),bfe=ei(),a4=Yt();function c4(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof e=="function"?function(n){return n.pipe(c4(function(i,o){return bfe.from(t(i,o)).pipe(vfe.map(function(s,a){return e(i,s,o,a)}))},r))}:(typeof e=="number"&&(r=e),function(n){return n.lift(new Ok(t,r))})}fs.mergeMap=c4;var Ok=function(){function t(e,r){r===void 0&&(r=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=r}return t.prototype.call=function(e,r){return r.subscribe(new Ck(e,this.project,this.concurrent))},t}();fs.MergeMapOperator=Ok;var Ck=function(t){yfe(e,t);function e(r,n,i){i===void 0&&(i=Number.POSITIVE_INFINITY);var o=t.call(this,r)||this;return o.project=n,o.concurrent=i,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return e.prototype._next=function(r){this.active<this.concurrent?this._tryNext(r):this.buffer.push(r)},e.prototype._tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(o){this.destination.error(o);return}this.active++,this._innerSub(n)},e.prototype._innerSub=function(r){var n=new a4.SimpleInnerSubscriber(this),i=this.destination;i.add(n);var o=a4.innerSubscribe(r,n);o!==n&&i.add(o)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},e}(a4.SimpleOuterSubscriber);fs.MergeMapSubscriber=Ck;fs.flatMap=c4});var Cm=_(u4=>{"use strict";Object.defineProperty(u4,"__esModule",{value:!0});var _fe=td(),wfe=as();function Efe(t){return t===void 0&&(t=Number.POSITIVE_INFINITY),_fe.mergeMap(wfe.identity,t)}u4.mergeAll=Efe});var f4=_(l4=>{"use strict";Object.defineProperty(l4,"__esModule",{value:!0});var Sfe=Cm();function xfe(){return Sfe.mergeAll(1)}l4.concatAll=xfe});var rd=_(h4=>{"use strict";Object.defineProperty(h4,"__esModule",{value:!0});var Ofe=qh(),Cfe=f4();function Afe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Cfe.concatAll()(Ofe.of.apply(void 0,t))}h4.concat=Afe});var Am=_(d4=>{"use strict";Object.defineProperty(d4,"__esModule",{value:!0});var Ife=Ge(),Mfe=ei(),Rfe=Qn();function Tfe(t){return new Ife.Observable(function(e){var r;try{r=t()}catch(i){e.error(i);return}var n=r?Mfe.from(r):Rfe.empty();return n.subscribe(e)})}d4.defer=Tfe});var Ik=_(p4=>{"use strict";Object.defineProperty(p4,"__esModule",{value:!0});var Pfe=Ge(),Ak=Yr(),Dfe=Sn(),Nfe=am(),kfe=ei();function Lfe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1){var r=t[0];if(Ak.isArray(r))return Im(r,null);if(Nfe.isObject(r)&&Object.getPrototypeOf(r)===Object.prototype){var n=Object.keys(r);return Im(n.map(function(o){return r[o]}),n)}}if(typeof t[t.length-1]=="function"){var i=t.pop();return t=t.length===1&&Ak.isArray(t[0])?t[0]:t,Im(t,null).pipe(Dfe.map(function(o){return i.apply(void 0,o)}))}return Im(t,null)}p4.forkJoin=Lfe;function Im(t,e){return new Pfe.Observable(function(r){var n=t.length;if(n===0){r.complete();return}for(var i=new Array(n),o=0,s=0,a=function(u){var l=kfe.from(t[u]),h=!1;r.add(l.subscribe({next:function(d){h||(h=!0,s++),i[u]=d},error:function(d){return r.error(d)},complete:function(){o++,(o===n||!h)&&(s===n&&r.next(e?e.reduce(function(d,m,v){return d[m]=i[v],d},{}):i),r.complete())}}))},c=0;c<n;c++)a(c)})}});var Tk=_(g4=>{"use strict";Object.defineProperty(g4,"__esModule",{value:!0});var jfe=Ge(),Bfe=Yr(),qfe=Au(),Ffe=Sn(),$je=function(){return Object.prototype.toString}();function Mk(t,e,r,n){return qfe.isFunction(r)&&(n=r,r=void 0),n?Mk(t,e,r).pipe(Ffe.map(function(i){return Bfe.isArray(i)?n.apply(void 0,i):n(i)})):new jfe.Observable(function(i){function o(s){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(s)}Rk(t,e,o,i,r)})}g4.fromEvent=Mk;function Rk(t,e,r,n,i){var o;if(Wfe(t)){var s=t;t.addEventListener(e,r,i),o=function(){return s.removeEventListener(e,r,i)}}else if($fe(t)){var a=t;t.on(e,r),o=function(){return a.off(e,r)}}else if(Ufe(t)){var c=t;t.addListener(e,r),o=function(){return c.removeListener(e,r)}}else if(t&&t.length)for(var u=0,l=t.length;u<l;u++)Rk(t[u],e,r,n,i);else throw new TypeError("Invalid event target");n.add(o)}function Ufe(t){return t&&typeof t.addListener=="function"&&typeof t.removeListener=="function"}function $fe(t){return t&&typeof t.on=="function"&&typeof t.off=="function"}function Wfe(t){return t&&typeof t.addEventListener=="function"&&typeof t.removeEventListener=="function"}});var Dk=_(m4=>{"use strict";Object.defineProperty(m4,"__esModule",{value:!0});var Hfe=Ge(),zfe=Yr(),Vfe=Au(),Gfe=Sn();function Pk(t,e,r){return r?Pk(t,e).pipe(Gfe.map(function(n){return zfe.isArray(n)?r.apply(void 0,n):r(n)})):new Hfe.Observable(function(n){var i=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return n.next(s.length===1?s[0]:s)},o;try{o=t(i)}catch(s){n.error(s);return}if(!!Vfe.isFunction(e))return function(){return e(i,o)}})}m4.fromEventPattern=Pk});var kk=_(y4=>{"use strict";Object.defineProperty(y4,"__esModule",{value:!0});var Kfe=Ge(),Nk=as(),Yfe=Xn();function Zfe(t,e,r,n,i){var o,s;if(arguments.length==1){var a=t;s=a.initialState,e=a.condition,r=a.iterate,o=a.resultSelector||Nk.identity,i=a.scheduler}else n===void 0||Yfe.isScheduler(n)?(s=t,o=Nk.identity,i=n):(s=t,o=n);return new Kfe.Observable(function(c){var u=s;if(i)return i.schedule(Jfe,0,{subscriber:c,iterate:r,condition:e,resultSelector:o,state:u});do{if(e){var l=void 0;try{l=e(u)}catch(d){c.error(d);return}if(!l){c.complete();break}}var h=void 0;try{h=o(u)}catch(d){c.error(d);return}if(c.next(h),c.closed)break;try{u=r(u)}catch(d){c.error(d);return}}while(!0)})}y4.generate=Zfe;function Jfe(t){var e=t.subscriber,r=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(o){e.error(o);return}else t.needIterate=!0;if(r){var n=void 0;try{n=r(t.state)}catch(o){e.error(o);return}if(!n){e.complete();return}if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(o){e.error(o);return}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}});var jk=_(v4=>{"use strict";Object.defineProperty(v4,"__esModule",{value:!0});var Qfe=Am(),Lk=Qn();function Xfe(t,e,r){return e===void 0&&(e=Lk.EMPTY),r===void 0&&(r=Lk.EMPTY),Qfe.defer(function(){return t()?e:r})}v4.iif=Xfe});var nd=_(b4=>{"use strict";Object.defineProperty(b4,"__esModule",{value:!0});var ehe=Yr();function the(t){return!ehe.isArray(t)&&t-parseFloat(t)+1>=0}b4.isNumeric=the});var qk=_(_4=>{"use strict";Object.defineProperty(_4,"__esModule",{value:!0});var rhe=Ge(),Bk=Zr(),nhe=nd();function ihe(t,e){return t===void 0&&(t=0),e===void 0&&(e=Bk.async),(!nhe.isNumeric(t)||t<0)&&(t=0),(!e||typeof e.schedule!="function")&&(e=Bk.async),new rhe.Observable(function(r){return r.add(e.schedule(ohe,t,{subscriber:r,counter:0,period:t})),r})}_4.interval=ihe;function ohe(t){var e=t.subscriber,r=t.counter,n=t.period;e.next(r),this.schedule({subscriber:e,counter:r+1,period:n},n)}});var E4=_(w4=>{"use strict";Object.defineProperty(w4,"__esModule",{value:!0});var she=Ge(),ahe=Xn(),che=Cm(),uhe=Nu();function lhe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return ahe.isScheduler(i)?(n=t.pop(),t.length>1&&typeof t[t.length-1]=="number"&&(r=t.pop())):typeof i=="number"&&(r=t.pop()),n===null&&t.length===1&&t[0]instanceof she.Observable?t[0]:che.mergeAll(r)(uhe.fromArray(t,n))}w4.merge=lhe});var S4=_(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});var fhe=Ge(),hhe=Em();id.NEVER=new fhe.Observable(hhe.noop);function dhe(){return id.NEVER}id.never=dhe});var Fk=_(O4=>{"use strict";Object.defineProperty(O4,"__esModule",{value:!0});var phe=Ge(),ghe=ei(),mhe=Yr(),yhe=Qn();function x4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===0)return yhe.EMPTY;var r=t[0],n=t.slice(1);return t.length===1&&mhe.isArray(r)?x4.apply(void 0,r):new phe.Observable(function(i){var o=function(){return i.add(x4.apply(void 0,n).subscribe(i))};return ghe.from(r).subscribe({next:function(s){i.next(s)},error:o,complete:o})})}O4.onErrorResumeNext=x4});var Wk=_(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});var Uk=Ge(),vhe=yr();function bhe(t,e){return e?new Uk.Observable(function(r){var n=Object.keys(t),i=new vhe.Subscription;return i.add(e.schedule($k,0,{keys:n,index:0,subscriber:r,subscription:i,obj:t})),i}):new Uk.Observable(function(r){for(var n=Object.keys(t),i=0;i<n.length&&!r.closed;i++){var o=n[i];t.hasOwnProperty(o)&&r.next([o,t[o]])}r.complete()})}Mm.pairs=bhe;function $k(t){var e=t.keys,r=t.index,n=t.subscriber,i=t.subscription,o=t.obj;if(!n.closed)if(r<e.length){var s=e[r];n.next([s,o[s]]),i.add(this.schedule({keys:e,index:r+1,subscriber:n,subscription:i,obj:o}))}else n.complete()}Mm.dispatch=$k});var A4=_(C4=>{"use strict";Object.defineProperty(C4,"__esModule",{value:!0});function _he(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}C4.not=_he});var Ia=_(od=>{"use strict";var whe=od&&od.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(od,"__esModule",{value:!0});var Ehe=Se();function She(t,e){return function(n){return n.lift(new xhe(t,e))}}od.filter=She;var xhe=function(){function t(e,r){this.predicate=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new Ohe(e,this.predicate,this.thisArg))},t}(),Ohe=function(t){whe(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.predicate=n,o.thisArg=i,o.count=0,o}return e.prototype._next=function(r){var n;try{n=this.predicate.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}n&&this.destination.next(r)},e}(Ehe.Subscriber)});var Gk=_(I4=>{"use strict";Object.defineProperty(I4,"__esModule",{value:!0});var Che=A4(),Hk=ed(),zk=Ia(),Vk=Ge();function Ahe(t,e,r){return[zk.filter(e,r)(new Vk.Observable(Hk.subscribeTo(t))),zk.filter(Che.not(e,r))(new Vk.Observable(Hk.subscribeTo(t)))]}I4.partition=Ahe});var M4=_(Ma=>{"use strict";var Ihe=Ma&&Ma.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ma,"__esModule",{value:!0});var Mhe=Yr(),Rhe=Nu(),The=us(),Phe=ls();function Dhe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1)if(Mhe.isArray(t[0]))t=t[0];else return t[0];return Rhe.fromArray(t,void 0).lift(new Kk)}Ma.race=Dhe;var Kk=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new Yk(e))},t}();Ma.RaceOperator=Kk;var Yk=function(t){Ihe(e,t);function e(r){var n=t.call(this,r)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return e.prototype._next=function(r){this.observables.push(r)},e.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{for(var i=0;i<n&&!this.hasFirst;i++){var o=r[i],s=Phe.subscribeToResult(this,o,void 0,i);this.subscriptions&&this.subscriptions.push(s),this.add(s)}this.observables=null}},e.prototype.notifyNext=function(r,n,i){if(!this.hasFirst){this.hasFirst=!0;for(var o=0;o<this.subscriptions.length;o++)if(o!==i){var s=this.subscriptions[o];s.unsubscribe(),this.remove(s)}this.subscriptions=null}this.destination.next(n)},e}(The.OuterSubscriber);Ma.RaceSubscriber=Yk});var Jk=_(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});var Nhe=Ge();function khe(t,e,r){return t===void 0&&(t=0),new Nhe.Observable(function(n){e===void 0&&(e=t,t=0);var i=0,o=t;if(r)return r.schedule(Zk,0,{index:i,count:e,start:t,subscriber:n});do{if(i++>=e){n.complete();break}if(n.next(o++),n.closed)break}while(!0)})}Rm.range=khe;function Zk(t){var e=t.start,r=t.index,n=t.count,i=t.subscriber;if(r>=n){i.complete();return}i.next(e),!i.closed&&(t.index=r+1,t.start=e+1,this.schedule(t))}Rm.dispatch=Zk});var T4=_(R4=>{"use strict";Object.defineProperty(R4,"__esModule",{value:!0});var Lhe=Ge(),jhe=Zr(),Qk=nd(),Xk=Xn();function Bhe(t,e,r){t===void 0&&(t=0);var n=-1;return Qk.isNumeric(e)?n=Number(e)<1&&1||Number(e):Xk.isScheduler(e)&&(r=e),Xk.isScheduler(r)||(r=jhe.async),new Lhe.Observable(function(i){var o=Qk.isNumeric(t)?t:+t-r.now();return r.schedule(qhe,o,{index:0,period:n,subscriber:i})})}R4.timer=Bhe;function qhe(t){var e=t.index,r=t.period,n=t.subscriber;if(n.next(e),!n.closed){if(r===-1)return n.complete();t.index=e+1,this.schedule(t,r)}}});var eL=_(P4=>{"use strict";Object.defineProperty(P4,"__esModule",{value:!0});var Fhe=Ge(),Uhe=ei(),$he=Qn();function Whe(t,e){return new Fhe.Observable(function(r){var n;try{n=t()}catch(a){r.error(a);return}var i;try{i=e(n)}catch(a){r.error(a);return}var o=i?Uhe.from(i):$he.EMPTY,s=o.subscribe(r);return function(){s.unsubscribe(),n&&n.unsubscribe()}})}P4.using=Whe});var Pm=_(Ra=>{"use strict";var tL=Ra&&Ra.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ra,"__esModule",{value:!0});var Hhe=Nu(),zhe=Yr(),Vhe=Se(),Tm=Fu(),D4=Yt();function Ghe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return typeof r=="function"&&t.pop(),Hhe.fromArray(t,void 0).lift(new rL(r))}Ra.zip=Ghe;var rL=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new nL(e,this.resultSelector))},t}();Ra.ZipOperator=rL;var nL=function(t){tL(e,t);function e(r,n,i){i===void 0&&(i=Object.create(null));var o=t.call(this,r)||this;return o.resultSelector=n,o.iterators=[],o.active=0,o.resultSelector=typeof n=="function"?n:void 0,o}return e.prototype._next=function(r){var n=this.iterators;zhe.isArray(r)?n.push(new Yhe(r)):typeof r[Tm.iterator]=="function"?n.push(new Khe(r[Tm.iterator]())):n.push(new Zhe(this.destination,this,r))},e.prototype._complete=function(){var r=this.iterators,n=r.length;if(this.unsubscribe(),n===0){this.destination.complete();return}this.active=n;for(var i=0;i<n;i++){var o=r[i];if(o.stillUnsubscribed){var s=this.destination;s.add(o.subscribe())}else this.active--}},e.prototype.notifyInactive=function(){this.active--,this.active===0&&this.destination.complete()},e.prototype.checkIterators=function(){for(var r=this.iterators,n=r.length,i=this.destination,o=0;o<n;o++){var s=r[o];if(typeof s.hasValue=="function"&&!s.hasValue())return}for(var a=!1,c=[],o=0;o<n;o++){var s=r[o],u=s.next();if(s.hasCompleted()&&(a=!0),u.done){i.complete();return}c.push(u.value)}this.resultSelector?this._tryresultSelector(c):i.next(c),a&&i.complete()},e.prototype._tryresultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(Vhe.Subscriber);Ra.ZipSubscriber=nL;var Khe=function(){function t(e){this.iterator=e,this.nextResult=e.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},t.prototype.hasCompleted=function(){var e=this.nextResult;return Boolean(e&&e.done)},t}(),Yhe=function(){function t(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return t.prototype[Tm.iterator]=function(){return this},t.prototype.next=function(e){var r=this.index++,n=this.array;return r<this.length?{value:n[r],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),Zhe=function(t){tL(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.parent=n,o.observable=i,o.stillUnsubscribed=!0,o.buffer=[],o.isComplete=!1,o}return e.prototype[Tm.iterator]=function(){return this},e.prototype.next=function(){var r=this.buffer;return r.length===0&&this.isComplete?{value:null,done:!0}:{value:r.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return this.buffer.length===0&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(r){this.buffer.push(r),this.parent.checkIterators()},e.prototype.subscribe=function(){return D4.innerSubscribe(this.observable,new D4.SimpleInnerSubscriber(this))},e}(D4.SimpleOuterSubscriber)});var Ta=_(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});var Jhe=Ge();pe.Observable=Jhe.Observable;var Qhe=b5();pe.ConnectableObservable=Qhe.ConnectableObservable;var Xhe=w5();pe.GroupedObservable=Xhe.GroupedObservable;var ede=Oa();pe.observable=ede.observable;var tde=jr();pe.Subject=tde.Subject;var rde=E5();pe.BehaviorSubject=rde.BehaviorSubject;var nde=bm();pe.ReplaySubject=nde.ReplaySubject;var ide=Hh();pe.AsyncSubject=ide.AsyncSubject;var iL=k5();pe.asap=iL.asap;pe.asapScheduler=iL.asapScheduler;var oL=Zr();pe.async=oL.async;pe.asyncScheduler=oL.asyncScheduler;var sL=O5();pe.queue=sL.queue;pe.queueScheduler=sL.queueScheduler;var aL=QN();pe.animationFrame=aL.animationFrame;pe.animationFrameScheduler=aL.animationFrameScheduler;var cL=tk();pe.VirtualTimeScheduler=cL.VirtualTimeScheduler;pe.VirtualAction=cL.VirtualAction;var ode=x5();pe.Scheduler=ode.Scheduler;var sde=yr();pe.Subscription=sde.Subscription;var ade=Se();pe.Subscriber=ade.Subscriber;var uL=Uh();pe.Notification=uL.Notification;pe.NotificationKind=uL.NotificationKind;var cde=dm();pe.pipe=cde.pipe;var ude=Em();pe.noop=ude.noop;var lde=as();pe.identity=lde.identity;var fde=rk();pe.isObservable=fde.isObservable;var hde=Lu();pe.ArgumentOutOfRangeError=hde.ArgumentOutOfRangeError;var dde=ju();pe.EmptyError=dde.EmptyError;var pde=Ah();pe.ObjectUnsubscribedError=pde.ObjectUnsubscribedError;var gde=n5();pe.UnsubscriptionError=gde.UnsubscriptionError;var mde=U5();pe.TimeoutError=mde.TimeoutError;var yde=sk();pe.bindCallback=yde.bindCallback;var vde=lk();pe.bindNodeCallback=vde.bindNodeCallback;var bde=Sm();pe.combineLatest=bde.combineLatest;var _de=rd();pe.concat=_de.concat;var wde=Am();pe.defer=wde.defer;var Ede=Qn();pe.empty=Ede.empty;var Sde=Ik();pe.forkJoin=Sde.forkJoin;var xde=ei();pe.from=xde.from;var Ode=Tk();pe.fromEvent=Ode.fromEvent;var Cde=Dk();pe.fromEventPattern=Cde.fromEventPattern;var Ade=kk();pe.generate=Ade.generate;var Ide=jk();pe.iif=Ide.iif;var Mde=qk();pe.interval=Mde.interval;var Rde=E4();pe.merge=Rde.merge;var Tde=S4();pe.never=Tde.never;var Pde=qh();pe.of=Pde.of;var Dde=Fk();pe.onErrorResumeNext=Dde.onErrorResumeNext;var Nde=Wk();pe.pairs=Nde.pairs;var kde=Gk();pe.partition=kde.partition;var Lde=M4();pe.race=Lde.race;var jde=Jk();pe.range=jde.range;var Bde=vm();pe.throwError=Bde.throwError;var qde=T4();pe.timer=qde.timer;var Fde=eL();pe.using=Fde.using;var Ude=Pm();pe.zip=Ude.zip;var $de=o4();pe.scheduled=$de.scheduled;var Wde=Qn();pe.EMPTY=Wde.EMPTY;var Hde=S4();pe.NEVER=Hde.NEVER;var zde=Oh();pe.config=zde.config});var k4=_(sd=>{"use strict";var Vde=sd&&sd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(sd,"__esModule",{value:!0});var N4=Yt();function Gde(t){return function(r){return r.lift(new Kde(t))}}sd.audit=Gde;var Kde=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new Yde(e,this.durationSelector))},t}(),Yde=function(t){Vde(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){if(this.value=r,this.hasValue=!0,!this.throttled){var n=void 0;try{var i=this.durationSelector;n=i(r)}catch(s){return this.destination.error(s)}var o=N4.innerSubscribe(n,new N4.SimpleInnerSubscriber(this));!o||o.closed?this.clearThrottle():this.add(this.throttled=o)}},e.prototype.clearThrottle=function(){var r=this,n=r.value,i=r.hasValue,o=r.throttled;o&&(this.remove(o),this.throttled=void 0,o.unsubscribe()),i&&(this.value=void 0,this.hasValue=!1,this.destination.next(n))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(N4.SimpleOuterSubscriber)});var lL=_(L4=>{"use strict";Object.defineProperty(L4,"__esModule",{value:!0});var Zde=Zr(),Jde=k4(),Qde=T4();function Xde(t,e){return e===void 0&&(e=Zde.async),Jde.audit(function(){return Qde.timer(t,e)})}L4.auditTime=Xde});var fL=_(ad=>{"use strict";var epe=ad&&ad.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ad,"__esModule",{value:!0});var j4=Yt();function tpe(t){return function(r){return r.lift(new rpe(t))}}ad.buffer=tpe;var rpe=function(){function t(e){this.closingNotifier=e}return t.prototype.call=function(e,r){return r.subscribe(new npe(e,this.closingNotifier))},t}(),npe=function(t){epe(e,t);function e(r,n){var i=t.call(this,r)||this;return i.buffer=[],i.add(j4.innerSubscribe(n,new j4.SimpleInnerSubscriber(i))),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype.notifyNext=function(){var r=this.buffer;this.buffer=[],this.destination.next(r)},e}(j4.SimpleOuterSubscriber)});var pL=_(cd=>{"use strict";var hL=cd&&cd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(cd,"__esModule",{value:!0});var dL=Se();function ipe(t,e){return e===void 0&&(e=null),function(n){return n.lift(new ope(t,e))}}cd.bufferCount=ipe;var ope=function(){function t(e,r){this.bufferSize=e,this.startBufferEvery=r,!r||e===r?this.subscriberClass=spe:this.subscriberClass=ape}return t.prototype.call=function(e,r){return r.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},t}(),spe=function(t){hL(e,t);function e(r,n){var i=t.call(this,r)||this;return i.bufferSize=n,i.buffer=[],i}return e.prototype._next=function(r){var n=this.buffer;n.push(r),n.length==this.bufferSize&&(this.destination.next(n),this.buffer=[])},e.prototype._complete=function(){var r=this.buffer;r.length>0&&this.destination.next(r),t.prototype._complete.call(this)},e}(dL.Subscriber),ape=function(t){hL(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.bufferSize=n,o.startBufferEvery=i,o.buffers=[],o.count=0,o}return e.prototype._next=function(r){var n=this,i=n.bufferSize,o=n.startBufferEvery,s=n.buffers,a=n.count;this.count++,a%o===0&&s.push([]);for(var c=s.length;c--;){var u=s[c];u.push(r),u.length===i&&(s.splice(c,1),this.destination.next(u))}},e.prototype._complete=function(){for(var r=this,n=r.buffers,i=r.destination;n.length>0;){var o=n.shift();o.length>0&&i.next(o)}t.prototype._complete.call(this)},e}(dL.Subscriber)});var yL=_(ud=>{"use strict";var cpe=ud&&ud.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ud,"__esModule",{value:!0});var upe=Zr(),lpe=Se(),fpe=Xn();function hpe(t){var e=arguments.length,r=upe.async;fpe.isScheduler(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],e--);var n=null;e>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(s){return s.lift(new dpe(t,n,i,r))}}ud.bufferTime=hpe;var dpe=function(){function t(e,r,n,i){this.bufferTimeSpan=e,this.bufferCreationInterval=r,this.maxBufferSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new gpe(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),ppe=function(){function t(){this.buffer=[]}return t}(),gpe=function(t){cpe(e,t);function e(r,n,i,o,s){var a=t.call(this,r)||this;a.bufferTimeSpan=n,a.bufferCreationInterval=i,a.maxBufferSize=o,a.scheduler=s,a.contexts=[];var c=a.openContext();if(a.timespanOnly=i==null||i<0,a.timespanOnly){var u={subscriber:a,context:c,bufferTimeSpan:n};a.add(c.closeAction=s.schedule(gL,n,u))}else{var l={subscriber:a,context:c},h={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:a,scheduler:s};a.add(c.closeAction=s.schedule(mL,n,l)),a.add(s.schedule(mpe,i,h))}return a}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,o,s=0;s<i;s++){var a=n[s],c=a.buffer;c.push(r),c.length==this.maxBufferSize&&(o=a)}o&&this.onBufferFull(o)},e.prototype._error=function(r){this.contexts.length=0,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this,n=r.contexts,i=r.destination;n.length>0;){var o=n.shift();i.next(o.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(r){this.closeContext(r);var n=r.closeAction;if(n.unsubscribe(),this.remove(n),!this.closed&&this.timespanOnly){r=this.openContext();var i=this.bufferTimeSpan,o={subscriber:this,context:r,bufferTimeSpan:i};this.add(r.closeAction=this.scheduler.schedule(gL,i,o))}},e.prototype.openContext=function(){var r=new ppe;return this.contexts.push(r),r},e.prototype.closeContext=function(r){this.destination.next(r.buffer);var n=this.contexts,i=n?n.indexOf(r):-1;i>=0&&n.splice(n.indexOf(r),1)},e}(lpe.Subscriber);function gL(t){var e=t.subscriber,r=t.context;r&&e.closeContext(r),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function mpe(t){var e=t.bufferCreationInterval,r=t.bufferTimeSpan,n=t.subscriber,i=t.scheduler,o=n.openContext(),s=this;n.closed||(n.add(o.closeAction=i.schedule(mL,r,{subscriber:n,context:o})),s.schedule(t,e))}function mL(t){var e=t.subscriber,r=t.context;e.closeContext(r)}});var bL=_(ld=>{"use strict";var ype=ld&&ld.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ld,"__esModule",{value:!0});var vpe=yr(),vL=ls(),bpe=us();function _pe(t,e){return function(n){return n.lift(new wpe(t,e))}}ld.bufferToggle=_pe;var wpe=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new Epe(e,this.openings,this.closingSelector))},t}(),Epe=function(t){ype(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.closingSelector=i,o.contexts=[],o.add(vL.subscribeToResult(o,n)),o}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,o=0;o<i;o++)n[o].buffer.push(r)},e.prototype._error=function(r){for(var n=this.contexts;n.length>0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this.contexts;r.length>0;){var n=r.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(r,n){r?this.closeBuffer(r):this.openBuffer(n)},e.prototype.notifyComplete=function(r){this.closeBuffer(r.context)},e.prototype.openBuffer=function(r){try{var n=this.closingSelector,i=n.call(this,r);i&&this.trySubscribe(i)}catch(o){this._error(o)}},e.prototype.closeBuffer=function(r){var n=this.contexts;if(n&&r){var i=r.buffer,o=r.subscription;this.destination.next(i),n.splice(n.indexOf(r),1),this.remove(o),o.unsubscribe()}},e.prototype.trySubscribe=function(r){var n=this.contexts,i=[],o=new vpe.Subscription,s={buffer:i,subscription:o};n.push(s);var a=vL.subscribeToResult(this,r,s);!a||a.closed?this.closeBuffer(s):(a.context=s,this.add(a),o.add(a))},e}(bpe.OuterSubscriber)});var _L=_(fd=>{"use strict";var Spe=fd&&fd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(fd,"__esModule",{value:!0});var xpe=yr(),B4=Yt();function Ope(t){return function(e){return e.lift(new Cpe(t))}}fd.bufferWhen=Ope;var Cpe=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new Ape(e,this.closingSelector))},t}(),Ape=function(t){Spe(e,t);function e(r,n){var i=t.call(this,r)||this;return i.closingSelector=n,i.subscribing=!1,i.openBuffer(),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype._complete=function(){var r=this.buffer;r&&this.destination.next(r),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var r=this.closingSubscription;r&&(this.remove(r),r.unsubscribe());var n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];var i;try{var o=this.closingSelector;i=o()}catch(s){return this.error(s)}r=new xpe.Subscription,this.closingSubscription=r,this.add(r),this.subscribing=!0,r.add(B4.innerSubscribe(i,new B4.SimpleInnerSubscriber(this))),this.subscribing=!1},e}(B4.SimpleOuterSubscriber)});var wL=_(hd=>{"use strict";var Ipe=hd&&hd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(hd,"__esModule",{value:!0});var q4=Yt();function Mpe(t){return function(r){var n=new Rpe(t),i=r.lift(n);return n.caught=i}}hd.catchError=Mpe;var Rpe=function(){function t(e){this.selector=e}return t.prototype.call=function(e,r){return r.subscribe(new Tpe(e,this.selector,this.caught))},t}(),Tpe=function(t){Ipe(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.selector=n,o.caught=i,o}return e.prototype.error=function(r){if(!this.isStopped){var n=void 0;try{n=this.selector(r,this.caught)}catch(s){t.prototype.error.call(this,s);return}this._unsubscribeAndRecycle();var i=new q4.SimpleInnerSubscriber(this);this.add(i);var o=q4.innerSubscribe(n,i);o!==i&&this.add(o)}},e}(q4.SimpleOuterSubscriber)});var EL=_(F4=>{"use strict";Object.defineProperty(F4,"__esModule",{value:!0});var Ppe=Sm();function Dpe(t){return function(e){return e.lift(new Ppe.CombineLatestOperator(t))}}F4.combineAll=Dpe});var SL=_(U4=>{"use strict";Object.defineProperty(U4,"__esModule",{value:!0});var Npe=Yr(),kpe=Sm(),Lpe=ei();function jpe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=null;return typeof t[t.length-1]=="function"&&(r=t.pop()),t.length===1&&Npe.isArray(t[0])&&(t=t[0].slice()),function(n){return n.lift.call(Lpe.from([n].concat(t)),new kpe.CombineLatestOperator(r))}}U4.combineLatest=jpe});var xL=_($4=>{"use strict";Object.defineProperty($4,"__esModule",{value:!0});var Bpe=rd();function qpe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(Bpe.concat.apply(void 0,[r].concat(t)))}}$4.concat=qpe});var H4=_(W4=>{"use strict";Object.defineProperty(W4,"__esModule",{value:!0});var Fpe=td();function Upe(t,e){return Fpe.mergeMap(t,e,1)}W4.concatMap=Upe});var OL=_(z4=>{"use strict";Object.defineProperty(z4,"__esModule",{value:!0});var $pe=H4();function Wpe(t,e){return $pe.concatMap(function(){return t},e)}z4.concatMapTo=Wpe});var CL=_(dd=>{"use strict";var Hpe=dd&&dd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(dd,"__esModule",{value:!0});var zpe=Se();function Vpe(t){return function(e){return e.lift(new Gpe(t,e))}}dd.count=Vpe;var Gpe=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new Kpe(e,this.predicate,this.source))},t}(),Kpe=function(t){Hpe(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.predicate=n,o.source=i,o.count=0,o.index=0,o}return e.prototype._next=function(r){this.predicate?this._tryPredicate(r):this.count++},e.prototype._tryPredicate=function(r){var n;try{n=this.predicate(r,this.index++,this.source)}catch(i){this.destination.error(i);return}n&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(zpe.Subscriber)});var AL=_(pd=>{"use strict";var Ype=pd&&pd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(pd,"__esModule",{value:!0});var V4=Yt();function Zpe(t){return function(e){return e.lift(new Jpe(t))}}pd.debounce=Zpe;var Jpe=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new Qpe(e,this.durationSelector))},t}(),Qpe=function(t){Ype(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){try{var n=this.durationSelector.call(this,r);n&&this._tryNext(r,n)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(r,n){var i=this.durationSubscription;this.value=r,this.hasValue=!0,i&&(i.unsubscribe(),this.remove(i)),i=V4.innerSubscribe(n,new V4.SimpleInnerSubscriber(this)),i&&!i.closed&&this.add(this.durationSubscription=i)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var r=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,r)}},e}(V4.SimpleOuterSubscriber)});var IL=_(gd=>{"use strict";var Xpe=gd&&gd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(gd,"__esModule",{value:!0});var e0e=Se(),t0e=Zr();function r0e(t,e){return e===void 0&&(e=t0e.async),function(r){return r.lift(new n0e(t,e))}}gd.debounceTime=r0e;var n0e=function(){function t(e,r){this.dueTime=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new i0e(e,this.dueTime,this.scheduler))},t}(),i0e=function(t){Xpe(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.dueTime=n,o.scheduler=i,o.debouncedSubscription=null,o.lastValue=null,o.hasValue=!1,o}return e.prototype._next=function(r){this.clearDebounce(),this.lastValue=r,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(o0e,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var r=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(r)}},e.prototype.clearDebounce=function(){var r=this.debouncedSubscription;r!==null&&(this.remove(r),r.unsubscribe(),this.debouncedSubscription=null)},e}(e0e.Subscriber);function o0e(t){t.debouncedNext()}});var Uu=_(md=>{"use strict";var s0e=md&&md.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(md,"__esModule",{value:!0});var a0e=Se();function c0e(t){return t===void 0&&(t=null),function(e){return e.lift(new u0e(t))}}md.defaultIfEmpty=c0e;var u0e=function(){function t(e){this.defaultValue=e}return t.prototype.call=function(e,r){return r.subscribe(new l0e(e,this.defaultValue))},t}(),l0e=function(t){s0e(e,t);function e(r,n){var i=t.call(this,r)||this;return i.defaultValue=n,i.isEmpty=!0,i}return e.prototype._next=function(r){this.isEmpty=!1,this.destination.next(r)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(a0e.Subscriber)});var K4=_(G4=>{"use strict";Object.defineProperty(G4,"__esModule",{value:!0});function f0e(t){return t instanceof Date&&!isNaN(+t)}G4.isDate=f0e});var RL=_(yd=>{"use strict";var h0e=yd&&yd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(yd,"__esModule",{value:!0});var d0e=Zr(),p0e=K4(),g0e=Se(),ML=Uh();function m0e(t,e){e===void 0&&(e=d0e.async);var r=p0e.isDate(t),n=r?+t-e.now():Math.abs(t);return function(i){return i.lift(new y0e(n,e))}}yd.delay=m0e;var y0e=function(){function t(e,r){this.delay=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new v0e(e,this.delay,this.scheduler))},t}(),v0e=function(t){h0e(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.delay=n,o.scheduler=i,o.queue=[],o.active=!1,o.errored=!1,o}return e.dispatch=function(r){for(var n=r.source,i=n.queue,o=r.scheduler,s=r.destination;i.length>0&&i[0].time-o.now()<=0;)i.shift().notification.observe(s);if(i.length>0){var a=Math.max(0,i[0].time-o.now());this.schedule(r,a)}else this.unsubscribe(),n.active=!1},e.prototype._schedule=function(r){this.active=!0;var n=this.destination;n.add(r.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:r}))},e.prototype.scheduleNotification=function(r){if(this.errored!==!0){var n=this.scheduler,i=new b0e(n.now()+this.delay,r);this.queue.push(i),this.active===!1&&this._schedule(n)}},e.prototype._next=function(r){this.scheduleNotification(ML.Notification.createNext(r))},e.prototype._error=function(r){this.errored=!0,this.queue=[],this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(ML.Notification.createComplete()),this.unsubscribe()},e}(g0e.Subscriber),b0e=function(){function t(e,r){this.time=e,this.notification=r}return t}()});var PL=_(vd=>{"use strict";var Y4=vd&&vd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(vd,"__esModule",{value:!0});var _0e=Se(),w0e=Ge(),E0e=us(),S0e=ls();function x0e(t,e){return e?function(r){return new C0e(r,e).lift(new TL(t))}:function(r){return r.lift(new TL(t))}}vd.delayWhen=x0e;var TL=function(){function t(e){this.delayDurationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new O0e(e,this.delayDurationSelector))},t}(),O0e=function(t){Y4(e,t);function e(r,n){var i=t.call(this,r)||this;return i.delayDurationSelector=n,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return e.prototype.notifyNext=function(r,n,i,o,s){this.destination.next(r),this.removeSubscription(s),this.tryComplete()},e.prototype.notifyError=function(r,n){this._error(r)},e.prototype.notifyComplete=function(r){var n=this.removeSubscription(r);n&&this.destination.next(n),this.tryComplete()},e.prototype._next=function(r){var n=this.index++;try{var i=this.delayDurationSelector(r,n);i&&this.tryDelay(i,r)}catch(o){this.destination.error(o)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(r){r.unsubscribe();var n=this.delayNotifierSubscriptions.indexOf(r);return n!==-1&&this.delayNotifierSubscriptions.splice(n,1),r.outerValue},e.prototype.tryDelay=function(r,n){var i=S0e.subscribeToResult(this,r,n);if(i&&!i.closed){var o=this.destination;o.add(i),this.delayNotifierSubscriptions.push(i)}},e.prototype.tryComplete=function(){this.completed&&this.delayNotifierSubscriptions.length===0&&this.destination.complete()},e}(E0e.OuterSubscriber),C0e=function(t){Y4(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subscriptionDelay=n,i}return e.prototype._subscribe=function(r){this.subscriptionDelay.subscribe(new A0e(r,this.source))},e}(w0e.Observable),A0e=function(t){Y4(e,t);function e(r,n){var i=t.call(this)||this;return i.parent=r,i.source=n,i.sourceSubscribed=!1,i}return e.prototype._next=function(r){this.subscribeToSource()},e.prototype._error=function(r){this.unsubscribe(),this.parent.error(r)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(_0e.Subscriber)});var DL=_(bd=>{"use strict";var I0e=bd&&bd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(bd,"__esModule",{value:!0});var M0e=Se();function R0e(){return function(e){return e.lift(new T0e)}}bd.dematerialize=R0e;var T0e=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new P0e(e))},t}(),P0e=function(t){I0e(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){r.observe(this.destination)},e}(M0e.Subscriber)});var kL=_($u=>{"use strict";var D0e=$u&&$u.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty($u,"__esModule",{value:!0});var Z4=Yt();function N0e(t,e){return function(r){return r.lift(new k0e(t,e))}}$u.distinct=N0e;var k0e=function(){function t(e,r){this.keySelector=e,this.flushes=r}return t.prototype.call=function(e,r){return r.subscribe(new NL(e,this.keySelector,this.flushes))},t}(),NL=function(t){D0e(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.keySelector=n,o.values=new Set,i&&o.add(Z4.innerSubscribe(i,new Z4.SimpleInnerSubscriber(o))),o}return e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(r){this._error(r)},e.prototype._next=function(r){this.keySelector?this._useKeySelector(r):this._finalizeNext(r,r)},e.prototype._useKeySelector=function(r){var n,i=this.destination;try{n=this.keySelector(r)}catch(o){i.error(o);return}this._finalizeNext(n,r)},e.prototype._finalizeNext=function(r,n){var i=this.values;i.has(r)||(i.add(r),this.destination.next(n))},e}(Z4.SimpleOuterSubscriber);$u.DistinctSubscriber=NL});var J4=_(_d=>{"use strict";var L0e=_d&&_d.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(_d,"__esModule",{value:!0});var j0e=Se();function B0e(t,e){return function(r){return r.lift(new q0e(t,e))}}_d.distinctUntilChanged=B0e;var q0e=function(){function t(e,r){this.compare=e,this.keySelector=r}return t.prototype.call=function(e,r){return r.subscribe(new F0e(e,this.compare,this.keySelector))},t}(),F0e=function(t){L0e(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.keySelector=i,o.hasKey=!1,typeof n=="function"&&(o.compare=n),o}return e.prototype.compare=function(r,n){return r===n},e.prototype._next=function(r){var n;try{var i=this.keySelector;n=i?i(r):r}catch(a){return this.destination.error(a)}var o=!1;if(this.hasKey)try{var s=this.compare;o=s(this.key,n)}catch(a){return this.destination.error(a)}else this.hasKey=!0;o||(this.key=n,this.destination.next(r))},e}(j0e.Subscriber)});var LL=_(Q4=>{"use strict";Object.defineProperty(Q4,"__esModule",{value:!0});var U0e=J4();function $0e(t,e){return U0e.distinctUntilChanged(function(r,n){return e?e(r[t],n[t]):r[t]===n[t]})}Q4.distinctUntilKeyChanged=$0e});var Ed=_(wd=>{"use strict";var W0e=wd&&wd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(wd,"__esModule",{value:!0});var H0e=ju(),z0e=Se();function V0e(t){return t===void 0&&(t=Y0e),function(e){return e.lift(new G0e(t))}}wd.throwIfEmpty=V0e;var G0e=function(){function t(e){this.errorFactory=e}return t.prototype.call=function(e,r){return r.subscribe(new K0e(e,this.errorFactory))},t}(),K0e=function(t){W0e(e,t);function e(r,n){var i=t.call(this,r)||this;return i.errorFactory=n,i.hasValue=!1,i}return e.prototype._next=function(r){this.hasValue=!0,this.destination.next(r)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var r=void 0;try{r=this.errorFactory()}catch(n){r=n}this.destination.error(r)},e}(z0e.Subscriber);function Y0e(){return new H0e.EmptyError}});var Dm=_(Sd=>{"use strict";var Z0e=Sd&&Sd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Sd,"__esModule",{value:!0});var J0e=Se(),Q0e=Lu(),X0e=Qn();function e1e(t){return function(e){return t===0?X0e.empty():e.lift(new t1e(t))}}Sd.take=e1e;var t1e=function(){function t(e){if(this.total=e,this.total<0)throw new Q0e.ArgumentOutOfRangeError}return t.prototype.call=function(e,r){return r.subscribe(new r1e(e,this.total))},t}(),r1e=function(t){Z0e(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){var n=this.total,i=++this.count;i<=n&&(this.destination.next(r),i===n&&(this.destination.complete(),this.unsubscribe()))},e}(J0e.Subscriber)});var BL=_(X4=>{"use strict";Object.defineProperty(X4,"__esModule",{value:!0});var jL=Lu(),n1e=Ia(),i1e=Ed(),o1e=Uu(),s1e=Dm();function a1e(t,e){if(t<0)throw new jL.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(n){return n.pipe(n1e.filter(function(i,o){return o===t}),s1e.take(1),r?o1e.defaultIfEmpty(e):i1e.throwIfEmpty(function(){return new jL.ArgumentOutOfRangeError}))}}X4.elementAt=a1e});var qL=_(eE=>{"use strict";Object.defineProperty(eE,"__esModule",{value:!0});var c1e=rd(),u1e=qh();function l1e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return c1e.concat(r,u1e.of.apply(void 0,t))}}eE.endWith=l1e});var FL=_(xd=>{"use strict";var f1e=xd&&xd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(xd,"__esModule",{value:!0});var h1e=Se();function d1e(t,e){return function(r){return r.lift(new p1e(t,e,r))}}xd.every=d1e;var p1e=function(){function t(e,r,n){this.predicate=e,this.thisArg=r,this.source=n}return t.prototype.call=function(e,r){return r.subscribe(new g1e(e,this.predicate,this.thisArg,this.source))},t}(),g1e=function(t){f1e(e,t);function e(r,n,i,o){var s=t.call(this,r)||this;return s.predicate=n,s.thisArg=i,s.source=o,s.index=0,s.thisArg=i||s,s}return e.prototype.notifyComplete=function(r){this.destination.next(r),this.destination.complete()},e.prototype._next=function(r){var n=!1;try{n=this.predicate.call(this.thisArg,r,this.index++,this.source)}catch(i){this.destination.error(i);return}n||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(h1e.Subscriber)});var UL=_(Od=>{"use strict";var m1e=Od&&Od.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Od,"__esModule",{value:!0});var tE=Yt();function y1e(){return function(t){return t.lift(new v1e)}}Od.exhaust=y1e;var v1e=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new b1e(e))},t}(),b1e=function(t){m1e(e,t);function e(r){var n=t.call(this,r)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return e.prototype._next=function(r){this.hasSubscription||(this.hasSubscription=!0,this.add(tE.innerSubscribe(r,new tE.SimpleInnerSubscriber(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(tE.SimpleOuterSubscriber)});var WL=_(Cd=>{"use strict";var _1e=Cd&&Cd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Cd,"__esModule",{value:!0});var w1e=Sn(),E1e=ei(),rE=Yt();function $L(t,e){return e?function(r){return r.pipe($L(function(n,i){return E1e.from(t(n,i)).pipe(w1e.map(function(o,s){return e(n,o,i,s)}))}))}:function(r){return r.lift(new S1e(t))}}Cd.exhaustMap=$L;var S1e=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new x1e(e,this.project))},t}(),x1e=function(t){_1e(e,t);function e(r,n){var i=t.call(this,r)||this;return i.project=n,i.hasSubscription=!1,i.hasCompleted=!1,i.index=0,i}return e.prototype._next=function(r){this.hasSubscription||this.tryNext(r)},e.prototype.tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(o){this.destination.error(o);return}this.hasSubscription=!0,this._innerSub(n)},e.prototype._innerSub=function(r){var n=new rE.SimpleInnerSubscriber(this),i=this.destination;i.add(n);var o=rE.innerSubscribe(r,n);o!==n&&i.add(o)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyError=function(r){this.destination.error(r)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(rE.SimpleOuterSubscriber)});var VL=_(Pa=>{"use strict";var O1e=Pa&&Pa.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Pa,"__esModule",{value:!0});var nE=Yt();function C1e(t,e,r){return e===void 0&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(n){return n.lift(new HL(t,e,r))}}Pa.expand=C1e;var HL=function(){function t(e,r,n){this.project=e,this.concurrent=r,this.scheduler=n}return t.prototype.call=function(e,r){return r.subscribe(new zL(e,this.project,this.concurrent,this.scheduler))},t}();Pa.ExpandOperator=HL;var zL=function(t){O1e(e,t);function e(r,n,i,o){var s=t.call(this,r)||this;return s.project=n,s.concurrent=i,s.scheduler=o,s.index=0,s.active=0,s.hasCompleted=!1,i<Number.POSITIVE_INFINITY&&(s.buffer=[]),s}return e.dispatch=function(r){var n=r.subscriber,i=r.result,o=r.value,s=r.index;n.subscribeToProjection(i,o,s)},e.prototype._next=function(r){var n=this.destination;if(n.closed){this._complete();return}var i=this.index++;if(this.active<this.concurrent){n.next(r);try{var o=this.project,s=o(r,i);if(!this.scheduler)this.subscribeToProjection(s,r,i);else{var a={subscriber:this,result:s,value:r,index:i},c=this.destination;c.add(this.scheduler.schedule(e.dispatch,0,a))}}catch(u){n.error(u)}}else this.buffer.push(r)},e.prototype.subscribeToProjection=function(r,n,i){this.active++;var o=this.destination;o.add(nE.innerSubscribe(r,new nE.SimpleInnerSubscriber(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&this.active===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this._next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r&&r.length>0&&this._next(r.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},e}(nE.SimpleOuterSubscriber);Pa.ExpandSubscriber=zL});var GL=_(Ad=>{"use strict";var A1e=Ad&&Ad.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ad,"__esModule",{value:!0});var I1e=Se(),M1e=yr();function R1e(t){return function(e){return e.lift(new T1e(t))}}Ad.finalize=R1e;var T1e=function(){function t(e){this.callback=e}return t.prototype.call=function(e,r){return r.subscribe(new P1e(e,this.callback))},t}(),P1e=function(t){A1e(e,t);function e(r,n){var i=t.call(this,r)||this;return i.add(new M1e.Subscription(n)),i}return e}(I1e.Subscriber)});var iE=_(Da=>{"use strict";var D1e=Da&&Da.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Da,"__esModule",{value:!0});var N1e=Se();function k1e(t,e){if(typeof t!="function")throw new TypeError("predicate is not a function");return function(r){return r.lift(new KL(t,r,!1,e))}}Da.find=k1e;var KL=function(){function t(e,r,n,i){this.predicate=e,this.source=r,this.yieldIndex=n,this.thisArg=i}return t.prototype.call=function(e,r){return r.subscribe(new YL(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}();Da.FindValueOperator=KL;var YL=function(t){D1e(e,t);function e(r,n,i,o,s){var a=t.call(this,r)||this;return a.predicate=n,a.source=i,a.yieldIndex=o,a.thisArg=s,a.index=0,a}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete(),this.unsubscribe()},e.prototype._next=function(r){var n=this,i=n.predicate,o=n.thisArg,s=this.index++;try{var a=i.call(o||this,r,s,this.source);a&&this.notifyComplete(this.yieldIndex?s:r)}catch(c){this.destination.error(c)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(N1e.Subscriber);Da.FindValueSubscriber=YL});var ZL=_(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});var L1e=iE();function j1e(t,e){return function(r){return r.lift(new L1e.FindValueOperator(t,r,!0,e))}}oE.findIndex=j1e});var JL=_(sE=>{"use strict";Object.defineProperty(sE,"__esModule",{value:!0});var B1e=ju(),q1e=Ia(),F1e=Dm(),U1e=Uu(),$1e=Ed(),W1e=as();function H1e(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?q1e.filter(function(i,o){return t(i,o,n)}):W1e.identity,F1e.take(1),r?U1e.defaultIfEmpty(e):$1e.throwIfEmpty(function(){return new B1e.EmptyError}))}}sE.first=H1e});var QL=_(Id=>{"use strict";var z1e=Id&&Id.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Id,"__esModule",{value:!0});var V1e=Se();function G1e(){return function(e){return e.lift(new K1e)}}Id.ignoreElements=G1e;var K1e=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new Y1e(e))},t}(),Y1e=function(t){z1e(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._next=function(r){},e}(V1e.Subscriber)});var XL=_(Md=>{"use strict";var Z1e=Md&&Md.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Md,"__esModule",{value:!0});var J1e=Se();function Q1e(){return function(t){return t.lift(new X1e)}}Md.isEmpty=Q1e;var X1e=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new ege(e))},t}(),ege=function(t){Z1e(e,t);function e(r){return t.call(this,r)||this}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype._next=function(r){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(J1e.Subscriber)});var Nm=_(Rd=>{"use strict";var tge=Rd&&Rd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Rd,"__esModule",{value:!0});var rge=Se(),nge=Lu(),ige=Qn();function oge(t){return function(r){return t===0?ige.empty():r.lift(new sge(t))}}Rd.takeLast=oge;var sge=function(){function t(e){if(this.total=e,this.total<0)throw new nge.ArgumentOutOfRangeError}return t.prototype.call=function(e,r){return r.subscribe(new age(e,this.total))},t}(),age=function(t){tge(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.ring=new Array,i.count=0,i}return e.prototype._next=function(r){var n=this.ring,i=this.total,o=this.count++;if(n.length<i)n.push(r);else{var s=o%i;n[s]=r}},e.prototype._complete=function(){var r=this.destination,n=this.count;if(n>0)for(var i=this.count>=this.total?this.total:this.count,o=this.ring,s=0;s<i;s++){var a=n++%i;r.next(o[a])}r.complete()},e}(rge.Subscriber)});var ej=_(aE=>{"use strict";Object.defineProperty(aE,"__esModule",{value:!0});var cge=ju(),uge=Ia(),lge=Nm(),fge=Ed(),hge=Uu(),dge=as();function pge(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?uge.filter(function(i,o){return t(i,o,n)}):dge.identity,lge.takeLast(1),r?hge.defaultIfEmpty(e):fge.throwIfEmpty(function(){return new cge.EmptyError}))}}aE.last=pge});var tj=_(Td=>{"use strict";var gge=Td&&Td.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Td,"__esModule",{value:!0});var mge=Se();function yge(t){return function(e){return e.lift(new vge(t))}}Td.mapTo=yge;var vge=function(){function t(e){this.value=e}return t.prototype.call=function(e,r){return r.subscribe(new bge(e,this.value))},t}(),bge=function(t){gge(e,t);function e(r,n){var i=t.call(this,r)||this;return i.value=n,i}return e.prototype._next=function(r){this.destination.next(this.value)},e}(mge.Subscriber)});var rj=_(Pd=>{"use strict";var _ge=Pd&&Pd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Pd,"__esModule",{value:!0});var wge=Se(),cE=Uh();function Ege(){return function(e){return e.lift(new Sge)}}Pd.materialize=Ege;var Sge=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new xge(e))},t}(),xge=function(t){_ge(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){this.destination.next(cE.Notification.createNext(r))},e.prototype._error=function(r){var n=this.destination;n.next(cE.Notification.createError(r)),n.complete()},e.prototype._complete=function(){var r=this.destination;r.next(cE.Notification.createComplete()),r.complete()},e}(wge.Subscriber)});var km=_(Dd=>{"use strict";var Oge=Dd&&Dd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Dd,"__esModule",{value:!0});var Cge=Se();function Age(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(i){return i.lift(new Ige(t,e,r))}}Dd.scan=Age;var Ige=function(){function t(e,r,n){n===void 0&&(n=!1),this.accumulator=e,this.seed=r,this.hasSeed=n}return t.prototype.call=function(e,r){return r.subscribe(new Mge(e,this.accumulator,this.seed,this.hasSeed))},t}(),Mge=function(t){Oge(e,t);function e(r,n,i,o){var s=t.call(this,r)||this;return s.accumulator=n,s._seed=i,s.hasSeed=o,s.index=0,s}return Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(r){this.hasSeed=!0,this._seed=r},enumerable:!0,configurable:!0}),e.prototype._next=function(r){if(!this.hasSeed)this.seed=r,this.destination.next(r);else return this._tryNext(r)},e.prototype._tryNext=function(r){var n=this.index++,i;try{i=this.accumulator(this.seed,r,n)}catch(o){this.destination.error(o)}this.seed=i,this.destination.next(i)},e}(Cge.Subscriber)});var Nd=_(uE=>{"use strict";Object.defineProperty(uE,"__esModule",{value:!0});var nj=km(),ij=Nm(),Rge=Uu(),oj=dm();function Tge(t,e){return arguments.length>=2?function(n){return oj.pipe(nj.scan(t,e),ij.takeLast(1),Rge.defaultIfEmpty(e))(n)}:function(n){return oj.pipe(nj.scan(function(i,o,s){return t(i,o,s+1)}),ij.takeLast(1))(n)}}uE.reduce=Tge});var sj=_(lE=>{"use strict";Object.defineProperty(lE,"__esModule",{value:!0});var Pge=Nd();function Dge(t){var e=typeof t=="function"?function(r,n){return t(r,n)>0?r:n}:function(r,n){return r>n?r:n};return Pge.reduce(e)}lE.max=Dge});var aj=_(fE=>{"use strict";Object.defineProperty(fE,"__esModule",{value:!0});var Nge=E4();function kge(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(Nge.merge.apply(void 0,[r].concat(t)))}}fE.merge=kge});var uj=_(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0});var cj=td();function Lge(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof e=="function"?cj.mergeMap(function(){return t},e,r):(typeof e=="number"&&(r=e),cj.mergeMap(function(){return t},r))}hE.mergeMapTo=Lge});var hj=_(Na=>{"use strict";var jge=Na&&Na.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Na,"__esModule",{value:!0});var dE=Yt();function Bge(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),function(n){return n.lift(new lj(t,e,r))}}Na.mergeScan=Bge;var lj=function(){function t(e,r,n){this.accumulator=e,this.seed=r,this.concurrent=n}return t.prototype.call=function(e,r){return r.subscribe(new fj(e,this.accumulator,this.seed,this.concurrent))},t}();Na.MergeScanOperator=lj;var fj=function(t){jge(e,t);function e(r,n,i,o){var s=t.call(this,r)||this;return s.accumulator=n,s.acc=i,s.concurrent=o,s.hasValue=!1,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return e.prototype._next=function(r){if(this.active<this.concurrent){var n=this.index++,i=this.destination,o=void 0;try{var s=this.accumulator;o=s(this.acc,r,n)}catch(a){return i.error(a)}this.active++,this._innerSub(o)}else this.buffer.push(r)},e.prototype._innerSub=function(r){var n=new dE.SimpleInnerSubscriber(this),i=this.destination;i.add(n);var o=dE.innerSubscribe(r,n);o!==n&&i.add(o)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(r){var n=this.destination;this.acc=r,this.hasValue=!0,n.next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},e}(dE.SimpleOuterSubscriber);Na.MergeScanSubscriber=fj});var dj=_(pE=>{"use strict";Object.defineProperty(pE,"__esModule",{value:!0});var qge=Nd();function Fge(t){var e=typeof t=="function"?function(r,n){return t(r,n)<0?r:n}:function(r,n){return r<n?r:n};return qge.reduce(e)}pE.min=Fge});var ka=_(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});var Uge=b5();function $ge(t,e){return function(n){var i;if(typeof t=="function"?i=t:i=function(){return t},typeof e=="function")return n.lift(new pj(i,e));var o=Object.create(n,Uge.connectableObservableDescriptor);return o.source=n,o.subjectFactory=i,o}}Lm.multicast=$ge;var pj=function(){function t(e,r){this.subjectFactory=e,this.selector=r}return t.prototype.call=function(e,r){var n=this.selector,i=this.subjectFactory(),o=n(i).subscribe(e);return o.add(r.subscribe(i)),o},t}();Lm.MulticastOperator=pj});var yj=_(Wu=>{"use strict";var Wge=Wu&&Wu.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Wu,"__esModule",{value:!0});var Hge=ei(),gj=Yr(),gE=Yt();function zge(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1&&gj.isArray(t[0])&&(t=t[0]),function(r){return r.lift(new mj(t))}}Wu.onErrorResumeNext=zge;function Vge(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=void 0;return t.length===1&&gj.isArray(t[0])&&(t=t[0]),r=t.shift(),Hge.from(r).lift(new mj(t))}Wu.onErrorResumeNextStatic=Vge;var mj=function(){function t(e){this.nextSources=e}return t.prototype.call=function(e,r){return r.subscribe(new Gge(e,this.nextSources))},t}(),Gge=function(t){Wge(e,t);function e(r,n){var i=t.call(this,r)||this;return i.destination=r,i.nextSources=n,i}return e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(r){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var r=this.nextSources.shift();if(r){var n=new gE.SimpleInnerSubscriber(this),i=this.destination;i.add(n);var o=gE.innerSubscribe(r,n);o!==n&&i.add(o)}else this.destination.complete()},e}(gE.SimpleOuterSubscriber)});var vj=_(kd=>{"use strict";var Kge=kd&&kd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(kd,"__esModule",{value:!0});var Yge=Se();function Zge(){return function(t){return t.lift(new Jge)}}kd.pairwise=Zge;var Jge=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new Qge(e))},t}(),Qge=function(t){Kge(e,t);function e(r){var n=t.call(this,r)||this;return n.hasPrev=!1,n}return e.prototype._next=function(r){var n;this.hasPrev?n=[this.prev,r]:this.hasPrev=!0,this.prev=r,n&&this.destination.next(n)},e}(Yge.Subscriber)});var _j=_(mE=>{"use strict";Object.defineProperty(mE,"__esModule",{value:!0});var Xge=A4(),bj=Ia();function eme(t,e){return function(r){return[bj.filter(t,e)(r),bj.filter(Xge.not(t,e))(r)]}}mE.partition=eme});var wj=_(yE=>{"use strict";Object.defineProperty(yE,"__esModule",{value:!0});var tme=Sn();function rme(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.length;if(r===0)throw new Error("list of properties cannot be empty.");return function(n){return tme.map(nme(t,r))(n)}}yE.pluck=rme;function nme(t,e){var r=function(n){for(var i=n,o=0;o<e;o++){var s=i?.[t[o]];if(s!==void 0)i=s;else return}return i};return r}});var xj=_(vE=>{"use strict";Object.defineProperty(vE,"__esModule",{value:!0});var Ej=jr(),Sj=ka();function ime(t){return t?Sj.multicast(function(){return new Ej.Subject},t):Sj.multicast(new Ej.Subject)}vE.publish=ime});var Oj=_(bE=>{"use strict";Object.defineProperty(bE,"__esModule",{value:!0});var ome=E5(),sme=ka();function ame(t){return function(e){return sme.multicast(new ome.BehaviorSubject(t))(e)}}bE.publishBehavior=ame});var Cj=_(_E=>{"use strict";Object.defineProperty(_E,"__esModule",{value:!0});var cme=Hh(),ume=ka();function lme(){return function(t){return ume.multicast(new cme.AsyncSubject)(t)}}_E.publishLast=lme});var Aj=_(wE=>{"use strict";Object.defineProperty(wE,"__esModule",{value:!0});var fme=bm(),hme=ka();function dme(t,e,r,n){r&&typeof r!="function"&&(n=r);var i=typeof r=="function"?r:void 0,o=new fme.ReplaySubject(t,e,n);return function(s){return hme.multicast(function(){return o},i)(s)}}wE.publishReplay=dme});var Ij=_(EE=>{"use strict";Object.defineProperty(EE,"__esModule",{value:!0});var pme=Yr(),gme=M4();function mme(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return t.length===1&&pme.isArray(t[0])&&(t=t[0]),n.lift.call(gme.race.apply(void 0,[n].concat(t)))}}EE.race=mme});var Rj=_(Ld=>{"use strict";var yme=Ld&&Ld.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ld,"__esModule",{value:!0});var vme=Se(),bme=Qn();function _me(t){return t===void 0&&(t=-1),function(e){return t===0?bme.empty():t<0?e.lift(new Mj(-1,e)):e.lift(new Mj(t-1,e))}}Ld.repeat=_me;var Mj=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new wme(e,this.count,this.source))},t}(),wme=function(t){yme(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.count=n,o.source=i,o}return e.prototype.complete=function(){if(!this.isStopped){var r=this,n=r.source,i=r.count;if(i===0)return t.prototype.complete.call(this);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(vme.Subscriber)});var Tj=_(jd=>{"use strict";var Eme=jd&&jd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(jd,"__esModule",{value:!0});var Sme=jr(),SE=Yt();function xme(t){return function(e){return e.lift(new Ome(t))}}jd.repeatWhen=xme;var Ome=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new Cme(e,this.notifier,r))},t}(),Cme=function(t){Eme(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.notifier=n,o.source=i,o.sourceIsBeingSubscribedTo=!0,o}return e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(this.sourceIsBeingSubscribedTo===!1)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var r=this,n=r.notifications,i=r.retriesSubscription;n&&(n.unsubscribe(),this.notifications=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var r=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=r,this},e.prototype.subscribeToRetries=function(){this.notifications=new Sme.Subject;var r;try{var n=this.notifier;r=n(this.notifications)}catch{return t.prototype.complete.call(this)}this.retries=r,this.retriesSubscription=SE.innerSubscribe(r,new SE.SimpleInnerSubscriber(this))},e}(SE.SimpleOuterSubscriber)});var Pj=_(Bd=>{"use strict";var Ame=Bd&&Bd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Bd,"__esModule",{value:!0});var Ime=Se();function Mme(t){return t===void 0&&(t=-1),function(e){return e.lift(new Rme(t,e))}}Bd.retry=Mme;var Rme=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new Tme(e,this.count,this.source))},t}(),Tme=function(t){Ame(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.count=n,o.source=i,o}return e.prototype.error=function(r){if(!this.isStopped){var n=this,i=n.source,o=n.count;if(o===0)return t.prototype.error.call(this,r);o>-1&&(this.count=o-1),i.subscribe(this._unsubscribeAndRecycle())}},e}(Ime.Subscriber)});var Dj=_(qd=>{"use strict";var Pme=qd&&qd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(qd,"__esModule",{value:!0});var Dme=jr(),xE=Yt();function Nme(t){return function(e){return e.lift(new kme(t,e))}}qd.retryWhen=Nme;var kme=function(){function t(e,r){this.notifier=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new Lme(e,this.notifier,this.source))},t}(),Lme=function(t){Pme(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.notifier=n,o.source=i,o}return e.prototype.error=function(r){if(!this.isStopped){var n=this.errors,i=this.retries,o=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{n=new Dme.Subject;try{var s=this.notifier;i=s(n)}catch(a){return t.prototype.error.call(this,a)}o=xE.innerSubscribe(i,new xE.SimpleInnerSubscriber(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=o,n.next(r)}},e.prototype._unsubscribe=function(){var r=this,n=r.errors,i=r.retriesSubscription;n&&(n.unsubscribe(),this.errors=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var r=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=r,this.source.subscribe(this)},e}(xE.SimpleOuterSubscriber)});var Nj=_(Fd=>{"use strict";var jme=Fd&&Fd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Fd,"__esModule",{value:!0});var OE=Yt();function Bme(t){return function(e){return e.lift(new qme(t))}}Fd.sample=Bme;var qme=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new Fme(e),i=r.subscribe(n);return i.add(OE.innerSubscribe(this.notifier,new OE.SimpleInnerSubscriber(n))),i},t}(),Fme=function(t){jme(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.hasValue=!1,r}return e.prototype._next=function(r){this.value=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(OE.SimpleOuterSubscriber)});var kj=_(Ud=>{"use strict";var Ume=Ud&&Ud.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ud,"__esModule",{value:!0});var $me=Se(),Wme=Zr();function Hme(t,e){return e===void 0&&(e=Wme.async),function(r){return r.lift(new zme(t,e))}}Ud.sampleTime=Hme;var zme=function(){function t(e,r){this.period=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new Vme(e,this.period,this.scheduler))},t}(),Vme=function(t){Ume(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.period=n,o.scheduler=i,o.hasValue=!1,o.add(i.schedule(Gme,n,{subscriber:o,period:n})),o}return e.prototype._next=function(r){this.lastValue=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}($me.Subscriber);function Gme(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}});var Fj=_(La=>{"use strict";var Lj=La&&La.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(La,"__esModule",{value:!0});var jj=Se();function Kme(t,e){return function(r){return r.lift(new Bj(t,e))}}La.sequenceEqual=Kme;var Bj=function(){function t(e,r){this.compareTo=e,this.comparator=r}return t.prototype.call=function(e,r){return r.subscribe(new qj(e,this.compareTo,this.comparator))},t}();La.SequenceEqualOperator=Bj;var qj=function(t){Lj(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.compareTo=n,o.comparator=i,o._a=[],o._b=[],o._oneComplete=!1,o.destination.add(n.subscribe(new Yme(r,o))),o}return e.prototype._next=function(r){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(r),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var r=this,n=r._a,i=r._b,o=r.comparator;n.length>0&&i.length>0;){var s=n.shift(),a=i.shift(),c=!1;try{c=o?o(s,a):s===a}catch(u){this.destination.error(u)}c||this.emit(!1)}},e.prototype.emit=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype.nextB=function(r){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(r),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},e}(jj.Subscriber);La.SequenceEqualSubscriber=qj;var Yme=function(t){Lj(e,t);function e(r,n){var i=t.call(this,r)||this;return i.parent=n,i}return e.prototype._next=function(r){this.parent.nextB(r)},e.prototype._error=function(r){this.parent.error(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(jj.Subscriber)});var Uj=_(CE=>{"use strict";Object.defineProperty(CE,"__esModule",{value:!0});var Zme=ka(),Jme=gm(),Qme=jr();function Xme(){return new Qme.Subject}function eye(){return function(t){return Jme.refCount()(Zme.multicast(Xme)(t))}}CE.share=eye});var $j=_(AE=>{"use strict";Object.defineProperty(AE,"__esModule",{value:!0});var tye=bm();function rye(t,e,r){var n;return t&&typeof t=="object"?n=t:n={bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(i){return i.lift(nye(n))}}AE.shareReplay=rye;function nye(t){var e=t.bufferSize,r=e===void 0?Number.POSITIVE_INFINITY:e,n=t.windowTime,i=n===void 0?Number.POSITIVE_INFINITY:n,o=t.refCount,s=t.scheduler,a,c=0,u,l=!1,h=!1;return function(m){c++;var v;!a||l?(l=!1,a=new tye.ReplaySubject(r,i,s),v=a.subscribe(this),u=m.subscribe({next:function(x){a.next(x)},error:function(x){l=!0,a.error(x)},complete:function(){h=!0,u=void 0,a.complete()}}),h&&(u=void 0)):v=a.subscribe(this),this.add(function(){c--,v.unsubscribe(),v=void 0,u&&!h&&o&&c===0&&(u.unsubscribe(),u=void 0,a=void 0)})}}});var Wj=_($d=>{"use strict";var iye=$d&&$d.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty($d,"__esModule",{value:!0});var oye=Se(),sye=ju();function aye(t){return function(e){return e.lift(new cye(t,e))}}$d.single=aye;var cye=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new uye(e,this.predicate,this.source))},t}(),uye=function(t){iye(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.predicate=n,o.source=i,o.seenValue=!1,o.index=0,o}return e.prototype.applySingleValue=function(r){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=r)},e.prototype._next=function(r){var n=this.index++;this.predicate?this.tryNext(r,n):this.applySingleValue(r)},e.prototype.tryNext=function(r,n){try{this.predicate(r,n,this.source)&&this.applySingleValue(r)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){var r=this.destination;this.index>0?(r.next(this.seenValue?this.singleValue:void 0),r.complete()):r.error(new sye.EmptyError)},e}(oye.Subscriber)});var Hj=_(Wd=>{"use strict";var lye=Wd&&Wd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Wd,"__esModule",{value:!0});var fye=Se();function hye(t){return function(e){return e.lift(new dye(t))}}Wd.skip=hye;var dye=function(){function t(e){this.total=e}return t.prototype.call=function(e,r){return r.subscribe(new pye(e,this.total))},t}(),pye=function(t){lye(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){++this.count>this.total&&this.destination.next(r)},e}(fye.Subscriber)});var Vj=_(Hd=>{"use strict";var gye=Hd&&Hd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Hd,"__esModule",{value:!0});var zj=Se(),mye=Lu();function yye(t){return function(e){return e.lift(new vye(t))}}Hd.skipLast=yye;var vye=function(){function t(e){if(this._skipCount=e,this._skipCount<0)throw new mye.ArgumentOutOfRangeError}return t.prototype.call=function(e,r){return this._skipCount===0?r.subscribe(new zj.Subscriber(e)):r.subscribe(new bye(e,this._skipCount))},t}(),bye=function(t){gye(e,t);function e(r,n){var i=t.call(this,r)||this;return i._skipCount=n,i._count=0,i._ring=new Array(n),i}return e.prototype._next=function(r){var n=this._skipCount,i=this._count++;if(i<n)this._ring[i]=r;else{var o=i%n,s=this._ring,a=s[o];s[o]=r,this.destination.next(a)}},e}(zj.Subscriber)});var Gj=_(zd=>{"use strict";var _ye=zd&&zd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(zd,"__esModule",{value:!0});var IE=Yt();function wye(t){return function(e){return e.lift(new Eye(t))}}zd.skipUntil=wye;var Eye=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new Sye(e,this.notifier))},t}(),Sye=function(t){_ye(e,t);function e(r,n){var i=t.call(this,r)||this;i.hasValue=!1;var o=new IE.SimpleInnerSubscriber(i);i.add(o),i.innerSubscription=o;var s=IE.innerSubscribe(n,o);return s!==o&&(i.add(s),i.innerSubscription=s),i}return e.prototype._next=function(r){this.hasValue&&t.prototype._next.call(this,r)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(IE.SimpleOuterSubscriber)});var Kj=_(Vd=>{"use strict";var xye=Vd&&Vd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Vd,"__esModule",{value:!0});var Oye=Se();function Cye(t){return function(e){return e.lift(new Aye(t))}}Vd.skipWhile=Cye;var Aye=function(){function t(e){this.predicate=e}return t.prototype.call=function(e,r){return r.subscribe(new Iye(e,this.predicate))},t}(),Iye=function(t){xye(e,t);function e(r,n){var i=t.call(this,r)||this;return i.predicate=n,i.skipping=!0,i.index=0,i}return e.prototype._next=function(r){var n=this.destination;this.skipping&&this.tryCallPredicate(r),this.skipping||n.next(r)},e.prototype.tryCallPredicate=function(r){try{var n=this.predicate(r,this.index++);this.skipping=Boolean(n)}catch(i){this.destination.error(i)}},e}(Oye.Subscriber)});var Zj=_(ME=>{"use strict";Object.defineProperty(ME,"__esModule",{value:!0});var Yj=rd(),Mye=Xn();function Rye(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Mye.isScheduler(r)?(t.pop(),function(n){return Yj.concat(t,n,r)}):function(n){return Yj.concat(t,n)}}ME.startWith=Rye});var Jj=_(Gd=>{"use strict";var Tye=Gd&&Gd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Gd,"__esModule",{value:!0});var Pye=Ge(),RE=k5(),Dye=nd(),Nye=function(t){Tye(e,t);function e(r,n,i){n===void 0&&(n=0),i===void 0&&(i=RE.asap);var o=t.call(this)||this;return o.source=r,o.delayTime=n,o.scheduler=i,(!Dye.isNumeric(n)||n<0)&&(o.delayTime=0),(!i||typeof i.schedule!="function")&&(o.scheduler=RE.asap),o}return e.create=function(r,n,i){return n===void 0&&(n=0),i===void 0&&(i=RE.asap),new e(r,n,i)},e.dispatch=function(r){var n=r.source,i=r.subscriber;return this.add(n.subscribe(i))},e.prototype._subscribe=function(r){var n=this.delayTime,i=this.source,o=this.scheduler;return o.schedule(e.dispatch,n,{source:i,subscriber:r})},e}(Pye.Observable);Gd.SubscribeOnObservable=Nye});var Qj=_(TE=>{"use strict";Object.defineProperty(TE,"__esModule",{value:!0});var kye=Jj();function Lye(t,e){return e===void 0&&(e=0),function(n){return n.lift(new jye(t,e))}}TE.subscribeOn=Lye;var jye=function(){function t(e,r){this.scheduler=e,this.delay=r}return t.prototype.call=function(e,r){return new kye.SubscribeOnObservable(r,this.delay,this.scheduler).subscribe(e)},t}()});var jm=_(Kd=>{"use strict";var Bye=Kd&&Kd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Kd,"__esModule",{value:!0});var qye=Sn(),Fye=ei(),PE=Yt();function Xj(t,e){return typeof e=="function"?function(r){return r.pipe(Xj(function(n,i){return Fye.from(t(n,i)).pipe(qye.map(function(o,s){return e(n,o,i,s)}))}))}:function(r){return r.lift(new Uye(t))}}Kd.switchMap=Xj;var Uye=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new $ye(e,this.project))},t}(),$ye=function(t){Bye(e,t);function e(r,n){var i=t.call(this,r)||this;return i.project=n,i.index=0,i}return e.prototype._next=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(o){this.destination.error(o);return}this._innerSub(n)},e.prototype._innerSub=function(r){var n=this.innerSubscription;n&&n.unsubscribe();var i=new PE.SimpleInnerSubscriber(this),o=this.destination;o.add(i),this.innerSubscription=PE.innerSubscribe(r,i),this.innerSubscription!==i&&o.add(this.innerSubscription)},e.prototype._complete=function(){var r=this.innerSubscription;(!r||r.closed)&&t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(r){this.destination.next(r)},e}(PE.SimpleOuterSubscriber)});var eB=_(DE=>{"use strict";Object.defineProperty(DE,"__esModule",{value:!0});var Wye=jm(),Hye=as();function zye(){return Wye.switchMap(Hye.identity)}DE.switchAll=zye});var rB=_(NE=>{"use strict";Object.defineProperty(NE,"__esModule",{value:!0});var tB=jm();function Vye(t,e){return e?tB.switchMap(function(){return t},e):tB.switchMap(function(){return t})}NE.switchMapTo=Vye});var nB=_(Yd=>{"use strict";var Gye=Yd&&Yd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Yd,"__esModule",{value:!0});var kE=Yt();function Kye(t){return function(e){return e.lift(new Yye(t))}}Yd.takeUntil=Kye;var Yye=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new Zye(e),i=kE.innerSubscribe(this.notifier,new kE.SimpleInnerSubscriber(n));return i&&!n.seenValue?(n.add(i),r.subscribe(n)):n},t}(),Zye=function(t){Gye(e,t);function e(r){var n=t.call(this,r)||this;return n.seenValue=!1,n}return e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(kE.SimpleOuterSubscriber)});var iB=_(Zd=>{"use strict";var Jye=Zd&&Zd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Zd,"__esModule",{value:!0});var Qye=Se();function Xye(t,e){return e===void 0&&(e=!1),function(r){return r.lift(new eve(t,e))}}Zd.takeWhile=Xye;var eve=function(){function t(e,r){this.predicate=e,this.inclusive=r}return t.prototype.call=function(e,r){return r.subscribe(new tve(e,this.predicate,this.inclusive))},t}(),tve=function(t){Jye(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.predicate=n,o.inclusive=i,o.index=0,o}return e.prototype._next=function(r){var n=this.destination,i;try{i=this.predicate(r,this.index++)}catch(o){n.error(o);return}this.nextOrComplete(r,i)},e.prototype.nextOrComplete=function(r,n){var i=this.destination;Boolean(n)?i.next(r):(this.inclusive&&i.next(r),i.complete())},e}(Qye.Subscriber)});var oB=_(Jd=>{"use strict";var rve=Jd&&Jd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Jd,"__esModule",{value:!0});var nve=Se(),hs=Em(),ive=Au();function ove(t,e,r){return function(i){return i.lift(new sve(t,e,r))}}Jd.tap=ove;var sve=function(){function t(e,r,n){this.nextOrObserver=e,this.error=r,this.complete=n}return t.prototype.call=function(e,r){return r.subscribe(new ave(e,this.nextOrObserver,this.error,this.complete))},t}(),ave=function(t){rve(e,t);function e(r,n,i,o){var s=t.call(this,r)||this;return s._tapNext=hs.noop,s._tapError=hs.noop,s._tapComplete=hs.noop,s._tapError=i||hs.noop,s._tapComplete=o||hs.noop,ive.isFunction(n)?(s._context=s,s._tapNext=n):n&&(s._context=n,s._tapNext=n.next||hs.noop,s._tapError=n.error||hs.noop,s._tapComplete=n.complete||hs.noop),s}return e.prototype._next=function(r){try{this._tapNext.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.next(r)},e.prototype._error=function(r){try{this._tapError.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.error(r)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(r){this.destination.error(r);return}return this.destination.complete()},e}(nve.Subscriber)});var jE=_(ja=>{"use strict";var cve=ja&&ja.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ja,"__esModule",{value:!0});var LE=Yt();ja.defaultThrottleConfig={leading:!0,trailing:!1};function uve(t,e){return e===void 0&&(e=ja.defaultThrottleConfig),function(r){return r.lift(new lve(t,!!e.leading,!!e.trailing))}}ja.throttle=uve;var lve=function(){function t(e,r,n){this.durationSelector=e,this.leading=r,this.trailing=n}return t.prototype.call=function(e,r){return r.subscribe(new fve(e,this.durationSelector,this.leading,this.trailing))},t}(),fve=function(t){cve(e,t);function e(r,n,i,o){var s=t.call(this,r)||this;return s.destination=r,s.durationSelector=n,s._leading=i,s._trailing=o,s._hasValue=!1,s}return e.prototype._next=function(r){this._hasValue=!0,this._sendValue=r,this._throttled||(this._leading?this.send():this.throttle(r))},e.prototype.send=function(){var r=this,n=r._hasValue,i=r._sendValue;n&&(this.destination.next(i),this.throttle(i)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(r){var n=this.tryDurationSelector(r);n&&this.add(this._throttled=LE.innerSubscribe(n,new LE.SimpleInnerSubscriber(this)))},e.prototype.tryDurationSelector=function(r){try{return this.durationSelector(r)}catch(n){return this.destination.error(n),null}},e.prototype.throttlingDone=function(){var r=this,n=r._throttled,i=r._trailing;n&&n.unsubscribe(),this._throttled=void 0,i&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(LE.SimpleOuterSubscriber)});var sB=_(Qd=>{"use strict";var hve=Qd&&Qd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Qd,"__esModule",{value:!0});var dve=Se(),pve=Zr(),gve=jE();function mve(t,e,r){return e===void 0&&(e=pve.async),r===void 0&&(r=gve.defaultThrottleConfig),function(n){return n.lift(new yve(t,e,r.leading,r.trailing))}}Qd.throttleTime=mve;var yve=function(){function t(e,r,n,i){this.duration=e,this.scheduler=r,this.leading=n,this.trailing=i}return t.prototype.call=function(e,r){return r.subscribe(new vve(e,this.duration,this.scheduler,this.leading,this.trailing))},t}(),vve=function(t){hve(e,t);function e(r,n,i,o,s){var a=t.call(this,r)||this;return a.duration=n,a.scheduler=i,a.leading=o,a.trailing=s,a._hasTrailingValue=!1,a._trailingValue=null,a}return e.prototype._next=function(r){this.throttled?this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(bve,this.duration,{subscriber:this})),this.leading?this.destination.next(r):this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var r=this.throttled;r&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),r.unsubscribe(),this.remove(r),this.throttled=null)},e}(dve.Subscriber);function bve(t){var e=t.subscriber;e.clearThrottle()}});var cB=_(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});var _ve=Zr(),wve=km(),Eve=Am(),Sve=Sn();function xve(t){return t===void 0&&(t=_ve.async),function(e){return Eve.defer(function(){return e.pipe(wve.scan(function(r,n){var i=r.current;return{value:n,current:t.now(),last:i}},{current:t.now(),value:void 0,last:void 0}),Sve.map(function(r){var n=r.current,i=r.last,o=r.value;return new aB(o,n-i)}))})}}Bm.timeInterval=xve;var aB=function(){function t(e,r){this.value=e,this.interval=r}return t}();Bm.TimeInterval=aB});var qE=_(Xd=>{"use strict";var Ove=Xd&&Xd.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Xd,"__esModule",{value:!0});var Cve=Zr(),Ave=K4(),BE=Yt();function Ive(t,e,r){return r===void 0&&(r=Cve.async),function(n){var i=Ave.isDate(t),o=i?+t-r.now():Math.abs(t);return n.lift(new Mve(o,i,e,r))}}Xd.timeoutWith=Ive;var Mve=function(){function t(e,r,n,i){this.waitFor=e,this.absoluteTimeout=r,this.withObservable=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new Rve(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),Rve=function(t){Ove(e,t);function e(r,n,i,o,s){var a=t.call(this,r)||this;return a.absoluteTimeout=n,a.waitFor=i,a.withObservable=o,a.scheduler=s,a.scheduleTimeout(),a}return e.dispatchTimeout=function(r){var n=r.withObservable;r._unsubscribeAndRecycle(),r.add(BE.innerSubscribe(n,new BE.SimpleInnerSubscriber(r)))},e.prototype.scheduleTimeout=function(){var r=this.action;r?this.action=r.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(r){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,r)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(BE.SimpleOuterSubscriber)});var uB=_(FE=>{"use strict";Object.defineProperty(FE,"__esModule",{value:!0});var Tve=Zr(),Pve=U5(),Dve=qE(),Nve=vm();function kve(t,e){return e===void 0&&(e=Tve.async),Dve.timeoutWith(t,Nve.throwError(new Pve.TimeoutError),e)}FE.timeout=kve});var fB=_(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});var Lve=Zr(),jve=Sn();function Bve(t){return t===void 0&&(t=Lve.async),jve.map(function(e){return new lB(e,t.now())})}qm.timestamp=Bve;var lB=function(){function t(e,r){this.value=e,this.timestamp=r}return t}();qm.Timestamp=lB});var hB=_(UE=>{"use strict";Object.defineProperty(UE,"__esModule",{value:!0});var qve=Nd();function Fve(t,e,r){return r===0?[e]:(t.push(e),t)}function Uve(){return qve.reduce(Fve,[])}UE.toArray=Uve});var pB=_(ep=>{"use strict";var $ve=ep&&ep.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ep,"__esModule",{value:!0});var dB=jr(),$E=Yt();function Wve(t){return function(r){return r.lift(new Hve(t))}}ep.window=Wve;var Hve=function(){function t(e){this.windowBoundaries=e}return t.prototype.call=function(e,r){var n=new zve(e),i=r.subscribe(n);return i.closed||n.add($E.innerSubscribe(this.windowBoundaries,new $E.SimpleInnerSubscriber(n))),i},t}(),zve=function(t){$ve(e,t);function e(r){var n=t.call(this,r)||this;return n.window=new dB.Subject,r.next(n.window),n}return e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(r){this._error(r)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(r){this.window.next(r)},e.prototype._error=function(r){this.window.error(r),this.destination.error(r)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var r=this.window;r&&r.complete();var n=this.destination,i=this.window=new dB.Subject;n.next(i)},e}($E.SimpleOuterSubscriber)});var mB=_(tp=>{"use strict";var Vve=tp&&tp.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(tp,"__esModule",{value:!0});var Gve=Se(),gB=jr();function Kve(t,e){return e===void 0&&(e=0),function(n){return n.lift(new Yve(t,e))}}tp.windowCount=Kve;var Yve=function(){function t(e,r){this.windowSize=e,this.startWindowEvery=r}return t.prototype.call=function(e,r){return r.subscribe(new Zve(e,this.windowSize,this.startWindowEvery))},t}(),Zve=function(t){Vve(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.destination=r,o.windowSize=n,o.startWindowEvery=i,o.windows=[new gB.Subject],o.count=0,r.next(o.windows[0]),o}return e.prototype._next=function(r){for(var n=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,i=this.destination,o=this.windowSize,s=this.windows,a=s.length,c=0;c<a&&!this.closed;c++)s[c].next(r);var u=this.count-o+1;if(u>=0&&u%n===0&&!this.closed&&s.shift().complete(),++this.count%n===0&&!this.closed){var l=new gB.Subject;s.push(l),i.next(l)}},e.prototype._error=function(r){var n=this.windows;if(n)for(;n.length>0&&!this.closed;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){var r=this.windows;if(r)for(;r.length>0&&!this.closed;)r.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(Gve.Subscriber)});var _B=_(rp=>{"use strict";var vB=rp&&rp.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(rp,"__esModule",{value:!0});var Jve=jr(),Qve=Zr(),Xve=Se(),yB=nd(),WE=Xn();function ebe(t){var e=Qve.async,r=null,n=Number.POSITIVE_INFINITY;return WE.isScheduler(arguments[3])&&(e=arguments[3]),WE.isScheduler(arguments[2])?e=arguments[2]:yB.isNumeric(arguments[2])&&(n=Number(arguments[2])),WE.isScheduler(arguments[1])?e=arguments[1]:yB.isNumeric(arguments[1])&&(r=Number(arguments[1])),function(o){return o.lift(new tbe(t,r,n,e))}}rp.windowTime=ebe;var tbe=function(){function t(e,r,n,i){this.windowTimeSpan=e,this.windowCreationInterval=r,this.maxWindowSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new nbe(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),rbe=function(t){vB(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._numberOfNextedValues=0,r}return e.prototype.next=function(r){this._numberOfNextedValues++,t.prototype.next.call(this,r)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(Jve.Subject),nbe=function(t){vB(e,t);function e(r,n,i,o,s){var a=t.call(this,r)||this;a.destination=r,a.windowTimeSpan=n,a.windowCreationInterval=i,a.maxWindowSize=o,a.scheduler=s,a.windows=[];var c=a.openWindow();if(i!==null&&i>=0){var u={subscriber:a,window:c,context:null},l={windowTimeSpan:n,windowCreationInterval:i,subscriber:a,scheduler:s};a.add(s.schedule(bB,n,u)),a.add(s.schedule(obe,i,l))}else{var h={subscriber:a,window:c,windowTimeSpan:n};a.add(s.schedule(ibe,n,h))}return a}return e.prototype._next=function(r){for(var n=this.windows,i=n.length,o=0;o<i;o++){var s=n[o];s.closed||(s.next(r),s.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(s))}},e.prototype._error=function(r){for(var n=this.windows;n.length>0;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){for(var r=this.windows;r.length>0;){var n=r.shift();n.closed||n.complete()}this.destination.complete()},e.prototype.openWindow=function(){var r=new rbe;this.windows.push(r);var n=this.destination;return n.next(r),r},e.prototype.closeWindow=function(r){r.complete();var n=this.windows;n.splice(n.indexOf(r),1)},e}(Xve.Subscriber);function ibe(t){var e=t.subscriber,r=t.windowTimeSpan,n=t.window;n&&e.closeWindow(n),t.window=e.openWindow(),this.schedule(t,r)}function obe(t){var e=t.windowTimeSpan,r=t.subscriber,n=t.scheduler,i=t.windowCreationInterval,o=r.openWindow(),s=this,a={action:s,subscription:null},c={subscriber:r,window:o,context:a};a.subscription=n.schedule(bB,e,c),s.add(a.subscription),s.schedule(t,i)}function bB(t){var e=t.subscriber,r=t.window,n=t.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),e.closeWindow(r)}});var EB=_(np=>{"use strict";var sbe=np&&np.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(np,"__esModule",{value:!0});var abe=jr(),cbe=yr(),ube=us(),wB=ls();function lbe(t,e){return function(r){return r.lift(new fbe(t,e))}}np.windowToggle=lbe;var fbe=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new hbe(e,this.openings,this.closingSelector))},t}(),hbe=function(t){sbe(e,t);function e(r,n,i){var o=t.call(this,r)||this;return o.openings=n,o.closingSelector=i,o.contexts=[],o.add(o.openSubscription=wB.subscribeToResult(o,n,n)),o}return e.prototype._next=function(r){var n=this.contexts;if(n)for(var i=n.length,o=0;o<i;o++)n[o].window.next(r)},e.prototype._error=function(r){var n=this.contexts;if(this.contexts=null,n)for(var i=n.length,o=-1;++o<i;){var s=n[o];s.window.error(r),s.subscription.unsubscribe()}t.prototype._error.call(this,r)},e.prototype._complete=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var o=r[i];o.window.complete(),o.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var o=r[i];o.window.unsubscribe(),o.subscription.unsubscribe()}},e.prototype.notifyNext=function(r,n,i,o,s){if(r===this.openings){var a=void 0;try{var c=this.closingSelector;a=c(n)}catch(m){return this.error(m)}var u=new abe.Subject,l=new cbe.Subscription,h={window:u,subscription:l};this.contexts.push(h);var d=wB.subscribeToResult(this,a,h);d.closed?this.closeWindow(this.contexts.length-1):(d.context=h,l.add(d)),this.destination.next(u)}else this.closeWindow(this.contexts.indexOf(r))},e.prototype.notifyError=function(r){this.error(r)},e.prototype.notifyComplete=function(r){r!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(r.context))},e.prototype.closeWindow=function(r){if(r!==-1){var n=this.contexts,i=n[r],o=i.window,s=i.subscription;n.splice(r,1),o.complete(),s.unsubscribe()}},e}(ube.OuterSubscriber)});var SB=_(ip=>{"use strict";var dbe=ip&&ip.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ip,"__esModule",{value:!0});var pbe=jr(),gbe=us(),mbe=ls();function ybe(t){return function(r){return r.lift(new vbe(t))}}ip.windowWhen=ybe;var vbe=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new bbe(e,this.closingSelector))},t}(),bbe=function(t){dbe(e,t);function e(r,n){var i=t.call(this,r)||this;return i.destination=r,i.closingSelector=n,i.openWindow(),i}return e.prototype.notifyNext=function(r,n,i,o,s){this.openWindow(s)},e.prototype.notifyError=function(r){this._error(r)},e.prototype.notifyComplete=function(r){this.openWindow(r)},e.prototype._next=function(r){this.window.next(r)},e.prototype._error=function(r){this.window.error(r),this.destination.error(r),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(r){r===void 0&&(r=null),r&&(this.remove(r),r.unsubscribe());var n=this.window;n&&n.complete();var i=this.window=new pbe.Subject;this.destination.next(i);var o;try{var s=this.closingSelector;o=s()}catch(a){this.destination.error(a),this.window.error(a);return}this.add(this.closingNotification=mbe.subscribeToResult(this,o))},e}(gbe.OuterSubscriber)});var xB=_(op=>{"use strict";var _be=op&&op.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(op,"__esModule",{value:!0});var wbe=us(),Ebe=ls();function Sbe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){var n;typeof t[t.length-1]=="function"&&(n=t.pop());var i=t;return r.lift(new xbe(i,n))}}op.withLatestFrom=Sbe;var xbe=function(){function t(e,r){this.observables=e,this.project=r}return t.prototype.call=function(e,r){return r.subscribe(new Obe(e,this.observables,this.project))},t}(),Obe=function(t){_be(e,t);function e(r,n,i){var o=t.call(this,r)||this;o.observables=n,o.project=i,o.toRespond=[];var s=n.length;o.values=new Array(s);for(var a=0;a<s;a++)o.toRespond.push(a);for(var a=0;a<s;a++){var c=n[a];o.add(Ebe.subscribeToResult(o,c,void 0,a))}return o}return e.prototype.notifyNext=function(r,n,i){this.values[i]=n;var o=this.toRespond;if(o.length>0){var s=o.indexOf(i);s!==-1&&o.splice(s,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(r){if(this.toRespond.length===0){var n=[r].concat(this.values);this.project?this._tryProject(n):this.destination.next(n)}},e.prototype._tryProject=function(r){var n;try{n=this.project.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(wbe.OuterSubscriber)});var OB=_(HE=>{"use strict";Object.defineProperty(HE,"__esModule",{value:!0});var Cbe=Pm();function Abe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return n.lift.call(Cbe.zip.apply(void 0,[n].concat(t)))}}HE.zip=Abe});var CB=_(zE=>{"use strict";Object.defineProperty(zE,"__esModule",{value:!0});var Ibe=Pm();function Mbe(t){return function(e){return e.lift(new Ibe.ZipOperator(t))}}zE.zipAll=Mbe});var sp=_(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});var Rbe=k4();ee.audit=Rbe.audit;var Tbe=lL();ee.auditTime=Tbe.auditTime;var Pbe=fL();ee.buffer=Pbe.buffer;var Dbe=pL();ee.bufferCount=Dbe.bufferCount;var Nbe=yL();ee.bufferTime=Nbe.bufferTime;var kbe=bL();ee.bufferToggle=kbe.bufferToggle;var Lbe=_L();ee.bufferWhen=Lbe.bufferWhen;var jbe=wL();ee.catchError=jbe.catchError;var Bbe=EL();ee.combineAll=Bbe.combineAll;var qbe=SL();ee.combineLatest=qbe.combineLatest;var Fbe=xL();ee.concat=Fbe.concat;var Ube=f4();ee.concatAll=Ube.concatAll;var $be=H4();ee.concatMap=$be.concatMap;var Wbe=OL();ee.concatMapTo=Wbe.concatMapTo;var Hbe=CL();ee.count=Hbe.count;var zbe=AL();ee.debounce=zbe.debounce;var Vbe=IL();ee.debounceTime=Vbe.debounceTime;var Gbe=Uu();ee.defaultIfEmpty=Gbe.defaultIfEmpty;var Kbe=RL();ee.delay=Kbe.delay;var Ybe=PL();ee.delayWhen=Ybe.delayWhen;var Zbe=DL();ee.dematerialize=Zbe.dematerialize;var Jbe=kL();ee.distinct=Jbe.distinct;var Qbe=J4();ee.distinctUntilChanged=Qbe.distinctUntilChanged;var Xbe=LL();ee.distinctUntilKeyChanged=Xbe.distinctUntilKeyChanged;var e_e=BL();ee.elementAt=e_e.elementAt;var t_e=qL();ee.endWith=t_e.endWith;var r_e=FL();ee.every=r_e.every;var n_e=UL();ee.exhaust=n_e.exhaust;var i_e=WL();ee.exhaustMap=i_e.exhaustMap;var o_e=VL();ee.expand=o_e.expand;var s_e=Ia();ee.filter=s_e.filter;var a_e=GL();ee.finalize=a_e.finalize;var c_e=iE();ee.find=c_e.find;var u_e=ZL();ee.findIndex=u_e.findIndex;var l_e=JL();ee.first=l_e.first;var f_e=w5();ee.groupBy=f_e.groupBy;var h_e=QL();ee.ignoreElements=h_e.ignoreElements;var d_e=XL();ee.isEmpty=d_e.isEmpty;var p_e=ej();ee.last=p_e.last;var g_e=Sn();ee.map=g_e.map;var m_e=tj();ee.mapTo=m_e.mapTo;var y_e=rj();ee.materialize=y_e.materialize;var v_e=sj();ee.max=v_e.max;var b_e=aj();ee.merge=b_e.merge;var __e=Cm();ee.mergeAll=__e.mergeAll;var AB=td();ee.mergeMap=AB.mergeMap;ee.flatMap=AB.flatMap;var w_e=uj();ee.mergeMapTo=w_e.mergeMapTo;var E_e=hj();ee.mergeScan=E_e.mergeScan;var S_e=dj();ee.min=S_e.min;var x_e=ka();ee.multicast=x_e.multicast;var O_e=N5();ee.observeOn=O_e.observeOn;var C_e=yj();ee.onErrorResumeNext=C_e.onErrorResumeNext;var A_e=vj();ee.pairwise=A_e.pairwise;var I_e=_j();ee.partition=I_e.partition;var M_e=wj();ee.pluck=M_e.pluck;var R_e=xj();ee.publish=R_e.publish;var T_e=Oj();ee.publishBehavior=T_e.publishBehavior;var P_e=Cj();ee.publishLast=P_e.publishLast;var D_e=Aj();ee.publishReplay=D_e.publishReplay;var N_e=Ij();ee.race=N_e.race;var k_e=Nd();ee.reduce=k_e.reduce;var L_e=Rj();ee.repeat=L_e.repeat;var j_e=Tj();ee.repeatWhen=j_e.repeatWhen;var B_e=Pj();ee.retry=B_e.retry;var q_e=Dj();ee.retryWhen=q_e.retryWhen;var F_e=gm();ee.refCount=F_e.refCount;var U_e=Nj();ee.sample=U_e.sample;var $_e=kj();ee.sampleTime=$_e.sampleTime;var W_e=km();ee.scan=W_e.scan;var H_e=Fj();ee.sequenceEqual=H_e.sequenceEqual;var z_e=Uj();ee.share=z_e.share;var V_e=$j();ee.shareReplay=V_e.shareReplay;var G_e=Wj();ee.single=G_e.single;var K_e=Hj();ee.skip=K_e.skip;var Y_e=Vj();ee.skipLast=Y_e.skipLast;var Z_e=Gj();ee.skipUntil=Z_e.skipUntil;var J_e=Kj();ee.skipWhile=J_e.skipWhile;var Q_e=Zj();ee.startWith=Q_e.startWith;var X_e=Qj();ee.subscribeOn=X_e.subscribeOn;var ewe=eB();ee.switchAll=ewe.switchAll;var twe=jm();ee.switchMap=twe.switchMap;var rwe=rB();ee.switchMapTo=rwe.switchMapTo;var nwe=Dm();ee.take=nwe.take;var iwe=Nm();ee.takeLast=iwe.takeLast;var owe=nB();ee.takeUntil=owe.takeUntil;var swe=iB();ee.takeWhile=swe.takeWhile;var awe=oB();ee.tap=awe.tap;var cwe=jE();ee.throttle=cwe.throttle;var uwe=sB();ee.throttleTime=uwe.throttleTime;var lwe=Ed();ee.throwIfEmpty=lwe.throwIfEmpty;var fwe=cB();ee.timeInterval=fwe.timeInterval;var hwe=uB();ee.timeout=hwe.timeout;var dwe=qE();ee.timeoutWith=dwe.timeoutWith;var pwe=fB();ee.timestamp=pwe.timestamp;var gwe=hB();ee.toArray=gwe.toArray;var mwe=pB();ee.window=mwe.window;var ywe=mB();ee.windowCount=ywe.windowCount;var vwe=_B();ee.windowTime=vwe.windowTime;var bwe=EB();ee.windowToggle=bwe.windowToggle;var _we=SB();ee.windowWhen=_we.windowWhen;var wwe=xB();ee.withLatestFrom=wwe.withLatestFrom;var Ewe=OB();ee.zip=Ewe.zip;var Swe=CB();ee.zipAll=Swe.zipAll});var xn=_((Qqe,VE)=>{typeof Object.create=="function"?VE.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:VE.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Oo=_((GE,MB)=>{var Fm=su(),Ai=Fm.Buffer;function IB(t,e){for(var r in t)e[r]=t[r]}Ai.from&&Ai.alloc&&Ai.allocUnsafe&&Ai.allocUnsafeSlow?MB.exports=Fm:(IB(Fm,GE),GE.Buffer=Ba);function Ba(t,e,r){return Ai(t,e,r)}Ba.prototype=Object.create(Ai.prototype);IB(Ai,Ba);Ba.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Ai(t,e,r)};Ba.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Ai(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Ba.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ai(t)};Ba.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Fm.SlowBuffer(t)}});var qa=_((Xqe,TB)=>{var RB=Oo().Buffer;function Um(t,e){this._block=RB.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}Um.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=RB.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,o=this._len,s=0;s<i;){for(var a=o%n,c=Math.min(i-s,n-a),u=0;u<c;u++)r[a+u]=t[s+u];o+=c,s+=c,o%n===0&&this._update(r)}return this._len+=i,this};Um.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o};Um.prototype._update=function(){throw new Error("_update must be implemented by subclass")};TB.exports=Um});var NB=_((eFe,DB)=>{var xwe=xn(),PB=qa(),Owe=Oo().Buffer,Cwe=[1518500249,1859775393,-1894007588,-899497514],Awe=new Array(80);function ap(){this.init(),this._w=Awe,PB.call(this,64,56)}xwe(ap,PB);ap.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Iwe(t){return t<<5|t>>>27}function Mwe(t){return t<<30|t>>>2}function Rwe(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}ap.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,s=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var c=0;c<80;++c){var u=~~(c/20),l=Iwe(r)+Rwe(u,n,i,o)+s+e[c]+Cwe[u]|0;s=o,o=i,i=Mwe(n),n=r,r=l}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0};ap.prototype._hash=function(){var t=Owe.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};DB.exports=ap});var jB=_((tFe,LB)=>{var Twe=xn(),kB=qa(),Pwe=Oo().Buffer,Dwe=[1518500249,1859775393,-1894007588,-899497514],Nwe=new Array(80);function cp(){this.init(),this._w=Nwe,kB.call(this,64,56)}Twe(cp,kB);cp.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function kwe(t){return t<<1|t>>>31}function Lwe(t){return t<<5|t>>>27}function jwe(t){return t<<30|t>>>2}function Bwe(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}cp.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,s=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=kwe(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var c=0;c<80;++c){var u=~~(c/20),l=Lwe(r)+Bwe(u,n,i,o)+s+e[c]+Dwe[u]|0;s=o,o=i,i=jwe(n),n=r,r=l}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0};cp.prototype._hash=function(){var t=Pwe.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};LB.exports=cp});var KE=_((rFe,qB)=>{var qwe=xn(),BB=qa(),Fwe=Oo().Buffer,Uwe=[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],$we=new Array(64);function up(){this.init(),this._w=$we,BB.call(this,64,56)}qwe(up,BB);up.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Wwe(t,e,r){return r^t&(e^r)}function Hwe(t,e,r){return t&e|r&(t|e)}function zwe(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function Vwe(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function Gwe(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function Kwe(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}up.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,s=this._e|0,a=this._f|0,c=this._g|0,u=this._h|0,l=0;l<16;++l)e[l]=t.readInt32BE(l*4);for(;l<64;++l)e[l]=Kwe(e[l-2])+e[l-7]+Gwe(e[l-15])+e[l-16]|0;for(var h=0;h<64;++h){var d=u+Vwe(s)+Wwe(s,a,c)+Uwe[h]+e[h]|0,m=zwe(r)+Hwe(r,n,i)|0;u=c,c=a,a=s,s=o+d|0,o=i,i=n,n=r,r=d+m|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=u+this._h|0};up.prototype._hash=function(){var t=Fwe.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};qB.exports=up});var UB=_((nFe,FB)=>{var Ywe=xn(),Zwe=KE(),Jwe=qa(),Qwe=Oo().Buffer,Xwe=new Array(64);function $m(){this.init(),this._w=Xwe,Jwe.call(this,64,56)}Ywe($m,Zwe);$m.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};$m.prototype._hash=function(){var t=Qwe.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};FB.exports=$m});var YE=_((iFe,KB)=>{var e2e=xn(),GB=qa(),t2e=Oo().Buffer,$B=[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],r2e=new Array(160);function lp(){this.init(),this._w=r2e,GB.call(this,128,112)}e2e(lp,GB);lp.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function WB(t,e,r){return r^t&(e^r)}function HB(t,e,r){return t&e|r&(t|e)}function zB(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function VB(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function n2e(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function i2e(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function o2e(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function s2e(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function _r(t,e){return t>>>0<e>>>0?1:0}lp.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,o=this._dh|0,s=this._eh|0,a=this._fh|0,c=this._gh|0,u=this._hh|0,l=this._al|0,h=this._bl|0,d=this._cl|0,m=this._dl|0,v=this._el|0,x=this._fl|0,O=this._gl|0,I=this._hl|0,j=0;j<32;j+=2)e[j]=t.readInt32BE(j*4),e[j+1]=t.readInt32BE(j*4+4);for(;j<160;j+=2){var k=e[j-30],B=e[j-15*2+1],V=n2e(k,B),q=i2e(B,k);k=e[j-2*2],B=e[j-2*2+1];var P=o2e(k,B),L=s2e(B,k),H=e[j-7*2],M=e[j-7*2+1],N=e[j-16*2],F=e[j-16*2+1],E=q+M|0,f=V+H+_r(E,q)|0;E=E+L|0,f=f+P+_r(E,L)|0,E=E+F|0,f=f+N+_r(E,F)|0,e[j]=f,e[j+1]=E}for(var g=0;g<160;g+=2){f=e[g],E=e[g+1];var y=HB(r,n,i),b=HB(l,h,d),w=zB(r,l),R=zB(l,r),T=VB(s,v),S=VB(v,s),p=$B[g],A=$B[g+1],Y=WB(s,a,c),Z=WB(v,x,O),G=I+S|0,X=u+T+_r(G,I)|0;G=G+Z|0,X=X+Y+_r(G,Z)|0,G=G+A|0,X=X+p+_r(G,A)|0,G=G+E|0,X=X+f+_r(G,E)|0;var ae=R+b|0,fe=w+y+_r(ae,R)|0;u=c,I=O,c=a,O=x,a=s,x=v,v=m+G|0,s=o+X+_r(v,m)|0,o=i,m=d,i=n,d=h,n=r,h=l,l=G+ae|0,r=X+fe+_r(l,G)|0}this._al=this._al+l|0,this._bl=this._bl+h|0,this._cl=this._cl+d|0,this._dl=this._dl+m|0,this._el=this._el+v|0,this._fl=this._fl+x|0,this._gl=this._gl+O|0,this._hl=this._hl+I|0,this._ah=this._ah+r+_r(this._al,l)|0,this._bh=this._bh+n+_r(this._bl,h)|0,this._ch=this._ch+i+_r(this._cl,d)|0,this._dh=this._dh+o+_r(this._dl,m)|0,this._eh=this._eh+s+_r(this._el,v)|0,this._fh=this._fh+a+_r(this._fl,x)|0,this._gh=this._gh+c+_r(this._gl,O)|0,this._hh=this._hh+u+_r(this._hl,I)|0};lp.prototype._hash=function(){var t=t2e.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};KB.exports=lp});var ZB=_((oFe,YB)=>{var a2e=xn(),c2e=YE(),u2e=qa(),l2e=Oo().Buffer,f2e=new Array(160);function Wm(){this.init(),this._w=f2e,u2e.call(this,128,112)}a2e(Wm,c2e);Wm.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Wm.prototype._hash=function(){var t=l2e.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};YB.exports=Wm});var QB=_((Co,JB)=>{var Co=JB.exports=function(e){e=e.toLowerCase();var r=Co[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};Co.sha=NB();Co.sha1=jB();Co.sha224=UB();Co.sha256=KE();Co.sha384=ZB();Co.sha512=YE()});var ZE=_((sFe,XB)=>{"use strict";XB.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}});var rq=_((aFe,tq)=>{"use strict";var eq=typeof Symbol<"u"&&Symbol,h2e=ZE();tq.exports=function(){return typeof eq!="function"||typeof Symbol!="function"||typeof eq("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:h2e()}});var iq=_((cFe,nq)=>{"use strict";var d2e="Function.prototype.bind called on incompatible ",JE=Array.prototype.slice,p2e=Object.prototype.toString,g2e="[object Function]";nq.exports=function(e){var r=this;if(typeof r!="function"||p2e.call(r)!==g2e)throw new TypeError(d2e+r);for(var n=JE.call(arguments,1),i,o=function(){if(this instanceof i){var l=r.apply(this,n.concat(JE.call(arguments)));return Object(l)===l?l:this}else return r.apply(e,n.concat(JE.call(arguments)))},s=Math.max(0,r.length-n.length),a=[],c=0;c<s;c++)a.push("$"+c);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var u=function(){};u.prototype=r.prototype,i.prototype=new u,u.prototype=null}return i}});var Hm=_((uFe,oq)=>{"use strict";var m2e=iq();oq.exports=Function.prototype.bind||m2e});var aq=_((lFe,sq)=>{"use strict";var y2e=Hm();sq.exports=y2e.call(Function.call,Object.prototype.hasOwnProperty)});var hp=_((fFe,hq)=>{"use strict";var He,Gu=SyntaxError,fq=Function,Vu=TypeError,QE=function(t){try{return fq('"use strict"; return ('+t+").constructor;")()}catch{}},Fa=Object.getOwnPropertyDescriptor;if(Fa)try{Fa({},"")}catch{Fa=null}var XE=function(){throw new Vu},v2e=Fa?function(){try{return arguments.callee,XE}catch{try{return Fa(arguments,"callee").get}catch{return XE}}}():XE,Hu=rq()(),Ii=Object.getPrototypeOf||function(t){return t.__proto__},zu={},b2e=typeof Uint8Array>"u"?He:Ii(Uint8Array),Ua={"%AggregateError%":typeof AggregateError>"u"?He:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?He:ArrayBuffer,"%ArrayIteratorPrototype%":Hu?Ii([][Symbol.iterator]()):He,"%AsyncFromSyncIteratorPrototype%":He,"%AsyncFunction%":zu,"%AsyncGenerator%":zu,"%AsyncGeneratorFunction%":zu,"%AsyncIteratorPrototype%":zu,"%Atomics%":typeof Atomics>"u"?He:Atomics,"%BigInt%":typeof BigInt>"u"?He:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?He:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?He:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?He:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?He:Float32Array,"%Float64Array%":typeof Float64Array>"u"?He:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?He:FinalizationRegistry,"%Function%":fq,"%GeneratorFunction%":zu,"%Int8Array%":typeof Int8Array>"u"?He:Int8Array,"%Int16Array%":typeof Int16Array>"u"?He:Int16Array,"%Int32Array%":typeof Int32Array>"u"?He:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Hu?Ii(Ii([][Symbol.iterator]())):He,"%JSON%":typeof JSON=="object"?JSON:He,"%Map%":typeof Map>"u"?He:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Hu?He:Ii(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?He:Promise,"%Proxy%":typeof Proxy>"u"?He:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?He:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?He:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Hu?He:Ii(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?He:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Hu?Ii(""[Symbol.iterator]()):He,"%Symbol%":Hu?Symbol:He,"%SyntaxError%":Gu,"%ThrowTypeError%":v2e,"%TypedArray%":b2e,"%TypeError%":Vu,"%Uint8Array%":typeof Uint8Array>"u"?He:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?He:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?He:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?He:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?He:WeakMap,"%WeakRef%":typeof WeakRef>"u"?He:WeakRef,"%WeakSet%":typeof WeakSet>"u"?He:WeakSet};try{null.error}catch(t){cq=Ii(Ii(t)),Ua["%Error.prototype%"]=cq}var cq,_2e=function t(e){var r;if(e==="%AsyncFunction%")r=QE("async function () {}");else if(e==="%GeneratorFunction%")r=QE("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=QE("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&(r=Ii(i.prototype))}return Ua[e]=r,r},uq={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},fp=Hm(),zm=aq(),w2e=fp.call(Function.call,Array.prototype.concat),E2e=fp.call(Function.apply,Array.prototype.splice),lq=fp.call(Function.call,String.prototype.replace),Vm=fp.call(Function.call,String.prototype.slice),S2e=fp.call(Function.call,RegExp.prototype.exec),x2e=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O2e=/\\(\\)?/g,C2e=function(e){var r=Vm(e,0,1),n=Vm(e,-1);if(r==="%"&&n!=="%")throw new Gu("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Gu("invalid intrinsic syntax, expected opening `%`");var i=[];return lq(e,x2e,function(o,s,a,c){i[i.length]=a?lq(c,O2e,"$1"):s||o}),i},A2e=function(e,r){var n=e,i;if(zm(uq,n)&&(i=uq[n],n="%"+i[0]+"%"),zm(Ua,n)){var o=Ua[n];if(o===zu&&(o=_2e(n)),typeof o>"u"&&!r)throw new Vu("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new Gu("intrinsic "+e+" does not exist!")};hq.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new Vu("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Vu('"allowMissing" argument must be a boolean');if(S2e(/^%?[^%]*%?$/,e)===null)throw new Gu("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=C2e(e),i=n.length>0?n[0]:"",o=A2e("%"+i+"%",r),s=o.name,a=o.value,c=!1,u=o.alias;u&&(i=u[0],E2e(n,w2e([0,1],u)));for(var l=1,h=!0;l<n.length;l+=1){var d=n[l],m=Vm(d,0,1),v=Vm(d,-1);if((m==='"'||m==="'"||m==="`"||v==='"'||v==="'"||v==="`")&&m!==v)throw new Gu("property names with quotes must have matching quotes");if((d==="constructor"||!h)&&(c=!0),i+="."+d,s="%"+i+"%",zm(Ua,s))a=Ua[s];else if(a!=null){if(!(d in a)){if(!r)throw new Vu("base intrinsic for "+e+" exists, but the property is not available.");return}if(Fa&&l+1>=n.length){var x=Fa(a,d);h=!!x,h&&"get"in x&&!("originalValue"in x.get)?a=x.get:a=a[d]}else h=zm(a,d),a=a[d];h&&!c&&(Ua[s]=a)}}return a}});var vq=_((hFe,Gm)=>{"use strict";var e6=Hm(),Ku=hp(),gq=Ku("%Function.prototype.apply%"),mq=Ku("%Function.prototype.call%"),yq=Ku("%Reflect.apply%",!0)||e6.call(mq,gq),dq=Ku("%Object.getOwnPropertyDescriptor%",!0),$a=Ku("%Object.defineProperty%",!0),I2e=Ku("%Math.max%");if($a)try{$a({},"a",{value:1})}catch{$a=null}Gm.exports=function(e){var r=yq(e6,mq,arguments);if(dq&&$a){var n=dq(r,"length");n.configurable&&$a(r,"length",{value:1+I2e(0,e.length-(arguments.length-1))})}return r};var pq=function(){return yq(e6,gq,arguments)};$a?$a(Gm.exports,"apply",{value:pq}):Gm.exports.apply=pq});var dp=_((dFe,wq)=>{"use strict";var bq=hp(),_q=vq(),M2e=_q(bq("String.prototype.indexOf"));wq.exports=function(e,r){var n=bq(e,!!r);return typeof n=="function"&&M2e(e,".prototype.")>-1?_q(n):n}});var Eq=_(()=>{});var $q=_((mFe,Uq)=>{var l6=typeof Map=="function"&&Map.prototype,t6=Object.getOwnPropertyDescriptor&&l6?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ym=l6&&t6&&typeof t6.get=="function"?t6.get:null,Sq=l6&&Map.prototype.forEach,f6=typeof Set=="function"&&Set.prototype,r6=Object.getOwnPropertyDescriptor&&f6?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Zm=f6&&r6&&typeof r6.get=="function"?r6.get:null,xq=f6&&Set.prototype.forEach,R2e=typeof WeakMap=="function"&&WeakMap.prototype,gp=R2e?WeakMap.prototype.has:null,T2e=typeof WeakSet=="function"&&WeakSet.prototype,mp=T2e?WeakSet.prototype.has:null,P2e=typeof WeakRef=="function"&&WeakRef.prototype,Oq=P2e?WeakRef.prototype.deref:null,D2e=Boolean.prototype.valueOf,N2e=Object.prototype.toString,k2e=Function.prototype.toString,L2e=String.prototype.match,h6=String.prototype.slice,ps=String.prototype.replace,j2e=String.prototype.toUpperCase,Cq=String.prototype.toLowerCase,kq=RegExp.prototype.test,Aq=Array.prototype.concat,Mi=Array.prototype.join,B2e=Array.prototype.slice,Iq=Math.floor,o6=typeof BigInt=="function"?BigInt.prototype.valueOf:null,n6=Object.getOwnPropertySymbols,s6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Yu=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Br=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Yu?"object":"symbol")?Symbol.toStringTag:null,Lq=Object.prototype.propertyIsEnumerable,Mq=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Rq(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||kq.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Iq(-t):Iq(t);if(n!==t){var i=String(n),o=h6.call(e,i.length+1);return ps.call(i,r,"$&_")+"."+ps.call(ps.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ps.call(e,r,"$&_")}var a6=Eq(),Tq=a6.custom,Pq=Bq(Tq)?Tq:null;Uq.exports=function t(e,r,n,i){var o=r||{};if(ds(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ds(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=ds(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ds(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ds(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Fq(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return a?Rq(e,c):c}if(typeof e=="bigint"){var u=String(e)+"n";return a?Rq(e,u):u}var l=typeof o.depth>"u"?5:o.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return c6(e)?"[Array]":"[Object]";var h=r3e(o,n);if(typeof i>"u")i=[];else if(qq(i,e)>=0)return"[Circular]";function d(E,f,g){if(f&&(i=B2e.call(i),i.push(f)),g){var y={depth:o.depth};return ds(o,"quoteStyle")&&(y.quoteStyle=o.quoteStyle),t(E,y,n+1,i)}return t(E,o,n+1,i)}if(typeof e=="function"&&!Dq(e)){var m=G2e(e),v=Km(e,d);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(v.length>0?" { "+Mi.call(v,", ")+" }":"")}if(Bq(e)){var x=Yu?ps.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):s6.call(e);return typeof e=="object"&&!Yu?pp(x):x}if(X2e(e)){for(var O="<"+Cq.call(String(e.nodeName)),I=e.attributes||[],j=0;j<I.length;j++)O+=" "+I[j].name+"="+jq(q2e(I[j].value),"double",o);return O+=">",e.childNodes&&e.childNodes.length&&(O+="..."),O+="</"+Cq.call(String(e.nodeName))+">",O}if(c6(e)){if(e.length===0)return"[]";var k=Km(e,d);return h&&!t3e(k)?"["+u6(k,h)+"]":"[ "+Mi.call(k,", ")+" ]"}if(U2e(e)){var B=Km(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!Lq.call(e,"cause")?"{ ["+String(e)+"] "+Mi.call(Aq.call("[cause]: "+d(e.cause),B),", ")+" }":B.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Mi.call(B,", ")+" }"}if(typeof e=="object"&&s){if(Pq&&typeof e[Pq]=="function"&&a6)return a6(e,{depth:l-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(K2e(e)){var V=[];return Sq&&Sq.call(e,function(E,f){V.push(d(f,e,!0)+" => "+d(E,e))}),Nq("Map",Ym.call(e),V,h)}if(J2e(e)){var q=[];return xq&&xq.call(e,function(E){q.push(d(E,e))}),Nq("Set",Zm.call(e),q,h)}if(Y2e(e))return i6("WeakMap");if(Q2e(e))return i6("WeakSet");if(Z2e(e))return i6("WeakRef");if(W2e(e))return pp(d(Number(e)));if(z2e(e))return pp(d(o6.call(e)));if(H2e(e))return pp(D2e.call(e));if($2e(e))return pp(d(String(e)));if(!F2e(e)&&!Dq(e)){var P=Km(e,d),L=Mq?Mq(e)===Object.prototype:e instanceof Object||e.constructor===Object,H=e instanceof Object?"":"null prototype",M=!L&&Br&&Object(e)===e&&Br in e?h6.call(gs(e),8,-1):H?"Object":"",N=L||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",F=N+(M||H?"["+Mi.call(Aq.call([],M||[],H||[]),": ")+"] ":"");return P.length===0?F+"{}":h?F+"{"+u6(P,h)+"}":F+"{ "+Mi.call(P,", ")+" }"}return String(e)};function jq(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function q2e(t){return ps.call(String(t),/"/g,"&quot;")}function c6(t){return gs(t)==="[object Array]"&&(!Br||!(typeof t=="object"&&Br in t))}function F2e(t){return gs(t)==="[object Date]"&&(!Br||!(typeof t=="object"&&Br in t))}function Dq(t){return gs(t)==="[object RegExp]"&&(!Br||!(typeof t=="object"&&Br in t))}function U2e(t){return gs(t)==="[object Error]"&&(!Br||!(typeof t=="object"&&Br in t))}function $2e(t){return gs(t)==="[object String]"&&(!Br||!(typeof t=="object"&&Br in t))}function W2e(t){return gs(t)==="[object Number]"&&(!Br||!(typeof t=="object"&&Br in t))}function H2e(t){return gs(t)==="[object Boolean]"&&(!Br||!(typeof t=="object"&&Br in t))}function Bq(t){if(Yu)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!s6)return!1;try{return s6.call(t),!0}catch{}return!1}function z2e(t){if(!t||typeof t!="object"||!o6)return!1;try{return o6.call(t),!0}catch{}return!1}var V2e=Object.prototype.hasOwnProperty||function(t){return t in this};function ds(t,e){return V2e.call(t,e)}function gs(t){return N2e.call(t)}function G2e(t){if(t.name)return t.name;var e=L2e.call(k2e.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function qq(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function K2e(t){if(!Ym||!t||typeof t!="object")return!1;try{Ym.call(t);try{Zm.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function Y2e(t){if(!gp||!t||typeof t!="object")return!1;try{gp.call(t,gp);try{mp.call(t,mp)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function Z2e(t){if(!Oq||!t||typeof t!="object")return!1;try{return Oq.call(t),!0}catch{}return!1}function J2e(t){if(!Zm||!t||typeof t!="object")return!1;try{Zm.call(t);try{Ym.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function Q2e(t){if(!mp||!t||typeof t!="object")return!1;try{mp.call(t,mp);try{gp.call(t,gp)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function X2e(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Fq(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Fq(h6.call(t,0,e.maxStringLength),e)+n}var i=ps.call(ps.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,e3e);return jq(i,"single",e)}function e3e(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+j2e.call(e.toString(16))}function pp(t){return"Object("+t+")"}function i6(t){return t+" { ? }"}function Nq(t,e,r,n){var i=n?u6(r,n):Mi.call(r,", ");return t+" ("+e+") {"+i+"}"}function t3e(t){for(var e=0;e<t.length;e++)if(qq(t[e],`
20
+ `)>=0)return!1;return!0}function r3e(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Mi.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Mi.call(Array(e+1),r)}}function u6(t,e){if(t.length===0)return"";var r=`
21
+ `+e.prev+e.base;return r+Mi.call(t,","+r)+`
22
+ `+e.prev}function Km(t,e){var r=c6(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=ds(t,i)?e(t[i],t):""}var o=typeof n6=="function"?n6(t):[],s;if(Yu){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var c in t)!ds(t,c)||r&&String(Number(c))===c&&c<t.length||Yu&&s["$"+c]instanceof Symbol||(kq.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t)));if(typeof n6=="function")for(var u=0;u<o.length;u++)Lq.call(t,o[u])&&n.push("["+e(o[u])+"]: "+e(t[o[u]],t));return n}});var Hq=_((yFe,Wq)=>{"use strict";var d6=hp(),Zu=dp(),n3e=$q(),i3e=d6("%TypeError%"),Jm=d6("%WeakMap%",!0),Qm=d6("%Map%",!0),o3e=Zu("WeakMap.prototype.get",!0),s3e=Zu("WeakMap.prototype.set",!0),a3e=Zu("WeakMap.prototype.has",!0),c3e=Zu("Map.prototype.get",!0),u3e=Zu("Map.prototype.set",!0),l3e=Zu("Map.prototype.has",!0),p6=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},f3e=function(t,e){var r=p6(t,e);return r&&r.value},h3e=function(t,e,r){var n=p6(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},d3e=function(t,e){return!!p6(t,e)};Wq.exports=function(){var e,r,n,i={assert:function(o){if(!i.has(o))throw new i3e("Side channel does not contain "+n3e(o))},get:function(o){if(Jm&&o&&(typeof o=="object"||typeof o=="function")){if(e)return o3e(e,o)}else if(Qm){if(r)return c3e(r,o)}else if(n)return f3e(n,o)},has:function(o){if(Jm&&o&&(typeof o=="object"||typeof o=="function")){if(e)return a3e(e,o)}else if(Qm){if(r)return l3e(r,o)}else if(n)return d3e(n,o);return!1},set:function(o,s){Jm&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new Jm),s3e(e,o,s)):Qm?(r||(r=new Qm),u3e(r,o,s)):(n||(n={key:{},next:null}),h3e(n,o,s))}};return i}});var Xm=_((vFe,zq)=>{"use strict";var p3e=String.prototype.replace,g3e=/%20/g,g6={RFC1738:"RFC1738",RFC3986:"RFC3986"};zq.exports={default:g6.RFC3986,formatters:{RFC1738:function(t){return p3e.call(t,g3e,"+")},RFC3986:function(t){return String(t)}},RFC1738:g6.RFC1738,RFC3986:g6.RFC3986}});var y6=_((bFe,Gq)=>{"use strict";var m3e=Xm(),m6=Object.prototype.hasOwnProperty,Wa=Array.isArray,Ri=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),y3e=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(Wa(n)){for(var i=[],o=0;o<n.length;++o)typeof n[o]<"u"&&i.push(n[o]);r.obj[r.prop]=i}}},Vq=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},v3e=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(Wa(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!m6.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var i=e;return Wa(e)&&!Wa(r)&&(i=Vq(e,n)),Wa(e)&&Wa(r)?(r.forEach(function(o,s){if(m6.call(e,s)){var a=e[s];a&&typeof a=="object"&&o&&typeof o=="object"?e[s]=t(a,o,n):e.push(o)}else e[s]=o}),e):Object.keys(r).reduce(function(o,s){var a=r[s];return m6.call(o,s)?o[s]=t(o[s],a,n):o[s]=a,o},i)},b3e=function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},_3e=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},w3e=function(e,r,n,i,o){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var a="",c=0;c<s.length;++c){var u=s.charCodeAt(c);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===m3e.RFC1738&&(u===40||u===41)){a+=s.charAt(c);continue}if(u<128){a=a+Ri[u];continue}if(u<2048){a=a+(Ri[192|u>>6]+Ri[128|u&63]);continue}if(u<55296||u>=57344){a=a+(Ri[224|u>>12]+Ri[128|u>>6&63]+Ri[128|u&63]);continue}c+=1,u=65536+((u&1023)<<10|s.charCodeAt(c)&1023),a+=Ri[240|u>>18]+Ri[128|u>>12&63]+Ri[128|u>>6&63]+Ri[128|u&63]}return a},E3e=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var o=r[i],s=o.obj[o.prop],a=Object.keys(s),c=0;c<a.length;++c){var u=a[c],l=s[u];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(r.push({obj:s,prop:u}),n.push(l))}return y3e(r),e},S3e=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},x3e=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},O3e=function(e,r){return[].concat(e,r)},C3e=function(e,r){if(Wa(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(r(e[i]));return n}return r(e)};Gq.exports={arrayToObject:Vq,assign:b3e,combine:O3e,compact:E3e,decode:_3e,encode:w3e,isBuffer:x3e,isRegExp:S3e,maybeMap:C3e,merge:v3e}});var Xq=_((_Fe,Qq)=>{"use strict";var Zq=Hq(),b6=y6(),yp=Xm(),A3e=Object.prototype.hasOwnProperty,Kq={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},Ao=Array.isArray,I3e=String.prototype.split,M3e=Array.prototype.push,Jq=function(t,e){M3e.apply(t,Ao(e)?e:[e])},R3e=Date.prototype.toISOString,Yq=yp.default,Ar={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:b6.encode,encodeValuesOnly:!1,format:Yq,formatter:yp.formatters[Yq],indices:!1,serializeDate:function(e){return R3e.call(e)},skipNulls:!1,strictNullHandling:!1},T3e=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},v6={},P3e=function t(e,r,n,i,o,s,a,c,u,l,h,d,m,v,x,O){for(var I=e,j=O,k=0,B=!1;(j=j.get(v6))!==void 0&&!B;){var V=j.get(e);if(k+=1,typeof V<"u"){if(V===k)throw new RangeError("Cyclic object value");B=!0}typeof j.get(v6)>"u"&&(k=0)}if(typeof c=="function"?I=c(r,I):I instanceof Date?I=h(I):n==="comma"&&Ao(I)&&(I=b6.maybeMap(I,function(R){return R instanceof Date?h(R):R})),I===null){if(o)return a&&!v?a(r,Ar.encoder,x,"key",d):r;I=""}if(T3e(I)||b6.isBuffer(I)){if(a){var q=v?r:a(r,Ar.encoder,x,"key",d);if(n==="comma"&&v){for(var P=I3e.call(String(I),","),L="",H=0;H<P.length;++H)L+=(H===0?"":",")+m(a(P[H],Ar.encoder,x,"value",d));return[m(q)+(i&&Ao(I)&&P.length===1?"[]":"")+"="+L]}return[m(q)+"="+m(a(I,Ar.encoder,x,"value",d))]}return[m(r)+"="+m(String(I))]}var M=[];if(typeof I>"u")return M;var N;if(n==="comma"&&Ao(I))N=[{value:I.length>0?I.join(",")||null:void 0}];else if(Ao(c))N=c;else{var F=Object.keys(I);N=u?F.sort(u):F}for(var E=i&&Ao(I)&&I.length===1?r+"[]":r,f=0;f<N.length;++f){var g=N[f],y=typeof g=="object"&&typeof g.value<"u"?g.value:I[g];if(!(s&&y===null)){var b=Ao(I)?typeof n=="function"?n(E,g):E:E+(l?"."+g:"["+g+"]");O.set(e,k);var w=Zq();w.set(v6,O),Jq(M,t(y,b,n,i,o,s,a,c,u,l,h,d,m,v,x,w))}}return M},D3e=function(e){if(!e)return Ar;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||Ar.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=yp.default;if(typeof e.format<"u"){if(!A3e.call(yp.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=yp.formatters[n],o=Ar.filter;return(typeof e.filter=="function"||Ao(e.filter))&&(o=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Ar.addQueryPrefix,allowDots:typeof e.allowDots>"u"?Ar.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Ar.charsetSentinel,delimiter:typeof e.delimiter>"u"?Ar.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Ar.encode,encoder:typeof e.encoder=="function"?e.encoder:Ar.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Ar.encodeValuesOnly,filter:o,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Ar.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Ar.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Ar.strictNullHandling}};Qq.exports=function(t,e){var r=t,n=D3e(e),i,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):Ao(n.filter)&&(o=n.filter,i=o);var s=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in Kq?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=Kq[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=c==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var l=Zq(),h=0;h<i.length;++h){var d=i[h];n.skipNulls&&r[d]===null||Jq(s,P3e(r[d],d,c,u,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}var m=s.join(n.delimiter),v=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),m.length>0?v+m:""}});var rF=_((wFe,tF)=>{"use strict";var Ju=y6(),_6=Object.prototype.hasOwnProperty,N3e=Array.isArray,wr={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Ju.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},k3e=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},eF=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},L3e="utf8=%26%2310003%3B",j3e="utf8=%E2%9C%93",B3e=function(e,r){var n={},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=r.parameterLimit===1/0?void 0:r.parameterLimit,s=i.split(r.delimiter,o),a=-1,c,u=r.charset;if(r.charsetSentinel)for(c=0;c<s.length;++c)s[c].indexOf("utf8=")===0&&(s[c]===j3e?u="utf-8":s[c]===L3e&&(u="iso-8859-1"),a=c,c=s.length);for(c=0;c<s.length;++c)if(c!==a){var l=s[c],h=l.indexOf("]="),d=h===-1?l.indexOf("="):h+1,m,v;d===-1?(m=r.decoder(l,wr.decoder,u,"key"),v=r.strictNullHandling?null:""):(m=r.decoder(l.slice(0,d),wr.decoder,u,"key"),v=Ju.maybeMap(eF(l.slice(d+1),r),function(x){return r.decoder(x,wr.decoder,u,"value")})),v&&r.interpretNumericEntities&&u==="iso-8859-1"&&(v=k3e(v)),l.indexOf("[]=")>-1&&(v=N3e(v)?[v]:v),_6.call(n,m)?n[m]=Ju.combine(n[m],v):n[m]=v}return n},q3e=function(t,e,r,n){for(var i=n?e:eF(e,r),o=t.length-1;o>=0;--o){var s,a=t[o];if(a==="[]"&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,u=parseInt(c,10);!r.parseArrays&&c===""?s={0:i}:!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(s=[],s[u]=i):c!=="__proto__"&&(s[c]=i)}i=s}return i},F3e=function(e,r,n,i){if(!!e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=n.depth>0&&s.exec(o),u=c?o.slice(0,c.index):o,l=[];if(u){if(!n.plainObjects&&_6.call(Object.prototype,u)&&!n.allowPrototypes)return;l.push(u)}for(var h=0;n.depth>0&&(c=a.exec(o))!==null&&h<n.depth;){if(h+=1,!n.plainObjects&&_6.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(c[1])}return c&&l.push("["+o.slice(c.index)+"]"),q3e(l,r,n,i)}},U3e=function(e){if(!e)return wr;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?wr.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?wr.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:wr.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:wr.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:wr.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:wr.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:wr.comma,decoder:typeof e.decoder=="function"?e.decoder:wr.decoder,delimiter:typeof e.delimiter=="string"||Ju.isRegExp(e.delimiter)?e.delimiter:wr.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:wr.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:wr.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:wr.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:wr.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:wr.strictNullHandling}};tF.exports=function(t,e){var r=U3e(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?B3e(t,r):t,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),s=0;s<o.length;++s){var a=o[s],c=F3e(a,n[a],r,typeof t=="string");i=Ju.merge(i,c,r)}return r.allowSparse===!0?i:Ju.compact(i)}});var iF=_((EFe,nF)=>{"use strict";var $3e=Xq(),W3e=rF(),H3e=Xm();nF.exports={formats:H3e,parse:W3e,stringify:$3e}});var bp=_(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.ProviderType=Ir.RegExpString=Ir.IntNumber=Ir.BigIntString=Ir.AddressString=Ir.HexString=Ir.OpaqueType=void 0;function vp(){return t=>t}Ir.OpaqueType=vp;Ir.HexString=vp();Ir.AddressString=vp();Ir.BigIntString=vp();function z3e(t){return Math.floor(t)}Ir.IntNumber=z3e;Ir.RegExpString=vp();var V3e;(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(V3e=Ir.ProviderType||(Ir.ProviderType={}))});var Io=_(we=>{"use strict";var G3e=we&&we.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(we,"__esModule",{value:!0});we.isInIFrame=we.createQrUrl=we.getFavicon=we.range=we.isBigNumber=we.ensureParsedJSONObject=we.ensureBN=we.ensureRegExpString=we.ensureIntNumber=we.ensureBuffer=we.ensureAddressString=we.ensureEvenLengthHexString=we.ensureHexString=we.isHexString=we.prepend0x=we.strip0x=we.has0xPrefix=we.hexStringFromIntNumber=we.intNumberFromHexString=we.bigIntStringFromBN=we.hexStringFromBuffer=we.hexStringToUint8Array=we.uint8ArrayToHex=we.randomBytesHex=void 0;var ms=G3e(Eh()),K3e=iF(),jn=bp(),oF=/^[0-9]*$/,sF=/^[a-f0-9]*$/;function Y3e(t){return aF(crypto.getRandomValues(new Uint8Array(t)))}we.randomBytesHex=Y3e;function aF(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}we.uint8ArrayToHex=aF;function Z3e(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}we.hexStringToUint8Array=Z3e;function J3e(t,e=!1){let r=t.toString("hex");return(0,jn.HexString)(e?"0x"+r:r)}we.hexStringFromBuffer=J3e;function Q3e(t){return(0,jn.BigIntString)(t.toString(10))}we.bigIntStringFromBN=Q3e;function X3e(t){return(0,jn.IntNumber)(new ms.default(wp(t,!1),16).toNumber())}we.intNumberFromHexString=X3e;function e5e(t){return(0,jn.HexString)("0x"+new ms.default(t).toString(16))}we.hexStringFromIntNumber=e5e;function w6(t){return t.startsWith("0x")||t.startsWith("0X")}we.has0xPrefix=w6;function ey(t){return w6(t)?t.slice(2):t}we.strip0x=ey;function cF(t){return w6(t)?"0x"+t.slice(2):"0x"+t}we.prepend0x=cF;function _p(t){if(typeof t!="string")return!1;let e=ey(t).toLowerCase();return sF.test(e)}we.isHexString=_p;function uF(t,e=!1){if(typeof t=="string"){let r=ey(t).toLowerCase();if(sF.test(r))return(0,jn.HexString)(e?"0x"+r:r)}throw new Error(`"${String(t)}" is not a hexadecimal string`)}we.ensureHexString=uF;function wp(t,e=!1){let r=uF(t,!1);return r.length%2===1&&(r=(0,jn.HexString)("0"+r)),e?(0,jn.HexString)("0x"+r):r}we.ensureEvenLengthHexString=wp;function t5e(t){if(typeof t=="string"){let e=ey(t).toLowerCase();if(_p(e)&&e.length===40)return(0,jn.AddressString)(cF(e))}throw new Error(`Invalid Ethereum address: ${String(t)}`)}we.ensureAddressString=t5e;function r5e(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string")if(_p(t)){let e=wp(t,!1);return Buffer.from(e,"hex")}else return Buffer.from(t,"utf8");throw new Error(`Not binary data: ${String(t)}`)}we.ensureBuffer=r5e;function lF(t){if(typeof t=="number"&&Number.isInteger(t))return(0,jn.IntNumber)(t);if(typeof t=="string"){if(oF.test(t))return(0,jn.IntNumber)(Number(t));if(_p(t))return(0,jn.IntNumber)(new ms.default(wp(t,!1),16).toNumber())}throw new Error(`Not an integer: ${String(t)}`)}we.ensureIntNumber=lF;function n5e(t){if(t instanceof RegExp)return(0,jn.RegExpString)(t.toString());throw new Error(`Not a RegExp: ${String(t)}`)}we.ensureRegExpString=n5e;function i5e(t){if(t!==null&&(ms.default.isBN(t)||fF(t)))return new ms.default(t.toString(10),10);if(typeof t=="number")return new ms.default(lF(t));if(typeof t=="string"){if(oF.test(t))return new ms.default(t,10);if(_p(t))return new ms.default(wp(t,!1),16)}throw new Error(`Not an integer: ${String(t)}`)}we.ensureBN=i5e;function o5e(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw new Error(`Not a JSON string or an object: ${String(t)}`)}we.ensureParsedJSONObject=o5e;function fF(t){if(t==null||typeof t.constructor!="function")return!1;let{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}we.isBigNumber=fF;function s5e(t,e){return Array.from({length:e-t},(r,n)=>t+n)}we.range=s5e;function a5e(){let t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}we.getFavicon=a5e;function c5e(t,e,r,n,i,o){let s=n?"parent-id":"id",a=(0,K3e.stringify)({[s]:t,secret:e,server:r,v:i,chainId:o});return`${r}/#/link?${a}`}we.createQrUrl=c5e;function u5e(){try{return window.frameElement!==null}catch{return!1}}we.isInIFrame=u5e});var ry=_(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.Session=void 0;var l5e=Ta(),hF=sp(),dF=QB(),pF=Io(),E6="session:id",gF="session:secret",mF="session:linked",Ep=class{constructor(e,r,n,i){this._storage=e,this._id=r||(0,pF.randomBytesHex)(16),this._secret=n||(0,pF.randomBytesHex)(32),this._key=new dF.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){let r=e.getItem(E6),n=e.getItem(mF),i=e.getItem(gF);return r&&i?new Ep(e,r,i,n==="1"):null}static get persistedSessionIdChange$(){return(0,l5e.fromEvent)(window,"storage").pipe((0,hF.filter)(e=>e.key===E6),(0,hF.map)(e=>({oldValue:e.oldValue||null,newValue:e.newValue||null})))}static hash(e){return new dF.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(E6,this._id),this._storage.setItem(gF,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(mF,this._linked?"1":"0")}};ty.Session=Ep});var x6=_(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.WalletSDKRelayAbstract=Ti.APP_VERSION_KEY=Ti.LOCAL_STORAGE_ADDRESSES_KEY=Ti.WALLET_USER_NAME_KEY=void 0;var yF=nm();Ti.WALLET_USER_NAME_KEY="walletUsername";Ti.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Ti.APP_VERSION_KEY="AppVersion";var S6=class{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw yF.ethErrors.rpc.parse({});let i=n,{error:o}=i;if(o)throw(0,yF.serializeError)(o);return i})}};Ti.WalletSDKRelayAbstract=S6});var O6=_((AFe,vF)=>{vF.exports=yn().EventEmitter});var C6=_(()=>{});var EF=_((RFe,wF)=>{"use strict";function bF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function f5e(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bF(Object(r),!0).forEach(function(n){h5e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function h5e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d5e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _F(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function p5e(t,e,r){return e&&_F(t.prototype,e),r&&_F(t,r),t}var g5e=su(),ny=g5e.Buffer,m5e=C6(),A6=m5e.inspect,y5e=A6&&A6.custom||"inspect";function v5e(t,e,r){ny.prototype.copy.call(t,e,r)}wF.exports=function(){function t(){d5e(this,t),this.head=null,this.tail=null,this.length=0}return p5e(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return ny.alloc(0);for(var n=ny.allocUnsafe(r>>>0),i=this.head,o=0;i;)v5e(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=ny.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,a),r-=a,r===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n}},{key:y5e,value:function(r,n){return A6(this,f5e({},n,{depth:0,customInspect:!1}))}}]),t}()});var M6=_((TFe,xF)=>{"use strict";function b5e(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(I6,this,t)):process.nextTick(I6,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(iy,r):(r._writableState.errorEmitted=!0,process.nextTick(SF,r,o)):process.nextTick(SF,r,o):e?(process.nextTick(iy,r),e(o)):process.nextTick(iy,r)}),this)}function SF(t,e){I6(t,e),iy(t)}function iy(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function _5e(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function I6(t,e){t.emit("error",e)}function w5e(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}xF.exports={destroy:b5e,undestroy:_5e,errorOrDestroy:w5e}});var Ha=_((PFe,AF)=>{"use strict";function E5e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var CF={};function Bn(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}var i=function(o){E5e(s,o);function s(a,c,u){return o.call(this,n(a,c,u))||this}return s}(r);i.prototype.name=r.name,i.prototype.code=t,CF[t]=i}function OF(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function S5e(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function x5e(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function O5e(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}Bn("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);Bn("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&S5e(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(x5e(t," argument"))i="The ".concat(t," ").concat(n," ").concat(OF(e,"type"));else{var o=O5e(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(o," ").concat(n," ").concat(OF(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);Bn("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Bn("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});Bn("ERR_STREAM_PREMATURE_CLOSE","Premature close");Bn("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});Bn("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Bn("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Bn("ERR_STREAM_WRITE_AFTER_END","write after end");Bn("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Bn("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);Bn("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");AF.exports.codes=CF});var R6=_((DFe,IF)=>{"use strict";var C5e=Ha().codes.ERR_INVALID_OPT_VALUE;function A5e(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function I5e(t,e,r,n){var i=A5e(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new C5e(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}IF.exports={getHighWaterMark:I5e}});var RF=_((NFe,MF)=>{MF.exports=M5e;function M5e(t,e){if(T6("noDeprecation"))return t;var r=!1;function n(){if(!r){if(T6("throwDeprecation"))throw new Error(e);T6("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function T6(t){try{if(!global.localStorage)return!1}catch{return!1}var e=global.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}});var N6=_((kFe,LF)=>{"use strict";LF.exports=Xt;function PF(t){var e=this;this.next=null,this.entry=null,this.finish=function(){r4e(e,t)}}var Qu;Xt.WritableState=xp;var R5e={deprecate:RF()},DF=O6(),sy=su().Buffer,T5e=global.Uint8Array||function(){};function P5e(t){return sy.from(t)}function D5e(t){return sy.isBuffer(t)||t instanceof T5e}var D6=M6(),N5e=R6(),k5e=N5e.getHighWaterMark,ys=Ha().codes,L5e=ys.ERR_INVALID_ARG_TYPE,j5e=ys.ERR_METHOD_NOT_IMPLEMENTED,B5e=ys.ERR_MULTIPLE_CALLBACK,q5e=ys.ERR_STREAM_CANNOT_PIPE,F5e=ys.ERR_STREAM_DESTROYED,U5e=ys.ERR_STREAM_NULL_VALUES,$5e=ys.ERR_STREAM_WRITE_AFTER_END,W5e=ys.ERR_UNKNOWN_ENCODING,Xu=D6.errorOrDestroy;xn()(Xt,DF);function H5e(){}function xp(t,e,r){Qu=Qu||za(),t=t||{},typeof r!="boolean"&&(r=e instanceof Qu),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=k5e(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){J5e(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new PF(this)}xp.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(xp.prototype,"buffer",{get:R5e.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var oy;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(oy=Function.prototype[Symbol.hasInstance],Object.defineProperty(Xt,Symbol.hasInstance,{value:function(e){return oy.call(this,e)?!0:this!==Xt?!1:e&&e._writableState instanceof xp}})):oy=function(e){return e instanceof this};function Xt(t){Qu=Qu||za();var e=this instanceof Qu;if(!e&&!oy.call(Xt,this))return new Xt(t);this._writableState=new xp(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),DF.call(this)}Xt.prototype.pipe=function(){Xu(this,new q5e)};function z5e(t,e){var r=new $5e;Xu(t,r),process.nextTick(e,r)}function V5e(t,e,r,n){var i;return r===null?i=new U5e:typeof r!="string"&&!e.objectMode&&(i=new L5e("chunk",["string","Buffer"],r)),i?(Xu(t,i),process.nextTick(n,i),!1):!0}Xt.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&D5e(t);return o&&!sy.isBuffer(t)&&(t=P5e(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=H5e),n.ending?z5e(this,r):(o||V5e(this,n,t,r))&&(n.pendingcb++,i=K5e(this,n,o,t,e,r)),i};Xt.prototype.cork=function(){this._writableState.corked++};Xt.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&NF(this,t))};Xt.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new W5e(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Xt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function G5e(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=sy.from(e,r)),e}Object.defineProperty(Xt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function K5e(t,e,r,n,i,o){if(!r){var s=G5e(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else P6(t,e,!1,a,n,i,o);return c}function P6(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new F5e("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function Y5e(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(Sp,t,e),t._writableState.errorEmitted=!0,Xu(t,n)):(i(n),t._writableState.errorEmitted=!0,Xu(t,n),Sp(t,e))}function Z5e(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function J5e(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new B5e;if(Z5e(r),e)Y5e(t,r,n,e,i);else{var o=kF(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&NF(t,r),n?process.nextTick(TF,t,r,o,i):TF(t,r,o,i)}}function TF(t,e,r,n){r||Q5e(t,e),e.pendingcb--,n(),Sp(t,e)}function Q5e(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function NF(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,P6(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new PF(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,u=r.encoding,l=r.callback,h=e.objectMode?1:c.length;if(P6(t,e,!1,h,c,u,l),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Xt.prototype._write=function(t,e,r){r(new j5e("_write()"))};Xt.prototype._writev=null;Xt.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||t4e(this,n,r),this};Object.defineProperty(Xt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function kF(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function X5e(t,e){t._final(function(r){e.pendingcb--,r&&Xu(t,r),e.prefinished=!0,t.emit("prefinish"),Sp(t,e)})}function e4e(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(X5e,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function Sp(t,e){var r=kF(e);if(r&&(e4e(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function t4e(t,e,r){e.ending=!0,Sp(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function r4e(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(Xt.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}});Xt.prototype.destroy=D6.destroy;Xt.prototype._undestroy=D6.undestroy;Xt.prototype._destroy=function(t,e){e(t)}});var za=_((LFe,BF)=>{"use strict";var n4e=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};BF.exports=Pi;var jF=j6(),L6=N6();xn()(Pi,jF);for(k6=n4e(L6.prototype),ay=0;ay<k6.length;ay++)cy=k6[ay],Pi.prototype[cy]||(Pi.prototype[cy]=L6.prototype[cy]);var k6,cy,ay;function Pi(t){if(!(this instanceof Pi))return new Pi(t);jF.call(this,t),L6.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",i4e)))}Object.defineProperty(Pi.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Pi.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Pi.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function i4e(){this._writableState.ended||process.nextTick(o4e,this)}function o4e(t){t.end()}Object.defineProperty(Pi.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var F6=_(FF=>{"use strict";var q6=Oo().Buffer,qF=q6.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s4e(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function a4e(t){var e=s4e(t);if(typeof e!="string"&&(q6.isEncoding===qF||!qF(t)))throw new Error("Unknown encoding: "+t);return e||t}FF.StringDecoder=Op;function Op(t){this.encoding=a4e(t);var e;switch(this.encoding){case"utf16le":this.text=d4e,this.end=p4e,e=4;break;case"utf8":this.fillLast=l4e,e=4;break;case"base64":this.text=g4e,this.end=m4e,e=3;break;default:this.write=y4e,this.end=v4e;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=q6.allocUnsafe(e)}Op.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Op.prototype.end=h4e;Op.prototype.text=f4e;Op.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function B6(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function c4e(t,e,r){var n=e.length-1;if(n<r)return 0;var i=B6(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=B6(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=B6(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function u4e(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function l4e(t){var e=this.lastTotal-this.lastNeed,r=u4e(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function f4e(t,e){var r=c4e(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function h4e(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function d4e(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function p4e(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function g4e(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function m4e(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function y4e(t){return t.toString(this.encoding)}function v4e(t){return t&&t.length?this.write(t):""}});var uy=_((BFe,WF)=>{"use strict";var UF=Ha().codes.ERR_STREAM_PREMATURE_CLOSE;function b4e(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function _4e(){}function w4e(t){return t.setHeader&&typeof t.abort=="function"}function $F(t,e,r){if(typeof e=="function")return $F(t,null,e);e||(e={}),r=b4e(r||_4e);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){i=!1,s=!0,n||r.call(t)},c=t._readableState&&t._readableState.endEmitted,u=function(){n=!1,c=!0,i||r.call(t)},l=function(v){r.call(t,v)},h=function(){var v;if(n&&!c)return(!t._readableState||!t._readableState.ended)&&(v=new UF),r.call(t,v);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(v=new UF),r.call(t,v)},d=function(){t.req.on("finish",a)};return w4e(t)?(t.on("complete",a),t.on("abort",h),t.req?d():t.on("request",d)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",u),t.on("finish",a),e.error!==!1&&t.on("error",l),t.on("close",h),function(){t.removeListener("complete",a),t.removeListener("abort",h),t.removeListener("request",d),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",u),t.removeListener("error",l),t.removeListener("close",h)}}WF.exports=$F});var zF=_((qFe,HF)=>{"use strict";var ly;function vs(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var E4e=uy(),bs=Symbol("lastResolve"),Va=Symbol("lastReject"),Cp=Symbol("error"),fy=Symbol("ended"),Ga=Symbol("lastPromise"),U6=Symbol("handlePromise"),Ka=Symbol("stream");function _s(t,e){return{value:t,done:e}}function S4e(t){var e=t[bs];if(e!==null){var r=t[Ka].read();r!==null&&(t[Ga]=null,t[bs]=null,t[Va]=null,e(_s(r,!1)))}}function x4e(t){process.nextTick(S4e,t)}function O4e(t,e){return function(r,n){t.then(function(){if(e[fy]){r(_s(void 0,!0));return}e[U6](r,n)},n)}}var C4e=Object.getPrototypeOf(function(){}),A4e=Object.setPrototypeOf((ly={get stream(){return this[Ka]},next:function(){var e=this,r=this[Cp];if(r!==null)return Promise.reject(r);if(this[fy])return Promise.resolve(_s(void 0,!0));if(this[Ka].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[Cp]?a(e[Cp]):s(_s(void 0,!0))})});var n=this[Ga],i;if(n)i=new Promise(O4e(n,this));else{var o=this[Ka].read();if(o!==null)return Promise.resolve(_s(o,!1));i=new Promise(this[U6])}return this[Ga]=i,i}},vs(ly,Symbol.asyncIterator,function(){return this}),vs(ly,"return",function(){var e=this;return new Promise(function(r,n){e[Ka].destroy(null,function(i){if(i){n(i);return}r(_s(void 0,!0))})})}),ly),C4e),I4e=function(e){var r,n=Object.create(A4e,(r={},vs(r,Ka,{value:e,writable:!0}),vs(r,bs,{value:null,writable:!0}),vs(r,Va,{value:null,writable:!0}),vs(r,Cp,{value:null,writable:!0}),vs(r,fy,{value:e._readableState.endEmitted,writable:!0}),vs(r,U6,{value:function(o,s){var a=n[Ka].read();a?(n[Ga]=null,n[bs]=null,n[Va]=null,o(_s(a,!1))):(n[bs]=o,n[Va]=s)},writable:!0}),r));return n[Ga]=null,E4e(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Va];o!==null&&(n[Ga]=null,n[bs]=null,n[Va]=null,o(i)),n[Cp]=i;return}var s=n[bs];s!==null&&(n[Ga]=null,n[bs]=null,n[Va]=null,s(_s(void 0,!0))),n[fy]=!0}),e.on("readable",x4e.bind(null,n)),n};HF.exports=I4e});var GF=_((FFe,VF)=>{VF.exports=function(){throw new Error("Readable.from is not available in the browser")}});var j6=_(($Fe,nU)=>{"use strict";nU.exports=Ye;var el;Ye.ReadableState=JF;var UFe=yn().EventEmitter,ZF=function(e,r){return e.listeners(r).length},Ip=O6(),hy=su().Buffer,M4e=global.Uint8Array||function(){};function R4e(t){return hy.from(t)}function T4e(t){return hy.isBuffer(t)||t instanceof M4e}var $6=C6(),Be;$6&&$6.debuglog?Be=$6.debuglog("stream"):Be=function(){};var P4e=EF(),Y6=M6(),D4e=R6(),N4e=D4e.getHighWaterMark,dy=Ha().codes,k4e=dy.ERR_INVALID_ARG_TYPE,L4e=dy.ERR_STREAM_PUSH_AFTER_EOF,j4e=dy.ERR_METHOD_NOT_IMPLEMENTED,B4e=dy.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,tl,W6,H6;xn()(Ye,Ip);var Ap=Y6.errorOrDestroy,z6=["error","close","destroy","pause","resume"];function q4e(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function JF(t,e,r){el=el||za(),t=t||{},typeof r!="boolean"&&(r=e instanceof el),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=N4e(this,t,"readableHighWaterMark",r),this.buffer=new P4e,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(tl||(tl=F6().StringDecoder),this.decoder=new tl(t.encoding),this.encoding=t.encoding)}function Ye(t){if(el=el||za(),!(this instanceof Ye))return new Ye(t);var e=this instanceof el;this._readableState=new JF(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Ip.call(this)}Object.defineProperty(Ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});Ye.prototype.destroy=Y6.destroy;Ye.prototype._undestroy=Y6.undestroy;Ye.prototype._destroy=function(t,e){e(t)};Ye.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=hy.from(t,e),e=""),n=!0),QF(this,t,e,!1,n)};Ye.prototype.unshift=function(t){return QF(this,t,null,!0,!1)};function QF(t,e,r,n,i){Be("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,$4e(t,o);else{var s;if(i||(s=F4e(o,e)),s)Ap(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==hy.prototype&&(e=R4e(e)),n)o.endEmitted?Ap(t,new B4e):V6(t,o,e,!0);else if(o.ended)Ap(t,new L4e);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?V6(t,o,e,!1):K6(t,o)):V6(t,o,e,!1)}else n||(o.reading=!1,K6(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function V6(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&py(t)),K6(t,e)}function F4e(t,e){var r;return!T4e(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new k4e("chunk",["string","Buffer","Uint8Array"],e)),r}Ye.prototype.isPaused=function(){return this._readableState.flowing===!1};Ye.prototype.setEncoding=function(t){tl||(tl=F6().StringDecoder);var e=new tl(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var KF=1073741824;function U4e(t){return t>=KF?t=KF:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function YF(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=U4e(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Ye.prototype.read=function(t){Be("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return Be("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?G6(this):py(this),null;if(t=YF(t,e),t===0&&e.ended)return e.length===0&&G6(this),null;var n=e.needReadable;Be("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,Be("length less than watermark",n)),e.ended||e.reading?(n=!1,Be("reading or ended",n)):n&&(Be("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=YF(r,e)));var i;return t>0?i=tU(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&G6(this)),i!==null&&this.emit("data",i),i};function $4e(t,e){if(Be("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?py(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,XF(t)))}}function py(t){var e=t._readableState;Be("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(Be("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(XF,t))}function XF(t){var e=t._readableState;Be("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Z6(t)}function K6(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(W4e,t,e))}function W4e(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(Be("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}Ye.prototype._read=function(t){Ap(this,new j4e("_read()"))};Ye.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,Be("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:x;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(O,I){Be("onunpipe"),O===r&&I&&I.hasUnpiped===!1&&(I.hasUnpiped=!0,l())}function a(){Be("onend"),t.end()}var c=H4e(r);t.on("drain",c);var u=!1;function l(){Be("cleanup"),t.removeListener("close",m),t.removeListener("finish",v),t.removeListener("drain",c),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",x),r.removeListener("data",h),u=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&c()}r.on("data",h);function h(O){Be("ondata");var I=t.write(O);Be("dest.write",I),I===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&rU(n.pipes,t)!==-1)&&!u&&(Be("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(O){Be("onerror",O),x(),t.removeListener("error",d),ZF(t,"error")===0&&Ap(t,O)}q4e(t,"error",d);function m(){t.removeListener("finish",v),x()}t.once("close",m);function v(){Be("onfinish"),t.removeListener("close",m),x()}t.once("finish",v);function x(){Be("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(Be("pipe resume"),r.resume()),t};function H4e(t){return function(){var r=t._readableState;Be("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&ZF(t,"data")&&(r.flowing=!0,Z6(t))}}Ye.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=rU(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};Ye.prototype.on=function(t,e){var r=Ip.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,Be("on readable",n.length,n.reading),n.length?py(this):n.reading||process.nextTick(z4e,this)),r};Ye.prototype.addListener=Ye.prototype.on;Ye.prototype.removeListener=function(t,e){var r=Ip.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(eU,this),r};Ye.prototype.removeAllListeners=function(t){var e=Ip.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(eU,this),e};function eU(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function z4e(t){Be("readable nexttick read 0"),t.read(0)}Ye.prototype.resume=function(){var t=this._readableState;return t.flowing||(Be("resume"),t.flowing=!t.readableListening,V4e(this,t)),t.paused=!1,this};function V4e(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(G4e,t,e))}function G4e(t,e){Be("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Z6(t),e.flowing&&!e.reading&&t.read(0)}Ye.prototype.pause=function(){return Be("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Be("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Z6(t){var e=t._readableState;for(Be("flow",e.flowing);e.flowing&&t.read()!==null;);}Ye.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(Be("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(Be("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var o=0;o<z6.length;o++)t.on(z6[o],this.emit.bind(this,z6[o]));return this._read=function(s){Be("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(Ye.prototype[Symbol.asyncIterator]=function(){return W6===void 0&&(W6=zF()),W6(this)});Object.defineProperty(Ye.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Ye.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Ye.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});Ye._fromList=tU;Object.defineProperty(Ye.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function tU(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function G6(t){var e=t._readableState;Be("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(K4e,e,t))}function K4e(t,e){if(Be("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(Ye.from=function(t,e){return H6===void 0&&(H6=GF()),H6(Ye,t,e)});function rU(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var J6=_((WFe,oU)=>{"use strict";oU.exports=Mo;var gy=Ha().codes,Y4e=gy.ERR_METHOD_NOT_IMPLEMENTED,Z4e=gy.ERR_MULTIPLE_CALLBACK,J4e=gy.ERR_TRANSFORM_ALREADY_TRANSFORMING,Q4e=gy.ERR_TRANSFORM_WITH_LENGTH_0,my=za();xn()(Mo,my);function X4e(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Z4e);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Mo(t){if(!(this instanceof Mo))return new Mo(t);my.call(this,t),this._transformState={afterTransform:X4e.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",eEe)}function eEe(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){iU(t,e,r)}):iU(this,null,null)}Mo.prototype.push=function(t,e){return this._transformState.needTransform=!1,my.prototype.push.call(this,t,e)};Mo.prototype._transform=function(t,e,r){r(new Y4e("_transform()"))};Mo.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Mo.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Mo.prototype._destroy=function(t,e){my.prototype._destroy.call(this,t,function(r){e(r)})};function iU(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new Q4e;if(t._transformState.transforming)throw new J4e;return t.push(null)}});var cU=_((HFe,aU)=>{"use strict";aU.exports=Mp;var sU=J6();xn()(Mp,sU);function Mp(t){if(!(this instanceof Mp))return new Mp(t);sU.call(this,t)}Mp.prototype._transform=function(t,e,r){r(null,t)}});var dU=_((zFe,hU)=>{"use strict";var Q6;function tEe(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var fU=Ha().codes,rEe=fU.ERR_MISSING_ARGS,nEe=fU.ERR_STREAM_DESTROYED;function uU(t){if(t)throw t}function iEe(t){return t.setHeader&&typeof t.abort=="function"}function oEe(t,e,r,n){n=tEe(n);var i=!1;t.on("close",function(){i=!0}),Q6===void 0&&(Q6=uy()),Q6(t,{readable:e,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,iEe(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new nEe("pipe"))}}}function lU(t){t()}function sEe(t,e){return t.pipe(e)}function aEe(t){return!t.length||typeof t[t.length-1]!="function"?uU:t.pop()}function cEe(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=aEe(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new rEe("streams");var i,o=e.map(function(s,a){var c=a<e.length-1,u=a>0;return oEe(s,c,u,function(l){i||(i=l),l&&o.forEach(lU),!c&&(o.forEach(lU),n(i))})});return e.reduce(sEe)}hU.exports=cEe});var X6=_((qn,pU)=>{qn=pU.exports=j6();qn.Stream=qn;qn.Readable=qn;qn.Writable=N6();qn.Duplex=za();qn.Transform=J6();qn.PassThrough=cU();qn.finished=uy();qn.pipeline=dU()});var yU=_((VFe,mU)=>{var{Transform:uEe}=X6();mU.exports=t=>class gU extends uEe{constructor(r,n,i,o,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=o,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let o=null;try{this.update(r,n)}catch(s){o=s}i(o)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){let r=new gU(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}}});var _U=_((GFe,bU)=>{var{Transform:lEe}=X6();bU.exports=t=>class vU extends lEe{constructor(r,n,i,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=o,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let o=null;try{this.update(r,n)}catch(s){o=s}i(o)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){let r=new vU(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}}});var EU=_((KFe,wU)=>{var fEe=yU(),hEe=_U();wU.exports=function(t){let e=fEe(t),r=hEe(t);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}}});var OU=_(xU=>{var SU=[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];xU.p1600=function(t){for(let e=0;e<24;++e){let r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],o=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],u=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49],d=l^(i<<1|o>>>31),m=h^(o<<1|i>>>31),v=t[0]^d,x=t[1]^m,O=t[10]^d,I=t[11]^m,j=t[20]^d,k=t[21]^m,B=t[30]^d,V=t[31]^m,q=t[40]^d,P=t[41]^m;d=r^(s<<1|a>>>31),m=n^(a<<1|s>>>31);let L=t[2]^d,H=t[3]^m,M=t[12]^d,N=t[13]^m,F=t[22]^d,E=t[23]^m,f=t[32]^d,g=t[33]^m,y=t[42]^d,b=t[43]^m;d=i^(c<<1|u>>>31),m=o^(u<<1|c>>>31);let w=t[4]^d,R=t[5]^m,T=t[14]^d,S=t[15]^m,p=t[24]^d,A=t[25]^m,Y=t[34]^d,Z=t[35]^m,G=t[44]^d,X=t[45]^m;d=s^(l<<1|h>>>31),m=a^(h<<1|l>>>31);let ae=t[6]^d,fe=t[7]^m,Ee=t[16]^d,he=t[17]^m,de=t[26]^d,Te=t[27]^m,ye=t[36]^d,ve=t[37]^m,tn=t[46]^d,qt=t[47]^m;d=c^(r<<1|n>>>31),m=u^(n<<1|r>>>31);let mt=t[8]^d,si=t[9]^m,at=t[18]^d,ct=t[19]^m,Bi=t[28]^d,yt=t[29]^m,vt=t[38]^d,Po=t[39]^m,bt=t[48]^d,_t=t[49]^m,qi=v,ut=x,lt=I<<4|O>>>28,Fi=O<<4|I>>>28,ft=j<<3|k>>>29,ht=k<<3|j>>>29,Ui=V<<9|B>>>23,rt=B<<9|V>>>23,wt=q<<18|P>>>14,Do=P<<18|q>>>14,nt=L<<1|H>>>31,dt=H<<1|L>>>31,No=N<<12|M>>>20,Ke=M<<12|N>>>20,Et=F<<10|E>>>22,ko=E<<10|F>>>22,pt=g<<13|f>>>19,St=f<<13|g>>>19,Lo=y<<2|b>>>30,xt=b<<2|y>>>30,Ot=R<<30|w>>>2,jo=w<<30|R>>>2,Ct=T<<6|S>>>26,At=S<<6|T>>>26,Bo=A<<11|p>>>21,It=p<<11|A>>>21,Mt=Y<<15|Z>>>17,$i=Z<<15|Y>>>17,Rt=X<<29|G>>>3,Tt=G<<29|X>>>3,qo=ae<<28|fe>>>4,Pt=fe<<28|ae>>>4,Dt=he<<23|Ee>>>9,Fo=Ee<<23|he>>>9,Nt=de<<25|Te>>>7,kt=Te<<25|de>>>7,Wi=ye<<21|ve>>>11,Hi=ve<<21|ye>>>11,zi=qt<<24|tn>>>8,Vi=tn<<24|qt>>>8,Gi=mt<<27|si>>>5,Ki=si<<27|mt>>>5,Yi=at<<20|ct>>>12,ai=ct<<20|at>>>12,pn=yt<<7|Bi>>>25,ci=Bi<<7|yt>>>25,rn=vt<<8|Po>>>24,Zi=Po<<8|vt>>>24,In=bt<<14|_t>>>18,Kn=_t<<14|bt>>>18;t[0]=qi^~No&Bo,t[1]=ut^~Ke&It,t[10]=qo^~Yi&ft,t[11]=Pt^~ai&ht,t[20]=nt^~Ct&Nt,t[21]=dt^~At&kt,t[30]=Gi^~lt&Et,t[31]=Ki^~Fi&ko,t[40]=Ot^~Dt&pn,t[41]=jo^~Fo&ci,t[2]=No^~Bo&Wi,t[3]=Ke^~It&Hi,t[12]=Yi^~ft&pt,t[13]=ai^~ht&St,t[22]=Ct^~Nt&rn,t[23]=At^~kt&Zi,t[32]=lt^~Et&Mt,t[33]=Fi^~ko&$i,t[42]=Dt^~pn&Ui,t[43]=Fo^~ci&rt,t[4]=Bo^~Wi&In,t[5]=It^~Hi&Kn,t[14]=ft^~pt&Rt,t[15]=ht^~St&Tt,t[24]=Nt^~rn&wt,t[25]=kt^~Zi&Do,t[34]=Et^~Mt&zi,t[35]=ko^~$i&Vi,t[44]=pn^~Ui&Lo,t[45]=ci^~rt&xt,t[6]=Wi^~In&qi,t[7]=Hi^~Kn&ut,t[16]=pt^~Rt&qo,t[17]=St^~Tt&Pt,t[26]=rn^~wt&nt,t[27]=Zi^~Do&dt,t[36]=Mt^~zi&Gi,t[37]=$i^~Vi&Ki,t[46]=Ui^~Lo&Ot,t[47]=rt^~xt&jo,t[8]=In^~qi&No,t[9]=Kn^~ut&Ke,t[18]=Rt^~qo&Yi,t[19]=Tt^~Pt&ai,t[28]=wt^~nt&Ct,t[29]=Do^~dt&At,t[38]=zi^~Gi&lt,t[39]=Vi^~Ki&Fi,t[48]=Lo^~Ot&Dt,t[49]=xt^~jo&Fo,t[0]^=SU[e*2],t[1]^=SU[e*2+1]}}});var AU=_((ZFe,CU)=>{var yy=OU();function rl(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}rl.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};rl.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(yy.p1600(this.state),this.count=0)};rl.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<8*(this.count%4),(t&128)!==0&&this.count===this.blockSize-1&&yy.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),yy.p1600(this.state),this.count=0,this.squeezing=!0};rl.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);let e=Buffer.alloc(t);for(let r=0;r<t;++r)e[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(yy.p1600(this.state),this.count=0);return e};rl.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};CU.exports=rl});var MU=_((JFe,IU)=>{IU.exports=EU()(AU())});var eS=_((QFe,NU)=>{var dEe=MU(),pEe=Eh();function RU(t){return Buffer.allocUnsafe(t).fill(0)}function TU(t,e,r){let n=RU(e);return t=vy(t),r?t.length<e?(t.copy(n),n):t.slice(0,e):t.length<e?(t.copy(n,e-t.length),n):t.slice(-e)}function gEe(t,e){return TU(t,e,!0)}function vy(t){if(!Buffer.isBuffer(t))if(Array.isArray(t))t=Buffer.from(t);else if(typeof t=="string")PU(t)?t=Buffer.from(vEe(DU(t)),"hex"):t=Buffer.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=Buffer.allocUnsafe(0);else if(pEe.isBN(t))t=t.toArrayLike(Buffer);else if(t.toArray)t=Buffer.from(t.toArray());else throw new Error("invalid type");return t}function mEe(t){return t=vy(t),"0x"+t.toString("hex")}function yEe(t,e){return t=vy(t),e||(e=256),dEe("keccak"+e).update(t).digest()}function vEe(t){return t.length%2?"0"+t:t}function PU(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function DU(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}NU.exports={zeros:RU,setLength:TU,setLengthRight:gEe,isHexString:PU,stripHexPrefix:DU,toBuffer:vy,bufferToHex:mEe,keccak:yEe}});var FU=_((XFe,qU)=>{var Ja=eS(),Za=Eh();function LU(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function nl(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function kU(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function jU(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function Ya(t){var e=typeof t;if(e==="string")return Ja.isHexString(t)?new Za(Ja.stripHexPrefix(t),16):new Za(t,10);if(e==="number")return new Za(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function Di(t,e){var r,n,i,o;if(t==="address")return Di("uint160",Ya(e));if(t==="bool")return Di("uint8",e?1:0);if(t==="string")return Di("bytes",new Buffer(e,"utf8"));if(_Ee(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(r=jU(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(o in e)i.push(Di(t,e[o]));if(r==="dynamic"){var s=Di("uint256",e.length);i.unshift(s)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([Di("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,Ja.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=nl(t),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return Ja.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=nl(t),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Ya(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(t.startsWith("int")){if(r=nl(t),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Ya(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=kU(t),n=Ya(e),n<0)throw new Error("Supplied ufixed is negative");return Di("uint256",n.mul(new Za(2).pow(new Za(r[1]))))}else if(t.startsWith("fixed"))return r=kU(t),Di("int256",Ya(e).mul(new Za(2).pow(new Za(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function bEe(t){return t==="string"||t==="bytes"||jU(t)==="dynamic"}function _Ee(t){return t.lastIndexOf("]")===t.length-1}function wEe(t,e){var r=[],n=[],i=32*t.length;for(var o in t){var s=LU(t[o]),a=e[o],c=Di(s,a);bEe(s)?(r.push(Di("uint256",i)),n.push(c),i+=c.length):r.push(c)}return Buffer.concat(r.concat(n))}function BU(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],o=0;o<t.length;o++){var s=LU(t[o]),a=e[o];if(s==="bytes")i.push(a);else if(s==="string")i.push(new Buffer(a,"utf8"));else if(s==="bool")i.push(new Buffer(a?"01":"00","hex"));else if(s==="address")i.push(Ja.setLength(a,20));else if(s.startsWith("bytes")){if(r=nl(s),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(Ja.setLengthRight(a,r))}else if(s.startsWith("uint")){if(r=nl(s),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Ya(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(s.startsWith("int")){if(r=nl(s),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Ya(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+s)}return Buffer.concat(i)}function EEe(t,e){return Ja.keccak(BU(t,e))}qU.exports={rawEncode:wEe,solidityPack:BU,soliditySHA3:EEe}});var WU=_((eUe,$U)=>{var ti=eS(),Rp=FU(),UU={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},tS={encodeData(t,e,r,n=!0){let i=["bytes32"],o=[this.hashType(t,r)];if(n){let s=(a,c,u)=>{if(r[c]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":ti.keccak(this.encodeData(c,u,r,n))];if(u===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",ti.keccak(u)];if(c==="string")return typeof u=="string"&&(u=Buffer.from(u,"utf8")),["bytes32",ti.keccak(u)];if(c.lastIndexOf("]")===c.length-1){let l=c.slice(0,c.lastIndexOf("[")),h=u.map(d=>s(a,l,d));return["bytes32",ti.keccak(Rp.rawEncode(h.map(([d])=>d),h.map(([,d])=>d)))]}return[c,u]};for(let a of r[t]){let[c,u]=s(a.name,a.type,e[a.name]);i.push(c),o.push(u)}}else for(let s of r[t]){let a=e[s.name];if(a!==void 0)if(s.type==="bytes")i.push("bytes32"),a=ti.keccak(a),o.push(a);else if(s.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=ti.keccak(a),o.push(a);else if(r[s.type]!==void 0)i.push("bytes32"),a=ti.keccak(this.encodeData(s.type,a,r,n)),o.push(a);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(s.type),o.push(a)}}return Rp.rawEncode(i,o)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(let i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:s,type:a})=>a+" "+s).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(let n of e[t])for(let i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return ti.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return ti.keccak(this.encodeType(t,e))},sanitizeData(t){let e={};for(let r in UU.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){let r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),ti.keccak(Buffer.concat(n))}};$U.exports={TYPED_MESSAGE_SCHEMA:UU,TypedDataUtils:tS,hashForSignTypedDataLegacy:function(t){return SEe(t.data)},hashForSignTypedData_v3:function(t){return tS.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return tS.hash(t.data)}};function SEe(t){let e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;let r=t.map(function(o){return o.type==="bytes"?ti.toBuffer(o.value):o.value}),n=t.map(function(o){return o.type}),i=t.map(function(o){if(!o.name)throw e;return o.type+" "+o.name});return Rp.soliditySHA3(["bytes32","bytes32"],[Rp.soliditySHA3(new Array(t.length).fill("string"),i),Rp.soliditySHA3(n,r)])}});var KU=_(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.filterFromParam=ol.FilterPolyfill=void 0;var il=bp(),Jr=Io(),xEe=5*60*1e3,Qa={jsonrpc:"2.0",id:0},rS=class{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,il.IntNumber)(1),this.provider=e}async newFilter(e){let r=GU(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.log(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Jr.hexStringFromIntNumber)(n)}async newBlockFilter(){let e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Jr.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){let e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Jr.hexStringFromIntNumber)(e)}uninstallFilter(e){let r=(0,Jr.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){let r=(0,Jr.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(by())}async getFilterLogs(e){let r=(0,Jr.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Qa),{method:"eth_getLogs",params:[HU(n)]})):by()}makeFilterId(){return(0,il.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,o)=>{if(i)return n(i);if(Array.isArray(o)||o==null)return n(new Error(`unexpected response received: ${JSON.stringify(o)}`));r(o)})})}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){let r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return by();let i=await this.getCurrentBlockHeight(),o=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>r.toBlock)return _y();console.log(`Fetching logs from ${n} to ${o} for filter ${e}`);let s=await this.sendAsyncPromise(Object.assign(Object.assign({},Qa),{method:"eth_getLogs",params:[HU(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:o}))]}));if(Array.isArray(s.result)){let a=s.result.map(u=>(0,Jr.intNumberFromHexString)(u.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>n){let u=(0,il.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${n} to ${u}`),this.cursors.set(e,u)}}return s}async getBlockFilterChanges(e){let r=this.cursors.get(e);if(!r)return by();let n=await this.getCurrentBlockHeight();if(r>n)return _y();console.log(`Fetching blocks from ${r} to ${n} for filter (${e})`);let i=(await Promise.all((0,Jr.range)(r,n+1).map(s=>this.getBlockHashByNumber((0,il.IntNumber)(s))))).filter(s=>!!s),o=(0,il.IntNumber)(r+i.length);return console.log(`Moving cursor position for filter (${e}) from ${r} to ${o}`),this.cursors.set(e,o),Object.assign(Object.assign({},Qa),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(_y())}async setInitialCursorPosition(e,r){let n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){let r=this.timeouts.get(e);r&&window.clearTimeout(r);let n=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},xEe);this.timeouts.set(e,n)}async getCurrentBlockHeight(){let{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},Qa),{method:"eth_blockNumber",params:[]}));return(0,Jr.intNumberFromHexString)((0,Jr.ensureHexString)(e))}async getBlockHashByNumber(e){let r=await this.sendAsyncPromise(Object.assign(Object.assign({},Qa),{method:"eth_getBlockByNumber",params:[(0,Jr.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Jr.ensureHexString)(r.result.hash):null}};ol.FilterPolyfill=rS;function GU(t){return{fromBlock:zU(t.fromBlock),toBlock:zU(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}ol.filterFromParam=GU;function HU(t){let e={fromBlock:VU(t.fromBlock),toBlock:VU(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function zU(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,il.IntNumber)(0);if((0,Jr.isHexString)(t))return(0,Jr.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function VU(t){return t==="latest"?t:(0,Jr.hexStringFromIntNumber)(t)}function by(){return Object.assign(Object.assign({},Qa),{error:{code:-32e3,message:"filter not found"}})}function _y(){return Object.assign(Object.assign({},Qa),{result:[]})}});var YU=_(Tp=>{"use strict";Object.defineProperty(Tp,"__esModule",{value:!0});Tp.JSONRPCMethod=void 0;var OEe;(function(t){t.eth_accounts="eth_accounts",t.eth_coinbase="eth_coinbase",t.net_version="net_version",t.eth_chainId="eth_chainId",t.eth_uninstallFilter="eth_uninstallFilter",t.eth_requestAccounts="eth_requestAccounts",t.eth_sign="eth_sign",t.eth_ecRecover="eth_ecRecover",t.personal_sign="personal_sign",t.personal_ecRecover="personal_ecRecover",t.eth_signTransaction="eth_signTransaction",t.eth_sendRawTransaction="eth_sendRawTransaction",t.eth_sendTransaction="eth_sendTransaction",t.eth_signTypedData_v1="eth_signTypedData_v1",t.eth_signTypedData_v2="eth_signTypedData_v2",t.eth_signTypedData_v3="eth_signTypedData_v3",t.eth_signTypedData_v4="eth_signTypedData_v4",t.eth_signTypedData="eth_signTypedData",t.cbWallet_arbitrary="walletlink_arbitrary",t.wallet_addEthereumChain="wallet_addEthereumChain",t.wallet_switchEthereumChain="wallet_switchEthereumChain",t.wallet_watchAsset="wallet_watchAsset",t.eth_subscribe="eth_subscribe",t.eth_unsubscribe="eth_unsubscribe",t.eth_newFilter="eth_newFilter",t.eth_newBlockFilter="eth_newBlockFilter",t.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",t.eth_getFilterChanges="eth_getFilterChanges",t.eth_getFilterLogs="eth_getFilterLogs"})(OEe=Tp.JSONRPCMethod||(Tp.JSONRPCMethod={}))});var nS=_((nUe,JU)=>{"use strict";var ZU=(t,e)=>function(){let r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,o)=>{e.errorFirst?n.push(function(s,a){if(e.multiArgs){let c=new Array(arguments.length-1);for(let u=1;u<arguments.length;u++)c[u-1]=arguments[u];s?(c.unshift(s),o(c)):i(c)}else s?o(s):i(a)}):n.push(function(s){if(e.multiArgs){let a=new Array(arguments.length-1);for(let c=0;c<arguments.length;c++)a[c]=arguments[c];i(a)}else i(s)}),t.apply(this,n)})};JU.exports=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);let r=i=>{let o=s=>typeof s=="string"?i===s:s.test(i);return e.include?e.include.some(o):!e.exclude.some(o)},n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):ZU(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(let i in t){let o=t[i];n[i]=typeof o=="function"&&r(i)?ZU(o,e):o}return n}});var XU=_((iUe,QU)=>{QU.exports=AEe;var CEe=Object.prototype.hasOwnProperty;function AEe(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var n in r)CEe.call(r,n)&&(t[n]=r[n])}return t}});var t$=_((oUe,e$)=>{e$.exports=IEe;function IEe(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}});var iS=_((sUe,r$)=>{var MEe=XU(),REe=t$()();r$.exports=Ie;function Ie(t){let e=this;e.currentProvider=t}Ie.prototype.getBalance=Pp(2,"eth_getBalance");Ie.prototype.getCode=Pp(2,"eth_getCode");Ie.prototype.getTransactionCount=Pp(2,"eth_getTransactionCount");Ie.prototype.getStorageAt=Pp(3,"eth_getStorageAt");Ie.prototype.call=Pp(2,"eth_call");Ie.prototype.protocolVersion=qe("eth_protocolVersion");Ie.prototype.syncing=qe("eth_syncing");Ie.prototype.coinbase=qe("eth_coinbase");Ie.prototype.mining=qe("eth_mining");Ie.prototype.hashrate=qe("eth_hashrate");Ie.prototype.gasPrice=qe("eth_gasPrice");Ie.prototype.accounts=qe("eth_accounts");Ie.prototype.blockNumber=qe("eth_blockNumber");Ie.prototype.getBlockTransactionCountByHash=qe("eth_getBlockTransactionCountByHash");Ie.prototype.getBlockTransactionCountByNumber=qe("eth_getBlockTransactionCountByNumber");Ie.prototype.getUncleCountByBlockHash=qe("eth_getUncleCountByBlockHash");Ie.prototype.getUncleCountByBlockNumber=qe("eth_getUncleCountByBlockNumber");Ie.prototype.sign=qe("eth_sign");Ie.prototype.sendTransaction=qe("eth_sendTransaction");Ie.prototype.sendRawTransaction=qe("eth_sendRawTransaction");Ie.prototype.estimateGas=qe("eth_estimateGas");Ie.prototype.getBlockByHash=qe("eth_getBlockByHash");Ie.prototype.getBlockByNumber=qe("eth_getBlockByNumber");Ie.prototype.getTransactionByHash=qe("eth_getTransactionByHash");Ie.prototype.getTransactionByBlockHashAndIndex=qe("eth_getTransactionByBlockHashAndIndex");Ie.prototype.getTransactionByBlockNumberAndIndex=qe("eth_getTransactionByBlockNumberAndIndex");Ie.prototype.getTransactionReceipt=qe("eth_getTransactionReceipt");Ie.prototype.getUncleByBlockHashAndIndex=qe("eth_getUncleByBlockHashAndIndex");Ie.prototype.getUncleByBlockNumberAndIndex=qe("eth_getUncleByBlockNumberAndIndex");Ie.prototype.getCompilers=qe("eth_getCompilers");Ie.prototype.compileLLL=qe("eth_compileLLL");Ie.prototype.compileSolidity=qe("eth_compileSolidity");Ie.prototype.compileSerpent=qe("eth_compileSerpent");Ie.prototype.newFilter=qe("eth_newFilter");Ie.prototype.newBlockFilter=qe("eth_newBlockFilter");Ie.prototype.newPendingTransactionFilter=qe("eth_newPendingTransactionFilter");Ie.prototype.uninstallFilter=qe("eth_uninstallFilter");Ie.prototype.getFilterChanges=qe("eth_getFilterChanges");Ie.prototype.getFilterLogs=qe("eth_getFilterLogs");Ie.prototype.getLogs=qe("eth_getLogs");Ie.prototype.getWork=qe("eth_getWork");Ie.prototype.submitWork=qe("eth_submitWork");Ie.prototype.submitHashrate=qe("eth_submitHashrate");Ie.prototype.sendAsync=function(t,e){this.currentProvider.sendAsync(TEe(t),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return e(n);e(null,i.result)})};function qe(t){return function(){let e=this;var r=[].slice.call(arguments),n=r.pop();e.sendAsync({method:t,params:r},n)}}function Pp(t,e){return function(){let r=this;var n=[].slice.call(arguments),i=n.pop();n.length<t&&n.push("latest"),r.sendAsync({method:e,params:n},i)}}function TEe(t){return MEe({id:REe(),jsonrpc:"2.0",params:[]},t)}});var Dp=_((aUe,n$)=>{"use strict";var PEe=ZE();n$.exports=function(){return PEe()&&!!Symbol.toStringTag}});var s$=_((cUe,o$)=>{"use strict";var DEe=Dp()(),NEe=dp(),oS=NEe("Object.prototype.toString"),wy=function(e){return DEe&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:oS(e)==="[object Arguments]"},i$=function(e){return wy(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&oS(e)!=="[object Array]"&&oS(e.callee)==="[object Function]"},kEe=function(){return wy(arguments)}();wy.isLegacyArguments=i$;o$.exports=kEe?wy:i$});var u$=_((uUe,c$)=>{"use strict";var LEe=Object.prototype.toString,jEe=Function.prototype.toString,BEe=/^\s*(?:function)?\*/,a$=Dp()(),sS=Object.getPrototypeOf,qEe=function(){if(!a$)return!1;try{return Function("return function*() {}")()}catch{}},aS;c$.exports=function(e){if(typeof e!="function")return!1;if(BEe.test(jEe.call(e)))return!0;if(!a$){var r=LEe.call(e);return r==="[object GeneratorFunction]"}if(!sS)return!1;if(typeof aS>"u"){var n=qEe();aS=n?sS(n):!1}return sS(e)===aS}});var d$=_((lUe,h$)=>{"use strict";var f$=Function.prototype.toString,sl=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,uS,Ey;if(typeof sl=="function"&&typeof Object.defineProperty=="function")try{uS=Object.defineProperty({},"length",{get:function(){throw Ey}}),Ey={},sl(function(){throw 42},null,uS)}catch(t){t!==Ey&&(sl=null)}else sl=null;var FEe=/^\s*class\b/,lS=function(e){try{var r=f$.call(e);return FEe.test(r)}catch{return!1}},cS=function(e){try{return lS(e)?!1:(f$.call(e),!0)}catch{return!1}},Sy=Object.prototype.toString,UEe="[object Object]",$Ee="[object Function]",WEe="[object GeneratorFunction]",HEe="[object HTMLAllCollection]",zEe="[object HTML document.all class]",VEe="[object HTMLCollection]",GEe=typeof Symbol=="function"&&!!Symbol.toStringTag,KEe=!(0 in[,]),fS=function(){return!1};typeof document=="object"&&(l$=document.all,Sy.call(l$)===Sy.call(document.all)&&(fS=function(e){if((KEe||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=Sy.call(e);return(r===HEe||r===zEe||r===VEe||r===UEe)&&e("")==null}catch{}return!1}));var l$;h$.exports=sl?function(e){if(fS(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{sl(e,null,uS)}catch(r){if(r!==Ey)return!1}return!lS(e)&&cS(e)}:function(e){if(fS(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(GEe)return cS(e);if(lS(e))return!1;var r=Sy.call(e);return r!==$Ee&&r!==WEe&&!/^\[object HTML/.test(r)?!1:cS(e)}});var hS=_((fUe,g$)=>{"use strict";var YEe=d$(),ZEe=Object.prototype.toString,p$=Object.prototype.hasOwnProperty,JEe=function(e,r,n){for(var i=0,o=e.length;i<o;i++)p$.call(e,i)&&(n==null?r(e[i],i,e):r.call(n,e[i],i,e))},QEe=function(e,r,n){for(var i=0,o=e.length;i<o;i++)n==null?r(e.charAt(i),i,e):r.call(n,e.charAt(i),i,e)},XEe=function(e,r,n){for(var i in e)p$.call(e,i)&&(n==null?r(e[i],i,e):r.call(n,e[i],i,e))},e6e=function(e,r,n){if(!YEe(r))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),ZEe.call(e)==="[object Array]"?JEe(e,r,i):typeof e=="string"?QEe(e,r,i):XEe(e,r,i)};g$.exports=e6e});var pS=_((hUe,m$)=>{"use strict";var dS=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],t6e=typeof globalThis>"u"?global:globalThis;m$.exports=function(){for(var e=[],r=0;r<dS.length;r++)typeof t6e[dS[r]]=="function"&&(e[e.length]=dS[r]);return e}});var gS=_((dUe,y$)=>{"use strict";var r6e=hp(),xy=r6e("%Object.getOwnPropertyDescriptor%",!0);if(xy)try{xy([],"length")}catch{xy=null}y$.exports=xy});var vS=_((pUe,E$)=>{"use strict";var v$=hS(),n6e=pS(),yS=dp(),i6e=yS("Object.prototype.toString"),b$=Dp()(),Oy=gS(),o6e=typeof globalThis>"u"?global:globalThis,_$=n6e(),s6e=yS("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n<e.length;n+=1)if(e[n]===r)return n;return-1},a6e=yS("String.prototype.slice"),w$={},mS=Object.getPrototypeOf;b$&&Oy&&mS&&v$(_$,function(t){var e=new o6e[t];if(Symbol.toStringTag in e){var r=mS(e),n=Oy(r,Symbol.toStringTag);if(!n){var i=mS(r);n=Oy(i,Symbol.toStringTag)}w$[t]=n.get}});var c6e=function(e){var r=!1;return v$(w$,function(n,i){if(!r)try{r=n.call(e)===i}catch{}}),r};E$.exports=function(e){if(!e||typeof e!="object")return!1;if(!b$||!(Symbol.toStringTag in e)){var r=a6e(i6e(e),8,-1);return s6e(_$,r)>-1}return Oy?c6e(e):!1}});var M$=_((gUe,I$)=>{"use strict";var x$=hS(),u6e=pS(),O$=dp(),bS=gS(),l6e=O$("Object.prototype.toString"),C$=Dp()(),S$=typeof globalThis>"u"?global:globalThis,f6e=u6e(),h6e=O$("String.prototype.slice"),A$={},_S=Object.getPrototypeOf;C$&&bS&&_S&&x$(f6e,function(t){if(typeof S$[t]=="function"){var e=new S$[t];if(Symbol.toStringTag in e){var r=_S(e),n=bS(r,Symbol.toStringTag);if(!n){var i=_S(r);n=bS(i,Symbol.toStringTag)}A$[t]=n.get}}});var d6e=function(e){var r=!1;return x$(A$,function(n,i){if(!r)try{var o=n.call(e);o===i&&(r=o)}catch{}}),r},p6e=vS();I$.exports=function(e){return p6e(e)?!C$||!(Symbol.toStringTag in e)?h6e(l6e(e),8,-1):d6e(e):!1}});var W$=_($e=>{"use strict";var g6e=s$(),m6e=u$(),ri=M$(),R$=vS();function al(t){return t.call.bind(t)}var T$=typeof BigInt<"u",P$=typeof Symbol<"u",Fn=al(Object.prototype.toString),y6e=al(Number.prototype.valueOf),v6e=al(String.prototype.valueOf),b6e=al(Boolean.prototype.valueOf);T$&&(D$=al(BigInt.prototype.valueOf));var D$;P$&&(N$=al(Symbol.prototype.valueOf));var N$;function kp(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}$e.isArgumentsObject=g6e;$e.isGeneratorFunction=m6e;$e.isTypedArray=R$;function _6e(t){return typeof Promise<"u"&&t instanceof Promise||t!==null&&typeof t=="object"&&typeof t.then=="function"&&typeof t.catch=="function"}$e.isPromise=_6e;function w6e(t){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(t):R$(t)||L$(t)}$e.isArrayBufferView=w6e;function E6e(t){return ri(t)==="Uint8Array"}$e.isUint8Array=E6e;function S6e(t){return ri(t)==="Uint8ClampedArray"}$e.isUint8ClampedArray=S6e;function x6e(t){return ri(t)==="Uint16Array"}$e.isUint16Array=x6e;function O6e(t){return ri(t)==="Uint32Array"}$e.isUint32Array=O6e;function C6e(t){return ri(t)==="Int8Array"}$e.isInt8Array=C6e;function A6e(t){return ri(t)==="Int16Array"}$e.isInt16Array=A6e;function I6e(t){return ri(t)==="Int32Array"}$e.isInt32Array=I6e;function M6e(t){return ri(t)==="Float32Array"}$e.isFloat32Array=M6e;function R6e(t){return ri(t)==="Float64Array"}$e.isFloat64Array=R6e;function T6e(t){return ri(t)==="BigInt64Array"}$e.isBigInt64Array=T6e;function P6e(t){return ri(t)==="BigUint64Array"}$e.isBigUint64Array=P6e;function Cy(t){return Fn(t)==="[object Map]"}Cy.working=typeof Map<"u"&&Cy(new Map);function D6e(t){return typeof Map>"u"?!1:Cy.working?Cy(t):t instanceof Map}$e.isMap=D6e;function Ay(t){return Fn(t)==="[object Set]"}Ay.working=typeof Set<"u"&&Ay(new Set);function N6e(t){return typeof Set>"u"?!1:Ay.working?Ay(t):t instanceof Set}$e.isSet=N6e;function Iy(t){return Fn(t)==="[object WeakMap]"}Iy.working=typeof WeakMap<"u"&&Iy(new WeakMap);function k6e(t){return typeof WeakMap>"u"?!1:Iy.working?Iy(t):t instanceof WeakMap}$e.isWeakMap=k6e;function ES(t){return Fn(t)==="[object WeakSet]"}ES.working=typeof WeakSet<"u"&&ES(new WeakSet);function L6e(t){return ES(t)}$e.isWeakSet=L6e;function My(t){return Fn(t)==="[object ArrayBuffer]"}My.working=typeof ArrayBuffer<"u"&&My(new ArrayBuffer);function k$(t){return typeof ArrayBuffer>"u"?!1:My.working?My(t):t instanceof ArrayBuffer}$e.isArrayBuffer=k$;function Ry(t){return Fn(t)==="[object DataView]"}Ry.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Ry(new DataView(new ArrayBuffer(1),0,1));function L$(t){return typeof DataView>"u"?!1:Ry.working?Ry(t):t instanceof DataView}$e.isDataView=L$;var wS=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Np(t){return Fn(t)==="[object SharedArrayBuffer]"}function j$(t){return typeof wS>"u"?!1:(typeof Np.working>"u"&&(Np.working=Np(new wS)),Np.working?Np(t):t instanceof wS)}$e.isSharedArrayBuffer=j$;function j6e(t){return Fn(t)==="[object AsyncFunction]"}$e.isAsyncFunction=j6e;function B6e(t){return Fn(t)==="[object Map Iterator]"}$e.isMapIterator=B6e;function q6e(t){return Fn(t)==="[object Set Iterator]"}$e.isSetIterator=q6e;function F6e(t){return Fn(t)==="[object Generator]"}$e.isGeneratorObject=F6e;function U6e(t){return Fn(t)==="[object WebAssembly.Module]"}$e.isWebAssemblyCompiledModule=U6e;function B$(t){return kp(t,y6e)}$e.isNumberObject=B$;function q$(t){return kp(t,v6e)}$e.isStringObject=q$;function F$(t){return kp(t,b6e)}$e.isBooleanObject=F$;function U$(t){return T$&&kp(t,D$)}$e.isBigIntObject=U$;function $$(t){return P$&&kp(t,N$)}$e.isSymbolObject=$$;function $6e(t){return B$(t)||q$(t)||F$(t)||U$(t)||$$(t)}$e.isBoxedPrimitive=$6e;function W6e(t){return typeof Uint8Array<"u"&&(k$(t)||j$(t))}$e.isAnyArrayBuffer=W6e;["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty($e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})})});var z$=_((yUe,H$)=>{H$.exports=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}});var J$=_(We=>{var V$=Object.getOwnPropertyDescriptors||function(e){for(var r=Object.keys(e),n={},i=0;i<r.length;i++)n[r[i]]=Object.getOwnPropertyDescriptor(e,r[i]);return n},H6e=/%[sdj%]/g;We.format=function(t){if(!jy(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(ws(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,i=n.length,o=String(t).replace(H6e,function(a){if(a==="%%")return"%";if(r>=i)return a;switch(a){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return a}}),s=n[r];r<i;s=n[++r])Ly(s)||!cl(s)?o+=" "+s:o+=" "+ws(s);return o};We.deprecate=function(t,e){if(typeof process<"u"&&process.noDeprecation===!0)return t;if(typeof process>"u")return function(){return We.deprecate(t,e).apply(this,arguments)};var r=!1;function n(){if(!r){if(process.throwDeprecation)throw new Error(e);process.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}return n};var Ty={},G$=/^$/;process.env.NODE_DEBUG&&(Py=process.env.NODE_DEBUG,Py=Py.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),G$=new RegExp("^"+Py+"$","i"));var Py;We.debuglog=function(t){if(t=t.toUpperCase(),!Ty[t])if(G$.test(t)){var e=process.pid;Ty[t]=function(){var r=We.format.apply(We,arguments);console.error("%s %d: %s",t,e,r)}}else Ty[t]=function(){};return Ty[t]};function ws(t,e){var r={seen:[],stylize:V6e};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),CS(e)?r.showHidden=e:e&&We._extend(r,e),ec(r.showHidden)&&(r.showHidden=!1),ec(r.depth)&&(r.depth=2),ec(r.colors)&&(r.colors=!1),ec(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=z6e),Ny(r,t,r.depth)}We.inspect=ws;ws.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};ws.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function z6e(t,e){var r=ws.styles[e];return r?"\x1B["+ws.colors[r][0]+"m"+t+"\x1B["+ws.colors[r][1]+"m":t}function V6e(t,e){return t}function G6e(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function Ny(t,e,r){if(t.customInspect&&e&&Dy(e.inspect)&&e.inspect!==We.inspect&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return jy(n)||(n=Ny(t,n,r)),n}var i=K6e(t,e);if(i)return i;var o=Object.keys(e),s=G6e(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),jp(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return SS(e);if(o.length===0){if(Dy(e)){var a=e.name?": "+e.name:"";return t.stylize("[Function"+a+"]","special")}if(Lp(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(ky(e))return t.stylize(Date.prototype.toString.call(e),"date");if(jp(e))return SS(e)}var c="",u=!1,l=["{","}"];if(K$(e)&&(u=!0,l=["[","]"]),Dy(e)){var h=e.name?": "+e.name:"";c=" [Function"+h+"]"}if(Lp(e)&&(c=" "+RegExp.prototype.toString.call(e)),ky(e)&&(c=" "+Date.prototype.toUTCString.call(e)),jp(e)&&(c=" "+SS(e)),o.length===0&&(!u||e.length==0))return l[0]+c+l[1];if(r<0)return Lp(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var d;return u?d=Y6e(t,e,r,s,o):d=o.map(function(m){return OS(t,e,r,s,m,u)}),t.seen.pop(),Z6e(d,c,l)}function K6e(t,e){if(ec(e))return t.stylize("undefined","undefined");if(jy(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(Y$(e))return t.stylize(""+e,"number");if(CS(e))return t.stylize(""+e,"boolean");if(Ly(e))return t.stylize("null","null")}function SS(t){return"["+Error.prototype.toString.call(t)+"]"}function Y6e(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)Z$(e,String(s))?o.push(OS(t,e,r,n,String(s),!0)):o.push("");return i.forEach(function(c){c.match(/^\d+$/)||o.push(OS(t,e,r,n,c,!0))}),o}function OS(t,e,r,n,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?c.set?a=t.stylize("[Getter/Setter]","special"):a=t.stylize("[Getter]","special"):c.set&&(a=t.stylize("[Setter]","special")),Z$(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(c.value)<0?(Ly(r)?a=Ny(t,c.value,null):a=Ny(t,c.value,r-1),a.indexOf(`
23
+ `)>-1&&(o?a=a.split(`
24
+ `).map(function(u){return" "+u}).join(`
25
+ `).slice(2):a=`
26
+ `+a.split(`
27
+ `).map(function(u){return" "+u}).join(`
28
+ `))):a=t.stylize("[Circular]","special")),ec(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function Z6e(t,e,r){var n=0,i=t.reduce(function(o,s){return n++,s.indexOf(`
29
+ `)>=0&&n++,o+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(e===""?"":e+`
30
+ `)+" "+t.join(`,
31
+ `)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}We.types=W$();function K$(t){return Array.isArray(t)}We.isArray=K$;function CS(t){return typeof t=="boolean"}We.isBoolean=CS;function Ly(t){return t===null}We.isNull=Ly;function J6e(t){return t==null}We.isNullOrUndefined=J6e;function Y$(t){return typeof t=="number"}We.isNumber=Y$;function jy(t){return typeof t=="string"}We.isString=jy;function Q6e(t){return typeof t=="symbol"}We.isSymbol=Q6e;function ec(t){return t===void 0}We.isUndefined=ec;function Lp(t){return cl(t)&&AS(t)==="[object RegExp]"}We.isRegExp=Lp;We.types.isRegExp=Lp;function cl(t){return typeof t=="object"&&t!==null}We.isObject=cl;function ky(t){return cl(t)&&AS(t)==="[object Date]"}We.isDate=ky;We.types.isDate=ky;function jp(t){return cl(t)&&(AS(t)==="[object Error]"||t instanceof Error)}We.isError=jp;We.types.isNativeError=jp;function Dy(t){return typeof t=="function"}We.isFunction=Dy;function X6e(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t>"u"}We.isPrimitive=X6e;We.isBuffer=z$();function AS(t){return Object.prototype.toString.call(t)}function xS(t){return t<10?"0"+t.toString(10):t.toString(10)}var eSe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function tSe(){var t=new Date,e=[xS(t.getHours()),xS(t.getMinutes()),xS(t.getSeconds())].join(":");return[t.getDate(),eSe[t.getMonth()],e].join(" ")}We.log=function(){console.log("%s - %s",tSe(),We.format.apply(We,arguments))};We.inherits=xn();We._extend=function(t,e){if(!e||!cl(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};function Z$(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Xa=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;We.promisify=function(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');if(Xa&&e[Xa]){var r=e[Xa];if(typeof r!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,Xa,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var n,i,o=new Promise(function(c,u){n=c,i=u}),s=[],a=0;a<arguments.length;a++)s.push(arguments[a]);s.push(function(c,u){c?i(c):n(u)});try{e.apply(this,s)}catch(c){i(c)}return o}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Xa&&Object.defineProperty(r,Xa,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,V$(e))};We.promisify.custom=Xa;function rSe(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}function nSe(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if(typeof i!="function")throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};t.apply(this,r).then(function(a){process.nextTick(s.bind(null,null,a))},function(a){process.nextTick(rSe.bind(null,a,s))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,V$(t)),e}We.callbackify=nSe});var tW=_((bUe,eW)=>{var iSe=J$(),X$=yn(),IS=typeof Reflect=="object"?Reflect:null,oSe=IS&&typeof IS.apply=="function"?IS.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)};eW.exports=MS;function MS(){X$.call(this)}iSe.inherits(MS,X$);MS.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n=t==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[t];if(a===void 0)return!1;if(typeof a=="function")Q$(a,this,e);else for(var c=a.length,u=sSe(a,c),r=0;r<c;++r)Q$(u[r],this,e);return!0};function Q$(t,e,r){try{oSe(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function sSe(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}});var oW=_((EUe,iW)=>{var _Ue=iS(),wUe=nS(),aSe=tW(),cSe=1e3,uSe=(t,e)=>t+e,rW=["sync","latest"],RS=class extends aSe{constructor(e={}){super(),this._blockResetDuration=e.blockResetDuration||20*cSe,this._blockResetTimeout,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(e){e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener()}_start(){}_end(){}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e,r){!rW.includes(e)||this._maybeStart()}_onRemoveListener(e,r){this._getBlockTrackerEventCount()>0||this._maybeEnd()}_maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}_maybeEnd(){!this._isRunning||(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}_getBlockTrackerEventCount(){return rW.map(e=>this.listenerCount(e)).reduce(uSe)}_newPotentialLatest(e){let r=this._currentBlock;r&&nW(e)<=nW(r)||this._setCurrentBlock(e)}_setCurrentBlock(e){let r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}};iW.exports=RS;function nW(t){return Number.parseInt(t,16)}});var cW=_((SUe,aW)=>{var lSe=nS(),fSe=oW(),hSe=1e3,TS=class extends fSe{constructor(e={}){if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");let r=e.pollingInterval||20*hSe,n=e.retryTimeout||r/10,i=e.keepEventLoopActive!==void 0?e.keepEventLoopActive:!0,o=e.setSkipCacheFlag||!1;super(Object.assign({blockResetDuration:r},e)),this._provider=e.provider,this._pollingInterval=r,this._retryTimeout=n,this._keepEventLoopActive=i,this._setSkipCacheFlag=o}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}_start(){this._performSync().catch(e=>this.emit("error",e))}async _performSync(){for(;this._isRunning;)try{await this._updateLatestBlock(),await sW(this._pollingInterval,!this._keepEventLoopActive)}catch(e){let r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
32
+ ${e.stack}`);try{this.emit("error",r)}catch{console.error(r)}await sW(this._retryTimeout,!this._keepEventLoopActive)}}async _updateLatestBlock(){let e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){let e={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0);let r=await lSe(n=>this._provider.sendAsync(e,n))();if(r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
33
+ ${r.error}`);return r.result}};aW.exports=TS;function sW(t,e){return new Promise(r=>{let n=setTimeout(r,t);n.unref&&e&&n.unref()})}});var lW=_((xUe,uW)=>{uW.exports=function(e){return(r,n,i,o)=>{let s=e[r.method];return s===void 0?i():typeof s=="function"?s(r,n,i,o):(n.result=s,o())}}});var PS=_((OUe,fW)=>{fW.exports=lW()});var NS=_(By=>{"use strict";Object.defineProperty(By,"__esModule",{value:!0});By.getUniqueId=void 0;var hW=4294967295,DS=Math.floor(Math.random()*hW);function dSe(){return DS=(DS+1)%hW,DS}By.getUniqueId=dSe});var dW=_(qy=>{"use strict";Object.defineProperty(qy,"__esModule",{value:!0});qy.createIdRemapMiddleware=void 0;var pSe=NS();function gSe(){return(t,e,r,n)=>{let i=t.id,o=pSe.getUniqueId();t.id=o,e.id=o,r(s=>{t.id=i,e.id=i,s()})}}qy.createIdRemapMiddleware=gSe});var pW=_(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0});Fy.createAsyncMiddleware=void 0;function mSe(t){return async(e,r,n,i)=>{let o,s=new Promise(l=>{o=l}),a=null,c=!1,u=async()=>{c=!0,n(l=>{a=l,o()}),await s};try{await t(e,r,u),c?(await s,a(null)):i(null)}catch(l){a?a(l):i(l)}}}Fy.createAsyncMiddleware=mSe});var gW=_(Uy=>{"use strict";Object.defineProperty(Uy,"__esModule",{value:!0});Uy.createScaffoldMiddleware=void 0;function ySe(t){return(e,r,n,i)=>{let o=t[e.method];return o===void 0?n():typeof o=="function"?o(e,r,n,i):(r.result=o,i())}}Uy.createScaffoldMiddleware=ySe});var Wy=_(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.EthereumProviderError=ul.EthereumRpcError=void 0;var vSe=$3(),$y=class extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}serialize(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return vSe.default(this.serialize(),_Se,2)}};ul.EthereumRpcError=$y;var kS=class extends $y{constructor(e,r,n){if(!bSe(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}};ul.EthereumProviderError=kS;function bSe(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function _Se(t,e){if(e!=="[Circular]")return e}});var Hy=_(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.errorValues=ll.errorCodes=void 0;ll.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};ll.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}});var BS=_(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.serializeError=ni.isValidCode=ni.getMessageFromCode=ni.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var zy=Hy(),wSe=Wy(),mW=zy.errorCodes.rpc.internal,ESe="Unspecified error message. This is a bug, please report it.",SSe={code:mW,message:jS(mW)};ni.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function jS(t,e=ESe){if(Number.isInteger(t)){let r=t.toString();if(LS(zy.errorValues,r))return zy.errorValues[r].message;if(bW(t))return ni.JSON_RPC_SERVER_ERROR_MESSAGE}return e}ni.getMessageFromCode=jS;function vW(t){if(!Number.isInteger(t))return!1;let e=t.toString();return!!(zy.errorValues[e]||bW(t))}ni.isValidCode=vW;function xSe(t,{fallbackError:e=SSe,shouldIncludeStack:r=!1}={}){var n,i;if(!e||!Number.isInteger(e.code)||typeof e.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(t instanceof wSe.EthereumRpcError)return t.serialize();let o={};if(t&&typeof t=="object"&&!Array.isArray(t)&&LS(t,"code")&&vW(t.code)){let a=t;o.code=a.code,a.message&&typeof a.message=="string"?(o.message=a.message,LS(a,"data")&&(o.data=a.data)):(o.message=jS(o.code),o.data={originalError:yW(t)})}else{o.code=e.code;let a=(n=t)===null||n===void 0?void 0:n.message;o.message=a&&typeof a=="string"?a:e.message,o.data={originalError:yW(t)}}let s=(i=t)===null||i===void 0?void 0:i.stack;return r&&t&&s&&typeof s=="string"&&(o.stack=s),o}ni.serializeError=xSe;function bW(t){return t>=-32099&&t<=-32e3}function yW(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function LS(t,e){return Object.prototype.hasOwnProperty.call(t,e)}});var EW=_(Vy=>{"use strict";Object.defineProperty(Vy,"__esModule",{value:!0});Vy.ethErrors=void 0;var qS=Wy(),_W=BS(),qr=Hy();Vy.ethErrors={rpc:{parse:t=>Un(qr.errorCodes.rpc.parse,t),invalidRequest:t=>Un(qr.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Un(qr.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Un(qr.errorCodes.rpc.methodNotFound,t),internal:t=>Un(qr.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");let{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Un(e,t)},invalidInput:t=>Un(qr.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Un(qr.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Un(qr.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Un(qr.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Un(qr.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Un(qr.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Bp(qr.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Bp(qr.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Bp(qr.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Bp(qr.errorCodes.provider.disconnected,t),chainDisconnected:t=>Bp(qr.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");let{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new qS.EthereumProviderError(e,r,n)}}};function Un(t,e){let[r,n]=wW(e);return new qS.EthereumRpcError(t,r||_W.getMessageFromCode(t),n)}function Bp(t,e){let[r,n]=wW(e);return new qS.EthereumProviderError(t,r||_W.getMessageFromCode(t),n)}function wW(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){let{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}});var OW=_(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.getMessageFromCode=fn.serializeError=fn.EthereumProviderError=fn.EthereumRpcError=fn.ethErrors=fn.errorCodes=void 0;var SW=Wy();Object.defineProperty(fn,"EthereumRpcError",{enumerable:!0,get:function(){return SW.EthereumRpcError}});Object.defineProperty(fn,"EthereumProviderError",{enumerable:!0,get:function(){return SW.EthereumProviderError}});var xW=BS();Object.defineProperty(fn,"serializeError",{enumerable:!0,get:function(){return xW.serializeError}});Object.defineProperty(fn,"getMessageFromCode",{enumerable:!0,get:function(){return xW.getMessageFromCode}});var OSe=EW();Object.defineProperty(fn,"ethErrors",{enumerable:!0,get:function(){return OSe.ethErrors}});var CSe=Hy();Object.defineProperty(fn,"errorCodes",{enumerable:!0,get:function(){return CSe.errorCodes}})});var US=_(fl=>{"use strict";var ASe=fl&&fl.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fl,"__esModule",{value:!0});fl.JsonRpcEngine=void 0;var ISe=ASe(wh()),$n=OW(),ii=class extends ISe.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{let[o,s,a]=await ii._runAllMiddleware(e,r,this._middleware);return s?(await ii._runReturnHandlers(a),i(o)):n(async c=>{try{await ii._runReturnHandlers(a)}catch(u){return c(u)}return c()})}catch(o){return i(o)}}}async _handleBatch(e,r){try{let n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){let s=new $n.EthereumRpcError($n.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(s,{id:void 0,jsonrpc:"2.0",error:s})}if(typeof e.method!="string"){let s=new $n.EthereumRpcError($n.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(s,{id:e.id,jsonrpc:"2.0",error:s})}let n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc},o=null;try{await this._processRequest(n,i)}catch(s){o=s}return o&&(delete i.result,i.error||(i.error=$n.serializeError(o))),r(o,i)}async _processRequest(e,r){let[n,i,o]=await ii._runAllMiddleware(e,r,this._middleware);if(ii._checkForCompletion(e,r,i),await ii._runReturnHandlers(o),n)throw n}static async _runAllMiddleware(e,r,n){let i=[],o=null,s=!1;for(let a of n)if([o,s]=await ii._runMiddleware(e,r,a,i),s)break;return[o,s,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(o=>{let s=c=>{let u=c||r.error;u&&(r.error=$n.serializeError(u)),o([u,!0])},a=c=>{r.error?s(r.error):(c&&(typeof c!="function"&&s(new $n.EthereumRpcError($n.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request:
34
+ ${FS(e)}`,{request:e})),i.push(c)),o([null,!1]))};try{n(e,r,a,s)}catch(c){s(c)}})}static async _runReturnHandlers(e){for(let r of e)await new Promise((n,i)=>{r(o=>o?i(o):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new $n.EthereumRpcError($n.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
35
+ ${FS(e)}`,{request:e});if(!n)throw new $n.EthereumRpcError($n.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
36
+ ${FS(e)}`,{request:e})}};fl.JsonRpcEngine=ii;function FS(t){return JSON.stringify(t,null,2)}});var CW=_(Gy=>{"use strict";Object.defineProperty(Gy,"__esModule",{value:!0});Gy.mergeMiddleware=void 0;var MSe=US();function RSe(t){let e=new MSe.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}Gy.mergeMiddleware=RSe});var $S=_(Wn=>{"use strict";var TSe=Wn&&Wn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),hl=Wn&&Wn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TSe(e,t,r)};Object.defineProperty(Wn,"__esModule",{value:!0});hl(dW(),Wn);hl(pW(),Wn);hl(gW(),Wn);hl(NS(),Wn);hl(US(),Wn);hl(CW(),Wn)});var HS=_(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var AW=Sg(),PSe=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return AW.__awaiter(this,void 0,void 0,function(){var r,n,i;return AW.__generator(this,function(o){switch(o.label){case 0:return[4,this.acquire()];case 1:r=o.sent(),n=r[0],i=r[1],o.label=2;case 2:return o.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,o.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(!!r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();WS.default=PSe});var MW=_(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var IW=Sg(),DSe=HS(),NSe=function(){function t(){this._semaphore=new DSe.default(1)}return t.prototype.acquire=function(){return IW.__awaiter(this,void 0,void 0,function(){var e,r;return IW.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();zS.default=NSe});var RW=_(Yy=>{"use strict";Object.defineProperty(Yy,"__esModule",{value:!0});Yy.withTimeout=void 0;var Ky=Sg();function kSe(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,o){return Ky.__awaiter(n,void 0,void 0,function(){var s,a,c;return Ky.__generator(this,function(u){switch(u.label){case 0:return s=!1,setTimeout(function(){s=!0,o(r)},e),[4,t.acquire()];case 1:return a=u.sent(),s?(c=Array.isArray(a)?a[1]:a,c()):i(a),[2]}})})})},runExclusive:function(i){return Ky.__awaiter(this,void 0,void 0,function(){var o,s;return Ky.__generator(this,function(a){switch(a.label){case 0:o=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return s=a.sent(),Array.isArray(s)?(o=s[1],[4,i(s[0])]):[3,4];case 3:return[2,a.sent()];case 4:return o=s,[4,i()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return o(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}Yy.withTimeout=kSe});var TW=_(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.withTimeout=Es.Semaphore=Es.Mutex=void 0;var LSe=MW();Object.defineProperty(Es,"Mutex",{enumerable:!0,get:function(){return LSe.default}});var jSe=HS();Object.defineProperty(Es,"Semaphore",{enumerable:!0,get:function(){return jSe.default}});var BSe=RW();Object.defineProperty(Es,"withTimeout",{enumerable:!0,get:function(){return BSe.withTimeout}})});var kW=_(($Ue,NW)=>{"use strict";var PW=(t,e,r,n)=>function(...i){let o=e.promiseModule;return new o((s,a)=>{e.multiArgs?i.push((...u)=>{e.errorFirst?u[0]?a(u):(u.shift(),s(u)):s(u)}):e.errorFirst?i.push((u,l)=>{u?a(u):s(l)}):i.push(s),Reflect.apply(t,this===r?n:this,i)})},DW=new WeakMap;NW.exports=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};let r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);let n=(s,a)=>{let c=DW.get(s);if(c||(c={},DW.set(s,c)),a in c)return c[a];let u=v=>typeof v=="string"||typeof a=="symbol"?a===v:v.test(a),l=Reflect.getOwnPropertyDescriptor(s,a),h=l===void 0||l.writable||l.configurable,m=(e.include?e.include.some(u):!e.exclude.some(u))&&h;return c[a]=m,m},i=new WeakMap,o=new Proxy(t,{apply(s,a,c){let u=i.get(s);if(u)return Reflect.apply(u,a,c);let l=e.excludeMain?s:PW(s,e,o,s);return i.set(s,l),Reflect.apply(l,a,c)},get(s,a){let c=s[a];if(!n(s,a)||c===Function.prototype[a])return c;let u=i.get(c);if(u)return u;if(typeof c=="function"){let l=PW(c,e,o,s);return i.set(c,l),l}return c}});return o}});var Zy=_((WUe,LW)=>{var qSe=wh().default,VS=class extends qSe{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(r=>this.emit("update",r))}addInitialResults(e){}getChangesAndClear(){let e=this.updates;return this.updates=[],e}};LW.exports=VS});var BW=_((HUe,jW)=>{var FSe=Zy(),GS=class extends FSe{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};jW.exports=GS});var dl=_((zUe,UW)=>{UW.exports={minBlockRef:USe,maxBlockRef:$Se,sortBlockRefs:KS,bnToHex:WSe,blockRefIsNumber:HSe,hexToInt:Jy,incrementHexInt:zSe,intToHex:FW,unsafeRandomBytes:VSe};function USe(...t){return KS(t)[0]}function $Se(...t){let e=KS(t);return e[e.length-1]}function KS(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:Jy(e)-Jy(r))}function WSe(t){return"0x"+t.toString(16)}function HSe(t){return t&&!["earliest","latest","pending"].includes(t)}function Jy(t){return t==null?t:Number.parseInt(t,16)}function zSe(t){if(t==null)return t;let e=Jy(t);return FW(e+1)}function FW(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function VSe(t){let e="0x";for(let r=0;r<t;r++)e+=qW(),e+=qW();return e}function qW(){return Math.floor(Math.random()*16).toString(16)}});var WW=_((GUe,$W)=>{var GSe=iS(),KSe=kW(),YSe=BW(),{bnToHex:VUe,hexToInt:Qy,incrementHexInt:ZSe,minBlockRef:JSe,blockRefIsNumber:QSe}=dl(),YS=class extends YSe{constructor({provider:e,params:r}){super(),this.type="log",this.ethQuery=new GSe(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:e}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=e),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;let n=JSe(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:n}),o=await this._fetchLogs(i);this.addInitialResults(o)}async update({oldBlock:e,newBlock:r}){let n=r,i;e?i=ZSe(e):i=r;let o=Object.assign({},this.params,{fromBlock:i,toBlock:n}),a=(await this._fetchLogs(o)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(e){return await KSe(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(Qy(this.params.fromBlock)>=Qy(e.blockNumber)||QSe(this.params.toBlock)&&Qy(this.params.toBlock)<=Qy(e.blockNumber))return!1;let r=e.address&&e.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,o)=>{let s=e.topics[o];if(!s)return!1;s=s.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(l=>l.toLowerCase()),a.includes(s))})}};$W.exports=YS});var Xy=_((KUe,zW)=>{zW.exports=XSe;async function XSe({provider:t,fromBlock:e,toBlock:r}){e||(e=r);let n=HW(e),o=HW(r)-n+1,s=Array(o).fill().map((c,u)=>n+u).map(exe);return await Promise.all(s.map(c=>txe(t,"eth_getBlockByNumber",[c,!1])))}function HW(t){return t==null?t:Number.parseInt(t,16)}function exe(t){if(t==null)return t;let e=t.toString(16);return"0x"+e}function txe(t,e,r){return new Promise((n,i)=>{t.sendAsync({id:1,jsonrpc:"2.0",method:e,params:r},(o,s)=>{if(o)return i(o);n(s.result)})})}});var GW=_((YUe,VW)=>{var rxe=Zy(),nxe=Xy(),{incrementHexInt:ixe}=dl(),ZS=class extends rxe{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){let n=r,i=ixe(e),s=(await nxe({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(s)}};VW.exports=ZS});var YW=_((ZUe,KW)=>{var oxe=Zy(),sxe=Xy(),{incrementHexInt:axe}=dl(),JS=class extends oxe{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){let r=e,n=axe(e),i=await sxe({provider:this.provider,fromBlock:n,toBlock:r}),o=[];for(let s of i)o.push(...s.transactions);this.addResults(o)}};KW.exports=JS});var QW=_((JUe,JW)=>{var cxe=TW().Mutex,{createAsyncMiddleware:uxe}=$S(),lxe=PS(),fxe=WW(),hxe=GW(),dxe=YW(),{intToHex:ZW,hexToInt:QS}=dl();JW.exports=pxe;function pxe({blockTracker:t,provider:e}){let r=0,n={},i=new cxe,o=gxe({mutex:i}),s=lxe({eth_newFilter:o(XS(c)),eth_newBlockFilter:o(XS(u)),eth_newPendingTransactionFilter:o(XS(l)),eth_uninstallFilter:o(ev(m)),eth_getFilterChanges:o(ev(h)),eth_getFilterLogs:o(ev(d))}),a=async({oldBlock:j,newBlock:k})=>{if(n.length===0)return;let B=await i.acquire();try{await Promise.all(pl(n).map(async V=>{try{await V.update({oldBlock:j,newBlock:k})}catch(q){console.error(q)}}))}catch(V){console.error(V)}B()};return s.newLogFilter=c,s.newBlockFilter=u,s.newPendingTransactionFilter=l,s.uninstallFilter=m,s.getFilterChanges=h,s.getFilterLogs=d,s.destroy=()=>{O()},s;async function c(j){let k=new fxe({provider:e,params:j}),B=await v(k);return k}async function u(){let j=new hxe({provider:e}),k=await v(j);return j}async function l(){let j=new dxe({provider:e}),k=await v(j);return j}async function h(j){let k=QS(j),B=n[k];if(!B)throw new Error(`No filter for index "${k}"`);return B.getChangesAndClear()}async function d(j){let k=QS(j),B=n[k];if(!B)throw new Error(`No filter for index "${k}"`);return B.type==="log"?results=B.getAllResults():results=[],results}async function m(j){let k=QS(j),B=n[k],V=Boolean(B);return V&&await x(k),V}async function v(j){let k=pl(n).length,B=await t.getLatestBlock();await j.initialize({currentBlock:B}),r++,n[r]=j,j.id=r,j.idHex=ZW(r);let V=pl(n).length;return I({prevFilterCount:k,newFilterCount:V}),r}async function x(j){let k=pl(n).length;delete n[j];let B=pl(n).length;I({prevFilterCount:k,newFilterCount:B})}async function O(){let j=pl(n).length;n={},I({prevFilterCount:j,newFilterCount:0})}function I({prevFilterCount:j,newFilterCount:k}){if(j===0&&k>0){t.on("sync",a);return}if(j>0&&k===0){t.removeListener("sync",a);return}}}function XS(t){return ev(async(...e)=>{let r=await t(...e);return ZW(r.id)})}function ev(t){return uxe(async(e,r)=>{let n=await t.apply(null,e.params);r.result=n})}function gxe({mutex:t}){return e=>async(r,n,i,o)=>{(await t.acquire())(),e(r,n,i,o)}}function pl(t,e){let r=[];for(let n in t)r.push(t[n]);return r}});var tH=_((QUe,eH)=>{var mxe=wh().default,yxe=PS(),{createAsyncMiddleware:XW}=$S(),vxe=QW(),{unsafeRandomBytes:bxe,incrementHexInt:_xe}=dl(),wxe=Xy();eH.exports=Exe;function Exe({blockTracker:t,provider:e}){let r={},n=vxe({blockTracker:t,provider:e}),i=!1,o=new mxe,s=yxe({eth_subscribe:XW(a),eth_unsubscribe:XW(c)});return s.destroy=l,{events:o,middleware:s};async function a(h,d){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");let m=h.params[0],v=bxe(16),x;switch(m){case"newHeads":x=O({subId:v});break;case"logs":let j=h.params[1],k=await n.newLogFilter(j);x=I({subId:v,filter:k});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${m}"`)}r[v]=x,d.result=v;return;function O({subId:j}){let k={type:m,destroy:async()=>{t.removeListener("sync",k.update)},update:async({oldBlock:B,newBlock:V})=>{let q=V,P=_xe(B);(await wxe({provider:e,fromBlock:P,toBlock:q})).map(Sxe).forEach(M=>{u(j,M)})}};return t.on("sync",k.update),k}function I({subId:j,filter:k}){return k.on("update",V=>u(j,V)),{type:m,destroy:async()=>await n.uninstallFilter(k.idHex)}}}async function c(h,d){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");let m=h.params[0],v=r[m];if(!v){d.result=!1;return}delete r[m],await v.destroy(),d.result=!0}function u(h,d){o.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:h,result:d}})}function l(){o.removeAllListeners();for(let h in r)r[h].destroy(),delete r[h];i=!0}}function Sxe(t){return{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}});var nH=_(tv=>{"use strict";Object.defineProperty(tv,"__esModule",{value:!0});tv.SubscriptionManager=void 0;var xxe=cW(),Oxe=tH(),rH=()=>{},ex=class{constructor(e){let r=new xxe({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=Oxe({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){let r={};return await this.subscriptionMiddleware(e,r,rH,rH),r}destroy(){this.subscriptionMiddleware.destroy()}};tv.SubscriptionManager=ex});var rv=_(gl=>{"use strict";var ix=gl&&gl.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gl,"__esModule",{value:!0});gl.CoinbaseWalletProvider=void 0;var Cxe=ix(wh()),Axe=ix(Eh()),Fr=nm(),tx=om(),iH=ry(),oH=x6(),De=Io(),rx=ix(WU()),Ixe=KU(),Xe=YU(),Mxe=nH(),sH="DefaultChainId",aH="DefaultJsonRpcUrl",nx=class extends Cxe.default{constructor(e){var r,n;super(),this._filterPolyfill=new Ixe.FilterPolyfill(this),this._subscriptionManager=new Mxe.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this._send=this.send.bind(this),this._sendAsync=this.sendAsync.bind(this),this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=e.qrUrl,this.supportsAddressSwitching=e.supportsAddressSwitching,this.isLedger=e.isLedger;let i=this.getChainId(),o=(0,De.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:o});let s=this._storage.getItem(oH.LOCAL_STORAGE_ADDRESSES_KEY);if(s){let a=s.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,De.ensureAddressString)(c)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",a=>{var c;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"){if(a.data.data.action==="defaultChainChanged"||a.data.data.action==="dappChainSwitched"){let u=a.data.data.chainId,l=(c=a.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;this.updateProviderInfo(l,Number(u))}a.data.data.action==="addressChanged"&&this._setAddresses([a.data.data.address])}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,De.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(aH))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(aH,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,r){this.jsonRpcUrl=e;let n=this.getChainId();this._storage.setItem(sH,r.toString(10)),((0,De.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,o,s){return!!(await(await this.initializeRelay()).watchAsset(e,r,n,i,o,s?.toString()).promise).result}async addEthereumChain(e,r,n,i,o,s){var a,c;if((0,De.ensureIntNumber)(e)===this.getChainId())return!1;let u=await this.initializeRelay(),l=u.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!l&&await u.requestEthereumAccounts().promise;let h=await u.addEthereumChain(e.toString(),r,o,n,i,s).promise;return((a=h.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],e),((c=h.result)===null||c===void 0?void 0:c.isApproved)===!0}async switchEthereumChain(e){let n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if(n.errorCode)throw Fr.ethErrors.provider.custom({code:n.errorCode});let i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,r){this.initializeRelay().then(n=>n.setAppInfo(e,r))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(tx.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?iH.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this._send(Xe.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(e,r){if(typeof e=="string"){let i=e,o=Array.isArray(r)?r:r!==void 0?[r]:[],s={jsonrpc:"2.0",id:0,method:i,params:o};return this._sendRequestAsync(s).then(a=>a.result)}if(typeof r=="function"){let i=e,o=r;return this._sendAsync(i,o)}if(Array.isArray(e))return e.map(o=>this._sendRequest(o));let n=e;return this._sendRequest(n)}async sendAsync(e,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(e)){let i=r;this._sendMultipleRequestsAsync(e).then(o=>i(null,o)).catch(o=>i(o,null));return}let n=r;return this._sendRequestAsync(e).then(i=>n(null,i)).catch(i=>n(i,null))}async request(e){if(!e||typeof e!="object"||Array.isArray(e))throw Fr.ethErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});let{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw Fr.ethErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw Fr.ethErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});let i=n===void 0?[]:n,o=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:o})).result}async scanQRCode(e){let n=await(await this.initializeRelay()).scanQRCode((0,De.ensureRegExpString)(e)).promise;if(typeof n.result!="string")throw new Error("result was not a string");return n.result}async genericRequest(e,r){let i=await(await this.initializeRelay()).genericRequest(e,r).promise;if(typeof i.result!="string")throw new Error("result was not a string");return i.result}async selectProvider(e){let n=await(await this.initializeRelay()).selectProvider(e).promise;if(typeof n.result!="string")throw new Error("result was not a string");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){let r={jsonrpc:"2.0",id:e.id},{method:n}=e;if(r.result=this._handleSynchronousMethods(e),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(e,r){if(!Array.isArray(e))throw new Error("addresses is not an array");let n=e.map(i=>(0,De.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&this.supportsAddressSwitching===!1&&!r||(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(oH.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" "))))}_sendRequestAsync(e){return new Promise((r,n)=>{try{let i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i});let o=this._handleAsynchronousFilterMethods(e);if(o!==void 0){o.then(a=>r(Object.assign(Object.assign({},a),{id:e.id}))).catch(a=>n(a));return}let s=this._handleSubscriptionMethods(e);if(s!==void 0){s.then(a=>r({jsonrpc:"2.0",id:e.id,result:a.result})).catch(a=>n(a));return}}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(e){let{method:r}=e,n=e.params||[];switch(r){case Xe.JSONRPCMethod.eth_accounts:return this._eth_accounts();case Xe.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case Xe.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case Xe.JSONRPCMethod.net_version:return this._net_version();case Xe.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){let{method:r}=e,n=e.params||[];switch(r){case Xe.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case Xe.JSONRPCMethod.eth_sign:return this._eth_sign(n);case Xe.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case Xe.JSONRPCMethod.personal_sign:return this._personal_sign(n);case Xe.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case Xe.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case Xe.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case Xe.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case Xe.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case Xe.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case Xe.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case Xe.JSONRPCMethod.eth_signTypedData_v4:case Xe.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case Xe.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(n);case Xe.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(n);case Xe.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(n);case Xe.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(e){let{method:r}=e,n=e.params||[];switch(r){case Xe.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case Xe.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case Xe.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case Xe.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case Xe.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case Xe.JSONRPCMethod.eth_subscribe:case Xe.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{let r=(0,De.ensureAddressString)(e);return this._addresses.map(i=>(0,De.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){var r;if(!this._isKnownAddress(e))throw(r=this.diagnostic)===null||r===void 0||r.log(tx.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){let r=e.from?(0,De.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);let n=e.to?(0,De.ensureAddressString)(e.to):null,i=e.value!=null?(0,De.ensureBN)(e.value):new Axe.default(0),o=e.data?(0,De.ensureBuffer)(e.data):Buffer.alloc(0),s=e.nonce!=null?(0,De.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,De.ensureBN)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,De.ensureBN)(e.maxFeePerGas):null,u=e.maxPriorityFeePerGas!=null?(0,De.ensureBN)(e.maxPriorityFeePerGas):null,l=e.gas!=null?(0,De.ensureBN)(e.gas):null,h=this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:o,nonce:s,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:u,gasLimit:l,chainId:h}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Fr.ethErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Fr.ethErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{let s=await(await this.initializeRelay()).signEthereumMessage(e,r,n,i).promise;return{jsonrpc:"2.0",id:0,result:s.result}}catch(o){throw typeof o.message=="string"&&o.message.match(/(denied|rejected)/i)?Fr.ethErrors.provider.userRejectedRequest("User denied message signature"):o}}async _ethereumAddressFromSignedMessage(e,r,n){let o=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,r,n).promise;return{jsonrpc:"2.0",id:0,result:o.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,De.hexStringFromIntNumber)(this.getChainId())}getChainId(){let e=this._storage.getItem(sH);if(!e)return(0,De.ensureIntNumber)(this._chainIdFromOpts);let r=parseInt(e,10);return(0,De.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(tx.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?iH.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{r=await(await this.initializeRelay()).requestEthereumAccounts().promise}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Fr.ethErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();let r=(0,De.ensureAddressString)(e[0]),n=(0,De.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){let r=(0,De.ensureBuffer)(e[0]),n=(0,De.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();let r=(0,De.ensureBuffer)(e[0]),n=(0,De.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){let r=(0,De.ensureBuffer)(e[0]),n=(0,De.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();let r=this._prepareTransactionParams(e[0]||{});try{let i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Fr.ethErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){let r=(0,De.ensureBuffer)(e[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(e){this._requireAuthorization();let r=this._prepareTransactionParams(e[0]||{});try{let i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Fr.ethErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();let r=(0,De.ensureParsedJSONObject)(e[0]),n=(0,De.ensureAddressString)(e[1]);this._ensureKnownAddress(n);let i=rx.default.hashForSignTypedDataLegacy({data:r}),o=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,o)}async _eth_signTypedData_v3(e){this._requireAuthorization();let r=(0,De.ensureAddressString)(e[0]),n=(0,De.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);let i=rx.default.hashForSignTypedData_v3({data:n}),o=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,o)}async _eth_signTypedData_v4(e){this._requireAuthorization();let r=(0,De.ensureAddressString)(e[0]),n=(0,De.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);let i=rx.default.hashForSignTypedData_v4({data:n}),o=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,o)}async _cbwallet_arbitrary(e){let r=e[0],n=e[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");let i=await this.genericRequest(r,n);return{jsonrpc:"2.0",id:0,result:i}}async _wallet_addEthereumChain(e){var r,n,i,o;let s=e[0];if(((r=s.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!s.chainName||s.chainName.trim()==="")throw Fr.ethErrors.provider.custom({code:0,message:"chainName is a required field"});if(!s.nativeCurrency)throw Fr.ethErrors.provider.custom({code:0,message:"nativeCurrency is a required field"});let a=parseInt(s.chainId,16);return await this.addEthereumChain(a,(n=s.rpcUrls)!==null&&n!==void 0?n:[],(i=s.blockExplorerUrls)!==null&&i!==void 0?i:[],s.chainName,(o=s.iconUrls)!==null&&o!==void 0?o:[],s.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){let r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){let r=Array.isArray(e)?e[0]:e;if(!r.type)throw Fr.ethErrors.rpc.invalidParams({message:"Type is required"});if(r?.type!=="ERC20")throw Fr.ethErrors.rpc.invalidParams({message:`Asset of type '${r.type}' is not supported`});if(!r?.options)throw Fr.ethErrors.rpc.invalidParams({message:"Options are required"});if(!r?.options.address)throw Fr.ethErrors.rpc.invalidParams({message:"Address is required"});let n=this.getChainId(),{address:i,symbol:o,image:s,decimals:a}=r.options,c=await this.watchAsset(r.type,i,o,a,s,n);return{jsonrpc:"2.0",id:0,result:c}}_eth_uninstallFilter(e){let r=(0,De.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(e){let r=e[0],n=await this._filterPolyfill.newFilter(r);return{jsonrpc:"2.0",id:0,result:n}}async _eth_newBlockFilter(){let e=await this._filterPolyfill.newBlockFilter();return{jsonrpc:"2.0",id:0,result:e}}async _eth_newPendingTransactionFilter(){let e=await this._filterPolyfill.newPendingTransactionFilter();return{jsonrpc:"2.0",id:0,result:e}}_eth_getFilterChanges(e){let r=(0,De.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){let r=(0,De.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}};gl.CoinbaseWalletProvider=nx});var hn={};ir(hn,{Component:()=>Fp,Fragment:()=>Wp,cloneElement:()=>Lxe,createContext:()=>jxe,createElement:()=>vH,createRef:()=>Txe,h:()=>vH,hydrate:()=>MH,isValidElement:()=>dH,options:()=>Me,render:()=>IH,toChildArray:()=>EH});function Ro(t,e){for(var r in e)t[r]=e[r];return t}function yH(t){var e=t.parentNode;e&&e.removeChild(t)}function vH(t,e,r){var n,i,o,s={};for(o in e)o=="key"?n=e[o]:o=="ref"?i=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?$p.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return qp(t,s,n,i,null)}function qp(t,e,r,n,i){var o={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++hH};return i==null&&Me.vnode!=null&&Me.vnode(o),o}function Txe(){return{current:null}}function Wp(t){return t.children}function Pxe(t,e,r,n,i){var o;for(o in r)o==="children"||o==="key"||o in e||iv(t,o,null,r[o],n);for(o in e)i&&typeof e[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||r[o]===e[o]||iv(t,o,e[o],r[o],n)}function uH(t,e,r){e[0]==="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||Rxe.test(e)?r:r+"px"}function iv(t,e,r,n,i){var o;e:if(e==="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||uH(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||uH(t.style,e,r[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?n||t.addEventListener(e,o?fH:lH,o):t.removeEventListener(e,o?fH:lH,o);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e.indexOf("-")==-1?t.removeAttribute(e):t.setAttribute(e,r))}}function lH(t){ml=!0;try{return this.l[t.type+!1](Me.event?Me.event(t):t)}finally{ml=!1}}function fH(t){ml=!0;try{return this.l[t.type+!0](Me.event?Me.event(t):t)}finally{ml=!1}}function Fp(t,e){this.props=t,this.context=e}function Up(t,e){if(e==null)return t.__?Up(t.__,t.__.__k.indexOf(t)+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Up(t):null}function bH(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return bH(t)}}function Dxe(t){ml?setTimeout(t):pH(t)}function ox(t){(!t.__d&&(t.__d=!0)&&tc.push(t)&&!ov.__r++||cH!==Me.debounceRendering)&&((cH=Me.debounceRendering)||Dxe)(ov)}function ov(){var t,e,r,n,i,o,s,a;for(tc.sort(function(c,u){return c.__v.__b-u.__v.__b});t=tc.shift();)t.__d&&(e=tc.length,n=void 0,i=void 0,s=(o=(r=t).__v).__e,(a=r.__P)&&(n=[],(i=Ro({},o)).__v=o.__v+1,sx(a,o,i,r.__n,a.ownerSVGElement!==void 0,o.__h!=null?[s]:null,n,s??Up(o),o.__h),OH(n,o),o.__e!=s&&bH(o)),tc.length>e&&tc.sort(function(c,u){return c.__v.__b-u.__v.__b}));ov.__r=0}function _H(t,e,r,n,i,o,s,a,c,u){var l,h,d,m,v,x,O,I=n&&n.__k||mH,j=I.length;for(r.__k=[],l=0;l<e.length;l++)if((m=r.__k[l]=(m=e[l])==null||typeof m=="boolean"?null:typeof m=="string"||typeof m=="number"||typeof m=="bigint"?qp(null,m,null,null,m):Array.isArray(m)?qp(Wp,{children:m},null,null,null):m.__b>0?qp(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)!=null){if(m.__=r,m.__b=r.__b+1,(d=I[l])===null||d&&m.key==d.key&&m.type===d.type)I[l]=void 0;else for(h=0;h<j;h++){if((d=I[h])&&m.key==d.key&&m.type===d.type){I[h]=void 0;break}d=null}sx(t,m,d=d||nv,i,o,s,a,c,u),v=m.__e,(h=m.ref)&&d.ref!=h&&(O||(O=[]),d.ref&&O.push(d.ref,null,m),O.push(h,m.__c||v,m)),v!=null?(x==null&&(x=v),typeof m.type=="function"&&m.__k===d.__k?m.__d=c=wH(m,c,t):c=SH(t,m,d,I,v,c),typeof r.type=="function"&&(r.__d=c)):c&&d.__e==c&&c.parentNode!=t&&(c=Up(d))}for(r.__e=x,l=j;l--;)I[l]!=null&&(typeof r.type=="function"&&I[l].__e!=null&&I[l].__e==r.__d&&(r.__d=xH(n).nextSibling),AH(I[l],I[l]));if(O)for(l=0;l<O.length;l++)CH(O[l],O[++l],O[++l])}function wH(t,e,r){for(var n,i=t.__k,o=0;i&&o<i.length;o++)(n=i[o])&&(n.__=t,e=typeof n.type=="function"?wH(n,e,r):SH(r,n,n,i,n.__e,e));return e}function EH(t,e){return e=e||[],t==null||typeof t=="boolean"||(Array.isArray(t)?t.some(function(r){EH(r,e)}):e.push(t)),e}function SH(t,e,r,n,i,o){var s,a,c;if(e.__d!==void 0)s=e.__d,e.__d=void 0;else if(r==null||i!=o||i.parentNode==null)e:if(o==null||o.parentNode!==t)t.appendChild(i),s=null;else{for(a=o,c=0;(a=a.nextSibling)&&c<n.length;c+=1)if(a==i)break e;t.insertBefore(i,o),s=o}return s!==void 0?s:i.nextSibling}function xH(t){var e,r,n;if(t.type==null||typeof t.type=="string")return t.__e;if(t.__k){for(e=t.__k.length-1;e>=0;e--)if((r=t.__k[e])&&(n=xH(r)))return n}return null}function sx(t,e,r,n,i,o,s,a,c){var u,l,h,d,m,v,x,O,I,j,k,B,V,q,P,L=e.type;if(e.constructor!==void 0)return null;r.__h!=null&&(c=r.__h,a=e.__e=r.__e,e.__h=null,o=[a]),(u=Me.__b)&&u(e);try{e:if(typeof L=="function"){if(O=e.props,I=(u=L.contextType)&&n[u.__c],j=u?I?I.props.value:u.__:n,r.__c?x=(l=e.__c=r.__c).__=l.__E:("prototype"in L&&L.prototype.render?e.__c=l=new L(O,j):(e.__c=l=new Fp(O,j),l.constructor=L,l.render=kxe),I&&I.sub(l),l.props=O,l.state||(l.state={}),l.context=j,l.__n=n,h=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),L.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Ro({},l.__s)),Ro(l.__s,L.getDerivedStateFromProps(O,l.__s))),d=l.props,m=l.state,l.__v=e,h)L.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(L.getDerivedStateFromProps==null&&O!==d&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(O,j),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(O,l.__s,j)===!1||e.__v===r.__v){for(e.__v!==r.__v&&(l.props=O,l.state=l.__s,l.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.forEach(function(H){H&&(H.__=e)}),k=0;k<l._sb.length;k++)l.__h.push(l._sb[k]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(O,l.__s,j),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(d,m,v)})}if(l.context=j,l.props=O,l.__P=t,B=Me.__r,V=0,"prototype"in L&&L.prototype.render){for(l.state=l.__s,l.__d=!1,B&&B(e),u=l.render(l.props,l.state,l.context),q=0;q<l._sb.length;q++)l.__h.push(l._sb[q]);l._sb=[]}else do l.__d=!1,B&&B(e),u=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++V<25);l.state=l.__s,l.getChildContext!=null&&(n=Ro(Ro({},n),l.getChildContext())),h||l.getSnapshotBeforeUpdate==null||(v=l.getSnapshotBeforeUpdate(d,m)),P=u!=null&&u.type===Wp&&u.key==null?u.props.children:u,_H(t,Array.isArray(P)?P:[P],e,r,n,i,o,s,a,c),l.base=e.__e,e.__h=null,l.__h.length&&s.push(l),x&&(l.__E=l.__=null),l.__e=!1}else o==null&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=Nxe(r.__e,e,r,n,i,o,s,c);(u=Me.diffed)&&u(e)}catch(H){e.__v=null,(c||o!=null)&&(e.__e=a,e.__h=!!c,o[o.indexOf(a)]=null),Me.__e(H,e,r)}}function OH(t,e){Me.__c&&Me.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(n){n.call(r)})}catch(n){Me.__e(n,r.__v)}})}function Nxe(t,e,r,n,i,o,s,a){var c,u,l,h=r.props,d=e.props,m=e.type,v=0;if(m==="svg"&&(i=!0),o!=null){for(;v<o.length;v++)if((c=o[v])&&"setAttribute"in c==!!m&&(m?c.localName===m:c.nodeType===3)){t=c,o[v]=null;break}}if(t==null){if(m===null)return document.createTextNode(d);t=i?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,d.is&&d),o=null,a=!1}if(m===null)h===d||a&&t.data===d||(t.data=d);else{if(o=o&&$p.call(t.childNodes),u=(h=r.props||nv).dangerouslySetInnerHTML,l=d.dangerouslySetInnerHTML,!a){if(o!=null)for(h={},v=0;v<t.attributes.length;v++)h[t.attributes[v].name]=t.attributes[v].value;(l||u)&&(l&&(u&&l.__html==u.__html||l.__html===t.innerHTML)||(t.innerHTML=l&&l.__html||""))}if(Pxe(t,d,h,i,a),l)e.__k=[];else if(v=e.props.children,_H(t,Array.isArray(v)?v:[v],e,r,n,i&&m!=="foreignObject",o,s,o?o[0]:r.__k&&Up(r,0),a),o!=null)for(v=o.length;v--;)o[v]!=null&&yH(o[v]);a||("value"in d&&(v=d.value)!==void 0&&(v!==t.value||m==="progress"&&!v||m==="option"&&v!==h.value)&&iv(t,"value",v,h.value,!1),"checked"in d&&(v=d.checked)!==void 0&&v!==t.checked&&iv(t,"checked",v,h.checked,!1))}return t}function CH(t,e,r){try{typeof t=="function"?t(e):t.current=e}catch(n){Me.__e(n,r)}}function AH(t,e,r){var n,i;if(Me.unmount&&Me.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||CH(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){Me.__e(o,e)}n.base=n.__P=null,t.__c=void 0}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&AH(n[i],e,r||typeof t.type!="function");r||t.__e==null||yH(t.__e),t.__=t.__e=t.__d=void 0}function kxe(t,e,r){return this.constructor(t,r)}function IH(t,e,r){var n,i,o;Me.__&&Me.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,o=[],sx(e,t=(!n&&r||e).__k=vH(Wp,null,[t]),i||nv,nv,e.ownerSVGElement!==void 0,!n&&r?[r]:i?null:e.firstChild?$p.call(e.childNodes):null,o,!n&&r?r:i?i.__e:e.firstChild,n),OH(o,t)}function MH(t,e){IH(t,e,MH)}function Lxe(t,e,r){var n,i,o,s=Ro({},t.props);for(o in e)o=="key"?n=e[o]:o=="ref"?i=e[o]:s[o]=e[o];return arguments.length>2&&(s.children=arguments.length>3?$p.call(arguments,2):r),qp(t.type,s,n||t.key,i||t.ref,null)}function jxe(t,e){var r={__c:e="__cC"+gH++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,o;return this.getChildContext||(i=[],(o={})[e]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&i.some(function(a){a.__e=!0,ox(a)})},this.sub=function(s){i.push(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){i.splice(i.indexOf(s),1),a&&a.call(s)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}var $p,Me,hH,dH,ml,tc,cH,pH,gH,nv,mH,Rxe,Qr=ie(()=>{nv={},mH=[],Rxe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;$p=mH.slice,Me={__e:function(t,e,r,n){for(var i,o,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(a){t=a}throw t}},hH=0,dH=function(t){return t!=null&&t.constructor===void 0},ml=!1,Fp.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ro({},this.state),typeof t=="function"&&(t=t(Ro({},r),this.props)),t&&Ro(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),ox(this))},Fp.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ox(this))},Fp.prototype.render=Wp,tc=[],pH=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ov.__r=0,gH=0});var Hp=_((t$e,ax)=>{function TH(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=TH(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function RH(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=TH(t))&&(n&&(n+=" "),n+=e);return n}ax.exports=RH,ax.exports.clsx=RH});var vl={};ir(vl,{useCallback:()=>Uxe,useContext:()=>$xe,useDebugValue:()=>Wxe,useEffect:()=>Bxe,useErrorBoundary:()=>Hxe,useId:()=>zxe,useImperativeHandle:()=>Fxe,useLayoutEffect:()=>$H,useMemo:()=>lx,useReducer:()=>UH,useRef:()=>qxe,useState:()=>FH});function rc(t,e){Me.__h&&Me.__h($t,t,yl||e),yl=0;var r=$t.__H||($t.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:sv}),r.__[t]}function FH(t){return yl=1,UH(WH,t)}function UH(t,e,r){var n=rc(Ss++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):WH(void 0,e),function(o){var s=n.__N?n.__N[0]:n.__[0],a=n.t(s,o);s!==a&&(n.__N=[a,n.__[1]],n.__c.setState({}))}],n.__c=$t,!$t.u)){$t.u=!0;var i=$t.shouldComponentUpdate;$t.shouldComponentUpdate=function(o,s,a){if(!n.__c.__H)return!0;var c=n.__c.__H.__.filter(function(l){return l.__c});if(c.every(function(l){return!l.__N}))return!i||i.call(this,o,s,a);var u=!1;return c.forEach(function(l){if(l.__N){var h=l.__[0];l.__=l.__N,l.__N=void 0,h!==l.__[0]&&(u=!0)}}),!(!u&&n.__c.props===o)&&(!i||i.call(this,o,s,a))}}return n.__N||n.__}function Bxe(t,e){var r=rc(Ss++,3);!Me.__s&&fx(r.__H,e)&&(r.__=t,r.i=e,$t.__H.__h.push(r))}function $H(t,e){var r=rc(Ss++,4);!Me.__s&&fx(r.__H,e)&&(r.__=t,r.i=e,$t.__h.push(r))}function qxe(t){return yl=5,lx(function(){return{current:t}},[])}function Fxe(t,e,r){yl=6,$H(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function lx(t,e){var r=rc(Ss++,7);return fx(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function Uxe(t,e){return yl=8,lx(function(){return t},e)}function $xe(t){var e=$t.context[t.__c],r=rc(Ss++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub($t)),e.props.value):t.__}function Wxe(t,e){Me.useDebugValue&&Me.useDebugValue(e?e(t):t)}function Hxe(t){var e=rc(Ss++,10),r=FH();return e.__=t,$t.componentDidCatch||($t.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function zxe(){var t=rc(Ss++,11);if(!t.__){for(var e=$t.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function Vxe(){for(var t;t=qH.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(av),t.__H.__h.forEach(ux),t.__H.__h=[]}catch(e){t.__H.__h=[],Me.__e(e,t.__v)}}function Gxe(t){var e,r=function(){clearTimeout(n),BH&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);BH&&(e=requestAnimationFrame(r))}function av(t){var e=$t,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),$t=e}function ux(t){var e=$t;t.__c=t.__(),$t=e}function fx(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function WH(t,e){return typeof e=="function"?e(t):e}var Ss,$t,cx,PH,yl,qH,sv,DH,NH,kH,LH,jH,BH,bl=ie(()=>{Qr();yl=0,qH=[],sv=[],DH=Me.__b,NH=Me.__r,kH=Me.diffed,LH=Me.__c,jH=Me.unmount;Me.__b=function(t){$t=null,DH&&DH(t)},Me.__r=function(t){NH&&NH(t),Ss=0;var e=($t=t.__c).__H;e&&(cx===$t?(e.__h=[],$t.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=sv,r.__N=r.i=void 0})):(e.__h.forEach(av),e.__h.forEach(ux),e.__h=[])),cx=$t},Me.diffed=function(t){kH&&kH(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(qH.push(e)!==1&&PH===Me.requestAnimationFrame||((PH=Me.requestAnimationFrame)||Gxe)(Vxe)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==sv&&(r.__=r.__V),r.i=void 0,r.__V=sv})),cx=$t=null},Me.__c=function(t,e){e.some(function(r){try{r.__h.forEach(av),r.__h=r.__h.filter(function(n){return!n.__||ux(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Me.__e(n,r.__v)}}),LH&&LH(t,e)},Me.unmount=function(t){jH&&jH(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{av(n)}catch(i){e=i}}),r.__H=void 0,e&&Me.__e(e,r.__v))};BH=typeof requestAnimationFrame=="function"});var HH=_(cv=>{"use strict";Object.defineProperty(cv,"__esModule",{value:!0});cv.LIB_VERSION=void 0;cv.LIB_VERSION="3.6.3"});var VH=_(uv=>{"use strict";Object.defineProperty(uv,"__esModule",{value:!0});uv.CloseIcon=void 0;var zH=(Qr(),or(hn));function Kxe(t){return(0,zH.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,zH.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}uv.CloseIcon=Kxe});var GH=_(hx=>{"use strict";Object.defineProperty(hx,"__esModule",{value:!0});hx.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4="});var KH=_(dx=>{"use strict";Object.defineProperty(dx,"__esModule",{value:!0});dx.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg=="});var YH=_(lv=>{"use strict";Object.defineProperty(lv,"__esModule",{value:!0});lv.QRCodeIcon=void 0;var Ni=(Qr(),or(hn));function Yxe(t){return(0,Ni.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ni.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,Ni.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,Ni.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,Ni.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,Ni.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,Ni.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,Ni.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,Ni.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,Ni.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}lv.QRCodeIcon=Yxe});var ZH=_(px=>{"use strict";Object.defineProperty(px,"__esModule",{value:!0});var Zxe=`
37
+ <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
38
+ <path d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100Z" fill="white"/>
39
+ <path d="M50.512 94C74.2907 94 93.5673 74.5244 93.5673 50.5C93.5673 26.4756 74.2907 7 50.512 7C26.7332 7 7.45667 26.4756 7.45667 50.5C7.45667 74.5244 26.7332 94 50.512 94Z" fill="#0052FF"/>
40
+ <path d="M50.6248 65.4335C42.3697 65.4335 35.8996 58.7469 35.8996 50.5C35.8996 42.2531 42.5928 35.5664 50.6248 35.5664C57.9873 35.5664 64.0111 40.9157 65.1267 48.0481H80.0749C78.7363 32.6688 66.0191 20.6328 50.6248 20.6328C34.3379 20.6328 20.9514 34.0062 20.9514 50.5C20.9514 66.9936 34.1148 80.3671 50.6248 80.3671C66.2422 80.3671 78.7363 68.331 80.0749 52.9516H65.1267C64.0111 60.0841 57.9873 65.4335 50.6248 65.4335Z" fill="white"/>
41
+ </svg>
42
+ `;px.default=Zxe});var JH=_(gx=>{"use strict";Object.defineProperty(gx,"__esModule",{value:!0});gx.default=`
43
+ <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
44
+ <circle cx="50" cy="50" r="50" fill="white"/>
45
+ <circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/>
46
+ <circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/>
47
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M19.3379 49.9484C19.3379 66.8508 33.04 80.553 49.9425 80.553C66.8449 80.553 80.5471 66.8508 80.5471 49.9484C80.5471 33.0459 66.8449 19.3438 49.9425 19.3438C33.04 19.3438 19.3379 33.0459 19.3379 49.9484ZM44.0817 40.0799C41.8725 40.0799 40.0817 41.8708 40.0817 44.0799V55.8029C40.0817 58.012 41.8725 59.8029 44.0817 59.8029H55.8046C58.0138 59.8029 59.8046 58.012 59.8046 55.8029V44.0799C59.8046 41.8708 58.0138 40.0799 55.8046 40.0799H44.0817Z" fill="white"/>
48
+ </svg>
49
+ `});var XH=_(fv=>{"use strict";Object.defineProperty(fv,"__esModule",{value:!0});fv.StatusDotIcon=void 0;var QH=(Qr(),or(hn));function Jxe(t){return(0,QH.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,QH.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}fv.StatusDotIcon=Jxe});var iz=_((f$e,nz)=>{function ez(t){this.mode=On.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e<r;e++){var n=[],i=this.data.charCodeAt(e);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}ez.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e<r;e++)t.put(this.parsedData[e],8)}};function Li(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Li.prototype={addData:function(t){var e=new ez(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Li.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=Zt.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var o=0;o<this.modules.length;o++)for(var s=o*i,a=0;a<this.modules[o].length;a++){var c=a*i,u=this.modules[o][a];u&&(n.beginFill(0,100),n.moveTo(c,s),n.lineTo(c+i,s),n.lineTo(c+i,s+i),n.lineTo(c,s+i),n.endFill())}return n},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=Zt.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var r=0;r<t.length;r++){var n=t[e],i=t[r];if(this.modules[n][i]==null)for(var o=-2;o<=2;o++)for(var s=-2;s<=2;s++)o==-2||o==2||s==-2||s==2||o==0&&s==0?this.modules[n+o][i+s]=!0:this.modules[n+o][i+s]=!1}},setupTypeNumber:function(t){for(var e=Zt.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=Zt.getBCHTypeInfo(r),i=0;i<15;i++){var o=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(var i=0;i<15;i++){var o=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(s==6&&s--;;){for(var a=0;a<2;a++)if(this.modules[n][s-a]==null){var c=!1;o<t.length&&(c=(t[o]>>>i&1)==1);var u=Zt.getMask(e,n,s-a);u&&(c=!c),this.modules[n][s-a]=c,i--,i==-1&&(o++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Li.PAD0=236;Li.PAD1=17;Li.createData=function(t,e,r){for(var n=ki.getRSBlocks(t,e),i=new tz,o=0;o<r.length;o++){var s=r[o];i.put(s.mode,4),i.put(s.getLength(),Zt.getLengthInBits(s.mode,t)),s.write(i)}for(var a=0,o=0;o<n.length;o++)a+=n[o].dataCount;if(i.getLengthInBits()>a*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(Li.PAD0,8),i.getLengthInBits()>=a*8));)i.put(Li.PAD1,8);return Li.createBytes(i,n)};Li.createBytes=function(t,e){for(var r=0,n=0,i=0,o=new Array(e.length),s=new Array(e.length),a=0;a<e.length;a++){var c=e[a].dataCount,u=e[a].totalCount-c;n=Math.max(n,c),i=Math.max(i,u),o[a]=new Array(c);for(var l=0;l<o[a].length;l++)o[a][l]=255&t.buffer[l+r];r+=c;var h=Zt.getErrorCorrectPolynomial(u),d=new _l(o[a],h.getLength()-1),m=d.mod(h);s[a]=new Array(h.getLength()-1);for(var l=0;l<s[a].length;l++){var v=l+m.getLength()-s[a].length;s[a][l]=v>=0?m.get(v):0}}for(var x=0,l=0;l<e.length;l++)x+=e[l].totalCount;for(var O=new Array(x),I=0,l=0;l<n;l++)for(var a=0;a<e.length;a++)l<o[a].length&&(O[I++]=o[a][l]);for(var l=0;l<i;l++)for(var a=0;a<e.length;a++)l<s[a].length&&(O[I++]=s[a][l]);return O};var On={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3},Os={L:1,M:0,Q:3,H:2},xs={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Zt={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(t){for(var e=t<<10;Zt.getBCHDigit(e)-Zt.getBCHDigit(Zt.G15)>=0;)e^=Zt.G15<<Zt.getBCHDigit(e)-Zt.getBCHDigit(Zt.G15);return(t<<10|e)^Zt.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;Zt.getBCHDigit(e)-Zt.getBCHDigit(Zt.G18)>=0;)e^=Zt.G18<<Zt.getBCHDigit(e)-Zt.getBCHDigit(Zt.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return Zt.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case xs.PATTERN000:return(e+r)%2==0;case xs.PATTERN001:return e%2==0;case xs.PATTERN010:return r%3==0;case xs.PATTERN011:return(e+r)%3==0;case xs.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case xs.PATTERN101:return e*r%2+e*r%3==0;case xs.PATTERN110:return(e*r%2+e*r%3)%2==0;case xs.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new _l([1],0),r=0;r<t;r++)e=e.multiply(new _l([1,Er.gexp(r)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case On.MODE_NUMBER:return 10;case On.MODE_ALPHA_NUM:return 9;case On.MODE_8BIT_BYTE:return 8;case On.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case On.MODE_NUMBER:return 12;case On.MODE_ALPHA_NUM:return 11;case On.MODE_8BIT_BYTE:return 16;case On.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case On.MODE_NUMBER:return 14;case On.MODE_ALPHA_NUM:return 13;case On.MODE_8BIT_BYTE:return 16;case On.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+e)},getLostPoint:function(t){for(var e=t.getModuleCount(),r=0,n=0;n<e;n++)for(var i=0;i<e;i++){for(var o=0,s=t.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||e<=n+a))for(var c=-1;c<=1;c++)i+c<0||e<=i+c||a==0&&c==0||s==t.isDark(n+a,i+c)&&o++;o>5&&(r+=3+o-5)}for(var n=0;n<e-1;n++)for(var i=0;i<e-1;i++){var u=0;t.isDark(n,i)&&u++,t.isDark(n+1,i)&&u++,t.isDark(n,i+1)&&u++,t.isDark(n+1,i+1)&&u++,(u==0||u==4)&&(r+=3)}for(var n=0;n<e;n++)for(var i=0;i<e-6;i++)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(r+=40);for(var i=0;i<e;i++)for(var n=0;n<e-6;n++)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(r+=40);for(var l=0,i=0;i<e;i++)for(var n=0;n<e;n++)t.isDark(n,i)&&l++;var h=Math.abs(100*l/e/e-50)/5;return r+=h*10,r}},Er={glog:function(t){if(t<1)throw new Error("glog("+t+")");return Er.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return Er.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(lr=0;lr<8;lr++)Er.EXP_TABLE[lr]=1<<lr;var lr;for(lr=8;lr<256;lr++)Er.EXP_TABLE[lr]=Er.EXP_TABLE[lr-4]^Er.EXP_TABLE[lr-5]^Er.EXP_TABLE[lr-6]^Er.EXP_TABLE[lr-8];var lr;for(lr=0;lr<255;lr++)Er.LOG_TABLE[Er.EXP_TABLE[lr]]=lr;var lr;function _l(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var r=0;r<t.length&&t[r]==0;)r++;this.num=new Array(t.length-r+e);for(var n=0;n<t.length-r;n++)this.num[n]=t[n+r]}_l.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<t.getLength();n++)e[r+n]^=Er.gexp(Er.glog(this.get(r))+Er.glog(t.get(n)));return new _l(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=Er.glog(this.get(0))-Er.glog(t.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<t.getLength();n++)r[n]^=Er.gexp(Er.glog(t.get(n))+e);return new _l(r,0).mod(t)}};function ki(t,e){this.totalCount=t,this.dataCount=e}ki.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];ki.getRSBlocks=function(t,e){var r=ki.getRsBlockTable(t,e);if(r==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var n=r.length/3,i=[],o=0;o<n;o++)for(var s=r[o*3+0],a=r[o*3+1],c=r[o*3+2],u=0;u<s;u++)i.push(new ki(a,c));return i};ki.getRsBlockTable=function(t,e){switch(e){case Os.L:return ki.RS_BLOCK_TABLE[(t-1)*4+0];case Os.M:return ki.RS_BLOCK_TABLE[(t-1)*4+1];case Os.Q:return ki.RS_BLOCK_TABLE[(t-1)*4+2];case Os.H:return ki.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};function tz(){this.buffer=[],this.length=0}tz.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var 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 mx=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function rz(t){var e=this;if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var r in t)this.options[r]=t[r];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function n(u){switch(u){case"L":return Os.L;case"M":return Os.M;case"Q":return Os.Q;case"H":return Os.H;default:throw new Error("Unknwon error correction level: "+u)}}function i(u,l){for(var h=o(u),d=1,m=0,v=0,x=mx.length;v<=x;v++){var O=mx[v];if(!O)throw new Error("Content too long: expected "+m+" but got "+h);switch(l){case"L":m=O[0];break;case"M":m=O[1];break;case"Q":m=O[2];break;case"H":m=O[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(h<=m)break;d++}if(d>mx.length)throw new Error("Content too long");return d}function o(u){var l=encodeURI(u).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=u?3:0)}var s=this.options.content,a=i(s,this.options.ecl),c=n(this.options.ecl);this.qrcode=new Li(a,c),this.qrcode.addData(s),this.qrcode.make()}rz.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",o=n?`\r
50
+ `:"",s=e.width,a=e.height,c=r.length,u=s/(c+2*e.padding),l=a/(c+2*e.padding),h=typeof e.join<"u"?!!e.join:!1,d=typeof e.swap<"u"?!!e.swap:!1,m=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,v=typeof e.predefined<"u"?!!e.predefined:!1,x=v?i+'<defs><path id="qrmodule" d="M0 0 h'+l+" v"+u+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+o:"",O=i+'<rect x="0" y="0" width="'+s+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+o,I="",j="",k=0;k<c;k++)for(var B=0;B<c;B++){var V=r[B][k];if(V){var q=B*u+e.padding*u,P=k*l+e.padding*l;if(d){var L=q;q=P,P=L}if(h){var H=u+q,M=l+P;q=Number.isInteger(q)?Number(q):q.toFixed(2),P=Number.isInteger(P)?Number(P):P.toFixed(2),H=Number.isInteger(H)?Number(H):H.toFixed(2),M=Number.isInteger(M)?Number(M):M.toFixed(2),j+="M"+q+","+P+" V"+M+" H"+H+" V"+P+" H"+q+" Z "}else v?I+=i+'<use x="'+q.toString()+'" y="'+P.toString()+'" href="#qrmodule" />'+o:I+=i+'<rect x="'+q.toString()+'" y="'+P.toString()+'" width="'+u+'" height="'+l+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+o}}h&&(I=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+j+'" />');let N="";if(this.options.image!==void 0&&this.options.image.svg){let E=s*this.options.image.width/100,f=a*this.options.image.height/100,g=s/2-E/2,y=a/2-f/2;N+=`<svg x="${g}" y="${y}" width="${E}" height="${f}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,N+=this.options.image.svg+o,N+="</svg>"}var F="";switch(t.container){case"svg":m&&(F+='<?xml version="1.0" standalone="yes"?>'+o),F+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+s+'" height="'+a+'">'+o,F+=x+O+I,F+=N,F+="</svg>";break;case"svg-viewbox":m&&(F+='<?xml version="1.0" standalone="yes"?>'+o),F+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+s+" "+a+'">'+o,F+=x+O+I,F+=N,F+="</svg>";break;case"g":F+='<g width="'+s+'" height="'+a+'">'+o,F+=x+O+I,F+=N,F+="</g>";break;default:F+=(x+O+I+N).replace(/^\s+/,"");break}return F};nz.exports=rz});var sz=_(wl=>{"use strict";var Qxe=wl&&wl.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wl,"__esModule",{value:!0});wl.QRCode=void 0;var Xxe=(Qr(),or(hn)),oz=(bl(),or(vl)),e8e=Qxe(iz()),t8e=t=>{let[e,r]=(0,oz.useState)("");return(0,oz.useEffect)(()=>{var n,i;let o=new e8e.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),s=Buffer.from(o.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${s}`)}),e?(0,Xxe.h)("img",{src:e,alt:"QR Code"}):null};wl.QRCode=t8e});var az=_(yx=>{"use strict";Object.defineProperty(yx,"__esModule",{value:!0});yx.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}"});var cz=_(El=>{"use strict";var r8e=El&&El.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(El,"__esModule",{value:!0});El.Spinner=void 0;var hv=(Qr(),or(hn)),n8e=r8e(az()),i8e=t=>{var e;let r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,hv.h)("div",{class:"-cbwsdk-spinner"},(0,hv.h)("style",null,n8e.default),(0,hv.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,hv.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};El.Spinner=i8e});var uz=_(vx=>{"use strict";Object.defineProperty(vx,"__esModule",{value:!0});vx.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}"});var mz=_(zn=>{"use strict";var Sl=zn&&zn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zn,"__esModule",{value:!0});zn.CoinbaseAppSteps=zn.CoinbaseWalletSteps=zn.ConnectItem=zn.ConnectContent=void 0;var Hn=Sl(Hp()),xe=(Qr(),or(hn)),lz=(bl(),or(vl)),o8e=Io(),s8e=HH(),a8e=VH(),c8e=Sl(GH()),u8e=Sl(KH()),hz=YH(),l8e=Sl(ZH()),f8e=Sl(JH()),h8e=XH(),d8e=sz(),p8e=cz(),g8e=Sl(uz()),fz={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:u8e.default,steps:pz},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:c8e.default,steps:gz}},m8e=t=>{switch(t){case"coinbase-app":return l8e.default;case"coinbase-wallet-app":default:return f8e.default}},bx=t=>t==="light"?"#FFFFFF":"#0A0B0D";function y8e(t){let{theme:e}=t,[r,n]=(0,lz.useState)("coinbase-wallet-app"),i=(0,lz.useCallback)(u=>{n(u)},[]),o=(0,o8e.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),s=fz[r];if(!r)return null;let a=s.steps,c=r==="coinbase-app";return(0,xe.h)("div",{"data-testid":"connect-content",class:(0,Hn.default)("-cbwsdk-connect-content",e)},(0,xe.h)("style",null,g8e.default),(0,xe.h)("div",{class:"-cbwsdk-connect-content-header"},(0,xe.h)("h2",{class:(0,Hn.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,xe.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,xe.h)(a8e.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,xe.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,xe.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,xe.h)("div",null,Object.entries(fz).map(([u,l])=>(0,xe.h)(dz,{key:u,title:l.title,description:l.description,icon:l.icon,selected:r===u,onClick:()=>i(u),theme:e}))),c&&(0,xe.h)("div",{class:(0,Hn.default)("-cbwsdk-connect-content-update-app",e)},"Don\u2019t see a ",(0,xe.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,xe.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,xe.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,xe.h)(d8e.QRCode,{content:o,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:m8e(r),width:25,height:25}}),(0,xe.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:s8e.LIB_VERSION}),(0,xe.h)("input",{type:"hidden",value:o})),(0,xe.h)(a,{theme:e}),!t.isConnected&&(0,xe.h)("div",{"data-testid":"connecting-spinner",class:(0,Hn.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,xe.h)(p8e.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,xe.h)("p",null,"Connecting...")))))}zn.ConnectContent=y8e;function dz({title:t,description:e,icon:r,selected:n,theme:i,onClick:o}){return(0,xe.h)("div",{onClick:o,class:(0,Hn.default)("-cbwsdk-connect-item",i,{selected:n})},(0,xe.h)("div",null,(0,xe.h)("img",{src:r,alt:t})),(0,xe.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,xe.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,xe.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}zn.ConnectItem=dz;function pz({theme:t}){return(0,xe.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,xe.h)("li",{class:(0,Hn.default)("-cbwsdk-wallet-steps-item",t)},(0,xe.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,xe.h)("li",{class:(0,Hn.default)("-cbwsdk-wallet-steps-item",t)},(0,xe.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,xe.h)("span",null,"Tap ",(0,xe.h)("strong",null,"Scan")," "),(0,xe.h)("span",{class:(0,Hn.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,xe.h)(hz.QRCodeIcon,{fill:bx(t)})))))}zn.CoinbaseWalletSteps=pz;function gz({theme:t}){return(0,xe.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,xe.h)("li",{class:(0,Hn.default)("-cbwsdk-wallet-steps-item",t)},(0,xe.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,xe.h)("li",{class:(0,Hn.default)("-cbwsdk-wallet-steps-item",t)},(0,xe.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,xe.h)("span",null,"Tap ",(0,xe.h)("strong",null,"More")),(0,xe.h)("span",{class:(0,Hn.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,xe.h)(h8e.StatusDotIcon,{fill:bx(t)})),(0,xe.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,xe.h)("strong",null,"Scan")),(0,xe.h)("span",{class:(0,Hn.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,xe.h)(hz.QRCodeIcon,{fill:bx(t)})))))}zn.CoinbaseAppSteps=gz});var vz=_(dv=>{"use strict";Object.defineProperty(dv,"__esModule",{value:!0});dv.ArrowLeftIcon=void 0;var yz=(Qr(),or(hn));function v8e(t){return(0,yz.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,yz.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}dv.ArrowLeftIcon=v8e});var bz=_(pv=>{"use strict";Object.defineProperty(pv,"__esModule",{value:!0});pv.LaptopIcon=void 0;var _x=(Qr(),or(hn));function b8e(t){return(0,_x.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,_x.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,_x.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}pv.LaptopIcon=b8e});var wz=_(gv=>{"use strict";Object.defineProperty(gv,"__esModule",{value:!0});gv.SafeIcon=void 0;var _z=(Qr(),or(hn));function _8e(t){return(0,_z.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,_z.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}gv.SafeIcon=_8e});var Ez=_(wx=>{"use strict";Object.defineProperty(wx,"__esModule",{value:!0});wx.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}"});var xz=_(xl=>{"use strict";var Sz=xl&&xl.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xl,"__esModule",{value:!0});xl.TryExtensionContent=void 0;var nc=Sz(Hp()),fr=(Qr(),or(hn)),Ex=(bl(),or(vl)),w8e=vz(),E8e=bz(),S8e=wz(),x8e=Sz(Ez());function O8e({theme:t}){let[e,r]=(0,Ex.useState)(!1),n=(0,Ex.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Ex.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,fr.h)("div",{class:(0,nc.default)("-cbwsdk-try-extension",t)},(0,fr.h)("style",null,x8e.default),(0,fr.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,fr.h)("h3",{class:(0,nc.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,fr.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,fr.h)("button",{class:(0,nc.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,fr.h)("div",null,!e&&(0,fr.h)(w8e.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,fr.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,fr.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,fr.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,fr.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,fr.h)("span",{class:(0,nc.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,fr.h)(E8e.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,fr.h)("div",{class:(0,nc.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,fr.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,fr.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,fr.h)("span",{class:(0,nc.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,fr.h)(S8e.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,fr.h)("div",{class:(0,nc.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}xl.TryExtensionContent=O8e});var Oz=_(Sx=>{"use strict";Object.defineProperty(Sx,"__esModule",{value:!0});Sx.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}"});var Az=_(Ol=>{"use strict";var Cz=Ol&&Ol.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ol,"__esModule",{value:!0});Ol.ConnectDialog=void 0;var xx=Cz(Hp()),ic=(Qr(),or(hn)),Ox=(bl(),or(vl)),C8e=mz(),A8e=xz(),I8e=Cz(Oz()),M8e=t=>{let{isOpen:e,darkMode:r}=t,[n,i]=(0,Ox.useState)(!e),[o,s]=(0,Ox.useState)(!e);(0,Ox.useEffect)(()=>{let c=[window.setTimeout(()=>{s(!e)},10)];return e?i(!1):c.push(window.setTimeout(()=>{i(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t.isOpen]);let a=r?"dark":"light";return(0,ic.h)("div",{class:(0,xx.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,ic.h)("style",null,I8e.default),(0,ic.h)("div",{class:(0,xx.default)("-cbwsdk-connect-dialog-backdrop",a,o&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,ic.h)("div",{class:"-cbwsdk-connect-dialog"},(0,ic.h)("div",{class:(0,xx.default)("-cbwsdk-connect-dialog-box",o&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,ic.h)(C8e.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,ic.h)(A8e.TryExtensionContent,{theme:a}))))};Ol.ConnectDialog=M8e});var Mz=_(mv=>{"use strict";Object.defineProperty(mv,"__esModule",{value:!0});mv.LinkFlow=void 0;var Cx=(Qr(),or(hn)),Iz=Ta(),R8e=Az(),Ax=class{constructor(e){this.extensionUI$=new Iz.BehaviorSubject({}),this.subscriptions=new Iz.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection,this.connected$=e.connected$,this.chainId$=e.chainId$}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe(r=>{this.isConnected!==r&&(this.isConnected=r,this.render())})),this.subscriptions.add(this.chainId$.subscribe(r=>{this.chainId!==r&&(this.chainId=r,this.render())}))}detach(){var e;!this.root||(this.subscriptions.unsubscribe(),(0,Cx.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;let e=this.extensionUI$.subscribe(()=>{!this.root||(0,Cx.render)((0,Cx.h)(R8e.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)});this.subscriptions.add(e)}};mv.LinkFlow=Ax});var Rz=_(Ix=>{"use strict";Object.defineProperty(Ix,"__esModule",{value:!0});Ix.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"});var Pz=_(Vn=>{"use strict";var Tz=Vn&&Vn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.SnackbarInstance=Vn.SnackbarContainer=Vn.Snackbar=void 0;var yv=Tz(Hp()),hr=(Qr(),or(hn)),Mx=(bl(),or(vl)),T8e=Tz(Rz()),P8e="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function D8e(t){switch(t){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}var Rx=class{constructor(e){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=e.darkMode}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){let r=this.nextItemKey++;return this.items.set(r,e),this.render(),()=>{this.items.delete(r),this.render()}}clear(){this.items.clear(),this.render()}render(){!this.root||(0,hr.render)((0,hr.h)("div",null,(0,hr.h)(Vn.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,r])=>(0,hr.h)(Vn.SnackbarInstance,Object.assign({},r,{key:e}))))),this.root)}};Vn.Snackbar=Rx;var N8e=t=>(0,hr.h)("div",{class:(0,yv.default)("-cbwsdk-snackbar-container")},(0,hr.h)("style",null,T8e.default),(0,hr.h)("div",{class:"-cbwsdk-snackbar"},t.children));Vn.SnackbarContainer=N8e;var k8e=({autoExpand:t,message:e,menuItems:r,appSrc:n})=>{let[i,o]=(0,Mx.useState)(!0),[s,a]=(0,Mx.useState)(t??!1);(0,Mx.useEffect)(()=>{let u=[window.setTimeout(()=>{o(!1)},1),window.setTimeout(()=>{a(!0)},1e4)];return()=>{u.forEach(window.clearTimeout)}});let c=()=>{a(!s)};return(0,hr.h)("div",{class:(0,yv.default)("-cbwsdk-snackbar-instance",i&&"-cbwsdk-snackbar-instance-hidden",s&&"-cbwsdk-snackbar-instance-expanded")},(0,hr.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:c},(0,hr.h)("img",{src:D8e(n),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,hr.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),(0,hr.h)("div",{class:"-gear-container"},!s&&(0,hr.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,hr.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,hr.h)("img",{src:P8e,class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&(0,hr.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map((u,l)=>(0,hr.h)("div",{class:(0,yv.default)("-cbwsdk-snackbar-instance-menu-item",u.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:u.onClick,key:l},(0,hr.h)("svg",{width:u.svgWidth,height:u.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,hr.h)("path",{"fill-rule":u.defaultFillRule,"clip-rule":u.defaultClipRule,d:u.path,fill:"#AAAAAA"})),(0,hr.h)("span",{class:(0,yv.default)("-cbwsdk-snackbar-instance-menu-item-info",u.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},u.info)))))};Vn.SnackbarInstance=k8e});var Dz=_(Tx=>{"use strict";Object.defineProperty(Tx,"__esModule",{value:!0});Tx.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}'});var Nz=_(Cl=>{"use strict";var L8e=Cl&&Cl.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Cl,"__esModule",{value:!0});Cl.injectCssReset=void 0;var j8e=L8e(Dz());function B8e(){let t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(j8e.default)),document.documentElement.appendChild(t)}Cl.injectCssReset=B8e});var kz=_(vv=>{"use strict";Object.defineProperty(vv,"__esModule",{value:!0});vv.WalletSDKUI=void 0;var q8e=Mz(),F8e=Pz(),U8e=Nz(),Px=class{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new F8e.Snackbar({darkMode:e.darkMode}),this.linkFlow=new q8e.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,connected$:e.connected$,chainId$:e.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");let e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,U8e.injectCssReset)()}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(e){}watchAsset(e){}switchEthereumChain(e){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(e){}signEthereumTransaction(e){}submitEthereumTransaction(e){}ethereumAddressFromSignedMessage(e){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}setAppSrc(e){this.appSrc=e}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(e){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}};vv.WalletSDKUI=Px});var jz=_(bv=>{"use strict";Object.defineProperty(bv,"__esModule",{value:!0});var Al;(function(t){t.typeOfFunction="function",t.boolTrue=!0})(Al||(Al={}));function Lz(t,e,r){if(!r||typeof r.value!==Al.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:Al.boolTrue,get:function(){var n=r.value.bind(this);return Object.defineProperty(this,e,{value:n,configurable:Al.boolTrue,writable:Al.boolTrue}),n}}}bv.bind=Lz;bv.default=Lz});var Bz=_(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.ClientMessagePublishEvent=Gn.ClientMessageSetSessionConfig=Gn.ClientMessageGetSessionConfig=Gn.ClientMessageIsLinked=Gn.ClientMessageHostSession=void 0;function $8e(t){return Object.assign({type:"HostSession"},t)}Gn.ClientMessageHostSession=$8e;function W8e(t){return Object.assign({type:"IsLinked"},t)}Gn.ClientMessageIsLinked=W8e;function H8e(t){return Object.assign({type:"GetSessionConfig"},t)}Gn.ClientMessageGetSessionConfig=H8e;function z8e(t){return Object.assign({type:"SetSessionConfig"},t)}Gn.ClientMessageSetSessionConfig=z8e;function V8e(t){return Object.assign({type:"PublishEvent"},t)}Gn.ClientMessagePublishEvent=V8e});var Fz=_(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.RxWebSocket=oc.ConnectionState=void 0;var Il=Ta(),qz=sp(),Ml;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(Ml=oc.ConnectionState||(oc.ConnectionState={}));var Dx=class{constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.connectionStateSubject=new Il.BehaviorSubject(Ml.DISCONNECTED),this.incomingDataSubject=new Il.Subject,this.url=e.replace(/^http/,"ws")}connect(){return this.webSocket?(0,Il.throwError)(new Error("webSocket object is not null")):new Il.Observable(e=>{let r;try{this.webSocket=r=new this.WebSocketClass(this.url)}catch(n){e.error(n);return}this.connectionStateSubject.next(Ml.CONNECTING),r.onclose=n=>{this.clearWebSocket(),e.error(new Error(`websocket error ${n.code}: ${n.reason}`)),this.connectionStateSubject.next(Ml.DISCONNECTED)},r.onopen=n=>{e.next(),e.complete(),this.connectionStateSubject.next(Ml.CONNECTED)},r.onmessage=n=>{this.incomingDataSubject.next(n.data)}}).pipe((0,qz.take)(1))}disconnect(){let{webSocket:e}=this;if(!!e){this.clearWebSocket(),this.connectionStateSubject.next(Ml.DISCONNECTED);try{e.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,qz.flatMap)(e=>{let r;try{r=JSON.parse(e)}catch{return(0,Il.empty)()}return(0,Il.of)(r)}))}sendData(e){let{webSocket:r}=this;if(!r)throw new Error("websocket is not connected");r.send(e)}clearWebSocket(){let{webSocket:e}=this;!e||(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}};oc.RxWebSocket=Dx});var Uz=_(_v=>{"use strict";Object.defineProperty(_v,"__esModule",{value:!0});_v.isServerMessageFail=void 0;function G8e(t){return t&&t.type==="Fail"&&typeof t.id=="number"&&typeof t.sessionId=="string"&&typeof t.error=="string"}_v.isServerMessageFail=G8e});var Wz=_(Ev=>{"use strict";Object.defineProperty(Ev,"__esModule",{value:!0});Ev.WalletSDKConnection=void 0;var oi=Ta(),ze=sp(),zp=ry(),Rl=bp(),Vp=Bz(),Gp=om(),wv=Fz(),Nx=Uz(),$z=1e4,K8e=6e4,kx=class{constructor(e,r,n,i,o=WebSocket){this.sessionId=e,this.sessionKey=r,this.diagnostic=i,this.subscriptions=new oi.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Rl.IntNumber)(1),this.connectedSubject=new oi.BehaviorSubject(!1),this.linkedSubject=new oi.BehaviorSubject(!1),this.sessionConfigSubject=new oi.ReplaySubject(1);let s=new wv.RxWebSocket(n+"/rpc",o);this.ws=s,this.subscriptions.add(s.connectionState$.pipe((0,ze.tap)(a=>{var c;return(c=this.diagnostic)===null||c===void 0?void 0:c.log(Gp.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:zp.Session.hash(e)})}),(0,ze.skip)(1),(0,ze.filter)(a=>a===wv.ConnectionState.DISCONNECTED&&!this.destroyed),(0,ze.delay)(5e3),(0,ze.filter)(a=>!this.destroyed),(0,ze.flatMap)(a=>s.connect()),(0,ze.retry)()).subscribe()),this.subscriptions.add(s.connectionState$.pipe((0,ze.skip)(2),(0,ze.switchMap)(a=>(0,oi.iif)(()=>a===wv.ConnectionState.CONNECTED,this.authenticate().pipe((0,ze.tap)(c=>this.sendIsLinked()),(0,ze.tap)(c=>this.sendGetSessionConfig()),(0,ze.map)(c=>!0)),(0,oi.of)(!1))),(0,ze.distinctUntilChanged)(),(0,ze.catchError)(a=>(0,oi.of)(!1))).subscribe(a=>this.connectedSubject.next(a))),this.subscriptions.add(s.connectionState$.pipe((0,ze.skip)(1),(0,ze.switchMap)(a=>(0,oi.iif)(()=>a===wv.ConnectionState.CONNECTED,(0,oi.timer)(0,$z)))).subscribe(a=>a===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(s.incomingData$.pipe((0,ze.filter)(a=>a==="h")).subscribe(a=>this.updateLastHeartbeat())),this.subscriptions.add(s.incomingJSONData$.pipe((0,ze.filter)(a=>["IsLinkedOK","Linked"].includes(a.type))).subscribe(a=>{var c;let u=a;(c=this.diagnostic)===null||c===void 0||c.log(Gp.EVENTS.LINKED,{sessionIdHash:zp.Session.hash(e),linked:u.linked,type:a.type,onlineGuests:u.onlineGuests}),this.linkedSubject.next(u.linked||u.onlineGuests>0)})),this.subscriptions.add(s.incomingJSONData$.pipe((0,ze.filter)(a=>["GetSessionConfigOK","SessionConfigUpdated"].includes(a.type))).subscribe(a=>{var c;let u=a;(c=this.diagnostic)===null||c===void 0||c.log(Gp.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:zp.Session.hash(e),metadata_keys:u&&u.metadata?Object.keys(u.metadata):void 0}),this.sessionConfigSubject.next({webhookId:u.webhookId,webhookUrl:u.webhookUrl,metadata:u.metadata})}))}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(Gp.EVENTS.STARTED_CONNECTING,{sessionIdHash:zp.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(Gp.EVENTS.DISCONNECTED,{sessionIdHash:zp.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,ze.filter)(e=>e),(0,ze.take)(1),(0,ze.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,ze.filter)(e=>e),(0,ze.take)(1),(0,ze.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,ze.filter)(e=>{if(e.type!=="Event")return!1;let r=e;return typeof r.sessionId=="string"&&typeof r.eventId=="string"&&typeof r.event=="string"&&typeof r.data=="string"}),(0,ze.map)(e=>e))}setSessionMetadata(e,r){let n=(0,Vp.ClientMessageSetSessionConfig)({id:(0,Rl.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[e]:r}});return this.onceConnected$.pipe((0,ze.flatMap)(i=>this.makeRequest(n)),(0,ze.map)(i=>{if((0,Nx.isServerMessageFail)(i))throw new Error(i.error||"failed to set session metadata")}))}publishEvent(e,r,n=!1){let i=(0,Vp.ClientMessagePublishEvent)({id:(0,Rl.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:r,callWebhook:n});return this.onceLinked$.pipe((0,ze.flatMap)(o=>this.makeRequest(i)),(0,ze.map)(o=>{if((0,Nx.isServerMessageFail)(o))throw new Error(o.error||"failed to publish event");return o.eventId}))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>$z*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}makeRequest(e,r=K8e){let n=e.id;try{this.sendData(e)}catch(i){return(0,oi.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,ze.timeoutWith)(r,(0,oi.throwError)(new Error(`request ${n} timed out`))),(0,ze.filter)(i=>i.id===n),(0,ze.take)(1))}authenticate(){let e=(0,Vp.ClientMessageHostSession)({id:(0,Rl.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,ze.map)(r=>{if((0,Nx.isServerMessageFail)(r))throw new Error(r.error||"failed to authentcate")}))}sendIsLinked(){let e=(0,Vp.ClientMessageIsLinked)({id:(0,Rl.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}sendGetSessionConfig(){let e=(0,Vp.ClientMessageGetSessionConfig)({id:(0,Rl.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}};Ev.WalletSDKConnection=kx});var Hz=_(Sv=>{"use strict";Object.defineProperty(Sv,"__esModule",{value:!0});Sv.WalletUIError=void 0;var sc=class extends Error{constructor(e,r){super(e),this.message=e,this.errorCode=r}};Sv.WalletUIError=sc;sc.UserRejectedRequest=new sc("User rejected request");sc.SwitchEthereumChainUnsupportedChainId=new sc("Unsupported chainId",4902)});var zz=_(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.decrypt=Tl.encrypt=void 0;var Y8e=Ta(),xv=Io();async function Z8e(t,e){if(e.length!==64)throw Error("secret must be 256 bits");let r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,xv.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(t)),s=16,a=o.slice(o.byteLength-s),c=o.slice(0,o.byteLength-s),u=new Uint8Array(a),l=new Uint8Array(c),h=new Uint8Array([...r,...u,...l]);return(0,xv.uint8ArrayToHex)(h)}Tl.encrypt=Z8e;function J8e(t,e){if(e.length!==64)throw Error("secret must be 256 bits");return new Y8e.Observable(r=>{(async function(){let n=await crypto.subtle.importKey("raw",(0,xv.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=(0,xv.hexStringToUint8Array)(t),o=i.slice(0,12),s=i.slice(12,28),a=i.slice(28),c=new Uint8Array([...a,...s]),u={name:"AES-GCM",iv:new Uint8Array(o)};try{let l=await window.crypto.subtle.decrypt(u,n,c),h=new TextDecoder;r.next(h.decode(l)),r.complete()}catch(l){r.error(l)}})()})}Tl.decrypt=J8e});var Lx=_(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});Kp.Web3Method=void 0;var Q8e;(function(t){t.requestEthereumAccounts="requestEthereumAccounts",t.signEthereumMessage="signEthereumMessage",t.signEthereumTransaction="signEthereumTransaction",t.submitEthereumTransaction="submitEthereumTransaction",t.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",t.scanQRCode="scanQRCode",t.generic="generic",t.childRequestEthereumAccounts="childRequestEthereumAccounts",t.addEthereumChain="addEthereumChain",t.switchEthereumChain="switchEthereumChain",t.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",t.watchAsset="watchAsset",t.selectProvider="selectProvider"})(Q8e=Kp.Web3Method||(Kp.Web3Method={}))});var Ov=_(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});Yp.RelayMessageType=void 0;var X8e;(function(t){t.SESSION_ID_REQUEST="SESSION_ID_REQUEST",t.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",t.LINKED="LINKED",t.UNLINKED="UNLINKED",t.WEB3_REQUEST="WEB3_REQUEST",t.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",t.WEB3_RESPONSE="WEB3_RESPONSE"})(X8e=Yp.RelayMessageType||(Yp.RelayMessageType={}))});var Vz=_(Cv=>{"use strict";Object.defineProperty(Cv,"__esModule",{value:!0});Cv.Web3RequestCanceledMessage=void 0;var eOe=Ov();function tOe(t){return{type:eOe.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}}Cv.Web3RequestCanceledMessage=tOe});var Gz=_(Av=>{"use strict";Object.defineProperty(Av,"__esModule",{value:!0});Av.Web3RequestMessage=void 0;var rOe=Ov();function nOe(t){return Object.assign({type:rOe.RelayMessageType.WEB3_REQUEST},t)}Av.Web3RequestMessage=nOe});var Kz=_(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.EthereumAddressFromSignedMessageResponse=Ht.SubmitEthereumTransactionResponse=Ht.SignEthereumTransactionResponse=Ht.SignEthereumMessageResponse=Ht.isRequestEthereumAccountsResponse=Ht.SelectProviderResponse=Ht.WatchAssetReponse=Ht.RequestEthereumAccountsResponse=Ht.SwitchEthereumChainResponse=Ht.AddEthereumChainResponse=Ht.ErrorResponse=void 0;var ji=Lx();function iOe(t,e,r){return{method:t,errorMessage:e,errorCode:r}}Ht.ErrorResponse=iOe;function oOe(t){return{method:ji.Web3Method.addEthereumChain,result:t}}Ht.AddEthereumChainResponse=oOe;function sOe(t){return{method:ji.Web3Method.switchEthereumChain,result:t}}Ht.SwitchEthereumChainResponse=sOe;function aOe(t){return{method:ji.Web3Method.requestEthereumAccounts,result:t}}Ht.RequestEthereumAccountsResponse=aOe;function cOe(t){return{method:ji.Web3Method.watchAsset,result:t}}Ht.WatchAssetReponse=cOe;function uOe(t){return{method:ji.Web3Method.selectProvider,result:t}}Ht.SelectProviderResponse=uOe;function lOe(t){return t&&t.method===ji.Web3Method.requestEthereumAccounts}Ht.isRequestEthereumAccountsResponse=lOe;function fOe(t){return{method:ji.Web3Method.signEthereumMessage,result:t}}Ht.SignEthereumMessageResponse=fOe;function hOe(t){return{method:ji.Web3Method.signEthereumTransaction,result:t}}Ht.SignEthereumTransactionResponse=hOe;function dOe(t){return{method:ji.Web3Method.submitEthereumTransaction,result:t}}Ht.SubmitEthereumTransactionResponse=dOe;function pOe(t){return{method:ji.Web3Method.ethereumAddressFromSignedMessage,result:t}}Ht.EthereumAddressFromSignedMessageResponse=pOe});var Zz=_(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.isWeb3ResponseMessage=Pl.Web3ResponseMessage=void 0;var Yz=Ov();function gOe(t){return Object.assign({type:Yz.RelayMessageType.WEB3_RESPONSE},t)}Pl.Web3ResponseMessage=gOe;function mOe(t){return t&&t.type===Yz.RelayMessageType.WEB3_RESPONSE}Pl.isWeb3ResponseMessage=mOe});var eV=_(dn=>{"use strict";var yOe=dn&&dn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),vOe=dn&&dn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Qz=dn&&dn.__decorate||function(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o},bOe=dn&&dn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&yOe(e,t,r);return vOe(e,t),e},_Oe=dn&&dn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(dn,"__esModule",{value:!0});dn.WalletSDKRelay=void 0;var Xz=_Oe(jz()),Jz=nm(),Zp=Ta(),vr=sp(),Ur=om(),wOe=Wz(),jx=Hz(),EOe=bp(),zt=Io(),Cs=bOe(zz()),As=ry(),Iv=x6(),Sr=Lx(),SOe=Vz(),xOe=Gz(),Cn=Kz(),Xr=Zz(),An=class extends Iv.WalletSDKRelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new Zp.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new Zp.Subscription,this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;let{session:n,ui:i,connection:o}=this.subscribe();if(this._session=n,this.connection=o,this.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this.diagnostic={log:e.eventListener.onEvent}:this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe(i=>{this.dappDefaultChain!==i&&(this.dappDefaultChain=i)}));let e=As.Session.load(this.storage)||new As.Session(this.storage).save(),r=new wOe.WalletSDKConnection(e.id,e.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(r.sessionConfig$.subscribe({next:i=>{this.onSessionConfigChanged(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Ur.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(r.incomingEvent$.pipe((0,vr.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(r.linked$.pipe((0,vr.skip)(1),(0,vr.tap)(i=>{var o;this.isLinked=i;let s=this.storage.getItem(Iv.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this.session.linked=i),this.isUnlinkedErrorState=!1,s){let a=s.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";if(a[0]!==""&&!i&&this.session.linked&&!c){this.isUnlinkedErrorState=!0;let u=this.getSessionIdHash();(o=this.diagnostic)===null||o===void 0||o.log(Ur.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:u})}}})).subscribe()),this.subscriptions.add(r.sessionConfig$.pipe((0,vr.filter)(i=>!!i.metadata&&i.metadata.__destroyed==="1")).subscribe(()=>{var i;let o=r.isDestroyed;return(i=this.diagnostic)===null||i===void 0||i.log(Ur.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:o,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(r.sessionConfig$.pipe((0,vr.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,vr.mergeMap)(i=>Cs.decrypt(i.metadata.WalletUsername,e.secret))).subscribe({next:i=>{this.storage.setItem(Iv.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Ur.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,vr.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,vr.mergeMap)(i=>Cs.decrypt(i.metadata.AppVersion,e.secret))).subscribe({next:i=>{this.storage.setItem(Iv.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Ur.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,vr.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,vr.mergeMap)(i=>(0,Zp.zip)(Cs.decrypt(i.metadata.ChainId,e.secret),Cs.decrypt(i.metadata.JsonRpcUrl,e.secret)))).pipe((0,vr.distinctUntilChanged)()).subscribe({next:([i,o])=>{this.chainCallback&&this.chainCallback(i,o)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Ur.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,vr.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,vr.mergeMap)(i=>Cs.decrypt(i.metadata.EthereumAddress,e.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),An.accountRequestCallbackIds.size>0&&(Array.from(An.accountRequestCallbackIds.values()).forEach(o=>{let s=(0,Xr.Web3ResponseMessage)({id:o,response:(0,Cn.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},s),{id:o}))}),An.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Ur.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,vr.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,vr.mergeMap)(i=>Cs.decrypt(i.metadata.AppSrc,e.secret))).subscribe({next:i=>{this.ui.setAppSrc(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Ur.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));let n=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:e,connected$:r.connected$,chainId$:this.dappDefaultChainSubject});return r.connect(),{session:e,ui:n,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,vr.timeout)(1e3),(0,vr.catchError)(e=>(0,Zp.of)(null))).subscribe(e=>{var r,n,i;let o=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch{(r=this.diagnostic)===null||r===void 0||r.log(Ur.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(n=this.diagnostic)===null||n===void 0||n.log(Ur.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();let s=As.Session.load(this.storage);if(s?.id===this._session.id?this.storage.clear():s&&((i=this.diagnostic)===null||i===void 0||i.log(Ur.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:As.Session.hash(s.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);let{session:a,ui:c,connection:u}=this.subscribe();this._session=a,this.connection=u,this.ui=c,o&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()},e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Ur.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:Sr.Web3Method.signEthereumMessage,params:{message:(0,zt.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:Sr.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,zt.hexStringFromBuffer)(e,!0),signature:(0,zt.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:Sr.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,zt.bigIntStringFromBN)(e.weiValue),data:(0,zt.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,zt.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,zt.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,zt.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,zt.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:Sr.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,zt.bigIntStringFromBN)(e.weiValue),data:(0,zt.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,zt.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,zt.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,zt.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,zt.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:Sr.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,zt.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:Sr.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,zt.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:Sr.Web3Method.generic,params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null,n=(0,zt.randomBytesHex)(8),i=s=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,s),r?.()};return{promise:new Promise((s,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r?.(),c.errorMessage)return a(new Error(c.errorMessage));s(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChainSubject.next(e)}publishWeb3RequestEvent(e,r){var n;let i=(0,xOe.Web3RequestMessage)({id:e,request:r}),o=As.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Ur.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o?As.Session.hash(o.id):"",isSessionMismatched:(o?.id!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:s=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(Ur.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o?As.Session.hash(o.id):"",isSessionMismatched:(o?.id!==this._session.id).toString()})},error:s=>{this.handleWeb3ResponseMessage((0,Xr.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:s.message}}))}}))}publishWeb3RequestCanceledEvent(e){let r=(0,SOe.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",r,!1).subscribe())}publishEvent(e,r,n){let i=this.session.secret;return new Zp.Observable(o=>{Cs.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin})),i).then(s=>{o.next(s),o.complete()})}).pipe((0,vr.mergeMap)(o=>this.connection.publishEvent(e,o,n)))}handleIncomingEvent(e){try{this.subscriptions.add(Cs.decrypt(e.data,this.session.secret).pipe((0,vr.map)(r=>JSON.parse(r))).subscribe({next:r=>{let n=(0,Xr.isWeb3ResponseMessage)(r)?r:null;!n||this.handleWeb3ResponseMessage(n)},error:()=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Ur.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(e){var r;let{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(Ur.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,Cn.isRequestEthereumAccountsResponse)(n)){An.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),An.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){this.handleWeb3ResponseMessage((0,Xr.Web3ResponseMessage)({id:e,response:(0,Cn.ErrorResponse)(r,(n??jx.WalletUIError.UserRejectedRequest).message,i)}))}invokeCallback(e){let r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){let e={method:Sr.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=null,n=(0,zt.randomBytesHex)(8),i=s=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,s),r?.()};return{promise:new Promise((s,a)=>{var c;this.relayEventManager.callbacks.set(n,l=>{if(this.ui.hideRequestEthereumAccounts(),r?.(),l.errorMessage)return a(new Error(l.errorMessage));s(l)});let u=((c=window?.navigator)===null||c===void 0?void 0:c.userAgent)||null;if(u&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(u)){let l;try{(0,zt.isInIFrame)()&&window.top?l=window.top.location:l=window.location}catch{l=window.location}l.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(l.href)}`;return}if(this.ui.inlineAccountsResponse()){let l=h=>{this.handleWeb3ResponseMessage((0,Xr.Web3ResponseMessage)({id:n,response:(0,Cn.RequestEthereumAccountsResponse)(h)}))};this.ui.requestEthereumAccounts({onCancel:i,onAccounts:l})}else{let l=Jz.ethErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>i(l)})}An.accountRequestCallbackIds.add(n),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(n,e)}),cancel:i}}selectProvider(e){let r={method:Sr.Web3Method.selectProvider,params:{providerOptions:e}},n=(0,zt.randomBytesHex)(8),i=s=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,s)},o=new Promise((s,a)=>{this.relayEventManager.callbacks.set(n,l=>{if(l.errorMessage)return a(new Error(l.errorMessage));s(l)});let c=l=>{this.handleWeb3ResponseMessage((0,Xr.Web3ResponseMessage)({id:n,response:(0,Cn.SelectProviderResponse)(EOe.ProviderType.Unselected)}))},u=l=>{this.handleWeb3ResponseMessage((0,Xr.Web3ResponseMessage)({id:n,response:(0,Cn.SelectProviderResponse)(l)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:u,onCancel:c,providerOptions:e})});return{cancel:i,promise:o}}watchAsset(e,r,n,i,o,s){let a={method:Sr.Web3Method.watchAsset,params:{type:e,options:{address:r,symbol:n,decimals:i,image:o},chainId:s}},c=null,u=(0,zt.randomBytesHex)(8),l=d=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,d),c?.()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}));let h=new Promise((d,m)=>{this.relayEventManager.callbacks.set(u,O=>{if(c?.(),O.errorMessage)return m(new Error(O.errorMessage));d(O)});let v=O=>{this.handleWeb3ResponseMessage((0,Xr.Web3ResponseMessage)({id:u,response:(0,Cn.WatchAssetReponse)(!1)}))},x=()=>{this.handleWeb3ResponseMessage((0,Xr.Web3ResponseMessage)({id:u,response:(0,Cn.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:x,onCancel:v,type:e,address:r,symbol:n,decimals:i,image:o,chainId:s}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,a)});return{cancel:l,promise:h}}addEthereumChain(e,r,n,i,o,s){let a={method:Sr.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:o,iconUrls:n,nativeCurrency:s}},c=null,u=(0,zt.randomBytesHex)(8),l=d=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,d),c?.()};return this.ui.inlineAddEthereumChain(e)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload})),{promise:new Promise((d,m)=>{this.relayEventManager.callbacks.set(u,O=>{if(c?.(),O.errorMessage)return m(new Error(O.errorMessage));d(O)});let v=O=>{this.handleWeb3ResponseMessage((0,Xr.Web3ResponseMessage)({id:u,response:(0,Cn.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},x=O=>{this.handleWeb3ResponseMessage((0,Xr.Web3ResponseMessage)({id:u,response:(0,Cn.AddEthereumChainResponse)({isApproved:!0,rpcUrl:O})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:v,onApprove:x,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,a)}),cancel:l}}switchEthereumChain(e,r){let n={method:Sr.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:r})},i=(0,zt.randomBytesHex)(8),o=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(i,h=>{if(h.errorMessage&&h.errorCode)return c(Jz.ethErrors.provider.custom({code:h.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(h.errorMessage)return c(new Error(h.errorMessage));a(h)});let u=h=>{if(typeof h=="number"){let d=h;this.handleWeb3ResponseMessage((0,Xr.Web3ResponseMessage)({id:i,response:(0,Cn.ErrorResponse)(Sr.Web3Method.switchEthereumChain,jx.WalletUIError.SwitchEthereumChainUnsupportedChainId.message,d)}))}else h instanceof jx.WalletUIError?this.handleErrorResponse(i,Sr.Web3Method.switchEthereumChain,h,h.errorCode):this.handleWeb3ResponseMessage((0,Xr.Web3ResponseMessage)({id:i,response:(0,Cn.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},l=h=>{this.handleWeb3ResponseMessage((0,Xr.Web3ResponseMessage)({id:i,response:(0,Cn.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:h})}))};this.ui.switchEthereumChain({onCancel:u,onApprove:l,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:o}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return As.Session.hash(this._session.id)}sendRequestStandalone(e,r){let n=o=>{this.handleErrorResponse(e,r.method,o)},i=o=>{this.handleWeb3ResponseMessage((0,Xr.Web3ResponseMessage)({id:e,response:o}))};switch(r.method){case Sr.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case Sr.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Sr.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Sr.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}onSessionConfigChanged(e){}};An.accountRequestCallbackIds=new Set;Qz([Xz.default],An.prototype,"resetAndReload",null);Qz([Xz.default],An.prototype,"handleIncomingEvent",null);dn.WalletSDKRelay=An});var tV=_(Mv=>{"use strict";Object.defineProperty(Mv,"__esModule",{value:!0});Mv.WalletSDKRelayEventManager=void 0;var OOe=Io(),Bx=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;let e=this._nextRequestId,r=(0,OOe.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}};Mv.WalletSDKRelayEventManager=Bx});var rV=_((z$e,COe)=>{COe.exports={name:"@coinbase/wallet-sdk",version:"3.6.3",description:"Coinbase Wallet JavaScript SDK",keywords:["cipher","cipherbrowser","coinbase","coinbasewallet","eth","ether","ethereum","etherium","injection","toshi","wallet","walletlink","web3"],main:"dist/index.js",types:"dist/index.d.ts",repository:"https://github.com/coinbase/coinbase-wallet-sdk.git",author:"Coinbase, Inc.",license:"Apache-2.0",scripts:{"pretest:unit":"node compile-assets.js","test:unit":"jest","test:unit:coverage":"yarn test:unit && open coverage/lcov-report/index.html","test:karma":"yarn build-npm && karma start",prebuild:`rm -rf ./build && node -p "'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'" > src/version.ts`,build:"node compile-assets.js && webpack --config webpack.config.js","build-npm":"tsc -p ./tsconfig.build.json","build:dev":"export LINK_API_URL='http://localhost:3000'; yarn build","build:dev:watch":"nodemon -e 'ts,tsx,js,json,css,scss,svg' --ignore 'src/**/*-css.ts' --ignore 'src/**/*-svg.ts' --watch src/ --exec 'yarn build:dev'","build:prod":`yarn prebuild && yarn build && yarn build-npm && cp ./package.json ../../README.md ./LICENSE build/npm && cp -a src/vendor-js build/npm/dist && sed -i.bak 's| "private": true,||g' build/npm/package.json && rm -f build/npm/package.json.bak`,"lint:types":"tsc --noEmit","lint:prettier":'prettier --check "{src,__tests__}/**/*.(js|ts|tsx)"',"lint:eslint":"eslint ./src --ext .ts,.tsx",lint:"yarn lint:eslint && yarn lint:types && yarn lint:prettier","fix:eslint":"yarn lint:eslint --fix","fix:prettier":"prettier . --write",release:"./scripts/release.sh"},dependencies:{"@metamask/safe-event-emitter":"2.0.0","@solana/web3.js":"^1.70.1","bind-decorator":"^1.0.11","bn.js":"^5.1.1",buffer:"^6.0.3",clsx:"^1.1.0","eth-block-tracker":"4.4.3","eth-json-rpc-filters":"4.2.2","eth-rpc-errors":"4.0.2","json-rpc-engine":"6.1.0",keccak:"^3.0.1",preact:"^10.5.9",qs:"^6.10.3",rxjs:"^6.6.3","sha.js":"^2.4.11","stream-browserify":"^3.0.0",util:"^0.12.4"},devDependencies:{"@babel/core":"^7.17.9","@babel/plugin-proposal-decorators":"^7.17.9","@babel/plugin-transform-react-jsx":"^7.17.3","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@peculiar/webcrypto":"^1.3.3","@testing-library/jest-dom":"^5.16.4","@testing-library/preact":"^2.0.1","@types/bn.js":"^4.11.6","@types/jest":"^27.4.1","@types/node":"^14.14.20","@types/qs":"^6.9.7","@types/sha.js":"^2.4.0","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/eslint-plugin-tslint":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.5.1",browserify:"17.0.0","copy-webpack-plugin":"^6.4.1","core-js":"^3.8.2",eslint:"^8.4.1","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.25.3","eslint-plugin-preact":"^0.1.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-simple-import-sort":"^7.0.0",jasmine:"3.8.0",jest:"^27.5.1","jest-chrome":"^0.7.2","jest-websocket-mock":"^2.3.0",karma:"^6.3.15","karma-browserify":"8.1.0","karma-chrome-launcher":"^3.1.0","karma-jasmine":"^4.0.1",nodemon:"^2.0.6",prettier:"^2.5.1","raw-loader":"^4.0.2","regenerator-runtime":"^0.13.7",sass:"^1.50.0",svgo:"^2.8.0","ts-jest":"^27.1.4","ts-loader":"^8.0.13","ts-node":"^10.7.0",tslib:"^2.0.3",typescript:"^4.1.3",watchify:"4.0.0",webpack:"^5.72.0","webpack-cli":"^4.9.2","whatwg-fetch":"^3.5.0"},engines:{node:">= 10.0.0"}}});var qx=_(Rv=>{"use strict";Object.defineProperty(Rv,"__esModule",{value:!0});Rv.CoinbaseWalletSDK=void 0;var AOe=tN(),IOe=rN(),MOe=rv(),ROe=kz(),TOe=eV(),POe=tV(),DOe=Io(),NOe=process.env.LINK_API_URL||"https://www.walletlink.org",nV=process.env.SDK_VERSION||rV().version||"unknown",Dl=class{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;let o=e.linkAPIUrl||NOe,s;if(e.uiConstructor?s=e.uiConstructor:s=u=>new ROe.WalletSDKUI(u),typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this._diagnosticLogger={log:e.eventListener.onEvent}:this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;let a=new URL(o),c=`${a.protocol}//${a.host}`;this._storage=new IOe.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",Dl.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new POe.WalletSDKRelayEventManager,this._relay=new TOe.WalletSDKRelay({linkAPIUrl:o,version:nV,darkMode:!!e.darkMode,uiConstructor:s,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger}),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI())}makeWeb3Provider(e="",r=1){let n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;let i=this.coinbaseBrowser;if(i)return i;let o=this._relay;if(!o||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||o.setConnectDisabled(!0),new MOe.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(o),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,DOe.getFavicon)();let i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;let r=this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,AOe.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{let n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}};Rv.CoinbaseWalletSDK=Dl;Dl.VERSION=nV});var oV=_(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.CoinbaseWalletProvider=ac.CoinbaseWalletSDK=void 0;var Fx=qx(),iV=rv(),kOe=qx();Object.defineProperty(ac,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return kOe.CoinbaseWalletSDK}});var LOe=rv();Object.defineProperty(ac,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return LOe.CoinbaseWalletProvider}});ac.default=Fx.CoinbaseWalletSDK;typeof window<"u"&&(window.CoinbaseWalletSDK=Fx.CoinbaseWalletSDK,window.CoinbaseWalletProvider=iV.CoinbaseWalletProvider,window.WalletLink=Fx.CoinbaseWalletSDK,window.WalletLinkProvider=iV.CoinbaseWalletProvider)});var WV=_(($V,Jx)=>{(function(t){if(typeof $V=="object"&&typeof Jx<"u")Jx.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e=this,e.localforage=t()}})(function(){var t,e,r;return function n(i,o,s){function a(l,h){if(!o[l]){if(!i[l]){var d=typeof Rs=="function"&&Rs;if(!h&&d)return d(l,!0);if(c)return c(l,!0);var m=new Error("Cannot find module '"+l+"'");throw m.code="MODULE_NOT_FOUND",m}var v=o[l]={exports:{}};i[l][0].call(v.exports,function(x){var O=i[l][1][x];return a(O||x)},v,v.exports,n,i,o,s)}return o[l].exports}for(var c=typeof Rs=="function"&&Rs,u=0;u<s.length;u++)a(s[u]);return a}({1:[function(n,i,o){(function(s){"use strict";var a=s.MutationObserver||s.WebKitMutationObserver,c;if(a){var u=0,l=new a(x),h=s.document.createTextNode("");l.observe(h,{characterData:!0}),c=function(){h.data=u=++u%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var d=new s.MessageChannel;d.port1.onmessage=x,c=function(){d.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?c=function(){var I=s.document.createElement("script");I.onreadystatechange=function(){x(),I.onreadystatechange=null,I.parentNode.removeChild(I),I=null},s.document.documentElement.appendChild(I)}:c=function(){setTimeout(x,0)};var m,v=[];function x(){m=!0;for(var I,j,k=v.length;k;){for(j=v,v=[],I=-1;++I<k;)j[I]();k=v.length}m=!1}i.exports=O;function O(I){v.push(I)===1&&!m&&c()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,i,o){"use strict";var s=n(1);function a(){}var c={},u=["REJECTED"],l=["FULFILLED"],h=["PENDING"];i.exports=d;function d(q){if(typeof q!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,q!==a&&O(this,q)}d.prototype.catch=function(q){return this.then(null,q)},d.prototype.then=function(q,P){if(typeof q!="function"&&this.state===l||typeof P!="function"&&this.state===u)return this;var L=new this.constructor(a);if(this.state!==h){var H=this.state===l?q:P;v(L,H,this.outcome)}else this.queue.push(new m(L,q,P));return L};function m(q,P,L){this.promise=q,typeof P=="function"&&(this.onFulfilled=P,this.callFulfilled=this.otherCallFulfilled),typeof L=="function"&&(this.onRejected=L,this.callRejected=this.otherCallRejected)}m.prototype.callFulfilled=function(q){c.resolve(this.promise,q)},m.prototype.otherCallFulfilled=function(q){v(this.promise,this.onFulfilled,q)},m.prototype.callRejected=function(q){c.reject(this.promise,q)},m.prototype.otherCallRejected=function(q){v(this.promise,this.onRejected,q)};function v(q,P,L){s(function(){var H;try{H=P(L)}catch(M){return c.reject(q,M)}H===q?c.reject(q,new TypeError("Cannot resolve promise with itself")):c.resolve(q,H)})}c.resolve=function(q,P){var L=I(x,P);if(L.status==="error")return c.reject(q,L.value);var H=L.value;if(H)O(q,H);else{q.state=l,q.outcome=P;for(var M=-1,N=q.queue.length;++M<N;)q.queue[M].callFulfilled(P)}return q},c.reject=function(q,P){q.state=u,q.outcome=P;for(var L=-1,H=q.queue.length;++L<H;)q.queue[L].callRejected(P);return q};function x(q){var P=q&&q.then;if(q&&(typeof q=="object"||typeof q=="function")&&typeof P=="function")return function(){P.apply(q,arguments)}}function O(q,P){var L=!1;function H(E){L||(L=!0,c.reject(q,E))}function M(E){L||(L=!0,c.resolve(q,E))}function N(){P(M,H)}var F=I(N);F.status==="error"&&H(F.value)}function I(q,P){var L={};try{L.value=q(P),L.status="success"}catch(H){L.status="error",L.value=H}return L}d.resolve=j;function j(q){return q instanceof this?q:c.resolve(new this(a),q)}d.reject=k;function k(q){var P=new this(a);return c.reject(P,q)}d.all=B;function B(q){var P=this;if(Object.prototype.toString.call(q)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=q.length,H=!1;if(!L)return this.resolve([]);for(var M=new Array(L),N=0,F=-1,E=new this(a);++F<L;)f(q[F],F);return E;function f(g,y){P.resolve(g).then(b,function(w){H||(H=!0,c.reject(E,w))});function b(w){M[y]=w,++N===L&&!H&&(H=!0,c.resolve(E,M))}}}d.race=V;function V(q){var P=this;if(Object.prototype.toString.call(q)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=q.length,H=!1;if(!L)return this.resolve([]);for(var M=-1,N=new this(a);++M<L;)F(q[M]);return N;function F(E){P.resolve(E).then(function(f){H||(H=!0,c.resolve(N,f))},function(f){H||(H=!0,c.reject(N,f))})}}},{1:1}],3:[function(n,i,o){(function(s){"use strict";typeof s.Promise!="function"&&(s.Promise=n(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C};function a(C,U){if(!(C instanceof U))throw new TypeError("Cannot call a class as a function")}function c(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var u=c();function l(){try{if(!u||!u.open)return!1;var C=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),U=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!C||U)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function h(C,U){C=C||[],U=U||{};try{return new Blob(C,U)}catch($){if($.name!=="TypeError")throw $;for(var D=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,W=new D,z=0;z<C.length;z+=1)W.append(C[z]);return W.getBlob(U.type)}}typeof Promise>"u"&&n(3);var d=Promise;function m(C,U){U&&C.then(function(D){U(null,D)},function(D){U(D)})}function v(C,U,D){typeof U=="function"&&C.then(U),typeof D=="function"&&C.catch(D)}function x(C){return typeof C!="string"&&(console.warn(C+" used as a key, but it is not a string."),C=String(C)),C}function O(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var I="local-forage-detect-blob-support",j=void 0,k={},B=Object.prototype.toString,V="readonly",q="readwrite";function P(C){for(var U=C.length,D=new ArrayBuffer(U),W=new Uint8Array(D),z=0;z<U;z++)W[z]=C.charCodeAt(z);return D}function L(C){return new d(function(U){var D=C.transaction(I,q),W=h([""]);D.objectStore(I).put(W,"key"),D.onabort=function(z){z.preventDefault(),z.stopPropagation(),U(!1)},D.oncomplete=function(){var z=navigator.userAgent.match(/Chrome\/(\d+)/),$=navigator.userAgent.match(/Edge\//);U($||!z||parseInt(z[1],10)>=43)}}).catch(function(){return!1})}function H(C){return typeof j=="boolean"?d.resolve(j):L(C).then(function(U){return j=U,j})}function M(C){var U=k[C.name],D={};D.promise=new d(function(W,z){D.resolve=W,D.reject=z}),U.deferredOperations.push(D),U.dbReady?U.dbReady=U.dbReady.then(function(){return D.promise}):U.dbReady=D.promise}function N(C){var U=k[C.name],D=U.deferredOperations.pop();if(D)return D.resolve(),D.promise}function F(C,U){var D=k[C.name],W=D.deferredOperations.pop();if(W)return W.reject(U),W.promise}function E(C,U){return new d(function(D,W){if(k[C.name]=k[C.name]||A(),C.db)if(U)M(C),C.db.close();else return D(C.db);var z=[C.name];U&&z.push(C.version);var $=u.open.apply(u,z);U&&($.onupgradeneeded=function(Q){var te=$.result;try{te.createObjectStore(C.storeName),Q.oldVersion<=1&&te.createObjectStore(I)}catch(re){if(re.name==="ConstraintError")console.warn('The database "'+C.name+'" has been upgraded from version '+Q.oldVersion+" to version "+Q.newVersion+', but the storage "'+C.storeName+'" already exists.');else throw re}}),$.onerror=function(Q){Q.preventDefault(),W($.error)},$.onsuccess=function(){var Q=$.result;Q.onversionchange=function(te){te.target.close()},D(Q),N(C)}})}function f(C){return E(C,!1)}function g(C){return E(C,!0)}function y(C,U){if(!C.db)return!0;var D=!C.db.objectStoreNames.contains(C.storeName),W=C.version<C.db.version,z=C.version>C.db.version;if(W&&(C.version!==U&&console.warn('The database "'+C.name+`" can't be downgraded from version `+C.db.version+" to version "+C.version+"."),C.version=C.db.version),z||D){if(D){var $=C.db.version+1;$>C.version&&(C.version=$)}return!0}return!1}function b(C){return new d(function(U,D){var W=new FileReader;W.onerror=D,W.onloadend=function(z){var $=btoa(z.target.result||"");U({__local_forage_encoded_blob:!0,data:$,type:C.type})},W.readAsBinaryString(C)})}function w(C){var U=P(atob(C.data));return h([U],{type:C.type})}function R(C){return C&&C.__local_forage_encoded_blob}function T(C){var U=this,D=U._initReady().then(function(){var W=k[U._dbInfo.name];if(W&&W.dbReady)return W.dbReady});return v(D,C,C),D}function S(C){M(C);for(var U=k[C.name],D=U.forages,W=0;W<D.length;W++){var z=D[W];z._dbInfo.db&&(z._dbInfo.db.close(),z._dbInfo.db=null)}return C.db=null,f(C).then(function($){return C.db=$,y(C)?g(C):$}).then(function($){C.db=U.db=$;for(var Q=0;Q<D.length;Q++)D[Q]._dbInfo.db=$}).catch(function($){throw F(C,$),$})}function p(C,U,D,W){W===void 0&&(W=1);try{var z=C.db.transaction(C.storeName,U);D(null,z)}catch($){if(W>0&&(!C.db||$.name==="InvalidStateError"||$.name==="NotFoundError"))return d.resolve().then(function(){if(!C.db||$.name==="NotFoundError"&&!C.db.objectStoreNames.contains(C.storeName)&&C.version<=C.db.version)return C.db&&(C.version=C.db.version+1),g(C)}).then(function(){return S(C).then(function(){p(C,U,D,W-1)})}).catch(D);D($)}}function A(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Y(C){var U=this,D={db:null};if(C)for(var W in C)D[W]=C[W];var z=k[D.name];z||(z=A(),k[D.name]=z),z.forages.push(U),U._initReady||(U._initReady=U.ready,U.ready=T);var $=[];function Q(){return d.resolve()}for(var te=0;te<z.forages.length;te++){var re=z.forages[te];re!==U&&$.push(re._initReady().catch(Q))}var ne=z.forages.slice(0);return d.all($).then(function(){return D.db=z.db,f(D)}).then(function(oe){return D.db=oe,y(D,U._defaultConfig.version)?g(D):oe}).then(function(oe){D.db=z.db=oe,U._dbInfo=D;for(var ge=0;ge<ne.length;ge++){var Ne=ne[ge];Ne!==U&&(Ne._dbInfo.db=D.db,Ne._dbInfo.version=D.version)}})}function Z(C,U){var D=this;C=x(C);var W=new d(function(z,$){D.ready().then(function(){p(D._dbInfo,V,function(Q,te){if(Q)return $(Q);try{var re=te.objectStore(D._dbInfo.storeName),ne=re.get(C);ne.onsuccess=function(){var oe=ne.result;oe===void 0&&(oe=null),R(oe)&&(oe=w(oe)),z(oe)},ne.onerror=function(){$(ne.error)}}catch(oe){$(oe)}})}).catch($)});return m(W,U),W}function G(C,U){var D=this,W=new d(function(z,$){D.ready().then(function(){p(D._dbInfo,V,function(Q,te){if(Q)return $(Q);try{var re=te.objectStore(D._dbInfo.storeName),ne=re.openCursor(),oe=1;ne.onsuccess=function(){var ge=ne.result;if(ge){var Ne=ge.value;R(Ne)&&(Ne=w(Ne));var Ze=C(Ne,ge.key,oe++);Ze!==void 0?z(Ze):ge.continue()}else z()},ne.onerror=function(){$(ne.error)}}catch(ge){$(ge)}})}).catch($)});return m(W,U),W}function X(C,U,D){var W=this;C=x(C);var z=new d(function($,Q){var te;W.ready().then(function(){return te=W._dbInfo,B.call(U)==="[object Blob]"?H(te.db).then(function(re){return re?U:b(U)}):U}).then(function(re){p(W._dbInfo,q,function(ne,oe){if(ne)return Q(ne);try{var ge=oe.objectStore(W._dbInfo.storeName);re===null&&(re=void 0);var Ne=ge.put(re,C);oe.oncomplete=function(){re===void 0&&(re=null),$(re)},oe.onabort=oe.onerror=function(){var Ze=Ne.error?Ne.error:Ne.transaction.error;Q(Ze)}}catch(Ze){Q(Ze)}})}).catch(Q)});return m(z,D),z}function ae(C,U){var D=this;C=x(C);var W=new d(function(z,$){D.ready().then(function(){p(D._dbInfo,q,function(Q,te){if(Q)return $(Q);try{var re=te.objectStore(D._dbInfo.storeName),ne=re.delete(C);te.oncomplete=function(){z()},te.onerror=function(){$(ne.error)},te.onabort=function(){var oe=ne.error?ne.error:ne.transaction.error;$(oe)}}catch(oe){$(oe)}})}).catch($)});return m(W,U),W}function fe(C){var U=this,D=new d(function(W,z){U.ready().then(function(){p(U._dbInfo,q,function($,Q){if($)return z($);try{var te=Q.objectStore(U._dbInfo.storeName),re=te.clear();Q.oncomplete=function(){W()},Q.onabort=Q.onerror=function(){var ne=re.error?re.error:re.transaction.error;z(ne)}}catch(ne){z(ne)}})}).catch(z)});return m(D,C),D}function Ee(C){var U=this,D=new d(function(W,z){U.ready().then(function(){p(U._dbInfo,V,function($,Q){if($)return z($);try{var te=Q.objectStore(U._dbInfo.storeName),re=te.count();re.onsuccess=function(){W(re.result)},re.onerror=function(){z(re.error)}}catch(ne){z(ne)}})}).catch(z)});return m(D,C),D}function he(C,U){var D=this,W=new d(function(z,$){if(C<0){z(null);return}D.ready().then(function(){p(D._dbInfo,V,function(Q,te){if(Q)return $(Q);try{var re=te.objectStore(D._dbInfo.storeName),ne=!1,oe=re.openKeyCursor();oe.onsuccess=function(){var ge=oe.result;if(!ge){z(null);return}C===0||ne?z(ge.key):(ne=!0,ge.advance(C))},oe.onerror=function(){$(oe.error)}}catch(ge){$(ge)}})}).catch($)});return m(W,U),W}function de(C){var U=this,D=new d(function(W,z){U.ready().then(function(){p(U._dbInfo,V,function($,Q){if($)return z($);try{var te=Q.objectStore(U._dbInfo.storeName),re=te.openKeyCursor(),ne=[];re.onsuccess=function(){var oe=re.result;if(!oe){W(ne);return}ne.push(oe.key),oe.continue()},re.onerror=function(){z(re.error)}}catch(oe){z(oe)}})}).catch(z)});return m(D,C),D}function Te(C,U){U=O.apply(this,arguments);var D=this.config();C=typeof C!="function"&&C||{},C.name||(C.name=C.name||D.name,C.storeName=C.storeName||D.storeName);var W=this,z;if(!C.name)z=d.reject("Invalid arguments");else{var $=C.name===D.name&&W._dbInfo.db,Q=$?d.resolve(W._dbInfo.db):f(C).then(function(te){var re=k[C.name],ne=re.forages;re.db=te;for(var oe=0;oe<ne.length;oe++)ne[oe]._dbInfo.db=te;return te});C.storeName?z=Q.then(function(te){if(!!te.objectStoreNames.contains(C.storeName)){var re=te.version+1;M(C);var ne=k[C.name],oe=ne.forages;te.close();for(var ge=0;ge<oe.length;ge++){var Ne=oe[ge];Ne._dbInfo.db=null,Ne._dbInfo.version=re}var Ze=new d(function(et,nr){var tr=u.open(C.name,re);tr.onerror=function(Mn){var Hl=tr.result;Hl.close(),nr(Mn)},tr.onupgradeneeded=function(){var Mn=tr.result;Mn.deleteObjectStore(C.storeName)},tr.onsuccess=function(){var Mn=tr.result;Mn.close(),et(Mn)}});return Ze.then(function(et){ne.db=et;for(var nr=0;nr<oe.length;nr++){var tr=oe[nr];tr._dbInfo.db=et,N(tr._dbInfo)}}).catch(function(et){throw(F(C,et)||d.resolve()).catch(function(){}),et})}}):z=Q.then(function(te){M(C);var re=k[C.name],ne=re.forages;te.close();for(var oe=0;oe<ne.length;oe++){var ge=ne[oe];ge._dbInfo.db=null}var Ne=new d(function(Ze,et){var nr=u.deleteDatabase(C.name);nr.onerror=function(){var tr=nr.result;tr&&tr.close(),et(nr.error)},nr.onblocked=function(){console.warn('dropInstance blocked for database "'+C.name+'" until all open connections are closed')},nr.onsuccess=function(){var tr=nr.result;tr&&tr.close(),Ze(tr)}});return Ne.then(function(Ze){re.db=Ze;for(var et=0;et<ne.length;et++){var nr=ne[et];N(nr._dbInfo)}}).catch(function(Ze){throw(F(C,Ze)||d.resolve()).catch(function(){}),Ze})})}return m(z,U),z}var ye={_driver:"asyncStorage",_initStorage:Y,_support:l(),iterate:G,getItem:Z,setItem:X,removeItem:ae,clear:fe,length:Ee,key:he,keys:de,dropInstance:Te};function ve(){return typeof openDatabase=="function"}var tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qt="~~local_forage_type~",mt=/^~~local_forage_type~([^~]+)~/,si="__lfsc__:",at=si.length,ct="arbf",Bi="blob",yt="si08",vt="ui08",Po="uic8",bt="si16",_t="si32",qi="ur16",ut="ui32",lt="fl32",Fi="fl64",ft=at+ct.length,ht=Object.prototype.toString;function Ui(C){var U=C.length*.75,D=C.length,W,z=0,$,Q,te,re;C[C.length-1]==="="&&(U--,C[C.length-2]==="="&&U--);var ne=new ArrayBuffer(U),oe=new Uint8Array(ne);for(W=0;W<D;W+=4)$=tn.indexOf(C[W]),Q=tn.indexOf(C[W+1]),te=tn.indexOf(C[W+2]),re=tn.indexOf(C[W+3]),oe[z++]=$<<2|Q>>4,oe[z++]=(Q&15)<<4|te>>2,oe[z++]=(te&3)<<6|re&63;return ne}function rt(C){var U=new Uint8Array(C),D="",W;for(W=0;W<U.length;W+=3)D+=tn[U[W]>>2],D+=tn[(U[W]&3)<<4|U[W+1]>>4],D+=tn[(U[W+1]&15)<<2|U[W+2]>>6],D+=tn[U[W+2]&63];return U.length%3===2?D=D.substring(0,D.length-1)+"=":U.length%3===1&&(D=D.substring(0,D.length-2)+"=="),D}function wt(C,U){var D="";if(C&&(D=ht.call(C)),C&&(D==="[object ArrayBuffer]"||C.buffer&&ht.call(C.buffer)==="[object ArrayBuffer]")){var W,z=si;C instanceof ArrayBuffer?(W=C,z+=ct):(W=C.buffer,D==="[object Int8Array]"?z+=yt:D==="[object Uint8Array]"?z+=vt:D==="[object Uint8ClampedArray]"?z+=Po:D==="[object Int16Array]"?z+=bt:D==="[object Uint16Array]"?z+=qi:D==="[object Int32Array]"?z+=_t:D==="[object Uint32Array]"?z+=ut:D==="[object Float32Array]"?z+=lt:D==="[object Float64Array]"?z+=Fi:U(new Error("Failed to get type for BinaryArray"))),U(z+rt(W))}else if(D==="[object Blob]"){var $=new FileReader;$.onload=function(){var Q=qt+C.type+"~"+rt(this.result);U(si+Bi+Q)},$.readAsArrayBuffer(C)}else try{U(JSON.stringify(C))}catch(Q){console.error("Couldn't convert value into a JSON string: ",C),U(null,Q)}}function Do(C){if(C.substring(0,at)!==si)return JSON.parse(C);var U=C.substring(ft),D=C.substring(at,ft),W;if(D===Bi&&mt.test(U)){var z=U.match(mt);W=z[1],U=U.substring(z[0].length)}var $=Ui(U);switch(D){case ct:return $;case Bi:return h([$],{type:W});case yt:return new Int8Array($);case vt:return new Uint8Array($);case Po:return new Uint8ClampedArray($);case bt:return new Int16Array($);case qi:return new Uint16Array($);case _t:return new Int32Array($);case ut:return new Uint32Array($);case lt:return new Float32Array($);case Fi:return new Float64Array($);default:throw new Error("Unkown type: "+D)}}var nt={serialize:wt,deserialize:Do,stringToBuffer:Ui,bufferToString:rt};function dt(C,U,D,W){C.executeSql("CREATE TABLE IF NOT EXISTS "+U.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],D,W)}function No(C){var U=this,D={db:null};if(C)for(var W in C)D[W]=typeof C[W]!="string"?C[W].toString():C[W];var z=new d(function($,Q){try{D.db=openDatabase(D.name,String(D.version),D.description,D.size)}catch(te){return Q(te)}D.db.transaction(function(te){dt(te,D,function(){U._dbInfo=D,$()},function(re,ne){Q(ne)})},Q)});return D.serializer=nt,z}function Ke(C,U,D,W,z,$){C.executeSql(D,W,z,function(Q,te){te.code===te.SYNTAX_ERR?Q.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[U.storeName],function(re,ne){ne.rows.length?$(re,te):dt(re,U,function(){re.executeSql(D,W,z,$)},$)},$):$(Q,te)},$)}function Et(C,U){var D=this;C=x(C);var W=new d(function(z,$){D.ready().then(function(){var Q=D._dbInfo;Q.db.transaction(function(te){Ke(te,Q,"SELECT * FROM "+Q.storeName+" WHERE key = ? LIMIT 1",[C],function(re,ne){var oe=ne.rows.length?ne.rows.item(0).value:null;oe&&(oe=Q.serializer.deserialize(oe)),z(oe)},function(re,ne){$(ne)})})}).catch($)});return m(W,U),W}function ko(C,U){var D=this,W=new d(function(z,$){D.ready().then(function(){var Q=D._dbInfo;Q.db.transaction(function(te){Ke(te,Q,"SELECT * FROM "+Q.storeName,[],function(re,ne){for(var oe=ne.rows,ge=oe.length,Ne=0;Ne<ge;Ne++){var Ze=oe.item(Ne),et=Ze.value;if(et&&(et=Q.serializer.deserialize(et)),et=C(et,Ze.key,Ne+1),et!==void 0){z(et);return}}z()},function(re,ne){$(ne)})})}).catch($)});return m(W,U),W}function pt(C,U,D,W){var z=this;C=x(C);var $=new d(function(Q,te){z.ready().then(function(){U===void 0&&(U=null);var re=U,ne=z._dbInfo;ne.serializer.serialize(U,function(oe,ge){ge?te(ge):ne.db.transaction(function(Ne){Ke(Ne,ne,"INSERT OR REPLACE INTO "+ne.storeName+" (key, value) VALUES (?, ?)",[C,oe],function(){Q(re)},function(Ze,et){te(et)})},function(Ne){if(Ne.code===Ne.QUOTA_ERR){if(W>0){Q(pt.apply(z,[C,re,D,W-1]));return}te(Ne)}})})}).catch(te)});return m($,D),$}function St(C,U,D){return pt.apply(this,[C,U,D,1])}function Lo(C,U){var D=this;C=x(C);var W=new d(function(z,$){D.ready().then(function(){var Q=D._dbInfo;Q.db.transaction(function(te){Ke(te,Q,"DELETE FROM "+Q.storeName+" WHERE key = ?",[C],function(){z()},function(re,ne){$(ne)})})}).catch($)});return m(W,U),W}function xt(C){var U=this,D=new d(function(W,z){U.ready().then(function(){var $=U._dbInfo;$.db.transaction(function(Q){Ke(Q,$,"DELETE FROM "+$.storeName,[],function(){W()},function(te,re){z(re)})})}).catch(z)});return m(D,C),D}function Ot(C){var U=this,D=new d(function(W,z){U.ready().then(function(){var $=U._dbInfo;$.db.transaction(function(Q){Ke(Q,$,"SELECT COUNT(key) as c FROM "+$.storeName,[],function(te,re){var ne=re.rows.item(0).c;W(ne)},function(te,re){z(re)})})}).catch(z)});return m(D,C),D}function jo(C,U){var D=this,W=new d(function(z,$){D.ready().then(function(){var Q=D._dbInfo;Q.db.transaction(function(te){Ke(te,Q,"SELECT key FROM "+Q.storeName+" WHERE id = ? LIMIT 1",[C+1],function(re,ne){var oe=ne.rows.length?ne.rows.item(0).key:null;z(oe)},function(re,ne){$(ne)})})}).catch($)});return m(W,U),W}function Ct(C){var U=this,D=new d(function(W,z){U.ready().then(function(){var $=U._dbInfo;$.db.transaction(function(Q){Ke(Q,$,"SELECT key FROM "+$.storeName,[],function(te,re){for(var ne=[],oe=0;oe<re.rows.length;oe++)ne.push(re.rows.item(oe).key);W(ne)},function(te,re){z(re)})})}).catch(z)});return m(D,C),D}function At(C){return new d(function(U,D){C.transaction(function(W){W.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(z,$){for(var Q=[],te=0;te<$.rows.length;te++)Q.push($.rows.item(te).name);U({db:C,storeNames:Q})},function(z,$){D($)})},function(W){D(W)})})}function Bo(C,U){U=O.apply(this,arguments);var D=this.config();C=typeof C!="function"&&C||{},C.name||(C.name=C.name||D.name,C.storeName=C.storeName||D.storeName);var W=this,z;return C.name?z=new d(function($){var Q;C.name===D.name?Q=W._dbInfo.db:Q=openDatabase(C.name,"","",0),C.storeName?$({db:Q,storeNames:[C.storeName]}):$(At(Q))}).then(function($){return new d(function(Q,te){$.db.transaction(function(re){function ne(Ze){return new d(function(et,nr){re.executeSql("DROP TABLE IF EXISTS "+Ze,[],function(){et()},function(tr,Mn){nr(Mn)})})}for(var oe=[],ge=0,Ne=$.storeNames.length;ge<Ne;ge++)oe.push(ne($.storeNames[ge]));d.all(oe).then(function(){Q()}).catch(function(Ze){te(Ze)})},function(re){te(re)})})}):z=d.reject("Invalid arguments"),m(z,U),z}var It={_driver:"webSQLStorage",_initStorage:No,_support:ve(),iterate:ko,getItem:Et,setItem:St,removeItem:Lo,clear:xt,length:Ot,key:jo,keys:Ct,dropInstance:Bo};function Mt(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function $i(C,U){var D=C.name+"/";return C.storeName!==U.storeName&&(D+=C.storeName+"/"),D}function Rt(){var C="_localforage_support_test";try{return localStorage.setItem(C,!0),localStorage.removeItem(C),!1}catch{return!0}}function Tt(){return!Rt()||localStorage.length>0}function qo(C){var U=this,D={};if(C)for(var W in C)D[W]=C[W];return D.keyPrefix=$i(C,U._defaultConfig),Tt()?(U._dbInfo=D,D.serializer=nt,d.resolve()):d.reject()}function Pt(C){var U=this,D=U.ready().then(function(){for(var W=U._dbInfo.keyPrefix,z=localStorage.length-1;z>=0;z--){var $=localStorage.key(z);$.indexOf(W)===0&&localStorage.removeItem($)}});return m(D,C),D}function Dt(C,U){var D=this;C=x(C);var W=D.ready().then(function(){var z=D._dbInfo,$=localStorage.getItem(z.keyPrefix+C);return $&&($=z.serializer.deserialize($)),$});return m(W,U),W}function Fo(C,U){var D=this,W=D.ready().then(function(){for(var z=D._dbInfo,$=z.keyPrefix,Q=$.length,te=localStorage.length,re=1,ne=0;ne<te;ne++){var oe=localStorage.key(ne);if(oe.indexOf($)===0){var ge=localStorage.getItem(oe);if(ge&&(ge=z.serializer.deserialize(ge)),ge=C(ge,oe.substring(Q),re++),ge!==void 0)return ge}}});return m(W,U),W}function Nt(C,U){var D=this,W=D.ready().then(function(){var z=D._dbInfo,$;try{$=localStorage.key(C)}catch{$=null}return $&&($=$.substring(z.keyPrefix.length)),$});return m(W,U),W}function kt(C){var U=this,D=U.ready().then(function(){for(var W=U._dbInfo,z=localStorage.length,$=[],Q=0;Q<z;Q++){var te=localStorage.key(Q);te.indexOf(W.keyPrefix)===0&&$.push(te.substring(W.keyPrefix.length))}return $});return m(D,C),D}function Wi(C){var U=this,D=U.keys().then(function(W){return W.length});return m(D,C),D}function Hi(C,U){var D=this;C=x(C);var W=D.ready().then(function(){var z=D._dbInfo;localStorage.removeItem(z.keyPrefix+C)});return m(W,U),W}function zi(C,U,D){var W=this;C=x(C);var z=W.ready().then(function(){U===void 0&&(U=null);var $=U;return new d(function(Q,te){var re=W._dbInfo;re.serializer.serialize(U,function(ne,oe){if(oe)te(oe);else try{localStorage.setItem(re.keyPrefix+C,ne),Q($)}catch(ge){(ge.name==="QuotaExceededError"||ge.name==="NS_ERROR_DOM_QUOTA_REACHED")&&te(ge),te(ge)}})})});return m(z,D),z}function Vi(C,U){if(U=O.apply(this,arguments),C=typeof C!="function"&&C||{},!C.name){var D=this.config();C.name=C.name||D.name,C.storeName=C.storeName||D.storeName}var W=this,z;return C.name?z=new d(function($){C.storeName?$($i(C,W._defaultConfig)):$(C.name+"/")}).then(function($){for(var Q=localStorage.length-1;Q>=0;Q--){var te=localStorage.key(Q);te.indexOf($)===0&&localStorage.removeItem(te)}}):z=d.reject("Invalid arguments"),m(z,U),z}var Gi={_driver:"localStorageWrapper",_initStorage:qo,_support:Mt(),iterate:Fo,getItem:Dt,setItem:zi,removeItem:Hi,clear:Pt,length:Wi,key:Nt,keys:kt,dropInstance:Vi},Ki=function(U,D){return U===D||typeof U=="number"&&typeof D=="number"&&isNaN(U)&&isNaN(D)},Yi=function(U,D){for(var W=U.length,z=0;z<W;){if(Ki(U[z],D))return!0;z++}return!1},ai=Array.isArray||function(C){return Object.prototype.toString.call(C)==="[object Array]"},pn={},ci={},rn={INDEXEDDB:ye,WEBSQL:It,LOCALSTORAGE:Gi},Zi=[rn.INDEXEDDB._driver,rn.WEBSQL._driver,rn.LOCALSTORAGE._driver],In=["dropInstance"],Kn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(In),Fl={description:"",driver:Zi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ul(C,U){C[U]=function(){var D=arguments;return C.ready().then(function(){return C[U].apply(C,D)})}}function Ms(){for(var C=1;C<arguments.length;C++){var U=arguments[C];if(U)for(var D in U)U.hasOwnProperty(D)&&(ai(U[D])?arguments[0][D]=U[D].slice():arguments[0][D]=U[D])}return arguments[0]}var $l=function(){function C(U){a(this,C);for(var D in rn)if(rn.hasOwnProperty(D)){var W=rn[D],z=W._driver;this[D]=z,pn[z]||this.defineDriver(W)}this._defaultConfig=Ms({},Fl),this._config=Ms({},this._defaultConfig,U),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return C.prototype.config=function(D){if((typeof D>"u"?"undefined":s(D))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var W in D){if(W==="storeName"&&(D[W]=D[W].replace(/\W/g,"_")),W==="version"&&typeof D[W]!="number")return new Error("Database version must be a number.");this._config[W]=D[W]}return"driver"in D&&D.driver?this.setDriver(this._config.driver):!0}else return typeof D=="string"?this._config[D]:this._config},C.prototype.defineDriver=function(D,W,z){var $=new d(function(Q,te){try{var re=D._driver,ne=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!D._driver){te(ne);return}for(var oe=Kn.concat("_initStorage"),ge=0,Ne=oe.length;ge<Ne;ge++){var Ze=oe[ge],et=!Yi(In,Ze);if((et||D[Ze])&&typeof D[Ze]!="function"){te(ne);return}}var nr=function(){for(var Hl=function(GV){return function(){var KV=new Error("Method "+GV+" is not implemented by the current driver"),Xx=d.reject(KV);return m(Xx,arguments[arguments.length-1]),Xx}},Vv=0,VV=In.length;Vv<VV;Vv++){var Gv=In[Vv];D[Gv]||(D[Gv]=Hl(Gv))}};nr();var tr=function(Hl){pn[re]&&console.info("Redefining LocalForage driver: "+re),pn[re]=D,ci[re]=Hl,Q()};"_support"in D?D._support&&typeof D._support=="function"?D._support().then(tr,te):tr(!!D._support):tr(!0)}catch(Mn){te(Mn)}});return v($,W,z),$},C.prototype.driver=function(){return this._driver||null},C.prototype.getDriver=function(D,W,z){var $=pn[D]?d.resolve(pn[D]):d.reject(new Error("Driver not found."));return v($,W,z),$},C.prototype.getSerializer=function(D){var W=d.resolve(nt);return v(W,D),W},C.prototype.ready=function(D){var W=this,z=W._driverSet.then(function(){return W._ready===null&&(W._ready=W._initDriver()),W._ready});return v(z,D,D),z},C.prototype.setDriver=function(D,W,z){var $=this;ai(D)||(D=[D]);var Q=this._getSupportedDrivers(D);function te(){$._config.driver=$.driver()}function re(ge){return $._extend(ge),te(),$._ready=$._initStorage($._config),$._ready}function ne(ge){return function(){var Ne=0;function Ze(){for(;Ne<ge.length;){var et=ge[Ne];return Ne++,$._dbInfo=null,$._ready=null,$.getDriver(et).then(re).catch(Ze)}te();var nr=new Error("No available storage method found.");return $._driverSet=d.reject(nr),$._driverSet}return Ze()}}var oe=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=oe.then(function(){var ge=Q[0];return $._dbInfo=null,$._ready=null,$.getDriver(ge).then(function(Ne){$._driver=Ne._driver,te(),$._wrapLibraryMethodsWithReady(),$._initDriver=ne(Q)})}).catch(function(){te();var ge=new Error("No available storage method found.");return $._driverSet=d.reject(ge),$._driverSet}),v(this._driverSet,W,z),this._driverSet},C.prototype.supports=function(D){return!!ci[D]},C.prototype._extend=function(D){Ms(this,D)},C.prototype._getSupportedDrivers=function(D){for(var W=[],z=0,$=D.length;z<$;z++){var Q=D[z];this.supports(Q)&&W.push(Q)}return W},C.prototype._wrapLibraryMethodsWithReady=function(){for(var D=0,W=Kn.length;D<W;D++)Ul(this,Kn[D])},C.prototype.createInstance=function(D){return new C(D)},C}(),Wl=new $l;i.exports=Wl},{3:3}]},{},[4])(4)})});var zV=_((Wv,HV)=>{(function(t,e){typeof Wv=="object"&&typeof HV<"u"?e(Wv):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],e):e(t.LocalforageDriverMemory={})})(typeof self<"u"?self:Wv,function(t){"use strict";var e="localforage-driver-memory";function r(y){var b=typeof Symbol=="function"&&y[Symbol.iterator],w=0;return b?b.call(y):{next:function(){return y&&w>=y.length&&(y=void 0),{value:y&&y[w++],done:!y}}}}function n(y,b){y=y||[],b=b||{};try{return new Blob(y,b)}catch(S){if(S.name!=="TypeError")throw S;for(var w=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,R=new w,T=0;T<y.length;T+=1)R.append(y[T]);return R.getBlob(b.type)}}var i=/^~~local_forage_type~([^~]+)~/,o=9,s=o+4,a=Object.prototype.toString;function c(y){var b=y.length*.75,w=y.length;y[y.length-1]==="="&&(b--,y[y.length-2]==="="&&b--);for(var R=new ArrayBuffer(b),T=new Uint8Array(R),S=0,p=0;S<w;S+=4){var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(y[S]),Y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(y[S+1]),Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(y[S+2]),G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(y[S+3]);T[p++]=A<<2|Y>>4,T[p++]=(Y&15)<<4|Z>>2,T[p++]=(Z&3)<<6|G&63}return R}function u(y){for(var b=new Uint8Array(y),w="",R=0;R<b.length;R+=3)w+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[b[R]>>2],w+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(b[R]&3)<<4|b[R+1]>>4],w+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(b[R+1]&15)<<2|b[R+2]>>6],w+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[b[R+2]&63];return b.length%3===2?w=w.substring(0,w.length-1)+"=":b.length%3===1&&(w=w.substring(0,w.length-2)+"=="),w}function l(y,b){var w="";if(y&&(w=a.call(y)),y&&(w==="[object ArrayBuffer]"||y.buffer&&a.call(y.buffer)==="[object ArrayBuffer]")){var R=void 0,T="__lfsc__:";y instanceof ArrayBuffer?(R=y,T+="arbf"):(R=y.buffer,w==="[object Int8Array]"?T+="si08":w==="[object Uint8Array]"?T+="ui08":w==="[object Uint8ClampedArray]"?T+="uic8":w==="[object Int16Array]"?T+="si16":w==="[object Uint16Array]"?T+="ur16":w==="[object Int32Array]"?T+="si32":w==="[object Uint32Array]"?T+="ui32":w==="[object Float32Array]"?T+="fl32":w==="[object Float64Array]"?T+="fl64":b(new Error("Failed to get type for BinaryArray"))),b(T+u(R))}else if(w==="[object Blob]"){var S=new FileReader;S.onload=function(){var p="~~local_forage_type~"+y.type+"~"+u(this.result);b("__lfsc__:blob"+p)},S.readAsArrayBuffer(y)}else try{b(JSON.stringify(y))}catch(p){console.error("Couldn't convert value into a JSON string: ",y),b(null,p)}}function h(y){if(y.substring(0,o)!=="__lfsc__:")return JSON.parse(y);var b=y.substring(s),w=y.substring(o,s),R;if(w==="blob"&&i.test(b)){var T=b.match(i);R=T[1],b=b.substring(T[0].length)}var S=c(b);switch(w){case"arbf":return S;case"blob":return n([S],{type:R});case"si08":return new Int8Array(S);case"ui08":return new Uint8Array(S);case"uic8":return new Uint8ClampedArray(S);case"si16":return new Int16Array(S);case"ur16":return new Uint16Array(S);case"si32":return new Int32Array(S);case"ui32":return new Uint32Array(S);case"fl32":return new Float32Array(S);case"fl64":return new Float64Array(S);default:throw new Error("Unkown type: "+w)}}function d(y){var b,w;if(y===null||typeof y!="object"||"isActiveClone"in y)return y;var R=y instanceof Date?new Date(y):y.constructor();try{for(var T=r(Object.keys(y)),S=T.next();!S.done;S=T.next()){var p=S.value;Object.prototype.hasOwnProperty.call(y,p)&&(y.isActiveClone=null,R[p]=d(y[p]),delete y.isActiveClone)}}catch(A){b={error:A}}finally{try{S&&!S.done&&(w=T.return)&&w.call(T)}finally{if(b)throw b.error}}return R}function m(y,b){return(y.name||b.name)+"/"+(y.storeName||b.storeName)+"/"}function v(y,b){b&&y.then(function(w){b(null,w)},function(w){b(w)})}function x(){for(var y=[],b=0;b<arguments.length;b++)y[b]=arguments[b];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function O(y,b){var w=this;if(b=x.apply(this,arguments),y=typeof y!="function"&&y||{},!y.name){var R=this.config();y.name=y.name||R.name,y.storeName=y.storeName||R.storeName}var T;return y.name?T=new Promise(function(S){y.storeName?S(m(y,w._defaultConfig)):S(y.name+"/")}):T=Promise.reject("Invalid arguments"),{promise:T,callback:b}}function I(y){return typeof y!="string"&&(console.warn(y+" used as a key, but it is not a string."),y=String(y)),y}var j={bufferToString:u,deserialize:h,serialize:l,stringToBuffer:c},k={},B=function(){function y(b){this.kp=b,this.data={}}return y.resolve=function(b){return k[b]||(k[b]=new y(b)),k[b]},y.prototype.clear=function(){this.data={}},y.prototype.drop=function(){this.clear(),delete k[this.kp]},y.prototype.get=function(b){return this.data[b]},y.prototype.key=function(b){return this.keys()[b]},y.prototype.keys=function(){return Object.keys(this.data)},y.prototype.rm=function(b){delete this.data[b]},y.prototype.set=function(b,w){this.data[b]=w},y}();function V(y){var b=y?d(y):{},w=m(b,this._defaultConfig),R=B.resolve(w);return this._dbInfo=b,this._dbInfo.serializer=j,this._dbInfo.keyPrefix=w,this._dbInfo.mStore=R,Promise.resolve()}function q(y){var b=this,w=this.ready().then(function(){b._dbInfo.mStore.clear()});return v(w,y),w}function P(y,b){var w=O.apply(this,arguments),R=w.promise,T=w.callback,S=R.then(function(p){B.resolve(p).drop()});return v(S,T),R}function L(y,b){var w=this;y=I(y);var R=this.ready().then(function(){var T=w._dbInfo.mStore.get(y);return T==null?null:w._dbInfo.serializer.deserialize(T)});return v(R,b),R}function H(y,b){var w=this,R=this.ready().then(function(){for(var T=w._dbInfo.mStore,S=T.keys(),p=0;p<S.length;p++){var A=T.get(S[p]);if(A&&(A=w._dbInfo.serializer.deserialize(A)),A=y(A,S[p],p+1),A!==void 0)return A}});return v(R,b),R}function M(y,b){var w=this,R=this.ready().then(function(){var T;try{T=w._dbInfo.mStore.key(y),T===void 0&&(T=null)}catch{T=null}return T});return v(R,b),R}function N(y){var b=this,w=this.ready().then(function(){return b._dbInfo.mStore.keys()});return v(w,y),w}function F(y){var b=this.keys().then(function(w){return w.length});return v(b,y),b}function E(y,b){var w=this;y=I(y);var R=this.ready().then(function(){w._dbInfo.mStore.rm(y)});return v(R,b),R}function f(y,b,w){var R=this;y=I(y);var T=this.ready().then(function(){b===void 0&&(b=null);var S=b;return new Promise(function(p,A){R._dbInfo.serializer.serialize(b,function(Y,Z){if(Z)A(Z);else try{R._dbInfo.mStore.set(y,Y),p(S)}catch(G){A(G)}})})});return v(T,w),T}var g=!0;t._support=g,t._driver=e,t._initStorage=V,t.clear=q,t.dropInstance=P,t.getItem=L,t.iterate=H,t.key=M,t.keys=N,t.length=F,t.removeItem=E,t.setItem=f,Object.defineProperty(t,"__esModule",{value:!0})})});var TCe={};ir(TCe,{default:()=>RCe});var Ji=(t=>(t.MissingApiKey="MISSING_API_KEY",t.ModalNotReady="MODAL_NOT_READY",t.MalformedResponse="MALFORMED_RESPONSE",t.InvalidArgument="INVALID_ARGUMENT",t.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",t.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",t))(Ji||{}),fc=(t=>(t.SyncWeb3Method="SYNC_WEB3_METHOD",t.DuplicateIframe="DUPLICATE_IFRAME",t.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",t.DeprecationNotice="DEPRECATION_NOTICE",t))(fc||{}),hc=(t=>(t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",t[t.MagicLinkExpired=-10001]="MagicLinkExpired",t[t.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",t[t.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",t[t.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",t[t.UpdateEmailFailed=-10004]="UpdateEmailFailed",t[t.UserRequestEditEmail=-10005]="UserRequestEditEmail",t[t.InactiveRecipient=-10010]="InactiveRecipient",t[t.AccessDeniedToUser=-10011]="AccessDeniedToUser",t))(hc||{}),mn=(t=>(t.MetaMask="metamask",t.WalletConnect="wallet_connect",t.CoinbaseWallet="coinbase_wallet",t))(mn||{}),Qi=(t=>(t.WalletSelected="wallet_selected",t.WalletConnected="wallet_connected",t.WalletRejected="wallet_rejected",t.DisplayUri="display_uri",t.Uri="uri",t))(Qi||{}),Xi=(t=>(t.WalletConnectError="Missing Wallet Connect Config",t.CoinbaseWalletError="Missing Coinbase Wallet Config",t))(Xi||{}),Le=(t=>(t.LoginWithSms="magic_auth_login_with_sms",t.LoginWithEmailOTP="magic_auth_login_with_email_otp",t.LoginWithMagicLink="magic_auth_login_with_magic_link",t.LoginWithCredential="magic_auth_login_with_credential",t.GetIdToken="magic_auth_get_id_token",t.GenerateIdToken="magic_auth_generate_id_token",t.GetMetadata="magic_auth_get_metadata",t.IsLoggedIn="magic_auth_is_logged_in",t.Logout="magic_auth_logout",t.UpdateEmail="magic_auth_update_email",t.UserSettings="magic_auth_settings",t.UserSettingsTestMode="magic_auth_settings_testing_mode",t.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",t.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",t.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",t.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",t.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",t.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",t.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",t.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",t.LogoutTestMode="magic_auth_logout_testing_mode",t.UpdateEmailTestMode="magic_auth_update_email_testing_mode",t.IntermediaryEvent="magic_intermediary_event",t.AutoConnect="mc_auto_connect",t.Login="mc_login",t.RequestAccounts="eth_requestAccounts",t.GetInfo="mc_get_wallet_info",t.ShowUI="mc_wallet",t.RequestUserInfoWithUI="mc_request_user_info",t.Disconnect="mc_disconnect",t.UpdatePhoneNumber="magic_auth_update_phone_number",t.UpdatePhoneNumberTestMode="magic_auth_update_phone_number_testing_mode",t))(Le||{}),eo=(t=>(t.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",t.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",t.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",t.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",t.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",t))(eo||{}),Ts=(t=>(t.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",t))(Ts||{}),i8=(t=>(t.Harmony="HARMONY",t))(i8||{});var HM=ke(Kl());var AM=ke(Kl());var go=ke(yn()),yw=ke(Kl()),fM=ke(G8()),Zc=ke(ZO()),gt=ke(T0());sb();var S7=ke(yn()),P0=class extends li{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}};var D0=class extends li{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},N0=class{constructor(e,r){this.logger=e,this.core=r}},k0=class extends li{constructor(e,r){super(),this.relayer=e,this.logger=r}},L0=class extends li{constructor(e){super()}},j0=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}};var B0=class extends li{constructor(e,r){super(),this.relayer=e,this.logger=r}};var q0=class extends li{constructor(e,r){super(),this.core=e,this.logger=r}};var F0=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}};var U0=class{constructor(e){this.client=e}};function Ds(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}function to(t){return typeof t=="string"?t:JSON.stringify(t)}var uf=ke(eC()),DC=ke(tf()),NC=ke(Ps());var tC="EdDSA",rC="JWT",kb=".",Lb="base64url",nC="utf8",iC="utf8",oC=":",sC="did",aC="key",jb="base58btc",cC="z",uC="K36";function Pc(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function G0(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Pc(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function lC(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));let r=G0(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return Pc(r)}var $b={};ir($b,{identity:()=>jK});function PK(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var a=t.length,c=t.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function h(v){if(v instanceof Uint8Array||(ArrayBuffer.isView(v)?v=new Uint8Array(v.buffer,v.byteOffset,v.byteLength):Array.isArray(v)&&(v=Uint8Array.from(v))),!(v instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(v.length===0)return"";for(var x=0,O=0,I=0,j=v.length;I!==j&&v[I]===0;)I++,x++;for(var k=(j-I)*l+1>>>0,B=new Uint8Array(k);I!==j;){for(var V=v[I],q=0,P=k-1;(V!==0||q<O)&&P!==-1;P--,q++)V+=256*B[P]>>>0,B[P]=V%a>>>0,V=V/a>>>0;if(V!==0)throw new Error("Non-zero carry");O=q,I++}for(var L=k-O;L!==k&&B[L]===0;)L++;for(var H=c.repeat(x);L<k;++L)H+=t.charAt(B[L]);return H}function d(v){if(typeof v!="string")throw new TypeError("Expected String");if(v.length===0)return new Uint8Array;var x=0;if(v[x]!==" "){for(var O=0,I=0;v[x]===c;)O++,x++;for(var j=(v.length-x)*u+1>>>0,k=new Uint8Array(j);v[x];){var B=r[v.charCodeAt(x)];if(B===255)return;for(var V=0,q=j-1;(B!==0||V<I)&&q!==-1;q--,V++)B+=a*k[q]>>>0,k[q]=B%256>>>0,B=B/256>>>0;if(B!==0)throw new Error("Non-zero carry");I=V,x++}if(v[x]!==" "){for(var P=j-I;P!==j&&k[P]===0;)P++;for(var L=new Uint8Array(O+(j-P)),H=O;P!==j;)L[H++]=k[P++];return L}}}function m(v){var x=d(v);if(x)return x;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:d,decode:m}}var DK=PK,NK=DK,fC=NK;var jAe=new Uint8Array(0);var hC=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},no=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")};var dC=t=>new TextEncoder().encode(t),pC=t=>new TextDecoder().decode(t);var Bb=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},qb=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return mC(this,e)}},Fb=class{constructor(e){this.decoders=e}or(e){return mC(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},mC=(t,e)=>new Fb({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),Ub=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Bb(e,r,n),this.decoder=new qb(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Dc=({name:t,prefix:e,encode:r,decode:n})=>new Ub(t,e,r,n),$o=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=fC(r,e);return Dc({prefix:t,name:e,encode:n,decode:o=>no(i(o))})},kK=(t,e,r,n)=>{let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=t.length;for(;t[o-1]==="=";)--o;let s=new Uint8Array(o*r/8|0),a=0,c=0,u=0;for(let l=0;l<o;++l){let h=i[t[l]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|h,a+=r,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},LK=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,o="",s=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],s+=8;s>r;)s-=r,o+=e[i&a>>s];if(s&&(o+=e[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},Jt=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Dc({prefix:e,name:t,encode(i){return LK(i,n,r)},decode(i){return kK(i,n,r,t)}});var jK=Dc({prefix:"\0",name:"identity",encode:t=>pC(t),decode:t=>dC(t)});var Wb={};ir(Wb,{base2:()=>BK});var BK=Jt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Hb={};ir(Hb,{base8:()=>qK});var qK=Jt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var zb={};ir(zb,{base10:()=>FK});var FK=$o({prefix:"9",name:"base10",alphabet:"0123456789"});var Vb={};ir(Vb,{base16:()=>UK,base16upper:()=>$K});var UK=Jt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),$K=Jt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Gb={};ir(Gb,{base32:()=>Nc,base32hex:()=>VK,base32hexpad:()=>KK,base32hexpadupper:()=>YK,base32hexupper:()=>GK,base32pad:()=>HK,base32padupper:()=>zK,base32upper:()=>WK,base32z:()=>ZK});var Nc=Jt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),WK=Jt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),HK=Jt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),zK=Jt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),VK=Jt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),GK=Jt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),KK=Jt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),YK=Jt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ZK=Jt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Kb={};ir(Kb,{base36:()=>JK,base36upper:()=>QK});var JK=$o({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),QK=$o({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Yb={};ir(Yb,{base58btc:()=>fi,base58flickr:()=>XK});var fi=$o({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),XK=$o({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Zb={};ir(Zb,{base64:()=>eY,base64pad:()=>tY,base64url:()=>rY,base64urlpad:()=>nY});var eY=Jt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),tY=Jt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),rY=Jt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),nY=Jt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Jb={};ir(Jb,{base256emoji:()=>cY});var yC=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}"),iY=yC.reduce((t,e,r)=>(t[r]=e,t),[]),oY=yC.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function sY(t){return t.reduce((e,r)=>(e+=iY[r],e),"")}function aY(t){let e=[];for(let r of t){let n=oY[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var cY=Dc({prefix:"\u{1F680}",name:"base256emoji",encode:sY,decode:aY});var t_={};ir(t_,{sha256:()=>AY,sha512:()=>IY});var uY=_C,vC=128,lY=127,fY=~lY,hY=Math.pow(2,31);function _C(t,e,r){e=e||[],r=r||0;for(var n=r;t>=hY;)e[r++]=t&255|vC,t/=128;for(;t&fY;)e[r++]=t&255|vC,t>>>=7;return e[r]=t|0,_C.bytes=r-n+1,e}var dY=Qb,pY=128,bC=127;function Qb(t,n){var r=0,n=n||0,i=0,o=n,s,a=t.length;do{if(o>=a)throw Qb.bytes=0,new RangeError("Could not decode varint");s=t[o++],r+=i<28?(s&bC)<<i:(s&bC)*Math.pow(2,i),i+=7}while(s>=pY);return Qb.bytes=o-n,r}var gY=Math.pow(2,7),mY=Math.pow(2,14),yY=Math.pow(2,21),vY=Math.pow(2,28),bY=Math.pow(2,35),_Y=Math.pow(2,42),wY=Math.pow(2,49),EY=Math.pow(2,56),SY=Math.pow(2,63),xY=function(t){return t<gY?1:t<mY?2:t<yY?3:t<vY?4:t<bY?5:t<_Y?6:t<wY?7:t<EY?8:t<SY?9:10},OY={encode:uY,decode:dY,encodingLength:xY},CY=OY,of=CY;var sf=(t,e=0)=>[of.decode(t,e),of.decode.bytes],kc=(t,e,r=0)=>(of.encode(t,e,r),e),Lc=t=>of.encodingLength(t);var js=(t,e)=>{let r=e.byteLength,n=Lc(t),i=n+Lc(r),o=new Uint8Array(i+r);return kc(t,o,0),kc(r,o,n),o.set(e,i),new jc(t,r,e,o)},wC=t=>{let e=no(t),[r,n]=sf(e),[i,o]=sf(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new jc(r,i,s,e)},EC=(t,e)=>t===e?!0:t.code===e.code&&t.size===e.size&&hC(t.bytes,e.bytes),jc=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var e_=({name:t,code:e,encode:r})=>new Xb(t,e,r),Xb=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?js(this.code,r):r.then(n=>js(this.code,n))}else throw Error("Unknown type, must be binary type")}};var xC=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),AY=e_({name:"sha2-256",code:18,encode:xC("SHA-256")}),IY=e_({name:"sha2-512",code:19,encode:xC("SHA-512")});var r_={};ir(r_,{identity:()=>TY});var OC=0,MY="identity",CC=no,RY=t=>js(OC,CC(t)),TY={code:OC,name:MY,encode:CC,digest:RY};var iIe=new TextEncoder,oIe=new TextDecoder;var pr=class{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this.byteOffset=i.byteOffset,this.byteLength=i.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:Z0,byteLength:Z0,code:Y0,version:Y0,multihash:Y0,bytes:Y0,_baseCache:Z0,asCID:Z0})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:r}=this;if(e!==cf)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==jY)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return pr.createV0(r)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=js(e,r);return pr.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&EC(this.multihash,e.multihash)}toString(e){let{bytes:r,version:n,_baseCache:i}=this;switch(n){case 0:return kY(r,i,e||fi.encoder);default:return LY(r,i,e||Nc.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return qY(/^0\.0/,FY),!!(e&&(e[IC]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof pr)return e;if(e!=null&&e.asCID===e){let{version:r,code:n,multihash:i,bytes:o}=e;return new pr(r,n,i,o||AC(r,n,i.bytes))}else if(e!=null&&e[IC]===!0){let{version:r,multihash:n,code:i}=e,o=wC(n);return pr.create(r,i,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(r!==cf)throw new Error(`Version 0 CID must use dag-pb (code: ${cf}) block encoding`);return new pr(e,r,n,n.bytes)}case 1:{let i=AC(e,r,n.bytes);return new pr(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return pr.create(0,cf,e)}static createV1(e,r){return pr.create(1,e,r)}static decode(e){let[r,n]=pr.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=pr.inspectBytes(e),n=r.size-r.multihashSize,i=no(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=i.subarray(r.multihashSize-r.digestSize),s=new jc(r.multihashCode,r.digestSize,o,i);return[r.version===0?pr.createV0(s):pr.createV1(r.codec,s),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,d]=sf(e.subarray(r));return r+=d,h},i=n(),o=cf;if(i===18?(i=0,r=0):i===1&&(o=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=r,a=n(),c=n(),u=r+c,l=u-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:u}}static parse(e,r){let[n,i]=NY(e,r),o=pr.decode(i);return o._baseCache.set(n,e),o}},NY=(t,e)=>{switch(t[0]){case"Q":{let r=e||fi;return[fi.prefix,r.decode(`${fi.prefix}${t}`)]}case fi.prefix:{let r=e||fi;return[fi.prefix,r.decode(t)]}case Nc.prefix:{let r=e||Nc;return[Nc.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},kY=(t,e,r)=>{let{prefix:n}=r;if(n!==fi.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let o=r.encode(t).slice(1);return e.set(n,o),o}else return i},LY=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let o=r.encode(t);return e.set(n,o),o}else return i},cf=112,jY=18,AC=(t,e,r)=>{let n=Lc(t),i=n+Lc(e),o=new Uint8Array(i+r.byteLength);return kc(t,o,0),kc(e,o,n),o.set(r,i),o},IC=Symbol.for("@ipld/js-cid/CID"),Y0={writable:!1,configurable:!1,enumerable:!0},Z0={writable:!1,enumerable:!1,configurable:!1},BY="0.0.0-dev",qY=(t,e)=>{if(t.test(BY))console.warn(e);else throw new Error(e)},FY=`CID.isCID(v) is deprecated and will be removed in the next major release.
51
+ Following code pattern:
52
+
53
+ if (CID.isCID(value)) {
54
+ doSomethingWithCID(value)
55
+ }
56
+
57
+ Is replaced with:
58
+
59
+ const cid = CID.asCID(value)
60
+ if (cid) {
61
+ // Make sure to use cid instead of value
62
+ doSomethingWithCID(cid)
63
+ }
64
+ `;var Bc={...$b,...Wb,...Hb,...zb,...Vb,...Gb,...Kb,...Yb,...Zb,...Jb},dIe={...t_,...r_};function RC(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var MC=RC("utf8","u",t=>{let e=new TextDecoder("utf8");return"u"+e.decode(t)},t=>new TextEncoder().encode(t.substring(1))),n_=RC("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);let e=G0(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),UY={utf8:MC,"utf-8":MC,hex:Bc.base16,latin1:n_,ascii:n_,binary:n_,...Bc},J0=UY;function Q0(t,e="utf8"){let r=J0[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 X0(t,e="utf8"){let r=J0[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Pc(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function e1(t){return Q0(X0(to(t),nC),Lb)}function t1(t){let e=X0(uC,jb),r=cC+Q0(lC([e,t]),jb);return[sC,aC,r].join(oC)}function $Y(t){return Q0(t,Lb)}function TC(t){return X0([e1(t.header),e1(t.payload)].join(kb),iC)}function PC(t){return[e1(t.header),e1(t.payload),$Y(t.signature)].join(kb)}function i_(t=(0,DC.randomBytes)(32)){return uf.generateKeyPairFromSeed(t)}async function kC(t,e,r,n,i=(0,NC.fromMiliseconds)(Date.now())){let o={alg:tC,typ:rC},s=t1(n.publicKey),a=i+r,c={iss:s,sub:t,aud:e,iat:i,exp:a},u=TC({header:o,payload:c}),l=uf.sign(n.secretKey,u);return PC({header:o,payload:c,signature:l})}var y_=ke(WC()),UA=ke(YC()),v_=ke(tf()),mf=ke(JC()),d1=ke(tA());function pf(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function l1(t,e){e||(e=t.reduce((i,o)=>i+o.length,0));let r=pf(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}function nA(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var rA=nA("utf8","u",t=>{let e=new TextDecoder("utf8");return"u"+e.decode(t)},t=>new TextEncoder().encode(t.substring(1))),f_=nA("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);let e=pf(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),bZ={utf8:rA,"utf-8":rA,hex:Bc.base16,latin1:f_,ascii:f_,binary:f_,...Bc},f1=bZ;function bn(t,e="utf8"){let r=f1[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 _n(t,e="utf8"){let r=f1[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 iA=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},_Z=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}();var wZ=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}();var EZ=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}();var SZ=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}();var xZ=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}();var OZ=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,CZ=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,oA=3,AZ=[["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",OZ]],sA=[["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 cA(t){return t?aA(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new xZ:typeof navigator<"u"?aA(navigator.userAgent):RZ()}function IZ(t){return t!==""&&AZ.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var o=i.exec(t);return!!o&&[n,o]},!1)}function aA(t){var e=IZ(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new SZ;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<oA&&(i=iA(iA([],i,!0),TZ(oA-i.length),!0)):i=[];var o=i.join("."),s=MZ(t),a=CZ.exec(t);return a&&a[1]?new EZ(r,o,s,a[1]):new _Z(r,o,s)}function MZ(t){for(var e=0,r=sA.length;e<r;e++){var n=sA[e],i=n[0],o=n[1],s=o.exec(t);if(s)return i}return null}function RZ(){var t=typeof process<"u"&&process.version;return t?new wZ(process.version.slice(1)):null}function TZ(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var co=ke(Ps()),qs=ke(h_()),$A=ke(lA()),Uc=ke(MA());var RA={waku:{publish:"waku_publish",subscribe:"waku_subscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe"},irn:{publish:"irn_publish",subscribe:"irn_subscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe"},iridium:{publish:"iridium_publish",subscribe:"iridium_subscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe"}};var WA="base10",an="base16",g_="base64pad",b_="utf8",HA=0,uo=1,QZ=0,TA=1,m_=12,__=32;function zA(){let t=d1.generateKeyPair();return{privateKey:_n(t.secretKey,an),publicKey:_n(t.publicKey,an)}}function p1(){let t=(0,v_.randomBytes)(__);return _n(t,an)}function VA(t,e){let r=d1.sharedKey(bn(t,an),bn(e,an)),n=new UA.HKDF(mf.SHA256,r).expand(__);return _n(n,an)}function GA(t){let e=(0,mf.hash)(bn(t,an));return _n(e,an)}function g1(t){let e=(0,mf.hash)(bn(t,b_));return _n(e,an)}function XZ(t){return bn(`${t}`,WA)}function $c(t){return Number(_n(t,WA))}function KA(t){let e=XZ(typeof t.type<"u"?t.type:HA);if($c(e)===uo&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");let r=typeof t.senderPublicKey<"u"?bn(t.senderPublicKey,an):void 0,n=typeof t.iv<"u"?bn(t.iv,an):(0,v_.randomBytes)(m_),i=new y_.ChaCha20Poly1305(bn(t.symKey,an)).seal(n,bn(t.message,b_));return eJ({type:e,sealed:i,iv:n,senderPublicKey:r})}function YA(t){let e=new y_.ChaCha20Poly1305(bn(t.symKey,an)),{sealed:r,iv:n}=m1(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return _n(i,b_)}function eJ(t){if($c(t.type)===uo){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return _n(l1([t.type,t.senderPublicKey,t.iv,t.sealed]),g_)}return _n(l1([t.type,t.iv,t.sealed]),g_)}function m1(t){let e=bn(t,g_),r=e.slice(QZ,TA),n=TA;if($c(r)===uo){let a=n+__,c=a+m_,u=e.slice(n,a),l=e.slice(a,c),h=e.slice(c);return{type:r,sealed:h,iv:l,senderPublicKey:u}}let i=n+m_,o=e.slice(n,i),s=e.slice(i);return{type:r,sealed:s,iv:o}}function ZA(t,e){let r=m1(t);return w_({type:$c(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?_n(r.senderPublicKey,an):void 0,receiverPublicKey:e?.receiverPublicKey})}function w_(t){let e=t?.type||HA;if(e===uo){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 E_(t){return t.type===uo&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var tJ=Object.defineProperty,PA=Object.getOwnPropertySymbols,rJ=Object.prototype.hasOwnProperty,nJ=Object.prototype.propertyIsEnumerable,DA=(t,e,r)=>e in t?tJ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,NA=(t,e)=>{for(var r in e||(e={}))rJ.call(e,r)&&DA(t,r,e[r]);if(PA)for(var r of PA(e))nJ.call(e,r)&&DA(t,r,e[r]);return t},iJ="ReactNative",gf={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"};var oJ="js";function JA(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function sJ(){return!(0,qs.getDocument)()&&!!(0,qs.getNavigator)()&&navigator.product===iJ}function aJ(){return!JA()&&!!(0,qs.getNavigator)()}function cJ(){return sJ()?gf.reactNative:JA()?gf.node:aJ()?gf.browser:gf.unknown}function uJ(t,e){let r=Uc.parse(t);return r=NA(NA({},r),e),t=Uc.stringify(r),t}function QA(){return(0,$A.getWindowMetadata)()||{name:"",description:"",url:"",icons:[""]}}function lJ(){let t=cA();if(t===null)return"unknown";let e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function fJ(){var t;let e=cJ();return e===gf.browser?[e,((t=(0,qs.getLocation)())==null?void 0:t.host)||"unknown"].join(":"):e}function hJ(t,e,r){let n=lJ(),i=fJ();return[[t,e].join("-"),[oJ,r].join("-"),n,i].join("/")}function XA({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:o}){let s=r.split("?"),a=hJ(t,e,n),c={auth:i,ua:a,projectId:o},u=uJ(s[1]||"",c);return s[0]+"?"+u}function sn(t,e){return t.filter(r=>e.includes(r)).length===t.length}function S_(t){return Object.fromEntries(t.entries())}function x_(t){return new Map(Object.entries(t))}function Tn(t,e){return(0,co.fromMiliseconds)((e||Date.now())+(0,co.toMiliseconds)(t))}function gi(t){return(0,co.fromMiliseconds)(Date.now())>=(0,co.toMiliseconds)(t)}function lo(t){let e=(0,co.toMiliseconds)(t||co.FIVE_MINUTES),r,n,i;return{resolve:o=>{i&&r&&(clearTimeout(i),r(o))},reject:o=>{i&&n&&(clearTimeout(i),n(o))},done:()=>new Promise((o,s)=>{i=setTimeout(s,e),r=o,n=s})}}function O_(t,e){return new Promise(async(r,n)=>{let i=setTimeout(()=>n(),e),o=await t;clearTimeout(i),r(o)})}function eI(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 tI(t){return eI("topic",t)}function rI(t){return eI("id",t)}function y1(t){let[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function Gt(t,e){return`${t}${e?`:${e}`:""}`}var dJ="irn";function v1(t){return t?.relay||{protocol:dJ}}function b1(t){let e=RA[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var pJ=Object.defineProperty,kA=Object.getOwnPropertySymbols,gJ=Object.prototype.hasOwnProperty,mJ=Object.prototype.propertyIsEnumerable,LA=(t,e,r)=>e in t?pJ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yJ=(t,e)=>{for(var r in e||(e={}))gJ.call(e,r)&&LA(t,r,e[r]);if(kA)for(var r of kA(e))mJ.call(e,r)&&LA(t,r,e[r]);return t};function vJ(t,e="-"){let r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){let o=i.replace(n,""),s=t[i];r[o]=s}}),r}function nI(t){let e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),o=typeof r<"u"?t.substring(r):"",s=Uc.parse(o);return{protocol:n,topic:i[0],version:parseInt(i[1],10),symKey:s.symKey,relay:vJ(s)}}function bJ(t,e="-"){let r="relay",n={};return Object.keys(t).forEach(i=>{let o=r+e+i;t[i]&&(n[o]=t[i])}),n}function iI(t){return`${t.protocol}:${t.topic}@${t.version}?`+Uc.stringify(yJ({symKey:t.symKey},bJ(t.relay)))}function pi(t){let e=[];return t.forEach(r=>{let[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function _J(t){let e=[];return Object.values(t).forEach(r=>{e.push(...pi(r.accounts)),r.extension&&r.extension.forEach(n=>{e.push(...pi(n.accounts))})}),e}function wJ(t,e){let r=[];return Object.values(t).forEach(n=>{pi(n.accounts).includes(e)&&r.push(...n.methods),n.extension&&n.extension.forEach(i=>{pi(i.accounts).includes(e)&&r.push(...i.methods)})}),r}function EJ(t,e){let r=[];return Object.values(t).forEach(n=>{pi(n.accounts).includes(e)&&r.push(...n.events),n.extension&&n.extension.forEach(i=>{pi(i.accounts).includes(e)&&r.push(...i.events)})}),r}function oI(t,e){let r=vf(t,e);if(r)throw new Error(r.message);let n={};for(let[i,o]of Object.entries(t))n[i]={methods:o.methods,events:o.events,chains:o.accounts.map(s=>`${s.split(":")[0]}:${s.split(":")[1]}`)};return n}var SJ={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}},xJ={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 ce(t,e){let{message:r,code:n}=xJ[t];return{message:e?`${r} ${e}`:r,code:n}}function Vt(t,e){let{message:r,code:n}=SJ[t];return{message:e?`${r} ${e}`:r,code:n}}function Fs(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function yf(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Hr(t){return typeof t>"u"}function gr(t,e){return e&&Hr(t)?!0:typeof t=="string"&&Boolean(t.trim().length)}function C_(t,e){return e&&Hr(t)?!0:typeof t=="number"&&!isNaN(t)}function sI(t,e){let{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r),o=!0;return sn(i,n)?(n.forEach(s=>{let{accounts:a,methods:c,events:u,extension:l}=t.namespaces[s],h=pi(a),d=r[s];(!sn(d.chains,h)||!sn(d.methods,c)||!sn(d.events,u))&&(o=!1),o&&l&&l.forEach(m=>{var v;let{accounts:x,methods:O,events:I}=m,j=pi(x);(v=d.extension)!=null&&v.find(k=>sn(k.chains,j)&&sn(k.methods,O)&&sn(k.events,I))||(o=!1)})}),o):!1}function A_(t){return gr(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function OJ(t){if(gr(t,!1)&&t.includes(":")){let e=t.split(":");if(e.length===3){let r=e[0]+":"+e[1];return!!e[2]&&A_(r)}}return!1}function aI(t){if(gr(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function cI(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function uI(t){return t?.topic}function lI(t,e){let r=null;return gr(t?.publicKey,!1)||(r=ce("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function I_(t,e){let r=null;return Hr(t?.extension)||(!Fs(t.extension)||!t.extension.length)&&(r=ce("MISSING_OR_INVALID",`${e} extension should be an array of namespaces, or omitted`)),r}function jA(t){let e=!0;return Fs(t)?t.length&&(e=t.every(r=>gr(r,!1))):e=!1,e}function BA(t,e,r){let n=null;return Fs(e)?e.forEach(i=>{n||(!A_(i)||!i.includes(t))&&(n=Vt("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):n=Vt("UNSUPPORTED_CHAINS",`${r}, chains ${e} should be an array of strings conforming to "namespace:chainId" format`),n}function CJ(t,e){let r=null;return Object.entries(t).forEach(([n,i])=>{if(r)return;let o=BA(n,i?.chains,`${e} requiredNamespace`),s=I_(i,e);o?r=o:s?r=s:i.extension&&i.extension.forEach(a=>{if(r)return;let c=BA(n,a.chains,`${e} extension`);c&&(r=c)})}),r}function qA(t,e){let r=null;return Fs(t)?t.forEach(n=>{r||OJ(n)||(r=Vt("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Vt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function AJ(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;let i=qA(n?.accounts,`${e} namespace`),o=I_(n,e);i?r=i:o?r=o:n.extension&&n.extension.forEach(s=>{if(r)return;let a=qA(s.accounts,`${e} extension`);a&&(r=a)})}),r}function FA(t,e){let r=null;return jA(t?.methods)?jA(t?.events)||(r=Vt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Vt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function fI(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;let i=FA(n,`${e}, namespace`),o=I_(n,e);i?r=i:o?r=o:n.extension&&n.extension.forEach(s=>{if(r)return;let a=FA(s,`${e}, extension`);a&&(r=a)})}),r}function hI(t,e){let r=null;if(t&&yf(t)){let n=fI(t,e);n&&(r=n);let i=CJ(t,e);i&&(r=i)}else r=ce("MISSING_OR_INVALID",`${e}, requiredNamespaces should be an object with data`);return r}function vf(t,e){let r=null;if(t&&yf(t)){let n=fI(t,e);n&&(r=n);let i=AJ(t,e);i&&(r=i)}else r=ce("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function M_(t){return gr(t.protocol,!0)}function dI(t,e){let r=!1;return e&&!t?r=!0:t&&Fs(t)&&t.length&&t.forEach(n=>{r=M_(n)}),r}function pI(t){return typeof t=="number"}function Dr(t){return typeof t<"u"&&typeof t!==null}function gI(t){return!(!t||typeof t!="object"||!t.code||!C_(t.code,!1)||!t.message||!gr(t.message,!1))}function mI(t){return!(Hr(t)||!gr(t.method,!1))}function yI(t){return!(Hr(t)||Hr(t.result)&&Hr(t.error)||!C_(t.id,!1)||!gr(t.jsonrpc,!1))}function vI(t){return!(Hr(t)||!gr(t.name,!1))}function R_(t,e){return!(!A_(e)||!_J(t).includes(e))}function bI(t,e,r){return gr(r,!1)?wJ(t,e).includes(r):!1}function _I(t,e,r){return gr(r,!1)?EJ(t,e).includes(r):!1}function T_(t,e,r){let n=null,i=Object.keys(t),o=Object.keys(e);return sn(i,o)?i.forEach(s=>{var a;if(n)return;let c=t[s].chains,u=pi(e[s].accounts);sn(c,u)?sn(t[s].methods,e[s].methods)?sn(t[s].events,e[s].events)?t[s].extension&&!e[s].extension?n=ce("NON_CONFORMING_NAMESPACES",`${r} namespaces extension doesn't satisfy requiredNamespaces extension for ${s}`):t[s].extension&&e[s].extension&&((a=t[s].extension)==null||a.forEach(({methods:l,events:h,chains:d})=>{var m;n||(m=e[s].extension)!=null&&m.find(v=>{let x=pi(v.accounts);return sn(d,x)&&sn(h,v.events)&&sn(l,v.methods)})||(n=ce("NON_CONFORMING_NAMESPACES",`${r} namespaces extension doesn't satisfy requiredNamespaces extension for ${s}`))})):n=ce("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy requiredNamespaces events for ${s}`):n=ce("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy requiredNamespaces methods for ${s}`):n=ce("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy requiredNamespaces chains for ${s}`)}):n=ce("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces`),n}function wI(t,e){return C_(t,!1)&&t<=e.max&&t>=e.min}var Ut=ke(Ps());var o9=ke(yn());var xr={};ir(xr,{DEFAULT_ERROR:()=>_f,IBaseJsonRpcProvider:()=>R1,IEvents:()=>zc,IJsonRpcConnection:()=>L_,IJsonRpcProvider:()=>Ef,INTERNAL_ERROR:()=>_1,INVALID_PARAMS:()=>OI,INVALID_REQUEST:()=>SI,METHOD_NOT_FOUND:()=>xI,PARSE_ERROR:()=>EI,RESERVED_ERROR_CODES:()=>P_,SERVER_ERROR:()=>bf,SERVER_ERROR_CODE_RANGE:()=>w1,STANDARD_ERROR_MAP:()=>Ho,formatErrorMessage:()=>n9,formatJsonRpcError:()=>fo,formatJsonRpcRequest:()=>Go,formatJsonRpcResult:()=>Hc,getError:()=>S1,getErrorByCode:()=>x1,isHttpUrl:()=>T1,isJsonRpcError:()=>Vr,isJsonRpcPayload:()=>B_,isJsonRpcRequest:()=>Vc,isJsonRpcResponse:()=>Us,isJsonRpcResult:()=>Pn,isJsonRpcValidationInvalid:()=>BJ,isLocalhostUrl:()=>j_,isNodeJs:()=>t9,isReservedErrorCode:()=>E1,isServerErrorCode:()=>IJ,isValidDefaultRoute:()=>I1,isValidErrorCode:()=>CI,isValidLeadingWildcardRoute:()=>DJ,isValidRoute:()=>PJ,isValidTrailingWildcardRoute:()=>NJ,isValidWildcardRoute:()=>M1,isWsUrl:()=>P1,parseConnectionError:()=>wf,payloadId:()=>r9,validateJsonRpcError:()=>MJ});var EI="PARSE_ERROR",SI="INVALID_REQUEST",xI="METHOD_NOT_FOUND",OI="INVALID_PARAMS",_1="INTERNAL_ERROR",bf="SERVER_ERROR",P_=[-32700,-32600,-32601,-32602,-32603],w1=[-32e3,-32099],Ho={[EI]:{code:-32700,message:"Parse error"},[SI]:{code:-32600,message:"Invalid Request"},[xI]:{code:-32601,message:"Method not found"},[OI]:{code:-32602,message:"Invalid params"},[_1]:{code:-32603,message:"Internal error"},[bf]:{code:-32e3,message:"Server error"}},_f=bf;function IJ(t){return t<=w1[0]&&t>=w1[1]}function E1(t){return P_.includes(t)}function CI(t){return typeof t=="number"}function S1(t){return Object.keys(Ho).includes(t)?Ho[t]:Ho[_f]}function x1(t){let e=Object.values(Ho).find(r=>r.code===t);return e||Ho[_f]}function MJ(t){if(typeof t.error.code>"u")return{valid:!1,error:"Missing code for JSON-RPC error"};if(typeof t.error.message>"u")return{valid:!1,error:"Missing message for JSON-RPC error"};if(!CI(t.error.code))return{valid:!1,error:`Invalid error code type for JSON-RPC: ${t.error.code}`};if(E1(t.error.code)){let e=x1(t.error.code);if(e.message!==Ho[_f].message&&t.error.message===e.message)return{valid:!1,error:`Invalid error code message for JSON-RPC: ${t.error.code}`}}return{valid:!0}}function wf(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var zr={};ir(zr,{isNodeJs:()=>t9});var e9=ke(k_());gn(zr,ke(k_()));var t9=e9.isNode;gn(xr,zr);function r9(){let t=Date.now()*Math.pow(10,3),e=Math.floor(Math.random()*Math.pow(10,3));return t+e}function Go(t,e,r){return{id:r||r9(),jsonrpc:"2.0",method:t,params:e}}function Hc(t,e){return{id:t,jsonrpc:"2.0",result:e}}function fo(t,e,r){return{id:t,jsonrpc:"2.0",error:n9(e,r)}}function n9(t,e){return typeof t>"u"?S1(_1):(typeof t=="string"&&(t=Object.assign(Object.assign({},S1(bf)),{message:t})),typeof e<"u"&&(t.data=e),E1(t.code)&&(t=x1(t.code)),t)}function PJ(t){return t.includes("*")?M1(t):!/\W/g.test(t)}function I1(t){return t==="*"}function M1(t){return I1(t)?!0:!(!t.includes("*")||t.split("*").length!==2||t.split("*").filter(e=>e.trim()==="").length!==1)}function DJ(t){return!I1(t)&&M1(t)&&!t.split("*")[0].trim()}function NJ(t){return!I1(t)&&M1(t)&&!t.split("*")[1].trim()}var zc=class{};var L_=class extends zc{constructor(e){super()}},R1=class extends zc{constructor(){super()}},Ef=class extends R1{constructor(e){super()}};var kJ="^https?:",LJ="^wss?:";function jJ(t){let e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function i9(t,e){let r=jJ(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function T1(t){return i9(t,kJ)}function P1(t){return i9(t,LJ)}function j_(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function B_(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function Vc(t){return B_(t)&&"method"in t}function Us(t){return B_(t)&&(Pn(t)||Vr(t))}function Pn(t){return"result"in t}function Vr(t){return"error"in t}function BJ(t){return"error"in t&&t.valid===!1}var $s=class extends Ef{constructor(e){super(e),this.events=new o9.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(Go(e.method,e.params||[]),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(o){i(o)}this.events.on(`${e.id}`,o=>{Vr(o)?i(o.error):n(o.result)});try{await this.connection.send(e,r)}catch(o){i(o)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Us(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}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",()=>this.events.emit("disconnect")),this.connection.on("error",e=>this.events.emit("error",e)),this.hasRegisteredEventListeners=!0)}};var u9=ke(yn());var c9=10,qJ=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:a9(),FJ=()=>typeof window<"u",UJ=qJ(),q_=class{constructor(e){if(this.url=e,this.events=new u9.EventEmitter,this.registering=!1,!P1(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=()=>{this.onClose(),e()},this.socket.close()})}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(to(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!P1(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){let r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{let i=(0,xr.isReactNative)()?void 0:{rejectUnauthorized:!j_(e)},o=new UJ(e,[],i);FJ()?o.onerror=s=>{let a=s;n(this.emitError(a.error))}:o.on("error",s=>{n(this.emitError(s))}),o.onopen=()=>{this.onOpen(o),r(o)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=()=>this.onClose(),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(){this.socket=void 0,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;let r=typeof e.data=="string"?Ds(e.data):e.data;this.events.emit("payload",r)}onError(e,r){let n=this.parseError(r),i=n.message||n.toString(),o=fo(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return wf(e,r,"WS")}resetMaxListeners(){this.events.getMaxListeners()>c9&&this.events.setMaxListeners(c9)}emitError(e){let r=this.parseError(new Error(e?.message||`WebSocket connection failed for URL: ${this.url}`));return this.events.emit("register_error",r),r}},l9=q_;var f9=l9;var hM=ke(V9());function vX(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var a=t.length,c=t.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function h(v){if(v instanceof Uint8Array||(ArrayBuffer.isView(v)?v=new Uint8Array(v.buffer,v.byteOffset,v.byteLength):Array.isArray(v)&&(v=Uint8Array.from(v))),!(v instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(v.length===0)return"";for(var x=0,O=0,I=0,j=v.length;I!==j&&v[I]===0;)I++,x++;for(var k=(j-I)*l+1>>>0,B=new Uint8Array(k);I!==j;){for(var V=v[I],q=0,P=k-1;(V!==0||q<O)&&P!==-1;P--,q++)V+=256*B[P]>>>0,B[P]=V%a>>>0,V=V/a>>>0;if(V!==0)throw new Error("Non-zero carry");O=q,I++}for(var L=k-O;L!==k&&B[L]===0;)L++;for(var H=c.repeat(x);L<k;++L)H+=t.charAt(B[L]);return H}function d(v){if(typeof v!="string")throw new TypeError("Expected String");if(v.length===0)return new Uint8Array;var x=0;if(v[x]!==" "){for(var O=0,I=0;v[x]===c;)O++,x++;for(var j=(v.length-x)*u+1>>>0,k=new Uint8Array(j);v[x];){var B=r[v.charCodeAt(x)];if(B===255)return;for(var V=0,q=j-1;(B!==0||V<I)&&q!==-1;q--,V++)B+=a*k[q]>>>0,k[q]=B%256>>>0,B=B/256>>>0;if(B!==0)throw new Error("Non-zero carry");I=V,x++}if(v[x]!==" "){for(var P=j-I;P!==j&&k[P]===0;)P++;for(var L=new Uint8Array(O+(j-P)),H=O;P!==j;)L[H++]=k[P++];return L}}}function m(v){var x=d(v);if(x)return x;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:d,decode:m}}var bX=vX,_X=bX,dM=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")},wX=t=>new TextEncoder().encode(t),EX=t=>new TextDecoder().decode(t),X_=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},ew=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return pM(this,e)}},tw=class{constructor(e){this.decoders=e}or(e){return pM(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},pM=(t,e)=>new tw({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),rw=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new X_(e,r,n),this.decoder=new ew(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},V1=({name:t,prefix:e,encode:r,decode:n})=>new rw(t,e,r,n),Rf=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=_X(r,e);return V1({prefix:t,name:e,encode:n,decode:o=>dM(i(o))})},SX=(t,e,r,n)=>{let i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=t.length;for(;t[o-1]==="=";)--o;let s=new Uint8Array(o*r/8|0),a=0,c=0,u=0;for(let l=0;l<o;++l){let h=i[t[l]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|h,a+=r,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},xX=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,o="",s=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],s+=8;s>r;)s-=r,o+=e[i&a>>s];if(s&&(o+=e[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},Or=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>V1({prefix:e,name:t,encode(i){return xX(i,n,r)},decode(i){return SX(i,n,r,t)}}),OX=V1({prefix:"\0",name:"identity",encode:t=>EX(t),decode:t=>wX(t)}),CX=Object.freeze({__proto__:null,identity:OX}),AX=Or({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),IX=Object.freeze({__proto__:null,base2:AX}),MX=Or({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),RX=Object.freeze({__proto__:null,base8:MX}),TX=Rf({prefix:"9",name:"base10",alphabet:"0123456789"}),PX=Object.freeze({__proto__:null,base10:TX}),DX=Or({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),NX=Or({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),kX=Object.freeze({__proto__:null,base16:DX,base16upper:NX}),LX=Or({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),jX=Or({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),BX=Or({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),qX=Or({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),FX=Or({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),UX=Or({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),$X=Or({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),WX=Or({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),HX=Or({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),zX=Object.freeze({__proto__:null,base32:LX,base32upper:jX,base32pad:BX,base32padupper:qX,base32hex:FX,base32hexupper:UX,base32hexpad:$X,base32hexpadupper:WX,base32z:HX}),VX=Rf({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),GX=Rf({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),KX=Object.freeze({__proto__:null,base36:VX,base36upper:GX}),YX=Rf({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ZX=Rf({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),JX=Object.freeze({__proto__:null,base58btc:YX,base58flickr:ZX}),QX=Or({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),XX=Or({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),eee=Or({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),tee=Or({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),ree=Object.freeze({__proto__:null,base64:QX,base64pad:XX,base64url:eee,base64urlpad:tee}),gM=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}"),nee=gM.reduce((t,e,r)=>(t[r]=e,t),[]),iee=gM.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function oee(t){return t.reduce((e,r)=>(e+=nee[r],e),"")}function see(t){let e=[];for(let r of t){let n=iee[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var aee=V1({prefix:"\u{1F680}",name:"base256emoji",encode:oee,decode:see}),cee=Object.freeze({__proto__:null,base256emoji:aee}),uee=mM,G9=128,lee=127,fee=~lee,hee=Math.pow(2,31);function mM(t,e,r){e=e||[],r=r||0;for(var n=r;t>=hee;)e[r++]=t&255|G9,t/=128;for(;t&fee;)e[r++]=t&255|G9,t>>>=7;return e[r]=t|0,mM.bytes=r-n+1,e}var dee=nw,pee=128,K9=127;function nw(t,n){var r=0,n=n||0,i=0,o=n,s,a=t.length;do{if(o>=a)throw nw.bytes=0,new RangeError("Could not decode varint");s=t[o++],r+=i<28?(s&K9)<<i:(s&K9)*Math.pow(2,i),i+=7}while(s>=pee);return nw.bytes=o-n,r}var gee=Math.pow(2,7),mee=Math.pow(2,14),yee=Math.pow(2,21),vee=Math.pow(2,28),bee=Math.pow(2,35),_ee=Math.pow(2,42),wee=Math.pow(2,49),Eee=Math.pow(2,56),See=Math.pow(2,63),xee=function(t){return t<gee?1:t<mee?2:t<yee?3:t<vee?4:t<bee?5:t<_ee?6:t<wee?7:t<Eee?8:t<See?9:10},Oee={encode:uee,decode:dee,encodingLength:xee},yM=Oee,Y9=(t,e,r=0)=>(yM.encode(t,e,r),e),Z9=t=>yM.encodingLength(t),iw=(t,e)=>{let r=e.byteLength,n=Z9(t),i=n+Z9(r),o=new Uint8Array(i+r);return Y9(t,o,0),Y9(r,o,n),o.set(e,i),new ow(t,r,e,o)},ow=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}},vM=({name:t,code:e,encode:r})=>new sw(t,e,r),sw=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?iw(this.code,r):r.then(n=>iw(this.code,n))}else throw Error("Unknown type, must be binary type")}},bM=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Cee=vM({name:"sha2-256",code:18,encode:bM("SHA-256")}),Aee=vM({name:"sha2-512",code:19,encode:bM("SHA-512")}),Iee=Object.freeze({__proto__:null,sha256:Cee,sha512:Aee}),_M=0,Mee="identity",wM=dM,Ree=t=>iw(_M,wM(t)),Tee={code:_M,name:Mee,encode:wM,digest:Ree},Pee=Object.freeze({__proto__:null,identity:Tee});new TextEncoder,new TextDecoder;var J9={...CX,...IX,...RX,...PX,...kX,...zX,...KX,...JX,...ree,...cee};({...Iee,...Pee});function Dee(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function EM(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Q9=EM("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),J_=EM("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);let e=Dee(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Nee={utf8:Q9,"utf-8":Q9,hex:J9.base16,latin1:J_,ascii:J_,binary:J_,...J9};function kee(t,e="utf8"){let r=Nee[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}`)}var SM="wc",Lee=2,vw="core",Zo=`${SM}@${2}:${vw}:`,jee={name:vw,logger:"error"},Bee={database:":memory:"},qee="crypto",X9="client_ed25519_seed",Fee=Ut.ONE_DAY,Uee="keychain",$ee="0.3",Wee="messages",Hee="0.3",zee=Ut.SIX_HOURS,Vee="publisher",bw="irn",Gee="error",Kee="wss://relay.walletconnect.com",Yee="relayer",Nr={message:"relayer_message",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},Zee="_subscription",H1={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},eM=Ut.ONE_SECOND;var Jee="2.2.1",Qee="0.3",vi={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"};var Xee="subscription",ete="0.3",tte=Ut.FIVE_SECONDS*1e3,rte="pairing",nte="0.3";var If={wc_pairingDelete:{req:{ttl:Ut.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Ut.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Ut.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Ut.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Ut.ONE_DAY,prompt:!1,tag:0},res:{ttl:Ut.ONE_DAY,prompt:!1,tag:0}}},yi={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},ite="history",ote="0.3",ste="expirer",wn={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},ate="0.3";var aw=class{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=Uee,this.version=$ee,this.initialized=!1,this.storagePrefix=Zo,this.init=async()=>{if(!this.initialized){let 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();let i=this.keychain.get(n);if(typeof i>"u"){let{message:o}=ce("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(o)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=(0,gt.generateChildLogger)(r,this.name)}get context(){return(0,gt.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,S_(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?x_(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}},cw=class{constructor(e,r,n){this.core=e,this.logger=r,this.name=qee,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();let i=await this.getClientSeed(),o=i_(i);return t1(o.publicKey)},this.generateKeyPair=()=>{this.isInitialized();let i=zA();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();let o=await this.getClientSeed(),s=i_(o),a=p1();return await kC(a,i,Fee,s)},this.generateSharedKey=(i,o,s)=>{this.isInitialized();let a=this.getPrivateKey(i),c=VA(a,o);return this.setSymKey(c,s)},this.setSymKey=async(i,o)=>{this.isInitialized();let s=o||GA(i);return await this.keychain.set(s,i),s},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,s)=>{this.isInitialized();let a=w_(s),c=to(o);if(E_(a)){let d=a.senderPublicKey,m=a.receiverPublicKey;i=await this.generateSharedKey(d,m)}let u=this.getSymKey(i),{type:l,senderPublicKey:h}=a;return KA({type:l,symKey:u,message:c,senderPublicKey:h})},this.decode=async(i,o,s)=>{this.isInitialized();let a=ZA(o,s);if(E_(a)){let l=a.receiverPublicKey,h=a.senderPublicKey;i=await this.generateSharedKey(l,h)}let c=this.getSymKey(i),u=YA({symKey:c,encoded:o});return Ds(u)},this.core=e,this.logger=(0,gt.generateChildLogger)(r,this.name),this.keychain=n||new aw(this.core,this.logger)}get context(){return(0,gt.getLoggerContext)(this.logger)}getPayloadType(e){let r=m1(e);return $c(r.type)}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(X9)}catch{e=p1(),await this.keychain.set(X9,e)}return kee(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}},uw=class extends N0{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=Wee,this.version=Hee,this.initialized=!1,this.storagePrefix=Zo,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{let 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();let o=g1(i),s=this.messages.get(n);return typeof s>"u"&&(s={}),typeof s[o]<"u"||(s[o]=i,this.messages.set(n,s),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();let o=this.get(n),s=g1(i);return typeof o[s]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=(0,gt.generateChildLogger)(e,this.name),this.core=r}get context(){return(0,gt.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,S_(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?x_(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){let{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}},lw=class extends k0{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new go.EventEmitter,this.name=Vee,this.queue=new Map,this.publishTimeout=1e4,this.publish=async(n,i,o)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}});try{let s=o?.ttl||zee,a=v1(o),c=o?.prompt||!1,u=o?.tag||0,l={topic:n,message:i,opts:{ttl:s,relay:a,prompt:c,tag:u}},h=g1(i);this.queue.set(h,l);try{await await O_(this.rpcPublish(n,i,s,a,c,u),this.publishTimeout),this.relayer.events.emit(Nr.publish,l)}catch{this.logger.debug("Publishing Payload stalled"),this.relayer.events.emit(Nr.connection_stalled);return}this.onPublish(h,l),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:o}})}catch(s){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(s),s}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=(0,gt.generateChildLogger)(r,this.name),this.registerEventListeners()}get context(){return(0,gt.getLoggerContext)(this.logger)}rpcPublish(e,r,n,i,o,s){var a,c,u,l;let h={method:b1(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:o,tag:s}};return Hr((a=h.params)==null?void 0:a.prompt)&&((c=h.params)==null||delete c.prompt),Hr((u=h.params)==null?void 0:u.tag)&&((l=h.params)==null||delete l.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:h}),this.relayer.provider.request(h)}onPublish(e,r){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{let{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(Zc.HEARTBEAT_EVENTS.pulse,()=>{this.checkQueue()})}},fw=class{constructor(){this.map=new Map,this.set=(e,r)=>{let n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;let n=this.get(e);if(!this.exists(e,r))return;let i=n.filter(o=>o!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}},cte=Object.defineProperty,ute=Object.defineProperties,lte=Object.getOwnPropertyDescriptors,tM=Object.getOwnPropertySymbols,fte=Object.prototype.hasOwnProperty,hte=Object.prototype.propertyIsEnumerable,rM=(t,e,r)=>e in t?cte(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,z1=(t,e)=>{for(var r in e||(e={}))fte.call(e,r)&&rM(t,r,e[r]);if(tM)for(var r of tM(e))hte.call(e,r)&&rM(t,r,e[r]);return t},Q_=(t,e)=>ute(t,lte(e)),hw=class extends B0{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new fw,this.events=new go.EventEmitter,this.name=Xee,this.version=ete,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pendingSubInterval=20,this.storagePrefix=Zo,this.subscribeTimeout=1e4,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable())},this.subscribe=async(n,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{let o=v1(i),s={topic:n,relay:o};this.pending.set(n,s);let a=await this.rpcSubscribe(n,o);return this.onSubscribe(a,s),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),a}catch(o){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(o),o}},this.unsubscribe=async(n,i)=>{this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,o)=>{let s=new Ut.Watch;s.start(this.pendingSubscriptionWatchLabel);let a=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(a),s.stop(this.pendingSubscriptionWatchLabel),i(!0)),s.elapsed(this.pendingSubscriptionWatchLabel)>=tte&&(clearInterval(a),s.stop(this.pendingSubscriptionWatchLabel),o(!1))},this.pendingSubInterval)}),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.restart=async()=>{await this.restore(),await this.reset()},this.relayer=e,this.logger=(0,gt.generateChildLogger)(r,this.name)}get context(){return(0,gt.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear(),this.initialized=!1}async unsubscribeByTopic(e,r){let n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{let i=v1(n);await this.rpcUnsubscribe(e,r,i);let o=Vt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,o),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){let n={method:b1(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await O_(this.relayer.provider.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Nr.connection_stalled)}return i}rpcUnsubscribe(e,r,n){let i={method:b1(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.provider.request(i)}onSubscribe(e,r){this.setSubscription(e,Q_(z1({},r),{id:e})),this.pending.delete(r.topic)}onResubscribe(e,r){this.addSubscription(e,Q_(z1({},r),{id:e})),this.pending.delete(r.topic)}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r))}addSubscription(e,r){this.subscriptions.set(e,z1({},r)),this.topicMap.set(r.topic,e),this.events.emit(vi.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});let r=this.subscriptions.get(e);if(!r){let{message:n}=ce("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});let n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(vi.deleted,Q_(z1({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(vi.sync)}async reset(){this.cached.length&&await Promise.all(this.cached.map(async e=>await this.resubscribe(e))),this.events.emit(vi.resubscribed)}async restore(){try{let e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){let{message:r}=ce("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),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 resubscribe(e){if(!this.ids.includes(e.id)){let{topic:r,relay:n}=e,i={topic:r,relay:n};this.pending.set(i.topic,i);let o=await this.rpcSubscribe(i.topic,i.relay);this.onResubscribe(o,i)}}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}checkPending(){this.relayer.transportExplicitlyClosed||this.pending.forEach(async e=>{let r=await this.rpcSubscribe(e.topic,e.relay);this.onSubscribe(r,e)})}registerEventListeners(){this.relayer.core.heartbeat.on(Zc.HEARTBEAT_EVENTS.pulse,()=>{this.checkPending()}),this.relayer.on(Nr.connect,async()=>{await this.onConnect()}),this.relayer.on(Nr.disconnect,()=>{this.onDisconnect()}),this.events.on(vi.created,async e=>{let r=vi.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(vi.deleted,async e=>{let r=vi.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}},dte=Object.defineProperty,nM=Object.getOwnPropertySymbols,pte=Object.prototype.hasOwnProperty,gte=Object.prototype.propertyIsEnumerable,iM=(t,e,r)=>e in t?dte(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mte=(t,e)=>{for(var r in e||(e={}))pte.call(e,r)&&iM(t,r,e[r]);if(nM)for(var r of nM(e))gte.call(e,r)&&iM(t,r,e[r]);return t},dw=class extends L0{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new go.EventEmitter,this.name=Yee,this.transportExplicitlyClosed=!1,this.initialized=!1,this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?(0,gt.generateChildLogger)(e.logger,this.name):(0,yw.default)((0,gt.getDefaultLoggerOptions)({level:e.logger||Gee})),this.messages=new uw(this.logger,e.core),this.subscriber=new hw(this,this.logger),this.publisher=new lw(this,this.logger),this.relayUrl=e?.relayUrl||Kee,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),this.provider=await this.createProvider(),await Promise.all([this.messages.init(),this.transportOpen(),this.subscriber.init()]),this.registerEventListeners(),this.initialized=!0}get context(){return(0,gt.getLoggerContext)(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r})}async subscribe(e,r){this.isInitialized();let n="";return await Promise.all([new Promise(i=>{this.subscriber.once(vi.created,o=>{o.topic===e&&i()})}),new Promise(async i=>{n=await this.subscriber.subscribe(e,r),i()})]),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 transportClose(){this.transportExplicitlyClosed=!0,this.connected&&await this.provider.disconnect(),this.events.emit(Nr.transport_closed)}async transportOpen(e){this.relayUrl=e||this.relayUrl,this.transportExplicitlyClosed=!1;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(vi.resubscribed,()=>{r()})}),await Promise.race([this.provider.connect(),new Promise((r,n)=>this.once(Nr.transport_closed,()=>{n()}))])])}catch(r){let n=r;if(!/socket hang up/i.test(n.message))throw new Error(n.message);this.logger.error(n),this.events.emit(Nr.transport_closed)}}async restartTransport(e){await this.transportClose(),await new Promise(r=>setTimeout(r,eM)),await this.transportOpen(e)}async createProvider(){let e=await this.core.crypto.signJWT(this.relayUrl);return new $s(new f9(XA({sdkVersion:Jee,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e})))}async recordMessageEvent(e){let{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){let{topic:r,message:n}=e;return await this.subscriber.isSubscribed(r)?this.messages.has(r,n):!0}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Vc(e)){if(!e.method.endsWith(Zee))return;let r=e.params,{topic:n,message:i}=r.data,o={topic:n,message:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(mte({type:"event",event:r.id},o)),this.events.emit(r.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Nr.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){let r=Hc(e.id,!0);await this.provider.connection.send(r)}registerEventListeners(){this.provider.on(H1.payload,e=>this.onProviderPayload(e)),this.provider.on(H1.connect,()=>{this.events.emit(Nr.connect)}),this.provider.on(H1.disconnect,()=>{this.events.emit(Nr.disconnect),this.attemptToReconnect()}),this.provider.on(H1.error,e=>this.events.emit(Nr.error,e)),this.events.on(Nr.connection_stalled,async()=>{await this.restartTransport()})}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.transportOpen()},(0,Ut.toMiliseconds)(eM))}isInitialized(){if(!this.initialized){let{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}},yte=Object.defineProperty,oM=Object.getOwnPropertySymbols,vte=Object.prototype.hasOwnProperty,bte=Object.prototype.propertyIsEnumerable,sM=(t,e,r)=>e in t?yte(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,aM=(t,e)=>{for(var r in e||(e={}))vte.call(e,r)&&sM(t,r,e[r]);if(oM)for(var r of oM(e))bte.call(e,r)&&sM(t,r,e[r]);return t},Gs=class extends j0{constructor(e,r,n,i=Zo,o=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=Qee,this.cached=[],this.initialized=!1,this.storagePrefix=Zo,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>{cI(s)?this.map.set(s.id,s):uI(s)?this.map.set(s.topic,s):this.getKey&&s!==null&&!Hr(s)&&this.map.set(this.getKey(s),s)}),this.cached=[],this.initialized=!0)},this.set=async(s,a)=>{this.isInitialized(),this.map.has(s)?await this.update(s,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:s,value:a}),this.map.set(s,a),await this.persist())},this.get=s=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:s}),this.getData(s)),this.getAll=s=>(this.isInitialized(),s?this.values.filter(a=>Object.keys(s).every(c=>(0,hM.default)(a[c],s[c]))):this.values),this.update=async(s,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:s,update:a});let c=aM(aM({},this.getData(s)),a);this.map.set(s,c),await this.persist()},this.delete=async(s,a)=>{this.isInitialized(),this.map.has(s)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:s,reason:a}),this.map.delete(s),await this.persist())},this.logger=(0,gt.generateChildLogger)(r,this.name),this.storagePrefix=i,this.getKey=o}get context(){return(0,gt.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let r=this.map.get(e);if(!r){let{message:n}=ce("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{let e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){let{message:r}=ce("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){let{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}},pw=class{constructor(e,r){this.core=e,this.logger=r,this.name=rte,this.version=nte,this.events=new go.default,this.initialized=!1,this.storagePrefix=Zo,this.ignoredPayloadTypes=[uo],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();let n=p1(),i=await this.core.crypto.setSymKey(n),o=Tn(Ut.FIVE_MINUTES),s={protocol:bw},a={topic:i,expiry:o,relay:s,active:!1},c=iI({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:s});return await this.pairings.set(i,a),await this.core.relayer.subscribe(i),this.core.expirer.set(i,o),{topic:i,uri:c}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);let{topic:i,symKey:o,relay:s}=nI(n.uri),a=Tn(Ut.FIVE_MINUTES),c={topic:i,relay:s,expiry:a,active:!1};return await this.pairings.set(i,c),await this.core.crypto.setSymKey(o,i),await this.core.relayer.subscribe(i,{relay:s}),this.core.expirer.set(i,a),n.activatePairing&&await this.activate({topic:i}),c},this.activate=async({topic:n})=>{this.isInitialized();let i=Tn(Ut.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:i}),this.core.expirer.set(n,i)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);let{topic:i}=n;if(this.pairings.keys.includes(i)){let o=await this.sendRequest(i,"wc_pairingPing",{}),{done:s,resolve:a,reject:c}=lo();this.events.once(Gt("pairing_ping",o),({error:u})=>{u?c(u):a()}),await s()}},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);let{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",Vt("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,o)=>{let s=Go(i,o),a=await this.core.crypto.encode(n,s),c=If[i].req;return this.core.history.set(n,s),await this.core.relayer.publish(n,a,c),s.id},this.sendResult=async(n,i,o)=>{let s=Hc(n,o),a=await this.core.crypto.encode(i,s),c=await this.core.history.get(i,n),u=If[c.request.method].res;await this.core.relayer.publish(i,a,u),await this.core.history.resolve(s)},this.sendError=async(n,i,o)=>{let s=fo(n,o),a=await this.core.crypto.encode(i,s),c=await this.core.history.get(i,n),u=If[c.request.method]?If[c.request.method].res:If.unregistered_method.res;await this.core.relayer.publish(i,a,u),await this.core.history.resolve(s)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,Vt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{let n=this.pairings.getAll().filter(i=>gi(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{let{topic:i,payload:o}=n,s=o.method;if(this.pairings.keys.includes(i))switch(s){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=>{let{topic:i,payload:o}=n,s=(await this.core.history.get(i,o.id)).request.method;if(this.pairings.keys.includes(i))switch(s){case"wc_pairingPing":return this.onPairingPingResponse(i,o);default:return this.onUnknownRpcMethodResponse(s)}},this.onPairingPingRequest=async(n,i)=>{let{id:o}=i;try{this.isValidPing({topic:n}),await this.sendResult(o,n,!0),this.events.emit("pairing_ping",{id:o,topic:n})}catch(s){await this.sendError(o,n,s),this.logger.error(s)}},this.onPairingPingResponse=(n,i)=>{let{id:o}=i;setTimeout(()=>{Pn(i)?this.events.emit(Gt("pairing_ping",o),{}):Vr(i)&&this.events.emit(Gt("pairing_ping",o),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{let{id:o}=i;try{this.isValidDisconnect({topic:n}),await this.sendResult(o,n,!0),await this.deletePairing(n),this.events.emit("pairing_delete",{id:o,topic:n})}catch(s){await this.sendError(o,n,s),this.logger.error(s)}},this.onUnknownRpcMethodRequest=async(n,i)=>{let{id:o,method:s}=i;try{if(this.registeredMethods.includes(s))return;let a=Vt("WC_METHOD_UNSUPPORTED",s);await this.sendError(o,n,a),this.logger.error(a)}catch(a){await this.sendError(o,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(Vt("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!Dr(n)){let{message:i}=ce("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!aI(n.uri)){let{message:i}=ce("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!Dr(n)){let{message:o}=ce("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(o)}let{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Dr(n)){let{message:o}=ce("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(o)}let{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!gr(n,!1)){let{message:i}=ce("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){let{message:i}=ce("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(gi(this.pairings.get(n).expiry)){await this.deletePairing(n);let{message:i}=ce("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=(0,gt.generateChildLogger)(r,this.name),this.pairings=new Gs(this.core,this.logger,this.name,this.storagePrefix)}get context(){return(0,gt.getLoggerContext)(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Nr.message,async e=>{let{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;let i=await this.core.crypto.decode(r,n);Vc(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):Us(i)&&(await this.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.core.expirer.on(wn.expired,async e=>{let{topic:r}=y1(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}},gw=class extends D0{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new go.EventEmitter,this.name=ite,this.version=ote,this.cached=[],this.initialized=!1,this.storagePrefix=Zo,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;let s={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:o};this.records.set(s.id,s),this.events.emit(yi.created,s)},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;let i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=Vr(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(yi.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(yi.deleted,o)}})},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=(0,gt.generateChildLogger)(r,this.name)}get context(){return(0,gt.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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(){let e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;let n={topic:r.topic,request:Go(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let r=this.records.get(e);if(!r){let{message:n}=ce("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(yi.sync)}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){let{message:r}=ce("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(yi.created,e=>{let r=yi.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(yi.updated,e=>{let r=yi.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(yi.deleted,e=>{let r=yi.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}},mw=class extends q0{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new go.EventEmitter,this.name=ste,this.version=ate,this.cached=[],this.initialized=!1,this.storagePrefix=Zo,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{let i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();let o=this.formatTarget(n),s={target:o,expiry:i};this.expirations.set(o,s),this.checkExpiry(o,s),this.events.emit(wn.created,{target:o,expiration:s})},this.get=n=>{this.isInitialized();let i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){let i=this.formatTarget(n),o=this.getExpiration(i);this.expirations.delete(i),this.events.emit(wn.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=(0,gt.generateChildLogger)(r,this.name)}get context(){return(0,gt.getLoggerContext)(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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 tI(e);if(typeof e=="number")return rI(e);let{message:r}=ce("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(wn.sync)}async restore(){try{let e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){let{message:r}=ce("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){let r=this.expirations.get(e);if(!r){let{message:n}=ce("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){let{expiry:n}=r;(0,Ut.toMiliseconds)(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(wn.expired,{target:e,expiration:r})}checkExpirations(){this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Zc.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(wn.created,e=>{let r=wn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(wn.expired,e=>{let r=wn.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(wn.deleted,e=>{let r=wn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}},_te=Object.defineProperty,cM=Object.getOwnPropertySymbols,wte=Object.prototype.hasOwnProperty,Ete=Object.prototype.propertyIsEnumerable,uM=(t,e,r)=>e in t?_te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lM=(t,e)=>{for(var r in e||(e={}))wte.call(e,r)&&uM(t,r,e[r]);if(cM)for(var r of cM(e))Ete.call(e,r)&&uM(t,r,e[r]);return t},Mf=class extends P0{constructor(e){super(e),this.protocol=SM,this.version=Lee,this.name=vw,this.events=new go.EventEmitter,this.initialized=!1,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.projectId=e?.projectId;let r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:(0,yw.default)((0,gt.getDefaultLoggerOptions)({level:e?.logger||jee.logger}));this.logger=(0,gt.generateChildLogger)(r,this.name),this.heartbeat=new Zc.HeartBeat,this.crypto=new cw(this,this.logger,e?.keychain),this.history=new gw(this,this.logger),this.expirer=new mw(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new fM.default(lM(lM({},Bee),e?.storageOptions)),this.relayer=new dw({core:this,logger:this.logger,relayUrl:e?.relayUrl,projectId:this.projectId}),this.pairing=new pw(this,this.logger)}static async init(e){let r=new Mf(e);return await r.initialize(),r}get context(){return(0,gt.getLoggerContext)(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}},xM=Mf;var Qc=ke(T0());var K1=ke(yn()),jt=ke(Ps());var IM="wc",MM=2,RM="client",Aw=`${IM}@${MM}:${RM}:`,_w={name:RM,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"};var Ste="proposal";var xte="session",G1=jt.SEVEN_DAYS,Ote="engine",Tf={wc_sessionPropose:{req:{ttl:jt.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:jt.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:jt.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:jt.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:jt.ONE_DAY,prompt:!1,tag:1104},res:{ttl:jt.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:jt.ONE_DAY,prompt:!1,tag:1106},res:{ttl:jt.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:jt.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:jt.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:jt.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:jt.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:jt.ONE_DAY,prompt:!1,tag:1112},res:{ttl:jt.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:jt.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:jt.THIRTY_SECONDS,prompt:!1,tag:1115}}},ww={min:jt.FIVE_MINUTES,max:jt.SEVEN_DAYS},Cte="request",Ate=Object.defineProperty,Ite=Object.defineProperties,Mte=Object.getOwnPropertyDescriptors,OM=Object.getOwnPropertySymbols,Rte=Object.prototype.hasOwnProperty,Tte=Object.prototype.propertyIsEnumerable,CM=(t,e,r)=>e in t?Ate(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mo=(t,e)=>{for(var r in e||(e={}))Rte.call(e,r)&&CM(t,r,e[r]);if(OM)for(var r of OM(e))Tte.call(e,r)&&CM(t,r,e[r]);return t},Ew=(t,e)=>Ite(t,Mte(e)),Sw=class extends U0{constructor(e){super(e),this.name=Ote,this.events=new K1.default,this.initialized=!1,this.ignoredPayloadTypes=[uo],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(Tf)}),this.initialized=!0)},this.connect=async r=>{this.isInitialized(),await this.isValidConnect(r);let{pairingTopic:n,requiredNamespaces:i,relays:o}=r,s=n,a,c=!1;if(s&&(c=this.client.core.pairing.pairings.get(s).active),!s||!c){let{topic:O,uri:I}=await this.client.core.pairing.create();s=O,a=I}let u=await this.client.core.crypto.generateKeyPair(),l={requiredNamespaces:i,relays:o??[{protocol:bw}],proposer:{publicKey:u,metadata:this.client.metadata}},{reject:h,resolve:d,done:m}=lo();if(this.events.once(Gt("session_connect"),async({error:O,session:I})=>{if(O)h(O);else if(I){I.self.publicKey=u;let j=Ew(mo({},I),{requiredNamespaces:I.requiredNamespaces});await this.client.session.set(I.topic,j),await this.setExpiry(I.topic,I.expiry),s&&await this.client.core.pairing.updateMetadata({topic:s,metadata:I.peer.metadata}),d(j)}}),!s){let{message:O}=ce("NO_MATCHING_KEY",`connect() pairing topic: ${s}`);throw new Error(O)}let v=await this.sendRequest(s,"wc_sessionPropose",l),x=Tn(jt.FIVE_MINUTES);return await this.setProposal(v,mo({id:v,expiry:x},l)),{uri:a,approval:m}},this.pair=async r=>(this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{this.isInitialized(),await this.isValidApprove(r);let{id:n,relayProtocol:i,namespaces:o}=r,s=this.client.proposal.get(n),{pairingTopic:a,proposer:c,requiredNamespaces:u}=s;yf(u)||(u=oI(o,"approve()"),this.client.proposal.set(n,Ew(mo({},s),{requiredNamespaces:u})));let l=await this.client.core.crypto.generateKeyPair(),h=c.publicKey,d=await this.client.core.crypto.generateSharedKey(l,h),m={relay:{protocol:i??"irn"},namespaces:o,requiredNamespaces:u,controller:{publicKey:l,metadata:this.client.metadata},expiry:Tn(G1)};await this.client.core.relayer.subscribe(d);let v=await this.sendRequest(d,"wc_sessionSettle",m),{done:x,resolve:O,reject:I}=lo();this.events.once(Gt("session_approve",v),({error:k})=>{k?I(k):O(this.client.session.get(d))});let j=Ew(mo({},m),{topic:d,acknowledged:!1,self:m.controller,peer:{publicKey:c.publicKey,metadata:c.metadata},controller:l});return await this.client.session.set(d,j),await this.setExpiry(d,Tn(G1)),a&&await this.client.core.pairing.updateMetadata({topic:a,metadata:j.peer.metadata}),a&&n&&(await this.sendResult(n,a,{relay:{protocol:i??"irn"},responderPublicKey:l}),await this.client.proposal.delete(n,Vt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:a})),{topic:d,acknowledged:x}},this.reject=async r=>{this.isInitialized(),await this.isValidReject(r);let{id:n,reason:i}=r,{pairingTopic:o}=this.client.proposal.get(n);o&&(await this.sendError(n,o,i),await this.client.proposal.delete(n,Vt("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.isValidUpdate(r);let{topic:n,namespaces:i}=r,o=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:i}),{done:s,resolve:a,reject:c}=lo();return this.events.once(Gt("session_update",o),({error:u})=>{u?c(u):a()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:s}},this.extend=async r=>{this.isInitialized(),await this.isValidExtend(r);let{topic:n}=r,i=await this.sendRequest(n,"wc_sessionExtend",{}),{done:o,resolve:s,reject:a}=lo();return this.events.once(Gt("session_extend",i),({error:c})=>{c?a(c):s()}),await this.setExpiry(n,Tn(G1)),{acknowledged:o}},this.request=async r=>{this.isInitialized(),await this.isValidRequest(r);let{chainId:n,request:i,topic:o,expiry:s}=r,a=await this.sendRequest(o,"wc_sessionRequest",{request:i,chainId:n},s),{done:c,resolve:u,reject:l}=lo(s);return this.events.once(Gt("session_request",a),({error:h,result:d})=>{h?l(h):u(d)}),await c()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);let{topic:n,response:i}=r,{id:o}=i;Pn(i)?await this.sendResult(o,n,i.result):Vr(i)&&await this.sendError(o,n,i.error),this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0})},this.ping=async r=>{this.isInitialized(),await this.isValidPing(r);let{topic:n}=r;if(this.client.session.keys.includes(n)){let i=await this.sendRequest(n,"wc_sessionPing",{}),{done:o,resolve:s,reject:a}=lo();this.events.once(Gt("session_ping",i),({error:c})=>{c?a(c):s()}),await o()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.isValidEmit(r);let{topic:n,event:i,chainId:o}=r;await this.sendRequest(n,"wc_sessionEvent",{event:i,chainId:o})},this.disconnect=async r=>{this.isInitialized(),await this.isValidDisconnect(r);let{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest(n,"wc_sessionDelete",Vt("USER_DISCONNECTED")),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>sI(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.deleteSession=async(r,n)=>{let{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await Promise.all([this.client.session.delete(r,Vt("USER_DISCONNECTED")),this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.deleteSymKey(r),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,Vt("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{let n=Tf.wc_sessionRequest.req.ttl,{id:i,topic:o,params:s}=r;await this.client.pendingRequest.set(i,{id:i,topic:o,params:s}),n&&this.client.core.expirer.set(i,Tn(n))},this.sendRequest=async(r,n,i,o)=>{let s=Go(n,i),a=await this.client.core.crypto.encode(r,s),c=Tf[n].req;return o&&(c.ttl=o),this.client.core.history.set(r,s),this.client.core.relayer.publish(r,a,c),s.id},this.sendResult=async(r,n,i)=>{let o=Hc(r,i),s=await this.client.core.crypto.encode(n,o),a=await this.client.core.history.get(n,r),c=Tf[a.request.method].res;this.client.core.relayer.publish(n,s,c),await this.client.core.history.resolve(o)},this.sendError=async(r,n,i)=>{let o=fo(r,i),s=await this.client.core.crypto.encode(n,o),a=await this.client.core.history.get(n,r),c=Tf[a.request.method].res;this.client.core.relayer.publish(n,s,c),await this.client.core.history.resolve(o)},this.cleanup=async()=>{let r=[],n=[];this.client.session.getAll().forEach(i=>{gi(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{gi(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=r=>{let{topic:n,payload:i}=r,o=i.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return this.onSessionExtendRequest(n,i);case"wc_sessionPing":return this.onSessionPingRequest(n,i);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return this.onSessionRequest(n,i);case"wc_sessionEvent":return this.onSessionEventRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async r=>{let{topic:n,payload:i}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onSessionProposeRequest=async(r,n)=>{let{params:i,id:o}=n;try{this.isValidConnect(mo({},n.params));let s=Tn(jt.FIVE_MINUTES),a=mo({id:o,pairingTopic:r,expiry:s},i);await this.setProposal(o,a),this.client.events.emit("session_proposal",{id:o,params:a})}catch(s){await this.sendError(o,r,s),this.client.logger.error(s)}},this.onSessionProposeResponse=async(r,n)=>{let{id:i}=n;if(Pn(n)){let{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});let s=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});let a=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:a});let c=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c});let u=await this.client.core.crypto.generateSharedKey(a,c);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:u});let l=await this.client.core.relayer.subscribe(u);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:l}),await this.client.core.pairing.activate({topic:r})}else Vr(n)&&(await this.client.proposal.delete(i,Vt("USER_DISCONNECTED")),this.events.emit(Gt("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{let{id:i,params:o}=n;try{this.isValidSessionSettleRequest(o);let{relay:s,controller:a,expiry:c,namespaces:u,requiredNamespaces:l}=n.params,h={topic:r,relay:s,expiry:c,namespaces:u,acknowledged:!0,requiredNamespaces:l,controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}};await this.sendResult(n.id,r,!0),this.events.emit(Gt("session_connect"),{session:h})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionSettleResponse=async(r,n)=>{let{id:i}=n;Pn(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Gt("session_approve",i),{})):Vr(n)&&(await this.client.session.delete(r,Vt("USER_DISCONNECTED")),this.events.emit(Gt("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{let{params:i,id:o}=n;try{this.isValidUpdate(mo({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult(o,r,!0),this.client.events.emit("session_update",{id:o,topic:r,params:i})}catch(s){await this.sendError(o,r,s),this.client.logger.error(s)}},this.onSessionUpdateResponse=(r,n)=>{let{id:i}=n;Pn(n)?this.events.emit(Gt("session_update",i),{}):Vr(n)&&this.events.emit(Gt("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{let{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Tn(G1)),await this.sendResult(i,r,!0),this.client.events.emit("session_extend",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionExtendResponse=(r,n)=>{let{id:i}=n;Pn(n)?this.events.emit(Gt("session_extend",i),{}):Vr(n)&&this.events.emit(Gt("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{let{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult(i,r,!0),this.client.events.emit("session_ping",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionPingResponse=(r,n)=>{let{id:i}=n;setTimeout(()=>{Pn(n)?this.events.emit(Gt("session_ping",i),{}):Vr(n)&&this.events.emit(Gt("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{let{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await this.sendResult(i,r,!0),await this.deleteSession(r),this.client.events.emit("session_delete",{id:i,topic:r})}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionRequest=async(r,n)=>{let{id:i,params:o}=n;try{this.isValidRequest(mo({topic:r},o)),await this.setPendingSessionRequest({id:i,topic:r,params:o}),this.client.events.emit("session_request",{id:i,topic:r,params:o})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionRequestResponse=(r,n)=>{let{id:i}=n;Pn(n)?this.events.emit(Gt("session_request",i),{result:n.result}):Vr(n)&&this.events.emit(Gt("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{let{id:i,params:o}=n;try{this.isValidEmit(mo({topic:r},o)),this.client.events.emit("session_event",{id:i,topic:r,params:o})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.isValidConnect=async r=>{if(!Dr(r)){let{message:a}=ce("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(a)}let{pairingTopic:n,requiredNamespaces:i,relays:o}=r;if(Hr(n)||await this.isValidPairingTopic(n),!Hr(i)&&yf(i)===0)return;let s=hI(i,"connect()");if(s)throw new Error(s.message);if(!dI(o,!0)){let{message:a}=ce("MISSING_OR_INVALID",`connect() relays: ${o}`);throw new Error(a)}},this.isValidApprove=async r=>{if(!Dr(r))throw new Error(ce("MISSING_OR_INVALID",`approve() params: ${r}`).message);let{id:n,namespaces:i,relayProtocol:o}=r;await this.isValidProposalId(n);let s=this.client.proposal.get(n),a=vf(i,"approve()");if(a)throw new Error(a.message);let c=T_(s.requiredNamespaces,i,"update()");if(c)throw new Error(c.message);if(!gr(o,!0)){let{message:u}=ce("MISSING_OR_INVALID",`approve() relayProtocol: ${o}`);throw new Error(u)}},this.isValidReject=async r=>{if(!Dr(r)){let{message:o}=ce("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(o)}let{id:n,reason:i}=r;if(await this.isValidProposalId(n),!gI(i)){let{message:o}=ce("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidSessionSettleRequest=r=>{if(!Dr(r)){let{message:u}=ce("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(u)}let{relay:n,controller:i,namespaces:o,expiry:s}=r;if(!M_(n)){let{message:u}=ce("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(u)}let a=lI(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);let c=vf(o,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(gi(s)){let{message:u}=ce("EXPIRED","onSessionSettleRequest()");throw new Error(u)}},this.isValidUpdate=async r=>{if(!Dr(r)){let{message:c}=ce("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}let{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);let o=this.client.session.get(n),s=vf(i,"update()");if(s)throw new Error(s.message);let a=T_(o.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!Dr(r)){let{message:i}=ce("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}let{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!Dr(r)){let{message:c}=ce("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}let{topic:n,request:i,chainId:o,expiry:s}=r;await this.isValidSessionTopic(n);let{namespaces:a}=this.client.session.get(n);if(!R_(a,o)){let{message:c}=ce("MISSING_OR_INVALID",`request() chainId: ${o}`);throw new Error(c)}if(!mI(i)){let{message:c}=ce("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!bI(a,o,i.method)){let{message:c}=ce("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(s&&!wI(s,ww)){let{message:c}=ce("MISSING_OR_INVALID",`request() expiry: ${s}. Expiry must be a number (in seconds) between ${ww.min} and ${ww.max}`);throw new Error(c)}},this.isValidRespond=async r=>{if(!Dr(r)){let{message:o}=ce("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}let{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!yI(i)){let{message:o}=ce("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!Dr(r)){let{message:i}=ce("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}let{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Dr(r)){let{message:a}=ce("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}let{topic:n,event:i,chainId:o}=r;await this.isValidSessionTopic(n);let{namespaces:s}=this.client.session.get(n);if(!R_(s,o)){let{message:a}=ce("MISSING_OR_INVALID",`emit() chainId: ${o}`);throw new Error(a)}if(!vI(i)){let{message:a}=ce("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!_I(s,o,i.name)){let{message:a}=ce("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!Dr(r)){let{message:i}=ce("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}let{topic:n}=r;await this.isValidSessionOrPairingTopic(n)}}isInitialized(){if(!this.initialized){let{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(Nr.message,async e=>{let{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;let i=await this.client.core.crypto.decode(r,n);Vc(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):Us(i)&&(await this.client.core.history.resolve(i),this.onRelayEventResponse({topic:r,payload:i}))})}registerExpirerEvents(){this.client.core.expirer.on(wn.expired,async e=>{let{topic:r,id:n}=y1(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,ce("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&await this.deleteProposal(n,!0)})}isValidPairingTopic(e){if(!gr(e,!1)){let{message:r}=ce("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:r}=ce("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(gi(this.client.core.pairing.pairings.get(e).expiry)){let{message:r}=ce("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!gr(e,!1)){let{message:r}=ce("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){let{message:r}=ce("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(gi(this.client.session.get(e).expiry)){await this.deleteSession(e);let{message:r}=ce("EXPIRED",`session topic: ${e}`);throw new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(gr(e,!1)){let{message:r}=ce("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{let{message:r}=ce("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!pI(e)){let{message:r}=ce("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){let{message:r}=ce("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(gi(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);let{message:r}=ce("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}},xw=class extends Gs{constructor(e,r){super(e,r,Ste,Aw),this.core=e,this.logger=r}},Ow=class extends Gs{constructor(e,r){super(e,r,xte,Aw),this.core=e,this.logger=r}},Cw=class extends Gs{constructor(e,r){super(e,r,Cte,Aw),this.core=e,this.logger=r}},Jc=class extends F0{constructor(e){super(e),this.protocol=IM,this.version=MM,this.name=_w.name,this.events=new K1.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=e?.name||_w.name,this.metadata=e?.metadata||QA();let r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:(0,AM.default)((0,Qc.getDefaultLoggerOptions)({level:e?.logger||_w.logger}));this.core=e?.core||new xM(e),this.logger=(0,Qc.generateChildLogger)(r,this.name),this.session=new Ow(this.core,this.logger),this.proposal=new xw(this.core,this.logger),this.pendingRequest=new Cw(this.core,this.logger),this.engine=new Sw(this)}static async init(e){let r=new Jc(e);return await r.initialize(),r}get context(){return(0,Qc.getLoggerContext)(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}};var zM=ke(T0());var LM=ke(yn()),Iw=ke(DM());var Pte={Accept:"application/json","Content-Type":"application/json"},Dte="POST",NM={headers:Pte,method:Dte},kM=10,Pf=class{constructor(e){if(this.url=e,this.events=new LM.EventEmitter,this.isAvailable=!1,this.registering=!1,!T1(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,r){this.isAvailable||await this.register();try{let n=to(e),o=await(await(0,Iw.default)(this.url,Object.assign(Object.assign({},NM),{body:n}))).json();this.onPayload({data:o})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!T1(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){let r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{let r=to({id:1,jsonrpc:"2.0",method:"test",params:[]});await(0,Iw.default)(e,Object.assign(Object.assign({},NM),{body:r})),this.onOpen()}catch(r){let n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;let r=typeof e.data=="string"?Ds(e.data):e.data;this.events.emit("payload",r)}onError(e,r){let n=this.parseError(r),i=n.message||n.toString(),o=fo(e,i);this.events.emit("payload",o)}parseError(e,r=this.url){return wf(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>kM&&this.events.setMaxListeners(kM)}},jM=Pf;var BM=jM;var VM=ke(yn());function Nte(t){var e;let r=(e=t[Object.keys(t)[0]])==null?void 0:e.chains[0];return[r.split(":")[0],r.split(":")[1]]}function Z1(t,e){let r;return e.rpcMap&&(r=e.rpcMap[kte([t])]),r}function kte(t){return Number(t[0].split(":")[1])}var Mw=class{constructor(e){this.name="eip155",this.namespace=e.namespace,this.client=e.client,this.events=e.events,this.httpProviders=this.createHttpProviders(),this.chainId=this.getDefaultChainId()}async request(e){var r;switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":{let n=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";return this.setDefaultChain(parseInt(n,16).toString()),null}case"eth_chainId":return this.getDefaultChainId()}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){if(this.chainId=parseInt(e),!this.httpProviders[e]){let n=r||Z1(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}createHttpProvider(e,r){let n=r||Z1(e,this.namespace);return typeof n>"u"?void 0:new $s(new Pf(n))}setHttpProvider(e,r){let n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){let e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getAccounts(){let e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}getDefaultChainId(){if(this.chainId)return this.chainId;let e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return parseInt(e.split(":")[1])}getHttpProvider(){let 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}},Rw=class{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=e.events,this.client=e.client,this.chainId=this.getDefaultChainId(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}createHttpProviders(){let e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getDefaultChainId(){if(this.chainId)return this.chainId;let 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)}getHttpProvider(){let 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}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){let n=r||Z1(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit("chainChanged",this.chainId)}setHttpProvider(e,r){let n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){let n=r||Z1(e,this.namespace);return typeof n>"u"?void 0:new $s(new BM(n))}},qM="error",Lte="wss://relay.walletconnect.com",jte="wc",Bte="universal_provider",FM=`${jte}@${2}:${Bte}:`,qte=Object.defineProperty,Fte=Object.defineProperties,Ute=Object.getOwnPropertyDescriptors,UM=Object.getOwnPropertySymbols,$te=Object.prototype.hasOwnProperty,Wte=Object.prototype.propertyIsEnumerable,$M=(t,e,r)=>e in t?qte(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,WM=(t,e)=>{for(var r in e||(e={}))$te.call(e,r)&&$M(t,r,e[r]);if(UM)for(var r of UM(e))Wte.call(e,r)&&$M(t,r,e[r]);return t},Hte=(t,e)=>Fte(t,Ute(e)),eu=class{constructor(e){this.events=new VM.default,this.rpcProviders={},this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:(0,HM.default)((0,zM.getDefaultLoggerOptions)({level:e?.logger||qM}))}static async init(e){let r=new eu(e);return await r.initialize(),r}async request(e,r){var n;let[i,o]=this.validateChain(r);return await this.getProvider(i).request({request:WM({},e),chainId:`${i}:${o}`,topic:(n=this.session)==null?void 0:n.topic})}sendAsync(e,r,n){this.request(e,n).then(i=>r(null,i)).catch(i=>r(i,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return await this.request({method:"eth_requestAccounts",params:[]})}async disconnect(){if(!this.client)throw new Error("Sign Client not initialized");await this.client.disconnect({topic:this.session.topic,reason:Vt("USER_DISCONNECTED")})}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");return this.setNamespaces(e.namespaces),this.createProviders(),await this.cleanupPendingPairings(),e.skipPairing===!0?void 0:await this.pair(e.pairingTopic)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){let{uri:r,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces});return r&&(this.uri=r,this.events.emit("display_uri",r)),this.session=await n(),this.onSessionUpdate(),this.session}setDefaultChain(e,r){try{let[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(){this.logger.info("Cleaning up inactive pairings...");let e=this.client.pairing.getAll({active:!1});!Fs(e)||(await Promise.all([e.map(r=>this.client.pairing.delete(r.topic,Vt("USER_DISCONNECTED"))),e.map(r=>this.client.core.relayer.unsubscribe(r.topic)),e.map(r=>this.client.core.expirer.del(r.topic))]),this.logger.info(`Inactive pairings cleared: ${e.length}`))}async checkStorage(){if(this.namespaces=await this.client.core.storage.getItem(`${FM}/namespaces`)||{},this.namespaces&&this.createProviders(),this.client.session.length){let e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.onSessionUpdate()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Jc.init({logger:this.providerOpts.logger||qM,relayUrl:this.providerOpts.relayUrl||Lte,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");Object.keys(this.namespaces).forEach(e=>{switch(e){case"eip155":this.rpcProviders[e]=new Mw({client:this.client,namespace:this.namespaces[e],events:this.events});break;case"solana":this.rpcProviders[e]=new Rw({client:this.client,namespace:this.namespaces[e],events:this.events});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;let{namespaces:i}=r,o=(n=this.client)==null?void 0:n.session.get(e);this.session=Hte(WM({},o),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",()=>{this.events.emit("session_delete")})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>this.getProvider(e).updateNamespace(this.session.namespaces[e]))}setNamespaces(e){if(!e||!Object.keys(e).length)throw new Error("Namespaces must be not empty");this.client.core.storage.setItem(`${FM}/namespaces`,e),this.namespaces=e}validateChain(e){let[r,n]=e?.split(":")||["",""];if(r&&!Object.keys(this.namespaces).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);return!r||!n?Nte(this.namespaces):[r,n]}};Hw();var Xse=Object.defineProperty,XD=Object.getOwnPropertySymbols,eae=Object.prototype.hasOwnProperty,tae=Object.prototype.propertyIsEnumerable,eN=(t,e,r)=>e in t?Xse(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,rae=(t,e)=>{for(var r in e||(e={}))eae.call(e,r)&&eN(t,r,e[r]);if(XD)for(var r of XD(e))tae.call(e,r)&&eN(t,r,e[r]);return t},Kg=class{constructor(e){this.openModal=ar.open,this.closeModal=ar.close,this.subscribeModal=ar.subscribe,this.setTheme=Kt.setThemeConfig,Kt.setConfig(rae({enableStandaloneMode:!0},e)),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(()=>(QD(),JD));let e=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",e),se.setIsUiLoaded(!0)}}};var qV=ke(oV());var jOe=Object.create,Uv=Object.defineProperty,BOe=Object.defineProperties,qOe=Object.getOwnPropertyDescriptor,FOe=Object.getOwnPropertyDescriptors,UOe=Object.getOwnPropertyNames,sV=Object.getOwnPropertySymbols,$Oe=Object.getPrototypeOf,_V=Object.prototype.hasOwnProperty,WOe=Object.prototype.propertyIsEnumerable,aV=(t,e,r)=>e in t?Uv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wx=(t,e)=>{for(var r in e||(e={}))_V.call(e,r)&&aV(t,r,e[r]);if(sV)for(var r of sV(e))WOe.call(e,r)&&aV(t,r,e[r]);return t},wV=(t,e)=>BOe(t,FOe(e)),HOe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),zOe=(t,e)=>{for(var r in e)Uv(t,r,{get:e[r],enumerable:!0})},VOe=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of UOe(e))!_V.call(t,i)&&i!==r&&Uv(t,i,{get:()=>e[i],enumerable:!(n=qOe(e,i))||n.enumerable});return t},GOe=(t,e,r)=>(r=t!=null?jOe($Oe(t)):{},VOe(e||!t||!t.__esModule?Uv(r,"default",{value:t,enumerable:!0}):r,t)),Wr=(t,e,r)=>new Promise((n,i)=>{var o=c=>{try{a(r.next(c))}catch(u){i(u)}},s=c=>{try{a(r.throw(c))}catch(u){i(u)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,s);a((r=r.apply(t,e)).next())}),KOe=HOe((t,e)=>{"use strict";var r=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function o(u,l,h){this.fn=u,this.context=l,this.once=h||!1}function s(u,l,h,d,m){if(typeof h!="function")throw new TypeError("The listener must be a function");var v=new o(h,d||u,m),x=n?n+l:l;return u._events[x]?u._events[x].fn?u._events[x]=[u._events[x],v]:u._events[x].push(v):(u._events[x]=v,u._eventsCount++),u}function a(u,l){--u._eventsCount===0?u._events=new i:delete u._events[l]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var u=[],l,h;if(this._eventsCount===0)return u;for(h in l=this._events)r.call(l,h)&&u.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(l)):u},c.prototype.listeners=function(u){var l=n?n+u:u,h=this._events[l];if(!h)return[];if(h.fn)return[h.fn];for(var d=0,m=h.length,v=new Array(m);d<m;d++)v[d]=h[d].fn;return v},c.prototype.listenerCount=function(u){var l=n?n+u:u,h=this._events[l];return h?h.fn?1:h.length:0},c.prototype.emit=function(u,l,h,d,m,v){var x=n?n+u:u;if(!this._events[x])return!1;var O=this._events[x],I=arguments.length,j,k;if(O.fn){switch(O.once&&this.removeListener(u,O.fn,void 0,!0),I){case 1:return O.fn.call(O.context),!0;case 2:return O.fn.call(O.context,l),!0;case 3:return O.fn.call(O.context,l,h),!0;case 4:return O.fn.call(O.context,l,h,d),!0;case 5:return O.fn.call(O.context,l,h,d,m),!0;case 6:return O.fn.call(O.context,l,h,d,m,v),!0}for(k=1,j=new Array(I-1);k<I;k++)j[k-1]=arguments[k];O.fn.apply(O.context,j)}else{var B=O.length,V;for(k=0;k<B;k++)switch(O[k].once&&this.removeListener(u,O[k].fn,void 0,!0),I){case 1:O[k].fn.call(O[k].context);break;case 2:O[k].fn.call(O[k].context,l);break;case 3:O[k].fn.call(O[k].context,l,h);break;case 4:O[k].fn.call(O[k].context,l,h,d);break;default:if(!j)for(V=1,j=new Array(I-1);V<I;V++)j[V-1]=arguments[V];O[k].fn.apply(O[k].context,j)}}return!0},c.prototype.on=function(u,l,h){return s(this,u,l,h,!1)},c.prototype.once=function(u,l,h){return s(this,u,l,h,!0)},c.prototype.removeListener=function(u,l,h,d){var m=n?n+u:u;if(!this._events[m])return this;if(!l)return a(this,m),this;var v=this._events[m];if(v.fn)v.fn===l&&(!d||v.once)&&(!h||v.context===h)&&a(this,m);else{for(var x=0,O=[],I=v.length;x<I;x++)(v[x].fn!==l||d&&!v[x].once||h&&v[x].context!==h)&&O.push(v[x]);O.length?this._events[m]=O.length===1?O[0]:O:a(this,m)}return this},c.prototype.removeAllListeners=function(u){var l;return u?(l=n?n+u:u,this._events[l]&&a(this,l)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,typeof e<"u"&&(e.exports=c)});function YOe(t){let e={exports:{}};return t(e,e.exports),e.exports}var ZOe=Number.MAX_SAFE_INTEGER||9007199254740991,Hx={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:ZOe,MAX_SAFE_COMPONENT_LENGTH:16},JOe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{},tt=JOe,r0=YOe(function(t,e){let{MAX_SAFE_COMPONENT_LENGTH:r}=Hx,n=(e=t.exports={}).re=[],i=e.src=[],o=e.t={},s=0,a=(c,u,l)=>{let h=s++;tt(h,u),o[c]=h,i[h]=u,n[h]=new RegExp(u,l?"g":void 0)};a("NUMERICIDENTIFIER","0|[1-9]\\d*"),a("NUMERICIDENTIFIERLOOSE","[0-9]+"),a("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),a("MAINVERSION",`(${i[o.NUMERICIDENTIFIER]})\\.(${i[o.NUMERICIDENTIFIER]})\\.(${i[o.NUMERICIDENTIFIER]})`),a("MAINVERSIONLOOSE",`(${i[o.NUMERICIDENTIFIERLOOSE]})\\.(${i[o.NUMERICIDENTIFIERLOOSE]})\\.(${i[o.NUMERICIDENTIFIERLOOSE]})`),a("PRERELEASEIDENTIFIER",`(?:${i[o.NUMERICIDENTIFIER]}|${i[o.NONNUMERICIDENTIFIER]})`),a("PRERELEASEIDENTIFIERLOOSE",`(?:${i[o.NUMERICIDENTIFIERLOOSE]}|${i[o.NONNUMERICIDENTIFIER]})`),a("PRERELEASE",`(?:-(${i[o.PRERELEASEIDENTIFIER]}(?:\\.${i[o.PRERELEASEIDENTIFIER]})*))`),a("PRERELEASELOOSE",`(?:-?(${i[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[o.PRERELEASEIDENTIFIERLOOSE]})*))`),a("BUILDIDENTIFIER","[0-9A-Za-z-]+"),a("BUILD",`(?:\\+(${i[o.BUILDIDENTIFIER]}(?:\\.${i[o.BUILDIDENTIFIER]})*))`),a("FULLPLAIN",`v?${i[o.MAINVERSION]}${i[o.PRERELEASE]}?${i[o.BUILD]}?`),a("FULL",`^${i[o.FULLPLAIN]}$`),a("LOOSEPLAIN",`[v=\\s]*${i[o.MAINVERSIONLOOSE]}${i[o.PRERELEASELOOSE]}?${i[o.BUILD]}?`),a("LOOSE",`^${i[o.LOOSEPLAIN]}$`),a("GTLT","((?:<|>)?=?)"),a("XRANGEIDENTIFIERLOOSE",`${i[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),a("XRANGEIDENTIFIER",`${i[o.NUMERICIDENTIFIER]}|x|X|\\*`),a("XRANGEPLAIN",`[v=\\s]*(${i[o.XRANGEIDENTIFIER]})(?:\\.(${i[o.XRANGEIDENTIFIER]})(?:\\.(${i[o.XRANGEIDENTIFIER]})(?:${i[o.PRERELEASE]})?${i[o.BUILD]}?)?)?`),a("XRANGEPLAINLOOSE",`[v=\\s]*(${i[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[o.XRANGEIDENTIFIERLOOSE]})(?:${i[o.PRERELEASELOOSE]})?${i[o.BUILD]}?)?)?`),a("XRANGE",`^${i[o.GTLT]}\\s*${i[o.XRANGEPLAIN]}$`),a("XRANGELOOSE",`^${i[o.GTLT]}\\s*${i[o.XRANGEPLAINLOOSE]}$`),a("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),a("COERCERTL",i[o.COERCE],!0),a("LONETILDE","(?:~>?)"),a("TILDETRIM",`(\\s*)${i[o.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",a("TILDE",`^${i[o.LONETILDE]}${i[o.XRANGEPLAIN]}$`),a("TILDELOOSE",`^${i[o.LONETILDE]}${i[o.XRANGEPLAINLOOSE]}$`),a("LONECARET","(?:\\^)"),a("CARETTRIM",`(\\s*)${i[o.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",a("CARET",`^${i[o.LONECARET]}${i[o.XRANGEPLAIN]}$`),a("CARETLOOSE",`^${i[o.LONECARET]}${i[o.XRANGEPLAINLOOSE]}$`),a("COMPARATORLOOSE",`^${i[o.GTLT]}\\s*(${i[o.LOOSEPLAIN]})$|^$`),a("COMPARATOR",`^${i[o.GTLT]}\\s*(${i[o.FULLPLAIN]})$|^$`),a("COMPARATORTRIM",`(\\s*)${i[o.GTLT]}\\s*(${i[o.LOOSEPLAIN]}|${i[o.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",a("HYPHENRANGE",`^\\s*(${i[o.XRANGEPLAIN]})\\s+-\\s+(${i[o.XRANGEPLAIN]})\\s*$`),a("HYPHENRANGELOOSE",`^\\s*(${i[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[o.XRANGEPLAINLOOSE]})\\s*$`),a("STAR","(<|>)?=?\\s*\\*"),a("GTE0","^\\s*>=\\s*0.0.0\\s*$"),a("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),cV=/^[0-9]+$/,EV=(t,e)=>{let r=cV.test(t),n=cV.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},QOe=(t,e)=>EV(e,t),XOe={compareIdentifiers:EV,rcompareIdentifiers:QOe},{MAX_LENGTH:uV,MAX_SAFE_INTEGER:Tv}=Hx,{re:lV,t:fV}=r0,{compareIdentifiers:Jp}=XOe,Mr=class{constructor(t,e){if(e&&typeof e=="object"||(e={loose:!!e,includePrerelease:!1}),t instanceof Mr){if(t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid Version: ${t}`);if(t.length>uV)throw new TypeError(`version is longer than ${uV} characters`);tt("SemVer",t,e),this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease;let r=t.trim().match(e.loose?lV[fV.LOOSE]:lV[fV.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Tv||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Tv||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Tv||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<Tv)return i}return n}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(tt("SemVer.compare",this.version,this.options,t),!(t instanceof Mr)){if(typeof t=="string"&&t===this.version)return 0;t=new Mr(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Mr||(t=new Mr(t,this.options)),Jp(this.major,t.major)||Jp(this.minor,t.minor)||Jp(this.patch,t.patch)}comparePre(t){if(t instanceof Mr||(t=new Mr(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let e=0;do{let r=this.prerelease[e],n=t.prerelease[e];if(tt("prerelease compare",e,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r!==n)return Jp(r,n)}while(++e)}compareBuild(t){t instanceof Mr||(t=new Mr(t,this.options));let e=0;do{let r=this.build[e],n=t.build[e];if(tt("prerelease compare",e,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r!==n)return Jp(r,n)}while(++e)}inc(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",e),this.inc("pre",e);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error(`invalid increment argument: ${t}`)}return this.format(),this.raw=this.version,this}},e7e=(t,e,r)=>new Mr(t,r).compare(new Mr(e,r)),Bl=e7e,t7e=(t,e,r)=>Bl(t,e,r)===0,r7e=t7e,n7e=(t,e,r)=>Bl(t,e,r)!==0,i7e=n7e,o7e=(t,e,r)=>Bl(t,e,r)>0,s7e=o7e,a7e=(t,e,r)=>Bl(t,e,r)>=0,c7e=a7e,u7e=(t,e,r)=>Bl(t,e,r)<0,l7e=u7e,f7e=(t,e,r)=>Bl(t,e,r)<=0,h7e=f7e,d7e=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return r7e(t,r,n);case"!=":return i7e(t,r,n);case">":return s7e(t,r,n);case">=":return c7e(t,r,n);case"<":return l7e(t,r,n);case"<=":return h7e(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},Ux=d7e,Qp=Symbol("SemVer ANY"),e0=class{static get ANY(){return Qp}constructor(t,e){if(e&&typeof e=="object"||(e={loose:!!e,includePrerelease:!1}),t instanceof e0){if(t.loose===!!e.loose)return t;t=t.value}tt("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===Qp?this.value="":this.value=this.operator+this.semver.version,tt("comp",this)}parse(t){let e=this.options.loose?hV[dV.COMPARATORLOOSE]:hV[dV.COMPARATOR],r=t.match(e);if(!r)throw new TypeError(`Invalid comparator: ${t}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new Mr(r[2],this.options.loose):this.semver=Qp}toString(){return this.value}test(t){if(tt("Comparator.test",t,this.options.loose),this.semver===Qp||t===Qp)return!0;if(typeof t=="string")try{t=new Mr(t,this.options)}catch(e){return!1}return Ux(t,this.operator,this.semver,this.options)}intersects(t,e){if(!(t instanceof e0))throw new TypeError("a Comparator is required");if(e&&typeof e=="object"||(e={loose:!!e,includePrerelease:!1}),this.operator==="")return this.value===""||new kl(t.value,e).test(this.value);if(t.operator==="")return t.value===""||new kl(this.value,e).test(t.semver);let r=!(this.operator!==">="&&this.operator!==">"||t.operator!==">="&&t.operator!==">"),n=!(this.operator!=="<="&&this.operator!=="<"||t.operator!=="<="&&t.operator!=="<"),i=this.semver.version===t.semver.version,o=!(this.operator!==">="&&this.operator!=="<="||t.operator!==">="&&t.operator!=="<="),s=Ux(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),a=Ux(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return r||n||i&&o||s||a}},{re:hV,t:dV}=r0,kl=class{constructor(t,e){if(e&&typeof e=="object"||(e={loose:!!e,includePrerelease:!1}),t instanceof kl)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new kl(t.raw,e);if(t instanceof e0)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${t}`);this.format()}format(){return this.range=this.set.map(t=>t.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(t){let{loose:e}=this.options;t=t.trim();let r=e?$r[Rr.HYPHENRANGELOOSE]:$r[Rr.HYPHENRANGE];t=t.replace(r,C7e(this.options.includePrerelease)),tt("hyphen replace",t),t=t.replace($r[Rr.COMPARATORTRIM],p7e),tt("comparator trim",t,$r[Rr.COMPARATORTRIM]),t=(t=(t=t.replace($r[Rr.TILDETRIM],g7e)).replace($r[Rr.CARETTRIM],m7e)).split(/\s+/).join(" ");let n=e?$r[Rr.COMPARATORLOOSE]:$r[Rr.COMPARATOR];return t.split(" ").map(i=>y7e(i,this.options)).join(" ").split(/\s+/).map(i=>O7e(i,this.options)).filter(this.options.loose?i=>!!i.match(n):()=>!0).map(i=>new e0(i,this.options))}intersects(t,e){if(!(t instanceof kl))throw new TypeError("a Range is required");return this.set.some(r=>pV(r,e)&&t.set.some(n=>pV(n,e)&&r.every(i=>n.every(o=>i.intersects(o,e)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new Mr(t,this.options)}catch(e){return!1}for(let e=0;e<this.set.length;e++)if(A7e(this.set[e],t,this.options))return!0;return!1}},{re:$r,t:Rr,comparatorTrimReplace:p7e,tildeTrimReplace:g7e,caretTrimReplace:m7e}=r0,pV=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},y7e=(t,e)=>(tt("comp",t,e),t=_7e(t,e),tt("caret",t),t=v7e(t,e),tt("tildes",t),t=E7e(t,e),tt("xrange",t),t=x7e(t,e),tt("stars",t),t),en=t=>!t||t.toLowerCase()==="x"||t==="*",v7e=(t,e)=>t.trim().split(/\s+/).map(r=>b7e(r,e)).join(" "),b7e=(t,e)=>{let r=e.loose?$r[Rr.TILDELOOSE]:$r[Rr.TILDE];return t.replace(r,(n,i,o,s,a)=>{let c;return tt("tilde",t,n,i,o,s,a),en(i)?c="":en(o)?c=`>=${i}.0.0 <${+i+1}.0.0-0`:en(s)?c=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?(tt("replaceTilde pr",a),c=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):c=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,tt("tilde return",c),c})},_7e=(t,e)=>t.trim().split(/\s+/).map(r=>w7e(r,e)).join(" "),w7e=(t,e)=>{tt("caret",t,e);let r=e.loose?$r[Rr.CARETLOOSE]:$r[Rr.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,c)=>{let u;return tt("caret",t,i,o,s,a,c),en(o)?u="":en(s)?u=`>=${o}.0.0${n} <${+o+1}.0.0-0`:en(a)?u=o==="0"?`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:c?(tt("replaceCaret pr",c),u=o==="0"?s==="0"?`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(tt("no pr"),u=o==="0"?s==="0"?`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:`>=${o}.${s}.${a} <${+o+1}.0.0-0`),tt("caret return",u),u})},E7e=(t,e)=>(tt("replaceXRanges",t,e),t.split(/\s+/).map(r=>S7e(r,e)).join(" ")),S7e=(t,e)=>{t=t.trim();let r=e.loose?$r[Rr.XRANGELOOSE]:$r[Rr.XRANGE];return t.replace(r,(n,i,o,s,a,c)=>{tt("xRange",t,n,i,o,s,a,c);let u=en(o),l=u||en(s),h=l||en(a),d=h;return i==="="&&d&&(i=""),c=e.includePrerelease?"-0":"",u?n=i===">"||i==="<"?"<0.0.0-0":"*":i&&d?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(c="-0"),n=`${i+o}.${s}.${a}${c}`):l?n=`>=${o}.0.0${c} <${+o+1}.0.0-0`:h&&(n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),tt("xRange return",n),n})},x7e=(t,e)=>(tt("replaceStars",t,e),t.trim().replace($r[Rr.STAR],"")),O7e=(t,e)=>(tt("replaceGTE0",t,e),t.trim().replace($r[e.includePrerelease?Rr.GTE0PRE:Rr.GTE0],"")),C7e=t=>(e,r,n,i,o,s,a,c,u,l,h,d,m)=>`${r=en(n)?"":en(i)?`>=${n}.0.0${t?"-0":""}`:en(o)?`>=${n}.${i}.0${t?"-0":""}`:s?`>=${r}`:`>=${r}${t?"-0":""}`} ${c=en(u)?"":en(l)?`<${+u+1}.0.0-0`:en(h)?`<${u}.${+l+1}.0-0`:d?`<=${u}.${l}.${h}-${d}`:t?`<${u}.${l}.${+h+1}-0`:`<=${c}`}`.trim(),A7e=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(tt(t[n].semver),t[n].semver!==e0.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0},I7e=(t,e,r)=>{try{e=new kl(e,r)}catch(n){return!1}return e.test(t)},{MAX_LENGTH:M7e}=Hx,{re:gV,t:mV}=r0,R7e=(t,e)=>{if(e&&typeof e=="object"||(e={loose:!!e,includePrerelease:!1}),t instanceof Mr)return t;if(typeof t!="string"||t.length>M7e||!(e.loose?gV[mV.LOOSE]:gV[mV.FULL]).test(t))return null;try{return new Mr(t,e)}catch(r){return null}},T7e=R7e,{re:Pv,t:Dv}=r0,P7e=(t,e)=>{if(t instanceof Mr)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;let r=null;if((e=e||{}).rtl){let n;for(;(n=Pv[Dv.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),Pv[Dv.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Pv[Dv.COERCERTL].lastIndex=-1}else r=t.match(Pv[Dv.COERCE]);return r===null?null:T7e(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};function D7e(t){return String.fromCharCode(parseInt(t.slice(1),16))}function N7e(t){return`%${`00${t.charCodeAt(0).toString(16)}`.slice(-2)}`}function k7e(t){return btoa(encodeURIComponent(t).replace(/%[0-9A-F]{2}/g,D7e))}function L7e(t){return decodeURIComponent(Array.from(atob(t),N7e).join(""))}function SV(t){return k7e(JSON.stringify(t))}function j7e(t){return JSON.parse(L7e(t))}function Xp(t){return typeof t=="undefined"}function B7e(t){return t===null}function xV(t){return B7e(t)||Xp(t)}function q7e(t){return xV(t)?!1:!Xp(t.jsonrpc)&&!Xp(t.id)&&(!Xp(t.result)||!Xp(t.error))}function F7e(t){return xV(t)?!1:typeof t=="number"&&Object.values(hc).includes(t)}function $x(t){if(!t)return!0;for(let e in t)if(Object.hasOwnProperty.call(t,e))return!1;return!0}var dr={};function OV(t,e){return Object.assign(dr,e),t}var U7e={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},To=class extends Error{constructor(t,e){super(`Magic SDK Error: [${t}] ${e}`),this.code=t,this.rawMessage=e,this.__proto__=Error,Object.setPrototypeOf(this,To.prototype)}},Ll=class extends Error{constructor(t){super(),this.__proto__=Error;let e=Number(t==null?void 0:t.code);this.rawMessage=(t==null?void 0:t.message)||"Internal error",this.code=F7e(e)?e:hc.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,Object.setPrototypeOf(this,Ll.prototype)}},n0=class{constructor(t,e){this.code=t,this.rawMessage=e,this.message=`Magic SDK Warning: [${t}] ${e}`}log(){console.warn(this.message)}},$v=class extends Error{constructor(t,e,r,n){super(`Magic Extension Error (${t.name}): [${e}] ${r}`),this.code=e,this.rawMessage=r,this.data=n,this.__proto__=Error,Object.setPrototypeOf(this,$v.prototype)}},jv=class{constructor(t,e,r){this.code=e,this.rawMessage=r,this.message=`Magic Extension Warning (${t.name}): [${e}] ${r}`}log(){console.warn(this.message)}};function $7e(){return new To(Ji.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function CV(){return new To(Ji.ModalNotReady,"Modal is not ready.")}function W7e(){return new To(Ji.MalformedResponse,"Response from the Magic iframe is malformed.")}function H7e(t){return new To(Ji.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${t}\` can be accessed. Do not invoke \`Extension.${t}\` inside an extension constructor.`)}function z7e(t){let e=`Some extensions are incompatible with \`${dr.sdkName}@${dr.version}\`:`;return t.filter(r=>typeof r.compat!="undefined"&&r.compat!==null).forEach(r=>{let n=r.compat[dr.sdkName];typeof n=="string"?e+=`
65
+ - Extension \`${r.name}\` supports version(s) \`${n}\``:n||(e+=`
66
+ - Extension \`${r.name}\` does not support ${dr.platform} environments.`)}),new To(Ji.IncompatibleExtensions,e)}function V7e(t){let e=r=>{let n=r+1,i=n%10,o=n%100;return i===1&&o!==11?`${n}st`:i===2&&o!==12?`${n}nd`:i===3&&o!==13?`${n}rd`:`${n}th`};return new To(Ji.InvalidArgument,`Invalid ${e(t.argument)} argument given to \`${t.procedure}\`.
67
+ Expected: \`${t.expected}\`
68
+ Received: \`${t.received}\``)}function AV(){return new n0(fc.DuplicateIframe,"Duplicate iframes found.")}function G7e(){return new n0(fc.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function K7e(){return new n0(fc.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${dr.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function*Y7e(){let t=0;for(;;)t<Number.MAX_SAFE_INTEGER?yield++t:t=0}var Z7e=Y7e();function IV(){return Z7e.next().value}var MV=Symbol("Payload pre-processed by Magic SDK");function RV(t){return Object.defineProperty(t,MV,{value:!0,enumerable:!1}),t}function J7e(t){return!!t[MV]}function Bv(t){var e,r,n;return J7e(t)||(t.jsonrpc=(e=t.jsonrpc)!=null?e:"2.0",t.id=IV(),t.method=(r=t.method)!=null?r:"noop",t.params=(n=t.params)!=null?n:[],RV(t)),t}function er(t,e=[]){return RV({params:e,method:t,jsonrpc:"2.0",id:IV()})}var zx=class{constructor(t){t instanceof zx?(this._jsonrpc=t.payload.jsonrpc,this._id=t.payload.id,this._result=t.payload.result,this._error=t.payload.error):q7e(t)?(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=t.result,this._error=t.error):(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=void 0,this._error=void 0)}applyError(t){return this._error=t,this}applyResult(t){return this._result=t,this}get hasError(){return typeof this._error!="undefined"&&this._error!==null}get hasResult(){return typeof this._result!="undefined"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},Q7e=GOe(KOe()),X7e=class extends Q7e.default{};function TV(){let t=new X7e;return{emitter:t,createChainingEmitterMethod:(e,r)=>(...n)=>(t[e].apply(t,n),r),createBoundEmitterMethod:e=>(...r)=>t[e].apply(t,r)}}var PV=Symbol("isPromiEvent");function Vx(t){return!!t[PV]}function DV(t){let e=NV(t),{createBoundEmitterMethod:r,createChainingEmitterMethod:n}=TV(),i=Symbol("Promise.then"),o=Symbol("Promise.catch"),s=Symbol("Promise.finally"),a=(l,h)=>(...d)=>{let m=h[l].apply(h,d);return c(m)},c=l=>Object.assign(l,{[PV]:!0,[i]:l[i]||l.then,[o]:l[o]||l.catch,[s]:l[s]||l.finally,then:a(i,l),catch:a(o,l),finally:a(s,l),on:n("on",l),once:n("once",l),addListener:n("addListener",l),off:n("off",l),removeListener:n("removeListener",l),removeAllListeners:n("removeAllListeners",l),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),u=c(e.then(l=>(u.emit("done",l),u.emit("settled"),l),l=>{throw u.emit("error",l),u.emit("settled"),l}));return u}function NV(t){return new Promise((e,r)=>{let n=t(e,r);Promise.resolve(n).catch(r)})}var ql=class{constructor(t){this.sdk=t}get overlay(){return this.sdk.overlay}request(t){let e=this.overlay.post(Ts.MAGIC_HANDLE_REQUEST,Bv(t)),r=DV((i,o)=>{e.then(s=>{if(n(),s.hasError)o(new Ll(s.payload.error));else if(s.hasResult)i(s.payload.result);else throw W7e()}).catch(s=>{n(),o(s)})}),n=this.overlay.on(eo.MAGIC_HANDLE_EVENT,i=>{var o;let{response:s}=i.data;if(s.id===t.id&&((o=s.result)==null?void 0:o.event)){let{event:a,params:c=[]}=s.result;r.emit(a,...c)}});return r}createIntermediaryEvent(t,e){return r=>{let n=er(Le.IntermediaryEvent,[{payloadId:e,eventType:t,args:r}]);this.request(n)}}},eCe=class extends ql{loginWithMagicLink(t){let{email:e,showUI:r=!0,redirectURI:n}=t,i=er(this.sdk.testMode?Le.LoginWithMagicLinkTestMode:Le.LoginWithMagicLink,[{email:e,showUI:r,redirectURI:n}]);return this.request(i)}loginWithSMS(t){let{phoneNumber:e}=t,r=er(this.sdk.testMode?Le.LoginWithSmsTestMode:Le.LoginWithSms,[{phoneNumber:e,showUI:!0}]);return this.request(r)}loginWithEmailOTP(t){let{email:e}=t,r=er(this.sdk.testMode?Le.LoginWithEmailOTPTestMode:Le.LoginWithEmailOTP,[{email:e,showUI:!0}]);return this.request(r)}loginWithCredential(t){let e=t!=null?t:"";if(!t&&dr.platform==="web"){e=window.location.search;let n=window.location.origin+window.location.pathname;window.history.replaceState(null,"",n)}let r=er(this.sdk.testMode?Le.LoginWithCredentialTestMode:Le.LoginWithCredential,[e]);return this.request(r)}},kV={};zOe(kV,{clear:()=>tCe,getItem:()=>jl,iterate:()=>oCe,key:()=>nCe,keys:()=>iCe,length:()=>rCe,removeItem:()=>qv,setItem:()=>cc});var Nv;function Is(t){return(...e)=>Wr(this,null,function*(){return Nv||(Nv=yield dr.configureStorage()),yield Nv.ready(),Nv[t](...e)})}var jl=Is("getItem"),cc=Is("setItem"),qv=Is("removeItem"),tCe=Is("clear"),rCe=Is("length"),nCe=Is("key"),iCe=Is("keys"),oCe=Is("iterate");function sCe(){let t=window.crypto.getRandomValues(new Uint8Array(16));t[6]=t[6]&15|64,t[8]=t[8]&191|128;let e="";return e+=t[0].toString(16),e+=t[1].toString(16),e+=t[2].toString(16),e+=t[3].toString(16),e+="-",e+=t[4].toString(16),e+=t[5].toString(16),e+="-",e+=t[6].toString(16),e+=t[7].toString(16),e+="-",e+=t[8].toString(16),e+=t[9].toString(16),e+="-",e+=t[10].toString(16),e+=t[11].toString(16),e+=t[12].toString(16),e+=t[13].toString(16),e+=t[14].toString(16),e+=t[15].toString(16),e}var Gx="STORE_KEY_PRIVATE_KEY",Fv="STORE_KEY_PUBLIC_JWK",Kx="ECDSA",LV="P-256",aCe={name:Kx,namedCurve:LV},cCe={name:Kx,namedCurve:LV};function jV(){qv(Fv),qv(Gx)}function uCe(){return Wr(this,null,function*(){let t=yield lCe();if(!t){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:e}=window.crypto,r=yield jl(Gx);if(!r||!e){console.info("unable to find private key or webcrypto unsupported");return}let n={iat:Math.floor(new Date().getTime()/1e3),jti:sCe()},i={typ:"dpop+jwt",alg:"ES256",jwk:t},o={protected:yV(JSON.stringify(i)),claims:yV(JSON.stringify(n))},s=dCe(`${o.protected}.${o.claims}`),a={name:Kx,hash:{name:"SHA-256"}},c=gCe(new Uint8Array(yield e.sign(a,r,s)));return`${o.protected}.${o.claims}.${c}`})}function lCe(){return Wr(this,null,function*(){if(!hCe()){console.info("webcrypto is not supported");return}return(yield jl(Fv))||(yield fCe()),jl(Fv)})}function fCe(){return Wr(this,null,function*(){let t=null,{subtle:e}=window.crypto,r=yield e.generateKey(aCe,!0,["sign"]),n=yield e.exportKey("jwk",r.privateKey);t=yield e.exportKey("jwk",r.publicKey);let i=yield e.importKey("jwk",n,cCe,!1,["sign"]);yield cc(Gx,i),yield cc(Fv,t)})}function hCe(){let t=typeof window!="undefined"&&!!window.crypto,e=t&&!!window.crypto.subtle;return t&&e}function yV(t){return BV(pCe(t))}function dCe(t){return new TextEncoder().encode(t)}function BV(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function pCe(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,r)=>String.fromCharCode(parseInt(r,16)))}function gCe(t){let e="";return t.forEach(r=>{e+=String.fromCharCode(r)}),BV(e)}var mCe=class extends ql{getIdToken(t){let e=er(this.sdk.testMode?Le.GetIdTokenTestMode:Le.GetIdToken,[t]);return this.request(e)}generateIdToken(t){let e=er(this.sdk.testMode?Le.GenerateIdTokenTestMode:Le.GenerateIdToken,[t]);return this.request(e)}getMetadata(){let t=er(this.sdk.testMode?Le.GetMetadataTestMode:Le.GetMetadata);return this.request(t)}updateEmail(t){let{email:e,showUI:r=!0}=t,n=er(this.sdk.testMode?Le.UpdateEmailTestMode:Le.UpdateEmail,[{email:e,showUI:r}]);return this.request(n)}isLoggedIn(){let t=er(this.sdk.testMode?Le.IsLoggedInTestMode:Le.IsLoggedIn);return this.request(t)}logout(){jV();let t=er(this.sdk.testMode?Le.LogoutTestMode:Le.Logout);return this.request(t)}showSettings(){let t=er(this.sdk.testMode?Le.UserSettingsTestMode:Le.UserSettings);return this.request(t)}updatePhoneNumber(){let t=er(this.sdk.testMode?Le.UpdatePhoneNumberTestMode:Le.UpdatePhoneNumber);return this.request(t)}},yCe=class extends ql{constructor(){super(...arguments),this.localStorageKey="mc_active_wallet"}connectWithUI(){if(this.isMetaMaskBrowser()||this.isCoinbaseWalletBrowser())return this.autoConnectIfWalletBrowser();let t=this.getUserEnv(),e=er(Le.Login,[t]),r=this.request(e);return r.on(Qi.WalletSelected,n=>Wr(this,null,function*(){try{let i=yield this.connectToThirdPartyWallet(n.wallet,e.id,n.showModal);cc(this.localStorageKey,n.wallet),this.createIntermediaryEvent(Qi.WalletConnected,e.id)(i)}catch(i){this.createIntermediaryEvent(Qi.WalletRejected,e.id)()}})),r}getProvider(){return Wr(this,null,function*(){var t,e;switch(yield jl(this.localStorageKey)){case mn.MetaMask:return this.getMetaMaskProvider();case mn.WalletConnect:try{if(!((t=this.sdk.thirdPartyWalletOptions)!=null&&t.walletConnect))throw new Error(Xi.WalletConnectError);return this.getWalletConnectProvider()}catch(r){return console.error(r),null}case mn.CoinbaseWallet:if(!((e=this.sdk.thirdPartyWalletOptions)!=null&&e.coinbaseWallet))throw new Error(Xi.CoinbaseWalletError);return this.getCoinbaseProvider().provider;default:return this.sdk.rpcProvider}})}showUI(){let t=er(Le.ShowUI);return this.request(t)}getInfo(){let t=er(Le.GetInfo);return this.request(t)}requestUserInfoWithUI(t){let e=er(Le.RequestUserInfoWithUI,t?[t]:[]);return this.request(e)}disconnect(){jV(),qv(this.localStorageKey);let t=er(Le.Disconnect);return this.request(t)}isMetaMaskInstalled(){var t,e,r;return((t=window.ethereum)==null?void 0:t.isMetaMask)||!!((r=(e=window.ethereum)==null?void 0:e.providers)!=null&&r.find(n=>n==null?void 0:n.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var t,e;return((e=(t=window.ethereum)==null?void 0:t.providers)==null?void 0:e.find(r=>r==null?void 0:r.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let t=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=t}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}getWalletConnectProvider(){return Wr(this,null,function*(){var t,e;let r=(e=(t=this.sdk.thirdPartyWalletOptions)==null?void 0:t.walletConnect)==null?void 0:e.provider;if(!r)throw new Error(Xi.WalletConnectError);return yield eu.init(r)})}connectToWalletConnect(t,e){return Wr(this,null,function*(){var r,n,i,o,s;if(!((r=this.sdk.thirdPartyWalletOptions)!=null&&r.walletConnect))throw new Error(Xi.WalletConnectError);let a=new Kg((i=(n=this.sdk.thirdPartyWalletOptions)==null?void 0:n.walletConnect)==null?void 0:i.modal);a.setTheme({themeZIndex:2147483660});let c=yield this.getWalletConnectProvider();return c.on(Qi.DisplayUri,u=>Wr(this,null,function*(){e?a.openModal({uri:u}):this.createIntermediaryEvent(Qi.Uri,t)(u)})),yield c.connect((s=(o=this.sdk.thirdPartyWalletOptions)==null?void 0:o.walletConnect)==null?void 0:s.connect),a.closeModal(),c.request({method:"eth_accounts"})})}isCoinbaseWalletInstalled(){var t,e,r;return((t=window.ethereum)==null?void 0:t.isCoinbaseWallet)||!!((r=(e=window.ethereum)==null?void 0:e.providers)!=null&&r.find(n=>n==null?void 0:n.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var t,e,r;return((t=window.ethereum)==null?void 0:t.isCoinbaseBrowser)||!!((r=(e=window.ethereum)==null?void 0:e.providers)!=null&&r.find(n=>n==null?void 0:n.isCoinbaseBrowser))}getCoinbaseProvider(){var t,e,r,n;let i=(e=(t=this.sdk.thirdPartyWalletOptions)==null?void 0:t.coinbaseWallet)==null?void 0:e.provider,o=(n=(r=this.sdk.thirdPartyWalletOptions)==null?void 0:r.coinbaseWallet)==null?void 0:n.sdk;if(!i||!o)throw new Error(Xi.CoinbaseWalletError);let s=new qV.CoinbaseWalletSDK(wV(Wx({},o),{overrideIsMetaMask:!1,headlessMode:!0})),a=s.getQrUrl();return{provider:s.makeWeb3Provider(i.jsonRpcUrl,i.chainId),qrCodeUrl:a}}connectToCoinbaseWallet(t){var e;if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let n=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=n}if(!((e=this.sdk.thirdPartyWalletOptions)!=null&&e.coinbaseWallet))throw new Error(Xi.CoinbaseWalletError);let r=this.getCoinbaseProvider();return r.qrCodeUrl&&this.createIntermediaryEvent(Qi.Uri,t)(r.qrCodeUrl),r.provider.request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent.toLocaleLowerCase())}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(t,e,r){return Wr(this,null,function*(){let n;switch(t){case mn.MetaMask:n=yield this.connectToMetaMask();break;case mn.WalletConnect:n=yield this.connectToWalletConnect(e,r);break;case mn.CoinbaseWallet:n=yield this.connectToCoinbaseWallet(e);break;default:break}return n})}autoConnectIfWalletBrowser(){return Wr(this,null,function*(){let t,e;if(this.isMetaMaskBrowser())try{t=mn.MetaMask,e=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"}),cc(this.localStorageKey,mn.MetaMask)}catch(n){console.error(n)}else if(this.isCoinbaseWalletBrowser())try{t=mn.CoinbaseWallet,e=yield this.getCoinbaseProvider().provider.request({method:"eth_requestAccounts"}),cc(this.localStorageKey,mn.CoinbaseWallet)}catch(n){console.error(n)}let r=er(Le.AutoConnect,[{wallet:t,address:e}]);return this.request(r)})}},{createBoundEmitterMethod:kv,createChainingEmitterMethod:Nl}=TV(),vCe=class extends ql{constructor(){super(...arguments),this.isMagic=!0,this.on=Nl("on",this),this.once=Nl("once",this),this.addListener=Nl("addListener",this),this.off=Nl("off",this),this.removeListener=Nl("removeListener",this),this.removeAllListeners=Nl("removeAllListeners",this),this.emit=kv("emit"),this.eventNames=kv("eventNames"),this.listeners=kv("listeners"),this.listenerCount=kv("listenerCount")}sendAsync(t,e){if(!e)throw V7e({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:e===null?"null":typeof e});if(Array.isArray(t))this.overlay.post(Ts.MAGIC_HANDLE_REQUEST,t.map(r=>{let n=Bv(r);return this.prefixPayloadMethodForTestMode(n),n})).then(r=>{e(null,r.map(n=>wV(Wx({},n.payload),{error:n.hasError?new Ll(n.payload.error):null})))});else{let r=Bv(t);this.prefixPayloadMethodForTestMode(r),this.overlay.post(Ts.MAGIC_HANDLE_REQUEST,r).then(n=>{e(n.hasError?new Ll(n.payload.error):null,n.payload)})}}send(t,e){if(typeof t=="string"){let n=er(t,Array.isArray(e)?e:[]);return this.request(n)}if(Array.isArray(t)||!!e){this.sendAsync(t,e);return}let r=G7e();return r.log(),new zx(t).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let t=er("eth_accounts");return this.request(t)}request(t){return this.prefixPayloadMethodForTestMode(t),super.request(t)}prefixPayloadMethodForTestMode(t){let e="testMode/eth/";this.sdk.testMode&&(t.method=`${e}${t.method}`)}};function t0(t,e){return e?new URL(t,e):new URL(t)}var vV=["request","overlay","sdk"];function bCe(t){let e=Object.getPrototypeOf(t),r=[e];for(;e!==ql.prototype;)e=Object.getPrototypeOf(e),r.push(e);return r}var FV=class extends ql{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:DV,isPromiEvent:Vx,encodeJSON:SV,decodeJSON:j7e,createJsonRpcRequestPayload:er,standardizeJsonRpcRequestPayload:Bv,storage:kV};let t=[this,...bCe(this)];vV.forEach(e=>{let r=t.map(s=>Object.getOwnPropertyDescriptor(s,e)),n=r.findIndex(s=>!!s),i=n>0,o=r[n];o&&(this.__sdk_access_field_descriptors__.set(e,{descriptor:o,isPrototypeField:i}),Object.defineProperty(this,e,{configurable:!0,get:()=>{throw H7e(e)}}))})}init(t){this.__is_initialized__||(vV.forEach(e=>{if(this.__sdk_access_field_descriptors__.has(e)){let{descriptor:r,isPrototypeField:n}=this.__sdk_access_field_descriptors__.get(e);n?delete this[e]:Object.defineProperty(this,e,r)}}),this.sdk=t,this.__is_initialized__=!0)}createDeprecationWarning(t){let{method:e,removalVersion:r,useInstead:n}=t,i=n?` Use \`${n}\` instead.`:"",o=`\`${e}\` will be removed from this Extension in version \`${r}\`.${i}`;return new jv(this,"DEPRECATION_NOTICE",o)}createWarning(t,e){return new jv(this,t,e)}createError(t,e,r){return new $v(this,t,e,r)}},_Ce=class extends FV{},uc=class extends FV{};uc.Internal=_Ce,uc.Anonymous="anonymous extension";function bV(t){return t.compat&&t.compat[dr.sdkName]!=null?typeof t.compat[dr.sdkName]=="string"?I7e(P7e(dr.version),t.compat[dr.sdkName]):!!t.compat[dr.sdkName]:!0}function wCe(t){var e;let r=(e=t==null?void 0:t.extensions)!=null?e:[],n={},i=[];if(Array.isArray(r)?r.forEach(o=>{bV(o)?(o.init(this),(o.name||o.name!==uc.Anonymous)&&(this[o.name]=o),o instanceof uc.Internal&&($x(o.config)||(n[o.name]=o.config))):i.push(o)}):Object.keys(r).forEach(o=>{if(bV(r[o])){r[o].init(this);let s=r[o];this[o]=s,s instanceof uc.Internal&&($x(s.config)||(n[r[o].name]=s.config))}else i.push(r[o])}),i.length)throw z7e(i);return n}var Lv=class{constructor(t,e){this.apiKey=t;var r;if(!t)throw $7e();dr.platform==="react-native"&&(e==null?void 0:e.endpoint)&&K7e().log();let{defaultEndpoint:n,version:i}=dr;this.testMode=!!(e!=null&&e.testMode),this.endpoint=t0((r=e==null?void 0:e.endpoint)!=null?r:n).origin,this.thirdPartyWalletOptions=e==null?void 0:e.thirdPartyWalletOptions,this.auth=new eCe(this),this.user=new mCe(this),this.wallet=new yCe(this),this.rpcProvider=new vCe(this);let o=wCe.call(this,e);this.parameters=SV(Wx({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:e==null?void 0:e.network,host:t0(this.endpoint).host,sdk:U7e[dr.sdkName],version:i,ext:$x(o)?void 0:o,locale:(e==null?void 0:e.locale)||"en_US"},dr.bundleId?{bundleId:dr.bundleId}:{}))}get overlay(){if(!Lv.__overlays__.has(this.parameters)){let t=new dr.ViewController(this.endpoint,this.parameters);t.init(),Lv.__overlays__.set(this.parameters,t)}return Lv.__overlays__.get(this.parameters)}preload(){return Wr(this,null,function*(){yield this.overlay.ready})}},Yx=Lv;Yx.__overlays__=new Map;function ECe(t,e){return e&&Array.isArray(t)?t.find(r=>r.id===e):t}function SCe(t,e){var r;let n=(r=e.data.response)==null?void 0:r.id,i=ECe(t,n);if(n&&i){let o=new zx(i).applyResult(e.data.response.result).applyError(e.data.response.error);return{id:n,response:o}}return{}}function xCe(t,e){return Wr(this,null,function*(){let r=yield jl("rt"),n;if(dr.platform==="web")try{n=yield uCe()}catch(i){console.error("webcrypto error",i)}return n?r?{msgType:t,payload:e,jwt:n,rt:r}:{msgType:t,payload:e,jwt:n}:{msgType:t,payload:e}})}function OCe(t){return Wr(this,null,function*(){!t.data.rt||(yield cc("rt",t.data.rt))})}var UV=class{constructor(t,e){this.endpoint=t,this.parameters=e,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(t,e){return Wr(this,null,function*(){return NV(r=>Wr(this,null,function*(){yield this.ready;let n=[],i=Array.isArray(e)?e.map(c=>c.id):[],o=yield xCe(`${t}-${this.parameters}`,e);yield this._post(o);let s=c=>u=>{let{id:l,response:h}=SCe(e,u);OCe(u),l&&h&&Array.isArray(e)&&i.includes(l)?(n.push(h),n.length===e.length&&(c(),r(n))):l&&h&&!Array.isArray(e)&&l===e.id&&(c(),r(h))},a=this.on(eo.MAGIC_HANDLE_RESPONSE,s(()=>a()))}))})}on(t,e){let r=e.bind(window),n=i=>{i.data.msgType===`${t}-${this.parameters}`&&r(i)};return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}waitForReady(){return new Promise(t=>{this.on(eo.MAGIC_OVERLAY_READY,()=>t())})}listen(){this.on(eo.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(eo.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}};var Zx={};ir(Zx,{Errors:()=>Xi,EthChainType:()=>i8,Events:()=>Qi,Extension:()=>uc,ExtensionError:()=>$v,ExtensionWarning:()=>jv,MagicIncomingWindowMessage:()=>eo,MagicOutgoingWindowMessage:()=>Ts,MagicPayloadMethod:()=>Le,RPCError:()=>Ll,RPCErrorCode:()=>hc,SDKError:()=>To,SDKErrorCode:()=>Ji,SDKWarning:()=>n0,SDKWarningCode:()=>fc,Wallets:()=>mn,isPromiEvent:()=>Vx});var zv=ke(WV()),Qx=ke(zV());var CCe={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function ACe(t){for(let[e,r]of Object.entries(CCe))t.style[e]=r}function ICe(t){let e=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(e.find(r=>r.src.includes(t)))}var Hv=class extends UV{constructor(){super(...arguments);this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(r=>{let n=()=>{if(ICe(encodeURIComponent(this.parameters)))AV().log();else{let i=document.createElement("iframe");i.classList.add("magic-iframe"),i.dataset.magicIframeLabel=t0(this.endpoint).host,i.title="Secure Modal",i.src=t0(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,ACe(i),document.body.appendChild(i),r(i)}};["loaded","interactive","complete"].includes(document.readyState)?n():window.addEventListener("load",n,!1)}),window.addEventListener("message",r=>{var n;if(r.origin===this.endpoint&&r.data&&r.data.msgType&&this.messageHandlers.size){r.data.response=(n=r.data.response)!=null?n:{};for(let i of this.messageHandlers.values())i(r)}})}showOverlay(){return lc(this,null,function*(){let r=yield this.iframe;r.style.display="block",this.activeElement=document.activeElement,r.focus()})}hideOverlay(){return lc(this,null,function*(){var n;let r=yield this.iframe;r.style.display="none",(n=this.activeElement)!=null&&n.focus&&this.activeElement.focus(),this.activeElement=null})}_post(r){return lc(this,null,function*(){let n=yield this.iframe;if(n&&n.contentWindow)n.contentWindow.postMessage(r,this.endpoint);else throw CV()})}};var MCe=Object.assign(OV(Yx,{platform:"web",sdkName:"magic-sdk",version:"13.3.0",defaultEndpoint:"https://auth.magic.link/",ViewController:Hv,configureStorage:()=>lc(void 0,null,function*(){let t=zv.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield t.defineDriver(Qx),yield t.setDriver([zv.default.INDEXEDDB,zv.default.LOCALSTORAGE,Qx._driver]),t})}),n8({},Zx)),RCe=MCe;return or(TCe);})();
6
69
  if (Magic && Magic.default != null) { Magic = Object.assign(Magic.default, Magic); delete Magic.default; }