magic-sdk 6.0.1 → 6.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/magic.js CHANGED
@@ -1 +1 @@
1
- var Magic=function(){function e(){return(e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function t(e,r){return(t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,r)}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var n,o,i,a,s,u,c,f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function h(e){var t={exports:{}};return e(t,t.exports),t.exports}function d(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function v(e,t,r){return t&&p(e.prototype,t),r&&p(e,r),e}function y(){return(y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function m(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,E(e,t)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function b(e,t,r){return(b=_()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&E(o,r.prototype),o}).apply(null,arguments)}function I(e){var t="function"==typeof Map?new Map:void 0;return(I=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return b(e,arguments,g(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),E(r,e)})(e)}function w(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}h(function(e){var t=function(e){var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,r,n){var o=Object.create((t&&t.prototype instanceof v?t:v).prototype),i=new N(n||[]);return o._invoke=function(e,t,r){var n=f;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return L()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=A(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=c(e,t,r);if("normal"===u.type){if(n=r.done?d:l,u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(e,r,i),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f="suspendedStart",l="suspendedYield",h="executing",d="completed",p={};function v(){}function y(){}function m(){}var g={};g[i]=function(){return this};var E=Object.getPrototypeOf,_=E&&E(E(S([])));_&&_!==r&&n.call(_,i)&&(g=_);var b=m.prototype=v.prototype=Object.create(g);function I(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function w(e,t){function r(o,i,a,s){var u=c(e[o],e,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then(function(e){r("next",e,a,s)},function(e){r("throw",e,a,s)}):t.resolve(l).then(function(e){f.value=e,a(f)},function(e){return r("throw",e,a,s)})}s(u.arg)}var o;this._invoke=function(e,n){function i(){return new t(function(t,o){r(e,n,t,o)})}return o=o?o.then(i,i):i()}}function A(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method))return p;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=c(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function S(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:L}}function L(){return{value:t,done:!0}}return y.prototype=b.constructor=m,m.constructor=y,m[s]=y.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},I(w.prototype),w.prototype[a]=function(){return this},e.AsyncIterator=w,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(e){return e.done?e.value:a.next()})},I(b),b[s]="Generator",b[i]=function(){return this},b.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=S,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}),function(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"}(n||(n={})),function(e){e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE"}(o||(o={})),function(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"}(i||(i={})),function(e){e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.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"}(a||(a={})),function(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"}(s||(s={})),function(e){e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST"}(u||(u={})),function(e){e.Harmony="HARMONY"}(c||(c={}));var A,R={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},O="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e;return(e=console).error.apply(e,["SEMVER"].concat([].slice.call(arguments)))}:function(){},N=(function(e,t){var r=R.MAX_SAFE_COMPONENT_LENGTH,n=(t=e.exports={}).re=[],o=t.src=[],i=t.t={},a=0,s=function(e,t,r){var s=a++;O(s,t),i[e]=s,o[s]=t,n[s]=new RegExp(t,r?"g":void 0)};s("NUMERICIDENTIFIER","0|[1-9]\\d*"),s("NUMERICIDENTIFIERLOOSE","[0-9]+"),s("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),s("MAINVERSION","("+o[i.NUMERICIDENTIFIER]+")\\.("+o[i.NUMERICIDENTIFIER]+")\\.("+o[i.NUMERICIDENTIFIER]+")"),s("MAINVERSIONLOOSE","("+o[i.NUMERICIDENTIFIERLOOSE]+")\\.("+o[i.NUMERICIDENTIFIERLOOSE]+")\\.("+o[i.NUMERICIDENTIFIERLOOSE]+")"),s("PRERELEASEIDENTIFIER","(?:"+o[i.NUMERICIDENTIFIER]+"|"+o[i.NONNUMERICIDENTIFIER]+")"),s("PRERELEASEIDENTIFIERLOOSE","(?:"+o[i.NUMERICIDENTIFIERLOOSE]+"|"+o[i.NONNUMERICIDENTIFIER]+")"),s("PRERELEASE","(?:-("+o[i.PRERELEASEIDENTIFIER]+"(?:\\."+o[i.PRERELEASEIDENTIFIER]+")*))"),s("PRERELEASELOOSE","(?:-?("+o[i.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+o[i.PRERELEASEIDENTIFIERLOOSE]+")*))"),s("BUILDIDENTIFIER","[0-9A-Za-z-]+"),s("BUILD","(?:\\+("+o[i.BUILDIDENTIFIER]+"(?:\\."+o[i.BUILDIDENTIFIER]+")*))"),s("FULLPLAIN","v?"+o[i.MAINVERSION]+o[i.PRERELEASE]+"?"+o[i.BUILD]+"?"),s("FULL","^"+o[i.FULLPLAIN]+"$"),s("LOOSEPLAIN","[v=\\s]*"+o[i.MAINVERSIONLOOSE]+o[i.PRERELEASELOOSE]+"?"+o[i.BUILD]+"?"),s("LOOSE","^"+o[i.LOOSEPLAIN]+"$"),s("GTLT","((?:<|>)?=?)"),s("XRANGEIDENTIFIERLOOSE",o[i.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),s("XRANGEIDENTIFIER",o[i.NUMERICIDENTIFIER]+"|x|X|\\*"),s("XRANGEPLAIN","[v=\\s]*("+o[i.XRANGEIDENTIFIER]+")(?:\\.("+o[i.XRANGEIDENTIFIER]+")(?:\\.("+o[i.XRANGEIDENTIFIER]+")(?:"+o[i.PRERELEASE]+")?"+o[i.BUILD]+"?)?)?"),s("XRANGEPLAINLOOSE","[v=\\s]*("+o[i.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+o[i.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+o[i.XRANGEIDENTIFIERLOOSE]+")(?:"+o[i.PRERELEASELOOSE]+")?"+o[i.BUILD]+"?)?)?"),s("XRANGE","^"+o[i.GTLT]+"\\s*"+o[i.XRANGEPLAIN]+"$"),s("XRANGELOOSE","^"+o[i.GTLT]+"\\s*"+o[i.XRANGEPLAINLOOSE]+"$"),s("COERCE","(^|[^\\d])(\\d{1,"+r+"})(?:\\.(\\d{1,"+r+"}))?(?:\\.(\\d{1,"+r+"}))?(?:$|[^\\d])"),s("COERCERTL",o[i.COERCE],!0),s("LONETILDE","(?:~>?)"),s("TILDETRIM","(\\s*)"+o[i.LONETILDE]+"\\s+",!0),t.tildeTrimReplace="$1~",s("TILDE","^"+o[i.LONETILDE]+o[i.XRANGEPLAIN]+"$"),s("TILDELOOSE","^"+o[i.LONETILDE]+o[i.XRANGEPLAINLOOSE]+"$"),s("LONECARET","(?:\\^)"),s("CARETTRIM","(\\s*)"+o[i.LONECARET]+"\\s+",!0),t.caretTrimReplace="$1^",s("CARET","^"+o[i.LONECARET]+o[i.XRANGEPLAIN]+"$"),s("CARETLOOSE","^"+o[i.LONECARET]+o[i.XRANGEPLAINLOOSE]+"$"),s("COMPARATORLOOSE","^"+o[i.GTLT]+"\\s*("+o[i.LOOSEPLAIN]+")$|^$"),s("COMPARATOR","^"+o[i.GTLT]+"\\s*("+o[i.FULLPLAIN]+")$|^$"),s("COMPARATORTRIM","(\\s*)"+o[i.GTLT]+"\\s*("+o[i.LOOSEPLAIN]+"|"+o[i.XRANGEPLAIN]+")",!0),t.comparatorTrimReplace="$1$2$3",s("HYPHENRANGE","^\\s*("+o[i.XRANGEPLAIN]+")\\s+-\\s+("+o[i.XRANGEPLAIN]+")\\s*$"),s("HYPHENRANGELOOSE","^\\s*("+o[i.XRANGEPLAINLOOSE]+")\\s+-\\s+("+o[i.XRANGEPLAINLOOSE]+")\\s*$"),s("STAR","(<|>)?=?\\s*\\*"),s("GTE0","^\\s*>=\\s*0.0.0\\s*$"),s("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}(A={exports:{}},A.exports),A.exports),S=/^[0-9]+$/,L=R.MAX_LENGTH,T=R.MAX_SAFE_INTEGER,M=N.re,P=N.t,j=function(e,t){var r=S.test(e),n=S.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},C=function(){function e(t,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError("Invalid Version: "+t);if(t.length>L)throw new TypeError("version is longer than "+L+" characters");O("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;var n=t.trim().match(r.loose?M[P.LOOSE]:M[P.FULL]);if(!n)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>T||this.major<0)throw new TypeError("Invalid major version");if(this.minor>T||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>T||this.patch<0)throw new TypeError("Invalid patch version");this.prerelease=n[4]?n[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<T)return t}return e}):[],this.build=n[5]?n[5].split("."):[],this.format()}var t=e.prototype;return t.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},t.toString=function(){return this.version},t.compare=function(t){if(O("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)},t.compareMain=function(t){return t instanceof e||(t=new e(t,this.options)),j(this.major,t.major)||j(this.minor,t.minor)||j(this.patch,t.patch)},t.comparePre=function(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var r=0;do{var n=this.prerelease[r],o=t.prerelease[r];if(O("prerelease compare",r,n,o),void 0===n&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===n)return-1;if(n!==o)return j(n,o)}while(++r)},t.compareBuild=function(t){t instanceof e||(t=new e(t,this.options));var r=0;do{var n=this.build[r],o=t.build[r];if(O("prerelease compare",r,n,o),void 0===n&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===n)return-1;if(n!==o)return j(n,o)}while(++r)},t.inc=function(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":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&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},e}(),k=function(e,t,r){return new C(e,r).compare(new C(t,r))},x=function(e,t,r,n){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return function(e,t,r){return 0===k(e,t,r)}(e,r,n);case"!=":return function(e,t,r){return 0!==k(e,t,r)}(e,r,n);case">":return function(e,t,r){return k(e,t,r)>0}(e,r,n);case">=":return function(e,t,r){return k(e,t,r)>=0}(e,r,n);case"<":return function(e,t,r){return k(e,t,r)<0}(e,r,n);case"<=":return function(e,t,r){return k(e,t,r)<=0}(e,r,n);default:throw new TypeError("Invalid operator: "+t)}},D=Symbol("SemVer ANY"),F=function(){function e(t,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}O("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.value=this.semver===D?"":this.operator+this.semver.version,O("comp",this)}var t=e.prototype;return t.parse=function(e){var t=e.match(this.options.loose?U[G.COMPARATORLOOSE]:U[G.COMPARATOR]);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),this.semver=t[2]?new C(t[2],this.options.loose):D},t.toString=function(){return this.value},t.test=function(e){if(O("Comparator.test",e,this.options.loose),this.semver===D||e===D)return!0;if("string"==typeof e)try{e=new C(e,this.options)}catch(e){return!1}return x(e,this.operator,this.semver,this.options)},t.intersects=function(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),""===this.operator)return""===this.value||new B(t.value,r).test(this.value);if(""===t.operator)return""===t.value||new B(this.value,r).test(t.semver);var n=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),i=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),s=x(this.semver,"<",t.semver,r)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),u=x(this.semver,">",t.semver,r)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return n||o||i&&a||s||u},v(e,null,[{key:"ANY",get:function(){return D}}]),e}(),U=N.re,G=N.t,B=function(){function e(t,r){var n=this;if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof F)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map(function(e){return n.parseRange(e.trim())}).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}var t=e.prototype;return t.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},t.toString=function(){return this.range},t.parseRange=function(e){var t=this,r=this.options.loose;e=(e=e.trim()).replace(r?H[W.HYPHENRANGELOOSE]:H[W.HYPHENRANGE],oe(this.options.includePrerelease)),O("hyphen replace",e),e=e.replace(H[W.COMPARATORTRIM],z),O("comparator trim",e,H[W.COMPARATORTRIM]),e=(e=(e=e.replace(H[W.TILDETRIM],X)).replace(H[W.CARETTRIM],q)).split(/\s+/).join(" ");var n=r?H[W.COMPARATORLOOSE]:H[W.COMPARATOR];return e.split(" ").map(function(e){return K(e,t.options)}).join(" ").split(/\s+/).map(function(e){return ne(e,t.options)}).filter(this.options.loose?function(e){return!!e.match(n)}:function(){return!0}).map(function(e){return new F(e,t.options)})},t.intersects=function(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(function(e){return V(e,r)&&t.set.some(function(t){return V(t,r)&&e.every(function(e){return t.every(function(t){return e.intersects(t,r)})})})})},t.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new C(e,this.options)}catch(e){return!1}for(var t=0;t<this.set.length;t++)if(ie(this.set[t],e,this.options))return!0;return!1},e}(),H=N.re,W=N.t,z=N.comparatorTrimReplace,X=N.tildeTrimReplace,q=N.caretTrimReplace,V=function(e,t){for(var r=!0,n=e.slice(),o=n.pop();r&&n.length;)r=n.every(function(e){return o.intersects(e,t)}),o=n.pop();return r},K=function(e,t){return O("comp",e,t),e=Q(e,t),O("caret",e),e=J(e,t),O("tildes",e),e=ee(e,t),O("xrange",e),e=re(e,t),O("stars",e),e},Y=function(e){return!e||"x"===e.toLowerCase()||"*"===e},J=function(e,t){return e.trim().split(/\s+/).map(function(e){return $(e,t)}).join(" ")},$=function(e,t){return e.replace(t.loose?H[W.TILDELOOSE]:H[W.TILDE],function(t,r,n,o,i){var a;return O("tilde",e,t,r,n,o,i),Y(r)?a="":Y(n)?a=">="+r+".0.0 <"+(+r+1)+".0.0-0":Y(o)?a=">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0-0":i?(O("replaceTilde pr",i),a=">="+r+"."+n+"."+o+"-"+i+" <"+r+"."+(+n+1)+".0-0"):a=">="+r+"."+n+"."+o+" <"+r+"."+(+n+1)+".0-0",O("tilde return",a),a})},Q=function(e,t){return e.trim().split(/\s+/).map(function(e){return Z(e,t)}).join(" ")},Z=function(e,t){O("caret",e,t);var r=t.includePrerelease?"-0":"";return e.replace(t.loose?H[W.CARETLOOSE]:H[W.CARET],function(t,n,o,i,a){var s;return O("caret",e,t,n,o,i,a),Y(n)?s="":Y(o)?s=">="+n+".0.0"+r+" <"+(+n+1)+".0.0-0":Y(i)?s="0"===n?">="+n+"."+o+".0"+r+" <"+n+"."+(+o+1)+".0-0":">="+n+"."+o+".0"+r+" <"+(+n+1)+".0.0-0":a?(O("replaceCaret pr",a),s="0"===n?"0"===o?">="+n+"."+o+"."+i+"-"+a+" <"+n+"."+o+"."+(+i+1)+"-0":">="+n+"."+o+"."+i+"-"+a+" <"+n+"."+(+o+1)+".0-0":">="+n+"."+o+"."+i+"-"+a+" <"+(+n+1)+".0.0-0"):(O("no pr"),s="0"===n?"0"===o?">="+n+"."+o+"."+i+r+" <"+n+"."+o+"."+(+i+1)+"-0":">="+n+"."+o+"."+i+r+" <"+n+"."+(+o+1)+".0-0":">="+n+"."+o+"."+i+" <"+(+n+1)+".0.0-0"),O("caret return",s),s})},ee=function(e,t){return O("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return te(e,t)}).join(" ")},te=function(e,t){return(e=e.trim()).replace(t.loose?H[W.XRANGELOOSE]:H[W.XRANGE],function(r,n,o,i,a,s){O("xRange",e,r,n,o,i,a,s);var u=Y(o),c=u||Y(i),f=c||Y(a);return"="===n&&f&&(n=""),s=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(c&&(i=0),a=0,">"===n?(n=">=",c?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===n&&(n="<",c?o=+o+1:i=+i+1),"<"===n&&(s="-0"),r=n+o+"."+i+"."+a+s):c?r=">="+o+".0.0"+s+" <"+(+o+1)+".0.0-0":f&&(r=">="+o+"."+i+".0"+s+" <"+o+"."+(+i+1)+".0-0"),O("xRange return",r),r})},re=function(e,t){return O("replaceStars",e,t),e.trim().replace(H[W.STAR],"")},ne=function(e,t){return O("replaceGTE0",e,t),e.trim().replace(H[t.includePrerelease?W.GTE0PRE:W.GTE0],"")},oe=function(e){return function(t,r,n,o,i,a,s,u,c,f,l,h,d){return((r=Y(n)?"":Y(o)?">="+n+".0.0"+(e?"-0":""):Y(i)?">="+n+"."+o+".0"+(e?"-0":""):a?">="+r:">="+r+(e?"-0":""))+" "+(u=Y(c)?"":Y(f)?"<"+(+c+1)+".0.0-0":Y(l)?"<"+c+"."+(+f+1)+".0-0":h?"<="+c+"."+f+"."+l+"-"+h:e?"<"+c+"."+f+"."+(+l+1)+"-0":"<="+u)).trim()}},ie=function(e,t,r){for(var n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(var o=0;o<e.length;o++)if(O(e[o].semver),e[o].semver!==F.ANY&&e[o].semver.prerelease.length>0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0},ae=R.MAX_LENGTH,se=N.re,ue=N.t,ce=N.re,fe=N.t;function le(e){return String.fromCharCode(parseInt(e.slice(1),16))}function he(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}function de(e){return t=JSON.stringify(e),btoa(encodeURIComponent(t).replace(/%[0-9A-F]{2}/g,le));var t}function pe(e){return JSON.parse(decodeURIComponent(Array.from(atob(e),he).join("")))}function ve(e){return void 0===e}function ye(e){return function(e){return null===e}(e)||ve(e)}function me(e){if(!e)return!0;for(var t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var ge={},Ee={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn"},_e=function(e){function t(r,n){var o;return(o=e.call(this,"Magic SDK Error: ["+r+"] "+n)||this).code=void 0,o.rawMessage=void 0,o.__proto__=Error,o.code=r,o.rawMessage=n,Object.setPrototypeOf(w(o),t.prototype),o}return m(t,e),t}(I(Error)),be=function(e){function t(r){var n;(n=e.call(this)||this).__proto__=Error,n.code=void 0,n.rawMessage=void 0;var o=Number(null==r?void 0:r.code);return n.rawMessage=(null==r?void 0:r.message)||"Internal error",n.code=function(e){return!ye(e)&&"number"==typeof e&&Object.values(i).includes(e)}(o)?o:i.InternalError,n.message="Magic RPC Error: ["+n.code+"] "+n.rawMessage,Object.setPrototypeOf(w(n),t.prototype),n}return m(t,e),t}(I(Error)),Ie=function(){function e(e,t){this.code=void 0,this.rawMessage=void 0,this.message=void 0,this.code=e,this.rawMessage=t,this.message="Magic SDK Warning: ["+e+"] "+t}return e.prototype.log=function(){console.warn(this.message)},e}(),we=function(e){function t(r,n,o,i){var a;return(a=e.call(this,"Magic Extension Error ("+r.name+"): ["+n+"] "+o)||this).code=void 0,a.rawMessage=void 0,a.data=void 0,a.__proto__=Error,a.code=n,a.rawMessage=o,a.data=i,Object.setPrototypeOf(w(a),t.prototype),a}return m(t,e),t}(I(Error)),Ae=function(){function e(e,t,r){this.code=void 0,this.rawMessage=void 0,this.message=void 0,this.code=t,this.rawMessage=r,this.message="Magic Extension Warning ("+e.name+"): ["+t+"] "+r}return e.prototype.log=function(){console.warn(this.message)},e}();function Re(){return new _e(n.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Oe(){return new _e(n.MalformedResponse,"Response from the Magic iframe is malformed.")}function Ne(e){return new _e(n.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 Se(e){var t="Some extensions are incompatible with `"+ge.sdkName+"@"+ge.version+"`:";return e.filter(function(e){return null!=e.compat}).forEach(function(e){var r=e.compat[ge.sdkName];"string"==typeof r?t+="\n - Extension `"+e.name+"` supports version(s) `"+r+"`":r||(t+="\n - Extension `"+e.name+"` does not support "+ge.platform+" environments.")}),new _e(n.IncompatibleExtensions,t)}function Le(e){var t,r,o;return new _e(n.InvalidArgument,"Invalid "+(o=(t=e.argument+1)%100,(1==(r=t%10)&&11!==o?t+"st":2===r&&12!==o?t+"nd":3===r&&13!==o?t+"rd":t+"th")+" argument given to `")+e.procedure+"`.\n Expected: `"+e.expected+"`\n Received: `"+e.received+"`")}function Te(){return new Ie(o.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 `"+ge.defaultEndpoint+"`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.")}var Me=regeneratorRuntime.mark(Pe);function Pe(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(!(e<Number.MAX_SAFE_INTEGER)){t.next=7;break}return t.next=5,++e;case 5:t.next=8;break;case 7:e=0;case 8:t.next=1;break;case 10:case"end":return t.stop()}},Me)}var je=Pe();function Ce(){return je.next().value}var ke=Symbol("Payload pre-processed by Magic SDK");function xe(e){return Object.defineProperty(e,ke,{value:!0,enumerable:!1}),e}function De(e){var t,r,n;return function(e){return!!e[ke]}(e)||(e.jsonrpc=null!=(t=e.jsonrpc)?t:"2.0",e.id=Ce(),e.method=null!=(r=e.method)?r:"noop",e.params=null!=(n=e.params)?n:[],xe(e)),e}function Fe(e,t){return void 0===t&&(t=[]),xe({params:t,method:e,jsonrpc:"2.0",id:Ce()})}var Ue,Ge=function(){function e(t){this._jsonrpc=void 0,this._id=void 0,this._result=void 0,this._error=void 0,t instanceof e?(this._jsonrpc=t.payload.jsonrpc,this._id=t.payload.id,this._result=t.payload.result,this._error=t.payload.error):function(e){return!ye(e)&&!(ve(e.jsonrpc)||ve(e.id)||ve(e.result)&&ve(e.error))}(t)?(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=t.result,this._error=t.error):(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=void 0,this._error=void 0)}var t=e.prototype;return t.applyError=function(e){return this._error=e,this},t.applyResult=function(e){return this._result=e,this},v(e,[{key:"hasError",get:function(){return null!=this._error}},{key:"hasResult",get:function(){return void 0!==this._result}},{key:"payload",get:function(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}}]),e}(),Be=function(e){function t(){return e.apply(this,arguments)||this}return m(t,e),t}((function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,i||e,a),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=this._events[r?r+e:e];if(!t)return[];if(t.fn)return[t.fn];for(var n=0,o=t.length,i=new Array(o);n<o;n++)i[n]=t[n].fn;return i},s.prototype.listenerCount=function(e){var t=this._events[r?r+e:e];return t?t.fn?1:t.length:0},s.prototype.emit=function(e,t,n,o,i,a){var s=r?r+e:e;if(!this._events[s])return!1;var u,c,f=this._events[s],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,n),!0;case 4:return f.fn.call(f.context,t,n,o),!0;case 5:return f.fn.call(f.context,t,n,o,i),!0;case 6:return f.fn.call(f.context,t,n,o,i,a),!0}for(c=1,u=new Array(l-1);c<l;c++)u[c-1]=arguments[c];f.fn.apply(f.context,u)}else{var h,d=f.length;for(c=0;c<d;c++)switch(f[c].once&&this.removeListener(e,f[c].fn,void 0,!0),l){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,t);break;case 3:f[c].fn.call(f[c].context,t,n);break;case 4:f[c].fn.call(f[c].context,t,n,o);break;default:if(!u)for(h=1,u=new Array(l-1);h<l;h++)u[h-1]=arguments[h];f[c].fn.apply(f[c].context,u)}}return!0},s.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,o){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,i);else{for(var u=0,c=[],f=s.length;u<f;u++)(s[u].fn!==t||o&&!s[u].once||n&&s[u].context!==n)&&c.push(s[u]);c.length?this._events[i]=1===c.length?c[0]:c:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?this._events[t=r?r+e:e]&&a(this,t):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(Ue={exports:{}}),Ue.exports));function He(){var e=new Be;return{emitter:e,createChainingEmitterMethod:function(t,r){return function(){return e[t].apply(e,[].slice.call(arguments)),r}},createBoundEmitterMethod:function(t){return function(){return e[t].apply(e,[].slice.call(arguments))}}}}var We=Symbol("isPromiEvent");function ze(e){return!!e[We]}function Xe(e){var t=qe(e),r=He(),n=r.createBoundEmitterMethod,o=r.createChainingEmitterMethod,i=Symbol("Promise.then"),a=Symbol("Promise.catch"),s=Symbol("Promise.finally"),u=function(e,t){return function(){var r=t[e].apply(t,[].slice.call(arguments));return c(r)}},c=function(e){var t;return Object.assign(e,((t={})[We]=!0,t[i]=e[i]||e.then,t[a]=e[a]||e.catch,t[s]=e[s]||e.finally,t.then=u(i,e),t.catch=u(a,e),t.finally=u(s,e),t.on=o("on",e),t.once=o("once",e),t.addListener=o("addListener",e),t.off=o("off",e),t.removeListener=o("removeListener",e),t.removeAllListeners=o("removeAllListeners",e),t.emit=n("emit"),t.eventNames=n("eventNames"),t.listeners=n("listeners"),t.listenerCount=n("listenerCount"),t))},f=c(t.then(function(e){return f.emit("done",e),f.emit("settled"),e},function(e){throw f.emit("error",e),f.emit("settled"),e}));return f}function qe(e){return new Promise(function(t,r){var n=e(t,r);Promise.resolve(n).catch(r)})}var Ve,Ke=function(){function e(e){this.sdk=void 0,this.sdk=e}return e.prototype.request=function(e){var t=this.overlay.post(u.MAGIC_HANDLE_REQUEST,De(e)),r=Xe(function(e,r){t.then(function(t){if(n(),t.hasError)r(new be(t.payload.error));else{if(!t.hasResult)throw Oe();e(t.payload.result)}}).catch(function(e){n(),r(e)})}),n=this.overlay.on(s.MAGIC_HANDLE_EVENT,function(t){var n,o=t.data.response;if(o.id===e.id&&null!=(n=o.result)&&n.event){var i=o.result,a=i.params;r.emit.apply(r,[i.event].concat(void 0===a?[]:a))}});return r},v(e,[{key:"overlay",get:function(){return this.sdk.overlay}}]),e}(),Ye=function(e){function t(){return e.apply(this,arguments)||this}m(t,e);var r=t.prototype;return r.loginWithMagicLink=function(e){var t=e.showUI,r=Fe(this.sdk.testMode?a.LoginWithMagicLinkTestMode:a.LoginWithMagicLink,[{email:e.email,showUI:void 0===t||t,redirectURI:e.redirectURI}]);return this.request(r)},r.loginWithCredential=function(e){var t=null!=e?e:"";if(!e&&"web"===ge.platform){t=window.location.search;var r=window.location.origin+window.location.pathname;window.history.replaceState(null,"",r)}var n=Fe(this.sdk.testMode?a.LoginWithCredentialTestMode:a.LoginWithCredential,[t]);return this.request(n)},t}(Ke);function Je(e){return function(){try{var t=arguments,r=function(){return Promise.resolve(Ve.ready()).then(function(){var r;return(r=Ve)[e].apply(r,[].slice.call(t))})},n=function(){if(!Ve)return Promise.resolve(ge.configureStorage()).then(function(e){Ve=e})}();return Promise.resolve(n&&n.then?n.then(r):r(n))}catch(e){return Promise.reject(e)}}}var $e=Je("getItem"),Qe=Je("setItem"),Ze=Je("removeItem"),et=Je("clear"),tt=Je("length"),rt=Je("key"),nt=Je("keys"),ot=Je("iterate"),it={__proto__:null,getItem:$e,setItem:Qe,removeItem:Ze,clear:et,length:tt,key:rt,keys:nt,iterate:ot};function at(){var e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=15&e[6]|64,e[8]=191&e[8]|128;var 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))+e[15].toString(16)}var st="STORE_KEY_PRIVATE_KEY",ut="STORE_KEY_PUBLIC_JWK",ct="ECDSA",ft={name:ct,namedCurve:"P-256"},lt={name:ct,namedCurve:"P-256"};function ht(){return window.crypto}function dt(e){return pt(function(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))})}(e))}function pt(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}var vt=function(e){function t(){return e.apply(this,arguments)||this}m(t,e);var r=t.prototype;return r.getIdToken=function(e){var t=Fe(this.sdk.testMode?a.GetIdTokenTestMode:a.GetIdToken,[e]);return this.request(t)},r.generateIdToken=function(e){var t=Fe(this.sdk.testMode?a.GenerateIdTokenTestMode:a.GenerateIdToken,[e]);return this.request(t)},r.getMetadata=function(){var e=Fe(this.sdk.testMode?a.GetMetadataTestMode:a.GetMetadata);return this.request(e)},r.updateEmail=function(e){var t=e.showUI,r=Fe(this.sdk.testMode?a.UpdateEmailTestMode:a.UpdateEmail,[{email:e.email,showUI:void 0===t||t}]);return this.request(r)},r.isLoggedIn=function(){var e=Fe(this.sdk.testMode?a.IsLoggedInTestMode:a.IsLoggedIn);return this.request(e)},r.logout=function(){Ze(ut),Ze(st);var e=Fe(this.sdk.testMode?a.LogoutTestMode:a.Logout);return this.request(e)},t}(Ke),yt=He(),mt=yt.createBoundEmitterMethod,gt=yt.createChainingEmitterMethod,Et=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).isMagic=!0,t.on=gt("on",w(t)),t.once=gt("once",w(t)),t.addListener=gt("addListener",w(t)),t.off=gt("off",w(t)),t.removeListener=gt("removeListener",w(t)),t.removeAllListeners=gt("removeAllListeners",w(t)),t.emit=mt("emit"),t.eventNames=mt("eventNames"),t.listeners=mt("listeners"),t.listenerCount=mt("listenerCount"),t}m(t,e);var r=t.prototype;return r.sendAsync=function(e,t){var r=this;if(!t)throw Le({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:null===t?"null":typeof t});if(Array.isArray(e))this.overlay.post(u.MAGIC_HANDLE_REQUEST,e.map(function(e){var t=De(e);return r.prefixPayloadMethodForTestMode(t),t})).then(function(e){t(null,e.map(function(e){return y({},e.payload,{error:e.hasError?new be(e.payload.error):null})}))});else{var n=De(e);this.prefixPayloadMethodForTestMode(n),this.overlay.post(u.MAGIC_HANDLE_REQUEST,n).then(function(e){t(e.hasError?new be(e.payload.error):null,e.payload)})}},r.send=function(e,t){if("string"==typeof e){var r=Fe(e,Array.isArray(t)?t:[]);return this.request(r)}if(!Array.isArray(e)&&!t){var n=new Ie(o.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.");return n.log(),new Ge(e).applyError({code:-32603,message:n.rawMessage}).payload}this.sendAsync(e,t)},r.enable=function(){var e=Fe("eth_accounts");return this.request(e)},r.request=function(t){return this.prefixPayloadMethodForTestMode(t),e.prototype.request.call(this,t)},r.prefixPayloadMethodForTestMode=function(e){this.sdk.testMode&&(e.method="testMode/eth/"+e.method)},t}(Ke);function _t(e,t){return t?new URL(e,t):new URL(e)}var bt=["request","overlay","sdk"],It=function(e){function t(){var t;(t=e.call(this,void 0)||this).__sdk_access_field_descriptors__=new Map,t.__is_initialized__=!1,t.utils={createPromiEvent:Xe,isPromiEvent:ze,encodeJSON:de,decodeJSON:pe,createJsonRpcRequestPayload:Fe,standardizeJsonRpcRequestPayload:De,storage:it};var r=[w(t)].concat(function(e){for(var t=Object.getPrototypeOf(e),r=[t];t!==Ke.prototype;)t=Object.getPrototypeOf(t),r.push(t);return r}(w(t)));return bt.forEach(function(e){var n=r.map(function(t){return Object.getOwnPropertyDescriptor(t,e)}),o=n.findIndex(function(e){return!!e}),i=n[o];i&&(t.__sdk_access_field_descriptors__.set(e,{descriptor:i,isPrototypeField:o>0}),Object.defineProperty(w(t),e,{configurable:!0,get:function(){throw Ne(e)}}))}),t}m(t,e);var r=t.prototype;return r.init=function(e){var t=this;this.__is_initialized__||(bt.forEach(function(e){if(t.__sdk_access_field_descriptors__.has(e)){var r=t.__sdk_access_field_descriptors__.get(e),n=r.descriptor;r.isPrototypeField?delete t[e]:Object.defineProperty(t,e,n)}}),this.sdk=e,this.__is_initialized__=!0)},r.createDeprecationWarning=function(e){var t=e.useInstead;return new Ae(this,"DEPRECATION_NOTICE","`"+e.method+"` will be removed from this Extension in version `"+e.removalVersion+"`."+(t?" Use `"+t+"` instead.":""))},r.createWarning=function(e,t){return new Ae(this,e,t)},r.createError=function(e,t,r){return new we(this,e,t,r)},t}(Ke),wt=function(e){function t(){return e.apply(this,arguments)||this}return m(t,e),t}(It),At=function(e){function t(){return e.apply(this,arguments)||this}return m(t,e),t}(It);function Rt(e){return!e.compat||null==e.compat[ge.sdkName]||("string"==typeof e.compat[ge.sdkName]?function(e,t,r){try{t=new B(t,void 0)}catch(e){return!1}return t.test(e)}(function(e,t){if(e instanceof C)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;var r=null;if((t=t||{}).rtl){for(var n;(n=ce[fe.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),ce[fe.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;ce[fe.COERCERTL].lastIndex=-1}else r=e.match(ce[fe.COERCE]);return null===r?null:function(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof C)return e;if("string"!=typeof e)return null;if(e.length>ae)return null;if(!(t.loose?se[ue.LOOSE]:se[ue.FULL]).test(e))return null;try{return new C(e,t)}catch(e){return null}}(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),t)}(ge.version),e.compat[ge.sdkName]):!!e.compat[ge.sdkName])}function Ot(e){var t,r=this,n=null!=(t=null==e?void 0:e.extensions)?t:[],o={},i=[];if(Array.isArray(n)?n.forEach(function(e){Rt(e)?(e.init(r),r[e.name]=e,e instanceof At.Internal&&(me(e.config)||(o[e.name]=e.config))):i.push(e)}):Object.keys(n).forEach(function(e){if(Rt(n[e])){n[e].init(r);var t=n[e];r[e]=t,t instanceof At.Internal&&(me(t.config)||(o[n[e].name]=t.config))}else i.push(n[e])}),i.length)throw Se(i);return o}At.Internal=wt;var Nt=function(){function e(e,t){var r;if(this.apiKey=void 0,this.endpoint=void 0,this.parameters=void 0,this.testMode=void 0,this.auth=void 0,this.user=void 0,this.rpcProvider=void 0,this.apiKey=e,!e)throw Re();"react-native"===ge.platform&&null!=t&&t.endpoint&&Te().log();var n=ge.defaultEndpoint,o=ge.version;this.testMode=!(null==t||!t.testMode),this.endpoint=_t(null!=(r=null==t?void 0:t.endpoint)?r:n).origin,this.auth=new Ye(this),this.user=new vt(this),this.rpcProvider=new Et(this);var i=Ot.call(this,t);this.parameters=de({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:null==t?void 0:t.network,host:_t(this.endpoint).host,sdk:Ee[ge.sdkName],version:o,ext:me(i)?void 0:i,locale:(null==t?void 0:t.locale)||"en_US"})}return e.prototype.preload=function(){try{return Promise.resolve(this.overlay.ready).then(function(){})}catch(e){return Promise.reject(e)}},v(e,[{key:"overlay",get:function(){if(!e.__overlays__.has(this.parameters)){var t=new ge.ViewController(this.endpoint,this.parameters);t.init(),e.__overlays__.set(this.parameters,t)}return e.__overlays__.get(this.parameters)}}]),e}();Nt.__overlays__=new Map;var St=function(){function e(e,t){this.endpoint=void 0,this.parameters=void 0,this.ready=void 0,this.messageHandlers=new Set,this.endpoint=e,this.parameters=t,this.ready=this.waitForReady(),this.listen()}var t=e.prototype;return t.post=function(e,t){try{var r=this;return Promise.resolve(qe(function(n){try{return Promise.resolve(r.ready).then(function(){var o=[],i=Array.isArray(t)?t.map(function(e){return e.id}):[];return Promise.resolve(function(e,t){try{return Promise.resolve($e("rt")).then(function(r){function n(){return o?r?{msgType:e,payload:t,jwt:o,rt:r}:{msgType:e,payload:t,jwt:o}:{msgType:e,payload:t}}var o,i=function(){if("web"===ge.platform){var e=function(e,t){try{var r=Promise.resolve(function(){try{return Promise.resolve(function(){try{return t=(e="undefined"!=typeof window&&!!window.crypto)&&!!window.crypto.subtle,e&&t?Promise.resolve($e(ut)).then(function(e){function t(){return $e(ut)}var r=function(){if(!e)return Promise.resolve(function(){try{var e=ht().subtle;return Promise.resolve(e.generateKey(ft,!0,["sign"])).then(function(t){return Promise.resolve(e.exportKey("jwk",t.privateKey)).then(function(r){return Promise.resolve(e.exportKey("jwk",t.publicKey)).then(function(t){return Promise.resolve(e.importKey("jwk",r,lt,!1,["sign"])).then(function(e){return Promise.resolve(Qe(st,e)).then(function(){return Promise.resolve(Qe(ut,t)).then(function(){})})})})})})}catch(e){return Promise.reject(e)}}()).then(function(){})}();return r&&r.then?r.then(t):t()}):(console.info("webcrypto is not supported"),Promise.resolve(void 0))}catch(e){return Promise.reject(e)}var e,t}()).then(function(e){if(e){var t=ht();return Promise.resolve($e(st)).then(function(r){if(r&&t){var n,o={iat:Math.floor((new Date).getTime()/1e3),jti:at()},i=dt(JSON.stringify({typ:"dpop+jwt",alg:"ES256",jwk:e})),a=dt(JSON.stringify(o)),s=(n=i+"."+a,(new TextEncoder).encode(n));return Promise.resolve(t.subtle.sign({name:ct,hash:{name:"SHA-256"}},r,s)).then(function(e){var t,r,n=(t=new Uint8Array(e),r="",t.forEach(function(e){r+=String.fromCharCode(e)}),pt(r));return i+"."+a+"."+n})}console.info("unable to find private key or webcrypto unsupported")})}console.info("unable to create public key")})}catch(e){return Promise.reject(e)}}()).then(function(e){o=e})}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(0,function(e){console.error("webcrypto error",e)});if(e&&e.then)return e.then(function(){})}}();return i&&i.then?i.then(n):n()})}catch(e){return Promise.reject(e)}}(e+"-"+r.parameters,t)).then(function(e){return Promise.resolve(r._post(e)).then(function(){var e,a=r.on(s.MAGIC_HANDLE_RESPONSE,(e=function(){return a()},function(r){var a=function(e,t){var r,n=null==(r=t.data.response)?void 0:r.id,o=function(e,t){return t&&Array.isArray(e)?e.find(function(e){return e.id===t}):e}(e,n);return n&&o?{id:n,response:new Ge(o).applyResult(t.data.response.result).applyError(t.data.response.error)}:{}}(t,r),s=a.id,u=a.response;!function(e){try{e.data.rt?Promise.resolve(Qe("rt",e.data.rt)).then(function(){}):Promise.resolve()}catch(e){return Promise.reject(e)}}(r),s&&u&&Array.isArray(t)&&i.includes(s)?(o.push(u),o.length===t.length&&(e(),n(o))):s&&u&&!Array.isArray(t)&&s===t.id&&(e(),n(u))}))})})})}catch(e){return Promise.reject(e)}}))}catch(e){return Promise.reject(e)}},t.on=function(e,t){var r=this,n=t.bind(window),o=function(t){t.data.msgType===e+"-"+r.parameters&&n(t)};return this.messageHandlers.add(o),function(){return r.messageHandlers.delete(o)}},t.waitForReady=function(){var e=this;return new Promise(function(t){e.on(s.MAGIC_OVERLAY_READY,function(){return t()})})},t.listen=function(){var e=this;this.on(s.MAGIC_HIDE_OVERLAY,function(){e.hideOverlay()}),this.on(s.MAGIC_SHOW_OVERLAY,function(){e.showOverlay()})},e}(),Lt={__proto__:null,Extension:At,ExtensionError:we,ExtensionWarning:Ae,RPCError:be,SDKError:_e,SDKWarning:Ie,isPromiEvent:ze,get EthChainType(){return c},get MagicIncomingWindowMessage(){return s},get MagicOutgoingWindowMessage(){return u},get MagicPayloadMethod(){return a},get RPCErrorCode(){return i},get SDKErrorCode(){return n},get SDKWarningCode(){return o}},Tt=h(function(e,t){e.exports=function e(t,r,n){function o(a,s){if(!r[a]){if(!t[a]){if(!s&&d)return d(a);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){return o(t[a][1][e]||e)},c,c.exports,e,t,r,n)}return r[a].exports}for(var i=d,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(e,t,r){(function(e){var r,n,o=e.MutationObserver||e.WebKitMutationObserver;if(o){var i=0,a=new o(f),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),r=function(){s.data=i=++i%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){f(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(f,0)};else{var u=new e.MessageChannel;u.port1.onmessage=f,r=function(){u.port2.postMessage(0)}}var c=[];function f(){var e,t;n=!0;for(var r=c.length;r;){for(t=c,c=[],e=-1;++e<r;)t[e]();r=c.length}n=!1}t.exports=function(e){1!==c.push(e)||n||r()}}).call(this,void 0!==f?f:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,r){var n=e(1);function o(){}var i={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==o&&d(this,e)}function f(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function l(e,t,r){n(function(){var n;try{n=t(r)}catch(t){return i.reject(e,t)}n===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,n)})}function h(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(e,t){var r=!1;function n(t){r||(r=!0,i.reject(e,t))}function o(t){r||(r=!0,i.resolve(e,t))}var a=p(function(){t(o,n)});"error"===a.status&&n(a.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}t.exports=c,c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var r=new this.constructor(o);return this.state!==u?l(r,this.state===s?e:t,this.outcome):this.queue.push(new f(r,e,t)),r},f.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){l(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){i.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){l(this.promise,this.onRejected,e)},i.resolve=function(e,t){var r=p(h,t);if("error"===r.status)return i.reject(e,r.value);var n=r.value;if(n)d(e,n);else{e.state=s,e.outcome=t;for(var o=-1,a=e.queue.length;++o<a;)e.queue[o].callFulfilled(t)}return e},i.reject=function(e,t){e.state=a,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:i.resolve(new this(o),e)},c.reject=function(e){var t=new this(o);return i.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a=new Array(r),s=0,u=-1,c=new this(o);++u<r;)f(e[u],u);return c;function f(e,o){t.resolve(e).then(function(e){a[o]=e,++s!==r||n||(n=!0,i.resolve(c,a))},function(e){n||(n=!0,i.reject(c,e))})}},c.race=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,r=!1;if(!t)return this.resolve([]);for(var n=-1,a=new this(o);++n<t;)this.resolve(e[n]).then(function(e){r||(r=!0,i.resolve(a,e))},function(e){r||(r=!0,i.reject(a,e))});return a}},{1:1}],3:[function(e,t,r){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==f?f:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,r){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function i(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var a=Promise;function s(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function u(e,t,r){"function"==typeof t&&e.then(t),"function"==typeof r&&e.catch(r)}function c(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function f(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l="local-forage-detect-blob-support",h=void 0,d={},p=Object.prototype.toString,v="readonly",y="readwrite";function m(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),o=0;o<t;o++)n[o]=e.charCodeAt(o);return r}function g(e){var t=d[e.name],r={};r.promise=new a(function(e,t){r.resolve=e,r.reject=t}),t.deferredOperations.push(r),t.dbReady=t.dbReady?t.dbReady.then(function(){return r.promise}):r.promise}function E(e){var t=d[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function _(e,t){var r=d[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function b(e,t){return new a(function(r,n){if(d[e.name]=d[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return r(e.db);g(e),e.db.close()}var i=[e.name];t&&i.push(e.version);var a=o.open.apply(o,i);t&&(a.onupgradeneeded=function(t){var r=a.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(l)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),n(a.error)},a.onsuccess=function(){r(a.result),E(e)}})}function I(e){return b(e,!1)}function w(e){return b(e,!0)}function A(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.version>e.db.version;if(e.version<e.db.version&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),n||r){if(r){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function R(e){return i([m(atob(e.data))],{type:e.type})}function O(e){return e&&e.__local_forage_encoded_blob}function N(e){var t=this,r=t._initReady().then(function(){var e=d[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return u(r,e,e),r}function S(e,t,r,n){void 0===n&&(n=1);try{var o=e.db.transaction(e.storeName,t);r(null,o)}catch(o){if(n>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return a.resolve().then(function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),w(e)}).then(function(){return function(e){g(e);for(var t=d[e.name],r=t.forages,n=0;n<r.length;n++){var o=r[n];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return e.db=null,I(e).then(function(t){return e.db=t,A(e)?w(e):t}).then(function(n){e.db=t.db=n;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n}).catch(function(t){throw _(e,t),t})}(e).then(function(){S(e,t,r,n-1)})}).catch(r);r(o)}}var L={_driver:"asyncStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var o=d[r.name];o||(d[r.name]=o={forages:[],db:null,dbReady:null,deferredOperations:[]}),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=N);var i=[];function s(){return a.resolve()}for(var u=0;u<o.forages.length;u++){var c=o.forages[u];c!==t&&i.push(c._initReady().catch(s))}var f=o.forages.slice(0);return a.all(i).then(function(){return r.db=o.db,I(r)}).then(function(e){return r.db=e,A(r,t._defaultConfig.version)?w(r):e}).then(function(e){r.db=o.db=e,t._dbInfo=r;for(var n=0;n<f.length;n++){var i=f[n];i!==t&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}})},_support:function(){try{if(!o||!o.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var r=this,n=new a(function(t,n){r.ready().then(function(){S(r._dbInfo,v,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).openCursor(),s=1;a.onsuccess=function(){var r=a.result;if(r){var n=r.value;O(n)&&(n=R(n));var o=e(n,r.key,s++);void 0!==o?t(o):r.continue()}else t()},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return s(n,t),n},getItem:function(e,t){var r=this;e=c(e);var n=new a(function(t,n){r.ready().then(function(){S(r._dbInfo,v,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),O(e)&&(e=R(e)),t(e)},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return s(n,t),n},setItem:function(e,t,r){var n=this;e=c(e);var o=new a(function(r,o){var s;n.ready().then(function(){return s=n._dbInfo,"[object Blob]"===p.call(t)?function(e){return"boolean"==typeof h?a.resolve(h):function(e){return new a(function(t){var r=e.transaction(l,y),n=i([""]);r.objectStore(l).put(n,"key"),r.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},r.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!e||parseInt(e[1],10)>=43)}}).catch(function(){return!1})}(e).then(function(e){return h=e})}(s.db).then(function(e){return e?t:(r=t,new a(function(e,t){var n=new FileReader;n.onerror=t,n.onloadend=function(t){var n=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:r.type})},n.readAsBinaryString(r)}));var r}):t}).then(function(t){S(n._dbInfo,y,function(i,a){if(i)return o(i);try{var s=a.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var u=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),r(t)},a.onabort=a.onerror=function(){o(u.error?u.error:u.transaction.error)}}catch(e){o(e)}})}).catch(o)});return s(o,r),o},removeItem:function(e,t){var r=this;e=c(e);var n=new a(function(t,n){r.ready().then(function(){S(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).delete(e);i.oncomplete=function(){t()},i.onerror=function(){n(a.error)},i.onabort=function(){n(a.error?a.error:a.transaction.error)}}catch(e){n(e)}})}).catch(n)});return s(n,t),n},clear:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){S(t._dbInfo,y,function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).clear();o.oncomplete=function(){e()},o.onabort=o.onerror=function(){r(i.error?i.error:i.transaction.error)}}catch(e){r(e)}})}).catch(r)});return s(r,e),r},length:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){S(t._dbInfo,v,function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).count();i.onsuccess=function(){e(i.result)},i.onerror=function(){r(i.error)}}catch(e){r(e)}})}).catch(r)});return s(r,e),r},key:function(e,t){var r=this,n=new a(function(t,n){e<0?t(null):r.ready().then(function(){S(r._dbInfo,v,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName),s=!1,u=a.openKeyCursor();u.onsuccess=function(){var r=u.result;r?0===e||s?t(r.key):(s=!0,r.advance(e)):t(null)},u.onerror=function(){n(u.error)}}catch(e){n(e)}})}).catch(n)});return s(n,t),n},keys:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){S(t._dbInfo,v,function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var t=i.result;t?(a.push(t.key),t.continue()):e(a)},i.onerror=function(){r(i.error)}}catch(e){r(e)}})}).catch(r)});return s(r,e),r},dropInstance:function(e,t){t=f.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,i=this;if(e.name){var u=e.name===r.name&&i._dbInfo.db?a.resolve(i._dbInfo.db):I(e).then(function(t){var r=d[e.name],n=r.forages;r.db=t;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=t;return t});n=u.then(e.storeName?function(t){if(t.objectStoreNames.contains(e.storeName)){var r=t.version+1;g(e);var n=d[e.name],i=n.forages;t.close();for(var s=0;s<i.length;s++){var u=i[s];u._dbInfo.db=null,u._dbInfo.version=r}return new a(function(t,n){var i=o.open(e.name,r);i.onerror=function(e){i.result.close(),n(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}).then(function(e){n.db=e;for(var t=0;t<i.length;t++){var r=i[t];r._dbInfo.db=e,E(r._dbInfo)}}).catch(function(t){throw(_(e,t)||a.resolve()).catch(function(){}),t})}}:function(t){g(e);var r=d[e.name],n=r.forages;t.close();for(var i=0;i<n.length;i++)n[i]._dbInfo.db=null;return new a(function(t,r){var n=o.deleteDatabase(e.name);n.onerror=n.onblocked=function(e){var t=n.result;t&&t.close(),r(e)},n.onsuccess=function(){var e=n.result;e&&e.close(),t(e)}}).then(function(e){r.db=e;for(var t=0;t<n.length;t++)E(n[t]._dbInfo)}).catch(function(t){throw(_(e,t)||a.resolve()).catch(function(){}),t})})}else n=a.reject("Invalid arguments");return s(n,t),n}},T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",M=/^~~local_forage_type~([^~]+)~/,P="__lfsc__:",j=P.length,C="arbf",k="blob",x="si08",D="ui08",F="uic8",U="si16",G="si32",B="ur16",H="ui32",W="fl32",z="fl64",X=j+C.length,q=Object.prototype.toString;function V(e){var t,r,n,o,i,a=.75*e.length,s=e.length,u=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var c=new ArrayBuffer(a),f=new Uint8Array(c);for(t=0;t<s;t+=4)r=T.indexOf(e[t]),n=T.indexOf(e[t+1]),o=T.indexOf(e[t+2]),i=T.indexOf(e[t+3]),f[u++]=r<<2|n>>4,f[u++]=(15&n)<<4|o>>2,f[u++]=(3&o)<<6|63&i;return c}function K(e){var t,r=new Uint8Array(e),n="";for(t=0;t<r.length;t+=3)n+=T[r[t]>>2],n+=T[(3&r[t])<<4|r[t+1]>>4],n+=T[(15&r[t+1])<<2|r[t+2]>>6],n+=T[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}var Y={serialize:function(e,t){var r="";if(e&&(r=q.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===q.call(e.buffer))){var n,o=P;e instanceof ArrayBuffer?(n=e,o+=C):(n=e.buffer,"[object Int8Array]"===r?o+=x:"[object Uint8Array]"===r?o+=D:"[object Uint8ClampedArray]"===r?o+=F:"[object Int16Array]"===r?o+=U:"[object Uint16Array]"===r?o+=B:"[object Int32Array]"===r?o+=G:"[object Uint32Array]"===r?o+=H:"[object Float32Array]"===r?o+=W:"[object Float64Array]"===r?o+=z:t(new Error("Failed to get type for BinaryArray"))),t(o+K(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r="~~local_forage_type~"+e.type+"~"+K(this.result);t("__lfsc__:blob"+r)},i.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}},deserialize:function(e){if(e.substring(0,j)!==P)return JSON.parse(e);var t,r=e.substring(X),n=e.substring(j,X);if(n===k&&M.test(r)){var o=r.match(M);t=o[1],r=r.substring(o[0].length)}var a=V(r);switch(n){case C:return a;case k:return i([a],{type:t});case x:return new Int8Array(a);case D:return new Uint8Array(a);case F:return new Uint8ClampedArray(a);case U:return new Int16Array(a);case B:return new Uint16Array(a);case G:return new Int32Array(a);case H:return new Uint32Array(a);case W:return new Float32Array(a);case z:return new Float64Array(a);default:throw new Error("Unkown type: "+n)}},stringToBuffer:V,bufferToString:K};function J(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function $(e,t,r,n,o,i){e.executeSql(r,n,o,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(e,s){s.rows.length?i(e,a):J(e,t,function(){e.executeSql(r,n,o,i)},i)},i):i(e,a)},i)}function Q(e,t,r,n){var o=this;e=c(e);var i=new a(function(i,a){o.ready().then(function(){void 0===t&&(t=null);var s=t,u=o._dbInfo;u.serializer.serialize(t,function(t,c){c?a(c):u.db.transaction(function(r){$(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,t],function(){i(s)},function(e,t){a(t)})},function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void i(Q.apply(o,[e,s,r,n-1]));a(t)}})})}).catch(a)});return s(i,r),i}function Z(e){return new a(function(t,r){e.transaction(function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(r,n){for(var o=[],i=0;i<n.rows.length;i++)o.push(n.rows.item(i).name);t({db:e,storeNames:o})},function(e,t){r(t)})},function(e){r(e)})})}var ee={_driver:"webSQLStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"!=typeof e[n]?e[n].toString():e[n];var o=new a(function(e,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(e){return n(e)}r.db.transaction(function(o){J(o,r,function(){t._dbInfo=r,e()},function(e,t){n(t)})},n)});return r.serializer=Y,o},_support:"function"==typeof openDatabase,iterate:function(e,t){var r=this,n=new a(function(t,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){$(r,o,"SELECT * FROM "+o.storeName,[],function(r,n){for(var i=n.rows,a=i.length,s=0;s<a;s++){var u=i.item(s),c=u.value;if(c&&(c=o.serializer.deserialize(c)),void 0!==(c=e(c,u.key,s+1)))return void t(c)}t()},function(e,t){n(t)})})}).catch(n)});return s(n,t),n},getItem:function(e,t){var r=this;e=c(e);var n=new a(function(t,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){$(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),t(n)},function(e,t){n(t)})})}).catch(n)});return s(n,t),n},setItem:function(e,t,r){return Q.apply(this,[e,t,r,1])},removeItem:function(e,t){var r=this;e=c(e);var n=new a(function(t,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){$(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],function(){t()},function(e,t){n(t)})})}).catch(n)});return s(n,t),n},clear:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(t){$(t,n,"DELETE FROM "+n.storeName,[],function(){e()},function(e,t){r(t)})})}).catch(r)});return s(r,e),r},length:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(t){$(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(t,r){var n=r.rows.item(0).c;e(n)},function(e,t){r(t)})})}).catch(r)});return s(r,e),r},key:function(e,t){var r=this,n=new a(function(t,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){$(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)},function(e,t){n(t)})})}).catch(n)});return s(n,t),n},keys:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(t){$(t,n,"SELECT key FROM "+n.storeName,[],function(t,r){for(var n=[],o=0;o<r.rows.length;o++)n.push(r.rows.item(o).key);e(n)},function(e,t){r(t)})})}).catch(r)});return s(r,e),r},dropInstance:function(e,t){t=f.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,o=this;return s(n=e.name?new a(function(t){var n;n=e.name===r.name?o._dbInfo.db:openDatabase(e.name,"","",0),t(e.storeName?{db:n,storeNames:[e.storeName]}:Z(n))}).then(function(e){return new a(function(t,r){e.db.transaction(function(n){function o(e){return new a(function(t,r){n.executeSql("DROP TABLE IF EXISTS "+e,[],function(){t()},function(e,t){r(t)})})}for(var i=[],s=0,u=e.storeNames.length;s<u;s++)i.push(o(e.storeNames[s]));a.all(i).then(function(){t()}).catch(function(e){r(e)})},function(e){r(e)})})}):a.reject("Invalid arguments"),t),n}};function te(e,t){var r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}var re={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var r in e)t[r]=e[r];return t.keyPrefix=te(e,this._defaultConfig),!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}()||localStorage.length>0?(this._dbInfo=t,t.serializer=Y,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var r=this,n=r.ready().then(function(){for(var t=r._dbInfo,n=t.keyPrefix,o=n.length,i=localStorage.length,a=1,s=0;s<i;s++){var u=localStorage.key(s);if(0===u.indexOf(n)){var c=localStorage.getItem(u);if(c&&(c=t.serializer.deserialize(c)),void 0!==(c=e(c,u.substring(o),a++)))return c}}});return s(n,t),n},getItem:function(e,t){var r=this;e=c(e);var n=r.ready().then(function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n});return s(n,t),n},setItem:function(e,t,r){var n=this;e=c(e);var o=n.ready().then(function(){void 0===t&&(t=null);var r=t;return new a(function(o,i){var a=n._dbInfo;a.serializer.serialize(t,function(t,n){if(n)i(n);else try{localStorage.setItem(a.keyPrefix+e,t),o(r)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||i(e),i(e)}})})});return s(o,r),o},removeItem:function(e,t){var r=this;e=c(e);var n=r.ready().then(function(){localStorage.removeItem(r._dbInfo.keyPrefix+e)});return s(n,t),n},clear:function(e){var t=this,r=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}});return s(r,e),r},length:function(e){var t=this.keys().then(function(e){return e.length});return s(t,e),t},key:function(e,t){var r=this,n=r.ready().then(function(){var t,n=r._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t});return s(n,t),n},keys:function(e){var t=this,r=t.ready().then(function(){for(var e=t._dbInfo,r=localStorage.length,n=[],o=0;o<r;o++){var i=localStorage.key(o);0===i.indexOf(e.keyPrefix)&&n.push(i.substring(e.keyPrefix.length))}return n});return s(r,e),r},dropInstance:function(e,t){if(t=f.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var n,o=this;return s(n=e.name?new a(function(t){t(e.storeName?te(e,o._defaultConfig):e.name+"/")}).then(function(e){for(var t=localStorage.length-1;t>=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}}):a.reject("Invalid arguments"),t),n}},ne=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},oe=function(e,t){for(var r=e.length,n=0;n<r;){if(ne(e[n],t))return!0;n++}return!1},ie=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ae={},se={},ue={INDEXEDDB:L,WEBSQL:ee,LOCALSTORAGE:re},ce=[ue.INDEXEDDB._driver,ue.WEBSQL._driver,ue.LOCALSTORAGE._driver],fe=["dropInstance"],le=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(fe),he={description:"",driver:ce.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function de(e,t){e[t]=function(){var r=arguments;return e.ready().then(function(){return e[t].apply(e,r)})}}function pe(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var r in t)t.hasOwnProperty(r)&&(arguments[0][r]=ie(t[r])?t[r].slice():t[r])}return arguments[0]}var ve=new(function(){function e(t){for(var r in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ue)if(ue.hasOwnProperty(r)){var n=ue[r],o=n._driver;this[r]=o,ae[o]||this.defineDriver(n)}this._defaultConfig=pe({},he),this._config=pe({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":n(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,r){var n=new a(function(t,r){try{var n=e._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void r(o);for(var i=le.concat("_initStorage"),u=0,c=i.length;u<c;u++){var f=i[u];if((!oe(fe,f)||e[f])&&"function"!=typeof e[f])return void r(o)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),r=a.reject(t);return s(r,arguments[arguments.length-1]),r}},r=0,n=fe.length;r<n;r++){var o=fe[r];e[o]||(e[o]=t(o))}}();var l=function(r){ae[n]&&console.info("Redefining LocalForage driver: "+n),ae[n]=e,se[n]=r,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(l,r):l(!!e._support):l(!0)}catch(e){r(e)}});return u(n,t,r),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,r){var n=ae[e]?a.resolve(ae[e]):a.reject(new Error("Driver not found."));return u(n,t,r),n},e.prototype.getSerializer=function(e){var t=a.resolve(Y);return u(t,e),t},e.prototype.ready=function(e){var t=this,r=t._driverSet.then(function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready});return u(r,e,e),r},e.prototype.setDriver=function(e,t,r){var n=this;ie(e)||(e=[e]);var o=this._getSupportedDrivers(e);function i(){n._config.driver=n.driver()}function s(e){return n._extend(e),i(),n._ready=n._initStorage(n._config),n._ready}var c=null!==this._driverSet?this._driverSet.catch(function(){return a.resolve()}):a.resolve();return this._driverSet=c.then(function(){var e=o[0];return n._dbInfo=null,n._ready=null,n.getDriver(e).then(function(e){n._driver=e._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=function(e){return function(){var t=0;return function r(){for(;t<e.length;){var o=e[t];return t++,n._dbInfo=null,n._ready=null,n.getDriver(o).then(s).catch(r)}i();var u=new Error("No available storage method found.");return n._driverSet=a.reject(u),n._driverSet}()}}(o)})}).catch(function(){i();var e=new Error("No available storage method found.");return n._driverSet=a.reject(e),n._driverSet}),u(this._driverSet,t,r),this._driverSet},e.prototype.supports=function(e){return!!se[e]},e.prototype._extend=function(e){pe(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],r=0,n=e.length;r<n;r++){var o=e[r];this.supports(o)&&t.push(o)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=le.length;e<t;e++)de(this,le[e])},e.prototype.createInstance=function(t){return new e(t)},e}());t.exports=ve},{3:3}]},{},[4])(4)}),Mt=l(h(function(e,t){"undefined"!=typeof self&&self,function(e){var t=/^~~local_forage_type~([^~]+)~/,r="__lfsc__:".length,n=r+"arbf".length,o=Object.prototype.toString;function i(e){var t=.75*e.length,r=e.length;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);for(var n=new ArrayBuffer(t),o=new Uint8Array(n),i=0,a=0;i<r;i+=4){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[i]),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[i+1]),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[i+2]),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[i+3]);o[a++]=s<<2|u>>4,o[a++]=(15&u)<<4|c>>2,o[a++]=(3&c)<<6|63&f}return n}function a(e){for(var t=new Uint8Array(e),r="",n=0;n<t.length;n+=3)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t[n]>>2],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t[n])<<4|t[n+1]>>4],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t[n+1])<<2|t[n+2]>>6],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&t[n+2]];return t.length%3==2?r=r.substring(0,r.length-1)+"=":t.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}function s(e){var t,r;if(null===e||"object"!=typeof e||"isActiveClone"in e)return e;var n=e instanceof Date?new Date(e):e.constructor();try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(Object.keys(e)),i=o.next();!i.done;i=o.next()){var a=i.value;Object.prototype.hasOwnProperty.call(e,a)&&(e.isActiveClone=null,n[a]=s(e[a]),delete e.isActiveClone)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n}function u(e,t){return(e.name||t.name)+"/"+(e.storeName||t.storeName)+"/"}function c(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function f(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function l(e,t){var r=this;if(t=f.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}return{promise:e.name?new Promise(function(t){t(e.storeName?u(e,r._defaultConfig):e.name+"/")}):Promise.reject("Invalid arguments"),callback:t}}function h(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}var d={bufferToString:a,deserialize:function(e){if("__lfsc__:"!==e.substring(0,r))return JSON.parse(e);var o,a=e.substring(n),s=e.substring(r,n);if("blob"===s&&t.test(a)){var u=a.match(t);o=u[1],a=a.substring(u[0].length)}var c=i(a);switch(s){case"arbf":return c;case"blob":return function(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}([c],{type:o});case"si08":return new Int8Array(c);case"ui08":return new Uint8Array(c);case"uic8":return new Uint8ClampedArray(c);case"si16":return new Int16Array(c);case"ur16":return new Uint16Array(c);case"si32":return new Int32Array(c);case"ui32":return new Uint32Array(c);case"fl32":return new Float32Array(c);case"fl64":return new Float64Array(c);default:throw new Error("Unkown type: "+s)}},serialize:function(e,t){var r="";if(e&&(r=o.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===o.call(e.buffer))){var n=void 0,i="__lfsc__:";e instanceof ArrayBuffer?(n=e,i+="arbf"):(n=e.buffer,"[object Int8Array]"===r?i+="si08":"[object Uint8Array]"===r?i+="ui08":"[object Uint8ClampedArray]"===r?i+="uic8":"[object Int16Array]"===r?i+="si16":"[object Uint16Array]"===r?i+="ur16":"[object Int32Array]"===r?i+="si32":"[object Uint32Array]"===r?i+="ui32":"[object Float32Array]"===r?i+="fl32":"[object Float64Array]"===r?i+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(i+a(n))}else if("[object Blob]"===r){var s=new FileReader;s.onload=function(){var r="~~local_forage_type~"+e.type+"~"+a(this.result);t("__lfsc__:blob"+r)},s.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}},stringToBuffer:i},p={},v=function(){function e(e){this.kp=e,this.data={}}return e.resolve=function(t){return p[t]||(p[t]=new e(t)),p[t]},e.prototype.clear=function(){this.data={}},e.prototype.drop=function(){this.clear(),delete p[this.kp]},e.prototype.get=function(e){return this.data[e]},e.prototype.key=function(e){return this.keys()[e]},e.prototype.keys=function(){return Object.keys(this.data)},e.prototype.rm=function(e){delete this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e}();e._support=!0,e._driver="localforage-driver-memory",e._initStorage=function(e){var t=e?s(e):{},r=u(t,this._defaultConfig),n=v.resolve(r);return this._dbInfo=t,this._dbInfo.serializer=d,this._dbInfo.keyPrefix=r,this._dbInfo.mStore=n,Promise.resolve()},e.clear=function(e){var t=this,r=this.ready().then(function(){t._dbInfo.mStore.clear()});return c(r,e),r},e.dropInstance=function(e,t){var r=l.apply(this,arguments),n=r.promise,o=r.callback;return c(n.then(function(e){v.resolve(e).drop()}),o),n},e.getItem=function(e,t){var r=this;e=h(e);var n=this.ready().then(function(){var t=r._dbInfo.mStore.get(e);return null==t?null:r._dbInfo.serializer.deserialize(t)});return c(n,t),n},e.iterate=function(e,t){var r=this,n=this.ready().then(function(){for(var t=r._dbInfo.mStore,n=t.keys(),o=0;o<n.length;o++){var i=t.get(n[o]);if(i&&(i=r._dbInfo.serializer.deserialize(i)),void 0!==(i=e(i,n[o],o+1)))return i}});return c(n,t),n},e.key=function(e,t){var r=this,n=this.ready().then(function(){var t;try{void 0===(t=r._dbInfo.mStore.key(e))&&(t=null)}catch(e){t=null}return t});return c(n,t),n},e.keys=function(e){var t=this,r=this.ready().then(function(){return t._dbInfo.mStore.keys()});return c(r,e),r},e.length=function(e){var t=this.keys().then(function(e){return e.length});return c(t,e),t},e.removeItem=function(e,t){var r=this;e=h(e);var n=this.ready().then(function(){r._dbInfo.mStore.rm(e)});return c(n,t),n},e.setItem=function(e,t,r){var n=this;e=h(e);var o=this.ready().then(function(){void 0===t&&(t=null);var r=t;return new Promise(function(o,i){n._dbInfo.serializer.serialize(t,function(t,a){if(a)i(a);else try{n._dbInfo.mStore.set(e,t),o(r)}catch(e){i(e)}})})});return c(o,r),o},Object.defineProperty(e,"__esModule",{value:!0})}(t)})),Pt={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"},jt=function(e,t){return Object.assign(ge,t),e}(Nt,{platform:"web",sdkName:"magic-sdk",version:"6.0.1",defaultEndpoint:"https://auth.magic.link/",ViewController:function(e){var i,a;function s(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).iframe=void 0,t.activeElement=null,t}a=e,(i=s).prototype=Object.create(a.prototype),i.prototype.constructor=i,t(i,a);var u=s.prototype;return u.init=function(){var e=this;this.test="hello",this.iframe=new Promise(function(t){var r=function(){if(n=encodeURIComponent(e.parameters),i=[].slice.call(document.querySelectorAll(".magic-iframe")),Boolean(i.find(function(e){return e.src.includes(n)})))new Ie(o.DuplicateIframe,"Duplicate iframes found.").log();else{var r=document.createElement("iframe");r.classList.add("magic-iframe"),r.dataset.magicIframeLabel=_t(e.endpoint).host,r.title="Secure Modal",r.src=_t("/send?params="+encodeURIComponent(e.parameters),e.endpoint).href,function(e){for(var t=0,r=Object.entries(Pt);t<r.length;t++){var n=r[t];e.style[n[0]]=n[1]}}(r),document.body.appendChild(r),t(r)}var n,i};["loaded","interactive","complete"].includes(document.readyState)?r():window.addEventListener("load",r,!1)}),window.addEventListener("message",function(t){if(t.origin===e.endpoint&&t.data&&t.data.msgType&&e.messageHandlers.size){var n;t.data.response=null!=(n=t.data.response)?n:{};for(var o,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.messageHandlers.values());!(o=i()).done;)(0,o.value)(t)}})},u.showOverlay=function(){try{var e=this;return Promise.resolve(e.iframe).then(function(t){t.style.display="block",e.activeElement=document.activeElement,t.focus()})}catch(e){return Promise.reject(e)}},u.hideOverlay=function(){try{var e=this;return Promise.resolve(e.iframe).then(function(t){var r;t.style.display="none",null!==(r=e.activeElement)&&void 0!==r&&r.focus&&e.activeElement.focus(),e.activeElement=null})}catch(e){return Promise.reject(e)}},u._post=function(e){try{var t=this;return Promise.resolve(t.iframe).then(function(r){if(!r||!r.contentWindow)throw new _e(n.ModalNotReady,"Modal is not ready.");r.contentWindow.postMessage(e,t.endpoint)})}catch(e){return Promise.reject(e)}},s}(St),configureStorage:function(){try{var e=Tt.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return Promise.resolve(e.defineDriver(Mt)).then(function(){return Promise.resolve(e.setDriver([Tt.INDEXEDDB,Tt.LOCALSTORAGE,Mt._driver])).then(function(){return e})})}catch(e){return Promise.reject(e)}}});return Object.assign(jt,e({},Lt)),jt}();
1
+ var Magic=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i(e,t)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function s(e,t,r){return(s=a()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&i(o,r.prototype),o}).apply(null,arguments)}function u(e){var t="function"==typeof Map?new Map:void 0;return(u=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return s(e,arguments,o(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),i(r,e)})(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var l,h,d,p,v,y,m,g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function E(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _(e){var t={exports:{}};return e(t,t.exports),t.exports}function b(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}_(function(e){var t=function(e){var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,r,n){var o=Object.create((t&&t.prototype instanceof v?t:v).prototype),i=new N(n||[]);return o._invoke=function(e,t,r){var n=f;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return L()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=R(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=c(e,t,r);if("normal"===u.type){if(n=r.done?d:l,u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(e,r,i),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f="suspendedStart",l="suspendedYield",h="executing",d="completed",p={};function v(){}function y(){}function m(){}var g={};g[i]=function(){return this};var E=Object.getPrototypeOf,_=E&&E(E(S([])));_&&_!==r&&n.call(_,i)&&(g=_);var b=m.prototype=v.prototype=Object.create(g);function I(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function w(e,t){function r(o,i,a,s){var u=c(e[o],e,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then(function(e){r("next",e,a,s)},function(e){r("throw",e,a,s)}):t.resolve(l).then(function(e){f.value=e,a(f)},function(e){return r("throw",e,a,s)})}s(u.arg)}var o;this._invoke=function(e,n){function i(){return new t(function(t,o){r(e,n,t,o)})}return o=o?o.then(i,i):i()}}function R(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,R(e,r),"throw"===r.method))return p;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=c(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function S(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:L}}function L(){return{value:t,done:!0}}return y.prototype=b.constructor=m,m.constructor=y,m[s]=y.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},I(w.prototype),w.prototype[a]=function(){return this},e.AsyncIterator=w,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(e){return e.done?e.value:a.next()})},I(b),b[s]="Generator",b[i]=function(){return this},b.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=S,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}),function(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"}(l||(l={})),function(e){e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE"}(h||(h={})),function(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"}(d||(d={})),function(e){e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.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"}(p||(p={})),function(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"}(v||(v={})),function(e){e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST"}(y||(y={})),function(e){e.Harmony="HARMONY"}(m||(m={}));var I=function(){try{var e;return Promise.resolve(function(){try{var e,t=function(t){if(e)return t;console.info("webcrypto is not supported")},r=function(){if(function(){var e="undefined"!=typeof window&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}())return e=1,Promise.resolve(Xe("STORE_KEY_PUBLIC_JWK")).then(function(e){function t(e){return Xe("STORE_KEY_PUBLIC_JWK")}return e?t():Promise.resolve(function(){try{return ot(),Promise.resolve(d.generateKey(rt,!0,["sign"])).then(function(e){return Promise.resolve(d.exportKey("jwk",e.privateKey)).then(function(t){return Promise.resolve(d.exportKey("jwk",e.publicKey)).then(function(e){return Promise.resolve(d.importKey("jwk",t,nt,!1,["sign"])).then(function(t){return Promise.resolve(qe("STORE_KEY_PRIVATE_KEY",t)).then(function(){return Promise.resolve(qe("STORE_KEY_PUBLIC_JWK",e)).then(function(e){})})})})})})}catch(e){return Promise.reject(e)}}()).then(t)})}();return Promise.resolve(r&&r.then?r.then(t):t(r))}catch(e){return Promise.reject(e)}}()).then(function(t){if(t){var r=ot();return Promise.resolve(Xe("STORE_KEY_PRIVATE_KEY")).then(function(n){if(n&&r){var o={iat:Math.floor((new Date).getTime()/1e3),jti:tt()},i=it(JSON.stringify({typ:"dpop+jwt",alg:"ES256",jwk:t})),a=it(JSON.stringify(o)),s=(e=i+"."+a,(new TextEncoder).encode(e));return Promise.resolve(r.subtle.sign({name:"ECDSA",hash:{name:"SHA-256"}},n,s)).then(function(e){return i+"."+a+"."+function(e){var t="";return e.forEach(function(e){t+=String.fromCharCode(e)}),at(t)}(new Uint8Array(e))})}console.info("unable to find private key or webcrypto unsupported")})}console.info("unable to create public key")})}catch(e){return Promise.reject(e)}},w={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},R="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e;return(e=console).error.apply(e,["SEMVER"].concat([].slice.call(arguments)))}:function(){},A=function(e){var t={exports:{}};return function(e,t){var r=w.MAX_SAFE_COMPONENT_LENGTH,n=(t=e.exports={}).re=[],o=t.src=[],i=t.t={},a=0,s=function(e,t,r){var s=a++;R(s,t),i[e]=s,o[s]=t,n[s]=new RegExp(t,r?"g":void 0)};s("NUMERICIDENTIFIER","0|[1-9]\\d*"),s("NUMERICIDENTIFIERLOOSE","[0-9]+"),s("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),s("MAINVERSION","("+o[i.NUMERICIDENTIFIER]+")\\.("+o[i.NUMERICIDENTIFIER]+")\\.("+o[i.NUMERICIDENTIFIER]+")"),s("MAINVERSIONLOOSE","("+o[i.NUMERICIDENTIFIERLOOSE]+")\\.("+o[i.NUMERICIDENTIFIERLOOSE]+")\\.("+o[i.NUMERICIDENTIFIERLOOSE]+")"),s("PRERELEASEIDENTIFIER","(?:"+o[i.NUMERICIDENTIFIER]+"|"+o[i.NONNUMERICIDENTIFIER]+")"),s("PRERELEASEIDENTIFIERLOOSE","(?:"+o[i.NUMERICIDENTIFIERLOOSE]+"|"+o[i.NONNUMERICIDENTIFIER]+")"),s("PRERELEASE","(?:-("+o[i.PRERELEASEIDENTIFIER]+"(?:\\."+o[i.PRERELEASEIDENTIFIER]+")*))"),s("PRERELEASELOOSE","(?:-?("+o[i.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+o[i.PRERELEASEIDENTIFIERLOOSE]+")*))"),s("BUILDIDENTIFIER","[0-9A-Za-z-]+"),s("BUILD","(?:\\+("+o[i.BUILDIDENTIFIER]+"(?:\\."+o[i.BUILDIDENTIFIER]+")*))"),s("FULLPLAIN","v?"+o[i.MAINVERSION]+o[i.PRERELEASE]+"?"+o[i.BUILD]+"?"),s("FULL","^"+o[i.FULLPLAIN]+"$"),s("LOOSEPLAIN","[v=\\s]*"+o[i.MAINVERSIONLOOSE]+o[i.PRERELEASELOOSE]+"?"+o[i.BUILD]+"?"),s("LOOSE","^"+o[i.LOOSEPLAIN]+"$"),s("GTLT","((?:<|>)?=?)"),s("XRANGEIDENTIFIERLOOSE",o[i.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),s("XRANGEIDENTIFIER",o[i.NUMERICIDENTIFIER]+"|x|X|\\*"),s("XRANGEPLAIN","[v=\\s]*("+o[i.XRANGEIDENTIFIER]+")(?:\\.("+o[i.XRANGEIDENTIFIER]+")(?:\\.("+o[i.XRANGEIDENTIFIER]+")(?:"+o[i.PRERELEASE]+")?"+o[i.BUILD]+"?)?)?"),s("XRANGEPLAINLOOSE","[v=\\s]*("+o[i.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+o[i.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+o[i.XRANGEIDENTIFIERLOOSE]+")(?:"+o[i.PRERELEASELOOSE]+")?"+o[i.BUILD]+"?)?)?"),s("XRANGE","^"+o[i.GTLT]+"\\s*"+o[i.XRANGEPLAIN]+"$"),s("XRANGELOOSE","^"+o[i.GTLT]+"\\s*"+o[i.XRANGEPLAINLOOSE]+"$"),s("COERCE","(^|[^\\d])(\\d{1,"+r+"})(?:\\.(\\d{1,"+r+"}))?(?:\\.(\\d{1,"+r+"}))?(?:$|[^\\d])"),s("COERCERTL",o[i.COERCE],!0),s("LONETILDE","(?:~>?)"),s("TILDETRIM","(\\s*)"+o[i.LONETILDE]+"\\s+",!0),t.tildeTrimReplace="$1~",s("TILDE","^"+o[i.LONETILDE]+o[i.XRANGEPLAIN]+"$"),s("TILDELOOSE","^"+o[i.LONETILDE]+o[i.XRANGEPLAINLOOSE]+"$"),s("LONECARET","(?:\\^)"),s("CARETTRIM","(\\s*)"+o[i.LONECARET]+"\\s+",!0),t.caretTrimReplace="$1^",s("CARET","^"+o[i.LONECARET]+o[i.XRANGEPLAIN]+"$"),s("CARETLOOSE","^"+o[i.LONECARET]+o[i.XRANGEPLAINLOOSE]+"$"),s("COMPARATORLOOSE","^"+o[i.GTLT]+"\\s*("+o[i.LOOSEPLAIN]+")$|^$"),s("COMPARATOR","^"+o[i.GTLT]+"\\s*("+o[i.FULLPLAIN]+")$|^$"),s("COMPARATORTRIM","(\\s*)"+o[i.GTLT]+"\\s*("+o[i.LOOSEPLAIN]+"|"+o[i.XRANGEPLAIN]+")",!0),t.comparatorTrimReplace="$1$2$3",s("HYPHENRANGE","^\\s*("+o[i.XRANGEPLAIN]+")\\s+-\\s+("+o[i.XRANGEPLAIN]+")\\s*$"),s("HYPHENRANGELOOSE","^\\s*("+o[i.XRANGEPLAINLOOSE]+")\\s+-\\s+("+o[i.XRANGEPLAINLOOSE]+")\\s*$"),s("STAR","(<|>)?=?\\s*\\*"),s("GTE0","^\\s*>=\\s*0.0.0\\s*$"),s("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}(t,t.exports),t.exports}(),O=/^[0-9]+$/,N=w.MAX_LENGTH,S=w.MAX_SAFE_INTEGER,L=A.re,T=A.t,M=function(e,t){var r=O.test(e),n=O.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},P=function(){function e(t,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError("Invalid Version: "+t);if(t.length>N)throw new TypeError("version is longer than "+N+" characters");R("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;var n=t.trim().match(r.loose?L[T.LOOSE]:L[T.FULL]);if(!n)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>S||this.major<0)throw new TypeError("Invalid major version");if(this.minor>S||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>S||this.patch<0)throw new TypeError("Invalid patch version");this.prerelease=n[4]?n[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<S)return t}return e}):[],this.build=n[5]?n[5].split("."):[],this.format()}var t=e.prototype;return t.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},t.toString=function(){return this.version},t.compare=function(t){if(R("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)},t.compareMain=function(t){return t instanceof e||(t=new e(t,this.options)),M(this.major,t.major)||M(this.minor,t.minor)||M(this.patch,t.patch)},t.comparePre=function(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var r=0;do{var n=this.prerelease[r],o=t.prerelease[r];if(R("prerelease compare",r,n,o),void 0===n&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===n)return-1;if(n!==o)return M(n,o)}while(++r)},t.compareBuild=function(t){t instanceof e||(t=new e(t,this.options));var r=0;do{var n=this.build[r],o=t.build[r];if(R("prerelease compare",r,n,o),void 0===n&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===n)return-1;if(n!==o)return M(n,o)}while(++r)},t.inc=function(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":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&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},e}(),j=function(e,t,r){return new P(e,r).compare(new P(t,r))},C=function(e,t,r,n){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return function(e,t,r){return 0===j(e,t,r)}(e,r,n);case"!=":return function(e,t,r){return 0!==j(e,t,r)}(e,r,n);case">":return function(e,t,r){return j(e,t,r)>0}(e,r,n);case">=":return function(e,t,r){return j(e,t,r)>=0}(e,r,n);case"<":return function(e,t,r){return j(e,t,r)<0}(e,r,n);case"<=":return function(e,t,r){return j(e,t,r)<=0}(e,r,n);default:throw new TypeError("Invalid operator: "+t)}},k=Symbol("SemVer ANY"),D=function(){function e(t,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}R("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.value=this.semver===k?"":this.operator+this.semver.version,R("comp",this)}var r=e.prototype;return r.parse=function(e){var t=e.match(this.options.loose?x[F.COMPARATORLOOSE]:x[F.COMPARATOR]);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),this.semver=t[2]?new P(t[2],this.options.loose):k},r.toString=function(){return this.value},r.test=function(e){if(R("Comparator.test",e,this.options.loose),this.semver===k||e===k)return!0;if("string"==typeof e)try{e=new P(e,this.options)}catch(e){return!1}return C(e,this.operator,this.semver,this.options)},r.intersects=function(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),""===this.operator)return""===this.value||new U(t.value,r).test(this.value);if(""===t.operator)return""===t.value||new U(this.value,r).test(t.semver);var n=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),i=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),s=C(this.semver,"<",t.semver,r)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),u=C(this.semver,">",t.semver,r)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return n||o||i&&a||s||u},t(e,null,[{key:"ANY",get:function(){return k}}]),e}(),x=A.re,F=A.t,U=function(){function e(t,r){var n=this;if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof D)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map(function(e){return n.parseRange(e.trim())}).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}var t=e.prototype;return t.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},t.toString=function(){return this.range},t.parseRange=function(e){var t=this,r=this.options.loose;e=(e=e.trim()).replace(r?G[B.HYPHENRANGELOOSE]:G[B.HYPHENRANGE],re(this.options.includePrerelease)),R("hyphen replace",e),e=e.replace(G[B.COMPARATORTRIM],W),R("comparator trim",e,G[B.COMPARATORTRIM]),e=(e=(e=e.replace(G[B.TILDETRIM],H)).replace(G[B.CARETTRIM],z)).split(/\s+/).join(" ");var n=r?G[B.COMPARATORLOOSE]:G[B.COMPARATOR];return e.split(" ").map(function(e){return X(e,t.options)}).join(" ").split(/\s+/).map(function(e){return te(e,t.options)}).filter(this.options.loose?function(e){return!!e.match(n)}:function(){return!0}).map(function(e){return new D(e,t.options)})},t.intersects=function(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(function(e){return K(e,r)&&t.set.some(function(t){return K(t,r)&&e.every(function(e){return t.every(function(t){return e.intersects(t,r)})})})})},t.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new P(e,this.options)}catch(e){return!1}for(var t=0;t<this.set.length;t++)if(ne(this.set[t],e,this.options))return!0;return!1},e}(),G=A.re,B=A.t,W=A.comparatorTrimReplace,H=A.tildeTrimReplace,z=A.caretTrimReplace,K=function(e,t){for(var r=!0,n=e.slice(),o=n.pop();r&&n.length;)r=n.every(function(e){return o.intersects(e,t)}),o=n.pop();return r},X=function(e,t){return R("comp",e,t),e=J(e,t),R("caret",e),e=V(e,t),R("tildes",e),e=Q(e,t),R("xrange",e),e=ee(e,t),R("stars",e),e},q=function(e){return!e||"x"===e.toLowerCase()||"*"===e},V=function(e,t){return e.trim().split(/\s+/).map(function(e){return Y(e,t)}).join(" ")},Y=function(e,t){return e.replace(t.loose?G[B.TILDELOOSE]:G[B.TILDE],function(t,r,n,o,i){var a;return R("tilde",e,t,r,n,o,i),q(r)?a="":q(n)?a=">="+r+".0.0 <"+(+r+1)+".0.0-0":q(o)?a=">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0-0":i?(R("replaceTilde pr",i),a=">="+r+"."+n+"."+o+"-"+i+" <"+r+"."+(+n+1)+".0-0"):a=">="+r+"."+n+"."+o+" <"+r+"."+(+n+1)+".0-0",R("tilde return",a),a})},J=function(e,t){return e.trim().split(/\s+/).map(function(e){return $(e,t)}).join(" ")},$=function(e,t){R("caret",e,t);var r=t.includePrerelease?"-0":"";return e.replace(t.loose?G[B.CARETLOOSE]:G[B.CARET],function(t,n,o,i,a){var s;return R("caret",e,t,n,o,i,a),q(n)?s="":q(o)?s=">="+n+".0.0"+r+" <"+(+n+1)+".0.0-0":q(i)?s="0"===n?">="+n+"."+o+".0"+r+" <"+n+"."+(+o+1)+".0-0":">="+n+"."+o+".0"+r+" <"+(+n+1)+".0.0-0":a?(R("replaceCaret pr",a),s="0"===n?"0"===o?">="+n+"."+o+"."+i+"-"+a+" <"+n+"."+o+"."+(+i+1)+"-0":">="+n+"."+o+"."+i+"-"+a+" <"+n+"."+(+o+1)+".0-0":">="+n+"."+o+"."+i+"-"+a+" <"+(+n+1)+".0.0-0"):(R("no pr"),s="0"===n?"0"===o?">="+n+"."+o+"."+i+r+" <"+n+"."+o+"."+(+i+1)+"-0":">="+n+"."+o+"."+i+r+" <"+n+"."+(+o+1)+".0-0":">="+n+"."+o+"."+i+" <"+(+n+1)+".0.0-0"),R("caret return",s),s})},Q=function(e,t){return R("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return Z(e,t)}).join(" ")},Z=function(e,t){return(e=e.trim()).replace(t.loose?G[B.XRANGELOOSE]:G[B.XRANGE],function(r,n,o,i,a,s){R("xRange",e,r,n,o,i,a,s);var u=q(o),c=u||q(i),f=c||q(a);return"="===n&&f&&(n=""),s=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(c&&(i=0),a=0,">"===n?(n=">=",c?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===n&&(n="<",c?o=+o+1:i=+i+1),"<"===n&&(s="-0"),r=n+o+"."+i+"."+a+s):c?r=">="+o+".0.0"+s+" <"+(+o+1)+".0.0-0":f&&(r=">="+o+"."+i+".0"+s+" <"+o+"."+(+i+1)+".0-0"),R("xRange return",r),r})},ee=function(e,t){return R("replaceStars",e,t),e.trim().replace(G[B.STAR],"")},te=function(e,t){return R("replaceGTE0",e,t),e.trim().replace(G[t.includePrerelease?B.GTE0PRE:B.GTE0],"")},re=function(e){return function(t,r,n,o,i,a,s,u,c,f,l,h,d){return((r=q(n)?"":q(o)?">="+n+".0.0"+(e?"-0":""):q(i)?">="+n+"."+o+".0"+(e?"-0":""):a?">="+r:">="+r+(e?"-0":""))+" "+(u=q(c)?"":q(f)?"<"+(+c+1)+".0.0-0":q(l)?"<"+c+"."+(+f+1)+".0-0":h?"<="+c+"."+f+"."+l+"-"+h:e?"<"+c+"."+f+"."+(+l+1)+"-0":"<="+u)).trim()}},ne=function(e,t,r){for(var n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(var o=0;o<e.length;o++)if(R(e[o].semver),e[o].semver!==D.ANY&&e[o].semver.prerelease.length>0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0},oe=w.MAX_LENGTH,ie=A.re,ae=A.t,se=A.re,ue=A.t;function ce(e){return String.fromCharCode(parseInt(e.slice(1),16))}function fe(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}function le(e){return t=JSON.stringify(e),btoa(encodeURIComponent(t).replace(/%[0-9A-F]{2}/g,ce));var t}function he(e){return JSON.parse(decodeURIComponent(Array.from(atob(e),fe).join("")))}function de(e){return void 0===e}function pe(e){return function(e){return null===e}(e)||de(e)}function ve(e){if(!e)return!0;for(var t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var ye={},me={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn"},ge=function(e){function t(r,n){var o;return(o=e.call(this,"Magic SDK Error: ["+r+"] "+n)||this).code=void 0,o.rawMessage=void 0,o.__proto__=Error,o.code=r,o.rawMessage=n,Object.setPrototypeOf(c(o),t.prototype),o}return n(t,e),t}(u(Error)),Ee=function(e){function t(r){var n;(n=e.call(this)||this).__proto__=Error,n.code=void 0,n.rawMessage=void 0;var o=Number(null==r?void 0:r.code);return n.rawMessage=(null==r?void 0:r.message)||"Internal error",n.code=function(e){return!pe(e)&&"number"==typeof e&&Object.values(d).includes(e)}(o)?o:d.InternalError,n.message="Magic RPC Error: ["+n.code+"] "+n.rawMessage,Object.setPrototypeOf(c(n),t.prototype),n}return n(t,e),t}(u(Error)),_e=function(){function e(e,t){this.code=void 0,this.rawMessage=void 0,this.message=void 0,this.code=e,this.rawMessage=t,this.message="Magic SDK Warning: ["+e+"] "+t}return e.prototype.log=function(){console.warn(this.message)},e}(),be=function(e){function t(r,n,o,i){var a;return(a=e.call(this,"Magic Extension Error ("+r.name+"): ["+n+"] "+o)||this).code=void 0,a.rawMessage=void 0,a.data=void 0,a.__proto__=Error,a.code=n,a.rawMessage=o,a.data=i,Object.setPrototypeOf(c(a),t.prototype),a}return n(t,e),t}(u(Error)),Ie=function(){function e(e,t,r){this.code=void 0,this.rawMessage=void 0,this.message=void 0,this.code=t,this.rawMessage=r,this.message="Magic Extension Warning ("+e.name+"): ["+t+"] "+r}return e.prototype.log=function(){console.warn(this.message)},e}();function we(){return new ge(l.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Re(){return new ge(l.MalformedResponse,"Response from the Magic iframe is malformed.")}function Ae(e){return new ge(l.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 Oe(e){var t="Some extensions are incompatible with `"+ye.sdkName+"@"+ye.version+"`:";return e.filter(function(e){return null!=e.compat}).forEach(function(e){var r=e.compat[ye.sdkName];"string"==typeof r?t+="\n - Extension `"+e.name+"` supports version(s) `"+r+"`":r||(t+="\n - Extension `"+e.name+"` does not support "+ye.platform+" environments.")}),new ge(l.IncompatibleExtensions,t)}function Ne(e){return new ge(l.InvalidArgument,"Invalid "+function(e){var t=e+1,r=t%10,n=t%100;return 1===r&&11!==n?t+"st":2===r&&12!==n?t+"nd":3===r&&13!==n?t+"rd":t+"th"}(e.argument)+" argument given to `"+e.procedure+"`.\n Expected: `"+e.expected+"`\n Received: `"+e.received+"`")}var Se=regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<Number.MAX_SAFE_INTEGER)){e.next=6;break}return e.next=4,++t;case 4:e.next=7;break;case 6:t=0;case 7:e.next=1;break;case 9:case"end":return e.stop()}},e)})();function Le(){return Se.next().value}var Te=Symbol("Payload pre-processed by Magic SDK");function Me(e){return Object.defineProperty(e,Te,{value:!0,enumerable:!1}),e}function Pe(e){var t,r,n;return function(e){return!!e[Te]}(e)||(e.jsonrpc=null!=(t=e.jsonrpc)?t:"2.0",e.id=Le(),e.method=null!=(r=e.method)?r:"noop",e.params=null!=(n=e.params)?n:[],Me(e)),e}function je(e,t){return void 0===t&&(t=[]),Me({params:t,method:e,jsonrpc:"2.0",id:Le()})}var Ce,ke=function(){function e(t){this._jsonrpc=void 0,this._id=void 0,this._result=void 0,this._error=void 0,t instanceof e?(this._jsonrpc=t.payload.jsonrpc,this._id=t.payload.id,this._result=t.payload.result,this._error=t.payload.error):function(e){return!pe(e)&&!(de(e.jsonrpc)||de(e.id)||de(e.result)&&de(e.error))}(t)?(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=t.result,this._error=t.error):(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=void 0,this._error=void 0)}var r=e.prototype;return r.applyError=function(e){return this._error=e,this},r.applyResult=function(e){return this._result=e,this},t(e,[{key:"hasError",get:function(){return null!=this._error}},{key:"hasResult",get:function(){return void 0!==this._result}},{key:"payload",get:function(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}}]),e}(),De=function(e){function t(){return e.apply(this,arguments)||this}return n(t,e),t}((function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,i||e,a),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=this._events[r?r+e:e];if(!t)return[];if(t.fn)return[t.fn];for(var n=0,o=t.length,i=new Array(o);n<o;n++)i[n]=t[n].fn;return i},s.prototype.listenerCount=function(e){var t=this._events[r?r+e:e];return t?t.fn?1:t.length:0},s.prototype.emit=function(e,t,n,o,i,a){var s=r?r+e:e;if(!this._events[s])return!1;var u,c,f=this._events[s],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,n),!0;case 4:return f.fn.call(f.context,t,n,o),!0;case 5:return f.fn.call(f.context,t,n,o,i),!0;case 6:return f.fn.call(f.context,t,n,o,i,a),!0}for(c=1,u=new Array(l-1);c<l;c++)u[c-1]=arguments[c];f.fn.apply(f.context,u)}else{var h,d=f.length;for(c=0;c<d;c++)switch(f[c].once&&this.removeListener(e,f[c].fn,void 0,!0),l){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,t);break;case 3:f[c].fn.call(f[c].context,t,n);break;case 4:f[c].fn.call(f[c].context,t,n,o);break;default:if(!u)for(h=1,u=new Array(l-1);h<l;h++)u[h-1]=arguments[h];f[c].fn.apply(f[c].context,u)}}return!0},s.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,o){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,i);else{for(var u=0,c=[],f=s.length;u<f;u++)(s[u].fn!==t||o&&!s[u].once||n&&s[u].context!==n)&&c.push(s[u]);c.length?this._events[i]=1===c.length?c[0]:c:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?this._events[t=r?r+e:e]&&a(this,t):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(Ce={exports:{}}),Ce.exports));function xe(){var e=new De;return{emitter:e,createChainingEmitterMethod:function(t,r){return function(){return e[t].apply(e,[].slice.call(arguments)),r}},createBoundEmitterMethod:function(t){return function(){return e[t].apply(e,[].slice.call(arguments))}}}}var Fe=Symbol("isPromiEvent");function Ue(e){return!!e[Fe]}function Ge(e){var t=Be(e),r=xe(),n=r.createBoundEmitterMethod,o=r.createChainingEmitterMethod,i=Symbol("Promise.then"),a=Symbol("Promise.catch"),s=Symbol("Promise.finally"),u=function(e,t){return function(){var r=t[e].apply(t,[].slice.call(arguments));return c(r)}},c=function(e){var t;return Object.assign(e,((t={})[Fe]=!0,t[i]=e[i]||e.then,t[a]=e[a]||e.catch,t[s]=e[s]||e.finally,t.then=u(i,e),t.catch=u(a,e),t.finally=u(s,e),t.on=o("on",e),t.once=o("once",e),t.addListener=o("addListener",e),t.off=o("off",e),t.removeListener=o("removeListener",e),t.removeAllListeners=o("removeAllListeners",e),t.emit=n("emit"),t.eventNames=n("eventNames"),t.listeners=n("listeners"),t.listenerCount=n("listenerCount"),t))},f=c(t.then(function(e){return f.emit("done",e),f.emit("settled"),e},function(e){throw f.emit("error",e),f.emit("settled"),e}));return f}function Be(e){return new Promise(function(t,r){var n=e(t,r);Promise.resolve(n).catch(r)})}var We,He=function(){function e(e){this.sdk=void 0,this.sdk=e}return e.prototype.request=function(e){var t=this.overlay.post(y.MAGIC_HANDLE_REQUEST,Pe(e)),r=Ge(function(e,r){t.then(function(t){if(n(),t.hasError)r(new Ee(t.payload.error));else{if(!t.hasResult)throw Re();e(t.payload.result)}}).catch(function(e){n(),r(e)})}),n=this.overlay.on(v.MAGIC_HANDLE_EVENT,function(t){var n,o=t.data.response;if(o.id===e.id&&null!=(n=o.result)&&n.event){var i=o.result,a=i.params;r.emit.apply(r,[i.event].concat(void 0===a?[]:a))}});return r},t(e,[{key:"overlay",get:function(){return this.sdk.overlay}}]),e}(),ze=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.loginWithMagicLink=function(e){var t=e.showUI,r=je(this.sdk.testMode?p.LoginWithMagicLinkTestMode:p.LoginWithMagicLink,[{email:e.email,showUI:void 0===t||t,redirectURI:e.redirectURI}]);return this.request(r)},r.loginWithCredential=function(e){var t=null!=e?e:"";if(!e&&"web"===ye.platform){t=window.location.search;var r=window.location.origin+window.location.pathname;window.history.replaceState(null,"",r)}var n=je(this.sdk.testMode?p.LoginWithCredentialTestMode:p.LoginWithCredential,[t]);return this.request(n)},t}(He);function Ke(e){return function(){try{var t=arguments,r=function(r){return n||(We=r),Promise.resolve(We.ready()).then(function(){var r;return(r=We)[e].apply(r,[].slice.call(t))})},n=We;return Promise.resolve(n?r(n):Promise.resolve(ye.configureStorage()).then(r))}catch(e){return Promise.reject(e)}}}var Xe=Ke("getItem"),qe=Ke("setItem"),Ve=Ke("removeItem"),Ye=Ke("clear"),Je=Ke("length"),$e=Ke("key"),Qe=Ke("keys"),Ze=Ke("iterate"),et={__proto__:null,getItem:Xe,setItem:qe,removeItem:Ve,clear:Ye,length:Je,key:$e,keys:Qe,iterate:Ze};function tt(){var e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=15&e[6]|64,e[8]=191&e[8]|128;var 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))+e[15].toString(16)}var rt={name:"ECDSA",namedCurve:"P-256"},nt={name:"ECDSA",namedCurve:"P-256"};function ot(){return window.crypto}function it(e){return at(function(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))})}(e))}function at(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}var st=function(e){function t(){return e.apply(this,arguments)||this}n(t,e);var r=t.prototype;return r.getIdToken=function(e){var t=je(this.sdk.testMode?p.GetIdTokenTestMode:p.GetIdToken,[e]);return this.request(t)},r.generateIdToken=function(e){var t=je(this.sdk.testMode?p.GenerateIdTokenTestMode:p.GenerateIdToken,[e]);return this.request(t)},r.getMetadata=function(){var e=je(this.sdk.testMode?p.GetMetadataTestMode:p.GetMetadata);return this.request(e)},r.updateEmail=function(e){var t=e.showUI,r=je(this.sdk.testMode?p.UpdateEmailTestMode:p.UpdateEmail,[{email:e.email,showUI:void 0===t||t}]);return this.request(r)},r.isLoggedIn=function(){var e=je(this.sdk.testMode?p.IsLoggedInTestMode:p.IsLoggedIn);return this.request(e)},r.logout=function(){Ve("STORE_KEY_PUBLIC_JWK"),Ve("STORE_KEY_PRIVATE_KEY");var e=je(this.sdk.testMode?p.LogoutTestMode:p.Logout);return this.request(e)},t}(He);function ut(){return(ut=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var ct=xe(),ft=ct.createBoundEmitterMethod,lt=ct.createChainingEmitterMethod,ht=function(e){function t(){var t;return(t=e.call.apply(e,[this].concat([].slice.call(arguments)))||this).isMagic=!0,t.on=lt("on",c(t)),t.once=lt("once",c(t)),t.addListener=lt("addListener",c(t)),t.off=lt("off",c(t)),t.removeListener=lt("removeListener",c(t)),t.removeAllListeners=lt("removeAllListeners",c(t)),t.emit=ft("emit"),t.eventNames=ft("eventNames"),t.listeners=ft("listeners"),t.listenerCount=ft("listenerCount"),t}n(t,e);var r=t.prototype;return r.sendAsync=function(e,t){var r=this;if(!t)throw Ne({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:null===t?"null":typeof t});if(Array.isArray(e))this.overlay.post(y.MAGIC_HANDLE_REQUEST,e.map(function(e){var t=Pe(e);return r.prefixPayloadMethodForTestMode(t),t})).then(function(e){t(null,e.map(function(e){return ut({},e.payload,{error:e.hasError?new Ee(e.payload.error):null})}))});else{var n=Pe(e);this.prefixPayloadMethodForTestMode(n),this.overlay.post(y.MAGIC_HANDLE_REQUEST,n).then(function(e){t(e.hasError?new Ee(e.payload.error):null,e.payload)})}},r.send=function(e,t){if("string"==typeof e){var r=je(e,Array.isArray(t)?t:[]);return this.request(r)}if(!Array.isArray(e)&&!t){var n=new _e(h.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.");return n.log(),new ke(e).applyError({code:-32603,message:n.rawMessage}).payload}this.sendAsync(e,t)},r.enable=function(){var e=je("eth_accounts");return this.request(e)},r.request=function(t){return this.prefixPayloadMethodForTestMode(t),e.prototype.request.call(this,t)},r.prefixPayloadMethodForTestMode=function(e){this.sdk.testMode&&(e.method="testMode/eth/"+e.method)},t}(He);function dt(e,t){return t?new URL(e,t):new URL(e)}var pt=["request","overlay","sdk"],vt=function(e){function t(){var t;(t=e.call(this,void 0)||this).__sdk_access_field_descriptors__=new Map,t.__is_initialized__=!1,t.utils={createPromiEvent:Ge,isPromiEvent:Ue,encodeJSON:le,decodeJSON:he,createJsonRpcRequestPayload:je,standardizeJsonRpcRequestPayload:Pe,storage:et};var r=[c(t)].concat(function(e){for(var t=Object.getPrototypeOf(e),r=[t];t!==He.prototype;)t=Object.getPrototypeOf(t),r.push(t);return r}(c(t)));return pt.forEach(function(e){var n=r.map(function(t){return Object.getOwnPropertyDescriptor(t,e)}),o=n.findIndex(function(e){return!!e}),i=n[o];i&&(t.__sdk_access_field_descriptors__.set(e,{descriptor:i,isPrototypeField:o>0}),Object.defineProperty(c(t),e,{configurable:!0,get:function(){throw Ae(e)}}))}),t}n(t,e);var r=t.prototype;return r.init=function(e){var t=this;this.__is_initialized__||(pt.forEach(function(e){if(t.__sdk_access_field_descriptors__.has(e)){var r=t.__sdk_access_field_descriptors__.get(e),n=r.descriptor;r.isPrototypeField?delete t[e]:Object.defineProperty(t,e,n)}}),this.sdk=e,this.__is_initialized__=!0)},r.createDeprecationWarning=function(e){var t=e.useInstead;return new Ie(this,"DEPRECATION_NOTICE","`"+e.method+"` will be removed from this Extension in version `"+e.removalVersion+"`."+(t?" Use `"+t+"` instead.":""))},r.createWarning=function(e,t){return new Ie(this,e,t)},r.createError=function(e,t,r){return new be(this,e,t,r)},t}(He),yt=function(e){function t(){return e.apply(this,arguments)||this}return n(t,e),t}(vt);function mt(e){return!e.compat||null==e.compat[ye.sdkName]||("string"==typeof e.compat[ye.sdkName]?function(e,t,r){try{t=new U(t,void 0)}catch(e){return!1}return t.test(e)}(function(e,t){if(e instanceof P)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;var r=null;if((t=t||{}).rtl){for(var n;(n=se[ue.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),se[ue.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;se[ue.COERCERTL].lastIndex=-1}else r=e.match(se[ue.COERCE]);return null===r?null:function(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof P)return e;if("string"!=typeof e)return null;if(e.length>oe)return null;if(!(t.loose?ie[ae.LOOSE]:ie[ae.FULL]).test(e))return null;try{return new P(e,t)}catch(e){return null}}(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),t)}(ye.version),e.compat[ye.sdkName]):!!e.compat[ye.sdkName])}function gt(e){var t,r=this,n=null!=(t=null==e?void 0:e.extensions)?t:[],o={},i=[];if(Array.isArray(n)?n.forEach(function(e){mt(e)?(e.init(r),r[e.name]=e,e instanceof yt.Internal&&(ve(e.config)||(o[e.name]=e.config))):i.push(e)}):Object.keys(n).forEach(function(e){if(mt(n[e])){n[e].init(r);var t=n[e];r[e]=t,t instanceof yt.Internal&&(ve(t.config)||(o[n[e].name]=t.config))}else i.push(n[e])}),i.length)throw Oe(i);return o}yt.Internal=function(e){function t(){return e.apply(this,arguments)||this}return n(t,e),t}(vt);var Et=function(){function e(e,t){var r;if(this.apiKey=void 0,this.endpoint=void 0,this.parameters=void 0,this.testMode=void 0,this.auth=void 0,this.user=void 0,this.rpcProvider=void 0,this.apiKey=e,!e)throw we();"react-native"===ye.platform&&null!=t&&t.endpoint&&new _e(h.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 `"+ye.defaultEndpoint+"`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.").log();var n=ye.defaultEndpoint,o=ye.version;this.testMode=!(null==t||!t.testMode),this.endpoint=dt(null!=(r=null==t?void 0:t.endpoint)?r:n).origin,this.auth=new ze(this),this.user=new st(this),this.rpcProvider=new ht(this);var i=gt.call(this,t);this.parameters=le({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:null==t?void 0:t.network,host:dt(this.endpoint).host,sdk:me[ye.sdkName],version:o,ext:ve(i)?void 0:i,locale:(null==t?void 0:t.locale)||"en_US"})}return e.prototype.preload=function(){try{return Promise.resolve(this.overlay.ready).then(function(){})}catch(e){return Promise.reject(e)}},t(e,[{key:"overlay",get:function(){if(!e.__overlays__.has(this.parameters)){var t=new ye.ViewController(this.endpoint,this.parameters);t.init(),e.__overlays__.set(this.parameters,t)}return e.__overlays__.get(this.parameters)}}]),e}();Et.__overlays__=new Map;var _t=function(){function e(e,t){this.endpoint=void 0,this.parameters=void 0,this.ready=void 0,this.messageHandlers=new Set,this.endpoint=e,this.parameters=t,this.ready=this.waitForReady(),this.listen()}var t=e.prototype;return t.post=function(e,t){try{var r=this;return Promise.resolve(Be(function(n){try{var o;return Promise.resolve(r.ready).then(function(){var i=[],a=Array.isArray(t)?t.map(function(e){return e.id}):[];return Promise.resolve(function(e,t){try{return Promise.resolve(Xe("rt")).then(function(r){function n(){return o?r?{msgType:e,payload:t,jwt:o,rt:r}:{msgType:e,payload:t,jwt:o}:{msgType:e,payload:t}}var o,i=function(){if("web"===ye.platform){var e=function(e,t){try{var r=Promise.resolve(I()).then(function(e){o=e})}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(0,function(e){console.error("webcrypto error",e)});if(e&&e.then)return e.then(function(){})}}();return i&&i.then?i.then(n):n()})}catch(e){return Promise.reject(e)}}(e+"-"+r.parameters,t)).then(function(e){return Promise.resolve(r._post(e)).then(function(){var e=r.on(v.MAGIC_HANDLE_RESPONSE,(o=function(){return e()},function(e){var r=function(e,t){var r,n=null==(r=t.data.response)?void 0:r.id,o=function(e,t){return t&&Array.isArray(e)?e.find(function(e){return e.id===t}):e}(e,n);return n&&o?{id:n,response:new ke(o).applyResult(t.data.response.result).applyError(t.data.response.error)}:{}}(t,e),s=r.id,u=r.response;!function(e){try{Promise.resolve(e.data.rt?Promise.resolve(qe("rt",e.data.rt)).then(function(e){}):void 0)}catch(e){return Promise.reject(e)}}(e),s&&u&&Array.isArray(t)&&a.includes(s)?(i.push(u),i.length===t.length&&(o(),n(i))):s&&u&&!Array.isArray(t)&&s===t.id&&(o(),n(u))}))})})})}catch(e){return Promise.reject(e)}}))}catch(e){return Promise.reject(e)}},t.on=function(e,t){var r=this,n=t.bind(window),o=function(t){t.data.msgType===e+"-"+r.parameters&&n(t)};return this.messageHandlers.add(o),function(){return r.messageHandlers.delete(o)}},t.waitForReady=function(){var e=this;return new Promise(function(t){e.on(v.MAGIC_OVERLAY_READY,function(){return t()})})},t.listen=function(){var e=this;this.on(v.MAGIC_HIDE_OVERLAY,function(){e.hideOverlay()}),this.on(v.MAGIC_SHOW_OVERLAY,function(){e.showOverlay()})},e}(),bt={__proto__:null,Extension:yt,ExtensionError:be,ExtensionWarning:Ie,RPCError:Ee,SDKError:ge,SDKWarning:_e,isPromiEvent:Ue,get EthChainType(){return m},get MagicIncomingWindowMessage(){return v},get MagicOutgoingWindowMessage(){return y},get MagicPayloadMethod(){return p},get RPCErrorCode(){return d},get SDKErrorCode(){return l},get SDKWarningCode(){return h}},It=_(function(e,t){e.exports=function e(t,r,n){function o(a,s){if(!r[a]){if(!t[a]){if(!s&&b)return b(a);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){return o(t[a][1][e]||e)},c,c.exports,e,t,r,n)}return r[a].exports}for(var i=b,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(e,t,r){(function(e){var r,n,o=e.MutationObserver||e.WebKitMutationObserver;if(o){var i=0,a=new o(f),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),r=function(){s.data=i=++i%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){f(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(f,0)};else{var u=new e.MessageChannel;u.port1.onmessage=f,r=function(){u.port2.postMessage(0)}}var c=[];function f(){var e,t;n=!0;for(var r=c.length;r;){for(t=c,c=[],e=-1;++e<r;)t[e]();r=c.length}n=!1}t.exports=function(e){1!==c.push(e)||n||r()}}).call(this,void 0!==g?g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,r){var n=e(1);function o(){}var i={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==o&&d(this,e)}function f(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function l(e,t,r){n(function(){var n;try{n=t(r)}catch(t){return i.reject(e,t)}n===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,n)})}function h(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(e,t){var r=!1;function n(t){r||(r=!0,i.reject(e,t))}function o(t){r||(r=!0,i.resolve(e,t))}var a=p(function(){t(o,n)});"error"===a.status&&n(a.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}t.exports=c,c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var r=new this.constructor(o);return this.state!==u?l(r,this.state===s?e:t,this.outcome):this.queue.push(new f(r,e,t)),r},f.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){l(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){i.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){l(this.promise,this.onRejected,e)},i.resolve=function(e,t){var r=p(h,t);if("error"===r.status)return i.reject(e,r.value);var n=r.value;if(n)d(e,n);else{e.state=s,e.outcome=t;for(var o=-1,a=e.queue.length;++o<a;)e.queue[o].callFulfilled(t)}return e},i.reject=function(e,t){e.state=a,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:i.resolve(new this(o),e)},c.reject=function(e){var t=new this(o);return i.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a=new Array(r),s=0,u=-1,c=new this(o);++u<r;)f(e[u],u);return c;function f(e,o){t.resolve(e).then(function(e){a[o]=e,++s!==r||n||(n=!0,i.resolve(c,a))},function(e){n||(n=!0,i.reject(c,e))})}},c.race=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,r=!1;if(!t)return this.resolve([]);for(var n=-1,a=new this(o);++n<t;)this.resolve(e[n]).then(function(e){r||(r=!0,i.resolve(a,e))},function(e){r||(r=!0,i.reject(a,e))});return a}},{1:1}],3:[function(e,t,r){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==g?g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,r){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function i(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var a=Promise;function s(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function u(e,t,r){"function"==typeof t&&e.then(t),"function"==typeof r&&e.catch(r)}function c(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function f(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l="local-forage-detect-blob-support",h=void 0,d={},p=Object.prototype.toString,v="readonly",y="readwrite";function m(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),o=0;o<t;o++)n[o]=e.charCodeAt(o);return r}function g(e){var t=d[e.name],r={};r.promise=new a(function(e,t){r.resolve=e,r.reject=t}),t.deferredOperations.push(r),t.dbReady=t.dbReady?t.dbReady.then(function(){return r.promise}):r.promise}function E(e){var t=d[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function _(e,t){var r=d[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function b(e,t){return new a(function(r,n){if(d[e.name]=d[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return r(e.db);g(e),e.db.close()}var i=[e.name];t&&i.push(e.version);var a=o.open.apply(o,i);t&&(a.onupgradeneeded=function(t){var r=a.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(l)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),n(a.error)},a.onsuccess=function(){r(a.result),E(e)}})}function I(e){return b(e,!1)}function w(e){return b(e,!0)}function R(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.version>e.db.version;if(e.version<e.db.version&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),n||r){if(r){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function A(e){return i([m(atob(e.data))],{type:e.type})}function O(e){return e&&e.__local_forage_encoded_blob}function N(e){var t=this,r=t._initReady().then(function(){var e=d[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return u(r,e,e),r}function S(e,t,r,n){void 0===n&&(n=1);try{var o=e.db.transaction(e.storeName,t);r(null,o)}catch(o){if(n>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return a.resolve().then(function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),w(e)}).then(function(){return function(e){g(e);for(var t=d[e.name],r=t.forages,n=0;n<r.length;n++){var o=r[n];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return e.db=null,I(e).then(function(t){return e.db=t,R(e)?w(e):t}).then(function(n){e.db=t.db=n;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n}).catch(function(t){throw _(e,t),t})}(e).then(function(){S(e,t,r,n-1)})}).catch(r);r(o)}}var L={_driver:"asyncStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var o=d[r.name];o||(d[r.name]=o={forages:[],db:null,dbReady:null,deferredOperations:[]}),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=N);var i=[];function s(){return a.resolve()}for(var u=0;u<o.forages.length;u++){var c=o.forages[u];c!==t&&i.push(c._initReady().catch(s))}var f=o.forages.slice(0);return a.all(i).then(function(){return r.db=o.db,I(r)}).then(function(e){return r.db=e,R(r,t._defaultConfig.version)?w(r):e}).then(function(e){r.db=o.db=e,t._dbInfo=r;for(var n=0;n<f.length;n++){var i=f[n];i!==t&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}})},_support:function(){try{if(!o||!o.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var r=this,n=new a(function(t,n){r.ready().then(function(){S(r._dbInfo,v,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).openCursor(),s=1;a.onsuccess=function(){var r=a.result;if(r){var n=r.value;O(n)&&(n=A(n));var o=e(n,r.key,s++);void 0!==o?t(o):r.continue()}else t()},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return s(n,t),n},getItem:function(e,t){var r=this;e=c(e);var n=new a(function(t,n){r.ready().then(function(){S(r._dbInfo,v,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),O(e)&&(e=A(e)),t(e)},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return s(n,t),n},setItem:function(e,t,r){var n=this;e=c(e);var o=new a(function(r,o){var s;n.ready().then(function(){return s=n._dbInfo,"[object Blob]"===p.call(t)?function(e){return"boolean"==typeof h?a.resolve(h):function(e){return new a(function(t){var r=e.transaction(l,y),n=i([""]);r.objectStore(l).put(n,"key"),r.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},r.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!e||parseInt(e[1],10)>=43)}}).catch(function(){return!1})}(e).then(function(e){return h=e})}(s.db).then(function(e){return e?t:(r=t,new a(function(e,t){var n=new FileReader;n.onerror=t,n.onloadend=function(t){var n=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:r.type})},n.readAsBinaryString(r)}));var r}):t}).then(function(t){S(n._dbInfo,y,function(i,a){if(i)return o(i);try{var s=a.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var u=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),r(t)},a.onabort=a.onerror=function(){o(u.error?u.error:u.transaction.error)}}catch(e){o(e)}})}).catch(o)});return s(o,r),o},removeItem:function(e,t){var r=this;e=c(e);var n=new a(function(t,n){r.ready().then(function(){S(r._dbInfo,y,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).delete(e);i.oncomplete=function(){t()},i.onerror=function(){n(a.error)},i.onabort=function(){n(a.error?a.error:a.transaction.error)}}catch(e){n(e)}})}).catch(n)});return s(n,t),n},clear:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){S(t._dbInfo,y,function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).clear();o.oncomplete=function(){e()},o.onabort=o.onerror=function(){r(i.error?i.error:i.transaction.error)}}catch(e){r(e)}})}).catch(r)});return s(r,e),r},length:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){S(t._dbInfo,v,function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).count();i.onsuccess=function(){e(i.result)},i.onerror=function(){r(i.error)}}catch(e){r(e)}})}).catch(r)});return s(r,e),r},key:function(e,t){var r=this,n=new a(function(t,n){e<0?t(null):r.ready().then(function(){S(r._dbInfo,v,function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName),s=!1,u=a.openKeyCursor();u.onsuccess=function(){var r=u.result;r?0===e||s?t(r.key):(s=!0,r.advance(e)):t(null)},u.onerror=function(){n(u.error)}}catch(e){n(e)}})}).catch(n)});return s(n,t),n},keys:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){S(t._dbInfo,v,function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var t=i.result;t?(a.push(t.key),t.continue()):e(a)},i.onerror=function(){r(i.error)}}catch(e){r(e)}})}).catch(r)});return s(r,e),r},dropInstance:function(e,t){t=f.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,i=this;if(e.name){var u=e.name===r.name&&i._dbInfo.db?a.resolve(i._dbInfo.db):I(e).then(function(t){var r=d[e.name],n=r.forages;r.db=t;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=t;return t});n=u.then(e.storeName?function(t){if(t.objectStoreNames.contains(e.storeName)){var r=t.version+1;g(e);var n=d[e.name],i=n.forages;t.close();for(var s=0;s<i.length;s++){var u=i[s];u._dbInfo.db=null,u._dbInfo.version=r}return new a(function(t,n){var i=o.open(e.name,r);i.onerror=function(e){i.result.close(),n(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}).then(function(e){n.db=e;for(var t=0;t<i.length;t++){var r=i[t];r._dbInfo.db=e,E(r._dbInfo)}}).catch(function(t){throw(_(e,t)||a.resolve()).catch(function(){}),t})}}:function(t){g(e);var r=d[e.name],n=r.forages;t.close();for(var i=0;i<n.length;i++)n[i]._dbInfo.db=null;return new a(function(t,r){var n=o.deleteDatabase(e.name);n.onerror=n.onblocked=function(e){var t=n.result;t&&t.close(),r(e)},n.onsuccess=function(){var e=n.result;e&&e.close(),t(e)}}).then(function(e){r.db=e;for(var t=0;t<n.length;t++)E(n[t]._dbInfo)}).catch(function(t){throw(_(e,t)||a.resolve()).catch(function(){}),t})})}else n=a.reject("Invalid arguments");return s(n,t),n}},T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",M=/^~~local_forage_type~([^~]+)~/,P="__lfsc__:",j=P.length,C="arbf",k="blob",D="si08",x="ui08",F="uic8",U="si16",G="si32",B="ur16",W="ui32",H="fl32",z="fl64",K=j+C.length,X=Object.prototype.toString;function q(e){var t,r,n,o,i,a=.75*e.length,s=e.length,u=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var c=new ArrayBuffer(a),f=new Uint8Array(c);for(t=0;t<s;t+=4)r=T.indexOf(e[t]),n=T.indexOf(e[t+1]),o=T.indexOf(e[t+2]),i=T.indexOf(e[t+3]),f[u++]=r<<2|n>>4,f[u++]=(15&n)<<4|o>>2,f[u++]=(3&o)<<6|63&i;return c}function V(e){var t,r=new Uint8Array(e),n="";for(t=0;t<r.length;t+=3)n+=T[r[t]>>2],n+=T[(3&r[t])<<4|r[t+1]>>4],n+=T[(15&r[t+1])<<2|r[t+2]>>6],n+=T[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}var Y={serialize:function(e,t){var r="";if(e&&(r=X.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===X.call(e.buffer))){var n,o=P;e instanceof ArrayBuffer?(n=e,o+=C):(n=e.buffer,"[object Int8Array]"===r?o+=D:"[object Uint8Array]"===r?o+=x:"[object Uint8ClampedArray]"===r?o+=F:"[object Int16Array]"===r?o+=U:"[object Uint16Array]"===r?o+=B:"[object Int32Array]"===r?o+=G:"[object Uint32Array]"===r?o+=W:"[object Float32Array]"===r?o+=H:"[object Float64Array]"===r?o+=z:t(new Error("Failed to get type for BinaryArray"))),t(o+V(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r="~~local_forage_type~"+e.type+"~"+V(this.result);t("__lfsc__:blob"+r)},i.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}},deserialize:function(e){if(e.substring(0,j)!==P)return JSON.parse(e);var t,r=e.substring(K),n=e.substring(j,K);if(n===k&&M.test(r)){var o=r.match(M);t=o[1],r=r.substring(o[0].length)}var a=q(r);switch(n){case C:return a;case k:return i([a],{type:t});case D:return new Int8Array(a);case x:return new Uint8Array(a);case F:return new Uint8ClampedArray(a);case U:return new Int16Array(a);case B:return new Uint16Array(a);case G:return new Int32Array(a);case W:return new Uint32Array(a);case H:return new Float32Array(a);case z:return new Float64Array(a);default:throw new Error("Unkown type: "+n)}},stringToBuffer:q,bufferToString:V};function J(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function $(e,t,r,n,o,i){e.executeSql(r,n,o,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(e,s){s.rows.length?i(e,a):J(e,t,function(){e.executeSql(r,n,o,i)},i)},i):i(e,a)},i)}function Q(e,t,r,n){var o=this;e=c(e);var i=new a(function(i,a){o.ready().then(function(){void 0===t&&(t=null);var s=t,u=o._dbInfo;u.serializer.serialize(t,function(t,c){c?a(c):u.db.transaction(function(r){$(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,t],function(){i(s)},function(e,t){a(t)})},function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void i(Q.apply(o,[e,s,r,n-1]));a(t)}})})}).catch(a)});return s(i,r),i}function Z(e){return new a(function(t,r){e.transaction(function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(r,n){for(var o=[],i=0;i<n.rows.length;i++)o.push(n.rows.item(i).name);t({db:e,storeNames:o})},function(e,t){r(t)})},function(e){r(e)})})}var ee={_driver:"webSQLStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"!=typeof e[n]?e[n].toString():e[n];var o=new a(function(e,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(e){return n(e)}r.db.transaction(function(o){J(o,r,function(){t._dbInfo=r,e()},function(e,t){n(t)})},n)});return r.serializer=Y,o},_support:"function"==typeof openDatabase,iterate:function(e,t){var r=this,n=new a(function(t,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){$(r,o,"SELECT * FROM "+o.storeName,[],function(r,n){for(var i=n.rows,a=i.length,s=0;s<a;s++){var u=i.item(s),c=u.value;if(c&&(c=o.serializer.deserialize(c)),void 0!==(c=e(c,u.key,s+1)))return void t(c)}t()},function(e,t){n(t)})})}).catch(n)});return s(n,t),n},getItem:function(e,t){var r=this;e=c(e);var n=new a(function(t,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){$(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),t(n)},function(e,t){n(t)})})}).catch(n)});return s(n,t),n},setItem:function(e,t,r){return Q.apply(this,[e,t,r,1])},removeItem:function(e,t){var r=this;e=c(e);var n=new a(function(t,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){$(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],function(){t()},function(e,t){n(t)})})}).catch(n)});return s(n,t),n},clear:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(t){$(t,n,"DELETE FROM "+n.storeName,[],function(){e()},function(e,t){r(t)})})}).catch(r)});return s(r,e),r},length:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(t){$(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(t,r){var n=r.rows.item(0).c;e(n)},function(e,t){r(t)})})}).catch(r)});return s(r,e),r},key:function(e,t){var r=this,n=new a(function(t,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){$(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)},function(e,t){n(t)})})}).catch(n)});return s(n,t),n},keys:function(e){var t=this,r=new a(function(e,r){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(t){$(t,n,"SELECT key FROM "+n.storeName,[],function(t,r){for(var n=[],o=0;o<r.rows.length;o++)n.push(r.rows.item(o).key);e(n)},function(e,t){r(t)})})}).catch(r)});return s(r,e),r},dropInstance:function(e,t){t=f.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,o=this;return s(n=e.name?new a(function(t){var n;n=e.name===r.name?o._dbInfo.db:openDatabase(e.name,"","",0),t(e.storeName?{db:n,storeNames:[e.storeName]}:Z(n))}).then(function(e){return new a(function(t,r){e.db.transaction(function(n){function o(e){return new a(function(t,r){n.executeSql("DROP TABLE IF EXISTS "+e,[],function(){t()},function(e,t){r(t)})})}for(var i=[],s=0,u=e.storeNames.length;s<u;s++)i.push(o(e.storeNames[s]));a.all(i).then(function(){t()}).catch(function(e){r(e)})},function(e){r(e)})})}):a.reject("Invalid arguments"),t),n}};function te(e,t){var r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}var re={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var r in e)t[r]=e[r];return t.keyPrefix=te(e,this._defaultConfig),!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}()||localStorage.length>0?(this._dbInfo=t,t.serializer=Y,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var r=this,n=r.ready().then(function(){for(var t=r._dbInfo,n=t.keyPrefix,o=n.length,i=localStorage.length,a=1,s=0;s<i;s++){var u=localStorage.key(s);if(0===u.indexOf(n)){var c=localStorage.getItem(u);if(c&&(c=t.serializer.deserialize(c)),void 0!==(c=e(c,u.substring(o),a++)))return c}}});return s(n,t),n},getItem:function(e,t){var r=this;e=c(e);var n=r.ready().then(function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n});return s(n,t),n},setItem:function(e,t,r){var n=this;e=c(e);var o=n.ready().then(function(){void 0===t&&(t=null);var r=t;return new a(function(o,i){var a=n._dbInfo;a.serializer.serialize(t,function(t,n){if(n)i(n);else try{localStorage.setItem(a.keyPrefix+e,t),o(r)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||i(e),i(e)}})})});return s(o,r),o},removeItem:function(e,t){var r=this;e=c(e);var n=r.ready().then(function(){localStorage.removeItem(r._dbInfo.keyPrefix+e)});return s(n,t),n},clear:function(e){var t=this,r=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}});return s(r,e),r},length:function(e){var t=this.keys().then(function(e){return e.length});return s(t,e),t},key:function(e,t){var r=this,n=r.ready().then(function(){var t,n=r._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t});return s(n,t),n},keys:function(e){var t=this,r=t.ready().then(function(){for(var e=t._dbInfo,r=localStorage.length,n=[],o=0;o<r;o++){var i=localStorage.key(o);0===i.indexOf(e.keyPrefix)&&n.push(i.substring(e.keyPrefix.length))}return n});return s(r,e),r},dropInstance:function(e,t){if(t=f.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var n,o=this;return s(n=e.name?new a(function(t){t(e.storeName?te(e,o._defaultConfig):e.name+"/")}).then(function(e){for(var t=localStorage.length-1;t>=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}}):a.reject("Invalid arguments"),t),n}},ne=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},oe=function(e,t){for(var r=e.length,n=0;n<r;){if(ne(e[n],t))return!0;n++}return!1},ie=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ae={},se={},ue={INDEXEDDB:L,WEBSQL:ee,LOCALSTORAGE:re},ce=[ue.INDEXEDDB._driver,ue.WEBSQL._driver,ue.LOCALSTORAGE._driver],fe=["dropInstance"],le=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(fe),he={description:"",driver:ce.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function de(e,t){e[t]=function(){var r=arguments;return e.ready().then(function(){return e[t].apply(e,r)})}}function pe(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var r in t)t.hasOwnProperty(r)&&(arguments[0][r]=ie(t[r])?t[r].slice():t[r])}return arguments[0]}var ve=new(function(){function e(t){for(var r in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ue)if(ue.hasOwnProperty(r)){var n=ue[r],o=n._driver;this[r]=o,ae[o]||this.defineDriver(n)}this._defaultConfig=pe({},he),this._config=pe({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":n(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,r){var n=new a(function(t,r){try{var n=e._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void r(o);for(var i=le.concat("_initStorage"),u=0,c=i.length;u<c;u++){var f=i[u];if((!oe(fe,f)||e[f])&&"function"!=typeof e[f])return void r(o)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),r=a.reject(t);return s(r,arguments[arguments.length-1]),r}},r=0,n=fe.length;r<n;r++){var o=fe[r];e[o]||(e[o]=t(o))}}();var l=function(r){ae[n]&&console.info("Redefining LocalForage driver: "+n),ae[n]=e,se[n]=r,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(l,r):l(!!e._support):l(!0)}catch(e){r(e)}});return u(n,t,r),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,r){var n=ae[e]?a.resolve(ae[e]):a.reject(new Error("Driver not found."));return u(n,t,r),n},e.prototype.getSerializer=function(e){var t=a.resolve(Y);return u(t,e),t},e.prototype.ready=function(e){var t=this,r=t._driverSet.then(function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready});return u(r,e,e),r},e.prototype.setDriver=function(e,t,r){var n=this;ie(e)||(e=[e]);var o=this._getSupportedDrivers(e);function i(){n._config.driver=n.driver()}function s(e){return n._extend(e),i(),n._ready=n._initStorage(n._config),n._ready}var c=null!==this._driverSet?this._driverSet.catch(function(){return a.resolve()}):a.resolve();return this._driverSet=c.then(function(){var e=o[0];return n._dbInfo=null,n._ready=null,n.getDriver(e).then(function(e){n._driver=e._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=function(e){return function(){var t=0;return function r(){for(;t<e.length;){var o=e[t];return t++,n._dbInfo=null,n._ready=null,n.getDriver(o).then(s).catch(r)}i();var u=new Error("No available storage method found.");return n._driverSet=a.reject(u),n._driverSet}()}}(o)})}).catch(function(){i();var e=new Error("No available storage method found.");return n._driverSet=a.reject(e),n._driverSet}),u(this._driverSet,t,r),this._driverSet},e.prototype.supports=function(e){return!!se[e]},e.prototype._extend=function(e){pe(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],r=0,n=e.length;r<n;r++){var o=e[r];this.supports(o)&&t.push(o)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=le.length;e<t;e++)de(this,le[e])},e.prototype.createInstance=function(t){return new e(t)},e}());t.exports=ve},{3:3}]},{},[4])(4)}),wt=E(_(function(e,t){"undefined"!=typeof self&&self,function(e){var t=/^~~local_forage_type~([^~]+)~/,r="__lfsc__:".length,n=r+"arbf".length,o=Object.prototype.toString;function i(e){var t=.75*e.length,r=e.length;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);for(var n=new ArrayBuffer(t),o=new Uint8Array(n),i=0,a=0;i<r;i+=4){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[i]),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[i+1]),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[i+2]),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[i+3]);o[a++]=s<<2|u>>4,o[a++]=(15&u)<<4|c>>2,o[a++]=(3&c)<<6|63&f}return n}function a(e){for(var t=new Uint8Array(e),r="",n=0;n<t.length;n+=3)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t[n]>>2],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t[n])<<4|t[n+1]>>4],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t[n+1])<<2|t[n+2]>>6],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&t[n+2]];return t.length%3==2?r=r.substring(0,r.length-1)+"=":t.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}function s(e){var t,r;if(null===e||"object"!=typeof e||"isActiveClone"in e)return e;var n=e instanceof Date?new Date(e):e.constructor();try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(Object.keys(e)),i=o.next();!i.done;i=o.next()){var a=i.value;Object.prototype.hasOwnProperty.call(e,a)&&(e.isActiveClone=null,n[a]=s(e[a]),delete e.isActiveClone)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n}function u(e,t){return(e.name||t.name)+"/"+(e.storeName||t.storeName)+"/"}function c(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function f(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function l(e,t){var r=this;if(t=f.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}return{promise:e.name?new Promise(function(t){t(e.storeName?u(e,r._defaultConfig):e.name+"/")}):Promise.reject("Invalid arguments"),callback:t}}function h(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}var d={bufferToString:a,deserialize:function(e){if("__lfsc__:"!==e.substring(0,r))return JSON.parse(e);var o,a=e.substring(n),s=e.substring(r,n);if("blob"===s&&t.test(a)){var u=a.match(t);o=u[1],a=a.substring(u[0].length)}var c=i(a);switch(s){case"arbf":return c;case"blob":return function(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}([c],{type:o});case"si08":return new Int8Array(c);case"ui08":return new Uint8Array(c);case"uic8":return new Uint8ClampedArray(c);case"si16":return new Int16Array(c);case"ur16":return new Uint16Array(c);case"si32":return new Int32Array(c);case"ui32":return new Uint32Array(c);case"fl32":return new Float32Array(c);case"fl64":return new Float64Array(c);default:throw new Error("Unkown type: "+s)}},serialize:function(e,t){var r="";if(e&&(r=o.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===o.call(e.buffer))){var n=void 0,i="__lfsc__:";e instanceof ArrayBuffer?(n=e,i+="arbf"):(n=e.buffer,"[object Int8Array]"===r?i+="si08":"[object Uint8Array]"===r?i+="ui08":"[object Uint8ClampedArray]"===r?i+="uic8":"[object Int16Array]"===r?i+="si16":"[object Uint16Array]"===r?i+="ur16":"[object Int32Array]"===r?i+="si32":"[object Uint32Array]"===r?i+="ui32":"[object Float32Array]"===r?i+="fl32":"[object Float64Array]"===r?i+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(i+a(n))}else if("[object Blob]"===r){var s=new FileReader;s.onload=function(){var r="~~local_forage_type~"+e.type+"~"+a(this.result);t("__lfsc__:blob"+r)},s.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}},stringToBuffer:i},p={},v=function(){function e(e){this.kp=e,this.data={}}return e.resolve=function(t){return p[t]||(p[t]=new e(t)),p[t]},e.prototype.clear=function(){this.data={}},e.prototype.drop=function(){this.clear(),delete p[this.kp]},e.prototype.get=function(e){return this.data[e]},e.prototype.key=function(e){return this.keys()[e]},e.prototype.keys=function(){return Object.keys(this.data)},e.prototype.rm=function(e){delete this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e}();e._support=!0,e._driver="localforage-driver-memory",e._initStorage=function(e){var t=e?s(e):{},r=u(t,this._defaultConfig),n=v.resolve(r);return this._dbInfo=t,this._dbInfo.serializer=d,this._dbInfo.keyPrefix=r,this._dbInfo.mStore=n,Promise.resolve()},e.clear=function(e){var t=this,r=this.ready().then(function(){t._dbInfo.mStore.clear()});return c(r,e),r},e.dropInstance=function(e,t){var r=l.apply(this,arguments),n=r.promise,o=r.callback;return c(n.then(function(e){v.resolve(e).drop()}),o),n},e.getItem=function(e,t){var r=this;e=h(e);var n=this.ready().then(function(){var t=r._dbInfo.mStore.get(e);return null==t?null:r._dbInfo.serializer.deserialize(t)});return c(n,t),n},e.iterate=function(e,t){var r=this,n=this.ready().then(function(){for(var t=r._dbInfo.mStore,n=t.keys(),o=0;o<n.length;o++){var i=t.get(n[o]);if(i&&(i=r._dbInfo.serializer.deserialize(i)),void 0!==(i=e(i,n[o],o+1)))return i}});return c(n,t),n},e.key=function(e,t){var r=this,n=this.ready().then(function(){var t;try{void 0===(t=r._dbInfo.mStore.key(e))&&(t=null)}catch(e){t=null}return t});return c(n,t),n},e.keys=function(e){var t=this,r=this.ready().then(function(){return t._dbInfo.mStore.keys()});return c(r,e),r},e.length=function(e){var t=this.keys().then(function(e){return e.length});return c(t,e),t},e.removeItem=function(e,t){var r=this;e=h(e);var n=this.ready().then(function(){r._dbInfo.mStore.rm(e)});return c(n,t),n},e.setItem=function(e,t,r){var n=this;e=h(e);var o=this.ready().then(function(){void 0===t&&(t=null);var r=t;return new Promise(function(o,i){n._dbInfo.serializer.serialize(t,function(t,a){if(a)i(a);else try{n._dbInfo.mStore.set(e,t),o(r)}catch(e){i(e)}})})});return c(o,r),o},Object.defineProperty(e,"__esModule",{value:!0})}(t)})),Rt={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"},At=function(e,t){return Object.assign(ye,t),e}(Et,{platform:"web",sdkName:"magic-sdk",version:"6.0.5",defaultEndpoint:"https://auth.magic.link/",ViewController:function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).iframe=void 0,t.activeElement=null,t}n(t,e);var r=t.prototype;return r.init=function(){var e=this;this.test="hello",this.iframe=new Promise(function(t){var r=function(){if(n=encodeURIComponent(e.parameters),o=[].slice.call(document.querySelectorAll(".magic-iframe")),Boolean(o.find(function(e){return e.src.includes(n)})))new _e(h.DuplicateIframe,"Duplicate iframes found.").log();else{var r=document.createElement("iframe");r.classList.add("magic-iframe"),r.dataset.magicIframeLabel=dt(e.endpoint).host,r.title="Secure Modal",r.src=dt("/send?params="+encodeURIComponent(e.parameters),e.endpoint).href,function(e){for(var t=0,r=Object.entries(Rt);t<r.length;t++){var n=r[t];e.style[n[0]]=n[1]}}(r),document.body.appendChild(r),t(r)}var n,o};["loaded","interactive","complete"].includes(document.readyState)?r():window.addEventListener("load",r,!1)}),window.addEventListener("message",function(t){if(t.origin===e.endpoint&&t.data&&t.data.msgType&&e.messageHandlers.size){var r;t.data.response=null!=(r=t.data.response)?r:{};for(var n,o=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.messageHandlers.values());!(n=o()).done;)(0,n.value)(t)}})},r.showOverlay=function(){try{var e=this;return Promise.resolve(e.iframe).then(function(t){t.style.display="block",e.activeElement=document.activeElement,t.focus()})}catch(e){return Promise.reject(e)}},r.hideOverlay=function(){try{var e=this;return Promise.resolve(e.iframe).then(function(t){var r;t.style.display="none",null!==(r=e.activeElement)&&void 0!==r&&r.focus&&e.activeElement.focus(),e.activeElement=null})}catch(e){return Promise.reject(e)}},r._post=function(e){try{var t=this;return Promise.resolve(t.iframe).then(function(r){if(!r||!r.contentWindow)throw new ge(l.ModalNotReady,"Modal is not ready.");r.contentWindow.postMessage(e,t.endpoint)})}catch(e){return Promise.reject(e)}},t}(_t),configureStorage:function(){try{var e=It.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return Promise.resolve(e.defineDriver(wt)).then(function(){return Promise.resolve(e.setDriver([It.INDEXEDDB,It.LOCALSTORAGE,wt._driver])).then(function(){return e})})}catch(e){return Promise.reject(e)}}});return Object.assign(At,r({},bt)),At}();