{"version":3,"sources":["webpack:///./node_modules/@aws-amplify/ui-components/dist/esm-es5/amplify-confirm-sign-in_7.entry.js","webpack:///./node_modules/@aws-amplify/ui-components/dist/esm-es5/auth-helpers-557b83fc.js"],"names":["__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","__spreadArrays","s","i","il","arguments","r","Array","k","a","j","jl","AmplifyConfirmSignIn","class_1","hostRef","_this","handleSubmit","event","confirm","headerText","CONFIRM_SMS_CODE","submitButtonText","CONFIRM","handleAuthStateChange","defaultFormFields","type","required","handleInputChange","handleCodeChange","formFields","mfaOption","SMS","loading","prototype","componentWillLoad","console","warn","setup","userHandler","user","SoftwareTokenMFA","TOTP","CONFIRM_TOTP_CODE","constructedFormFieldOptions","constructFormFieldOptions","code","target","mfaType","error_1","_a","preventDefault","confirmSignIn","Error","content","undefined","forEach","formField","Object","assign","render","get","secondaryFooterContent","variant","onClick","SignIn","BACK_TO_SIGN_IN","defineProperty","enumerable","configurable","AmplifyConfirmSignUp","class_2","confirmSignUp","CONFIRM_SIGN_UP_HEADER_TEXT","CONFIRM_SIGN_UP_SUBMIT_BUTTON_TEXT","usernameAlias","newFormFields","phoneNumber","countryDialCodeValue","phoneNumberValue","formFieldsHandler","buildFormFields","userInput","username","_signUpAttrs","signUpAttrs","buildDefaultFormFields","handleFormFieldInputChange","disabled","inputProps","autocomplete","CONFIRM_SIGN_UP_CODE_LABEL","placeholder","CONFIRM_SIGN_UP_CODE_PLACEHOLDER","hint","CONFIRM_SIGN_UP_LOST_CODE","resendConfirmCode","CONFIRM_SIGN_UP_RESEND_CODE","newFields_1","field","newField","handleFormFieldInputWithCallback","fieldType","setFieldValue","dialCode","fnToCall","cb","bind","getUsername","error_2","resendSignUp","EMPTY_USERNAME","trim","error_3","CONFIRM_SIGN_UP_FAILED","password","logger","AmplifyForgotPassword","class_3","RESET_YOUR_PASSWORD","sendButtonText","SEND_CODE","SUBMIT","handleSend","send","submit","delivery","forgotPasswordAttrs","newFields_2","formAttributes","data","error_4","forgotPassword","error","debug","NEW_PASSWORD_LABEL","NEW_PASSWORD_PLACEHOLDER","CodeDeliveryDetails","error_5","_b","forgotPasswordSubmit","submitFn","testDataPrefix","logger$1","AmplifyRequireNewPassword","class_4","CHANGE_PASSWORD","CHANGE_PASSWORD_ACTION","completeNewPassword","Password","handlePasswordChange","requiredAttributes","setCurrentUser","handleRequiredAttributeInputChange","attribute","formatPhoneNumber","error_6","userRequiredAttributes","requiredAttributesMap_1","currentAuthenticatedUser","currentUser","challengeParam","name","composedInput","err","error_7","challengeName","SMSMFA","MFASetup","ConfirmSignIn","TOTPSetup","AmplifySignIn","class_5","signIn","SIGN_IN_HEADER_TEXT","SIGN_IN_ACTION","hideSignUp","signInAttributes","formFieldInputs","FORGOT_PASSWORD_TEXT","ForgotPassword","RESET_PASSWORD_TEXT","newFields_3","slot","federated","class","NO_ACCOUNT_TEXT","SignUp","CREATE_ACCOUNT_TEXT","style","AmplifySignUp","class_6","signUp","handleSignUp","params","authSignUp","SIGN_UP_HEADER_TEXT","SIGN_UP_SUBMIT_BUTTON_TEXT","haveAccountText","SIGN_UP_HAVE_ACCOUNT_TEXT","signInText","SIGN_IN_TEXT","signUpAttributes","attributes","email","SIGN_UP_FAILED","assignPhoneNumberToSignUpAttributes","phone_number","assignUserNameAliasToSignUpAttributes","assignFormInputToSignUpAttributes","validateSignUpAttributes","EMPTY_EMAIL","EMPTY_PHONE","indexOf","USERNAME_REMOVE_WHITESPACE","PASSWORD_REMOVE_WHITESPACE","error_8","userConfirmed","ConfirmSignUp","SIGN_UP_EMAIL_PLACEHOLDER","SIGN_UP_PASSWORD_PLACEHOLDER","SIGN_UP_USERNAME_PLACEHOLDER","newFields_4","logger$2","AmplifyVerifyContact","class_7","verifyAttr","verify","contact","attr","error_9","verifyCurrentUserAttributeSubmit","SignedIn","error_10","verifyCurrentUserAttribute","inputName","renderSubmit","CODE_PLACEHOLDER","renderVerify","unverified","VERIFY_CONTACT_EMAIL_LABEL","key","VERIFY_CONTACT_PHONE_LABEL","VERIFY_CONTACT_HEADER_TEXT","SKIP","VERIFY_CONTACT_SUBMIT_LABEL","VERIFY_CONTACT_VERIFY_LABEL","checkContact","newUser","verifiedContact","isCognitoUser","verified","VerifyContact","handleSignIn","NewPasswordRequired","ResetPassword","CustomChallenge","trigger","CustomConfirmSignIn","message","EMPTY_PASSWORD"],"mappings":"2FAAA,2dAAIA,EAAwC,SAAUC,EAASC,EAAYC,EAAGC,GAE1E,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAS,CAAE,MAAOG,GAAKL,EAAOK,EAAI,CAAE,CAC1F,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,GAAS,CAAE,MAAOG,GAAKL,EAAOK,EAAI,CAAE,CAC7F,SAASF,EAAKI,GAJlB,IAAeL,EAIaK,EAAOC,KAAOT,EAAQQ,EAAOL,QAJ1CA,EAIyDK,EAAOL,MAJhDA,aAAiBN,EAAIM,EAAQ,IAAIN,GAAE,SAAUG,GAAWA,EAAQG,EAAQ,KAIjBO,KAAKR,EAAWK,EAAW,CAC7GH,GAAMN,EAAYA,EAAUa,MAAMhB,EAASC,GAAc,KAAKS,OAClE,GACJ,EACIO,EAA4C,SAAUjB,EAASkB,MAC/D,IAAsGC,EAAGC,EAAGC,EAAGC,EAA3GC,EAAI,CAAEC,MAAO,EAAGC,KAAM,WAAa,GAAW,EAAPJ,EAAE,GAAQ,MAAMA,EAAE,GAAI,OAAOA,EAAE,EAAI,EAAGK,KAAM,GAAIC,IAAK,IAChG,OAAOL,EAAI,CAAEZ,KAAMkB,EAAK,GAAI,MAASA,EAAK,GAAI,OAAUA,EAAK,IAAwB,mBAAXC,SAA0BP,EAAEO,OA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isArg, _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 __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nimport { r as registerInstance, h, H as Host } from './index-83f2275b.js';\nimport { I18n, Logger, ConsoleLogger, isEmpty } from '@aws-amplify/core';\nimport { M as MfaOption, C as ChallengeName, A as AuthState, a as AuthFormField, U as UsernameAlias } from './auth-types-78df304e.js';\nimport { Auth } from '@aws-amplify/auth';\nimport { T as Translations } from './Translations-108d469f.js';\nimport { N as NO_AUTH_MODULE_FOUND, g as COUNTRY_DIAL_CODE_DEFAULT, b as PHONE_SUFFIX } from './constants-c8ecaa24.js';\nimport { d as dispatchAuthStateChangeEvent, a as dispatchToastHubEvent, c as checkUsernameAlias, i as isHintValid, h as handlePhoneNumberChange, b as composePhoneNumberInput, g as getRequiredAttributesMap } from './helpers-14fcb50c.js';\nimport { c as checkContact, h as handleSignIn } from './auth-helpers-557b83fc.js';\nvar AmplifyConfirmSignIn = /** @class */ (function () {\n function class_1(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Fires when confirm sign in form is submitted */\n this.handleSubmit = function (event) { return _this.confirm(event); };\n /** Used for header text in confirm sign in component */\n this.headerText = Translations.CONFIRM_SMS_CODE;\n /** Used for the submit button text in confirm sign in component */\n this.submitButtonText = Translations.CONFIRM;\n /** Auth state change handler for this component */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Default form field */\n this.defaultFormFields = [\n {\n type: 'code',\n required: true,\n handleInputChange: function (event) { return _this.handleCodeChange(event); },\n },\n ];\n /**\n * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc.\n * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing\n * text for a label or adjust a placeholder, you can follow the structure below in order to do just that.\n * ```\n * [\n * {\n * type: string,\n * label: string,\n * placeholder: string,\n * hint: string | Functional Component | null,\n * required: boolean\n * }\n * ]\n * ```\n */\n this.formFields = this.defaultFormFields;\n /** The MFA option to confirm with */\n this.mfaOption = MfaOption.SMS;\n /* Whether or not the confirm-sign-in component is loading */\n this.loading = false;\n }\n class_1.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n this.setup();\n };\n class_1.prototype.userHandler = function () {\n this.setup();\n };\n class_1.prototype.setup = function () {\n if (this.user &&\n this.user['challengeName'] === ChallengeName.SoftwareTokenMFA) {\n this.mfaOption = MfaOption.TOTP;\n // If header text is using default use TOTP string\n if (this.headerText === Translations.CONFIRM_SMS_CODE) {\n this.headerText = Translations.CONFIRM_TOTP_CODE;\n }\n }\n this.constructedFormFieldOptions = this.constructFormFieldOptions(this.formFields);\n };\n class_1.prototype.handleCodeChange = function (event) {\n this.code = event.target.value;\n };\n class_1.prototype.confirm = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var mfaType, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n mfaType = this.user['challengeName'] === ChallengeName.SoftwareTokenMFA\n ? ChallengeName.SoftwareTokenMFA\n : null;\n if (!Auth || typeof Auth.confirmSignIn !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, 5, 6]);\n return [4 /*yield*/, Auth.confirmSignIn(this.user, this.code, mfaType)];\n case 2:\n _a.sent();\n return [4 /*yield*/, checkContact(this.user, this.handleAuthStateChange)];\n case 3:\n _a.sent();\n return [3 /*break*/, 6];\n case 4:\n error_1 = _a.sent();\n dispatchToastHubEvent(error_1);\n return [3 /*break*/, 6];\n case 5:\n this.loading = false;\n return [7 /*endfinally*/];\n case 6: return [2 /*return*/];\n }\n });\n });\n };\n class_1.prototype.constructFormFieldOptions = function (formFields) {\n var _this = this;\n var content = [];\n if (formFields === undefined)\n return undefined;\n if (formFields.length <= 0)\n return this.defaultFormFields;\n formFields.forEach(function (formField) {\n if (typeof formField === 'string' || formField.type !== 'code') {\n // This is either a `string`, and/or a custom field that isn't `code`. Pass this directly.\n content.push(formField);\n }\n else {\n // This is a code input field. Attach input handler.\n content.push(Object.assign({ handleInputChange: function (event) { return _this.handleCodeChange(event); } }, formField));\n }\n });\n return content;\n };\n class_1.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: this.handleSubmit, submitButtonText: I18n.get(this.submitButtonText), loading: this.loading, secondaryFooterContent: h(\"span\", null, h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); } }, I18n.get(Translations.BACK_TO_SIGN_IN))) }, h(\"amplify-auth-fields\", { formFields: this.constructedFormFieldOptions }))));\n };\n Object.defineProperty(class_1, \"watchers\", {\n get: function () {\n return {\n \"user\": [\"userHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_1;\n}());\nvar AmplifyConfirmSignUp = /** @class */ (function () {\n function class_2(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Fires when sign up form is submitted */\n this.handleSubmit = function (event) { return _this.confirmSignUp(event); };\n /** Used for header text in confirm sign up component */\n this.headerText = Translations.CONFIRM_SIGN_UP_HEADER_TEXT;\n /** Used for the submit button text in confirm sign up component */\n this.submitButtonText = Translations.CONFIRM_SIGN_UP_SUBMIT_BUTTON_TEXT;\n /**\n * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc.\n * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing\n * text for a label or adjust a placeholder, you can follow the structure below in order to do just that.\n * ```\n * [\n * {\n * type: string,\n * label: string,\n * placeholder: string,\n * hint: string | Functional Component | null,\n * required: boolean\n * }\n * ]\n * ```\n */\n this.formFields = [];\n /** Auth state change handler for this components\n * e.g. SignIn -> 'Create Account' link -> SignUp\n */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */\n this.usernameAlias = 'username';\n this.loading = false;\n this.newFormFields = [];\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: null,\n };\n }\n class_2.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n this.setup();\n };\n class_2.prototype.formFieldsHandler = function () {\n this.buildFormFields();\n };\n class_2.prototype.userHandler = function () {\n this.setup();\n };\n class_2.prototype.setup = function () {\n // TODO: Use optional chaining instead\n this.userInput = this.user && this.user.username;\n this._signUpAttrs = this.user && this.user.signUpAttrs;\n checkUsernameAlias(this.usernameAlias);\n this.buildFormFields();\n };\n class_2.prototype.buildDefaultFormFields = function () {\n var _this = this;\n this.newFormFields = [\n {\n type: \"\" + this.usernameAlias,\n required: true,\n handleInputChange: this.handleFormFieldInputChange(\"\" + this.usernameAlias),\n value: this.userInput,\n disabled: this.userInput ? true : false,\n inputProps: { autocomplete: 'username' },\n },\n {\n type: 'code',\n label: I18n.get(Translations.CONFIRM_SIGN_UP_CODE_LABEL),\n placeholder: I18n.get(Translations.CONFIRM_SIGN_UP_CODE_PLACEHOLDER),\n required: true,\n hint: (h(\"div\", null, I18n.get(Translations.CONFIRM_SIGN_UP_LOST_CODE), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.resendConfirmCode(); } }, I18n.get(Translations.CONFIRM_SIGN_UP_RESEND_CODE)))),\n handleInputChange: this.handleFormFieldInputChange('code'),\n },\n ];\n };\n class_2.prototype.buildFormFields = function () {\n var _this = this;\n if (this.formFields.length === 0) {\n this.buildDefaultFormFields();\n }\n else {\n var newFields_1 = [];\n this.formFields.forEach(function (field) {\n var newField = Object.assign({}, field);\n if (newField.type === 'code') {\n newField['hint'] = isHintValid(newField) ? (h(\"div\", null, I18n.get(Translations.CONFIRM_SIGN_UP_LOST_CODE), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.resendConfirmCode(); } }, I18n.get(Translations.CONFIRM_SIGN_UP_RESEND_CODE)))) : (newField['hint']);\n }\n newField['handleInputChange'] = function (event) { return _this.handleFormFieldInputWithCallback(event, field); };\n newFields_1.push(newField);\n });\n this.newFormFields = newFields_1;\n }\n };\n class_2.prototype.handleFormFieldInputChange = function (fieldType) {\n var _this = this;\n switch (fieldType) {\n case 'username':\n case 'email':\n return function (event) { return (_this.userInput = event.target.value); };\n case 'phone_number':\n return function (event) { return handlePhoneNumberChange(event, _this.phoneNumber); };\n case 'code':\n return function (event) { return (_this.code = event.target.value); };\n default:\n return;\n }\n };\n class_2.prototype.setFieldValue = function (field) {\n switch (field.type) {\n case 'username':\n case 'email':\n if (field.value === undefined) {\n this.userInput = '';\n }\n else {\n this.userInput = field.value;\n }\n break;\n case 'phone_number':\n if (field.dialCode) {\n this.phoneNumber.countryDialCodeValue = field.dialCode;\n }\n this.phoneNumber.phoneNumberValue = field.value;\n break;\n }\n };\n class_2.prototype.handleFormFieldInputWithCallback = function (event, field) {\n var fnToCall = field['handleInputChange']\n ? field['handleInputChange']\n : function (event, cb) {\n cb(event);\n };\n var callback = this.handleFormFieldInputChange(field.type);\n fnToCall(event, callback.bind(this));\n };\n /**\n * Returns the username of the user to confirm. If a valid `user.username` has been passed as a prop, we return that.\n * Otherwise, we return the `userInput` on the form.\n */\n class_2.prototype.getUsername = function () {\n if (this.user && this.user.username)\n return this.user.username;\n switch (this.usernameAlias) {\n case 'username':\n case 'email':\n return this.userInput;\n case 'phone_number':\n return composePhoneNumberInput(this.phoneNumber);\n }\n };\n class_2.prototype.resendConfirmCode = function () {\n return __awaiter(this, void 0, void 0, function () {\n var username, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.resendSignUp !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n username = this.getUsername();\n if (!username)\n throw new Error(Translations.EMPTY_USERNAME);\n return [4 /*yield*/, Auth.resendSignUp(username.trim())];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n error_2 = _a.sent();\n dispatchToastHubEvent(error_2);\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n // TODO: Add validation\n // TODO: Prefix\n class_2.prototype.confirmSignUp = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var username, confirmSignUpResult, error_3;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.confirmSignUp !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 6, 7, 8]);\n username = this.getUsername();\n if (!username)\n throw new Error(Translations.EMPTY_USERNAME);\n username = username.trim();\n return [4 /*yield*/, Auth.confirmSignUp(username, this.code)];\n case 2:\n confirmSignUpResult = _a.sent();\n if (!confirmSignUpResult) {\n throw new Error(I18n.get(Translations.CONFIRM_SIGN_UP_FAILED));\n }\n if (!(this._signUpAttrs &&\n this._signUpAttrs.password &&\n this._signUpAttrs.password !== '')) return [3 /*break*/, 4];\n // Auto sign in user if password is available from previous workflow\n return [4 /*yield*/, handleSignIn(username, this._signUpAttrs.password, this.handleAuthStateChange)];\n case 3:\n // Auto sign in user if password is available from previous workflow\n _a.sent();\n return [3 /*break*/, 5];\n case 4:\n this.handleAuthStateChange(AuthState.SignIn);\n _a.label = 5;\n case 5: return [3 /*break*/, 8];\n case 6:\n error_3 = _a.sent();\n dispatchToastHubEvent(error_3);\n return [3 /*break*/, 8];\n case 7:\n this.loading = false;\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/];\n }\n });\n });\n };\n class_2.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), submitButtonText: I18n.get(this.submitButtonText), handleSubmit: this.handleSubmit, loading: this.loading, secondaryFooterContent: h(\"div\", null, h(\"span\", null, h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); } }, I18n.get(Translations.BACK_TO_SIGN_IN)))) }, h(\"amplify-auth-fields\", { formFields: this.newFormFields }))));\n };\n Object.defineProperty(class_2, \"watchers\", {\n get: function () {\n return {\n \"formFields\": [\"formFieldsHandler\"],\n \"user\": [\"userHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_2;\n}());\nvar logger = new Logger('ForgotPassword');\nvar AmplifyForgotPassword = /** @class */ (function () {\n function class_3(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** The header text of the forgot password section */\n this.headerText = Translations.RESET_YOUR_PASSWORD;\n /** The text displayed inside of the send code button for the form */\n this.sendButtonText = Translations.SEND_CODE;\n /** The text displayed inside of the submit button for the form */\n this.submitButtonText = Translations.SUBMIT;\n /** The form fields displayed inside of the forgot password form */\n this.formFields = [];\n /** The function called when making a request to reset password */\n this.handleSend = function (event) { return _this.send(event); };\n /** The function called when submitting a new password */\n this.handleSubmit = function (event) { return _this.submit(event); };\n /** Auth state change handler for this component */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */\n this.usernameAlias = 'username';\n this.delivery = null;\n this.loading = false;\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: null,\n };\n this.newFormFields = [];\n this.forgotPasswordAttrs = {\n userInput: '',\n password: '',\n code: '',\n };\n }\n class_3.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n checkUsernameAlias(this.usernameAlias);\n this.buildFormFields();\n };\n class_3.prototype.formFieldsHandler = function () {\n this.buildFormFields();\n };\n class_3.prototype.buildFormFields = function () {\n var _this = this;\n if (this.formFields.length === 0) {\n this.buildDefaultFormFields();\n }\n else {\n var newFields_2 = [];\n this.formFields.forEach(function (field) {\n var newField = Object.assign({}, field);\n newField['handleInputChange'] = function (event) { return _this.handleFormFieldInputWithCallback(event, field); };\n newFields_2.push(newField);\n });\n this.newFormFields = newFields_2;\n }\n };\n class_3.prototype.buildDefaultFormFields = function () {\n switch (this.usernameAlias) {\n case 'email':\n this.newFormFields = [\n {\n type: 'email',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'forgot-password-email-input',\n },\n },\n ];\n break;\n case 'phone_number':\n this.newFormFields = [\n {\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'forgot-password-phone-number-input',\n },\n },\n ];\n break;\n case 'username':\n default:\n this.newFormFields = [\n {\n type: 'username',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('username'),\n inputProps: {\n 'data-test': 'forgot-password-username-input',\n },\n },\n ];\n break;\n }\n };\n class_3.prototype.handleFormFieldInputChange = function (fieldType) {\n var _this = this;\n switch (fieldType) {\n case 'username':\n case 'email':\n return function (event) { return (_this.forgotPasswordAttrs.userInput = event.target.value); };\n case 'phone_number':\n return function (event) { return handlePhoneNumberChange(event, _this.phoneNumber); };\n case 'password':\n case 'code':\n return function (event) { return (_this.forgotPasswordAttrs[fieldType] = event.target.value); };\n default:\n return;\n }\n };\n class_3.prototype.setFieldValue = function (field, formAttributes) {\n switch (field.type) {\n case 'username':\n case 'email':\n if (field.value === undefined) {\n formAttributes.userInput = '';\n }\n else {\n formAttributes.userInput = field.value;\n }\n break;\n case 'phone_number':\n if (field.dialCode) {\n this.phoneNumber.countryDialCodeValue = field.dialCode;\n }\n this.phoneNumber.phoneNumberValue = field.value;\n break;\n case 'password':\n case 'code':\n if (field.value === undefined) {\n formAttributes[field.type] = '';\n }\n else {\n formAttributes[field.type] = field.value;\n }\n break;\n }\n };\n class_3.prototype.handleFormFieldInputWithCallback = function (event, field) {\n var fnToCall = field['handleInputChange']\n ? field['handleInputChange']\n : function (event, cb) {\n cb(event);\n };\n var callback = this.handleFormFieldInputChange(field.type);\n fnToCall(event, callback.bind(this));\n };\n class_3.prototype.send = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var data, error_4;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.forgotPassword !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n switch (this.usernameAlias) {\n case 'phone_number':\n try {\n this.forgotPasswordAttrs.userInput = composePhoneNumberInput(this.phoneNumber);\n }\n catch (error) {\n dispatchToastHubEvent(error);\n }\n break;\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, 4, 5]);\n return [4 /*yield*/, Auth.forgotPassword(this.forgotPasswordAttrs.userInput.trim())];\n case 2:\n data = _a.sent();\n logger.debug(data);\n this.newFormFields = [\n {\n type: 'code',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('code'),\n inputProps: {\n 'data-test': 'forgot-password-code-input',\n },\n },\n {\n type: 'password',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n label: I18n.get(Translations.NEW_PASSWORD_LABEL),\n placeholder: I18n.get(Translations.NEW_PASSWORD_PLACEHOLDER),\n },\n ];\n this.delivery = data.CodeDeliveryDetails;\n return [3 /*break*/, 5];\n case 3:\n error_4 = _a.sent();\n dispatchToastHubEvent(error_4);\n return [3 /*break*/, 5];\n case 4:\n this.loading = false;\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n class_3.prototype.submit = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, userInput, code, password, data, error_5;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.forgotPasswordSubmit !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 3, 4, 5]);\n _a = this.forgotPasswordAttrs, userInput = _a.userInput, code = _a.code, password = _a.password;\n return [4 /*yield*/, Auth.forgotPasswordSubmit(userInput.trim(), code, password)];\n case 2:\n data = _b.sent();\n logger.debug(data);\n this.handleAuthStateChange(AuthState.SignIn);\n this.delivery = null;\n return [3 /*break*/, 5];\n case 3:\n error_5 = _b.sent();\n dispatchToastHubEvent(error_5);\n return [3 /*break*/, 5];\n case 4:\n this.loading = false;\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n class_3.prototype.render = function () {\n var _this = this;\n var submitFn = this.delivery\n ? function (event) { return _this.handleSubmit(event); }\n : function (event) { return _this.handleSend(event); };\n var submitButtonText = this.delivery\n ? this.submitButtonText\n : this.sendButtonText;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: submitFn, loading: this.loading, secondaryFooterContent: h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); }, \"data-test\": \"forgot-password-back-to-sign-in-link\" }, I18n.get(Translations.BACK_TO_SIGN_IN)), testDataPrefix: 'forgot-password', submitButtonText: I18n.get(submitButtonText) }, h(\"amplify-auth-fields\", { formFields: this.newFormFields }))));\n };\n Object.defineProperty(class_3, \"watchers\", {\n get: function () {\n return {\n \"formFields\": [\"formFieldsHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_3;\n}());\nvar logger$1 = new ConsoleLogger('amplify-require-new-password');\nvar AmplifyRequireNewPassword = /** @class */ (function () {\n function class_4(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** The header text of the forgot password section */\n this.headerText = Translations.CHANGE_PASSWORD;\n /** The text displayed inside of the submit button for the form */\n this.submitButtonText = Translations.CHANGE_PASSWORD_ACTION;\n /** The function called when submitting a new password */\n this.handleSubmit = function (event) { return _this.completeNewPassword(event); };\n /** Auth state change handler for this component */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** The form fields displayed inside of the forgot password form */\n this.formFields = [\n {\n type: AuthFormField.Password,\n required: true,\n handleInputChange: function (event) { return _this.handlePasswordChange(event); },\n label: I18n.get(Translations.NEW_PASSWORD_LABEL),\n placeholder: I18n.get(Translations.NEW_PASSWORD_PLACEHOLDER),\n inputProps: {\n 'data-test': 'require-new-password-password-input',\n },\n },\n ];\n this.loading = false;\n this.requiredAttributes = {};\n this.newFormFields = this.formFields;\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: ' ',\n };\n }\n class_4.prototype.userHandler = function () {\n this.setCurrentUser();\n };\n class_4.prototype.handleRequiredAttributeInputChange = function (attribute, event) {\n if (attribute === 'phone_number') {\n this.formatPhoneNumber(event);\n }\n else {\n this.requiredAttributes[attribute] = event.target.value;\n }\n };\n class_4.prototype.setCurrentUser = function () {\n return __awaiter(this, void 0, void 0, function () {\n var user, error_6, userRequiredAttributes, requiredAttributesMap_1;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!this.user) return [3 /*break*/, 5];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, Auth.currentAuthenticatedUser()];\n case 2:\n user = _a.sent();\n if (user)\n this.currentUser = user;\n return [3 /*break*/, 4];\n case 3:\n error_6 = _a.sent();\n dispatchToastHubEvent(error_6);\n return [3 /*break*/, 4];\n case 4: return [3 /*break*/, 6];\n case 5:\n this.currentUser = this.user;\n _a.label = 6;\n case 6:\n if (this.currentUser &&\n this.currentUser.challengeParam &&\n this.currentUser.challengeParam.requiredAttributes) {\n userRequiredAttributes = this.currentUser.challengeParam\n .requiredAttributes;\n requiredAttributesMap_1 = getRequiredAttributesMap();\n userRequiredAttributes.forEach(function (attribute) {\n var formField = {\n type: attribute,\n required: true,\n label: requiredAttributesMap_1[attribute].label,\n placeholder: requiredAttributesMap_1[attribute].placeholder,\n handleInputChange: function (event) { return _this.handleRequiredAttributeInputChange(attribute, event); },\n inputProps: {\n 'data-test': \"require-new-password-\" + attribute + \"-input\",\n },\n };\n _this.newFormFields = __spreadArrays(_this.newFormFields, [formField]);\n });\n }\n return [2 /*return*/];\n }\n });\n });\n };\n class_4.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n return this.setCurrentUser();\n };\n class_4.prototype.handlePasswordChange = function (event) {\n this.password = event.target.value;\n };\n class_4.prototype.formatPhoneNumber = function (event) {\n handlePhoneNumberChange(event, this.phoneNumber);\n /**\n * composePhoneNumberInput will throw an error if the phoneNumberValue it receives\n * is empty. Adding a check here to try and make sure that doesn't happen...but will\n * wrap it in a try/catch block just in case as well\n */\n try {\n if (event.target.name === PHONE_SUFFIX &&\n this.phoneNumber.phoneNumberValue) {\n var composedInput = composePhoneNumberInput(this.phoneNumber);\n this.requiredAttributes['phone_number'] = composedInput;\n }\n }\n catch (err) {\n logger$1.error(\"error in phone number field - \" + err);\n }\n };\n class_4.prototype.completeNewPassword = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var user, _a, error_7;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.completeNewPassword !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 8, 9, 10]);\n return [4 /*yield*/, Auth.completeNewPassword(this.currentUser, this.password, this.requiredAttributes)];\n case 2:\n user = _b.sent();\n logger$1.debug('complete new password', user);\n _a = user.challengeName;\n switch (_a) {\n case ChallengeName.SMSMFA: return [3 /*break*/, 3];\n case ChallengeName.MFASetup: return [3 /*break*/, 4];\n }\n return [3 /*break*/, 5];\n case 3:\n this.handleAuthStateChange(AuthState.ConfirmSignIn, user);\n return [3 /*break*/, 7];\n case 4:\n logger$1.debug('TOTP setup', user.challengeParam);\n this.handleAuthStateChange(AuthState.TOTPSetup, user);\n return [3 /*break*/, 7];\n case 5: return [4 /*yield*/, checkContact(user, this.handleAuthStateChange)];\n case 6:\n _b.sent();\n _b.label = 7;\n case 7: return [3 /*break*/, 10];\n case 8:\n error_7 = _b.sent();\n dispatchToastHubEvent(error_7);\n return [3 /*break*/, 10];\n case 9:\n this.loading = false;\n return [7 /*endfinally*/];\n case 10: return [2 /*return*/];\n }\n });\n });\n };\n class_4.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: this.handleSubmit, loading: this.loading, secondaryFooterContent: h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); } }, I18n.get(Translations.BACK_TO_SIGN_IN)), submitButtonText: I18n.get(this.submitButtonText) }, h(\"amplify-auth-fields\", { formFields: this.newFormFields }))));\n };\n Object.defineProperty(class_4, \"watchers\", {\n get: function () {\n return {\n \"user\": [\"userHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_4;\n}());\nvar amplifySignInCss = \":host{--footer-size:var(--amplify-text-sm);--footer-color:var(--amplify-grey);--footer-font-family:var(--amplify-font-family);--font-weight:var(--amplify-font-weight)}.sign-in-form-footer{font-family:var(--footer-font-family);font-size:var(--footer-size);color:var(--footer-color);font-weight:--font-weight;display:-ms-flexbox;display:flex;-ms-flex-direction:column-reverse;flex-direction:column-reverse;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.sign-in-form-footer amplify-button{margin-bottom:0.625rem}@media (min-width: 672px){.sign-in-form-footer{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline}.sign-in-form-footer amplify-button{margin-bottom:0}}.sign-in-form-footer *+*{margin-bottom:15px}.full-width-footer-content{width:100%}\";\nvar AmplifySignIn = /** @class */ (function () {\n function class_5(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Fires when sign in form is submitted */\n this.handleSubmit = function (event) { return _this.signIn(event); };\n /** Used for header text in sign in component */\n this.headerText = Translations.SIGN_IN_HEADER_TEXT;\n /** Used for the submit button text in sign in component */\n this.submitButtonText = Translations.SIGN_IN_ACTION;\n /** Auth state change handler for this component */\n // prettier-ignore\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */\n this.usernameAlias = 'username';\n /**\n * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc.\n * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing\n * text for a label or adjust a placeholder, you can follow the structure below in order to do just that.\n * ```\n * [\n * {\n * type: string,\n * label: string,\n * placeholder: string,\n * hint: string | Functional Component | null,\n * required: boolean\n * }\n * ]\n * ```\n */\n this.formFields = [];\n /** Hides the sign up link */\n this.hideSignUp = false;\n this.newFormFields = [];\n /* Whether or not the sign-in component is loading */\n this.loading = false;\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: null,\n };\n this.signInAttributes = {\n userInput: '',\n password: '',\n };\n }\n class_5.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n checkUsernameAlias(this.usernameAlias);\n this.buildFormFields();\n };\n class_5.prototype.formFieldsHandler = function () {\n this.buildFormFields();\n };\n class_5.prototype.handleFormFieldInputChange = function (fieldType) {\n var _this = this;\n switch (fieldType) {\n case 'username':\n case 'email':\n return function (event) { return (_this.signInAttributes.userInput = event.target.value); };\n case 'phone_number':\n return function (event) { return handlePhoneNumberChange(event, _this.phoneNumber); };\n case 'password':\n return function (event) { return (_this.signInAttributes.password = event.target.value); };\n default:\n return function () { };\n }\n };\n class_5.prototype.handleFormFieldInputWithCallback = function (event, field) {\n var fnToCall = field['handleInputChange']\n ? field['handleInputChange']\n : function (event, cb) {\n cb(event);\n };\n var callback = this.handleFormFieldInputChange(field.type);\n fnToCall(event, callback.bind(this));\n };\n class_5.prototype.signIn = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var username;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // avoid submitting the form\n if (event) {\n event.preventDefault();\n }\n this.loading = true;\n switch (this.usernameAlias) {\n case 'phone_number':\n try {\n this.signInAttributes.userInput = composePhoneNumberInput(this.phoneNumber);\n }\n catch (error) {\n dispatchToastHubEvent(error);\n }\n }\n username = this.signInAttributes.userInput.trim();\n return [4 /*yield*/, handleSignIn(username, this.signInAttributes.password, this.handleAuthStateChange, this.usernameAlias)];\n case 1:\n _a.sent();\n this.loading = false;\n return [2 /*return*/];\n }\n });\n });\n };\n class_5.prototype.buildDefaultFormFields = function () {\n var _this = this;\n var formFieldInputs = [];\n switch (this.usernameAlias) {\n case 'email':\n formFieldInputs.push({\n type: 'email',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'sign-in-email-input',\n autocomplete: 'username',\n },\n });\n break;\n case 'phone_number':\n formFieldInputs.push({\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'sign-in-phone-number-input',\n autocomplete: 'username',\n },\n });\n break;\n case 'username':\n default:\n formFieldInputs.push({\n type: 'username',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('username'),\n inputProps: {\n 'data-test': 'sign-in-username-input',\n autocomplete: 'username',\n },\n });\n break;\n }\n formFieldInputs.push({\n type: 'password',\n hint: (h(\"div\", null, I18n.get(Translations.FORGOT_PASSWORD_TEXT), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.ForgotPassword); }, \"data-test\": \"sign-in-forgot-password-link\" }, I18n.get(Translations.RESET_PASSWORD_TEXT)))),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n inputProps: {\n 'data-test': 'sign-in-password-input',\n },\n });\n this.newFormFields = __spreadArrays(formFieldInputs);\n };\n class_5.prototype.buildFormFields = function () {\n var _this = this;\n if (this.formFields.length === 0) {\n this.buildDefaultFormFields();\n }\n else {\n var newFields_3 = [];\n this.formFields.forEach(function (field) {\n var newField = Object.assign({}, field);\n // TODO: handle hint better\n if (newField.type === 'password') {\n newField['hint'] = isHintValid(newField) ? (h(\"div\", null, I18n.get(Translations.FORGOT_PASSWORD_TEXT), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.ForgotPassword); }, \"data-test\": \"sign-in-forgot-password-link\" }, I18n.get(Translations.RESET_PASSWORD_TEXT)))) : (newField['hint']);\n }\n newField['handleInputChange'] = function (event) { return _this.handleFormFieldInputWithCallback(event, field); };\n _this.setFieldValue(newField, _this.signInAttributes);\n newFields_3.push(newField);\n });\n this.newFormFields = newFields_3;\n }\n };\n class_5.prototype.setFieldValue = function (field, formAttributes) {\n switch (field.type) {\n case 'username':\n case 'email':\n if (field.value === undefined) {\n formAttributes.userInput = '';\n }\n else {\n formAttributes.userInput = field.value;\n }\n break;\n case 'phone_number':\n if (field.dialCode) {\n this.phoneNumber.countryDialCodeValue = field.dialCode;\n }\n this.phoneNumber.phoneNumberValue = field.value;\n break;\n case 'password':\n if (field.value === undefined) {\n formAttributes.password = '';\n }\n else {\n formAttributes.password = field.value;\n }\n break;\n }\n };\n class_5.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: this.handleSubmit, testDataPrefix: 'sign-in' }, h(\"div\", { slot: \"subtitle\" }, h(\"slot\", { name: \"header-subtitle\" })), h(\"slot\", { name: \"federated-buttons\" }, h(\"amplify-federated-buttons\", { handleAuthStateChange: this.handleAuthStateChange, federated: this.federated })), !isEmpty(this.federated) && h(\"amplify-strike\", null, \"or\"), h(\"amplify-auth-fields\", { formFields: this.newFormFields }), h(\"div\", { slot: \"amplify-form-section-footer\", class: \"sign-in-form-footer\" }, h(\"slot\", { name: \"footer\" }, !this.hideSignUp && (h(\"slot\", { name: \"secondary-footer-content\" }, h(\"span\", null, I18n.get(Translations.NO_ACCOUNT_TEXT), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignUp); }, \"data-test\": \"sign-in-create-account-link\" }, I18n.get(Translations.CREATE_ACCOUNT_TEXT))))), h(\"div\", { class: this.hideSignUp ? 'full-width-footer-content' : '' }, h(\"slot\", { name: \"primary-footer-content\" }, h(\"amplify-button\", { type: \"submit\", disabled: this.loading, \"data-test\": \"sign-in-sign-in-button\" }, this.loading ? (h(\"amplify-loading-spinner\", null)) : (h(\"span\", null, I18n.get(this.submitButtonText)))))))))));\n };\n Object.defineProperty(class_5, \"watchers\", {\n get: function () {\n return {\n \"formFields\": [\"formFieldsHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_5;\n}());\nAmplifySignIn.style = amplifySignInCss;\nvar amplifySignUpCss = \"amplify-sign-up{--footer-font-family:var(--amplify-font-family);--footer-font-size:var(--amplify-text-sm);--footer-color:var(--amplify-grey);--font-weight:var(--amplify-font-weight)}.sign-up-form-footer{font-family:var(--footer-font-family);font-size:var(--footer-font-size);color:var(--footer-color);font-weight:--font-weight;display:-ms-flexbox;display:flex;-ms-flex-direction:column-reverse;flex-direction:column-reverse;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.sign-up-form-footer amplify-button{margin-bottom:0.625rem}@media (min-width: 672px){.sign-up-form-footer{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline}.sign-up-form-footer amplify-button{margin-bottom:0}}.sign-up-form-footer *+*{margin-bottom:15px}\";\nvar AmplifySignUp = /** @class */ (function () {\n function class_6(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Fires when sign up form is submitted */\n this.handleSubmit = function (event) { return _this.signUp(event); };\n /** Override for handling the Auth.SignUp API call */\n this.handleSignUp = function (params) { return _this.authSignUp(params); };\n /** Used for header text in sign up component */\n this.headerText = Translations.SIGN_UP_HEADER_TEXT;\n /** Used for the submit button text in sign up component */\n this.submitButtonText = Translations.SIGN_UP_SUBMIT_BUTTON_TEXT;\n /** Used for the submit button text in sign up component */\n this.haveAccountText = Translations.SIGN_UP_HAVE_ACCOUNT_TEXT;\n /** Text used for the sign in hyperlink */\n this.signInText = Translations.SIGN_IN_TEXT;\n /**\n * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc.\n * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing\n * text for a label or adjust a placeholder, you can follow the structure below in order to do just that.\n * ```\n * [\n * {\n * type: string,\n * label: string,\n * placeholder: string,\n * hint: string | Functional Component | null,\n * required: boolean\n * }\n * ]\n * ```\n */\n this.formFields = [];\n /** Auth state change handler for this component\n * e.g. SignIn -> 'Create Account' link -> SignUp\n */\n // prettier-ignore\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */\n this.usernameAlias = 'username';\n // private userInput: string | PhoneNumberInterface;\n this.newFormFields = [];\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: null,\n };\n this.loading = false;\n this.signUpAttributes = {\n username: '',\n password: '',\n attributes: {},\n };\n }\n class_6.prototype.handleFormFieldInputChange = function (fieldType) {\n var _this = this;\n switch (fieldType) {\n case 'username':\n return function (event) { return (_this.signUpAttributes.username = event.target.value); };\n case 'password':\n return function (event) { return (_this.signUpAttributes.password = event.target.value); };\n case 'email':\n return function (event) { return (_this.signUpAttributes.attributes.email = event.target.value); };\n case 'phone_number':\n return function (event) { return handlePhoneNumberChange(event, _this.phoneNumber); };\n default:\n return function (event) { return (_this.signUpAttributes.attributes[fieldType] = event.target.value); };\n }\n };\n class_6.prototype.handleFormFieldInputWithCallback = function (event, field) {\n var fnToCall = field['handleInputChange']\n ? field['handleInputChange']\n : function (event, cb) {\n cb(event);\n };\n var callback = this.handleFormFieldInputChange(field.type);\n fnToCall(event, callback.bind(this));\n };\n class_6.prototype.authSignUp = function (params) {\n return __awaiter(this, void 0, void 0, function () {\n var data;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, Auth.signUp(params)];\n case 1:\n data = _a.sent();\n if (!data) {\n throw new Error(Translations.SIGN_UP_FAILED);\n }\n return [2 /*return*/, data];\n }\n });\n });\n };\n class_6.prototype.assignPhoneNumberToSignUpAttributes = function () {\n if (this.phoneNumber.phoneNumberValue) {\n try {\n this.signUpAttributes.attributes.phone_number = composePhoneNumberInput(this.phoneNumber);\n }\n catch (error) {\n dispatchToastHubEvent(error);\n }\n }\n };\n class_6.prototype.assignUserNameAliasToSignUpAttributes = function () {\n switch (this.usernameAlias) {\n case 'email':\n case 'phone_number':\n this.signUpAttributes.username = this.signUpAttributes.attributes[this.usernameAlias];\n break;\n }\n };\n class_6.prototype.assignFormInputToSignUpAttributes = function () {\n this.assignPhoneNumberToSignUpAttributes();\n this.assignUserNameAliasToSignUpAttributes();\n };\n class_6.prototype.validateSignUpAttributes = function () {\n if (!this.signUpAttributes.username) {\n if (this.usernameAlias === UsernameAlias.email) {\n throw new Error(Translations.EMPTY_EMAIL);\n }\n else if (this.usernameAlias === UsernameAlias.phone_number) {\n throw new Error(Translations.EMPTY_PHONE);\n }\n else {\n throw new Error(Translations.EMPTY_USERNAME);\n }\n }\n if (this.signUpAttributes.username.indexOf(' ') >= 0) {\n throw new Error(Translations.USERNAME_REMOVE_WHITESPACE);\n }\n if (this.signUpAttributes.password !== this.signUpAttributes.password.trim()) {\n throw new Error(Translations.PASSWORD_REMOVE_WHITESPACE);\n }\n };\n // TODO: Add validation\n // TODO: Prefix\n class_6.prototype.signUp = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var data, signUpAttrs, error_8;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.signUp !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n this.assignFormInputToSignUpAttributes();\n _a.label = 1;\n case 1:\n _a.trys.push([1, 6, 7, 8]);\n this.validateSignUpAttributes();\n return [4 /*yield*/, this.handleSignUp(this.signUpAttributes)];\n case 2:\n data = _a.sent();\n if (!data.userConfirmed) return [3 /*break*/, 4];\n return [4 /*yield*/, handleSignIn(this.signUpAttributes.username, this.signUpAttributes.password, this.handleAuthStateChange)];\n case 3:\n _a.sent();\n return [3 /*break*/, 5];\n case 4:\n signUpAttrs = Object.assign({}, this.signUpAttributes);\n this.handleAuthStateChange(AuthState.ConfirmSignUp, Object.assign(Object.assign({}, data.user), { signUpAttrs: signUpAttrs }));\n _a.label = 5;\n case 5: return [3 /*break*/, 8];\n case 6:\n error_8 = _a.sent();\n dispatchToastHubEvent(error_8);\n return [3 /*break*/, 8];\n case 7:\n this.loading = false;\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/];\n }\n });\n });\n };\n class_6.prototype.buildDefaultFormFields = function () {\n switch (this.usernameAlias) {\n case 'email':\n this.newFormFields = [\n {\n type: 'email',\n placeholder: I18n.get(Translations.SIGN_UP_EMAIL_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'sign-up-email-input',\n autocomplete: 'username',\n },\n },\n {\n type: 'password',\n placeholder: I18n.get(Translations.SIGN_UP_PASSWORD_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n inputProps: {\n 'data-test': 'sign-up-password-input',\n autocomplete: 'new-password',\n },\n },\n {\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'sign-up-phone-number-input',\n autocomplete: 'tel-national',\n },\n },\n ];\n break;\n case 'phone_number':\n this.newFormFields = [\n {\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'sign-up-phone-number-input',\n autocomplete: 'username',\n },\n },\n {\n type: 'password',\n placeholder: I18n.get(Translations.SIGN_UP_PASSWORD_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n inputProps: {\n 'data-test': 'sign-up-password-input',\n autocomplete: 'new-password',\n },\n },\n {\n type: 'email',\n placeholder: I18n.get(Translations.SIGN_UP_EMAIL_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'sign-up-email-input',\n autocomplete: 'email',\n },\n },\n ];\n break;\n case 'username':\n default:\n this.newFormFields = [\n {\n type: 'username',\n placeholder: I18n.get(Translations.SIGN_UP_USERNAME_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('username'),\n inputProps: {\n 'data-test': 'sign-up-username-input',\n autocomplete: 'username',\n },\n },\n {\n type: 'password',\n placeholder: I18n.get(Translations.SIGN_UP_PASSWORD_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n inputProps: {\n 'data-test': 'sign-up-password-input',\n autocomplete: 'new-password',\n },\n },\n {\n type: 'email',\n placeholder: I18n.get(Translations.SIGN_UP_EMAIL_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'sign-up-email-input',\n },\n },\n {\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'sign-up-phone-number-input',\n },\n },\n ];\n break;\n }\n };\n class_6.prototype.buildFormFields = function () {\n var _this = this;\n if (this.formFields.length === 0) {\n this.buildDefaultFormFields();\n }\n else {\n var newFields_4 = [];\n this.formFields.forEach(function (field) {\n var newField = Object.assign({}, field);\n newField['handleInputChange'] = function (event) { return _this.handleFormFieldInputWithCallback(event, field); };\n _this.setFieldValue(field, _this.signUpAttributes);\n newFields_4.push(newField);\n });\n this.newFormFields = newFields_4;\n }\n };\n class_6.prototype.setFieldValue = function (field, formAttributes) {\n switch (field.type) {\n case 'username':\n if (field.value === undefined) {\n formAttributes.username = '';\n }\n else {\n formAttributes.username = field.value;\n }\n break;\n case 'password':\n if (field.value === undefined) {\n formAttributes.password = '';\n }\n else {\n formAttributes.password = field.value;\n }\n break;\n case 'email':\n formAttributes.attributes.email = field.value;\n break;\n case 'phone_number':\n if (field.dialCode) {\n this.phoneNumber.countryDialCodeValue = field.dialCode;\n }\n this.phoneNumber.phoneNumberValue = field.value;\n break;\n default:\n formAttributes.attributes[field.type] = field.value;\n break;\n }\n };\n class_6.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n checkUsernameAlias(this.usernameAlias);\n this.buildFormFields();\n };\n class_6.prototype.formFieldsHandler = function () {\n this.buildFormFields();\n };\n class_6.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: this.handleSubmit, testDataPrefix: 'sign-up' }, h(\"div\", { slot: \"subtitle\" }, h(\"slot\", { name: \"header-subtitle\" })), h(\"amplify-auth-fields\", { formFields: this.newFormFields }), h(\"div\", { class: \"sign-up-form-footer\", slot: \"amplify-form-section-footer\" }, h(\"slot\", { name: \"footer\" }, h(\"slot\", { name: \"secondary-footer-content\" }, h(\"span\", null, I18n.get(this.haveAccountText), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); }, \"data-test\": \"sign-up-sign-in-link\" }, I18n.get(this.signInText)))), h(\"slot\", { name: \"primary-footer-content\" }, h(\"amplify-button\", { type: \"submit\", \"data-test\": \"sign-up-create-account-button\", disabled: this.loading }, this.loading ? (h(\"amplify-loading-spinner\", null)) : (h(\"span\", null, I18n.get(this.submitButtonText))))))))));\n };\n Object.defineProperty(class_6, \"watchers\", {\n get: function () {\n return {\n \"formFields\": [\"formFieldsHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_6;\n}());\nAmplifySignUp.style = amplifySignUpCss;\nvar logger$2 = new Logger('AmplifyVerifyContact');\nvar AmplifyVerifyContact = /** @class */ (function () {\n function class_7(hostRef) {\n registerInstance(this, hostRef);\n /** Authentication state handler */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n this.loading = false;\n }\n class_7.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n };\n class_7.prototype.handleSubmit = function (event) {\n event.preventDefault();\n this.verifyAttr ? this.submit(this.code) : this.verify(this.contact);\n };\n class_7.prototype.submit = function (code) {\n return __awaiter(this, void 0, void 0, function () {\n var attr, data, error_9;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n attr = this.verifyAttr;\n if (!Auth || typeof Auth.verifyCurrentUserAttributeSubmit !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, 4, 5]);\n return [4 /*yield*/, Auth.verifyCurrentUserAttributeSubmit(attr, code)];\n case 2:\n data = _a.sent();\n logger$2.debug(data);\n this.handleAuthStateChange(AuthState.SignedIn, this.user);\n this.verifyAttr = null;\n return [3 /*break*/, 5];\n case 3:\n error_9 = _a.sent();\n dispatchToastHubEvent(error_9);\n logger$2.error(error_9);\n return [3 /*break*/, 5];\n case 4:\n this.loading = false;\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n class_7.prototype.verify = function (contact) {\n return __awaiter(this, void 0, void 0, function () {\n var data, error_10;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!contact) {\n logger$2.error('Neither Email nor Phone Number selected');\n return [2 /*return*/];\n }\n if (!Auth || typeof Auth.verifyCurrentUserAttribute !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, 4, 5]);\n return [4 /*yield*/, Auth.verifyCurrentUserAttribute(contact)];\n case 2:\n data = _a.sent();\n logger$2.debug(data);\n this.verifyAttr = contact;\n return [3 /*break*/, 5];\n case 3:\n error_10 = _a.sent();\n dispatchToastHubEvent(error_10);\n logger$2.error(error_10);\n return [3 /*break*/, 5];\n case 4:\n this.loading = false;\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n class_7.prototype.handleInputChange = function (event) {\n var inputName = event.target.name;\n if (inputName === 'code') {\n this.code = event.target.value;\n }\n else if (inputName === 'contact') {\n this.contact = event.target.value;\n }\n };\n class_7.prototype.renderSubmit = function () {\n var _this = this;\n return (h(\"div\", null, h(\"amplify-input\", { inputProps: {\n autocomplete: 'off',\n 'data-test': 'verify-contact-code-input',\n }, name: \"code\", placeholder: I18n.get(Translations.CODE_PLACEHOLDER), handleInputChange: function (event) { return _this.handleInputChange(event); } })));\n };\n class_7.prototype.renderVerify = function () {\n var _this = this;\n var user = this.user;\n if (!user) {\n logger$2.debug('No user to verify');\n return null;\n }\n var unverified = user.unverified;\n if (!unverified) {\n logger$2.debug('Unverified variable does not exist on user');\n return null;\n }\n var email = unverified.email, phone_number = unverified.phone_number;\n return (h(\"div\", null, email && (h(\"amplify-radio-button\", { label: I18n.get(Translations.VERIFY_CONTACT_EMAIL_LABEL), key: \"email\", name: \"contact\", value: \"email\", handleInputChange: function (event) { return _this.handleInputChange(event); }, inputProps: {\n 'data-test': 'verify-contact-email-radio',\n } })), phone_number && (h(\"amplify-radio-button\", { label: I18n.get(Translations.VERIFY_CONTACT_PHONE_LABEL), key: \"phone_number\", name: \"contact\", value: \"phone_number\", handleInputChange: function (event) { return _this.handleInputChange(event); }, inputProps: {\n 'data-test': 'verify-contact-phone-number-radio',\n } }))));\n };\n class_7.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { handleSubmit: function (event) { return _this.handleSubmit(event); }, headerText: I18n.get(Translations.VERIFY_CONTACT_HEADER_TEXT), loading: this.loading, secondaryFooterContent: h(\"span\", null, h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignedIn, _this.user); }, \"data-test\": \"verify-contact-skip-link\" }, I18n.get(Translations.SKIP))), submitButtonText: this.verifyAttr\n ? I18n.get(Translations.VERIFY_CONTACT_SUBMIT_LABEL)\n : I18n.get(Translations.VERIFY_CONTACT_VERIFY_LABEL) }, this.verifyAttr ? this.renderSubmit() : this.renderVerify())));\n };\n return class_7;\n}());\nexport { AmplifyConfirmSignIn as amplify_confirm_sign_in, AmplifyConfirmSignUp as amplify_confirm_sign_up, AmplifyForgotPassword as amplify_forgot_password, AmplifyRequireNewPassword as amplify_require_new_password, AmplifySignIn as amplify_sign_in, AmplifySignUp as amplify_sign_up, AmplifyVerifyContact as amplify_verify_contact };\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":""}