{"version":3,"sources":["../node_modules/@aws-amplify/ui-components/dist/esm-es5/amplify-authenticator.entry.js","../node_modules/@aws-amplify/ui-components/dist/esm-es5/auth-helpers-557b83fc.js"],"names":["_a","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","__generator","body","f","y","t","g","_","label","sent","trys","ops","verb","Symbol","iterator","this","n","v","op","TypeError","call","pop","length","push","authSlotNames","AuthState","SignIn","ConfirmSignIn","SignUp","ConfirmSignUp","ForgotPassword","ResetPassword","VerifyContact","TOTPSetup","Loading","logger","Logger","AmplifyAuthenticator","class_1","hostRef","_this","registerInstance","initialAuthState","handleAuthStateChange","hideToast","authState","toastMessage","handleExternalAuthEvent","payload","event","checkContact","data","dispatchAuthStateChangeEvent","handleToastEvent","TOAST_AUTH_ERROR_EVENT","message","prototype","componentWillLoad","onAuthUIStateChange","authData","onAuthStateChange","Hub","listen","UI_AUTH_CHANNEL","AUTH_CHANNEL","appendToCognitoUserAgent","checkUser","Auth","currentAuthenticatedUser","Error","NO_AUTH_MODULE_FOUND","user","SignedIn","catch","nextAuthState","undefined","error","info","SignedOut","log","getAuthComponent","h","federated","usernameAlias","getSlotWithAuthComponent","authComponent","slotName","slotIsEmpty","el","querySelector","name","disconnectedCallback","remove","render","Host","handleClose","class","Object","defineProperty","get","getElement","enumerable","configurable","style","newUser","error_1","verifiedContact","isCognitoUser","isEmpty","verified","unverified","assign","dispatchToastHubEvent","handleSignIn","username","password","error_2","signIn","debug","challengeName","ChallengeName","SMSMFA","SoftwareTokenMFA","NewPasswordRequired","challengeParam","MFASetup","CustomChallenge","trigger","CustomConfirmSignIn","code","Translations","EMPTY_PASSWORD","EMPTY_USERNAME","UsernameAlias","email","EMPTY_EMAIL","phone_number","EMPTY_PHONE","CognitoUser"],"mappings":"sIAAA,iEAoCIA,EApCJ,oFAAIC,EAAwC,SAAUC,EAASC,EAAYC,EAAGC,GAE1E,OAAO,IAAKD,IAAMA,EAAIE,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ClCjD,IAAkBkD,IAAcC,QAChClB,EAAQ7D,QAAU2E,IAAaK,aAE/BpD,IAAkBkD,IAAcG,eAChCpB,EAAQ7D,QAAU2E,IAAaO,cAGvCzB,YAAsBI,GACf,CAAC,EAAa,IACzB,KAAK,GAAI,MAAO,CAAC,WAIzBT,EAAgB,SAAUpC,GAC1B,OAAOA,aAAgBmE","file":"static/js/5.ae11a723.chunk.js","sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar _a;\nimport { r as registerInstance, h, H as Host, g as getElement } from './index-83f2275b.js';\nimport { Logger, Hub } from '@aws-amplify/core';\nimport { A as AuthState } from './auth-types-78df304e.js';\nimport { appendToCognitoUserAgent, Auth } from '@aws-amplify/auth';\nimport './Translations-108d469f.js';\nimport { T as TOAST_AUTH_ERROR_EVENT, U as UI_AUTH_CHANNEL, A as AUTH_CHANNEL, N as NO_AUTH_MODULE_FOUND } from './constants-c8ecaa24.js';\nimport { d as dispatchAuthStateChangeEvent, o as onAuthUIStateChange } from './helpers-14fcb50c.js';\nimport { c as checkContact } from './auth-helpers-557b83fc.js';\nvar authSlotNames = (_a = {},\n _a[AuthState.SignIn] = 'sign-in',\n _a[AuthState.ConfirmSignIn] = 'confirm-sign-in',\n _a[AuthState.SignUp] = 'sign-up',\n _a[AuthState.ConfirmSignUp] = 'confirm-sign-up',\n _a[AuthState.ForgotPassword] = 'forgot-password',\n _a[AuthState.ResetPassword] = 'require-new-password',\n _a[AuthState.VerifyContact] = 'verify-contact',\n _a[AuthState.TOTPSetup] = 'totp-setup',\n _a[AuthState.Loading] = 'loading',\n _a);\nvar amplifyAuthenticatorCss = \":host{--background-color:var(--amplify-background-color);--width:28.75rem;--min-width:20rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--box-shadow:1px 1px 4px 0 rgba(0, 0, 0, 0.15);--border-radius:6px;--padding:35px 40px;--margin-bottom:20px;--container-height:100vh;--container-display:flex;--container-justify:center;--container-align:center}.auth-container{display:var(--container-display);-ms-flex-pack:var(--container-justify);justify-content:var(--container-justify);-ms-flex-align:var(--container-align);align-items:var(--container-align);min-height:var(--container-height)}\";\nvar logger = new Logger('Authenticator');\nvar AmplifyAuthenticator = /** @class */ (function () {\n function class_1(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Initial starting state of the Authenticator component. E.g. If `signup` is passed the default component is set to AmplifySignUp */\n this.initialAuthState = AuthState.SignIn;\n /** Callback for Authenticator state machine changes */\n this.handleAuthStateChange = function () { };\n /** Hide amplify-toast for auth errors */\n this.hideToast = false;\n this.authState = AuthState.Loading;\n this.toastMessage = '';\n this.handleExternalAuthEvent = function (_a) {\n var payload = _a.payload;\n switch (payload.event) {\n case 'cognitoHostedUI':\n case 'signIn':\n checkContact(payload.data, dispatchAuthStateChangeEvent);\n break;\n case 'cognitoHostedUI_failure':\n case 'parsingUrl_failure':\n case 'signOut':\n case 'customGreetingSignOut':\n return dispatchAuthStateChangeEvent(_this.initialAuthState);\n }\n };\n this.handleToastEvent = function (_a) {\n var payload = _a.payload;\n switch (payload.event) {\n case TOAST_AUTH_ERROR_EVENT:\n if (payload.message)\n _this.toastMessage = payload.message;\n break;\n }\n };\n }\n class_1.prototype.componentWillLoad = function () {\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n onAuthUIStateChange(function (authState, authData) {\n _this.onAuthStateChange(authState, authData);\n _this.toastMessage = '';\n });\n if (!this.hideToast)\n Hub.listen(UI_AUTH_CHANNEL, this.handleToastEvent);\n Hub.listen(AUTH_CHANNEL, this.handleExternalAuthEvent);\n appendToCognitoUserAgent('amplify-authenticator');\n return [4 /*yield*/, this.checkUser()];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n class_1.prototype.checkUser = function () {\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n if (!Auth || typeof Auth.currentAuthenticatedUser !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n return [2 /*return*/, Auth.currentAuthenticatedUser()\n .then(function (user) {\n dispatchAuthStateChangeEvent(AuthState.SignedIn, user);\n })\n .catch(function () {\n dispatchAuthStateChangeEvent(_this.initialAuthState);\n })];\n });\n });\n };\n class_1.prototype.onAuthStateChange = function (nextAuthState, data) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (nextAuthState === undefined)\n return [2 /*return*/, logger.error('nextAuthState cannot be undefined')];\n logger.info('Inside onAuthStateChange Method current authState:', this.authState);\n if (nextAuthState === AuthState.SignedOut) {\n this.authState = this.initialAuthState;\n }\n else {\n this.authState = nextAuthState;\n }\n this.authData = data;\n if (this.authData)\n logger.log('Auth Data was set:', this.authData);\n if (this.authState === nextAuthState) {\n this.handleAuthStateChange(this.authState, this.authData);\n logger.info(\"authState has been updated to \" + this.authState);\n }\n return [2 /*return*/];\n });\n });\n };\n // Returns the auth component corresponding to the given authState.\n class_1.prototype.getAuthComponent = function (authState) {\n switch (authState) {\n case AuthState.SignIn:\n return (h(\"amplify-sign-in\", { federated: this.federated, usernameAlias: this.usernameAlias }));\n case AuthState.ConfirmSignIn:\n return h(\"amplify-confirm-sign-in\", { user: this.authData });\n case AuthState.SignUp:\n return h(\"amplify-sign-up\", { usernameAlias: this.usernameAlias });\n case AuthState.ConfirmSignUp:\n return (h(\"amplify-confirm-sign-up\", { user: this.authData, usernameAlias: this.usernameAlias }));\n case AuthState.ForgotPassword:\n return h(\"amplify-forgot-password\", { usernameAlias: this.usernameAlias });\n case AuthState.ResetPassword:\n return h(\"amplify-require-new-password\", { user: this.authData });\n case AuthState.VerifyContact:\n return h(\"amplify-verify-contact\", { user: this.authData });\n case AuthState.TOTPSetup:\n return h(\"amplify-totp-setup\", { user: this.authData });\n case AuthState.Loading:\n return h(\"div\", null, \"Loading...\");\n default:\n throw new Error(\"Unhandled auth state: \" + authState);\n }\n };\n // Returns a slot containing the Auth component corresponding to the given authState\n class_1.prototype.getSlotWithAuthComponent = function (authState) {\n var authComponent = this.getAuthComponent(authState);\n var slotName = authSlotNames[authState];\n var slotIsEmpty = this.el.querySelector(\"[slot=\\\"\" + slotName + \"\\\"]\") === null; // true if no element has been inserted to the slot\n /**\n * Connect the inner auth component to DOM only if the slot hasn't been overwritten. This prevents\n * the overwritten component from calling its lifecycle methods.\n */\n return h(\"slot\", { name: slotName }, slotIsEmpty && authComponent);\n };\n class_1.prototype.disconnectedCallback = function () {\n Hub.remove(AUTH_CHANNEL, this.handleExternalAuthEvent);\n if (!this.hideToast)\n Hub.remove(UI_AUTH_CHANNEL, this.handleToastEvent);\n return onAuthUIStateChange;\n };\n class_1.prototype.render = function () {\n var _this = this;\n return (h(Host, null, !this.hideToast && this.toastMessage && (h(\"amplify-toast\", { message: this.toastMessage, handleClose: function () {\n _this.toastMessage = '';\n }, \"data-test\": \"authenticator-error\" })), this.authState === AuthState.SignedIn ? ([h(\"slot\", { name: \"greetings\" }), h(\"slot\", null)]) : (h(\"div\", { class: \"auth-container\" }, this.getSlotWithAuthComponent(this.authState)))));\n };\n Object.defineProperty(class_1.prototype, \"el\", {\n get: function () { return getElement(this); },\n enumerable: false,\n configurable: true\n });\n return class_1;\n}());\nAmplifyAuthenticator.style = amplifyAuthenticatorCss;\nexport { AmplifyAuthenticator as amplify_authenticator };\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { Logger, isEmpty } from '@aws-amplify/core';\nimport { A as AuthState, C as ChallengeName, U as UsernameAlias } from './auth-types-78df304e.js';\nimport { Auth, CognitoUser } from '@aws-amplify/auth';\nimport { T as Translations } from './Translations-108d469f.js';\nimport { N as NO_AUTH_MODULE_FOUND } from './constants-c8ecaa24.js';\nimport { a as dispatchToastHubEvent } from './helpers-14fcb50c.js';\nvar logger = new Logger('auth-helpers');\nfunction checkContact(user, handleAuthStateChange) {\n return __awaiter(this, void 0, void 0, function () {\n var data, newUser, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!Auth || typeof Auth.verifiedContact !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n // If `user` is a federated user, we shouldn't call `verifiedContact`\n // since `user` isn't `CognitoUser`\n if (!isCognitoUser(user)) {\n handleAuthStateChange(AuthState.SignedIn, user);\n return [2 /*return*/];\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, Auth.verifiedContact(user)];\n case 2:\n data = _a.sent();\n if (!isEmpty(data.verified) || isEmpty(data.unverified)) {\n handleAuthStateChange(AuthState.SignedIn, user);\n }\n else {\n newUser = Object.assign(user, data);\n handleAuthStateChange(AuthState.VerifyContact, newUser);\n }\n return [3 /*break*/, 4];\n case 3:\n error_1 = _a.sent();\n dispatchToastHubEvent(error_1);\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n });\n}\nvar handleSignIn = function (username, password, handleAuthStateChange, usernameAlias) { return __awaiter(void 0, void 0, void 0, function () {\n var user, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!Auth || typeof Auth.signIn !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 9, , 10]);\n return [4 /*yield*/, Auth.signIn(username, password)];\n case 2:\n user = _a.sent();\n logger.debug(user);\n if (!(user.challengeName === ChallengeName.SMSMFA ||\n user.challengeName === ChallengeName.SoftwareTokenMFA)) return [3 /*break*/, 3];\n logger.debug('confirm user with ' + user.challengeName);\n handleAuthStateChange(AuthState.ConfirmSignIn, user);\n return [3 /*break*/, 8];\n case 3:\n if (!(user.challengeName === ChallengeName.NewPasswordRequired)) return [3 /*break*/, 4];\n logger.debug('require new password', user.challengeParam);\n handleAuthStateChange(AuthState.ResetPassword, user);\n return [3 /*break*/, 8];\n case 4:\n if (!(user.challengeName === ChallengeName.MFASetup)) return [3 /*break*/, 5];\n logger.debug('TOTP setup', user.challengeParam);\n handleAuthStateChange(AuthState.TOTPSetup, user);\n return [3 /*break*/, 8];\n case 5:\n if (!(user.challengeName === ChallengeName.CustomChallenge &&\n user.challengeParam &&\n user.challengeParam.trigger === 'true')) return [3 /*break*/, 6];\n logger.debug('custom challenge', user.challengeParam);\n handleAuthStateChange(AuthState.CustomConfirmSignIn, user);\n return [3 /*break*/, 8];\n case 6: return [4 /*yield*/, checkContact(user, handleAuthStateChange)];\n case 7:\n _a.sent();\n _a.label = 8;\n case 8: return [3 /*break*/, 10];\n case 9:\n error_2 = _a.sent();\n if (error_2.code === 'UserNotConfirmedException') {\n logger.debug('the user is not confirmed');\n handleAuthStateChange(AuthState.ConfirmSignUp, { username: username });\n }\n else if (error_2.code === 'PasswordResetRequiredException') {\n logger.debug('the user requires a new password');\n handleAuthStateChange(AuthState.ForgotPassword, { username: username });\n }\n else if (error_2.code === 'InvalidParameterException' && password === '') {\n logger.debug('Password cannot be empty');\n error_2.message = Translations.EMPTY_PASSWORD;\n }\n else if (error_2.message === Translations.EMPTY_USERNAME) {\n if (usernameAlias === UsernameAlias.email) {\n error_2.message = Translations.EMPTY_EMAIL;\n }\n if (usernameAlias === UsernameAlias.phone_number) {\n error_2.message = Translations.EMPTY_PHONE;\n }\n }\n dispatchToastHubEvent(error_2);\n return [3 /*break*/, 10];\n case 10: return [2 /*return*/];\n }\n });\n}); };\nvar isCognitoUser = function (user) {\n return user instanceof CognitoUser;\n};\nexport { checkContact as c, handleSignIn as h };\n"],"sourceRoot":""}