magic-sdk 28.0.4-canary.747.9406332813.0 → 28.0.4-canary.852ded9.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 +4 -10
- package/package.json +5 -5
package/dist/magic.js
CHANGED
@@ -1,12 +1,6 @@
|
|
1
|
-
"use strict";var Magic=(()=>{var Hu=Object.create;var rr=Object.defineProperty;var Ku=Object.getOwnPropertyDescriptor;var Yu=Object.getOwnPropertyNames,hi=Object.getOwnPropertySymbols,qu=Object.getPrototypeOf,gi=Object.prototype.hasOwnProperty,Vu=Object.prototype.propertyIsEnumerable;var vi=(e,t,r)=>t in e?rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yi=(e,t)=>{for(var r in t||(t={}))gi.call(t,r)&&vi(e,r,t[r]);if(hi)for(var r of hi(t))Vu.call(t,r)&&vi(e,r,t[r]);return e};var nr=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var Ei=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bi=(e,t)=>{for(var r in t)rr(e,r,{get:t[r],enumerable:!0})},_i=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Yu(t))!gi.call(e,o)&&o!==r&&rr(e,o,{get:()=>t[o],enumerable:!(n=Ku(t,o))||n.enumerable});return e};var Si=(e,t,r)=>(r=e!=null?Hu(qu(e)):{},_i(t||!e||!e.__esModule?rr(r,"default",{value:e,enumerable:!0}):r,e)),zu=e=>_i(rr({},"__esModule",{value:!0}),e);var It=(e,t,r)=>new Promise((n,o)=>{var i=f=>{try{c(r.next(f))}catch(l){o(l)}},a=f=>{try{c(r.throw(f))}catch(l){o(l)}},c=f=>f.done?n(f.value):Promise.resolve(f.value).then(i,a);c((r=r.apply(e,t)).next())});var qs=Ei((Ys,Vo)=>{(function(e){if(typeof Ys=="object"&&typeof Vo<"u")Vo.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,r;return function n(o,i,a){function c(p,g){if(!i[p]){if(!o[p]){var y=typeof nr=="function"&&nr;if(!g&&y)return y(p,!0);if(f)return f(p,!0);var S=new Error("Cannot find module '"+p+"'");throw S.code="MODULE_NOT_FOUND",S}var C=i[p]={exports:{}};o[p][0].call(C.exports,function(L){var A=o[p][1][L];return c(A||L)},C,C.exports,n,o,i,a)}return i[p].exports}for(var f=typeof nr=="function"&&nr,l=0;l<a.length;l++)c(a[l]);return c}({1:[function(n,o,i){(function(a){"use strict";var c=a.MutationObserver||a.WebKitMutationObserver,f;if(c){var l=0,p=new c(L),g=a.document.createTextNode("");p.observe(g,{characterData:!0}),f=function(){g.data=l=++l%2}}else if(!a.setImmediate&&typeof a.MessageChannel<"u"){var y=new a.MessageChannel;y.port1.onmessage=L,f=function(){y.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?f=function(){var $=a.document.createElement("script");$.onreadystatechange=function(){L(),$.onreadystatechange=null,$.parentNode.removeChild($),$=null},a.document.documentElement.appendChild($)}:f=function(){setTimeout(L,0)};var S,C=[];function L(){S=!0;for(var $,Q,k=C.length;k;){for(Q=C,C=[],$=-1;++$<k;)Q[$]();k=C.length}S=!1}o.exports=A;function A($){C.push($)===1&&!S&&f()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,o,i){"use strict";var a=n(1);function c(){}var f={},l=["REJECTED"],p=["FULFILLED"],g=["PENDING"];o.exports=y;function y(O){if(typeof O!="function")throw new TypeError("resolver must be a function");this.state=g,this.queue=[],this.outcome=void 0,O!==c&&A(this,O)}y.prototype.catch=function(O){return this.then(null,O)},y.prototype.then=function(O,K){if(typeof O!="function"&&this.state===p||typeof K!="function"&&this.state===l)return this;var F=new this.constructor(c);if(this.state!==g){var X=this.state===p?O:K;C(F,X,this.outcome)}else this.queue.push(new S(F,O,K));return F};function S(O,K,F){this.promise=O,typeof K=="function"&&(this.onFulfilled=K,this.callFulfilled=this.otherCallFulfilled),typeof F=="function"&&(this.onRejected=F,this.callRejected=this.otherCallRejected)}S.prototype.callFulfilled=function(O){f.resolve(this.promise,O)},S.prototype.otherCallFulfilled=function(O){C(this.promise,this.onFulfilled,O)},S.prototype.callRejected=function(O){f.reject(this.promise,O)},S.prototype.otherCallRejected=function(O){C(this.promise,this.onRejected,O)};function C(O,K,F){a(function(){var X;try{X=K(F)}catch(ae){return f.reject(O,ae)}X===O?f.reject(O,new TypeError("Cannot resolve promise with itself")):f.resolve(O,X)})}f.resolve=function(O,K){var F=$(L,K);if(F.status==="error")return f.reject(O,F.value);var X=F.value;if(X)A(O,X);else{O.state=p,O.outcome=K;for(var ae=-1,me=O.queue.length;++ae<me;)O.queue[ae].callFulfilled(K)}return O},f.reject=function(O,K){O.state=l,O.outcome=K;for(var F=-1,X=O.queue.length;++F<X;)O.queue[F].callRejected(K);return O};function L(O){var K=O&&O.then;if(O&&(typeof O=="object"||typeof O=="function")&&typeof K=="function")return function(){K.apply(O,arguments)}}function A(O,K){var F=!1;function X(Ee){F||(F=!0,f.reject(O,Ee))}function ae(Ee){F||(F=!0,f.resolve(O,Ee))}function me(){K(ae,X)}var ye=$(me);ye.status==="error"&&X(ye.value)}function $(O,K){var F={};try{F.value=O(K),F.status="success"}catch(X){F.status="error",F.value=X}return F}y.resolve=Q;function Q(O){return O instanceof this?O:f.resolve(new this(c),O)}y.reject=k;function k(O){var K=new this(c);return f.reject(K,O)}y.all=Ue;function Ue(O){var K=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=O.length,X=!1;if(!F)return this.resolve([]);for(var ae=new Array(F),me=0,ye=-1,Ee=new this(c);++ye<F;)ke(O[ye],ye);return Ee;function ke(ut,E){K.resolve(ut).then(I,function(R){X||(X=!0,f.reject(Ee,R))});function I(R){ae[E]=R,++me===F&&!X&&(X=!0,f.resolve(Ee,ae))}}}y.race=U;function U(O){var K=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=O.length,X=!1;if(!F)return this.resolve([]);for(var ae=-1,me=new this(c);++ae<F;)ye(O[ae]);return me;function ye(Ee){K.resolve(Ee).then(function(ke){X||(X=!0,f.resolve(me,ke))},function(ke){X||(X=!0,f.reject(me,ke))})}}},{1:1}],3:[function(n,o,i){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,o,i){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function c(s,d){if(!(s instanceof d))throw new TypeError("Cannot call a class as a function")}function f(){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 l=f();function p(){try{if(!l||!l.open)return!1;var s=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),d=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!s||d)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function g(s,d){s=s||[],d=d||{};try{return new Blob(s,d)}catch(m){if(m.name!=="TypeError")throw m;for(var u=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,h=new u,v=0;v<s.length;v+=1)h.append(s[v]);return h.getBlob(d.type)}}typeof Promise>"u"&&n(3);var y=Promise;function S(s,d){d&&s.then(function(u){d(null,u)},function(u){d(u)})}function C(s,d,u){typeof d=="function"&&s.then(d),typeof u=="function"&&s.catch(u)}function L(s){return typeof s!="string"&&(console.warn(s+" used as a key, but it is not a string."),s=String(s)),s}function A(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var $="local-forage-detect-blob-support",Q=void 0,k={},Ue=Object.prototype.toString,U="readonly",O="readwrite";function K(s){for(var d=s.length,u=new ArrayBuffer(d),h=new Uint8Array(u),v=0;v<d;v++)h[v]=s.charCodeAt(v);return u}function F(s){return new y(function(d){var u=s.transaction($,O),h=g([""]);u.objectStore($).put(h,"key"),u.onabort=function(v){v.preventDefault(),v.stopPropagation(),d(!1)},u.oncomplete=function(){var v=navigator.userAgent.match(/Chrome\/(\d+)/),m=navigator.userAgent.match(/Edge\//);d(m||!v||parseInt(v[1],10)>=43)}}).catch(function(){return!1})}function X(s){return typeof Q=="boolean"?y.resolve(Q):F(s).then(function(d){return Q=d,Q})}function ae(s){var d=k[s.name],u={};u.promise=new y(function(h,v){u.resolve=h,u.reject=v}),d.deferredOperations.push(u),d.dbReady?d.dbReady=d.dbReady.then(function(){return u.promise}):d.dbReady=u.promise}function me(s){var d=k[s.name],u=d.deferredOperations.pop();if(u)return u.resolve(),u.promise}function ye(s,d){var u=k[s.name],h=u.deferredOperations.pop();if(h)return h.reject(d),h.promise}function Ee(s,d){return new y(function(u,h){if(k[s.name]=k[s.name]||ue(),s.db)if(d)ae(s),s.db.close();else return u(s.db);var v=[s.name];d&&v.push(s.version);var m=l.open.apply(l,v);d&&(m.onupgradeneeded=function(b){var _=m.result;try{_.createObjectStore(s.storeName),b.oldVersion<=1&&_.createObjectStore($)}catch(w){if(w.name==="ConstraintError")console.warn('The database "'+s.name+'" has been upgraded from version '+b.oldVersion+" to version "+b.newVersion+', but the storage "'+s.storeName+'" already exists.');else throw w}}),m.onerror=function(b){b.preventDefault(),h(m.error)},m.onsuccess=function(){var b=m.result;b.onversionchange=function(_){_.target.close()},u(b),me(s)}})}function ke(s){return Ee(s,!1)}function ut(s){return Ee(s,!0)}function E(s,d){if(!s.db)return!0;var u=!s.db.objectStoreNames.contains(s.storeName),h=s.version<s.db.version,v=s.version>s.db.version;if(h&&(s.version!==d&&console.warn('The database "'+s.name+`" can't be downgraded from version `+s.db.version+" to version "+s.version+"."),s.version=s.db.version),v||u){if(u){var m=s.db.version+1;m>s.version&&(s.version=m)}return!0}return!1}function I(s){return new y(function(d,u){var h=new FileReader;h.onerror=u,h.onloadend=function(v){var m=btoa(v.target.result||"");d({__local_forage_encoded_blob:!0,data:m,type:s.type})},h.readAsBinaryString(s)})}function R(s){var d=K(atob(s.data));return g([d],{type:s.type})}function P(s){return s&&s.__local_forage_encoded_blob}function D(s){var d=this,u=d._initReady().then(function(){var h=k[d._dbInfo.name];if(h&&h.dbReady)return h.dbReady});return C(u,s,s),u}function B(s){ae(s);for(var d=k[s.name],u=d.forages,h=0;h<u.length;h++){var v=u[h];v._dbInfo.db&&(v._dbInfo.db.close(),v._dbInfo.db=null)}return s.db=null,ke(s).then(function(m){return s.db=m,E(s)?ut(s):m}).then(function(m){s.db=d.db=m;for(var b=0;b<u.length;b++)u[b]._dbInfo.db=m}).catch(function(m){throw ye(s,m),m})}function Y(s,d,u,h){h===void 0&&(h=1);try{var v=s.db.transaction(s.storeName,d);u(null,v)}catch(m){if(h>0&&(!s.db||m.name==="InvalidStateError"||m.name==="NotFoundError"))return y.resolve().then(function(){if(!s.db||m.name==="NotFoundError"&&!s.db.objectStoreNames.contains(s.storeName)&&s.version<=s.db.version)return s.db&&(s.version=s.db.version+1),ut(s)}).then(function(){return B(s).then(function(){Y(s,d,u,h-1)})}).catch(u);u(m)}}function ue(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function _t(s){var d=this,u={db:null};if(s)for(var h in s)u[h]=s[h];var v=k[u.name];v||(v=ue(),k[u.name]=v),v.forages.push(d),d._initReady||(d._initReady=d.ready,d.ready=D);var m=[];function b(){return y.resolve()}for(var _=0;_<v.forages.length;_++){var w=v.forages[_];w!==d&&m.push(w._initReady().catch(b))}var x=v.forages.slice(0);return y.all(m).then(function(){return u.db=v.db,ke(u)}).then(function(T){return u.db=T,E(u,d._defaultConfig.version)?ut(u):T}).then(function(T){u.db=v.db=T,d._dbInfo=u;for(var N=0;N<x.length;N++){var G=x[N];G!==d&&(G._dbInfo.db=u.db,G._dbInfo.version=u.version)}})}function ct(s,d){var u=this;s=L(s);var h=new y(function(v,m){u.ready().then(function(){Y(u._dbInfo,U,function(b,_){if(b)return m(b);try{var w=_.objectStore(u._dbInfo.storeName),x=w.get(s);x.onsuccess=function(){var T=x.result;T===void 0&&(T=null),P(T)&&(T=R(T)),v(T)},x.onerror=function(){m(x.error)}}catch(T){m(T)}})}).catch(m)});return S(h,d),h}function Qt(s,d){var u=this,h=new y(function(v,m){u.ready().then(function(){Y(u._dbInfo,U,function(b,_){if(b)return m(b);try{var w=_.objectStore(u._dbInfo.storeName),x=w.openCursor(),T=1;x.onsuccess=function(){var N=x.result;if(N){var G=N.value;P(G)&&(G=R(G));var V=s(G,N.key,T++);V!==void 0?v(V):N.continue()}else v()},x.onerror=function(){m(x.error)}}catch(N){m(N)}})}).catch(m)});return S(h,d),h}function Xs(s,d,u){var h=this;s=L(s);var v=new y(function(m,b){var _;h.ready().then(function(){return _=h._dbInfo,Ue.call(d)==="[object Blob]"?X(_.db).then(function(w){return w?d:I(d)}):d}).then(function(w){Y(h._dbInfo,O,function(x,T){if(x)return b(x);try{var N=T.objectStore(h._dbInfo.storeName);w===null&&(w=void 0);var G=N.put(w,s);T.oncomplete=function(){w===void 0&&(w=null),m(w)},T.onabort=T.onerror=function(){var V=G.error?G.error:G.transaction.error;b(V)}}catch(V){b(V)}})}).catch(b)});return S(v,u),v}function Js(s,d){var u=this;s=L(s);var h=new y(function(v,m){u.ready().then(function(){Y(u._dbInfo,O,function(b,_){if(b)return m(b);try{var w=_.objectStore(u._dbInfo.storeName),x=w.delete(s);_.oncomplete=function(){v()},_.onerror=function(){m(x.error)},_.onabort=function(){var T=x.error?x.error:x.transaction.error;m(T)}}catch(T){m(T)}})}).catch(m)});return S(h,d),h}function Zs(s){var d=this,u=new y(function(h,v){d.ready().then(function(){Y(d._dbInfo,O,function(m,b){if(m)return v(m);try{var _=b.objectStore(d._dbInfo.storeName),w=_.clear();b.oncomplete=function(){h()},b.onabort=b.onerror=function(){var x=w.error?w.error:w.transaction.error;v(x)}}catch(x){v(x)}})}).catch(v)});return S(u,s),u}function Qs(s){var d=this,u=new y(function(h,v){d.ready().then(function(){Y(d._dbInfo,U,function(m,b){if(m)return v(m);try{var _=b.objectStore(d._dbInfo.storeName),w=_.count();w.onsuccess=function(){h(w.result)},w.onerror=function(){v(w.error)}}catch(x){v(x)}})}).catch(v)});return S(u,s),u}function eu(s,d){var u=this,h=new y(function(v,m){if(s<0){v(null);return}u.ready().then(function(){Y(u._dbInfo,U,function(b,_){if(b)return m(b);try{var w=_.objectStore(u._dbInfo.storeName),x=!1,T=w.openKeyCursor();T.onsuccess=function(){var N=T.result;if(!N){v(null);return}s===0||x?v(N.key):(x=!0,N.advance(s))},T.onerror=function(){m(T.error)}}catch(N){m(N)}})}).catch(m)});return S(h,d),h}function tu(s){var d=this,u=new y(function(h,v){d.ready().then(function(){Y(d._dbInfo,U,function(m,b){if(m)return v(m);try{var _=b.objectStore(d._dbInfo.storeName),w=_.openKeyCursor(),x=[];w.onsuccess=function(){var T=w.result;if(!T){h(x);return}x.push(T.key),T.continue()},w.onerror=function(){v(w.error)}}catch(T){v(T)}})}).catch(v)});return S(u,s),u}function ru(s,d){d=A.apply(this,arguments);var u=this.config();s=typeof s!="function"&&s||{},s.name||(s.name=s.name||u.name,s.storeName=s.storeName||u.storeName);var h=this,v;if(!s.name)v=y.reject("Invalid arguments");else{var m=s.name===u.name&&h._dbInfo.db,b=m?y.resolve(h._dbInfo.db):ke(s).then(function(_){var w=k[s.name],x=w.forages;w.db=_;for(var T=0;T<x.length;T++)x[T]._dbInfo.db=_;return _});s.storeName?v=b.then(function(_){if(!!_.objectStoreNames.contains(s.storeName)){var w=_.version+1;ae(s);var x=k[s.name],T=x.forages;_.close();for(var N=0;N<T.length;N++){var G=T[N];G._dbInfo.db=null,G._dbInfo.version=w}var V=new y(function(J,ie){var oe=l.open(s.name,w);oe.onerror=function(Re){var tr=oe.result;tr.close(),ie(Re)},oe.onupgradeneeded=function(){var Re=oe.result;Re.deleteObjectStore(s.storeName)},oe.onsuccess=function(){var Re=oe.result;Re.close(),J(Re)}});return V.then(function(J){x.db=J;for(var ie=0;ie<T.length;ie++){var oe=T[ie];oe._dbInfo.db=J,me(oe._dbInfo)}}).catch(function(J){throw(ye(s,J)||y.resolve()).catch(function(){}),J})}}):v=b.then(function(_){ae(s);var w=k[s.name],x=w.forages;_.close();for(var T=0;T<x.length;T++){var N=x[T];N._dbInfo.db=null}var G=new y(function(V,J){var ie=l.deleteDatabase(s.name);ie.onerror=function(){var oe=ie.result;oe&&oe.close(),J(ie.error)},ie.onblocked=function(){console.warn('dropInstance blocked for database "'+s.name+'" until all open connections are closed')},ie.onsuccess=function(){var oe=ie.result;oe&&oe.close(),V(oe)}});return G.then(function(V){w.db=V;for(var J=0;J<x.length;J++){var ie=x[J];me(ie._dbInfo)}}).catch(function(V){throw(ye(s,V)||y.resolve()).catch(function(){}),V})})}return S(v,d),v}var nu={_driver:"asyncStorage",_initStorage:_t,_support:p(),iterate:Qt,getItem:ct,setItem:Xs,removeItem:Js,clear:Zs,length:Qs,key:eu,keys:tu,dropInstance:ru};function ou(){return typeof openDatabase=="function"}var tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",iu="~~local_forage_type~",Xo=/^~~local_forage_type~([^~]+)~/,Lr="__lfsc__:",Ln=Lr.length,Nn="arbf",Mn="blob",Jo="si08",Zo="ui08",Qo="uic8",ei="si16",ti="si32",ri="ur16",ni="ui32",oi="fl32",ii="fl64",ai=Ln+Nn.length,si=Object.prototype.toString;function ui(s){var d=s.length*.75,u=s.length,h,v=0,m,b,_,w;s[s.length-1]==="="&&(d--,s[s.length-2]==="="&&d--);var x=new ArrayBuffer(d),T=new Uint8Array(x);for(h=0;h<u;h+=4)m=tt.indexOf(s[h]),b=tt.indexOf(s[h+1]),_=tt.indexOf(s[h+2]),w=tt.indexOf(s[h+3]),T[v++]=m<<2|b>>4,T[v++]=(b&15)<<4|_>>2,T[v++]=(_&3)<<6|w&63;return x}function kn(s){var d=new Uint8Array(s),u="",h;for(h=0;h<d.length;h+=3)u+=tt[d[h]>>2],u+=tt[(d[h]&3)<<4|d[h+1]>>4],u+=tt[(d[h+1]&15)<<2|d[h+2]>>6],u+=tt[d[h+2]&63];return d.length%3===2?u=u.substring(0,u.length-1)+"=":d.length%3===1&&(u=u.substring(0,u.length-2)+"=="),u}function au(s,d){var u="";if(s&&(u=si.call(s)),s&&(u==="[object ArrayBuffer]"||s.buffer&&si.call(s.buffer)==="[object ArrayBuffer]")){var h,v=Lr;s instanceof ArrayBuffer?(h=s,v+=Nn):(h=s.buffer,u==="[object Int8Array]"?v+=Jo:u==="[object Uint8Array]"?v+=Zo:u==="[object Uint8ClampedArray]"?v+=Qo:u==="[object Int16Array]"?v+=ei:u==="[object Uint16Array]"?v+=ri:u==="[object Int32Array]"?v+=ti:u==="[object Uint32Array]"?v+=ni:u==="[object Float32Array]"?v+=oi:u==="[object Float64Array]"?v+=ii:d(new Error("Failed to get type for BinaryArray"))),d(v+kn(h))}else if(u==="[object Blob]"){var m=new FileReader;m.onload=function(){var b=iu+s.type+"~"+kn(this.result);d(Lr+Mn+b)},m.readAsArrayBuffer(s)}else try{d(JSON.stringify(s))}catch(b){console.error("Couldn't convert value into a JSON string: ",s),d(null,b)}}function su(s){if(s.substring(0,Ln)!==Lr)return JSON.parse(s);var d=s.substring(ai),u=s.substring(Ln,ai),h;if(u===Mn&&Xo.test(d)){var v=d.match(Xo);h=v[1],d=d.substring(v[0].length)}var m=ui(d);switch(u){case Nn:return m;case Mn:return g([m],{type:h});case Jo:return new Int8Array(m);case Zo:return new Uint8Array(m);case Qo:return new Uint8ClampedArray(m);case ei:return new Int16Array(m);case ri:return new Uint16Array(m);case ti:return new Int32Array(m);case ni:return new Uint32Array(m);case oi:return new Float32Array(m);case ii:return new Float64Array(m);default:throw new Error("Unkown type: "+u)}}var Pn={serialize:au,deserialize:su,stringToBuffer:ui,bufferToString:kn};function ci(s,d,u,h){s.executeSql("CREATE TABLE IF NOT EXISTS "+d.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],u,h)}function uu(s){var d=this,u={db:null};if(s)for(var h in s)u[h]=typeof s[h]!="string"?s[h].toString():s[h];var v=new y(function(m,b){try{u.db=openDatabase(u.name,String(u.version),u.description,u.size)}catch(_){return b(_)}u.db.transaction(function(_){ci(_,u,function(){d._dbInfo=u,m()},function(w,x){b(x)})},b)});return u.serializer=Pn,v}function rt(s,d,u,h,v,m){s.executeSql(u,h,v,function(b,_){_.code===_.SYNTAX_ERR?b.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[d.storeName],function(w,x){x.rows.length?m(w,_):ci(w,d,function(){w.executeSql(u,h,v,m)},m)},m):m(b,_)},m)}function cu(s,d){var u=this;s=L(s);var h=new y(function(v,m){u.ready().then(function(){var b=u._dbInfo;b.db.transaction(function(_){rt(_,b,"SELECT * FROM "+b.storeName+" WHERE key = ? LIMIT 1",[s],function(w,x){var T=x.rows.length?x.rows.item(0).value:null;T&&(T=b.serializer.deserialize(T)),v(T)},function(w,x){m(x)})})}).catch(m)});return S(h,d),h}function lu(s,d){var u=this,h=new y(function(v,m){u.ready().then(function(){var b=u._dbInfo;b.db.transaction(function(_){rt(_,b,"SELECT * FROM "+b.storeName,[],function(w,x){for(var T=x.rows,N=T.length,G=0;G<N;G++){var V=T.item(G),J=V.value;if(J&&(J=b.serializer.deserialize(J)),J=s(J,V.key,G+1),J!==void 0){v(J);return}}v()},function(w,x){m(x)})})}).catch(m)});return S(h,d),h}function li(s,d,u,h){var v=this;s=L(s);var m=new y(function(b,_){v.ready().then(function(){d===void 0&&(d=null);var w=d,x=v._dbInfo;x.serializer.serialize(d,function(T,N){N?_(N):x.db.transaction(function(G){rt(G,x,"INSERT OR REPLACE INTO "+x.storeName+" (key, value) VALUES (?, ?)",[s,T],function(){b(w)},function(V,J){_(J)})},function(G){if(G.code===G.QUOTA_ERR){if(h>0){b(li.apply(v,[s,w,u,h-1]));return}_(G)}})})}).catch(_)});return S(m,u),m}function fu(s,d,u){return li.apply(this,[s,d,u,1])}function du(s,d){var u=this;s=L(s);var h=new y(function(v,m){u.ready().then(function(){var b=u._dbInfo;b.db.transaction(function(_){rt(_,b,"DELETE FROM "+b.storeName+" WHERE key = ?",[s],function(){v()},function(w,x){m(x)})})}).catch(m)});return S(h,d),h}function pu(s){var d=this,u=new y(function(h,v){d.ready().then(function(){var m=d._dbInfo;m.db.transaction(function(b){rt(b,m,"DELETE FROM "+m.storeName,[],function(){h()},function(_,w){v(w)})})}).catch(v)});return S(u,s),u}function mu(s){var d=this,u=new y(function(h,v){d.ready().then(function(){var m=d._dbInfo;m.db.transaction(function(b){rt(b,m,"SELECT COUNT(key) as c FROM "+m.storeName,[],function(_,w){var x=w.rows.item(0).c;h(x)},function(_,w){v(w)})})}).catch(v)});return S(u,s),u}function hu(s,d){var u=this,h=new y(function(v,m){u.ready().then(function(){var b=u._dbInfo;b.db.transaction(function(_){rt(_,b,"SELECT key FROM "+b.storeName+" WHERE id = ? LIMIT 1",[s+1],function(w,x){var T=x.rows.length?x.rows.item(0).key:null;v(T)},function(w,x){m(x)})})}).catch(m)});return S(h,d),h}function vu(s){var d=this,u=new y(function(h,v){d.ready().then(function(){var m=d._dbInfo;m.db.transaction(function(b){rt(b,m,"SELECT key FROM "+m.storeName,[],function(_,w){for(var x=[],T=0;T<w.rows.length;T++)x.push(w.rows.item(T).key);h(x)},function(_,w){v(w)})})}).catch(v)});return S(u,s),u}function gu(s){return new y(function(d,u){s.transaction(function(h){h.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(v,m){for(var b=[],_=0;_<m.rows.length;_++)b.push(m.rows.item(_).name);d({db:s,storeNames:b})},function(v,m){u(m)})},function(h){u(h)})})}function yu(s,d){d=A.apply(this,arguments);var u=this.config();s=typeof s!="function"&&s||{},s.name||(s.name=s.name||u.name,s.storeName=s.storeName||u.storeName);var h=this,v;return s.name?v=new y(function(m){var b;s.name===u.name?b=h._dbInfo.db:b=openDatabase(s.name,"","",0),s.storeName?m({db:b,storeNames:[s.storeName]}):m(gu(b))}).then(function(m){return new y(function(b,_){m.db.transaction(function(w){function x(V){return new y(function(J,ie){w.executeSql("DROP TABLE IF EXISTS "+V,[],function(){J()},function(oe,Re){ie(Re)})})}for(var T=[],N=0,G=m.storeNames.length;N<G;N++)T.push(x(m.storeNames[N]));y.all(T).then(function(){b()}).catch(function(V){_(V)})},function(w){_(w)})})}):v=y.reject("Invalid arguments"),S(v,d),v}var Eu={_driver:"webSQLStorage",_initStorage:uu,_support:ou(),iterate:lu,getItem:cu,setItem:fu,removeItem:du,clear:pu,length:mu,key:hu,keys:vu,dropInstance:yu};function bu(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function fi(s,d){var u=s.name+"/";return s.storeName!==d.storeName&&(u+=s.storeName+"/"),u}function _u(){var s="_localforage_support_test";try{return localStorage.setItem(s,!0),localStorage.removeItem(s),!1}catch{return!0}}function Su(){return!_u()||localStorage.length>0}function Iu(s){var d=this,u={};if(s)for(var h in s)u[h]=s[h];return u.keyPrefix=fi(s,d._defaultConfig),Su()?(d._dbInfo=u,u.serializer=Pn,y.resolve()):y.reject()}function wu(s){var d=this,u=d.ready().then(function(){for(var h=d._dbInfo.keyPrefix,v=localStorage.length-1;v>=0;v--){var m=localStorage.key(v);m.indexOf(h)===0&&localStorage.removeItem(m)}});return S(u,s),u}function xu(s,d){var u=this;s=L(s);var h=u.ready().then(function(){var v=u._dbInfo,m=localStorage.getItem(v.keyPrefix+s);return m&&(m=v.serializer.deserialize(m)),m});return S(h,d),h}function Tu(s,d){var u=this,h=u.ready().then(function(){for(var v=u._dbInfo,m=v.keyPrefix,b=m.length,_=localStorage.length,w=1,x=0;x<_;x++){var T=localStorage.key(x);if(T.indexOf(m)===0){var N=localStorage.getItem(T);if(N&&(N=v.serializer.deserialize(N)),N=s(N,T.substring(b),w++),N!==void 0)return N}}});return S(h,d),h}function Ru(s,d){var u=this,h=u.ready().then(function(){var v=u._dbInfo,m;try{m=localStorage.key(s)}catch{m=null}return m&&(m=m.substring(v.keyPrefix.length)),m});return S(h,d),h}function Ou(s){var d=this,u=d.ready().then(function(){for(var h=d._dbInfo,v=localStorage.length,m=[],b=0;b<v;b++){var _=localStorage.key(b);_.indexOf(h.keyPrefix)===0&&m.push(_.substring(h.keyPrefix.length))}return m});return S(u,s),u}function Cu(s){var d=this,u=d.keys().then(function(h){return h.length});return S(u,s),u}function Au(s,d){var u=this;s=L(s);var h=u.ready().then(function(){var v=u._dbInfo;localStorage.removeItem(v.keyPrefix+s)});return S(h,d),h}function Lu(s,d,u){var h=this;s=L(s);var v=h.ready().then(function(){d===void 0&&(d=null);var m=d;return new y(function(b,_){var w=h._dbInfo;w.serializer.serialize(d,function(x,T){if(T)_(T);else try{localStorage.setItem(w.keyPrefix+s,x),b(m)}catch(N){(N.name==="QuotaExceededError"||N.name==="NS_ERROR_DOM_QUOTA_REACHED")&&_(N),_(N)}})})});return S(v,u),v}function Nu(s,d){if(d=A.apply(this,arguments),s=typeof s!="function"&&s||{},!s.name){var u=this.config();s.name=s.name||u.name,s.storeName=s.storeName||u.storeName}var h=this,v;return s.name?v=new y(function(m){s.storeName?m(fi(s,h._defaultConfig)):m(s.name+"/")}).then(function(m){for(var b=localStorage.length-1;b>=0;b--){var _=localStorage.key(b);_.indexOf(m)===0&&localStorage.removeItem(_)}}):v=y.reject("Invalid arguments"),S(v,d),v}var Mu={_driver:"localStorageWrapper",_initStorage:Iu,_support:bu(),iterate:Tu,getItem:xu,setItem:Lu,removeItem:Au,clear:wu,length:Cu,key:Ru,keys:Ou,dropInstance:Nu},ku=function(d,u){return d===u||typeof d=="number"&&typeof u=="number"&&isNaN(d)&&isNaN(u)},Pu=function(d,u){for(var h=d.length,v=0;v<h;){if(ku(d[v],u))return!0;v++}return!1},di=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"},er={},pi={},St={INDEXEDDB:nu,WEBSQL:Eu,LOCALSTORAGE:Mu},Du=[St.INDEXEDDB._driver,St.WEBSQL._driver,St.LOCALSTORAGE._driver],Nr=["dropInstance"],Dn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Nr),Uu={description:"",driver:Du.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Bu(s,d){s[d]=function(){var u=arguments;return s.ready().then(function(){return s[d].apply(s,u)})}}function Un(){for(var s=1;s<arguments.length;s++){var d=arguments[s];if(d)for(var u in d)d.hasOwnProperty(u)&&(di(d[u])?arguments[0][u]=d[u].slice():arguments[0][u]=d[u])}return arguments[0]}var $u=function(){function s(d){c(this,s);for(var u in St)if(St.hasOwnProperty(u)){var h=St[u],v=h._driver;this[u]=v,er[v]||this.defineDriver(h)}this._defaultConfig=Un({},Uu),this._config=Un({},this._defaultConfig,d),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return s.prototype.config=function(u){if((typeof u>"u"?"undefined":a(u))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var h in u){if(h==="storeName"&&(u[h]=u[h].replace(/\W/g,"_")),h==="version"&&typeof u[h]!="number")return new Error("Database version must be a number.");this._config[h]=u[h]}return"driver"in u&&u.driver?this.setDriver(this._config.driver):!0}else return typeof u=="string"?this._config[u]:this._config},s.prototype.defineDriver=function(u,h,v){var m=new y(function(b,_){try{var w=u._driver,x=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver){_(x);return}for(var T=Dn.concat("_initStorage"),N=0,G=T.length;N<G;N++){var V=T[N],J=!Pu(Nr,V);if((J||u[V])&&typeof u[V]!="function"){_(x);return}}var ie=function(){for(var tr=function(ju){return function(){var Wu=new Error("Method "+ju+" is not implemented by the current driver"),mi=y.reject(Wu);return S(mi,arguments[arguments.length-1]),mi}},Bn=0,Gu=Nr.length;Bn<Gu;Bn++){var $n=Nr[Bn];u[$n]||(u[$n]=tr($n))}};ie();var oe=function(tr){er[w]&&console.info("Redefining LocalForage driver: "+w),er[w]=u,pi[w]=tr,b()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(oe,_):oe(!!u._support):oe(!0)}catch(Re){_(Re)}});return C(m,h,v),m},s.prototype.driver=function(){return this._driver||null},s.prototype.getDriver=function(u,h,v){var m=er[u]?y.resolve(er[u]):y.reject(new Error("Driver not found."));return C(m,h,v),m},s.prototype.getSerializer=function(u){var h=y.resolve(Pn);return C(h,u),h},s.prototype.ready=function(u){var h=this,v=h._driverSet.then(function(){return h._ready===null&&(h._ready=h._initDriver()),h._ready});return C(v,u,u),v},s.prototype.setDriver=function(u,h,v){var m=this;di(u)||(u=[u]);var b=this._getSupportedDrivers(u);function _(){m._config.driver=m.driver()}function w(N){return m._extend(N),_(),m._ready=m._initStorage(m._config),m._ready}function x(N){return function(){var G=0;function V(){for(;G<N.length;){var J=N[G];return G++,m._dbInfo=null,m._ready=null,m.getDriver(J).then(w).catch(V)}_();var ie=new Error("No available storage method found.");return m._driverSet=y.reject(ie),m._driverSet}return V()}}var T=this._driverSet!==null?this._driverSet.catch(function(){return y.resolve()}):y.resolve();return this._driverSet=T.then(function(){var N=b[0];return m._dbInfo=null,m._ready=null,m.getDriver(N).then(function(G){m._driver=G._driver,_(),m._wrapLibraryMethodsWithReady(),m._initDriver=x(b)})}).catch(function(){_();var N=new Error("No available storage method found.");return m._driverSet=y.reject(N),m._driverSet}),C(this._driverSet,h,v),this._driverSet},s.prototype.supports=function(u){return!!pi[u]},s.prototype._extend=function(u){Un(this,u)},s.prototype._getSupportedDrivers=function(u){for(var h=[],v=0,m=u.length;v<m;v++){var b=u[v];this.supports(b)&&h.push(b)}return h},s.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,h=Dn.length;u<h;u++)Bu(this,Dn[u])},s.prototype.createInstance=function(u){return new s(u)},s}(),Fu=new $u;o.exports=Fu},{3:3}]},{},[4])(4)})});var zs=Ei((On,Vs)=>{(function(e,t){typeof On=="object"&&typeof Vs<"u"?t(On):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],t):t(e.LocalforageDriverMemory={})})(typeof self<"u"?self:On,function(e){"use strict";var t="localforage-driver-memory";function r(E){var I=typeof Symbol=="function"&&E[Symbol.iterator],R=0;return I?I.call(E):{next:function(){return E&&R>=E.length&&(E=void 0),{value:E&&E[R++],done:!E}}}}function n(E,I){E=E||[],I=I||{};try{return new Blob(E,I)}catch(B){if(B.name!=="TypeError")throw B;for(var R=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,P=new R,D=0;D<E.length;D+=1)P.append(E[D]);return P.getBlob(I.type)}}var o=/^~~local_forage_type~([^~]+)~/,i=9,a=i+4,c=Object.prototype.toString;function f(E){var I=E.length*.75,R=E.length;E[E.length-1]==="="&&(I--,E[E.length-2]==="="&&I--);for(var P=new ArrayBuffer(I),D=new Uint8Array(P),B=0,Y=0;B<R;B+=4){var ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(E[B]),_t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(E[B+1]),ct="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(E[B+2]),Qt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(E[B+3]);D[Y++]=ue<<2|_t>>4,D[Y++]=(_t&15)<<4|ct>>2,D[Y++]=(ct&3)<<6|Qt&63}return P}function l(E){for(var I=new Uint8Array(E),R="",P=0;P<I.length;P+=3)R+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[I[P]>>2],R+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(I[P]&3)<<4|I[P+1]>>4],R+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(I[P+1]&15)<<2|I[P+2]>>6],R+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[I[P+2]&63];return I.length%3===2?R=R.substring(0,R.length-1)+"=":I.length%3===1&&(R=R.substring(0,R.length-2)+"=="),R}function p(E,I){var R="";if(E&&(R=c.call(E)),E&&(R==="[object ArrayBuffer]"||E.buffer&&c.call(E.buffer)==="[object ArrayBuffer]")){var P=void 0,D="__lfsc__:";E instanceof ArrayBuffer?(P=E,D+="arbf"):(P=E.buffer,R==="[object Int8Array]"?D+="si08":R==="[object Uint8Array]"?D+="ui08":R==="[object Uint8ClampedArray]"?D+="uic8":R==="[object Int16Array]"?D+="si16":R==="[object Uint16Array]"?D+="ur16":R==="[object Int32Array]"?D+="si32":R==="[object Uint32Array]"?D+="ui32":R==="[object Float32Array]"?D+="fl32":R==="[object Float64Array]"?D+="fl64":I(new Error("Failed to get type for BinaryArray"))),I(D+l(P))}else if(R==="[object Blob]"){var B=new FileReader;B.onload=function(){var Y="~~local_forage_type~"+E.type+"~"+l(this.result);I("__lfsc__:blob"+Y)},B.readAsArrayBuffer(E)}else try{I(JSON.stringify(E))}catch(Y){console.error("Couldn't convert value into a JSON string: ",E),I(null,Y)}}function g(E){if(E.substring(0,i)!=="__lfsc__:")return JSON.parse(E);var I=E.substring(a),R=E.substring(i,a),P;if(R==="blob"&&o.test(I)){var D=I.match(o);P=D[1],I=I.substring(D[0].length)}var B=f(I);switch(R){case"arbf":return B;case"blob":return n([B],{type:P});case"si08":return new Int8Array(B);case"ui08":return new Uint8Array(B);case"uic8":return new Uint8ClampedArray(B);case"si16":return new Int16Array(B);case"ur16":return new Uint16Array(B);case"si32":return new Int32Array(B);case"ui32":return new Uint32Array(B);case"fl32":return new Float32Array(B);case"fl64":return new Float64Array(B);default:throw new Error("Unkown type: "+R)}}function y(E){var I,R;if(E===null||typeof E!="object"||"isActiveClone"in E)return E;var P=E instanceof Date?new Date(E):E.constructor();try{for(var D=r(Object.keys(E)),B=D.next();!B.done;B=D.next()){var Y=B.value;Object.prototype.hasOwnProperty.call(E,Y)&&(E.isActiveClone=null,P[Y]=y(E[Y]),delete E.isActiveClone)}}catch(ue){I={error:ue}}finally{try{B&&!B.done&&(R=D.return)&&R.call(D)}finally{if(I)throw I.error}}return P}function S(E,I){return(E.name||I.name)+"/"+(E.storeName||I.storeName)+"/"}function C(E,I){I&&E.then(function(R){I(null,R)},function(R){I(R)})}function L(){for(var E=[],I=0;I<arguments.length;I++)E[I]=arguments[I];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function A(E,I){var R=this;if(I=L.apply(this,arguments),E=typeof E!="function"&&E||{},!E.name){var P=this.config();E.name=E.name||P.name,E.storeName=E.storeName||P.storeName}var D;return E.name?D=new Promise(function(B){E.storeName?B(S(E,R._defaultConfig)):B(E.name+"/")}):D=Promise.reject("Invalid arguments"),{promise:D,callback:I}}function $(E){return typeof E!="string"&&(console.warn(E+" used as a key, but it is not a string."),E=String(E)),E}var Q={bufferToString:l,deserialize:g,serialize:p,stringToBuffer:f},k={},Ue=function(){function E(I){this.kp=I,this.data={}}return E.resolve=function(I){return k[I]||(k[I]=new E(I)),k[I]},E.prototype.clear=function(){this.data={}},E.prototype.drop=function(){this.clear(),delete k[this.kp]},E.prototype.get=function(I){return this.data[I]},E.prototype.key=function(I){return this.keys()[I]},E.prototype.keys=function(){return Object.keys(this.data)},E.prototype.rm=function(I){delete this.data[I]},E.prototype.set=function(I,R){this.data[I]=R},E}();function U(E){var I=E?y(E):{},R=S(I,this._defaultConfig),P=Ue.resolve(R);return this._dbInfo=I,this._dbInfo.serializer=Q,this._dbInfo.keyPrefix=R,this._dbInfo.mStore=P,Promise.resolve()}function O(E){var I=this,R=this.ready().then(function(){I._dbInfo.mStore.clear()});return C(R,E),R}function K(E,I){var R=A.apply(this,arguments),P=R.promise,D=R.callback,B=P.then(function(Y){Ue.resolve(Y).drop()});return C(B,D),P}function F(E,I){var R=this;E=$(E);var P=this.ready().then(function(){var D=R._dbInfo.mStore.get(E);return D==null?null:R._dbInfo.serializer.deserialize(D)});return C(P,I),P}function X(E,I){var R=this,P=this.ready().then(function(){for(var D=R._dbInfo.mStore,B=D.keys(),Y=0;Y<B.length;Y++){var ue=D.get(B[Y]);if(ue&&(ue=R._dbInfo.serializer.deserialize(ue)),ue=E(ue,B[Y],Y+1),ue!==void 0)return ue}});return C(P,I),P}function ae(E,I){var R=this,P=this.ready().then(function(){var D;try{D=R._dbInfo.mStore.key(E),D===void 0&&(D=null)}catch{D=null}return D});return C(P,I),P}function me(E){var I=this,R=this.ready().then(function(){return I._dbInfo.mStore.keys()});return C(R,E),R}function ye(E){var I=this.keys().then(function(R){return R.length});return C(I,E),I}function Ee(E,I){var R=this;E=$(E);var P=this.ready().then(function(){R._dbInfo.mStore.rm(E)});return C(P,I),P}function ke(E,I,R){var P=this;E=$(E);var D=this.ready().then(function(){I===void 0&&(I=null);var B=I;return new Promise(function(Y,ue){P._dbInfo.serializer.serialize(I,function(_t,ct){if(ct)ue(ct);else try{P._dbInfo.mStore.set(E,_t),Y(B)}catch(Qt){ue(Qt)}})})});return C(D,R),D}var ut=!0;e._support=ut,e._driver=t,e._initStorage=U,e.clear=O,e.dropInstance=K,e.getItem=F,e.iterate=X,e.key=ae,e.keys=me,e.length=ye,e.removeItem=Ee,e.setItem=ke,Object.defineProperty(e,"__esModule",{value:!0})})});var dp={};bi(dp,{default:()=>fp});var Ke=(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))(Ke||{}),Ye=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e.ProductAnnouncement="ANNOUNCEMENT",e))(Ye||{}),wt=(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[e.RedirectLoginComplete=-10015]="RedirectLoginComplete",e))(wt||{}),Se=(e=>(e.MetaMask="metamask",e.CoinbaseWallet="coinbase_wallet",e))(Se||{}),xt=(e=>(e.WalletSelected="wallet_selected",e.WalletConnected="wallet_connected",e.WalletRejected="wallet_rejected",e))(xt||{}),M=(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.NFTCheckout="magic_nft_checkout",e.NFTTransfer="magic_nft_transfer",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",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.EncryptV1="magic_auth_encrypt_v1",e.DecryptV1="magic_auth_decrypt_v1",e.ShowNFTs="magic_show_nfts",e.ShowOnRamp="magic_show_fiat_onramp",e.ShowSendTokensUI="magic_show_send_tokens_ui",e.ShowAddress="magic_show_address",e.ShowBalances="magic_show_balances",e.SendGaslessTransaction="eth_sendGaslessTransaction",e.RevealPK="magic_reveal_key",e))(M||{}),Be=(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.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",e))(Be||{}),lt=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(lt||{}),Ii=(e=>(e.UpdateEmail="update-email",e.MFA="mfa",e.Recovery="recovery",e))(Ii||{}),wi=(e=>(e.Retry="retry",e))(wi||{}),xi=(e=>(e.EmailSent="email-sent",e.EmailNotDeliverable="email-not-deliverable",e))(xi||{}),ft=(e=>(e.VerifyEmailOtp="verify-email-otp",e.Cancel="cancel",e))(ft||{}),Ti=(e=>(e.EmailOTPSent="email-otp-sent",e.InvalidEmailOtp="invalid-email-otp",e.ExpiredEmailOtp="expired-email-otp",e))(Ti||{}),or=(e=>(e.Retry="device-retry",e))(or||{}),Ri=(e=>(e.DeviceApproved="device-approved",e.DeviceNeedsApproval="device-needs-approval",e.DeviceVerificationLinkExpired="device-verification-link-expired",e.DeviceVerificationEmailSent="device-verification-email-sent",e))(Ri||{}),qe=(e=>(e.Retry="Recency/auth-factor-retry",e.Cancel="Recency/auth-factor-verification-cancel",e.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",e))(qe||{}),Oi=(e=>(e.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",e.PrimaryAuthFactorVerified="Recency/auth-factor-verified",e.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",e.EmailExpired="Recency/auth-factor-verification-email-expired",e.EmailSent="Recency/auth-factor-verification-email-sent",e.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",e))(Oi||{}),Ve=(e=>(e.RetryWithNewEmail="UpdateEmail/retry-with-new-email",e.Cancel="UpdateEmail/new-email-verification-cancel",e.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",e))(Ve||{}),Ci=(e=>(e.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",e.EmailUpdated="UpdateEmail/email-updated",e.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",e.EmailExpired="UpdateEmail/new-email-verification-email-expired",e.EmailSent="UpdateEmail/new-email-verification-email-sent",e.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",e.InvalidEmail="UpdateEmail/new-email-invalid",e.EmailAlreadyExists="UpdateEmail/new-email-already-exists",e))(Ci||{}),Ai=(e=>(e.IDTokenCreated="Auth/id-token-created",e))(Ai||{}),Li=(e=>(e.Harmony="HARMONY",e))(Li||{}),Ni=(e=>(e.PhoneNumber="phone_number",e))(Ni||{}),Mi=(e=>(e.WalletInfoFetched="Wallet/wallet-info-fetched",e))(Mi||{});var de={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},Oe=console,nt={};Object.keys(de).forEach(function(e){nt[e]=Oe[e]});var ir="Datadog Browser SDK:",H={debug:nt.debug.bind(Oe,ir),log:nt.log.bind(Oe,ir),info:nt.info.bind(Oe,ir),warn:nt.warn.bind(Oe,ir),error:nt.error.bind(Oe,ir)},ot="https://docs.datadoghq.com";function Mr(e,t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];try{return e.apply(void 0,r)}catch(o){H.error(t,o)}}}var kr;(function(e){e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.CUSTOM_VITALS="custom_vitals",e.TOLERANT_RESOURCE_TIMINGS="tolerant_resource_timings",e.MICRO_FRONTEND="micro_frontend"})(kr||(kr={}));var ki=new Set;function Pi(e){e.forEach(function(t){ki.add(t)})}function Di(){return ki}function Tt(e){return e!==0&&Math.random()*100<=e}function ar(e){return Xu(e)&&e>=0&&e<=100}function Xu(e){return typeof e=="number"}var ze=1e3,Ie=60*ze,Gn=60*Ie,Ju=24*Gn,_p=365*Ju;function dt(){return new Date().getTime()}function he(){return dt()}function Rt(){return performance.now()}function Ce(){return{relative:Rt(),timeStamp:he()}}function Ui(){return{relative:0,timeStamp:Gi()}}function Bi(e,t){return t-e}function $i(e,t){return e+t}function Fi(e){return e-Gi()}var Fn;function Gi(){return Fn===void 0&&(Fn=performance.timing.navigationStart),Fn}var be=1024,jn=1024*be,Zu=/[^\u0000-\u007F]/;function Ot(e){return Zu.test(e)?window.TextEncoder!==void 0?new TextEncoder().encode(e).length:new Blob([e]).size:e.length}function Ae(e,t){return e.indexOf(t)!==-1}function Ct(e){if(Array.from)return Array.from(e);var t=[];if(e instanceof Set)e.forEach(function(n){return t.push(n)});else for(var r=0;r<e.length;r++)t.push(e[r]);return t}function ji(e,t){for(var r=0;r<e.length;r+=1){var n=e[r];if(t(n,r))return n}}function $e(e){return Object.keys(e).map(function(t){return e[t]})}function Wi(e){return Object.keys(e).map(function(t){return[t,e[t]]})}function At(e,t){return e.slice(0,t.length)===t}function Hi(e,t){return e.slice(-t.length)===t}function te(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.forEach(function(n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}),e}function Ki(e){return te({},e)}function Wn(e,t){return Object.keys(e).some(function(r){return e[r]===t})}function Lt(e){return Object.keys(e).length===0}function Le(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var e=_dd_temp_;return delete Object.prototype._dd_temp_,typeof e!="object"&&(typeof self=="object"?e=self:typeof window=="object"?e=window:e={}),e}function it(e,t){var r=Le(),n;return r.Zone&&typeof r.Zone.__symbol__=="function"&&(n=e[r.Zone.__symbol__(t)]),n||(n=e[t]),n}var Qu=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},Pr,Yi=!1;function qi(e){Pr=e}function Hn(e){Yi=e}function Kn(e,t,r){var n=r.value;r.value=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var a=Pr?j(n):n;return a.apply(this,o)}}function j(e){return function(){return Xe(e,this,arguments)}}function Xe(e,t,r){try{return e.apply(t,r)}catch(n){if(Dr(n),Pr)try{Pr(n)}catch(o){Dr(o)}}}function Dr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Yi&&H.error.apply(H,Qu(["[MONITOR]"],e,!1))}function Fe(e,t){return it(Le(),"setTimeout")(j(e),t)}function Ur(e){it(Le(),"clearTimeout")(e)}function Nt(e,t){return it(Le(),"setInterval")(j(e),t)}function Mt(e){it(Le(),"clearInterval")(e)}var q=function(){function e(t){this.onFirstSubscribe=t,this.observers=[]}return e.prototype.subscribe=function(t){var r=this;return!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),this.observers.push(t),{unsubscribe:function(){r.observers=r.observers.filter(function(n){return t!==n}),!r.observers.length&&r.onLastUnsubscribe&&r.onLastUnsubscribe()}}},e.prototype.notify=function(t){this.observers.forEach(function(r){return r(t)})},e}();function Br(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new q(function(r){var n=e.map(function(o){return o.subscribe(function(i){return r.notify(i)})});return function(){return n.forEach(function(o){return o.unsubscribe()})}})}function $r(e,t,r){var n=r&&r.leading!==void 0?r.leading:!0,o=r&&r.trailing!==void 0?r.trailing:!0,i=!1,a,c;return{throttled:function(){for(var f=[],l=0;l<arguments.length;l++)f[l]=arguments[l];if(i){a=f;return}n?e.apply(void 0,f):a=f,i=!0,c=Fe(function(){o&&a&&e.apply(void 0,a),i=!1,a=void 0},t)},cancel:function(){Ur(c),i=!1,a=void 0}}}function we(){}function Ne(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,Ne)}var Fr=/([\w-]+)\s*=\s*([^;]+)/g;function Vi(e,t){for(Fr.lastIndex=0;;){var r=Fr.exec(e);if(r){if(r[1]===t)return r[2]}else break}}function zi(e){var t=new Map;for(Fr.lastIndex=0;;){var r=Fr.exec(e);if(r)t.set(r[1],r[2]);else break}return t}function Xi(e,t,r){r===void 0&&(r="");var n=e.charCodeAt(t-1),o=n>=55296&&n<=56319,i=o?t+1:t;return e.length<=i?e:"".concat(e.slice(0,i)).concat(r)}function Ji(){return ec()===1}var Gr;function ec(){return Gr??(Gr=tc())}function tc(e){var t;e===void 0&&(e=window);var r=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(r)?1:((t=e.navigator.vendor)===null||t===void 0?void 0:t.indexOf("Apple"))===0||/safari/i.test(r)&&!/chrome|android/i.test(r)?2:e.document.documentMode?0:3}function kt(e,t,r,n){var o=new Date;o.setTime(o.getTime()+r);var i="expires=".concat(o.toUTCString()),a=n&&n.crossSite?"none":"strict",c=n&&n.domain?";domain=".concat(n.domain):"",f=n&&n.secure?";secure":"",l=n&&n.partitioned?";partitioned":"";document.cookie="".concat(e,"=").concat(t,";").concat(i,";path=/;samesite=").concat(a).concat(c).concat(f).concat(l)}function jr(e){return Vi(document.cookie,e)}var Yn;function Je(e){return Yn||(Yn=zi(document.cookie)),Yn.get(e)}function Zi(e,t){kt(e,"",0,t)}function Qi(e){if(document.cookie===void 0||document.cookie===null)return!1;try{var t="dd_cookie_test_".concat(Ne()),r="test";kt(t,r,Ie,e);var n=jr(t)===r;return Zi(t,e),n}catch(o){return H.error(o),!1}}var qn;function ea(){if(qn===void 0){for(var e="dd_site_test_".concat(Ne()),t="test",r=window.location.hostname.split("."),n=r.pop();r.length&&!jr(e);)n="".concat(r.pop(),".").concat(n),kt(e,t,ze,{domain:n});Zi(e,{domain:n}),qn=n}return qn}var Ze="_dd_s";var Pt=4*Gn,Wr=15*Ie;var ta=/^([a-zA-Z]+)=([a-z0-9-]+)$/,Vn="&",rc="1";function Ge(){return{isExpired:rc}}function sr(e){return Lt(e)}function Hr(e){return!sr(e)}function Dt(e){return e.isExpired!==void 0||!nc(e)}function nc(e){return(e.created===void 0||dt()-Number(e.created)<Pt)&&(e.expire===void 0||dt()<Number(e.expire))}function Kr(e){e.expire=String(dt()+Wr)}function ur(e){return Wi(e).map(function(t){var r=t[0],n=t[1];return"".concat(r,"=").concat(n)}).join(Vn)}function Yr(e){var t={};return oc(e)&&e.split(Vn).forEach(function(r){var n=ta.exec(r);if(n!==null){var o=n[1],i=n[2];t[o]=i}}),t}function oc(e){return!!e&&(e.indexOf(Vn)!==-1||ta.test(e))}var ic="_dd",ac="_dd_r",sc="_dd_l",uc="rum",cc="logs";function ra(e){var t=Je(Ze);if(!t){var r=Je(ic),n=Je(ac),o=Je(sc),i={};r&&(i.id=r),o&&/^[01]$/.test(o)&&(i[cc]=o),n&&/^[012]$/.test(n)&&(i[uc]=n),Hr(i)&&(Kr(i),e.persistSession(i))}}function na(e){var t=pc(e);return Qi(t)?{type:"Cookie",cookieOptions:t}:void 0}function oa(e){var t={isLockEnabled:Ji(),persistSession:lc(e),retrieveSession:dc,expireSession:function(){return fc(e)}};return ra(t),t}function lc(e){return function(t){kt(Ze,ur(t),Wr,e)}}function fc(e){kt(Ze,ur(Ge()),Pt,e)}function dc(){var e=jr(Ze);return Yr(e)}function pc(e){var t={};return t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=ea()),t}var mc="_dd_test_";function ia(){try{var e=Ne(),t="".concat(mc).concat(e);localStorage.setItem(t,e);var r=localStorage.getItem(t);return localStorage.removeItem(t),e===r?{type:"LocalStorage"}:void 0}catch{return}}function aa(){return{isLockEnabled:!1,persistSession:sa,retrieveSession:hc,expireSession:vc}}function sa(e){localStorage.setItem(Ze,ur(e))}function hc(){var e=localStorage.getItem(Ze);return Yr(e)}function vc(){sa(Ge())}var gc=10,yc=100,ca=[],Vr;function pt(e,t,r){var n;r===void 0&&(r=0);var o=t.isLockEnabled,i=t.persistSession,a=t.expireSession,c=function(y){return i(te({},y,{lock:l}))},f=function(){var y=t.retrieveSession(),S=y.lock;return y.lock&&delete y.lock,{session:y,lock:S}};if(Vr||(Vr=e),e!==Vr){ca.push(e);return}if(o&&r>=yc){ua(t);return}var l,p=f();if(o){if(p.lock){qr(e,t,r);return}if(l=Ne(),c(p.session),p=f(),p.lock!==l){qr(e,t,r);return}}var g=e.process(p.session);if(o&&(p=f(),p.lock!==l)){qr(e,t,r);return}if(g&&(Dt(g)?a():(Kr(g),o?c(g):i(g))),o&&!(g&&Dt(g))){if(p=f(),p.lock!==l){qr(e,t,r);return}i(p.session),g=p.session}(n=e.after)===null||n===void 0||n.call(e,g||p.session),ua(t)}function qr(e,t,r){Fe(function(){pt(e,t,r+1)},gc)}function ua(e){Vr=void 0;var t=ca.shift();t&&pt(t,e)}var la=ze;function fa(e){var t=na(e);return!t&&e.allowFallbackToLocalStorage&&(t=ia()),t}function da(e,t,r){var n=new q,o=new q,i=e.type==="Cookie"?oa(e.cookieOptions):aa(),a=i.expireSession,c=Nt(S,la),f;L();var l=$r(function(){pt({process:function(U){if(!sr(U)){var O=C(U);return A(O),O}},after:function(U){Hr(U)&&!$()&&Ue(U),f=U}},i)},la),p=l.throttled,g=l.cancel;function y(){pt({process:function(U){return $()?C(U):void 0}},i)}function S(){pt({process:function(U){return Dt(U)?Ge():void 0},after:C},i)}function C(U){return Dt(U)&&(U=Ge()),$()&&(Q(U)?k():f=U),U}function L(){pt({process:function(U){if(sr(U))return Ge()},after:function(U){f=U}},i)}function A(U){if(sr(U))return!1;var O=r(U[t]),K=O.trackingType,F=O.isTracked;U[t]=K,delete U.isExpired,F&&!U.id&&(U.id=Ne(),U.created=String(dt()))}function $(){return f[t]!==void 0}function Q(U){return f.id!==U.id||f[t]!==U[t]}function k(){f=Ge(),o.notify()}function Ue(U){f=U,n.notify()}return{expandOrRenewSession:p,expandSession:y,getSession:function(){return f},renewObservable:n,expireObservable:o,restartSession:L,expire:function(){g(),a(),C(Ge())},stop:function(){Mt(c)}}}var cr={GRANTED:"granted",NOT_GRANTED:"not-granted"};function zn(e){var t=new q;return{tryToInit:function(r){e||(e=r)},update:function(r){e=r,t.notify()},isGranted:function(){return e===cr.GRANTED},observable:t}}function xe(e,t,r){if(typeof e!="object"||e===null)return JSON.stringify(e);var n=mt(Object.prototype),o=mt(Array.prototype),i=mt(Object.getPrototypeOf(e)),a=mt(e);try{return JSON.stringify(e,t,r)}catch{return"<error: unable to serialize object>"}finally{n(),o(),i(),a()}}function mt(e){var t=e,r=t.toJSON;return r?(delete t.toJSON,function(){t.toJSON=r}):we}function Ut(e){return Ec(e,location.href).href}function Ec(e,t){var r=bc();if(r)try{return t!==void 0?new r(e,t):new r(e)}catch(a){throw new Error("Failed to construct URL: ".concat(String(a)," ").concat(xe({url:e,base:t})))}if(t===void 0&&!/:/.test(e))throw new Error("Invalid URL: '".concat(e,"'"));var n=document,o=n.createElement("a");if(t!==void 0){n=document.implementation.createHTMLDocument("");var i=n.createElement("base");i.href=t,n.head.appendChild(i),n.body.appendChild(o)}return o.href=e,o}var pa=URL,zr;function bc(){if(zr===void 0)try{var e=new pa("http://test/path");zr=e.href==="http://test/path"}catch{zr=!1}return zr?pa:void 0}var Xn="datad0g.com",ma="dd0g-gov.com",je="datadoghq.com";var Jn="ddog-gov.com",Xr="pci.browser-intake-datadoghq.com";function Bt(e,t,r){var n=_c(e,t);return{build:function(o,i){var a=Ic(e,t,r,o,i);return n(a)},urlPrefix:n(""),trackType:t}}function _c(e,t){var r="/api/v2/".concat(t),n=e.proxy;if(typeof n=="string"){var o=Ut(n);return function(a){return"".concat(o,"?ddforward=").concat(encodeURIComponent("".concat(r,"?").concat(a)))}}if(typeof n=="function")return function(a){return n({path:r,parameters:a})};var i=Sc(t,e);return function(a){return"https://".concat(i).concat(r,"?").concat(a)}}function Sc(e,t){var r=t.site,n=r===void 0?je:r,o=t.internalAnalyticsSubdomain;if(e==="logs"&&t.usePciIntake&&n===je)return Xr;if(o&&n===je)return"".concat(o,".").concat(je);if(n===ma)return"http-intake.logs.".concat(n);var i=n.split("."),a=i.pop();return"browser-intake-".concat(i.join("-"),".").concat(a)}function Ic(e,t,r,n,o){var i=e.clientToken,a=e.internalAnalyticsSubdomain,c=o.retry,f=o.encoding,l=["sdk_version:".concat("5.20.0"),"api:".concat(n)].concat(r);c&&l.push("retry_count:".concat(c.count),"retry_after:".concat(c.lastFailureStatus));var p=["ddsource=browser","ddtags=".concat(encodeURIComponent(l.join(","))),"dd-api-key=".concat(i),"dd-evp-origin-version=".concat(encodeURIComponent("5.20.0")),"dd-evp-origin=browser","dd-request-id=".concat(Ne())];return f&&p.push("dd-evp-encoding=".concat(f)),t==="rum"&&p.push("batch_time=".concat(he())),a&&p.reverse(),p.join("&")}var wc=200;function ha(e){var t=e.env,r=e.service,n=e.version,o=e.datacenter,i=[];return t&&i.push(Jr("env",t)),r&&i.push(Jr("service",r)),n&&i.push(Jr("version",n)),o&&i.push(Jr("datacenter",o)),i}var xc=/[^a-z0-9_:./-]/;function Jr(e,t){var r=wc-e.length-1;(t.length>r||xc.test(t))&&H.warn("".concat(e," value doesn't meet tag requirements and will be sanitized. More details: ").concat(ot,"/getting_started/tagging/#defining-tags"));var n=t.replace(/,/g,"_");return"".concat(e,":").concat(n)}function va(e){var t=e.site||je,r=ha(e),n=Tc(e,r),o=Oc(n,t),i=Rc(e,o,r);return te({isIntakeUrl:function(a){return o.some(function(c){return a.indexOf(c)===0})},replica:i,site:t},n)}function Tc(e,t){return{logsEndpointBuilder:Bt(e,"logs",t),rumEndpointBuilder:Bt(e,"rum",t),sessionReplayEndpointBuilder:Bt(e,"replay",t)}}function Rc(e,t,r){if(!!e.replica){var n=te({},e,{site:je,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:Bt(n,"logs",r),rumEndpointBuilder:Bt(n,"rum",r)};return t.push.apply(t,$e(o).map(function(i){return i.urlPrefix})),te({applicationId:e.replica.applicationId},o)}}function Oc(e,t){var r=$e(e).map(function(n){return n.urlPrefix});return t===je&&r.push("https://".concat(Xr,"/")),r}function Zn(e,t){return e!=null&&typeof e!="string"?(H.error("".concat(t," must be defined as a string")),!1):!0}function Cc(e){return/(datadog|ddog|datad0g|dd0g)/.test(e)}function Zr(e){var t,r,n,o,i;if(!e||!e.clientToken){H.error("Client Token is not configured, we will not send any data.");return}if(e.sessionSampleRate!==void 0&&!ar(e.sessionSampleRate)){H.error("Session Sample Rate should be a number between 0 and 100");return}if(e.telemetrySampleRate!==void 0&&!ar(e.telemetrySampleRate)){H.error("Telemetry Sample Rate should be a number between 0 and 100");return}if(e.telemetryConfigurationSampleRate!==void 0&&!ar(e.telemetryConfigurationSampleRate)){H.error("Telemetry Configuration Sample Rate should be a number between 0 and 100");return}if(e.telemetryUsageSampleRate!==void 0&&!ar(e.telemetryUsageSampleRate)){H.error("Telemetry Usage Sample Rate should be a number between 0 and 100");return}if(!!Zn(e.version,"Version")&&!!Zn(e.env,"Env")&&!!Zn(e.service,"Service")){if(e.trackingConsent!==void 0&&!Wn(cr,e.trackingConsent)){H.error('Tracking Consent should be either "granted" or "not-granted"');return}if(e.site&&!Cc(e.site)){H.error("Site should be a valid Datadog site. Learn more here: ".concat(ot,"/getting_started/site/."));return}return Array.isArray(e.enableExperimentalFeatures)&&Pi(e.enableExperimentalFeatures.filter(function(a){return Wn(kr,a)})),te({beforeSend:e.beforeSend&&Mr(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:fa(e),sessionSampleRate:(t=e.sessionSampleRate)!==null&&t!==void 0?t:100,telemetrySampleRate:(r=e.telemetrySampleRate)!==null&&r!==void 0?r:20,telemetryConfigurationSampleRate:(n=e.telemetryConfigurationSampleRate)!==null&&n!==void 0?n:5,telemetryUsageSampleRate:(o=e.telemetryUsageSampleRate)!==null&&o!==void 0?o:5,service:e.service||void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(i=e.trackingConsent)!==null&&i!==void 0?i:cr.GRANTED,batchBytesLimit:16*be,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*ze,batchMessagesLimit:50,messageBytesLimit:256*be},va(e))}}function Qr(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_cross_site_session_cookie:e.useCrossSiteSessionCookie,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent}}var lr="?";function ce(e){var t=[],r=Qn(e,"stack"),n=String(e);return r&&At(r,n)&&(r=r.slice(n.length)),r&&r.split(`
|
2
|
-
|
3
|
-
at `.concat(n).concat(o," @ ").concat(r.url).concat(i).concat(a)}),t}function eo(e){return"".concat(e.name||"Error",": ").concat(e.message)}function We(e,t,r,n){var o=n===void 0?{}:n,i=o.computeHandlingStack,a=e[t];if(typeof a!="function")if(At(t,"on"))a=we;else return{stop:we};var c=!1,f=function(){if(c)return a.apply(this,arguments);var l=Ct(arguments),p;Xe(r,null,[{target:this,parameters:l,onPostCall:function(y){p=y},handlingStack:i?en():void 0}]);var g=a.apply(this,l);return p&&Xe(p,null,[g]),g};return e[t]=f,{stop:function(){c=!0,e[t]===f&&(e[t]=a)}}}var Hc=220*be,Kc="$",Yc=3;function _e(e,t){var r;t===void 0&&(t=Hc);var n=mt(Object.prototype),o=mt(Array.prototype),i=[],a=new WeakMap,c=to(e,Kc,void 0,i,a),f=((r=JSON.stringify(c))===null||r===void 0?void 0:r.length)||0;if(f>t){ro(t,"discarded",e);return}for(;i.length>0&&f<t;){var l=i.shift(),p=0;if(Array.isArray(l.source))for(var g=0;g<l.source.length;g++){var y=to(l.source[g],l.path,g,i,a);if(y!==void 0?f+=JSON.stringify(y).length:f+=4,f+=p,p=1,f>t){ro(t,"truncated",e);break}l.target[g]=y}else for(var g in l.source)if(Object.prototype.hasOwnProperty.call(l.source,g)){var y=to(l.source[g],l.path,g,i,a);if(y!==void 0&&(f+=JSON.stringify(y).length+p+g.length+Yc,p=1),f>t){ro(t,"truncated",e);break}l.target[g]=y}}return n(),o(),c}function to(e,t,r,n,o){var i=zc(e);if(!i||typeof i!="object")return qc(i);var a=Vc(i);if(a!=="[Object]"&&a!=="[Array]"&&a!=="[Error]")return a;var c=e;if(o.has(c))return"[Reference seen at ".concat(o.get(c),"]");var f=r!==void 0?"".concat(t,".").concat(r):t,l=Array.isArray(i)?[]:{};return o.set(c,f),n.push({source:i,target:l,path:f}),l}function qc(e){return typeof e=="bigint"?"[BigInt] ".concat(e.toString()):typeof e=="function"?"[Function] ".concat(e.name||"unknown"):typeof e=="symbol"?"[Symbol] ".concat(e.description||e.toString()):e}function Vc(e){try{if(e instanceof Event)return{isTrusted:e.isTrusted};var t=Object.prototype.toString.call(e),r=t.match(/\[object (.*)\]/);if(r&&r[1])return"[".concat(r[1],"]")}catch{}return"[Unserializable]"}function zc(e){var t=e;if(t&&typeof t.toJSON=="function")try{return t.toJSON()}catch{}return e}function ro(e,t,r){H.warn("The data provided has been ".concat(t," as it is over the limit of ").concat(e," characters:"),r)}var tn="No stack, consider using an instance of Error";function fr(e){var t=e.stackTrace,r=e.originalError,n=e.handlingStack,o=e.startClocks,i=e.nonErrorPrefix,a=e.source,c=e.handling,f=r instanceof Error,l=Xc(t,f,i,r),p=Jc(f,t)?Me(t):tn,g=f?io(r,a):void 0,y=t?.name,S=no(r);return{startClocks:o,source:a,handling:c,handlingStack:n,originalError:r,type:y,message:l,stack:p,causes:g,fingerprint:S}}function Xc(e,t,r,n){return e?.message&&e?.name?e.message:t?"Empty message":"".concat(r," ").concat(xe(_e(n)))}function Jc(e,t){return t===void 0?!1:e?!0:t.stack.length>0&&(t.stack.length>1||t.stack[0].url!==void 0)}function no(e){return e instanceof Error&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function oo(e){var t;return(t=/@ (.+)/.exec(e))===null||t===void 0?void 0:t[1]}function io(e,t){for(var r=e,n=[];r?.cause instanceof Error&&n.length<10;){var o=ce(r.cause);n.push({message:r.cause.message,source:t,type:o?.name,stack:o&&Me(o)}),r=r.cause}return n.length?n:void 0}var re={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function ao(e){var t=function(o,i){var a=fr({stackTrace:o,originalError:i,startClocks:Ce(),nonErrorPrefix:"Uncaught",source:re.SOURCE,handling:"unhandled"});e.notify(a)},r=Zc(t).stop,n=Qc(t).stop;return{stop:function(){r(),n()}}}function Zc(e){return We(window,"onerror",function(t){var r=t.parameters,n=r[0],o=r[1],i=r[2],a=r[3],c=r[4],f;c instanceof Error?f=ce(c):f=ya(n,o,i,a),e(f,c??n)})}function Qc(e){return We(window,"onunhandledrejection",function(t){var r=t.parameters[0],n=r.reason||"Empty reason",o=ce(n);e(o,n)})}function so(e){var t=te({version:"5.20.0",onReady:function(r){r()}},e);return Object.defineProperty(t,"_setDebug",{get:function(){return Hn},enumerable:!1}),t}function uo(e,t,r){var n=e[t];n&&!n.q&&n.version&&H.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=r,n&&n.q&&n.q.forEach(function(o){return Mr(o,"onReady callback threw an error:")()})}function dr(e,t){t.silentMultipleInit||H.error("".concat(e," is already initialized."))}var se;(function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.DBL_CLICK="dblclick",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.TOUCH_MOVE="touchmove",e.VISIBILITY_CHANGE="visibilitychange",e.PAGE_SHOW="pageshow",e.FREEZE="freeze",e.RESUME="resume",e.DOM_CONTENT_LOADED="DOMContentLoaded",e.POINTER_DOWN="pointerdown",e.POINTER_UP="pointerup",e.POINTER_CANCEL="pointercancel",e.HASH_CHANGE="hashchange",e.PAGE_HIDE="pagehide",e.MOUSE_DOWN="mousedown",e.MOUSE_UP="mouseup",e.MOUSE_MOVE="mousemove",e.FOCUS="focus",e.BLUR="blur",e.CONTEXT_MENU="contextmenu",e.RESIZE="resize",e.CHANGE="change",e.INPUT="input",e.PLAY="play",e.PAUSE="pause",e.SECURITY_POLICY_VIOLATION="securitypolicyviolation",e.SELECTION_CHANGE="selectionchange",e.STORAGE="storage"})(se||(se={}));function Te(e,t,r,n,o){return pr(e,t,[r],n,o)}function pr(e,t,r,n,o){var i=o===void 0?{}:o,a=i.once,c=i.capture,f=i.passive,l=j(function(S){!S.isTrusted&&!S.__ddIsTrusted&&!e.allowUntrustedEvents||(a&&y(),n(S))}),p=f?{capture:c,passive:f}:c,g=it(t,"addEventListener");r.forEach(function(S){return g.call(t,S,l,p)});function y(){var S=it(t,"removeEventListener");r.forEach(function(C){return S.call(t,C,l,p)})}return{stop:y}}var Pe={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function co(e,t){var r=[];Ae(t,Pe.cspViolation)&&r.push(tl(e));var n=t.filter(function(o){return o!==Pe.cspViolation});return n.length&&r.push(el(n)),Br.apply(void 0,r)}function el(e){return new q(function(t){if(!!window.ReportingObserver){var r=j(function(o,i){return o.forEach(function(a){t.notify(rl(a))})}),n=new window.ReportingObserver(r,{types:e,buffered:!0});return n.observe(),function(){n.disconnect()}}})}function tl(e){return new q(function(t){var r=Te(e,document,se.SECURITY_POLICY_VIOLATION,function(n){t.notify(nl(n))}).stop;return r})}function rl(e){var t=e.type,r=e.body;return{type:t,subtype:r.id,message:"".concat(t,": ").concat(r.message),originalReport:e,stack:Ea(r.id,r.message,r.sourceFile,r.lineNumber,r.columnNumber)}}function nl(e){var t=Pe.cspViolation,r="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return{type:Pe.cspViolation,subtype:e.effectiveDirective,message:"".concat(t,": ").concat(r),stack:Ea(e.effectiveDirective,e.originalPolicy?"".concat(r,' of the policy "').concat(Xi(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber),originalReport:e}}function Ea(e,t,r,n,o){return r?Me({name:e,message:t,stack:[{func:"?",url:r,line:n??void 0,column:o??void 0}]}):void 0}function mr(e,t){var r=window.__ddBrowserSdkExtensionCallback;r&&r({type:e,payload:t})}function Ft(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function rn(e,t,r){if(r===void 0&&(r=ol()),t===void 0)return e;if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var n=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,n)}if(!r.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],i=0;i<t.length;++i)o[i]=rn(o[i],t[i],r);return o}var a=Ft(e)==="object"?e:{};for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&(a[c]=rn(a[c],t[c],r));return a}}function nn(e){return rn(void 0,e)}function De(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r,n=0,o=e;n<o.length;n++){var i=o[n];i!=null&&(r=rn(r,i))}return r}function ol(){if(typeof WeakSet<"u"){var e=new WeakSet;return{hasAlreadyBeenSeen:function(r){var n=e.has(r);return n||e.add(r),n}}}var t=[];return{hasAlreadyBeenSeen:function(r){var n=t.indexOf(r)>=0;return n||t.push(r),n}}}function ba(){var e,t=window.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:(e=t.connection)===null||e===void 0?void 0:e.effectiveType}}function _a(e){var t=new Set;return e.forEach(function(r){return t.add(r)}),Ct(t)}function on(e,t){var r=e.indexOf(t);r>=0&&e.splice(r,1)}var il=500,hr=function(){function e(){this.buffer=[]}return e.prototype.add=function(t){var r=this.buffer.push(t);r>il&&this.buffer.splice(0,1)},e.prototype.remove=function(t){on(this.buffer,t)},e.prototype.drain=function(t){this.buffer.forEach(function(r){return r(t)}),this.buffer.length=0},e}();var at={log:"log",configuration:"configuration",usage:"usage"};var al=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],sl=[Jn],Sa=new hr,Gt=function(e){Sa.add(function(){return Gt(e)})};function an(e,t){var r,n,o=new q,i=new Set,a=!Ae(sl,t.site)&&Tt(t.telemetrySampleRate),c=(r={},r[at.log]=a,r[at.configuration]=a&&Tt(t.telemetryConfigurationSampleRate),r[at.usage]=a&&Tt(t.telemetryUsageSampleRate),r),f=ul();Gt=function(p){var g=xe(p);if(c[p.type]&&i.size<t.maxTelemetryEventsPerPage&&!i.has(g)){var y=l(e,p,f);o.notify(y),mr("telemetry",y),i.add(g)}},qi(vr);function l(p,g,y){return De({type:"telemetry",date:he(),service:p,version:"5.20.0",source:"browser",_dd:{format_version:2},telemetry:De(g,{runtime_env:y,connectivity:ba()}),experimental_features:Ct(Di())},n!==void 0?n():{})}return{setContextProvider:function(p){n=p},observable:o,enabled:a}}function ul(){return{is_local_file:window.location.protocol==="file:",is_worker:"WorkerGlobalScope"in self}}function sn(){Sa.drain()}function un(e){return e.site===Xn}function jt(e,t){Dr(de.debug,e,t),Gt(te({type:at.log,message:e,status:"debug"},t))}function vr(e,t){Gt(te({type:at.log,status:"error"},cl(e),t))}function cn(e){Gt({type:at.configuration,configuration:e})}function ln(e){Gt({type:at.usage,usage:e})}function cl(e){if(e instanceof Error){var t=ce(e);return{error:{kind:t.name,stack:Me(ll(t))},message:t.message}}return{error:{stack:tn},message:"".concat("Uncaught"," ").concat(xe(e))}}function ll(e){return e.stack=e.stack.filter(function(t){return!t.url||al.some(function(r){return At(t.url,r)})}),e}var fn=1/0,pl=Ie,Ia=function(){function e(t,r){var n=this;this.expireDelay=t,this.maxEntries=r,this.entries=[],this.clearOldValuesInterval=Nt(function(){return n.clearOldValues()},pl)}return e.prototype.add=function(t,r){var n=this,o={value:t,startTime:r,endTime:fn,remove:function(){on(n.entries,o)},close:function(i){o.endTime=i}};return this.maxEntries&&this.entries.length>=this.maxEntries&&this.entries.pop(),this.entries.unshift(o),o},e.prototype.find=function(t,r){t===void 0&&(t=fn),r===void 0&&(r={returnInactive:!1});for(var n=0,o=this.entries;n<o.length;n++){var i=o[n];if(i.startTime<=t){if(r.returnInactive||t<=i.endTime)return i.value;break}}},e.prototype.closeActive=function(t){var r=this.entries[0];r&&r.endTime===fn&&r.close(t)},e.prototype.findAll=function(t,r){t===void 0&&(t=fn),r===void 0&&(r=0);var n=$i(t,r);return this.entries.filter(function(o){return o.startTime<=n&&t<=o.endTime}).map(function(o){return o.value})},e.prototype.reset=function(){this.entries=[]},e.prototype.stop=function(){Mt(this.clearOldValuesInterval)},e.prototype.clearOldValues=function(){for(var t=Rt()-this.expireDelay;this.entries.length>0&&this.entries[this.entries.length-1].endTime<t;)this.entries.pop()},e}();var ml=Ie,hl=Pt,Wt=[];function lo(e,t,r,n){var o=new q,i=new q,a=da(e.sessionStoreStrategyType,t,r);Wt.push(function(){return a.stop()});var c=new Ia(hl);Wt.push(function(){return c.stop()}),a.renewObservable.subscribe(function(){c.add(f(),Rt()),o.notify()}),a.expireObservable.subscribe(function(){i.notify(),c.closeActive(Rt())}),a.expandOrRenewSession(),c.add(f(),Ui().relative),n.observable.subscribe(function(){n.isGranted()?a.expandOrRenewSession():a.expire()}),vl(e,function(){n.isGranted()&&a.expandOrRenewSession()}),gl(e,function(){return a.expandSession()}),yl(e,function(){return a.restartSession()});function f(){return{id:a.getSession().id,trackingType:a.getSession()[t]}}return{findSession:function(l,p){return c.find(l,p)},renewObservable:o,expireObservable:i,expire:a.expire}}function vl(e,t){var r=pr(e,window,[se.CLICK,se.TOUCH_START,se.KEY_DOWN,se.SCROLL],t,{capture:!0,passive:!0}).stop;Wt.push(r)}function gl(e,t){var r=function(){document.visibilityState==="visible"&&t()},n=Te(e,document,se.VISIBILITY_CHANGE,r).stop;Wt.push(n);var o=Nt(r,ml);Wt.push(function(){Mt(o)})}function yl(e,t){var r=Te(e,window,se.RESUME,t,{capture:!0}).stop;Wt.push(r)}function dn(e){return e>=500}function wa(e){try{return e.clone()}catch{return}}var El=80*be,bl=32,xa=3*jn,_l=Ie,Ta=ze;function fo(e,t,r,n,o){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?Oa(e,t,r,{onSuccess:function(){return Ca(0,t,r,n,o)},onFailure:function(){t.queuedPayloads.enqueue(e),Ra(t,r,n,o)}}):t.queuedPayloads.enqueue(e)}function Ra(e,t,r,n){e.transportStatus===2&&Fe(function(){var o=e.queuedPayloads.first();Oa(o,e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=Ta,Ca(1,e,t,r,n)},onFailure:function(){e.currentBackoffTime=Math.min(_l,e.currentBackoffTime*2),Ra(e,t,r,n)}})},e.currentBackoffTime)}function Oa(e,t,r,n){var o=n.onSuccess,i=n.onFailure;t.bandwidthMonitor.add(e),r(e,function(a){t.bandwidthMonitor.remove(e),Sl(a)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:a.status},i()):(t.transportStatus=0,o())})}function Ca(e,t,r,n,o){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(n," events size queued for upload: ").concat(xa/jn,"MiB"),source:re.AGENT,startClocks:Ce()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=La();i.size()>0;)fo(i.dequeue(),t,r,n,o)}function Sl(e){return e.type!=="opaque"&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||dn(e.status))}function Aa(){return{transportStatus:0,currentBackoffTime:Ta,bandwidthMonitor:Il(),queuedPayloads:La(),queueFullReported:!1}}function La(){var e=[];return{bytesCount:0,enqueue:function(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first:function(){return e[0]},dequeue:function(){var t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:function(){return e.length},isFull:function(){return this.bytesCount>=xa}}}function Il(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=El&&this.ongoingRequestCount<bl},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}}}function mo(e,t,r,n){var o=Aa(),i=function(a,c){return Tl(e,t,r,a,c)};return{send:function(a){fo(a,o,i,t.trackType,n)},sendOnExit:function(a){wl(e,t,r,a)}}}function wl(e,t,r,n){var o=!!navigator.sendBeacon&&n.bytesCount<r;if(o)try{var i=t.build("beacon",n),a=navigator.sendBeacon(i,n.data);if(a)return}catch(f){xl(f)}var c=t.build("xhr",n);po(e,c,n.data)}var Na=!1;function xl(e){Na||(Na=!0,vr(e))}function Tl(e,t,r,n,o){var i=Rl()&&n.bytesCount<r;if(i){var a=t.build("fetch",n);fetch(a,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(j(function(f){return o?.({status:f.status,type:f.type})}),j(function(){var f=t.build("xhr",n);po(e,f,n.data,o)}))}else{var c=t.build("xhr",n);po(e,c,n.data,o)}}function Rl(){try{return window.Request&&"keepalive"in new Request("http://a")}catch{return!1}}function po(e,t,r,n){var o=new XMLHttpRequest;o.open("POST",t,!0),r instanceof Blob&&o.setRequestHeader("Content-Type",r.type),Te(e,o,"loadend",function(){n?.({status:o.status})},{once:!0}),o.send(r)}function ht(){var e=Ol();if(!!e)return{getCapabilities:function(){var t;return JSON.parse(((t=e.getCapabilities)===null||t===void 0?void 0:t.call(e))||"[]")},getPrivacyLevel:function(){var t;return(t=e.getPrivacyLevel)===null||t===void 0?void 0:t.call(e)},getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,r,n){var o=n?{id:n}:void 0;e.send(JSON.stringify({eventType:t,event:r,view:o}))}}}function Qe(e){var t;e===void 0&&(e=(t=Le().location)===null||t===void 0?void 0:t.hostname);var r=ht();return!!r&&r.getAllowedWebViewHosts().some(function(n){return e===n||Hi(e,".".concat(n))})}function Ol(){return Le().DatadogEventBridge}var gr={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function ho(e){return new q(function(t){var r=pr(e,window,[se.VISIBILITY_CHANGE,se.FREEZE],function(o){o.type===se.VISIBILITY_CHANGE&&document.visibilityState==="hidden"?t.notify({reason:gr.HIDDEN}):o.type===se.FREEZE&&t.notify({reason:gr.FROZEN})},{capture:!0}).stop,n=Te(e,window,se.BEFORE_UNLOAD,function(){t.notify({reason:gr.UNLOADING})}).stop;return function(){r(),n()}})}function vo(e){return Ae($e(gr),e)}var ka=function(){function e(t,r,n,o){var i=this;this.encoder=t,this.request=r,this.flushController=n,this.messageBytesLimit=o,this.upsertBuffer={},this.flushSubscription=this.flushController.flushObservable.subscribe(function(a){return i.flush(a)})}return e.prototype.add=function(t){this.addOrUpdate(t)},e.prototype.upsert=function(t,r){this.addOrUpdate(t,r)},e.prototype.stop=function(){this.flushSubscription.unsubscribe()},e.prototype.flush=function(t){var r=$e(this.upsertBuffer).join(`
|
4
|
-
`);this.upsertBuffer={};var n=vo(t.reason),o=n?this.request.sendOnExit:this.request.send;if(n&&this.encoder.isAsync){var i=this.encoder.finishSync();i.outputBytesCount&&o(Ma(i));var a=[i.pendingData,r].filter(Boolean).join(`
|
5
|
-
`);a&&o({data:a,bytesCount:Ot(a)})}else r&&this.encoder.write(this.encoder.isEmpty?r:`
|
6
|
-
`.concat(r)),this.encoder.finish(function(c){o(Ma(c))})},e.prototype.addOrUpdate=function(t,r){var n=xe(t),o=this.encoder.estimateEncodedBytesCount(n);if(o>=this.messageBytesLimit){H.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(this.messageBytesLimit,"KB. More details: ").concat(ot,"/real_user_monitoring/browser/troubleshooting/#technical-limitations"));return}this.hasMessageFor(r)&&this.remove(r),this.push(n,o,r)},e.prototype.push=function(t,r,n){var o=this;this.flushController.notifyBeforeAddMessage(r),n!==void 0?(this.upsertBuffer[n]=t,this.flushController.notifyAfterAddMessage()):this.encoder.write(this.encoder.isEmpty?t:`
|
7
|
-
`.concat(t),function(i){o.flushController.notifyAfterAddMessage(i-r)})},e.prototype.remove=function(t){var r=this.upsertBuffer[t];delete this.upsertBuffer[t];var n=this.encoder.estimateEncodedBytesCount(r);this.flushController.notifyAfterRemoveMessage(n)},e.prototype.hasMessageFor=function(t){return t!==void 0&&this.upsertBuffer[t]!==void 0},e}();function Ma(e){var t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function go(e){var t=e.messagesLimit,r=e.bytesLimit,n=e.durationLimit,o=e.pageExitObservable,i=e.sessionExpireObservable,a=o.subscribe(function(L){return g(L.reason)}),c=i.subscribe(function(){return g("session_expire")}),f=new q(function(){return function(){a.unsubscribe(),c.unsubscribe()}}),l=0,p=0;function g(L){if(p!==0){var A=p,$=l;p=0,l=0,C(),f.notify({reason:L,messagesCount:A,bytesCount:$})}}var y;function S(){y===void 0&&(y=Fe(function(){g("duration_limit")},n))}function C(){Ur(y),y=void 0}return{flushObservable:f,get messagesCount(){return p},notifyBeforeAddMessage:function(L){l+L>=r&&g("bytes_limit"),p+=1,l+=L,S()},notifyAfterAddMessage:function(L){L===void 0&&(L=0),l+=L,p>=t?g("messages_limit"):l>=r&&g("bytes_limit")},notifyAfterRemoveMessage:function(L){l-=L,p-=1,p===0&&C()}}}function Ht(e,t,r,n,o,i){var a=f(e,t),c=r&&f(e,r);function f(l,p){var g=p.endpoint,y=p.encoder;return new ka(y,mo(l,g,l.batchBytesLimit,n),go({messagesLimit:l.batchMessagesLimit,bytesLimit:l.batchBytesLimit,durationLimit:l.flushTimeout,pageExitObservable:o,sessionExpireObservable:i}),l.messageBytesLimit)}return{flushObservable:a.flushController.flushObservable,add:function(l,p){p===void 0&&(p=!0),a.add(l),c&&p&&c.add(r.transformMessage?r.transformMessage(l):l)},upsert:function(l,p){a.upsert(l,p),c&&c.upsert(r.transformMessage?r.transformMessage(l):l,p)},stop:function(){a.stop(),c?.stop()}}}function vt(){var e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write:function(r,n){var o=Ot(r);t+=o,e+=r,n&&n(o)},finish:function(r){r(this.finishSync())},finishSync:function(){var r={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,r},estimateEncodedBytesCount:function(r){return r.length}}}var yo=function(){function e(){this.callbacks={}}return e.prototype.notify=function(t,r){var n=this.callbacks[t];n&&n.forEach(function(o){return o(r)})},e.prototype.subscribe=function(t,r){var n=this;return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(r),{unsubscribe:function(){n.callbacks[t]=n.callbacks[t].filter(function(o){return r!==o})}}},e}();function Pa(e,t,r){var n=0,o=!1;return{isLimitReached:function(){if(n===0&&Fe(function(){n=0},Ie),n+=1,n<=t||o)return o=!1,!1;if(n===t+1){o=!0;try{r({message:"Reached max number of ".concat(e,"s by minute: ").concat(t),source:re.AGENT,startClocks:Ce()})}finally{o=!1}}return!0}}}var Eo,bo=new WeakMap;function _o(e){return Eo||(Eo=Al(e)),Eo}function Al(e){return new q(function(t){var r=We(XMLHttpRequest.prototype,"open",Ll).stop,n=We(XMLHttpRequest.prototype,"send",function(i){Nl(i,e,t)},{computeHandlingStack:!0}).stop,o=We(XMLHttpRequest.prototype,"abort",Ml).stop;return function(){r(),n(),o()}})}function Ll(e){var t=e.target,r=e.parameters,n=r[0],o=r[1];bo.set(t,{state:"open",method:String(n).toUpperCase(),url:Ut(String(o))})}function Nl(e,t,r){var n=e.target,o=e.handlingStack,i=bo.get(n);if(!!i){var a=i;a.state="start",a.startClocks=Ce(),a.isAborted=!1,a.xhr=n,a.handlingStack=o;var c=!1,f=We(n,"onreadystatechange",function(){n.readyState===XMLHttpRequest.DONE&&l()}).stop,l=function(){if(p(),f(),!c){c=!0;var g=i;g.state="complete",g.duration=Bi(a.startClocks.timeStamp,he()),g.status=n.status,r.notify(Ki(g))}},p=Te(t,n,"loadend",l).stop;r.notify(a)}}function Ml(e){var t=e.target,r=bo.get(t);r&&(r.isAborted=!0)}var So;function Io(){return So||(So=kl()),So}function kl(){return new q(function(e){if(!!window.fetch){var t=We(window,"fetch",function(r){return Pl(r,e)},{computeHandlingStack:!0}).stop;return t}})}function Pl(e,t){var r=e.parameters,n=e.onPostCall,o=e.handlingStack,i=r[0],a=r[1],c=a&&a.method;c===void 0&&i instanceof Request&&(c=i.method);var f=c!==void 0?String(c).toUpperCase():"GET",l=i instanceof Request?i.url:Ut(String(i)),p=Ce(),g={state:"start",init:a,input:i,method:f,startClocks:p,url:l,handlingStack:o};t.notify(g),r[0]=g.input,r[1]=g.init,n(function(y){return Dl(t,y,g)})}function Dl(e,t,r){var n=function(o){var i=r;i.state="resolve","stack"in o||o instanceof Error?(i.status=0,i.isAborted=o instanceof DOMException&&o.code===DOMException.ABORT_ERR,i.error=o):"status"in o&&(i.response=o,i.responseType=o.type,i.status=o.status,i.isAborted=!1),e.notify(i)};t.then(j(n),j(n))}var wo={};function xo(e){var t=e.map(function(r){return wo[r]||(wo[r]=Ul(r)),wo[r]});return Br.apply(void 0,t)}function Ul(e){return new q(function(t){var r=Oe[e];return Oe[e]=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];r.apply(console,n);var i=en();Xe(function(){t.notify(Bl(n,e,i))})},function(){Oe[e]=r}})}function Bl(e,t,r){var n=e.map(function(f){return $l(f)}).join(" "),o,i,a;if(t===de.error){var c=ji(e,function(f){return f instanceof Error});o=c?Me(ce(c)):void 0,i=no(c),a=c?io(c,"console"):void 0}return{api:t,message:n,stack:o,handlingStack:r,fingerprint:i,causes:a}}function $l(e){return typeof e=="string"?_e(e):e instanceof Error?eo(ce(e)):xe(_e(e),void 0,2)}function Kt(e){var t={},r=new q,n={getContext:function(){return nn(t)},setContext:function(o){Ft(o)==="object"?(t=_e(o),e.updateCustomerData(t)):n.clearContext(),r.notify()},setContextProperty:function(o,i){t[o]=_e(i),e.updateCustomerData(t),r.notify()},removeContextProperty:function(o){delete t[o],e.updateCustomerData(t),r.notify()},clearContext:function(){t={},e.resetCustomerData(),r.notify()},changeObservable:r};return n}var Fl="_dd_c",Gl=[];function pn(e,t,r,n){var o=jl(r,n);Gl.push(Te(e,window,se.STORAGE,function(f){var l=f.key;o===l&&i()})),t.changeObservable.subscribe(a),t.setContext(De(c(),t.getContext()));function i(){t.setContext(c())}function a(){localStorage.setItem(o,JSON.stringify(t.getContext()))}function c(){var f=localStorage.getItem(o);return f!==null?JSON.parse(f):{}}}function jl(e,t){return"".concat(Fl,"_").concat(e,"_").concat(t)}var Da=3*be,Wl=16*be,Hl=200;function Ro(e){e===void 0&&(e=2);var t=new Map,r=!1;function n(o){if(o===void 0&&(o=0),!(r||e===0)){var i=e===2?Da:Wl,a=o;t.forEach(function(c){a+=c.getBytesCount()}),a>i&&(Kl(i),r=!0)}}return{createDetachedTracker:function(){var o=To(function(){return n(o.getBytesCount())});return o},getOrCreateTracker:function(o){return t.has(o)||t.set(o,To(n)),t.get(o)},setCompressionStatus:function(o){e===0&&(e=o,n())},getCompressionStatus:function(){return e},stop:function(){t.forEach(function(o){return o.stop()}),t.clear()}}}function To(e){var t=0,r=$r(function(a){t=Ot(xe(a)),e()},Hl),n=r.throttled,o=r.cancel,i=function(){o(),t=0};return{updateCustomerData:function(a){Lt(a)?i():n(a)},resetCustomerData:i,getBytesCount:function(){return t},stop:function(){o()}}}function Kl(e){H.warn("Customer data exceeds the recommended ".concat(e/be,"KiB threshold. More details: ").concat(ot,"/real_user_monitoring/browser/troubleshooting/#customer-data-exceeds-the-recommended-threshold-warning"))}function Oo(e,t,r){var n=e.getReader(),o=[],i=0;a();function a(){n.read().then(j(function(f){if(f.done){c();return}r.collectStreamBody&&o.push(f.value),i+=f.value.length,i>r.bytesLimit?c():a()}),j(function(f){return t(f)}))}function c(){n.cancel().catch(we);var f,l;if(r.collectStreamBody){var p;if(o.length===1)p=o[0];else{p=new Uint8Array(i);var g=0;o.forEach(function(y){p.set(y,g),g+=y.length})}f=p.slice(0,r.bytesLimit),l=p.length>r.bytesLimit}t(void 0,f,l)}}var Yl="datadog-synthetics-public-id",ql="datadog-synthetics-result-id",Vl="datadog-synthetics-injects-rum";function yr(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||Je(Vl))}function Co(){var e=window._DATADOG_SYNTHETICS_PUBLIC_ID||Je(Yl);return typeof e=="string"?e:void 0}function Ao(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||Je(ql);return typeof e=="string"?e:void 0}function mn(e){var t=te({},e),r=["id","name","email"];return r.forEach(function(n){n in t&&(t[n]=String(t[n]))}),t}function Lo(e){var t=Ft(e)==="object";return t||H.error("Unsupported user:",e),t}var zl=function(e,t,r,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(i=(o<3?a(i):o>3?a(t,r,i):a(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i},z={debug:"debug",error:"error",info:"info",warn:"warn"},Er={console:"console",http:"http",silent:"silent"},Ua=Object.keys(z),hn=function(){function e(t,r,n,o,i,a){o===void 0&&(o=Er.http),i===void 0&&(i=z.debug),a===void 0&&(a={}),this.handleLogStrategy=t,this.handlerType=o,this.level=i,this.contextManager=Kt(r),this.contextManager.setContext(a),n&&this.contextManager.setContextProperty("logger",{name:n})}return e.prototype.log=function(t,r,n,o){n===void 0&&(n=z.info);var i;if(o!=null){var a=o instanceof Error?ce(o):void 0,c=fr({stackTrace:a,originalError:o,nonErrorPrefix:"Provided",source:re.LOGGER,handling:"handled",startClocks:Ce()});i={stack:c.stack,kind:c.type,message:c.message,causes:c.causes}}var f=_e(r),l=i?De({error:i},f):f;this.handleLogStrategy({message:_e(t),context:l,status:n},this)},e.prototype.debug=function(t,r,n){this.log(t,r,z.debug,n)},e.prototype.info=function(t,r,n){this.log(t,r,z.info,n)},e.prototype.warn=function(t,r,n){this.log(t,r,z.warn,n)},e.prototype.error=function(t,r,n){this.log(t,r,z.error,n)},e.prototype.setContext=function(t){this.contextManager.setContext(t)},e.prototype.getContext=function(){return this.contextManager.getContext()},e.prototype.setContextProperty=function(t,r){this.contextManager.setContextProperty(t,r)},e.prototype.removeContextProperty=function(t){this.contextManager.removeContextProperty(t)},e.prototype.clearContext=function(){this.contextManager.clearContext()},e.prototype.setHandler=function(t){this.handlerType=t},e.prototype.getHandler=function(){return this.handlerType},e.prototype.setLevel=function(t){this.level=t},e.prototype.getLevel=function(){return this.level},zl([Kn],e.prototype,"log",null),e}();function Ba(e,t){return{view:{referrer:document.referrer,url:window.location.href},context:e.getContext(),user:t.getContext()}}var Xl=32*be;function Fa(e){e.usePciIntake===!0&&e.site&&e.site!=="datadoghq.com"&&H.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");var t=Zr(e),r=$a(e.forwardConsoleLogs,$e(de),"Forward Console Logs"),n=$a(e.forwardReports,$e(Pe),"Forward Reports");if(!(!t||!r||!n))return e.forwardErrorsToLogs&&!Ae(r,de.error)&&r.push(de.error),te({forwardErrorsToLogs:e.forwardErrorsToLogs!==!1,forwardConsoleLogs:r,forwardReports:n,requestErrorResponseLengthLimit:Xl,sendLogsAfterSessionExpiration:!!e.sendLogsAfterSessionExpiration},t)}function $a(e,t,r){if(e===void 0)return[];if(!(e==="all"||Array.isArray(e)&&e.every(function(n){return Ae(t,n)}))){H.error("".concat(r,' should be "all" or an array with allowed values "').concat(t.join('", "'),'"'));return}return e==="all"?t:_a(e)}function Ga(e){var t=Qr(e);return te({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports,use_pci_intake:e.usePciIntake,send_logs_after_session_expiration:e.sendLogsAfterSessionExpiration},t)}function ja(e,t,r){var n=new hr,o,i,a=t.observable.subscribe(c);function c(){if(!(!i||!o||!t.isGranted())){a.unsubscribe();var f=r(o,i);n.drain(f)}}return{init:function(f){if(!f){H.error("Missing configuration");return}if(Qe()&&(f=Jl(f)),o=f,i){dr("DD_LOGS",f);return}var l=Fa(f);!l||(i=l,t.tryToInit(l.trackingConsent),c())},get initConfiguration(){return o},getInternalContext:we,handleLog:function(f,l,p,g){p===void 0&&(p=e()),g===void 0&&(g=he()),n.add(function(y){return y.handleLog(f,l,p,g)})}}}function Jl(e){return te({},e,{clientToken:"empty"})}var Wa="logs";function Ha(e){var t=Ro(),r=Kt(t.getOrCreateTracker(2)),n=Kt(t.getOrCreateTracker(1)),o=zn();function i(){return Ba(r,n)}var a=ja(i,o,function(l,p){l.storeContextsAcrossPages&&(pn(p,r,Wa,2),pn(p,n,Wa,1));var g=e(l,p,i,o);return a=Zl(l,g),g}),c={},f=new hn(function(){for(var l=[],p=0;p<arguments.length;p++)l[p]=arguments[p];return a.handleLog.apply(a,l)},t.createDetachedTracker());return so({logger:f,init:j(function(l){return a.init(l)}),setTrackingConsent:j(function(l){o.update(l),ln({feature:"set-tracking-consent",tracking_consent:l})}),getGlobalContext:j(function(){return r.getContext()}),setGlobalContext:j(function(l){return r.setContext(l)}),setGlobalContextProperty:j(function(l,p){return r.setContextProperty(l,p)}),removeGlobalContextProperty:j(function(l){return r.removeContextProperty(l)}),clearGlobalContext:j(function(){return r.clearContext()}),createLogger:j(function(l,p){return p===void 0&&(p={}),c[l]=new hn(function(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];return a.handleLog.apply(a,g)},t.createDetachedTracker(),_e(l),p.handler,p.level,_e(p.context)),c[l]}),getLogger:j(function(l){return c[l]}),getInitConfiguration:j(function(){return nn(a.initConfiguration)}),getInternalContext:j(function(l){return a.getInternalContext(l)}),setUser:j(function(l){Lo(l)&&n.setContext(mn(l))}),getUser:j(function(){return n.getContext()}),setUserProperty:j(function(l,p){var g,y=mn((g={},g[l]=p,g))[l];n.setContextProperty(l,y)}),removeUserProperty:j(function(l){return n.removeContextProperty(l)}),clearUser:j(function(){return n.clearContext()})})}function Zl(e,t){return te({init:function(r){dr("DD_LOGS",r)},initConfiguration:e},t)}var Ql="logs";function Ka(e,t){var r=lo(e,Ql,function(n){return ef(e,n)},t);return{findTrackedSession:function(n,o){o===void 0&&(o={returnInactive:!1});var i=r.findSession(n,o);return i&&i.trackingType==="1"?{id:i.id}:void 0},expireObservable:r.expireObservable}}function Ya(e){var t=qa(e)==="1",r=t?{}:void 0;return{findTrackedSession:function(){return r},expireObservable:new q}}function qa(e){return Tt(e.sessionSampleRate)?"1":"0"}function ef(e,t){var r=tf(t)?t:qa(e);return{trackingType:r,isTracked:r==="1"}}function tf(e){return e==="0"||e==="1"}var Va=!1;function Yt(e){var t=window;if(yr()){var r=n(t.DD_RUM_SYNTHETICS);return!r&&!Va&&(Va=!0,jt("Logs sent before RUM is injected by the synthetics worker",{testId:Co(),resultId:Ao()})),r}return n(t.DD_RUM);function n(o){if(o&&o.getInternalContext)return o.getInternalContext(e)}}function za(e,t,r,n,o){var i=Ua.concat(["custom"]),a={};i.forEach(function(c){a[c]=Pa(c,t.eventRateLimiterThreshold,o)}),r.subscribe(0,function(c){var f,l,p=c.rawLogsEvent,g=c.messageContext,y=g===void 0?void 0:g,S=c.savedCommonContext,C=S===void 0?void 0:S,L=c.domainContext,A=Fi(p.date),$=e.findTrackedSession(A);if(!(!$&&(!t.sendLogsAfterSessionExpiration||!e.findTrackedSession(A,{returnInactive:!0})))){var Q=C||n(),k=De({service:t.service,session_id:$?.id,usr:Lt(Q.user)?void 0:Q.user,view:Q.view},Q.context,Yt(A),p,y);((f=t.beforeSend)===null||f===void 0?void 0:f.call(t,k,L))===!1||k.origin!==re.AGENT&&((l=a[k.status])!==null&&l!==void 0?l:a.custom).isLimitReached()||r.notify(1,k)}})}var gt,rf=(gt={},gt[de.log]=z.info,gt[de.debug]=z.debug,gt[de.info]=z.info,gt[de.warn]=z.warn,gt[de.error]=z.error,gt);function Xa(e,t){var r=xo(e.forwardConsoleLogs).subscribe(function(n){t.notify(0,{rawLogsEvent:{date:he(),message:n.message,origin:re.CONSOLE,error:n.api===de.error?{stack:n.stack,fingerprint:n.fingerprint,causes:n.causes}:void 0,status:rf[n.api]}})});return{stop:function(){r.unsubscribe()}}}var br,nf=(br={},br[Pe.cspViolation]=z.error,br[Pe.intervention]=z.error,br[Pe.deprecation]=z.warn,br);function Ja(e,t){var r=co(e,e.forwardReports).subscribe(function(n){var o=n.message,i=nf[n.type],a;i===z.error?a={kind:n.subtype,stack:n.stack}:n.stack&&(o+=" Found in ".concat(oo(n.stack))),t.notify(0,{rawLogsEvent:{date:he(),message:o,origin:re.REPORT,error:a,status:i}})});return{stop:function(){r.unsubscribe()}}}function Za(e,t){if(!e.forwardErrorsToLogs)return{stop:we};var r=_o(e).subscribe(function(i){i.state==="complete"&&o("xhr",i)}),n=Io().subscribe(function(i){i.state==="resolve"&&o("fetch",i)});function o(i,a){!e.isIntakeUrl(a.url)&&(uf(a)||dn(a.status))&&("xhr"in a?of(a.xhr,e,c):a.response?sf(a.response,e,c):a.error&&af(a.error,e,c));function c(f){var l={isAborted:a.isAborted};t.notify(0,{rawLogsEvent:{message:"".concat(cf(i)," error ").concat(a.method," ").concat(a.url),date:a.startClocks.timeStamp,error:{stack:f||"Failed to load"},http:{method:a.method,status_code:a.status,url:a.url},status:z.error,origin:re.NETWORK},domainContext:l})}}return{stop:function(){r.unsubscribe(),n.unsubscribe()}}}function of(e,t,r){typeof e.response=="string"?r(No(e.response,t)):r(e.response)}function af(e,t,r){r(No(Me(ce(e)),t))}function sf(e,t,r){var n=wa(e);!n||!n.body?r():window.TextDecoder?lf(n.body,t.requestErrorResponseLengthLimit,function(o,i){r(o?"Unable to retrieve response: ".concat(o):i)}):n.text().then(j(function(o){return r(No(o,t))}),j(function(o){return r("Unable to retrieve response: ".concat(o))}))}function uf(e){return e.status===0&&e.responseType!=="opaque"}function No(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function cf(e){return e==="xhr"?"XHR":"Fetch"}function lf(e,t,r){Oo(e,function(n,o,i){if(n)r(n);else{var a=new TextDecoder().decode(o);i&&(a+="..."),r(void 0,a)}},{bytesLimit:t,collectStreamBody:!0})}function Qa(e,t){if(!e.forwardErrorsToLogs)return{stop:we};var r=new q,n=ao(r).stop,o=r.subscribe(function(i){t.notify(0,{rawLogsEvent:{message:i.message,date:i.startClocks.timeStamp,error:{kind:i.type,stack:i.stack,causes:i.causes},origin:re.SOURCE,status:z.error}})});return{stop:function(){n(),o.unsubscribe()}}}var es=yo;var qt,ts=(qt={},qt[z.debug]=0,qt[z.info]=1,qt[z.warn]=2,qt[z.error]=3,qt);function ns(e){function t(r,n,o,i){var a=De(n.getContext(),r.context);rs(r.status,Er.console,n)&&ff(r,a),rs(r.status,Er.http,n)&&e.notify(0,{rawLogsEvent:{date:i||he(),message:r.message,status:r.status,origin:re.LOGGER},messageContext:a,savedCommonContext:o})}return{handleLog:t}}function rs(e,t,r){var n=r.getHandler(),o=Array.isArray(n)?n:[n];return ts[e]>=ts[r.getLevel()]&&Ae(o,t)}function ff(e,t){nt[e.status].call(Oe,e.message,t)}function os(e,t,r,n,o){var i=Ht(e,{endpoint:e.logsEndpointBuilder,encoder:vt()},e.replica&&{endpoint:e.replica.logsEndpointBuilder,encoder:vt()},r,n,o.expireObservable);return t.subscribe(1,function(a){i.add(a)}),i}function is(e){var t=ht();e.subscribe(1,function(r){t.send("log",r)})}function as(e){return{get:function(t){var r=e.findTrackedSession(t);if(r)return{session_id:r.id}}}}function ss(e){return function(t){e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,origin:re.AGENT,status:z.error}}),jt("Error reported to customer",{"error.message":t.message})}}function us(e,t,r,n,o){var i=an("browser-logs-sdk",t);i.setContextProvider(function(){var g,y,S,C,L,A;return{application:{id:(g=Yt())===null||g===void 0?void 0:g.application_id},session:{id:(y=o.findTrackedSession())===null||y===void 0?void 0:y.id},view:{id:(C=(S=Yt())===null||S===void 0?void 0:S.view)===null||C===void 0?void 0:C.id},action:{id:(A=(L=Yt())===null||L===void 0?void 0:L.user_action)===null||A===void 0?void 0:A.id}}});var a=[];if(Qe()){var c=ht(),f=i.observable.subscribe(function(g){return c.send("internal_telemetry",g)});a.push(function(){return f.unsubscribe()})}else{var l=Ht(t,{endpoint:t.rumEndpointBuilder,encoder:vt()},t.replica&&{endpoint:t.replica.rumEndpointBuilder,encoder:vt()},r,n,o.expireObservable);a.push(function(){return l.stop()});var p=i.observable.subscribe(function(g){return l.add(g,un(t))});a.push(function(){return p.unsubscribe()})}return sn(),cn(Ga(e)),{telemetry:i,stop:function(){a.forEach(function(g){return g()})}}}function cs(e,t,r,n){var o=new es,i=[];o.subscribe(1,function(S){return mr("logs",S)});var a=ss(o),c=ho(t),f=t.sessionStoreStrategyType&&!Qe()&&!yr()?Ka(t,n):Ya(t),l=us(e,t,a,c,f).stop;i.push(function(){return l()}),Za(t,o),Qa(t,o),Xa(t,o),Ja(t,o);var p=ns(o).handleLog;if(za(f,t,o,r,a),Qe())is(o);else{var g=os(t,o,a,c,f).stop;i.push(function(){return g()})}var y=as(f);return{handleLog:p,getInternalContext:y.get,stop:function(){i.forEach(function(S){return S()})}}}var _r=Ha(cs);uo(Le(),"DD_LOGS",_r);var df=Object.create,xn=Object.defineProperty,pf=Object.defineProperties,mf=Object.getOwnPropertyDescriptor,hf=Object.getOwnPropertyDescriptors,vf=Object.getOwnPropertyNames,ls=Object.getOwnPropertySymbols,gf=Object.getPrototypeOf,xs=Object.prototype.hasOwnProperty,yf=Object.prototype.propertyIsEnumerable,fs=(e,t,r)=>t in e?xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Po=(e,t)=>{for(var r in t||(t={}))xs.call(t,r)&&fs(e,r,t[r]);if(ls)for(var r of ls(t))yf.call(t,r)&&fs(e,r,t[r]);return e},Do=(e,t)=>pf(e,hf(t)),Ef=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bf=(e,t)=>{for(var r in t)xn(e,r,{get:t[r],enumerable:!0})},_f=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vf(t))!xs.call(e,o)&&o!==r&&xn(e,o,{get:()=>t[o],enumerable:!(n=mf(t,o))||n.enumerable});return e},Sf=(e,t,r)=>(r=e!=null?df(gf(e)):{},_f(t||!e||!e.__esModule?xn(r,"default",{value:e,enumerable:!0}):r,e)),ne=(e,t,r)=>new Promise((n,o)=>{var i=f=>{try{c(r.next(f))}catch(l){o(l)}},a=f=>{try{c(r.throw(f))}catch(l){o(l)}},c=f=>f.done?n(f.value):Promise.resolve(f.value).then(i,a);c((r=r.apply(e,t)).next())}),If=Ef((e,t)=>{"use strict";var r=Object.prototype.hasOwnProperty,n="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(n=!1));function i(l,p,g){this.fn=l,this.context=p,this.once=g||!1}function a(l,p,g,y,S){if(typeof g!="function")throw new TypeError("The listener must be a function");var C=new i(g,y||l,S),L=n?n+p:p;return l._events[L]?l._events[L].fn?l._events[L]=[l._events[L],C]:l._events[L].push(C):(l._events[L]=C,l._eventsCount++),l}function c(l,p){--l._eventsCount===0?l._events=new o:delete l._events[p]}function f(){this._events=new o,this._eventsCount=0}f.prototype.eventNames=function(){var l=[],p,g;if(this._eventsCount===0)return l;for(g in p=this._events)r.call(p,g)&&l.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(p)):l},f.prototype.listeners=function(l){var p=n?n+l:l,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var y=0,S=g.length,C=new Array(S);y<S;y++)C[y]=g[y].fn;return C},f.prototype.listenerCount=function(l){var p=n?n+l:l,g=this._events[p];return g?g.fn?1:g.length:0},f.prototype.emit=function(l,p,g,y,S,C){var L=n?n+l:l;if(!this._events[L])return!1;var A=this._events[L],$=arguments.length,Q,k;if(A.fn){switch(A.once&&this.removeListener(l,A.fn,void 0,!0),$){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,p),!0;case 3:return A.fn.call(A.context,p,g),!0;case 4:return A.fn.call(A.context,p,g,y),!0;case 5:return A.fn.call(A.context,p,g,y,S),!0;case 6:return A.fn.call(A.context,p,g,y,S,C),!0}for(k=1,Q=new Array($-1);k<$;k++)Q[k-1]=arguments[k];A.fn.apply(A.context,Q)}else{var Ue=A.length,U;for(k=0;k<Ue;k++)switch(A[k].once&&this.removeListener(l,A[k].fn,void 0,!0),$){case 1:A[k].fn.call(A[k].context);break;case 2:A[k].fn.call(A[k].context,p);break;case 3:A[k].fn.call(A[k].context,p,g);break;case 4:A[k].fn.call(A[k].context,p,g,y);break;default:if(!Q)for(U=1,Q=new Array($-1);U<$;U++)Q[U-1]=arguments[U];A[k].fn.apply(A[k].context,Q)}}return!0},f.prototype.on=function(l,p,g){return a(this,l,p,g,!1)},f.prototype.once=function(l,p,g){return a(this,l,p,g,!0)},f.prototype.removeListener=function(l,p,g,y){var S=n?n+l:l;if(!this._events[S])return this;if(!p)return c(this,S),this;var C=this._events[S];if(C.fn)C.fn===p&&(!y||C.once)&&(!g||C.context===g)&&c(this,S);else{for(var L=0,A=[],$=C.length;L<$;L++)(C[L].fn!==p||y&&!C[L].once||g&&C[L].context!==g)&&A.push(C[L]);A.length?this._events[S]=A.length===1?A[0]:A:c(this,S)}return this},f.prototype.removeAllListeners=function(l){var p;return l?(p=n?n+l:l,this._events[p]&&c(this,p)):(this._events=new o,this._eventsCount=0),this},f.prototype.off=f.prototype.removeListener,f.prototype.addListener=f.prototype.on,f.prefixed=n,f.EventEmitter=f,typeof t<"u"&&(t.exports=f)});function wf(e){let t={exports:{}};return e(t,t.exports),t.exports}var xf=Number.MAX_SAFE_INTEGER||9007199254740991,Uo={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:xf,MAX_SAFE_COMPONENT_LENGTH:16},Tf=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},Z=Tf,Ar=wf(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:r}=Uo,n=(t=e.exports={}).re=[],o=t.src=[],i=t.t={},a=0,c=(f,l,p)=>{let g=a++;Z(g,l),i[f]=g,o[g]=l,n[g]=new RegExp(l,p?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION",`(${o[i.NUMERICIDENTIFIER]})\\.(${o[i.NUMERICIDENTIFIER]})\\.(${o[i.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${o[i.NUMERICIDENTIFIERLOOSE]})\\.(${o[i.NUMERICIDENTIFIERLOOSE]})\\.(${o[i.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${o[i.NUMERICIDENTIFIER]}|${o[i.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${o[i.NUMERICIDENTIFIERLOOSE]}|${o[i.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${o[i.PRERELEASEIDENTIFIER]}(?:\\.${o[i.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${o[i.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[i.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD",`(?:\\+(${o[i.BUILDIDENTIFIER]}(?:\\.${o[i.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${o[i.MAINVERSION]}${o[i.PRERELEASE]}?${o[i.BUILD]}?`),c("FULL",`^${o[i.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${o[i.MAINVERSIONLOOSE]}${o[i.PRERELEASELOOSE]}?${o[i.BUILD]}?`),c("LOOSE",`^${o[i.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${o[i.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${o[i.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${o[i.XRANGEIDENTIFIER]})(?:\\.(${o[i.XRANGEIDENTIFIER]})(?:\\.(${o[i.XRANGEIDENTIFIER]})(?:${o[i.PRERELEASE]})?${o[i.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${o[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[i.XRANGEIDENTIFIERLOOSE]})(?:${o[i.PRERELEASELOOSE]})?${o[i.BUILD]}?)?)?`),c("XRANGE",`^${o[i.GTLT]}\\s*${o[i.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${o[i.GTLT]}\\s*${o[i.XRANGEPLAINLOOSE]}$`),c("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),c("COERCERTL",o[i.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${o[i.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",c("TILDE",`^${o[i.LONETILDE]}${o[i.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${o[i.LONETILDE]}${o[i.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${o[i.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",c("CARET",`^${o[i.LONECARET]}${o[i.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${o[i.LONECARET]}${o[i.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${o[i.GTLT]}\\s*(${o[i.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${o[i.GTLT]}\\s*(${o[i.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${o[i.GTLT]}\\s*(${o[i.LOOSEPLAIN]}|${o[i.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${o[i.XRANGEPLAIN]})\\s+-\\s+(${o[i.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${o[i.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[i.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0.0.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),ds=/^[0-9]+$/,Ts=(e,t)=>{let r=ds.test(e),n=ds.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Rf=(e,t)=>Ts(t,e),Of={compareIdentifiers:Ts,rcompareIdentifiers:Rf},{MAX_LENGTH:ps,MAX_SAFE_INTEGER:vn}=Uo,{re:ms,t:hs}=Ar,{compareIdentifiers:Sr}=Of,le=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof le){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>ps)throw new TypeError(`version is longer than ${ps} characters`);Z("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?ms[hs.LOOSE]:ms[hs.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>vn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>vn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>vn||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let o=+n;if(o>=0&&o<vn)return o}return n}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Z("SemVer.compare",this.version,this.options,e),!(e instanceof le)){if(typeof e=="string"&&e===this.version)return 0;e=new le(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof le||(e=new le(e,this.options)),Sr(this.major,e.major)||Sr(this.minor,e.minor)||Sr(this.patch,e.patch)}comparePre(e){if(e instanceof le||(e=new le(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 r=this.prerelease[t],n=e.prerelease[t];if(Z("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r!==n)return Sr(r,n)}while(++t)}compareBuild(e){e instanceof le||(e=new le(e,this.options));let t=0;do{let r=this.build[t],n=e.build[t];if(Z("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r!==n)return Sr(r,n)}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 r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-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}},Cf=(e,t,r)=>new le(e,r).compare(new le(t,r)),Zt=Cf,Af=(e,t,r)=>Zt(e,t,r)===0,Lf=Af,Nf=(e,t,r)=>Zt(e,t,r)!==0,Mf=Nf,kf=(e,t,r)=>Zt(e,t,r)>0,Pf=kf,Df=(e,t,r)=>Zt(e,t,r)>=0,Uf=Df,Bf=(e,t,r)=>Zt(e,t,r)<0,$f=Bf,Ff=(e,t,r)=>Zt(e,t,r)<=0,Gf=Ff,jf=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Lf(e,r,n);case"!=":return Mf(e,r,n);case">":return Pf(e,r,n);case">=":return Uf(e,r,n);case"<":return $f(e,r,n);case"<=":return Gf(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}},Mo=jf,Ir=Symbol("SemVer ANY"),Rr=class{static get ANY(){return Ir}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Rr){if(e.loose===!!t.loose)return e;e=e.value}Z("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ir?this.value="":this.value=this.operator+this.semver.version,Z("comp",this)}parse(e){let t=this.options.loose?vs[gs.COMPARATORLOOSE]:vs[gs.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new le(r[2],this.options.loose):this.semver=Ir}toString(){return this.value}test(e){if(Z("Comparator.test",e,this.options.loose),this.semver===Ir||e===Ir)return!0;if(typeof e=="string")try{e=new le(e,this.options)}catch(t){return!1}return Mo(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Rr))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new zt(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new zt(this.value,t).test(e.semver);let r=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),n=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),o=this.semver.version===e.semver.version,i=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),a=Mo(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),c=Mo(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return r||n||o&&i||a||c}},{re:vs,t:gs}=Ar,zt=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof zt)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new zt(e.raw,t);if(e instanceof Rr)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(r=>this.parseRange(r.trim())).filter(r=>r.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 r=t?pe[fe.HYPHENRANGELOOSE]:pe[fe.HYPHENRANGE];e=e.replace(r,td(this.options.includePrerelease)),Z("hyphen replace",e),e=e.replace(pe[fe.COMPARATORTRIM],Wf),Z("comparator trim",e,pe[fe.COMPARATORTRIM]),e=(e=(e=e.replace(pe[fe.TILDETRIM],Hf)).replace(pe[fe.CARETTRIM],Kf)).split(/\s+/).join(" ");let n=t?pe[fe.COMPARATORLOOSE]:pe[fe.COMPARATOR];return e.split(" ").map(o=>Yf(o,this.options)).join(" ").split(/\s+/).map(o=>ed(o,this.options)).filter(this.options.loose?o=>!!o.match(n):()=>!0).map(o=>new Rr(o,this.options))}intersects(e,t){if(!(e instanceof zt))throw new TypeError("a Range is required");return this.set.some(r=>ys(r,t)&&e.set.some(n=>ys(n,t)&&r.every(o=>n.every(i=>o.intersects(i,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new le(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(rd(this.set[t],e,this.options))return!0;return!1}},{re:pe,t:fe,comparatorTrimReplace:Wf,tildeTrimReplace:Hf,caretTrimReplace:Kf}=Ar,ys=(e,t)=>{let r=!0,n=e.slice(),o=n.pop();for(;r&&n.length;)r=n.every(i=>o.intersects(i,t)),o=n.pop();return r},Yf=(e,t)=>(Z("comp",e,t),e=zf(e,t),Z("caret",e),e=qf(e,t),Z("tildes",e),e=Jf(e,t),Z("xrange",e),e=Qf(e,t),Z("stars",e),e),ve=e=>!e||e.toLowerCase()==="x"||e==="*",qf=(e,t)=>e.trim().split(/\s+/).map(r=>Vf(r,t)).join(" "),Vf=(e,t)=>{let r=t.loose?pe[fe.TILDELOOSE]:pe[fe.TILDE];return e.replace(r,(n,o,i,a,c)=>{let f;return Z("tilde",e,n,o,i,a,c),ve(o)?f="":ve(i)?f=`>=${o}.0.0 <${+o+1}.0.0-0`:ve(a)?f=`>=${o}.${i}.0 <${o}.${+i+1}.0-0`:c?(Z("replaceTilde pr",c),f=`>=${o}.${i}.${a}-${c} <${o}.${+i+1}.0-0`):f=`>=${o}.${i}.${a} <${o}.${+i+1}.0-0`,Z("tilde return",f),f})},zf=(e,t)=>e.trim().split(/\s+/).map(r=>Xf(r,t)).join(" "),Xf=(e,t)=>{Z("caret",e,t);let r=t.loose?pe[fe.CARETLOOSE]:pe[fe.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(o,i,a,c,f)=>{let l;return Z("caret",e,o,i,a,c,f),ve(i)?l="":ve(a)?l=`>=${i}.0.0${n} <${+i+1}.0.0-0`:ve(c)?l=i==="0"?`>=${i}.${a}.0${n} <${i}.${+a+1}.0-0`:`>=${i}.${a}.0${n} <${+i+1}.0.0-0`:f?(Z("replaceCaret pr",f),l=i==="0"?a==="0"?`>=${i}.${a}.${c}-${f} <${i}.${a}.${+c+1}-0`:`>=${i}.${a}.${c}-${f} <${i}.${+a+1}.0-0`:`>=${i}.${a}.${c}-${f} <${+i+1}.0.0-0`):(Z("no pr"),l=i==="0"?a==="0"?`>=${i}.${a}.${c}${n} <${i}.${a}.${+c+1}-0`:`>=${i}.${a}.${c}${n} <${i}.${+a+1}.0-0`:`>=${i}.${a}.${c} <${+i+1}.0.0-0`),Z("caret return",l),l})},Jf=(e,t)=>(Z("replaceXRanges",e,t),e.split(/\s+/).map(r=>Zf(r,t)).join(" ")),Zf=(e,t)=>{e=e.trim();let r=t.loose?pe[fe.XRANGELOOSE]:pe[fe.XRANGE];return e.replace(r,(n,o,i,a,c,f)=>{Z("xRange",e,n,o,i,a,c,f);let l=ve(i),p=l||ve(a),g=p||ve(c),y=g;return o==="="&&y&&(o=""),f=t.includePrerelease?"-0":"",l?n=o===">"||o==="<"?"<0.0.0-0":"*":o&&y?(p&&(a=0),c=0,o===">"?(o=">=",p?(i=+i+1,a=0,c=0):(a=+a+1,c=0)):o==="<="&&(o="<",p?i=+i+1:a=+a+1),o==="<"&&(f="-0"),n=`${o+i}.${a}.${c}${f}`):p?n=`>=${i}.0.0${f} <${+i+1}.0.0-0`:g&&(n=`>=${i}.${a}.0${f} <${i}.${+a+1}.0-0`),Z("xRange return",n),n})},Qf=(e,t)=>(Z("replaceStars",e,t),e.trim().replace(pe[fe.STAR],"")),ed=(e,t)=>(Z("replaceGTE0",e,t),e.trim().replace(pe[t.includePrerelease?fe.GTE0PRE:fe.GTE0],"")),td=e=>(t,r,n,o,i,a,c,f,l,p,g,y,S)=>`${r=ve(n)?"":ve(o)?`>=${n}.0.0${e?"-0":""}`:ve(i)?`>=${n}.${o}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${f=ve(l)?"":ve(p)?`<${+l+1}.0.0-0`:ve(g)?`<${l}.${+p+1}.0-0`:y?`<=${l}.${p}.${g}-${y}`:e?`<${l}.${p}.${+g+1}-0`:`<=${f}`}`.trim(),rd=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(Z(e[n].semver),e[n].semver!==Rr.ANY&&e[n].semver.prerelease.length>0){let o=e[n].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0},nd=(e,t,r)=>{try{t=new zt(t,r)}catch(n){return!1}return t.test(e)},{MAX_LENGTH:od}=Uo,{re:Es,t:bs}=Ar,id=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof le)return e;if(typeof e!="string"||e.length>od||!(t.loose?Es[bs.LOOSE]:Es[bs.FULL]).test(e))return null;try{return new le(e,t)}catch(r){return null}},ad=id,{re:gn,t:yn}=Ar,sd=(e,t)=>{if(e instanceof le)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let r=null;if((t=t||{}).rtl){let n;for(;(n=gn[yn.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),gn[yn.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;gn[yn.COERCERTL].lastIndex=-1}else r=e.match(gn[yn.COERCE]);return r===null?null:ad(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function ud(e){return String.fromCharCode(parseInt(e.slice(1),16))}function cd(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function ld(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,ud))}function fd(e){return decodeURIComponent(Array.from(atob(e),cd).join(""))}function Rs(e){return ld(JSON.stringify(e))}function dd(e){return JSON.parse(fd(e))}function wr(e){return typeof e=="undefined"}function pd(e){return e===null}function Os(e){return pd(e)||wr(e)}function md(e){return Os(e)?!1:!wr(e.jsonrpc)&&!wr(e.id)&&(!wr(e.result)||!wr(e.error))}function hd(e){return Os(e)?!1:typeof e=="number"&&Object.values(wt).includes(e)}function Sn(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var ee={};function Cs(e,t){return Object.assign(ee,t),e}var vd={"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"},et=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,et.prototype)}},Jt=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=hd(t)?t:wt.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,Jt.prototype)}},Et=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},Tn=class extends Error{constructor(e,t,r,n){super(`Magic Extension Error (${e.name}): [${t}] ${r}`),this.code=t,this.rawMessage=r,this.data=n,this.__proto__=Error,Object.setPrototypeOf(this,Tn.prototype)}},In=class{constructor(e,t,r){this.code=t,this.rawMessage=r,this.message=`Magic Extension Warning (${e.name}): [${t}] ${r}`}log(){console.warn(this.message)}};function gd(){return new et(Ke.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Bo(){return new et(Ke.ModalNotReady,"Modal is not ready.")}function yd(){return new et(Ke.MalformedResponse,"Response from the Magic iframe is malformed.")}function Ed(e){return new et(Ke.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 bd(e){let t=`Some extensions are incompatible with \`${ee.sdkName}@${ee.version}\`:`;return e.filter(r=>typeof r.compat!="undefined"&&r.compat!==null).forEach(r=>{let n=r.compat[ee.sdkName];typeof n=="string"?t+=`
|
8
|
-
- Extension \`${r.name}\` supports version(s) \`${n}\``:n||(t+=`
|
9
|
-
- Extension \`${r.name}\` does not support ${ee.platform} environments.`)}),new et(Ke.IncompatibleExtensions,t)}function _d(e){let t=r=>{let n=r+1,o=n%10,i=n%100;return o===1&&i!==11?`${n}st`:o===2&&i!==12?`${n}nd`:o===3&&i!==13?`${n}rd`:`${n}th`};return new et(Ke.InvalidArgument,`Invalid ${t(e.argument)} argument given to \`${e.procedure}\`.
|
1
|
+
"use strict";var Magic=(()=>{var ci=Object.create;var Ve=Object.defineProperty;var ui=Object.getOwnPropertyDescriptor;var fi=Object.getOwnPropertyNames,ur=Object.getOwnPropertySymbols,di=Object.getPrototypeOf,dr=Object.prototype.hasOwnProperty,hi=Object.prototype.propertyIsEnumerable;var fr=(e,t,r)=>t in e?Ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hr=(e,t)=>{for(var r in t||(t={}))dr.call(t,r)&&fr(e,r,t[r]);if(ur)for(var r of ur(t))hi.call(t,r)&&fr(e,r,t[r]);return e};var Ke=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var mr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),pr=(e,t)=>{for(var r in t)Ve(e,r,{get:t[r],enumerable:!0})},vr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of fi(t))!dr.call(e,a)&&a!==r&&Ve(e,a,{get:()=>t[a],enumerable:!(o=ui(t,a))||o.enumerable});return e};var gr=(e,t,r)=>(r=e!=null?ci(di(e)):{},vr(t||!e||!e.__esModule?Ve(r,"default",{value:e,enumerable:!0}):r,e)),mi=e=>vr(Ve({},"__esModule",{value:!0}),e);var Pe=(e,t,r)=>new Promise((o,a)=>{var s=g=>{try{h(r.next(g))}catch(v){a(v)}},m=g=>{try{h(r.throw(g))}catch(v){a(v)}},h=g=>g.done?o(g.value):Promise.resolve(g.value).then(s,m);h((r=r.apply(e,t)).next())});var dn=mr((fn,jt)=>{(function(e){if(typeof fn=="object"&&typeof jt<"u")jt.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,r;return function o(a,s,m){function h(y,T){if(!s[y]){if(!a[y]){var _=typeof Ke=="function"&&Ke;if(!T&&_)return _(y,!0);if(g)return g(y,!0);var N=new Error("Cannot find module '"+y+"'");throw N.code="MODULE_NOT_FOUND",N}var L=s[y]={exports:{}};a[y][0].call(L.exports,function(k){var C=a[y][1][k];return h(C||k)},L,L.exports,o,a,s,m)}return s[y].exports}for(var g=typeof Ke=="function"&&Ke,v=0;v<m.length;v++)h(m[v]);return h}({1:[function(o,a,s){(function(m){"use strict";var h=m.MutationObserver||m.WebKitMutationObserver,g;if(h){var v=0,y=new h(k),T=m.document.createTextNode("");y.observe(T,{characterData:!0}),g=function(){T.data=v=++v%2}}else if(!m.setImmediate&&typeof m.MessageChannel<"u"){var _=new m.MessageChannel;_.port1.onmessage=k,g=function(){_.port2.postMessage(0)}}else"document"in m&&"onreadystatechange"in m.document.createElement("script")?g=function(){var B=m.document.createElement("script");B.onreadystatechange=function(){k(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null},m.document.documentElement.appendChild(B)}:g=function(){setTimeout(k,0)};var N,L=[];function k(){N=!0;for(var B,Q,D=L.length;D;){for(Q=L,L=[],B=-1;++B<D;)Q[B]();D=L.length}N=!1}a.exports=C;function C(B){L.push(B)===1&&!N&&g()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(o,a,s){"use strict";var m=o(1);function h(){}var g={},v=["REJECTED"],y=["FULFILLED"],T=["PENDING"];a.exports=_;function _(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=T,this.queue=[],this.outcome=void 0,S!==h&&C(this,S)}_.prototype.catch=function(S){return this.then(null,S)},_.prototype.then=function(S,G){if(typeof S!="function"&&this.state===y||typeof G!="function"&&this.state===v)return this;var U=new this.constructor(h);if(this.state!==T){var K=this.state===y?S:G;L(U,K,this.outcome)}else this.queue.push(new N(U,S,G));return U};function N(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)}N.prototype.callFulfilled=function(S){g.resolve(this.promise,S)},N.prototype.otherCallFulfilled=function(S){L(this.promise,this.onFulfilled,S)},N.prototype.callRejected=function(S){g.reject(this.promise,S)},N.prototype.otherCallRejected=function(S){L(this.promise,this.onRejected,S)};function L(S,G,U){m(function(){var K;try{K=G(U)}catch(Z){return g.reject(S,Z)}K===S?g.reject(S,new TypeError("Cannot resolve promise with itself")):g.resolve(S,K)})}g.resolve=function(S,G){var U=B(k,G);if(U.status==="error")return g.reject(S,U.value);var K=U.value;if(K)C(S,K);else{S.state=y,S.outcome=G;for(var Z=-1,oe=S.queue.length;++Z<oe;)S.queue[Z].callFulfilled(G)}return S},g.reject=function(S,G){S.state=v,S.outcome=G;for(var U=-1,K=S.queue.length;++U<K;)S.queue[U].callRejected(G);return S};function k(S){var G=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof G=="function")return function(){G.apply(S,arguments)}}function C(S,G){var U=!1;function K(ce){U||(U=!0,g.reject(S,ce))}function Z(ce){U||(U=!0,g.resolve(S,ce))}function oe(){G(Z,K)}var le=B(oe);le.status==="error"&&K(le.value)}function B(S,G){var U={};try{U.value=S(G),U.status="success"}catch(K){U.status="error",U.value=K}return U}_.resolve=Q;function Q(S){return S instanceof this?S:g.resolve(new this(h),S)}_.reject=D;function D(S){var G=new this(h);return g.reject(G,S)}_.all=_e;function _e(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,K=!1;if(!U)return this.resolve([]);for(var Z=new Array(U),oe=0,le=-1,ce=new this(h);++le<U;)de(S[le],le);return ce;function de(Re,d){G.resolve(Re).then(I,function(A){K||(K=!0,g.reject(ce,A))});function I(A){Z[d]=A,++oe===U&&!K&&(K=!0,g.resolve(ce,Z))}}}_.race=ie;function ie(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,K=!1;if(!U)return this.resolve([]);for(var Z=-1,oe=new this(h);++Z<U;)le(S[Z]);return oe;function le(ce){G.resolve(ce).then(function(de){K||(K=!0,g.resolve(oe,de))},function(de){K||(K=!0,g.reject(oe,de))})}}},{1:1}],3:[function(o,a,s){(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,a,s){"use strict";var m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function h(n,l){if(!(n instanceof l))throw new TypeError("Cannot call a class as a function")}function g(){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=g();function y(){try{if(!v||!v.open)return!1;var n=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),l=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!n||l)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function T(n,l){n=n||[],l=l||{};try{return new Blob(n,l)}catch(c){if(c.name!=="TypeError")throw c;for(var i=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,u=new i,f=0;f<n.length;f+=1)u.append(n[f]);return u.getBlob(l.type)}}typeof Promise>"u"&&o(3);var _=Promise;function N(n,l){l&&n.then(function(i){l(null,i)},function(i){l(i)})}function L(n,l,i){typeof l=="function"&&n.then(l),typeof i=="function"&&n.catch(i)}function k(n){return typeof n!="string"&&(console.warn(n+" used as a key, but it is not a string."),n=String(n)),n}function C(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var B="local-forage-detect-blob-support",Q=void 0,D={},_e=Object.prototype.toString,ie="readonly",S="readwrite";function G(n){for(var l=n.length,i=new ArrayBuffer(l),u=new Uint8Array(i),f=0;f<l;f++)u[f]=n.charCodeAt(f);return i}function U(n){return new _(function(l){var i=n.transaction(B,S),u=T([""]);i.objectStore(B).put(u,"key"),i.onabort=function(f){f.preventDefault(),f.stopPropagation(),l(!1)},i.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),c=navigator.userAgent.match(/Edge\//);l(c||!f||parseInt(f[1],10)>=43)}}).catch(function(){return!1})}function K(n){return typeof Q=="boolean"?_.resolve(Q):U(n).then(function(l){return Q=l,Q})}function Z(n){var l=D[n.name],i={};i.promise=new _(function(u,f){i.resolve=u,i.reject=f}),l.deferredOperations.push(i),l.dbReady?l.dbReady=l.dbReady.then(function(){return i.promise}):l.dbReady=i.promise}function oe(n){var l=D[n.name],i=l.deferredOperations.pop();if(i)return i.resolve(),i.promise}function le(n,l){var i=D[n.name],u=i.deferredOperations.pop();if(u)return u.reject(l),u.promise}function ce(n,l){return new _(function(i,u){if(D[n.name]=D[n.name]||ee(),n.db)if(l)Z(n),n.db.close();else return i(n.db);var f=[n.name];l&&f.push(n.version);var c=v.open.apply(v,f);l&&(c.onupgradeneeded=function(p){var E=c.result;try{E.createObjectStore(n.storeName),p.oldVersion<=1&&E.createObjectStore(B)}catch(w){if(w.name==="ConstraintError")console.warn('The database "'+n.name+'" has been upgraded from version '+p.oldVersion+" to version "+p.newVersion+', but the storage "'+n.storeName+'" already exists.');else throw w}}),c.onerror=function(p){p.preventDefault(),u(c.error)},c.onsuccess=function(){var p=c.result;p.onversionchange=function(E){E.target.close()},i(p),oe(n)}})}function de(n){return ce(n,!1)}function Re(n){return ce(n,!0)}function d(n,l){if(!n.db)return!0;var i=!n.db.objectStoreNames.contains(n.storeName),u=n.version<n.db.version,f=n.version>n.db.version;if(u&&(n.version!==l&&console.warn('The database "'+n.name+`" can't be downgraded from version `+n.db.version+" to version "+n.version+"."),n.version=n.db.version),f||i){if(i){var c=n.db.version+1;c>n.version&&(n.version=c)}return!0}return!1}function I(n){return new _(function(l,i){var u=new FileReader;u.onerror=i,u.onloadend=function(f){var c=btoa(f.target.result||"");l({__local_forage_encoded_blob:!0,data:c,type:n.type})},u.readAsBinaryString(n)})}function A(n){var l=G(atob(n.data));return T([l],{type:n.type})}function P(n){return n&&n.__local_forage_encoded_blob}function $(n){var l=this,i=l._initReady().then(function(){var u=D[l._dbInfo.name];if(u&&u.dbReady)return u.dbReady});return L(i,n,n),i}function x(n){Z(n);for(var l=D[n.name],i=l.forages,u=0;u<i.length;u++){var f=i[u];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null)}return n.db=null,de(n).then(function(c){return n.db=c,d(n)?Re(n):c}).then(function(c){n.db=l.db=c;for(var p=0;p<i.length;p++)i[p]._dbInfo.db=c}).catch(function(c){throw le(n,c),c})}function j(n,l,i,u){u===void 0&&(u=1);try{var f=n.db.transaction(n.storeName,l);i(null,f)}catch(c){if(u>0&&(!n.db||c.name==="InvalidStateError"||c.name==="NotFoundError"))return _.resolve().then(function(){if(!n.db||c.name==="NotFoundError"&&!n.db.objectStoreNames.contains(n.storeName)&&n.version<=n.db.version)return n.db&&(n.version=n.db.version+1),Re(n)}).then(function(){return x(n).then(function(){j(n,l,i,u-1)})}).catch(i);i(c)}}function ee(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Le(n){var l=this,i={db:null};if(n)for(var u in n)i[u]=n[u];var f=D[i.name];f||(f=ee(),D[i.name]=f),f.forages.push(l),l._initReady||(l._initReady=l.ready,l.ready=$);var c=[];function p(){return _.resolve()}for(var E=0;E<f.forages.length;E++){var w=f.forages[E];w!==l&&c.push(w._initReady().catch(p))}var b=f.forages.slice(0);return _.all(c).then(function(){return i.db=f.db,de(i)}).then(function(R){return i.db=R,d(i,l._defaultConfig.version)?Re(i):R}).then(function(R){i.db=f.db=R,l._dbInfo=i;for(var O=0;O<b.length;O++){var F=b[O];F!==l&&(F._dbInfo.db=i.db,F._dbInfo.version=i.version)}})}function Ae(n,l){var i=this;n=k(n);var u=new _(function(f,c){i.ready().then(function(){j(i._dbInfo,ie,function(p,E){if(p)return c(p);try{var w=E.objectStore(i._dbInfo.storeName),b=w.get(n);b.onsuccess=function(){var R=b.result;R===void 0&&(R=null),P(R)&&(R=A(R)),f(R)},b.onerror=function(){c(b.error)}}catch(R){c(R)}})}).catch(c)});return N(u,l),u}function Be(n,l){var i=this,u=new _(function(f,c){i.ready().then(function(){j(i._dbInfo,ie,function(p,E){if(p)return c(p);try{var w=E.objectStore(i._dbInfo.storeName),b=w.openCursor(),R=1;b.onsuccess=function(){var O=b.result;if(O){var F=O.value;P(F)&&(F=A(F));var V=n(F,O.key,R++);V!==void 0?f(V):O.continue()}else f()},b.onerror=function(){c(b.error)}}catch(O){c(O)}})}).catch(c)});return N(u,l),u}function pn(n,l,i){var u=this;n=k(n);var f=new _(function(c,p){var E;u.ready().then(function(){return E=u._dbInfo,_e.call(l)==="[object Blob]"?K(E.db).then(function(w){return w?l:I(l)}):l}).then(function(w){j(u._dbInfo,S,function(b,R){if(b)return p(b);try{var O=R.objectStore(u._dbInfo.storeName);w===null&&(w=void 0);var F=O.put(w,n);R.oncomplete=function(){w===void 0&&(w=null),c(w)},R.onabort=R.onerror=function(){var V=F.error?F.error:F.transaction.error;p(V)}}catch(V){p(V)}})}).catch(p)});return N(f,i),f}function vn(n,l){var i=this;n=k(n);var u=new _(function(f,c){i.ready().then(function(){j(i._dbInfo,S,function(p,E){if(p)return c(p);try{var w=E.objectStore(i._dbInfo.storeName),b=w.delete(n);E.oncomplete=function(){f()},E.onerror=function(){c(b.error)},E.onabort=function(){var R=b.error?b.error:b.transaction.error;c(R)}}catch(R){c(R)}})}).catch(c)});return N(u,l),u}function gn(n){var l=this,i=new _(function(u,f){l.ready().then(function(){j(l._dbInfo,S,function(c,p){if(c)return f(c);try{var E=p.objectStore(l._dbInfo.storeName),w=E.clear();p.oncomplete=function(){u()},p.onabort=p.onerror=function(){var b=w.error?w.error:w.transaction.error;f(b)}}catch(b){f(b)}})}).catch(f)});return N(i,n),i}function yn(n){var l=this,i=new _(function(u,f){l.ready().then(function(){j(l._dbInfo,ie,function(c,p){if(c)return f(c);try{var E=p.objectStore(l._dbInfo.storeName),w=E.count();w.onsuccess=function(){u(w.result)},w.onerror=function(){f(w.error)}}catch(b){f(b)}})}).catch(f)});return N(i,n),i}function En(n,l){var i=this,u=new _(function(f,c){if(n<0){f(null);return}i.ready().then(function(){j(i._dbInfo,ie,function(p,E){if(p)return c(p);try{var w=E.objectStore(i._dbInfo.storeName),b=!1,R=w.openKeyCursor();R.onsuccess=function(){var O=R.result;if(!O){f(null);return}n===0||b?f(O.key):(b=!0,O.advance(n))},R.onerror=function(){c(R.error)}}catch(O){c(O)}})}).catch(c)});return N(u,l),u}function _n(n){var l=this,i=new _(function(u,f){l.ready().then(function(){j(l._dbInfo,ie,function(c,p){if(c)return f(c);try{var E=p.objectStore(l._dbInfo.storeName),w=E.openKeyCursor(),b=[];w.onsuccess=function(){var R=w.result;if(!R){u(b);return}b.push(R.key),R.continue()},w.onerror=function(){f(w.error)}}catch(R){f(R)}})}).catch(f)});return N(i,n),i}function In(n,l){l=C.apply(this,arguments);var i=this.config();n=typeof n!="function"&&n||{},n.name||(n.name=n.name||i.name,n.storeName=n.storeName||i.storeName);var u=this,f;if(!n.name)f=_.reject("Invalid arguments");else{var c=n.name===i.name&&u._dbInfo.db,p=c?_.resolve(u._dbInfo.db):de(n).then(function(E){var w=D[n.name],b=w.forages;w.db=E;for(var R=0;R<b.length;R++)b[R]._dbInfo.db=E;return E});n.storeName?f=p.then(function(E){if(!!E.objectStoreNames.contains(n.storeName)){var w=E.version+1;Z(n);var b=D[n.name],R=b.forages;E.close();for(var O=0;O<R.length;O++){var F=R[O];F._dbInfo.db=null,F._dbInfo.version=w}var V=new _(function(q,J){var z=v.open(n.name,w);z.onerror=function(fe){var je=z.result;je.close(),J(fe)},z.onupgradeneeded=function(){var fe=z.result;fe.deleteObjectStore(n.storeName)},z.onsuccess=function(){var fe=z.result;fe.close(),q(fe)}});return V.then(function(q){b.db=q;for(var J=0;J<R.length;J++){var z=R[J];z._dbInfo.db=q,oe(z._dbInfo)}}).catch(function(q){throw(le(n,q)||_.resolve()).catch(function(){}),q})}}):f=p.then(function(E){Z(n);var w=D[n.name],b=w.forages;E.close();for(var R=0;R<b.length;R++){var O=b[R];O._dbInfo.db=null}var F=new _(function(V,q){var J=v.deleteDatabase(n.name);J.onerror=function(){var z=J.result;z&&z.close(),q(J.error)},J.onblocked=function(){console.warn('dropInstance blocked for database "'+n.name+'" until all open connections are closed')},J.onsuccess=function(){var z=J.result;z&&z.close(),V(z)}});return F.then(function(V){w.db=V;for(var q=0;q<b.length;q++){var J=b[q];oe(J._dbInfo)}}).catch(function(V){throw(le(n,V)||_.resolve()).catch(function(){}),V})})}return N(f,l),f}var wn={_driver:"asyncStorage",_initStorage:Le,_support:y(),iterate:Be,getItem:Ae,setItem:pn,removeItem:vn,clear:gn,length:yn,key:En,keys:_n,dropInstance:In};function bn(){return typeof openDatabase=="function"}var Ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Rn="~~local_forage_type~",Kt=/^~~local_forage_type~([^~]+)~/,rt="__lfsc__:",Et=rt.length,_t="arbf",It="blob",qt="si08",Ht="ui08",Yt="uic8",Xt="si16",zt="si32",Jt="ur16",Qt="ui32",Zt="fl32",er="fl64",tr=Et+_t.length,rr=Object.prototype.toString;function nr(n){var l=n.length*.75,i=n.length,u,f=0,c,p,E,w;n[n.length-1]==="="&&(l--,n[n.length-2]==="="&&l--);var b=new ArrayBuffer(l),R=new Uint8Array(b);for(u=0;u<i;u+=4)c=Ie.indexOf(n[u]),p=Ie.indexOf(n[u+1]),E=Ie.indexOf(n[u+2]),w=Ie.indexOf(n[u+3]),R[f++]=c<<2|p>>4,R[f++]=(p&15)<<4|E>>2,R[f++]=(E&3)<<6|w&63;return b}function wt(n){var l=new Uint8Array(n),i="",u;for(u=0;u<l.length;u+=3)i+=Ie[l[u]>>2],i+=Ie[(l[u]&3)<<4|l[u+1]>>4],i+=Ie[(l[u+1]&15)<<2|l[u+2]>>6],i+=Ie[l[u+2]&63];return l.length%3===2?i=i.substring(0,i.length-1)+"=":l.length%3===1&&(i=i.substring(0,i.length-2)+"=="),i}function An(n,l){var i="";if(n&&(i=rr.call(n)),n&&(i==="[object ArrayBuffer]"||n.buffer&&rr.call(n.buffer)==="[object ArrayBuffer]")){var u,f=rt;n instanceof ArrayBuffer?(u=n,f+=_t):(u=n.buffer,i==="[object Int8Array]"?f+=qt:i==="[object Uint8Array]"?f+=Ht:i==="[object Uint8ClampedArray]"?f+=Yt:i==="[object Int16Array]"?f+=Xt:i==="[object Uint16Array]"?f+=Jt:i==="[object Int32Array]"?f+=zt:i==="[object Uint32Array]"?f+=Qt:i==="[object Float32Array]"?f+=Zt:i==="[object Float64Array]"?f+=er:l(new Error("Failed to get type for BinaryArray"))),l(f+wt(u))}else if(i==="[object Blob]"){var c=new FileReader;c.onload=function(){var p=Rn+n.type+"~"+wt(this.result);l(rt+It+p)},c.readAsArrayBuffer(n)}else try{l(JSON.stringify(n))}catch(p){console.error("Couldn't convert value into a JSON string: ",n),l(null,p)}}function Sn(n){if(n.substring(0,Et)!==rt)return JSON.parse(n);var l=n.substring(tr),i=n.substring(Et,tr),u;if(i===It&&Kt.test(l)){var f=l.match(Kt);u=f[1],l=l.substring(f[0].length)}var c=nr(l);switch(i){case _t:return c;case It:return T([c],{type:u});case qt:return new Int8Array(c);case Ht:return new Uint8Array(c);case Yt:return new Uint8ClampedArray(c);case Xt:return new Int16Array(c);case Jt:return new Uint16Array(c);case zt:return new Int32Array(c);case Qt:return new Uint32Array(c);case Zt:return new Float32Array(c);case er:return new Float64Array(c);default:throw new Error("Unkown type: "+i)}}var bt={serialize:An,deserialize:Sn,stringToBuffer:nr,bufferToString:wt};function ir(n,l,i,u){n.executeSql("CREATE TABLE IF NOT EXISTS "+l.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],i,u)}function Nn(n){var l=this,i={db:null};if(n)for(var u in n)i[u]=typeof n[u]!="string"?n[u].toString():n[u];var f=new _(function(c,p){try{i.db=openDatabase(i.name,String(i.version),i.description,i.size)}catch(E){return p(E)}i.db.transaction(function(E){ir(E,i,function(){l._dbInfo=i,c()},function(w,b){p(b)})},p)});return i.serializer=bt,f}function we(n,l,i,u,f,c){n.executeSql(i,u,f,function(p,E){E.code===E.SYNTAX_ERR?p.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[l.storeName],function(w,b){b.rows.length?c(w,E):ir(w,l,function(){w.executeSql(i,u,f,c)},c)},c):c(p,E)},c)}function Tn(n,l){var i=this;n=k(n);var u=new _(function(f,c){i.ready().then(function(){var p=i._dbInfo;p.db.transaction(function(E){we(E,p,"SELECT * FROM "+p.storeName+" WHERE key = ? LIMIT 1",[n],function(w,b){var R=b.rows.length?b.rows.item(0).value:null;R&&(R=p.serializer.deserialize(R)),f(R)},function(w,b){c(b)})})}).catch(c)});return N(u,l),u}function On(n,l){var i=this,u=new _(function(f,c){i.ready().then(function(){var p=i._dbInfo;p.db.transaction(function(E){we(E,p,"SELECT * FROM "+p.storeName,[],function(w,b){for(var R=b.rows,O=R.length,F=0;F<O;F++){var V=R.item(F),q=V.value;if(q&&(q=p.serializer.deserialize(q)),q=n(q,V.key,F+1),q!==void 0){f(q);return}}f()},function(w,b){c(b)})})}).catch(c)});return N(u,l),u}function or(n,l,i,u){var f=this;n=k(n);var c=new _(function(p,E){f.ready().then(function(){l===void 0&&(l=null);var w=l,b=f._dbInfo;b.serializer.serialize(l,function(R,O){O?E(O):b.db.transaction(function(F){we(F,b,"INSERT OR REPLACE INTO "+b.storeName+" (key, value) VALUES (?, ?)",[n,R],function(){p(w)},function(V,q){E(q)})},function(F){if(F.code===F.QUOTA_ERR){if(u>0){p(or.apply(f,[n,w,i,u-1]));return}E(F)}})})}).catch(E)});return N(c,i),c}function Mn(n,l,i){return or.apply(this,[n,l,i,1])}function Ln(n,l){var i=this;n=k(n);var u=new _(function(f,c){i.ready().then(function(){var p=i._dbInfo;p.db.transaction(function(E){we(E,p,"DELETE FROM "+p.storeName+" WHERE key = ?",[n],function(){f()},function(w,b){c(b)})})}).catch(c)});return N(u,l),u}function Cn(n){var l=this,i=new _(function(u,f){l.ready().then(function(){var c=l._dbInfo;c.db.transaction(function(p){we(p,c,"DELETE FROM "+c.storeName,[],function(){u()},function(E,w){f(w)})})}).catch(f)});return N(i,n),i}function Pn(n){var l=this,i=new _(function(u,f){l.ready().then(function(){var c=l._dbInfo;c.db.transaction(function(p){we(p,c,"SELECT COUNT(key) as c FROM "+c.storeName,[],function(E,w){var b=w.rows.item(0).c;u(b)},function(E,w){f(w)})})}).catch(f)});return N(i,n),i}function $n(n,l){var i=this,u=new _(function(f,c){i.ready().then(function(){var p=i._dbInfo;p.db.transaction(function(E){we(E,p,"SELECT key FROM "+p.storeName+" WHERE id = ? LIMIT 1",[n+1],function(w,b){var R=b.rows.length?b.rows.item(0).key:null;f(R)},function(w,b){c(b)})})}).catch(c)});return N(u,l),u}function Dn(n){var l=this,i=new _(function(u,f){l.ready().then(function(){var c=l._dbInfo;c.db.transaction(function(p){we(p,c,"SELECT key FROM "+c.storeName,[],function(E,w){for(var b=[],R=0;R<w.rows.length;R++)b.push(w.rows.item(R).key);u(b)},function(E,w){f(w)})})}).catch(f)});return N(i,n),i}function xn(n){return new _(function(l,i){n.transaction(function(u){u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,c){for(var p=[],E=0;E<c.rows.length;E++)p.push(c.rows.item(E).name);l({db:n,storeNames:p})},function(f,c){i(c)})},function(u){i(u)})})}function Un(n,l){l=C.apply(this,arguments);var i=this.config();n=typeof n!="function"&&n||{},n.name||(n.name=n.name||i.name,n.storeName=n.storeName||i.storeName);var u=this,f;return n.name?f=new _(function(c){var p;n.name===i.name?p=u._dbInfo.db:p=openDatabase(n.name,"","",0),n.storeName?c({db:p,storeNames:[n.storeName]}):c(xn(p))}).then(function(c){return new _(function(p,E){c.db.transaction(function(w){function b(V){return new _(function(q,J){w.executeSql("DROP TABLE IF EXISTS "+V,[],function(){q()},function(z,fe){J(fe)})})}for(var R=[],O=0,F=c.storeNames.length;O<F;O++)R.push(b(c.storeNames[O]));_.all(R).then(function(){p()}).catch(function(V){E(V)})},function(w){E(w)})})}):f=_.reject("Invalid arguments"),N(f,l),f}var kn={_driver:"webSQLStorage",_initStorage:Nn,_support:bn(),iterate:On,getItem:Tn,setItem:Mn,removeItem:Ln,clear:Cn,length:Pn,key:$n,keys:Dn,dropInstance:Un};function Fn(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ar(n,l){var i=n.name+"/";return n.storeName!==l.storeName&&(i+=n.storeName+"/"),i}function Wn(){var n="_localforage_support_test";try{return localStorage.setItem(n,!0),localStorage.removeItem(n),!1}catch{return!0}}function Bn(){return!Wn()||localStorage.length>0}function Gn(n){var l=this,i={};if(n)for(var u in n)i[u]=n[u];return i.keyPrefix=ar(n,l._defaultConfig),Bn()?(l._dbInfo=i,i.serializer=bt,_.resolve()):_.reject()}function jn(n){var l=this,i=l.ready().then(function(){for(var u=l._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var c=localStorage.key(f);c.indexOf(u)===0&&localStorage.removeItem(c)}});return N(i,n),i}function Vn(n,l){var i=this;n=k(n);var u=i.ready().then(function(){var f=i._dbInfo,c=localStorage.getItem(f.keyPrefix+n);return c&&(c=f.serializer.deserialize(c)),c});return N(u,l),u}function Kn(n,l){var i=this,u=i.ready().then(function(){for(var f=i._dbInfo,c=f.keyPrefix,p=c.length,E=localStorage.length,w=1,b=0;b<E;b++){var R=localStorage.key(b);if(R.indexOf(c)===0){var O=localStorage.getItem(R);if(O&&(O=f.serializer.deserialize(O)),O=n(O,R.substring(p),w++),O!==void 0)return O}}});return N(u,l),u}function qn(n,l){var i=this,u=i.ready().then(function(){var f=i._dbInfo,c;try{c=localStorage.key(n)}catch{c=null}return c&&(c=c.substring(f.keyPrefix.length)),c});return N(u,l),u}function Hn(n){var l=this,i=l.ready().then(function(){for(var u=l._dbInfo,f=localStorage.length,c=[],p=0;p<f;p++){var E=localStorage.key(p);E.indexOf(u.keyPrefix)===0&&c.push(E.substring(u.keyPrefix.length))}return c});return N(i,n),i}function Yn(n){var l=this,i=l.keys().then(function(u){return u.length});return N(i,n),i}function Xn(n,l){var i=this;n=k(n);var u=i.ready().then(function(){var f=i._dbInfo;localStorage.removeItem(f.keyPrefix+n)});return N(u,l),u}function zn(n,l,i){var u=this;n=k(n);var f=u.ready().then(function(){l===void 0&&(l=null);var c=l;return new _(function(p,E){var w=u._dbInfo;w.serializer.serialize(l,function(b,R){if(R)E(R);else try{localStorage.setItem(w.keyPrefix+n,b),p(c)}catch(O){(O.name==="QuotaExceededError"||O.name==="NS_ERROR_DOM_QUOTA_REACHED")&&E(O),E(O)}})})});return N(f,i),f}function Jn(n,l){if(l=C.apply(this,arguments),n=typeof n!="function"&&n||{},!n.name){var i=this.config();n.name=n.name||i.name,n.storeName=n.storeName||i.storeName}var u=this,f;return n.name?f=new _(function(c){n.storeName?c(ar(n,u._defaultConfig)):c(n.name+"/")}).then(function(c){for(var p=localStorage.length-1;p>=0;p--){var E=localStorage.key(p);E.indexOf(c)===0&&localStorage.removeItem(E)}}):f=_.reject("Invalid arguments"),N(f,l),f}var Qn={_driver:"localStorageWrapper",_initStorage:Gn,_support:Fn(),iterate:Kn,getItem:Vn,setItem:zn,removeItem:Xn,clear:jn,length:Yn,key:qn,keys:Hn,dropInstance:Jn},Zn=function(l,i){return l===i||typeof l=="number"&&typeof i=="number"&&isNaN(l)&&isNaN(i)},ei=function(l,i){for(var u=l.length,f=0;f<u;){if(Zn(l[f],i))return!0;f++}return!1},sr=Array.isArray||function(n){return Object.prototype.toString.call(n)==="[object Array]"},Ge={},lr={},Ce={INDEXEDDB:wn,WEBSQL:kn,LOCALSTORAGE:Qn},ti=[Ce.INDEXEDDB._driver,Ce.WEBSQL._driver,Ce.LOCALSTORAGE._driver],nt=["dropInstance"],Rt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(nt),ri={description:"",driver:ti.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ni(n,l){n[l]=function(){var i=arguments;return n.ready().then(function(){return n[l].apply(n,i)})}}function At(){for(var n=1;n<arguments.length;n++){var l=arguments[n];if(l)for(var i in l)l.hasOwnProperty(i)&&(sr(l[i])?arguments[0][i]=l[i].slice():arguments[0][i]=l[i])}return arguments[0]}var ii=function(){function n(l){h(this,n);for(var i in Ce)if(Ce.hasOwnProperty(i)){var u=Ce[i],f=u._driver;this[i]=f,Ge[f]||this.defineDriver(u)}this._defaultConfig=At({},ri),this._config=At({},this._defaultConfig,l),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return n.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 u in i){if(u==="storeName"&&(i[u]=i[u].replace(/\W/g,"_")),u==="version"&&typeof i[u]!="number")return new Error("Database version must be a number.");this._config[u]=i[u]}return"driver"in i&&i.driver?this.setDriver(this._config.driver):!0}else return typeof i=="string"?this._config[i]:this._config},n.prototype.defineDriver=function(i,u,f){var c=new _(function(p,E){try{var w=i._driver,b=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!i._driver){E(b);return}for(var R=Rt.concat("_initStorage"),O=0,F=R.length;O<F;O++){var V=R[O],q=!ei(nt,V);if((q||i[V])&&typeof i[V]!="function"){E(b);return}}var J=function(){for(var je=function(si){return function(){var li=new Error("Method "+si+" is not implemented by the current driver"),cr=_.reject(li);return N(cr,arguments[arguments.length-1]),cr}},St=0,ai=nt.length;St<ai;St++){var Nt=nt[St];i[Nt]||(i[Nt]=je(Nt))}};J();var z=function(je){Ge[w]&&console.info("Redefining LocalForage driver: "+w),Ge[w]=i,lr[w]=je,p()};"_support"in i?i._support&&typeof i._support=="function"?i._support().then(z,E):z(!!i._support):z(!0)}catch(fe){E(fe)}});return L(c,u,f),c},n.prototype.driver=function(){return this._driver||null},n.prototype.getDriver=function(i,u,f){var c=Ge[i]?_.resolve(Ge[i]):_.reject(new Error("Driver not found."));return L(c,u,f),c},n.prototype.getSerializer=function(i){var u=_.resolve(bt);return L(u,i),u},n.prototype.ready=function(i){var u=this,f=u._driverSet.then(function(){return u._ready===null&&(u._ready=u._initDriver()),u._ready});return L(f,i,i),f},n.prototype.setDriver=function(i,u,f){var c=this;sr(i)||(i=[i]);var p=this._getSupportedDrivers(i);function E(){c._config.driver=c.driver()}function w(O){return c._extend(O),E(),c._ready=c._initStorage(c._config),c._ready}function b(O){return function(){var F=0;function V(){for(;F<O.length;){var q=O[F];return F++,c._dbInfo=null,c._ready=null,c.getDriver(q).then(w).catch(V)}E();var J=new Error("No available storage method found.");return c._driverSet=_.reject(J),c._driverSet}return V()}}var R=this._driverSet!==null?this._driverSet.catch(function(){return _.resolve()}):_.resolve();return this._driverSet=R.then(function(){var O=p[0];return c._dbInfo=null,c._ready=null,c.getDriver(O).then(function(F){c._driver=F._driver,E(),c._wrapLibraryMethodsWithReady(),c._initDriver=b(p)})}).catch(function(){E();var O=new Error("No available storage method found.");return c._driverSet=_.reject(O),c._driverSet}),L(this._driverSet,u,f),this._driverSet},n.prototype.supports=function(i){return!!lr[i]},n.prototype._extend=function(i){At(this,i)},n.prototype._getSupportedDrivers=function(i){for(var u=[],f=0,c=i.length;f<c;f++){var p=i[f];this.supports(p)&&u.push(p)}return u},n.prototype._wrapLibraryMethodsWithReady=function(){for(var i=0,u=Rt.length;i<u;i++)ni(this,Rt[i])},n.prototype.createInstance=function(i){return new n(i)},n}(),oi=new ii;a.exports=oi},{3:3}]},{},[4])(4)})});var mn=mr((vt,hn)=>{(function(e,t){typeof vt=="object"&&typeof hn<"u"?t(vt):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],t):t(e.LocalforageDriverMemory={})})(typeof self<"u"?self:vt,function(e){"use strict";var t="localforage-driver-memory";function r(d){var I=typeof Symbol=="function"&&d[Symbol.iterator],A=0;return I?I.call(d):{next:function(){return d&&A>=d.length&&(d=void 0),{value:d&&d[A++],done:!d}}}}function o(d,I){d=d||[],I=I||{};try{return new Blob(d,I)}catch(x){if(x.name!=="TypeError")throw x;for(var A=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,P=new A,$=0;$<d.length;$+=1)P.append(d[$]);return P.getBlob(I.type)}}var a=/^~~local_forage_type~([^~]+)~/,s=9,m=s+4,h=Object.prototype.toString;function g(d){var I=d.length*.75,A=d.length;d[d.length-1]==="="&&(I--,d[d.length-2]==="="&&I--);for(var P=new ArrayBuffer(I),$=new Uint8Array(P),x=0,j=0;x<A;x+=4){var ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[x]),Le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[x+1]),Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[x+2]),Be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[x+3]);$[j++]=ee<<2|Le>>4,$[j++]=(Le&15)<<4|Ae>>2,$[j++]=(Ae&3)<<6|Be&63}return P}function v(d){for(var I=new Uint8Array(d),A="",P=0;P<I.length;P+=3)A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[I[P]>>2],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(I[P]&3)<<4|I[P+1]>>4],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(I[P+1]&15)<<2|I[P+2]>>6],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[I[P+2]&63];return I.length%3===2?A=A.substring(0,A.length-1)+"=":I.length%3===1&&(A=A.substring(0,A.length-2)+"=="),A}function y(d,I){var A="";if(d&&(A=h.call(d)),d&&(A==="[object ArrayBuffer]"||d.buffer&&h.call(d.buffer)==="[object ArrayBuffer]")){var P=void 0,$="__lfsc__:";d instanceof ArrayBuffer?(P=d,$+="arbf"):(P=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":I(new Error("Failed to get type for BinaryArray"))),I($+v(P))}else if(A==="[object Blob]"){var x=new FileReader;x.onload=function(){var j="~~local_forage_type~"+d.type+"~"+v(this.result);I("__lfsc__:blob"+j)},x.readAsArrayBuffer(d)}else try{I(JSON.stringify(d))}catch(j){console.error("Couldn't convert value into a JSON string: ",d),I(null,j)}}function T(d){if(d.substring(0,s)!=="__lfsc__:")return JSON.parse(d);var I=d.substring(m),A=d.substring(s,m),P;if(A==="blob"&&a.test(I)){var $=I.match(a);P=$[1],I=I.substring($[0].length)}var x=g(I);switch(A){case"arbf":return x;case"blob":return o([x],{type:P});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 _(d){var I,A;if(d===null||typeof d!="object"||"isActiveClone"in d)return d;var P=d instanceof Date?new Date(d):d.constructor();try{for(var $=r(Object.keys(d)),x=$.next();!x.done;x=$.next()){var j=x.value;Object.prototype.hasOwnProperty.call(d,j)&&(d.isActiveClone=null,P[j]=_(d[j]),delete d.isActiveClone)}}catch(ee){I={error:ee}}finally{try{x&&!x.done&&(A=$.return)&&A.call($)}finally{if(I)throw I.error}}return P}function N(d,I){return(d.name||I.name)+"/"+(d.storeName||I.storeName)+"/"}function L(d,I){I&&d.then(function(A){I(null,A)},function(A){I(A)})}function k(){for(var d=[],I=0;I<arguments.length;I++)d[I]=arguments[I];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function C(d,I){var A=this;if(I=k.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var P=this.config();d.name=d.name||P.name,d.storeName=d.storeName||P.storeName}var $;return d.name?$=new Promise(function(x){d.storeName?x(N(d,A._defaultConfig)):x(d.name+"/")}):$=Promise.reject("Invalid arguments"),{promise:$,callback:I}}function B(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}var Q={bufferToString:v,deserialize:T,serialize:y,stringToBuffer:g},D={},_e=function(){function d(I){this.kp=I,this.data={}}return d.resolve=function(I){return D[I]||(D[I]=new d(I)),D[I]},d.prototype.clear=function(){this.data={}},d.prototype.drop=function(){this.clear(),delete D[this.kp]},d.prototype.get=function(I){return this.data[I]},d.prototype.key=function(I){return this.keys()[I]},d.prototype.keys=function(){return Object.keys(this.data)},d.prototype.rm=function(I){delete this.data[I]},d.prototype.set=function(I,A){this.data[I]=A},d}();function ie(d){var I=d?_(d):{},A=N(I,this._defaultConfig),P=_e.resolve(A);return this._dbInfo=I,this._dbInfo.serializer=Q,this._dbInfo.keyPrefix=A,this._dbInfo.mStore=P,Promise.resolve()}function S(d){var I=this,A=this.ready().then(function(){I._dbInfo.mStore.clear()});return L(A,d),A}function G(d,I){var A=C.apply(this,arguments),P=A.promise,$=A.callback,x=P.then(function(j){_e.resolve(j).drop()});return L(x,$),P}function U(d,I){var A=this;d=B(d);var P=this.ready().then(function(){var $=A._dbInfo.mStore.get(d);return $==null?null:A._dbInfo.serializer.deserialize($)});return L(P,I),P}function K(d,I){var A=this,P=this.ready().then(function(){for(var $=A._dbInfo.mStore,x=$.keys(),j=0;j<x.length;j++){var ee=$.get(x[j]);if(ee&&(ee=A._dbInfo.serializer.deserialize(ee)),ee=d(ee,x[j],j+1),ee!==void 0)return ee}});return L(P,I),P}function Z(d,I){var A=this,P=this.ready().then(function(){var $;try{$=A._dbInfo.mStore.key(d),$===void 0&&($=null)}catch{$=null}return $});return L(P,I),P}function oe(d){var I=this,A=this.ready().then(function(){return I._dbInfo.mStore.keys()});return L(A,d),A}function le(d){var I=this.keys().then(function(A){return A.length});return L(I,d),I}function ce(d,I){var A=this;d=B(d);var P=this.ready().then(function(){A._dbInfo.mStore.rm(d)});return L(P,I),P}function de(d,I,A){var P=this;d=B(d);var $=this.ready().then(function(){I===void 0&&(I=null);var x=I;return new Promise(function(j,ee){P._dbInfo.serializer.serialize(I,function(Le,Ae){if(Ae)ee(Ae);else try{P._dbInfo.mStore.set(d,Le),j(x)}catch(Be){ee(Be)}})})});return L($,A),$}var Re=!0;e._support=Re,e._driver=t,e._initStorage=ie,e.clear=S,e.dropInstance=G,e.getItem=U,e.iterate=K,e.key=Z,e.keys=oe,e.length=le,e.removeItem=ce,e.setItem=de,Object.defineProperty(e,"__esModule",{value:!0})})});var va={};pr(va,{default:()=>pa});var pe=(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))(pe||{}),ve=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e.ProductAnnouncement="ANNOUNCEMENT",e))(ve||{}),$e=(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[e.RedirectLoginComplete=-10015]="RedirectLoginComplete",e))($e||{}),ue=(e=>(e.MetaMask="metamask",e.CoinbaseWallet="coinbase_wallet",e))(ue||{}),De=(e=>(e.WalletSelected="wallet_selected",e.WalletConnected="wallet_connected",e.WalletRejected="wallet_rejected",e))(De||{}),M=(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.NFTCheckout="magic_nft_checkout",e.NFTTransfer="magic_nft_transfer",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",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.EncryptV1="magic_auth_encrypt_v1",e.DecryptV1="magic_auth_decrypt_v1",e.ShowNFTs="magic_show_nfts",e.ShowOnRamp="magic_show_fiat_onramp",e.ShowSendTokensUI="magic_show_send_tokens_ui",e.ShowAddress="magic_show_address",e.ShowBalances="magic_show_balances",e.SendGaslessTransaction="eth_sendGaslessTransaction",e.RevealPK="magic_reveal_key",e))(M||{}),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.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",e))(he||{}),Se=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(Se||{}),yr=(e=>(e.UpdateEmail="update-email",e.MFA="mfa",e.Recovery="recovery",e))(yr||{}),Er=(e=>(e.Retry="retry",e))(Er||{}),_r=(e=>(e.EmailSent="email-sent",e.EmailNotDeliverable="email-not-deliverable",e))(_r||{}),Ne=(e=>(e.VerifyEmailOtp="verify-email-otp",e.Cancel="cancel",e))(Ne||{}),Ir=(e=>(e.EmailOTPSent="email-otp-sent",e.InvalidEmailOtp="invalid-email-otp",e.ExpiredEmailOtp="expired-email-otp",e))(Ir||{}),qe=(e=>(e.Retry="device-retry",e))(qe||{}),wr=(e=>(e.DeviceApproved="device-approved",e.DeviceNeedsApproval="device-needs-approval",e.DeviceVerificationLinkExpired="device-verification-link-expired",e.DeviceVerificationEmailSent="device-verification-email-sent",e))(wr||{}),ge=(e=>(e.Retry="Recency/auth-factor-retry",e.Cancel="Recency/auth-factor-verification-cancel",e.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",e))(ge||{}),br=(e=>(e.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",e.PrimaryAuthFactorVerified="Recency/auth-factor-verified",e.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",e.EmailExpired="Recency/auth-factor-verification-email-expired",e.EmailSent="Recency/auth-factor-verification-email-sent",e.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",e))(br||{}),ye=(e=>(e.RetryWithNewEmail="UpdateEmail/retry-with-new-email",e.Cancel="UpdateEmail/new-email-verification-cancel",e.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",e))(ye||{}),Rr=(e=>(e.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",e.EmailUpdated="UpdateEmail/email-updated",e.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",e.EmailExpired="UpdateEmail/new-email-verification-email-expired",e.EmailSent="UpdateEmail/new-email-verification-email-sent",e.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",e.InvalidEmail="UpdateEmail/new-email-invalid",e.EmailAlreadyExists="UpdateEmail/new-email-already-exists",e))(Rr||{}),Ar=(e=>(e.IDTokenCreated="Auth/id-token-created",e))(Ar||{}),Sr=(e=>(e.Harmony="HARMONY",e))(Sr||{}),Nr=(e=>(e.PhoneNumber="phone_number",e))(Nr||{}),Tr=(e=>(e.WalletInfoFetched="Wallet/wallet-info-fetched",e))(Tr||{});var pi=Object.create,ht=Object.defineProperty,vi=Object.defineProperties,gi=Object.getOwnPropertyDescriptor,yi=Object.getOwnPropertyDescriptors,Ei=Object.getOwnPropertyNames,Or=Object.getOwnPropertySymbols,_i=Object.getPrototypeOf,jr=Object.prototype.hasOwnProperty,Ii=Object.prototype.propertyIsEnumerable,Mr=(e,t,r)=>t in e?ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mt=(e,t)=>{for(var r in t||(t={}))jr.call(t,r)&&Mr(e,r,t[r]);if(Or)for(var r of Or(t))Ii.call(t,r)&&Mr(e,r,t[r]);return e},Lt=(e,t)=>vi(e,yi(t)),wi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bi=(e,t)=>{for(var r in t)ht(e,r,{get:t[r],enumerable:!0})},Ri=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ei(t))!jr.call(e,a)&&a!==r&&ht(e,a,{get:()=>t[a],enumerable:!(o=gi(t,a))||o.enumerable});return e},Ai=(e,t,r)=>(r=e!=null?pi(_i(e)):{},Ri(t||!e||!e.__esModule?ht(r,"default",{value:e,enumerable:!0}):r,e)),X=(e,t,r)=>new Promise((o,a)=>{var s=g=>{try{h(r.next(g))}catch(v){a(v)}},m=g=>{try{h(r.throw(g))}catch(v){a(v)}},h=g=>g.done?o(g.value):Promise.resolve(g.value).then(s,m);h((r=r.apply(e,t)).next())}),Si=wi((e,t)=>{"use strict";var r=Object.prototype.hasOwnProperty,o="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(o=!1));function s(v,y,T){this.fn=v,this.context=y,this.once=T||!1}function m(v,y,T,_,N){if(typeof T!="function")throw new TypeError("The listener must be a function");var L=new s(T,_||v,N),k=o?o+y:y;return v._events[k]?v._events[k].fn?v._events[k]=[v._events[k],L]:v._events[k].push(L):(v._events[k]=L,v._eventsCount++),v}function h(v,y){--v._eventsCount===0?v._events=new a:delete v._events[y]}function g(){this._events=new a,this._eventsCount=0}g.prototype.eventNames=function(){var v=[],y,T;if(this._eventsCount===0)return v;for(T in y=this._events)r.call(y,T)&&v.push(o?T.slice(1):T);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(y)):v},g.prototype.listeners=function(v){var y=o?o+v:v,T=this._events[y];if(!T)return[];if(T.fn)return[T.fn];for(var _=0,N=T.length,L=new Array(N);_<N;_++)L[_]=T[_].fn;return L},g.prototype.listenerCount=function(v){var y=o?o+v:v,T=this._events[y];return T?T.fn?1:T.length:0},g.prototype.emit=function(v,y,T,_,N,L){var k=o?o+v:v;if(!this._events[k])return!1;var C=this._events[k],B=arguments.length,Q,D;if(C.fn){switch(C.once&&this.removeListener(v,C.fn,void 0,!0),B){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,y),!0;case 3:return C.fn.call(C.context,y,T),!0;case 4:return C.fn.call(C.context,y,T,_),!0;case 5:return C.fn.call(C.context,y,T,_,N),!0;case 6:return C.fn.call(C.context,y,T,_,N,L),!0}for(D=1,Q=new Array(B-1);D<B;D++)Q[D-1]=arguments[D];C.fn.apply(C.context,Q)}else{var _e=C.length,ie;for(D=0;D<_e;D++)switch(C[D].once&&this.removeListener(v,C[D].fn,void 0,!0),B){case 1:C[D].fn.call(C[D].context);break;case 2:C[D].fn.call(C[D].context,y);break;case 3:C[D].fn.call(C[D].context,y,T);break;case 4:C[D].fn.call(C[D].context,y,T,_);break;default:if(!Q)for(ie=1,Q=new Array(B-1);ie<B;ie++)Q[ie-1]=arguments[ie];C[D].fn.apply(C[D].context,Q)}}return!0},g.prototype.on=function(v,y,T){return m(this,v,y,T,!1)},g.prototype.once=function(v,y,T){return m(this,v,y,T,!0)},g.prototype.removeListener=function(v,y,T,_){var N=o?o+v:v;if(!this._events[N])return this;if(!y)return h(this,N),this;var L=this._events[N];if(L.fn)L.fn===y&&(!_||L.once)&&(!T||L.context===T)&&h(this,N);else{for(var k=0,C=[],B=L.length;k<B;k++)(L[k].fn!==y||_&&!L[k].once||T&&L[k].context!==T)&&C.push(L[k]);C.length?this._events[N]=C.length===1?C[0]:C:h(this,N)}return this},g.prototype.removeAllListeners=function(v){var y;return v?(y=o?o+v:v,this._events[y]&&h(this,y)):(this._events=new a,this._eventsCount=0),this},g.prototype.off=g.prototype.removeListener,g.prototype.addListener=g.prototype.on,g.prefixed=o,g.EventEmitter=g,typeof t<"u"&&(t.exports=g)});function Ni(e){let t={exports:{}};return e(t,t.exports),t.exports}var Ti=Number.MAX_SAFE_INTEGER||9007199254740991,Ct={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Ti,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,tt=Ni(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:r}=Ct,o=(t=e.exports={}).re=[],a=t.src=[],s=t.t={},m=0,h=(g,v,y)=>{let T=m++;H(T,v),s[g]=T,a[T]=v,o[T]=new RegExp(v,y?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","[0-9]+"),h("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),h("MAINVERSION",`(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${a[s.NUMERICIDENTIFIER]}|${a[s.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${a[s.NUMERICIDENTIFIERLOOSE]}|${a[s.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${a[s.PRERELEASEIDENTIFIER]}(?:\\.${a[s.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${a[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[s.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER","[0-9A-Za-z-]+"),h("BUILD",`(?:\\+(${a[s.BUILDIDENTIFIER]}(?:\\.${a[s.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${a[s.MAINVERSION]}${a[s.PRERELEASE]}?${a[s.BUILD]}?`),h("FULL",`^${a[s.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${a[s.MAINVERSIONLOOSE]}${a[s.PRERELEASELOOSE]}?${a[s.BUILD]}?`),h("LOOSE",`^${a[s.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${a[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${a[s.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:${a[s.PRERELEASE]})?${a[s.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:${a[s.PRERELEASELOOSE]})?${a[s.BUILD]}?)?)?`),h("XRANGE",`^${a[s.GTLT]}\\s*${a[s.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${a[s.GTLT]}\\s*${a[s.XRANGEPLAINLOOSE]}$`),h("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),h("COERCERTL",a[s.COERCE],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${a[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${a[s.LONETILDE]}${a[s.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${a[s.LONETILDE]}${a[s.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${a[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${a[s.LONECARET]}${a[s.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${a[s.LONECARET]}${a[s.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${a[s.GTLT]}\\s*(${a[s.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]}|${a[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${a[s.XRANGEPLAIN]})\\s+-\\s+(${a[s.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${a[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[s.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0.0.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),Lr=/^[0-9]+$/,Vr=(e,t)=>{let r=Lr.test(e),o=Lr.test(t);return r&&o&&(e=+e,t=+t),e===t?0:r&&!o?-1:o&&!r?1:e<t?-1:1},Mi=(e,t)=>Vr(t,e),Li={compareIdentifiers:Vr,rcompareIdentifiers:Mi},{MAX_LENGTH:Cr,MAX_SAFE_INTEGER:it}=Ct,{re:Pr,t:$r}=tt,{compareIdentifiers:He}=Li,te=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof te){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>Cr)throw new TypeError(`version is longer than ${Cr} characters`);H("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Pr[$r.LOOSE]:Pr[$r.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>it||this.major<0)throw new TypeError("Invalid major version");if(this.minor>it||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>it||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let a=+o;if(a>=0&&a<it)return a}return o}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(H("SemVer.compare",this.version,this.options,e),!(e instanceof te)){if(typeof e=="string"&&e===this.version)return 0;e=new te(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof te||(e=new te(e,this.options)),He(this.major,e.major)||He(this.minor,e.minor)||He(this.patch,e.patch)}comparePre(e){if(e instanceof te||(e=new te(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 r=this.prerelease[t],o=e.prerelease[t];if(H("prerelease compare",t,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r!==o)return He(r,o)}while(++t)}compareBuild(e){e instanceof te||(e=new te(e,this.options));let t=0;do{let r=this.build[t],o=e.build[t];if(H("prerelease compare",t,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r!==o)return He(r,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 r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-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}},Ci=(e,t,r)=>new te(e,r).compare(new te(t,r)),We=Ci,Pi=(e,t,r)=>We(e,t,r)===0,$i=Pi,Di=(e,t,r)=>We(e,t,r)!==0,xi=Di,Ui=(e,t,r)=>We(e,t,r)>0,ki=Ui,Fi=(e,t,r)=>We(e,t,r)>=0,Wi=Fi,Bi=(e,t,r)=>We(e,t,r)<0,Gi=Bi,ji=(e,t,r)=>We(e,t,r)<=0,Vi=ji,Ki=(e,t,r,o)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return $i(e,r,o);case"!=":return xi(e,r,o);case">":return ki(e,r,o);case">=":return Wi(e,r,o);case"<":return Gi(e,r,o);case"<=":return Vi(e,r,o);default:throw new TypeError(`Invalid operator: ${t}`)}},Tt=Ki,Ye=Symbol("SemVer ANY"),Qe=class{static get ANY(){return Ye}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Qe){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===Ye?this.value="":this.value=this.operator+this.semver.version,H("comp",this)}parse(e){let t=this.options.loose?Dr[xr.COMPARATORLOOSE]:Dr[xr.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new te(r[2],this.options.loose):this.semver=Ye}toString(){return this.value}test(e){if(H("Comparator.test",e,this.options.loose),this.semver===Ye||e===Ye)return!0;if(typeof e=="string")try{e=new te(e,this.options)}catch(t){return!1}return Tt(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Qe))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new Ue(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new Ue(this.value,t).test(e.semver);let r=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),o=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),a=this.semver.version===e.semver.version,s=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),m=Tt(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),h=Tt(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return r||o||a&&s||m||h}},{re:Dr,t:xr}=tt,Ue=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Ue)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Ue(e.raw,t);if(e instanceof Qe)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(r=>this.parseRange(r.trim())).filter(r=>r.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 r=t?ne[re.HYPHENRANGELOOSE]:ne[re.HYPHENRANGE];e=e.replace(r,io(this.options.includePrerelease)),H("hyphen replace",e),e=e.replace(ne[re.COMPARATORTRIM],qi),H("comparator trim",e,ne[re.COMPARATORTRIM]),e=(e=(e=e.replace(ne[re.TILDETRIM],Hi)).replace(ne[re.CARETTRIM],Yi)).split(/\s+/).join(" ");let o=t?ne[re.COMPARATORLOOSE]:ne[re.COMPARATOR];return e.split(" ").map(a=>Xi(a,this.options)).join(" ").split(/\s+/).map(a=>no(a,this.options)).filter(this.options.loose?a=>!!a.match(o):()=>!0).map(a=>new Qe(a,this.options))}intersects(e,t){if(!(e instanceof Ue))throw new TypeError("a Range is required");return this.set.some(r=>Ur(r,t)&&e.set.some(o=>Ur(o,t)&&r.every(a=>o.every(s=>a.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new te(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(oo(this.set[t],e,this.options))return!0;return!1}},{re:ne,t:re,comparatorTrimReplace:qi,tildeTrimReplace:Hi,caretTrimReplace:Yi}=tt,Ur=(e,t)=>{let r=!0,o=e.slice(),a=o.pop();for(;r&&o.length;)r=o.every(s=>a.intersects(s,t)),a=o.pop();return r},Xi=(e,t)=>(H("comp",e,t),e=Qi(e,t),H("caret",e),e=zi(e,t),H("tildes",e),e=eo(e,t),H("xrange",e),e=ro(e,t),H("stars",e),e),ae=e=>!e||e.toLowerCase()==="x"||e==="*",zi=(e,t)=>e.trim().split(/\s+/).map(r=>Ji(r,t)).join(" "),Ji=(e,t)=>{let r=t.loose?ne[re.TILDELOOSE]:ne[re.TILDE];return e.replace(r,(o,a,s,m,h)=>{let g;return H("tilde",e,o,a,s,m,h),ae(a)?g="":ae(s)?g=`>=${a}.0.0 <${+a+1}.0.0-0`:ae(m)?g=`>=${a}.${s}.0 <${a}.${+s+1}.0-0`:h?(H("replaceTilde pr",h),g=`>=${a}.${s}.${m}-${h} <${a}.${+s+1}.0-0`):g=`>=${a}.${s}.${m} <${a}.${+s+1}.0-0`,H("tilde return",g),g})},Qi=(e,t)=>e.trim().split(/\s+/).map(r=>Zi(r,t)).join(" "),Zi=(e,t)=>{H("caret",e,t);let r=t.loose?ne[re.CARETLOOSE]:ne[re.CARET],o=t.includePrerelease?"-0":"";return e.replace(r,(a,s,m,h,g)=>{let v;return H("caret",e,a,s,m,h,g),ae(s)?v="":ae(m)?v=`>=${s}.0.0${o} <${+s+1}.0.0-0`:ae(h)?v=s==="0"?`>=${s}.${m}.0${o} <${s}.${+m+1}.0-0`:`>=${s}.${m}.0${o} <${+s+1}.0.0-0`:g?(H("replaceCaret pr",g),v=s==="0"?m==="0"?`>=${s}.${m}.${h}-${g} <${s}.${m}.${+h+1}-0`:`>=${s}.${m}.${h}-${g} <${s}.${+m+1}.0-0`:`>=${s}.${m}.${h}-${g} <${+s+1}.0.0-0`):(H("no pr"),v=s==="0"?m==="0"?`>=${s}.${m}.${h}${o} <${s}.${m}.${+h+1}-0`:`>=${s}.${m}.${h}${o} <${s}.${+m+1}.0-0`:`>=${s}.${m}.${h} <${+s+1}.0.0-0`),H("caret return",v),v})},eo=(e,t)=>(H("replaceXRanges",e,t),e.split(/\s+/).map(r=>to(r,t)).join(" ")),to=(e,t)=>{e=e.trim();let r=t.loose?ne[re.XRANGELOOSE]:ne[re.XRANGE];return e.replace(r,(o,a,s,m,h,g)=>{H("xRange",e,o,a,s,m,h,g);let v=ae(s),y=v||ae(m),T=y||ae(h),_=T;return a==="="&&_&&(a=""),g=t.includePrerelease?"-0":"",v?o=a===">"||a==="<"?"<0.0.0-0":"*":a&&_?(y&&(m=0),h=0,a===">"?(a=">=",y?(s=+s+1,m=0,h=0):(m=+m+1,h=0)):a==="<="&&(a="<",y?s=+s+1:m=+m+1),a==="<"&&(g="-0"),o=`${a+s}.${m}.${h}${g}`):y?o=`>=${s}.0.0${g} <${+s+1}.0.0-0`:T&&(o=`>=${s}.${m}.0${g} <${s}.${+m+1}.0-0`),H("xRange return",o),o})},ro=(e,t)=>(H("replaceStars",e,t),e.trim().replace(ne[re.STAR],"")),no=(e,t)=>(H("replaceGTE0",e,t),e.trim().replace(ne[t.includePrerelease?re.GTE0PRE:re.GTE0],"")),io=e=>(t,r,o,a,s,m,h,g,v,y,T,_,N)=>`${r=ae(o)?"":ae(a)?`>=${o}.0.0${e?"-0":""}`:ae(s)?`>=${o}.${a}.0${e?"-0":""}`:m?`>=${r}`:`>=${r}${e?"-0":""}`} ${g=ae(v)?"":ae(y)?`<${+v+1}.0.0-0`:ae(T)?`<${v}.${+y+1}.0-0`:_?`<=${v}.${y}.${T}-${_}`:e?`<${v}.${y}.${+T+1}-0`:`<=${g}`}`.trim(),oo=(e,t,r)=>{for(let o=0;o<e.length;o++)if(!e[o].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let o=0;o<e.length;o++)if(H(e[o].semver),e[o].semver!==Qe.ANY&&e[o].semver.prerelease.length>0){let a=e[o].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0},ao=(e,t,r)=>{try{t=new Ue(t,r)}catch(o){return!1}return t.test(e)},{MAX_LENGTH:so}=Ct,{re:kr,t:Fr}=tt,lo=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof te)return e;if(typeof e!="string"||e.length>so||!(t.loose?kr[Fr.LOOSE]:kr[Fr.FULL]).test(e))return null;try{return new te(e,t)}catch(r){return null}},co=lo,{re:ot,t:at}=tt,uo=(e,t)=>{if(e instanceof te)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let r=null;if((t=t||{}).rtl){let o;for(;(o=ot[at.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&o.index+o[0].length===r.index+r[0].length||(r=o),ot[at.COERCERTL].lastIndex=o.index+o[1].length+o[2].length;ot[at.COERCERTL].lastIndex=-1}else r=e.match(ot[at.COERCE]);return r===null?null:co(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function fo(e){return String.fromCharCode(parseInt(e.slice(1),16))}function ho(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function mo(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,fo))}function po(e){return decodeURIComponent(Array.from(atob(e),ho).join(""))}function Kr(e){return mo(JSON.stringify(e))}function vo(e){return JSON.parse(po(e))}function Xe(e){return typeof e=="undefined"}function go(e){return e===null}function qr(e){return go(e)||Xe(e)}function yo(e){return qr(e)?!1:!Xe(e.jsonrpc)&&!Xe(e.id)&&(!Xe(e.result)||!Xe(e.error))}function Eo(e){return qr(e)?!1:typeof e=="number"&&Object.values($e).includes(e)}function ut(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var Y={};function Hr(e,t){return Object.assign(Y,t),e}var _o={"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"},Ee=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,Ee.prototype)}},Fe=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=Eo(t)?t:$e.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,Fe.prototype)}},Oe=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},mt=class extends Error{constructor(e,t,r,o){super(`Magic Extension Error (${e.name}): [${t}] ${r}`),this.code=t,this.rawMessage=r,this.data=o,this.__proto__=Error,Object.setPrototypeOf(this,mt.prototype)}},ft=class{constructor(e,t,r){this.code=t,this.rawMessage=r,this.message=`Magic Extension Warning (${e.name}): [${t}] ${r}`}log(){console.warn(this.message)}};function Io(){return new Ee(pe.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Pt(){return new Ee(pe.ModalNotReady,"Modal is not ready.")}function wo(){return new Ee(pe.MalformedResponse,"Response from the Magic iframe is malformed.")}function bo(e){return new Ee(pe.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 Ro(e){let t=`Some extensions are incompatible with \`${Y.sdkName}@${Y.version}\`:`;return e.filter(r=>typeof r.compat!="undefined"&&r.compat!==null).forEach(r=>{let o=r.compat[Y.sdkName];typeof o=="string"?t+=`
|
2
|
+
- Extension \`${r.name}\` supports version(s) \`${o}\``:o||(t+=`
|
3
|
+
- Extension \`${r.name}\` does not support ${Y.platform} environments.`)}),new Ee(pe.IncompatibleExtensions,t)}function Ao(e){let t=r=>{let o=r+1,a=o%10,s=o%100;return a===1&&s!==11?`${o}st`:a===2&&s!==12?`${o}nd`:a===3&&s!==13?`${o}rd`:`${o}th`};return new Ee(pe.InvalidArgument,`Invalid ${t(e.argument)} argument given to \`${e.procedure}\`.
|
10
4
|
Expected: \`${e.expected}\`
|
11
|
-
Received: \`${e.received}\``)}function As(){return new Et(Ye.DuplicateIframe,"Duplicate iframes found.")}function Sd(){return new Et(Ye.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 Id(){return new Et(Ye.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 \`${ee.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function xr(e){let{method:t,removalVersions:r,useInstead:n}=e,o=r[ee.sdkName],i=n?` Use \`${n}\` instead.`:"",a=`\`${t}\` will be removed from \`${ee.sdkName}\` in version \`${o}\`.${i}`;return new Et(Ye.DeprecationNotice,a)}function*wd(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}var xd=wd();function Ls(){return xd.next().value}var Ns=Symbol("Payload pre-processed by Magic SDK");function Ms(e){return Object.defineProperty(e,Ns,{value:!0,enumerable:!1}),e}function Td(e){return!!e[Ns]}function wn(e){var t,r,n;return Td(e)||(e.jsonrpc=(t=e.jsonrpc)!=null?t:"2.0",e.id=Ls(),e.method=(r=e.method)!=null?r:"noop",e.params=(n=e.params)!=null?n:[],Ms(e)),e}function W(e,t=[]){return Ms({params:t,method:e,jsonrpc:"2.0",id:Ls()})}var $o=class{constructor(e){e instanceof $o?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):md(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}}},Rd=Sf(If()),Od=class extends Rd.default{};function ks(){let e=new Od;return{emitter:e,createChainingEmitterMethod:(t,r)=>(...n)=>(e[t].apply(e,n),r),createBoundEmitterMethod:t=>(...r)=>e[t].apply(e,r)}}var Ps=Symbol("isPromiEvent");function Fo(e){return!!e[Ps]}function Or(e){let t=Ds(e),{createBoundEmitterMethod:r,createChainingEmitterMethod:n}=ks(),o=Symbol("Promise.then"),i=Symbol("Promise.catch"),a=Symbol("Promise.finally"),c=(p,g)=>(...y)=>{let S=g[p].apply(g,y);return f(S)},f=p=>Object.assign(p,{[Ps]:!0,[o]:p[o]||p.then,[i]:p[i]||p.catch,[a]:p[a]||p.finally,then:c(o,p),catch:c(i,p),finally:c(a,p),on:n("on",p),once:n("once",p),addListener:n("addListener",p),off:n("off",p),removeListener:n("removeListener",p),removeAllListeners:n("removeAllListeners",p),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),l=f(t.then(p=>(l.emit("done",p),l.emit("settled"),p),p=>{throw l.emit("error",p),l.emit("settled"),p}));return l}function Ds(e){return new Promise((t,r)=>{let n=e(t,r);Promise.resolve(n).catch(r)})}var bt=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(lt.MAGIC_HANDLE_REQUEST,wn(e)),r=Or((o,i)=>{t.then(a=>{if(n(),a.hasError)i(new Jt(a.payload.error));else if(a.hasResult)o(a.payload.result);else throw yd()}).catch(a=>{n(),i(a)})}),n=this.overlay.on(Be.MAGIC_HANDLE_EVENT,o=>{var i;let{response:a}=o.data;if(a.id===e.id&&((i=a.result)==null?void 0:i.event)){let{event:c,params:f=[]}=a.result;r.emit(c,...f)}});return r}createIntermediaryEvent(e,t){return r=>{let n=W(M.IntermediaryEvent,[{payloadId:t,eventType:e,args:r}]);this.request(n)}}};function Cd(e,t){let[r]=e.split(".").map(Number);return r>=t}var Tr={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},Ad=class extends bt{loginWithMagicLink(e){let t=ee.sdkName==="@magic-sdk/react-native"||ee.sdkName==="@magic-sdk/react-native-bare"||ee.sdkName==="@magic-sdk/react-native-expo";if(t&&Cd(ee.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");t&&xr({method:"auth.loginWithMagicLink()",removalVersions:Tr,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:r,showUI:n=!0,redirectURI:o,overrides:i}=e,a=W(this.sdk.testMode?M.LoginWithMagicLinkTestMode:M.LoginWithMagicLink,[{email:r,showUI:n,redirectURI:o,overrides:i}]);return this.request(a)}loginWithSMS(e){let{phoneNumber:t}=e,r=W(this.sdk.testMode?M.LoginWithSmsTestMode:M.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(r)}loginWithEmailOTP(e){let{email:t,showUI:r,deviceCheckUI:n,overrides:o}=e,i=W(this.sdk.testMode?M.LoginWithEmailOTPTestMode:M.LoginWithEmailOTP,[{email:t,showUI:r,deviceCheckUI:n,overrides:o}]),a=this.request(i);return!n&&a&&a.on(or.Retry,()=>{this.createIntermediaryEvent(or.Retry,i.id)()}),!r&&a&&(a.on(ft.VerifyEmailOtp,c=>{this.createIntermediaryEvent(ft.VerifyEmailOtp,i.id)(c)}),a.on(ft.Cancel,()=>{this.createIntermediaryEvent(ft.Cancel,i.id)()})),a}loginWithCredential(e){let t=e!=null?e:"";if(!e&&ee.platform==="web"){t=window.location.search;let n=window.location.origin+window.location.pathname;window.history.replaceState(null,"",n)}let r=W(this.sdk.testMode?M.LoginWithCredentialTestMode:M.LoginWithCredential,[t]);return this.request(r)}setAuthorizationToken(e){let t=W(M.SetAuthorizationToken,[{jwt:e}]);return this.request(t)}updateEmailWithUI(e){let{email:t,showUI:r=!0}=e,n=W(this.sdk.testMode?M.UpdateEmailTestMode:M.UpdateEmail,[{email:t,showUI:r}]),o=this.request(n);return r||(o.on(qe.Retry,()=>{this.createIntermediaryEvent(qe.Retry,n.id)()}),o.on(qe.Cancel,()=>{this.createIntermediaryEvent(qe.Cancel,n.id)()}),o.on(qe.VerifyEmailOtp,i=>{this.createIntermediaryEvent(qe.VerifyEmailOtp,n.id)(i)}),o.on(Ve.RetryWithNewEmail,i=>{this.createIntermediaryEvent(Ve.RetryWithNewEmail,n.id)(i)}),o.on(Ve.Cancel,()=>{this.createIntermediaryEvent(Ve.Cancel,n.id)()}),o.on(Ve.VerifyEmailOtp,i=>{this.createIntermediaryEvent(Ve.VerifyEmailOtp,n.id)(i)})),o}},Us={};bf(Us,{clear:()=>Ld,getItem:()=>ge,iterate:()=>Bs,key:()=>Md,keys:()=>kd,length:()=>Nd,removeItem:()=>Xt,setItem:()=>He});var En;function st(e){return(...t)=>ne(this,null,function*(){return En||(En=yield ee.configureStorage()),yield En.ready(),En[e](...t)})}var ge=st("getItem"),He=st("setItem"),Xt=st("removeItem"),Ld=st("clear"),Nd=st("length"),Md=st("key"),kd=st("keys"),Bs=st("iterate");function Pd(){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 $s="STORE_KEY_PRIVATE_KEY",ko="STORE_KEY_PUBLIC_JWK",Fs="ECDSA",Dd="P-256",Ud={name:Fs,namedCurve:Dd};function Rn(){let e=typeof window!="undefined"&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}function Bd(){return ne(this,null,function*(){let e=yield $d();if(!e){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:t}=window.crypto,r=yield ge($s);if(!r||!t){console.info("unable to find private key or webcrypto unsupported");return}let n={iat:Math.floor(new Date().getTime()/1e3),jti:Pd()},o={typ:"dpop+jwt",alg:"ES256",jwk:e},i={protected:_s(JSON.stringify(o)),claims:_s(JSON.stringify(n))},a=Gd(`${i.protected}.${i.claims}`),c={name:Fs,hash:{name:"SHA-256"}},f=Wd(new Uint8Array(yield t.sign(c,r,a)));return`${i.protected}.${i.claims}.${f}`})}function $d(){return ne(this,null,function*(){if(!Rn()){console.info("webcrypto is not supported");return}return(yield ge(ko))||(yield Fd()),ge(ko)})}function Fd(){return ne(this,null,function*(){let{subtle:e}=window.crypto,t=yield e.generateKey(Ud,!1,["sign"]),r=yield e.exportKey("jwk",t.publicKey);yield He($s,t.privateKey),yield He(ko,r)})}function _s(e){return Gs(jd(e))}function Gd(e){return new TextEncoder().encode(e)}function Gs(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function jd(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,r)=>String.fromCharCode(parseInt(r,16)))}function Wd(e){let t="";return e.forEach(r=>{t+=String.fromCharCode(r)}),Gs(t)}var Go="ds",jo="ek",Wo="iv",Ho="AES-GCM",Hd=256;function Ko(){return ne(this,null,function*(){let e=[];yield Bs((t,r,n)=>{r.startsWith(`${Go}_`)&&e.push(r)});for(let t of e)yield Xt(t)})}function js(e){let t="",r=new Uint8Array(e),n=r.byteLength;for(let o=0;o<n;o++)t+=String.fromCharCode(r[o]);return window.btoa(t)}function Ws(e){let t=window.atob(e),r=t.length,n=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=t.charCodeAt(o);return n.buffer}function Kd(){return ne(this,null,function*(){if(!Rn()){console.info("webcrypto is not supported");return}let{crypto:e}=window;return(yield ge(Wo))||e.getRandomValues(new Uint8Array(12))})}function Yd(){return ne(this,null,function*(){if(!Rn()){console.info("webcrypto is not supported");return}let{subtle:e}=window.crypto;return(yield ge(jo))||(yield e.generateKey({name:Ho,length:Hd},!1,["encrypt","decrypt"]))})}function qd(e,t){return ne(this,null,function*(){let r=yield Kd(),n=yield Yd();if(!r||!n||!e)return;let o=Ws(e),{subtle:i}=window.crypto,a=yield i.encrypt({name:Ho,iv:r},n,o),c=js(a);yield He(`${Go}_${t}`,c),yield He(jo,n),yield He(Wo,r)})}function Vd(e){return ne(this,null,function*(){let t=yield ge(`${Go}_${e}`),r=yield ge(Wo),n=yield ge(jo);if(!r||!t||!n||!Rn())return;let{subtle:o}=window.crypto,i=yield o.decrypt({name:Ho,iv:r},n,Ws(t));return js(i)})}function Cr(e,t){return t?new URL(e,t):new URL(e)}var zd=class extends bt{constructor(){super(...arguments),this.localForageKey="mc_active_wallet",this.localForageIsLoggedInKey="magic_auth_is_logged_in",this.userLoggedOutCallbacks=[]}getIdToken(e){let t=W(this.sdk.testMode?M.GetIdTokenTestMode:M.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=W(this.sdk.testMode?M.GenerateIdTokenTestMode:M.GenerateIdToken,[e]);return this.request(t)}getInfo(){return ne(this,null,function*(){let e=yield ge(this.localForageKey),t=W(M.GetInfo,[{walletType:e}]);return this.request(t)})}isLoggedIn(){return Or((e,t)=>ne(this,null,function*(){try{let r=!1;this.sdk.useStorageCache&&(r=(yield ge(this.localForageIsLoggedInKey))==="true",r&&e(!0));let n=W(this.sdk.testMode?M.IsLoggedInTestMode:M.IsLoggedIn),o=yield this.request(n);this.sdk.useStorageCache&&(o?He(this.localForageIsLoggedInKey,!0):Xt(this.localForageIsLoggedInKey),r&&!o&&this.emitUserLoggedOut(!0)),e(o)}catch(r){t(r)}}))}logout(){return Xt(this.localForageKey),Xt(this.localForageIsLoggedInKey),Ko(),Or((e,t)=>ne(this,null,function*(){try{let r=W(this.sdk.testMode?M.LogoutTestMode:M.Logout),n=yield this.request(r);this.sdk.useStorageCache&&this.emitUserLoggedOut(n),e(n)}catch(r){t(r)}}))}requestInfoWithUI(e){let t=W(M.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}showSettings(e){let t=W(this.sdk.testMode?M.UserSettingsTestMode:M.UserSettings,[e]);return this.request(t)}recoverAccount(e){let t=W(this.sdk.testMode?M.RecoverAccountTestMode:M.RecoverAccount,[e]);return this.request(t)}revealPrivateKey(){let e=W(M.RevealPK);return this.request(e)}getMetadata(){xr({method:"user.getMetadata()",removalVersions:Tr,useInstead:"user.getInfo()"}).log();let e=W(this.sdk.testMode?M.GetMetadataTestMode:M.GetMetadata);return this.request(e)}onUserLoggedOut(e){this.userLoggedOutCallbacks.push(e)}emitUserLoggedOut(e){this.userLoggedOutCallbacks.forEach(t=>{t(e)})}},Xd=class extends bt{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){let e=Or((t,r)=>ne(this,null,function*(){try{if(this.isMetaMaskBrowser()&&(yield this.isWalletEnabled(Se.MetaMask))){let c=yield this.autoConnectIfWalletBrowser(Se.MetaMask);t(c);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(Se.CoinbaseWallet))){let c=yield this.autoConnectIfWalletBrowser(Se.CoinbaseWallet);t(c);return}let n=this.getUserEnv(),o=W(M.Login,[n]),i=this.request(o);i.on(xt.WalletSelected,c=>this.handleWalletSelected(Do(Po({},c),{payloadId:o.id}))),i.on("id-token-created",c=>{e.emit("id-token-created",c)});let a=yield i;a.error&&r(a),t(a)}catch(n){r(n)}}));return e}showUI(){return this.request(W(M.ShowUI))}showAddress(){return this.request(W(M.ShowAddress))}showSendTokensUI(){return this.request(W(M.ShowSendTokensUI))}showOnRamp(){return this.request(W(M.ShowOnRamp))}showNFTs(){return this.request(W(M.ShowNFTs))}showBalances(){return this.request(W(M.ShowBalances))}sendGaslessTransaction(e,t){return this.request(W(M.SendGaslessTransaction,[e,t]))}getInfo(){return ne(this,null,function*(){xr({method:"wallet.getInfo()",removalVersions:Tr,useInstead:"user.getInfo()"}).log();let e=yield ge(this.localForageKey),t=W(M.GetInfo,[{walletType:e}]);return this.request(t)})}disconnect(){xr({method:"wallet.disconnect()",removalVersions:Tr,useInstead:"user.logout()"}).log(),Xt(this.localForageKey),Ko();let e=W(M.Disconnect);return this.request(e)}requestUserInfoWithUI(e){xr({method:"wallet.requestUserInfoWithUI()",removalVersions:Tr,useInstead:"user.requestUserInfoWithUI()"}).log();let t=W(M.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}getProvider(){return ne(this,null,function*(){switch(yield ge(this.localForageKey)){case Se.MetaMask:return this.getMetaMaskProvider();case Se.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(n=>n==null?void 0:n.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(r=>r==null?void 0:r.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,r;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(n=>n==null?void 0:n.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(r=>r==null?void 0:r.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 Se.MetaMask:return this.connectToMetaMask();case Se.CoinbaseWallet:return this.connectToCoinbaseWallet();default:throw new Error(`Invalid provider: ${e}. Must be one of "metamask" or "coinbase_wallet".`)}}isWalletEnabled(e){let t=W("mc_is_wallet_enabled",[{wallet:e}]);return this.request(t)}handleWalletSelected(e){return ne(this,null,function*(){try{let t=yield this.connectToThirdPartyWallet(e.wallet);yield He(this.localForageKey,e.wallet),this.createIntermediaryEvent(xt.WalletConnected,e.payloadId)(t)}catch(t){console.error(t),this.createIntermediaryEvent(xt.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return ne(this,null,function*(){let t;e===Se.MetaMask&&(t=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===Se.CoinbaseWallet&&(t=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield He(this.localForageKey,e);let r=W(M.AutoConnect,[{wallet:e,address:t}]);return this.request(r)})}},{createBoundEmitterMethod:bn,createChainingEmitterMethod:Vt}=ks(),Jd=class extends bt{constructor(){super(...arguments),this.isMagic=!0,this.on=Vt("on",this),this.once=Vt("once",this),this.addListener=Vt("addListener",this),this.off=Vt("off",this),this.removeListener=Vt("removeListener",this),this.removeAllListeners=Vt("removeAllListeners",this),this.emit=bn("emit"),this.eventNames=bn("eventNames"),this.listeners=bn("listeners"),this.listenerCount=bn("listenerCount")}sendAsync(e,t){if(!t)throw _d({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:t===null?"null":typeof t});if(Array.isArray(e))this.overlay.post(lt.MAGIC_HANDLE_REQUEST,e.map(r=>{let n=wn(r);return this.prefixPayloadMethodForTestMode(n),n})).then(r=>{t(null,r.map(n=>Do(Po({},n.payload),{error:n.hasError?new Jt(n.payload.error):null})))});else{let r=wn(e);this.prefixPayloadMethodForTestMode(r),this.overlay.post(lt.MAGIC_HANDLE_REQUEST,r).then(n=>{t(n.hasError?new Jt(n.payload.error):null,n.payload)})}}send(e,t){if(typeof e=="string"){let n=W(e,Array.isArray(t)?t:[]);return this.request(n)}if(Array.isArray(e)||!!t){this.sendAsync(e,t);return}let r=Sd();return r.log(),new $o(e).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let e=W(M.Login);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}`)}},Ss=["request","overlay","sdk"];function Zd(e){let t=Object.getPrototypeOf(e),r=[t];for(;t!==bt.prototype;)t=Object.getPrototypeOf(t),r.push(t);return r}var Hs=class extends bt{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Or,isPromiEvent:Fo,encodeJSON:Rs,decodeJSON:dd,createJsonRpcRequestPayload:W,standardizeJsonRpcRequestPayload:wn,storage:Us};let e=[this,...Zd(this)];Ss.forEach(t=>{let r=e.map(a=>Object.getOwnPropertyDescriptor(a,t)),n=r.findIndex(a=>!!a),o=n>0,i=r[n];i&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:i,isPrototypeField:o}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw Ed(t)}}))})}init(e){this.__is_initialized__||(Ss.forEach(t=>{if(this.__sdk_access_field_descriptors__.has(t)){let{descriptor:r,isPrototypeField:n}=this.__sdk_access_field_descriptors__.get(t);n?delete this[t]:Object.defineProperty(this,t,r)}}),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:r,useInstead:n}=e,o=n?` Use \`${n}\` instead.`:"",i=`\`${t}\` will be removed from this Extension in version \`${r}\`.${o}`;return new In(this,"DEPRECATION_NOTICE",i)}createWarning(e,t){return new In(this,e,t)}createError(e,t,r){return new Tn(this,e,t,r)}},Qd=class extends Hs{},yt=class extends Hs{};yt.Internal=Qd,yt.Anonymous="anonymous extension";var ep=class extends bt{purchase(e){let t=W(M.NFTPurchase,[e]);return this.request(t)}checkout(e){let t=W(M.NFTCheckout,[e]);return this.request(t)}transfer(e){let t=W(M.NFTTransfer,[e]);return this.request(t)}};function Is(e){return e.compat&&e.compat[ee.sdkName]!=null?typeof e.compat[ee.sdkName]=="string"?nd(sd(ee.version),e.compat[ee.sdkName]):!!e.compat[ee.sdkName]:!0}function tp(e,t,r){return!t&&!r?`${e}_eth_mainnet`:r?`${e}_${JSON.stringify(r)}`:t?typeof t=="string"?`${e}_eth_${t}`:`${e}_${t.rpcUrl}_${t.chainId}_${t.chainType}`:`${e}_unknown`}function rp(e){var t;let r=(t=e==null?void 0:e.extensions)!=null?t:[],n={},o=[];if(Array.isArray(r)?r.forEach(i=>{Is(i)?(i.init(this),(i.name||i.name!==yt.Anonymous)&&(this[i.name]=i),i instanceof yt.Internal&&(Sn(i.config)||(n[i.name]=i.config))):o.push(i)}):Object.keys(r).forEach(i=>{if(Is(r[i])){r[i].init(this);let a=r[i];this[i]=a,a instanceof yt.Internal&&(Sn(a.config)||(n[r[i].name]=a.config))}else o.push(r[i])}),o.length)throw bd(o);return n}var _n=class{constructor(e,t){this.apiKey=e;var r;if(!e)throw gd();ee.platform==="react-native"&&(t==null?void 0:t.endpoint)&&Id().log();let{defaultEndpoint:n,version:o}=ee;this.testMode=!!(t!=null&&t.testMode),this.useStorageCache=!!(t!=null&&t.useStorageCache),this.endpoint=Cr((r=t==null?void 0:t.endpoint)!=null?r:n).origin,this.externalLogger=t==null?void 0:t.externalLogger,this.auth=new Ad(this),this.user=new zd(this),this.wallet=new Xd(this),this.nft=new ep(this),this.rpcProvider=new Jd(this);let i=rp.call(this,t);this.parameters=Rs(Do(Po({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?void 0:t.network,host:Cr(this.endpoint).host,sdk:vd[ee.sdkName],version:o,ext:Sn(i)?void 0:i,locale:(t==null?void 0:t.locale)||"en_US"},ee.bundleId?{bundleId:ee.bundleId}:{}),{meta:t==null?void 0:t.meta})),this.networkHash=tp(this.apiKey,t==null?void 0:t.network,Sn(i)?void 0:i),t!=null&&t.deferPreload||this.preload()}get overlay(){if(!_n.__overlays__.has(this.parameters)){let e=new ee.ViewController(this.endpoint,this.parameters,this.networkHash,this.externalLogger);e.init(),_n.__overlays__.set(this.parameters,e)}return _n.__overlays__.get(this.parameters)}preload(){return ne(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},Yo=_n;Yo.__overlays__=new Map;var ws=(e,t={})=>{_r.logger.log(e,{data:t})};_r.init({clientToken:"pub7091a72b7044b9398c00ce3f3243327f",service:"movement"});function np(e,t){return t&&Array.isArray(e)?e.find(r=>r.id===t):e}function op(e,t){var r;let n=(r=t.data.response)==null?void 0:r.id,o=np(e,n);if(n&&o){let i=new $o(o).applyResult(t.data.response.result).applyError(t.data.response.error);return{id:n,response:i}}return{}}function ip(e,t,r){return ne(this,null,function*(){var n;let o=yield ge("rt"),i;if(ee.platform==="web")try{i=(n=yield ge("jwt"))!=null?n:yield Bd()}catch(f){console.error("webcrypto error",f)}let a={msgType:e,payload:t};i&&(a.jwt=i),i&&o&&(a.rt=o);let c=yield Vd(r);return c&&(a.deviceShare=c),a})}function ap(e){return ne(this,null,function*(){!e.data.rt||(yield He("rt",e.data.rt))})}var Ks=class{constructor(e,t,r,n){this.endpoint=e,this.parameters=t,this.networkHash=r,this.externalLogger=n,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=!1,this.listen()}post(e,t){return ne(this,null,function*(){return Ds((r,n)=>ne(this,null,function*(){if(!this.isConnectedToInternet){let l=Bo();n(l)}this.isReadyForRequest||(ws("waiting for ready",{msgType:e,payload:t}),this.externalLogger.log("waiting for ready",{msgType:e,payload:t}),yield this.waitForReady(),ws("ready for requests",{msgType:e,payload:t}),this.externalLogger.log("ready for requests",{msgType:e,payload:t}));let o=[],i=Array.isArray(t)?t.map(l=>l.id):[],a=yield ip(`${e}-${this.parameters}`,t,this.networkHash);yield this._post(a);let c=l=>p=>{var g;let{id:y,response:S}=op(t,p);if(ap(p),((g=S==null?void 0:S.payload.error)==null?void 0:g.message)==="User denied account access.")Ko();else if(p.data.deviceShare){let{deviceShare:C}=p.data;qd(C,this.networkHash)}y&&S&&Array.isArray(t)&&i.includes(y)?(o.push(S),o.length===t.length&&(l(),r(o))):y&&S&&!Array.isArray(t)&&y===t.id&&(l(),r(S))},f=this.on(Be.MAGIC_HANDLE_RESPONSE,c(()=>f()))}))})}on(e,t){let r=t.bind(window),n=o=>{o.data.msgType===`${e}-${this.parameters}`&&r(o)};return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}waitForReady(){return new Promise(e=>{let t=this.on(Be.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,e(),t()})})}listen(){this.on(Be.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(Be.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()}),this.on(Be.MAGIC_SEND_PRODUCT_ANNOUNCEMENT,e=>{e.data.response.result.product_announcement&&new Et(Ye.ProductAnnouncement,e.data.response.result.product_announcement).log()})}};var qo={};bi(qo,{AuthEventOnReceived:()=>Ai,DeepLinkPage:()=>Ii,DeviceVerificationEventEmit:()=>or,DeviceVerificationEventOnReceived:()=>Ri,EthChainType:()=>Li,Events:()=>xt,Extension:()=>yt,ExtensionError:()=>Tn,ExtensionWarning:()=>In,LoginWithEmailOTPEventEmit:()=>ft,LoginWithEmailOTPEventOnReceived:()=>Ti,LoginWithMagicLinkEventEmit:()=>wi,LoginWithMagicLinkEventOnReceived:()=>xi,MagicIncomingWindowMessage:()=>Be,MagicOutgoingWindowMessage:()=>lt,MagicPayloadMethod:()=>M,RPCError:()=>Jt,RPCErrorCode:()=>wt,RecencyCheckEventEmit:()=>qe,RecencyCheckEventOnReceived:()=>Oi,RecoveryMethodType:()=>Ni,SDKError:()=>et,SDKErrorCode:()=>Ke,SDKWarning:()=>Et,SDKWarningCode:()=>Ye,UpdateEmailEventEmit:()=>Ve,UpdateEmailEventOnReceived:()=>Ci,WalletEventOnReceived:()=>Mi,Wallets:()=>Se,isPromiEvent:()=>Fo});var An=Si(qs()),zo=Si(zs());var sp={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function up(e){for(let[t,r]of Object.entries(sp))e.style[t]=r}function cp(e){let t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find(r=>r.src.includes(e)))}var Cn=class extends Ks{constructor(){super(...arguments);this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(r=>{let n=()=>{if(cp(encodeURIComponent(this.parameters)))As().log();else{let o=document.createElement("iframe");o.classList.add("magic-iframe"),o.dataset.magicIframeLabel=Cr(this.endpoint).host,o.title="Secure Modal",o.src=Cr(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,o.allow="clipboard-read; clipboard-write",up(o),document.body.appendChild(o),r(o)}};["loaded","interactive","complete"].includes(document.readyState)?n():window.addEventListener("load",n,!1)}),window.addEventListener("message",r=>{var n;if(r.origin===this.endpoint&&r.data&&r.data.msgType&&this.messageHandlers.size){r.data.response=(n=r.data.response)!=null?n:{};for(let o of this.messageHandlers.values())o(r)}})}showOverlay(){return It(this,null,function*(){let r=yield this.iframe;r.style.display="block",this.activeElement=document.activeElement,r.focus()})}hideOverlay(){return It(this,null,function*(){var n;let r=yield this.iframe;r.style.display="none",(n=this.activeElement)!=null&&n.focus&&this.activeElement.focus(),this.activeElement=null})}_post(r){return It(this,null,function*(){let n=yield this.iframe;if(n&&n.contentWindow)n.contentWindow.postMessage(r,this.endpoint);else throw Bo()})}};var lp=Object.assign(Cs(Yo,{platform:"web",sdkName:"magic-sdk",version:"28.0.3",defaultEndpoint:"https://auth.magic.link/",ViewController:Cn,configureStorage:()=>It(void 0,null,function*(){let e=An.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(zo),yield e.setDriver([An.default.INDEXEDDB,An.default.LOCALSTORAGE,zo._driver]),e})}),yi({},qo)),fp=lp;return zu(dp);})();
|
5
|
+
Received: \`${e.received}\``)}function Yr(){return new Oe(ve.DuplicateIframe,"Duplicate iframes found.")}function So(){return new Oe(ve.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 Oe(ve.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 \`${Y.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function ze(e){let{method:t,removalVersions:r,useInstead:o}=e,a=r[Y.sdkName],s=o?` Use \`${o}\` instead.`:"",m=`\`${t}\` will be removed from \`${Y.sdkName}\` in version \`${a}\`.${s}`;return new Oe(ve.DeprecationNotice,m)}function*To(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}var Oo=To();function Xr(){return Oo.next().value}var zr=Symbol("Payload pre-processed by Magic SDK");function Jr(e){return Object.defineProperty(e,zr,{value:!0,enumerable:!1}),e}function Mo(e){return!!e[zr]}function dt(e){var t,r,o;return Mo(e)||(e.jsonrpc=(t=e.jsonrpc)!=null?t:"2.0",e.id=Xr(),e.method=(r=e.method)!=null?r:"noop",e.params=(o=e.params)!=null?o:[],Jr(e)),e}function W(e,t=[]){return Jr({params:t,method:e,jsonrpc:"2.0",id:Xr()})}var $t=class{constructor(e){e instanceof $t?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):yo(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}}},Lo=Ai(Si()),Co=class extends Lo.default{};function Qr(){let e=new Co;return{emitter:e,createChainingEmitterMethod:(t,r)=>(...o)=>(e[t].apply(e,o),r),createBoundEmitterMethod:t=>(...r)=>e[t].apply(e,r)}}var Zr=Symbol("isPromiEvent");function Dt(e){return!!e[Zr]}function Ze(e){let t=en(e),{createBoundEmitterMethod:r,createChainingEmitterMethod:o}=Qr(),a=Symbol("Promise.then"),s=Symbol("Promise.catch"),m=Symbol("Promise.finally"),h=(y,T)=>(..._)=>{let N=T[y].apply(T,_);return g(N)},g=y=>Object.assign(y,{[Zr]:!0,[a]:y[a]||y.then,[s]:y[s]||y.catch,[m]:y[m]||y.finally,then:h(a,y),catch:h(s,y),finally:h(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:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),v=g(t.then(y=>(v.emit("done",y),v.emit("settled"),y),y=>{throw v.emit("error",y),v.emit("settled"),y}));return v}function en(e){return new Promise((t,r)=>{let o=e(t,r);Promise.resolve(o).catch(r)})}var Me=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(Se.MAGIC_HANDLE_REQUEST,dt(e)),r=Ze((a,s)=>{t.then(m=>{if(o(),m.hasError)s(new Fe(m.payload.error));else if(m.hasResult)a(m.payload.result);else throw wo()}).catch(m=>{o(),s(m)})}),o=this.overlay.on(he.MAGIC_HANDLE_EVENT,a=>{var s;let{response:m}=a.data;if(m.id===e.id&&((s=m.result)==null?void 0:s.event)){let{event:h,params:g=[]}=m.result;r.emit(h,...g)}});return r}createIntermediaryEvent(e,t){return r=>{let o=W(M.IntermediaryEvent,[{payloadId:t,eventType:e,args:r}]);this.request(o)}}};function Po(e,t){let[r]=e.split(".").map(Number);return r>=t}var Je={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},$o=class extends Me{loginWithMagicLink(e){let t=Y.sdkName==="@magic-sdk/react-native"||Y.sdkName==="@magic-sdk/react-native-bare"||Y.sdkName==="@magic-sdk/react-native-expo";if(t&&Po(Y.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");t&&ze({method:"auth.loginWithMagicLink()",removalVersions:Je,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:r,showUI:o=!0,redirectURI:a,overrides:s}=e,m=W(this.sdk.testMode?M.LoginWithMagicLinkTestMode:M.LoginWithMagicLink,[{email:r,showUI:o,redirectURI:a,overrides:s}]);return this.request(m)}loginWithSMS(e){let{phoneNumber:t}=e,r=W(this.sdk.testMode?M.LoginWithSmsTestMode:M.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(r)}loginWithEmailOTP(e){let{email:t,showUI:r,deviceCheckUI:o,overrides:a}=e,s=W(this.sdk.testMode?M.LoginWithEmailOTPTestMode:M.LoginWithEmailOTP,[{email:t,showUI:r,deviceCheckUI:o,overrides:a}]),m=this.request(s);return!o&&m&&m.on(qe.Retry,()=>{this.createIntermediaryEvent(qe.Retry,s.id)()}),!r&&m&&(m.on(Ne.VerifyEmailOtp,h=>{this.createIntermediaryEvent(Ne.VerifyEmailOtp,s.id)(h)}),m.on(Ne.Cancel,()=>{this.createIntermediaryEvent(Ne.Cancel,s.id)()})),m}loginWithCredential(e){let t=e!=null?e:"";if(!e&&Y.platform==="web"){t=window.location.search;let o=window.location.origin+window.location.pathname;window.history.replaceState(null,"",o)}let r=W(this.sdk.testMode?M.LoginWithCredentialTestMode:M.LoginWithCredential,[t]);return this.request(r)}setAuthorizationToken(e){let t=W(M.SetAuthorizationToken,[{jwt:e}]);return this.request(t)}updateEmailWithUI(e){let{email:t,showUI:r=!0}=e,o=W(this.sdk.testMode?M.UpdateEmailTestMode:M.UpdateEmail,[{email:t,showUI:r}]),a=this.request(o);return r||(a.on(ge.Retry,()=>{this.createIntermediaryEvent(ge.Retry,o.id)()}),a.on(ge.Cancel,()=>{this.createIntermediaryEvent(ge.Cancel,o.id)()}),a.on(ge.VerifyEmailOtp,s=>{this.createIntermediaryEvent(ge.VerifyEmailOtp,o.id)(s)}),a.on(ye.RetryWithNewEmail,s=>{this.createIntermediaryEvent(ye.RetryWithNewEmail,o.id)(s)}),a.on(ye.Cancel,()=>{this.createIntermediaryEvent(ye.Cancel,o.id)()}),a.on(ye.VerifyEmailOtp,s=>{this.createIntermediaryEvent(ye.VerifyEmailOtp,o.id)(s)})),a}},tn={};bi(tn,{clear:()=>Do,getItem:()=>se,iterate:()=>rn,key:()=>Uo,keys:()=>ko,length:()=>xo,removeItem:()=>ke,setItem:()=>me});var st;function be(e){return(...t)=>X(this,null,function*(){return st||(st=yield Y.configureStorage()),yield st.ready(),st[e](...t)})}var se=be("getItem"),me=be("setItem"),ke=be("removeItem"),Do=be("clear"),xo=be("length"),Uo=be("key"),ko=be("keys"),rn=be("iterate");function Fo(){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 nn="STORE_KEY_PRIVATE_KEY",Ot="STORE_KEY_PUBLIC_JWK",on="ECDSA",Wo="P-256",Bo={name:on,namedCurve:Wo};function pt(){let e=typeof window!="undefined"&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}function Go(){return X(this,null,function*(){let e=yield jo();if(!e){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:t}=window.crypto,r=yield se(nn);if(!r||!t){console.info("unable to find private key or webcrypto unsupported");return}let o={iat:Math.floor(new Date().getTime()/1e3),jti:Fo()},a={typ:"dpop+jwt",alg:"ES256",jwk:e},s={protected:Wr(JSON.stringify(a)),claims:Wr(JSON.stringify(o))},m=Ko(`${s.protected}.${s.claims}`),h={name:on,hash:{name:"SHA-256"}},g=Ho(new Uint8Array(yield t.sign(h,r,m)));return`${s.protected}.${s.claims}.${g}`})}function jo(){return X(this,null,function*(){if(!pt()){console.info("webcrypto is not supported");return}return(yield se(Ot))||(yield Vo()),se(Ot)})}function Vo(){return X(this,null,function*(){let{subtle:e}=window.crypto,t=yield e.generateKey(Bo,!1,["sign"]),r=yield e.exportKey("jwk",t.publicKey);yield me(nn,t.privateKey),yield me(Ot,r)})}function Wr(e){return an(qo(e))}function Ko(e){return new TextEncoder().encode(e)}function an(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function qo(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,r)=>String.fromCharCode(parseInt(r,16)))}function Ho(e){let t="";return e.forEach(r=>{t+=String.fromCharCode(r)}),an(t)}var xt="ds",Ut="ek",kt="iv",Ft="AES-GCM",Yo=256;function Wt(){return X(this,null,function*(){let e=[];yield rn((t,r,o)=>{r.startsWith(`${xt}_`)&&e.push(r)});for(let t of e)yield ke(t)})}function sn(e){let t="",r=new Uint8Array(e),o=r.byteLength;for(let a=0;a<o;a++)t+=String.fromCharCode(r[a]);return window.btoa(t)}function ln(e){let t=window.atob(e),r=t.length,o=new Uint8Array(r);for(let a=0;a<r;a++)o[a]=t.charCodeAt(a);return o.buffer}function Xo(){return X(this,null,function*(){if(!pt()){console.info("webcrypto is not supported");return}let{crypto:e}=window;return(yield se(kt))||e.getRandomValues(new Uint8Array(12))})}function zo(){return X(this,null,function*(){if(!pt()){console.info("webcrypto is not supported");return}let{subtle:e}=window.crypto;return(yield se(Ut))||(yield e.generateKey({name:Ft,length:Yo},!1,["encrypt","decrypt"]))})}function Jo(e,t){return X(this,null,function*(){let r=yield Xo(),o=yield zo();if(!r||!o||!e)return;let a=ln(e),{subtle:s}=window.crypto,m=yield s.encrypt({name:Ft,iv:r},o,a),h=sn(m);yield me(`${xt}_${t}`,h),yield me(Ut,o),yield me(kt,r)})}function Qo(e){return X(this,null,function*(){let t=yield se(`${xt}_${e}`),r=yield se(kt),o=yield se(Ut);if(!r||!t||!o||!pt())return;let{subtle:a}=window.crypto,s=yield a.decrypt({name:Ft,iv:r},o,ln(t));return sn(s)})}function et(e,t){return t?new URL(e,t):new URL(e)}var Zo=class extends Me{constructor(){super(...arguments),this.localForageKey="mc_active_wallet",this.localForageIsLoggedInKey="magic_auth_is_logged_in",this.userLoggedOutCallbacks=[]}getIdToken(e){let t=W(this.sdk.testMode?M.GetIdTokenTestMode:M.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=W(this.sdk.testMode?M.GenerateIdTokenTestMode:M.GenerateIdToken,[e]);return this.request(t)}getInfo(){return X(this,null,function*(){let e=yield se(this.localForageKey),t=W(M.GetInfo,[{walletType:e}]);return this.request(t)})}isLoggedIn(){return Ze((e,t)=>X(this,null,function*(){try{let r=!1;this.sdk.useStorageCache&&(r=(yield se(this.localForageIsLoggedInKey))==="true",r&&e(!0));let o=W(this.sdk.testMode?M.IsLoggedInTestMode:M.IsLoggedIn),a=yield this.request(o);this.sdk.useStorageCache&&(a?me(this.localForageIsLoggedInKey,!0):ke(this.localForageIsLoggedInKey),r&&!a&&this.emitUserLoggedOut(!0)),e(a)}catch(r){t(r)}}))}logout(){return ke(this.localForageKey),ke(this.localForageIsLoggedInKey),Wt(),Ze((e,t)=>X(this,null,function*(){try{let r=W(this.sdk.testMode?M.LogoutTestMode:M.Logout),o=yield this.request(r);this.sdk.useStorageCache&&this.emitUserLoggedOut(o),e(o)}catch(r){t(r)}}))}requestInfoWithUI(e){let t=W(M.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}showSettings(e){let t=W(this.sdk.testMode?M.UserSettingsTestMode:M.UserSettings,[e]);return this.request(t)}recoverAccount(e){let t=W(this.sdk.testMode?M.RecoverAccountTestMode:M.RecoverAccount,[e]);return this.request(t)}revealPrivateKey(){let e=W(M.RevealPK);return this.request(e)}getMetadata(){ze({method:"user.getMetadata()",removalVersions:Je,useInstead:"user.getInfo()"}).log();let e=W(this.sdk.testMode?M.GetMetadataTestMode:M.GetMetadata);return this.request(e)}onUserLoggedOut(e){this.userLoggedOutCallbacks.push(e)}emitUserLoggedOut(e){this.userLoggedOutCallbacks.forEach(t=>{t(e)})}},ea=class extends Me{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){let e=Ze((t,r)=>X(this,null,function*(){try{if(this.isMetaMaskBrowser()&&(yield this.isWalletEnabled(ue.MetaMask))){let h=yield this.autoConnectIfWalletBrowser(ue.MetaMask);t(h);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(ue.CoinbaseWallet))){let h=yield this.autoConnectIfWalletBrowser(ue.CoinbaseWallet);t(h);return}let o=this.getUserEnv(),a=W(M.Login,[o]),s=this.request(a);s.on(De.WalletSelected,h=>this.handleWalletSelected(Lt(Mt({},h),{payloadId:a.id}))),s.on("id-token-created",h=>{e.emit("id-token-created",h)});let m=yield s;m.error&&r(m),t(m)}catch(o){r(o)}}));return e}showUI(){return this.request(W(M.ShowUI))}showAddress(){return this.request(W(M.ShowAddress))}showSendTokensUI(){return this.request(W(M.ShowSendTokensUI))}showOnRamp(){return this.request(W(M.ShowOnRamp))}showNFTs(){return this.request(W(M.ShowNFTs))}showBalances(){return this.request(W(M.ShowBalances))}sendGaslessTransaction(e,t){return this.request(W(M.SendGaslessTransaction,[e,t]))}getInfo(){return X(this,null,function*(){ze({method:"wallet.getInfo()",removalVersions:Je,useInstead:"user.getInfo()"}).log();let e=yield se(this.localForageKey),t=W(M.GetInfo,[{walletType:e}]);return this.request(t)})}disconnect(){ze({method:"wallet.disconnect()",removalVersions:Je,useInstead:"user.logout()"}).log(),ke(this.localForageKey),Wt();let e=W(M.Disconnect);return this.request(e)}requestUserInfoWithUI(e){ze({method:"wallet.requestUserInfoWithUI()",removalVersions:Je,useInstead:"user.requestUserInfoWithUI()"}).log();let t=W(M.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}getProvider(){return X(this,null,function*(){switch(yield se(this.localForageKey)){case ue.MetaMask:return this.getMetaMaskProvider();case ue.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.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(r=>r==null?void 0:r.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,r;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.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(r=>r==null?void 0:r.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=W("mc_is_wallet_enabled",[{wallet:e}]);return this.request(t)}handleWalletSelected(e){return X(this,null,function*(){try{let t=yield this.connectToThirdPartyWallet(e.wallet);yield me(this.localForageKey,e.wallet),this.createIntermediaryEvent(De.WalletConnected,e.payloadId)(t)}catch(t){console.error(t),this.createIntermediaryEvent(De.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return X(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 me(this.localForageKey,e);let r=W(M.AutoConnect,[{wallet:e,address:t}]);return this.request(r)})}},{createBoundEmitterMethod:lt,createChainingEmitterMethod:xe}=Qr(),ta=class extends Me{constructor(){super(...arguments),this.isMagic=!0,this.on=xe("on",this),this.once=xe("once",this),this.addListener=xe("addListener",this),this.off=xe("off",this),this.removeListener=xe("removeListener",this),this.removeAllListeners=xe("removeAllListeners",this),this.emit=lt("emit"),this.eventNames=lt("eventNames"),this.listeners=lt("listeners"),this.listenerCount=lt("listenerCount")}sendAsync(e,t){if(!t)throw Ao({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:t===null?"null":typeof t});if(Array.isArray(e))this.overlay.post(Se.MAGIC_HANDLE_REQUEST,e.map(r=>{let o=dt(r);return this.prefixPayloadMethodForTestMode(o),o})).then(r=>{t(null,r.map(o=>Lt(Mt({},o.payload),{error:o.hasError?new Fe(o.payload.error):null})))});else{let r=dt(e);this.prefixPayloadMethodForTestMode(r),this.overlay.post(Se.MAGIC_HANDLE_REQUEST,r).then(o=>{t(o.hasError?new Fe(o.payload.error):null,o.payload)})}}send(e,t){if(typeof e=="string"){let o=W(e,Array.isArray(t)?t:[]);return this.request(o)}if(Array.isArray(e)||!!t){this.sendAsync(e,t);return}let r=So();return r.log(),new $t(e).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let e=W(M.Login);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}`)}},Br=["request","overlay","sdk"];function ra(e){let t=Object.getPrototypeOf(e),r=[t];for(;t!==Me.prototype;)t=Object.getPrototypeOf(t),r.push(t);return r}var cn=class extends Me{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Ze,isPromiEvent:Dt,encodeJSON:Kr,decodeJSON:vo,createJsonRpcRequestPayload:W,standardizeJsonRpcRequestPayload:dt,storage:tn};let e=[this,...ra(this)];Br.forEach(t=>{let r=e.map(m=>Object.getOwnPropertyDescriptor(m,t)),o=r.findIndex(m=>!!m),a=o>0,s=r[o];s&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:s,isPrototypeField:a}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw bo(t)}}))})}init(e){this.__is_initialized__||(Br.forEach(t=>{if(this.__sdk_access_field_descriptors__.has(t)){let{descriptor:r,isPrototypeField:o}=this.__sdk_access_field_descriptors__.get(t);o?delete this[t]:Object.defineProperty(this,t,r)}}),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:r,useInstead:o}=e,a=o?` Use \`${o}\` instead.`:"",s=`\`${t}\` will be removed from this Extension in version \`${r}\`.${a}`;return new ft(this,"DEPRECATION_NOTICE",s)}createWarning(e,t){return new ft(this,e,t)}createError(e,t,r){return new mt(this,e,t,r)}},na=class extends cn{},Te=class extends cn{};Te.Internal=na,Te.Anonymous="anonymous extension";var ia=class extends Me{purchase(e){let t=W(M.NFTPurchase,[e]);return this.request(t)}checkout(e){let t=W(M.NFTCheckout,[e]);return this.request(t)}transfer(e){let t=W(M.NFTTransfer,[e]);return this.request(t)}};function Gr(e){return e.compat&&e.compat[Y.sdkName]!=null?typeof e.compat[Y.sdkName]=="string"?ao(uo(Y.version),e.compat[Y.sdkName]):!!e.compat[Y.sdkName]:!0}function oa(e,t,r){return!t&&!r?`${e}_eth_mainnet`:r?`${e}_${JSON.stringify(r)}`:t?typeof t=="string"?`${e}_eth_${t}`:`${e}_${t.rpcUrl}_${t.chainId}_${t.chainType}`:`${e}_unknown`}function aa(e){var t;let r=(t=e==null?void 0:e.extensions)!=null?t:[],o={},a=[];if(Array.isArray(r)?r.forEach(s=>{Gr(s)?(s.init(this),(s.name||s.name!==Te.Anonymous)&&(this[s.name]=s),s instanceof Te.Internal&&(ut(s.config)||(o[s.name]=s.config))):a.push(s)}):Object.keys(r).forEach(s=>{if(Gr(r[s])){r[s].init(this);let m=r[s];this[s]=m,m instanceof Te.Internal&&(ut(m.config)||(o[r[s].name]=m.config))}else a.push(r[s])}),a.length)throw Ro(a);return o}var ct=class{constructor(e,t){this.apiKey=e;var r;if(!e)throw Io();Y.platform==="react-native"&&(t==null?void 0:t.endpoint)&&No().log();let{defaultEndpoint:o,version:a}=Y;this.testMode=!!(t!=null&&t.testMode),this.useStorageCache=!!(t!=null&&t.useStorageCache),this.endpoint=et((r=t==null?void 0:t.endpoint)!=null?r:o).origin,this.auth=new $o(this),this.user=new Zo(this),this.wallet=new ea(this),this.nft=new ia(this),this.rpcProvider=new ta(this);let s=aa.call(this,t);this.parameters=Kr(Lt(Mt({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?void 0:t.network,host:et(this.endpoint).host,sdk:_o[Y.sdkName],version:a,ext:ut(s)?void 0:s,locale:(t==null?void 0:t.locale)||"en_US"},Y.bundleId?{bundleId:Y.bundleId}:{}),{meta:t==null?void 0:t.meta})),this.networkHash=oa(this.apiKey,t==null?void 0:t.network,ut(s)?void 0:s),t!=null&&t.deferPreload||this.preload()}get overlay(){if(!ct.__overlays__.has(this.parameters)){let e=new Y.ViewController(this.endpoint,this.parameters,this.networkHash);e.init(),ct.__overlays__.set(this.parameters,e)}return ct.__overlays__.get(this.parameters)}preload(){return X(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},Bt=ct;Bt.__overlays__=new Map;function sa(e,t){return t&&Array.isArray(e)?e.find(r=>r.id===t):e}function la(e,t){var r;let o=(r=t.data.response)==null?void 0:r.id,a=sa(e,o);if(o&&a){let s=new $t(a).applyResult(t.data.response.result).applyError(t.data.response.error);return{id:o,response:s}}return{}}function ca(e,t,r){return X(this,null,function*(){var o;let a=yield se("rt"),s;if(Y.platform==="web")try{s=(o=yield se("jwt"))!=null?o:yield Go()}catch(g){console.error("webcrypto error",g)}let m={msgType:e,payload:t};s&&(m.jwt=s),s&&a&&(m.rt=a);let h=yield Qo(r);return h&&(m.deviceShare=h),m})}function ua(e){return X(this,null,function*(){!e.data.rt||(yield me("rt",e.data.rt))})}var un=class{constructor(e,t,r){this.endpoint=e,this.parameters=t,this.networkHash=r,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=!1,this.listen()}post(e,t){return X(this,null,function*(){return en((r,o)=>X(this,null,function*(){if(!this.isConnectedToInternet){let v=Pt();o(v)}this.isReadyForRequest||(yield this.waitForReady());let a=[],s=Array.isArray(t)?t.map(v=>v.id):[],m=yield ca(`${e}-${this.parameters}`,t,this.networkHash);yield this._post(m);let h=v=>y=>{var T;let{id:_,response:N}=la(t,y);if(ua(y),((T=N==null?void 0:N.payload.error)==null?void 0:T.message)==="User denied account access.")Wt();else if(y.data.deviceShare){let{deviceShare:L}=y.data;Jo(L,this.networkHash)}_&&N&&Array.isArray(t)&&s.includes(_)?(a.push(N),a.length===t.length&&(v(),r(a))):_&&N&&!Array.isArray(t)&&_===t.id&&(v(),r(N))},g=this.on(he.MAGIC_HANDLE_RESPONSE,h(()=>g()))}))})}on(e,t){let r=t.bind(window),o=a=>{a.data.msgType===`${e}-${this.parameters}`&&r(a)};return this.messageHandlers.add(o),()=>this.messageHandlers.delete(o)}waitForReady(){return new Promise(e=>{let t=this.on(he.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,e(),t()})})}listen(){this.on(he.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(he.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()}),this.on(he.MAGIC_SEND_PRODUCT_ANNOUNCEMENT,e=>{e.data.response.result.product_announcement&&new Oe(ve.ProductAnnouncement,e.data.response.result.product_announcement).log()})}};var Gt={};pr(Gt,{AuthEventOnReceived:()=>Ar,DeepLinkPage:()=>yr,DeviceVerificationEventEmit:()=>qe,DeviceVerificationEventOnReceived:()=>wr,EthChainType:()=>Sr,Events:()=>De,Extension:()=>Te,ExtensionError:()=>mt,ExtensionWarning:()=>ft,LoginWithEmailOTPEventEmit:()=>Ne,LoginWithEmailOTPEventOnReceived:()=>Ir,LoginWithMagicLinkEventEmit:()=>Er,LoginWithMagicLinkEventOnReceived:()=>_r,MagicIncomingWindowMessage:()=>he,MagicOutgoingWindowMessage:()=>Se,MagicPayloadMethod:()=>M,RPCError:()=>Fe,RPCErrorCode:()=>$e,RecencyCheckEventEmit:()=>ge,RecencyCheckEventOnReceived:()=>br,RecoveryMethodType:()=>Nr,SDKError:()=>Ee,SDKErrorCode:()=>pe,SDKWarning:()=>Oe,SDKWarningCode:()=>ve,UpdateEmailEventEmit:()=>ye,UpdateEmailEventOnReceived:()=>Rr,WalletEventOnReceived:()=>Tr,Wallets:()=>ue,isPromiEvent:()=>Dt});var yt=gr(dn()),Vt=gr(mn());var fa={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function da(e){for(let[t,r]of Object.entries(fa))e.style[t]=r}function ha(e){let t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find(r=>r.src.includes(e)))}var gt=class extends un{constructor(){super(...arguments);this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(r=>{let o=()=>{if(ha(encodeURIComponent(this.parameters)))Yr().log();else{let a=document.createElement("iframe");a.classList.add("magic-iframe"),a.dataset.magicIframeLabel=et(this.endpoint).host,a.title="Secure Modal",a.src=et(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,a.allow="clipboard-read; clipboard-write",da(a),document.body.appendChild(a),r(a)}};["loaded","interactive","complete"].includes(document.readyState)?o():window.addEventListener("load",o,!1)}),window.addEventListener("message",r=>{var o;if(r.origin===this.endpoint&&r.data&&r.data.msgType&&this.messageHandlers.size){r.data.response=(o=r.data.response)!=null?o:{};for(let a of this.messageHandlers.values())a(r)}})}showOverlay(){return Pe(this,null,function*(){let r=yield this.iframe;r.style.display="block",this.activeElement=document.activeElement,r.focus()})}hideOverlay(){return Pe(this,null,function*(){var o;let r=yield this.iframe;r.style.display="none",(o=this.activeElement)!=null&&o.focus&&this.activeElement.focus(),this.activeElement=null})}_post(r){return Pe(this,null,function*(){let o=yield this.iframe;if(o&&o.contentWindow)o.contentWindow.postMessage(r,this.endpoint);else throw Pt()})}};var ma=Object.assign(Hr(Bt,{platform:"web",sdkName:"magic-sdk",version:"28.0.3",defaultEndpoint:"https://auth.magic.link/",ViewController:gt,configureStorage:()=>Pe(void 0,null,function*(){let e=yt.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(Vt),yield e.setDriver([yt.default.INDEXEDDB,yt.default.LOCALSTORAGE,Vt._driver]),e})}),hr({},Gt)),pa=ma;return mi(va);})();
|
12
6
|
if (Magic && Magic.default != null) { Magic = Object.assign(Magic.default, Magic); delete Magic.default; }
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "magic-sdk",
|
3
|
-
"version": "28.0.4-canary.
|
3
|
+
"version": "28.0.4-canary.852ded9.0",
|
4
4
|
"description": "Passwordless authentication for the web.",
|
5
5
|
"author": "Magic Labs <team@magic.link> (https://magic.link/)",
|
6
6
|
"license": "MIT",
|
@@ -29,9 +29,9 @@
|
|
29
29
|
]
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@magic-sdk/commons": "24.0.3-canary.
|
33
|
-
"@magic-sdk/provider": "28.0.3-canary.
|
34
|
-
"@magic-sdk/types": "24.0.2-canary.
|
32
|
+
"@magic-sdk/commons": "24.0.3-canary.852ded9.0",
|
33
|
+
"@magic-sdk/provider": "28.0.3-canary.852ded9.0",
|
34
|
+
"@magic-sdk/types": "24.0.2-canary.852ded9.0",
|
35
35
|
"localforage": "^1.7.4"
|
36
36
|
},
|
37
37
|
"devDependencies": {
|
@@ -40,5 +40,5 @@
|
|
40
40
|
"@babel/runtime": "^7.9.6",
|
41
41
|
"localforage-driver-memory": "^1.0.5"
|
42
42
|
},
|
43
|
-
"gitHead": "
|
43
|
+
"gitHead": "852ded9b793159cb72e28d83bd1f1d69fb55cae0"
|
44
44
|
}
|