@dcl/vesting-dashboard 3.2.0 → 3.2.1-10994005036.commit-371a9b8
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/assets/{fortmatic-09cba070.js → fortmatic-6aabbac2.js} +1 -1
- package/assets/{index-3f9fa081.js → index-1e48b2db.js} +1 -1
- package/assets/{index-d1deb370.css → index-94a0e6a0.css} +7 -7
- package/assets/{index-535c8f8c.js → index-9b8a6048.js} +111 -111
- package/assets/{index-de09cc9e.js → index-a3f56210.js} +1 -1
- package/assets/{index-0a6167b9.js → index-bdd52a72.js} +1 -1
- package/assets/{index-d753f3d1.js → index-be19fa8b.js} +1 -1
- package/assets/{index-a12fa12c.js → index-bef610ea.js} +1 -1
- package/assets/{index-a614c278.js → index-ecb02c87.js} +1 -1
- package/assets/{index.es-82042750.js → index.es-4d45d99e.js} +2 -2
- package/index.html +4 -4
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as se}from"./index-535c8f8c.js";import{J as Wr,M as qr,K as Kr,p as Xr,O as Yr,W as Je}from"./index-3f9fa081.js";import{f as st,T as lt,A as dt,R as vt,c as ht,D as yt,H as pt,t as mt,I as bt,x as gt,v as _t,E as wt,u as It,g as Et,l as St,_ as Ot,m as jt,N as Nt,C as At,o as Bt,B as kt,a as xt,b as Dt,P as Rt}from"./index-3f9fa081.js";var Jr=Object.create,Qe=Object.defineProperty,Vr=Object.getOwnPropertyDescriptor,Qr=Object.getOwnPropertyNames,Zr=Object.getPrototypeOf,Hr=Object.prototype.hasOwnProperty,pe=(_=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(_,{get:(S,m)=>(typeof require<"u"?require:S)[m]}):_)(function(_){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+_+'" is not supported')}),Ze=(_,S)=>()=>(S||_((S={exports:{}}).exports,S),S.exports),Gr=(_,S,m,x)=>{if(S&&typeof S=="object"||typeof S=="function")for(let q of Qr(S))!Hr.call(_,q)&&q!==m&&Qe(_,q,{get:()=>S[q],enumerable:!(x=Vr(S,q))||x.enumerable});return _},He=(_,S,m)=>(m=_!=null?Jr(Zr(_)):{},Gr(S||!_||!_.__esModule?Qe(m,"default",{value:_,enumerable:!0}):m,_)),me=(_,S,m)=>new Promise((x,q)=>{var C=D=>{try{j(m.next(D))}catch(L){q(L)}},P=D=>{try{j(m.throw(D))}catch(L){q(L)}},j=D=>D.done?x(D.value):Promise.resolve(D.value).then(C,P);j((m=m.apply(_,S)).next())}),$r=Ze((_,S)=>{(function(m){if(typeof _=="object"&&typeof S<"u")S.exports=m();else if(typeof define=="function"&&define.amd)define([],m);else{var x;typeof window<"u"?x=window:typeof se<"u"?x=se:typeof self<"u"?x=self:x=this,x.localforage=m()}})(function(){return function m(x,q,C){function P(L,J){if(!q[L]){if(!x[L]){var y=typeof pe=="function"&&pe;if(!J&&y)return y(L,!0);if(j)return j(L,!0);var w=new Error("Cannot find module '"+L+"'");throw w.code="MODULE_NOT_FOUND",w}var z=q[L]={exports:{}};x[L][0].call(z.exports,function(F){var Z=x[L][1][F];return P(Z||F)},z,z.exports,m,x,q,C)}return q[L].exports}for(var j=typeof pe=="function"&&pe,D=0;D<C.length;D++)P(C[D]);return P}({1:[function(m,x,q){(function(C){var P=C.MutationObserver||C.WebKitMutationObserver,j;if(P){var D=0,L=new P(F),J=C.document.createTextNode("");L.observe(J,{characterData:!0}),j=function(){J.data=D=++D%2}}else if(!C.setImmediate&&typeof C.MessageChannel<"u"){var y=new C.MessageChannel;y.port1.onmessage=F,j=function(){y.port2.postMessage(0)}}else"document"in C&&"onreadystatechange"in C.document.createElement("script")?j=function(){var A=C.document.createElement("script");A.onreadystatechange=function(){F(),A.onreadystatechange=null,A.parentNode.removeChild(A),A=null},C.document.documentElement.appendChild(A)}:j=function(){setTimeout(F,0)};var w,z=[];function F(){w=!0;for(var A,G,U=z.length;U;){for(G=z,z=[],A=-1;++A<U;)G[A]();U=z.length}w=!1}x.exports=Z;function Z(A){z.push(A)===1&&!w&&j()}}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(m,x,q){var C=m(1);function P(){}var j={},D=["REJECTED"],L=["FULFILLED"],J=["PENDING"];x.exports=y;function y(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=J,this.queue=[],this.outcome=void 0,v!==P&&Z(this,v)}y.prototype.catch=function(v){return this.then(null,v)},y.prototype.then=function(v,N){if(typeof v!="function"&&this.state===L||typeof N!="function"&&this.state===D)return this;var E=new this.constructor(P);if(this.state!==J){var B=this.state===L?v:N;z(E,B,this.outcome)}else this.queue.push(new w(E,v,N));return E};function w(v,N,E){this.promise=v,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(v){j.resolve(this.promise,v)},w.prototype.otherCallFulfilled=function(v){z(this.promise,this.onFulfilled,v)},w.prototype.callRejected=function(v){j.reject(this.promise,v)},w.prototype.otherCallRejected=function(v){z(this.promise,this.onRejected,v)};function z(v,N,E){C(function(){var B;try{B=N(E)}catch(K){return j.reject(v,K)}B===v?j.reject(v,new TypeError("Cannot resolve promise with itself")):j.resolve(v,B)})}j.resolve=function(v,N){var E=A(F,N);if(E.status==="error")return j.reject(v,E.value);var B=E.value;if(B)Z(v,B);else{v.state=L,v.outcome=N;for(var K=-1,Y=v.queue.length;++K<Y;)v.queue[K].callFulfilled(N)}return v},j.reject=function(v,N){v.state=D,v.outcome=N;for(var E=-1,B=v.queue.length;++E<B;)v.queue[E].callRejected(N);return v};function F(v){var N=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof N=="function")return function(){N.apply(v,arguments)}}function Z(v,N){var E=!1;function B(Q){E||(E=!0,j.reject(v,Q))}function K(Q){E||(E=!0,j.resolve(v,Q))}function Y(){N(K,B)}var V=A(Y);V.status==="error"&&B(V.value)}function A(v,N){var E={};try{E.value=v(N),E.status="success"}catch(B){E.status="error",E.value=B}return E}y.resolve=G;function G(v){return v instanceof this?v:j.resolve(new this(P),v)}y.reject=U;function U(v){var N=new this(P);return j.reject(N,v)}y.all=oe;function oe(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=new Array(E),Y=0,V=-1,Q=new this(P);++V<E;)$(v[V],V);return Q;function $(ie,ue){N.resolve(ie).then(le,function(re){B||(B=!0,j.reject(Q,re))});function le(re){K[ue]=re,++Y===E&&!B&&(B=!0,j.resolve(Q,K))}}}y.race=ee;function ee(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=-1,Y=new this(P);++K<E;)V(v[K]);return Y;function V(Q){N.resolve(Q).then(function($){B||(B=!0,j.resolve(Y,$))},function($){B||(B=!0,j.reject(Y,$))})}}},{1:1}],3:[function(m,x,q){(function(C){typeof C.Promise!="function"&&(C.Promise=m(2))}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(m,x,q){var C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function P(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function j(){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 D=j();function L(){try{if(!D||!D.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||r)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function J(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(i){if(i.name!=="TypeError")throw i;for(var t=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,o=new t,n=0;n<e.length;n+=1)o.append(e[n]);return o.getBlob(r.type)}}typeof Promise>"u"&&m(3);var y=Promise;function w(e,r){r&&e.then(function(t){r(null,t)},function(t){r(t)})}function z(e,r,t){typeof r=="function"&&e.then(r),typeof t=="function"&&e.catch(t)}function F(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function Z(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var A="local-forage-detect-blob-support",G=void 0,U={},oe=Object.prototype.toString,ee="readonly",v="readwrite";function N(e){for(var r=e.length,t=new ArrayBuffer(r),o=new Uint8Array(t),n=0;n<r;n++)o[n]=e.charCodeAt(n);return t}function E(e){return new y(function(r){var t=e.transaction(A,v),o=J([""]);t.objectStore(A).put(o,"key"),t.onabort=function(n){n.preventDefault(),n.stopPropagation(),r(!1)},t.oncomplete=function(){var n=navigator.userAgent.match(/Chrome\/(\d+)/),i=navigator.userAgent.match(/Edge\//);r(i||!n||parseInt(n[1],10)>=43)}}).catch(function(){return!1})}function B(e){return typeof G=="boolean"?y.resolve(G):E(e).then(function(r){return G=r,G})}function K(e){var r=U[e.name],t={};t.promise=new y(function(o,n){t.resolve=o,t.reject=n}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise}function Y(e){var r=U[e.name],t=r.deferredOperations.pop();if(t)return t.resolve(),t.promise}function V(e,r){var t=U[e.name],o=t.deferredOperations.pop();if(o)return o.reject(r),o.promise}function Q(e,r){return new y(function(t,o){if(U[e.name]=U[e.name]||g(),e.db)if(r)K(e),e.db.close();else return t(e.db);var n=[e.name];r&&n.push(e.version);var i=D.open.apply(D,n);r&&(i.onupgradeneeded=function(u){var c=i.result;try{c.createObjectStore(e.storeName),u.oldVersion<=1&&c.createObjectStore(A)}catch(d){if(d.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+u.oldVersion+" to version "+u.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw d}}),i.onerror=function(u){u.preventDefault(),o(i.error)},i.onsuccess=function(){var u=i.result;u.onversionchange=function(c){c.target.close()},t(u),Y(e)}})}function $(e){return Q(e,!1)}function ie(e){return Q(e,!0)}function ue(e,r){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),o=e.version<e.db.version,n=e.version>e.db.version;if(o&&(e.version!==r&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),n||t){if(t){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function le(e){return new y(function(r,t){var o=new FileReader;o.onerror=t,o.onloadend=function(n){var i=btoa(n.target.result||"");r({__local_forage_encoded_blob:!0,data:i,type:e.type})},o.readAsBinaryString(e)})}function re(e){var r=N(atob(e.data));return J([r],{type:e.type})}function a(e){return e&&e.__local_forage_encoded_blob}function f(e){var r=this,t=r._initReady().then(function(){var o=U[r._dbInfo.name];if(o&&o.dbReady)return o.dbReady});return z(t,e,e),t}function h(e){K(e);for(var r=U[e.name],t=r.forages,o=0;o<t.length;o++){var n=t[o];n._dbInfo.db&&(n._dbInfo.db.close(),n._dbInfo.db=null)}return e.db=null,$(e).then(function(i){return e.db=i,ue(e)?ie(e):i}).then(function(i){e.db=r.db=i;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=i}).catch(function(i){throw V(e,i),i})}function p(e,r,t,o){o===void 0&&(o=1);try{var n=e.db.transaction(e.storeName,r);t(null,n)}catch(i){if(o>0&&(!e.db||i.name==="InvalidStateError"||i.name==="NotFoundError"))return y.resolve().then(function(){if(!e.db||i.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ie(e)}).then(function(){return h(e).then(function(){p(e,r,t,o-1)})}).catch(t);t(i)}}function g(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function I(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=e[o];var n=U[t.name];n||(n=g(),U[t.name]=n),n.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=f);var i=[];function u(){return y.resolve()}for(var c=0;c<n.forages.length;c++){var d=n.forages[c];d!==r&&i.push(d._initReady().catch(u))}var l=n.forages.slice(0);return y.all(i).then(function(){return t.db=n.db,$(t)}).then(function(s){return t.db=s,ue(t,r._defaultConfig.version)?ie(t):s}).then(function(s){t.db=n.db=s,r._dbInfo=t;for(var b=0;b<l.length;b++){var O=l[b];O!==r&&(O._dbInfo.db=t.db,O._dbInfo.version=t.version)}})}function M(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.get(e);l.onsuccess=function(){var s=l.result;s===void 0&&(s=null),a(s)&&(s=re(s)),n(s)},l.onerror=function(){i(l.error)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function X(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.openCursor(),s=1;l.onsuccess=function(){var b=l.result;if(b){var O=b.value;a(O)&&(O=re(O));var R=e(O,b.key,s++);R!==void 0?n(R):b.continue()}else n()},l.onerror=function(){i(l.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function ce(e,r,t){var o=this;e=F(e);var n=new y(function(i,u){var c;o.ready().then(function(){return c=o._dbInfo,oe.call(r)==="[object Blob]"?B(c.db).then(function(d){return d?r:le(r)}):r}).then(function(d){p(o._dbInfo,v,function(l,s){if(l)return u(l);try{var b=s.objectStore(o._dbInfo.storeName);d===null&&(d=void 0);var O=b.put(d,e);s.oncomplete=function(){d===void 0&&(d=null),i(d)},s.onabort=s.onerror=function(){var R=O.error?O.error:O.transaction.error;u(R)}}catch(R){u(R)}})}).catch(u)});return w(n,t),n}function ae(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,v,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.delete(e);c.oncomplete=function(){n()},c.onerror=function(){i(l.error)},c.onabort=function(){var s=l.error?l.error:l.transaction.error;i(s)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function de(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,v,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.clear();u.oncomplete=function(){o()},u.onabort=u.onerror=function(){var l=d.error?d.error:d.transaction.error;n(l)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function Ge(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.count();d.onsuccess=function(){o(d.result)},d.onerror=function(){n(d.error)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function $e(e,r){var t=this,o=new y(function(n,i){if(e<0){n(null);return}t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=!1,s=d.openKeyCursor();s.onsuccess=function(){var b=s.result;if(!b){n(null);return}e===0||l?n(b.key):(l=!0,b.advance(e))},s.onerror=function(){i(s.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function er(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.openKeyCursor(),l=[];d.onsuccess=function(){var s=d.result;if(!s){o(l);return}l.push(s.key),s.continue()},d.onerror=function(){n(d.error)}}catch(s){n(s)}})}).catch(n)});return w(t,e),t}function rr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;if(!e.name)n=y.reject("Invalid arguments");else{var i=e.name===t.name&&o._dbInfo.db,u=i?y.resolve(o._dbInfo.db):$(e).then(function(c){var d=U[e.name],l=d.forages;d.db=c;for(var s=0;s<l.length;s++)l[s]._dbInfo.db=c;return c});e.storeName?n=u.then(function(c){if(c.objectStoreNames.contains(e.storeName)){var d=c.version+1;K(e);var l=U[e.name],s=l.forages;c.close();for(var b=0;b<s.length;b++){var O=s[b];O._dbInfo.db=null,O._dbInfo.version=d}var R=new y(function(k,W){var T=D.open(e.name,d);T.onerror=function(H){var Oe=T.result;Oe.close(),W(H)},T.onupgradeneeded=function(){var H=T.result;H.deleteObjectStore(e.storeName)},T.onsuccess=function(){var H=T.result;H.close(),k(H)}});return R.then(function(k){l.db=k;for(var W=0;W<s.length;W++){var T=s[W];T._dbInfo.db=k,Y(T._dbInfo)}}).catch(function(k){throw(V(e,k)||y.resolve()).catch(function(){}),k})}}):n=u.then(function(c){K(e);var d=U[e.name],l=d.forages;c.close();for(var s=0;s<l.length;s++){var b=l[s];b._dbInfo.db=null}var O=new y(function(R,k){var W=D.deleteDatabase(e.name);W.onerror=function(){var T=W.result;T&&T.close(),k(W.error)},W.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},W.onsuccess=function(){var T=W.result;T&&T.close(),R(T)}});return O.then(function(R){d.db=R;for(var k=0;k<l.length;k++){var W=l[k];Y(W._dbInfo)}}).catch(function(R){throw(V(e,R)||y.resolve()).catch(function(){}),R})})}return w(n,r),n}var tr={_driver:"asyncStorage",_initStorage:I,_support:L(),iterate:X,getItem:M,setItem:ce,removeItem:ae,clear:de,length:Ge,key:$e,keys:er,dropInstance:rr};function nr(){return typeof openDatabase=="function"}var te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",or="~~local_forage_type~",Ae=/^~~local_forage_type~([^~]+)~/,he="__lfsc__:",be=he.length,ge="arbf",_e="blob",Be="si08",ke="ui08",xe="uic8",De="si16",Re="si32",Ce="ur16",Le="ui32",Me="fl32",Te="fl64",ze=be+ge.length,Fe=Object.prototype.toString;function Pe(e){var r=e.length*.75,t=e.length,o,n=0,i,u,c,d;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var l=new ArrayBuffer(r),s=new Uint8Array(l);for(o=0;o<t;o+=4)i=te.indexOf(e[o]),u=te.indexOf(e[o+1]),c=te.indexOf(e[o+2]),d=te.indexOf(e[o+3]),s[n++]=i<<2|u>>4,s[n++]=(u&15)<<4|c>>2,s[n++]=(c&3)<<6|d&63;return l}function we(e){var r=new Uint8Array(e),t="",o;for(o=0;o<r.length;o+=3)t+=te[r[o]>>2],t+=te[(r[o]&3)<<4|r[o+1]>>4],t+=te[(r[o+1]&15)<<2|r[o+2]>>6],t+=te[r[o+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+"=":r.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function ir(e,r){var t="";if(e&&(t=Fe.call(e)),e&&(t==="[object ArrayBuffer]"||e.buffer&&Fe.call(e.buffer)==="[object ArrayBuffer]")){var o,n=he;e instanceof ArrayBuffer?(o=e,n+=ge):(o=e.buffer,t==="[object Int8Array]"?n+=Be:t==="[object Uint8Array]"?n+=ke:t==="[object Uint8ClampedArray]"?n+=xe:t==="[object Int16Array]"?n+=De:t==="[object Uint16Array]"?n+=Ce:t==="[object Int32Array]"?n+=Re:t==="[object Uint32Array]"?n+=Le:t==="[object Float32Array]"?n+=Me:t==="[object Float64Array]"?n+=Te:r(new Error("Failed to get type for BinaryArray"))),r(n+we(o))}else if(t==="[object Blob]"){var i=new FileReader;i.onload=function(){var u=or+e.type+"~"+we(this.result);r(he+_e+u)},i.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(u){console.error("Couldn't convert value into a JSON string: ",e),r(null,u)}}function ar(e){if(e.substring(0,be)!==he)return JSON.parse(e);var r=e.substring(ze),t=e.substring(be,ze),o;if(t===_e&&Ae.test(r)){var n=r.match(Ae);o=n[1],r=r.substring(n[0].length)}var i=Pe(r);switch(t){case ge:return i;case _e:return J([i],{type:o});case Be:return new Int8Array(i);case ke:return new Uint8Array(i);case xe:return new Uint8ClampedArray(i);case De:return new Int16Array(i);case Ce:return new Uint16Array(i);case Re:return new Int32Array(i);case Le:return new Uint32Array(i);case Me:return new Float32Array(i);case Te:return new Float64Array(i);default:throw new Error("Unkown type: "+t)}}var Ie={serialize:ir,deserialize:ar,stringToBuffer:Pe,bufferToString:we};function Ue(e,r,t,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,o)}function ur(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=typeof e[o]!="string"?e[o].toString():e[o];var n=new y(function(i,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(c){return u(c)}t.db.transaction(function(c){Ue(c,t,function(){r._dbInfo=t,i()},function(d,l){u(l)})},u)});return t.serializer=Ie,n}function ne(e,r,t,o,n,i){e.executeSql(t,o,n,function(u,c){c.code===c.SYNTAX_ERR?u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(d,l){l.rows.length?i(d,c):Ue(d,r,function(){d.executeSql(t,o,n,i)},i)},i):i(u,c)},i)}function cr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName+" WHERE key = ? LIMIT 1",[e],function(d,l){var s=l.rows.length?l.rows.item(0).value:null;s&&(s=u.serializer.deserialize(s)),n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function fr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName,[],function(d,l){for(var s=l.rows,b=s.length,O=0;O<b;O++){var R=s.item(O),k=R.value;if(k&&(k=u.serializer.deserialize(k)),k=e(k,R.key,O+1),k!==void 0){n(k);return}}n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function We(e,r,t,o){var n=this;e=F(e);var i=new y(function(u,c){n.ready().then(function(){r===void 0&&(r=null);var d=r,l=n._dbInfo;l.serializer.serialize(r,function(s,b){b?c(b):l.db.transaction(function(O){ne(O,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,s],function(){u(d)},function(R,k){c(k)})},function(O){if(O.code===O.QUOTA_ERR){if(o>0){u(We.apply(n,[e,d,t,o-1]));return}c(O)}})})}).catch(c)});return w(i,t),i}function sr(e,r,t){return We.apply(this,[e,r,t,1])}function lr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"DELETE FROM "+u.storeName+" WHERE key = ?",[e],function(){n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function dr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"DELETE FROM "+i.storeName,[],function(){o()},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function vr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],function(c,d){var l=d.rows.item(0).c;o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function hr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT key FROM "+u.storeName+" WHERE id = ? LIMIT 1",[e+1],function(d,l){var s=l.rows.length?l.rows.item(0).key:null;n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function yr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT key FROM "+i.storeName,[],function(c,d){for(var l=[],s=0;s<d.rows.length;s++)l.push(d.rows.item(s).key);o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function pr(e){return new y(function(r,t){e.transaction(function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(n,i){for(var u=[],c=0;c<i.rows.length;c++)u.push(i.rows.item(c).name);r({db:e,storeNames:u})},function(n,i){t(i)})},function(o){t(o)})})}function mr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;return e.name?n=new y(function(i){var u;e.name===t.name?u=o._dbInfo.db:u=openDatabase(e.name,"","",0),e.storeName?i({db:u,storeNames:[e.storeName]}):i(pr(u))}).then(function(i){return new y(function(u,c){i.db.transaction(function(d){function l(R){return new y(function(k,W){d.executeSql("DROP TABLE IF EXISTS "+R,[],function(){k()},function(T,H){W(H)})})}for(var s=[],b=0,O=i.storeNames.length;b<O;b++)s.push(l(i.storeNames[b]));y.all(s).then(function(){u()}).catch(function(R){c(R)})},function(d){c(d)})})}):n=y.reject("Invalid arguments"),w(n,r),n}var br={_driver:"webSQLStorage",_initStorage:ur,_support:nr(),iterate:fr,getItem:cr,setItem:sr,removeItem:lr,clear:dr,length:vr,key:hr,keys:yr,dropInstance:mr};function gr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qe(e,r){var t=e.name+"/";return e.storeName!==r.storeName&&(t+=e.storeName+"/"),t}function _r(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function wr(){return!_r()||localStorage.length>0}function Ir(e){var r=this,t={};if(e)for(var o in e)t[o]=e[o];return t.keyPrefix=qe(e,r._defaultConfig),wr()?(r._dbInfo=t,t.serializer=Ie,y.resolve()):y.reject()}function Er(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var i=localStorage.key(n);i.indexOf(o)===0&&localStorage.removeItem(i)}});return w(t,e),t}function Sr(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo,i=localStorage.getItem(n.keyPrefix+e);return i&&(i=n.serializer.deserialize(i)),i});return w(o,r),o}function Or(e,r){var t=this,o=t.ready().then(function(){for(var n=t._dbInfo,i=n.keyPrefix,u=i.length,c=localStorage.length,d=1,l=0;l<c;l++){var s=localStorage.key(l);if(s.indexOf(i)===0){var b=localStorage.getItem(s);if(b&&(b=n.serializer.deserialize(b)),b=e(b,s.substring(u),d++),b!==void 0)return b}}});return w(o,r),o}function jr(e,r){var t=this,o=t.ready().then(function(){var n=t._dbInfo,i;try{i=localStorage.key(e)}catch{i=null}return i&&(i=i.substring(n.keyPrefix.length)),i});return w(o,r),o}function Nr(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo,n=localStorage.length,i=[],u=0;u<n;u++){var c=localStorage.key(u);c.indexOf(o.keyPrefix)===0&&i.push(c.substring(o.keyPrefix.length))}return i});return w(t,e),t}function Ar(e){var r=this,t=r.keys().then(function(o){return o.length});return w(t,e),t}function Br(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo;localStorage.removeItem(n.keyPrefix+e)});return w(o,r),o}function kr(e,r,t){var o=this;e=F(e);var n=o.ready().then(function(){r===void 0&&(r=null);var i=r;return new y(function(u,c){var d=o._dbInfo;d.serializer.serialize(r,function(l,s){if(s)c(s);else try{localStorage.setItem(d.keyPrefix+e,l),u(i)}catch(b){(b.name==="QuotaExceededError"||b.name==="NS_ERROR_DOM_QUOTA_REACHED")&&c(b),c(b)}})})});return w(n,t),n}function xr(e,r){if(r=Z.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var o=this,n;return e.name?n=new y(function(i){e.storeName?i(qe(e,o._defaultConfig)):i(e.name+"/")}).then(function(i){for(var u=localStorage.length-1;u>=0;u--){var c=localStorage.key(u);c.indexOf(i)===0&&localStorage.removeItem(c)}}):n=y.reject("Invalid arguments"),w(n,r),n}var Dr={_driver:"localStorageWrapper",_initStorage:Ir,_support:gr(),iterate:Or,getItem:Sr,setItem:kr,removeItem:Br,clear:Er,length:Ar,key:jr,keys:Nr,dropInstance:xr},Rr=function(e,r){return e===r||typeof e=="number"&&typeof r=="number"&&isNaN(e)&&isNaN(r)},Cr=function(e,r){for(var t=e.length,o=0;o<t;){if(Rr(e[o],r))return!0;o++}return!1},Ke=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},ve={},Xe={},fe={INDEXEDDB:tr,WEBSQL:br,LOCALSTORAGE:Dr},Lr=[fe.INDEXEDDB._driver,fe.WEBSQL._driver,fe.LOCALSTORAGE._driver],ye=["dropInstance"],Ee=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ye),Mr={description:"",driver:Lr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Tr(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})}}function Se(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(Ke(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t])}return arguments[0]}var zr=function(){function e(r){P(this,e);for(var t in fe)if(fe.hasOwnProperty(t)){var o=fe[t],n=o._driver;this[t]=n,ve[n]||this.defineDriver(o)}this._defaultConfig=Se({},Mr),this._config=Se({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(r){if((typeof r>"u"?"undefined":C(r))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in r){if(t==="storeName"&&(r[t]=r[t].replace(/\W/g,"_")),t==="version"&&typeof r[t]!="number")return new Error("Database version must be a number.");this._config[t]=r[t]}return"driver"in r&&r.driver?this.setDriver(this._config.driver):!0}else return typeof r=="string"?this._config[r]:this._config},e.prototype.defineDriver=function(r,t,o){var n=new y(function(i,u){try{var c=r._driver,d=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!r._driver){u(d);return}for(var l=Ee.concat("_initStorage"),s=0,b=l.length;s<b;s++){var O=l[s],R=!Cr(ye,O);if((R||r[O])&&typeof r[O]!="function"){u(d);return}}var k=function(){for(var T=function(Pr){return function(){var Ur=new Error("Method "+Pr+" is not implemented by the current driver"),Ye=y.reject(Ur);return w(Ye,arguments[arguments.length-1]),Ye}},H=0,Oe=ye.length;H<Oe;H++){var je=ye[H];r[je]||(r[je]=T(je))}};k();var W=function(T){ve[c]&&console.info("Redefining LocalForage driver: "+c),ve[c]=r,Xe[c]=T,i()};"_support"in r?r._support&&typeof r._support=="function"?r._support().then(W,u):W(!!r._support):W(!0)}catch(T){u(T)}});return z(n,t,o),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(r,t,o){var n=ve[r]?y.resolve(ve[r]):y.reject(new Error("Driver not found."));return z(n,t,o),n},e.prototype.getSerializer=function(r){var t=y.resolve(Ie);return z(t,r),t},e.prototype.ready=function(r){var t=this,o=t._driverSet.then(function(){return t._ready===null&&(t._ready=t._initDriver()),t._ready});return z(o,r,r),o},e.prototype.setDriver=function(r,t,o){var n=this;Ke(r)||(r=[r]);var i=this._getSupportedDrivers(r);function u(){n._config.driver=n.driver()}function c(s){return n._extend(s),u(),n._ready=n._initStorage(n._config),n._ready}function d(s){return function(){var b=0;function O(){for(;b<s.length;){var R=s[b];return b++,n._dbInfo=null,n._ready=null,n.getDriver(R).then(c).catch(O)}u();var k=new Error("No available storage method found.");return n._driverSet=y.reject(k),n._driverSet}return O()}}var l=this._driverSet!==null?this._driverSet.catch(function(){return y.resolve()}):y.resolve();return this._driverSet=l.then(function(){var s=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(s).then(function(b){n._driver=b._driver,u(),n._wrapLibraryMethodsWithReady(),n._initDriver=d(i)})}).catch(function(){u();var s=new Error("No available storage method found.");return n._driverSet=y.reject(s),n._driverSet}),z(this._driverSet,t,o),this._driverSet},e.prototype.supports=function(r){return!!Xe[r]},e.prototype._extend=function(r){Se(this,r)},e.prototype._getSupportedDrivers=function(r){for(var t=[],o=0,n=r.length;o<n;o++){var i=r[o];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var r=0,t=Ee.length;r<t;r++)Tr(this,Ee[r])},e.prototype.createInstance=function(r){return new e(r)},e}(),Fr=new zr;x.exports=Fr},{3:3}]},{},[4])(4)})}),et=Ze((_,S)=>{(function(m,x){typeof _=="object"&&typeof S<"u"?x(_):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],x):x(m.LocalforageDriverMemory={})})(typeof self<"u"?self:_,function(m){var x="localforage-driver-memory";function q(a){var f=typeof Symbol=="function"&&a[Symbol.iterator],h=0;return f?f.call(a):{next:function(){return a&&h>=a.length&&(a=void 0),{value:a&&a[h++],done:!a}}}}function C(a,f){a=a||[],f=f||{};try{return new Blob(a,f)}catch(I){if(I.name!=="TypeError")throw I;for(var h=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,p=new h,g=0;g<a.length;g+=1)p.append(a[g]);return p.getBlob(f.type)}}var P=/^~~local_forage_type~([^~]+)~/,j=9,D=j+4,L=Object.prototype.toString;function J(a){var f=a.length*.75,h=a.length;a[a.length-1]==="="&&(f--,a[a.length-2]==="="&&f--);for(var p=new ArrayBuffer(f),g=new Uint8Array(p),I=0,M=0;I<h;I+=4){var X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I]),ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+1]),ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+2]),de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+3]);g[M++]=X<<2|ce>>4,g[M++]=(ce&15)<<4|ae>>2,g[M++]=(ae&3)<<6|de&63}return p}function y(a){for(var f=new Uint8Array(a),h="",p=0;p<f.length;p+=3)h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p]>>2],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p]&3)<<4|f[p+1]>>4],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p+1]&15)<<2|f[p+2]>>6],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p+2]&63];return f.length%3===2?h=h.substring(0,h.length-1)+"=":f.length%3===1&&(h=h.substring(0,h.length-2)+"=="),h}function w(a,f){var h="";if(a&&(h=L.call(a)),a&&(h==="[object ArrayBuffer]"||a.buffer&&L.call(a.buffer)==="[object ArrayBuffer]")){var p=void 0,g="__lfsc__:";a instanceof ArrayBuffer?(p=a,g+="arbf"):(p=a.buffer,h==="[object Int8Array]"?g+="si08":h==="[object Uint8Array]"?g+="ui08":h==="[object Uint8ClampedArray]"?g+="uic8":h==="[object Int16Array]"?g+="si16":h==="[object Uint16Array]"?g+="ur16":h==="[object Int32Array]"?g+="si32":h==="[object Uint32Array]"?g+="ui32":h==="[object Float32Array]"?g+="fl32":h==="[object Float64Array]"?g+="fl64":f(new Error("Failed to get type for BinaryArray"))),f(g+y(p))}else if(h==="[object Blob]"){var I=new FileReader;I.onload=function(){var M="~~local_forage_type~"+a.type+"~"+y(this.result);f("__lfsc__:blob"+M)},I.readAsArrayBuffer(a)}else try{f(JSON.stringify(a))}catch(M){console.error("Couldn't convert value into a JSON string: ",a),f(null,M)}}function z(a){if(a.substring(0,j)!=="__lfsc__:")return JSON.parse(a);var f=a.substring(D),h=a.substring(j,D),p;if(h==="blob"&&P.test(f)){var g=f.match(P);p=g[1],f=f.substring(g[0].length)}var I=J(f);switch(h){case"arbf":return I;case"blob":return C([I],{type:p});case"si08":return new Int8Array(I);case"ui08":return new Uint8Array(I);case"uic8":return new Uint8ClampedArray(I);case"si16":return new Int16Array(I);case"ur16":return new Uint16Array(I);case"si32":return new Int32Array(I);case"ui32":return new Uint32Array(I);case"fl32":return new Float32Array(I);case"fl64":return new Float64Array(I);default:throw new Error("Unkown type: "+h)}}function F(a){var f,h;if(a===null||typeof a!="object"||"isActiveClone"in a)return a;var p=a instanceof Date?new Date(a):a.constructor();try{for(var g=q(Object.keys(a)),I=g.next();!I.done;I=g.next()){var M=I.value;Object.prototype.hasOwnProperty.call(a,M)&&(a.isActiveClone=null,p[M]=F(a[M]),delete a.isActiveClone)}}catch(X){f={error:X}}finally{try{I&&!I.done&&(h=g.return)&&h.call(g)}finally{if(f)throw f.error}}return p}function Z(a,f){return(a.name||f.name)+"/"+(a.storeName||f.storeName)+"/"}function A(a,f){f&&a.then(function(h){f(null,h)},function(h){f(h)})}function G(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function U(a,f){var h=this;if(f=G.apply(this,arguments),a=typeof a!="function"&&a||{},!a.name){var p=this.config();a.name=a.name||p.name,a.storeName=a.storeName||p.storeName}var g;return a.name?g=new Promise(function(I){a.storeName?I(Z(a,h._defaultConfig)):I(a.name+"/")}):g=Promise.reject("Invalid arguments"),{promise:g,callback:f}}function oe(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}var ee={bufferToString:y,deserialize:z,serialize:w,stringToBuffer:J},v={},N=function(){function a(f){this.kp=f,this.data={}}return a.resolve=function(f){return v[f]||(v[f]=new a(f)),v[f]},a.prototype.clear=function(){this.data={}},a.prototype.drop=function(){this.clear(),delete v[this.kp]},a.prototype.get=function(f){return this.data[f]},a.prototype.key=function(f){return this.keys()[f]},a.prototype.keys=function(){return Object.keys(this.data)},a.prototype.rm=function(f){delete this.data[f]},a.prototype.set=function(f,h){this.data[f]=h},a}();function E(a){var f=a?F(a):{},h=Z(f,this._defaultConfig),p=N.resolve(h);return this._dbInfo=f,this._dbInfo.serializer=ee,this._dbInfo.keyPrefix=h,this._dbInfo.mStore=p,Promise.resolve()}function B(a){var f=this,h=this.ready().then(function(){f._dbInfo.mStore.clear()});return A(h,a),h}function K(a,f){var h=U.apply(this,arguments),p=h.promise,g=h.callback,I=p.then(function(M){N.resolve(M).drop()});return A(I,g),p}function Y(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){var g=h._dbInfo.mStore.get(a);return g==null?null:h._dbInfo.serializer.deserialize(g)});return A(p,f),p}function V(a,f){var h=this,p=this.ready().then(function(){for(var g=h._dbInfo.mStore,I=g.keys(),M=0;M<I.length;M++){var X=g.get(I[M]);if(X&&(X=h._dbInfo.serializer.deserialize(X)),X=a(X,I[M],M+1),X!==void 0)return X}});return A(p,f),p}function Q(a,f){var h=this,p=this.ready().then(function(){var g;try{g=h._dbInfo.mStore.key(a),g===void 0&&(g=null)}catch{g=null}return g});return A(p,f),p}function $(a){var f=this,h=this.ready().then(function(){return f._dbInfo.mStore.keys()});return A(h,a),h}function ie(a){var f=this.keys().then(function(h){return h.length});return A(f,a),f}function ue(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){h._dbInfo.mStore.rm(a)});return A(p,f),p}function le(a,f,h){var p=this;a=oe(a);var g=this.ready().then(function(){f===void 0&&(f=null);var I=f;return new Promise(function(M,X){p._dbInfo.serializer.serialize(f,function(ce,ae){if(ae)X(ae);else try{p._dbInfo.mStore.set(a,ce),M(I)}catch(de){X(de)}})})});return A(g,h),g}var re=!0;m._support=re,m._driver=x,m._initStorage=E,m.clear=B,m.dropInstance=K,m.getItem=Y,m.iterate=V,m.key=Q,m.keys=$,m.length=ie,m.removeItem=ue,m.setItem=le,Object.defineProperty(m,"__esModule",{value:!0})})}),Ne=He($r()),Ve=He(et()),rt={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function tt(_){for(let[S,m]of Object.entries(rt))_.style[S]=m}function nt(_){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(m=>m.src.includes(_))}var ot=class extends Kr{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(_=>{let S=()=>{if(nt(encodeURIComponent(this.parameters)))Yr().log();else{let m=document.createElement("iframe");m.classList.add("magic-iframe"),m.dataset.magicIframeLabel=Je(this.endpoint).host,m.title="Secure Modal",m.src=Je(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,tt(m),document.body.appendChild(m),_(m)}};["loaded","interactive","complete"].includes(document.readyState)?S():window.addEventListener("load",S,!1)}),window.addEventListener("message",_=>{var S;if(_.origin===this.endpoint&&_.data&&_.data.msgType&&this.messageHandlers.size){_.data.response=(S=_.data.response)!=null?S:{};for(let m of this.messageHandlers.values())m(_)}})}showOverlay(){return me(this,null,function*(){let _=yield this.iframe;_.style.display="block",this.activeElement=document.activeElement,_.focus()})}hideOverlay(){return me(this,null,function*(){var _;let S=yield this.iframe;S.style.display="none",(_=this.activeElement)!=null&&_.focus&&this.activeElement.focus(),this.activeElement=null})}_post(_){return me(this,null,function*(){let S=yield this.iframe;if(S&&S.contentWindow)S.contentWindow.postMessage(_,this.endpoint);else throw Xr()})}},ut=Wr(qr,{platform:"web",sdkName:"magic-sdk",version:"21.5.0",defaultEndpoint:"https://auth.magic.link/",ViewController:ot,configureStorage:()=>me(void 0,null,function*(){let _=Ne.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield _.defineDriver(Ve),yield _.setDriver([Ne.default.INDEXEDDB,Ne.default.LOCALSTORAGE,Ve._driver]),_})});export{st as DeepLinkPage,lt as DeviceVerificationEventEmit,dt as DeviceVerificationEventOnReceived,vt as EthChainType,ht as Events,yt as Extension,pt as ExtensionError,mt as ExtensionWarning,bt as LoginWithEmailOTPEventEmit,gt as LoginWithEmailOTPEventOnReceived,_t as LoginWithMagicLinkEventEmit,wt as LoginWithMagicLinkEventOnReceived,ut as Magic,It as MagicIncomingWindowMessage,Et as MagicOutgoingWindowMessage,St as MagicPayloadMethod,Ot as RPCError,jt as RPCErrorCode,Nt as RecoveryMethodType,At as SDKError,Bt as SDKErrorCode,kt as SDKWarning,xt as SDKWarningCode,Dt as Wallets,Rt as isPromiEvent};
|
|
1
|
+
import{a as se}from"./index-9b8a6048.js";import{J as Wr,M as qr,K as Kr,p as Xr,O as Yr,W as Je}from"./index-1e48b2db.js";import{f as st,T as lt,A as dt,R as vt,c as ht,D as yt,H as pt,t as mt,I as bt,x as gt,v as _t,E as wt,u as It,g as Et,l as St,_ as Ot,m as jt,N as Nt,C as At,o as Bt,B as kt,a as xt,b as Dt,P as Rt}from"./index-1e48b2db.js";var Jr=Object.create,Qe=Object.defineProperty,Vr=Object.getOwnPropertyDescriptor,Qr=Object.getOwnPropertyNames,Zr=Object.getPrototypeOf,Hr=Object.prototype.hasOwnProperty,pe=(_=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(_,{get:(S,m)=>(typeof require<"u"?require:S)[m]}):_)(function(_){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+_+'" is not supported')}),Ze=(_,S)=>()=>(S||_((S={exports:{}}).exports,S),S.exports),Gr=(_,S,m,x)=>{if(S&&typeof S=="object"||typeof S=="function")for(let q of Qr(S))!Hr.call(_,q)&&q!==m&&Qe(_,q,{get:()=>S[q],enumerable:!(x=Vr(S,q))||x.enumerable});return _},He=(_,S,m)=>(m=_!=null?Jr(Zr(_)):{},Gr(S||!_||!_.__esModule?Qe(m,"default",{value:_,enumerable:!0}):m,_)),me=(_,S,m)=>new Promise((x,q)=>{var C=D=>{try{j(m.next(D))}catch(L){q(L)}},P=D=>{try{j(m.throw(D))}catch(L){q(L)}},j=D=>D.done?x(D.value):Promise.resolve(D.value).then(C,P);j((m=m.apply(_,S)).next())}),$r=Ze((_,S)=>{(function(m){if(typeof _=="object"&&typeof S<"u")S.exports=m();else if(typeof define=="function"&&define.amd)define([],m);else{var x;typeof window<"u"?x=window:typeof se<"u"?x=se:typeof self<"u"?x=self:x=this,x.localforage=m()}})(function(){return function m(x,q,C){function P(L,J){if(!q[L]){if(!x[L]){var y=typeof pe=="function"&&pe;if(!J&&y)return y(L,!0);if(j)return j(L,!0);var w=new Error("Cannot find module '"+L+"'");throw w.code="MODULE_NOT_FOUND",w}var z=q[L]={exports:{}};x[L][0].call(z.exports,function(F){var Z=x[L][1][F];return P(Z||F)},z,z.exports,m,x,q,C)}return q[L].exports}for(var j=typeof pe=="function"&&pe,D=0;D<C.length;D++)P(C[D]);return P}({1:[function(m,x,q){(function(C){var P=C.MutationObserver||C.WebKitMutationObserver,j;if(P){var D=0,L=new P(F),J=C.document.createTextNode("");L.observe(J,{characterData:!0}),j=function(){J.data=D=++D%2}}else if(!C.setImmediate&&typeof C.MessageChannel<"u"){var y=new C.MessageChannel;y.port1.onmessage=F,j=function(){y.port2.postMessage(0)}}else"document"in C&&"onreadystatechange"in C.document.createElement("script")?j=function(){var A=C.document.createElement("script");A.onreadystatechange=function(){F(),A.onreadystatechange=null,A.parentNode.removeChild(A),A=null},C.document.documentElement.appendChild(A)}:j=function(){setTimeout(F,0)};var w,z=[];function F(){w=!0;for(var A,G,U=z.length;U;){for(G=z,z=[],A=-1;++A<U;)G[A]();U=z.length}w=!1}x.exports=Z;function Z(A){z.push(A)===1&&!w&&j()}}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(m,x,q){var C=m(1);function P(){}var j={},D=["REJECTED"],L=["FULFILLED"],J=["PENDING"];x.exports=y;function y(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=J,this.queue=[],this.outcome=void 0,v!==P&&Z(this,v)}y.prototype.catch=function(v){return this.then(null,v)},y.prototype.then=function(v,N){if(typeof v!="function"&&this.state===L||typeof N!="function"&&this.state===D)return this;var E=new this.constructor(P);if(this.state!==J){var B=this.state===L?v:N;z(E,B,this.outcome)}else this.queue.push(new w(E,v,N));return E};function w(v,N,E){this.promise=v,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(v){j.resolve(this.promise,v)},w.prototype.otherCallFulfilled=function(v){z(this.promise,this.onFulfilled,v)},w.prototype.callRejected=function(v){j.reject(this.promise,v)},w.prototype.otherCallRejected=function(v){z(this.promise,this.onRejected,v)};function z(v,N,E){C(function(){var B;try{B=N(E)}catch(K){return j.reject(v,K)}B===v?j.reject(v,new TypeError("Cannot resolve promise with itself")):j.resolve(v,B)})}j.resolve=function(v,N){var E=A(F,N);if(E.status==="error")return j.reject(v,E.value);var B=E.value;if(B)Z(v,B);else{v.state=L,v.outcome=N;for(var K=-1,Y=v.queue.length;++K<Y;)v.queue[K].callFulfilled(N)}return v},j.reject=function(v,N){v.state=D,v.outcome=N;for(var E=-1,B=v.queue.length;++E<B;)v.queue[E].callRejected(N);return v};function F(v){var N=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof N=="function")return function(){N.apply(v,arguments)}}function Z(v,N){var E=!1;function B(Q){E||(E=!0,j.reject(v,Q))}function K(Q){E||(E=!0,j.resolve(v,Q))}function Y(){N(K,B)}var V=A(Y);V.status==="error"&&B(V.value)}function A(v,N){var E={};try{E.value=v(N),E.status="success"}catch(B){E.status="error",E.value=B}return E}y.resolve=G;function G(v){return v instanceof this?v:j.resolve(new this(P),v)}y.reject=U;function U(v){var N=new this(P);return j.reject(N,v)}y.all=oe;function oe(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=new Array(E),Y=0,V=-1,Q=new this(P);++V<E;)$(v[V],V);return Q;function $(ie,ue){N.resolve(ie).then(le,function(re){B||(B=!0,j.reject(Q,re))});function le(re){K[ue]=re,++Y===E&&!B&&(B=!0,j.resolve(Q,K))}}}y.race=ee;function ee(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=-1,Y=new this(P);++K<E;)V(v[K]);return Y;function V(Q){N.resolve(Q).then(function($){B||(B=!0,j.resolve(Y,$))},function($){B||(B=!0,j.reject(Y,$))})}}},{1:1}],3:[function(m,x,q){(function(C){typeof C.Promise!="function"&&(C.Promise=m(2))}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(m,x,q){var C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function P(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function j(){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 D=j();function L(){try{if(!D||!D.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||r)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function J(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(i){if(i.name!=="TypeError")throw i;for(var t=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,o=new t,n=0;n<e.length;n+=1)o.append(e[n]);return o.getBlob(r.type)}}typeof Promise>"u"&&m(3);var y=Promise;function w(e,r){r&&e.then(function(t){r(null,t)},function(t){r(t)})}function z(e,r,t){typeof r=="function"&&e.then(r),typeof t=="function"&&e.catch(t)}function F(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function Z(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var A="local-forage-detect-blob-support",G=void 0,U={},oe=Object.prototype.toString,ee="readonly",v="readwrite";function N(e){for(var r=e.length,t=new ArrayBuffer(r),o=new Uint8Array(t),n=0;n<r;n++)o[n]=e.charCodeAt(n);return t}function E(e){return new y(function(r){var t=e.transaction(A,v),o=J([""]);t.objectStore(A).put(o,"key"),t.onabort=function(n){n.preventDefault(),n.stopPropagation(),r(!1)},t.oncomplete=function(){var n=navigator.userAgent.match(/Chrome\/(\d+)/),i=navigator.userAgent.match(/Edge\//);r(i||!n||parseInt(n[1],10)>=43)}}).catch(function(){return!1})}function B(e){return typeof G=="boolean"?y.resolve(G):E(e).then(function(r){return G=r,G})}function K(e){var r=U[e.name],t={};t.promise=new y(function(o,n){t.resolve=o,t.reject=n}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise}function Y(e){var r=U[e.name],t=r.deferredOperations.pop();if(t)return t.resolve(),t.promise}function V(e,r){var t=U[e.name],o=t.deferredOperations.pop();if(o)return o.reject(r),o.promise}function Q(e,r){return new y(function(t,o){if(U[e.name]=U[e.name]||g(),e.db)if(r)K(e),e.db.close();else return t(e.db);var n=[e.name];r&&n.push(e.version);var i=D.open.apply(D,n);r&&(i.onupgradeneeded=function(u){var c=i.result;try{c.createObjectStore(e.storeName),u.oldVersion<=1&&c.createObjectStore(A)}catch(d){if(d.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+u.oldVersion+" to version "+u.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw d}}),i.onerror=function(u){u.preventDefault(),o(i.error)},i.onsuccess=function(){var u=i.result;u.onversionchange=function(c){c.target.close()},t(u),Y(e)}})}function $(e){return Q(e,!1)}function ie(e){return Q(e,!0)}function ue(e,r){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),o=e.version<e.db.version,n=e.version>e.db.version;if(o&&(e.version!==r&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),n||t){if(t){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function le(e){return new y(function(r,t){var o=new FileReader;o.onerror=t,o.onloadend=function(n){var i=btoa(n.target.result||"");r({__local_forage_encoded_blob:!0,data:i,type:e.type})},o.readAsBinaryString(e)})}function re(e){var r=N(atob(e.data));return J([r],{type:e.type})}function a(e){return e&&e.__local_forage_encoded_blob}function f(e){var r=this,t=r._initReady().then(function(){var o=U[r._dbInfo.name];if(o&&o.dbReady)return o.dbReady});return z(t,e,e),t}function h(e){K(e);for(var r=U[e.name],t=r.forages,o=0;o<t.length;o++){var n=t[o];n._dbInfo.db&&(n._dbInfo.db.close(),n._dbInfo.db=null)}return e.db=null,$(e).then(function(i){return e.db=i,ue(e)?ie(e):i}).then(function(i){e.db=r.db=i;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=i}).catch(function(i){throw V(e,i),i})}function p(e,r,t,o){o===void 0&&(o=1);try{var n=e.db.transaction(e.storeName,r);t(null,n)}catch(i){if(o>0&&(!e.db||i.name==="InvalidStateError"||i.name==="NotFoundError"))return y.resolve().then(function(){if(!e.db||i.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ie(e)}).then(function(){return h(e).then(function(){p(e,r,t,o-1)})}).catch(t);t(i)}}function g(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function I(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=e[o];var n=U[t.name];n||(n=g(),U[t.name]=n),n.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=f);var i=[];function u(){return y.resolve()}for(var c=0;c<n.forages.length;c++){var d=n.forages[c];d!==r&&i.push(d._initReady().catch(u))}var l=n.forages.slice(0);return y.all(i).then(function(){return t.db=n.db,$(t)}).then(function(s){return t.db=s,ue(t,r._defaultConfig.version)?ie(t):s}).then(function(s){t.db=n.db=s,r._dbInfo=t;for(var b=0;b<l.length;b++){var O=l[b];O!==r&&(O._dbInfo.db=t.db,O._dbInfo.version=t.version)}})}function M(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.get(e);l.onsuccess=function(){var s=l.result;s===void 0&&(s=null),a(s)&&(s=re(s)),n(s)},l.onerror=function(){i(l.error)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function X(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.openCursor(),s=1;l.onsuccess=function(){var b=l.result;if(b){var O=b.value;a(O)&&(O=re(O));var R=e(O,b.key,s++);R!==void 0?n(R):b.continue()}else n()},l.onerror=function(){i(l.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function ce(e,r,t){var o=this;e=F(e);var n=new y(function(i,u){var c;o.ready().then(function(){return c=o._dbInfo,oe.call(r)==="[object Blob]"?B(c.db).then(function(d){return d?r:le(r)}):r}).then(function(d){p(o._dbInfo,v,function(l,s){if(l)return u(l);try{var b=s.objectStore(o._dbInfo.storeName);d===null&&(d=void 0);var O=b.put(d,e);s.oncomplete=function(){d===void 0&&(d=null),i(d)},s.onabort=s.onerror=function(){var R=O.error?O.error:O.transaction.error;u(R)}}catch(R){u(R)}})}).catch(u)});return w(n,t),n}function ae(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,v,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.delete(e);c.oncomplete=function(){n()},c.onerror=function(){i(l.error)},c.onabort=function(){var s=l.error?l.error:l.transaction.error;i(s)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function de(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,v,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.clear();u.oncomplete=function(){o()},u.onabort=u.onerror=function(){var l=d.error?d.error:d.transaction.error;n(l)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function Ge(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.count();d.onsuccess=function(){o(d.result)},d.onerror=function(){n(d.error)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function $e(e,r){var t=this,o=new y(function(n,i){if(e<0){n(null);return}t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=!1,s=d.openKeyCursor();s.onsuccess=function(){var b=s.result;if(!b){n(null);return}e===0||l?n(b.key):(l=!0,b.advance(e))},s.onerror=function(){i(s.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function er(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.openKeyCursor(),l=[];d.onsuccess=function(){var s=d.result;if(!s){o(l);return}l.push(s.key),s.continue()},d.onerror=function(){n(d.error)}}catch(s){n(s)}})}).catch(n)});return w(t,e),t}function rr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;if(!e.name)n=y.reject("Invalid arguments");else{var i=e.name===t.name&&o._dbInfo.db,u=i?y.resolve(o._dbInfo.db):$(e).then(function(c){var d=U[e.name],l=d.forages;d.db=c;for(var s=0;s<l.length;s++)l[s]._dbInfo.db=c;return c});e.storeName?n=u.then(function(c){if(c.objectStoreNames.contains(e.storeName)){var d=c.version+1;K(e);var l=U[e.name],s=l.forages;c.close();for(var b=0;b<s.length;b++){var O=s[b];O._dbInfo.db=null,O._dbInfo.version=d}var R=new y(function(k,W){var T=D.open(e.name,d);T.onerror=function(H){var Oe=T.result;Oe.close(),W(H)},T.onupgradeneeded=function(){var H=T.result;H.deleteObjectStore(e.storeName)},T.onsuccess=function(){var H=T.result;H.close(),k(H)}});return R.then(function(k){l.db=k;for(var W=0;W<s.length;W++){var T=s[W];T._dbInfo.db=k,Y(T._dbInfo)}}).catch(function(k){throw(V(e,k)||y.resolve()).catch(function(){}),k})}}):n=u.then(function(c){K(e);var d=U[e.name],l=d.forages;c.close();for(var s=0;s<l.length;s++){var b=l[s];b._dbInfo.db=null}var O=new y(function(R,k){var W=D.deleteDatabase(e.name);W.onerror=function(){var T=W.result;T&&T.close(),k(W.error)},W.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},W.onsuccess=function(){var T=W.result;T&&T.close(),R(T)}});return O.then(function(R){d.db=R;for(var k=0;k<l.length;k++){var W=l[k];Y(W._dbInfo)}}).catch(function(R){throw(V(e,R)||y.resolve()).catch(function(){}),R})})}return w(n,r),n}var tr={_driver:"asyncStorage",_initStorage:I,_support:L(),iterate:X,getItem:M,setItem:ce,removeItem:ae,clear:de,length:Ge,key:$e,keys:er,dropInstance:rr};function nr(){return typeof openDatabase=="function"}var te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",or="~~local_forage_type~",Ae=/^~~local_forage_type~([^~]+)~/,he="__lfsc__:",be=he.length,ge="arbf",_e="blob",Be="si08",ke="ui08",xe="uic8",De="si16",Re="si32",Ce="ur16",Le="ui32",Me="fl32",Te="fl64",ze=be+ge.length,Fe=Object.prototype.toString;function Pe(e){var r=e.length*.75,t=e.length,o,n=0,i,u,c,d;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var l=new ArrayBuffer(r),s=new Uint8Array(l);for(o=0;o<t;o+=4)i=te.indexOf(e[o]),u=te.indexOf(e[o+1]),c=te.indexOf(e[o+2]),d=te.indexOf(e[o+3]),s[n++]=i<<2|u>>4,s[n++]=(u&15)<<4|c>>2,s[n++]=(c&3)<<6|d&63;return l}function we(e){var r=new Uint8Array(e),t="",o;for(o=0;o<r.length;o+=3)t+=te[r[o]>>2],t+=te[(r[o]&3)<<4|r[o+1]>>4],t+=te[(r[o+1]&15)<<2|r[o+2]>>6],t+=te[r[o+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+"=":r.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function ir(e,r){var t="";if(e&&(t=Fe.call(e)),e&&(t==="[object ArrayBuffer]"||e.buffer&&Fe.call(e.buffer)==="[object ArrayBuffer]")){var o,n=he;e instanceof ArrayBuffer?(o=e,n+=ge):(o=e.buffer,t==="[object Int8Array]"?n+=Be:t==="[object Uint8Array]"?n+=ke:t==="[object Uint8ClampedArray]"?n+=xe:t==="[object Int16Array]"?n+=De:t==="[object Uint16Array]"?n+=Ce:t==="[object Int32Array]"?n+=Re:t==="[object Uint32Array]"?n+=Le:t==="[object Float32Array]"?n+=Me:t==="[object Float64Array]"?n+=Te:r(new Error("Failed to get type for BinaryArray"))),r(n+we(o))}else if(t==="[object Blob]"){var i=new FileReader;i.onload=function(){var u=or+e.type+"~"+we(this.result);r(he+_e+u)},i.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(u){console.error("Couldn't convert value into a JSON string: ",e),r(null,u)}}function ar(e){if(e.substring(0,be)!==he)return JSON.parse(e);var r=e.substring(ze),t=e.substring(be,ze),o;if(t===_e&&Ae.test(r)){var n=r.match(Ae);o=n[1],r=r.substring(n[0].length)}var i=Pe(r);switch(t){case ge:return i;case _e:return J([i],{type:o});case Be:return new Int8Array(i);case ke:return new Uint8Array(i);case xe:return new Uint8ClampedArray(i);case De:return new Int16Array(i);case Ce:return new Uint16Array(i);case Re:return new Int32Array(i);case Le:return new Uint32Array(i);case Me:return new Float32Array(i);case Te:return new Float64Array(i);default:throw new Error("Unkown type: "+t)}}var Ie={serialize:ir,deserialize:ar,stringToBuffer:Pe,bufferToString:we};function Ue(e,r,t,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,o)}function ur(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=typeof e[o]!="string"?e[o].toString():e[o];var n=new y(function(i,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(c){return u(c)}t.db.transaction(function(c){Ue(c,t,function(){r._dbInfo=t,i()},function(d,l){u(l)})},u)});return t.serializer=Ie,n}function ne(e,r,t,o,n,i){e.executeSql(t,o,n,function(u,c){c.code===c.SYNTAX_ERR?u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(d,l){l.rows.length?i(d,c):Ue(d,r,function(){d.executeSql(t,o,n,i)},i)},i):i(u,c)},i)}function cr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName+" WHERE key = ? LIMIT 1",[e],function(d,l){var s=l.rows.length?l.rows.item(0).value:null;s&&(s=u.serializer.deserialize(s)),n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function fr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName,[],function(d,l){for(var s=l.rows,b=s.length,O=0;O<b;O++){var R=s.item(O),k=R.value;if(k&&(k=u.serializer.deserialize(k)),k=e(k,R.key,O+1),k!==void 0){n(k);return}}n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function We(e,r,t,o){var n=this;e=F(e);var i=new y(function(u,c){n.ready().then(function(){r===void 0&&(r=null);var d=r,l=n._dbInfo;l.serializer.serialize(r,function(s,b){b?c(b):l.db.transaction(function(O){ne(O,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,s],function(){u(d)},function(R,k){c(k)})},function(O){if(O.code===O.QUOTA_ERR){if(o>0){u(We.apply(n,[e,d,t,o-1]));return}c(O)}})})}).catch(c)});return w(i,t),i}function sr(e,r,t){return We.apply(this,[e,r,t,1])}function lr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"DELETE FROM "+u.storeName+" WHERE key = ?",[e],function(){n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function dr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"DELETE FROM "+i.storeName,[],function(){o()},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function vr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],function(c,d){var l=d.rows.item(0).c;o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function hr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT key FROM "+u.storeName+" WHERE id = ? LIMIT 1",[e+1],function(d,l){var s=l.rows.length?l.rows.item(0).key:null;n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function yr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT key FROM "+i.storeName,[],function(c,d){for(var l=[],s=0;s<d.rows.length;s++)l.push(d.rows.item(s).key);o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function pr(e){return new y(function(r,t){e.transaction(function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(n,i){for(var u=[],c=0;c<i.rows.length;c++)u.push(i.rows.item(c).name);r({db:e,storeNames:u})},function(n,i){t(i)})},function(o){t(o)})})}function mr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;return e.name?n=new y(function(i){var u;e.name===t.name?u=o._dbInfo.db:u=openDatabase(e.name,"","",0),e.storeName?i({db:u,storeNames:[e.storeName]}):i(pr(u))}).then(function(i){return new y(function(u,c){i.db.transaction(function(d){function l(R){return new y(function(k,W){d.executeSql("DROP TABLE IF EXISTS "+R,[],function(){k()},function(T,H){W(H)})})}for(var s=[],b=0,O=i.storeNames.length;b<O;b++)s.push(l(i.storeNames[b]));y.all(s).then(function(){u()}).catch(function(R){c(R)})},function(d){c(d)})})}):n=y.reject("Invalid arguments"),w(n,r),n}var br={_driver:"webSQLStorage",_initStorage:ur,_support:nr(),iterate:fr,getItem:cr,setItem:sr,removeItem:lr,clear:dr,length:vr,key:hr,keys:yr,dropInstance:mr};function gr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qe(e,r){var t=e.name+"/";return e.storeName!==r.storeName&&(t+=e.storeName+"/"),t}function _r(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function wr(){return!_r()||localStorage.length>0}function Ir(e){var r=this,t={};if(e)for(var o in e)t[o]=e[o];return t.keyPrefix=qe(e,r._defaultConfig),wr()?(r._dbInfo=t,t.serializer=Ie,y.resolve()):y.reject()}function Er(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var i=localStorage.key(n);i.indexOf(o)===0&&localStorage.removeItem(i)}});return w(t,e),t}function Sr(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo,i=localStorage.getItem(n.keyPrefix+e);return i&&(i=n.serializer.deserialize(i)),i});return w(o,r),o}function Or(e,r){var t=this,o=t.ready().then(function(){for(var n=t._dbInfo,i=n.keyPrefix,u=i.length,c=localStorage.length,d=1,l=0;l<c;l++){var s=localStorage.key(l);if(s.indexOf(i)===0){var b=localStorage.getItem(s);if(b&&(b=n.serializer.deserialize(b)),b=e(b,s.substring(u),d++),b!==void 0)return b}}});return w(o,r),o}function jr(e,r){var t=this,o=t.ready().then(function(){var n=t._dbInfo,i;try{i=localStorage.key(e)}catch{i=null}return i&&(i=i.substring(n.keyPrefix.length)),i});return w(o,r),o}function Nr(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo,n=localStorage.length,i=[],u=0;u<n;u++){var c=localStorage.key(u);c.indexOf(o.keyPrefix)===0&&i.push(c.substring(o.keyPrefix.length))}return i});return w(t,e),t}function Ar(e){var r=this,t=r.keys().then(function(o){return o.length});return w(t,e),t}function Br(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo;localStorage.removeItem(n.keyPrefix+e)});return w(o,r),o}function kr(e,r,t){var o=this;e=F(e);var n=o.ready().then(function(){r===void 0&&(r=null);var i=r;return new y(function(u,c){var d=o._dbInfo;d.serializer.serialize(r,function(l,s){if(s)c(s);else try{localStorage.setItem(d.keyPrefix+e,l),u(i)}catch(b){(b.name==="QuotaExceededError"||b.name==="NS_ERROR_DOM_QUOTA_REACHED")&&c(b),c(b)}})})});return w(n,t),n}function xr(e,r){if(r=Z.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var o=this,n;return e.name?n=new y(function(i){e.storeName?i(qe(e,o._defaultConfig)):i(e.name+"/")}).then(function(i){for(var u=localStorage.length-1;u>=0;u--){var c=localStorage.key(u);c.indexOf(i)===0&&localStorage.removeItem(c)}}):n=y.reject("Invalid arguments"),w(n,r),n}var Dr={_driver:"localStorageWrapper",_initStorage:Ir,_support:gr(),iterate:Or,getItem:Sr,setItem:kr,removeItem:Br,clear:Er,length:Ar,key:jr,keys:Nr,dropInstance:xr},Rr=function(e,r){return e===r||typeof e=="number"&&typeof r=="number"&&isNaN(e)&&isNaN(r)},Cr=function(e,r){for(var t=e.length,o=0;o<t;){if(Rr(e[o],r))return!0;o++}return!1},Ke=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},ve={},Xe={},fe={INDEXEDDB:tr,WEBSQL:br,LOCALSTORAGE:Dr},Lr=[fe.INDEXEDDB._driver,fe.WEBSQL._driver,fe.LOCALSTORAGE._driver],ye=["dropInstance"],Ee=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ye),Mr={description:"",driver:Lr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Tr(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})}}function Se(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(Ke(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t])}return arguments[0]}var zr=function(){function e(r){P(this,e);for(var t in fe)if(fe.hasOwnProperty(t)){var o=fe[t],n=o._driver;this[t]=n,ve[n]||this.defineDriver(o)}this._defaultConfig=Se({},Mr),this._config=Se({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(r){if((typeof r>"u"?"undefined":C(r))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in r){if(t==="storeName"&&(r[t]=r[t].replace(/\W/g,"_")),t==="version"&&typeof r[t]!="number")return new Error("Database version must be a number.");this._config[t]=r[t]}return"driver"in r&&r.driver?this.setDriver(this._config.driver):!0}else return typeof r=="string"?this._config[r]:this._config},e.prototype.defineDriver=function(r,t,o){var n=new y(function(i,u){try{var c=r._driver,d=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!r._driver){u(d);return}for(var l=Ee.concat("_initStorage"),s=0,b=l.length;s<b;s++){var O=l[s],R=!Cr(ye,O);if((R||r[O])&&typeof r[O]!="function"){u(d);return}}var k=function(){for(var T=function(Pr){return function(){var Ur=new Error("Method "+Pr+" is not implemented by the current driver"),Ye=y.reject(Ur);return w(Ye,arguments[arguments.length-1]),Ye}},H=0,Oe=ye.length;H<Oe;H++){var je=ye[H];r[je]||(r[je]=T(je))}};k();var W=function(T){ve[c]&&console.info("Redefining LocalForage driver: "+c),ve[c]=r,Xe[c]=T,i()};"_support"in r?r._support&&typeof r._support=="function"?r._support().then(W,u):W(!!r._support):W(!0)}catch(T){u(T)}});return z(n,t,o),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(r,t,o){var n=ve[r]?y.resolve(ve[r]):y.reject(new Error("Driver not found."));return z(n,t,o),n},e.prototype.getSerializer=function(r){var t=y.resolve(Ie);return z(t,r),t},e.prototype.ready=function(r){var t=this,o=t._driverSet.then(function(){return t._ready===null&&(t._ready=t._initDriver()),t._ready});return z(o,r,r),o},e.prototype.setDriver=function(r,t,o){var n=this;Ke(r)||(r=[r]);var i=this._getSupportedDrivers(r);function u(){n._config.driver=n.driver()}function c(s){return n._extend(s),u(),n._ready=n._initStorage(n._config),n._ready}function d(s){return function(){var b=0;function O(){for(;b<s.length;){var R=s[b];return b++,n._dbInfo=null,n._ready=null,n.getDriver(R).then(c).catch(O)}u();var k=new Error("No available storage method found.");return n._driverSet=y.reject(k),n._driverSet}return O()}}var l=this._driverSet!==null?this._driverSet.catch(function(){return y.resolve()}):y.resolve();return this._driverSet=l.then(function(){var s=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(s).then(function(b){n._driver=b._driver,u(),n._wrapLibraryMethodsWithReady(),n._initDriver=d(i)})}).catch(function(){u();var s=new Error("No available storage method found.");return n._driverSet=y.reject(s),n._driverSet}),z(this._driverSet,t,o),this._driverSet},e.prototype.supports=function(r){return!!Xe[r]},e.prototype._extend=function(r){Se(this,r)},e.prototype._getSupportedDrivers=function(r){for(var t=[],o=0,n=r.length;o<n;o++){var i=r[o];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var r=0,t=Ee.length;r<t;r++)Tr(this,Ee[r])},e.prototype.createInstance=function(r){return new e(r)},e}(),Fr=new zr;x.exports=Fr},{3:3}]},{},[4])(4)})}),et=Ze((_,S)=>{(function(m,x){typeof _=="object"&&typeof S<"u"?x(_):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],x):x(m.LocalforageDriverMemory={})})(typeof self<"u"?self:_,function(m){var x="localforage-driver-memory";function q(a){var f=typeof Symbol=="function"&&a[Symbol.iterator],h=0;return f?f.call(a):{next:function(){return a&&h>=a.length&&(a=void 0),{value:a&&a[h++],done:!a}}}}function C(a,f){a=a||[],f=f||{};try{return new Blob(a,f)}catch(I){if(I.name!=="TypeError")throw I;for(var h=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,p=new h,g=0;g<a.length;g+=1)p.append(a[g]);return p.getBlob(f.type)}}var P=/^~~local_forage_type~([^~]+)~/,j=9,D=j+4,L=Object.prototype.toString;function J(a){var f=a.length*.75,h=a.length;a[a.length-1]==="="&&(f--,a[a.length-2]==="="&&f--);for(var p=new ArrayBuffer(f),g=new Uint8Array(p),I=0,M=0;I<h;I+=4){var X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I]),ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+1]),ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+2]),de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+3]);g[M++]=X<<2|ce>>4,g[M++]=(ce&15)<<4|ae>>2,g[M++]=(ae&3)<<6|de&63}return p}function y(a){for(var f=new Uint8Array(a),h="",p=0;p<f.length;p+=3)h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p]>>2],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p]&3)<<4|f[p+1]>>4],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p+1]&15)<<2|f[p+2]>>6],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p+2]&63];return f.length%3===2?h=h.substring(0,h.length-1)+"=":f.length%3===1&&(h=h.substring(0,h.length-2)+"=="),h}function w(a,f){var h="";if(a&&(h=L.call(a)),a&&(h==="[object ArrayBuffer]"||a.buffer&&L.call(a.buffer)==="[object ArrayBuffer]")){var p=void 0,g="__lfsc__:";a instanceof ArrayBuffer?(p=a,g+="arbf"):(p=a.buffer,h==="[object Int8Array]"?g+="si08":h==="[object Uint8Array]"?g+="ui08":h==="[object Uint8ClampedArray]"?g+="uic8":h==="[object Int16Array]"?g+="si16":h==="[object Uint16Array]"?g+="ur16":h==="[object Int32Array]"?g+="si32":h==="[object Uint32Array]"?g+="ui32":h==="[object Float32Array]"?g+="fl32":h==="[object Float64Array]"?g+="fl64":f(new Error("Failed to get type for BinaryArray"))),f(g+y(p))}else if(h==="[object Blob]"){var I=new FileReader;I.onload=function(){var M="~~local_forage_type~"+a.type+"~"+y(this.result);f("__lfsc__:blob"+M)},I.readAsArrayBuffer(a)}else try{f(JSON.stringify(a))}catch(M){console.error("Couldn't convert value into a JSON string: ",a),f(null,M)}}function z(a){if(a.substring(0,j)!=="__lfsc__:")return JSON.parse(a);var f=a.substring(D),h=a.substring(j,D),p;if(h==="blob"&&P.test(f)){var g=f.match(P);p=g[1],f=f.substring(g[0].length)}var I=J(f);switch(h){case"arbf":return I;case"blob":return C([I],{type:p});case"si08":return new Int8Array(I);case"ui08":return new Uint8Array(I);case"uic8":return new Uint8ClampedArray(I);case"si16":return new Int16Array(I);case"ur16":return new Uint16Array(I);case"si32":return new Int32Array(I);case"ui32":return new Uint32Array(I);case"fl32":return new Float32Array(I);case"fl64":return new Float64Array(I);default:throw new Error("Unkown type: "+h)}}function F(a){var f,h;if(a===null||typeof a!="object"||"isActiveClone"in a)return a;var p=a instanceof Date?new Date(a):a.constructor();try{for(var g=q(Object.keys(a)),I=g.next();!I.done;I=g.next()){var M=I.value;Object.prototype.hasOwnProperty.call(a,M)&&(a.isActiveClone=null,p[M]=F(a[M]),delete a.isActiveClone)}}catch(X){f={error:X}}finally{try{I&&!I.done&&(h=g.return)&&h.call(g)}finally{if(f)throw f.error}}return p}function Z(a,f){return(a.name||f.name)+"/"+(a.storeName||f.storeName)+"/"}function A(a,f){f&&a.then(function(h){f(null,h)},function(h){f(h)})}function G(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function U(a,f){var h=this;if(f=G.apply(this,arguments),a=typeof a!="function"&&a||{},!a.name){var p=this.config();a.name=a.name||p.name,a.storeName=a.storeName||p.storeName}var g;return a.name?g=new Promise(function(I){a.storeName?I(Z(a,h._defaultConfig)):I(a.name+"/")}):g=Promise.reject("Invalid arguments"),{promise:g,callback:f}}function oe(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}var ee={bufferToString:y,deserialize:z,serialize:w,stringToBuffer:J},v={},N=function(){function a(f){this.kp=f,this.data={}}return a.resolve=function(f){return v[f]||(v[f]=new a(f)),v[f]},a.prototype.clear=function(){this.data={}},a.prototype.drop=function(){this.clear(),delete v[this.kp]},a.prototype.get=function(f){return this.data[f]},a.prototype.key=function(f){return this.keys()[f]},a.prototype.keys=function(){return Object.keys(this.data)},a.prototype.rm=function(f){delete this.data[f]},a.prototype.set=function(f,h){this.data[f]=h},a}();function E(a){var f=a?F(a):{},h=Z(f,this._defaultConfig),p=N.resolve(h);return this._dbInfo=f,this._dbInfo.serializer=ee,this._dbInfo.keyPrefix=h,this._dbInfo.mStore=p,Promise.resolve()}function B(a){var f=this,h=this.ready().then(function(){f._dbInfo.mStore.clear()});return A(h,a),h}function K(a,f){var h=U.apply(this,arguments),p=h.promise,g=h.callback,I=p.then(function(M){N.resolve(M).drop()});return A(I,g),p}function Y(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){var g=h._dbInfo.mStore.get(a);return g==null?null:h._dbInfo.serializer.deserialize(g)});return A(p,f),p}function V(a,f){var h=this,p=this.ready().then(function(){for(var g=h._dbInfo.mStore,I=g.keys(),M=0;M<I.length;M++){var X=g.get(I[M]);if(X&&(X=h._dbInfo.serializer.deserialize(X)),X=a(X,I[M],M+1),X!==void 0)return X}});return A(p,f),p}function Q(a,f){var h=this,p=this.ready().then(function(){var g;try{g=h._dbInfo.mStore.key(a),g===void 0&&(g=null)}catch{g=null}return g});return A(p,f),p}function $(a){var f=this,h=this.ready().then(function(){return f._dbInfo.mStore.keys()});return A(h,a),h}function ie(a){var f=this.keys().then(function(h){return h.length});return A(f,a),f}function ue(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){h._dbInfo.mStore.rm(a)});return A(p,f),p}function le(a,f,h){var p=this;a=oe(a);var g=this.ready().then(function(){f===void 0&&(f=null);var I=f;return new Promise(function(M,X){p._dbInfo.serializer.serialize(f,function(ce,ae){if(ae)X(ae);else try{p._dbInfo.mStore.set(a,ce),M(I)}catch(de){X(de)}})})});return A(g,h),g}var re=!0;m._support=re,m._driver=x,m._initStorage=E,m.clear=B,m.dropInstance=K,m.getItem=Y,m.iterate=V,m.key=Q,m.keys=$,m.length=ie,m.removeItem=ue,m.setItem=le,Object.defineProperty(m,"__esModule",{value:!0})})}),Ne=He($r()),Ve=He(et()),rt={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function tt(_){for(let[S,m]of Object.entries(rt))_.style[S]=m}function nt(_){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(m=>m.src.includes(_))}var ot=class extends Kr{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(_=>{let S=()=>{if(nt(encodeURIComponent(this.parameters)))Yr().log();else{let m=document.createElement("iframe");m.classList.add("magic-iframe"),m.dataset.magicIframeLabel=Je(this.endpoint).host,m.title="Secure Modal",m.src=Je(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,tt(m),document.body.appendChild(m),_(m)}};["loaded","interactive","complete"].includes(document.readyState)?S():window.addEventListener("load",S,!1)}),window.addEventListener("message",_=>{var S;if(_.origin===this.endpoint&&_.data&&_.data.msgType&&this.messageHandlers.size){_.data.response=(S=_.data.response)!=null?S:{};for(let m of this.messageHandlers.values())m(_)}})}showOverlay(){return me(this,null,function*(){let _=yield this.iframe;_.style.display="block",this.activeElement=document.activeElement,_.focus()})}hideOverlay(){return me(this,null,function*(){var _;let S=yield this.iframe;S.style.display="none",(_=this.activeElement)!=null&&_.focus&&this.activeElement.focus(),this.activeElement=null})}_post(_){return me(this,null,function*(){let S=yield this.iframe;if(S&&S.contentWindow)S.contentWindow.postMessage(_,this.endpoint);else throw Xr()})}},ut=Wr(qr,{platform:"web",sdkName:"magic-sdk",version:"21.5.0",defaultEndpoint:"https://auth.magic.link/",ViewController:ot,configureStorage:()=>me(void 0,null,function*(){let _=Ne.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield _.defineDriver(Ve),yield _.setDriver([Ne.default.INDEXEDDB,Ne.default.LOCALSTORAGE,Ve._driver]),_})});export{st as DeepLinkPage,lt as DeviceVerificationEventEmit,dt as DeviceVerificationEventOnReceived,vt as EthChainType,ht as Events,yt as Extension,pt as ExtensionError,mt as ExtensionWarning,bt as LoginWithEmailOTPEventEmit,gt as LoginWithEmailOTPEventOnReceived,_t as LoginWithMagicLinkEventEmit,wt as LoginWithMagicLinkEventOnReceived,ut as Magic,It as MagicIncomingWindowMessage,Et as MagicOutgoingWindowMessage,St as MagicPayloadMethod,Ot as RPCError,jt as RPCErrorCode,Nt as RecoveryMethodType,At as SDKError,Bt as SDKErrorCode,kt as SDKWarning,xt as SDKWarningCode,Dt as Wallets,Rt as isPromiEvent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{D as le}from"./index-3f9fa081.js";import{d as U,b as pe}from"./index-535c8f8c.js";var Mr={exports:{}},C0={exports:{}},lr;function L(){return lr||(lr=1,function(w,D){(function(s,a){w.exports=a()})(U,function(){var s=s||function(a,b){var y=Object.create||function(){function e(){}return function(o){var h;return e.prototype=o,h=new e,e.prototype=null,h}}(),m={},v=m.lib={},d=v.Base=function(){return{extend:function(e){var o=y(this);return e&&o.mixIn(e),(!o.hasOwnProperty("init")||this.init===o.init)&&(o.init=function(){o.$super.init.apply(this,arguments)}),o.init.prototype=o,o.$super=this,o},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var o in e)e.hasOwnProperty(o)&&(this[o]=e[o]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),r=v.WordArray=d.extend({init:function(e,o){e=this.words=e||[],o!=b?this.sigBytes=o:this.sigBytes=e.length*4},toString:function(e){return(e||p).stringify(this)},concat:function(e){var o=this.words,h=e.words,l=this.sigBytes,u=e.sigBytes;if(this.clamp(),l%4)for(var g=0;g<u;g++){var k=h[g>>>2]>>>24-g%4*8&255;o[l+g>>>2]|=k<<24-(l+g)%4*8}else for(var g=0;g<u;g+=4)o[l+g>>>2]=h[g>>>2];return this.sigBytes+=u,this},clamp:function(){var e=this.words,o=this.sigBytes;e[o>>>2]&=4294967295<<32-o%4*8,e.length=a.ceil(o/4)},clone:function(){var e=d.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var o=[],h=function(C){var C=C,B=987654321,W=4294967295;return function(){B=36969*(B&65535)+(B>>16)&W,C=18e3*(C&65535)+(C>>16)&W;var c=(B<<16)+C&W;return c/=4294967296,c+=.5,c*(a.random()>.5?1:-1)}},l=0,u;l<e;l+=4){var g=h((u||a.random())*4294967296);u=g()*987654071,o.push(g()*4294967296|0)}return new r.init(o,e)}}),t=m.enc={},p=t.Hex={stringify:function(e){for(var o=e.words,h=e.sigBytes,l=[],u=0;u<h;u++){var g=o[u>>>2]>>>24-u%4*8&255;l.push((g>>>4).toString(16)),l.push((g&15).toString(16))}return l.join("")},parse:function(e){for(var o=e.length,h=[],l=0;l<o;l+=2)h[l>>>3]|=parseInt(e.substr(l,2),16)<<24-l%8*4;return new r.init(h,o/2)}},x=t.Latin1={stringify:function(e){for(var o=e.words,h=e.sigBytes,l=[],u=0;u<h;u++){var g=o[u>>>2]>>>24-u%4*8&255;l.push(String.fromCharCode(g))}return l.join("")},parse:function(e){for(var o=e.length,h=[],l=0;l<o;l++)h[l>>>2]|=(e.charCodeAt(l)&255)<<24-l%4*8;return new r.init(h,o)}},i=t.Utf8={stringify:function(e){try{return decodeURIComponent(escape(x.stringify(e)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(e){return x.parse(unescape(encodeURIComponent(e)))}},n=v.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(e){typeof e=="string"&&(e=i.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var o=this._data,h=o.words,l=o.sigBytes,u=this.blockSize,g=u*4,k=l/g;e?k=a.ceil(k):k=a.max((k|0)-this._minBufferSize,0);var C=k*u,B=a.min(C*4,l);if(C){for(var W=0;W<C;W+=u)this._doProcessBlock(h,W);var c=h.splice(0,C);o.sigBytes-=B}return new r.init(c,B)},clone:function(){var e=d.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});v.Hasher=n.extend({cfg:d.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){n.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){e&&this._append(e);var o=this._doFinalize();return o},blockSize:16,_createHelper:function(e){return function(o,h){return new e.init(h).finalize(o)}},_createHmacHelper:function(e){return function(o,h){return new f.HMAC.init(e,h).finalize(o)}}});var f=m.algo={};return m}(Math);return s})}(C0)),C0.exports}var k0={exports:{}},pr;function g0(){return pr||(pr=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(a){var b=s,y=b.lib,m=y.Base,v=y.WordArray,d=b.x64={};d.Word=m.extend({init:function(r,t){this.high=r,this.low=t}}),d.WordArray=m.extend({init:function(r,t){r=this.words=r||[],t!=a?this.sigBytes=t:this.sigBytes=r.length*8},toX32:function(){for(var r=this.words,t=r.length,p=[],x=0;x<t;x++){var i=r[x];p.push(i.high),p.push(i.low)}return v.create(p,this.sigBytes)},clone:function(){for(var r=m.clone.call(this),t=r.words=this.words.slice(0),p=t.length,x=0;x<p;x++)t[x]=t[x].clone();return r}})}(),s})}(k0)),k0.exports}var H0={exports:{}},_r;function _e(){return _r||(_r=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(){if(typeof ArrayBuffer=="function"){var a=s,b=a.lib,y=b.WordArray,m=y.init,v=y.init=function(d){if(d instanceof ArrayBuffer&&(d=new Uint8Array(d)),(d instanceof Int8Array||typeof Uint8ClampedArray<"u"&&d instanceof Uint8ClampedArray||d instanceof Int16Array||d instanceof Uint16Array||d instanceof Int32Array||d instanceof Uint32Array||d instanceof Float32Array||d instanceof Float64Array)&&(d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength)),d instanceof Uint8Array){for(var r=d.byteLength,t=[],p=0;p<r;p++)t[p>>>2]|=d[p]<<24-p%4*8;m.call(this,t,r)}else m.apply(this,arguments)};v.prototype=y}}(),s.lib.WordArray})}(H0)),H0.exports}var w0={exports:{}},br;function be(){return br||(br=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(){var a=s,b=a.lib,y=b.WordArray,m=a.enc;m.Utf16=m.Utf16BE={stringify:function(d){for(var r=d.words,t=d.sigBytes,p=[],x=0;x<t;x+=2){var i=r[x>>>2]>>>16-x%4*8&65535;p.push(String.fromCharCode(i))}return p.join("")},parse:function(d){for(var r=d.length,t=[],p=0;p<r;p++)t[p>>>1]|=d.charCodeAt(p)<<16-p%2*16;return y.create(t,r*2)}},m.Utf16LE={stringify:function(d){for(var r=d.words,t=d.sigBytes,p=[],x=0;x<t;x+=2){var i=v(r[x>>>2]>>>16-x%4*8&65535);p.push(String.fromCharCode(i))}return p.join("")},parse:function(d){for(var r=d.length,t=[],p=0;p<r;p++)t[p>>>1]|=v(d.charCodeAt(p)<<16-p%2*16);return y.create(t,r*2)}};function v(d){return d<<8&4278255360|d>>>8&16711935}}(),s.enc.Utf16})}(w0)),w0.exports}var m0={exports:{}},gr;function n0(){return gr||(gr=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(){var a=s,b=a.lib,y=b.WordArray,m=a.enc;m.Base64={stringify:function(d){var r=d.words,t=d.sigBytes,p=this._map;d.clamp();for(var x=[],i=0;i<t;i+=3)for(var n=r[i>>>2]>>>24-i%4*8&255,f=r[i+1>>>2]>>>24-(i+1)%4*8&255,e=r[i+2>>>2]>>>24-(i+2)%4*8&255,o=n<<16|f<<8|e,h=0;h<4&&i+h*.75<t;h++)x.push(p.charAt(o>>>6*(3-h)&63));var l=p.charAt(64);if(l)for(;x.length%4;)x.push(l);return x.join("")},parse:function(d){var r=d.length,t=this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var x=0;x<t.length;x++)p[t.charCodeAt(x)]=x}var i=t.charAt(64);if(i){var n=d.indexOf(i);n!==-1&&(r=n)}return v(d,r,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function v(d,r,t){for(var p=[],x=0,i=0;i<r;i++)if(i%4){var n=t[d.charCodeAt(i-1)]<<i%4*2,f=t[d.charCodeAt(i)]>>>6-i%4*2;p[x>>>2]|=(n|f)<<24-x%4*8,x++}return y.create(p,x)}}(),s.enc.Base64})}(m0)),m0.exports}var S0={exports:{}},yr;function i0(){return yr||(yr=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(a){var b=s,y=b.lib,m=y.WordArray,v=y.Hasher,d=b.algo,r=[];(function(){for(var f=0;f<64;f++)r[f]=a.abs(a.sin(f+1))*4294967296|0})();var t=d.MD5=v.extend({_doReset:function(){this._hash=new m.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(f,e){for(var o=0;o<16;o++){var h=e+o,l=f[h];f[h]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360}var u=this._hash.words,g=f[e+0],k=f[e+1],C=f[e+2],B=f[e+3],W=f[e+4],c=f[e+5],_=f[e+6],R=f[e+7],A=f[e+8],q=f[e+9],P=f[e+10],I=f[e+11],X=f[e+12],T=f[e+13],N=f[e+14],K=f[e+15],H=u[0],z=u[1],E=u[2],S=u[3];H=p(H,z,E,S,g,7,r[0]),S=p(S,H,z,E,k,12,r[1]),E=p(E,S,H,z,C,17,r[2]),z=p(z,E,S,H,B,22,r[3]),H=p(H,z,E,S,W,7,r[4]),S=p(S,H,z,E,c,12,r[5]),E=p(E,S,H,z,_,17,r[6]),z=p(z,E,S,H,R,22,r[7]),H=p(H,z,E,S,A,7,r[8]),S=p(S,H,z,E,q,12,r[9]),E=p(E,S,H,z,P,17,r[10]),z=p(z,E,S,H,I,22,r[11]),H=p(H,z,E,S,X,7,r[12]),S=p(S,H,z,E,T,12,r[13]),E=p(E,S,H,z,N,17,r[14]),z=p(z,E,S,H,K,22,r[15]),H=x(H,z,E,S,k,5,r[16]),S=x(S,H,z,E,_,9,r[17]),E=x(E,S,H,z,I,14,r[18]),z=x(z,E,S,H,g,20,r[19]),H=x(H,z,E,S,c,5,r[20]),S=x(S,H,z,E,P,9,r[21]),E=x(E,S,H,z,K,14,r[22]),z=x(z,E,S,H,W,20,r[23]),H=x(H,z,E,S,q,5,r[24]),S=x(S,H,z,E,N,9,r[25]),E=x(E,S,H,z,B,14,r[26]),z=x(z,E,S,H,A,20,r[27]),H=x(H,z,E,S,T,5,r[28]),S=x(S,H,z,E,C,9,r[29]),E=x(E,S,H,z,R,14,r[30]),z=x(z,E,S,H,X,20,r[31]),H=i(H,z,E,S,c,4,r[32]),S=i(S,H,z,E,A,11,r[33]),E=i(E,S,H,z,I,16,r[34]),z=i(z,E,S,H,N,23,r[35]),H=i(H,z,E,S,k,4,r[36]),S=i(S,H,z,E,W,11,r[37]),E=i(E,S,H,z,R,16,r[38]),z=i(z,E,S,H,P,23,r[39]),H=i(H,z,E,S,T,4,r[40]),S=i(S,H,z,E,g,11,r[41]),E=i(E,S,H,z,B,16,r[42]),z=i(z,E,S,H,_,23,r[43]),H=i(H,z,E,S,q,4,r[44]),S=i(S,H,z,E,X,11,r[45]),E=i(E,S,H,z,K,16,r[46]),z=i(z,E,S,H,C,23,r[47]),H=n(H,z,E,S,g,6,r[48]),S=n(S,H,z,E,R,10,r[49]),E=n(E,S,H,z,N,15,r[50]),z=n(z,E,S,H,c,21,r[51]),H=n(H,z,E,S,X,6,r[52]),S=n(S,H,z,E,B,10,r[53]),E=n(E,S,H,z,P,15,r[54]),z=n(z,E,S,H,k,21,r[55]),H=n(H,z,E,S,A,6,r[56]),S=n(S,H,z,E,K,10,r[57]),E=n(E,S,H,z,_,15,r[58]),z=n(z,E,S,H,T,21,r[59]),H=n(H,z,E,S,W,6,r[60]),S=n(S,H,z,E,I,10,r[61]),E=n(E,S,H,z,C,15,r[62]),z=n(z,E,S,H,q,21,r[63]),u[0]=u[0]+H|0,u[1]=u[1]+z|0,u[2]=u[2]+E|0,u[3]=u[3]+S|0},_doFinalize:function(){var f=this._data,e=f.words,o=this._nDataBytes*8,h=f.sigBytes*8;e[h>>>5]|=128<<24-h%32;var l=a.floor(o/4294967296),u=o;e[(h+64>>>9<<4)+15]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,e[(h+64>>>9<<4)+14]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360,f.sigBytes=(e.length+1)*4,this._process();for(var g=this._hash,k=g.words,C=0;C<4;C++){var B=k[C];k[C]=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360}return g},clone:function(){var f=v.clone.call(this);return f._hash=this._hash.clone(),f}});function p(f,e,o,h,l,u,g){var k=f+(e&o|~e&h)+l+g;return(k<<u|k>>>32-u)+e}function x(f,e,o,h,l,u,g){var k=f+(e&h|o&~h)+l+g;return(k<<u|k>>>32-u)+e}function i(f,e,o,h,l,u,g){var k=f+(e^o^h)+l+g;return(k<<u|k>>>32-u)+e}function n(f,e,o,h,l,u,g){var k=f+(o^(e|~h))+l+g;return(k<<u|k>>>32-u)+e}b.MD5=v._createHelper(t),b.HmacMD5=v._createHmacHelper(t)}(Math),s.MD5})}(S0)),S0.exports}var R0={exports:{}},Br;function er(){return Br||(Br=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(){var a=s,b=a.lib,y=b.WordArray,m=b.Hasher,v=a.algo,d=[],r=v.SHA1=m.extend({_doReset:function(){this._hash=new y.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,p){for(var x=this._hash.words,i=x[0],n=x[1],f=x[2],e=x[3],o=x[4],h=0;h<80;h++){if(h<16)d[h]=t[p+h]|0;else{var l=d[h-3]^d[h-8]^d[h-14]^d[h-16];d[h]=l<<1|l>>>31}var u=(i<<5|i>>>27)+o+d[h];h<20?u+=(n&f|~n&e)+1518500249:h<40?u+=(n^f^e)+1859775393:h<60?u+=(n&f|n&e|f&e)-1894007588:u+=(n^f^e)-899497514,o=e,e=f,f=n<<30|n>>>2,n=i,i=u}x[0]=x[0]+i|0,x[1]=x[1]+n|0,x[2]=x[2]+f|0,x[3]=x[3]+e|0,x[4]=x[4]+o|0},_doFinalize:function(){var t=this._data,p=t.words,x=this._nDataBytes*8,i=t.sigBytes*8;return p[i>>>5]|=128<<24-i%32,p[(i+64>>>9<<4)+14]=Math.floor(x/4294967296),p[(i+64>>>9<<4)+15]=x,t.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var t=m.clone.call(this);return t._hash=this._hash.clone(),t}});a.SHA1=m._createHelper(r),a.HmacSHA1=m._createHmacHelper(r)}(),s.SHA1})}(R0)),R0.exports}var A0={exports:{}},Cr;function Vr(){return Cr||(Cr=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(a){var b=s,y=b.lib,m=y.WordArray,v=y.Hasher,d=b.algo,r=[],t=[];(function(){function i(o){for(var h=a.sqrt(o),l=2;l<=h;l++)if(!(o%l))return!1;return!0}function n(o){return(o-(o|0))*4294967296|0}for(var f=2,e=0;e<64;)i(f)&&(e<8&&(r[e]=n(a.pow(f,1/2))),t[e]=n(a.pow(f,1/3)),e++),f++})();var p=[],x=d.SHA256=v.extend({_doReset:function(){this._hash=new m.init(r.slice(0))},_doProcessBlock:function(i,n){for(var f=this._hash.words,e=f[0],o=f[1],h=f[2],l=f[3],u=f[4],g=f[5],k=f[6],C=f[7],B=0;B<64;B++){if(B<16)p[B]=i[n+B]|0;else{var W=p[B-15],c=(W<<25|W>>>7)^(W<<14|W>>>18)^W>>>3,_=p[B-2],R=(_<<15|_>>>17)^(_<<13|_>>>19)^_>>>10;p[B]=c+p[B-7]+R+p[B-16]}var A=u&g^~u&k,q=e&o^e&h^o&h,P=(e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22),I=(u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25),X=C+I+A+t[B]+p[B],T=P+q;C=k,k=g,g=u,u=l+X|0,l=h,h=o,o=e,e=X+T|0}f[0]=f[0]+e|0,f[1]=f[1]+o|0,f[2]=f[2]+h|0,f[3]=f[3]+l|0,f[4]=f[4]+u|0,f[5]=f[5]+g|0,f[6]=f[6]+k|0,f[7]=f[7]+C|0},_doFinalize:function(){var i=this._data,n=i.words,f=this._nDataBytes*8,e=i.sigBytes*8;return n[e>>>5]|=128<<24-e%32,n[(e+64>>>9<<4)+14]=a.floor(f/4294967296),n[(e+64>>>9<<4)+15]=f,i.sigBytes=n.length*4,this._process(),this._hash},clone:function(){var i=v.clone.call(this);return i._hash=this._hash.clone(),i}});b.SHA256=v._createHelper(x),b.HmacSHA256=v._createHmacHelper(x)}(Math),s.SHA256})}(A0)),A0.exports}var z0={exports:{}},kr;function ge(){return kr||(kr=1,function(w,D){(function(s,a,b){w.exports=a(L(),Vr())})(U,function(s){return function(){var a=s,b=a.lib,y=b.WordArray,m=a.algo,v=m.SHA256,d=m.SHA224=v.extend({_doReset:function(){this._hash=new y.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var r=v._doFinalize.call(this);return r.sigBytes-=4,r}});a.SHA224=v._createHelper(d),a.HmacSHA224=v._createHmacHelper(d)}(),s.SHA224})}(z0)),z0.exports}var E0={exports:{}},Hr;function Jr(){return Hr||(Hr=1,function(w,D){(function(s,a,b){w.exports=a(L(),g0())})(U,function(s){return function(){var a=s,b=a.lib,y=b.Hasher,m=a.x64,v=m.Word,d=m.WordArray,r=a.algo;function t(){return v.create.apply(v,arguments)}var p=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],x=[];(function(){for(var n=0;n<80;n++)x[n]=t()})();var i=r.SHA512=y.extend({_doReset:function(){this._hash=new d.init([new v.init(1779033703,4089235720),new v.init(3144134277,2227873595),new v.init(1013904242,4271175723),new v.init(2773480762,1595750129),new v.init(1359893119,2917565137),new v.init(2600822924,725511199),new v.init(528734635,4215389547),new v.init(1541459225,327033209)])},_doProcessBlock:function(n,f){for(var e=this._hash.words,o=e[0],h=e[1],l=e[2],u=e[3],g=e[4],k=e[5],C=e[6],B=e[7],W=o.high,c=o.low,_=h.high,R=h.low,A=l.high,q=l.low,P=u.high,I=u.low,X=g.high,T=g.low,N=k.high,K=k.low,H=C.high,z=C.low,E=B.high,S=B.low,G=W,O=c,Z=_,F=R,o0=A,t0=q,y0=P,f0=I,Y=X,j=T,l0=N,s0=K,p0=H,c0=z,B0=E,v0=S,M=0;M<80;M++){var _0=x[M];if(M<16)var r0=_0.high=n[f+M*2]|0,V=_0.low=n[f+M*2+1]|0;else{var ar=x[M-15],a0=ar.high,u0=ar.low,te=(a0>>>1|u0<<31)^(a0>>>8|u0<<24)^a0>>>7,xr=(u0>>>1|a0<<31)^(u0>>>8|a0<<24)^(u0>>>7|a0<<25),nr=x[M-2],x0=nr.high,d0=nr.low,ae=(x0>>>19|d0<<13)^(x0<<3|d0>>>29)^x0>>>6,ir=(d0>>>19|x0<<13)^(d0<<3|x0>>>29)^(d0>>>6|x0<<26),or=x[M-7],xe=or.high,ne=or.low,fr=x[M-16],ie=fr.high,sr=fr.low,V=xr+ne,r0=te+xe+(V>>>0<xr>>>0?1:0),V=V+ir,r0=r0+ae+(V>>>0<ir>>>0?1:0),V=V+sr,r0=r0+ie+(V>>>0<sr>>>0?1:0);_0.high=r0,_0.low=V}var oe=Y&l0^~Y&p0,cr=j&s0^~j&c0,fe=G&Z^G&o0^Z&o0,se=O&F^O&t0^F&t0,ce=(G>>>28|O<<4)^(G<<30|O>>>2)^(G<<25|O>>>7),vr=(O>>>28|G<<4)^(O<<30|G>>>2)^(O<<25|G>>>7),ve=(Y>>>14|j<<18)^(Y>>>18|j<<14)^(Y<<23|j>>>9),ue=(j>>>14|Y<<18)^(j>>>18|Y<<14)^(j<<23|Y>>>9),ur=p[M],de=ur.high,dr=ur.low,Q=v0+ue,J=B0+ve+(Q>>>0<v0>>>0?1:0),Q=Q+cr,J=J+oe+(Q>>>0<cr>>>0?1:0),Q=Q+dr,J=J+de+(Q>>>0<dr>>>0?1:0),Q=Q+V,J=J+r0+(Q>>>0<V>>>0?1:0),hr=vr+se,he=ce+fe+(hr>>>0<vr>>>0?1:0);B0=p0,v0=c0,p0=l0,c0=s0,l0=Y,s0=j,j=f0+Q|0,Y=y0+J+(j>>>0<f0>>>0?1:0)|0,y0=o0,f0=t0,o0=Z,t0=F,Z=G,F=O,O=Q+hr|0,G=J+he+(O>>>0<Q>>>0?1:0)|0}c=o.low=c+O,o.high=W+G+(c>>>0<O>>>0?1:0),R=h.low=R+F,h.high=_+Z+(R>>>0<F>>>0?1:0),q=l.low=q+t0,l.high=A+o0+(q>>>0<t0>>>0?1:0),I=u.low=I+f0,u.high=P+y0+(I>>>0<f0>>>0?1:0),T=g.low=T+j,g.high=X+Y+(T>>>0<j>>>0?1:0),K=k.low=K+s0,k.high=N+l0+(K>>>0<s0>>>0?1:0),z=C.low=z+c0,C.high=H+p0+(z>>>0<c0>>>0?1:0),S=B.low=S+v0,B.high=E+B0+(S>>>0<v0>>>0?1:0)},_doFinalize:function(){var n=this._data,f=n.words,e=this._nDataBytes*8,o=n.sigBytes*8;f[o>>>5]|=128<<24-o%32,f[(o+128>>>10<<5)+30]=Math.floor(e/4294967296),f[(o+128>>>10<<5)+31]=e,n.sigBytes=f.length*4,this._process();var h=this._hash.toX32();return h},clone:function(){var n=y.clone.call(this);return n._hash=this._hash.clone(),n},blockSize:1024/32});a.SHA512=y._createHelper(i),a.HmacSHA512=y._createHmacHelper(i)}(),s.SHA512})}(E0)),E0.exports}var W0={exports:{}},wr;function ye(){return wr||(wr=1,function(w,D){(function(s,a,b){w.exports=a(L(),g0(),Jr())})(U,function(s){return function(){var a=s,b=a.x64,y=b.Word,m=b.WordArray,v=a.algo,d=v.SHA512,r=v.SHA384=d.extend({_doReset:function(){this._hash=new m.init([new y.init(3418070365,3238371032),new y.init(1654270250,914150663),new y.init(2438529370,812702999),new y.init(355462360,4144912697),new y.init(1731405415,4290775857),new y.init(2394180231,1750603025),new y.init(3675008525,1694076839),new y.init(1203062813,3204075428)])},_doFinalize:function(){var t=d._doFinalize.call(this);return t.sigBytes-=16,t}});a.SHA384=d._createHelper(r),a.HmacSHA384=d._createHmacHelper(r)}(),s.SHA384})}(W0)),W0.exports}var D0={exports:{}},mr;function Be(){return mr||(mr=1,function(w,D){(function(s,a,b){w.exports=a(L(),g0())})(U,function(s){return function(a){var b=s,y=b.lib,m=y.WordArray,v=y.Hasher,d=b.x64,r=d.Word,t=b.algo,p=[],x=[],i=[];(function(){for(var e=1,o=0,h=0;h<24;h++){p[e+5*o]=(h+1)*(h+2)/2%64;var l=o%5,u=(2*e+3*o)%5;e=l,o=u}for(var e=0;e<5;e++)for(var o=0;o<5;o++)x[e+5*o]=o+(2*e+3*o)%5*5;for(var g=1,k=0;k<24;k++){for(var C=0,B=0,W=0;W<7;W++){if(g&1){var c=(1<<W)-1;c<32?B^=1<<c:C^=1<<c-32}g&128?g=g<<1^113:g<<=1}i[k]=r.create(C,B)}})();var n=[];(function(){for(var e=0;e<25;e++)n[e]=r.create()})();var f=t.SHA3=v.extend({cfg:v.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],o=0;o<25;o++)e[o]=new r.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,o){for(var h=this._state,l=this.blockSize/2,u=0;u<l;u++){var g=e[o+2*u],k=e[o+2*u+1];g=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360,k=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360;var C=h[u];C.high^=k,C.low^=g}for(var B=0;B<24;B++){for(var W=0;W<5;W++){for(var c=0,_=0,R=0;R<5;R++){var C=h[W+5*R];c^=C.high,_^=C.low}var A=n[W];A.high=c,A.low=_}for(var W=0;W<5;W++)for(var q=n[(W+4)%5],P=n[(W+1)%5],I=P.high,X=P.low,c=q.high^(I<<1|X>>>31),_=q.low^(X<<1|I>>>31),R=0;R<5;R++){var C=h[W+5*R];C.high^=c,C.low^=_}for(var T=1;T<25;T++){var C=h[T],N=C.high,K=C.low,H=p[T];if(H<32)var c=N<<H|K>>>32-H,_=K<<H|N>>>32-H;else var c=K<<H-32|N>>>64-H,_=N<<H-32|K>>>64-H;var z=n[x[T]];z.high=c,z.low=_}var E=n[0],S=h[0];E.high=S.high,E.low=S.low;for(var W=0;W<5;W++)for(var R=0;R<5;R++){var T=W+5*R,C=h[T],G=n[T],O=n[(W+1)%5+5*R],Z=n[(W+2)%5+5*R];C.high=G.high^~O.high&Z.high,C.low=G.low^~O.low&Z.low}var C=h[0],F=i[B];C.high^=F.high,C.low^=F.low}},_doFinalize:function(){var e=this._data,o=e.words;this._nDataBytes*8;var h=e.sigBytes*8,l=this.blockSize*32;o[h>>>5]|=1<<24-h%32,o[(a.ceil((h+1)/l)*l>>>5)-1]|=128,e.sigBytes=o.length*4,this._process();for(var u=this._state,g=this.cfg.outputLength/8,k=g/8,C=[],B=0;B<k;B++){var W=u[B],c=W.high,_=W.low;c=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,_=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,C.push(_),C.push(c)}return new m.init(C,g)},clone:function(){for(var e=v.clone.call(this),o=e._state=this._state.slice(0),h=0;h<25;h++)o[h]=o[h].clone();return e}});b.SHA3=v._createHelper(f),b.HmacSHA3=v._createHmacHelper(f)}(Math),s.SHA3})}(D0)),D0.exports}var q0={exports:{}},Sr;function Ce(){return Sr||(Sr=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){/** @preserve
|
|
1
|
+
import{D as le}from"./index-1e48b2db.js";import{d as U,b as pe}from"./index-9b8a6048.js";var Mr={exports:{}},C0={exports:{}},lr;function L(){return lr||(lr=1,function(w,D){(function(s,a){w.exports=a()})(U,function(){var s=s||function(a,b){var y=Object.create||function(){function e(){}return function(o){var h;return e.prototype=o,h=new e,e.prototype=null,h}}(),m={},v=m.lib={},d=v.Base=function(){return{extend:function(e){var o=y(this);return e&&o.mixIn(e),(!o.hasOwnProperty("init")||this.init===o.init)&&(o.init=function(){o.$super.init.apply(this,arguments)}),o.init.prototype=o,o.$super=this,o},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var o in e)e.hasOwnProperty(o)&&(this[o]=e[o]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),r=v.WordArray=d.extend({init:function(e,o){e=this.words=e||[],o!=b?this.sigBytes=o:this.sigBytes=e.length*4},toString:function(e){return(e||p).stringify(this)},concat:function(e){var o=this.words,h=e.words,l=this.sigBytes,u=e.sigBytes;if(this.clamp(),l%4)for(var g=0;g<u;g++){var k=h[g>>>2]>>>24-g%4*8&255;o[l+g>>>2]|=k<<24-(l+g)%4*8}else for(var g=0;g<u;g+=4)o[l+g>>>2]=h[g>>>2];return this.sigBytes+=u,this},clamp:function(){var e=this.words,o=this.sigBytes;e[o>>>2]&=4294967295<<32-o%4*8,e.length=a.ceil(o/4)},clone:function(){var e=d.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var o=[],h=function(C){var C=C,B=987654321,W=4294967295;return function(){B=36969*(B&65535)+(B>>16)&W,C=18e3*(C&65535)+(C>>16)&W;var c=(B<<16)+C&W;return c/=4294967296,c+=.5,c*(a.random()>.5?1:-1)}},l=0,u;l<e;l+=4){var g=h((u||a.random())*4294967296);u=g()*987654071,o.push(g()*4294967296|0)}return new r.init(o,e)}}),t=m.enc={},p=t.Hex={stringify:function(e){for(var o=e.words,h=e.sigBytes,l=[],u=0;u<h;u++){var g=o[u>>>2]>>>24-u%4*8&255;l.push((g>>>4).toString(16)),l.push((g&15).toString(16))}return l.join("")},parse:function(e){for(var o=e.length,h=[],l=0;l<o;l+=2)h[l>>>3]|=parseInt(e.substr(l,2),16)<<24-l%8*4;return new r.init(h,o/2)}},x=t.Latin1={stringify:function(e){for(var o=e.words,h=e.sigBytes,l=[],u=0;u<h;u++){var g=o[u>>>2]>>>24-u%4*8&255;l.push(String.fromCharCode(g))}return l.join("")},parse:function(e){for(var o=e.length,h=[],l=0;l<o;l++)h[l>>>2]|=(e.charCodeAt(l)&255)<<24-l%4*8;return new r.init(h,o)}},i=t.Utf8={stringify:function(e){try{return decodeURIComponent(escape(x.stringify(e)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(e){return x.parse(unescape(encodeURIComponent(e)))}},n=v.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(e){typeof e=="string"&&(e=i.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var o=this._data,h=o.words,l=o.sigBytes,u=this.blockSize,g=u*4,k=l/g;e?k=a.ceil(k):k=a.max((k|0)-this._minBufferSize,0);var C=k*u,B=a.min(C*4,l);if(C){for(var W=0;W<C;W+=u)this._doProcessBlock(h,W);var c=h.splice(0,C);o.sigBytes-=B}return new r.init(c,B)},clone:function(){var e=d.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});v.Hasher=n.extend({cfg:d.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){n.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){e&&this._append(e);var o=this._doFinalize();return o},blockSize:16,_createHelper:function(e){return function(o,h){return new e.init(h).finalize(o)}},_createHmacHelper:function(e){return function(o,h){return new f.HMAC.init(e,h).finalize(o)}}});var f=m.algo={};return m}(Math);return s})}(C0)),C0.exports}var k0={exports:{}},pr;function g0(){return pr||(pr=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(a){var b=s,y=b.lib,m=y.Base,v=y.WordArray,d=b.x64={};d.Word=m.extend({init:function(r,t){this.high=r,this.low=t}}),d.WordArray=m.extend({init:function(r,t){r=this.words=r||[],t!=a?this.sigBytes=t:this.sigBytes=r.length*8},toX32:function(){for(var r=this.words,t=r.length,p=[],x=0;x<t;x++){var i=r[x];p.push(i.high),p.push(i.low)}return v.create(p,this.sigBytes)},clone:function(){for(var r=m.clone.call(this),t=r.words=this.words.slice(0),p=t.length,x=0;x<p;x++)t[x]=t[x].clone();return r}})}(),s})}(k0)),k0.exports}var H0={exports:{}},_r;function _e(){return _r||(_r=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(){if(typeof ArrayBuffer=="function"){var a=s,b=a.lib,y=b.WordArray,m=y.init,v=y.init=function(d){if(d instanceof ArrayBuffer&&(d=new Uint8Array(d)),(d instanceof Int8Array||typeof Uint8ClampedArray<"u"&&d instanceof Uint8ClampedArray||d instanceof Int16Array||d instanceof Uint16Array||d instanceof Int32Array||d instanceof Uint32Array||d instanceof Float32Array||d instanceof Float64Array)&&(d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength)),d instanceof Uint8Array){for(var r=d.byteLength,t=[],p=0;p<r;p++)t[p>>>2]|=d[p]<<24-p%4*8;m.call(this,t,r)}else m.apply(this,arguments)};v.prototype=y}}(),s.lib.WordArray})}(H0)),H0.exports}var w0={exports:{}},br;function be(){return br||(br=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(){var a=s,b=a.lib,y=b.WordArray,m=a.enc;m.Utf16=m.Utf16BE={stringify:function(d){for(var r=d.words,t=d.sigBytes,p=[],x=0;x<t;x+=2){var i=r[x>>>2]>>>16-x%4*8&65535;p.push(String.fromCharCode(i))}return p.join("")},parse:function(d){for(var r=d.length,t=[],p=0;p<r;p++)t[p>>>1]|=d.charCodeAt(p)<<16-p%2*16;return y.create(t,r*2)}},m.Utf16LE={stringify:function(d){for(var r=d.words,t=d.sigBytes,p=[],x=0;x<t;x+=2){var i=v(r[x>>>2]>>>16-x%4*8&65535);p.push(String.fromCharCode(i))}return p.join("")},parse:function(d){for(var r=d.length,t=[],p=0;p<r;p++)t[p>>>1]|=v(d.charCodeAt(p)<<16-p%2*16);return y.create(t,r*2)}};function v(d){return d<<8&4278255360|d>>>8&16711935}}(),s.enc.Utf16})}(w0)),w0.exports}var m0={exports:{}},gr;function n0(){return gr||(gr=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(){var a=s,b=a.lib,y=b.WordArray,m=a.enc;m.Base64={stringify:function(d){var r=d.words,t=d.sigBytes,p=this._map;d.clamp();for(var x=[],i=0;i<t;i+=3)for(var n=r[i>>>2]>>>24-i%4*8&255,f=r[i+1>>>2]>>>24-(i+1)%4*8&255,e=r[i+2>>>2]>>>24-(i+2)%4*8&255,o=n<<16|f<<8|e,h=0;h<4&&i+h*.75<t;h++)x.push(p.charAt(o>>>6*(3-h)&63));var l=p.charAt(64);if(l)for(;x.length%4;)x.push(l);return x.join("")},parse:function(d){var r=d.length,t=this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var x=0;x<t.length;x++)p[t.charCodeAt(x)]=x}var i=t.charAt(64);if(i){var n=d.indexOf(i);n!==-1&&(r=n)}return v(d,r,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function v(d,r,t){for(var p=[],x=0,i=0;i<r;i++)if(i%4){var n=t[d.charCodeAt(i-1)]<<i%4*2,f=t[d.charCodeAt(i)]>>>6-i%4*2;p[x>>>2]|=(n|f)<<24-x%4*8,x++}return y.create(p,x)}}(),s.enc.Base64})}(m0)),m0.exports}var S0={exports:{}},yr;function i0(){return yr||(yr=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(a){var b=s,y=b.lib,m=y.WordArray,v=y.Hasher,d=b.algo,r=[];(function(){for(var f=0;f<64;f++)r[f]=a.abs(a.sin(f+1))*4294967296|0})();var t=d.MD5=v.extend({_doReset:function(){this._hash=new m.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(f,e){for(var o=0;o<16;o++){var h=e+o,l=f[h];f[h]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360}var u=this._hash.words,g=f[e+0],k=f[e+1],C=f[e+2],B=f[e+3],W=f[e+4],c=f[e+5],_=f[e+6],R=f[e+7],A=f[e+8],q=f[e+9],P=f[e+10],I=f[e+11],X=f[e+12],T=f[e+13],N=f[e+14],K=f[e+15],H=u[0],z=u[1],E=u[2],S=u[3];H=p(H,z,E,S,g,7,r[0]),S=p(S,H,z,E,k,12,r[1]),E=p(E,S,H,z,C,17,r[2]),z=p(z,E,S,H,B,22,r[3]),H=p(H,z,E,S,W,7,r[4]),S=p(S,H,z,E,c,12,r[5]),E=p(E,S,H,z,_,17,r[6]),z=p(z,E,S,H,R,22,r[7]),H=p(H,z,E,S,A,7,r[8]),S=p(S,H,z,E,q,12,r[9]),E=p(E,S,H,z,P,17,r[10]),z=p(z,E,S,H,I,22,r[11]),H=p(H,z,E,S,X,7,r[12]),S=p(S,H,z,E,T,12,r[13]),E=p(E,S,H,z,N,17,r[14]),z=p(z,E,S,H,K,22,r[15]),H=x(H,z,E,S,k,5,r[16]),S=x(S,H,z,E,_,9,r[17]),E=x(E,S,H,z,I,14,r[18]),z=x(z,E,S,H,g,20,r[19]),H=x(H,z,E,S,c,5,r[20]),S=x(S,H,z,E,P,9,r[21]),E=x(E,S,H,z,K,14,r[22]),z=x(z,E,S,H,W,20,r[23]),H=x(H,z,E,S,q,5,r[24]),S=x(S,H,z,E,N,9,r[25]),E=x(E,S,H,z,B,14,r[26]),z=x(z,E,S,H,A,20,r[27]),H=x(H,z,E,S,T,5,r[28]),S=x(S,H,z,E,C,9,r[29]),E=x(E,S,H,z,R,14,r[30]),z=x(z,E,S,H,X,20,r[31]),H=i(H,z,E,S,c,4,r[32]),S=i(S,H,z,E,A,11,r[33]),E=i(E,S,H,z,I,16,r[34]),z=i(z,E,S,H,N,23,r[35]),H=i(H,z,E,S,k,4,r[36]),S=i(S,H,z,E,W,11,r[37]),E=i(E,S,H,z,R,16,r[38]),z=i(z,E,S,H,P,23,r[39]),H=i(H,z,E,S,T,4,r[40]),S=i(S,H,z,E,g,11,r[41]),E=i(E,S,H,z,B,16,r[42]),z=i(z,E,S,H,_,23,r[43]),H=i(H,z,E,S,q,4,r[44]),S=i(S,H,z,E,X,11,r[45]),E=i(E,S,H,z,K,16,r[46]),z=i(z,E,S,H,C,23,r[47]),H=n(H,z,E,S,g,6,r[48]),S=n(S,H,z,E,R,10,r[49]),E=n(E,S,H,z,N,15,r[50]),z=n(z,E,S,H,c,21,r[51]),H=n(H,z,E,S,X,6,r[52]),S=n(S,H,z,E,B,10,r[53]),E=n(E,S,H,z,P,15,r[54]),z=n(z,E,S,H,k,21,r[55]),H=n(H,z,E,S,A,6,r[56]),S=n(S,H,z,E,K,10,r[57]),E=n(E,S,H,z,_,15,r[58]),z=n(z,E,S,H,T,21,r[59]),H=n(H,z,E,S,W,6,r[60]),S=n(S,H,z,E,I,10,r[61]),E=n(E,S,H,z,C,15,r[62]),z=n(z,E,S,H,q,21,r[63]),u[0]=u[0]+H|0,u[1]=u[1]+z|0,u[2]=u[2]+E|0,u[3]=u[3]+S|0},_doFinalize:function(){var f=this._data,e=f.words,o=this._nDataBytes*8,h=f.sigBytes*8;e[h>>>5]|=128<<24-h%32;var l=a.floor(o/4294967296),u=o;e[(h+64>>>9<<4)+15]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,e[(h+64>>>9<<4)+14]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360,f.sigBytes=(e.length+1)*4,this._process();for(var g=this._hash,k=g.words,C=0;C<4;C++){var B=k[C];k[C]=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360}return g},clone:function(){var f=v.clone.call(this);return f._hash=this._hash.clone(),f}});function p(f,e,o,h,l,u,g){var k=f+(e&o|~e&h)+l+g;return(k<<u|k>>>32-u)+e}function x(f,e,o,h,l,u,g){var k=f+(e&h|o&~h)+l+g;return(k<<u|k>>>32-u)+e}function i(f,e,o,h,l,u,g){var k=f+(e^o^h)+l+g;return(k<<u|k>>>32-u)+e}function n(f,e,o,h,l,u,g){var k=f+(o^(e|~h))+l+g;return(k<<u|k>>>32-u)+e}b.MD5=v._createHelper(t),b.HmacMD5=v._createHmacHelper(t)}(Math),s.MD5})}(S0)),S0.exports}var R0={exports:{}},Br;function er(){return Br||(Br=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(){var a=s,b=a.lib,y=b.WordArray,m=b.Hasher,v=a.algo,d=[],r=v.SHA1=m.extend({_doReset:function(){this._hash=new y.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,p){for(var x=this._hash.words,i=x[0],n=x[1],f=x[2],e=x[3],o=x[4],h=0;h<80;h++){if(h<16)d[h]=t[p+h]|0;else{var l=d[h-3]^d[h-8]^d[h-14]^d[h-16];d[h]=l<<1|l>>>31}var u=(i<<5|i>>>27)+o+d[h];h<20?u+=(n&f|~n&e)+1518500249:h<40?u+=(n^f^e)+1859775393:h<60?u+=(n&f|n&e|f&e)-1894007588:u+=(n^f^e)-899497514,o=e,e=f,f=n<<30|n>>>2,n=i,i=u}x[0]=x[0]+i|0,x[1]=x[1]+n|0,x[2]=x[2]+f|0,x[3]=x[3]+e|0,x[4]=x[4]+o|0},_doFinalize:function(){var t=this._data,p=t.words,x=this._nDataBytes*8,i=t.sigBytes*8;return p[i>>>5]|=128<<24-i%32,p[(i+64>>>9<<4)+14]=Math.floor(x/4294967296),p[(i+64>>>9<<4)+15]=x,t.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var t=m.clone.call(this);return t._hash=this._hash.clone(),t}});a.SHA1=m._createHelper(r),a.HmacSHA1=m._createHmacHelper(r)}(),s.SHA1})}(R0)),R0.exports}var A0={exports:{}},Cr;function Vr(){return Cr||(Cr=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){return function(a){var b=s,y=b.lib,m=y.WordArray,v=y.Hasher,d=b.algo,r=[],t=[];(function(){function i(o){for(var h=a.sqrt(o),l=2;l<=h;l++)if(!(o%l))return!1;return!0}function n(o){return(o-(o|0))*4294967296|0}for(var f=2,e=0;e<64;)i(f)&&(e<8&&(r[e]=n(a.pow(f,1/2))),t[e]=n(a.pow(f,1/3)),e++),f++})();var p=[],x=d.SHA256=v.extend({_doReset:function(){this._hash=new m.init(r.slice(0))},_doProcessBlock:function(i,n){for(var f=this._hash.words,e=f[0],o=f[1],h=f[2],l=f[3],u=f[4],g=f[5],k=f[6],C=f[7],B=0;B<64;B++){if(B<16)p[B]=i[n+B]|0;else{var W=p[B-15],c=(W<<25|W>>>7)^(W<<14|W>>>18)^W>>>3,_=p[B-2],R=(_<<15|_>>>17)^(_<<13|_>>>19)^_>>>10;p[B]=c+p[B-7]+R+p[B-16]}var A=u&g^~u&k,q=e&o^e&h^o&h,P=(e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22),I=(u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25),X=C+I+A+t[B]+p[B],T=P+q;C=k,k=g,g=u,u=l+X|0,l=h,h=o,o=e,e=X+T|0}f[0]=f[0]+e|0,f[1]=f[1]+o|0,f[2]=f[2]+h|0,f[3]=f[3]+l|0,f[4]=f[4]+u|0,f[5]=f[5]+g|0,f[6]=f[6]+k|0,f[7]=f[7]+C|0},_doFinalize:function(){var i=this._data,n=i.words,f=this._nDataBytes*8,e=i.sigBytes*8;return n[e>>>5]|=128<<24-e%32,n[(e+64>>>9<<4)+14]=a.floor(f/4294967296),n[(e+64>>>9<<4)+15]=f,i.sigBytes=n.length*4,this._process(),this._hash},clone:function(){var i=v.clone.call(this);return i._hash=this._hash.clone(),i}});b.SHA256=v._createHelper(x),b.HmacSHA256=v._createHmacHelper(x)}(Math),s.SHA256})}(A0)),A0.exports}var z0={exports:{}},kr;function ge(){return kr||(kr=1,function(w,D){(function(s,a,b){w.exports=a(L(),Vr())})(U,function(s){return function(){var a=s,b=a.lib,y=b.WordArray,m=a.algo,v=m.SHA256,d=m.SHA224=v.extend({_doReset:function(){this._hash=new y.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var r=v._doFinalize.call(this);return r.sigBytes-=4,r}});a.SHA224=v._createHelper(d),a.HmacSHA224=v._createHmacHelper(d)}(),s.SHA224})}(z0)),z0.exports}var E0={exports:{}},Hr;function Jr(){return Hr||(Hr=1,function(w,D){(function(s,a,b){w.exports=a(L(),g0())})(U,function(s){return function(){var a=s,b=a.lib,y=b.Hasher,m=a.x64,v=m.Word,d=m.WordArray,r=a.algo;function t(){return v.create.apply(v,arguments)}var p=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],x=[];(function(){for(var n=0;n<80;n++)x[n]=t()})();var i=r.SHA512=y.extend({_doReset:function(){this._hash=new d.init([new v.init(1779033703,4089235720),new v.init(3144134277,2227873595),new v.init(1013904242,4271175723),new v.init(2773480762,1595750129),new v.init(1359893119,2917565137),new v.init(2600822924,725511199),new v.init(528734635,4215389547),new v.init(1541459225,327033209)])},_doProcessBlock:function(n,f){for(var e=this._hash.words,o=e[0],h=e[1],l=e[2],u=e[3],g=e[4],k=e[5],C=e[6],B=e[7],W=o.high,c=o.low,_=h.high,R=h.low,A=l.high,q=l.low,P=u.high,I=u.low,X=g.high,T=g.low,N=k.high,K=k.low,H=C.high,z=C.low,E=B.high,S=B.low,G=W,O=c,Z=_,F=R,o0=A,t0=q,y0=P,f0=I,Y=X,j=T,l0=N,s0=K,p0=H,c0=z,B0=E,v0=S,M=0;M<80;M++){var _0=x[M];if(M<16)var r0=_0.high=n[f+M*2]|0,V=_0.low=n[f+M*2+1]|0;else{var ar=x[M-15],a0=ar.high,u0=ar.low,te=(a0>>>1|u0<<31)^(a0>>>8|u0<<24)^a0>>>7,xr=(u0>>>1|a0<<31)^(u0>>>8|a0<<24)^(u0>>>7|a0<<25),nr=x[M-2],x0=nr.high,d0=nr.low,ae=(x0>>>19|d0<<13)^(x0<<3|d0>>>29)^x0>>>6,ir=(d0>>>19|x0<<13)^(d0<<3|x0>>>29)^(d0>>>6|x0<<26),or=x[M-7],xe=or.high,ne=or.low,fr=x[M-16],ie=fr.high,sr=fr.low,V=xr+ne,r0=te+xe+(V>>>0<xr>>>0?1:0),V=V+ir,r0=r0+ae+(V>>>0<ir>>>0?1:0),V=V+sr,r0=r0+ie+(V>>>0<sr>>>0?1:0);_0.high=r0,_0.low=V}var oe=Y&l0^~Y&p0,cr=j&s0^~j&c0,fe=G&Z^G&o0^Z&o0,se=O&F^O&t0^F&t0,ce=(G>>>28|O<<4)^(G<<30|O>>>2)^(G<<25|O>>>7),vr=(O>>>28|G<<4)^(O<<30|G>>>2)^(O<<25|G>>>7),ve=(Y>>>14|j<<18)^(Y>>>18|j<<14)^(Y<<23|j>>>9),ue=(j>>>14|Y<<18)^(j>>>18|Y<<14)^(j<<23|Y>>>9),ur=p[M],de=ur.high,dr=ur.low,Q=v0+ue,J=B0+ve+(Q>>>0<v0>>>0?1:0),Q=Q+cr,J=J+oe+(Q>>>0<cr>>>0?1:0),Q=Q+dr,J=J+de+(Q>>>0<dr>>>0?1:0),Q=Q+V,J=J+r0+(Q>>>0<V>>>0?1:0),hr=vr+se,he=ce+fe+(hr>>>0<vr>>>0?1:0);B0=p0,v0=c0,p0=l0,c0=s0,l0=Y,s0=j,j=f0+Q|0,Y=y0+J+(j>>>0<f0>>>0?1:0)|0,y0=o0,f0=t0,o0=Z,t0=F,Z=G,F=O,O=Q+hr|0,G=J+he+(O>>>0<Q>>>0?1:0)|0}c=o.low=c+O,o.high=W+G+(c>>>0<O>>>0?1:0),R=h.low=R+F,h.high=_+Z+(R>>>0<F>>>0?1:0),q=l.low=q+t0,l.high=A+o0+(q>>>0<t0>>>0?1:0),I=u.low=I+f0,u.high=P+y0+(I>>>0<f0>>>0?1:0),T=g.low=T+j,g.high=X+Y+(T>>>0<j>>>0?1:0),K=k.low=K+s0,k.high=N+l0+(K>>>0<s0>>>0?1:0),z=C.low=z+c0,C.high=H+p0+(z>>>0<c0>>>0?1:0),S=B.low=S+v0,B.high=E+B0+(S>>>0<v0>>>0?1:0)},_doFinalize:function(){var n=this._data,f=n.words,e=this._nDataBytes*8,o=n.sigBytes*8;f[o>>>5]|=128<<24-o%32,f[(o+128>>>10<<5)+30]=Math.floor(e/4294967296),f[(o+128>>>10<<5)+31]=e,n.sigBytes=f.length*4,this._process();var h=this._hash.toX32();return h},clone:function(){var n=y.clone.call(this);return n._hash=this._hash.clone(),n},blockSize:1024/32});a.SHA512=y._createHelper(i),a.HmacSHA512=y._createHmacHelper(i)}(),s.SHA512})}(E0)),E0.exports}var W0={exports:{}},wr;function ye(){return wr||(wr=1,function(w,D){(function(s,a,b){w.exports=a(L(),g0(),Jr())})(U,function(s){return function(){var a=s,b=a.x64,y=b.Word,m=b.WordArray,v=a.algo,d=v.SHA512,r=v.SHA384=d.extend({_doReset:function(){this._hash=new m.init([new y.init(3418070365,3238371032),new y.init(1654270250,914150663),new y.init(2438529370,812702999),new y.init(355462360,4144912697),new y.init(1731405415,4290775857),new y.init(2394180231,1750603025),new y.init(3675008525,1694076839),new y.init(1203062813,3204075428)])},_doFinalize:function(){var t=d._doFinalize.call(this);return t.sigBytes-=16,t}});a.SHA384=d._createHelper(r),a.HmacSHA384=d._createHmacHelper(r)}(),s.SHA384})}(W0)),W0.exports}var D0={exports:{}},mr;function Be(){return mr||(mr=1,function(w,D){(function(s,a,b){w.exports=a(L(),g0())})(U,function(s){return function(a){var b=s,y=b.lib,m=y.WordArray,v=y.Hasher,d=b.x64,r=d.Word,t=b.algo,p=[],x=[],i=[];(function(){for(var e=1,o=0,h=0;h<24;h++){p[e+5*o]=(h+1)*(h+2)/2%64;var l=o%5,u=(2*e+3*o)%5;e=l,o=u}for(var e=0;e<5;e++)for(var o=0;o<5;o++)x[e+5*o]=o+(2*e+3*o)%5*5;for(var g=1,k=0;k<24;k++){for(var C=0,B=0,W=0;W<7;W++){if(g&1){var c=(1<<W)-1;c<32?B^=1<<c:C^=1<<c-32}g&128?g=g<<1^113:g<<=1}i[k]=r.create(C,B)}})();var n=[];(function(){for(var e=0;e<25;e++)n[e]=r.create()})();var f=t.SHA3=v.extend({cfg:v.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],o=0;o<25;o++)e[o]=new r.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,o){for(var h=this._state,l=this.blockSize/2,u=0;u<l;u++){var g=e[o+2*u],k=e[o+2*u+1];g=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360,k=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360;var C=h[u];C.high^=k,C.low^=g}for(var B=0;B<24;B++){for(var W=0;W<5;W++){for(var c=0,_=0,R=0;R<5;R++){var C=h[W+5*R];c^=C.high,_^=C.low}var A=n[W];A.high=c,A.low=_}for(var W=0;W<5;W++)for(var q=n[(W+4)%5],P=n[(W+1)%5],I=P.high,X=P.low,c=q.high^(I<<1|X>>>31),_=q.low^(X<<1|I>>>31),R=0;R<5;R++){var C=h[W+5*R];C.high^=c,C.low^=_}for(var T=1;T<25;T++){var C=h[T],N=C.high,K=C.low,H=p[T];if(H<32)var c=N<<H|K>>>32-H,_=K<<H|N>>>32-H;else var c=K<<H-32|N>>>64-H,_=N<<H-32|K>>>64-H;var z=n[x[T]];z.high=c,z.low=_}var E=n[0],S=h[0];E.high=S.high,E.low=S.low;for(var W=0;W<5;W++)for(var R=0;R<5;R++){var T=W+5*R,C=h[T],G=n[T],O=n[(W+1)%5+5*R],Z=n[(W+2)%5+5*R];C.high=G.high^~O.high&Z.high,C.low=G.low^~O.low&Z.low}var C=h[0],F=i[B];C.high^=F.high,C.low^=F.low}},_doFinalize:function(){var e=this._data,o=e.words;this._nDataBytes*8;var h=e.sigBytes*8,l=this.blockSize*32;o[h>>>5]|=1<<24-h%32,o[(a.ceil((h+1)/l)*l>>>5)-1]|=128,e.sigBytes=o.length*4,this._process();for(var u=this._state,g=this.cfg.outputLength/8,k=g/8,C=[],B=0;B<k;B++){var W=u[B],c=W.high,_=W.low;c=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,_=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,C.push(_),C.push(c)}return new m.init(C,g)},clone:function(){for(var e=v.clone.call(this),o=e._state=this._state.slice(0),h=0;h<25;h++)o[h]=o[h].clone();return e}});b.SHA3=v._createHelper(f),b.HmacSHA3=v._createHmacHelper(f)}(Math),s.SHA3})}(D0)),D0.exports}var q0={exports:{}},Sr;function Ce(){return Sr||(Sr=1,function(w,D){(function(s,a){w.exports=a(L())})(U,function(s){/** @preserve
|
|
2
2
|
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
3
3
|
|
|
4
4
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as ri,g as S1,c as X3,r as Z3,a as Ie,B as ua,e as Di,b as Bl,d as Xi,W as Ll,o as hd,_ as t6}from"./index-
|
|
1
|
+
import{p as ri,g as S1,c as X3,r as Z3,a as Ie,B as ua,e as Di,b as Bl,d as Xi,W as Ll,o as hd,_ as t6}from"./index-9b8a6048.js";var ld=globalThis&&globalThis.__spreadArray||function(r,t,e){if(e||arguments.length===2)for(var i=0,s=t.length,a;i<s;i++)(a||!(i in t))&&(a||(a=Array.prototype.slice.call(t,0,i)),a[i]=t[i]);return r.concat(a||Array.prototype.slice.call(t))},e6=function(){function r(t,e,i){this.name=t,this.version=e,this.os=i,this.type="browser"}return r}(),r6=function(){function r(t){this.version=t,this.type="node",this.name="node",this.os=ri.platform}return r}(),i6=function(){function r(t,e,i,s){this.name=t,this.version=e,this.os=i,this.bot=s,this.type="bot-device"}return r}(),n6=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),s6=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),o6=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,a6=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,fd=3,c6=[["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",o6]],dd=[["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 u6(r){return r?pd(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new s6:typeof navigator<"u"?pd(navigator.userAgent):f6()}function h6(r){return r!==""&&c6.reduce(function(t,e){var i=e[0],s=e[1];if(t)return t;var a=s.exec(r);return!!a&&[i,a]},!1)}function pd(r){var t=h6(r);if(!t)return null;var e=t[0],i=t[1];if(e==="searchbot")return new n6;var s=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);s?s.length<fd&&(s=ld(ld([],s,!0),d6(fd-s.length),!0)):s=[];var a=s.join("."),u=l6(r),l=a6.exec(r);return l&&l[1]?new i6(e,a,u,l[1]):new e6(e,a,u)}function l6(r){for(var t=0,e=dd.length;t<e;t++){var i=dd[t],s=i[0],a=i[1],u=a.exec(r);if(u)return s}return null}function f6(){var r=typeof ri<"u"&&ri.version;return r?new r6(ri.version.slice(1)):null}function d6(r){for(var t=[],e=0;e<r;e++)t.push("0");return t}var bt={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -53,4 +53,4 @@ __p += '`),be&&(dt+=`' +
|
|
|
53
53
|
function print() { __p += __j.call(arguments, '') }
|
|
54
54
|
`:`;
|
|
55
55
|
`)+dt+`return __p
|
|
56
|
-
}`;var ue=ad(function(){return Se(O,Ft+"return "+dt).apply(e,H)});if(ue.source=dt,vh(ue))throw ue;return ue}function s3(n){return Me(n).toLowerCase()}function o3(n){return Me(n).toUpperCase()}function a3(n,o,c){if(n=Me(n),n&&(c||o===e))return mf(n);if(!n||!(o=Qr(o)))return n;var m=Ci(n),A=Ci(o),O=vf(m,A),H=yf(m,A)+1;return jn(m,O,H).join("")}function c3(n,o,c){if(n=Me(n),n&&(c||o===e))return n.slice(0,bf(n)+1);if(!n||!(o=Qr(o)))return n;var m=Ci(n),A=yf(m,Ci(o))+1;return jn(m,0,A).join("")}function u3(n,o,c){if(n=Me(n),n&&(c||o===e))return n.replace(Yt,"");if(!n||!(o=Qr(o)))return n;var m=Ci(n),A=vf(m,Ci(o));return jn(m,A).join("")}function h3(n,o){var c=ft,m=pt;if(Ge(o)){var A="separator"in o?o.separator:A;c="length"in o?ae(o.length):c,m="omission"in o?Qr(o.omission):m}n=Me(n);var O=n.length;if(Ls(n)){var H=Ci(n);O=H.length}if(c>=O)return n;var W=c-qs(m);if(W<1)return m;var X=H?jn(H,0,W).join(""):n.slice(0,W);if(A===e)return X+m;if(H&&(W+=X.length-W),yh(A)){if(n.slice(W).search(A)){var ot,ct=X;for(A.global||(A=Tu(A.source,Me(le.exec(A))+"g")),A.lastIndex=0;ot=A.exec(ct);)var dt=ot.index;X=X.slice(0,dt===e?W:dt)}}else if(n.indexOf(Qr(A),W)!=W){var vt=X.lastIndexOf(A);vt>-1&&(X=X.slice(0,vt))}return X+m}function l3(n){return n=Me(n),n&&Gt.test(n)?n.replace(_e,jm):n}var f3=Vs(function(n,o,c){return n+(c?" ":"")+o.toUpperCase()}),_h=c0("toUpperCase");function od(n,o,c){return n=Me(n),o=c?e:o,o===e?Fm(n)?km(n):Dm(n):n.match(o)||[]}var ad=he(function(n,o){try{return cr(n,e,o)}catch(c){return vh(c)?c:new ee(c)}}),d3=gn(function(n,o){return fi(o,function(c){c=Vi(c),dn(n,c,gh(n[c],n))}),n});function p3(n){var o=n==null?0:n.length,c=jt();return n=o?ke(n,function(m){if(typeof m[1]!="function")throw new di(u);return[c(m[0]),m[1]]}):[],he(function(m){for(var A=-1;++A<o;){var O=n[A];if(cr(O[0],this,m))return cr(O[1],this,m)}})}function g3(n){return jv(gi(n,E))}function Eh(n){return function(){return n}}function m3(n,o){return n==null||n!==n?o:n}var v3=h0(),y3=h0(!0);function qr(n){return n}function Ah(n){return jf(typeof n=="function"?n:gi(n,E))}function w3(n){return zf(gi(n,E))}function b3(n,o){return kf(n,gi(o,E))}var _3=he(function(n,o){return function(c){return Ro(c,n,o)}}),E3=he(function(n,o){return function(c){return Ro(n,c,o)}});function Sh(n,o,c){var m=ur(o),A=nc(o,m);c==null&&!(Ge(o)&&(A.length||!m.length))&&(c=o,o=n,n=this,A=nc(o,ur(o)));var O=!(Ge(c)&&"chain"in c)||!!c.chain,H=vn(n);return fi(A,function(W){var X=o[W];n[W]=X,H&&(n.prototype[W]=function(){var ot=this.__chain__;if(O||ot){var ct=n(this.__wrapped__),dt=ct.__actions__=Ur(this.__actions__);return dt.push({func:X,args:arguments,thisArg:n}),ct.__chain__=ot,ct}return X.apply(n,Tn([this.value()],arguments))})}),n}function A3(){return we._===this&&(we._=Ym),this}function Ih(){}function S3(n){return n=ae(n),he(function(o){return Hf(o,n)})}var I3=rh(ke),D3=rh(lf),x3=rh(xu);function cd(n){return uh(n)?Mu(Vi(n)):iy(n)}function M3(n){return function(o){return n==null?e:ps(n,o)}}var C3=f0(),P3=f0(!0);function Dh(){return[]}function xh(){return!1}function O3(){return{}}function N3(){return""}function R3(){return!0}function T3(n,o){if(n=ae(n),n<1||n>R)return[];var c=g,m=yr(n,g);o=jt(o),n-=g;for(var A=Ou(m,o);++c<n;)o(c);return A}function F3(n){return ie(n)?ke(n,Vi):Jr(n)?[n]:Ur(M0(Me(n)))}function U3(n){var o=++Gm;return Me(n)+o}var B3=hc(function(n,o){return n+o},0),L3=ih("ceil"),q3=hc(function(n,o){return n/o},1),j3=ih("floor");function $3(n){return n&&n.length?ic(n,qr,zu):e}function z3(n,o){return n&&n.length?ic(n,jt(o,2),zu):e}function k3(n){return pf(n,qr)}function H3(n,o){return pf(n,jt(o,2))}function K3(n){return n&&n.length?ic(n,qr,Vu):e}function V3(n,o){return n&&n.length?ic(n,jt(o,2),Vu):e}var G3=hc(function(n,o){return n*o},1),W3=ih("round"),Y3=hc(function(n,o){return n-o},0);function Q3(n){return n&&n.length?Pu(n,qr):0}function J3(n,o){return n&&n.length?Pu(n,jt(o,2)):0}return x.after=wb,x.ary=q0,x.assign=o2,x.assignIn=Z0,x.assignInWith=Ac,x.assignWith=a2,x.at=c2,x.before=j0,x.bind=gh,x.bindAll=d3,x.bindKey=$0,x.castArray=Ob,x.chain=U0,x.chunk=jy,x.compact=$y,x.concat=zy,x.cond=p3,x.conforms=g3,x.constant=Eh,x.countBy=Qw,x.create=u2,x.curry=z0,x.curryRight=k0,x.debounce=H0,x.defaults=h2,x.defaultsDeep=l2,x.defer=bb,x.delay=_b,x.difference=ky,x.differenceBy=Hy,x.differenceWith=Ky,x.drop=Vy,x.dropRight=Gy,x.dropRightWhile=Wy,x.dropWhile=Yy,x.fill=Qy,x.filter=Xw,x.flatMap=eb,x.flatMapDeep=rb,x.flatMapDepth=ib,x.flatten=N0,x.flattenDeep=Jy,x.flattenDepth=Xy,x.flip=Eb,x.flow=v3,x.flowRight=y3,x.fromPairs=Zy,x.functions=y2,x.functionsIn=w2,x.groupBy=nb,x.initial=ew,x.intersection=rw,x.intersectionBy=iw,x.intersectionWith=nw,x.invert=_2,x.invertBy=E2,x.invokeMap=ob,x.iteratee=Ah,x.keyBy=ab,x.keys=ur,x.keysIn=Lr,x.map=vc,x.mapKeys=S2,x.mapValues=I2,x.matches=w3,x.matchesProperty=b3,x.memoize=wc,x.merge=D2,x.mergeWith=td,x.method=_3,x.methodOf=E3,x.mixin=Sh,x.negate=bc,x.nthArg=S3,x.omit=x2,x.omitBy=M2,x.once=Ab,x.orderBy=cb,x.over=I3,x.overArgs=Sb,x.overEvery=D3,x.overSome=x3,x.partial=mh,x.partialRight=K0,x.partition=ub,x.pick=C2,x.pickBy=ed,x.property=cd,x.propertyOf=M3,x.pull=cw,x.pullAll=T0,x.pullAllBy=uw,x.pullAllWith=hw,x.pullAt=lw,x.range=C3,x.rangeRight=P3,x.rearg=Ib,x.reject=fb,x.remove=fw,x.rest=Db,x.reverse=dh,x.sampleSize=pb,x.set=O2,x.setWith=N2,x.shuffle=gb,x.slice=dw,x.sortBy=yb,x.sortedUniq=bw,x.sortedUniqBy=_w,x.split=e3,x.spread=xb,x.tail=Ew,x.take=Aw,x.takeRight=Sw,x.takeRightWhile=Iw,x.takeWhile=Dw,x.tap=$w,x.throttle=Mb,x.thru=mc,x.toArray=Q0,x.toPairs=rd,x.toPairsIn=id,x.toPath=F3,x.toPlainObject=X0,x.transform=R2,x.unary=Cb,x.union=xw,x.unionBy=Mw,x.unionWith=Cw,x.uniq=Pw,x.uniqBy=Ow,x.uniqWith=Nw,x.unset=T2,x.unzip=ph,x.unzipWith=F0,x.update=F2,x.updateWith=U2,x.values=Ys,x.valuesIn=B2,x.without=Rw,x.words=od,x.wrap=Pb,x.xor=Tw,x.xorBy=Fw,x.xorWith=Uw,x.zip=Bw,x.zipObject=Lw,x.zipObjectDeep=qw,x.zipWith=jw,x.entries=rd,x.entriesIn=id,x.extend=Z0,x.extendWith=Ac,Sh(x,x),x.add=B3,x.attempt=ad,x.camelCase=$2,x.capitalize=nd,x.ceil=L3,x.clamp=L2,x.clone=Nb,x.cloneDeep=Tb,x.cloneDeepWith=Fb,x.cloneWith=Rb,x.conformsTo=Ub,x.deburr=sd,x.defaultTo=m3,x.divide=q3,x.endsWith=z2,x.eq=Oi,x.escape=k2,x.escapeRegExp=H2,x.every=Jw,x.find=Zw,x.findIndex=P0,x.findKey=f2,x.findLast=tb,x.findLastIndex=O0,x.findLastKey=d2,x.floor=j3,x.forEach=B0,x.forEachRight=L0,x.forIn=p2,x.forInRight=g2,x.forOwn=m2,x.forOwnRight=v2,x.get=wh,x.gt=Bb,x.gte=Lb,x.has=b2,x.hasIn=bh,x.head=R0,x.identity=qr,x.includes=sb,x.indexOf=tw,x.inRange=q2,x.invoke=A2,x.isArguments=vs,x.isArray=ie,x.isArrayBuffer=qb,x.isArrayLike=Br,x.isArrayLikeObject=Je,x.isBoolean=jb,x.isBuffer=$n,x.isDate=$b,x.isElement=zb,x.isEmpty=kb,x.isEqual=Hb,x.isEqualWith=Kb,x.isError=vh,x.isFinite=Vb,x.isFunction=vn,x.isInteger=V0,x.isLength=_c,x.isMap=G0,x.isMatch=Gb,x.isMatchWith=Wb,x.isNaN=Yb,x.isNative=Qb,x.isNil=Xb,x.isNull=Jb,x.isNumber=W0,x.isObject=Ge,x.isObjectLike=We,x.isPlainObject=qo,x.isRegExp=yh,x.isSafeInteger=Zb,x.isSet=Y0,x.isString=Ec,x.isSymbol=Jr,x.isTypedArray=Ws,x.isUndefined=t2,x.isWeakMap=e2,x.isWeakSet=r2,x.join=sw,x.kebabCase=K2,x.last=vi,x.lastIndexOf=ow,x.lowerCase=V2,x.lowerFirst=G2,x.lt=i2,x.lte=n2,x.max=$3,x.maxBy=z3,x.mean=k3,x.meanBy=H3,x.min=K3,x.minBy=V3,x.stubArray=Dh,x.stubFalse=xh,x.stubObject=O3,x.stubString=N3,x.stubTrue=R3,x.multiply=G3,x.nth=aw,x.noConflict=A3,x.noop=Ih,x.now=yc,x.pad=W2,x.padEnd=Y2,x.padStart=Q2,x.parseInt=J2,x.random=j2,x.reduce=hb,x.reduceRight=lb,x.repeat=X2,x.replace=Z2,x.result=P2,x.round=W3,x.runInContext=J,x.sample=db,x.size=mb,x.snakeCase=t3,x.some=vb,x.sortedIndex=pw,x.sortedIndexBy=gw,x.sortedIndexOf=mw,x.sortedLastIndex=vw,x.sortedLastIndexBy=yw,x.sortedLastIndexOf=ww,x.startCase=r3,x.startsWith=i3,x.subtract=Y3,x.sum=Q3,x.sumBy=J3,x.template=n3,x.times=T3,x.toFinite=yn,x.toInteger=ae,x.toLength=J0,x.toLower=s3,x.toNumber=yi,x.toSafeInteger=s2,x.toString=Me,x.toUpper=o3,x.trim=a3,x.trimEnd=c3,x.trimStart=u3,x.truncate=h3,x.unescape=l3,x.uniqueId=U3,x.upperCase=f3,x.upperFirst=_h,x.each=B0,x.eachRight=L0,x.first=R0,Sh(x,function(){var n={};return Hi(x,function(o,c){Ne.call(x.prototype,c)||(n[c]=o)}),n}(),{chain:!1}),x.VERSION=i,fi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){x[n].placeholder=x}),fi(["drop","take"],function(n,o){ge.prototype[n]=function(c){c=c===e?1:nr(ae(c),0);var m=this.__filtered__&&!o?new ge(this):this.clone();return m.__filtered__?m.__takeCount__=yr(c,m.__takeCount__):m.__views__.push({size:yr(c,g),type:n+(m.__dir__<0?"Right":"")}),m},ge.prototype[n+"Right"]=function(c){return this.reverse()[n](c).reverse()}}),fi(["filter","map","takeWhile"],function(n,o){var c=o+1,m=c==y||c==M;ge.prototype[n]=function(A){var O=this.clone();return O.__iteratees__.push({iteratee:jt(A,3),type:c}),O.__filtered__=O.__filtered__||m,O}}),fi(["head","last"],function(n,o){var c="take"+(o?"Right":"");ge.prototype[n]=function(){return this[c](1).value()[0]}}),fi(["initial","tail"],function(n,o){var c="drop"+(o?"":"Right");ge.prototype[n]=function(){return this.__filtered__?new ge(this):this[c](1)}}),ge.prototype.compact=function(){return this.filter(qr)},ge.prototype.find=function(n){return this.filter(n).head()},ge.prototype.findLast=function(n){return this.reverse().find(n)},ge.prototype.invokeMap=he(function(n,o){return typeof n=="function"?new ge(this):this.map(function(c){return Ro(c,n,o)})}),ge.prototype.reject=function(n){return this.filter(bc(jt(n)))},ge.prototype.slice=function(n,o){n=ae(n);var c=this;return c.__filtered__&&(n>0||o<0)?new ge(c):(n<0?c=c.takeRight(-n):n&&(c=c.drop(n)),o!==e&&(o=ae(o),c=o<0?c.dropRight(-o):c.take(o-n)),c)},ge.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},ge.prototype.toArray=function(){return this.take(g)},Hi(ge.prototype,function(n,o){var c=/^(?:filter|find|map|reject)|While$/.test(o),m=/^(?:head|last)$/.test(o),A=x[m?"take"+(o=="last"?"Right":""):o],O=m||/^find/.test(o);A&&(x.prototype[o]=function(){var H=this.__wrapped__,W=m?[1]:arguments,X=H instanceof ge,ot=W[0],ct=X||ie(H),dt=function(fe){var be=A.apply(x,Tn([fe],W));return m&&vt?be[0]:be};ct&&c&&typeof ot=="function"&&ot.length!=1&&(X=ct=!1);var vt=this.__chain__,Ft=!!this.__actions__.length,kt=O&&!vt,ue=X&&!Ft;if(!O&&ct){H=ue?H:new ge(this);var Ht=n.apply(H,W);return Ht.__actions__.push({func:mc,args:[dt],thisArg:e}),new pi(Ht,vt)}return kt&&ue?n.apply(this,W):(Ht=this.thru(dt),kt?m?Ht.value()[0]:Ht.value():Ht)})}),fi(["pop","push","shift","sort","splice","unshift"],function(n){var o=za[n],c=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",m=/^(?:pop|shift)$/.test(n);x.prototype[n]=function(){var A=arguments;if(m&&!this.__chain__){var O=this.value();return o.apply(ie(O)?O:[],A)}return this[c](function(H){return o.apply(ie(H)?H:[],A)})}}),Hi(ge.prototype,function(n,o){var c=x[o];if(c){var m=c.name+"";Ne.call(ks,m)||(ks[m]=[]),ks[m].push({name:o,func:c})}}),ks[uc(e,tt).name]=[{name:"wrapper",func:e}],ge.prototype.clone=lv,ge.prototype.reverse=fv,ge.prototype.value=dv,x.prototype.at=zw,x.prototype.chain=kw,x.prototype.commit=Hw,x.prototype.next=Kw,x.prototype.plant=Gw,x.prototype.reverse=Ww,x.prototype.toJSON=x.prototype.valueOf=x.prototype.value=Yw,x.prototype.first=x.prototype.head,Do&&(x.prototype[Do]=Vw),x},js=Hm();Qe?((Qe.exports=js)._=js,Le._=js):we._=js}).call(Wo)})(Tl,Tl.exports);var w9=Object.defineProperty,b9=Object.defineProperties,_9=Object.getOwnPropertyDescriptors,m1=Object.getOwnPropertySymbols,E9=Object.prototype.hasOwnProperty,A9=Object.prototype.propertyIsEnumerable,v1=(r,t,e)=>t in r?w9(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Nc=(r,t)=>{for(var e in t||(t={}))E9.call(t,e)&&v1(r,e,t[e]);if(m1)for(var e of m1(t))A9.call(t,e)&&v1(r,e,t[e]);return r},S9=(r,t)=>b9(r,_9(t));function Yn(r,t,e){var i;const s=Fc(r);return((i=t.rpcMap)==null?void 0:i[s.reference])||`${y9}?chainId=${s.namespace}:${s.reference}&projectId=${e}`}function Ns(r){return r.includes(":")?r.split(":")[1]:r}function wm(r){return r.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function I9(r,t){const e=Object.keys(t.namespaces).filter(s=>s.includes(r));if(!e.length)return[];const i=[];return e.forEach(s=>{const a=t.namespaces[s].accounts;i.push(...a)}),i}function nl(r={},t={}){const e=y1(r),i=y1(t);return Tl.exports.merge(e,i)}function y1(r){var t,e,i,s;const a={};if(!oa(r))return a;for(const[u,l]of Object.entries(r)){const d=Zl(u)?[u]:l.chains,f=l.methods||[],w=l.events||[],E=l.rpcMap||{},I=Jo(u);a[I]=S9(Nc(Nc({},a[I]),l),{chains:Uc(d,(t=a[I])==null?void 0:t.chains),methods:Uc(f,(e=a[I])==null?void 0:e.methods),events:Uc(w,(i=a[I])==null?void 0:i.events),rpcMap:Nc(Nc({},E),(s=a[I])==null?void 0:s.rpcMap)})}return a}function D9(r){return r.includes(":")?r.split(":")[2]:r}function w1(r){const t={};for(const[e,i]of Object.entries(r)){const s=i.methods||[],a=i.events||[],u=i.accounts||[],l=Zl(e)?[e]:i.chains?i.chains:wm(i.accounts);t[e]={chains:l,methods:s,events:a,accounts:u}}return t}function sl(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const bm={},He=r=>bm[r],ol=(r,t)=>{bm[r]=t};class x9{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class M9{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(parseInt(t),e),this.chainId=parseInt(t),this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,e){const i=e||Yn(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=parseInt(Ns(e));t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}async handleSwitchChain(t){var e,i;let s=t.request.params?(e=t.request.params[0])==null?void 0:e.chainId:"0x0";s=s.startsWith("0x")?s:`0x${s}`;const a=parseInt(s,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:s}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}}class C9{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class P9{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class O9{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{const i=this.getCardanoRPCUrl(e),s=Ns(e);t[s]=this.createHttpProvider(s,i)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}getCardanoRPCUrl(t){const e=this.namespace.rpcMap;if(e)return e[t]}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||this.getCardanoRPCUrl(t);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class N9{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class R9{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class T9{constructor(t){this.name="near",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){if(this.chainId=t,!this.httpProviders[t]){const i=e||Yn(`${this.name}:${t}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,i)}this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;t[e]=this.createHttpProvider(e,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace);return typeof i>"u"?void 0:new Mn(new Jn(i,He("disableProviderPing")))}}var F9=Object.defineProperty,U9=Object.defineProperties,B9=Object.getOwnPropertyDescriptors,b1=Object.getOwnPropertySymbols,L9=Object.prototype.hasOwnProperty,q9=Object.prototype.propertyIsEnumerable,_1=(r,t,e)=>t in r?F9(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Rc=(r,t)=>{for(var e in t||(t={}))L9.call(t,e)&&_1(r,e,t[e]);if(b1)for(var e of b1(t))q9.call(t,e)&&_1(r,e,t[e]);return r},al=(r,t)=>U9(r,B9(t));class uf{constructor(t){this.events=new Ll,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:wa(du({level:(t==null?void 0:t.logger)||p1})),this.disableProviderPing=(t==null?void 0:t.disableProviderPing)||!1}static async init(t){const e=new uf(t);return await e.initialize(),e}async request(t,e,i){const[s,a]=this.validateChain(e);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:Rc({},t),chainId:`${s}:${a}`,topic:this.session.topic,expiry:i})}sendAsync(t,e,i,s){const a=new Date().getTime();this.request(t,i,s).then(u=>e(null,pu(a,u))).catch(u=>e(u,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:Re("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}async authenticate(t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(t),await this.cleanupPendingPairings();const{uri:e,response:i}=await this.client.authenticate(t);e&&(this.uri=e,this.events.emit("display_uri",e));const s=await i();if(this.session=s.session,this.session){const a=w1(this.session.namespaces);this.namespaces=nl(this.namespaces,a),this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}removeListener(t,e){this.events.removeListener(t,e)}off(t,e){this.events.off(t,e)}get isWalletConnect(){return!0}async pair(t){this.shouldAbortPairingAttempt=!1;let e=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(e>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:s}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await s().then(a=>{this.session=a;const u=w1(a.namespaces);this.namespaces=nl(this.namespaces,u),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==ym)throw a;e++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,e){try{if(!this.session)return;const[i,s]=this.validateChain(t);this.getProvider(i).setDefaultChain(s,e)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const e=this.client.pairing.getAll();if(cn(e)){for(const i of e)t.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${e.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await cf.init({logger:this.providerOpts.logger||p1,relayUrl:this.providerOpts.relayUrl||g9,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const t=[...new Set(Object.keys(this.session.namespaces).map(e=>Jo(e)))];ol("client",this.client),ol("events",this.events),ol("disableProviderPing",this.disableProviderPing),t.forEach(e=>{if(!this.session)return;const i=I9(e,this.session),s=wm(i),a=nl(this.namespaces,this.optionalNamespaces),u=al(Rc({},a[e]),{accounts:i,chains:s});switch(e){case"eip155":this.rpcProviders[e]=new M9({namespace:u});break;case"solana":this.rpcProviders[e]=new C9({namespace:u});break;case"cosmos":this.rpcProviders[e]=new P9({namespace:u});break;case"polkadot":this.rpcProviders[e]=new x9({namespace:u});break;case"cip34":this.rpcProviders[e]=new O9({namespace:u});break;case"elrond":this.rpcProviders[e]=new N9({namespace:u});break;case"multiversx":this.rpcProviders[e]=new R9({namespace:u});break;case"near":this.rpcProviders[e]=new T9({namespace:u});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{this.events.emit("session_ping",t)}),this.client.on("session_event",t=>{const{params:e}=t,{event:i}=e;if(i.name==="accountsChanged"){const s=i.data;s&&cn(s)&&this.events.emit("accountsChanged",s.map(D9))}else if(i.name==="chainChanged"){const s=e.chainId,a=e.event.data,u=Jo(s),l=sl(s)!==sl(a)?`${u}:${sl(a)}`:s;this.onChainChanged(l)}else this.events.emit(i.name,i.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:e})=>{var i;const{namespaces:s}=e,a=(i=this.client)==null?void 0:i.session.get(t);this.session=al(Rc({},a),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:e})}),this.client.on("session_delete",async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",al(Rc({},Re("USER_DISCONNECTED")),{data:t.topic}))}),this.on(Cn.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(t,!0)})}getProvider(t){if(!this.rpcProviders[t])throw new Error(`Provider not found: ${t}`);return this.rpcProviders[t]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var e;this.getProvider(t).updateNamespace((e=this.session)==null?void 0:e.namespaces[t])})}setNamespaces(t){const{namespaces:e,optionalNamespaces:i,sessionProperties:s}=t;e&&Object.keys(e).length&&(this.namespaces=e),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=s,this.persist("namespaces",e),this.persist("optionalNamespaces",i)}validateChain(t){const[e,i]=(t==null?void 0:t.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[e,i];if(e&&!Object.keys(this.namespaces||{}).map(u=>Jo(u)).includes(e))throw new Error(`Namespace '${e}' is not configured. Please call connect() first with namespace config.`);if(e&&i)return[e,i];const s=Jo(Object.keys(this.namespaces)[0]),a=this.rpcProviders[s].getDefaultChain();return[s,a]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t,e=!1){if(!this.namespaces)return;const[i,s]=this.validateChain(t);s&&(e||this.getProvider(i).setDefaultChain(s),this.namespaces[i]?this.namespaces[i].defaultChain=s:this.namespaces[`${i}:${s}`]?this.namespaces[`${i}:${s}`].defaultChain=s:this.namespaces[`${i}:${s}`]={defaultChain:s},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",s))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(t,e){this.client.core.storage.setItem(`${g1}/${t}`,e)}async getFromStore(t){return await this.client.core.storage.getItem(`${g1}/${t}`)}}const j9=uf,$9="wc",z9="ethereum_provider",k9=`${$9}@2:${z9}:`,H9="https://rpc.walletconnect.com/v1/",Fl=["eth_sendTransaction","personal_sign"],K9=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],Ul=["chainChanged","accountsChanged"],V9=["chainChanged","accountsChanged","message","disconnect","connect"];var G9=Object.defineProperty,W9=Object.defineProperties,Y9=Object.getOwnPropertyDescriptors,E1=Object.getOwnPropertySymbols,Q9=Object.prototype.hasOwnProperty,J9=Object.prototype.propertyIsEnumerable,A1=(r,t,e)=>t in r?G9(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,ro=(r,t)=>{for(var e in t||(t={}))Q9.call(t,e)&&A1(r,e,t[e]);if(E1)for(var e of E1(t))J9.call(t,e)&&A1(r,e,t[e]);return r},cl=(r,t)=>W9(r,Y9(t));function nu(r){return Number(r[0].split(":")[1])}function Tc(r){return`0x${r.toString(16)}`}function X9(r){const{chains:t,optionalChains:e,methods:i,optionalMethods:s,events:a,optionalEvents:u,rpcMap:l}=r;if(!cn(t))throw new Error("Invalid chains");const d={chains:t,methods:i||Fl,events:a||Ul,rpcMap:ro({},t.length?{[nu(t)]:l[nu(t)]}:{})},f=a==null?void 0:a.filter(D=>!Ul.includes(D)),w=i==null?void 0:i.filter(D=>!Fl.includes(D));if(!e&&!u&&!s&&!(f!=null&&f.length)&&!(w!=null&&w.length))return{required:t.length?d:void 0};const E=(f==null?void 0:f.length)&&(w==null?void 0:w.length)||!e,I={chains:[...new Set(E?d.chains.concat(e||[]):e)],methods:[...new Set(d.methods.concat(s!=null&&s.length?s:K9))],events:[...new Set(d.events.concat(u!=null&&u.length?u:V9))],rpcMap:l};return{required:t.length?d:void 0,optional:e.length?I:void 0}}class hf{constructor(){this.events=new Di.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=k9,this.on=(t,e)=>(this.events.on(t,e),this),this.once=(t,e)=>(this.events.once(t,e),this),this.removeListener=(t,e)=>(this.events.removeListener(t,e),this),this.off=(t,e)=>(this.events.off(t,e),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){const e=new hf;return await e.initialize(t),e}async request(t,e){return await this.signer.request(t,this.formatChainId(this.chainId),e)}sendAsync(t,e,i){this.signer.sendAsync(t,e,this.formatChainId(this.chainId),i)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);const{required:e,optional:i}=X9(this.rpc);try{const s=await new Promise(async(u,l)=>{var d;this.rpc.showQrModal&&((d=this.modal)==null||d.subscribeModal(f=>{!f.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(cl(ro({namespaces:ro({},e&&{[this.namespace]:e})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:t==null?void 0:t.pairingTopic})).then(f=>{u(f)}).catch(f=>{l(new Error(f.message))})});if(!s)return;const a=Nd(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:Tc(this.chainId)})}catch(s){throw this.signer.logger.error(s),s}finally{this.modal&&this.modal.closeModal()}}async authenticate(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:t==null?void 0:t.chains});try{const e=await new Promise(async(s,a)=>{var u;this.rpc.showQrModal&&((u=this.modal)==null||u.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(cl(ro({},t),{chains:this.rpc.chains})).then(l=>{s(l)}).catch(l=>{a(new Error(l.message))})}),i=e.session;if(i){const s=Nd(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:Tc(this.chainId)})}return e}catch(e){throw this.signer.logger.error(e),e}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",t=>{const{params:e}=t,{event:i}=e;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",t)}),this.signer.on("chainChanged",t=>{const e=parseInt(t);this.chainId=e,this.events.emit("chainChanged",Tc(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",cl(ro({},Re("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",t=>{var e,i;this.rpc.showQrModal&&((e=this.modal)==null||e.closeModal(),(i=this.modal)==null||i.openModal({uri:t})),this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return typeof t=="string"?t.startsWith(`${this.namespace}:`):!1}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){const e=t.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));e.length&&(this.chainId=e[0],this.events.emit("chainChanged",Tc(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const e=this.parseChainId(t);this.chainId=e,this.switchEthereumChain(e)}}parseAccountId(t){const[e,i,s]=t.split(":");return{chainId:`${e}:${i}`,address:s}}setAccounts(t){this.accounts=t.filter(e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId).map(e=>this.parseAccountId(e).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var e,i;const s=(e=t==null?void 0:t.chains)!=null?e:[],a=(i=t==null?void 0:t.optionalChains)!=null?i:[],u=s.concat(a);if(!u.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const l=s.length?(t==null?void 0:t.methods)||Fl:[],d=s.length?(t==null?void 0:t.events)||Ul:[],f=(t==null?void 0:t.optionalMethods)||[],w=(t==null?void 0:t.optionalEvents)||[],E=(t==null?void 0:t.rpcMap)||this.buildRpcMap(u,t.projectId),I=(t==null?void 0:t.qrModalOptions)||void 0;return{chains:s==null?void 0:s.map(D=>this.formatChainId(D)),optionalChains:a.map(D=>this.formatChainId(D)),methods:l,events:d,optionalMethods:f,optionalEvents:w,rpcMap:E,showQrModal:!!(t!=null&&t.showQrModal),qrModalOptions:I,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,e){const i={};return t.forEach(s=>{i[s]=this.getRpcUrl(s,e)}),i}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?nu(this.rpc.chains):nu(this.rpc.optionalChains),this.signer=await j9.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let e;try{const{WalletConnectModal:i}=await t6(()=>import("./index-0a6167b9.js").then(s=>s.i),["assets/index-0a6167b9.js","assets/index-535c8f8c.js","assets/index-d1deb370.css"]);e=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(e)try{this.modal=new e(ro({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:e,optionalChains:i,rpcMap:s}=t;e&&cn(e)&&(this.rpc.chains=e.map(a=>this.formatChainId(a)),e.forEach(a=>{this.rpc.rpcMap[a]=(s==null?void 0:s[a])||this.getRpcUrl(a)})),i&&cn(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i==null?void 0:i.map(a=>this.formatChainId(a)),i.forEach(a=>{this.rpc.rpcMap[a]=(s==null?void 0:s[a])||this.getRpcUrl(a)}))}getRpcUrl(t,e){var i;return((i=this.rpc.rpcMap)==null?void 0:i[t])||`${H9}?chainId=eip155:${t}&projectId=${e||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),e=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:e==null?void 0:e.accounts),this.setAccounts(e==null?void 0:e.accounts)}catch(t){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(t),await this.disconnect().catch(e=>this.signer.logger.warn(e))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return typeof t=="string"||t instanceof String?[this.parseAccount(t)]:t.map(e=>this.parseAccount(e))}}const IM=hf;export{IM as EthereumProvider,V9 as OPTIONAL_EVENTS,K9 as OPTIONAL_METHODS,Ul as REQUIRED_EVENTS,Fl as REQUIRED_METHODS,hf as default};
|
|
56
|
+
}`;var ue=ad(function(){return Se(O,Ft+"return "+dt).apply(e,H)});if(ue.source=dt,vh(ue))throw ue;return ue}function s3(n){return Me(n).toLowerCase()}function o3(n){return Me(n).toUpperCase()}function a3(n,o,c){if(n=Me(n),n&&(c||o===e))return mf(n);if(!n||!(o=Qr(o)))return n;var m=Ci(n),A=Ci(o),O=vf(m,A),H=yf(m,A)+1;return jn(m,O,H).join("")}function c3(n,o,c){if(n=Me(n),n&&(c||o===e))return n.slice(0,bf(n)+1);if(!n||!(o=Qr(o)))return n;var m=Ci(n),A=yf(m,Ci(o))+1;return jn(m,0,A).join("")}function u3(n,o,c){if(n=Me(n),n&&(c||o===e))return n.replace(Yt,"");if(!n||!(o=Qr(o)))return n;var m=Ci(n),A=vf(m,Ci(o));return jn(m,A).join("")}function h3(n,o){var c=ft,m=pt;if(Ge(o)){var A="separator"in o?o.separator:A;c="length"in o?ae(o.length):c,m="omission"in o?Qr(o.omission):m}n=Me(n);var O=n.length;if(Ls(n)){var H=Ci(n);O=H.length}if(c>=O)return n;var W=c-qs(m);if(W<1)return m;var X=H?jn(H,0,W).join(""):n.slice(0,W);if(A===e)return X+m;if(H&&(W+=X.length-W),yh(A)){if(n.slice(W).search(A)){var ot,ct=X;for(A.global||(A=Tu(A.source,Me(le.exec(A))+"g")),A.lastIndex=0;ot=A.exec(ct);)var dt=ot.index;X=X.slice(0,dt===e?W:dt)}}else if(n.indexOf(Qr(A),W)!=W){var vt=X.lastIndexOf(A);vt>-1&&(X=X.slice(0,vt))}return X+m}function l3(n){return n=Me(n),n&&Gt.test(n)?n.replace(_e,jm):n}var f3=Vs(function(n,o,c){return n+(c?" ":"")+o.toUpperCase()}),_h=c0("toUpperCase");function od(n,o,c){return n=Me(n),o=c?e:o,o===e?Fm(n)?km(n):Dm(n):n.match(o)||[]}var ad=he(function(n,o){try{return cr(n,e,o)}catch(c){return vh(c)?c:new ee(c)}}),d3=gn(function(n,o){return fi(o,function(c){c=Vi(c),dn(n,c,gh(n[c],n))}),n});function p3(n){var o=n==null?0:n.length,c=jt();return n=o?ke(n,function(m){if(typeof m[1]!="function")throw new di(u);return[c(m[0]),m[1]]}):[],he(function(m){for(var A=-1;++A<o;){var O=n[A];if(cr(O[0],this,m))return cr(O[1],this,m)}})}function g3(n){return jv(gi(n,E))}function Eh(n){return function(){return n}}function m3(n,o){return n==null||n!==n?o:n}var v3=h0(),y3=h0(!0);function qr(n){return n}function Ah(n){return jf(typeof n=="function"?n:gi(n,E))}function w3(n){return zf(gi(n,E))}function b3(n,o){return kf(n,gi(o,E))}var _3=he(function(n,o){return function(c){return Ro(c,n,o)}}),E3=he(function(n,o){return function(c){return Ro(n,c,o)}});function Sh(n,o,c){var m=ur(o),A=nc(o,m);c==null&&!(Ge(o)&&(A.length||!m.length))&&(c=o,o=n,n=this,A=nc(o,ur(o)));var O=!(Ge(c)&&"chain"in c)||!!c.chain,H=vn(n);return fi(A,function(W){var X=o[W];n[W]=X,H&&(n.prototype[W]=function(){var ot=this.__chain__;if(O||ot){var ct=n(this.__wrapped__),dt=ct.__actions__=Ur(this.__actions__);return dt.push({func:X,args:arguments,thisArg:n}),ct.__chain__=ot,ct}return X.apply(n,Tn([this.value()],arguments))})}),n}function A3(){return we._===this&&(we._=Ym),this}function Ih(){}function S3(n){return n=ae(n),he(function(o){return Hf(o,n)})}var I3=rh(ke),D3=rh(lf),x3=rh(xu);function cd(n){return uh(n)?Mu(Vi(n)):iy(n)}function M3(n){return function(o){return n==null?e:ps(n,o)}}var C3=f0(),P3=f0(!0);function Dh(){return[]}function xh(){return!1}function O3(){return{}}function N3(){return""}function R3(){return!0}function T3(n,o){if(n=ae(n),n<1||n>R)return[];var c=g,m=yr(n,g);o=jt(o),n-=g;for(var A=Ou(m,o);++c<n;)o(c);return A}function F3(n){return ie(n)?ke(n,Vi):Jr(n)?[n]:Ur(M0(Me(n)))}function U3(n){var o=++Gm;return Me(n)+o}var B3=hc(function(n,o){return n+o},0),L3=ih("ceil"),q3=hc(function(n,o){return n/o},1),j3=ih("floor");function $3(n){return n&&n.length?ic(n,qr,zu):e}function z3(n,o){return n&&n.length?ic(n,jt(o,2),zu):e}function k3(n){return pf(n,qr)}function H3(n,o){return pf(n,jt(o,2))}function K3(n){return n&&n.length?ic(n,qr,Vu):e}function V3(n,o){return n&&n.length?ic(n,jt(o,2),Vu):e}var G3=hc(function(n,o){return n*o},1),W3=ih("round"),Y3=hc(function(n,o){return n-o},0);function Q3(n){return n&&n.length?Pu(n,qr):0}function J3(n,o){return n&&n.length?Pu(n,jt(o,2)):0}return x.after=wb,x.ary=q0,x.assign=o2,x.assignIn=Z0,x.assignInWith=Ac,x.assignWith=a2,x.at=c2,x.before=j0,x.bind=gh,x.bindAll=d3,x.bindKey=$0,x.castArray=Ob,x.chain=U0,x.chunk=jy,x.compact=$y,x.concat=zy,x.cond=p3,x.conforms=g3,x.constant=Eh,x.countBy=Qw,x.create=u2,x.curry=z0,x.curryRight=k0,x.debounce=H0,x.defaults=h2,x.defaultsDeep=l2,x.defer=bb,x.delay=_b,x.difference=ky,x.differenceBy=Hy,x.differenceWith=Ky,x.drop=Vy,x.dropRight=Gy,x.dropRightWhile=Wy,x.dropWhile=Yy,x.fill=Qy,x.filter=Xw,x.flatMap=eb,x.flatMapDeep=rb,x.flatMapDepth=ib,x.flatten=N0,x.flattenDeep=Jy,x.flattenDepth=Xy,x.flip=Eb,x.flow=v3,x.flowRight=y3,x.fromPairs=Zy,x.functions=y2,x.functionsIn=w2,x.groupBy=nb,x.initial=ew,x.intersection=rw,x.intersectionBy=iw,x.intersectionWith=nw,x.invert=_2,x.invertBy=E2,x.invokeMap=ob,x.iteratee=Ah,x.keyBy=ab,x.keys=ur,x.keysIn=Lr,x.map=vc,x.mapKeys=S2,x.mapValues=I2,x.matches=w3,x.matchesProperty=b3,x.memoize=wc,x.merge=D2,x.mergeWith=td,x.method=_3,x.methodOf=E3,x.mixin=Sh,x.negate=bc,x.nthArg=S3,x.omit=x2,x.omitBy=M2,x.once=Ab,x.orderBy=cb,x.over=I3,x.overArgs=Sb,x.overEvery=D3,x.overSome=x3,x.partial=mh,x.partialRight=K0,x.partition=ub,x.pick=C2,x.pickBy=ed,x.property=cd,x.propertyOf=M3,x.pull=cw,x.pullAll=T0,x.pullAllBy=uw,x.pullAllWith=hw,x.pullAt=lw,x.range=C3,x.rangeRight=P3,x.rearg=Ib,x.reject=fb,x.remove=fw,x.rest=Db,x.reverse=dh,x.sampleSize=pb,x.set=O2,x.setWith=N2,x.shuffle=gb,x.slice=dw,x.sortBy=yb,x.sortedUniq=bw,x.sortedUniqBy=_w,x.split=e3,x.spread=xb,x.tail=Ew,x.take=Aw,x.takeRight=Sw,x.takeRightWhile=Iw,x.takeWhile=Dw,x.tap=$w,x.throttle=Mb,x.thru=mc,x.toArray=Q0,x.toPairs=rd,x.toPairsIn=id,x.toPath=F3,x.toPlainObject=X0,x.transform=R2,x.unary=Cb,x.union=xw,x.unionBy=Mw,x.unionWith=Cw,x.uniq=Pw,x.uniqBy=Ow,x.uniqWith=Nw,x.unset=T2,x.unzip=ph,x.unzipWith=F0,x.update=F2,x.updateWith=U2,x.values=Ys,x.valuesIn=B2,x.without=Rw,x.words=od,x.wrap=Pb,x.xor=Tw,x.xorBy=Fw,x.xorWith=Uw,x.zip=Bw,x.zipObject=Lw,x.zipObjectDeep=qw,x.zipWith=jw,x.entries=rd,x.entriesIn=id,x.extend=Z0,x.extendWith=Ac,Sh(x,x),x.add=B3,x.attempt=ad,x.camelCase=$2,x.capitalize=nd,x.ceil=L3,x.clamp=L2,x.clone=Nb,x.cloneDeep=Tb,x.cloneDeepWith=Fb,x.cloneWith=Rb,x.conformsTo=Ub,x.deburr=sd,x.defaultTo=m3,x.divide=q3,x.endsWith=z2,x.eq=Oi,x.escape=k2,x.escapeRegExp=H2,x.every=Jw,x.find=Zw,x.findIndex=P0,x.findKey=f2,x.findLast=tb,x.findLastIndex=O0,x.findLastKey=d2,x.floor=j3,x.forEach=B0,x.forEachRight=L0,x.forIn=p2,x.forInRight=g2,x.forOwn=m2,x.forOwnRight=v2,x.get=wh,x.gt=Bb,x.gte=Lb,x.has=b2,x.hasIn=bh,x.head=R0,x.identity=qr,x.includes=sb,x.indexOf=tw,x.inRange=q2,x.invoke=A2,x.isArguments=vs,x.isArray=ie,x.isArrayBuffer=qb,x.isArrayLike=Br,x.isArrayLikeObject=Je,x.isBoolean=jb,x.isBuffer=$n,x.isDate=$b,x.isElement=zb,x.isEmpty=kb,x.isEqual=Hb,x.isEqualWith=Kb,x.isError=vh,x.isFinite=Vb,x.isFunction=vn,x.isInteger=V0,x.isLength=_c,x.isMap=G0,x.isMatch=Gb,x.isMatchWith=Wb,x.isNaN=Yb,x.isNative=Qb,x.isNil=Xb,x.isNull=Jb,x.isNumber=W0,x.isObject=Ge,x.isObjectLike=We,x.isPlainObject=qo,x.isRegExp=yh,x.isSafeInteger=Zb,x.isSet=Y0,x.isString=Ec,x.isSymbol=Jr,x.isTypedArray=Ws,x.isUndefined=t2,x.isWeakMap=e2,x.isWeakSet=r2,x.join=sw,x.kebabCase=K2,x.last=vi,x.lastIndexOf=ow,x.lowerCase=V2,x.lowerFirst=G2,x.lt=i2,x.lte=n2,x.max=$3,x.maxBy=z3,x.mean=k3,x.meanBy=H3,x.min=K3,x.minBy=V3,x.stubArray=Dh,x.stubFalse=xh,x.stubObject=O3,x.stubString=N3,x.stubTrue=R3,x.multiply=G3,x.nth=aw,x.noConflict=A3,x.noop=Ih,x.now=yc,x.pad=W2,x.padEnd=Y2,x.padStart=Q2,x.parseInt=J2,x.random=j2,x.reduce=hb,x.reduceRight=lb,x.repeat=X2,x.replace=Z2,x.result=P2,x.round=W3,x.runInContext=J,x.sample=db,x.size=mb,x.snakeCase=t3,x.some=vb,x.sortedIndex=pw,x.sortedIndexBy=gw,x.sortedIndexOf=mw,x.sortedLastIndex=vw,x.sortedLastIndexBy=yw,x.sortedLastIndexOf=ww,x.startCase=r3,x.startsWith=i3,x.subtract=Y3,x.sum=Q3,x.sumBy=J3,x.template=n3,x.times=T3,x.toFinite=yn,x.toInteger=ae,x.toLength=J0,x.toLower=s3,x.toNumber=yi,x.toSafeInteger=s2,x.toString=Me,x.toUpper=o3,x.trim=a3,x.trimEnd=c3,x.trimStart=u3,x.truncate=h3,x.unescape=l3,x.uniqueId=U3,x.upperCase=f3,x.upperFirst=_h,x.each=B0,x.eachRight=L0,x.first=R0,Sh(x,function(){var n={};return Hi(x,function(o,c){Ne.call(x.prototype,c)||(n[c]=o)}),n}(),{chain:!1}),x.VERSION=i,fi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){x[n].placeholder=x}),fi(["drop","take"],function(n,o){ge.prototype[n]=function(c){c=c===e?1:nr(ae(c),0);var m=this.__filtered__&&!o?new ge(this):this.clone();return m.__filtered__?m.__takeCount__=yr(c,m.__takeCount__):m.__views__.push({size:yr(c,g),type:n+(m.__dir__<0?"Right":"")}),m},ge.prototype[n+"Right"]=function(c){return this.reverse()[n](c).reverse()}}),fi(["filter","map","takeWhile"],function(n,o){var c=o+1,m=c==y||c==M;ge.prototype[n]=function(A){var O=this.clone();return O.__iteratees__.push({iteratee:jt(A,3),type:c}),O.__filtered__=O.__filtered__||m,O}}),fi(["head","last"],function(n,o){var c="take"+(o?"Right":"");ge.prototype[n]=function(){return this[c](1).value()[0]}}),fi(["initial","tail"],function(n,o){var c="drop"+(o?"":"Right");ge.prototype[n]=function(){return this.__filtered__?new ge(this):this[c](1)}}),ge.prototype.compact=function(){return this.filter(qr)},ge.prototype.find=function(n){return this.filter(n).head()},ge.prototype.findLast=function(n){return this.reverse().find(n)},ge.prototype.invokeMap=he(function(n,o){return typeof n=="function"?new ge(this):this.map(function(c){return Ro(c,n,o)})}),ge.prototype.reject=function(n){return this.filter(bc(jt(n)))},ge.prototype.slice=function(n,o){n=ae(n);var c=this;return c.__filtered__&&(n>0||o<0)?new ge(c):(n<0?c=c.takeRight(-n):n&&(c=c.drop(n)),o!==e&&(o=ae(o),c=o<0?c.dropRight(-o):c.take(o-n)),c)},ge.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},ge.prototype.toArray=function(){return this.take(g)},Hi(ge.prototype,function(n,o){var c=/^(?:filter|find|map|reject)|While$/.test(o),m=/^(?:head|last)$/.test(o),A=x[m?"take"+(o=="last"?"Right":""):o],O=m||/^find/.test(o);A&&(x.prototype[o]=function(){var H=this.__wrapped__,W=m?[1]:arguments,X=H instanceof ge,ot=W[0],ct=X||ie(H),dt=function(fe){var be=A.apply(x,Tn([fe],W));return m&&vt?be[0]:be};ct&&c&&typeof ot=="function"&&ot.length!=1&&(X=ct=!1);var vt=this.__chain__,Ft=!!this.__actions__.length,kt=O&&!vt,ue=X&&!Ft;if(!O&&ct){H=ue?H:new ge(this);var Ht=n.apply(H,W);return Ht.__actions__.push({func:mc,args:[dt],thisArg:e}),new pi(Ht,vt)}return kt&&ue?n.apply(this,W):(Ht=this.thru(dt),kt?m?Ht.value()[0]:Ht.value():Ht)})}),fi(["pop","push","shift","sort","splice","unshift"],function(n){var o=za[n],c=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",m=/^(?:pop|shift)$/.test(n);x.prototype[n]=function(){var A=arguments;if(m&&!this.__chain__){var O=this.value();return o.apply(ie(O)?O:[],A)}return this[c](function(H){return o.apply(ie(H)?H:[],A)})}}),Hi(ge.prototype,function(n,o){var c=x[o];if(c){var m=c.name+"";Ne.call(ks,m)||(ks[m]=[]),ks[m].push({name:o,func:c})}}),ks[uc(e,tt).name]=[{name:"wrapper",func:e}],ge.prototype.clone=lv,ge.prototype.reverse=fv,ge.prototype.value=dv,x.prototype.at=zw,x.prototype.chain=kw,x.prototype.commit=Hw,x.prototype.next=Kw,x.prototype.plant=Gw,x.prototype.reverse=Ww,x.prototype.toJSON=x.prototype.valueOf=x.prototype.value=Yw,x.prototype.first=x.prototype.head,Do&&(x.prototype[Do]=Vw),x},js=Hm();Qe?((Qe.exports=js)._=js,Le._=js):we._=js}).call(Wo)})(Tl,Tl.exports);var w9=Object.defineProperty,b9=Object.defineProperties,_9=Object.getOwnPropertyDescriptors,m1=Object.getOwnPropertySymbols,E9=Object.prototype.hasOwnProperty,A9=Object.prototype.propertyIsEnumerable,v1=(r,t,e)=>t in r?w9(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Nc=(r,t)=>{for(var e in t||(t={}))E9.call(t,e)&&v1(r,e,t[e]);if(m1)for(var e of m1(t))A9.call(t,e)&&v1(r,e,t[e]);return r},S9=(r,t)=>b9(r,_9(t));function Yn(r,t,e){var i;const s=Fc(r);return((i=t.rpcMap)==null?void 0:i[s.reference])||`${y9}?chainId=${s.namespace}:${s.reference}&projectId=${e}`}function Ns(r){return r.includes(":")?r.split(":")[1]:r}function wm(r){return r.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function I9(r,t){const e=Object.keys(t.namespaces).filter(s=>s.includes(r));if(!e.length)return[];const i=[];return e.forEach(s=>{const a=t.namespaces[s].accounts;i.push(...a)}),i}function nl(r={},t={}){const e=y1(r),i=y1(t);return Tl.exports.merge(e,i)}function y1(r){var t,e,i,s;const a={};if(!oa(r))return a;for(const[u,l]of Object.entries(r)){const d=Zl(u)?[u]:l.chains,f=l.methods||[],w=l.events||[],E=l.rpcMap||{},I=Jo(u);a[I]=S9(Nc(Nc({},a[I]),l),{chains:Uc(d,(t=a[I])==null?void 0:t.chains),methods:Uc(f,(e=a[I])==null?void 0:e.methods),events:Uc(w,(i=a[I])==null?void 0:i.events),rpcMap:Nc(Nc({},E),(s=a[I])==null?void 0:s.rpcMap)})}return a}function D9(r){return r.includes(":")?r.split(":")[2]:r}function w1(r){const t={};for(const[e,i]of Object.entries(r)){const s=i.methods||[],a=i.events||[],u=i.accounts||[],l=Zl(e)?[e]:i.chains?i.chains:wm(i.accounts);t[e]={chains:l,methods:s,events:a,accounts:u}}return t}function sl(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const bm={},He=r=>bm[r],ol=(r,t)=>{bm[r]=t};class x9{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class M9{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(parseInt(t),e),this.chainId=parseInt(t),this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,e){const i=e||Yn(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=parseInt(Ns(e));t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}async handleSwitchChain(t){var e,i;let s=t.request.params?(e=t.request.params[0])==null?void 0:e.chainId:"0x0";s=s.startsWith("0x")?s:`0x${s}`;const a=parseInt(s,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:s}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}}class C9{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class P9{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class O9{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{const i=this.getCardanoRPCUrl(e),s=Ns(e);t[s]=this.createHttpProvider(s,i)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}getCardanoRPCUrl(t){const e=this.namespace.rpcMap;if(e)return e[t]}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||this.getCardanoRPCUrl(t);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class N9{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class R9{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class T9{constructor(t){this.name="near",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){if(this.chainId=t,!this.httpProviders[t]){const i=e||Yn(`${this.name}:${t}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,i)}this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;t[e]=this.createHttpProvider(e,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace);return typeof i>"u"?void 0:new Mn(new Jn(i,He("disableProviderPing")))}}var F9=Object.defineProperty,U9=Object.defineProperties,B9=Object.getOwnPropertyDescriptors,b1=Object.getOwnPropertySymbols,L9=Object.prototype.hasOwnProperty,q9=Object.prototype.propertyIsEnumerable,_1=(r,t,e)=>t in r?F9(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Rc=(r,t)=>{for(var e in t||(t={}))L9.call(t,e)&&_1(r,e,t[e]);if(b1)for(var e of b1(t))q9.call(t,e)&&_1(r,e,t[e]);return r},al=(r,t)=>U9(r,B9(t));class uf{constructor(t){this.events=new Ll,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:wa(du({level:(t==null?void 0:t.logger)||p1})),this.disableProviderPing=(t==null?void 0:t.disableProviderPing)||!1}static async init(t){const e=new uf(t);return await e.initialize(),e}async request(t,e,i){const[s,a]=this.validateChain(e);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:Rc({},t),chainId:`${s}:${a}`,topic:this.session.topic,expiry:i})}sendAsync(t,e,i,s){const a=new Date().getTime();this.request(t,i,s).then(u=>e(null,pu(a,u))).catch(u=>e(u,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:Re("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}async authenticate(t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(t),await this.cleanupPendingPairings();const{uri:e,response:i}=await this.client.authenticate(t);e&&(this.uri=e,this.events.emit("display_uri",e));const s=await i();if(this.session=s.session,this.session){const a=w1(this.session.namespaces);this.namespaces=nl(this.namespaces,a),this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}removeListener(t,e){this.events.removeListener(t,e)}off(t,e){this.events.off(t,e)}get isWalletConnect(){return!0}async pair(t){this.shouldAbortPairingAttempt=!1;let e=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(e>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:s}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await s().then(a=>{this.session=a;const u=w1(a.namespaces);this.namespaces=nl(this.namespaces,u),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==ym)throw a;e++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,e){try{if(!this.session)return;const[i,s]=this.validateChain(t);this.getProvider(i).setDefaultChain(s,e)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const e=this.client.pairing.getAll();if(cn(e)){for(const i of e)t.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${e.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await cf.init({logger:this.providerOpts.logger||p1,relayUrl:this.providerOpts.relayUrl||g9,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const t=[...new Set(Object.keys(this.session.namespaces).map(e=>Jo(e)))];ol("client",this.client),ol("events",this.events),ol("disableProviderPing",this.disableProviderPing),t.forEach(e=>{if(!this.session)return;const i=I9(e,this.session),s=wm(i),a=nl(this.namespaces,this.optionalNamespaces),u=al(Rc({},a[e]),{accounts:i,chains:s});switch(e){case"eip155":this.rpcProviders[e]=new M9({namespace:u});break;case"solana":this.rpcProviders[e]=new C9({namespace:u});break;case"cosmos":this.rpcProviders[e]=new P9({namespace:u});break;case"polkadot":this.rpcProviders[e]=new x9({namespace:u});break;case"cip34":this.rpcProviders[e]=new O9({namespace:u});break;case"elrond":this.rpcProviders[e]=new N9({namespace:u});break;case"multiversx":this.rpcProviders[e]=new R9({namespace:u});break;case"near":this.rpcProviders[e]=new T9({namespace:u});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{this.events.emit("session_ping",t)}),this.client.on("session_event",t=>{const{params:e}=t,{event:i}=e;if(i.name==="accountsChanged"){const s=i.data;s&&cn(s)&&this.events.emit("accountsChanged",s.map(D9))}else if(i.name==="chainChanged"){const s=e.chainId,a=e.event.data,u=Jo(s),l=sl(s)!==sl(a)?`${u}:${sl(a)}`:s;this.onChainChanged(l)}else this.events.emit(i.name,i.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:e})=>{var i;const{namespaces:s}=e,a=(i=this.client)==null?void 0:i.session.get(t);this.session=al(Rc({},a),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:e})}),this.client.on("session_delete",async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",al(Rc({},Re("USER_DISCONNECTED")),{data:t.topic}))}),this.on(Cn.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(t,!0)})}getProvider(t){if(!this.rpcProviders[t])throw new Error(`Provider not found: ${t}`);return this.rpcProviders[t]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var e;this.getProvider(t).updateNamespace((e=this.session)==null?void 0:e.namespaces[t])})}setNamespaces(t){const{namespaces:e,optionalNamespaces:i,sessionProperties:s}=t;e&&Object.keys(e).length&&(this.namespaces=e),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=s,this.persist("namespaces",e),this.persist("optionalNamespaces",i)}validateChain(t){const[e,i]=(t==null?void 0:t.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[e,i];if(e&&!Object.keys(this.namespaces||{}).map(u=>Jo(u)).includes(e))throw new Error(`Namespace '${e}' is not configured. Please call connect() first with namespace config.`);if(e&&i)return[e,i];const s=Jo(Object.keys(this.namespaces)[0]),a=this.rpcProviders[s].getDefaultChain();return[s,a]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t,e=!1){if(!this.namespaces)return;const[i,s]=this.validateChain(t);s&&(e||this.getProvider(i).setDefaultChain(s),this.namespaces[i]?this.namespaces[i].defaultChain=s:this.namespaces[`${i}:${s}`]?this.namespaces[`${i}:${s}`].defaultChain=s:this.namespaces[`${i}:${s}`]={defaultChain:s},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",s))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(t,e){this.client.core.storage.setItem(`${g1}/${t}`,e)}async getFromStore(t){return await this.client.core.storage.getItem(`${g1}/${t}`)}}const j9=uf,$9="wc",z9="ethereum_provider",k9=`${$9}@2:${z9}:`,H9="https://rpc.walletconnect.com/v1/",Fl=["eth_sendTransaction","personal_sign"],K9=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],Ul=["chainChanged","accountsChanged"],V9=["chainChanged","accountsChanged","message","disconnect","connect"];var G9=Object.defineProperty,W9=Object.defineProperties,Y9=Object.getOwnPropertyDescriptors,E1=Object.getOwnPropertySymbols,Q9=Object.prototype.hasOwnProperty,J9=Object.prototype.propertyIsEnumerable,A1=(r,t,e)=>t in r?G9(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,ro=(r,t)=>{for(var e in t||(t={}))Q9.call(t,e)&&A1(r,e,t[e]);if(E1)for(var e of E1(t))J9.call(t,e)&&A1(r,e,t[e]);return r},cl=(r,t)=>W9(r,Y9(t));function nu(r){return Number(r[0].split(":")[1])}function Tc(r){return`0x${r.toString(16)}`}function X9(r){const{chains:t,optionalChains:e,methods:i,optionalMethods:s,events:a,optionalEvents:u,rpcMap:l}=r;if(!cn(t))throw new Error("Invalid chains");const d={chains:t,methods:i||Fl,events:a||Ul,rpcMap:ro({},t.length?{[nu(t)]:l[nu(t)]}:{})},f=a==null?void 0:a.filter(D=>!Ul.includes(D)),w=i==null?void 0:i.filter(D=>!Fl.includes(D));if(!e&&!u&&!s&&!(f!=null&&f.length)&&!(w!=null&&w.length))return{required:t.length?d:void 0};const E=(f==null?void 0:f.length)&&(w==null?void 0:w.length)||!e,I={chains:[...new Set(E?d.chains.concat(e||[]):e)],methods:[...new Set(d.methods.concat(s!=null&&s.length?s:K9))],events:[...new Set(d.events.concat(u!=null&&u.length?u:V9))],rpcMap:l};return{required:t.length?d:void 0,optional:e.length?I:void 0}}class hf{constructor(){this.events=new Di.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=k9,this.on=(t,e)=>(this.events.on(t,e),this),this.once=(t,e)=>(this.events.once(t,e),this),this.removeListener=(t,e)=>(this.events.removeListener(t,e),this),this.off=(t,e)=>(this.events.off(t,e),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){const e=new hf;return await e.initialize(t),e}async request(t,e){return await this.signer.request(t,this.formatChainId(this.chainId),e)}sendAsync(t,e,i){this.signer.sendAsync(t,e,this.formatChainId(this.chainId),i)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);const{required:e,optional:i}=X9(this.rpc);try{const s=await new Promise(async(u,l)=>{var d;this.rpc.showQrModal&&((d=this.modal)==null||d.subscribeModal(f=>{!f.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(cl(ro({namespaces:ro({},e&&{[this.namespace]:e})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:t==null?void 0:t.pairingTopic})).then(f=>{u(f)}).catch(f=>{l(new Error(f.message))})});if(!s)return;const a=Nd(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:Tc(this.chainId)})}catch(s){throw this.signer.logger.error(s),s}finally{this.modal&&this.modal.closeModal()}}async authenticate(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:t==null?void 0:t.chains});try{const e=await new Promise(async(s,a)=>{var u;this.rpc.showQrModal&&((u=this.modal)==null||u.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(cl(ro({},t),{chains:this.rpc.chains})).then(l=>{s(l)}).catch(l=>{a(new Error(l.message))})}),i=e.session;if(i){const s=Nd(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:Tc(this.chainId)})}return e}catch(e){throw this.signer.logger.error(e),e}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",t=>{const{params:e}=t,{event:i}=e;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",t)}),this.signer.on("chainChanged",t=>{const e=parseInt(t);this.chainId=e,this.events.emit("chainChanged",Tc(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",cl(ro({},Re("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",t=>{var e,i;this.rpc.showQrModal&&((e=this.modal)==null||e.closeModal(),(i=this.modal)==null||i.openModal({uri:t})),this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return typeof t=="string"?t.startsWith(`${this.namespace}:`):!1}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){const e=t.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));e.length&&(this.chainId=e[0],this.events.emit("chainChanged",Tc(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const e=this.parseChainId(t);this.chainId=e,this.switchEthereumChain(e)}}parseAccountId(t){const[e,i,s]=t.split(":");return{chainId:`${e}:${i}`,address:s}}setAccounts(t){this.accounts=t.filter(e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId).map(e=>this.parseAccountId(e).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var e,i;const s=(e=t==null?void 0:t.chains)!=null?e:[],a=(i=t==null?void 0:t.optionalChains)!=null?i:[],u=s.concat(a);if(!u.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const l=s.length?(t==null?void 0:t.methods)||Fl:[],d=s.length?(t==null?void 0:t.events)||Ul:[],f=(t==null?void 0:t.optionalMethods)||[],w=(t==null?void 0:t.optionalEvents)||[],E=(t==null?void 0:t.rpcMap)||this.buildRpcMap(u,t.projectId),I=(t==null?void 0:t.qrModalOptions)||void 0;return{chains:s==null?void 0:s.map(D=>this.formatChainId(D)),optionalChains:a.map(D=>this.formatChainId(D)),methods:l,events:d,optionalMethods:f,optionalEvents:w,rpcMap:E,showQrModal:!!(t!=null&&t.showQrModal),qrModalOptions:I,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,e){const i={};return t.forEach(s=>{i[s]=this.getRpcUrl(s,e)}),i}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?nu(this.rpc.chains):nu(this.rpc.optionalChains),this.signer=await j9.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let e;try{const{WalletConnectModal:i}=await t6(()=>import("./index-bdd52a72.js").then(s=>s.i),["assets/index-bdd52a72.js","assets/index-9b8a6048.js","assets/index-94a0e6a0.css"]);e=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(e)try{this.modal=new e(ro({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:e,optionalChains:i,rpcMap:s}=t;e&&cn(e)&&(this.rpc.chains=e.map(a=>this.formatChainId(a)),e.forEach(a=>{this.rpc.rpcMap[a]=(s==null?void 0:s[a])||this.getRpcUrl(a)})),i&&cn(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i==null?void 0:i.map(a=>this.formatChainId(a)),i.forEach(a=>{this.rpc.rpcMap[a]=(s==null?void 0:s[a])||this.getRpcUrl(a)}))}getRpcUrl(t,e){var i;return((i=this.rpc.rpcMap)==null?void 0:i[t])||`${H9}?chainId=eip155:${t}&projectId=${e||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),e=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:e==null?void 0:e.accounts),this.setAccounts(e==null?void 0:e.accounts)}catch(t){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(t),await this.disconnect().catch(e=>this.signer.logger.warn(e))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return typeof t=="string"||t instanceof String?[this.parseAccount(t)]:t.map(e=>this.parseAccount(e))}}const IM=hf;export{IM as EthereumProvider,V9 as OPTIONAL_EVENTS,K9 as OPTIONAL_METHODS,Ul as REQUIRED_EVENTS,Fl as REQUIRED_METHODS,hf as default};
|