supertokens-web-js
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensEmailPassword;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[581],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var r=new URL(e);return t?r.hostname.startsWith("localhost")||(o=r.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),n(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=n(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},634:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1260),a=n(255),u=n(2173),c=function(){function e(e,t){var n=this;this.get=function(e,t,s,a,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,s),r({method:"GET"},t),a,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.post=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),r({method:"POST"},t),s,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.delete=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"DELETE"},t),s,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.put=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"PUT"},t),s,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.fetch=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n,o,c,l,f,p;return i(this,(function(i){switch(i.label){case 0:return n=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:s,url:e,requestInit:r(r({},t),{headers:r(r({},n),{"fdi-version":a.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===u?[3,4]:(p=f.clone(),[4,u({requestInit:c,url:e,fetchResponse:p})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(e){return o(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var r=new s.default(e),o="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(n.appInfo.apiBasePath.getAsStringDangerous()).concat(r.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=r.sent()).status)throw n=void 0===t.message?"No Error Message Provided":t.message,new u.default(n);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var n=e.recipePreAPIHook,s=e.action,a=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{action:s,userContext:u}))];case 1:return o=t.sent(),void 0===a||void 0===a.preAPIHook?[2,o]:[2,a.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var n=e.recipePostAPIHook,s=e.action,a=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{userContext:a,action:s}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(1996),u=n(6322),c=function(e){function t(t){var n=e.call(this,t)||this;return n.signOut=function(e){return i(n,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},n}return o(t,e),t}(a.default);t.default=c},5053:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var r=n(6069);t.normaliseAuthRecipe=function(e){return(0,r.normaliseRecipeModuleConfig)(e)}},6277:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(6923),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.emailVerificationRecipe=void 0===n.emailVerification?new i.default({appInfo:t.appInfo,recipeId:t.recipeId,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:void 0===t.override?void 0:t.override.emailVerification}):n.emailVerification,r}return o(t,e),t}(n(7725).default);t.default=s},7870:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipeWithEmailVerificationConfig=void 0;var r=n(5053);t.normaliseAuthRecipeWithEmailVerificationConfig=function(e){return(0,r.normaliseAuthRecipe)(e)}},6022:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.signOut=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.getResetPasswordTokenFromURL=t.doesEmailExist=t.signIn=t.signUp=t.sendPasswordResetEmail=t.submitNewPassword=t.init=void 0;var s=n(7939),a=n(8122),u=function(){function e(){}return e.init=function(e){return s.default.init(e)},e.signOut=function(e){return s.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.submitNewPassword=function(e){return s.default.getInstanceOrThrow().recipeImplementation.submitNewPassword(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.sendPasswordResetEmail=function(e){return s.default.getInstanceOrThrow().recipeImplementation.sendPasswordResetEmail(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.signUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.signUp(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.signIn=function(e){return s.default.getInstanceOrThrow().recipeImplementation.signIn(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.doesEmailExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getResetPasswordTokenFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getResetPasswordTokenFromURL(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.sendVerificationEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.sendVerificationEmail(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.isEmailVerified=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e}();t.default=u;var c=u.init;t.init=c;var l=u.submitNewPassword;t.submitNewPassword=l;var f=u.sendPasswordResetEmail;t.sendPasswordResetEmail=f;var p=u.signUp;t.signUp=p;var d=u.signIn;t.signIn=d;var h=u.doesEmailExist;t.doesEmailExist=h;var v=u.verifyEmail;t.verifyEmail=v;var w=u.sendVerificationEmail;t.sendVerificationEmail=w;var I=u.isEmailVerified;t.isEmailVerified=I;var y=u.signOut;t.signOut=y;var P=u.getResetPasswordTokenFromURL;t.getResetPasswordTokenFromURL=P},7939:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=n(6277),a=n(5110),u=n(4071),c=n(6333),l=n(8122),f=function(e){function t(t,n){var r=e.call(this,(0,a.normaliseUserInput)(t),n)||this,o=new c.default((0,u.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=o.override(r.config.override.functions).build(),r}return o(t,e),t.init=function(e){return function(n){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n}),{emailVerification:void 0}),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of EmailPassword found. Make sure to call the EmailPassword.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="emailpassword",t}(s.default);t.Recipe=f,t.default=f},4071:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=n(634),s=n(8122);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{submitNewPassword:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l;return o(this,(function(o){switch(o.label){case 0:return n=this.getResetPasswordTokenFromURL({userContext:u}),[4,t.post("/user/password/reset",{body:JSON.stringify({formFields:s,token:n,method:"token"})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SUBMIT_NEW_PASSWORD",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,"FIELD_ERROR"===c.status?[2,{status:"FIELD_ERROR",formFields:c.formFields,fetchResponse:l}]:[2,{status:c.status,fetchResponse:l}]}}))}))},sendPasswordResetEmail:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/password/reset/token",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,"FIELD_ERROR"===r.status?[2,{status:"FIELD_ERROR",formFields:r.formFields,fetchResponse:c}]:[2,{status:r.status,fetchResponse:c}]}}))}))},signUp:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/signup",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,"FIELD_ERROR"===r.status?[2,{status:"FIELD_ERROR",formFields:r.formFields,fetchResponse:c}]:[2,{status:r.status,user:r.user,fetchResponse:c}]}}))}))},signIn:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/signin",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,"FIELD_ERROR"===r.status?[2,{status:"FIELD_ERROR",formFields:r.formFields,fetchResponse:c}]:"WRONG_CREDENTIALS_ERROR"===r.status?[2,{status:"WRONG_CREDENTIALS_ERROR",fetchResponse:c}]:[2,{status:"OK",user:r.user,fetchResponse:c}]}}))}))},doesEmailExist:function(n){var s=n.email,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/signup/email/exists",{},{email:s},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,[2,{status:r.status,doesExist:r.exists,fetchResponse:c}]}}))}))},getResetPasswordTokenFromURL:function(){var e=(0,s.getQueryParams)("token");return void 0===e?"":e}}}t.default=a,t.getRecipeImplementation=a},5110:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=n(7870);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},6923:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=n(787),i=n(5120),s=n(6333),a=n(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new s.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(n){return e.instance=new e(r(r({},t),{appInfo:n,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Make sure to call the EmailVerification.init method.";throw t=(0,a.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,a.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=n(634),s=n(8122);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(n){var s=n.options,a=n.userContext;return r(this,void 0,void 0,(function(){var n,r,u,c;return o(this,(function(o){switch(o.label){case 0:return n=this.getEmailVerificationTokenFromURL({userContext:a}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:n})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"VERIFY_EMAIL"}))];case 1:return r=o.sent(),u=r.jsonBody,c=r.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(n){var s=n.options,a=n.userContext;return r(this,void 0,void 0,(function(){var n,r,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/user/email/verify",{},void 0,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"IS_EMAIL_VERIFIED",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"IS_EMAIL_VERIFIED"}))];case 1:return n=o.sent(),r=n.jsonBody,u=n.fetchResponse,[2,{status:"OK",isVerified:r.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(n){var s=n.options,a=n.userContext;return r(this,void 0,void 0,(function(){var n,r,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/email/verify/token",{body:JSON.stringify({})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_VERIFY_EMAIL",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"SEND_VERIFY_EMAIL"}))];case 1:return n=o.sent(),r=n.jsonBody,u=n.fetchResponse,[2,{status:r.status,fetchResponse:u}]}}))}))},getEmailVerificationTokenFromURL:function(){var e=(0,s.getQueryParams)("token");return void 0===e?"":e}}}t.default=a,t.getRecipeImplementation=a},787:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=n(6069);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return n(t,void 0,void 0,(function(){return r(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return n(t,void 0,void 0,(function(){return r(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=n(1996),c=n(1757),l=n(8122),f=function(e){function t(t){var n=e.call(this,t)||this;return n.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},n.getAccessTokenPayloadSecurely=function(e){return s(n,void 0,void 0,(function(){return a(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},n.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},n.signOut=function(e){return c.default.signOut({userContext:e.userContext})},n.attemptRefreshingSession=function(){return s(n,void 0,void 0,(function(){return a(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},c.default.init(i(i({},t),{preAPIHook:function(e){return s(n,void 0,void 0,(function(){var n;return a(this,(function(r){return n=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,n]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),n}return o(t,e),t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:r})),t.instance}},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=f,t.default=f},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(9092),o=n(7611),i=n(7992),s=n(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var n=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];n.searchParams.set(t,r)})),n.href}catch(n){var r=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(r).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];o.searchParams.set(t,n)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,n,r=new s.default("");return void 0!==e.apiGatewayPath&&(r=new s.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:r.appendPath((t=o.DEFAULT_API_BASE_PATH,n=e.apiBasePath,void 0!==n?new s.default(n):new s.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.1.5",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},942:(e,t,n)=>{function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let o=n(6398);void 0!==o.default?r(o):r({default:o,...o})},9092:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7860))}},e=>{var t=(6022,e(e.s=6022));supertokensEmailPassword=t}]); | ||
"use strict";var supertokensEmailPassword;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[581],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var r=new URL(e);return t?r.hostname.startsWith("localhost")||(o=r.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),n(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=n(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},634:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1260),a=n(255),u=n(2173),c=function(){function e(e,t){var n=this;this.get=function(e,t,s,a,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,s),r({method:"GET"},t),a,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.post=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),r({method:"POST"},t),s,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.delete=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"DELETE"},t),s,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.put=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"PUT"},t),s,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.fetch=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n,o,c,l,f,p;return i(this,(function(i){switch(i.label){case 0:return n=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:s,url:e,requestInit:r(r({},t),{headers:r(r({},n),{"fdi-version":a.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===u?[3,4]:(p=f.clone(),[4,u({requestInit:c,url:e,fetchResponse:p})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(e){return o(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var r=new s.default(e),o="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(n.appInfo.apiBasePath.getAsStringDangerous()).concat(r.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=r.sent()).status)throw n=void 0===t.message?"No Error Message Provided":t.message,new u.default(n);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var n=e.recipePreAPIHook,s=e.action,a=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{action:s,userContext:u}))];case 1:return o=t.sent(),void 0===a||void 0===a.preAPIHook?[2,o]:[2,a.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var n=e.recipePostAPIHook,s=e.action,a=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{userContext:a,action:s}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(1996),u=n(6322),c=function(e){function t(t){var n=e.call(this,t)||this;return n.signOut=function(e){return i(n,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},n}return o(t,e),t}(a.default);t.default=c},5053:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var r=n(6069);t.normaliseAuthRecipe=function(e){return(0,r.normaliseRecipeModuleConfig)(e)}},6277:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(6923),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.emailVerificationRecipe=void 0===n.emailVerification?new i.default({appInfo:t.appInfo,recipeId:t.recipeId,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:void 0===t.override?void 0:t.override.emailVerification}):n.emailVerification,r}return o(t,e),t}(n(7725).default);t.default=s},7870:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipeWithEmailVerificationConfig=void 0;var r=n(5053);t.normaliseAuthRecipeWithEmailVerificationConfig=function(e){return(0,r.normaliseAuthRecipe)(e)}},6022:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.signOut=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.getResetPasswordTokenFromURL=t.doesEmailExist=t.signIn=t.signUp=t.sendPasswordResetEmail=t.submitNewPassword=t.init=void 0;var s=n(7939),a=n(8122),u=function(){function e(){}return e.init=function(e){return s.default.init(e)},e.signOut=function(e){return s.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.submitNewPassword=function(e){return s.default.getInstanceOrThrow().recipeImplementation.submitNewPassword(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.sendPasswordResetEmail=function(e){return s.default.getInstanceOrThrow().recipeImplementation.sendPasswordResetEmail(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.signUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.signUp(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.signIn=function(e){return s.default.getInstanceOrThrow().recipeImplementation.signIn(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.doesEmailExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getResetPasswordTokenFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getResetPasswordTokenFromURL(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.sendVerificationEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.sendVerificationEmail(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.isEmailVerified=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e}();t.default=u;var c=u.init;t.init=c;var l=u.submitNewPassword;t.submitNewPassword=l;var f=u.sendPasswordResetEmail;t.sendPasswordResetEmail=f;var p=u.signUp;t.signUp=p;var d=u.signIn;t.signIn=d;var h=u.doesEmailExist;t.doesEmailExist=h;var v=u.verifyEmail;t.verifyEmail=v;var w=u.sendVerificationEmail;t.sendVerificationEmail=w;var I=u.isEmailVerified;t.isEmailVerified=I;var y=u.signOut;t.signOut=y;var P=u.getResetPasswordTokenFromURL;t.getResetPasswordTokenFromURL=P},7939:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=n(6277),a=n(5110),u=n(4071),c=n(6333),l=n(8122),f=function(e){function t(t,n){var r=e.call(this,(0,a.normaliseUserInput)(t),n)||this,o=new c.default((0,u.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=o.override(r.config.override.functions).build(),r}return o(t,e),t.init=function(e){return function(n){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n}),{emailVerification:void 0}),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of EmailPassword found. Make sure to call the EmailPassword.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="emailpassword",t}(s.default);t.Recipe=f,t.default=f},4071:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=n(634),s=n(8122);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{submitNewPassword:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l;return o(this,(function(o){switch(o.label){case 0:return n=this.getResetPasswordTokenFromURL({userContext:u}),[4,t.post("/user/password/reset",{body:JSON.stringify({formFields:s,token:n,method:"token"})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SUBMIT_NEW_PASSWORD",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,"FIELD_ERROR"===c.status?[2,{status:"FIELD_ERROR",formFields:c.formFields,fetchResponse:l}]:[2,{status:c.status,fetchResponse:l}]}}))}))},sendPasswordResetEmail:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/password/reset/token",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,"FIELD_ERROR"===r.status?[2,{status:"FIELD_ERROR",formFields:r.formFields,fetchResponse:c}]:[2,{status:r.status,fetchResponse:c}]}}))}))},signUp:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/signup",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,"FIELD_ERROR"===r.status?[2,{status:"FIELD_ERROR",formFields:r.formFields,fetchResponse:c}]:[2,{status:r.status,user:r.user,fetchResponse:c}]}}))}))},signIn:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/signin",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,"FIELD_ERROR"===r.status?[2,{status:"FIELD_ERROR",formFields:r.formFields,fetchResponse:c}]:"WRONG_CREDENTIALS_ERROR"===r.status?[2,{status:"WRONG_CREDENTIALS_ERROR",fetchResponse:c}]:[2,{status:"OK",user:r.user,fetchResponse:c}]}}))}))},doesEmailExist:function(n){var s=n.email,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/signup/email/exists",{},{email:s},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,[2,{status:r.status,doesExist:r.exists,fetchResponse:c}]}}))}))},getResetPasswordTokenFromURL:function(){var e=(0,s.getQueryParams)("token");return void 0===e?"":e}}}t.default=a,t.getRecipeImplementation=a},5110:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=n(7870);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},6923:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=n(787),i=n(5120),s=n(6333),a=n(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new s.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(n){return e.instance=new e(r(r({},t),{appInfo:n,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Make sure to call the EmailVerification.init method.";throw t=(0,a.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,a.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=n(634),s=n(8122);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(n){var s=n.options,a=n.userContext;return r(this,void 0,void 0,(function(){var n,r,u,c;return o(this,(function(o){switch(o.label){case 0:return n=this.getEmailVerificationTokenFromURL({userContext:a}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:n})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"VERIFY_EMAIL"}))];case 1:return r=o.sent(),u=r.jsonBody,c=r.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(n){var s=n.options,a=n.userContext;return r(this,void 0,void 0,(function(){var n,r,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/user/email/verify",{},void 0,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"IS_EMAIL_VERIFIED",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"IS_EMAIL_VERIFIED"}))];case 1:return n=o.sent(),r=n.jsonBody,u=n.fetchResponse,[2,{status:"OK",isVerified:r.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(n){var s=n.options,a=n.userContext;return r(this,void 0,void 0,(function(){var n,r,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/email/verify/token",{body:JSON.stringify({})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_VERIFY_EMAIL",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"SEND_VERIFY_EMAIL"}))];case 1:return n=o.sent(),r=n.jsonBody,u=n.fetchResponse,[2,{status:r.status,fetchResponse:u}]}}))}))},getEmailVerificationTokenFromURL:function(){var e=(0,s.getQueryParams)("token");return void 0===e?"":e}}}t.default=a,t.getRecipeImplementation=a},787:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=n(6069);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return n(t,void 0,void 0,(function(){return r(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return n(t,void 0,void 0,(function(){return r(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=n(1996),c=n(1757),l=n(8122),f=function(e){function t(t){var n=e.call(this,t)||this;return n.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},n.getAccessTokenPayloadSecurely=function(e){return s(n,void 0,void 0,(function(){return a(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},n.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},n.signOut=function(e){return c.default.signOut({userContext:e.userContext})},n.attemptRefreshingSession=function(){return s(n,void 0,void 0,(function(){return a(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},c.default.init(i(i({},t),{preAPIHook:function(e){return s(n,void 0,void 0,(function(){var n;return a(this,(function(r){return n=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,n]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),n}return o(t,e),t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:r})),t.instance}},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=f,t.default=f},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(9092),o=n(7611),i=n(7992),s=n(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var n=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];n.searchParams.set(t,r)})),n.href}catch(n){var r=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(r).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];o.searchParams.set(t,n)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,n,r=new s.default("");return void 0!==e.apiGatewayPath&&(r=new s.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:r.appendPath((t=o.DEFAULT_API_BASE_PATH,n=e.apiBasePath,void 0!==n?new s.default(n):new s.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.1.6",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},942:(e,t,n)=>{function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let o=n(6398);void 0!==o.default?r(o):r({default:o,...o})},9092:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7860))}},e=>{var t=(6022,e(e.s=6022));supertokensEmailPassword=t}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensEmailVerification;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[537],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(942);t.default=n.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(e);return t?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),r(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=r(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return r(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),r("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var n=this;this.startsWith=function(e){return n.value.startsWith(e.value)},this.appendPath=function(t){return new e(n.value+t.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(t)}},634:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1260),s=r(255),u=r(2173),c=function(){function e(e,t){var r=this;this.get=function(e,t,a,s,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,a),n({method:"GET"},t),s,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),n({method:"POST"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"DELETE"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"PUT"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(e,t,a,u){return o(r,void 0,void 0,(function(){var r,o,c,l,f,p;return i(this,(function(i){switch(i.label){case 0:return r=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:a,url:e,requestInit:n(n({},t),{headers:n(n({},r),{"fdi-version":s.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===u?[3,4]:(p=f.clone(),[4,u({requestInit:c,url:e,fetchResponse:p})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(e){return o(r,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var n=new a.default(e),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(r,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=n.sent()).status)throw r=void 0===t.message?"No Error Message Provided":t.message,new u.default(r);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var r=e.recipePreAPIHook,a=e.action,s=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{action:a,userContext:u}))];case 1:return o=t.sent(),void 0===s||void 0===s.preAPIHook?[2,o]:[2,s.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var r=e.recipePostAPIHook,a=e.action,s=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{userContext:s,action:a}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},5857:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getEmailVerificationTokenFromURL=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.init=void 0;var o=r(6923),i=r(8122),a=function(){function e(){}return e.init=function(e){return o.default.init(e)},e.verifyEmail=function(e){return o.default.getInstanceOrThrow().recipeImplementation.verifyEmail(n(n({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.sendVerificationEmail=function(e){return o.default.getInstanceOrThrow().recipeImplementation.sendVerificationEmail(n(n({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.isEmailVerified=function(e){return o.default.getInstanceOrThrow().recipeImplementation.isEmailVerified(n(n({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getEmailVerificationTokenFromURL=function(e){return o.default.getInstanceOrThrow().recipeImplementation.getEmailVerificationTokenFromURL(n(n({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e}();t.default=a;var s=a.init;t.init=s;var u=a.verifyEmail;t.verifyEmail=u;var c=a.sendVerificationEmail;t.sendVerificationEmail=c;var l=a.isEmailVerified;t.isEmailVerified=l;var f=a.getEmailVerificationTokenFromURL;t.getEmailVerificationTokenFromURL=f},6923:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=r(787),i=r(5120),a=r(6333),s=r(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new a.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(r){return e.instance=new e(n(n({},t),{appInfo:r,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Make sure to call the EmailVerification.init method.";throw t=(0,s.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,s.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),a=r(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u,c;return o(this,(function(o){switch(o.label){case 0:return r=this.getEmailVerificationTokenFromURL({userContext:s}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:r})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"VERIFY_EMAIL"}))];case 1:return n=o.sent(),u=n.jsonBody,c=n.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/user/email/verify",{},void 0,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"IS_EMAIL_VERIFIED",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"IS_EMAIL_VERIFIED"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:"OK",isVerified:n.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/email/verify/token",{body:JSON.stringify({})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"SEND_VERIFY_EMAIL"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:n.status,fetchResponse:u}]}}))}))},getEmailVerificationTokenFromURL:function(){var e=(0,a.getQueryParams)("token");return void 0===e?"":e}}}t.default=s,t.getRecipeImplementation=s},787:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(6069);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},6069:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return r(t,void 0,void 0,(function(){return n(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return r(t,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},8122:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var n=r(9092),o=r(7611),i=r(7992),a=r(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var r=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];r.searchParams.set(t,n)})),r.href}catch(r){var n=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];o.searchParams.set(t,r)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,r,n=new a.default("");return void 0!==e.apiGatewayPath&&(n=new a.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:n.appendPath((t=o.DEFAULT_API_BASE_PATH,r=e.apiBasePath,void 0!==r?new a.default(r):new a.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.1.5",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},942:(e,t,r)=>{function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}t.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(7860))}},e=>{var t=(5857,e(e.s=5857));supertokensEmailVerification=t}]); | ||
"use strict";var supertokensEmailVerification;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[537],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(942);t.default=n.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(e);return t?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),r(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=r(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return r(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),r("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var n=this;this.startsWith=function(e){return n.value.startsWith(e.value)},this.appendPath=function(t){return new e(n.value+t.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(t)}},634:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1260),s=r(255),u=r(2173),c=function(){function e(e,t){var r=this;this.get=function(e,t,a,s,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,a),n({method:"GET"},t),s,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),n({method:"POST"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"DELETE"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"PUT"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(e,t,a,u){return o(r,void 0,void 0,(function(){var r,o,c,l,f,p;return i(this,(function(i){switch(i.label){case 0:return r=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:a,url:e,requestInit:n(n({},t),{headers:n(n({},r),{"fdi-version":s.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===u?[3,4]:(p=f.clone(),[4,u({requestInit:c,url:e,fetchResponse:p})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(e){return o(r,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var n=new a.default(e),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(r,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=n.sent()).status)throw r=void 0===t.message?"No Error Message Provided":t.message,new u.default(r);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var r=e.recipePreAPIHook,a=e.action,s=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{action:a,userContext:u}))];case 1:return o=t.sent(),void 0===s||void 0===s.preAPIHook?[2,o]:[2,s.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var r=e.recipePostAPIHook,a=e.action,s=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{userContext:s,action:a}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},5857:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getEmailVerificationTokenFromURL=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.init=void 0;var o=r(6923),i=r(8122),a=function(){function e(){}return e.init=function(e){return o.default.init(e)},e.verifyEmail=function(e){return o.default.getInstanceOrThrow().recipeImplementation.verifyEmail(n(n({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.sendVerificationEmail=function(e){return o.default.getInstanceOrThrow().recipeImplementation.sendVerificationEmail(n(n({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.isEmailVerified=function(e){return o.default.getInstanceOrThrow().recipeImplementation.isEmailVerified(n(n({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getEmailVerificationTokenFromURL=function(e){return o.default.getInstanceOrThrow().recipeImplementation.getEmailVerificationTokenFromURL(n(n({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e}();t.default=a;var s=a.init;t.init=s;var u=a.verifyEmail;t.verifyEmail=u;var c=a.sendVerificationEmail;t.sendVerificationEmail=c;var l=a.isEmailVerified;t.isEmailVerified=l;var f=a.getEmailVerificationTokenFromURL;t.getEmailVerificationTokenFromURL=f},6923:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=r(787),i=r(5120),a=r(6333),s=r(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new a.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(r){return e.instance=new e(n(n({},t),{appInfo:r,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Make sure to call the EmailVerification.init method.";throw t=(0,s.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,s.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),a=r(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u,c;return o(this,(function(o){switch(o.label){case 0:return r=this.getEmailVerificationTokenFromURL({userContext:s}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:r})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"VERIFY_EMAIL"}))];case 1:return n=o.sent(),u=n.jsonBody,c=n.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/user/email/verify",{},void 0,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"IS_EMAIL_VERIFIED",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"IS_EMAIL_VERIFIED"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:"OK",isVerified:n.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/email/verify/token",{body:JSON.stringify({})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"SEND_VERIFY_EMAIL"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:n.status,fetchResponse:u}]}}))}))},getEmailVerificationTokenFromURL:function(){var e=(0,a.getQueryParams)("token");return void 0===e?"":e}}}t.default=s,t.getRecipeImplementation=s},787:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(6069);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},6069:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return r(t,void 0,void 0,(function(){return n(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return r(t,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},8122:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var n=r(9092),o=r(7611),i=r(7992),a=r(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var r=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];r.searchParams.set(t,n)})),r.href}catch(r){var n=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];o.searchParams.set(t,r)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,r,n=new a.default("");return void 0!==e.apiGatewayPath&&(n=new a.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:n.appendPath((t=o.DEFAULT_API_BASE_PATH,r=e.apiBasePath,void 0!==r?new a.default(r):new a.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.1.6",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},942:(e,t,r)=>{function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}t.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(7860))}},e=>{var t=(5857,e(e.s=5857));supertokensEmailVerification=t}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensPasswordless;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[87],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var r=new URL(e);return t?r.hostname.startsWith("localhost")||(o=r.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),n(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=n(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},634:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1260),u=n(255),a=n(2173),c=function(){function e(e,t){var n=this;this.get=function(e,t,s,u,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,s),r({method:"GET"},t),u,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.post=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),r({method:"POST"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.delete=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"DELETE"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.put=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"PUT"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.fetch=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n,o,c,l,f,p;return i(this,(function(i){switch(i.label){case 0:return n=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:s,url:e,requestInit:r(r({},t),{headers:r(r({},n),{"fdi-version":u.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===a?[3,4]:(p=f.clone(),[4,a({requestInit:c,url:e,fetchResponse:p})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(e){return o(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var r=new s.default(e),o="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(n.appInfo.apiBasePath.getAsStringDangerous()).concat(r.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=r.sent()).status)throw n=void 0===t.message?"No Error Message Provided":t.message,new a.default(n);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var n=e.recipePreAPIHook,s=e.action,u=e.options,a=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{action:s,userContext:a}))];case 1:return o=t.sent(),void 0===u||void 0===u.preAPIHook?[2,o]:[2,u.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:a})]}}))}))}},e.preparePostAPIHook=function(e){var n=e.recipePostAPIHook,s=e.action,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{userContext:u,action:s}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(1996),a=n(6322),c=function(e){function t(t){var n=e.call(this,t)||this;return n.signOut=function(e){return i(n,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,a.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},n}return o(t,e),t}(u.default);t.default=c},5053:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var r=n(6069);t.normaliseAuthRecipe=function(e){return(0,r.normaliseRecipeModuleConfig)(e)}},6427:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY=void 0,t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY="supertokens-passwordless-loginAttemptInfo"},6525:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.clearLoginAttemptInfo=t.setLoginAttemptInfo=t.getLoginAttemptInfo=t.getPreAuthSessionIdFromURL=t.getLinkCodeFromURL=t.signOut=t.doesPhoneNumberExist=t.doesEmailExist=t.consumeCode=t.resendCode=t.createCode=t.init=void 0;var s=n(8122),u=n(2856),a=n(4921),c=function(){function e(){}return e.init=function(e){return u.default.init(e)},e.createCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=u.default.getInstanceOrThrow(),[2,a.createCode(r(r({},e),{recipeImplementation:t.recipeImplementation}))]}))}))},e.resendCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=u.default.getInstanceOrThrow(),[2,a.resendCode(r(r({},e),{recipeImplementation:t.recipeImplementation}))]}))}))},e.consumeCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=u.default.getInstanceOrThrow(),[2,a.consumeCode(r(r({},e),{recipeImplementation:t.recipeImplementation}))]}))}))},e.getLinkCodeFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getLinkCodeFromURL(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getPreAuthSessionIdFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getPreAuthSessionIdFromURL(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.doesEmailExist=function(e){return u.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.doesPhoneNumberExist=function(e){return u.default.getInstanceOrThrow().recipeImplementation.doesPhoneNumberExist(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.getLoginAttemptInfo=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getLoginAttemptInfo(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setLoginAttemptInfo=function(e){return u.default.getInstanceOrThrow().recipeImplementation.setLoginAttemptInfo(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.clearLoginAttemptInfo=function(e){return u.default.getInstanceOrThrow().recipeImplementation.clearLoginAttemptInfo(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.signOut=function(e){return u.default.getInstanceOrThrow().signOut({userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e}();t.default=c;var l=c.init;t.init=l;var f=c.createCode;t.createCode=f;var p=c.resendCode;t.resendCode=p;var d=c.consumeCode;t.consumeCode=d;var h=c.doesEmailExist;t.doesEmailExist=h;var v=c.doesPhoneNumberExist;t.doesPhoneNumberExist=v;var I=c.signOut;t.signOut=I;var g=c.getLinkCodeFromURL;t.getLinkCodeFromURL=g;var m=c.getPreAuthSessionIdFromURL;t.getPreAuthSessionIdFromURL=m;var w=c.getLoginAttemptInfo;t.getLoginAttemptInfo=w;var y=c.setLoginAttemptInfo;t.setLoginAttemptInfo=y;var P=c.clearLoginAttemptInfo;t.clearLoginAttemptInfo=P},2856:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=n(6333),u=n(8122),a=n(7725),c=n(4921),l=n(8891),f=function(e){function t(t){var n=e.call(this,(0,c.normaliseUserInput)(t))||this,r=new s.default((0,l.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=r.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(n){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Passwordless found. Make sure to call the Passwordless.init method.";throw e=(0,u.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,u.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="passwordless",t}(a.default);t.Recipe=f,t.default=f},8891:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=n(9092),u=n(634),a=n(8122),c=n(6427);function l(e){var t=new u.default(e.recipeId,e.appInfo);return{createCode:function(n){return o(this,void 0,void 0,(function(){var o,s,a,c;return i(this,(function(i){switch(i.label){case 0:return"email"in n&&(o={email:n.email}),"phoneNumber"in n&&(o={phoneNumber:n.phoneNumber}),[4,t.post("/signinup/code",{body:JSON.stringify(o)},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:n.userContext}))];case 1:return s=i.sent(),a=s.jsonBody,c=s.fetchResponse,[2,r(r({},a),{fetchResponse:c})]}}))}))},resendCode:function(n){return o(this,void 0,void 0,(function(){var r,o,s,a;return i(this,(function(i){switch(i.label){case 0:return r={deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId},[4,t.post("/signinup/code/resend",{body:JSON.stringify(r)},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:n.userContext}))];case 1:return o=i.sent(),s=o.jsonBody,a=o.fetchResponse,[2,{status:s.status,fetchResponse:a}]}}))}))},consumeCode:function(n){return o(this,void 0,void 0,(function(){var o,s,a,c;return i(this,(function(i){switch(i.label){case 0:return o="userInputCode"in n?{userInputCode:n.userInputCode,deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId}:{linkCode:n.linkCode,preAuthSessionId:n.preAuthSessionId},[4,t.post("/signinup/code/consume",{body:JSON.stringify(o)},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:n.userContext}))];case 1:return s=i.sent(),a=s.jsonBody,c=s.fetchResponse,"OK"===a.status?[2,{status:"OK",createdUser:a.createdNewUser,user:a.user,fetchResponse:c}]:[2,r(r({},a),{fetchResponse:c})]}}))}))},getLinkCodeFromURL:function(){return(0,a.getHashFromLocation)()},getPreAuthSessionIdFromURL:function(){var e=(0,a.getQueryParams)("preAuthSessionId");return void 0===e?"":e},doesEmailExist:function(n){return o(this,void 0,void 0,(function(){var r,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/email/exists",{},{email:n.email},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:n.userContext}))];case 1:return r=i.sent(),o=r.jsonBody,s=r.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},doesPhoneNumberExist:function(n){return o(this,void 0,void 0,(function(){var r,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/phoneNumber/exists",{},{phoneNumber:n.phoneNumber},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:n.userContext}))];case 1:return r=i.sent(),o=r.jsonBody,s=r.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},getLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.getItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY)];case 1:if(null===(e=t.sent()))return[2,void 0];try{return[2,JSON.parse(e)]}catch(e){return[2,void 0]}return[2]}}))}))},setLoginAttemptInfo:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.setItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY,JSON.stringify(r({version:1},e.attemptInfo)))];case 1:return t.sent(),[2]}}))}))},clearLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.removeItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY),[2]}))}))}}}t.default=l,t.getRecipeImplementation=l},4921:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.consumeCode=t.resendCode=t.createCode=t.normaliseUserInput=void 0;var s=n(8122),u=n(5053);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,u.normaliseAuthRecipe)(e)),{override:t})},t.createCode=function(e){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.createCode(r(r({},e),{userContext:t}))];case 1:return n=o.sent(),[4,e.recipeImplementation.setLoginAttemptInfo({attemptInfo:{deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId,flowType:n.flowType},userContext:t})];case 2:return o.sent(),[2,n]}}))}))},t.resendCode=function(e){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})];case 1:return n=o.sent(),[2,e.recipeImplementation.resendCode(r(r({},e),{userContext:t,deviceId:void 0===n?"":n.deviceId,preAuthSessionId:void 0===n?"":n.preAuthSessionId}))]}}))}))},t.consumeCode=function(e){return o(this,void 0,void 0,(function(){var t,n,o,u,a;return i(this,(function(i){switch(i.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),"userInputCode"in e?[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})]:[3,2];case 1:return o=i.sent(),n={userInputCode:e.userInputCode,deviceId:void 0===o?"":o.deviceId,preAuthSessionId:void 0===o?"":o.preAuthSessionId},[3,3];case 2:u=e.recipeImplementation.getLinkCodeFromURL({userContext:e.userContext}),a=e.recipeImplementation.getPreAuthSessionIdFromURL({userContext:e.userContext}),n={linkCode:u,preAuthSessionId:a},i.label=3;case 3:return[2,e.recipeImplementation.consumeCode(r({userContext:t,options:e.options},n))]}}))}))}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return n(t,void 0,void 0,(function(){return r(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return n(t,void 0,void 0,(function(){return r(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var a=n(1996),c=n(1757),l=n(8122),f=function(e){function t(t){var n=e.call(this,t)||this;return n.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},n.getAccessTokenPayloadSecurely=function(e){return s(n,void 0,void 0,(function(){return u(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},n.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},n.signOut=function(e){return c.default.signOut({userContext:e.userContext})},n.attemptRefreshingSession=function(){return s(n,void 0,void 0,(function(){return u(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},c.default.init(i(i({},t),{preAPIHook:function(e){return s(n,void 0,void 0,(function(){var n;return u(this,(function(r){return n=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,n]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),n}return o(t,e),t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:r})),t.instance}},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(a.default);t.Recipe=f,t.default=f},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(9092),o=n(7611),i=n(7992),s=n(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var n=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];n.searchParams.set(t,r)})),n.href}catch(n){var r=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(r).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];o.searchParams.set(t,n)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,n,r=new s.default("");return void 0!==e.apiGatewayPath&&(r=new s.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:r.appendPath((t=o.DEFAULT_API_BASE_PATH,n=e.apiBasePath,void 0!==n?new s.default(n):new s.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.1.5",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},942:(e,t,n)=>{function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let o=n(6398);void 0!==o.default?r(o):r({default:o,...o})},9092:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7860))}},e=>{var t=(6525,e(e.s=6525));supertokensPasswordless=t}]); | ||
"use strict";var supertokensPasswordless;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[87],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var r=new URL(e);return t?r.hostname.startsWith("localhost")||(o=r.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),n(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=n(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},634:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1260),u=n(255),a=n(2173),c=function(){function e(e,t){var n=this;this.get=function(e,t,s,u,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,s),r({method:"GET"},t),u,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.post=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),r({method:"POST"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.delete=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"DELETE"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.put=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"PUT"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.fetch=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n,o,c,l,f,p;return i(this,(function(i){switch(i.label){case 0:return n=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:s,url:e,requestInit:r(r({},t),{headers:r(r({},n),{"fdi-version":u.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===a?[3,4]:(p=f.clone(),[4,a({requestInit:c,url:e,fetchResponse:p})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(e){return o(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var r=new s.default(e),o="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(n.appInfo.apiBasePath.getAsStringDangerous()).concat(r.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=r.sent()).status)throw n=void 0===t.message?"No Error Message Provided":t.message,new a.default(n);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var n=e.recipePreAPIHook,s=e.action,u=e.options,a=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{action:s,userContext:a}))];case 1:return o=t.sent(),void 0===u||void 0===u.preAPIHook?[2,o]:[2,u.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:a})]}}))}))}},e.preparePostAPIHook=function(e){var n=e.recipePostAPIHook,s=e.action,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{userContext:u,action:s}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(1996),a=n(6322),c=function(e){function t(t){var n=e.call(this,t)||this;return n.signOut=function(e){return i(n,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,a.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},n}return o(t,e),t}(u.default);t.default=c},5053:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var r=n(6069);t.normaliseAuthRecipe=function(e){return(0,r.normaliseRecipeModuleConfig)(e)}},6427:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY=void 0,t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY="supertokens-passwordless-loginAttemptInfo"},6525:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.clearLoginAttemptInfo=t.setLoginAttemptInfo=t.getLoginAttemptInfo=t.getPreAuthSessionIdFromURL=t.getLinkCodeFromURL=t.signOut=t.doesPhoneNumberExist=t.doesEmailExist=t.consumeCode=t.resendCode=t.createCode=t.init=void 0;var s=n(8122),u=n(2856),a=n(4921),c=function(){function e(){}return e.init=function(e){return u.default.init(e)},e.createCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=u.default.getInstanceOrThrow(),[2,a.createCode(r(r({},e),{recipeImplementation:t.recipeImplementation}))]}))}))},e.resendCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=u.default.getInstanceOrThrow(),[2,a.resendCode(r(r({},e),{recipeImplementation:t.recipeImplementation}))]}))}))},e.consumeCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=u.default.getInstanceOrThrow(),[2,a.consumeCode(r(r({},e),{recipeImplementation:t.recipeImplementation}))]}))}))},e.getLinkCodeFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getLinkCodeFromURL(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getPreAuthSessionIdFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getPreAuthSessionIdFromURL(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.doesEmailExist=function(e){return u.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.doesPhoneNumberExist=function(e){return u.default.getInstanceOrThrow().recipeImplementation.doesPhoneNumberExist(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.getLoginAttemptInfo=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getLoginAttemptInfo(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setLoginAttemptInfo=function(e){return u.default.getInstanceOrThrow().recipeImplementation.setLoginAttemptInfo(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.clearLoginAttemptInfo=function(e){return u.default.getInstanceOrThrow().recipeImplementation.clearLoginAttemptInfo(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.signOut=function(e){return u.default.getInstanceOrThrow().signOut({userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e}();t.default=c;var l=c.init;t.init=l;var f=c.createCode;t.createCode=f;var p=c.resendCode;t.resendCode=p;var d=c.consumeCode;t.consumeCode=d;var h=c.doesEmailExist;t.doesEmailExist=h;var v=c.doesPhoneNumberExist;t.doesPhoneNumberExist=v;var I=c.signOut;t.signOut=I;var g=c.getLinkCodeFromURL;t.getLinkCodeFromURL=g;var m=c.getPreAuthSessionIdFromURL;t.getPreAuthSessionIdFromURL=m;var w=c.getLoginAttemptInfo;t.getLoginAttemptInfo=w;var y=c.setLoginAttemptInfo;t.setLoginAttemptInfo=y;var P=c.clearLoginAttemptInfo;t.clearLoginAttemptInfo=P},2856:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=n(6333),u=n(8122),a=n(7725),c=n(4921),l=n(8891),f=function(e){function t(t){var n=e.call(this,(0,c.normaliseUserInput)(t))||this,r=new s.default((0,l.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=r.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(n){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Passwordless found. Make sure to call the Passwordless.init method.";throw e=(0,u.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,u.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="passwordless",t}(a.default);t.Recipe=f,t.default=f},8891:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=n(9092),u=n(634),a=n(8122),c=n(6427);function l(e){var t=new u.default(e.recipeId,e.appInfo);return{createCode:function(n){return o(this,void 0,void 0,(function(){var o,s,a,c;return i(this,(function(i){switch(i.label){case 0:return"email"in n&&(o={email:n.email}),"phoneNumber"in n&&(o={phoneNumber:n.phoneNumber}),[4,t.post("/signinup/code",{body:JSON.stringify(o)},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:n.userContext}))];case 1:return s=i.sent(),a=s.jsonBody,c=s.fetchResponse,[2,r(r({},a),{fetchResponse:c})]}}))}))},resendCode:function(n){return o(this,void 0,void 0,(function(){var r,o,s,a;return i(this,(function(i){switch(i.label){case 0:return r={deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId},[4,t.post("/signinup/code/resend",{body:JSON.stringify(r)},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:n.userContext}))];case 1:return o=i.sent(),s=o.jsonBody,a=o.fetchResponse,[2,{status:s.status,fetchResponse:a}]}}))}))},consumeCode:function(n){return o(this,void 0,void 0,(function(){var o,s,a,c;return i(this,(function(i){switch(i.label){case 0:return o="userInputCode"in n?{userInputCode:n.userInputCode,deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId}:{linkCode:n.linkCode,preAuthSessionId:n.preAuthSessionId},[4,t.post("/signinup/code/consume",{body:JSON.stringify(o)},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:n.userContext}))];case 1:return s=i.sent(),a=s.jsonBody,c=s.fetchResponse,"OK"===a.status?[2,{status:"OK",createdUser:a.createdNewUser,user:a.user,fetchResponse:c}]:[2,r(r({},a),{fetchResponse:c})]}}))}))},getLinkCodeFromURL:function(){return(0,a.getHashFromLocation)()},getPreAuthSessionIdFromURL:function(){var e=(0,a.getQueryParams)("preAuthSessionId");return void 0===e?"":e},doesEmailExist:function(n){return o(this,void 0,void 0,(function(){var r,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/email/exists",{},{email:n.email},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:n.userContext}))];case 1:return r=i.sent(),o=r.jsonBody,s=r.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},doesPhoneNumberExist:function(n){return o(this,void 0,void 0,(function(){var r,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/phoneNumber/exists",{},{phoneNumber:n.phoneNumber},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:n.userContext}))];case 1:return r=i.sent(),o=r.jsonBody,s=r.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},getLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.getItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY)];case 1:if(null===(e=t.sent()))return[2,void 0];try{return[2,JSON.parse(e)]}catch(e){return[2,void 0]}return[2]}}))}))},setLoginAttemptInfo:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.setItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY,JSON.stringify(r({version:1},e.attemptInfo)))];case 1:return t.sent(),[2]}}))}))},clearLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.removeItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY),[2]}))}))}}}t.default=l,t.getRecipeImplementation=l},4921:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.consumeCode=t.resendCode=t.createCode=t.normaliseUserInput=void 0;var s=n(8122),u=n(5053);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,u.normaliseAuthRecipe)(e)),{override:t})},t.createCode=function(e){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.createCode(r(r({},e),{userContext:t}))];case 1:return n=o.sent(),[4,e.recipeImplementation.setLoginAttemptInfo({attemptInfo:{deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId,flowType:n.flowType},userContext:t})];case 2:return o.sent(),[2,n]}}))}))},t.resendCode=function(e){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})];case 1:return n=o.sent(),[2,e.recipeImplementation.resendCode(r(r({},e),{userContext:t,deviceId:void 0===n?"":n.deviceId,preAuthSessionId:void 0===n?"":n.preAuthSessionId}))]}}))}))},t.consumeCode=function(e){return o(this,void 0,void 0,(function(){var t,n,o,u,a;return i(this,(function(i){switch(i.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),"userInputCode"in e?[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})]:[3,2];case 1:return o=i.sent(),n={userInputCode:e.userInputCode,deviceId:void 0===o?"":o.deviceId,preAuthSessionId:void 0===o?"":o.preAuthSessionId},[3,3];case 2:u=e.recipeImplementation.getLinkCodeFromURL({userContext:e.userContext}),a=e.recipeImplementation.getPreAuthSessionIdFromURL({userContext:e.userContext}),n={linkCode:u,preAuthSessionId:a},i.label=3;case 3:return[2,e.recipeImplementation.consumeCode(r({userContext:t,options:e.options},n))]}}))}))}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return n(t,void 0,void 0,(function(){return r(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return n(t,void 0,void 0,(function(){return r(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var a=n(1996),c=n(1757),l=n(8122),f=function(e){function t(t){var n=e.call(this,t)||this;return n.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},n.getAccessTokenPayloadSecurely=function(e){return s(n,void 0,void 0,(function(){return u(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},n.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},n.signOut=function(e){return c.default.signOut({userContext:e.userContext})},n.attemptRefreshingSession=function(){return s(n,void 0,void 0,(function(){return u(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},c.default.init(i(i({},t),{preAPIHook:function(e){return s(n,void 0,void 0,(function(){var n;return u(this,(function(r){return n=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,n]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),n}return o(t,e),t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:r})),t.instance}},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(a.default);t.Recipe=f,t.default=f},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(9092),o=n(7611),i=n(7992),s=n(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var n=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];n.searchParams.set(t,r)})),n.href}catch(n){var r=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(r).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];o.searchParams.set(t,n)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,n,r=new s.default("");return void 0!==e.apiGatewayPath&&(r=new s.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:r.appendPath((t=o.DEFAULT_API_BASE_PATH,n=e.apiBasePath,void 0!==n?new s.default(n):new s.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.1.6",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},942:(e,t,n)=>{function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let o=n(6398);void 0!==o.default?r(o):r({default:o,...o})},9092:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7860))}},e=>{var t=(6525,e(e.s=6525));supertokensPasswordless=t}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensThirdParty;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[298],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(942);t.default=n.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(e);return t?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),r(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=r(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return r(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),r("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var n=this;this.startsWith=function(e){return n.value.startsWith(e.value)},this.appendPath=function(t){return new e(n.value+t.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(t)}},634:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1260),s=r(255),u=r(2173),c=function(){function e(e,t){var r=this;this.get=function(e,t,a,s,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,a),n({method:"GET"},t),s,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),n({method:"POST"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"DELETE"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"PUT"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(e,t,a,u){return o(r,void 0,void 0,(function(){var r,o,c,f,l,p;return i(this,(function(i){switch(i.label){case 0:return r=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:a,url:e,requestInit:n(n({},t),{headers:n(n({},r),{"fdi-version":s.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,f=o.url,[4,fetch(f,c)];case 2:if((l=i.sent()).status>=300)throw l;return void 0===u?[3,4]:(p=l.clone(),[4,u({requestInit:c,url:e,fetchResponse:p})]);case 3:i.sent(),i.label=4;case 4:return[2,l]}}))}))},this.callPreAPIHook=function(e){return o(r,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var n=new a.default(e),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(r,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=n.sent()).status)throw r=void 0===t.message?"No Error Message Provided":t.message,new u.default(r);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var r=e.recipePreAPIHook,a=e.action,s=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{action:a,userContext:u}))];case 1:return o=t.sent(),void 0===s||void 0===s.preAPIHook?[2,o]:[2,s.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var r=e.recipePostAPIHook,a=e.action,s=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{userContext:s,action:a}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1996),u=r(6322),c=function(e){function t(t){var r=e.call(this,t)||this;return r.signOut=function(e){return i(r,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},r}return o(t,e),t}(s.default);t.default=c},5053:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var n=r(6069);t.normaliseAuthRecipe=function(e){return(0,n.normaliseRecipeModuleConfig)(e)}},6277:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(6923),a=function(e){function t(t,r){var n=e.call(this,t)||this;return n.emailVerificationRecipe=void 0===r.emailVerification?new i.default({appInfo:t.appInfo,recipeId:t.recipeId,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:void 0===t.override?void 0:t.override.emailVerification}):r.emailVerification,n}return o(t,e),t}(r(7725).default);t.default=a},7870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipeWithEmailVerificationConfig=void 0;var n=r(5053);t.normaliseAuthRecipeWithEmailVerificationConfig=function(e){return(0,n.normaliseAuthRecipe)(e)}},6923:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=r(787),i=r(5120),a=r(6333),s=r(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new a.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(r){return e.instance=new e(n(n({},t),{appInfo:r,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Make sure to call the EmailVerification.init method.";throw t=(0,s.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,s.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),a=r(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u,c;return o(this,(function(o){switch(o.label){case 0:return r=this.getEmailVerificationTokenFromURL({userContext:s}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:r})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"VERIFY_EMAIL"}))];case 1:return n=o.sent(),u=n.jsonBody,c=n.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/user/email/verify",{},void 0,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"IS_EMAIL_VERIFIED",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"IS_EMAIL_VERIFIED"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:"OK",isVerified:n.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/email/verify/token",{body:JSON.stringify({})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"SEND_VERIFY_EMAIL"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:n.status,fetchResponse:u}]}}))}))},getEmailVerificationTokenFromURL:function(){var e=(0,a.getQueryParams)("token");return void 0===e?"":e}}}t.default=s,t.getRecipeImplementation=s},787:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(6069);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return r(t,void 0,void 0,(function(){return n(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return r(t,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=r(1996),c=r(1757),f=r(8122),l=function(e){function t(t){var r=e.call(this,t)||this;return r.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},r.getAccessTokenPayloadSecurely=function(e){return a(r,void 0,void 0,(function(){return s(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},r.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},r.signOut=function(e){return c.default.signOut({userContext:e.userContext})},r.attemptRefreshingSession=function(){return a(r,void 0,void 0,(function(){return s(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},c.default.init(i(i({},t),{preAPIHook:function(e){return a(r,void 0,void 0,(function(){var r;return s(this,(function(n){return r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,r]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),r}return o(t,e),t.init=function(e){return function(r,n){return t.instance=new t(i(i({},e),{appInfo:r,recipeId:t.RECIPE_ID,enableDebugLogs:n})),t.instance}},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=l,t.default=l},1257:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getAuthStateFromURL=t.getAuthErrorFromURL=t.getAuthCodeFromURL=t.verifyAndGetStateOrThrowError=t.generateStateToSendToOAuthProvider=t.getAuthorisationURLFromBackend=t.setStateAndOtherInfoToStorage=t.getStateAndOtherInfoFromStorage=t.signOut=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.signInAndUp=t.getAuthorisationURLWithQueryParamsAndSetState=t.init=void 0;var a=r(8122),s=r(9102),u=function(){function e(){}return e.init=function(e){return s.default.init(e)},e.signOut=function(e){return s.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getStateAndOtherInfoFromStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setStateAndOtherInfoToStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setStateAndOtherInfoToStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthorisationURLWithQueryParamsAndSetState=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthorisationURLFromBackend=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLFromBackend(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.signInAndUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.signInAndUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.generateStateToSendToOAuthProvider=function(e){return s.default.getInstanceOrThrow().recipeImplementation.generateStateToSendToOAuthProvider(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyAndGetStateOrThrowError=function(e){return s.default.getInstanceOrThrow().recipeImplementation.verifyAndGetStateOrThrowError(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthErrorFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthErrorFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthStateFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthStateFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.sendVerificationEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.sendVerificationEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.isEmailVerified=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e}();t.default=u;var c=u.init;t.init=c;var f=u.getAuthorisationURLWithQueryParamsAndSetState;t.getAuthorisationURLWithQueryParamsAndSetState=f;var l=u.signInAndUp;t.signInAndUp=l;var p=u.verifyEmail;t.verifyEmail=p;var h=u.sendVerificationEmail;t.sendVerificationEmail=h;var d=u.isEmailVerified;t.isEmailVerified=d;var v=u.getStateAndOtherInfoFromStorage;t.getStateAndOtherInfoFromStorage=v;var g=u.setStateAndOtherInfoToStorage;t.setStateAndOtherInfoToStorage=g;var y=u.getAuthorisationURLFromBackend;t.getAuthorisationURLFromBackend=y;var m=u.generateStateToSendToOAuthProvider;t.generateStateToSendToOAuthProvider=m;var w=u.verifyAndGetStateOrThrowError;t.verifyAndGetStateOrThrowError=w;var I=u.getAuthCodeFromURL;t.getAuthCodeFromURL=I;var P=u.getAuthErrorFromURL;t.getAuthErrorFromURL=P;var A=u.getAuthStateFromURL;t.getAuthStateFromURL=A;var b=u.signOut;t.signOut=b},9102:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var a=r(6277),s=r(4566),u=r(6333),c=r(3664),f=r(8122),l=function(e){function t(t,r){var n=e.call(this,(0,s.normaliseUserInput)(t),r)||this,o=new u.default((0,c.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=o.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{emailVerification:void 0}),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdParty found. Make sure to call the ThirdParty.init method.";throw e=(0,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdparty",t}(a.default);t.Recipe=l,t.default=l},3664:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var a=r(634),s=r(8122),u=r(2173),c=r(9092);function f(e){var t=new a.default(e.recipeId,e.appInfo);return{getStateAndOtherInfoFromStorage:function(){var e=c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.getItemSync("supertokens-oauth-state-2");if(null!==e)try{return JSON.parse(e)}catch(e){return}},setStateAndOtherInfoToStorage:function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=JSON.stringify(n({},e.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",t)];case 1:return r.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return o(this,void 0,void 0,(function(){var t,r,n,o;return i(this,(function(i){switch(i.label){case 0:return t=this.generateStateToSendToOAuthProvider({userContext:e.userContext}),r=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:t,providerId:e.providerId,expiresAt:r,authorisationURL:e.authorisationURL,providerClientId:e.providerClientId},userContext:e.userContext})];case 1:return i.sent(),[4,this.getAuthorisationURLFromBackend({providerId:e.providerId,userContext:e.userContext,options:e.options})];case 2:return n=i.sent(),o=new URL(n.url),[2,null!==o.searchParams.get("redirect_uri")?(0,s.appendQueryParamsToURL)(n.url,{state:t}):(0,s.appendQueryParamsToURL)(n.url,{state:t,redirect_uri:e.authorisationURL})]}}))}))},getAuthorisationURLFromBackend:function(r){return o(this,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/authorisationurl",{},{thirdPartyId:r.providerId},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:s}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,s,c,f,l,p,h,d;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),s=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:s,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),f=this.getAuthCodeFromURL({userContext:r.userContext}),void 0!==(l=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(l));return[4,t.post("/signinup",{body:JSON.stringify({code:f,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(p=i.sent(),h=p.jsonBody,d=p.fetchResponse,"FIELD_ERROR"===h.status)throw new u.default(h.error);return[2,n(n({},h),{fetchResponse:d})]}}))}))},generateStateToSendToOAuthProvider:function(){return"".concat(1e20).replace(/[018]/g,(function(e){return(parseInt(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(e)/4).toString(16)}))},verifyAndGetStateOrThrowError:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){if(void 0===e.stateObjectFromStorage||void 0===e.stateObjectFromStorage.stateForAuthProvider)throw new Error("No valid auth state present in session storage");if(void 0===e.stateFromAuthProvider)throw new Error("No state recieved from auth provider");if(e.stateObjectFromStorage.expiresAt<Date.now())throw new Error("Auth state verification failed. The auth provider took too long to respond");if(e.stateFromAuthProvider!==e.stateObjectFromStorage.stateForAuthProvider)throw new Error("Auth state verification failed. The auth provider responded with an invalid state");return[2,e.stateObjectFromStorage]}))}))},getAuthCodeFromURL:function(){var e=(0,s.getQueryParams)("code");return void 0===e?"":e},getAuthErrorFromURL:function(){return(0,s.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,s.getQueryParams)("state");return void 0===e?"":e}}}t.default=f,t.getRecipeImplementation=f},4566:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},8122:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var n=r(9092),o=r(7611),i=r(7992),a=r(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var r=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];r.searchParams.set(t,n)})),r.href}catch(r){var n=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];o.searchParams.set(t,r)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,r,n=new a.default("");return void 0!==e.apiGatewayPath&&(n=new a.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:n.appendPath((t=o.DEFAULT_API_BASE_PATH,r=e.apiBasePath,void 0!==r?new a.default(r):new a.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.1.5",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},942:(e,t,r)=>{function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}t.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(7860))}},e=>{var t=(1257,e(e.s=1257));supertokensThirdParty=t}]); | ||
"use strict";var supertokensThirdParty;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[298],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(942);t.default=n.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(e);return t?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),r(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=r(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return r(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),r("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var n=this;this.startsWith=function(e){return n.value.startsWith(e.value)},this.appendPath=function(t){return new e(n.value+t.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(t)}},634:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1260),s=r(255),u=r(2173),c=function(){function e(e,t){var r=this;this.get=function(e,t,a,s,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,a),n({method:"GET"},t),s,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),n({method:"POST"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"DELETE"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"PUT"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(e,t,a,u){return o(r,void 0,void 0,(function(){var r,o,c,f,l,p;return i(this,(function(i){switch(i.label){case 0:return r=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:a,url:e,requestInit:n(n({},t),{headers:n(n({},r),{"fdi-version":s.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,f=o.url,[4,fetch(f,c)];case 2:if((l=i.sent()).status>=300)throw l;return void 0===u?[3,4]:(p=l.clone(),[4,u({requestInit:c,url:e,fetchResponse:p})]);case 3:i.sent(),i.label=4;case 4:return[2,l]}}))}))},this.callPreAPIHook=function(e){return o(r,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var n=new a.default(e),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(r,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=n.sent()).status)throw r=void 0===t.message?"No Error Message Provided":t.message,new u.default(r);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var r=e.recipePreAPIHook,a=e.action,s=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{action:a,userContext:u}))];case 1:return o=t.sent(),void 0===s||void 0===s.preAPIHook?[2,o]:[2,s.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var r=e.recipePostAPIHook,a=e.action,s=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{userContext:s,action:a}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1996),u=r(6322),c=function(e){function t(t){var r=e.call(this,t)||this;return r.signOut=function(e){return i(r,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},r}return o(t,e),t}(s.default);t.default=c},5053:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var n=r(6069);t.normaliseAuthRecipe=function(e){return(0,n.normaliseRecipeModuleConfig)(e)}},6277:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(6923),a=function(e){function t(t,r){var n=e.call(this,t)||this;return n.emailVerificationRecipe=void 0===r.emailVerification?new i.default({appInfo:t.appInfo,recipeId:t.recipeId,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:void 0===t.override?void 0:t.override.emailVerification}):r.emailVerification,n}return o(t,e),t}(r(7725).default);t.default=a},7870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipeWithEmailVerificationConfig=void 0;var n=r(5053);t.normaliseAuthRecipeWithEmailVerificationConfig=function(e){return(0,n.normaliseAuthRecipe)(e)}},6923:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=r(787),i=r(5120),a=r(6333),s=r(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new a.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(r){return e.instance=new e(n(n({},t),{appInfo:r,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Make sure to call the EmailVerification.init method.";throw t=(0,s.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,s.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),a=r(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u,c;return o(this,(function(o){switch(o.label){case 0:return r=this.getEmailVerificationTokenFromURL({userContext:s}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:r})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"VERIFY_EMAIL"}))];case 1:return n=o.sent(),u=n.jsonBody,c=n.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/user/email/verify",{},void 0,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"IS_EMAIL_VERIFIED",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"IS_EMAIL_VERIFIED"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:"OK",isVerified:n.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/email/verify/token",{body:JSON.stringify({})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"SEND_VERIFY_EMAIL"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:n.status,fetchResponse:u}]}}))}))},getEmailVerificationTokenFromURL:function(){var e=(0,a.getQueryParams)("token");return void 0===e?"":e}}}t.default=s,t.getRecipeImplementation=s},787:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(6069);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return r(t,void 0,void 0,(function(){return n(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return r(t,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=r(1996),c=r(1757),f=r(8122),l=function(e){function t(t){var r=e.call(this,t)||this;return r.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},r.getAccessTokenPayloadSecurely=function(e){return a(r,void 0,void 0,(function(){return s(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},r.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},r.signOut=function(e){return c.default.signOut({userContext:e.userContext})},r.attemptRefreshingSession=function(){return a(r,void 0,void 0,(function(){return s(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},c.default.init(i(i({},t),{preAPIHook:function(e){return a(r,void 0,void 0,(function(){var r;return s(this,(function(n){return r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,r]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),r}return o(t,e),t.init=function(e){return function(r,n){return t.instance=new t(i(i({},e),{appInfo:r,recipeId:t.RECIPE_ID,enableDebugLogs:n})),t.instance}},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=l,t.default=l},1257:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getAuthStateFromURL=t.getAuthErrorFromURL=t.getAuthCodeFromURL=t.verifyAndGetStateOrThrowError=t.generateStateToSendToOAuthProvider=t.getAuthorisationURLFromBackend=t.setStateAndOtherInfoToStorage=t.getStateAndOtherInfoFromStorage=t.signOut=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.signInAndUp=t.getAuthorisationURLWithQueryParamsAndSetState=t.init=void 0;var a=r(8122),s=r(9102),u=function(){function e(){}return e.init=function(e){return s.default.init(e)},e.signOut=function(e){return s.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getStateAndOtherInfoFromStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setStateAndOtherInfoToStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setStateAndOtherInfoToStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthorisationURLWithQueryParamsAndSetState=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthorisationURLFromBackend=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLFromBackend(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.signInAndUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.signInAndUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.generateStateToSendToOAuthProvider=function(e){return s.default.getInstanceOrThrow().recipeImplementation.generateStateToSendToOAuthProvider(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyAndGetStateOrThrowError=function(e){return s.default.getInstanceOrThrow().recipeImplementation.verifyAndGetStateOrThrowError(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthErrorFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthErrorFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthStateFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthStateFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.sendVerificationEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.sendVerificationEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.isEmailVerified=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e}();t.default=u;var c=u.init;t.init=c;var f=u.getAuthorisationURLWithQueryParamsAndSetState;t.getAuthorisationURLWithQueryParamsAndSetState=f;var l=u.signInAndUp;t.signInAndUp=l;var p=u.verifyEmail;t.verifyEmail=p;var h=u.sendVerificationEmail;t.sendVerificationEmail=h;var d=u.isEmailVerified;t.isEmailVerified=d;var v=u.getStateAndOtherInfoFromStorage;t.getStateAndOtherInfoFromStorage=v;var g=u.setStateAndOtherInfoToStorage;t.setStateAndOtherInfoToStorage=g;var y=u.getAuthorisationURLFromBackend;t.getAuthorisationURLFromBackend=y;var m=u.generateStateToSendToOAuthProvider;t.generateStateToSendToOAuthProvider=m;var w=u.verifyAndGetStateOrThrowError;t.verifyAndGetStateOrThrowError=w;var I=u.getAuthCodeFromURL;t.getAuthCodeFromURL=I;var P=u.getAuthErrorFromURL;t.getAuthErrorFromURL=P;var A=u.getAuthStateFromURL;t.getAuthStateFromURL=A;var b=u.signOut;t.signOut=b},9102:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var a=r(6277),s=r(4566),u=r(6333),c=r(3664),f=r(8122),l=function(e){function t(t,r){var n=e.call(this,(0,s.normaliseUserInput)(t),r)||this,o=new u.default((0,c.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=o.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{emailVerification:void 0}),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdParty found. Make sure to call the ThirdParty.init method.";throw e=(0,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdparty",t}(a.default);t.Recipe=l,t.default=l},3664:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var a=r(634),s=r(8122),u=r(2173),c=r(9092);function f(e){var t=new a.default(e.recipeId,e.appInfo);return{getStateAndOtherInfoFromStorage:function(){var e=c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.getItemSync("supertokens-oauth-state-2");if(null!==e)try{return JSON.parse(e)}catch(e){return}},setStateAndOtherInfoToStorage:function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=JSON.stringify(n({},e.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",t)];case 1:return r.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return o(this,void 0,void 0,(function(){var t,r,n,o;return i(this,(function(i){switch(i.label){case 0:return t=this.generateStateToSendToOAuthProvider({userContext:e.userContext}),r=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:t,providerId:e.providerId,expiresAt:r,authorisationURL:e.authorisationURL,providerClientId:e.providerClientId},userContext:e.userContext})];case 1:return i.sent(),[4,this.getAuthorisationURLFromBackend({providerId:e.providerId,userContext:e.userContext,options:e.options})];case 2:return n=i.sent(),o=new URL(n.url),[2,null!==o.searchParams.get("redirect_uri")?(0,s.appendQueryParamsToURL)(n.url,{state:t}):(0,s.appendQueryParamsToURL)(n.url,{state:t,redirect_uri:e.authorisationURL})]}}))}))},getAuthorisationURLFromBackend:function(r){return o(this,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/authorisationurl",{},{thirdPartyId:r.providerId},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:s}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,s,c,f,l,p,h,d;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),s=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:s,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),f=this.getAuthCodeFromURL({userContext:r.userContext}),void 0!==(l=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(l));return[4,t.post("/signinup",{body:JSON.stringify({code:f,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(p=i.sent(),h=p.jsonBody,d=p.fetchResponse,"FIELD_ERROR"===h.status)throw new u.default(h.error);return[2,n(n({},h),{fetchResponse:d})]}}))}))},generateStateToSendToOAuthProvider:function(){return"".concat(1e20).replace(/[018]/g,(function(e){return(parseInt(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(e)/4).toString(16)}))},verifyAndGetStateOrThrowError:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){if(void 0===e.stateObjectFromStorage||void 0===e.stateObjectFromStorage.stateForAuthProvider)throw new Error("No valid auth state present in session storage");if(void 0===e.stateFromAuthProvider)throw new Error("No state recieved from auth provider");if(e.stateObjectFromStorage.expiresAt<Date.now())throw new Error("Auth state verification failed. The auth provider took too long to respond");if(e.stateFromAuthProvider!==e.stateObjectFromStorage.stateForAuthProvider)throw new Error("Auth state verification failed. The auth provider responded with an invalid state");return[2,e.stateObjectFromStorage]}))}))},getAuthCodeFromURL:function(){var e=(0,s.getQueryParams)("code");return void 0===e?"":e},getAuthErrorFromURL:function(){return(0,s.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,s.getQueryParams)("state");return void 0===e?"":e}}}t.default=f,t.getRecipeImplementation=f},4566:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},8122:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var n=r(9092),o=r(7611),i=r(7992),a=r(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var r=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];r.searchParams.set(t,n)})),r.href}catch(r){var n=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];o.searchParams.set(t,r)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,r,n=new a.default("");return void 0!==e.apiGatewayPath&&(n=new a.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:n.appendPath((t=o.DEFAULT_API_BASE_PATH,r=e.apiBasePath,void 0!==r?new a.default(r):new a.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.1.6",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},942:(e,t,r)=>{function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}t.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(7860))}},e=>{var t=(1257,e(e.s=1257));supertokensThirdParty=t}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensThirdPartyEmailPassword;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[828],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(942);t.default=n.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(e);return t?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),r(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=r(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return r(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),r("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var n=this;this.startsWith=function(e){return n.value.startsWith(e.value)},this.appendPath=function(t){return new e(n.value+t.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(t)}},634:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1260),s=r(255),u=r(2173),c=function(){function e(e,t){var r=this;this.get=function(e,t,a,s,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,a),n({method:"GET"},t),s,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),n({method:"POST"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"DELETE"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"PUT"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(e,t,a,u){return o(r,void 0,void 0,(function(){var r,o,c,f,l,d;return i(this,(function(i){switch(i.label){case 0:return r=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:a,url:e,requestInit:n(n({},t),{headers:n(n({},r),{"fdi-version":s.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,f=o.url,[4,fetch(f,c)];case 2:if((l=i.sent()).status>=300)throw l;return void 0===u?[3,4]:(d=l.clone(),[4,u({requestInit:c,url:e,fetchResponse:d})]);case 3:i.sent(),i.label=4;case 4:return[2,l]}}))}))},this.callPreAPIHook=function(e){return o(r,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var n=new a.default(e),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(r,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=n.sent()).status)throw r=void 0===t.message?"No Error Message Provided":t.message,new u.default(r);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var r=e.recipePreAPIHook,a=e.action,s=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{action:a,userContext:u}))];case 1:return o=t.sent(),void 0===s||void 0===s.preAPIHook?[2,o]:[2,s.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var r=e.recipePostAPIHook,a=e.action,s=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{userContext:s,action:a}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1996),u=r(6322),c=function(e){function t(t){var r=e.call(this,t)||this;return r.signOut=function(e){return i(r,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},r}return o(t,e),t}(s.default);t.default=c},5053:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var n=r(6069);t.normaliseAuthRecipe=function(e){return(0,n.normaliseRecipeModuleConfig)(e)}},6277:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(6923),a=function(e){function t(t,r){var n=e.call(this,t)||this;return n.emailVerificationRecipe=void 0===r.emailVerification?new i.default({appInfo:t.appInfo,recipeId:t.recipeId,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:void 0===t.override?void 0:t.override.emailVerification}):r.emailVerification,n}return o(t,e),t}(r(7725).default);t.default=a},7870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipeWithEmailVerificationConfig=void 0;var n=r(5053);t.normaliseAuthRecipeWithEmailVerificationConfig=function(e){return(0,n.normaliseAuthRecipe)(e)}},7939:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var a=r(6277),s=r(5110),u=r(4071),c=r(6333),f=r(8122),l=function(e){function t(t,r){var n=e.call(this,(0,s.normaliseUserInput)(t),r)||this,o=new c.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=o.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{emailVerification:void 0}),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of EmailPassword found. Make sure to call the EmailPassword.init method.";throw e=(0,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="emailpassword",t}(a.default);t.Recipe=l,t.default=l},4071:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),a=r(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{submitNewPassword:function(r){var a=r.formFields,s=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c,f;return o(this,(function(o){switch(o.label){case 0:return r=this.getResetPasswordTokenFromURL({userContext:u}),[4,t.post("/user/password/reset",{body:JSON.stringify({formFields:a,token:r,method:"token"})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SUBMIT_NEW_PASSWORD",userContext:u}))];case 1:return n=o.sent(),c=n.jsonBody,f=n.fetchResponse,"FIELD_ERROR"===c.status?[2,{status:"FIELD_ERROR",formFields:c.formFields,fetchResponse:f}]:[2,{status:c.status,fetchResponse:f}]}}))}))},sendPasswordResetEmail:function(r){var a=r.formFields,s=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/password/reset/token",{body:JSON.stringify({formFields:a})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,"FIELD_ERROR"===n.status?[2,{status:"FIELD_ERROR",formFields:n.formFields,fetchResponse:c}]:[2,{status:n.status,fetchResponse:c}]}}))}))},signUp:function(r){var a=r.formFields,s=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/signup",{body:JSON.stringify({formFields:a})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,"FIELD_ERROR"===n.status?[2,{status:"FIELD_ERROR",formFields:n.formFields,fetchResponse:c}]:[2,{status:n.status,user:n.user,fetchResponse:c}]}}))}))},signIn:function(r){var a=r.formFields,s=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/signin",{body:JSON.stringify({formFields:a})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,"FIELD_ERROR"===n.status?[2,{status:"FIELD_ERROR",formFields:n.formFields,fetchResponse:c}]:"WRONG_CREDENTIALS_ERROR"===n.status?[2,{status:"WRONG_CREDENTIALS_ERROR",fetchResponse:c}]:[2,{status:"OK",user:n.user,fetchResponse:c}]}}))}))},doesEmailExist:function(r){var a=r.email,s=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/signup/email/exists",{},{email:a},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,[2,{status:n.status,doesExist:n.exists,fetchResponse:c}]}}))}))},getResetPasswordTokenFromURL:function(){var e=(0,a.getQueryParams)("token");return void 0===e?"":e}}}t.default=s,t.getRecipeImplementation=s},5110:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},6923:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=r(787),i=r(5120),a=r(6333),s=r(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new a.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(r){return e.instance=new e(n(n({},t),{appInfo:r,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Make sure to call the EmailVerification.init method.";throw t=(0,s.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,s.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),a=r(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u,c;return o(this,(function(o){switch(o.label){case 0:return r=this.getEmailVerificationTokenFromURL({userContext:s}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:r})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"VERIFY_EMAIL"}))];case 1:return n=o.sent(),u=n.jsonBody,c=n.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/user/email/verify",{},void 0,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"IS_EMAIL_VERIFIED",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"IS_EMAIL_VERIFIED"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:"OK",isVerified:n.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/email/verify/token",{body:JSON.stringify({})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"SEND_VERIFY_EMAIL"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:n.status,fetchResponse:u}]}}))}))},getEmailVerificationTokenFromURL:function(){var e=(0,a.getQueryParams)("token");return void 0===e?"":e}}}t.default=s,t.getRecipeImplementation=s},787:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(6069);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return r(t,void 0,void 0,(function(){return n(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return r(t,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=r(1996),c=r(1757),f=r(8122),l=function(e){function t(t){var r=e.call(this,t)||this;return r.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},r.getAccessTokenPayloadSecurely=function(e){return a(r,void 0,void 0,(function(){return s(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},r.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},r.signOut=function(e){return c.default.signOut({userContext:e.userContext})},r.attemptRefreshingSession=function(){return a(r,void 0,void 0,(function(){return s(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},c.default.init(i(i({},t),{preAPIHook:function(e){return a(r,void 0,void 0,(function(){var r;return s(this,(function(n){return r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,r]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),r}return o(t,e),t.init=function(e){return function(r,n){return t.instance=new t(i(i({},e),{appInfo:r,recipeId:t.RECIPE_ID,enableDebugLogs:n})),t.instance}},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=l,t.default=l},9102:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var a=r(6277),s=r(4566),u=r(6333),c=r(3664),f=r(8122),l=function(e){function t(t,r){var n=e.call(this,(0,s.normaliseUserInput)(t),r)||this,o=new u.default((0,c.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=o.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{emailVerification:void 0}),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdParty found. Make sure to call the ThirdParty.init method.";throw e=(0,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdparty",t}(a.default);t.Recipe=l,t.default=l},3664:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var a=r(634),s=r(8122),u=r(2173),c=r(9092);function f(e){var t=new a.default(e.recipeId,e.appInfo);return{getStateAndOtherInfoFromStorage:function(){var e=c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.getItemSync("supertokens-oauth-state-2");if(null!==e)try{return JSON.parse(e)}catch(e){return}},setStateAndOtherInfoToStorage:function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=JSON.stringify(n({},e.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",t)];case 1:return r.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return o(this,void 0,void 0,(function(){var t,r,n,o;return i(this,(function(i){switch(i.label){case 0:return t=this.generateStateToSendToOAuthProvider({userContext:e.userContext}),r=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:t,providerId:e.providerId,expiresAt:r,authorisationURL:e.authorisationURL,providerClientId:e.providerClientId},userContext:e.userContext})];case 1:return i.sent(),[4,this.getAuthorisationURLFromBackend({providerId:e.providerId,userContext:e.userContext,options:e.options})];case 2:return n=i.sent(),o=new URL(n.url),[2,null!==o.searchParams.get("redirect_uri")?(0,s.appendQueryParamsToURL)(n.url,{state:t}):(0,s.appendQueryParamsToURL)(n.url,{state:t,redirect_uri:e.authorisationURL})]}}))}))},getAuthorisationURLFromBackend:function(r){return o(this,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/authorisationurl",{},{thirdPartyId:r.providerId},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:s}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,s,c,f,l,d,p,h;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),s=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:s,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),f=this.getAuthCodeFromURL({userContext:r.userContext}),void 0!==(l=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(l));return[4,t.post("/signinup",{body:JSON.stringify({code:f,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(d=i.sent(),p=d.jsonBody,h=d.fetchResponse,"FIELD_ERROR"===p.status)throw new u.default(p.error);return[2,n(n({},p),{fetchResponse:h})]}}))}))},generateStateToSendToOAuthProvider:function(){return"".concat(1e20).replace(/[018]/g,(function(e){return(parseInt(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(e)/4).toString(16)}))},verifyAndGetStateOrThrowError:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){if(void 0===e.stateObjectFromStorage||void 0===e.stateObjectFromStorage.stateForAuthProvider)throw new Error("No valid auth state present in session storage");if(void 0===e.stateFromAuthProvider)throw new Error("No state recieved from auth provider");if(e.stateObjectFromStorage.expiresAt<Date.now())throw new Error("Auth state verification failed. The auth provider took too long to respond");if(e.stateFromAuthProvider!==e.stateObjectFromStorage.stateForAuthProvider)throw new Error("Auth state verification failed. The auth provider responded with an invalid state");return[2,e.stateObjectFromStorage]}))}))},getAuthCodeFromURL:function(){var e=(0,s.getQueryParams)("code");return void 0===e?"":e},getAuthErrorFromURL:function(){return(0,s.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,s.getQueryParams)("state");return void 0===e?"":e}}}t.default=f,t.getRecipeImplementation=f},4566:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},4442:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getAuthStateFromURL=t.getAuthErrorFromURL=t.getAuthCodeFromURL=t.verifyAndGetStateOrThrowError=t.generateStateToSendToOAuthProvider=t.setStateAndOtherInfoToStorage=t.getStateAndOtherInfoFromStorage=t.getAuthorisationURLFromBackend=t.getResetPasswordTokenFromURL=t.signOut=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.getAuthorisationURLWithQueryParamsAndSetState=t.thirdPartySignInAndUp=t.emailPasswordSignIn=t.emailPasswordSignUp=t.doesEmailExist=t.sendPasswordResetEmail=t.submitNewPassword=t.init=void 0;var a=r(8122),s=r(5716),u=function(){function e(){}return e.init=function(e){return s.default.init(e)},e.signOut=function(e){return s.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.submitNewPassword=function(e){return s.default.getInstanceOrThrow().recipeImplementation.submitNewPassword(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.sendPasswordResetEmail=function(e){return s.default.getInstanceOrThrow().recipeImplementation.sendPasswordResetEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.doesEmailExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.emailPasswordSignUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.emailPasswordSignIn=function(e){return s.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignIn(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getResetPasswordTokenFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getResetPasswordTokenFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthorisationURLFromBackend=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLFromBackend(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.thirdPartySignInAndUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.thirdPartySignInAndUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getStateAndOtherInfoFromStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setStateAndOtherInfoToStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setStateAndOtherInfoToStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthorisationURLWithQueryParamsAndSetState=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.generateStateToSendToOAuthProvider=function(e){return s.default.getInstanceOrThrow().recipeImplementation.generateStateToSendToOAuthProvider(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyAndGetStateOrThrowError=function(e){return s.default.getInstanceOrThrow().recipeImplementation.verifyAndGetStateOrThrowError(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthErrorFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthErrorFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthStateFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthStateFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.sendVerificationEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.sendVerificationEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.isEmailVerified=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e}();t.default=u;var c=u.init;t.init=c;var f=u.submitNewPassword;t.submitNewPassword=f;var l=u.sendPasswordResetEmail;t.sendPasswordResetEmail=l;var d=u.doesEmailExist;t.doesEmailExist=d;var p=u.emailPasswordSignUp;t.emailPasswordSignUp=p;var h=u.emailPasswordSignIn;t.emailPasswordSignIn=h;var v=u.thirdPartySignInAndUp;t.thirdPartySignInAndUp=v;var g=u.getAuthorisationURLWithQueryParamsAndSetState;t.getAuthorisationURLWithQueryParamsAndSetState=g;var m=u.verifyEmail;t.verifyEmail=m;var I=u.sendVerificationEmail;t.sendVerificationEmail=I;var P=u.isEmailVerified;t.isEmailVerified=P;var w=u.getResetPasswordTokenFromURL;t.getResetPasswordTokenFromURL=w;var y=u.getAuthorisationURLFromBackend;t.getAuthorisationURLFromBackend=y;var A=u.getStateAndOtherInfoFromStorage;t.getStateAndOtherInfoFromStorage=A;var b=u.setStateAndOtherInfoToStorage;t.setStateAndOtherInfoToStorage=b;var R=u.generateStateToSendToOAuthProvider;t.generateStateToSendToOAuthProvider=R;var _=u.verifyAndGetStateOrThrowError;t.verifyAndGetStateOrThrowError=_;var S=u.getAuthCodeFromURL;t.getAuthCodeFromURL=S;var O=u.getAuthErrorFromURL;t.getAuthErrorFromURL=O;var E=u.getAuthStateFromURL;t.getAuthStateFromURL=E;var x=u.signOut;t.signOut=x},5716:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var a=r(6277),s=r(7939),u=r(9102),c=r(3834),f=r(6333),l=r(1473),d=r(5367),p=r(5092),h=r(8122),v=function(e){function t(t,r){var n,o,i=e.call(this,(0,c.normaliseUserInput)(t),r)||this,a=new f.default((0,l.default)({recipeId:i.config.recipeId,appInfo:i.config.appInfo,preAPIHook:i.config.preAPIHook,postAPIHook:i.config.postAPIHook})).override(i.config.override.functions).build();return i.recipeImplementation=a,i.emailPasswordRecipe=void 0===r.emailPassword?new s.default({recipeId:i.config.recipeId,appInfo:i.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{emailVerification:null===(n=t.override)||void 0===n?void 0:n.emailVerification,functions:function(){return(0,d.default)(a)}}},{emailVerification:i.emailVerificationRecipe}):r.emailPassword,i.thirdPartyRecipe=void 0===r.thirdParty?new u.default({recipeId:i.config.recipeId,appInfo:i.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{emailVerification:null===(o=t.override)||void 0===o?void 0:o.emailVerification,functions:function(){return(0,p.default)(a)}}},{emailVerification:i.emailVerificationRecipe}):r.thirdParty,i}return o(t,e),t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdPartyEmailPassword found. Make sure to call the ThirdPartyEmailPassword.init method.";throw e=(0,h.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{emailVerification:void 0,emailPassword:void 0,thirdParty:void 0}),t.instance}},t.reset=function(){(0,h.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdpartyemailpassword",t}(a.default);t.Recipe=v,t.default=v},5367:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{doesEmailExist:e.doesEmailExist.bind(e),sendPasswordResetEmail:e.sendPasswordResetEmail.bind(e),submitNewPassword:e.submitNewPassword.bind(e),getResetPasswordTokenFromURL:e.getResetPasswordTokenFromURL.bind(e),signIn:e.emailPasswordSignIn.bind(e),signUp:e.emailPasswordSignUp.bind(e)}}},1473:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(4071),a=r(3664),s=r(5367),u=r(5092);function c(e){var t=(0,i.default)(e),r=(0,a.default)(e);return{submitNewPassword:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.submitNewPassword.bind((0,s.default)(this))(e)]}))}))},sendPasswordResetEmail:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.sendPasswordResetEmail.bind((0,s.default)(this))(e)]}))}))},doesEmailExist:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.doesEmailExist.bind((0,s.default)(this))(e)]}))}))},emailPasswordSignUp:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.signUp.bind((0,s.default)(this))(e)]}))}))},emailPasswordSignIn:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.signIn.bind((0,s.default)(this))(e)]}))}))},getResetPasswordTokenFromURL:function(e){return t.getResetPasswordTokenFromURL.bind((0,s.default)(this))(e)},getAuthorisationURLFromBackend:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.getAuthorisationURLFromBackend.bind((0,u.default)(this))(e)]}))}))},thirdPartySignInAndUp:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.signInAndUp.bind((0,u.default)(this))(e)]}))}))},getStateAndOtherInfoFromStorage:function(e){return r.getStateAndOtherInfoFromStorage.bind((0,u.default)(this))(e)},setStateAndOtherInfoToStorage:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.setStateAndOtherInfoToStorage.bind((0,u.default)(this))(e)]}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.getAuthorisationURLWithQueryParamsAndSetState.bind((0,u.default)(this))(e)]}))}))},generateStateToSendToOAuthProvider:function(e){return r.generateStateToSendToOAuthProvider.bind((0,u.default)(this))(e)},verifyAndGetStateOrThrowError:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.verifyAndGetStateOrThrowError.bind((0,u.default)(this))(e)]}))}))},getAuthCodeFromURL:function(e){return r.getAuthCodeFromURL.bind((0,u.default)(this))(e)},getAuthErrorFromURL:function(e){return r.getAuthErrorFromURL.bind((0,u.default)(this))(e)},getAuthStateFromURL:function(e){return r.getAuthStateFromURL.bind((0,u.default)(this))(e)}}}t.default=c,t.getRecipeImplementation=c},5092:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{getAuthorisationURLFromBackend:e.getAuthorisationURLFromBackend.bind(e),getStateAndOtherInfoFromStorage:e.getStateAndOtherInfoFromStorage.bind(e),getAuthorisationURLWithQueryParamsAndSetState:e.getAuthorisationURLWithQueryParamsAndSetState.bind(e),setStateAndOtherInfoToStorage:e.setStateAndOtherInfoToStorage.bind(e),generateStateToSendToOAuthProvider:e.generateStateToSendToOAuthProvider.bind(e),getAuthCodeFromURL:e.getAuthCodeFromURL.bind(e),getAuthErrorFromURL:e.getAuthErrorFromURL.bind(e),getAuthStateFromURL:e.getAuthStateFromURL.bind(e),verifyAndGetStateOrThrowError:e.verifyAndGetStateOrThrowError.bind(e),signInAndUp:e.thirdPartySignInAndUp.bind(e)}}},3834:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},8122:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var n=r(9092),o=r(7611),i=r(7992),a=r(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var r=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];r.searchParams.set(t,n)})),r.href}catch(r){var n=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];o.searchParams.set(t,r)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,r,n=new a.default("");return void 0!==e.apiGatewayPath&&(n=new a.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:n.appendPath((t=o.DEFAULT_API_BASE_PATH,r=e.apiBasePath,void 0!==r?new a.default(r):new a.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.1.5",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},942:(e,t,r)=>{function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}t.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(7860))}},e=>{var t=(4442,e(e.s=4442));supertokensThirdPartyEmailPassword=t}]); | ||
"use strict";var supertokensThirdPartyEmailPassword;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[828],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(942);t.default=n.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(e);return t?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),r(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=r(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return r(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),r("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var n=this;this.startsWith=function(e){return n.value.startsWith(e.value)},this.appendPath=function(t){return new e(n.value+t.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(t)}},634:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1260),s=r(255),u=r(2173),c=function(){function e(e,t){var r=this;this.get=function(e,t,a,s,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,a),n({method:"GET"},t),s,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),n({method:"POST"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"DELETE"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(e,t,a,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"PUT"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(e,t,a,u){return o(r,void 0,void 0,(function(){var r,o,c,f,l,d;return i(this,(function(i){switch(i.label){case 0:return r=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:a,url:e,requestInit:n(n({},t),{headers:n(n({},r),{"fdi-version":s.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,f=o.url,[4,fetch(f,c)];case 2:if((l=i.sent()).status>=300)throw l;return void 0===u?[3,4]:(d=l.clone(),[4,u({requestInit:c,url:e,fetchResponse:d})]);case 3:i.sent(),i.label=4;case 4:return[2,l]}}))}))},this.callPreAPIHook=function(e){return o(r,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var n=new a.default(e),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(r,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=n.sent()).status)throw r=void 0===t.message?"No Error Message Provided":t.message,new u.default(r);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var r=e.recipePreAPIHook,a=e.action,s=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{action:a,userContext:u}))];case 1:return o=t.sent(),void 0===s||void 0===s.preAPIHook?[2,o]:[2,s.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var r=e.recipePostAPIHook,a=e.action,s=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{userContext:s,action:a}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1996),u=r(6322),c=function(e){function t(t){var r=e.call(this,t)||this;return r.signOut=function(e){return i(r,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},r}return o(t,e),t}(s.default);t.default=c},5053:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var n=r(6069);t.normaliseAuthRecipe=function(e){return(0,n.normaliseRecipeModuleConfig)(e)}},6277:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(6923),a=function(e){function t(t,r){var n=e.call(this,t)||this;return n.emailVerificationRecipe=void 0===r.emailVerification?new i.default({appInfo:t.appInfo,recipeId:t.recipeId,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:void 0===t.override?void 0:t.override.emailVerification}):r.emailVerification,n}return o(t,e),t}(r(7725).default);t.default=a},7870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipeWithEmailVerificationConfig=void 0;var n=r(5053);t.normaliseAuthRecipeWithEmailVerificationConfig=function(e){return(0,n.normaliseAuthRecipe)(e)}},7939:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var a=r(6277),s=r(5110),u=r(4071),c=r(6333),f=r(8122),l=function(e){function t(t,r){var n=e.call(this,(0,s.normaliseUserInput)(t),r)||this,o=new c.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=o.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{emailVerification:void 0}),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of EmailPassword found. Make sure to call the EmailPassword.init method.";throw e=(0,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="emailpassword",t}(a.default);t.Recipe=l,t.default=l},4071:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),a=r(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{submitNewPassword:function(r){var a=r.formFields,s=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c,f;return o(this,(function(o){switch(o.label){case 0:return r=this.getResetPasswordTokenFromURL({userContext:u}),[4,t.post("/user/password/reset",{body:JSON.stringify({formFields:a,token:r,method:"token"})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SUBMIT_NEW_PASSWORD",userContext:u}))];case 1:return n=o.sent(),c=n.jsonBody,f=n.fetchResponse,"FIELD_ERROR"===c.status?[2,{status:"FIELD_ERROR",formFields:c.formFields,fetchResponse:f}]:[2,{status:c.status,fetchResponse:f}]}}))}))},sendPasswordResetEmail:function(r){var a=r.formFields,s=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/password/reset/token",{body:JSON.stringify({formFields:a})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,"FIELD_ERROR"===n.status?[2,{status:"FIELD_ERROR",formFields:n.formFields,fetchResponse:c}]:[2,{status:n.status,fetchResponse:c}]}}))}))},signUp:function(r){var a=r.formFields,s=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/signup",{body:JSON.stringify({formFields:a})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,"FIELD_ERROR"===n.status?[2,{status:"FIELD_ERROR",formFields:n.formFields,fetchResponse:c}]:[2,{status:n.status,user:n.user,fetchResponse:c}]}}))}))},signIn:function(r){var a=r.formFields,s=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/signin",{body:JSON.stringify({formFields:a})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,"FIELD_ERROR"===n.status?[2,{status:"FIELD_ERROR",formFields:n.formFields,fetchResponse:c}]:"WRONG_CREDENTIALS_ERROR"===n.status?[2,{status:"WRONG_CREDENTIALS_ERROR",fetchResponse:c}]:[2,{status:"OK",user:n.user,fetchResponse:c}]}}))}))},doesEmailExist:function(r){var a=r.email,s=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/signup/email/exists",{},{email:a},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,[2,{status:n.status,doesExist:n.exists,fetchResponse:c}]}}))}))},getResetPasswordTokenFromURL:function(){var e=(0,a.getQueryParams)("token");return void 0===e?"":e}}}t.default=s,t.getRecipeImplementation=s},5110:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},6923:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=r(787),i=r(5120),a=r(6333),s=r(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new a.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(r){return e.instance=new e(n(n({},t),{appInfo:r,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Make sure to call the EmailVerification.init method.";throw t=(0,s.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,s.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),a=r(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u,c;return o(this,(function(o){switch(o.label){case 0:return r=this.getEmailVerificationTokenFromURL({userContext:s}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:r})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"VERIFY_EMAIL"}))];case 1:return n=o.sent(),u=n.jsonBody,c=n.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/user/email/verify",{},void 0,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"IS_EMAIL_VERIFIED",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"IS_EMAIL_VERIFIED"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:"OK",isVerified:n.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/email/verify/token",{body:JSON.stringify({})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"SEND_VERIFY_EMAIL"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:n.status,fetchResponse:u}]}}))}))},getEmailVerificationTokenFromURL:function(){var e=(0,a.getQueryParams)("token");return void 0===e?"":e}}}t.default=s,t.getRecipeImplementation=s},787:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(6069);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return r(t,void 0,void 0,(function(){return n(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return r(t,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=r(1996),c=r(1757),f=r(8122),l=function(e){function t(t){var r=e.call(this,t)||this;return r.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},r.getAccessTokenPayloadSecurely=function(e){return a(r,void 0,void 0,(function(){return s(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},r.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},r.signOut=function(e){return c.default.signOut({userContext:e.userContext})},r.attemptRefreshingSession=function(){return a(r,void 0,void 0,(function(){return s(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},c.default.init(i(i({},t),{preAPIHook:function(e){return a(r,void 0,void 0,(function(){var r;return s(this,(function(n){return r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,r]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),r}return o(t,e),t.init=function(e){return function(r,n){return t.instance=new t(i(i({},e),{appInfo:r,recipeId:t.RECIPE_ID,enableDebugLogs:n})),t.instance}},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=l,t.default=l},9102:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var a=r(6277),s=r(4566),u=r(6333),c=r(3664),f=r(8122),l=function(e){function t(t,r){var n=e.call(this,(0,s.normaliseUserInput)(t),r)||this,o=new u.default((0,c.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=o.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{emailVerification:void 0}),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdParty found. Make sure to call the ThirdParty.init method.";throw e=(0,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdparty",t}(a.default);t.Recipe=l,t.default=l},3664:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var a=r(634),s=r(8122),u=r(2173),c=r(9092);function f(e){var t=new a.default(e.recipeId,e.appInfo);return{getStateAndOtherInfoFromStorage:function(){var e=c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.getItemSync("supertokens-oauth-state-2");if(null!==e)try{return JSON.parse(e)}catch(e){return}},setStateAndOtherInfoToStorage:function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=JSON.stringify(n({},e.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",t)];case 1:return r.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return o(this,void 0,void 0,(function(){var t,r,n,o;return i(this,(function(i){switch(i.label){case 0:return t=this.generateStateToSendToOAuthProvider({userContext:e.userContext}),r=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:t,providerId:e.providerId,expiresAt:r,authorisationURL:e.authorisationURL,providerClientId:e.providerClientId},userContext:e.userContext})];case 1:return i.sent(),[4,this.getAuthorisationURLFromBackend({providerId:e.providerId,userContext:e.userContext,options:e.options})];case 2:return n=i.sent(),o=new URL(n.url),[2,null!==o.searchParams.get("redirect_uri")?(0,s.appendQueryParamsToURL)(n.url,{state:t}):(0,s.appendQueryParamsToURL)(n.url,{state:t,redirect_uri:e.authorisationURL})]}}))}))},getAuthorisationURLFromBackend:function(r){return o(this,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/authorisationurl",{},{thirdPartyId:r.providerId},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:s}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,s,c,f,l,d,p,h;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),s=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:s,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),f=this.getAuthCodeFromURL({userContext:r.userContext}),void 0!==(l=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(l));return[4,t.post("/signinup",{body:JSON.stringify({code:f,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(d=i.sent(),p=d.jsonBody,h=d.fetchResponse,"FIELD_ERROR"===p.status)throw new u.default(p.error);return[2,n(n({},p),{fetchResponse:h})]}}))}))},generateStateToSendToOAuthProvider:function(){return"".concat(1e20).replace(/[018]/g,(function(e){return(parseInt(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(e)/4).toString(16)}))},verifyAndGetStateOrThrowError:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){if(void 0===e.stateObjectFromStorage||void 0===e.stateObjectFromStorage.stateForAuthProvider)throw new Error("No valid auth state present in session storage");if(void 0===e.stateFromAuthProvider)throw new Error("No state recieved from auth provider");if(e.stateObjectFromStorage.expiresAt<Date.now())throw new Error("Auth state verification failed. The auth provider took too long to respond");if(e.stateFromAuthProvider!==e.stateObjectFromStorage.stateForAuthProvider)throw new Error("Auth state verification failed. The auth provider responded with an invalid state");return[2,e.stateObjectFromStorage]}))}))},getAuthCodeFromURL:function(){var e=(0,s.getQueryParams)("code");return void 0===e?"":e},getAuthErrorFromURL:function(){return(0,s.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,s.getQueryParams)("state");return void 0===e?"":e}}}t.default=f,t.getRecipeImplementation=f},4566:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},4442:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getAuthStateFromURL=t.getAuthErrorFromURL=t.getAuthCodeFromURL=t.verifyAndGetStateOrThrowError=t.generateStateToSendToOAuthProvider=t.setStateAndOtherInfoToStorage=t.getStateAndOtherInfoFromStorage=t.getAuthorisationURLFromBackend=t.getResetPasswordTokenFromURL=t.signOut=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.getAuthorisationURLWithQueryParamsAndSetState=t.thirdPartySignInAndUp=t.emailPasswordSignIn=t.emailPasswordSignUp=t.doesEmailExist=t.sendPasswordResetEmail=t.submitNewPassword=t.init=void 0;var a=r(8122),s=r(5716),u=function(){function e(){}return e.init=function(e){return s.default.init(e)},e.signOut=function(e){return s.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.submitNewPassword=function(e){return s.default.getInstanceOrThrow().recipeImplementation.submitNewPassword(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.sendPasswordResetEmail=function(e){return s.default.getInstanceOrThrow().recipeImplementation.sendPasswordResetEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.doesEmailExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.emailPasswordSignUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.emailPasswordSignIn=function(e){return s.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignIn(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getResetPasswordTokenFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getResetPasswordTokenFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthorisationURLFromBackend=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLFromBackend(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.thirdPartySignInAndUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.thirdPartySignInAndUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getStateAndOtherInfoFromStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setStateAndOtherInfoToStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setStateAndOtherInfoToStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthorisationURLWithQueryParamsAndSetState=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.generateStateToSendToOAuthProvider=function(e){return s.default.getInstanceOrThrow().recipeImplementation.generateStateToSendToOAuthProvider(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyAndGetStateOrThrowError=function(e){return s.default.getInstanceOrThrow().recipeImplementation.verifyAndGetStateOrThrowError(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthErrorFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthErrorFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthStateFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthStateFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.sendVerificationEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.sendVerificationEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.isEmailVerified=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e}();t.default=u;var c=u.init;t.init=c;var f=u.submitNewPassword;t.submitNewPassword=f;var l=u.sendPasswordResetEmail;t.sendPasswordResetEmail=l;var d=u.doesEmailExist;t.doesEmailExist=d;var p=u.emailPasswordSignUp;t.emailPasswordSignUp=p;var h=u.emailPasswordSignIn;t.emailPasswordSignIn=h;var v=u.thirdPartySignInAndUp;t.thirdPartySignInAndUp=v;var g=u.getAuthorisationURLWithQueryParamsAndSetState;t.getAuthorisationURLWithQueryParamsAndSetState=g;var m=u.verifyEmail;t.verifyEmail=m;var I=u.sendVerificationEmail;t.sendVerificationEmail=I;var P=u.isEmailVerified;t.isEmailVerified=P;var w=u.getResetPasswordTokenFromURL;t.getResetPasswordTokenFromURL=w;var y=u.getAuthorisationURLFromBackend;t.getAuthorisationURLFromBackend=y;var A=u.getStateAndOtherInfoFromStorage;t.getStateAndOtherInfoFromStorage=A;var b=u.setStateAndOtherInfoToStorage;t.setStateAndOtherInfoToStorage=b;var R=u.generateStateToSendToOAuthProvider;t.generateStateToSendToOAuthProvider=R;var _=u.verifyAndGetStateOrThrowError;t.verifyAndGetStateOrThrowError=_;var S=u.getAuthCodeFromURL;t.getAuthCodeFromURL=S;var O=u.getAuthErrorFromURL;t.getAuthErrorFromURL=O;var E=u.getAuthStateFromURL;t.getAuthStateFromURL=E;var x=u.signOut;t.signOut=x},5716:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var a=r(6277),s=r(7939),u=r(9102),c=r(3834),f=r(6333),l=r(1473),d=r(5367),p=r(5092),h=r(8122),v=function(e){function t(t,r){var n,o,i=e.call(this,(0,c.normaliseUserInput)(t),r)||this,a=new f.default((0,l.default)({recipeId:i.config.recipeId,appInfo:i.config.appInfo,preAPIHook:i.config.preAPIHook,postAPIHook:i.config.postAPIHook})).override(i.config.override.functions).build();return i.recipeImplementation=a,i.emailPasswordRecipe=void 0===r.emailPassword?new s.default({recipeId:i.config.recipeId,appInfo:i.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{emailVerification:null===(n=t.override)||void 0===n?void 0:n.emailVerification,functions:function(){return(0,d.default)(a)}}},{emailVerification:i.emailVerificationRecipe}):r.emailPassword,i.thirdPartyRecipe=void 0===r.thirdParty?new u.default({recipeId:i.config.recipeId,appInfo:i.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{emailVerification:null===(o=t.override)||void 0===o?void 0:o.emailVerification,functions:function(){return(0,p.default)(a)}}},{emailVerification:i.emailVerificationRecipe}):r.thirdParty,i}return o(t,e),t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdPartyEmailPassword found. Make sure to call the ThirdPartyEmailPassword.init method.";throw e=(0,h.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{emailVerification:void 0,emailPassword:void 0,thirdParty:void 0}),t.instance}},t.reset=function(){(0,h.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdpartyemailpassword",t}(a.default);t.Recipe=v,t.default=v},5367:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{doesEmailExist:e.doesEmailExist.bind(e),sendPasswordResetEmail:e.sendPasswordResetEmail.bind(e),submitNewPassword:e.submitNewPassword.bind(e),getResetPasswordTokenFromURL:e.getResetPasswordTokenFromURL.bind(e),signIn:e.emailPasswordSignIn.bind(e),signUp:e.emailPasswordSignUp.bind(e)}}},1473:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(4071),a=r(3664),s=r(5367),u=r(5092);function c(e){var t=(0,i.default)(e),r=(0,a.default)(e);return{submitNewPassword:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.submitNewPassword.bind((0,s.default)(this))(e)]}))}))},sendPasswordResetEmail:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.sendPasswordResetEmail.bind((0,s.default)(this))(e)]}))}))},doesEmailExist:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.doesEmailExist.bind((0,s.default)(this))(e)]}))}))},emailPasswordSignUp:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.signUp.bind((0,s.default)(this))(e)]}))}))},emailPasswordSignIn:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.signIn.bind((0,s.default)(this))(e)]}))}))},getResetPasswordTokenFromURL:function(e){return t.getResetPasswordTokenFromURL.bind((0,s.default)(this))(e)},getAuthorisationURLFromBackend:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.getAuthorisationURLFromBackend.bind((0,u.default)(this))(e)]}))}))},thirdPartySignInAndUp:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.signInAndUp.bind((0,u.default)(this))(e)]}))}))},getStateAndOtherInfoFromStorage:function(e){return r.getStateAndOtherInfoFromStorage.bind((0,u.default)(this))(e)},setStateAndOtherInfoToStorage:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.setStateAndOtherInfoToStorage.bind((0,u.default)(this))(e)]}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.getAuthorisationURLWithQueryParamsAndSetState.bind((0,u.default)(this))(e)]}))}))},generateStateToSendToOAuthProvider:function(e){return r.generateStateToSendToOAuthProvider.bind((0,u.default)(this))(e)},verifyAndGetStateOrThrowError:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.verifyAndGetStateOrThrowError.bind((0,u.default)(this))(e)]}))}))},getAuthCodeFromURL:function(e){return r.getAuthCodeFromURL.bind((0,u.default)(this))(e)},getAuthErrorFromURL:function(e){return r.getAuthErrorFromURL.bind((0,u.default)(this))(e)},getAuthStateFromURL:function(e){return r.getAuthStateFromURL.bind((0,u.default)(this))(e)}}}t.default=c,t.getRecipeImplementation=c},5092:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{getAuthorisationURLFromBackend:e.getAuthorisationURLFromBackend.bind(e),getStateAndOtherInfoFromStorage:e.getStateAndOtherInfoFromStorage.bind(e),getAuthorisationURLWithQueryParamsAndSetState:e.getAuthorisationURLWithQueryParamsAndSetState.bind(e),setStateAndOtherInfoToStorage:e.setStateAndOtherInfoToStorage.bind(e),generateStateToSendToOAuthProvider:e.generateStateToSendToOAuthProvider.bind(e),getAuthCodeFromURL:e.getAuthCodeFromURL.bind(e),getAuthErrorFromURL:e.getAuthErrorFromURL.bind(e),getAuthStateFromURL:e.getAuthStateFromURL.bind(e),verifyAndGetStateOrThrowError:e.verifyAndGetStateOrThrowError.bind(e),signInAndUp:e.thirdPartySignInAndUp.bind(e)}}},3834:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},8122:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var n=r(9092),o=r(7611),i=r(7992),a=r(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var r=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];r.searchParams.set(t,n)})),r.href}catch(r){var n=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];o.searchParams.set(t,r)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,r,n=new a.default("");return void 0!==e.apiGatewayPath&&(n=new a.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:n.appendPath((t=o.DEFAULT_API_BASE_PATH,r=e.apiBasePath,void 0!==r?new a.default(r):new a.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.1.6",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},942:(e,t,r)=>{function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}t.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(7860))}},e=>{var t=(4442,e(e.s=4442));supertokensThirdPartyEmailPassword=t}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensThirdPartyPasswordless;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[425],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(942);t.default=n.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(e);return t?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),r(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=r(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return r(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),r("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var n=this;this.startsWith=function(e){return n.value.startsWith(e.value)},this.appendPath=function(t){return new e(n.value+t.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(t)}},634:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1260),a=r(255),u=r(2173),c=function(){function e(e,t){var r=this;this.get=function(e,t,s,a,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,s),n({method:"GET"},t),a,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(e,t,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),n({method:"POST"},t),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(e,t,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"DELETE"},t),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(e,t,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"PUT"},t),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(e,t,s,u){return o(r,void 0,void 0,(function(){var r,o,c,d,l,f;return i(this,(function(i){switch(i.label){case 0:return r=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:s,url:e,requestInit:n(n({},t),{headers:n(n({},r),{"fdi-version":a.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,d=o.url,[4,fetch(d,c)];case 2:if((l=i.sent()).status>=300)throw l;return void 0===u?[3,4]:(f=l.clone(),[4,u({requestInit:c,url:e,fetchResponse:f})]);case 3:i.sent(),i.label=4;case 4:return[2,l]}}))}))},this.callPreAPIHook=function(e){return o(r,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var n=new s.default(e),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(r,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=n.sent()).status)throw r=void 0===t.message?"No Error Message Provided":t.message,new u.default(r);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var r=e.recipePreAPIHook,s=e.action,a=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{action:s,userContext:u}))];case 1:return o=t.sent(),void 0===a||void 0===a.preAPIHook?[2,o]:[2,a.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var r=e.recipePostAPIHook,s=e.action,a=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{userContext:a,action:s}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1996),u=r(6322),c=function(e){function t(t){var r=e.call(this,t)||this;return r.signOut=function(e){return i(r,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},r}return o(t,e),t}(a.default);t.default=c},5053:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var n=r(6069);t.normaliseAuthRecipe=function(e){return(0,n.normaliseRecipeModuleConfig)(e)}},6277:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(6923),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.emailVerificationRecipe=void 0===r.emailVerification?new i.default({appInfo:t.appInfo,recipeId:t.recipeId,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:void 0===t.override?void 0:t.override.emailVerification}):r.emailVerification,n}return o(t,e),t}(r(7725).default);t.default=s},7870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipeWithEmailVerificationConfig=void 0;var n=r(5053);t.normaliseAuthRecipeWithEmailVerificationConfig=function(e){return(0,n.normaliseAuthRecipe)(e)}},6923:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=r(787),i=r(5120),s=r(6333),a=r(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new s.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(r){return e.instance=new e(n(n({},t),{appInfo:r,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Make sure to call the EmailVerification.init method.";throw t=(0,a.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,a.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),s=r(8122);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(r){var s=r.options,a=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u,c;return o(this,(function(o){switch(o.label){case 0:return r=this.getEmailVerificationTokenFromURL({userContext:a}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:r})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"VERIFY_EMAIL"}))];case 1:return n=o.sent(),u=n.jsonBody,c=n.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(r){var s=r.options,a=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/user/email/verify",{},void 0,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"IS_EMAIL_VERIFIED",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"IS_EMAIL_VERIFIED"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:"OK",isVerified:n.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(r){var s=r.options,a=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/email/verify/token",{body:JSON.stringify({})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_VERIFY_EMAIL",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"SEND_VERIFY_EMAIL"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:n.status,fetchResponse:u}]}}))}))},getEmailVerificationTokenFromURL:function(){var e=(0,s.getQueryParams)("token");return void 0===e?"":e}}}t.default=a,t.getRecipeImplementation=a},787:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(6069);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},6427:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY=void 0,t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY="supertokens-passwordless-loginAttemptInfo"},2856:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=r(6333),a=r(8122),u=r(7725),c=r(4921),d=r(8891),l=function(e){function t(t){var r=e.call(this,(0,c.normaliseUserInput)(t))||this,n=new s.default((0,d.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=n.override(r.config.override.functions).build(),r}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Passwordless found. Make sure to call the Passwordless.init method.";throw e=(0,a.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,a.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="passwordless",t}(u.default);t.Recipe=l,t.default=l},8891:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=r(9092),a=r(634),u=r(8122),c=r(6427);function d(e){var t=new a.default(e.recipeId,e.appInfo);return{createCode:function(r){return o(this,void 0,void 0,(function(){var o,s,u,c;return i(this,(function(i){switch(i.label){case 0:return"email"in r&&(o={email:r.email}),"phoneNumber"in r&&(o={phoneNumber:r.phoneNumber}),[4,t.post("/signinup/code",{body:JSON.stringify(o)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:r.userContext}))];case 1:return s=i.sent(),u=s.jsonBody,c=s.fetchResponse,[2,n(n({},u),{fetchResponse:c})]}}))}))},resendCode:function(r){return o(this,void 0,void 0,(function(){var n,o,s,u;return i(this,(function(i){switch(i.label){case 0:return n={deviceId:r.deviceId,preAuthSessionId:r.preAuthSessionId},[4,t.post("/signinup/code/resend",{body:JSON.stringify(n)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:r.userContext}))];case 1:return o=i.sent(),s=o.jsonBody,u=o.fetchResponse,[2,{status:s.status,fetchResponse:u}]}}))}))},consumeCode:function(r){return o(this,void 0,void 0,(function(){var o,s,u,c;return i(this,(function(i){switch(i.label){case 0:return o="userInputCode"in r?{userInputCode:r.userInputCode,deviceId:r.deviceId,preAuthSessionId:r.preAuthSessionId}:{linkCode:r.linkCode,preAuthSessionId:r.preAuthSessionId},[4,t.post("/signinup/code/consume",{body:JSON.stringify(o)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:r.userContext}))];case 1:return s=i.sent(),u=s.jsonBody,c=s.fetchResponse,"OK"===u.status?[2,{status:"OK",createdUser:u.createdNewUser,user:u.user,fetchResponse:c}]:[2,n(n({},u),{fetchResponse:c})]}}))}))},getLinkCodeFromURL:function(){return(0,u.getHashFromLocation)()},getPreAuthSessionIdFromURL:function(){var e=(0,u.getQueryParams)("preAuthSessionId");return void 0===e?"":e},doesEmailExist:function(r){return o(this,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/email/exists",{},{email:r.email},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},doesPhoneNumberExist:function(r){return o(this,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/phoneNumber/exists",{},{phoneNumber:r.phoneNumber},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},getLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.getItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY)];case 1:if(null===(e=t.sent()))return[2,void 0];try{return[2,JSON.parse(e)]}catch(e){return[2,void 0]}return[2]}}))}))},setLoginAttemptInfo:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.setItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY,JSON.stringify(n({version:1},e.attemptInfo)))];case 1:return t.sent(),[2]}}))}))},clearLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.removeItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY),[2]}))}))}}}t.default=d,t.getRecipeImplementation=d},4921:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.consumeCode=t.resendCode=t.createCode=t.normaliseUserInput=void 0;var s=r(8122),a=r(5053);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,a.normaliseAuthRecipe)(e)),{override:t})},t.createCode=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.createCode(n(n({},e),{userContext:t}))];case 1:return r=o.sent(),[4,e.recipeImplementation.setLoginAttemptInfo({attemptInfo:{deviceId:r.deviceId,preAuthSessionId:r.preAuthSessionId,flowType:r.flowType},userContext:t})];case 2:return o.sent(),[2,r]}}))}))},t.resendCode=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})];case 1:return r=o.sent(),[2,e.recipeImplementation.resendCode(n(n({},e),{userContext:t,deviceId:void 0===r?"":r.deviceId,preAuthSessionId:void 0===r?"":r.preAuthSessionId}))]}}))}))},t.consumeCode=function(e){return o(this,void 0,void 0,(function(){var t,r,o,a,u;return i(this,(function(i){switch(i.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),"userInputCode"in e?[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})]:[3,2];case 1:return o=i.sent(),r={userInputCode:e.userInputCode,deviceId:void 0===o?"":o.deviceId,preAuthSessionId:void 0===o?"":o.preAuthSessionId},[3,3];case 2:a=e.recipeImplementation.getLinkCodeFromURL({userContext:e.userContext}),u=e.recipeImplementation.getPreAuthSessionIdFromURL({userContext:e.userContext}),r={linkCode:a,preAuthSessionId:u},i.label=3;case 3:return[2,e.recipeImplementation.consumeCode(n({userContext:t,options:e.options},r))]}}))}))}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return r(t,void 0,void 0,(function(){return n(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return r(t,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=r(1996),c=r(1757),d=r(8122),l=function(e){function t(t){var r=e.call(this,t)||this;return r.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},r.getAccessTokenPayloadSecurely=function(e){return s(r,void 0,void 0,(function(){return a(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},r.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},r.signOut=function(e){return c.default.signOut({userContext:e.userContext})},r.attemptRefreshingSession=function(){return s(r,void 0,void 0,(function(){return a(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},c.default.init(i(i({},t),{preAPIHook:function(e){return s(r,void 0,void 0,(function(){var r;return a(this,(function(n){return r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,r]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),r}return o(t,e),t.init=function(e){return function(r,n){return t.instance=new t(i(i({},e),{appInfo:r,recipeId:t.RECIPE_ID,enableDebugLogs:n})),t.instance}},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,d.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,d.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=l,t.default=l},9102:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=r(6277),a=r(4566),u=r(6333),c=r(3664),d=r(8122),l=function(e){function t(t,r){var n=e.call(this,(0,a.normaliseUserInput)(t),r)||this,o=new u.default((0,c.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=o.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{emailVerification:void 0}),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdParty found. Make sure to call the ThirdParty.init method.";throw e=(0,d.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,d.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdparty",t}(s.default);t.Recipe=l,t.default=l},3664:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=r(634),a=r(8122),u=r(2173),c=r(9092);function d(e){var t=new s.default(e.recipeId,e.appInfo);return{getStateAndOtherInfoFromStorage:function(){var e=c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.getItemSync("supertokens-oauth-state-2");if(null!==e)try{return JSON.parse(e)}catch(e){return}},setStateAndOtherInfoToStorage:function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=JSON.stringify(n({},e.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",t)];case 1:return r.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return o(this,void 0,void 0,(function(){var t,r,n,o;return i(this,(function(i){switch(i.label){case 0:return t=this.generateStateToSendToOAuthProvider({userContext:e.userContext}),r=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:t,providerId:e.providerId,expiresAt:r,authorisationURL:e.authorisationURL,providerClientId:e.providerClientId},userContext:e.userContext})];case 1:return i.sent(),[4,this.getAuthorisationURLFromBackend({providerId:e.providerId,userContext:e.userContext,options:e.options})];case 2:return n=i.sent(),o=new URL(n.url),[2,null!==o.searchParams.get("redirect_uri")?(0,a.appendQueryParamsToURL)(n.url,{state:t}):(0,a.appendQueryParamsToURL)(n.url,{state:t,redirect_uri:e.authorisationURL})]}}))}))},getAuthorisationURLFromBackend:function(r){return o(this,void 0,void 0,(function(){var n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/authorisationurl",{},{thirdPartyId:r.providerId},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,a=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:a}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,a,c,d,l,f,p,h;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),a=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:a,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),d=this.getAuthCodeFromURL({userContext:r.userContext}),void 0!==(l=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(l));return[4,t.post("/signinup",{body:JSON.stringify({code:d,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(f=i.sent(),p=f.jsonBody,h=f.fetchResponse,"FIELD_ERROR"===p.status)throw new u.default(p.error);return[2,n(n({},p),{fetchResponse:h})]}}))}))},generateStateToSendToOAuthProvider:function(){return"".concat(1e20).replace(/[018]/g,(function(e){return(parseInt(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(e)/4).toString(16)}))},verifyAndGetStateOrThrowError:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){if(void 0===e.stateObjectFromStorage||void 0===e.stateObjectFromStorage.stateForAuthProvider)throw new Error("No valid auth state present in session storage");if(void 0===e.stateFromAuthProvider)throw new Error("No state recieved from auth provider");if(e.stateObjectFromStorage.expiresAt<Date.now())throw new Error("Auth state verification failed. The auth provider took too long to respond");if(e.stateFromAuthProvider!==e.stateObjectFromStorage.stateForAuthProvider)throw new Error("Auth state verification failed. The auth provider responded with an invalid state");return[2,e.stateObjectFromStorage]}))}))},getAuthCodeFromURL:function(){var e=(0,a.getQueryParams)("code");return void 0===e?"":e},getAuthErrorFromURL:function(){return(0,a.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,a.getQueryParams)("state");return void 0===e?"":e}}}t.default=d,t.getRecipeImplementation=d},4566:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},4706:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.clearPasswordlessLoginAttemptInfo=t.setPasswordlessLoginAttemptInfo=t.getPasswordlessLoginAttemptInfo=t.getPasswordlessPreAuthSessionIdFromURL=t.getPasswordlessLinkCodeFromURL=t.getThirdPartyAuthStateFromURL=t.getThirdPartyAuthErrorFromURL=t.getThirdPartyAuthCodeFromURL=t.verifyAndGetThirdPartyStateOrThrowError=t.generateThirdPartyStateToSendToOAuthProvider=t.setThirdPartyStateAndOtherInfoToStorage=t.getThirdPartyStateAndOtherInfoFromStorage=t.getAuthorisationURLFromBackend=t.signOut=t.doesPasswordlessUserPhoneNumberExist=t.doesPasswordlessUserEmailExist=t.consumePasswordlessCode=t.resendPasswordlessCode=t.createPasswordlessCode=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.thirdPartySignInAndUp=t.getThirdPartyAuthorisationURLWithQueryParamsAndSetState=t.init=void 0;var s=r(8495),a=r(8122),u=r(4921),c=function(){function e(){}return e.init=function(e){return s.default.init(e)},e.signOut=function(e){return s.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getAuthorisationURLFromBackend=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLFromBackend(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.thirdPartySignInAndUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.thirdPartySignInAndUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getThirdPartyStateAndOtherInfoFromStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyStateAndOtherInfoFromStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setThirdPartyStateAndOtherInfoToStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setThirdPartyStateAndOtherInfoToStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getThirdPartyAuthorisationURLWithQueryParamsAndSetState=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthorisationURLWithQueryParamsAndSetState(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.generateThirdPartyStateToSendToOAuthProvider=function(e){return s.default.getInstanceOrThrow().recipeImplementation.generateThirdPartyStateToSendToOAuthProvider(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyAndGetThirdPartyStateOrThrowError=function(e){return s.default.getInstanceOrThrow().recipeImplementation.verifyAndGetThirdPartyStateOrThrowError(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getThirdPartyAuthCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getThirdPartyAuthErrorFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthErrorFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getThirdPartyAuthStateFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthStateFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.createPasswordlessCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=s.default.getInstanceOrThrow(),[2,u.createCode(n(n({},e),{recipeImplementation:t.passwordlessRecipe.recipeImplementation}))]}))}))},e.resendPasswordlessCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=s.default.getInstanceOrThrow(),[2,u.resendCode(n(n({},e),{recipeImplementation:t.passwordlessRecipe.recipeImplementation}))]}))}))},e.consumePasswordlessCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=s.default.getInstanceOrThrow(),[2,u.consumeCode(n(n({},e),{recipeImplementation:t.passwordlessRecipe.recipeImplementation}))]}))}))},e.getPasswordlessLinkCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getPasswordlessLinkCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getPasswordlessPreAuthSessionIdFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getPasswordlessPreAuthSessionIdFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.sendVerificationEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.sendVerificationEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.isEmailVerified=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.doesPasswordlessUserEmailExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesPasswordlessUserEmailExist(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.doesPasswordlessUserPhoneNumberExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesPasswordlessUserPhoneNumberExist(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getPasswordlessLoginAttemptInfo=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getPasswordlessLoginAttemptInfo(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setPasswordlessLoginAttemptInfo=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setPasswordlessLoginAttemptInfo(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.clearPasswordlessLoginAttemptInfo=function(e){return s.default.getInstanceOrThrow().recipeImplementation.clearPasswordlessLoginAttemptInfo(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e}();t.default=c;var d=c.init;t.init=d;var l=c.getThirdPartyAuthorisationURLWithQueryParamsAndSetState;t.getThirdPartyAuthorisationURLWithQueryParamsAndSetState=l;var f=c.thirdPartySignInAndUp;t.thirdPartySignInAndUp=f;var p=c.verifyEmail;t.verifyEmail=p;var h=c.sendVerificationEmail;t.sendVerificationEmail=h;var v=c.isEmailVerified;t.isEmailVerified=v;var P=c.createPasswordlessCode;t.createPasswordlessCode=P;var g=c.resendPasswordlessCode;t.resendPasswordlessCode=g;var I=c.consumePasswordlessCode;t.consumePasswordlessCode=I;var m=c.doesPasswordlessUserEmailExist;t.doesPasswordlessUserEmailExist=m;var y=c.doesPasswordlessUserPhoneNumberExist;t.doesPasswordlessUserPhoneNumberExist=y;var w=c.getAuthorisationURLFromBackend;t.getAuthorisationURLFromBackend=w;var A=c.getThirdPartyStateAndOtherInfoFromStorage;t.getThirdPartyStateAndOtherInfoFromStorage=A;var b=c.setThirdPartyStateAndOtherInfoToStorage;t.setThirdPartyStateAndOtherInfoToStorage=b;var S=c.generateThirdPartyStateToSendToOAuthProvider;t.generateThirdPartyStateToSendToOAuthProvider=S;var _=c.verifyAndGetThirdPartyStateOrThrowError;t.verifyAndGetThirdPartyStateOrThrowError=_;var O=c.getThirdPartyAuthCodeFromURL;t.getThirdPartyAuthCodeFromURL=O;var R=c.getThirdPartyAuthErrorFromURL;t.getThirdPartyAuthErrorFromURL=R;var C=c.getThirdPartyAuthStateFromURL;t.getThirdPartyAuthStateFromURL=C;var x=c.getPasswordlessLinkCodeFromURL;t.getPasswordlessLinkCodeFromURL=x;var E=c.getPasswordlessPreAuthSessionIdFromURL;t.getPasswordlessPreAuthSessionIdFromURL=E;var T=c.getPasswordlessLoginAttemptInfo;t.getPasswordlessLoginAttemptInfo=T;var k=c.setPasswordlessLoginAttemptInfo;t.setPasswordlessLoginAttemptInfo=k;var U=c.clearPasswordlessLoginAttemptInfo;t.clearPasswordlessLoginAttemptInfo=U;var L=c.signOut;t.signOut=L},8495:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=r(6277),a=r(9102),u=r(2856),c=r(3063),d=r(6333),l=r(1187),f=r(8122),p=r(5491),h=r(9817),v=function(e){function t(t,r){var n,o=e.call(this,(0,c.normaliseUserInput)(t),r)||this,i=new d.default((0,l.default)({recipeId:o.config.recipeId,appInfo:o.config.appInfo,preAPIHook:o.config.preAPIHook,postAPIHook:o.config.postAPIHook})).override(o.config.override.functions).build();return o.recipeImplementation=i,o.thirdPartyRecipe=void 0===r.thirdParty?new a.default({recipeId:o.config.recipeId,appInfo:o.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{emailVerification:null===(n=t.override)||void 0===n?void 0:n.emailVerification,functions:function(){return(0,p.default)(i)}}},{emailVerification:o.emailVerificationRecipe}):r.thirdParty,o.passwordlessRecipe=void 0===r.passwordless?new u.default({recipeId:o.config.recipeId,appInfo:o.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{functions:function(){return(0,h.default)(i)}}}):r.passwordless,o}return o(t,e),t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdPartyPasswordless found. Make sure to call the ThirdPartyPasswordless.init method.";throw e=(0,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{emailVerification:void 0,thirdParty:void 0,passwordless:void 0}),t.instance}},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdpartypasswordless",t}(s.default);t.Recipe=v,t.default=v},1187:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(3664),s=r(8891),a=r(5491),u=r(9817);function c(e){var t=(0,i.default)(e),r=(0,s.default)(e);return{getAuthorisationURLFromBackend:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.getAuthorisationURLFromBackend.bind((0,a.default)(this))(e)]}))}))},thirdPartySignInAndUp:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.signInAndUp.bind((0,a.default)(this))(e)]}))}))},getThirdPartyStateAndOtherInfoFromStorage:function(e){return t.getStateAndOtherInfoFromStorage.bind((0,a.default)(this))(e)},setThirdPartyStateAndOtherInfoToStorage:function(e){return t.setStateAndOtherInfoToStorage.bind((0,a.default)(this))(e)},getThirdPartyAuthorisationURLWithQueryParamsAndSetState:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.getAuthorisationURLWithQueryParamsAndSetState.bind((0,a.default)(this))(e)]}))}))},generateThirdPartyStateToSendToOAuthProvider:function(e){return t.generateStateToSendToOAuthProvider.bind((0,a.default)(this))(e)},verifyAndGetThirdPartyStateOrThrowError:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.verifyAndGetStateOrThrowError.bind((0,a.default)(this))(e)]}))}))},getThirdPartyAuthCodeFromURL:function(e){return t.getAuthCodeFromURL.bind((0,a.default)(this))(e)},getThirdPartyAuthErrorFromURL:function(e){return t.getAuthErrorFromURL.bind((0,a.default)(this))(e)},getThirdPartyAuthStateFromURL:function(e){return t.getAuthStateFromURL.bind((0,a.default)(this))(e)},createPasswordlessCode:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.createCode.bind((0,u.default)(this))(e)]}))}))},resendPasswordlessCode:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.resendCode.bind((0,u.default)(this))(e)]}))}))},consumePasswordlessCode:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.consumeCode.bind((0,u.default)(this))(e)]}))}))},getPasswordlessLinkCodeFromURL:function(e){return r.getLinkCodeFromURL.bind((0,u.default)(this))(e)},getPasswordlessPreAuthSessionIdFromURL:function(e){return r.getPreAuthSessionIdFromURL.bind((0,u.default)(this))(e)},doesPasswordlessUserEmailExist:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.doesEmailExist.bind((0,u.default)(this))(e)]}))}))},doesPasswordlessUserPhoneNumberExist:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.doesPhoneNumberExist.bind((0,u.default)(this))(e)]}))}))},getPasswordlessLoginAttemptInfo:function(e){return r.getLoginAttemptInfo.bind((0,u.default)(this))(e)},setPasswordlessLoginAttemptInfo:function(e){return r.setLoginAttemptInfo.bind((0,u.default)(this))(e)},clearPasswordlessLoginAttemptInfo:function(e){return r.clearLoginAttemptInfo.bind((0,u.default)(this))(e)}}}t.default=c,t.getRecipeImplementation=c},9817:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{clearLoginAttemptInfo:e.clearPasswordlessLoginAttemptInfo.bind(e),consumeCode:e.consumePasswordlessCode.bind(e),createCode:e.createPasswordlessCode.bind(e),doesEmailExist:e.doesPasswordlessUserEmailExist.bind(e),doesPhoneNumberExist:e.doesPasswordlessUserPhoneNumberExist.bind(e),getLoginAttemptInfo:e.getPasswordlessLoginAttemptInfo.bind(e),resendCode:e.resendPasswordlessCode.bind(e),setLoginAttemptInfo:e.setPasswordlessLoginAttemptInfo.bind(e),getLinkCodeFromURL:e.getPasswordlessLinkCodeFromURL.bind(e),getPreAuthSessionIdFromURL:e.getPasswordlessPreAuthSessionIdFromURL.bind(e)}}},5491:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{getAuthorisationURLFromBackend:e.getAuthorisationURLFromBackend.bind(e),getStateAndOtherInfoFromStorage:e.getThirdPartyStateAndOtherInfoFromStorage.bind(e),getAuthorisationURLWithQueryParamsAndSetState:e.getThirdPartyAuthorisationURLWithQueryParamsAndSetState.bind(e),setStateAndOtherInfoToStorage:e.setThirdPartyStateAndOtherInfoToStorage.bind(e),generateStateToSendToOAuthProvider:e.generateThirdPartyStateToSendToOAuthProvider.bind(e),getAuthCodeFromURL:e.getThirdPartyAuthCodeFromURL.bind(e),getAuthErrorFromURL:e.getThirdPartyAuthErrorFromURL.bind(e),getAuthStateFromURL:e.getThirdPartyAuthStateFromURL.bind(e),verifyAndGetStateOrThrowError:e.verifyAndGetThirdPartyStateOrThrowError.bind(e),signInAndUp:e.thirdPartySignInAndUp.bind(e)}}},3063:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},8122:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var n=r(9092),o=r(7611),i=r(7992),s=r(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var r=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];r.searchParams.set(t,n)})),r.href}catch(r){var n=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];o.searchParams.set(t,r)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,r,n=new s.default("");return void 0!==e.apiGatewayPath&&(n=new s.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:n.appendPath((t=o.DEFAULT_API_BASE_PATH,r=e.apiBasePath,void 0!==r?new s.default(r):new s.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.1.5",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},942:(e,t,r)=>{function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}t.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(7860))}},e=>{var t=(4706,e(e.s=4706));supertokensThirdPartyPasswordless=t}]); | ||
"use strict";var supertokensThirdPartyPasswordless;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[425],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(942);t.default=n.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(e);return t?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),r(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=r(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return r(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),r("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var n=this;this.startsWith=function(e){return n.value.startsWith(e.value)},this.appendPath=function(t){return new e(n.value+t.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(t)}},634:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1260),a=r(255),u=r(2173),c=function(){function e(e,t){var r=this;this.get=function(e,t,s,a,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,s),n({method:"GET"},t),a,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(e,t,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),n({method:"POST"},t),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(e,t,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"DELETE"},t),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(e,t,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"PUT"},t),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(e,t,s,u){return o(r,void 0,void 0,(function(){var r,o,c,d,l,f;return i(this,(function(i){switch(i.label){case 0:return r=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:s,url:e,requestInit:n(n({},t),{headers:n(n({},r),{"fdi-version":a.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,d=o.url,[4,fetch(d,c)];case 2:if((l=i.sent()).status>=300)throw l;return void 0===u?[3,4]:(f=l.clone(),[4,u({requestInit:c,url:e,fetchResponse:f})]);case 3:i.sent(),i.label=4;case 4:return[2,l]}}))}))},this.callPreAPIHook=function(e){return o(r,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var n=new s.default(e),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(r,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=n.sent()).status)throw r=void 0===t.message?"No Error Message Provided":t.message,new u.default(r);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var r=e.recipePreAPIHook,s=e.action,a=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{action:s,userContext:u}))];case 1:return o=t.sent(),void 0===a||void 0===a.preAPIHook?[2,o]:[2,a.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var r=e.recipePostAPIHook,s=e.action,a=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{userContext:a,action:s}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1996),u=r(6322),c=function(e){function t(t){var r=e.call(this,t)||this;return r.signOut=function(e){return i(r,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},r}return o(t,e),t}(a.default);t.default=c},5053:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var n=r(6069);t.normaliseAuthRecipe=function(e){return(0,n.normaliseRecipeModuleConfig)(e)}},6277:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(6923),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.emailVerificationRecipe=void 0===r.emailVerification?new i.default({appInfo:t.appInfo,recipeId:t.recipeId,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:void 0===t.override?void 0:t.override.emailVerification}):r.emailVerification,n}return o(t,e),t}(r(7725).default);t.default=s},7870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipeWithEmailVerificationConfig=void 0;var n=r(5053);t.normaliseAuthRecipeWithEmailVerificationConfig=function(e){return(0,n.normaliseAuthRecipe)(e)}},6923:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=r(787),i=r(5120),s=r(6333),a=r(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new s.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(r){return e.instance=new e(n(n({},t),{appInfo:r,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Make sure to call the EmailVerification.init method.";throw t=(0,a.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,a.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),s=r(8122);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(r){var s=r.options,a=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u,c;return o(this,(function(o){switch(o.label){case 0:return r=this.getEmailVerificationTokenFromURL({userContext:a}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:r})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"VERIFY_EMAIL"}))];case 1:return n=o.sent(),u=n.jsonBody,c=n.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(r){var s=r.options,a=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/user/email/verify",{},void 0,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"IS_EMAIL_VERIFIED",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"IS_EMAIL_VERIFIED"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:"OK",isVerified:n.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(r){var s=r.options,a=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/email/verify/token",{body:JSON.stringify({})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_VERIFY_EMAIL",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"SEND_VERIFY_EMAIL"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:n.status,fetchResponse:u}]}}))}))},getEmailVerificationTokenFromURL:function(){var e=(0,s.getQueryParams)("token");return void 0===e?"":e}}}t.default=a,t.getRecipeImplementation=a},787:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(6069);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},6427:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY=void 0,t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY="supertokens-passwordless-loginAttemptInfo"},2856:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=r(6333),a=r(8122),u=r(7725),c=r(4921),d=r(8891),l=function(e){function t(t){var r=e.call(this,(0,c.normaliseUserInput)(t))||this,n=new s.default((0,d.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=n.override(r.config.override.functions).build(),r}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Passwordless found. Make sure to call the Passwordless.init method.";throw e=(0,a.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,a.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="passwordless",t}(u.default);t.Recipe=l,t.default=l},8891:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=r(9092),a=r(634),u=r(8122),c=r(6427);function d(e){var t=new a.default(e.recipeId,e.appInfo);return{createCode:function(r){return o(this,void 0,void 0,(function(){var o,s,u,c;return i(this,(function(i){switch(i.label){case 0:return"email"in r&&(o={email:r.email}),"phoneNumber"in r&&(o={phoneNumber:r.phoneNumber}),[4,t.post("/signinup/code",{body:JSON.stringify(o)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:r.userContext}))];case 1:return s=i.sent(),u=s.jsonBody,c=s.fetchResponse,[2,n(n({},u),{fetchResponse:c})]}}))}))},resendCode:function(r){return o(this,void 0,void 0,(function(){var n,o,s,u;return i(this,(function(i){switch(i.label){case 0:return n={deviceId:r.deviceId,preAuthSessionId:r.preAuthSessionId},[4,t.post("/signinup/code/resend",{body:JSON.stringify(n)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:r.userContext}))];case 1:return o=i.sent(),s=o.jsonBody,u=o.fetchResponse,[2,{status:s.status,fetchResponse:u}]}}))}))},consumeCode:function(r){return o(this,void 0,void 0,(function(){var o,s,u,c;return i(this,(function(i){switch(i.label){case 0:return o="userInputCode"in r?{userInputCode:r.userInputCode,deviceId:r.deviceId,preAuthSessionId:r.preAuthSessionId}:{linkCode:r.linkCode,preAuthSessionId:r.preAuthSessionId},[4,t.post("/signinup/code/consume",{body:JSON.stringify(o)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:r.userContext}))];case 1:return s=i.sent(),u=s.jsonBody,c=s.fetchResponse,"OK"===u.status?[2,{status:"OK",createdUser:u.createdNewUser,user:u.user,fetchResponse:c}]:[2,n(n({},u),{fetchResponse:c})]}}))}))},getLinkCodeFromURL:function(){return(0,u.getHashFromLocation)()},getPreAuthSessionIdFromURL:function(){var e=(0,u.getQueryParams)("preAuthSessionId");return void 0===e?"":e},doesEmailExist:function(r){return o(this,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/email/exists",{},{email:r.email},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},doesPhoneNumberExist:function(r){return o(this,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/phoneNumber/exists",{},{phoneNumber:r.phoneNumber},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},getLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.getItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY)];case 1:if(null===(e=t.sent()))return[2,void 0];try{return[2,JSON.parse(e)]}catch(e){return[2,void 0]}return[2]}}))}))},setLoginAttemptInfo:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.setItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY,JSON.stringify(n({version:1},e.attemptInfo)))];case 1:return t.sent(),[2]}}))}))},clearLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.removeItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY),[2]}))}))}}}t.default=d,t.getRecipeImplementation=d},4921:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.consumeCode=t.resendCode=t.createCode=t.normaliseUserInput=void 0;var s=r(8122),a=r(5053);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,a.normaliseAuthRecipe)(e)),{override:t})},t.createCode=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.createCode(n(n({},e),{userContext:t}))];case 1:return r=o.sent(),[4,e.recipeImplementation.setLoginAttemptInfo({attemptInfo:{deviceId:r.deviceId,preAuthSessionId:r.preAuthSessionId,flowType:r.flowType},userContext:t})];case 2:return o.sent(),[2,r]}}))}))},t.resendCode=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})];case 1:return r=o.sent(),[2,e.recipeImplementation.resendCode(n(n({},e),{userContext:t,deviceId:void 0===r?"":r.deviceId,preAuthSessionId:void 0===r?"":r.preAuthSessionId}))]}}))}))},t.consumeCode=function(e){return o(this,void 0,void 0,(function(){var t,r,o,a,u;return i(this,(function(i){switch(i.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),"userInputCode"in e?[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})]:[3,2];case 1:return o=i.sent(),r={userInputCode:e.userInputCode,deviceId:void 0===o?"":o.deviceId,preAuthSessionId:void 0===o?"":o.preAuthSessionId},[3,3];case 2:a=e.recipeImplementation.getLinkCodeFromURL({userContext:e.userContext}),u=e.recipeImplementation.getPreAuthSessionIdFromURL({userContext:e.userContext}),r={linkCode:a,preAuthSessionId:u},i.label=3;case 3:return[2,e.recipeImplementation.consumeCode(n({userContext:t,options:e.options},r))]}}))}))}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return r(t,void 0,void 0,(function(){return n(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return r(t,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=r(1996),c=r(1757),d=r(8122),l=function(e){function t(t){var r=e.call(this,t)||this;return r.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},r.getAccessTokenPayloadSecurely=function(e){return s(r,void 0,void 0,(function(){return a(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},r.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},r.signOut=function(e){return c.default.signOut({userContext:e.userContext})},r.attemptRefreshingSession=function(){return s(r,void 0,void 0,(function(){return a(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},c.default.init(i(i({},t),{preAPIHook:function(e){return s(r,void 0,void 0,(function(){var r;return a(this,(function(n){return r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,r]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),r}return o(t,e),t.init=function(e){return function(r,n){return t.instance=new t(i(i({},e),{appInfo:r,recipeId:t.RECIPE_ID,enableDebugLogs:n})),t.instance}},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,d.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,d.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=l,t.default=l},9102:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=r(6277),a=r(4566),u=r(6333),c=r(3664),d=r(8122),l=function(e){function t(t,r){var n=e.call(this,(0,a.normaliseUserInput)(t),r)||this,o=new u.default((0,c.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=o.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{emailVerification:void 0}),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdParty found. Make sure to call the ThirdParty.init method.";throw e=(0,d.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,d.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdparty",t}(s.default);t.Recipe=l,t.default=l},3664:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=r(634),a=r(8122),u=r(2173),c=r(9092);function d(e){var t=new s.default(e.recipeId,e.appInfo);return{getStateAndOtherInfoFromStorage:function(){var e=c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.getItemSync("supertokens-oauth-state-2");if(null!==e)try{return JSON.parse(e)}catch(e){return}},setStateAndOtherInfoToStorage:function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=JSON.stringify(n({},e.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",t)];case 1:return r.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return o(this,void 0,void 0,(function(){var t,r,n,o;return i(this,(function(i){switch(i.label){case 0:return t=this.generateStateToSendToOAuthProvider({userContext:e.userContext}),r=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:t,providerId:e.providerId,expiresAt:r,authorisationURL:e.authorisationURL,providerClientId:e.providerClientId},userContext:e.userContext})];case 1:return i.sent(),[4,this.getAuthorisationURLFromBackend({providerId:e.providerId,userContext:e.userContext,options:e.options})];case 2:return n=i.sent(),o=new URL(n.url),[2,null!==o.searchParams.get("redirect_uri")?(0,a.appendQueryParamsToURL)(n.url,{state:t}):(0,a.appendQueryParamsToURL)(n.url,{state:t,redirect_uri:e.authorisationURL})]}}))}))},getAuthorisationURLFromBackend:function(r){return o(this,void 0,void 0,(function(){var n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/authorisationurl",{},{thirdPartyId:r.providerId},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,a=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:a}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,a,c,d,l,f,p,h;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),a=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:a,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),d=this.getAuthCodeFromURL({userContext:r.userContext}),void 0!==(l=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(l));return[4,t.post("/signinup",{body:JSON.stringify({code:d,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(f=i.sent(),p=f.jsonBody,h=f.fetchResponse,"FIELD_ERROR"===p.status)throw new u.default(p.error);return[2,n(n({},p),{fetchResponse:h})]}}))}))},generateStateToSendToOAuthProvider:function(){return"".concat(1e20).replace(/[018]/g,(function(e){return(parseInt(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(e)/4).toString(16)}))},verifyAndGetStateOrThrowError:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){if(void 0===e.stateObjectFromStorage||void 0===e.stateObjectFromStorage.stateForAuthProvider)throw new Error("No valid auth state present in session storage");if(void 0===e.stateFromAuthProvider)throw new Error("No state recieved from auth provider");if(e.stateObjectFromStorage.expiresAt<Date.now())throw new Error("Auth state verification failed. The auth provider took too long to respond");if(e.stateFromAuthProvider!==e.stateObjectFromStorage.stateForAuthProvider)throw new Error("Auth state verification failed. The auth provider responded with an invalid state");return[2,e.stateObjectFromStorage]}))}))},getAuthCodeFromURL:function(){var e=(0,a.getQueryParams)("code");return void 0===e?"":e},getAuthErrorFromURL:function(){return(0,a.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,a.getQueryParams)("state");return void 0===e?"":e}}}t.default=d,t.getRecipeImplementation=d},4566:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},4706:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.clearPasswordlessLoginAttemptInfo=t.setPasswordlessLoginAttemptInfo=t.getPasswordlessLoginAttemptInfo=t.getPasswordlessPreAuthSessionIdFromURL=t.getPasswordlessLinkCodeFromURL=t.getThirdPartyAuthStateFromURL=t.getThirdPartyAuthErrorFromURL=t.getThirdPartyAuthCodeFromURL=t.verifyAndGetThirdPartyStateOrThrowError=t.generateThirdPartyStateToSendToOAuthProvider=t.setThirdPartyStateAndOtherInfoToStorage=t.getThirdPartyStateAndOtherInfoFromStorage=t.getAuthorisationURLFromBackend=t.signOut=t.doesPasswordlessUserPhoneNumberExist=t.doesPasswordlessUserEmailExist=t.consumePasswordlessCode=t.resendPasswordlessCode=t.createPasswordlessCode=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.thirdPartySignInAndUp=t.getThirdPartyAuthorisationURLWithQueryParamsAndSetState=t.init=void 0;var s=r(8495),a=r(8122),u=r(4921),c=function(){function e(){}return e.init=function(e){return s.default.init(e)},e.signOut=function(e){return s.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getAuthorisationURLFromBackend=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLFromBackend(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.thirdPartySignInAndUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.thirdPartySignInAndUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getThirdPartyStateAndOtherInfoFromStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyStateAndOtherInfoFromStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setThirdPartyStateAndOtherInfoToStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setThirdPartyStateAndOtherInfoToStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getThirdPartyAuthorisationURLWithQueryParamsAndSetState=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthorisationURLWithQueryParamsAndSetState(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.generateThirdPartyStateToSendToOAuthProvider=function(e){return s.default.getInstanceOrThrow().recipeImplementation.generateThirdPartyStateToSendToOAuthProvider(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyAndGetThirdPartyStateOrThrowError=function(e){return s.default.getInstanceOrThrow().recipeImplementation.verifyAndGetThirdPartyStateOrThrowError(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getThirdPartyAuthCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getThirdPartyAuthErrorFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthErrorFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getThirdPartyAuthStateFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthStateFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.createPasswordlessCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=s.default.getInstanceOrThrow(),[2,u.createCode(n(n({},e),{recipeImplementation:t.passwordlessRecipe.recipeImplementation}))]}))}))},e.resendPasswordlessCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=s.default.getInstanceOrThrow(),[2,u.resendCode(n(n({},e),{recipeImplementation:t.passwordlessRecipe.recipeImplementation}))]}))}))},e.consumePasswordlessCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=s.default.getInstanceOrThrow(),[2,u.consumeCode(n(n({},e),{recipeImplementation:t.passwordlessRecipe.recipeImplementation}))]}))}))},e.getPasswordlessLinkCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getPasswordlessLinkCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getPasswordlessPreAuthSessionIdFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getPasswordlessPreAuthSessionIdFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.sendVerificationEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.sendVerificationEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.isEmailVerified=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.doesPasswordlessUserEmailExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesPasswordlessUserEmailExist(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.doesPasswordlessUserPhoneNumberExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesPasswordlessUserPhoneNumberExist(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getPasswordlessLoginAttemptInfo=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getPasswordlessLoginAttemptInfo(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setPasswordlessLoginAttemptInfo=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setPasswordlessLoginAttemptInfo(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.clearPasswordlessLoginAttemptInfo=function(e){return s.default.getInstanceOrThrow().recipeImplementation.clearPasswordlessLoginAttemptInfo(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e}();t.default=c;var d=c.init;t.init=d;var l=c.getThirdPartyAuthorisationURLWithQueryParamsAndSetState;t.getThirdPartyAuthorisationURLWithQueryParamsAndSetState=l;var f=c.thirdPartySignInAndUp;t.thirdPartySignInAndUp=f;var p=c.verifyEmail;t.verifyEmail=p;var h=c.sendVerificationEmail;t.sendVerificationEmail=h;var v=c.isEmailVerified;t.isEmailVerified=v;var P=c.createPasswordlessCode;t.createPasswordlessCode=P;var g=c.resendPasswordlessCode;t.resendPasswordlessCode=g;var I=c.consumePasswordlessCode;t.consumePasswordlessCode=I;var m=c.doesPasswordlessUserEmailExist;t.doesPasswordlessUserEmailExist=m;var y=c.doesPasswordlessUserPhoneNumberExist;t.doesPasswordlessUserPhoneNumberExist=y;var w=c.getAuthorisationURLFromBackend;t.getAuthorisationURLFromBackend=w;var A=c.getThirdPartyStateAndOtherInfoFromStorage;t.getThirdPartyStateAndOtherInfoFromStorage=A;var b=c.setThirdPartyStateAndOtherInfoToStorage;t.setThirdPartyStateAndOtherInfoToStorage=b;var S=c.generateThirdPartyStateToSendToOAuthProvider;t.generateThirdPartyStateToSendToOAuthProvider=S;var _=c.verifyAndGetThirdPartyStateOrThrowError;t.verifyAndGetThirdPartyStateOrThrowError=_;var O=c.getThirdPartyAuthCodeFromURL;t.getThirdPartyAuthCodeFromURL=O;var R=c.getThirdPartyAuthErrorFromURL;t.getThirdPartyAuthErrorFromURL=R;var C=c.getThirdPartyAuthStateFromURL;t.getThirdPartyAuthStateFromURL=C;var x=c.getPasswordlessLinkCodeFromURL;t.getPasswordlessLinkCodeFromURL=x;var E=c.getPasswordlessPreAuthSessionIdFromURL;t.getPasswordlessPreAuthSessionIdFromURL=E;var T=c.getPasswordlessLoginAttemptInfo;t.getPasswordlessLoginAttemptInfo=T;var k=c.setPasswordlessLoginAttemptInfo;t.setPasswordlessLoginAttemptInfo=k;var U=c.clearPasswordlessLoginAttemptInfo;t.clearPasswordlessLoginAttemptInfo=U;var L=c.signOut;t.signOut=L},8495:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=r(6277),a=r(9102),u=r(2856),c=r(3063),d=r(6333),l=r(1187),f=r(8122),p=r(5491),h=r(9817),v=function(e){function t(t,r){var n,o=e.call(this,(0,c.normaliseUserInput)(t),r)||this,i=new d.default((0,l.default)({recipeId:o.config.recipeId,appInfo:o.config.appInfo,preAPIHook:o.config.preAPIHook,postAPIHook:o.config.postAPIHook})).override(o.config.override.functions).build();return o.recipeImplementation=i,o.thirdPartyRecipe=void 0===r.thirdParty?new a.default({recipeId:o.config.recipeId,appInfo:o.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{emailVerification:null===(n=t.override)||void 0===n?void 0:n.emailVerification,functions:function(){return(0,p.default)(i)}}},{emailVerification:o.emailVerificationRecipe}):r.thirdParty,o.passwordlessRecipe=void 0===r.passwordless?new u.default({recipeId:o.config.recipeId,appInfo:o.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{functions:function(){return(0,h.default)(i)}}}):r.passwordless,o}return o(t,e),t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdPartyPasswordless found. Make sure to call the ThirdPartyPasswordless.init method.";throw e=(0,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{emailVerification:void 0,thirdParty:void 0,passwordless:void 0}),t.instance}},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdpartypasswordless",t}(s.default);t.Recipe=v,t.default=v},1187:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(3664),s=r(8891),a=r(5491),u=r(9817);function c(e){var t=(0,i.default)(e),r=(0,s.default)(e);return{getAuthorisationURLFromBackend:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.getAuthorisationURLFromBackend.bind((0,a.default)(this))(e)]}))}))},thirdPartySignInAndUp:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.signInAndUp.bind((0,a.default)(this))(e)]}))}))},getThirdPartyStateAndOtherInfoFromStorage:function(e){return t.getStateAndOtherInfoFromStorage.bind((0,a.default)(this))(e)},setThirdPartyStateAndOtherInfoToStorage:function(e){return t.setStateAndOtherInfoToStorage.bind((0,a.default)(this))(e)},getThirdPartyAuthorisationURLWithQueryParamsAndSetState:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.getAuthorisationURLWithQueryParamsAndSetState.bind((0,a.default)(this))(e)]}))}))},generateThirdPartyStateToSendToOAuthProvider:function(e){return t.generateStateToSendToOAuthProvider.bind((0,a.default)(this))(e)},verifyAndGetThirdPartyStateOrThrowError:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.verifyAndGetStateOrThrowError.bind((0,a.default)(this))(e)]}))}))},getThirdPartyAuthCodeFromURL:function(e){return t.getAuthCodeFromURL.bind((0,a.default)(this))(e)},getThirdPartyAuthErrorFromURL:function(e){return t.getAuthErrorFromURL.bind((0,a.default)(this))(e)},getThirdPartyAuthStateFromURL:function(e){return t.getAuthStateFromURL.bind((0,a.default)(this))(e)},createPasswordlessCode:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.createCode.bind((0,u.default)(this))(e)]}))}))},resendPasswordlessCode:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.resendCode.bind((0,u.default)(this))(e)]}))}))},consumePasswordlessCode:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.consumeCode.bind((0,u.default)(this))(e)]}))}))},getPasswordlessLinkCodeFromURL:function(e){return r.getLinkCodeFromURL.bind((0,u.default)(this))(e)},getPasswordlessPreAuthSessionIdFromURL:function(e){return r.getPreAuthSessionIdFromURL.bind((0,u.default)(this))(e)},doesPasswordlessUserEmailExist:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.doesEmailExist.bind((0,u.default)(this))(e)]}))}))},doesPasswordlessUserPhoneNumberExist:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.doesPhoneNumberExist.bind((0,u.default)(this))(e)]}))}))},getPasswordlessLoginAttemptInfo:function(e){return r.getLoginAttemptInfo.bind((0,u.default)(this))(e)},setPasswordlessLoginAttemptInfo:function(e){return r.setLoginAttemptInfo.bind((0,u.default)(this))(e)},clearPasswordlessLoginAttemptInfo:function(e){return r.clearLoginAttemptInfo.bind((0,u.default)(this))(e)}}}t.default=c,t.getRecipeImplementation=c},9817:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{clearLoginAttemptInfo:e.clearPasswordlessLoginAttemptInfo.bind(e),consumeCode:e.consumePasswordlessCode.bind(e),createCode:e.createPasswordlessCode.bind(e),doesEmailExist:e.doesPasswordlessUserEmailExist.bind(e),doesPhoneNumberExist:e.doesPasswordlessUserPhoneNumberExist.bind(e),getLoginAttemptInfo:e.getPasswordlessLoginAttemptInfo.bind(e),resendCode:e.resendPasswordlessCode.bind(e),setLoginAttemptInfo:e.setPasswordlessLoginAttemptInfo.bind(e),getLinkCodeFromURL:e.getPasswordlessLinkCodeFromURL.bind(e),getPreAuthSessionIdFromURL:e.getPasswordlessPreAuthSessionIdFromURL.bind(e)}}},5491:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{getAuthorisationURLFromBackend:e.getAuthorisationURLFromBackend.bind(e),getStateAndOtherInfoFromStorage:e.getThirdPartyStateAndOtherInfoFromStorage.bind(e),getAuthorisationURLWithQueryParamsAndSetState:e.getThirdPartyAuthorisationURLWithQueryParamsAndSetState.bind(e),setStateAndOtherInfoToStorage:e.setThirdPartyStateAndOtherInfoToStorage.bind(e),generateStateToSendToOAuthProvider:e.generateThirdPartyStateToSendToOAuthProvider.bind(e),getAuthCodeFromURL:e.getThirdPartyAuthCodeFromURL.bind(e),getAuthErrorFromURL:e.getThirdPartyAuthErrorFromURL.bind(e),getAuthStateFromURL:e.getThirdPartyAuthStateFromURL.bind(e),verifyAndGetStateOrThrowError:e.verifyAndGetThirdPartyStateOrThrowError.bind(e),signInAndUp:e.thirdPartySignInAndUp.bind(e)}}},3063:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},8122:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var n=r(9092),o=r(7611),i=r(7992),s=r(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var r=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];r.searchParams.set(t,n)})),r.href}catch(r){var n=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];o.searchParams.set(t,r)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,r,n=new s.default("");return void 0!==e.apiGatewayPath&&(n=new s.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:n.appendPath((t=o.DEFAULT_API_BASE_PATH,r=e.apiBasePath,void 0!==r?new s.default(r):new s.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.1.6",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},942:(e,t,r)=>{function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}t.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(7860))}},e=>{var t=(4706,e(e.s=4706));supertokensThirdPartyPasswordless=t}]); |
@@ -10,4 +10,12 @@ # Changelog | ||
## [0.1.6] - 2022-08-23 | ||
### Changed | ||
- Makes the input argument for `consumePasswordlessCode` in ThirdPartyPasswordless optional. | ||
## [0.1.5] - 2022-08-11 | ||
### Changed | ||
- Refactors the way the SDK exports recipe functions and utilities | ||
@@ -14,0 +22,0 @@ |
@@ -218,3 +218,3 @@ import { UserInput, RecipeInterface, PreAPIHookContext, PostAPIHookContext, PreAndPostAPIHookAction } from "./types"; | ||
static consumePasswordlessCode( | ||
input: | ||
input?: | ||
| { | ||
@@ -221,0 +221,0 @@ userInputCode: string; |
@@ -1,2 +0,2 @@ | ||
export declare const package_version = "0.1.5"; | ||
export declare const package_version = "0.1.6"; | ||
export declare const supported_fdi: string[]; |
@@ -18,3 +18,3 @@ "use strict"; | ||
*/ | ||
exports.package_version = "0.1.5"; | ||
exports.package_version = "0.1.6"; | ||
exports.supported_fdi = ["1.8", "1.9", "1.10", "1.11", "1.12", "1.13", "1.14"]; |
{ | ||
"name": "supertokens-web-js", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "SuperTokens SDK for vanilla JS for all recipes", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
975662