magic-sdk 16.3.0-canary.497.4682731127.0 → 17.0.0-canary.496.4689611306.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/magic.js +3 -3
- package/dist/types/index.cdn.d.ts +2 -0
- package/package.json +5 -5
package/dist/magic.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
"use strict";var Magic=(()=>{var Bn=Object.create;var Ue=Object.defineProperty;var kn=Object.getOwnPropertyDescriptor;var Fn=Object.getOwnPropertyNames,Xt=Object.getOwnPropertySymbols,Gn=Object.getPrototypeOf,Jt=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable;var zt=(e,t,n)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qt=(e,t)=>{for(var n in t||(t={}))Jt.call(t,n)&&zt(e,n,t[n]);if(Xt)for(var n of Xt(t))jn.call(t,n)&&zt(e,n,t[n]);return e};var Be=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var Zt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),er=(e,t)=>{for(var n in t)Ue(e,n,{get:t[n],enumerable:!0})},tr=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Fn(t))!Jt.call(e,s)&&s!==n&&Ue(e,s,{get:()=>t[s],enumerable:!(o=kn(t,s))||o.enumerable});return e};var rr=(e,t,n)=>(n=e!=null?Bn(Gn(e)):{},tr(t||!e||!e.__esModule?Ue(n,"default",{value:e,enumerable:!0}):n,e)),Wn=e=>tr(Ue({},"__esModule",{value:!0}),e);var Se=(e,t,n)=>new Promise((o,s)=>{var c=v=>{try{p(n.next(v))}catch(g){s(g)}},m=v=>{try{p(n.throw(v))}catch(g){s(g)}},p=v=>v.done?o(v.value):Promise.resolve(v.value).then(c,m);p((n=n.apply(e,t)).next())});var Fr=Zt((kr,Tt)=>{(function(e){if(typeof kr=="object"&&typeof Tt<"u")Tt.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t=this,t.localforage=e()}})(function(){var e,t,n;return function o(s,c,m){function p(y,N){if(!c[y]){if(!s[y]){var I=typeof Be=="function"&&Be;if(!N&&I)return I(y,!0);if(v)return v(y,!0);var T=new Error("Cannot find module '"+y+"'");throw T.code="MODULE_NOT_FOUND",T}var P=c[y]={exports:{}};s[y][0].call(P.exports,function(B){var L=s[y][1][B];return p(L||B)},P,P.exports,o,s,c,m)}return c[y].exports}for(var v=typeof Be=="function"&&Be,g=0;g<m.length;g++)p(m[g]);return p}({1:[function(o,s,c){(function(m){"use strict";var p=m.MutationObserver||m.WebKitMutationObserver,v;if(p){var g=0,y=new p(B),N=m.document.createTextNode("");y.observe(N,{characterData:!0}),v=function(){N.data=g=++g%2}}else if(!m.setImmediate&&typeof m.MessageChannel<"u"){var I=new m.MessageChannel;I.port1.onmessage=B,v=function(){I.port2.postMessage(0)}}else"document"in m&&"onreadystatechange"in m.document.createElement("script")?v=function(){var F=m.document.createElement("script");F.onreadystatechange=function(){B(),F.onreadystatechange=null,F.parentNode.removeChild(F),F=null},m.document.documentElement.appendChild(F)}:v=function(){setTimeout(B,0)};var T,P=[];function B(){T=!0;for(var F,J,C=P.length;C;){for(J=P,P=[],F=-1;++F<C;)J[F]();C=P.length}T=!1}s.exports=L;function L(F){P.push(F)===1&&!T&&v()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(o,s,c){"use strict";var m=o(1);function p(){}var v={},g=["REJECTED"],y=["FULFILLED"],N=["PENDING"];s.exports=I;function I(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=N,this.queue=[],this.outcome=void 0,S!==p&&L(this,S)}I.prototype.catch=function(S){return this.then(null,S)},I.prototype.then=function(S,G){if(typeof S!="function"&&this.state===y||typeof G!="function"&&this.state===g)return this;var U=new this.constructor(p);if(this.state!==N){var V=this.state===y?S:G;P(U,V,this.outcome)}else this.queue.push(new T(U,S,G));return U};function T(S,G,U){this.promise=S,typeof G=="function"&&(this.onFulfilled=G,this.callFulfilled=this.otherCallFulfilled),typeof U=="function"&&(this.onRejected=U,this.callRejected=this.otherCallRejected)}T.prototype.callFulfilled=function(S){v.resolve(this.promise,S)},T.prototype.otherCallFulfilled=function(S){P(this.promise,this.onFulfilled,S)},T.prototype.callRejected=function(S){v.reject(this.promise,S)},T.prototype.otherCallRejected=function(S){P(this.promise,this.onRejected,S)};function P(S,G,U){m(function(){var V;try{V=G(U)}catch(Q){return v.reject(S,Q)}V===S?v.reject(S,new TypeError("Cannot resolve promise with itself")):v.resolve(S,V)})}v.resolve=function(S,G){var U=F(B,G);if(U.status==="error")return v.reject(S,U.value);var V=U.value;if(V)L(S,V);else{S.state=y,S.outcome=G;for(var Q=-1,ie=S.queue.length;++Q<ie;)S.queue[Q].callFulfilled(G)}return S},v.reject=function(S,G){S.state=g,S.outcome=G;for(var U=-1,V=S.queue.length;++U<V;)S.queue[U].callRejected(G);return S};function B(S){var G=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof G=="function")return function(){G.apply(S,arguments)}}function L(S,G){var U=!1;function V(se){U||(U=!0,v.reject(S,se))}function Q(se){U||(U=!0,v.resolve(S,se))}function ie(){G(Q,V)}var ae=F(ie);ae.status==="error"&&V(ae.value)}function F(S,G){var U={};try{U.value=S(G),U.status="success"}catch(V){U.status="error",U.value=V}return U}I.resolve=J;function J(S){return S instanceof this?S:v.resolve(new this(p),S)}I.reject=C;function C(S){var G=new this(p);return v.reject(G,S)}I.all=pe;function pe(S){var G=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var U=S.length,V=!1;if(!U)return this.resolve([]);for(var Q=new Array(U),ie=0,ae=-1,se=new this(p);++ae<U;)ce(S[ae],ae);return se;function ce(ye,d){G.resolve(ye).then(_,function(A){V||(V=!0,v.reject(se,A))});function _(A){Q[d]=A,++ie===U&&!V&&(V=!0,v.resolve(se,Q))}}}I.race=ne;function ne(S){var G=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var U=S.length,V=!1;if(!U)return this.resolve([]);for(var Q=-1,ie=new this(p);++Q<U;)ae(S[Q]);return ie;function ae(se){G.resolve(se).then(function(ce){V||(V=!0,v.resolve(ie,ce))},function(ce){V||(V=!0,v.reject(ie,ce))})}}},{1:1}],3:[function(o,s,c){(function(m){"use strict";typeof m.Promise!="function"&&(m.Promise=o(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(o,s,c){"use strict";var m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};function p(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function v(){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 g=v();function y(){try{if(!g||!g.open)return!1;var r=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),a=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!r||a)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function N(r,a){r=r||[],a=a||{};try{return new Blob(r,a)}catch(u){if(u.name!=="TypeError")throw u;for(var i=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,l=new i,f=0;f<r.length;f+=1)l.append(r[f]);return l.getBlob(a.type)}}typeof Promise>"u"&&o(3);var I=Promise;function T(r,a){a&&r.then(function(i){a(null,i)},function(i){a(i)})}function P(r,a,i){typeof a=="function"&&r.then(a),typeof i=="function"&&r.catch(i)}function B(r){return typeof r!="string"&&(console.warn(r+" used as a key, but it is not a string."),r=String(r)),r}function L(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var F="local-forage-detect-blob-support",J=void 0,C={},pe=Object.prototype.toString,ne="readonly",S="readwrite";function G(r){for(var a=r.length,i=new ArrayBuffer(a),l=new Uint8Array(i),f=0;f<a;f++)l[f]=r.charCodeAt(f);return i}function U(r){return new I(function(a){var i=r.transaction(F,S),l=N([""]);i.objectStore(F).put(l,"key"),i.onabort=function(f){f.preventDefault(),f.stopPropagation(),a(!1)},i.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),u=navigator.userAgent.match(/Edge\//);a(u||!f||parseInt(f[1],10)>=43)}}).catch(function(){return!1})}function V(r){return typeof J=="boolean"?I.resolve(J):U(r).then(function(a){return J=a,J})}function Q(r){var a=C[r.name],i={};i.promise=new I(function(l,f){i.resolve=l,i.reject=f}),a.deferredOperations.push(i),a.dbReady?a.dbReady=a.dbReady.then(function(){return i.promise}):a.dbReady=i.promise}function ie(r){var a=C[r.name],i=a.deferredOperations.pop();if(i)return i.resolve(),i.promise}function ae(r,a){var i=C[r.name],l=i.deferredOperations.pop();if(l)return l.reject(a),l.promise}function se(r,a){return new I(function(i,l){if(C[r.name]=C[r.name]||Z(),r.db)if(a)Q(r),r.db.close();else return i(r.db);var f=[r.name];a&&f.push(r.version);var u=g.open.apply(g,f);a&&(u.onupgradeneeded=function(h){var E=u.result;try{E.createObjectStore(r.storeName),h.oldVersion<=1&&E.createObjectStore(F)}catch(b){if(b.name==="ConstraintError")console.warn('The database "'+r.name+'" has been upgraded from version '+h.oldVersion+" to version "+h.newVersion+', but the storage "'+r.storeName+'" already exists.');else throw b}}),u.onerror=function(h){h.preventDefault(),l(u.error)},u.onsuccess=function(){var h=u.result;h.onversionchange=function(E){E.target.close()},i(h),ie(r)}})}function ce(r){return se(r,!1)}function ye(r){return se(r,!0)}function d(r,a){if(!r.db)return!0;var i=!r.db.objectStoreNames.contains(r.storeName),l=r.version<r.db.version,f=r.version>r.db.version;if(l&&(r.version!==a&&console.warn('The database "'+r.name+`" can't be downgraded from version `+r.db.version+" to version "+r.version+"."),r.version=r.db.version),f||i){if(i){var u=r.db.version+1;u>r.version&&(r.version=u)}return!0}return!1}function _(r){return new I(function(a,i){var l=new FileReader;l.onerror=i,l.onloadend=function(f){var u=btoa(f.target.result||"");a({__local_forage_encoded_blob:!0,data:u,type:r.type})},l.readAsBinaryString(r)})}function A(r){var a=G(atob(r.data));return N([a],{type:r.type})}function M(r){return r&&r.__local_forage_encoded_blob}function $(r){var a=this,i=a._initReady().then(function(){var l=C[a._dbInfo.name];if(l&&l.dbReady)return l.dbReady});return P(i,r,r),i}function x(r){Q(r);for(var a=C[r.name],i=a.forages,l=0;l<i.length;l++){var f=i[l];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null)}return r.db=null,ce(r).then(function(u){return r.db=u,d(r)?ye(r):u}).then(function(u){r.db=a.db=u;for(var h=0;h<i.length;h++)i[h]._dbInfo.db=u}).catch(function(u){throw ae(r,u),u})}function j(r,a,i,l){l===void 0&&(l=1);try{var f=r.db.transaction(r.storeName,a);i(null,f)}catch(u){if(l>0&&(!r.db||u.name==="InvalidStateError"||u.name==="NotFoundError"))return I.resolve().then(function(){if(!r.db||u.name==="NotFoundError"&&!r.db.objectStoreNames.contains(r.storeName)&&r.version<=r.db.version)return r.db&&(r.version=r.db.version+1),ye(r)}).then(function(){return x(r).then(function(){j(r,a,i,l-1)})}).catch(i);i(u)}}function Z(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Re(r){var a=this,i={db:null};if(r)for(var l in r)i[l]=r[l];var f=C[i.name];f||(f=Z(),C[i.name]=f),f.forages.push(a),a._initReady||(a._initReady=a.ready,a.ready=$);var u=[];function h(){return I.resolve()}for(var E=0;E<f.forages.length;E++){var b=f.forages[E];b!==a&&u.push(b._initReady().catch(h))}var w=f.forages.slice(0);return I.all(u).then(function(){return i.db=f.db,ce(i)}).then(function(R){return i.db=R,d(i,a._defaultConfig.version)?ye(i):R}).then(function(R){i.db=f.db=R,a._dbInfo=i;for(var O=0;O<w.length;O++){var k=w[O];k!==a&&(k._dbInfo.db=i.db,k._dbInfo.version=i.version)}})}function Ee(r,a){var i=this;r=B(r);var l=new I(function(f,u){i.ready().then(function(){j(i._dbInfo,ne,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),w=b.get(r);w.onsuccess=function(){var R=w.result;R===void 0&&(R=null),M(R)&&(R=A(R)),f(R)},w.onerror=function(){u(w.error)}}catch(R){u(R)}})}).catch(u)});return T(l,a),l}function De(r,a){var i=this,l=new I(function(f,u){i.ready().then(function(){j(i._dbInfo,ne,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),w=b.openCursor(),R=1;w.onsuccess=function(){var O=w.result;if(O){var k=O.value;M(k)&&(k=A(k));var W=r(k,O.key,R++);W!==void 0?f(W):O.continue()}else f()},w.onerror=function(){u(w.error)}}catch(O){u(O)}})}).catch(u)});return T(l,a),l}function Wr(r,a,i){var l=this;r=B(r);var f=new I(function(u,h){var E;l.ready().then(function(){return E=l._dbInfo,pe.call(a)==="[object Blob]"?V(E.db).then(function(b){return b?a:_(a)}):a}).then(function(b){j(l._dbInfo,S,function(w,R){if(w)return h(w);try{var O=R.objectStore(l._dbInfo.storeName);b===null&&(b=void 0);var k=O.put(b,r);R.oncomplete=function(){b===void 0&&(b=null),u(b)},R.onabort=R.onerror=function(){var W=k.error?k.error:k.transaction.error;h(W)}}catch(W){h(W)}})}).catch(h)});return T(f,i),f}function Vr(r,a){var i=this;r=B(r);var l=new I(function(f,u){i.ready().then(function(){j(i._dbInfo,S,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),w=b.delete(r);E.oncomplete=function(){f()},E.onerror=function(){u(w.error)},E.onabort=function(){var R=w.error?w.error:w.transaction.error;u(R)}}catch(R){u(R)}})}).catch(u)});return T(l,a),l}function Yr(r){var a=this,i=new I(function(l,f){a.ready().then(function(){j(a._dbInfo,S,function(u,h){if(u)return f(u);try{var E=h.objectStore(a._dbInfo.storeName),b=E.clear();h.oncomplete=function(){l()},h.onabort=h.onerror=function(){var w=b.error?b.error:b.transaction.error;f(w)}}catch(w){f(w)}})}).catch(f)});return T(i,r),i}function Hr(r){var a=this,i=new I(function(l,f){a.ready().then(function(){j(a._dbInfo,ne,function(u,h){if(u)return f(u);try{var E=h.objectStore(a._dbInfo.storeName),b=E.count();b.onsuccess=function(){l(b.result)},b.onerror=function(){f(b.error)}}catch(w){f(w)}})}).catch(f)});return T(i,r),i}function Kr(r,a){var i=this,l=new I(function(f,u){if(r<0){f(null);return}i.ready().then(function(){j(i._dbInfo,ne,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),w=!1,R=b.openKeyCursor();R.onsuccess=function(){var O=R.result;if(!O){f(null);return}r===0||w?f(O.key):(w=!0,O.advance(r))},R.onerror=function(){u(R.error)}}catch(O){u(O)}})}).catch(u)});return T(l,a),l}function qr(r){var a=this,i=new I(function(l,f){a.ready().then(function(){j(a._dbInfo,ne,function(u,h){if(u)return f(u);try{var E=h.objectStore(a._dbInfo.storeName),b=E.openKeyCursor(),w=[];b.onsuccess=function(){var R=b.result;if(!R){l(w);return}w.push(R.key),R.continue()},b.onerror=function(){f(b.error)}}catch(R){f(R)}})}).catch(f)});return T(i,r),i}function Xr(r,a){a=L.apply(this,arguments);var i=this.config();r=typeof r!="function"&&r||{},r.name||(r.name=r.name||i.name,r.storeName=r.storeName||i.storeName);var l=this,f;if(!r.name)f=I.reject("Invalid arguments");else{var u=r.name===i.name&&l._dbInfo.db,h=u?I.resolve(l._dbInfo.db):ce(r).then(function(E){var b=C[r.name],w=b.forages;b.db=E;for(var R=0;R<w.length;R++)w[R]._dbInfo.db=E;return E});r.storeName?f=h.then(function(E){if(!!E.objectStoreNames.contains(r.storeName)){var b=E.version+1;Q(r);var w=C[r.name],R=w.forages;E.close();for(var O=0;O<R.length;O++){var k=R[O];k._dbInfo.db=null,k._dbInfo.version=b}var W=new I(function(Y,z){var X=g.open(r.name,b);X.onerror=function(ue){var xe=X.result;xe.close(),z(ue)},X.onupgradeneeded=function(){var ue=X.result;ue.deleteObjectStore(r.storeName)},X.onsuccess=function(){var ue=X.result;ue.close(),Y(ue)}});return W.then(function(Y){w.db=Y;for(var z=0;z<R.length;z++){var X=R[z];X._dbInfo.db=Y,ie(X._dbInfo)}}).catch(function(Y){throw(ae(r,Y)||I.resolve()).catch(function(){}),Y})}}):f=h.then(function(E){Q(r);var b=C[r.name],w=b.forages;E.close();for(var R=0;R<w.length;R++){var O=w[R];O._dbInfo.db=null}var k=new I(function(W,Y){var z=g.deleteDatabase(r.name);z.onerror=function(){var X=z.result;X&&X.close(),Y(z.error)},z.onblocked=function(){console.warn('dropInstance blocked for database "'+r.name+'" until all open connections are closed')},z.onsuccess=function(){var X=z.result;X&&X.close(),W(X)}});return k.then(function(W){b.db=W;for(var Y=0;Y<w.length;Y++){var z=w[Y];ie(z._dbInfo)}}).catch(function(W){throw(ae(r,W)||I.resolve()).catch(function(){}),W})})}return T(f,a),f}var zr={_driver:"asyncStorage",_initStorage:Re,_support:y(),iterate:De,getItem:Ee,setItem:Wr,removeItem:Vr,clear:Yr,length:Hr,key:Kr,keys:qr,dropInstance:Xr};function Jr(){return typeof openDatabase=="function"}var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qr="~~local_forage_type~",Lt=/^~~local_forage_type~([^~]+)~/,He="__lfsc__:",ct=He.length,lt="arbf",ft="blob",Mt="si08",$t="ui08",Pt="uic8",Dt="si16",Ct="si32",xt="ur16",Ut="ui32",Bt="fl32",kt="fl64",Ft=ct+lt.length,Gt=Object.prototype.toString;function jt(r){var a=r.length*.75,i=r.length,l,f=0,u,h,E,b;r[r.length-1]==="="&&(a--,r[r.length-2]==="="&&a--);var w=new ArrayBuffer(a),R=new Uint8Array(w);for(l=0;l<i;l+=4)u=me.indexOf(r[l]),h=me.indexOf(r[l+1]),E=me.indexOf(r[l+2]),b=me.indexOf(r[l+3]),R[f++]=u<<2|h>>4,R[f++]=(h&15)<<4|E>>2,R[f++]=(E&3)<<6|b&63;return w}function dt(r){var a=new Uint8Array(r),i="",l;for(l=0;l<a.length;l+=3)i+=me[a[l]>>2],i+=me[(a[l]&3)<<4|a[l+1]>>4],i+=me[(a[l+1]&15)<<2|a[l+2]>>6],i+=me[a[l+2]&63];return a.length%3===2?i=i.substring(0,i.length-1)+"=":a.length%3===1&&(i=i.substring(0,i.length-2)+"=="),i}function Zr(r,a){var i="";if(r&&(i=Gt.call(r)),r&&(i==="[object ArrayBuffer]"||r.buffer&&Gt.call(r.buffer)==="[object ArrayBuffer]")){var l,f=He;r instanceof ArrayBuffer?(l=r,f+=lt):(l=r.buffer,i==="[object Int8Array]"?f+=Mt:i==="[object Uint8Array]"?f+=$t:i==="[object Uint8ClampedArray]"?f+=Pt:i==="[object Int16Array]"?f+=Dt:i==="[object Uint16Array]"?f+=xt:i==="[object Int32Array]"?f+=Ct:i==="[object Uint32Array]"?f+=Ut:i==="[object Float32Array]"?f+=Bt:i==="[object Float64Array]"?f+=kt:a(new Error("Failed to get type for BinaryArray"))),a(f+dt(l))}else if(i==="[object Blob]"){var u=new FileReader;u.onload=function(){var h=Qr+r.type+"~"+dt(this.result);a(He+ft+h)},u.readAsArrayBuffer(r)}else try{a(JSON.stringify(r))}catch(h){console.error("Couldn't convert value into a JSON string: ",r),a(null,h)}}function en(r){if(r.substring(0,ct)!==He)return JSON.parse(r);var a=r.substring(Ft),i=r.substring(ct,Ft),l;if(i===ft&&Lt.test(a)){var f=a.match(Lt);l=f[1],a=a.substring(f[0].length)}var u=jt(a);switch(i){case lt:return u;case ft:return N([u],{type:l});case Mt:return new Int8Array(u);case $t:return new Uint8Array(u);case Pt:return new Uint8ClampedArray(u);case Dt:return new Int16Array(u);case xt:return new Uint16Array(u);case Ct:return new Int32Array(u);case Ut:return new Uint32Array(u);case Bt:return new Float32Array(u);case kt:return new Float64Array(u);default:throw new Error("Unkown type: "+i)}}var ht={serialize:Zr,deserialize:en,stringToBuffer:jt,bufferToString:dt};function Wt(r,a,i,l){r.executeSql("CREATE TABLE IF NOT EXISTS "+a.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],i,l)}function tn(r){var a=this,i={db:null};if(r)for(var l in r)i[l]=typeof r[l]!="string"?r[l].toString():r[l];var f=new I(function(u,h){try{i.db=openDatabase(i.name,String(i.version),i.description,i.size)}catch(E){return h(E)}i.db.transaction(function(E){Wt(E,i,function(){a._dbInfo=i,u()},function(b,w){h(w)})},h)});return i.serializer=ht,f}function ve(r,a,i,l,f,u){r.executeSql(i,l,f,function(h,E){E.code===E.SYNTAX_ERR?h.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[a.storeName],function(b,w){w.rows.length?u(b,E):Wt(b,a,function(){b.executeSql(i,l,f,u)},u)},u):u(h,E)},u)}function rn(r,a){var i=this;r=B(r);var l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"SELECT * FROM "+h.storeName+" WHERE key = ? LIMIT 1",[r],function(b,w){var R=w.rows.length?w.rows.item(0).value:null;R&&(R=h.serializer.deserialize(R)),f(R)},function(b,w){u(w)})})}).catch(u)});return T(l,a),l}function nn(r,a){var i=this,l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"SELECT * FROM "+h.storeName,[],function(b,w){for(var R=w.rows,O=R.length,k=0;k<O;k++){var W=R.item(k),Y=W.value;if(Y&&(Y=h.serializer.deserialize(Y)),Y=r(Y,W.key,k+1),Y!==void 0){f(Y);return}}f()},function(b,w){u(w)})})}).catch(u)});return T(l,a),l}function Vt(r,a,i,l){var f=this;r=B(r);var u=new I(function(h,E){f.ready().then(function(){a===void 0&&(a=null);var b=a,w=f._dbInfo;w.serializer.serialize(a,function(R,O){O?E(O):w.db.transaction(function(k){ve(k,w,"INSERT OR REPLACE INTO "+w.storeName+" (key, value) VALUES (?, ?)",[r,R],function(){h(b)},function(W,Y){E(Y)})},function(k){if(k.code===k.QUOTA_ERR){if(l>0){h(Vt.apply(f,[r,b,i,l-1]));return}E(k)}})})}).catch(E)});return T(u,i),u}function on(r,a,i){return Vt.apply(this,[r,a,i,1])}function an(r,a){var i=this;r=B(r);var l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"DELETE FROM "+h.storeName+" WHERE key = ?",[r],function(){f()},function(b,w){u(w)})})}).catch(u)});return T(l,a),l}function sn(r){var a=this,i=new I(function(l,f){a.ready().then(function(){var u=a._dbInfo;u.db.transaction(function(h){ve(h,u,"DELETE FROM "+u.storeName,[],function(){l()},function(E,b){f(b)})})}).catch(f)});return T(i,r),i}function un(r){var a=this,i=new I(function(l,f){a.ready().then(function(){var u=a._dbInfo;u.db.transaction(function(h){ve(h,u,"SELECT COUNT(key) as c FROM "+u.storeName,[],function(E,b){var w=b.rows.item(0).c;l(w)},function(E,b){f(b)})})}).catch(f)});return T(i,r),i}function cn(r,a){var i=this,l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"SELECT key FROM "+h.storeName+" WHERE id = ? LIMIT 1",[r+1],function(b,w){var R=w.rows.length?w.rows.item(0).key:null;f(R)},function(b,w){u(w)})})}).catch(u)});return T(l,a),l}function ln(r){var a=this,i=new I(function(l,f){a.ready().then(function(){var u=a._dbInfo;u.db.transaction(function(h){ve(h,u,"SELECT key FROM "+u.storeName,[],function(E,b){for(var w=[],R=0;R<b.rows.length;R++)w.push(b.rows.item(R).key);l(w)},function(E,b){f(b)})})}).catch(f)});return T(i,r),i}function fn(r){return new I(function(a,i){r.transaction(function(l){l.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,u){for(var h=[],E=0;E<u.rows.length;E++)h.push(u.rows.item(E).name);a({db:r,storeNames:h})},function(f,u){i(u)})},function(l){i(l)})})}function dn(r,a){a=L.apply(this,arguments);var i=this.config();r=typeof r!="function"&&r||{},r.name||(r.name=r.name||i.name,r.storeName=r.storeName||i.storeName);var l=this,f;return r.name?f=new I(function(u){var h;r.name===i.name?h=l._dbInfo.db:h=openDatabase(r.name,"","",0),r.storeName?u({db:h,storeNames:[r.storeName]}):u(fn(h))}).then(function(u){return new I(function(h,E){u.db.transaction(function(b){function w(W){return new I(function(Y,z){b.executeSql("DROP TABLE IF EXISTS "+W,[],function(){Y()},function(X,ue){z(ue)})})}for(var R=[],O=0,k=u.storeNames.length;O<k;O++)R.push(w(u.storeNames[O]));I.all(R).then(function(){h()}).catch(function(W){E(W)})},function(b){E(b)})})}):f=I.reject("Invalid arguments"),T(f,a),f}var hn={_driver:"webSQLStorage",_initStorage:tn,_support:Jr(),iterate:nn,getItem:rn,setItem:on,removeItem:an,clear:sn,length:un,key:cn,keys:ln,dropInstance:dn};function pn(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Yt(r,a){var i=r.name+"/";return r.storeName!==a.storeName&&(i+=r.storeName+"/"),i}function mn(){var r="_localforage_support_test";try{return localStorage.setItem(r,!0),localStorage.removeItem(r),!1}catch{return!0}}function vn(){return!mn()||localStorage.length>0}function gn(r){var a=this,i={};if(r)for(var l in r)i[l]=r[l];return i.keyPrefix=Yt(r,a._defaultConfig),vn()?(a._dbInfo=i,i.serializer=ht,I.resolve()):I.reject()}function yn(r){var a=this,i=a.ready().then(function(){for(var l=a._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var u=localStorage.key(f);u.indexOf(l)===0&&localStorage.removeItem(u)}});return T(i,r),i}function En(r,a){var i=this;r=B(r);var l=i.ready().then(function(){var f=i._dbInfo,u=localStorage.getItem(f.keyPrefix+r);return u&&(u=f.serializer.deserialize(u)),u});return T(l,a),l}function _n(r,a){var i=this,l=i.ready().then(function(){for(var f=i._dbInfo,u=f.keyPrefix,h=u.length,E=localStorage.length,b=1,w=0;w<E;w++){var R=localStorage.key(w);if(R.indexOf(u)===0){var O=localStorage.getItem(R);if(O&&(O=f.serializer.deserialize(O)),O=r(O,R.substring(h),b++),O!==void 0)return O}}});return T(l,a),l}function In(r,a){var i=this,l=i.ready().then(function(){var f=i._dbInfo,u;try{u=localStorage.key(r)}catch{u=null}return u&&(u=u.substring(f.keyPrefix.length)),u});return T(l,a),l}function bn(r){var a=this,i=a.ready().then(function(){for(var l=a._dbInfo,f=localStorage.length,u=[],h=0;h<f;h++){var E=localStorage.key(h);E.indexOf(l.keyPrefix)===0&&u.push(E.substring(l.keyPrefix.length))}return u});return T(i,r),i}function wn(r){var a=this,i=a.keys().then(function(l){return l.length});return T(i,r),i}function Rn(r,a){var i=this;r=B(r);var l=i.ready().then(function(){var f=i._dbInfo;localStorage.removeItem(f.keyPrefix+r)});return T(l,a),l}function An(r,a,i){var l=this;r=B(r);var f=l.ready().then(function(){a===void 0&&(a=null);var u=a;return new I(function(h,E){var b=l._dbInfo;b.serializer.serialize(a,function(w,R){if(R)E(R);else try{localStorage.setItem(b.keyPrefix+r,w),h(u)}catch(O){(O.name==="QuotaExceededError"||O.name==="NS_ERROR_DOM_QUOTA_REACHED")&&E(O),E(O)}})})});return T(f,i),f}function Sn(r,a){if(a=L.apply(this,arguments),r=typeof r!="function"&&r||{},!r.name){var i=this.config();r.name=r.name||i.name,r.storeName=r.storeName||i.storeName}var l=this,f;return r.name?f=new I(function(u){r.storeName?u(Yt(r,l._defaultConfig)):u(r.name+"/")}).then(function(u){for(var h=localStorage.length-1;h>=0;h--){var E=localStorage.key(h);E.indexOf(u)===0&&localStorage.removeItem(E)}}):f=I.reject("Invalid arguments"),T(f,a),f}var Nn={_driver:"localStorageWrapper",_initStorage:gn,_support:pn(),iterate:_n,getItem:En,setItem:An,removeItem:Rn,clear:yn,length:wn,key:In,keys:bn,dropInstance:Sn},Tn=function(a,i){return a===i||typeof a=="number"&&typeof i=="number"&&isNaN(a)&&isNaN(i)},On=function(a,i){for(var l=a.length,f=0;f<l;){if(Tn(a[f],i))return!0;f++}return!1},Ht=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"},Ce={},Kt={},Ae={INDEXEDDB:zr,WEBSQL:hn,LOCALSTORAGE:Nn},Ln=[Ae.INDEXEDDB._driver,Ae.WEBSQL._driver,Ae.LOCALSTORAGE._driver],Ke=["dropInstance"],pt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ke),Mn={description:"",driver:Ln.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function $n(r,a){r[a]=function(){var i=arguments;return r.ready().then(function(){return r[a].apply(r,i)})}}function mt(){for(var r=1;r<arguments.length;r++){var a=arguments[r];if(a)for(var i in a)a.hasOwnProperty(i)&&(Ht(a[i])?arguments[0][i]=a[i].slice():arguments[0][i]=a[i])}return arguments[0]}var Pn=function(){function r(a){p(this,r);for(var i in Ae)if(Ae.hasOwnProperty(i)){var l=Ae[i],f=l._driver;this[i]=f,Ce[f]||this.defineDriver(l)}this._defaultConfig=mt({},Mn),this._config=mt({},this._defaultConfig,a),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return r.prototype.config=function(i){if((typeof i>"u"?"undefined":m(i))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var l in i){if(l==="storeName"&&(i[l]=i[l].replace(/\W/g,"_")),l==="version"&&typeof i[l]!="number")return new Error("Database version must be a number.");this._config[l]=i[l]}return"driver"in i&&i.driver?this.setDriver(this._config.driver):!0}else return typeof i=="string"?this._config[i]:this._config},r.prototype.defineDriver=function(i,l,f){var u=new I(function(h,E){try{var b=i._driver,w=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!i._driver){E(w);return}for(var R=pt.concat("_initStorage"),O=0,k=R.length;O<k;O++){var W=R[O],Y=!On(Ke,W);if((Y||i[W])&&typeof i[W]!="function"){E(w);return}}var z=function(){for(var xe=function(xn){return function(){var Un=new Error("Method "+xn+" is not implemented by the current driver"),qt=I.reject(Un);return T(qt,arguments[arguments.length-1]),qt}},vt=0,Cn=Ke.length;vt<Cn;vt++){var gt=Ke[vt];i[gt]||(i[gt]=xe(gt))}};z();var X=function(xe){Ce[b]&&console.info("Redefining LocalForage driver: "+b),Ce[b]=i,Kt[b]=xe,h()};"_support"in i?i._support&&typeof i._support=="function"?i._support().then(X,E):X(!!i._support):X(!0)}catch(ue){E(ue)}});return P(u,l,f),u},r.prototype.driver=function(){return this._driver||null},r.prototype.getDriver=function(i,l,f){var u=Ce[i]?I.resolve(Ce[i]):I.reject(new Error("Driver not found."));return P(u,l,f),u},r.prototype.getSerializer=function(i){var l=I.resolve(ht);return P(l,i),l},r.prototype.ready=function(i){var l=this,f=l._driverSet.then(function(){return l._ready===null&&(l._ready=l._initDriver()),l._ready});return P(f,i,i),f},r.prototype.setDriver=function(i,l,f){var u=this;Ht(i)||(i=[i]);var h=this._getSupportedDrivers(i);function E(){u._config.driver=u.driver()}function b(O){return u._extend(O),E(),u._ready=u._initStorage(u._config),u._ready}function w(O){return function(){var k=0;function W(){for(;k<O.length;){var Y=O[k];return k++,u._dbInfo=null,u._ready=null,u.getDriver(Y).then(b).catch(W)}E();var z=new Error("No available storage method found.");return u._driverSet=I.reject(z),u._driverSet}return W()}}var R=this._driverSet!==null?this._driverSet.catch(function(){return I.resolve()}):I.resolve();return this._driverSet=R.then(function(){var O=h[0];return u._dbInfo=null,u._ready=null,u.getDriver(O).then(function(k){u._driver=k._driver,E(),u._wrapLibraryMethodsWithReady(),u._initDriver=w(h)})}).catch(function(){E();var O=new Error("No available storage method found.");return u._driverSet=I.reject(O),u._driverSet}),P(this._driverSet,l,f),this._driverSet},r.prototype.supports=function(i){return!!Kt[i]},r.prototype._extend=function(i){mt(this,i)},r.prototype._getSupportedDrivers=function(i){for(var l=[],f=0,u=i.length;f<u;f++){var h=i[f];this.supports(h)&&l.push(h)}return l},r.prototype._wrapLibraryMethodsWithReady=function(){for(var i=0,l=pt.length;i<l;i++)$n(this,pt[i])},r.prototype.createInstance=function(i){return new r(i)},r}(),Dn=new Pn;s.exports=Dn},{3:3}]},{},[4])(4)})});var jr=Zt((at,Gr)=>{(function(e,t){typeof at=="object"&&typeof Gr<"u"?t(at):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],t):t(e.LocalforageDriverMemory={})})(typeof self<"u"?self:at,function(e){"use strict";var t="localforage-driver-memory";function n(d){var _=typeof Symbol=="function"&&d[Symbol.iterator],A=0;return _?_.call(d):{next:function(){return d&&A>=d.length&&(d=void 0),{value:d&&d[A++],done:!d}}}}function o(d,_){d=d||[],_=_||{};try{return new Blob(d,_)}catch(x){if(x.name!=="TypeError")throw x;for(var A=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,M=new A,$=0;$<d.length;$+=1)M.append(d[$]);return M.getBlob(_.type)}}var s=/^~~local_forage_type~([^~]+)~/,c=9,m=c+4,p=Object.prototype.toString;function v(d){var _=d.length*.75,A=d.length;d[d.length-1]==="="&&(_--,d[d.length-2]==="="&&_--);for(var M=new ArrayBuffer(_),$=new Uint8Array(M),x=0,j=0;x<A;x+=4){var Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[x]),Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[x+1]),Ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[x+2]),De="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[x+3]);$[j++]=Z<<2|Re>>4,$[j++]=(Re&15)<<4|Ee>>2,$[j++]=(Ee&3)<<6|De&63}return M}function g(d){for(var _=new Uint8Array(d),A="",M=0;M<_.length;M+=3)A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_[M]>>2],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(_[M]&3)<<4|_[M+1]>>4],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(_[M+1]&15)<<2|_[M+2]>>6],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_[M+2]&63];return _.length%3===2?A=A.substring(0,A.length-1)+"=":_.length%3===1&&(A=A.substring(0,A.length-2)+"=="),A}function y(d,_){var A="";if(d&&(A=p.call(d)),d&&(A==="[object ArrayBuffer]"||d.buffer&&p.call(d.buffer)==="[object ArrayBuffer]")){var M=void 0,$="__lfsc__:";d instanceof ArrayBuffer?(M=d,$+="arbf"):(M=d.buffer,A==="[object Int8Array]"?$+="si08":A==="[object Uint8Array]"?$+="ui08":A==="[object Uint8ClampedArray]"?$+="uic8":A==="[object Int16Array]"?$+="si16":A==="[object Uint16Array]"?$+="ur16":A==="[object Int32Array]"?$+="si32":A==="[object Uint32Array]"?$+="ui32":A==="[object Float32Array]"?$+="fl32":A==="[object Float64Array]"?$+="fl64":_(new Error("Failed to get type for BinaryArray"))),_($+g(M))}else if(A==="[object Blob]"){var x=new FileReader;x.onload=function(){var j="~~local_forage_type~"+d.type+"~"+g(this.result);_("__lfsc__:blob"+j)},x.readAsArrayBuffer(d)}else try{_(JSON.stringify(d))}catch(j){console.error("Couldn't convert value into a JSON string: ",d),_(null,j)}}function N(d){if(d.substring(0,c)!=="__lfsc__:")return JSON.parse(d);var _=d.substring(m),A=d.substring(c,m),M;if(A==="blob"&&s.test(_)){var $=_.match(s);M=$[1],_=_.substring($[0].length)}var x=v(_);switch(A){case"arbf":return x;case"blob":return o([x],{type:M});case"si08":return new Int8Array(x);case"ui08":return new Uint8Array(x);case"uic8":return new Uint8ClampedArray(x);case"si16":return new Int16Array(x);case"ur16":return new Uint16Array(x);case"si32":return new Int32Array(x);case"ui32":return new Uint32Array(x);case"fl32":return new Float32Array(x);case"fl64":return new Float64Array(x);default:throw new Error("Unkown type: "+A)}}function I(d){var _,A;if(d===null||typeof d!="object"||"isActiveClone"in d)return d;var M=d instanceof Date?new Date(d):d.constructor();try{for(var $=n(Object.keys(d)),x=$.next();!x.done;x=$.next()){var j=x.value;Object.prototype.hasOwnProperty.call(d,j)&&(d.isActiveClone=null,M[j]=I(d[j]),delete d.isActiveClone)}}catch(Z){_={error:Z}}finally{try{x&&!x.done&&(A=$.return)&&A.call($)}finally{if(_)throw _.error}}return M}function T(d,_){return(d.name||_.name)+"/"+(d.storeName||_.storeName)+"/"}function P(d,_){_&&d.then(function(A){_(null,A)},function(A){_(A)})}function B(){for(var d=[],_=0;_<arguments.length;_++)d[_]=arguments[_];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function L(d,_){var A=this;if(_=B.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var M=this.config();d.name=d.name||M.name,d.storeName=d.storeName||M.storeName}var $;return d.name?$=new Promise(function(x){d.storeName?x(T(d,A._defaultConfig)):x(d.name+"/")}):$=Promise.reject("Invalid arguments"),{promise:$,callback:_}}function F(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}var J={bufferToString:g,deserialize:N,serialize:y,stringToBuffer:v},C={},pe=function(){function d(_){this.kp=_,this.data={}}return d.resolve=function(_){return C[_]||(C[_]=new d(_)),C[_]},d.prototype.clear=function(){this.data={}},d.prototype.drop=function(){this.clear(),delete C[this.kp]},d.prototype.get=function(_){return this.data[_]},d.prototype.key=function(_){return this.keys()[_]},d.prototype.keys=function(){return Object.keys(this.data)},d.prototype.rm=function(_){delete this.data[_]},d.prototype.set=function(_,A){this.data[_]=A},d}();function ne(d){var _=d?I(d):{},A=T(_,this._defaultConfig),M=pe.resolve(A);return this._dbInfo=_,this._dbInfo.serializer=J,this._dbInfo.keyPrefix=A,this._dbInfo.mStore=M,Promise.resolve()}function S(d){var _=this,A=this.ready().then(function(){_._dbInfo.mStore.clear()});return P(A,d),A}function G(d,_){var A=L.apply(this,arguments),M=A.promise,$=A.callback,x=M.then(function(j){pe.resolve(j).drop()});return P(x,$),M}function U(d,_){var A=this;d=F(d);var M=this.ready().then(function(){var $=A._dbInfo.mStore.get(d);return $==null?null:A._dbInfo.serializer.deserialize($)});return P(M,_),M}function V(d,_){var A=this,M=this.ready().then(function(){for(var $=A._dbInfo.mStore,x=$.keys(),j=0;j<x.length;j++){var Z=$.get(x[j]);if(Z&&(Z=A._dbInfo.serializer.deserialize(Z)),Z=d(Z,x[j],j+1),Z!==void 0)return Z}});return P(M,_),M}function Q(d,_){var A=this,M=this.ready().then(function(){var $;try{$=A._dbInfo.mStore.key(d),$===void 0&&($=null)}catch{$=null}return $});return P(M,_),M}function ie(d){var _=this,A=this.ready().then(function(){return _._dbInfo.mStore.keys()});return P(A,d),A}function ae(d){var _=this.keys().then(function(A){return A.length});return P(_,d),_}function se(d,_){var A=this;d=F(d);var M=this.ready().then(function(){A._dbInfo.mStore.rm(d)});return P(M,_),M}function ce(d,_,A){var M=this;d=F(d);var $=this.ready().then(function(){_===void 0&&(_=null);var x=_;return new Promise(function(j,Z){M._dbInfo.serializer.serialize(_,function(Re,Ee){if(Ee)Z(Ee);else try{M._dbInfo.mStore.set(d,Re),j(x)}catch(De){Z(De)}})})});return P($,A),$}var ye=!0;e._support=ye,e._driver=t,e._initStorage=ne,e.clear=S,e.dropInstance=G,e.getItem=U,e.iterate=V,e.key=Q,e.keys=ie,e.length=ae,e.removeItem=se,e.setItem=ce,Object.defineProperty(e,"__esModule",{value:!0})})});var Go={};er(Go,{default:()=>Fo});var le=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(le||{}),_e=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e))(_e||{}),Ne=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))(Ne||{}),D=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.SetAuthorizationToken="magic_auth_set_authorization_token",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="magic_get_info",e.ShowUI="magic_wallet",e.NFTPurchase="magic_nft_purchase",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.UpdatePhoneNumber="magic_auth_update_phone_number",e.UpdatePhoneNumberTestMode="magic_auth_update_phone_number_testing_mode",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e.MagicBoxHeartBeat="magic_box_heart_beat",e))(D||{}),fe=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",e))(fe||{}),Ie=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(Ie||{}),nr=(e=>(e.Harmony="HARMONY",e))(nr||{});var Vn=Object.create,it=Object.defineProperty,Yn=Object.defineProperties,Hn=Object.getOwnPropertyDescriptor,Kn=Object.getOwnPropertyDescriptors,qn=Object.getOwnPropertyNames,ir=Object.getOwnPropertySymbols,Xn=Object.getPrototypeOf,yr=Object.prototype.hasOwnProperty,zn=Object.prototype.propertyIsEnumerable,or=(e,t,n)=>t in e?it(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Er=(e,t)=>{for(var n in t||(t={}))yr.call(t,n)&&or(e,n,t[n]);if(ir)for(var n of ir(t))zn.call(t,n)&&or(e,n,t[n]);return e},Jn=(e,t)=>Yn(e,Kn(t)),Qn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zn=(e,t)=>{for(var n in t)it(e,n,{get:t[n],enumerable:!0})},ei=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of qn(t))!yr.call(e,s)&&s!==n&&it(e,s,{get:()=>t[s],enumerable:!(o=Hn(t,s))||o.enumerable});return e},ti=(e,t,n)=>(n=e!=null?Vn(Xn(e)):{},ei(t||!e||!e.__esModule?it(n,"default",{value:e,enumerable:!0}):n,e)),de=(e,t,n)=>new Promise((o,s)=>{var c=v=>{try{p(n.next(v))}catch(g){s(g)}},m=v=>{try{p(n.throw(v))}catch(g){s(g)}},p=v=>v.done?o(v.value):Promise.resolve(v.value).then(c,m);p((n=n.apply(e,t)).next())}),ri=Qn((e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty,o="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(o=!1));function c(g,y,N){this.fn=g,this.context=y,this.once=N||!1}function m(g,y,N,I,T){if(typeof N!="function")throw new TypeError("The listener must be a function");var P=new c(N,I||g,T),B=o?o+y:y;return g._events[B]?g._events[B].fn?g._events[B]=[g._events[B],P]:g._events[B].push(P):(g._events[B]=P,g._eventsCount++),g}function p(g,y){--g._eventsCount===0?g._events=new s:delete g._events[y]}function v(){this._events=new s,this._eventsCount=0}v.prototype.eventNames=function(){var g=[],y,N;if(this._eventsCount===0)return g;for(N in y=this._events)n.call(y,N)&&g.push(o?N.slice(1):N);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(y)):g},v.prototype.listeners=function(g){var y=o?o+g:g,N=this._events[y];if(!N)return[];if(N.fn)return[N.fn];for(var I=0,T=N.length,P=new Array(T);I<T;I++)P[I]=N[I].fn;return P},v.prototype.listenerCount=function(g){var y=o?o+g:g,N=this._events[y];return N?N.fn?1:N.length:0},v.prototype.emit=function(g,y,N,I,T,P){var B=o?o+g:g;if(!this._events[B])return!1;var L=this._events[B],F=arguments.length,J,C;if(L.fn){switch(L.once&&this.removeListener(g,L.fn,void 0,!0),F){case 1:return L.fn.call(L.context),!0;case 2:return L.fn.call(L.context,y),!0;case 3:return L.fn.call(L.context,y,N),!0;case 4:return L.fn.call(L.context,y,N,I),!0;case 5:return L.fn.call(L.context,y,N,I,T),!0;case 6:return L.fn.call(L.context,y,N,I,T,P),!0}for(C=1,J=new Array(F-1);C<F;C++)J[C-1]=arguments[C];L.fn.apply(L.context,J)}else{var pe=L.length,ne;for(C=0;C<pe;C++)switch(L[C].once&&this.removeListener(g,L[C].fn,void 0,!0),F){case 1:L[C].fn.call(L[C].context);break;case 2:L[C].fn.call(L[C].context,y);break;case 3:L[C].fn.call(L[C].context,y,N);break;case 4:L[C].fn.call(L[C].context,y,N,I);break;default:if(!J)for(ne=1,J=new Array(F-1);ne<F;ne++)J[ne-1]=arguments[ne];L[C].fn.apply(L[C].context,J)}}return!0},v.prototype.on=function(g,y,N){return m(this,g,y,N,!1)},v.prototype.once=function(g,y,N){return m(this,g,y,N,!0)},v.prototype.removeListener=function(g,y,N,I){var T=o?o+g:g;if(!this._events[T])return this;if(!y)return p(this,T),this;var P=this._events[T];if(P.fn)P.fn===y&&(!I||P.once)&&(!N||P.context===N)&&p(this,T);else{for(var B=0,L=[],F=P.length;B<F;B++)(P[B].fn!==y||I&&!P[B].once||N&&P[B].context!==N)&&L.push(P[B]);L.length?this._events[T]=L.length===1?L[0]:L:p(this,T)}return this},v.prototype.removeAllListeners=function(g){var y;return g?(y=o?o+g:g,this._events[y]&&p(this,y)):(this._events=new s,this._eventsCount=0),this},v.prototype.off=v.prototype.removeListener,v.prototype.addListener=v.prototype.on,v.prefixed=o,v.EventEmitter=v,typeof t<"u"&&(t.exports=v)});function ni(e){let t={exports:{}};return e(t,t.exports),t.exports}var ii=Number.MAX_SAFE_INTEGER||9007199254740991,It={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:ii,MAX_SAFE_COMPONENT_LENGTH:16},oi=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},H=oi,Ye=ni(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:n}=It,o=(t=e.exports={}).re=[],s=t.src=[],c=t.t={},m=0,p=(v,g,y)=>{let N=m++;H(N,g),c[v]=N,s[N]=g,o[N]=new RegExp(g,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","[0-9]+"),p("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),p("MAINVERSION",`(${s[c.NUMERICIDENTIFIER]})\\.(${s[c.NUMERICIDENTIFIER]})\\.(${s[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${s[c.NUMERICIDENTIFIERLOOSE]})\\.(${s[c.NUMERICIDENTIFIERLOOSE]})\\.(${s[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${s[c.NUMERICIDENTIFIER]}|${s[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${s[c.NUMERICIDENTIFIERLOOSE]}|${s[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${s[c.PRERELEASEIDENTIFIER]}(?:\\.${s[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${s[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER","[0-9A-Za-z-]+"),p("BUILD",`(?:\\+(${s[c.BUILDIDENTIFIER]}(?:\\.${s[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${s[c.MAINVERSION]}${s[c.PRERELEASE]}?${s[c.BUILD]}?`),p("FULL",`^${s[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${s[c.MAINVERSIONLOOSE]}${s[c.PRERELEASELOOSE]}?${s[c.BUILD]}?`),p("LOOSE",`^${s[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${s[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${s[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${s[c.XRANGEIDENTIFIER]})(?:\\.(${s[c.XRANGEIDENTIFIER]})(?:\\.(${s[c.XRANGEIDENTIFIER]})(?:${s[c.PRERELEASE]})?${s[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${s[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[c.XRANGEIDENTIFIERLOOSE]})(?:${s[c.PRERELEASELOOSE]})?${s[c.BUILD]}?)?)?`),p("XRANGE",`^${s[c.GTLT]}\\s*${s[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${s[c.GTLT]}\\s*${s[c.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",s[c.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${s[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${s[c.LONETILDE]}${s[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${s[c.LONETILDE]}${s[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${s[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${s[c.LONECARET]}${s[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${s[c.LONECARET]}${s[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${s[c.GTLT]}\\s*(${s[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${s[c.GTLT]}\\s*(${s[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${s[c.GTLT]}\\s*(${s[c.LOOSEPLAIN]}|${s[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${s[c.XRANGEPLAIN]})\\s+-\\s+(${s[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${s[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0.0.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),ar=/^[0-9]+$/,_r=(e,t)=>{let n=ar.test(e),o=ar.test(t);return n&&o&&(e=+e,t=+t),e===t?0:n&&!o?-1:o&&!n?1:e<t?-1:1},ai=(e,t)=>_r(t,e),si={compareIdentifiers:_r,rcompareIdentifiers:ai},{MAX_LENGTH:sr,MAX_SAFE_INTEGER:qe}=It,{re:ur,t:cr}=Ye,{compareIdentifiers:ke}=si,ee=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof ee){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>sr)throw new TypeError(`version is longer than ${sr} characters`);H("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?ur[cr.LOOSE]:ur[cr.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>qe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>qe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>qe||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<qe)return s}return o}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(H("SemVer.compare",this.version,this.options,e),!(e instanceof ee)){if(typeof e=="string"&&e===this.version)return 0;e=new ee(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof ee||(e=new ee(e,this.options)),ke(this.major,e.major)||ke(this.minor,e.minor)||ke(this.patch,e.patch)}comparePre(e){if(e instanceof ee||(e=new ee(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],o=e.prerelease[t];if(H("prerelease compare",t,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n!==o)return ke(n,o)}while(++t)}compareBuild(e){e instanceof ee||(e=new ee(e,this.options));let t=0;do{let n=this.build[t],o=e.build[t];if(H("prerelease compare",t,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n!==o)return ke(n,o)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);n===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},ui=(e,t,n)=>new ee(e,n).compare(new ee(t,n)),$e=ui,ci=(e,t,n)=>$e(e,t,n)===0,li=ci,fi=(e,t,n)=>$e(e,t,n)!==0,di=fi,hi=(e,t,n)=>$e(e,t,n)>0,pi=hi,mi=(e,t,n)=>$e(e,t,n)>=0,vi=mi,gi=(e,t,n)=>$e(e,t,n)<0,yi=gi,Ei=(e,t,n)=>$e(e,t,n)<=0,_i=Ei,Ii=(e,t,n,o)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return li(e,n,o);case"!=":return di(e,n,o);case">":return pi(e,n,o);case">=":return vi(e,n,o);case"<":return yi(e,n,o);case"<=":return _i(e,n,o);default:throw new TypeError(`Invalid operator: ${t}`)}},yt=Ii,Fe=Symbol("SemVer ANY"),je=class{static get ANY(){return Fe}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof je){if(e.loose===!!t.loose)return e;e=e.value}H("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Fe?this.value="":this.value=this.operator+this.semver.version,H("comp",this)}parse(e){let t=this.options.loose?lr[fr.COMPARATORLOOSE]:lr[fr.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new ee(n[2],this.options.loose):this.semver=Fe}toString(){return this.value}test(e){if(H("Comparator.test",e,this.options.loose),this.semver===Fe||e===Fe)return!0;if(typeof e=="string")try{e=new ee(e,this.options)}catch(t){return!1}return yt(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof je))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new Oe(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new Oe(this.value,t).test(e.semver);let n=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),o=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),s=this.semver.version===e.semver.version,c=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),m=yt(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),p=yt(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||o||s&&c||m||p}},{re:lr,t:fr}=Ye,Oe=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Oe)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Oe(e.raw,t);if(e instanceof je)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let n=t?re[te.HYPHENRANGELOOSE]:re[te.HYPHENRANGE];e=e.replace(n,Di(this.options.includePrerelease)),H("hyphen replace",e),e=e.replace(re[te.COMPARATORTRIM],bi),H("comparator trim",e,re[te.COMPARATORTRIM]),e=(e=(e=e.replace(re[te.TILDETRIM],wi)).replace(re[te.CARETTRIM],Ri)).split(/\s+/).join(" ");let o=t?re[te.COMPARATORLOOSE]:re[te.COMPARATOR];return e.split(" ").map(s=>Ai(s,this.options)).join(" ").split(/\s+/).map(s=>Pi(s,this.options)).filter(this.options.loose?s=>!!s.match(o):()=>!0).map(s=>new je(s,this.options))}intersects(e,t){if(!(e instanceof Oe))throw new TypeError("a Range is required");return this.set.some(n=>dr(n,t)&&e.set.some(o=>dr(o,t)&&n.every(s=>o.every(c=>s.intersects(c,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new ee(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Ci(this.set[t],e,this.options))return!0;return!1}},{re,t:te,comparatorTrimReplace:bi,tildeTrimReplace:wi,caretTrimReplace:Ri}=Ye,dr=(e,t)=>{let n=!0,o=e.slice(),s=o.pop();for(;n&&o.length;)n=o.every(c=>s.intersects(c,t)),s=o.pop();return n},Ai=(e,t)=>(H("comp",e,t),e=Ti(e,t),H("caret",e),e=Si(e,t),H("tildes",e),e=Li(e,t),H("xrange",e),e=$i(e,t),H("stars",e),e),oe=e=>!e||e.toLowerCase()==="x"||e==="*",Si=(e,t)=>e.trim().split(/\s+/).map(n=>Ni(n,t)).join(" "),Ni=(e,t)=>{let n=t.loose?re[te.TILDELOOSE]:re[te.TILDE];return e.replace(n,(o,s,c,m,p)=>{let v;return H("tilde",e,o,s,c,m,p),oe(s)?v="":oe(c)?v=`>=${s}.0.0 <${+s+1}.0.0-0`:oe(m)?v=`>=${s}.${c}.0 <${s}.${+c+1}.0-0`:p?(H("replaceTilde pr",p),v=`>=${s}.${c}.${m}-${p} <${s}.${+c+1}.0-0`):v=`>=${s}.${c}.${m} <${s}.${+c+1}.0-0`,H("tilde return",v),v})},Ti=(e,t)=>e.trim().split(/\s+/).map(n=>Oi(n,t)).join(" "),Oi=(e,t)=>{H("caret",e,t);let n=t.loose?re[te.CARETLOOSE]:re[te.CARET],o=t.includePrerelease?"-0":"";return e.replace(n,(s,c,m,p,v)=>{let g;return H("caret",e,s,c,m,p,v),oe(c)?g="":oe(m)?g=`>=${c}.0.0${o} <${+c+1}.0.0-0`:oe(p)?g=c==="0"?`>=${c}.${m}.0${o} <${c}.${+m+1}.0-0`:`>=${c}.${m}.0${o} <${+c+1}.0.0-0`:v?(H("replaceCaret pr",v),g=c==="0"?m==="0"?`>=${c}.${m}.${p}-${v} <${c}.${m}.${+p+1}-0`:`>=${c}.${m}.${p}-${v} <${c}.${+m+1}.0-0`:`>=${c}.${m}.${p}-${v} <${+c+1}.0.0-0`):(H("no pr"),g=c==="0"?m==="0"?`>=${c}.${m}.${p}${o} <${c}.${m}.${+p+1}-0`:`>=${c}.${m}.${p}${o} <${c}.${+m+1}.0-0`:`>=${c}.${m}.${p} <${+c+1}.0.0-0`),H("caret return",g),g})},Li=(e,t)=>(H("replaceXRanges",e,t),e.split(/\s+/).map(n=>Mi(n,t)).join(" ")),Mi=(e,t)=>{e=e.trim();let n=t.loose?re[te.XRANGELOOSE]:re[te.XRANGE];return e.replace(n,(o,s,c,m,p,v)=>{H("xRange",e,o,s,c,m,p,v);let g=oe(c),y=g||oe(m),N=y||oe(p),I=N;return s==="="&&I&&(s=""),v=t.includePrerelease?"-0":"",g?o=s===">"||s==="<"?"<0.0.0-0":"*":s&&I?(y&&(m=0),p=0,s===">"?(s=">=",y?(c=+c+1,m=0,p=0):(m=+m+1,p=0)):s==="<="&&(s="<",y?c=+c+1:m=+m+1),s==="<"&&(v="-0"),o=`${s+c}.${m}.${p}${v}`):y?o=`>=${c}.0.0${v} <${+c+1}.0.0-0`:N&&(o=`>=${c}.${m}.0${v} <${c}.${+m+1}.0-0`),H("xRange return",o),o})},$i=(e,t)=>(H("replaceStars",e,t),e.trim().replace(re[te.STAR],"")),Pi=(e,t)=>(H("replaceGTE0",e,t),e.trim().replace(re[t.includePrerelease?te.GTE0PRE:te.GTE0],"")),Di=e=>(t,n,o,s,c,m,p,v,g,y,N,I,T)=>`${n=oe(o)?"":oe(s)?`>=${o}.0.0${e?"-0":""}`:oe(c)?`>=${o}.${s}.0${e?"-0":""}`:m?`>=${n}`:`>=${n}${e?"-0":""}`} ${v=oe(g)?"":oe(y)?`<${+g+1}.0.0-0`:oe(N)?`<${g}.${+y+1}.0-0`:I?`<=${g}.${y}.${N}-${I}`:e?`<${g}.${y}.${+N+1}-0`:`<=${v}`}`.trim(),Ci=(e,t,n)=>{for(let o=0;o<e.length;o++)if(!e[o].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let o=0;o<e.length;o++)if(H(e[o].semver),e[o].semver!==je.ANY&&e[o].semver.prerelease.length>0){let s=e[o].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0},xi=(e,t,n)=>{try{t=new Oe(t,n)}catch(o){return!1}return t.test(e)},{MAX_LENGTH:Ui}=It,{re:hr,t:pr}=Ye,Bi=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof ee)return e;if(typeof e!="string"||e.length>Ui||!(t.loose?hr[pr.LOOSE]:hr[pr.FULL]).test(e))return null;try{return new ee(e,t)}catch(n){return null}},ki=Bi,{re:Xe,t:ze}=Ye,Fi=(e,t)=>{if(e instanceof ee)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let n=null;if((t=t||{}).rtl){let o;for(;(o=Xe[ze.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&o.index+o[0].length===n.index+n[0].length||(n=o),Xe[ze.COERCERTL].lastIndex=o.index+o[1].length+o[2].length;Xe[ze.COERCERTL].lastIndex=-1}else n=e.match(Xe[ze.COERCE]);return n===null?null:ki(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function Gi(e){return String.fromCharCode(parseInt(e.slice(1),16))}function ji(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function Wi(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,Gi))}function Vi(e){return decodeURIComponent(Array.from(atob(e),ji).join(""))}function Ir(e){return Wi(JSON.stringify(e))}function Yi(e){return JSON.parse(Vi(e))}function Ge(e){return typeof e=="undefined"}function Hi(e){return e===null}function br(e){return Hi(e)||Ge(e)}function Ki(e){return br(e)?!1:!Ge(e.jsonrpc)&&!Ge(e.id)&&(!Ge(e.result)||!Ge(e.error))}function qi(e){return br(e)?!1:typeof e=="number"&&Object.values(Ne).includes(e)}function Et(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var q={};function wr(e,t){return Object.assign(q,t),e}var Xi={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},he=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,he.prototype)}},Me=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=qi(t)?t:Ne.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,Me.prototype)}},Pe=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},ot=class extends Error{constructor(e,t,n,o){super(`Magic Extension Error (${e.name}): [${t}] ${n}`),this.code=t,this.rawMessage=n,this.data=o,this.__proto__=Error,Object.setPrototypeOf(this,ot.prototype)}},et=class{constructor(e,t,n){this.code=t,this.rawMessage=n,this.message=`Magic Extension Warning (${e.name}): [${t}] ${n}`}log(){console.warn(this.message)}};function zi(){return new he(le.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Rr(){return new he(le.ModalNotReady,"Modal is not ready.")}function Ji(){return new he(le.MalformedResponse,"Response from the Magic iframe is malformed.")}function Qi(e){return new he(le.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function Zi(e){let t=`Some extensions are incompatible with \`${q.sdkName}@${q.version}\`:`;return e.filter(n=>typeof n.compat!="undefined"&&n.compat!==null).forEach(n=>{let o=n.compat[q.sdkName];typeof o=="string"?t+=`
|
1
|
+
"use strict";var Magic=(()=>{var Wn=Object.create;var ke=Object.defineProperty;var Fn=Object.getOwnPropertyDescriptor;var Gn=Object.getOwnPropertyNames,Jt=Object.getOwnPropertySymbols,jn=Object.getPrototypeOf,Zt=Object.prototype.hasOwnProperty,Kn=Object.prototype.propertyIsEnumerable;var Qt=(e,t,n)=>t in e?ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,er=(e,t)=>{for(var n in t||(t={}))Zt.call(t,n)&&Qt(e,n,t[n]);if(Jt)for(var n of Jt(t))Kn.call(t,n)&&Qt(e,n,t[n]);return e};var We=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var tr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),rr=(e,t)=>{for(var n in t)ke(e,n,{get:t[n],enumerable:!0})},nr=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Gn(t))!Zt.call(e,s)&&s!==n&&ke(e,s,{get:()=>t[s],enumerable:!(o=Fn(t,s))||o.enumerable});return e};var ir=(e,t,n)=>(n=e!=null?Wn(jn(e)):{},nr(t||!e||!e.__esModule?ke(n,"default",{value:e,enumerable:!0}):n,e)),Yn=e=>nr(ke({},"__esModule",{value:!0}),e);var Ne=(e,t,n)=>new Promise((o,s)=>{var u=m=>{try{p(n.next(m))}catch(v){s(v)}},g=m=>{try{p(n.throw(m))}catch(v){s(v)}},p=m=>m.done?o(m.value):Promise.resolve(m.value).then(u,g);p((n=n.apply(e,t)).next())});var Gr=tr((Fr,Ot)=>{(function(e){if(typeof Fr=="object"&&typeof Ot<"u")Ot.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t=this,t.localforage=e()}})(function(){var e,t,n;return function o(s,u,g){function p(y,N){if(!u[y]){if(!s[y]){var I=typeof We=="function"&&We;if(!N&&I)return I(y,!0);if(m)return m(y,!0);var M=new Error("Cannot find module '"+y+"'");throw M.code="MODULE_NOT_FOUND",M}var $=u[y]={exports:{}};s[y][0].call($.exports,function(B){var O=s[y][1][B];return p(O||B)},$,$.exports,o,s,u,g)}return u[y].exports}for(var m=typeof We=="function"&&We,v=0;v<g.length;v++)p(g[v]);return p}({1:[function(o,s,u){(function(g){"use strict";var p=g.MutationObserver||g.WebKitMutationObserver,m;if(p){var v=0,y=new p(B),N=g.document.createTextNode("");y.observe(N,{characterData:!0}),m=function(){N.data=v=++v%2}}else if(!g.setImmediate&&typeof g.MessageChannel<"u"){var I=new g.MessageChannel;I.port1.onmessage=B,m=function(){I.port2.postMessage(0)}}else"document"in g&&"onreadystatechange"in g.document.createElement("script")?m=function(){var W=g.document.createElement("script");W.onreadystatechange=function(){B(),W.onreadystatechange=null,W.parentNode.removeChild(W),W=null},g.document.documentElement.appendChild(W)}:m=function(){setTimeout(B,0)};var M,$=[];function B(){M=!0;for(var W,J,C=$.length;C;){for(J=$,$=[],W=-1;++W<C;)J[W]();C=$.length}M=!1}s.exports=O;function O(W){$.push(W)===1&&!M&&m()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(o,s,u){"use strict";var g=o(1);function p(){}var m={},v=["REJECTED"],y=["FULFILLED"],N=["PENDING"];s.exports=I;function I(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=N,this.queue=[],this.outcome=void 0,S!==p&&O(this,S)}I.prototype.catch=function(S){return this.then(null,S)},I.prototype.then=function(S,F){if(typeof S!="function"&&this.state===y||typeof F!="function"&&this.state===v)return this;var U=new this.constructor(p);if(this.state!==N){var K=this.state===y?S:F;$(U,K,this.outcome)}else this.queue.push(new M(U,S,F));return U};function M(S,F,U){this.promise=S,typeof F=="function"&&(this.onFulfilled=F,this.callFulfilled=this.otherCallFulfilled),typeof U=="function"&&(this.onRejected=U,this.callRejected=this.otherCallRejected)}M.prototype.callFulfilled=function(S){m.resolve(this.promise,S)},M.prototype.otherCallFulfilled=function(S){$(this.promise,this.onFulfilled,S)},M.prototype.callRejected=function(S){m.reject(this.promise,S)},M.prototype.otherCallRejected=function(S){$(this.promise,this.onRejected,S)};function $(S,F,U){g(function(){var K;try{K=F(U)}catch(Q){return m.reject(S,Q)}K===S?m.reject(S,new TypeError("Cannot resolve promise with itself")):m.resolve(S,K)})}m.resolve=function(S,F){var U=W(B,F);if(U.status==="error")return m.reject(S,U.value);var K=U.value;if(K)O(S,K);else{S.state=y,S.outcome=F;for(var Q=-1,ie=S.queue.length;++Q<ie;)S.queue[Q].callFulfilled(F)}return S},m.reject=function(S,F){S.state=v,S.outcome=F;for(var U=-1,K=S.queue.length;++U<K;)S.queue[U].callRejected(F);return S};function B(S){var F=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof F=="function")return function(){F.apply(S,arguments)}}function O(S,F){var U=!1;function K(se){U||(U=!0,m.reject(S,se))}function Q(se){U||(U=!0,m.resolve(S,se))}function ie(){F(Q,K)}var ae=W(ie);ae.status==="error"&&K(ae.value)}function W(S,F){var U={};try{U.value=S(F),U.status="success"}catch(K){U.status="error",U.value=K}return U}I.resolve=J;function J(S){return S instanceof this?S:m.resolve(new this(p),S)}I.reject=C;function C(S){var F=new this(p);return m.reject(F,S)}I.all=me;function me(S){var F=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var U=S.length,K=!1;if(!U)return this.resolve([]);for(var Q=new Array(U),ie=0,ae=-1,se=new this(p);++ae<U;)fe(S[ae],ae);return se;function fe(Ee,d){F.resolve(Ee).then(_,function(A){K||(K=!0,m.reject(se,A))});function _(A){Q[d]=A,++ie===U&&!K&&(K=!0,m.resolve(se,Q))}}}I.race=ne;function ne(S){var F=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var U=S.length,K=!1;if(!U)return this.resolve([]);for(var Q=-1,ie=new this(p);++Q<U;)ae(S[Q]);return ie;function ae(se){F.resolve(se).then(function(fe){K||(K=!0,m.resolve(ie,fe))},function(fe){K||(K=!0,m.reject(ie,fe))})}}},{1:1}],3:[function(o,s,u){(function(g){"use strict";typeof g.Promise!="function"&&(g.Promise=o(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(o,s,u){"use strict";var g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};function p(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function m(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var v=m();function y(){try{if(!v||!v.open)return!1;var r=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),a=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!r||a)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function N(r,a){r=r||[],a=a||{};try{return new Blob(r,a)}catch(l){if(l.name!=="TypeError")throw l;for(var i=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,c=new i,f=0;f<r.length;f+=1)c.append(r[f]);return c.getBlob(a.type)}}typeof Promise>"u"&&o(3);var I=Promise;function M(r,a){a&&r.then(function(i){a(null,i)},function(i){a(i)})}function $(r,a,i){typeof a=="function"&&r.then(a),typeof i=="function"&&r.catch(i)}function B(r){return typeof r!="string"&&(console.warn(r+" used as a key, but it is not a string."),r=String(r)),r}function O(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var W="local-forage-detect-blob-support",J=void 0,C={},me=Object.prototype.toString,ne="readonly",S="readwrite";function F(r){for(var a=r.length,i=new ArrayBuffer(a),c=new Uint8Array(i),f=0;f<a;f++)c[f]=r.charCodeAt(f);return i}function U(r){return new I(function(a){var i=r.transaction(W,S),c=N([""]);i.objectStore(W).put(c,"key"),i.onabort=function(f){f.preventDefault(),f.stopPropagation(),a(!1)},i.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),l=navigator.userAgent.match(/Edge\//);a(l||!f||parseInt(f[1],10)>=43)}}).catch(function(){return!1})}function K(r){return typeof J=="boolean"?I.resolve(J):U(r).then(function(a){return J=a,J})}function Q(r){var a=C[r.name],i={};i.promise=new I(function(c,f){i.resolve=c,i.reject=f}),a.deferredOperations.push(i),a.dbReady?a.dbReady=a.dbReady.then(function(){return i.promise}):a.dbReady=i.promise}function ie(r){var a=C[r.name],i=a.deferredOperations.pop();if(i)return i.resolve(),i.promise}function ae(r,a){var i=C[r.name],c=i.deferredOperations.pop();if(c)return c.reject(a),c.promise}function se(r,a){return new I(function(i,c){if(C[r.name]=C[r.name]||Z(),r.db)if(a)Q(r),r.db.close();else return i(r.db);var f=[r.name];a&&f.push(r.version);var l=v.open.apply(v,f);a&&(l.onupgradeneeded=function(h){var E=l.result;try{E.createObjectStore(r.storeName),h.oldVersion<=1&&E.createObjectStore(W)}catch(b){if(b.name==="ConstraintError")console.warn('The database "'+r.name+'" has been upgraded from version '+h.oldVersion+" to version "+h.newVersion+', but the storage "'+r.storeName+'" already exists.');else throw b}}),l.onerror=function(h){h.preventDefault(),c(l.error)},l.onsuccess=function(){var h=l.result;h.onversionchange=function(E){E.target.close()},i(h),ie(r)}})}function fe(r){return se(r,!1)}function Ee(r){return se(r,!0)}function d(r,a){if(!r.db)return!0;var i=!r.db.objectStoreNames.contains(r.storeName),c=r.version<r.db.version,f=r.version>r.db.version;if(c&&(r.version!==a&&console.warn('The database "'+r.name+`" can't be downgraded from version `+r.db.version+" to version "+r.version+"."),r.version=r.db.version),f||i){if(i){var l=r.db.version+1;l>r.version&&(r.version=l)}return!0}return!1}function _(r){return new I(function(a,i){var c=new FileReader;c.onerror=i,c.onloadend=function(f){var l=btoa(f.target.result||"");a({__local_forage_encoded_blob:!0,data:l,type:r.type})},c.readAsBinaryString(r)})}function A(r){var a=F(atob(r.data));return N([a],{type:r.type})}function L(r){return r&&r.__local_forage_encoded_blob}function P(r){var a=this,i=a._initReady().then(function(){var c=C[a._dbInfo.name];if(c&&c.dbReady)return c.dbReady});return $(i,r,r),i}function D(r){Q(r);for(var a=C[r.name],i=a.forages,c=0;c<i.length;c++){var f=i[c];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null)}return r.db=null,fe(r).then(function(l){return r.db=l,d(r)?Ee(r):l}).then(function(l){r.db=a.db=l;for(var h=0;h<i.length;h++)i[h]._dbInfo.db=l}).catch(function(l){throw ae(r,l),l})}function G(r,a,i,c){c===void 0&&(c=1);try{var f=r.db.transaction(r.storeName,a);i(null,f)}catch(l){if(c>0&&(!r.db||l.name==="InvalidStateError"||l.name==="NotFoundError"))return I.resolve().then(function(){if(!r.db||l.name==="NotFoundError"&&!r.db.objectStoreNames.contains(r.storeName)&&r.version<=r.db.version)return r.db&&(r.version=r.db.version+1),Ee(r)}).then(function(){return D(r).then(function(){G(r,a,i,c-1)})}).catch(i);i(l)}}function Z(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ae(r){var a=this,i={db:null};if(r)for(var c in r)i[c]=r[c];var f=C[i.name];f||(f=Z(),C[i.name]=f),f.forages.push(a),a._initReady||(a._initReady=a.ready,a.ready=P);var l=[];function h(){return I.resolve()}for(var E=0;E<f.forages.length;E++){var b=f.forages[E];b!==a&&l.push(b._initReady().catch(h))}var w=f.forages.slice(0);return I.all(l).then(function(){return i.db=f.db,fe(i)}).then(function(R){return i.db=R,d(i,a._defaultConfig.version)?Ee(i):R}).then(function(R){i.db=f.db=R,a._dbInfo=i;for(var T=0;T<w.length;T++){var k=w[T];k!==a&&(k._dbInfo.db=i.db,k._dbInfo.version=i.version)}})}function _e(r,a){var i=this;r=B(r);var c=new I(function(f,l){i.ready().then(function(){G(i._dbInfo,ne,function(h,E){if(h)return l(h);try{var b=E.objectStore(i._dbInfo.storeName),w=b.get(r);w.onsuccess=function(){var R=w.result;R===void 0&&(R=null),L(R)&&(R=A(R)),f(R)},w.onerror=function(){l(w.error)}}catch(R){l(R)}})}).catch(l)});return M(c,a),c}function xe(r,a){var i=this,c=new I(function(f,l){i.ready().then(function(){G(i._dbInfo,ne,function(h,E){if(h)return l(h);try{var b=E.objectStore(i._dbInfo.storeName),w=b.openCursor(),R=1;w.onsuccess=function(){var T=w.result;if(T){var k=T.value;L(k)&&(k=A(k));var j=r(k,T.key,R++);j!==void 0?f(j):T.continue()}else f()},w.onerror=function(){l(w.error)}}catch(T){l(T)}})}).catch(l)});return M(c,a),c}function Yr(r,a,i){var c=this;r=B(r);var f=new I(function(l,h){var E;c.ready().then(function(){return E=c._dbInfo,me.call(a)==="[object Blob]"?K(E.db).then(function(b){return b?a:_(a)}):a}).then(function(b){G(c._dbInfo,S,function(w,R){if(w)return h(w);try{var T=R.objectStore(c._dbInfo.storeName);b===null&&(b=void 0);var k=T.put(b,r);R.oncomplete=function(){b===void 0&&(b=null),l(b)},R.onabort=R.onerror=function(){var j=k.error?k.error:k.transaction.error;h(j)}}catch(j){h(j)}})}).catch(h)});return M(f,i),f}function Hr(r,a){var i=this;r=B(r);var c=new I(function(f,l){i.ready().then(function(){G(i._dbInfo,S,function(h,E){if(h)return l(h);try{var b=E.objectStore(i._dbInfo.storeName),w=b.delete(r);E.oncomplete=function(){f()},E.onerror=function(){l(w.error)},E.onabort=function(){var R=w.error?w.error:w.transaction.error;l(R)}}catch(R){l(R)}})}).catch(l)});return M(c,a),c}function qr(r){var a=this,i=new I(function(c,f){a.ready().then(function(){G(a._dbInfo,S,function(l,h){if(l)return f(l);try{var E=h.objectStore(a._dbInfo.storeName),b=E.clear();h.oncomplete=function(){c()},h.onabort=h.onerror=function(){var w=b.error?b.error:b.transaction.error;f(w)}}catch(w){f(w)}})}).catch(f)});return M(i,r),i}function Vr(r){var a=this,i=new I(function(c,f){a.ready().then(function(){G(a._dbInfo,ne,function(l,h){if(l)return f(l);try{var E=h.objectStore(a._dbInfo.storeName),b=E.count();b.onsuccess=function(){c(b.result)},b.onerror=function(){f(b.error)}}catch(w){f(w)}})}).catch(f)});return M(i,r),i}function Xr(r,a){var i=this,c=new I(function(f,l){if(r<0){f(null);return}i.ready().then(function(){G(i._dbInfo,ne,function(h,E){if(h)return l(h);try{var b=E.objectStore(i._dbInfo.storeName),w=!1,R=b.openKeyCursor();R.onsuccess=function(){var T=R.result;if(!T){f(null);return}r===0||w?f(T.key):(w=!0,T.advance(r))},R.onerror=function(){l(R.error)}}catch(T){l(T)}})}).catch(l)});return M(c,a),c}function zr(r){var a=this,i=new I(function(c,f){a.ready().then(function(){G(a._dbInfo,ne,function(l,h){if(l)return f(l);try{var E=h.objectStore(a._dbInfo.storeName),b=E.openKeyCursor(),w=[];b.onsuccess=function(){var R=b.result;if(!R){c(w);return}w.push(R.key),R.continue()},b.onerror=function(){f(b.error)}}catch(R){f(R)}})}).catch(f)});return M(i,r),i}function Jr(r,a){a=O.apply(this,arguments);var i=this.config();r=typeof r!="function"&&r||{},r.name||(r.name=r.name||i.name,r.storeName=r.storeName||i.storeName);var c=this,f;if(!r.name)f=I.reject("Invalid arguments");else{var l=r.name===i.name&&c._dbInfo.db,h=l?I.resolve(c._dbInfo.db):fe(r).then(function(E){var b=C[r.name],w=b.forages;b.db=E;for(var R=0;R<w.length;R++)w[R]._dbInfo.db=E;return E});r.storeName?f=h.then(function(E){if(!!E.objectStoreNames.contains(r.storeName)){var b=E.version+1;Q(r);var w=C[r.name],R=w.forages;E.close();for(var T=0;T<R.length;T++){var k=R[T];k._dbInfo.db=null,k._dbInfo.version=b}var j=new I(function(Y,X){var V=v.open(r.name,b);V.onerror=function(ce){var Be=V.result;Be.close(),X(ce)},V.onupgradeneeded=function(){var ce=V.result;ce.deleteObjectStore(r.storeName)},V.onsuccess=function(){var ce=V.result;ce.close(),Y(ce)}});return j.then(function(Y){w.db=Y;for(var X=0;X<R.length;X++){var V=R[X];V._dbInfo.db=Y,ie(V._dbInfo)}}).catch(function(Y){throw(ae(r,Y)||I.resolve()).catch(function(){}),Y})}}):f=h.then(function(E){Q(r);var b=C[r.name],w=b.forages;E.close();for(var R=0;R<w.length;R++){var T=w[R];T._dbInfo.db=null}var k=new I(function(j,Y){var X=v.deleteDatabase(r.name);X.onerror=function(){var V=X.result;V&&V.close(),Y(X.error)},X.onblocked=function(){console.warn('dropInstance blocked for database "'+r.name+'" until all open connections are closed')},X.onsuccess=function(){var V=X.result;V&&V.close(),j(V)}});return k.then(function(j){b.db=j;for(var Y=0;Y<w.length;Y++){var X=w[Y];ie(X._dbInfo)}}).catch(function(j){throw(ae(r,j)||I.resolve()).catch(function(){}),j})})}return M(f,a),f}var Qr={_driver:"asyncStorage",_initStorage:Ae,_support:y(),iterate:xe,getItem:_e,setItem:Yr,removeItem:Hr,clear:qr,length:Vr,key:Xr,keys:zr,dropInstance:Jr};function Zr(){return typeof openDatabase=="function"}var ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",en="~~local_forage_type~",Pt=/^~~local_forage_type~([^~]+)~/,Ve="__lfsc__:",ft=Ve.length,dt="arbf",ht="blob",$t="si08",Ct="ui08",Dt="uic8",xt="si16",Ut="si32",Bt="ur16",kt="ui32",Wt="fl32",Ft="fl64",Gt=ft+dt.length,jt=Object.prototype.toString;function Kt(r){var a=r.length*.75,i=r.length,c,f=0,l,h,E,b;r[r.length-1]==="="&&(a--,r[r.length-2]==="="&&a--);var w=new ArrayBuffer(a),R=new Uint8Array(w);for(c=0;c<i;c+=4)l=ve.indexOf(r[c]),h=ve.indexOf(r[c+1]),E=ve.indexOf(r[c+2]),b=ve.indexOf(r[c+3]),R[f++]=l<<2|h>>4,R[f++]=(h&15)<<4|E>>2,R[f++]=(E&3)<<6|b&63;return w}function pt(r){var a=new Uint8Array(r),i="",c;for(c=0;c<a.length;c+=3)i+=ve[a[c]>>2],i+=ve[(a[c]&3)<<4|a[c+1]>>4],i+=ve[(a[c+1]&15)<<2|a[c+2]>>6],i+=ve[a[c+2]&63];return a.length%3===2?i=i.substring(0,i.length-1)+"=":a.length%3===1&&(i=i.substring(0,i.length-2)+"=="),i}function tn(r,a){var i="";if(r&&(i=jt.call(r)),r&&(i==="[object ArrayBuffer]"||r.buffer&&jt.call(r.buffer)==="[object ArrayBuffer]")){var c,f=Ve;r instanceof ArrayBuffer?(c=r,f+=dt):(c=r.buffer,i==="[object Int8Array]"?f+=$t:i==="[object Uint8Array]"?f+=Ct:i==="[object Uint8ClampedArray]"?f+=Dt:i==="[object Int16Array]"?f+=xt:i==="[object Uint16Array]"?f+=Bt:i==="[object Int32Array]"?f+=Ut:i==="[object Uint32Array]"?f+=kt:i==="[object Float32Array]"?f+=Wt:i==="[object Float64Array]"?f+=Ft:a(new Error("Failed to get type for BinaryArray"))),a(f+pt(c))}else if(i==="[object Blob]"){var l=new FileReader;l.onload=function(){var h=en+r.type+"~"+pt(this.result);a(Ve+ht+h)},l.readAsArrayBuffer(r)}else try{a(JSON.stringify(r))}catch(h){console.error("Couldn't convert value into a JSON string: ",r),a(null,h)}}function rn(r){if(r.substring(0,ft)!==Ve)return JSON.parse(r);var a=r.substring(Gt),i=r.substring(ft,Gt),c;if(i===ht&&Pt.test(a)){var f=a.match(Pt);c=f[1],a=a.substring(f[0].length)}var l=Kt(a);switch(i){case dt:return l;case ht:return N([l],{type:c});case $t:return new Int8Array(l);case Ct:return new Uint8Array(l);case Dt:return new Uint8ClampedArray(l);case xt:return new Int16Array(l);case Bt:return new Uint16Array(l);case Ut:return new Int32Array(l);case kt:return new Uint32Array(l);case Wt:return new Float32Array(l);case Ft:return new Float64Array(l);default:throw new Error("Unkown type: "+i)}}var mt={serialize:tn,deserialize:rn,stringToBuffer:Kt,bufferToString:pt};function Yt(r,a,i,c){r.executeSql("CREATE TABLE IF NOT EXISTS "+a.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],i,c)}function nn(r){var a=this,i={db:null};if(r)for(var c in r)i[c]=typeof r[c]!="string"?r[c].toString():r[c];var f=new I(function(l,h){try{i.db=openDatabase(i.name,String(i.version),i.description,i.size)}catch(E){return h(E)}i.db.transaction(function(E){Yt(E,i,function(){a._dbInfo=i,l()},function(b,w){h(w)})},h)});return i.serializer=mt,f}function ge(r,a,i,c,f,l){r.executeSql(i,c,f,function(h,E){E.code===E.SYNTAX_ERR?h.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[a.storeName],function(b,w){w.rows.length?l(b,E):Yt(b,a,function(){b.executeSql(i,c,f,l)},l)},l):l(h,E)},l)}function on(r,a){var i=this;r=B(r);var c=new I(function(f,l){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ge(E,h,"SELECT * FROM "+h.storeName+" WHERE key = ? LIMIT 1",[r],function(b,w){var R=w.rows.length?w.rows.item(0).value:null;R&&(R=h.serializer.deserialize(R)),f(R)},function(b,w){l(w)})})}).catch(l)});return M(c,a),c}function an(r,a){var i=this,c=new I(function(f,l){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ge(E,h,"SELECT * FROM "+h.storeName,[],function(b,w){for(var R=w.rows,T=R.length,k=0;k<T;k++){var j=R.item(k),Y=j.value;if(Y&&(Y=h.serializer.deserialize(Y)),Y=r(Y,j.key,k+1),Y!==void 0){f(Y);return}}f()},function(b,w){l(w)})})}).catch(l)});return M(c,a),c}function Ht(r,a,i,c){var f=this;r=B(r);var l=new I(function(h,E){f.ready().then(function(){a===void 0&&(a=null);var b=a,w=f._dbInfo;w.serializer.serialize(a,function(R,T){T?E(T):w.db.transaction(function(k){ge(k,w,"INSERT OR REPLACE INTO "+w.storeName+" (key, value) VALUES (?, ?)",[r,R],function(){h(b)},function(j,Y){E(Y)})},function(k){if(k.code===k.QUOTA_ERR){if(c>0){h(Ht.apply(f,[r,b,i,c-1]));return}E(k)}})})}).catch(E)});return M(l,i),l}function sn(r,a,i){return Ht.apply(this,[r,a,i,1])}function ln(r,a){var i=this;r=B(r);var c=new I(function(f,l){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ge(E,h,"DELETE FROM "+h.storeName+" WHERE key = ?",[r],function(){f()},function(b,w){l(w)})})}).catch(l)});return M(c,a),c}function un(r){var a=this,i=new I(function(c,f){a.ready().then(function(){var l=a._dbInfo;l.db.transaction(function(h){ge(h,l,"DELETE FROM "+l.storeName,[],function(){c()},function(E,b){f(b)})})}).catch(f)});return M(i,r),i}function cn(r){var a=this,i=new I(function(c,f){a.ready().then(function(){var l=a._dbInfo;l.db.transaction(function(h){ge(h,l,"SELECT COUNT(key) as c FROM "+l.storeName,[],function(E,b){var w=b.rows.item(0).c;c(w)},function(E,b){f(b)})})}).catch(f)});return M(i,r),i}function fn(r,a){var i=this,c=new I(function(f,l){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ge(E,h,"SELECT key FROM "+h.storeName+" WHERE id = ? LIMIT 1",[r+1],function(b,w){var R=w.rows.length?w.rows.item(0).key:null;f(R)},function(b,w){l(w)})})}).catch(l)});return M(c,a),c}function dn(r){var a=this,i=new I(function(c,f){a.ready().then(function(){var l=a._dbInfo;l.db.transaction(function(h){ge(h,l,"SELECT key FROM "+l.storeName,[],function(E,b){for(var w=[],R=0;R<b.rows.length;R++)w.push(b.rows.item(R).key);c(w)},function(E,b){f(b)})})}).catch(f)});return M(i,r),i}function hn(r){return new I(function(a,i){r.transaction(function(c){c.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,l){for(var h=[],E=0;E<l.rows.length;E++)h.push(l.rows.item(E).name);a({db:r,storeNames:h})},function(f,l){i(l)})},function(c){i(c)})})}function pn(r,a){a=O.apply(this,arguments);var i=this.config();r=typeof r!="function"&&r||{},r.name||(r.name=r.name||i.name,r.storeName=r.storeName||i.storeName);var c=this,f;return r.name?f=new I(function(l){var h;r.name===i.name?h=c._dbInfo.db:h=openDatabase(r.name,"","",0),r.storeName?l({db:h,storeNames:[r.storeName]}):l(hn(h))}).then(function(l){return new I(function(h,E){l.db.transaction(function(b){function w(j){return new I(function(Y,X){b.executeSql("DROP TABLE IF EXISTS "+j,[],function(){Y()},function(V,ce){X(ce)})})}for(var R=[],T=0,k=l.storeNames.length;T<k;T++)R.push(w(l.storeNames[T]));I.all(R).then(function(){h()}).catch(function(j){E(j)})},function(b){E(b)})})}):f=I.reject("Invalid arguments"),M(f,a),f}var mn={_driver:"webSQLStorage",_initStorage:nn,_support:Zr(),iterate:an,getItem:on,setItem:sn,removeItem:ln,clear:un,length:cn,key:fn,keys:dn,dropInstance:pn};function vn(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qt(r,a){var i=r.name+"/";return r.storeName!==a.storeName&&(i+=r.storeName+"/"),i}function gn(){var r="_localforage_support_test";try{return localStorage.setItem(r,!0),localStorage.removeItem(r),!1}catch{return!0}}function yn(){return!gn()||localStorage.length>0}function En(r){var a=this,i={};if(r)for(var c in r)i[c]=r[c];return i.keyPrefix=qt(r,a._defaultConfig),yn()?(a._dbInfo=i,i.serializer=mt,I.resolve()):I.reject()}function _n(r){var a=this,i=a.ready().then(function(){for(var c=a._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var l=localStorage.key(f);l.indexOf(c)===0&&localStorage.removeItem(l)}});return M(i,r),i}function In(r,a){var i=this;r=B(r);var c=i.ready().then(function(){var f=i._dbInfo,l=localStorage.getItem(f.keyPrefix+r);return l&&(l=f.serializer.deserialize(l)),l});return M(c,a),c}function bn(r,a){var i=this,c=i.ready().then(function(){for(var f=i._dbInfo,l=f.keyPrefix,h=l.length,E=localStorage.length,b=1,w=0;w<E;w++){var R=localStorage.key(w);if(R.indexOf(l)===0){var T=localStorage.getItem(R);if(T&&(T=f.serializer.deserialize(T)),T=r(T,R.substring(h),b++),T!==void 0)return T}}});return M(c,a),c}function wn(r,a){var i=this,c=i.ready().then(function(){var f=i._dbInfo,l;try{l=localStorage.key(r)}catch{l=null}return l&&(l=l.substring(f.keyPrefix.length)),l});return M(c,a),c}function Rn(r){var a=this,i=a.ready().then(function(){for(var c=a._dbInfo,f=localStorage.length,l=[],h=0;h<f;h++){var E=localStorage.key(h);E.indexOf(c.keyPrefix)===0&&l.push(E.substring(c.keyPrefix.length))}return l});return M(i,r),i}function An(r){var a=this,i=a.keys().then(function(c){return c.length});return M(i,r),i}function Sn(r,a){var i=this;r=B(r);var c=i.ready().then(function(){var f=i._dbInfo;localStorage.removeItem(f.keyPrefix+r)});return M(c,a),c}function Nn(r,a,i){var c=this;r=B(r);var f=c.ready().then(function(){a===void 0&&(a=null);var l=a;return new I(function(h,E){var b=c._dbInfo;b.serializer.serialize(a,function(w,R){if(R)E(R);else try{localStorage.setItem(b.keyPrefix+r,w),h(l)}catch(T){(T.name==="QuotaExceededError"||T.name==="NS_ERROR_DOM_QUOTA_REACHED")&&E(T),E(T)}})})});return M(f,i),f}function Mn(r,a){if(a=O.apply(this,arguments),r=typeof r!="function"&&r||{},!r.name){var i=this.config();r.name=r.name||i.name,r.storeName=r.storeName||i.storeName}var c=this,f;return r.name?f=new I(function(l){r.storeName?l(qt(r,c._defaultConfig)):l(r.name+"/")}).then(function(l){for(var h=localStorage.length-1;h>=0;h--){var E=localStorage.key(h);E.indexOf(l)===0&&localStorage.removeItem(E)}}):f=I.reject("Invalid arguments"),M(f,a),f}var Tn={_driver:"localStorageWrapper",_initStorage:En,_support:vn(),iterate:bn,getItem:In,setItem:Nn,removeItem:Sn,clear:_n,length:An,key:wn,keys:Rn,dropInstance:Mn},On=function(a,i){return a===i||typeof a=="number"&&typeof i=="number"&&isNaN(a)&&isNaN(i)},Ln=function(a,i){for(var c=a.length,f=0;f<c;){if(On(a[f],i))return!0;f++}return!1},Vt=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"},Ue={},Xt={},Se={INDEXEDDB:Qr,WEBSQL:mn,LOCALSTORAGE:Tn},Pn=[Se.INDEXEDDB._driver,Se.WEBSQL._driver,Se.LOCALSTORAGE._driver],Xe=["dropInstance"],vt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Xe),$n={description:"",driver:Pn.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Cn(r,a){r[a]=function(){var i=arguments;return r.ready().then(function(){return r[a].apply(r,i)})}}function gt(){for(var r=1;r<arguments.length;r++){var a=arguments[r];if(a)for(var i in a)a.hasOwnProperty(i)&&(Vt(a[i])?arguments[0][i]=a[i].slice():arguments[0][i]=a[i])}return arguments[0]}var Dn=function(){function r(a){p(this,r);for(var i in Se)if(Se.hasOwnProperty(i)){var c=Se[i],f=c._driver;this[i]=f,Ue[f]||this.defineDriver(c)}this._defaultConfig=gt({},$n),this._config=gt({},this._defaultConfig,a),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return r.prototype.config=function(i){if((typeof i>"u"?"undefined":g(i))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var c in i){if(c==="storeName"&&(i[c]=i[c].replace(/\W/g,"_")),c==="version"&&typeof i[c]!="number")return new Error("Database version must be a number.");this._config[c]=i[c]}return"driver"in i&&i.driver?this.setDriver(this._config.driver):!0}else return typeof i=="string"?this._config[i]:this._config},r.prototype.defineDriver=function(i,c,f){var l=new I(function(h,E){try{var b=i._driver,w=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!i._driver){E(w);return}for(var R=vt.concat("_initStorage"),T=0,k=R.length;T<k;T++){var j=R[T],Y=!Ln(Xe,j);if((Y||i[j])&&typeof i[j]!="function"){E(w);return}}var X=function(){for(var Be=function(Bn){return function(){var kn=new Error("Method "+Bn+" is not implemented by the current driver"),zt=I.reject(kn);return M(zt,arguments[arguments.length-1]),zt}},yt=0,Un=Xe.length;yt<Un;yt++){var Et=Xe[yt];i[Et]||(i[Et]=Be(Et))}};X();var V=function(Be){Ue[b]&&console.info("Redefining LocalForage driver: "+b),Ue[b]=i,Xt[b]=Be,h()};"_support"in i?i._support&&typeof i._support=="function"?i._support().then(V,E):V(!!i._support):V(!0)}catch(ce){E(ce)}});return $(l,c,f),l},r.prototype.driver=function(){return this._driver||null},r.prototype.getDriver=function(i,c,f){var l=Ue[i]?I.resolve(Ue[i]):I.reject(new Error("Driver not found."));return $(l,c,f),l},r.prototype.getSerializer=function(i){var c=I.resolve(mt);return $(c,i),c},r.prototype.ready=function(i){var c=this,f=c._driverSet.then(function(){return c._ready===null&&(c._ready=c._initDriver()),c._ready});return $(f,i,i),f},r.prototype.setDriver=function(i,c,f){var l=this;Vt(i)||(i=[i]);var h=this._getSupportedDrivers(i);function E(){l._config.driver=l.driver()}function b(T){return l._extend(T),E(),l._ready=l._initStorage(l._config),l._ready}function w(T){return function(){var k=0;function j(){for(;k<T.length;){var Y=T[k];return k++,l._dbInfo=null,l._ready=null,l.getDriver(Y).then(b).catch(j)}E();var X=new Error("No available storage method found.");return l._driverSet=I.reject(X),l._driverSet}return j()}}var R=this._driverSet!==null?this._driverSet.catch(function(){return I.resolve()}):I.resolve();return this._driverSet=R.then(function(){var T=h[0];return l._dbInfo=null,l._ready=null,l.getDriver(T).then(function(k){l._driver=k._driver,E(),l._wrapLibraryMethodsWithReady(),l._initDriver=w(h)})}).catch(function(){E();var T=new Error("No available storage method found.");return l._driverSet=I.reject(T),l._driverSet}),$(this._driverSet,c,f),this._driverSet},r.prototype.supports=function(i){return!!Xt[i]},r.prototype._extend=function(i){gt(this,i)},r.prototype._getSupportedDrivers=function(i){for(var c=[],f=0,l=i.length;f<l;f++){var h=i[f];this.supports(h)&&c.push(h)}return c},r.prototype._wrapLibraryMethodsWithReady=function(){for(var i=0,c=vt.length;i<c;i++)Cn(this,vt[i])},r.prototype.createInstance=function(i){return new r(i)},r}(),xn=new Dn;s.exports=xn},{3:3}]},{},[4])(4)})});var Kr=tr((lt,jr)=>{(function(e,t){typeof lt=="object"&&typeof jr<"u"?t(lt):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],t):t(e.LocalforageDriverMemory={})})(typeof self<"u"?self:lt,function(e){"use strict";var t="localforage-driver-memory";function n(d){var _=typeof Symbol=="function"&&d[Symbol.iterator],A=0;return _?_.call(d):{next:function(){return d&&A>=d.length&&(d=void 0),{value:d&&d[A++],done:!d}}}}function o(d,_){d=d||[],_=_||{};try{return new Blob(d,_)}catch(D){if(D.name!=="TypeError")throw D;for(var A=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,L=new A,P=0;P<d.length;P+=1)L.append(d[P]);return L.getBlob(_.type)}}var s=/^~~local_forage_type~([^~]+)~/,u=9,g=u+4,p=Object.prototype.toString;function m(d){var _=d.length*.75,A=d.length;d[d.length-1]==="="&&(_--,d[d.length-2]==="="&&_--);for(var L=new ArrayBuffer(_),P=new Uint8Array(L),D=0,G=0;D<A;D+=4){var Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[D]),Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[D+1]),_e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[D+2]),xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[D+3]);P[G++]=Z<<2|Ae>>4,P[G++]=(Ae&15)<<4|_e>>2,P[G++]=(_e&3)<<6|xe&63}return L}function v(d){for(var _=new Uint8Array(d),A="",L=0;L<_.length;L+=3)A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_[L]>>2],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(_[L]&3)<<4|_[L+1]>>4],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(_[L+1]&15)<<2|_[L+2]>>6],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_[L+2]&63];return _.length%3===2?A=A.substring(0,A.length-1)+"=":_.length%3===1&&(A=A.substring(0,A.length-2)+"=="),A}function y(d,_){var A="";if(d&&(A=p.call(d)),d&&(A==="[object ArrayBuffer]"||d.buffer&&p.call(d.buffer)==="[object ArrayBuffer]")){var L=void 0,P="__lfsc__:";d instanceof ArrayBuffer?(L=d,P+="arbf"):(L=d.buffer,A==="[object Int8Array]"?P+="si08":A==="[object Uint8Array]"?P+="ui08":A==="[object Uint8ClampedArray]"?P+="uic8":A==="[object Int16Array]"?P+="si16":A==="[object Uint16Array]"?P+="ur16":A==="[object Int32Array]"?P+="si32":A==="[object Uint32Array]"?P+="ui32":A==="[object Float32Array]"?P+="fl32":A==="[object Float64Array]"?P+="fl64":_(new Error("Failed to get type for BinaryArray"))),_(P+v(L))}else if(A==="[object Blob]"){var D=new FileReader;D.onload=function(){var G="~~local_forage_type~"+d.type+"~"+v(this.result);_("__lfsc__:blob"+G)},D.readAsArrayBuffer(d)}else try{_(JSON.stringify(d))}catch(G){console.error("Couldn't convert value into a JSON string: ",d),_(null,G)}}function N(d){if(d.substring(0,u)!=="__lfsc__:")return JSON.parse(d);var _=d.substring(g),A=d.substring(u,g),L;if(A==="blob"&&s.test(_)){var P=_.match(s);L=P[1],_=_.substring(P[0].length)}var D=m(_);switch(A){case"arbf":return D;case"blob":return o([D],{type:L});case"si08":return new Int8Array(D);case"ui08":return new Uint8Array(D);case"uic8":return new Uint8ClampedArray(D);case"si16":return new Int16Array(D);case"ur16":return new Uint16Array(D);case"si32":return new Int32Array(D);case"ui32":return new Uint32Array(D);case"fl32":return new Float32Array(D);case"fl64":return new Float64Array(D);default:throw new Error("Unkown type: "+A)}}function I(d){var _,A;if(d===null||typeof d!="object"||"isActiveClone"in d)return d;var L=d instanceof Date?new Date(d):d.constructor();try{for(var P=n(Object.keys(d)),D=P.next();!D.done;D=P.next()){var G=D.value;Object.prototype.hasOwnProperty.call(d,G)&&(d.isActiveClone=null,L[G]=I(d[G]),delete d.isActiveClone)}}catch(Z){_={error:Z}}finally{try{D&&!D.done&&(A=P.return)&&A.call(P)}finally{if(_)throw _.error}}return L}function M(d,_){return(d.name||_.name)+"/"+(d.storeName||_.storeName)+"/"}function $(d,_){_&&d.then(function(A){_(null,A)},function(A){_(A)})}function B(){for(var d=[],_=0;_<arguments.length;_++)d[_]=arguments[_];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function O(d,_){var A=this;if(_=B.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var L=this.config();d.name=d.name||L.name,d.storeName=d.storeName||L.storeName}var P;return d.name?P=new Promise(function(D){d.storeName?D(M(d,A._defaultConfig)):D(d.name+"/")}):P=Promise.reject("Invalid arguments"),{promise:P,callback:_}}function W(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}var J={bufferToString:v,deserialize:N,serialize:y,stringToBuffer:m},C={},me=function(){function d(_){this.kp=_,this.data={}}return d.resolve=function(_){return C[_]||(C[_]=new d(_)),C[_]},d.prototype.clear=function(){this.data={}},d.prototype.drop=function(){this.clear(),delete C[this.kp]},d.prototype.get=function(_){return this.data[_]},d.prototype.key=function(_){return this.keys()[_]},d.prototype.keys=function(){return Object.keys(this.data)},d.prototype.rm=function(_){delete this.data[_]},d.prototype.set=function(_,A){this.data[_]=A},d}();function ne(d){var _=d?I(d):{},A=M(_,this._defaultConfig),L=me.resolve(A);return this._dbInfo=_,this._dbInfo.serializer=J,this._dbInfo.keyPrefix=A,this._dbInfo.mStore=L,Promise.resolve()}function S(d){var _=this,A=this.ready().then(function(){_._dbInfo.mStore.clear()});return $(A,d),A}function F(d,_){var A=O.apply(this,arguments),L=A.promise,P=A.callback,D=L.then(function(G){me.resolve(G).drop()});return $(D,P),L}function U(d,_){var A=this;d=W(d);var L=this.ready().then(function(){var P=A._dbInfo.mStore.get(d);return P==null?null:A._dbInfo.serializer.deserialize(P)});return $(L,_),L}function K(d,_){var A=this,L=this.ready().then(function(){for(var P=A._dbInfo.mStore,D=P.keys(),G=0;G<D.length;G++){var Z=P.get(D[G]);if(Z&&(Z=A._dbInfo.serializer.deserialize(Z)),Z=d(Z,D[G],G+1),Z!==void 0)return Z}});return $(L,_),L}function Q(d,_){var A=this,L=this.ready().then(function(){var P;try{P=A._dbInfo.mStore.key(d),P===void 0&&(P=null)}catch{P=null}return P});return $(L,_),L}function ie(d){var _=this,A=this.ready().then(function(){return _._dbInfo.mStore.keys()});return $(A,d),A}function ae(d){var _=this.keys().then(function(A){return A.length});return $(_,d),_}function se(d,_){var A=this;d=W(d);var L=this.ready().then(function(){A._dbInfo.mStore.rm(d)});return $(L,_),L}function fe(d,_,A){var L=this;d=W(d);var P=this.ready().then(function(){_===void 0&&(_=null);var D=_;return new Promise(function(G,Z){L._dbInfo.serializer.serialize(_,function(Ae,_e){if(_e)Z(_e);else try{L._dbInfo.mStore.set(d,Ae),G(D)}catch(xe){Z(xe)}})})});return $(P,A),P}var Ee=!0;e._support=Ee,e._driver=t,e._initStorage=ne,e.clear=S,e.dropInstance=F,e.getItem=U,e.iterate=K,e.key=Q,e.keys=ie,e.length=ae,e.removeItem=se,e.setItem=fe,Object.defineProperty(e,"__esModule",{value:!0})})});var Go={};rr(Go,{default:()=>Fo});var de=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(de||{}),Me=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e))(Me||{}),Te=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))(Te||{}),ue=(e=>(e.MetaMask="metamask",e.CoinbaseWallet="coinbase_wallet",e))(ue||{}),Oe=(e=>(e.WalletSelected="wallet_selected",e.WalletConnected="wallet_connected",e.WalletRejected="wallet_rejected",e))(Oe||{}),x=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.SetAuthorizationToken="magic_auth_set_authorization_token",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="mc_get_wallet_info",e.ShowUI="mc_wallet",e.NFTPurchase="magic_nft_purchase",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.UpdatePhoneNumber="magic_auth_update_phone_number",e.UpdatePhoneNumberTestMode="magic_auth_update_phone_number_testing_mode",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e.MagicBoxHeartBeat="magic_box_heart_beat",e.AutoConnect="mc_auto_connect",e.Login="mc_login",e))(x||{}),he=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",e))(he||{}),Ie=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(Ie||{}),or=(e=>(e.Harmony="HARMONY",e))(or||{});var Hn=Object.create,at=Object.defineProperty,qn=Object.defineProperties,Vn=Object.getOwnPropertyDescriptor,Xn=Object.getOwnPropertyDescriptors,zn=Object.getOwnPropertyNames,ar=Object.getOwnPropertySymbols,Jn=Object.getPrototypeOf,_r=Object.prototype.hasOwnProperty,Qn=Object.prototype.propertyIsEnumerable,sr=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bt=(e,t)=>{for(var n in t||(t={}))_r.call(t,n)&&sr(e,n,t[n]);if(ar)for(var n of ar(t))Qn.call(t,n)&&sr(e,n,t[n]);return e},Ir=(e,t)=>qn(e,Xn(t)),Zn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ei=(e,t)=>{for(var n in t)at(e,n,{get:t[n],enumerable:!0})},ti=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of zn(t))!_r.call(e,s)&&s!==n&&at(e,s,{get:()=>t[s],enumerable:!(o=Vn(t,s))||o.enumerable});return e},ri=(e,t,n)=>(n=e!=null?Hn(Jn(e)):{},ti(t||!e||!e.__esModule?at(n,"default",{value:e,enumerable:!0}):n,e)),le=(e,t,n)=>new Promise((o,s)=>{var u=m=>{try{p(n.next(m))}catch(v){s(v)}},g=m=>{try{p(n.throw(m))}catch(v){s(v)}},p=m=>m.done?o(m.value):Promise.resolve(m.value).then(u,g);p((n=n.apply(e,t)).next())}),ni=Zn((e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty,o="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(o=!1));function u(v,y,N){this.fn=v,this.context=y,this.once=N||!1}function g(v,y,N,I,M){if(typeof N!="function")throw new TypeError("The listener must be a function");var $=new u(N,I||v,M),B=o?o+y:y;return v._events[B]?v._events[B].fn?v._events[B]=[v._events[B],$]:v._events[B].push($):(v._events[B]=$,v._eventsCount++),v}function p(v,y){--v._eventsCount===0?v._events=new s:delete v._events[y]}function m(){this._events=new s,this._eventsCount=0}m.prototype.eventNames=function(){var v=[],y,N;if(this._eventsCount===0)return v;for(N in y=this._events)n.call(y,N)&&v.push(o?N.slice(1):N);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(y)):v},m.prototype.listeners=function(v){var y=o?o+v:v,N=this._events[y];if(!N)return[];if(N.fn)return[N.fn];for(var I=0,M=N.length,$=new Array(M);I<M;I++)$[I]=N[I].fn;return $},m.prototype.listenerCount=function(v){var y=o?o+v:v,N=this._events[y];return N?N.fn?1:N.length:0},m.prototype.emit=function(v,y,N,I,M,$){var B=o?o+v:v;if(!this._events[B])return!1;var O=this._events[B],W=arguments.length,J,C;if(O.fn){switch(O.once&&this.removeListener(v,O.fn,void 0,!0),W){case 1:return O.fn.call(O.context),!0;case 2:return O.fn.call(O.context,y),!0;case 3:return O.fn.call(O.context,y,N),!0;case 4:return O.fn.call(O.context,y,N,I),!0;case 5:return O.fn.call(O.context,y,N,I,M),!0;case 6:return O.fn.call(O.context,y,N,I,M,$),!0}for(C=1,J=new Array(W-1);C<W;C++)J[C-1]=arguments[C];O.fn.apply(O.context,J)}else{var me=O.length,ne;for(C=0;C<me;C++)switch(O[C].once&&this.removeListener(v,O[C].fn,void 0,!0),W){case 1:O[C].fn.call(O[C].context);break;case 2:O[C].fn.call(O[C].context,y);break;case 3:O[C].fn.call(O[C].context,y,N);break;case 4:O[C].fn.call(O[C].context,y,N,I);break;default:if(!J)for(ne=1,J=new Array(W-1);ne<W;ne++)J[ne-1]=arguments[ne];O[C].fn.apply(O[C].context,J)}}return!0},m.prototype.on=function(v,y,N){return g(this,v,y,N,!1)},m.prototype.once=function(v,y,N){return g(this,v,y,N,!0)},m.prototype.removeListener=function(v,y,N,I){var M=o?o+v:v;if(!this._events[M])return this;if(!y)return p(this,M),this;var $=this._events[M];if($.fn)$.fn===y&&(!I||$.once)&&(!N||$.context===N)&&p(this,M);else{for(var B=0,O=[],W=$.length;B<W;B++)($[B].fn!==y||I&&!$[B].once||N&&$[B].context!==N)&&O.push($[B]);O.length?this._events[M]=O.length===1?O[0]:O:p(this,M)}return this},m.prototype.removeAllListeners=function(v){var y;return v?(y=o?o+v:v,this._events[y]&&p(this,y)):(this._events=new s,this._eventsCount=0),this},m.prototype.off=m.prototype.removeListener,m.prototype.addListener=m.prototype.on,m.prefixed=o,m.EventEmitter=m,typeof t<"u"&&(t.exports=m)});function ii(e){let t={exports:{}};return e(t,t.exports),t.exports}var oi=Number.MAX_SAFE_INTEGER||9007199254740991,wt={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:oi,MAX_SAFE_COMPONENT_LENGTH:16},ai=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},H=ai,He=ii(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:n}=wt,o=(t=e.exports={}).re=[],s=t.src=[],u=t.t={},g=0,p=(m,v,y)=>{let N=g++;H(N,v),u[m]=N,s[N]=v,o[N]=new RegExp(v,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","[0-9]+"),p("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),p("MAINVERSION",`(${s[u.NUMERICIDENTIFIER]})\\.(${s[u.NUMERICIDENTIFIER]})\\.(${s[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${s[u.NUMERICIDENTIFIERLOOSE]})\\.(${s[u.NUMERICIDENTIFIERLOOSE]})\\.(${s[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${s[u.NUMERICIDENTIFIER]}|${s[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${s[u.NUMERICIDENTIFIERLOOSE]}|${s[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${s[u.PRERELEASEIDENTIFIER]}(?:\\.${s[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${s[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER","[0-9A-Za-z-]+"),p("BUILD",`(?:\\+(${s[u.BUILDIDENTIFIER]}(?:\\.${s[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${s[u.MAINVERSION]}${s[u.PRERELEASE]}?${s[u.BUILD]}?`),p("FULL",`^${s[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${s[u.MAINVERSIONLOOSE]}${s[u.PRERELEASELOOSE]}?${s[u.BUILD]}?`),p("LOOSE",`^${s[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${s[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${s[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${s[u.XRANGEIDENTIFIER]})(?:\\.(${s[u.XRANGEIDENTIFIER]})(?:\\.(${s[u.XRANGEIDENTIFIER]})(?:${s[u.PRERELEASE]})?${s[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${s[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[u.XRANGEIDENTIFIERLOOSE]})(?:${s[u.PRERELEASELOOSE]})?${s[u.BUILD]}?)?)?`),p("XRANGE",`^${s[u.GTLT]}\\s*${s[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${s[u.GTLT]}\\s*${s[u.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",s[u.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${s[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${s[u.LONETILDE]}${s[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${s[u.LONETILDE]}${s[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${s[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${s[u.LONECARET]}${s[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${s[u.LONECARET]}${s[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${s[u.GTLT]}\\s*(${s[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${s[u.GTLT]}\\s*(${s[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${s[u.GTLT]}\\s*(${s[u.LOOSEPLAIN]}|${s[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${s[u.XRANGEPLAIN]})\\s+-\\s+(${s[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${s[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0.0.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),lr=/^[0-9]+$/,br=(e,t)=>{let n=lr.test(e),o=lr.test(t);return n&&o&&(e=+e,t=+t),e===t?0:n&&!o?-1:o&&!n?1:e<t?-1:1},si=(e,t)=>br(t,e),li={compareIdentifiers:br,rcompareIdentifiers:si},{MAX_LENGTH:ur,MAX_SAFE_INTEGER:ze}=wt,{re:cr,t:fr}=He,{compareIdentifiers:Fe}=li,ee=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof ee){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>ur)throw new TypeError(`version is longer than ${ur} characters`);H("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?cr[fr.LOOSE]:cr[fr.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>ze||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ze||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ze||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<ze)return s}return o}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(H("SemVer.compare",this.version,this.options,e),!(e instanceof ee)){if(typeof e=="string"&&e===this.version)return 0;e=new ee(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof ee||(e=new ee(e,this.options)),Fe(this.major,e.major)||Fe(this.minor,e.minor)||Fe(this.patch,e.patch)}comparePre(e){if(e instanceof ee||(e=new ee(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],o=e.prerelease[t];if(H("prerelease compare",t,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n!==o)return Fe(n,o)}while(++t)}compareBuild(e){e instanceof ee||(e=new ee(e,this.options));let t=0;do{let n=this.build[t],o=e.build[t];if(H("prerelease compare",t,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n!==o)return Fe(n,o)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);n===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},ui=(e,t,n)=>new ee(e,n).compare(new ee(t,n)),De=ui,ci=(e,t,n)=>De(e,t,n)===0,fi=ci,di=(e,t,n)=>De(e,t,n)!==0,hi=di,pi=(e,t,n)=>De(e,t,n)>0,mi=pi,vi=(e,t,n)=>De(e,t,n)>=0,gi=vi,yi=(e,t,n)=>De(e,t,n)<0,Ei=yi,_i=(e,t,n)=>De(e,t,n)<=0,Ii=_i,bi=(e,t,n,o)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return fi(e,n,o);case"!=":return hi(e,n,o);case">":return mi(e,n,o);case">=":return gi(e,n,o);case"<":return Ei(e,n,o);case"<=":return Ii(e,n,o);default:throw new TypeError(`Invalid operator: ${t}`)}},_t=bi,Ge=Symbol("SemVer ANY"),Ke=class{static get ANY(){return Ge}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Ke){if(e.loose===!!t.loose)return e;e=e.value}H("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ge?this.value="":this.value=this.operator+this.semver.version,H("comp",this)}parse(e){let t=this.options.loose?dr[hr.COMPARATORLOOSE]:dr[hr.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new ee(n[2],this.options.loose):this.semver=Ge}toString(){return this.value}test(e){if(H("Comparator.test",e,this.options.loose),this.semver===Ge||e===Ge)return!0;if(typeof e=="string")try{e=new ee(e,this.options)}catch(t){return!1}return _t(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ke))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new Pe(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new Pe(this.value,t).test(e.semver);let n=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),o=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),s=this.semver.version===e.semver.version,u=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),g=_t(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),p=_t(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||o||s&&u||g||p}},{re:dr,t:hr}=He,Pe=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Pe)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Pe(e.raw,t);if(e instanceof Ke)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let n=t?re[te.HYPHENRANGELOOSE]:re[te.HYPHENRANGE];e=e.replace(n,Di(this.options.includePrerelease)),H("hyphen replace",e),e=e.replace(re[te.COMPARATORTRIM],wi),H("comparator trim",e,re[te.COMPARATORTRIM]),e=(e=(e=e.replace(re[te.TILDETRIM],Ri)).replace(re[te.CARETTRIM],Ai)).split(/\s+/).join(" ");let o=t?re[te.COMPARATORLOOSE]:re[te.COMPARATOR];return e.split(" ").map(s=>Si(s,this.options)).join(" ").split(/\s+/).map(s=>Ci(s,this.options)).filter(this.options.loose?s=>!!s.match(o):()=>!0).map(s=>new Ke(s,this.options))}intersects(e,t){if(!(e instanceof Pe))throw new TypeError("a Range is required");return this.set.some(n=>pr(n,t)&&e.set.some(o=>pr(o,t)&&n.every(s=>o.every(u=>s.intersects(u,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new ee(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(xi(this.set[t],e,this.options))return!0;return!1}},{re,t:te,comparatorTrimReplace:wi,tildeTrimReplace:Ri,caretTrimReplace:Ai}=He,pr=(e,t)=>{let n=!0,o=e.slice(),s=o.pop();for(;n&&o.length;)n=o.every(u=>s.intersects(u,t)),s=o.pop();return n},Si=(e,t)=>(H("comp",e,t),e=Ti(e,t),H("caret",e),e=Ni(e,t),H("tildes",e),e=Li(e,t),H("xrange",e),e=$i(e,t),H("stars",e),e),oe=e=>!e||e.toLowerCase()==="x"||e==="*",Ni=(e,t)=>e.trim().split(/\s+/).map(n=>Mi(n,t)).join(" "),Mi=(e,t)=>{let n=t.loose?re[te.TILDELOOSE]:re[te.TILDE];return e.replace(n,(o,s,u,g,p)=>{let m;return H("tilde",e,o,s,u,g,p),oe(s)?m="":oe(u)?m=`>=${s}.0.0 <${+s+1}.0.0-0`:oe(g)?m=`>=${s}.${u}.0 <${s}.${+u+1}.0-0`:p?(H("replaceTilde pr",p),m=`>=${s}.${u}.${g}-${p} <${s}.${+u+1}.0-0`):m=`>=${s}.${u}.${g} <${s}.${+u+1}.0-0`,H("tilde return",m),m})},Ti=(e,t)=>e.trim().split(/\s+/).map(n=>Oi(n,t)).join(" "),Oi=(e,t)=>{H("caret",e,t);let n=t.loose?re[te.CARETLOOSE]:re[te.CARET],o=t.includePrerelease?"-0":"";return e.replace(n,(s,u,g,p,m)=>{let v;return H("caret",e,s,u,g,p,m),oe(u)?v="":oe(g)?v=`>=${u}.0.0${o} <${+u+1}.0.0-0`:oe(p)?v=u==="0"?`>=${u}.${g}.0${o} <${u}.${+g+1}.0-0`:`>=${u}.${g}.0${o} <${+u+1}.0.0-0`:m?(H("replaceCaret pr",m),v=u==="0"?g==="0"?`>=${u}.${g}.${p}-${m} <${u}.${g}.${+p+1}-0`:`>=${u}.${g}.${p}-${m} <${u}.${+g+1}.0-0`:`>=${u}.${g}.${p}-${m} <${+u+1}.0.0-0`):(H("no pr"),v=u==="0"?g==="0"?`>=${u}.${g}.${p}${o} <${u}.${g}.${+p+1}-0`:`>=${u}.${g}.${p}${o} <${u}.${+g+1}.0-0`:`>=${u}.${g}.${p} <${+u+1}.0.0-0`),H("caret return",v),v})},Li=(e,t)=>(H("replaceXRanges",e,t),e.split(/\s+/).map(n=>Pi(n,t)).join(" ")),Pi=(e,t)=>{e=e.trim();let n=t.loose?re[te.XRANGELOOSE]:re[te.XRANGE];return e.replace(n,(o,s,u,g,p,m)=>{H("xRange",e,o,s,u,g,p,m);let v=oe(u),y=v||oe(g),N=y||oe(p),I=N;return s==="="&&I&&(s=""),m=t.includePrerelease?"-0":"",v?o=s===">"||s==="<"?"<0.0.0-0":"*":s&&I?(y&&(g=0),p=0,s===">"?(s=">=",y?(u=+u+1,g=0,p=0):(g=+g+1,p=0)):s==="<="&&(s="<",y?u=+u+1:g=+g+1),s==="<"&&(m="-0"),o=`${s+u}.${g}.${p}${m}`):y?o=`>=${u}.0.0${m} <${+u+1}.0.0-0`:N&&(o=`>=${u}.${g}.0${m} <${u}.${+g+1}.0-0`),H("xRange return",o),o})},$i=(e,t)=>(H("replaceStars",e,t),e.trim().replace(re[te.STAR],"")),Ci=(e,t)=>(H("replaceGTE0",e,t),e.trim().replace(re[t.includePrerelease?te.GTE0PRE:te.GTE0],"")),Di=e=>(t,n,o,s,u,g,p,m,v,y,N,I,M)=>`${n=oe(o)?"":oe(s)?`>=${o}.0.0${e?"-0":""}`:oe(u)?`>=${o}.${s}.0${e?"-0":""}`:g?`>=${n}`:`>=${n}${e?"-0":""}`} ${m=oe(v)?"":oe(y)?`<${+v+1}.0.0-0`:oe(N)?`<${v}.${+y+1}.0-0`:I?`<=${v}.${y}.${N}-${I}`:e?`<${v}.${y}.${+N+1}-0`:`<=${m}`}`.trim(),xi=(e,t,n)=>{for(let o=0;o<e.length;o++)if(!e[o].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let o=0;o<e.length;o++)if(H(e[o].semver),e[o].semver!==Ke.ANY&&e[o].semver.prerelease.length>0){let s=e[o].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0},Ui=(e,t,n)=>{try{t=new Pe(t,n)}catch(o){return!1}return t.test(e)},{MAX_LENGTH:Bi}=wt,{re:mr,t:vr}=He,ki=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof ee)return e;if(typeof e!="string"||e.length>Bi||!(t.loose?mr[vr.LOOSE]:mr[vr.FULL]).test(e))return null;try{return new ee(e,t)}catch(n){return null}},Wi=ki,{re:Je,t:Qe}=He,Fi=(e,t)=>{if(e instanceof ee)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let n=null;if((t=t||{}).rtl){let o;for(;(o=Je[Qe.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&o.index+o[0].length===n.index+n[0].length||(n=o),Je[Qe.COERCERTL].lastIndex=o.index+o[1].length+o[2].length;Je[Qe.COERCERTL].lastIndex=-1}else n=e.match(Je[Qe.COERCE]);return n===null?null:Wi(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function Gi(e){return String.fromCharCode(parseInt(e.slice(1),16))}function ji(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function Ki(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,Gi))}function Yi(e){return decodeURIComponent(Array.from(atob(e),ji).join(""))}function wr(e){return Ki(JSON.stringify(e))}function Hi(e){return JSON.parse(Yi(e))}function je(e){return typeof e=="undefined"}function qi(e){return e===null}function Rr(e){return qi(e)||je(e)}function Vi(e){return Rr(e)?!1:!je(e.jsonrpc)&&!je(e.id)&&(!je(e.result)||!je(e.error))}function Xi(e){return Rr(e)?!1:typeof e=="number"&&Object.values(Te).includes(e)}function It(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var z={};function Ar(e,t){return Object.assign(z,t),e}var zi={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},pe=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,pe.prototype)}},$e=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=Xi(t)?t:Te.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,$e.prototype)}},qe=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},st=class extends Error{constructor(e,t,n,o){super(`Magic Extension Error (${e.name}): [${t}] ${n}`),this.code=t,this.rawMessage=n,this.data=o,this.__proto__=Error,Object.setPrototypeOf(this,st.prototype)}},rt=class{constructor(e,t,n){this.code=t,this.rawMessage=n,this.message=`Magic Extension Warning (${e.name}): [${t}] ${n}`}log(){console.warn(this.message)}};function Ji(){return new pe(de.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Sr(){return new pe(de.ModalNotReady,"Modal is not ready.")}function Qi(){return new pe(de.MalformedResponse,"Response from the Magic iframe is malformed.")}function Zi(e){return new pe(de.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function eo(e){let t=`Some extensions are incompatible with \`${z.sdkName}@${z.version}\`:`;return e.filter(n=>typeof n.compat!="undefined"&&n.compat!==null).forEach(n=>{let o=n.compat[z.sdkName];typeof o=="string"?t+=`
|
2
2
|
- Extension \`${n.name}\` supports version(s) \`${o}\``:o||(t+=`
|
3
|
-
- Extension \`${n.name}\` does not support ${
|
3
|
+
- Extension \`${n.name}\` does not support ${z.platform} environments.`)}),new pe(de.IncompatibleExtensions,t)}function to(e){let t=n=>{let o=n+1,s=o%10,u=o%100;return s===1&&u!==11?`${o}st`:s===2&&u!==12?`${o}nd`:s===3&&u!==13?`${o}rd`:`${o}th`};return new pe(de.InvalidArgument,`Invalid ${t(e.argument)} argument given to \`${e.procedure}\`.
|
4
4
|
Expected: \`${e.expected}\`
|
5
|
-
Received: \`${e.received}\``)}function Ar(){return new Pe(_e.DuplicateIframe,"Duplicate iframes found.")}function to(){return new Pe(_e.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function ro(){return new Pe(_e.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${q.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function Le(e){let{method:t,removalVersions:n,useInstead:o}=e,s=n[q.sdkName],c=o?` Use \`${o}\` instead.`:"",m=`\`${t}\` will be removed from \`${q.sdkName}\` in version \`${s}\`.${c}`;return new Pe(_e.DeprecationNotice,m)}function*no(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}var io=no();function Sr(){return io.next().value}var Nr=Symbol("Payload pre-processed by Magic SDK");function Tr(e){return Object.defineProperty(e,Nr,{value:!0,enumerable:!1}),e}function oo(e){return!!e[Nr]}function tt(e){var t,n,o;return oo(e)||(e.jsonrpc=(t=e.jsonrpc)!=null?t:"2.0",e.id=Sr(),e.method=(n=e.method)!=null?n:"noop",e.params=(o=e.params)!=null?o:[],Tr(e)),e}function K(e,t=[]){return Tr({params:t,method:e,jsonrpc:"2.0",id:Sr()})}var bt=class{constructor(e){e instanceof bt?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):Ki(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return typeof this._error!="undefined"&&this._error!==null}get hasResult(){return typeof this._result!="undefined"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},ao=ti(ri()),so=class extends ao.default{};function Or(){let e=new so;return{emitter:e,createChainingEmitterMethod:(t,n)=>(...o)=>(e[t].apply(e,o),n),createBoundEmitterMethod:t=>(...n)=>e[t].apply(e,n)}}var Lr=Symbol("isPromiEvent");function wt(e){return!!e[Lr]}function Mr(e){let t=$r(e),{createBoundEmitterMethod:n,createChainingEmitterMethod:o}=Or(),s=Symbol("Promise.then"),c=Symbol("Promise.catch"),m=Symbol("Promise.finally"),p=(y,N)=>(...I)=>{let T=N[y].apply(N,I);return v(T)},v=y=>Object.assign(y,{[Lr]:!0,[s]:y[s]||y.then,[c]:y[c]||y.catch,[m]:y[m]||y.finally,then:p(s,y),catch:p(c,y),finally:p(m,y),on:o("on",y),once:o("once",y),addListener:o("addListener",y),off:o("off",y),removeListener:o("removeListener",y),removeAllListeners:o("removeAllListeners",y),emit:n("emit"),eventNames:n("eventNames"),listeners:n("listeners"),listenerCount:n("listenerCount")}),g=v(t.then(y=>(g.emit("done",y),g.emit("settled"),y),y=>{throw g.emit("error",y),g.emit("settled"),y}));return g}function $r(e){return new Promise((t,n)=>{let o=e(t,n);Promise.resolve(o).catch(n)})}var we=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(Ie.MAGIC_HANDLE_REQUEST,tt(e)),n=Mr((s,c)=>{t.then(m=>{if(o(),m.hasError)c(new Me(m.payload.error));else if(m.hasResult)s(m.payload.result);else throw Ji()}).catch(m=>{o(),c(m)})}),o=this.overlay.on(fe.MAGIC_HANDLE_EVENT,s=>{var c;let{response:m}=s.data;if(m.id===e.id&&((c=m.result)==null?void 0:c.event)){let{event:p,params:v=[]}=m.result;n.emit(p,...v)}});return n}createIntermediaryEvent(e,t){return n=>{let o=K(D.IntermediaryEvent,[{payloadId:t,eventType:e,args:n}]);this.request(o)}}},uo=class extends we{loginWithMagicLink(e){let{email:t,showUI:n=!0,redirectURI:o}=e,s=K(this.sdk.testMode?D.LoginWithMagicLinkTestMode:D.LoginWithMagicLink,[{email:t,showUI:n,redirectURI:o}]);return this.request(s)}loginWithSMS(e){let{phoneNumber:t}=e,n=K(this.sdk.testMode?D.LoginWithSmsTestMode:D.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(n)}loginWithEmailOTP(e){let{email:t,showUI:n}=e,o=K(this.sdk.testMode?D.LoginWithEmailOTPTestMode:D.LoginWithEmailOTP,[{email:t,showUI:n}]);if(!n){let s=this.request(o);return s&&(s.on("verify-email-otp",c=>{this.createIntermediaryEvent("verify-email-otp",o.id)(c)}),s.on("cancel",()=>{this.createIntermediaryEvent("cancel",o.id)()})),s}return this.request(o)}loginWithCredential(e){let t=e!=null?e:"";if(!e&&q.platform==="web"){t=window.location.search;let o=window.location.origin+window.location.pathname;window.history.replaceState(null,"",o)}let n=K(this.sdk.testMode?D.LoginWithCredentialTestMode:D.LoginWithCredential,[t]);return this.request(n)}setAuthorizationToken(){let e=K(D.SetAuthorizationToken);return this.request(e)}updateEmailWithUI(e){let{email:t,showUI:n=!0}=e,o=K(this.sdk.testMode?D.UpdateEmailTestMode:D.UpdateEmail,[{email:t,showUI:n}]);return this.request(o)}updatePhoneNumberWithUI(){let e=K(this.sdk.testMode?D.UpdatePhoneNumberTestMode:D.UpdatePhoneNumber);return this.request(e)}},Pr={};Zn(Pr,{clear:()=>co,getItem:()=>We,iterate:()=>po,key:()=>fo,keys:()=>ho,length:()=>lo,removeItem:()=>_t,setItem:()=>rt});var Je;function ge(e){return(...t)=>de(this,null,function*(){return Je||(Je=yield q.configureStorage()),yield Je.ready(),Je[e](...t)})}var We=ge("getItem"),rt=ge("setItem"),_t=ge("removeItem"),co=ge("clear"),lo=ge("length"),fo=ge("key"),ho=ge("keys"),po=ge("iterate");function mo(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&191|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var Rt="STORE_KEY_PRIVATE_KEY",nt="STORE_KEY_PUBLIC_JWK",At="ECDSA",Dr="P-256",vo={name:At,namedCurve:Dr},go={name:At,namedCurve:Dr};function Cr(){_t(nt),_t(Rt)}function yo(){return de(this,null,function*(){let e=yield Eo();if(!e){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:t}=window.crypto,n=yield We(Rt);if(!n||!t){console.info("unable to find private key or webcrypto unsupported");return}let o={iat:Math.floor(new Date().getTime()/1e3),jti:mo()},s={typ:"dpop+jwt",alg:"ES256",jwk:e},c={protected:mr(JSON.stringify(s)),claims:mr(JSON.stringify(o))},m=bo(`${c.protected}.${c.claims}`),p={name:At,hash:{name:"SHA-256"}},v=Ro(new Uint8Array(yield t.sign(p,n,m)));return`${c.protected}.${c.claims}.${v}`})}function Eo(){return de(this,null,function*(){if(!Io()){console.info("webcrypto is not supported");return}return(yield We(nt))||(yield _o()),We(nt)})}function _o(){return de(this,null,function*(){let e=null,{subtle:t}=window.crypto,n=yield t.generateKey(vo,!0,["sign"]),o=yield t.exportKey("jwk",n.privateKey);e=yield t.exportKey("jwk",n.publicKey);let s=yield t.importKey("jwk",o,go,!1,["sign"]);yield rt(Rt,s),yield rt(nt,e)})}function Io(){let e=typeof window!="undefined"&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}function mr(e){return xr(wo(e))}function bo(e){return new TextEncoder().encode(e)}function xr(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function wo(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode(parseInt(n,16)))}function Ro(e){let t="";return e.forEach(n=>{t+=String.fromCharCode(n)}),xr(t)}var Ao=class extends we{getIdToken(e){let t=K(this.sdk.testMode?D.GetIdTokenTestMode:D.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=K(this.sdk.testMode?D.GenerateIdTokenTestMode:D.GenerateIdToken,[e]);return this.request(t)}getInfo(){let e=K(D.GetInfo);return this.request(e)}isLoggedIn(){let e=K(this.sdk.testMode?D.IsLoggedInTestMode:D.IsLoggedIn);return this.request(e)}logout(){Cr();let e=K(this.sdk.testMode?D.LogoutTestMode:D.Logout);return this.request(e)}requestUserInfoWithUI(e){let t=K(D.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}showSettings(){let e=K(this.sdk.testMode?D.UserSettingsTestMode:D.UserSettings);return this.request(e)}recoverAccount(e){let t=K(this.sdk.testMode?D.RecoverAccountTestMode:D.RecoverAccount,[e]);return this.request(t)}getMetadata(){Le({method:"user.getMetadata()",removalVersions:{"magic-sdk":"v17.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v18.0.0","@magic-sdk/react-native-expo":"v18.0.0"},useInstead:"user.getInfo()"}).log();let e=K(this.sdk.testMode?D.GetMetadataTestMode:D.GetMetadata);return this.request(e)}updateEmail(e){Le({method:"user.updateEmail()",removalVersions:{"magic-sdk":"v17.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v18.0.0","@magic-sdk/react-native-expo":"v18.0.0"},useInstead:"auth.updateEmailWithUI()"}).log();let{email:t,showUI:n=!0}=e,o=K(this.sdk.testMode?D.UpdateEmailTestMode:D.UpdateEmail,[{email:t,showUI:n}]);return this.request(o)}updatePhoneNumber(){Le({method:"user.updatePhoneNumber()",removalVersions:{"magic-sdk":"v17.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v18.0.0","@magic-sdk/react-native-expo":"v18.0.0"},useInstead:"auth.updatePhoneNumberWithUI()"}).log();let e=K(this.sdk.testMode?D.UpdatePhoneNumberTestMode:D.UpdatePhoneNumber);return this.request(e)}},So=class extends we{connectWithUI(){let e=K(D.RequestAccounts);return this.request(e)}showUI(){let e=K(D.ShowUI);return this.request(e)}getInfo(){Le({method:"wallet.getInfo()",removalVersions:{"magic-sdk":"v17.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v18.0.0","@magic-sdk/react-native-expo":"v18.0.0"},useInstead:"user.getInfo()"}).log();let e=K(D.GetInfo);return this.request(e)}disconnect(){Le({method:"wallet.disconnect()",removalVersions:{"magic-sdk":"v17.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v18.0.0","@magic-sdk/react-native-expo":"v18.0.0"},useInstead:"user.logout()"}).log(),Cr();let e=K(D.Disconnect);return this.request(e)}requestUserInfoWithUI(e){Le({method:"wallet.requestUserInfoWithUI()",removalVersions:{"magic-sdk":"v17.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v18.0.0","@magic-sdk/react-native-expo":"v18.0.0"},useInstead:"user.requestUserInfoWithUI()"}).log();let t=K(D.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}},{createBoundEmitterMethod:Qe,createChainingEmitterMethod:Te}=Or(),No=class extends we{constructor(){super(...arguments),this.isMagic=!0,this.on=Te("on",this),this.once=Te("once",this),this.addListener=Te("addListener",this),this.off=Te("off",this),this.removeListener=Te("removeListener",this),this.removeAllListeners=Te("removeAllListeners",this),this.emit=Qe("emit"),this.eventNames=Qe("eventNames"),this.listeners=Qe("listeners"),this.listenerCount=Qe("listenerCount")}sendAsync(e,t){if(!t)throw eo({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:t===null?"null":typeof t});if(Array.isArray(e))this.overlay.post(Ie.MAGIC_HANDLE_REQUEST,e.map(n=>{let o=tt(n);return this.prefixPayloadMethodForTestMode(o),o})).then(n=>{t(null,n.map(o=>Jn(Er({},o.payload),{error:o.hasError?new Me(o.payload.error):null})))});else{let n=tt(e);this.prefixPayloadMethodForTestMode(n),this.overlay.post(Ie.MAGIC_HANDLE_REQUEST,n).then(o=>{t(o.hasError?new Me(o.payload.error):null,o.payload)})}}send(e,t){if(typeof e=="string"){let o=K(e,Array.isArray(t)?t:[]);return this.request(o)}if(Array.isArray(e)||!!t){this.sendAsync(e,t);return}let n=to();return n.log(),new bt(e).applyError({code:-32603,message:n.rawMessage}).payload}enable(){let e=K("eth_accounts");return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){let t="testMode/eth/";this.sdk.testMode&&(e.method=`${t}${e.method}`)}};function Ve(e,t){return t?new URL(e,t):new URL(e)}var vr=["request","overlay","sdk"];function To(e){let t=Object.getPrototypeOf(e),n=[t];for(;t!==we.prototype;)t=Object.getPrototypeOf(t),n.push(t);return n}var Ur=class extends we{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Mr,isPromiEvent:wt,encodeJSON:Ir,decodeJSON:Yi,createJsonRpcRequestPayload:K,standardizeJsonRpcRequestPayload:tt,storage:Pr};let e=[this,...To(this)];vr.forEach(t=>{let n=e.map(m=>Object.getOwnPropertyDescriptor(m,t)),o=n.findIndex(m=>!!m),s=o>0,c=n[o];c&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:c,isPrototypeField:s}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw Qi(t)}}))})}init(e){this.__is_initialized__||(vr.forEach(t=>{if(this.__sdk_access_field_descriptors__.has(t)){let{descriptor:n,isPrototypeField:o}=this.__sdk_access_field_descriptors__.get(t);o?delete this[t]:Object.defineProperty(this,t,n)}}),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:n,useInstead:o}=e,s=o?` Use \`${o}\` instead.`:"",c=`\`${t}\` will be removed from this Extension in version \`${n}\`.${s}`;return new et(this,"DEPRECATION_NOTICE",c)}createWarning(e,t){return new et(this,e,t)}createError(e,t,n){return new ot(this,e,t,n)}},Oo=class extends Ur{},be=class extends Ur{};be.Internal=Oo,be.Anonymous="anonymous extension";var Lo=class extends we{purchase(e){let t=K(D.NFTPurchase,[e]);return this.request(t)}};function gr(e){return e.compat&&e.compat[q.sdkName]!=null?typeof e.compat[q.sdkName]=="string"?xi(Fi(q.version),e.compat[q.sdkName]):!!e.compat[q.sdkName]:!0}function Mo(e){var t;let n=(t=e==null?void 0:e.extensions)!=null?t:[],o={},s=[];if(Array.isArray(n)?n.forEach(c=>{gr(c)?(c.init(this),(c.name||c.name!==be.Anonymous)&&(this[c.name]=c),c instanceof be.Internal&&(Et(c.config)||(o[c.name]=c.config))):s.push(c)}):Object.keys(n).forEach(c=>{if(gr(n[c])){n[c].init(this);let m=n[c];this[c]=m,m instanceof be.Internal&&(Et(m.config)||(o[n[c].name]=m.config))}else s.push(n[c])}),s.length)throw Zi(s);return o}var Ze=class{constructor(e,t){this.apiKey=e;var n;if(!e)throw zi();q.platform==="react-native"&&(t==null?void 0:t.endpoint)&&ro().log();let{defaultEndpoint:o,version:s}=q;this.testMode=!!(t!=null&&t.testMode),this.endpoint=Ve((n=t==null?void 0:t.endpoint)!=null?n:o).origin,this.auth=new uo(this),this.user=new Ao(this),this.wallet=new So(this),this.nft=new Lo(this),this.rpcProvider=new No(this);let c=Mo.call(this,t);this.parameters=Ir(Er({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?void 0:t.network,host:Ve(this.endpoint).host,sdk:Xi[q.sdkName],version:s,ext:Et(c)?void 0:c,locale:(t==null?void 0:t.locale)||"en_US"},q.bundleId?{bundleId:q.bundleId}:{}))}get overlay(){if(!Ze.__overlays__.has(this.parameters)){let e=new q.ViewController(this.endpoint,this.parameters);e.init(),Ze.__overlays__.set(this.parameters,e)}return Ze.__overlays__.get(this.parameters)}preload(){return de(this,null,function*(){yield this.overlay.ready})}},St=Ze;St.__overlays__=new Map;function $o(e,t){return t&&Array.isArray(e)?e.find(n=>n.id===t):e}function Po(e,t){var n;let o=(n=t.data.response)==null?void 0:n.id,s=$o(e,o);if(o&&s){let c=new bt(s).applyResult(t.data.response.result).applyError(t.data.response.error);return{id:o,response:c}}return{}}function Do(e,t){return de(this,null,function*(){let n=yield We("rt"),o;if(q.platform==="web")try{o=yield yo()}catch(s){console.error("webcrypto error",s)}return o?n?{msgType:e,payload:t,jwt:o,rt:n}:{msgType:e,payload:t,jwt:o}:{msgType:e,payload:t}})}function Co(e){return de(this,null,function*(){!e.data.rt||(yield rt("rt",e.data.rt))})}var Br=class{constructor(e,t){this.endpoint=e,this.parameters=t,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(e,t){return de(this,null,function*(){return $r(n=>de(this,null,function*(){yield this.ready;let o=[],s=Array.isArray(t)?t.map(v=>v.id):[],c=yield Do(`${e}-${this.parameters}`,t);yield this._post(c);let m=v=>g=>{let{id:y,response:N}=Po(t,g);Co(g),y&&N&&Array.isArray(t)&&s.includes(y)?(o.push(N),o.length===t.length&&(v(),n(o))):y&&N&&!Array.isArray(t)&&y===t.id&&(v(),n(N))},p=this.on(fe.MAGIC_HANDLE_RESPONSE,m(()=>p()))}))})}on(e,t){let n=t.bind(window),o=s=>{s.data.msgType===`${e}-${this.parameters}`&&n(s)};return this.messageHandlers.add(o),()=>this.messageHandlers.delete(o)}waitForReady(){return new Promise(e=>{this.on(fe.MAGIC_OVERLAY_READY,()=>e())})}listen(){this.on(fe.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(fe.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}};var Nt={};er(Nt,{EthChainType:()=>nr,Extension:()=>be,ExtensionError:()=>ot,ExtensionWarning:()=>et,MagicIncomingWindowMessage:()=>fe,MagicOutgoingWindowMessage:()=>Ie,MagicPayloadMethod:()=>D,RPCError:()=>Me,RPCErrorCode:()=>Ne,SDKError:()=>he,SDKErrorCode:()=>le,SDKWarning:()=>Pe,SDKWarningCode:()=>_e,isPromiEvent:()=>wt});var ut=rr(Fr()),Ot=rr(jr());var xo={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function Uo(e){for(let[t,n]of Object.entries(xo))e.style[t]=n}function Bo(e){let t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find(n=>n.src.includes(e)))}var st=class extends Br{constructor(){super(...arguments);this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(n=>{let o=()=>{if(Bo(encodeURIComponent(this.parameters)))Ar().log();else{let s=document.createElement("iframe");s.classList.add("magic-iframe"),s.dataset.magicIframeLabel=Ve(this.endpoint).host,s.title="Secure Modal",s.src=Ve(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,Uo(s),document.body.appendChild(s),n(s)}};["loaded","interactive","complete"].includes(document.readyState)?o():window.addEventListener("load",o,!1)}),window.addEventListener("message",n=>{var o;if(n.origin===this.endpoint&&n.data&&n.data.msgType&&this.messageHandlers.size){n.data.response=(o=n.data.response)!=null?o:{};for(let s of this.messageHandlers.values())s(n)}})}showOverlay(){return Se(this,null,function*(){let n=yield this.iframe;n.style.display="block",this.activeElement=document.activeElement,n.focus()})}hideOverlay(){return Se(this,null,function*(){var o;let n=yield this.iframe;n.style.display="none",(o=this.activeElement)!=null&&o.focus&&this.activeElement.focus(),this.activeElement=null})}_post(n){return Se(this,null,function*(){let o=yield this.iframe;if(o&&o.contentWindow)o.contentWindow.postMessage(n,this.endpoint);else throw Rr()})}};var ko=Object.assign(wr(St,{platform:"web",sdkName:"magic-sdk",version:"16.2.0",defaultEndpoint:"https://auth.magic.link/",ViewController:st,configureStorage:()=>Se(void 0,null,function*(){let e=ut.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(Ot),yield e.setDriver([ut.default.INDEXEDDB,ut.default.LOCALSTORAGE,Ot._driver]),e})}),Qt({},Nt)),Fo=ko;return Wn(Go);})();
|
5
|
+
Received: \`${e.received}\``)}function Nr(){return new qe(Me.DuplicateIframe,"Duplicate iframes found.")}function ro(){return new qe(Me.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function no(){return new qe(Me.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${z.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function*io(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}var oo=io();function Mr(){return oo.next().value}var Tr=Symbol("Payload pre-processed by Magic SDK");function Or(e){return Object.defineProperty(e,Tr,{value:!0,enumerable:!1}),e}function ao(e){return!!e[Tr]}function nt(e){var t,n,o;return ao(e)||(e.jsonrpc=(t=e.jsonrpc)!=null?t:"2.0",e.id=Mr(),e.method=(n=e.method)!=null?n:"noop",e.params=(o=e.params)!=null?o:[],Or(e)),e}function q(e,t=[]){return Or({params:t,method:e,jsonrpc:"2.0",id:Mr()})}var Rt=class{constructor(e){e instanceof Rt?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):Vi(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return typeof this._error!="undefined"&&this._error!==null}get hasResult(){return typeof this._result!="undefined"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},so=ri(ni()),lo=class extends so.default{};function Lr(){let e=new lo;return{emitter:e,createChainingEmitterMethod:(t,n)=>(...o)=>(e[t].apply(e,o),n),createBoundEmitterMethod:t=>(...n)=>e[t].apply(e,n)}}var Pr=Symbol("isPromiEvent");function At(e){return!!e[Pr]}function $r(e){let t=Cr(e),{createBoundEmitterMethod:n,createChainingEmitterMethod:o}=Lr(),s=Symbol("Promise.then"),u=Symbol("Promise.catch"),g=Symbol("Promise.finally"),p=(y,N)=>(...I)=>{let M=N[y].apply(N,I);return m(M)},m=y=>Object.assign(y,{[Pr]:!0,[s]:y[s]||y.then,[u]:y[u]||y.catch,[g]:y[g]||y.finally,then:p(s,y),catch:p(u,y),finally:p(g,y),on:o("on",y),once:o("once",y),addListener:o("addListener",y),off:o("off",y),removeListener:o("removeListener",y),removeAllListeners:o("removeAllListeners",y),emit:n("emit"),eventNames:n("eventNames"),listeners:n("listeners"),listenerCount:n("listenerCount")}),v=m(t.then(y=>(v.emit("done",y),v.emit("settled"),y),y=>{throw v.emit("error",y),v.emit("settled"),y}));return v}function Cr(e){return new Promise((t,n)=>{let o=e(t,n);Promise.resolve(o).catch(n)})}var Re=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(Ie.MAGIC_HANDLE_REQUEST,nt(e)),n=$r((s,u)=>{t.then(g=>{if(o(),g.hasError)u(new $e(g.payload.error));else if(g.hasResult)s(g.payload.result);else throw Qi()}).catch(g=>{o(),u(g)})}),o=this.overlay.on(he.MAGIC_HANDLE_EVENT,s=>{var u;let{response:g}=s.data;if(g.id===e.id&&((u=g.result)==null?void 0:u.event)){let{event:p,params:m=[]}=g.result;n.emit(p,...m)}});return n}createIntermediaryEvent(e,t){return n=>{let o=q(x.IntermediaryEvent,[{payloadId:t,eventType:e,args:n}]);this.request(o)}}},uo=class extends Re{loginWithMagicLink(e){let{email:t,showUI:n=!0,redirectURI:o}=e,s=q(this.sdk.testMode?x.LoginWithMagicLinkTestMode:x.LoginWithMagicLink,[{email:t,showUI:n,redirectURI:o}]);return this.request(s)}loginWithSMS(e){let{phoneNumber:t}=e,n=q(this.sdk.testMode?x.LoginWithSmsTestMode:x.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(n)}loginWithEmailOTP(e){let{email:t,showUI:n}=e,o=q(this.sdk.testMode?x.LoginWithEmailOTPTestMode:x.LoginWithEmailOTP,[{email:t,showUI:n}]);if(!n){let s=this.request(o);return s&&(s.on("verify-email-otp",u=>{this.createIntermediaryEvent("verify-email-otp",o.id)(u)}),s.on("cancel",()=>{this.createIntermediaryEvent("cancel",o.id)()})),s}return this.request(o)}loginWithCredential(e){let t=e!=null?e:"";if(!e&&z.platform==="web"){t=window.location.search;let o=window.location.origin+window.location.pathname;window.history.replaceState(null,"",o)}let n=q(this.sdk.testMode?x.LoginWithCredentialTestMode:x.LoginWithCredential,[t]);return this.request(n)}setAuthorizationToken(){let e=q(x.SetAuthorizationToken);return this.request(e)}},Dr={};ei(Dr,{clear:()=>co,getItem:()=>we,iterate:()=>mo,key:()=>ho,keys:()=>po,length:()=>fo,removeItem:()=>it,setItem:()=>Ce});var Ze;function ye(e){return(...t)=>le(this,null,function*(){return Ze||(Ze=yield z.configureStorage()),yield Ze.ready(),Ze[e](...t)})}var we=ye("getItem"),Ce=ye("setItem"),it=ye("removeItem"),co=ye("clear"),fo=ye("length"),ho=ye("key"),po=ye("keys"),mo=ye("iterate");function vo(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&191|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var St="STORE_KEY_PRIVATE_KEY",ot="STORE_KEY_PUBLIC_JWK",Nt="ECDSA",xr="P-256",go={name:Nt,namedCurve:xr},yo={name:Nt,namedCurve:xr};function Ur(){it(ot),it(St)}function Eo(){return le(this,null,function*(){let e=yield _o();if(!e){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:t}=window.crypto,n=yield we(St);if(!n||!t){console.info("unable to find private key or webcrypto unsupported");return}let o={iat:Math.floor(new Date().getTime()/1e3),jti:vo()},s={typ:"dpop+jwt",alg:"ES256",jwk:e},u={protected:gr(JSON.stringify(s)),claims:gr(JSON.stringify(o))},g=wo(`${u.protected}.${u.claims}`),p={name:Nt,hash:{name:"SHA-256"}},m=Ao(new Uint8Array(yield t.sign(p,n,g)));return`${u.protected}.${u.claims}.${m}`})}function _o(){return le(this,null,function*(){if(!bo()){console.info("webcrypto is not supported");return}return(yield we(ot))||(yield Io()),we(ot)})}function Io(){return le(this,null,function*(){let e=null,{subtle:t}=window.crypto,n=yield t.generateKey(go,!0,["sign"]),o=yield t.exportKey("jwk",n.privateKey);e=yield t.exportKey("jwk",n.publicKey);let s=yield t.importKey("jwk",o,yo,!1,["sign"]);yield Ce(St,s),yield Ce(ot,e)})}function bo(){let e=typeof window!="undefined"&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}function gr(e){return Br(Ro(e))}function wo(e){return new TextEncoder().encode(e)}function Br(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function Ro(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode(parseInt(n,16)))}function Ao(e){let t="";return e.forEach(n=>{t+=String.fromCharCode(n)}),Br(t)}var So=class extends Re{getIdToken(e){let t=q(this.sdk.testMode?x.GetIdTokenTestMode:x.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=q(this.sdk.testMode?x.GenerateIdTokenTestMode:x.GenerateIdToken,[e]);return this.request(t)}getMetadata(){let e=q(this.sdk.testMode?x.GetMetadataTestMode:x.GetMetadata);return this.request(e)}updateEmail(e){let{email:t,showUI:n=!0}=e,o=q(this.sdk.testMode?x.UpdateEmailTestMode:x.UpdateEmail,[{email:t,showUI:n}]);return this.request(o)}isLoggedIn(){let e=q(this.sdk.testMode?x.IsLoggedInTestMode:x.IsLoggedIn);return this.request(e)}logout(){Ur();let e=q(this.sdk.testMode?x.LogoutTestMode:x.Logout);return this.request(e)}showSettings(){let e=q(this.sdk.testMode?x.UserSettingsTestMode:x.UserSettings);return this.request(e)}updatePhoneNumber(){let e=q(this.sdk.testMode?x.UpdatePhoneNumberTestMode:x.UpdatePhoneNumber);return this.request(e)}recoverAccount(e){let t=q(this.sdk.testMode?x.RecoverAccountTestMode:x.RecoverAccount,[e]);return this.request(t)}},No=class extends Re{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){return le(this,null,function*(){if(this.isMetaMaskBrowser())try{if(yield this.isWalletEnabled(ue.MetaMask))return this.autoConnectIfWalletBrowser(ue.MetaMask)}catch(o){console.error(o)}if(this.isCoinbaseWalletBrowser())try{if(yield this.isWalletEnabled(ue.CoinbaseWallet))return this.autoConnectIfWalletBrowser(ue.CoinbaseWallet)}catch(o){console.error(o)}let e=this.getUserEnv(),t=q(x.Login,[e]),n=this.request(t);return n.on(Oe.WalletSelected,o=>this.handleWalletSelected(Ir(bt({},o),{payloadId:t.id}))),n})}showUI(){let e=q(x.ShowUI);return this.request(e)}getInfo(){return le(this,null,function*(){let e=yield we(this.localForageKey),t=q(x.GetInfo,[{walletType:e}]);return this.request(t)})}requestUserInfoWithUI(e){let t=q(x.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}disconnect(){Ur(),it(this.localForageKey);let e=q(x.Disconnect);return this.request(e)}getProvider(){return le(this,null,function*(){switch(yield we(this.localForageKey)){case ue.MetaMask:return this.getMetaMaskProvider();case ue.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var e,t,n;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((n=(t=window.ethereum)==null?void 0:t.providers)!=null&&n.find(o=>o==null?void 0:o.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var e,t;return((t=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:t.find(n=>n==null?void 0:n.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let e=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=e}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}isCoinbaseWalletInstalled(){var e,t,n;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((n=(t=window.ethereum)==null?void 0:t.providers)!=null&&n.find(o=>o==null?void 0:o.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var e;return!!((e=window.ethereum)!=null&&e.isCoinbaseBrowser)}getCoinbaseProvider(){var e,t;return((t=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:t.find(n=>n==null?void 0:n.isCoinbaseWallet))||window.ethereum}connectToCoinbaseWallet(){if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let e=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=e}return this.getCoinbaseProvider().request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(e){switch(e){case ue.MetaMask:return this.connectToMetaMask();case ue.CoinbaseWallet:return this.connectToCoinbaseWallet();default:throw new Error(`Invalid provider: ${e}. Must be one of "metamask" or "coinbase_wallet".`)}}isWalletEnabled(e){let t=q("mc_is_wallet_enabled",[{wallet:e}]);return this.request(t)}handleWalletSelected(e){return le(this,null,function*(){try{let t=yield this.connectToThirdPartyWallet(e.wallet);yield Ce(this.localForageKey,e.wallet),this.createIntermediaryEvent(Oe.WalletConnected,e.payloadId)(t)}catch(t){console.error(t),this.createIntermediaryEvent(Oe.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return le(this,null,function*(){let t;e===ue.MetaMask&&(t=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===ue.CoinbaseWallet&&(t=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield Ce(this.localForageKey,e);let n=q(x.AutoConnect,[{wallet:e,address:t}]);return this.request(n)})}},{createBoundEmitterMethod:et,createChainingEmitterMethod:Le}=Lr(),Mo=class extends Re{constructor(){super(...arguments),this.isMagic=!0,this.on=Le("on",this),this.once=Le("once",this),this.addListener=Le("addListener",this),this.off=Le("off",this),this.removeListener=Le("removeListener",this),this.removeAllListeners=Le("removeAllListeners",this),this.emit=et("emit"),this.eventNames=et("eventNames"),this.listeners=et("listeners"),this.listenerCount=et("listenerCount")}sendAsync(e,t){if(!t)throw to({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:t===null?"null":typeof t});if(Array.isArray(e))this.overlay.post(Ie.MAGIC_HANDLE_REQUEST,e.map(n=>{let o=nt(n);return this.prefixPayloadMethodForTestMode(o),o})).then(n=>{t(null,n.map(o=>Ir(bt({},o.payload),{error:o.hasError?new $e(o.payload.error):null})))});else{let n=nt(e);this.prefixPayloadMethodForTestMode(n),this.overlay.post(Ie.MAGIC_HANDLE_REQUEST,n).then(o=>{t(o.hasError?new $e(o.payload.error):null,o.payload)})}}send(e,t){if(typeof e=="string"){let o=q(e,Array.isArray(t)?t:[]);return this.request(o)}if(Array.isArray(e)||!!t){this.sendAsync(e,t);return}let n=ro();return n.log(),new Rt(e).applyError({code:-32603,message:n.rawMessage}).payload}enable(){let e=q("eth_accounts");return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){let t="testMode/eth/";this.sdk.testMode&&(e.method=`${t}${e.method}`)}};function Ye(e,t){return t?new URL(e,t):new URL(e)}var yr=["request","overlay","sdk"];function To(e){let t=Object.getPrototypeOf(e),n=[t];for(;t!==Re.prototype;)t=Object.getPrototypeOf(t),n.push(t);return n}var kr=class extends Re{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:$r,isPromiEvent:At,encodeJSON:wr,decodeJSON:Hi,createJsonRpcRequestPayload:q,standardizeJsonRpcRequestPayload:nt,storage:Dr};let e=[this,...To(this)];yr.forEach(t=>{let n=e.map(g=>Object.getOwnPropertyDescriptor(g,t)),o=n.findIndex(g=>!!g),s=o>0,u=n[o];u&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:u,isPrototypeField:s}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw Zi(t)}}))})}init(e){this.__is_initialized__||(yr.forEach(t=>{if(this.__sdk_access_field_descriptors__.has(t)){let{descriptor:n,isPrototypeField:o}=this.__sdk_access_field_descriptors__.get(t);o?delete this[t]:Object.defineProperty(this,t,n)}}),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:n,useInstead:o}=e,s=o?` Use \`${o}\` instead.`:"",u=`\`${t}\` will be removed from this Extension in version \`${n}\`.${s}`;return new rt(this,"DEPRECATION_NOTICE",u)}createWarning(e,t){return new rt(this,e,t)}createError(e,t,n){return new st(this,e,t,n)}},Oo=class extends kr{},be=class extends kr{};be.Internal=Oo,be.Anonymous="anonymous extension";var Lo=class extends Re{purchase(e){let t=q(x.NFTPurchase,[e]);return this.request(t)}};function Er(e){return e.compat&&e.compat[z.sdkName]!=null?typeof e.compat[z.sdkName]=="string"?Ui(Fi(z.version),e.compat[z.sdkName]):!!e.compat[z.sdkName]:!0}function Po(e){var t;let n=(t=e==null?void 0:e.extensions)!=null?t:[],o={},s=[];if(Array.isArray(n)?n.forEach(u=>{Er(u)?(u.init(this),(u.name||u.name!==be.Anonymous)&&(this[u.name]=u),u instanceof be.Internal&&(It(u.config)||(o[u.name]=u.config))):s.push(u)}):Object.keys(n).forEach(u=>{if(Er(n[u])){n[u].init(this);let g=n[u];this[u]=g,g instanceof be.Internal&&(It(g.config)||(o[n[u].name]=g.config))}else s.push(n[u])}),s.length)throw eo(s);return o}var tt=class{constructor(e,t){this.apiKey=e;var n;if(!e)throw Ji();z.platform==="react-native"&&(t==null?void 0:t.endpoint)&&no().log();let{defaultEndpoint:o,version:s}=z;this.testMode=!!(t!=null&&t.testMode),this.endpoint=Ye((n=t==null?void 0:t.endpoint)!=null?n:o).origin,this.auth=new uo(this),this.user=new So(this),this.wallet=new No(this),this.nft=new Lo(this),this.rpcProvider=new Mo(this);let u=Po.call(this,t);this.parameters=wr(bt({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?void 0:t.network,host:Ye(this.endpoint).host,sdk:zi[z.sdkName],version:s,ext:It(u)?void 0:u,locale:(t==null?void 0:t.locale)||"en_US"},z.bundleId?{bundleId:z.bundleId}:{}))}get overlay(){if(!tt.__overlays__.has(this.parameters)){let e=new z.ViewController(this.endpoint,this.parameters);e.init(),tt.__overlays__.set(this.parameters,e)}return tt.__overlays__.get(this.parameters)}preload(){return le(this,null,function*(){yield this.overlay.ready})}},Mt=tt;Mt.__overlays__=new Map;function $o(e,t){return t&&Array.isArray(e)?e.find(n=>n.id===t):e}function Co(e,t){var n;let o=(n=t.data.response)==null?void 0:n.id,s=$o(e,o);if(o&&s){let u=new Rt(s).applyResult(t.data.response.result).applyError(t.data.response.error);return{id:o,response:u}}return{}}function Do(e,t){return le(this,null,function*(){let n=yield we("rt"),o;if(z.platform==="web")try{o=yield Eo()}catch(s){console.error("webcrypto error",s)}return o?n?{msgType:e,payload:t,jwt:o,rt:n}:{msgType:e,payload:t,jwt:o}:{msgType:e,payload:t}})}function xo(e){return le(this,null,function*(){!e.data.rt||(yield Ce("rt",e.data.rt))})}var Wr=class{constructor(e,t){this.endpoint=e,this.parameters=t,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(e,t){return le(this,null,function*(){return Cr(n=>le(this,null,function*(){yield this.ready;let o=[],s=Array.isArray(t)?t.map(m=>m.id):[],u=yield Do(`${e}-${this.parameters}`,t);yield this._post(u);let g=m=>v=>{let{id:y,response:N}=Co(t,v);xo(v),y&&N&&Array.isArray(t)&&s.includes(y)?(o.push(N),o.length===t.length&&(m(),n(o))):y&&N&&!Array.isArray(t)&&y===t.id&&(m(),n(N))},p=this.on(he.MAGIC_HANDLE_RESPONSE,g(()=>p()))}))})}on(e,t){let n=t.bind(window),o=s=>{s.data.msgType===`${e}-${this.parameters}`&&n(s)};return this.messageHandlers.add(o),()=>this.messageHandlers.delete(o)}waitForReady(){return new Promise(e=>{this.on(he.MAGIC_OVERLAY_READY,()=>e())})}listen(){this.on(he.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(he.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}};var Tt={};rr(Tt,{EthChainType:()=>or,Events:()=>Oe,Extension:()=>be,ExtensionError:()=>st,ExtensionWarning:()=>rt,MagicIncomingWindowMessage:()=>he,MagicOutgoingWindowMessage:()=>Ie,MagicPayloadMethod:()=>x,RPCError:()=>$e,RPCErrorCode:()=>Te,SDKError:()=>pe,SDKErrorCode:()=>de,SDKWarning:()=>qe,SDKWarningCode:()=>Me,Wallets:()=>ue,isPromiEvent:()=>At});var ct=ir(Gr()),Lt=ir(Kr());var Uo={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function Bo(e){for(let[t,n]of Object.entries(Uo))e.style[t]=n}function ko(e){let t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find(n=>n.src.includes(e)))}var ut=class extends Wr{constructor(){super(...arguments);this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(n=>{let o=()=>{if(ko(encodeURIComponent(this.parameters)))Nr().log();else{let s=document.createElement("iframe");s.classList.add("magic-iframe"),s.dataset.magicIframeLabel=Ye(this.endpoint).host,s.title="Secure Modal",s.src=Ye(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,Bo(s),document.body.appendChild(s),n(s)}};["loaded","interactive","complete"].includes(document.readyState)?o():window.addEventListener("load",o,!1)}),window.addEventListener("message",n=>{var o;if(n.origin===this.endpoint&&n.data&&n.data.msgType&&this.messageHandlers.size){n.data.response=(o=n.data.response)!=null?o:{};for(let s of this.messageHandlers.values())s(n)}})}showOverlay(){return Ne(this,null,function*(){let n=yield this.iframe;n.style.display="block",this.activeElement=document.activeElement,n.focus()})}hideOverlay(){return Ne(this,null,function*(){var o;let n=yield this.iframe;n.style.display="none",(o=this.activeElement)!=null&&o.focus&&this.activeElement.focus(),this.activeElement=null})}_post(n){return Ne(this,null,function*(){let o=yield this.iframe;if(o&&o.contentWindow)o.contentWindow.postMessage(n,this.endpoint);else throw Sr()})}};var Wo=Object.assign(Ar(Mt,{platform:"web",sdkName:"magic-sdk",version:"16.2.0",defaultEndpoint:"https://auth.magic.link/",ViewController:ut,configureStorage:()=>Ne(void 0,null,function*(){let e=ct.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(Lt),yield e.setDriver([ct.default.INDEXEDDB,ct.default.LOCALSTORAGE,Lt._driver]),e})}),er({},Tt)),Fo=Wo;return Yn(Go);})();
|
6
6
|
if (Magic && Magic.default != null) { Magic = Object.assign(Magic.default, Magic); delete Magic.default; }
|
@@ -11,6 +11,8 @@ declare const Magic: import("@magic-sdk/provider").WithExtensions<SDKBase> & {
|
|
11
11
|
SDKErrorCode: typeof publicAPI.SDKErrorCode;
|
12
12
|
SDKWarningCode: typeof publicAPI.SDKWarningCode;
|
13
13
|
RPCErrorCode: typeof publicAPI.RPCErrorCode;
|
14
|
+
Wallets: typeof publicAPI.Wallets;
|
15
|
+
Events: typeof publicAPI.Events;
|
14
16
|
MagicPayloadMethod: typeof publicAPI.MagicPayloadMethod;
|
15
17
|
MagicIncomingWindowMessage: typeof publicAPI.MagicIncomingWindowMessage;
|
16
18
|
MagicOutgoingWindowMessage: typeof publicAPI.MagicOutgoingWindowMessage;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "magic-sdk",
|
3
|
-
"version": "
|
3
|
+
"version": "17.0.0-canary.496.4689611306.0",
|
4
4
|
"description": "Passwordless authentication for the web.",
|
5
5
|
"author": "Magic Labs <team@magic.link> (https://magic.link/)",
|
6
6
|
"license": "MIT",
|
@@ -28,9 +28,9 @@
|
|
28
28
|
]
|
29
29
|
},
|
30
30
|
"dependencies": {
|
31
|
-
"@magic-sdk/commons": "
|
32
|
-
"@magic-sdk/provider": "16.
|
33
|
-
"@magic-sdk/types": "
|
31
|
+
"@magic-sdk/commons": "13.0.0-canary.496.4689611306.0",
|
32
|
+
"@magic-sdk/provider": "^16.2.0",
|
33
|
+
"@magic-sdk/types": "15.0.0-canary.496.4689611306.0",
|
34
34
|
"localforage": "^1.7.4"
|
35
35
|
},
|
36
36
|
"devDependencies": {
|
@@ -39,5 +39,5 @@
|
|
39
39
|
"@babel/runtime": "^7.9.6",
|
40
40
|
"localforage-driver-memory": "^1.0.5"
|
41
41
|
},
|
42
|
-
"gitHead": "
|
42
|
+
"gitHead": "aeee91434090acc567a7ce3460c307f42984316e"
|
43
43
|
}
|