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CAET,CACA,MAAMsW,EAAmB,CACrB,cAAe,gBACf,YAAa,cACb,UAAW,YACX,WAAY,YAChB,EACA,SAASzY,EAAgB/K,EAAQ,CAC7B,OAAOA,GAAQ,aAAeA,GAAQ,OAC1C,CACA,SAASsjB,EAAgCtjB,EAAQ,CAC7C,OAAO+K,EAAgB/K,CAAM,GAAKA,GAAQ,YAC9C,CACA,SAASqjB,EAAqCrjB,EAAQ,CAClD,OAAO+K,EAAgB/K,CAAM,GAAK,CAACA,GAAQ,YAC/C,C,mCC3EA,SAASyjB,EAAmB,CAAE,SAAAzlB,EAAU,WAAAhB,EAAY,iBAAAc,CAAkB,EAAG,CACrE,GAAI,OAAO,OAAW,IAClB,OAEJ,MAAM4lB,EAAoC,OACrC,kCACL,GAAI,OAAOA,EAAsC,IAC7C,OAEJ,MAAMC,EAAuBD,EAAkC,QAAQ1lB,EAAUhB,EAAYc,CAAgB,EAC7G,OAAI6lB,EACwB,CACpB,YAAaA,CACjB,EAGG,CAAC,CACZ,C,6DCfA,MAAMrlB,EAAwB,CAACoiB,EAAQkD,OAA2B,MAAoB,CAClF,SAAU,KAAS,KACnB,OAAAlD,EACA,GAAGkD,CACP,CAAC,C,mCCND,MAAMnc,EAAkB,MAAO3K,GAAQ,CAC9B,QAAQ,WAIb,OAAO,SAAS,KAAOA,EAAI,QAAQ,UAAW,UAAU,EAC5D,C","sources":["../node_modules/@aws-amplify/auth/dist/esm/common/AuthErrorStrings.mjs","../node_modules/@aws-amplify/auth/dist/esm/errors/AuthError.mjs","../node_modules/@aws-amplify/auth/dist/esm/errors/constants.mjs","../node_modules/@aws-amplify/auth/dist/esm/errors/types/validation.mjs","../node_modules/@aws-amplify/auth/dist/esm/errors/utils/assertServiceError.mjs","../node_modules/@aws-amplify/auth/dist/esm/errors/utils/assertValidationError.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/constants.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createInitiateAuthClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolDeserializer.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolSerializer.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/parsers/regionParsers.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/autoSignIn.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmForgotPasswordClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/confirmResetPassword.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/confirmSignIn.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmSignUpClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/confirmSignUp.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createVerifyUserAttributeClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/confirmUserAttribute.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetUserClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/internal/fetchUserAttributes.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/fetchUserAttributes.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/internal/getCurrentUser.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/getCurrentUser.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createResendConfirmationCodeClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/resendSignUpCode.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createForgotPasswordClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/resetPassword.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetUserAttributeVerificationCodeClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/sendUserAttributeVerificationCode.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signInWithCustomAuth.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signInWithCustomSRPAuth.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signInWithSRP.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signInWithUserPassword.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signIn.mjs","../node_modules/@aws-amplify/auth/dist/esm/Errors.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/createOAuthError.mjs","../node_modules/@aws-amplify/auth/dist/esm/types/Auth.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/validateState.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/completeOAuthFlow.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/handleFailure.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/attemptCompleteOAuthFlow.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/enableOAuthListener.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/types/models.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/generateCodeVerifier.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/generateState.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/cancelOAuthFlow.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signInWithRedirect.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/completeOAuthSignOut.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/oAuthSignOutRedirect.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/handleOAuthSignOut.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createRevokeTokenClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGlobalSignOutClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signOut.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createSignUpClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signUp.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/types.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/IdentityIdStore.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/utils.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/IdentityIdProvider.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/credentialsProvider.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/index.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/cognitoUserPoolEndpointResolver.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/factories/createCognitoUserPoolEndpointResolver.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/types.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/errorHelpers.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/TokenStore.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/cacheTokens.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/refreshAuthTokens.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/TokenOrchestrator.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/CognitoUserPoolsTokenProvider.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/tokenProvider.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/apiHelpers.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/dispatchSignedInHubEvent.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/getRedirectUrl.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/inflightPromise.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/oAuthStore.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/types/errors.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createVerifySoftwareTokenClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createAssociateSoftwareTokenClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmDeviceClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/textEncoder/index.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/BigInteger/BigInteger.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/calculate/calculateS.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/constants.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getBytesFromHex.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getHexFromBytes.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getHashFromData.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getHashFromHex.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getPaddedHex.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/calculate/calculateU.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getHkdfKey.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getRandomBytes.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getRandomString.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/AuthenticationHelper/AuthenticationHelper.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/calculate/calculateA.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getAuthenticationHelper.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getNowString.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getSignatureString.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInHelpers.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInStore.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInWithRedirectStore.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signUpHelpers.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/types.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/userContextData.mjs","../node_modules/@aws-amplify/auth/dist/esm/utils/getAuthUserAgentValue.mjs","../node_modules/@aws-amplify/auth/dist/esm/utils/openAuthSession.mjs"],"sourcesContent":["import { AuthValidationErrorCode } from '../errors/types/validation.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst validationErrorMap = {\n [AuthValidationErrorCode.EmptyChallengeResponse]: {\n message: 'challengeResponse is required to confirmSignIn',\n },\n [AuthValidationErrorCode.EmptyConfirmResetPasswordUsername]: {\n message: 'username is required to confirmResetPassword',\n },\n [AuthValidationErrorCode.EmptyConfirmSignUpCode]: {\n message: 'code is required to confirmSignUp',\n },\n [AuthValidationErrorCode.EmptyConfirmSignUpUsername]: {\n message: 'username is required to confirmSignUp',\n },\n [AuthValidationErrorCode.EmptyConfirmResetPasswordConfirmationCode]: {\n message: 'confirmationCode is required to confirmResetPassword',\n },\n [AuthValidationErrorCode.EmptyConfirmResetPasswordNewPassword]: {\n message: 'newPassword is required to confirmResetPassword',\n },\n [AuthValidationErrorCode.EmptyResendSignUpCodeUsername]: {\n message: 'username is required to confirmSignUp',\n },\n [AuthValidationErrorCode.EmptyResetPasswordUsername]: {\n message: 'username is required to resetPassword',\n },\n [AuthValidationErrorCode.EmptySignInPassword]: {\n message: 'password is required to signIn',\n },\n [AuthValidationErrorCode.EmptySignInUsername]: {\n message: 'username is required to signIn',\n },\n [AuthValidationErrorCode.EmptySignUpPassword]: {\n message: 'password is required to signUp',\n },\n [AuthValidationErrorCode.EmptySignUpUsername]: {\n message: 'username is required to signUp',\n },\n [AuthValidationErrorCode.CustomAuthSignInPassword]: {\n message: 'A password is not needed when signing in with CUSTOM_WITHOUT_SRP',\n recoverySuggestion: 'Do not include a password in your signIn call.',\n },\n [AuthValidationErrorCode.IncorrectMFAMethod]: {\n message: 'Incorrect MFA method was chosen. It should be either SMS or TOTP',\n recoverySuggestion: 'Try to pass TOTP or SMS as the challengeResponse',\n },\n [AuthValidationErrorCode.EmptyVerifyTOTPSetupCode]: {\n message: 'code is required to verifyTotpSetup',\n },\n [AuthValidationErrorCode.EmptyUpdatePassword]: {\n message: 'oldPassword and newPassword are required to changePassword',\n },\n [AuthValidationErrorCode.EmptyConfirmUserAttributeCode]: {\n message: 'confirmation code is required to confirmUserAttribute',\n },\n};\n// TODO: delete this code when the Auth class is removed.\nvar AuthErrorStrings;\n(function (AuthErrorStrings) {\n AuthErrorStrings[\"DEFAULT_MSG\"] = \"Authentication Error\";\n AuthErrorStrings[\"EMPTY_EMAIL\"] = \"Email cannot be empty\";\n AuthErrorStrings[\"EMPTY_PHONE\"] = \"Phone number cannot be empty\";\n AuthErrorStrings[\"EMPTY_USERNAME\"] = \"Username cannot be empty\";\n AuthErrorStrings[\"INVALID_USERNAME\"] = \"The username should either be a string or one of the sign in types\";\n AuthErrorStrings[\"EMPTY_PASSWORD\"] = \"Password cannot be empty\";\n AuthErrorStrings[\"EMPTY_CODE\"] = \"Confirmation code cannot be empty\";\n AuthErrorStrings[\"SIGN_UP_ERROR\"] = \"Error creating account\";\n AuthErrorStrings[\"NO_MFA\"] = \"No valid MFA method provided\";\n AuthErrorStrings[\"INVALID_MFA\"] = \"Invalid MFA type\";\n AuthErrorStrings[\"EMPTY_CHALLENGE\"] = \"Challenge response cannot be empty\";\n AuthErrorStrings[\"NO_USER_SESSION\"] = \"Failed to get the session because the user is empty\";\n AuthErrorStrings[\"NETWORK_ERROR\"] = \"Network Error\";\n AuthErrorStrings[\"DEVICE_CONFIG\"] = \"Device tracking has not been configured in this User Pool\";\n AuthErrorStrings[\"AUTOSIGNIN_ERROR\"] = \"Please use your credentials to sign in\";\n AuthErrorStrings[\"OAUTH_ERROR\"] = \"Couldn't finish OAuth flow, check your User Pool HostedUI settings\";\n})(AuthErrorStrings || (AuthErrorStrings = {}));\nvar AuthErrorCodes;\n(function (AuthErrorCodes) {\n AuthErrorCodes[\"SignInException\"] = \"SignInException\";\n AuthErrorCodes[\"OAuthSignInError\"] = \"OAuthSignInException\";\n})(AuthErrorCodes || (AuthErrorCodes = {}));\n\nexport { AuthErrorCodes, AuthErrorStrings, validationErrorMap };\n","import { AmplifyError } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nclass AuthError extends AmplifyError {\n constructor(params) {\n super(params);\n // Hack for making the custom error class work when transpiled to es5\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = AuthError;\n Object.setPrototypeOf(this, AuthError.prototype);\n }\n}\n\nexport { AuthError };\n","import { AuthError } from './AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst USER_UNAUTHENTICATED_EXCEPTION = 'UserUnAuthenticatedException';\nconst USER_ALREADY_AUTHENTICATED_EXCEPTION = 'UserAlreadyAuthenticatedException';\nconst DEVICE_METADATA_NOT_FOUND_EXCEPTION = 'DeviceMetadataNotFoundException';\nconst AUTO_SIGN_IN_EXCEPTION = 'AutoSignInException';\nconst INVALID_REDIRECT_EXCEPTION = 'InvalidRedirectException';\nconst INVALID_APP_SCHEME_EXCEPTION = 'InvalidAppSchemeException';\nconst INVALID_PREFERRED_REDIRECT_EXCEPTION = 'InvalidPreferredRedirectUrlException';\nconst invalidRedirectException = new AuthError({\n name: INVALID_REDIRECT_EXCEPTION,\n message: 'signInRedirect or signOutRedirect had an invalid format or was not found.',\n recoverySuggestion: 'Please make sure the signIn/Out redirect in your oauth config is valid.',\n});\nconst invalidAppSchemeException = new AuthError({\n name: INVALID_APP_SCHEME_EXCEPTION,\n message: 'A valid non-http app scheme was not found in the config.',\n recoverySuggestion: 'Please make sure a valid custom app scheme is present in the config.',\n});\nconst invalidPreferredRedirectUrlException = new AuthError({\n name: INVALID_PREFERRED_REDIRECT_EXCEPTION,\n message: 'The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.',\n recoverySuggestion: 'Please make sure a matching preferredRedirectUrl is provided.',\n});\nconst INVALID_ORIGIN_EXCEPTION = 'InvalidOriginException';\nconst invalidOriginException = new AuthError({\n name: INVALID_ORIGIN_EXCEPTION,\n message: 'redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin',\n recoverySuggestion: 'Please call signInWithRedirect from the same origin.',\n});\nconst OAUTH_SIGNOUT_EXCEPTION = 'OAuthSignOutException';\nconst TOKEN_REFRESH_EXCEPTION = 'TokenRefreshException';\nconst UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION = 'UnexpectedSignInInterruptionException';\n\nexport { AUTO_SIGN_IN_EXCEPTION, DEVICE_METADATA_NOT_FOUND_EXCEPTION, INVALID_APP_SCHEME_EXCEPTION, INVALID_ORIGIN_EXCEPTION, INVALID_PREFERRED_REDIRECT_EXCEPTION, INVALID_REDIRECT_EXCEPTION, OAUTH_SIGNOUT_EXCEPTION, TOKEN_REFRESH_EXCEPTION, UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION, USER_ALREADY_AUTHENTICATED_EXCEPTION, USER_UNAUTHENTICATED_EXCEPTION, invalidAppSchemeException, invalidOriginException, invalidPreferredRedirectUrlException, invalidRedirectException };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar AuthValidationErrorCode;\n(function (AuthValidationErrorCode) {\n AuthValidationErrorCode[\"EmptySignInUsername\"] = \"EmptySignInUsername\";\n AuthValidationErrorCode[\"EmptySignInPassword\"] = \"EmptySignInPassword\";\n AuthValidationErrorCode[\"CustomAuthSignInPassword\"] = \"CustomAuthSignInPassword\";\n AuthValidationErrorCode[\"EmptySignUpUsername\"] = \"EmptySignUpUsername\";\n AuthValidationErrorCode[\"EmptySignUpPassword\"] = \"EmptySignUpPassword\";\n AuthValidationErrorCode[\"EmptyConfirmSignUpUsername\"] = \"EmptyConfirmSignUpUsername\";\n AuthValidationErrorCode[\"EmptyConfirmSignUpCode\"] = \"EmptyConfirmSignUpCode\";\n AuthValidationErrorCode[\"EmptyResendSignUpCodeUsername\"] = \"EmptyresendSignUpCodeUsername\";\n AuthValidationErrorCode[\"EmptyChallengeResponse\"] = \"EmptyChallengeResponse\";\n AuthValidationErrorCode[\"EmptyConfirmResetPasswordUsername\"] = \"EmptyConfirmResetPasswordUsername\";\n AuthValidationErrorCode[\"EmptyConfirmResetPasswordNewPassword\"] = \"EmptyConfirmResetPasswordNewPassword\";\n AuthValidationErrorCode[\"EmptyConfirmResetPasswordConfirmationCode\"] = \"EmptyConfirmResetPasswordConfirmationCode\";\n AuthValidationErrorCode[\"EmptyResetPasswordUsername\"] = \"EmptyResetPasswordUsername\";\n AuthValidationErrorCode[\"EmptyVerifyTOTPSetupCode\"] = \"EmptyVerifyTOTPSetupCode\";\n AuthValidationErrorCode[\"EmptyConfirmUserAttributeCode\"] = \"EmptyConfirmUserAttributeCode\";\n AuthValidationErrorCode[\"IncorrectMFAMethod\"] = \"IncorrectMFAMethod\";\n AuthValidationErrorCode[\"EmptyUpdatePassword\"] = \"EmptyUpdatePassword\";\n})(AuthValidationErrorCode || (AuthValidationErrorCode = {}));\n\nexport { AuthValidationErrorCode };\n","import { AmplifyErrorCode } from '@aws-amplify/core/internals/utils';\nimport { AuthError } from '../AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction assertServiceError(error) {\n if (!error ||\n error.name === 'Error' ||\n error instanceof TypeError) {\n throw new AuthError({\n name: AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n underlyingError: error,\n });\n }\n}\n\nexport { assertServiceError };\n","import { validationErrorMap } from '../../common/AuthErrorStrings.mjs';\nimport { AuthError } from '../AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction assertValidationError(assertion, name) {\n const { message, recoverySuggestion } = validationErrorMap[name];\n if (!assertion) {\n throw new AuthError({ name, message, recoverySuggestion });\n }\n}\n\nexport { assertValidationError };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * The service name used to sign requests if the API requires authentication.\n */\nconst COGNITO_IDP_SERVICE_NAME = 'cognito-idp';\n\nexport { COGNITO_IDP_SERVICE_NAME };\n","import { getRetryDecider, parseJsonError, jitteredBackoff } from '@aws-amplify/core/internals/aws-client-utils';\nimport { getAmplifyUserAgent } from '@aws-amplify/core/internals/utils';\nimport { COGNITO_IDP_SERVICE_NAME } from '../../../constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst DEFAULT_SERVICE_CLIENT_API_CONFIG = {\n service: COGNITO_IDP_SERVICE_NAME,\n retryDecider: getRetryDecider(parseJsonError),\n computeDelay: jitteredBackoff,\n userAgentValue: getAmplifyUserAgent(),\n cache: 'no-store',\n};\n\nexport { DEFAULT_SERVICE_CLIENT_API_CONFIG };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createInitiateAuthClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('InitiateAuth'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createInitiateAuthClient };\n","import { composeTransferHandler } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { unauthenticatedHandler } from '@aws-amplify/core/internals/aws-client-utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * A Cognito Identity-specific middleware that disables caching for all requests.\n */\nconst disableCacheMiddlewareFactory = () => (next, _) => async function disableCacheMiddleware(request) {\n request.headers['cache-control'] = 'no-store';\n return next(request);\n};\n/**\n * A Cognito Identity-specific transfer handler that does NOT sign requests, and\n * disables caching.\n *\n * @internal\n */\nconst cognitoUserPoolTransferHandler = composeTransferHandler(unauthenticatedHandler, [disableCacheMiddlewareFactory]);\n\nexport { cognitoUserPoolTransferHandler };\n","import { parseJsonError, parseJsonBody } from '@aws-amplify/core/internals/aws-client-utils';\nimport { assertServiceError } from '../../../../../../errors/utils/assertServiceError.mjs';\nimport { AuthError } from '../../../../../../errors/AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createUserPoolDeserializer = () => async (response) => {\n if (response.statusCode >= 300) {\n const error = await parseJsonError(response);\n assertServiceError(error);\n throw new AuthError({ name: error.name, message: error.message });\n }\n return parseJsonBody(response);\n};\n\nexport { createUserPoolDeserializer };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createUserPoolSerializer = (operation) => (input, endpoint) => {\n const headers = getSharedHeaders(operation);\n const body = JSON.stringify(input);\n return buildHttpRpcRequest(endpoint, headers, body);\n};\nconst getSharedHeaders = (operation) => ({\n 'content-type': 'application/x-amz-json-1.1',\n 'x-amz-target': `AWSCognitoIdentityProviderService.${operation}`,\n});\nconst buildHttpRpcRequest = ({ url }, headers, body) => ({\n headers,\n url,\n body,\n method: 'POST',\n});\n\nexport { createUserPoolSerializer };\n","import { AuthError } from '../../errors/AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction getRegionFromUserPoolId(userPoolId) {\n const region = userPoolId?.split('_')[0];\n if (!userPoolId ||\n userPoolId.indexOf('_') < 0 ||\n !region ||\n typeof region !== 'string')\n throw new AuthError({\n name: 'InvalidUserPoolId',\n message: 'Invalid user pool id provided.',\n });\n return region;\n}\nfunction getRegionFromIdentityPoolId(identityPoolId) {\n if (!identityPoolId || !identityPoolId.includes(':')) {\n throw new AuthError({\n name: 'InvalidIdentityPoolIdException',\n message: 'Invalid identity pool id provided.',\n recoverySuggestion: 'Make sure a valid identityPoolId is given in the config.',\n });\n }\n return identityPoolId.split(':')[0];\n}\n\nexport { getRegionFromIdentityPoolId, getRegionFromUserPoolId };\n","import { AuthError } from '../../../errors/AuthError.mjs';\nimport { AUTO_SIGN_IN_EXCEPTION } from '../../../errors/constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst initialAutoSignIn = async () => {\n throw new AuthError({\n name: AUTO_SIGN_IN_EXCEPTION,\n message: 'The autoSignIn flow has not started, or has been cancelled/completed.',\n recoverySuggestion: 'Please try to use the signIn API or log out before starting a new autoSignIn flow.',\n });\n};\n/**\n * Signs a user in automatically after finishing the sign-up process.\n *\n * This API will automatically sign a user in if the autoSignIn flow has been completed in the following cases:\n * - User confirmed their account with a verification code sent to their phone or email (default option).\n * - User confirmed their account with a verification link sent to their phone or email. In order to\n * enable this option you need to go to the Amazon Cognito [console](https://aws.amazon.com/pm/cognito),\n * look for your userpool, then go to the `Messaging` tab and enable `link` mode inside the `Verification message` option.\n * Finally you need to define the `signUpVerificationMethod` in your `Auth` config.\n *\n * @example\n * ```typescript\n * Amplify.configure({\n * Auth: {\n * Cognito: {\n * ...cognitoConfig,\n * signUpVerificationMethod: \"link\" // the default value is \"code\"\n * }\n *\t}});\n * ```\n *\n * @throws AutoSignInException - Thrown when the autoSignIn flow has not started, or has been cancelled/completed.\n * @returns The signInOutput.\n *\n * @example\n * ```typescript\n * // handleSignUp.ts\n * async function handleSignUp(\n * username:string,\n * password:string\n * ){\n * try {\n * const { nextStep } = await signUp({\n * username,\n * password,\n * options: {\n * userAttributes:{ email:'email@email.com'},\n * autoSignIn: true // This enables the auto sign-in flow.\n * },\n * });\n *\n * handleSignUpStep(nextStep);\n *\n * } catch (error) {\n * console.log(error);\n * }\n * }\n *\n * // handleConfirmSignUp.ts\n * async function handleConfirmSignUp(username:string, confirmationCode:string) {\n * try {\n * const { nextStep } = await confirmSignUp({\n * username,\n * confirmationCode,\n * });\n *\n * handleSignUpStep(nextStep);\n * } catch (error) {\n * console.log(error);\n * }\n * }\n *\n * // signUpUtils.ts\n * async function handleSignUpStep( step: SignUpOutput[\"nextStep\"]) {\n * switch (step.signUpStep) {\n * case \"CONFIRM_SIGN_UP\":\n *\n * // Redirect end-user to confirm-sign up screen.\n *\n * case \"COMPLETE_AUTO_SIGN_IN\":\n *\t const codeDeliveryDetails = step.codeDeliveryDetails;\n * if (codeDeliveryDetails) {\n * // Redirect user to confirm-sign-up with link screen.\n * }\n * const signInOutput = await autoSignIn();\n * // handle sign-in steps\n * }\n *\n * ```\n */\n// TODO(Eslint): can this be refactored not using `let` on exported member?\n// eslint-disable-next-line import/no-mutable-exports\nlet autoSignIn = initialAutoSignIn;\n/**\n * Sets the context of autoSignIn at run time.\n * @internal\n */\nfunction setAutoSignIn(callback) {\n autoSignIn = callback;\n}\n/**\n * Resets the context\n *\n * @internal\n */\nfunction resetAutoSignIn() {\n autoSignIn = initialAutoSignIn;\n}\n\nexport { autoSignIn, resetAutoSignIn, setAutoSignIn };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createConfirmForgotPasswordClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('ConfirmForgotPassword'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createConfirmForgotPasswordClient };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { getUserContextData } from '../utils/userContextData.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createConfirmForgotPasswordClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmForgotPasswordClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Confirms the new password and verification code to reset the password.\n *\n * @param input - The ConfirmResetPasswordInput object.\n * @throws -{@link ConfirmForgotPasswordException }\n * Thrown due to an invalid confirmation code or password.\n * @throws -{@link AuthValidationErrorCode }\n * Thrown due to an empty confirmation code, password or username.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function confirmResetPassword(input) {\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(authConfig);\n const { userPoolClientId, userPoolId, userPoolEndpoint } = authConfig;\n const { username, newPassword } = input;\n assertValidationError(!!username, AuthValidationErrorCode.EmptyConfirmResetPasswordUsername);\n assertValidationError(!!newPassword, AuthValidationErrorCode.EmptyConfirmResetPasswordNewPassword);\n const code = input.confirmationCode;\n assertValidationError(!!code, AuthValidationErrorCode.EmptyConfirmResetPasswordConfirmationCode);\n const metadata = input.options?.clientMetadata;\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const confirmForgotPassword = createConfirmForgotPasswordClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n await confirmForgotPassword({\n region: getRegionFromUserPoolId(authConfig.userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmResetPassword),\n }, {\n Username: username,\n ConfirmationCode: code,\n Password: newPassword,\n ClientMetadata: metadata,\n ClientId: authConfig.userPoolClientId,\n UserContextData,\n });\n}\n\nexport { confirmResetPassword };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { signInStore, setActiveSignInState, cleanActiveSignInState } from '../utils/signInStore.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { handleChallengeName, getNewDeviceMetadata, getSignInResult, getSignInResultFromError } from '../utils/signInHelpers.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { AuthErrorCodes } from '../../../common/AuthErrorStrings.mjs';\nimport { cacheCognitoTokens } from '../tokenProvider/cacheTokens.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport '../utils/types.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Continues or completes the sign in process when required by the initial call to `signIn`.\n *\n * @param input - The ConfirmSignInInput object\n * @returns ConfirmSignInOutput\n * @throws -{@link VerifySoftwareTokenException }:\n * Thrown due to an invalid MFA token.\n * @throws -{@link RespondToAuthChallengeException }:\n * Thrown due to an invalid auth challenge response.\n * @throws -{@link AssociateSoftwareTokenException}:\n * Thrown due to a service error during the MFA setup process.\n * @throws -{@link AuthValidationErrorCode }:\n * Thrown when `challengeResponse` is not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function confirmSignIn(input) {\n const { challengeResponse, options } = input;\n const { username, challengeName, signInSession, signInDetails } = signInStore.getState();\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(authConfig);\n const clientMetaData = options?.clientMetadata;\n assertValidationError(!!challengeResponse, AuthValidationErrorCode.EmptyChallengeResponse);\n if (!username || !challengeName || !signInSession)\n // TODO: remove this error message for production apps\n throw new AuthError({\n name: AuthErrorCodes.SignInException,\n message: `\n\t\t\tAn error occurred during the sign in process. \n\t\t\t\n\t\t\tThis most likely occurred due to:\n\t\t\t1. signIn was not called before confirmSignIn.\n\t\t\t2. signIn threw an exception.\n\t\t\t3. page was refreshed during the sign in flow.\n\t\t\t`,\n recoverySuggestion: 'Make sure a successful call to signIn is made before calling confirmSignIn' +\n 'and that the page is not refreshed until the sign in process is done.',\n });\n try {\n const { Session, ChallengeName: handledChallengeName, AuthenticationResult, ChallengeParameters: handledChallengeParameters, } = await handleChallengeName(username, challengeName, signInSession, challengeResponse, authConfig, tokenOrchestrator, clientMetaData, options);\n // sets up local state used during the sign-in process\n setActiveSignInState({\n signInSession: Session,\n username,\n challengeName: handledChallengeName,\n signInDetails,\n });\n if (AuthenticationResult) {\n cleanActiveSignInState();\n await cacheCognitoTokens({\n username,\n ...AuthenticationResult,\n NewDeviceMetadata: await getNewDeviceMetadata({\n userPoolId: authConfig.userPoolId,\n userPoolEndpoint: authConfig.userPoolEndpoint,\n newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n accessToken: AuthenticationResult.AccessToken,\n }),\n signInDetails,\n });\n await dispatchSignedInHubEvent();\n return {\n isSignedIn: true,\n nextStep: { signInStep: 'DONE' },\n };\n }\n return getSignInResult({\n challengeName: handledChallengeName,\n challengeParameters: handledChallengeParameters,\n });\n }\n catch (error) {\n assertServiceError(error);\n const result = getSignInResultFromError(error.name);\n if (result)\n return result;\n throw error;\n }\n}\n\nexport { confirmSignIn };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createConfirmSignUpClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('ConfirmSignUp'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createConfirmSignUpClient };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction, HubInternal } from '@aws-amplify/core/internals/utils';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { isAutoSignInStarted, isAutoSignInUserUsingConfirmSignUp, setAutoSignInStarted } from '../utils/signUpHelpers.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { getUserContextData } from '../utils/userContextData.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createConfirmSignUpClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmSignUpClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Confirms a new user account.\n *\n * @param input - The ConfirmSignUpInput object.\n * @returns ConfirmSignUpOutput\n * @throws -{@link ConfirmSignUpException }\n * Thrown due to an invalid confirmation code.\n * @throws -{@link AuthValidationErrorCode }\n * Thrown due to an empty confirmation code\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function confirmSignUp(input) {\n const { username, confirmationCode, options } = input;\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(authConfig);\n const { userPoolId, userPoolClientId, userPoolEndpoint } = authConfig;\n const clientMetadata = options?.clientMetadata;\n assertValidationError(!!username, AuthValidationErrorCode.EmptyConfirmSignUpUsername);\n assertValidationError(!!confirmationCode, AuthValidationErrorCode.EmptyConfirmSignUpCode);\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const confirmSignUpClient = createConfirmSignUpClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n await confirmSignUpClient({\n region: getRegionFromUserPoolId(authConfig.userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignUp),\n }, {\n Username: username,\n ConfirmationCode: confirmationCode,\n ClientMetadata: clientMetadata,\n ForceAliasCreation: options?.forceAliasCreation,\n ClientId: authConfig.userPoolClientId,\n UserContextData,\n });\n return new Promise((resolve, reject) => {\n try {\n const signUpOut = {\n isSignUpComplete: true,\n nextStep: {\n signUpStep: 'DONE',\n },\n };\n if (!isAutoSignInStarted() ||\n !isAutoSignInUserUsingConfirmSignUp(username)) {\n resolve(signUpOut);\n return;\n }\n const stopListener = HubInternal.listen('auth-internal', ({ payload }) => {\n switch (payload.event) {\n case 'autoSignIn':\n resolve({\n isSignUpComplete: true,\n nextStep: {\n signUpStep: 'COMPLETE_AUTO_SIGN_IN',\n },\n });\n setAutoSignInStarted(false);\n stopListener();\n }\n });\n HubInternal.dispatch('auth-internal', {\n event: 'confirmSignUp',\n data: signUpOut,\n });\n }\n catch (error) {\n reject(error);\n }\n });\n}\n\nexport { confirmSignUp };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createVerifyUserAttributeClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('VerifyUserAttribute'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createVerifyUserAttributeClient };\n","import { Amplify, fetchAuthSession } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { assertAuthTokens } from '../utils/types.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createVerifyUserAttributeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createVerifyUserAttributeClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Confirms a user attribute with the confirmation code.\n *\n * @param input - The ConfirmUserAttributeInput object\n * @throws -{@link AuthValidationErrorCode } -\n * Thrown when `confirmationCode` is not defined.\n * @throws -{@link VerifyUserAttributeException } - Thrown due to an invalid confirmation code or attribute.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function confirmUserAttribute(input) {\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(authConfig);\n const { userPoolEndpoint, userPoolId } = authConfig;\n const { confirmationCode, userAttributeKey } = input;\n assertValidationError(!!confirmationCode, AuthValidationErrorCode.EmptyConfirmUserAttributeCode);\n const { tokens } = await fetchAuthSession({ forceRefresh: false });\n assertAuthTokens(tokens);\n const verifyUserAttribute = createVerifyUserAttributeClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n await verifyUserAttribute({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmUserAttribute),\n }, {\n AccessToken: tokens.accessToken.toString(),\n AttributeName: userAttributeKey,\n Code: confirmationCode,\n });\n}\n\nexport { confirmUserAttribute };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createGetUserClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('GetUser'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createGetUserClient };\n","import { assertTokenProviderConfig, fetchAuthSession, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { getRegionFromUserPoolId } from '../../../../foundation/parsers/regionParsers.mjs';\nimport { assertAuthTokens } from '../../utils/types.mjs';\nimport { toAuthUserAttribute } from '../../utils/apiHelpers.mjs';\nimport { getAuthUserAgentValue } from '../../../../utils/getAuthUserAgentValue.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createGetUserClient } from '../../../../foundation/factories/serviceClients/cognitoIdentityProvider/createGetUserClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../../factories/createCognitoUserPoolEndpointResolver.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst fetchUserAttributes = async (amplify) => {\n const authConfig = amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(authConfig);\n const { userPoolEndpoint, userPoolId } = authConfig;\n const { tokens } = await fetchAuthSession(amplify, {\n forceRefresh: false,\n });\n assertAuthTokens(tokens);\n const getUser = createGetUserClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const { UserAttributes } = await getUser({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.FetchUserAttributes),\n }, {\n AccessToken: tokens.accessToken.toString(),\n });\n return toAuthUserAttribute(UserAttributes);\n};\n\nexport { fetchUserAttributes };\n","import { Amplify } from '@aws-amplify/core';\nimport { fetchUserAttributes as fetchUserAttributes$1 } from './internal/fetchUserAttributes.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Fetches the current user attributes while authenticated.\n *\n * @throws - {@link GetUserException} - Cognito service errors thrown when the service is not able to get the user.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nconst fetchUserAttributes = () => {\n return fetchUserAttributes$1(Amplify);\n};\n\nexport { fetchUserAttributes };\n","import { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { assertAuthTokens } from '../../utils/types.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst getCurrentUser = async (amplify) => {\n const authConfig = amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(authConfig);\n const tokens = await amplify.Auth.getTokens({ forceRefresh: false });\n assertAuthTokens(tokens);\n const { 'cognito:username': username, sub } = tokens.idToken?.payload ?? {};\n const authUser = {\n username: username,\n userId: sub,\n };\n const signInDetails = getSignInDetailsFromTokens(tokens);\n if (signInDetails) {\n authUser.signInDetails = signInDetails;\n }\n return authUser;\n};\nfunction getSignInDetailsFromTokens(tokens) {\n return tokens?.signInDetails;\n}\n\nexport { getCurrentUser };\n","import { Amplify } from '@aws-amplify/core';\nimport { getCurrentUser as getCurrentUser$1 } from './internal/getCurrentUser.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Gets the current user from the idToken.\n *\n * @param input - The GetCurrentUserInput object.\n * @returns GetCurrentUserOutput\n * @throws - {@link InitiateAuthException} - Thrown when the service fails to refresh the tokens.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nconst getCurrentUser = async () => {\n return getCurrentUser$1(Amplify);\n};\n\nexport { getCurrentUser };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createResendConfirmationCodeClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('ResendConfirmationCode'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createResendConfirmationCodeClient };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { getUserContextData } from '../utils/userContextData.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createResendConfirmationCodeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createResendConfirmationCodeClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Resend the confirmation code while signing up\n *\n * @param input - The ResendSignUpCodeInput object\n * @returns ResendSignUpCodeOutput\n * @throws service: {@link ResendConfirmationException } - Cognito service errors thrown when resending the code.\n * @throws validation: {@link AuthValidationErrorCode } - Validation errors thrown either username are not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function resendSignUpCode(input) {\n const { username } = input;\n assertValidationError(!!username, AuthValidationErrorCode.EmptySignUpUsername);\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(authConfig);\n const { userPoolClientId, userPoolId, userPoolEndpoint } = authConfig;\n const clientMetadata = input.options?.clientMetadata;\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const resendConfirmationCode = createResendConfirmationCodeClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const { CodeDeliveryDetails } = await resendConfirmationCode({\n region: getRegionFromUserPoolId(authConfig.userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.ResendSignUpCode),\n }, {\n Username: username,\n ClientMetadata: clientMetadata,\n ClientId: authConfig.userPoolClientId,\n UserContextData,\n });\n const { DeliveryMedium, AttributeName, Destination } = {\n ...CodeDeliveryDetails,\n };\n return {\n destination: Destination,\n deliveryMedium: DeliveryMedium,\n attributeName: AttributeName\n ? AttributeName\n : undefined,\n };\n}\n\nexport { resendSignUpCode };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createForgotPasswordClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('ForgotPassword'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createForgotPasswordClient };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { getUserContextData } from '../utils/userContextData.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createForgotPasswordClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createForgotPasswordClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Resets a user's password.\n *\n * @param input - The ResetPasswordInput object.\n * @returns ResetPasswordOutput\n * @throws -{@link ForgotPasswordException }\n * Thrown due to an invalid confirmation code or password.\n * @throws -{@link AuthValidationErrorCode }\n * Thrown due to an empty username.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n **/\nasync function resetPassword(input) {\n const { username } = input;\n assertValidationError(!!username, AuthValidationErrorCode.EmptyResetPasswordUsername);\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(authConfig);\n const { userPoolClientId, userPoolId, userPoolEndpoint } = authConfig;\n const clientMetadata = input.options?.clientMetadata;\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const forgotPassword = createForgotPasswordClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const res = await forgotPassword({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.ResetPassword),\n }, {\n Username: username,\n ClientMetadata: clientMetadata,\n ClientId: userPoolClientId,\n UserContextData,\n });\n const codeDeliveryDetails = res.CodeDeliveryDetails;\n return {\n isPasswordReset: false,\n nextStep: {\n resetPasswordStep: 'CONFIRM_RESET_PASSWORD_WITH_CODE',\n codeDeliveryDetails: {\n deliveryMedium: codeDeliveryDetails?.DeliveryMedium,\n destination: codeDeliveryDetails?.Destination,\n attributeName: codeDeliveryDetails?.AttributeName,\n },\n },\n };\n}\n\nexport { resetPassword };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createGetUserAttributeVerificationCodeClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('GetUserAttributeVerificationCode'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createGetUserAttributeVerificationCodeClient };\n","import { Amplify, fetchAuthSession } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { assertAuthTokens } from '../utils/types.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createGetUserAttributeVerificationCodeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createGetUserAttributeVerificationCodeClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Resends user's confirmation code when updating attributes while authenticated.\n *\n * @param input - The SendUserAttributeVerificationCodeInput object\n * @returns SendUserAttributeVerificationCodeOutput\n * @throws - {@link GetUserAttributeVerificationException}\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nconst sendUserAttributeVerificationCode = async (input) => {\n const { userAttributeKey, options } = input;\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n const clientMetadata = options?.clientMetadata;\n assertTokenProviderConfig(authConfig);\n const { userPoolEndpoint, userPoolId } = authConfig;\n const { tokens } = await fetchAuthSession({ forceRefresh: false });\n assertAuthTokens(tokens);\n const getUserAttributeVerificationCode = createGetUserAttributeVerificationCodeClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const { CodeDeliveryDetails } = await getUserAttributeVerificationCode({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.SendUserAttributeVerificationCode),\n }, {\n AccessToken: tokens.accessToken.toString(),\n ClientMetadata: clientMetadata,\n AttributeName: userAttributeKey,\n });\n const { DeliveryMedium, AttributeName, Destination } = {\n ...CodeDeliveryDetails,\n };\n return {\n destination: Destination,\n deliveryMedium: DeliveryMedium,\n attributeName: AttributeName,\n };\n};\n\nexport { sendUserAttributeVerificationCode };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { retryOnResourceNotFoundException, handleCustomAuthFlowWithoutSRP, getActiveSignInUsername, getNewDeviceMetadata, getSignInResult, getSignInResultFromError } from '../utils/signInHelpers.mjs';\nimport { setActiveSignInState, cleanActiveSignInState } from '../utils/signInStore.mjs';\nimport { cacheCognitoTokens } from '../tokenProvider/cacheTokens.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport '../utils/types.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Signs a user in using a custom authentication flow without password\n *\n * @param input - The SignInWithCustomAuthInput object\n * @returns AuthSignInResult\n * @throws service: {@link InitiateAuthException } - Cognito service errors thrown during the sign-in process.\n * @throws validation: {@link AuthValidationErrorCode } - Validation errors thrown when either username or password\n * are not defined.\n * @throws SignInWithCustomAuthOutput - Thrown when the token provider config is invalid.\n */\nasync function signInWithCustomAuth(input) {\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(authConfig);\n const { username, password, options } = input;\n const signInDetails = {\n loginId: username,\n authFlowType: 'CUSTOM_WITHOUT_SRP',\n };\n const metadata = options?.clientMetadata;\n assertValidationError(!!username, AuthValidationErrorCode.EmptySignInUsername);\n assertValidationError(!password, AuthValidationErrorCode.CustomAuthSignInPassword);\n try {\n const { ChallengeName: retriedChallengeName, ChallengeParameters: retiredChallengeParameters, AuthenticationResult, Session, } = await retryOnResourceNotFoundException(handleCustomAuthFlowWithoutSRP, [username, metadata, authConfig, tokenOrchestrator], username, tokenOrchestrator);\n const activeUsername = getActiveSignInUsername(username);\n // sets up local state used during the sign-in process\n setActiveSignInState({\n signInSession: Session,\n username: activeUsername,\n challengeName: retriedChallengeName,\n signInDetails,\n });\n if (AuthenticationResult) {\n cleanActiveSignInState();\n await cacheCognitoTokens({\n username: activeUsername,\n ...AuthenticationResult,\n NewDeviceMetadata: await getNewDeviceMetadata({\n userPoolId: authConfig.userPoolId,\n userPoolEndpoint: authConfig.userPoolEndpoint,\n newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n accessToken: AuthenticationResult.AccessToken,\n }),\n signInDetails,\n });\n await dispatchSignedInHubEvent();\n return {\n isSignedIn: true,\n nextStep: { signInStep: 'DONE' },\n };\n }\n return getSignInResult({\n challengeName: retriedChallengeName,\n challengeParameters: retiredChallengeParameters,\n });\n }\n catch (error) {\n cleanActiveSignInState();\n assertServiceError(error);\n const result = getSignInResultFromError(error.name);\n if (result)\n return result;\n throw error;\n }\n}\n\nexport { signInWithCustomAuth };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { handleCustomSRPAuthFlow, getActiveSignInUsername, getNewDeviceMetadata, getSignInResult, getSignInResultFromError } from '../utils/signInHelpers.mjs';\nimport { setActiveSignInState, cleanActiveSignInState } from '../utils/signInStore.mjs';\nimport { cacheCognitoTokens } from '../tokenProvider/cacheTokens.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport '../utils/types.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Signs a user in using a custom authentication flow with SRP\n *\n * @param input - The SignInWithCustomSRPAuthInput object\n * @returns SignInWithCustomSRPAuthOutput\n * @throws service: {@link InitiateAuthException }, {@link RespondToAuthChallengeException } - Cognito\n * service errors thrown during the sign-in process.\n * @throws validation: {@link AuthValidationErrorCode } - Validation errors thrown when either username or password\n * are not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signInWithCustomSRPAuth(input) {\n const { username, password, options } = input;\n const signInDetails = {\n loginId: username,\n authFlowType: 'CUSTOM_WITH_SRP',\n };\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(authConfig);\n const metadata = options?.clientMetadata;\n assertValidationError(!!username, AuthValidationErrorCode.EmptySignInUsername);\n assertValidationError(!!password, AuthValidationErrorCode.EmptySignInPassword);\n try {\n const { ChallengeName: handledChallengeName, ChallengeParameters: handledChallengeParameters, AuthenticationResult, Session, } = await handleCustomSRPAuthFlow(username, password, metadata, authConfig, tokenOrchestrator);\n const activeUsername = getActiveSignInUsername(username);\n // sets up local state used during the sign-in process\n setActiveSignInState({\n signInSession: Session,\n username: activeUsername,\n challengeName: handledChallengeName,\n signInDetails,\n });\n if (AuthenticationResult) {\n await cacheCognitoTokens({\n username: activeUsername,\n ...AuthenticationResult,\n NewDeviceMetadata: await getNewDeviceMetadata({\n userPoolId: authConfig.userPoolId,\n userPoolEndpoint: authConfig.userPoolEndpoint,\n newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n accessToken: AuthenticationResult.AccessToken,\n }),\n signInDetails,\n });\n cleanActiveSignInState();\n await dispatchSignedInHubEvent();\n return {\n isSignedIn: true,\n nextStep: { signInStep: 'DONE' },\n };\n }\n return getSignInResult({\n challengeName: handledChallengeName,\n challengeParameters: handledChallengeParameters,\n });\n }\n catch (error) {\n cleanActiveSignInState();\n assertServiceError(error);\n const result = getSignInResultFromError(error.name);\n if (result)\n return result;\n throw error;\n }\n}\n\nexport { signInWithCustomSRPAuth };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { handleUserSRPAuthFlow, getActiveSignInUsername, getNewDeviceMetadata, getSignInResult, getSignInResultFromError } from '../utils/signInHelpers.mjs';\nimport { setActiveSignInState, cleanActiveSignInState } from '../utils/signInStore.mjs';\nimport { cacheCognitoTokens } from '../tokenProvider/cacheTokens.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport '../utils/types.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Signs a user in\n *\n * @param input - The SignInWithSRPInput object\n * @returns SignInWithSRPOutput\n * @throws service: {@link InitiateAuthException }, {@link RespondToAuthChallengeException } - Cognito service errors\n * thrown during the sign-in process.\n * @throws validation: {@link AuthValidationErrorCode } - Validation errors thrown when either username or password\n * are not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signInWithSRP(input) {\n const { username, password } = input;\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n const signInDetails = {\n loginId: username,\n authFlowType: 'USER_SRP_AUTH',\n };\n assertTokenProviderConfig(authConfig);\n const clientMetaData = input.options?.clientMetadata;\n assertValidationError(!!username, AuthValidationErrorCode.EmptySignInUsername);\n assertValidationError(!!password, AuthValidationErrorCode.EmptySignInPassword);\n try {\n const { ChallengeName: handledChallengeName, ChallengeParameters: handledChallengeParameters, AuthenticationResult, Session, } = await handleUserSRPAuthFlow(username, password, clientMetaData, authConfig, tokenOrchestrator);\n const activeUsername = getActiveSignInUsername(username);\n // sets up local state used during the sign-in process\n setActiveSignInState({\n signInSession: Session,\n username: activeUsername,\n challengeName: handledChallengeName,\n signInDetails,\n });\n if (AuthenticationResult) {\n cleanActiveSignInState();\n await cacheCognitoTokens({\n username: activeUsername,\n ...AuthenticationResult,\n NewDeviceMetadata: await getNewDeviceMetadata({\n userPoolId: authConfig.userPoolId,\n userPoolEndpoint: authConfig.userPoolEndpoint,\n newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n accessToken: AuthenticationResult.AccessToken,\n }),\n signInDetails,\n });\n await dispatchSignedInHubEvent();\n return {\n isSignedIn: true,\n nextStep: { signInStep: 'DONE' },\n };\n }\n return getSignInResult({\n challengeName: handledChallengeName,\n challengeParameters: handledChallengeParameters,\n });\n }\n catch (error) {\n cleanActiveSignInState();\n assertServiceError(error);\n const result = getSignInResultFromError(error.name);\n if (result)\n return result;\n throw error;\n }\n}\n\nexport { signInWithSRP };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { retryOnResourceNotFoundException, handleUserPasswordAuthFlow, getActiveSignInUsername, getNewDeviceMetadata, getSignInResult, getSignInResultFromError } from '../utils/signInHelpers.mjs';\nimport { setActiveSignInState, cleanActiveSignInState } from '../utils/signInStore.mjs';\nimport { cacheCognitoTokens } from '../tokenProvider/cacheTokens.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport '../utils/types.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Signs a user in using USER_PASSWORD_AUTH AuthFlowType\n *\n * @param input - The SignInWithUserPasswordInput object\n * @returns SignInWithUserPasswordOutput\n * @throws service: {@link InitiateAuthException } - Cognito service error thrown during the sign-in process.\n * @throws validation: {@link AuthValidationErrorCode } - Validation errors thrown when either username or password\n * are not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signInWithUserPassword(input) {\n const { username, password, options } = input;\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n const signInDetails = {\n loginId: username,\n authFlowType: 'USER_PASSWORD_AUTH',\n };\n assertTokenProviderConfig(authConfig);\n const metadata = options?.clientMetadata;\n assertValidationError(!!username, AuthValidationErrorCode.EmptySignInUsername);\n assertValidationError(!!password, AuthValidationErrorCode.EmptySignInPassword);\n try {\n const { ChallengeName: retiredChallengeName, ChallengeParameters: retriedChallengeParameters, AuthenticationResult, Session, } = await retryOnResourceNotFoundException(handleUserPasswordAuthFlow, [username, password, metadata, authConfig, tokenOrchestrator], username, tokenOrchestrator);\n const activeUsername = getActiveSignInUsername(username);\n // sets up local state used during the sign-in process\n setActiveSignInState({\n signInSession: Session,\n username: activeUsername,\n challengeName: retiredChallengeName,\n signInDetails,\n });\n if (AuthenticationResult) {\n await cacheCognitoTokens({\n ...AuthenticationResult,\n username: activeUsername,\n NewDeviceMetadata: await getNewDeviceMetadata({\n userPoolId: authConfig.userPoolId,\n userPoolEndpoint: authConfig.userPoolEndpoint,\n newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n accessToken: AuthenticationResult.AccessToken,\n }),\n signInDetails,\n });\n cleanActiveSignInState();\n await dispatchSignedInHubEvent();\n return {\n isSignedIn: true,\n nextStep: { signInStep: 'DONE' },\n };\n }\n return getSignInResult({\n challengeName: retiredChallengeName,\n challengeParameters: retriedChallengeParameters,\n });\n }\n catch (error) {\n cleanActiveSignInState();\n assertServiceError(error);\n const result = getSignInResultFromError(error.name);\n if (result)\n return result;\n throw error;\n }\n}\n\nexport { signInWithUserPassword };\n","import { assertUserNotAuthenticated } from '../utils/signInHelpers.mjs';\nimport { signInWithCustomAuth } from './signInWithCustomAuth.mjs';\nimport { signInWithCustomSRPAuth } from './signInWithCustomSRPAuth.mjs';\nimport { signInWithSRP } from './signInWithSRP.mjs';\nimport { signInWithUserPassword } from './signInWithUserPassword.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Signs a user in\n *\n * @param input - The SignInInput object\n * @returns SignInOutput\n * @throws service: {@link InitiateAuthException }, {@link RespondToAuthChallengeException }\n * - Cognito service errors thrown during the sign-in process.\n * @throws validation: {@link AuthValidationErrorCode } - Validation errors thrown when either username or password\n * are not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signIn(input) {\n const authFlowType = input.options?.authFlowType;\n await assertUserNotAuthenticated();\n switch (authFlowType) {\n case 'USER_SRP_AUTH':\n return signInWithSRP(input);\n case 'USER_PASSWORD_AUTH':\n return signInWithUserPassword(input);\n case 'CUSTOM_WITHOUT_SRP':\n return signInWithCustomAuth(input);\n case 'CUSTOM_WITH_SRP':\n return signInWithCustomSRPAuth(input);\n default:\n return signInWithSRP(input);\n }\n}\n\nexport { signIn };\n","import { ConsoleLogger } from '@aws-amplify/core';\nimport { AuthErrorStrings } from './common/AuthErrorStrings.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// TODO: delete this module when the Auth class is removed.\nconst logger = new ConsoleLogger('AuthError');\nclass AuthError extends Error {\n constructor(type) {\n const { message, log } = authErrorMessages[type];\n super(message);\n // Hack for making the custom error class work when transpiled to es5\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = AuthError;\n Object.setPrototypeOf(this, AuthError.prototype);\n this.name = 'AuthError';\n this.log = log || message;\n logger.error(this.log);\n }\n}\nclass NoUserPoolError extends AuthError {\n constructor(type) {\n super(type);\n // Hack for making the custom error class work when transpiled to es5\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = NoUserPoolError;\n Object.setPrototypeOf(this, NoUserPoolError.prototype);\n this.name = 'NoUserPoolError';\n }\n}\nconst authErrorMessages = {\n oauthSignInError: {\n message: AuthErrorStrings.OAUTH_ERROR,\n log: 'Make sure Cognito Hosted UI has been configured correctly',\n },\n noConfig: {\n message: AuthErrorStrings.DEFAULT_MSG,\n log: `\n Error: Amplify has not been configured correctly.\n This error is typically caused by one of the following scenarios:\n\n 1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point\n See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information\n \n 2. There might be multiple conflicting versions of amplify packages in your node_modules.\n\t\t\t\tRefer to our docs site for help upgrading Amplify packages (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js)\n `,\n },\n missingAuthConfig: {\n message: AuthErrorStrings.DEFAULT_MSG,\n log: `\n Error: Amplify has not been configured correctly. \n The configuration object is missing required auth properties.\n This error is typically caused by one of the following scenarios:\n\n 1. Did you run \\`amplify push\\` after adding auth via \\`amplify add auth\\`?\n See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information\n\n 2. This could also be caused by multiple conflicting versions of amplify packages, see (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) for help upgrading Amplify packages.\n `,\n },\n emptyUsername: {\n message: AuthErrorStrings.EMPTY_USERNAME,\n },\n // TODO: should include a list of valid sign-in types\n invalidUsername: {\n message: AuthErrorStrings.INVALID_USERNAME,\n },\n emptyPassword: {\n message: AuthErrorStrings.EMPTY_PASSWORD,\n },\n emptyCode: {\n message: AuthErrorStrings.EMPTY_CODE,\n },\n signUpError: {\n message: AuthErrorStrings.SIGN_UP_ERROR,\n log: 'The first parameter should either be non-null string or object',\n },\n noMFA: {\n message: AuthErrorStrings.NO_MFA,\n },\n invalidMFA: {\n message: AuthErrorStrings.INVALID_MFA,\n },\n emptyChallengeResponse: {\n message: AuthErrorStrings.EMPTY_CHALLENGE,\n },\n noUserSession: {\n message: AuthErrorStrings.NO_USER_SESSION,\n },\n deviceConfig: {\n message: AuthErrorStrings.DEVICE_CONFIG,\n },\n networkError: {\n message: AuthErrorStrings.NETWORK_ERROR,\n },\n autoSignInError: {\n message: AuthErrorStrings.AUTOSIGNIN_ERROR,\n },\n default: {\n message: AuthErrorStrings.DEFAULT_MSG,\n },\n};\n\nexport { AuthError, NoUserPoolError, authErrorMessages };\n","import { authErrorMessages } from '../../../../Errors.mjs';\nimport { AuthErrorCodes } from '../../../../common/AuthErrorStrings.mjs';\nimport { AuthError } from '../../../../errors/AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createOAuthError = (message, recoverySuggestion) => new AuthError({\n message: message ?? 'An error has occurred during the oauth process.',\n name: AuthErrorCodes.OAuthSignInError,\n recoverySuggestion: recoverySuggestion ?? authErrorMessages.oauthSignInError.log,\n});\n\nexport { createOAuthError };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar AuthErrorTypes;\n(function (AuthErrorTypes) {\n AuthErrorTypes[\"NoConfig\"] = \"noConfig\";\n AuthErrorTypes[\"MissingAuthConfig\"] = \"missingAuthConfig\";\n AuthErrorTypes[\"EmptyUsername\"] = \"emptyUsername\";\n AuthErrorTypes[\"InvalidUsername\"] = \"invalidUsername\";\n AuthErrorTypes[\"EmptyPassword\"] = \"emptyPassword\";\n AuthErrorTypes[\"EmptyCode\"] = \"emptyCode\";\n AuthErrorTypes[\"SignUpError\"] = \"signUpError\";\n AuthErrorTypes[\"NoMFA\"] = \"noMFA\";\n AuthErrorTypes[\"InvalidMFA\"] = \"invalidMFA\";\n AuthErrorTypes[\"EmptyChallengeResponse\"] = \"emptyChallengeResponse\";\n AuthErrorTypes[\"NoUserSession\"] = \"noUserSession\";\n AuthErrorTypes[\"Default\"] = \"default\";\n AuthErrorTypes[\"DeviceConfig\"] = \"deviceConfig\";\n AuthErrorTypes[\"NetworkError\"] = \"networkError\";\n AuthErrorTypes[\"AutoSignInError\"] = \"autoSignInError\";\n AuthErrorTypes[\"OAuthSignInError\"] = \"oauthSignInError\";\n})(AuthErrorTypes || (AuthErrorTypes = {}));\n\nexport { AuthErrorTypes };\n","import { AuthError } from '../../../../errors/AuthError.mjs';\nimport { AuthErrorTypes } from '../../../../types/Auth.mjs';\nimport { oAuthStore } from './oAuthStore.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst flowCancelledMessage = '`signInWithRedirect` has been canceled.';\nconst validationFailedMessage = 'An error occurred while validating the state.';\nconst validationRecoverySuggestion = 'Try to initiate an OAuth flow from Amplify';\nconst validateState = async (state) => {\n const savedState = await oAuthStore.loadOAuthState();\n // This is because savedState only exists if the flow was initiated by Amplify\n const validatedState = state === savedState ? savedState : undefined;\n if (!validatedState) {\n throw new AuthError({\n name: AuthErrorTypes.OAuthSignInError,\n message: state === null ? flowCancelledMessage : validationFailedMessage,\n recoverySuggestion: state === null ? undefined : validationRecoverySuggestion,\n });\n }\n return validatedState;\n};\n\nexport { flowCancelledMessage, validateState, validationFailedMessage, validationRecoverySuggestion };\n","import { AmplifyUrl, USER_AGENT_HEADER, urlSafeDecode, AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';\nimport { decodeJWT, Hub } from '@aws-amplify/core';\nimport { cacheCognitoTokens } from '../../tokenProvider/cacheTokens.mjs';\nimport { dispatchSignedInHubEvent } from '../dispatchSignedInHubEvent.mjs';\nimport '../refreshAuthTokens.mjs';\nimport '../../tokenProvider/errorHelpers.mjs';\nimport { oAuthStore } from './oAuthStore.mjs';\nimport { resolveAndClearInflightPromises } from './inflightPromise.mjs';\nimport { tokenOrchestrator } from '../../tokenProvider/tokenProvider.mjs';\nimport { createOAuthError } from './createOAuthError.mjs';\nimport { validateState } from './validateState.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst completeOAuthFlow = async ({ currentUrl, userAgentValue, clientId, redirectUri, responseType, domain, preferPrivateSession, }) => {\n const urlParams = new AmplifyUrl(currentUrl);\n const error = urlParams.searchParams.get('error');\n const errorMessage = urlParams.searchParams.get('error_description');\n if (error) {\n throw createOAuthError(errorMessage ?? error);\n }\n if (responseType === 'code') {\n return handleCodeFlow({\n currentUrl,\n userAgentValue,\n clientId,\n redirectUri,\n domain,\n preferPrivateSession,\n });\n }\n return handleImplicitFlow({\n currentUrl,\n redirectUri,\n preferPrivateSession,\n });\n};\nconst handleCodeFlow = async ({ currentUrl, userAgentValue, clientId, redirectUri, domain, preferPrivateSession, }) => {\n /* Convert URL into an object with parameters as keys\n{ redirect_uri: 'http://localhost:3000/', response_type: 'code', ...} */\n const url = new AmplifyUrl(currentUrl);\n const code = url.searchParams.get('code');\n const state = url.searchParams.get('state');\n // if `code` or `state` is not presented in the redirect url, most likely\n // that the end user cancelled the inflight oauth flow by:\n // 1. clicking the back button of browser\n // 2. closing the provider hosted UI page and coming back to the app\n if (!code || !state) {\n throw createOAuthError('User cancelled OAuth flow.');\n }\n // may throw error is being caught in attemptCompleteOAuthFlow.ts\n const validatedState = await validateState(state);\n const oAuthTokenEndpoint = 'https://' + domain + '/oauth2/token';\n // TODO(v6): check hub events\n // dispatchAuthEvent(\n // \t'codeFlow',\n // \t{},\n // \t`Retrieving tokens from ${oAuthTokenEndpoint}`\n // );\n const codeVerifier = await oAuthStore.loadPKCE();\n const oAuthTokenBody = {\n grant_type: 'authorization_code',\n code,\n client_id: clientId,\n redirect_uri: redirectUri,\n ...(codeVerifier ? { code_verifier: codeVerifier } : {}),\n };\n const body = Object.entries(oAuthTokenBody)\n .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)\n .join('&');\n const { access_token, refresh_token: refreshToken, id_token, error, error_message: errorMessage, token_type, expires_in, } = await (await fetch(oAuthTokenEndpoint, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n [USER_AGENT_HEADER]: userAgentValue,\n },\n body,\n })).json();\n if (error) {\n // error is being caught in attemptCompleteOAuthFlow.ts\n throw createOAuthError(errorMessage ?? error);\n }\n const username = (access_token && decodeJWT(access_token).payload.username) ?? 'username';\n await cacheCognitoTokens({\n username,\n AccessToken: access_token,\n IdToken: id_token,\n RefreshToken: refreshToken,\n TokenType: token_type,\n ExpiresIn: expires_in,\n });\n return completeFlow({\n redirectUri,\n state: validatedState,\n preferPrivateSession,\n });\n};\nconst handleImplicitFlow = async ({ currentUrl, redirectUri, preferPrivateSession, }) => {\n // hash is `null` if `#` doesn't exist on URL\n const url = new AmplifyUrl(currentUrl);\n const { id_token, access_token, state, token_type, expires_in, error_description, error, } = (url.hash ?? '#')\n .substring(1) // Remove # from returned code\n .split('&')\n .map(pairings => pairings.split('='))\n .reduce((accum, [k, v]) => ({ ...accum, [k]: v }), {\n id_token: undefined,\n access_token: undefined,\n state: undefined,\n token_type: undefined,\n expires_in: undefined,\n error_description: undefined,\n error: undefined,\n });\n if (error) {\n throw createOAuthError(error_description ?? error);\n }\n if (!access_token) {\n // error is being caught in attemptCompleteOAuthFlow.ts\n throw createOAuthError('No access token returned from OAuth flow.');\n }\n const validatedState = await validateState(state);\n const username = (access_token && decodeJWT(access_token).payload.username) ?? 'username';\n await cacheCognitoTokens({\n username,\n AccessToken: access_token,\n IdToken: id_token,\n TokenType: token_type,\n ExpiresIn: expires_in,\n });\n return completeFlow({\n redirectUri,\n state: validatedState,\n preferPrivateSession,\n });\n};\nconst completeFlow = async ({ redirectUri, state, preferPrivateSession, }) => {\n await tokenOrchestrator.setOAuthMetadata({\n oauthSignIn: true,\n });\n await oAuthStore.clearOAuthData();\n await oAuthStore.storeOAuthSignIn(true, preferPrivateSession);\n // this should be called before any call that involves `fetchAuthSession`\n // e.g. `getCurrentUser()` below, so it allows every inflight async calls to\n // `fetchAuthSession` can be resolved\n resolveAndClearInflightPromises();\n if (isCustomState(state)) {\n Hub.dispatch('auth', {\n event: 'customOAuthState',\n data: urlSafeDecode(getCustomState(state)),\n }, 'Auth', AMPLIFY_SYMBOL);\n }\n Hub.dispatch('auth', { event: 'signInWithRedirect' }, 'Auth', AMPLIFY_SYMBOL);\n await dispatchSignedInHubEvent();\n clearHistory(redirectUri);\n};\nconst isCustomState = (state) => {\n return /-/.test(state);\n};\nconst getCustomState = (state) => {\n return state.split('-').splice(1).join('-');\n};\nconst clearHistory = (redirectUri) => {\n if (typeof window !== 'undefined' && typeof window.history !== 'undefined') {\n window.history.replaceState(window.history.state, '', redirectUri);\n }\n};\n\nexport { completeOAuthFlow };\n","import { Hub } from '@aws-amplify/core';\nimport { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';\nimport { oAuthStore } from './oAuthStore.mjs';\nimport { resolveAndClearInflightPromises } from './inflightPromise.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst handleFailure = async (error) => {\n resolveAndClearInflightPromises();\n await oAuthStore.clearOAuthInflightData();\n Hub.dispatch('auth', { event: 'signInWithRedirect_failure', data: { error } }, 'Auth', AMPLIFY_SYMBOL);\n};\n\nexport { handleFailure };\n","import { assertTokenProviderConfig, assertOAuthConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { getAuthUserAgentValue } from '../../../../utils/getAuthUserAgentValue.mjs';\nimport { oAuthStore } from './oAuthStore.mjs';\nimport { completeOAuthFlow } from './completeOAuthFlow.mjs';\nimport { getRedirectUrl } from './getRedirectUrl.mjs';\nimport { handleFailure } from './handleFailure.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst attemptCompleteOAuthFlow = async (authConfig) => {\n try {\n assertTokenProviderConfig(authConfig);\n assertOAuthConfig(authConfig);\n oAuthStore.setAuthConfig(authConfig);\n }\n catch (_) {\n // no-op\n // This should not happen as Amplify singleton checks the oauth config key\n // unless the oauth config object doesn't contain required properties\n return;\n }\n // No inflight OAuth\n if (!(await oAuthStore.loadOAuthInFlight())) {\n return;\n }\n try {\n const currentUrl = window.location.href;\n const { loginWith, userPoolClientId } = authConfig;\n const { domain, redirectSignIn, responseType } = loginWith.oauth;\n const redirectUri = getRedirectUrl(redirectSignIn);\n await completeOAuthFlow({\n currentUrl,\n clientId: userPoolClientId,\n domain,\n redirectUri,\n responseType,\n userAgentValue: getAuthUserAgentValue(AuthAction.SignInWithRedirect),\n });\n }\n catch (err) {\n await handleFailure(err);\n }\n};\n\nexport { attemptCompleteOAuthFlow };\n","import { Amplify } from '@aws-amplify/core';\nimport { isBrowser, ADD_OAUTH_LISTENER } from '@aws-amplify/core/internals/utils';\nimport { attemptCompleteOAuthFlow } from './attemptCompleteOAuthFlow.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// attach the side effect for handling the completion of an inflight oauth flow\n// this side effect works only on Web\nisBrowser() &&\n (() => {\n // add the listener to the singleton for triggering\n Amplify[ADD_OAUTH_LISTENER](attemptCompleteOAuthFlow);\n })();\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst cognitoHostedUIIdentityProviderMap = {\n Google: 'Google',\n Facebook: 'Facebook',\n Amazon: 'LoginWithAmazon',\n Apple: 'SignInWithApple',\n};\n\nexport { cognitoHostedUIIdentityProviderMap };\n","import { Sha256 } from '@aws-crypto/sha256-js';\nimport { getCrypto, base64Encoder } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst CODE_VERIFIER_CHARSET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n/**\n *\n * @param length Desired length of the code verifier.\n *\n * **NOTE:** According to the [RFC 7636](https://datatracker.ietf.org/doc/html/rfc7636#section-4.1)\n * A code verifier must be with a length >= 43 and <= 128.\n *\n * @returns An object that contains the generated `codeVerifier` and a method\n * `toCodeChallenge` to generate the code challenge from the `codeVerifier`\n * following the spec of [RFC 7636](https://datatracker.ietf.org/doc/html/rfc7636#section-4.2).\n */\nconst generateCodeVerifier = (length) => {\n const randomBytes = new Uint8Array(length);\n getCrypto().getRandomValues(randomBytes);\n let value = '';\n let codeChallenge;\n for (const byte of randomBytes) {\n value += CODE_VERIFIER_CHARSET.charAt(byte % CODE_VERIFIER_CHARSET.length);\n }\n return {\n value,\n method: 'S256',\n toCodeChallenge() {\n if (codeChallenge) {\n return codeChallenge;\n }\n codeChallenge = generateCodeChallenge(value);\n return codeChallenge;\n },\n };\n};\nfunction generateCodeChallenge(codeVerifier) {\n const awsCryptoHash = new Sha256();\n awsCryptoHash.update(codeVerifier);\n const codeChallenge = removePaddingChar(base64Encoder.convert(awsCryptoHash.digestSync(), { urlSafe: true }));\n return codeChallenge;\n}\nfunction removePaddingChar(base64Encoded) {\n return base64Encoded.replace(/=/g, '');\n}\n\nexport { generateCodeVerifier };\n","import { generateRandomString } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst generateState = () => {\n return generateRandomString(32);\n};\n\nexport { generateState };\n","import { createOAuthError } from './createOAuthError.mjs';\nimport { handleFailure } from './handleFailure.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst listenForOAuthFlowCancellation = (store) => {\n async function handleCancelOAuthFlow(event) {\n const isBfcache = event.persisted;\n if (isBfcache && (await store.loadOAuthInFlight())) {\n const error = createOAuthError('User cancelled OAuth flow.');\n await handleFailure(error);\n }\n window.removeEventListener('pageshow', handleCancelOAuthFlow);\n }\n window.addEventListener('pageshow', handleCancelOAuthFlow);\n};\n\nexport { listenForOAuthFlowCancellation };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, assertOAuthConfig, urlSafeEncode, isBrowser, AuthAction } from '@aws-amplify/core/internals/utils';\nimport '../utils/oauth/enableOAuthListener.mjs';\nimport { cognitoHostedUIIdentityProviderMap } from '../types/models.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { openAuthSession } from '../../../utils/openAuthSession.mjs';\nimport { assertUserNotAuthenticated } from '../utils/signInHelpers.mjs';\nimport { generateCodeVerifier } from '../utils/oauth/generateCodeVerifier.mjs';\nimport { generateState } from '../utils/oauth/generateState.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport { oAuthStore } from '../utils/oauth/oAuthStore.mjs';\nimport '../tokenProvider/tokenProvider.mjs';\nimport { getRedirectUrl } from '../utils/oauth/getRedirectUrl.mjs';\nimport { handleFailure } from '../utils/oauth/handleFailure.mjs';\nimport { completeOAuthFlow } from '../utils/oauth/completeOAuthFlow.mjs';\nimport { createOAuthError } from '../utils/oauth/createOAuthError.mjs';\nimport { listenForOAuthFlowCancellation } from '../utils/oauth/cancelOAuthFlow.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Signs in a user with OAuth. Redirects the application to an Identity Provider.\n *\n * @param input - The SignInWithRedirectInput object, if empty it will redirect to Cognito HostedUI\n *\n * @throws AuthTokenConfigException - Thrown when the user pool config is invalid.\n * @throws OAuthNotConfigureException - Thrown when the oauth config is invalid.\n */\nasync function signInWithRedirect(input) {\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(authConfig);\n assertOAuthConfig(authConfig);\n oAuthStore.setAuthConfig(authConfig);\n await assertUserNotAuthenticated();\n let provider = 'COGNITO'; // Default\n if (typeof input?.provider === 'string') {\n provider = cognitoHostedUIIdentityProviderMap[input.provider];\n }\n else if (input?.provider?.custom) {\n provider = input.provider.custom;\n }\n return oauthSignIn({\n oauthConfig: authConfig.loginWith.oauth,\n clientId: authConfig.userPoolClientId,\n provider,\n customState: input?.customState,\n preferPrivateSession: input?.options?.preferPrivateSession,\n });\n}\nconst oauthSignIn = async ({ oauthConfig, provider, clientId, customState, preferPrivateSession, }) => {\n const { domain, redirectSignIn, responseType, scopes } = oauthConfig;\n const randomState = generateState();\n /* encodeURIComponent is not URL safe, use urlSafeEncode instead. Cognito\n single-encodes/decodes url on first sign in and double-encodes/decodes url\n when user already signed in. Using encodeURIComponent, Base32, Base64 add\n characters % or = which on further encoding becomes unsafe. '=' create issue\n for parsing query params.\n Refer: https://github.com/aws-amplify/amplify-js/issues/5218 */\n const state = customState\n ? `${randomState}-${urlSafeEncode(customState)}`\n : randomState;\n const { value, method, toCodeChallenge } = generateCodeVerifier(128);\n const redirectUri = getRedirectUrl(oauthConfig.redirectSignIn);\n if (isBrowser())\n oAuthStore.storeOAuthInFlight(true);\n oAuthStore.storeOAuthState(state);\n oAuthStore.storePKCE(value);\n const queryString = Object.entries({\n redirect_uri: redirectUri,\n response_type: responseType,\n client_id: clientId,\n identity_provider: provider,\n scope: scopes.join(' '),\n state,\n ...(responseType === 'code' && {\n code_challenge: toCodeChallenge(),\n code_challenge_method: method,\n }),\n })\n .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)\n .join('&');\n // TODO(v6): use URL object instead\n const oAuthUrl = `https://${domain}/oauth2/authorize?${queryString}`;\n // this will only take effect in the following scenarios:\n // 1. the user cancels the OAuth flow on web via back button, and\n // 2. when bfcache is enabled\n listenForOAuthFlowCancellation(oAuthStore);\n // the following is effective only in react-native as openAuthSession resolves only in react-native\n const { type, error, url } = (await openAuthSession(oAuthUrl)) ??\n {};\n try {\n if (type === 'error') {\n throw createOAuthError(String(error));\n }\n if (type === 'success' && url) {\n await completeOAuthFlow({\n currentUrl: url,\n clientId,\n domain,\n redirectUri,\n responseType,\n userAgentValue: getAuthUserAgentValue(AuthAction.SignInWithRedirect),\n preferPrivateSession,\n });\n }\n }\n catch (err) {\n await handleFailure(err);\n // rethrow the error so it can be caught by `await signInWithRedirect()` in react-native\n throw err;\n }\n};\n\nexport { signInWithRedirect };\n","import { clearCredentials, Hub } from '@aws-amplify/core';\nimport { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';\nimport '../refreshAuthTokens.mjs';\nimport '../../tokenProvider/errorHelpers.mjs';\nimport '../types.mjs';\nimport { tokenOrchestrator } from '../../tokenProvider/tokenProvider.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst completeOAuthSignOut = async (store) => {\n await store.clearOAuthData();\n tokenOrchestrator.clearTokens();\n await clearCredentials();\n Hub.dispatch('auth', { event: 'signedOut' }, 'Auth', AMPLIFY_SYMBOL);\n};\n\nexport { completeOAuthSignOut };\n","import { assertOAuthConfig } from '@aws-amplify/core/internals/utils';\nimport { openAuthSession } from '../../../../utils/openAuthSession.mjs';\nimport { getRedirectUrl } from './getRedirectUrl.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst oAuthSignOutRedirect = async (authConfig, preferPrivateSession = false, redirectUrl) => {\n assertOAuthConfig(authConfig);\n const { loginWith, userPoolClientId } = authConfig;\n const { domain, redirectSignOut } = loginWith.oauth;\n const signoutUri = getRedirectUrl(redirectSignOut, redirectUrl);\n const oAuthLogoutEndpoint = `https://${domain}/logout?${Object.entries({\n client_id: userPoolClientId,\n logout_uri: encodeURIComponent(signoutUri),\n })\n .map(([k, v]) => `${k}=${v}`)\n .join('&')}`;\n return openAuthSession(oAuthLogoutEndpoint);\n};\n\nexport { oAuthSignOutRedirect };\n","import { completeOAuthSignOut } from './completeOAuthSignOut.mjs';\nimport { oAuthSignOutRedirect } from './oAuthSignOutRedirect.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst handleOAuthSignOut = async (cognitoConfig, store, tokenOrchestrator, redirectUrl) => {\n const { isOAuthSignIn } = await store.loadOAuthSignIn();\n const oauthMetadata = await tokenOrchestrator.getOAuthMetadata();\n // Clear everything before attempting to visted logout endpoint since the current application\n // state could be wiped away on redirect\n await completeOAuthSignOut(store);\n // The isOAuthSignIn flag is propagated by the oAuthToken store which manages oauth keys in local storage only.\n // These keys are used to determine if a user is in an inflight or signedIn oauth states.\n // However, this behavior represents an issue when 2 apps share the same set of tokens in Cookie storage because the app that didn't\n // start the OAuth will not have access to the oauth keys.\n // A heuristic solution is to add oauth metadata to the tokenOrchestrator which will have access to the underlying\n // storage mechanism that is used by Amplify.\n if (isOAuthSignIn || oauthMetadata?.oauthSignIn) {\n // On web, this will always end up being a void action\n return oAuthSignOutRedirect(cognitoConfig, false, redirectUrl);\n }\n};\n\nexport { handleOAuthSignOut };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createRevokeTokenClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('RevokeToken'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createRevokeTokenClient };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createGlobalSignOutClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('GlobalSignOut'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createGlobalSignOutClient };\n","import { ConsoleLogger, Amplify, clearCredentials, Hub, defaultStorage } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, assertOAuthConfig, AMPLIFY_SYMBOL, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport { DefaultOAuthStore } from '../utils/signInWithRedirectStore.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { assertAuthTokensWithRefreshToken, assertAuthTokens } from '../utils/types.mjs';\nimport '@aws-crypto/sha256-js';\nimport { handleOAuthSignOut } from '../utils/oauth/handleOAuthSignOut.mjs';\nimport { OAUTH_SIGNOUT_EXCEPTION } from '../../../errors/constants.mjs';\nimport '../../../Errors.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../../../types/Auth.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createRevokeTokenClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createRevokeTokenClient.mjs';\nimport { createGlobalSignOutClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createGlobalSignOutClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('Auth');\n/**\n * Signs a user out\n *\n * @param input - The SignOutInput object\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signOut(input) {\n const cognitoConfig = Amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(cognitoConfig);\n if (input?.global) {\n await globalSignOut(cognitoConfig);\n }\n else {\n await clientSignOut(cognitoConfig);\n }\n let hasOAuthConfig;\n try {\n assertOAuthConfig(cognitoConfig);\n hasOAuthConfig = true;\n }\n catch (err) {\n hasOAuthConfig = false;\n }\n if (hasOAuthConfig) {\n const oAuthStore = new DefaultOAuthStore(defaultStorage);\n oAuthStore.setAuthConfig(cognitoConfig);\n const { type } = (await handleOAuthSignOut(cognitoConfig, oAuthStore, tokenOrchestrator, input?.oauth?.redirectUrl)) ?? {};\n if (type === 'error') {\n throw new AuthError({\n name: OAUTH_SIGNOUT_EXCEPTION,\n message: `An error occurred when attempting to log out from OAuth provider.`,\n });\n }\n }\n else {\n // complete sign out\n tokenOrchestrator.clearTokens();\n await clearCredentials();\n Hub.dispatch('auth', { event: 'signedOut' }, 'Auth', AMPLIFY_SYMBOL);\n }\n}\nasync function clientSignOut(cognitoConfig) {\n try {\n const { userPoolEndpoint, userPoolId, userPoolClientId } = cognitoConfig;\n const authTokens = await tokenOrchestrator.getTokenStore().loadTokens();\n assertAuthTokensWithRefreshToken(authTokens);\n if (isSessionRevocable(authTokens.accessToken)) {\n const revokeToken = createRevokeTokenClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n await revokeToken({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.SignOut),\n }, {\n ClientId: userPoolClientId,\n Token: authTokens.refreshToken,\n });\n }\n }\n catch (err) {\n // this shouldn't throw\n logger.debug('Client signOut error caught but will proceed with token removal');\n }\n}\nasync function globalSignOut(cognitoConfig) {\n try {\n const { userPoolEndpoint, userPoolId } = cognitoConfig;\n const authTokens = await tokenOrchestrator.getTokenStore().loadTokens();\n assertAuthTokens(authTokens);\n const globalSignOutClient = createGlobalSignOutClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n await globalSignOutClient({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.SignOut),\n }, {\n AccessToken: authTokens.accessToken.toString(),\n });\n }\n catch (err) {\n // it should not throw\n logger.debug('Global signOut error caught but will proceed with token removal');\n }\n}\nconst isSessionRevocable = (token) => !!token?.payload?.origin_jti;\n\nexport { signOut };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createSignUpClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('SignUp'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createSignUpClient };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { toAttributeType } from '../utils/apiHelpers.mjs';\nimport { setUsernameUsedForAutoSignIn, setAutoSignInStarted, isSignUpComplete, isAutoSignInStarted, autoSignInUserConfirmed, handleCodeAutoSignIn, autoSignInWhenUserIsConfirmedWithLink } from '../utils/signUpHelpers.mjs';\nimport { getUserContextData } from '../utils/userContextData.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createSignUpClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createSignUpClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { setAutoSignIn } from './autoSignIn.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Creates a user\n *\n * @param input - The SignUpInput object\n * @returns SignUpOutput\n * @throws service: {@link SignUpException } - Cognito service errors thrown during the sign-up process.\n * @throws validation: {@link AuthValidationErrorCode } - Validation errors thrown either username or password\n * are not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signUp(input) {\n const { username, password, options } = input;\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n const signUpVerificationMethod = authConfig?.signUpVerificationMethod ?? 'code';\n const { clientMetadata, validationData, autoSignIn } = input.options ?? {};\n assertTokenProviderConfig(authConfig);\n assertValidationError(!!username, AuthValidationErrorCode.EmptySignUpUsername);\n assertValidationError(!!password, AuthValidationErrorCode.EmptySignUpPassword);\n const signInServiceOptions = typeof autoSignIn !== 'boolean' ? autoSignIn : undefined;\n const signInInput = {\n username,\n options: signInServiceOptions,\n };\n // if the authFlowType is 'CUSTOM_WITHOUT_SRP' then we don't include the password\n if (signInServiceOptions?.authFlowType !== 'CUSTOM_WITHOUT_SRP') {\n signInInput.password = password;\n }\n if (signInServiceOptions || autoSignIn === true) {\n setUsernameUsedForAutoSignIn(username);\n setAutoSignInStarted(true);\n }\n const { userPoolId, userPoolClientId, userPoolEndpoint } = authConfig;\n const signUpClient = createSignUpClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const clientOutput = await signUpClient({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.SignUp),\n }, {\n Username: username,\n Password: password,\n UserAttributes: options?.userAttributes && toAttributeType(options?.userAttributes),\n ClientMetadata: clientMetadata,\n ValidationData: validationData && toAttributeType(validationData),\n ClientId: userPoolClientId,\n UserContextData: getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n }),\n });\n const { UserSub, CodeDeliveryDetails } = clientOutput;\n if (isSignUpComplete(clientOutput) && isAutoSignInStarted()) {\n setAutoSignIn(autoSignInUserConfirmed(signInInput));\n return {\n isSignUpComplete: true,\n nextStep: {\n signUpStep: 'COMPLETE_AUTO_SIGN_IN',\n },\n userId: UserSub,\n };\n }\n else if (isSignUpComplete(clientOutput) && !isAutoSignInStarted()) {\n return {\n isSignUpComplete: true,\n nextStep: {\n signUpStep: 'DONE',\n },\n userId: UserSub,\n };\n }\n else if (!isSignUpComplete(clientOutput) &&\n isAutoSignInStarted() &&\n signUpVerificationMethod === 'code') {\n handleCodeAutoSignIn(signInInput);\n }\n else if (!isSignUpComplete(clientOutput) &&\n isAutoSignInStarted() &&\n signUpVerificationMethod === 'link') {\n setAutoSignIn(autoSignInWhenUserIsConfirmedWithLink(signInInput));\n return {\n isSignUpComplete: false,\n nextStep: {\n signUpStep: 'COMPLETE_AUTO_SIGN_IN',\n codeDeliveryDetails: {\n deliveryMedium: CodeDeliveryDetails?.DeliveryMedium,\n destination: CodeDeliveryDetails?.Destination,\n attributeName: CodeDeliveryDetails?.AttributeName,\n },\n },\n userId: UserSub,\n };\n }\n return {\n isSignUpComplete: false,\n nextStep: {\n signUpStep: 'CONFIRM_SIGN_UP',\n codeDeliveryDetails: {\n deliveryMedium: CodeDeliveryDetails?.DeliveryMedium,\n destination: CodeDeliveryDetails?.Destination,\n attributeName: CodeDeliveryDetails?.AttributeName,\n },\n },\n userId: UserSub,\n };\n}\n\nexport { signUp };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst IdentityIdStorageKeys = {\n identityId: 'identityId',\n};\n\nexport { IdentityIdStorageKeys };\n","import { ConsoleLogger } from '@aws-amplify/core';\nimport { assertIdentityPoolIdConfig } from '@aws-amplify/core/internals/utils';\nimport { getAuthStorageKeys } from '../tokenProvider/TokenStore.mjs';\nimport { IdentityIdStorageKeys } from './types.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('DefaultIdentityIdStore');\nclass DefaultIdentityIdStore {\n setAuthConfig(authConfigParam) {\n assertIdentityPoolIdConfig(authConfigParam.Cognito);\n this.authConfig = authConfigParam;\n this._authKeys = createKeysForAuthStorage('Cognito', authConfigParam.Cognito.identityPoolId);\n }\n constructor(keyValueStorage) {\n this._authKeys = {};\n this._hasGuestIdentityId = false;\n this.keyValueStorage = keyValueStorage;\n }\n async loadIdentityId() {\n assertIdentityPoolIdConfig(this.authConfig?.Cognito);\n try {\n if (this._primaryIdentityId) {\n return {\n id: this._primaryIdentityId,\n type: 'primary',\n };\n }\n else {\n const storedIdentityId = await this.keyValueStorage.getItem(this._authKeys.identityId);\n if (storedIdentityId) {\n this._hasGuestIdentityId = true;\n return {\n id: storedIdentityId,\n type: 'guest',\n };\n }\n return null;\n }\n }\n catch (err) {\n logger.log('Error getting stored IdentityId.', err);\n return null;\n }\n }\n async storeIdentityId(identity) {\n assertIdentityPoolIdConfig(this.authConfig?.Cognito);\n if (identity.type === 'guest') {\n this.keyValueStorage.setItem(this._authKeys.identityId, identity.id);\n // Clear in-memory storage of primary identityId\n this._primaryIdentityId = undefined;\n this._hasGuestIdentityId = true;\n }\n else {\n this._primaryIdentityId = identity.id;\n // Clear locally stored guest id\n if (this._hasGuestIdentityId) {\n this.keyValueStorage.removeItem(this._authKeys.identityId);\n this._hasGuestIdentityId = false;\n }\n }\n }\n async clearIdentityId() {\n this._primaryIdentityId = undefined;\n await this.keyValueStorage.removeItem(this._authKeys.identityId);\n }\n}\nconst createKeysForAuthStorage = (provider, identifier) => {\n return getAuthStorageKeys(IdentityIdStorageKeys)(`com.amplify.${provider}`, identifier);\n};\n\nexport { DefaultIdentityIdStore };\n","import { decodeJWT } from '@aws-amplify/core/internals/utils';\nimport { AuthError } from '../../../errors/AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction formLoginsMap(idToken) {\n const issuer = decodeJWT(idToken).payload.iss;\n const res = {};\n if (!issuer) {\n throw new AuthError({\n name: 'InvalidIdTokenException',\n message: 'Invalid Idtoken.',\n });\n }\n const domainName = issuer.replace(/(^\\w+:|^)\\/\\//, '');\n res[domainName] = idToken;\n return res;\n}\n\nexport { formLoginsMap };\n","import { ConsoleLogger, getId } from '@aws-amplify/core';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { getRegionFromIdentityPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { formLoginsMap } from './utils.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('CognitoIdentityIdProvider');\n/**\n * Provides a Cognito identityId\n *\n * @param tokens - The AuthTokens received after SignIn\n * @returns string\n * @throws configuration exceptions: `InvalidIdentityPoolIdException`\n * - Auth errors that may arise from misconfiguration.\n * @throws service exceptions: {@link GetIdException }\n */\nasync function cognitoIdentityIdProvider({ tokens, authConfig, identityIdStore, }) {\n identityIdStore.setAuthConfig({ Cognito: authConfig });\n // will return null only if there is no identityId cached or if there is an error retrieving it\n let identityId = await identityIdStore.loadIdentityId();\n // Tokens are available so return primary identityId\n if (tokens) {\n // If there is existing primary identityId in-memory return that\n if (identityId && identityId.type === 'primary') {\n return identityId.id;\n }\n else {\n const logins = tokens.idToken\n ? formLoginsMap(tokens.idToken.toString())\n : {};\n const generatedIdentityId = await generateIdentityId(logins, authConfig);\n if (identityId && identityId.id === generatedIdentityId) {\n logger.debug(`The guest identity ${identityId.id} has become the primary identity.`);\n }\n identityId = {\n id: generatedIdentityId,\n type: 'primary',\n };\n }\n }\n else {\n // If there is existing guest identityId cached return that\n if (identityId && identityId.type === 'guest') {\n return identityId.id;\n }\n else {\n identityId = {\n id: await generateIdentityId({}, authConfig),\n type: 'guest',\n };\n }\n }\n // Store in-memory or local storage depending on guest or primary identityId\n identityIdStore.storeIdentityId(identityId);\n return identityId.id;\n}\nasync function generateIdentityId(logins, authConfig) {\n const identityPoolId = authConfig?.identityPoolId;\n const region = getRegionFromIdentityPoolId(identityPoolId);\n // IdentityId is absent so get it using IdentityPoolId with Cognito's GetId API\n const idResult = \n // for a first-time user, this will return a brand new identity\n // for a returning user, this will retrieve the previous identity assocaited with the logins\n (await getId({\n region,\n }, {\n IdentityPoolId: identityPoolId,\n Logins: logins,\n })).IdentityId;\n if (!idResult) {\n throw new AuthError({\n name: 'GetIdResponseException',\n message: 'Received undefined response from getId operation',\n recoverySuggestion: 'Make sure to pass a valid identityPoolId in the configuration.',\n });\n }\n return idResult;\n}\n\nexport { cognitoIdentityIdProvider };\n","import { ConsoleLogger, getCredentialsForIdentity } from '@aws-amplify/core';\nimport { assertIdentityPoolIdConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { getRegionFromIdentityPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { assertIdTokenInAuthTokens } from '../utils/types.mjs';\nimport { cognitoIdentityIdProvider } from './IdentityIdProvider.mjs';\nimport { formLoginsMap } from './utils.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('CognitoCredentialsProvider');\nconst CREDENTIALS_TTL = 50 * 60 * 1000; // 50 min, can be modified on config if required in the future\nclass CognitoAWSCredentialsAndIdentityIdProvider {\n constructor(identityIdStore) {\n this._nextCredentialsRefresh = 0;\n this._identityIdStore = identityIdStore;\n }\n async clearCredentialsAndIdentityId() {\n logger.debug('Clearing out credentials and identityId');\n this._credentialsAndIdentityId = undefined;\n await this._identityIdStore.clearIdentityId();\n }\n async clearCredentials() {\n logger.debug('Clearing out in-memory credentials');\n this._credentialsAndIdentityId = undefined;\n }\n async getCredentialsAndIdentityId(getCredentialsOptions) {\n const isAuthenticated = getCredentialsOptions.authenticated;\n const { tokens } = getCredentialsOptions;\n const { authConfig } = getCredentialsOptions;\n try {\n assertIdentityPoolIdConfig(authConfig?.Cognito);\n }\n catch {\n // No identity pool configured, skipping\n return;\n }\n if (!isAuthenticated && !authConfig.Cognito.allowGuestAccess) {\n // TODO(V6): return partial result like Native platforms\n return;\n }\n const { forceRefresh } = getCredentialsOptions;\n const tokenHasChanged = this.hasTokenChanged(tokens);\n const identityId = await cognitoIdentityIdProvider({\n tokens,\n authConfig: authConfig.Cognito,\n identityIdStore: this._identityIdStore,\n });\n // Clear cached credentials when forceRefresh is true OR the cache token has changed\n if (forceRefresh || tokenHasChanged) {\n this.clearCredentials();\n }\n if (!isAuthenticated) {\n return this.getGuestCredentials(identityId, authConfig.Cognito);\n }\n else {\n assertIdTokenInAuthTokens(tokens);\n return this.credsForOIDCTokens(authConfig.Cognito, tokens, identityId);\n }\n }\n async getGuestCredentials(identityId, authConfig) {\n // Return existing in-memory cached credentials only if it exists, is not past it's lifetime and is unauthenticated credentials\n if (this._credentialsAndIdentityId &&\n !this.isPastTTL() &&\n this._credentialsAndIdentityId.isAuthenticatedCreds === false) {\n logger.info('returning stored credentials as they neither past TTL nor expired.');\n return this._credentialsAndIdentityId;\n }\n // Clear to discard if any authenticated credentials are set and start with a clean slate\n this.clearCredentials();\n const region = getRegionFromIdentityPoolId(authConfig.identityPoolId);\n // use identityId to obtain guest credentials\n // save credentials in-memory\n // No logins params should be passed for guest creds:\n // https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html\n const clientResult = await getCredentialsForIdentity({ region }, {\n IdentityId: identityId,\n });\n if (clientResult.Credentials &&\n clientResult.Credentials.AccessKeyId &&\n clientResult.Credentials.SecretKey) {\n this._nextCredentialsRefresh = new Date().getTime() + CREDENTIALS_TTL;\n const res = {\n credentials: {\n accessKeyId: clientResult.Credentials.AccessKeyId,\n secretAccessKey: clientResult.Credentials.SecretKey,\n sessionToken: clientResult.Credentials.SessionToken,\n expiration: clientResult.Credentials.Expiration,\n },\n identityId,\n };\n const identityIdRes = clientResult.IdentityId;\n if (identityIdRes) {\n res.identityId = identityIdRes;\n this._identityIdStore.storeIdentityId({\n id: identityIdRes,\n type: 'guest',\n });\n }\n this._credentialsAndIdentityId = {\n ...res,\n isAuthenticatedCreds: false,\n };\n return res;\n }\n else {\n throw new AuthError({\n name: 'CredentialsNotFoundException',\n message: `Cognito did not respond with either Credentials, AccessKeyId or SecretKey.`,\n });\n }\n }\n async credsForOIDCTokens(authConfig, authTokens, identityId) {\n if (this._credentialsAndIdentityId &&\n !this.isPastTTL() &&\n this._credentialsAndIdentityId.isAuthenticatedCreds === true) {\n logger.debug('returning stored credentials as they neither past TTL nor expired.');\n return this._credentialsAndIdentityId;\n }\n // Clear to discard if any unauthenticated credentials are set and start with a clean slate\n this.clearCredentials();\n const logins = authTokens.idToken\n ? formLoginsMap(authTokens.idToken.toString())\n : {};\n const region = getRegionFromIdentityPoolId(authConfig.identityPoolId);\n const clientResult = await getCredentialsForIdentity({ region }, {\n IdentityId: identityId,\n Logins: logins,\n });\n if (clientResult.Credentials &&\n clientResult.Credentials.AccessKeyId &&\n clientResult.Credentials.SecretKey) {\n const res = {\n credentials: {\n accessKeyId: clientResult.Credentials.AccessKeyId,\n secretAccessKey: clientResult.Credentials.SecretKey,\n sessionToken: clientResult.Credentials.SessionToken,\n expiration: clientResult.Credentials.Expiration,\n },\n identityId,\n };\n // Store the credentials in-memory along with the expiration\n this._credentialsAndIdentityId = {\n ...res,\n isAuthenticatedCreds: true,\n associatedIdToken: authTokens.idToken?.toString(),\n };\n this._nextCredentialsRefresh = new Date().getTime() + CREDENTIALS_TTL;\n const identityIdRes = clientResult.IdentityId;\n if (identityIdRes) {\n res.identityId = identityIdRes;\n this._identityIdStore.storeIdentityId({\n id: identityIdRes,\n type: 'primary',\n });\n }\n return res;\n }\n else {\n throw new AuthError({\n name: 'CredentialsException',\n message: `Cognito did not respond with either Credentials, AccessKeyId or SecretKey.`,\n });\n }\n }\n isPastTTL() {\n return this._nextCredentialsRefresh === undefined\n ? true\n : this._nextCredentialsRefresh <= Date.now();\n }\n hasTokenChanged(tokens) {\n return (!!tokens &&\n !!this._credentialsAndIdentityId?.associatedIdToken &&\n tokens.idToken?.toString() !==\n this._credentialsAndIdentityId.associatedIdToken);\n }\n}\n\nexport { CognitoAWSCredentialsAndIdentityIdProvider };\n","import { defaultStorage } from '@aws-amplify/core';\nimport { DefaultIdentityIdStore } from './IdentityIdStore.mjs';\nimport { CognitoAWSCredentialsAndIdentityIdProvider } from './credentialsProvider.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Cognito specific implmentation of the CredentialsProvider interface\n * that manages setting and getting of AWS Credentials.\n *\n * @throws configuration expections: `InvalidIdentityPoolIdException`\n * - Auth errors that may arise from misconfiguration.\n * @throws service expections: {@link GetCredentialsForIdentityException}, {@link GetIdException}\n *\n */\nconst cognitoCredentialsProvider = new CognitoAWSCredentialsAndIdentityIdProvider(new DefaultIdentityIdStore(defaultStorage));\n\nexport { CognitoAWSCredentialsAndIdentityIdProvider, DefaultIdentityIdStore, cognitoCredentialsProvider };\n","import { getDnsSuffix } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { COGNITO_IDP_SERVICE_NAME } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst cognitoUserPoolEndpointResolver = ({ region, }) => ({\n url: new AmplifyUrl(`https://${COGNITO_IDP_SERVICE_NAME}.${region}.${getDnsSuffix(region)}`),\n});\n\nexport { cognitoUserPoolEndpointResolver };\n","import { AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { cognitoUserPoolEndpointResolver } from '../../../foundation/cognitoUserPoolEndpointResolver.mjs';\n\nconst createCognitoUserPoolEndpointResolver = ({ endpointOverride }) => (input) => {\n if (endpointOverride) {\n return { url: new AmplifyUrl(endpointOverride) };\n }\n return cognitoUserPoolEndpointResolver(input);\n};\n\nexport { createCognitoUserPoolEndpointResolver };\n","const AuthTokenStorageKeys = {\n accessToken: 'accessToken',\n idToken: 'idToken',\n oidcProvider: 'oidcProvider',\n clockDrift: 'clockDrift',\n refreshToken: 'refreshToken',\n deviceKey: 'deviceKey',\n randomPasswordKey: 'randomPasswordKey',\n deviceGroupKey: 'deviceGroupKey',\n signInDetails: 'signInDetails',\n oauthMetadata: 'oauthMetadata',\n};\n\nexport { AuthTokenStorageKeys };\n","import { createAssertionFunction } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar TokenProviderErrorCode;\n(function (TokenProviderErrorCode) {\n TokenProviderErrorCode[\"InvalidAuthTokens\"] = \"InvalidAuthTokens\";\n})(TokenProviderErrorCode || (TokenProviderErrorCode = {}));\nconst tokenValidationErrorMap = {\n [TokenProviderErrorCode.InvalidAuthTokens]: {\n message: 'Invalid tokens.',\n recoverySuggestion: 'Make sure the tokens are valid.',\n },\n};\nconst assert = createAssertionFunction(tokenValidationErrorMap);\n\nexport { TokenProviderErrorCode, assert };\n","import { decodeJWT, assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { AuthTokenStorageKeys } from './types.mjs';\nimport { assert, TokenProviderErrorCode } from './errorHelpers.mjs';\n\nclass DefaultTokenStore {\n constructor() {\n this.name = 'CognitoIdentityServiceProvider'; // To be backwards compatible with V5, no migration needed\n }\n getKeyValueStorage() {\n if (!this.keyValueStorage) {\n throw new AuthError({\n name: 'KeyValueStorageNotFoundException',\n message: 'KeyValueStorage was not found in TokenStore',\n });\n }\n return this.keyValueStorage;\n }\n setKeyValueStorage(keyValueStorage) {\n this.keyValueStorage = keyValueStorage;\n }\n setAuthConfig(authConfig) {\n this.authConfig = authConfig;\n }\n async loadTokens() {\n // TODO(v6): migration logic should be here\n // Reading V5 tokens old format\n try {\n const authKeys = await this.getAuthKeys();\n const accessTokenString = await this.getKeyValueStorage().getItem(authKeys.accessToken);\n if (!accessTokenString) {\n throw new AuthError({\n name: 'NoSessionFoundException',\n message: 'Auth session was not found. Make sure to call signIn.',\n });\n }\n const accessToken = decodeJWT(accessTokenString);\n const itString = await this.getKeyValueStorage().getItem(authKeys.idToken);\n const idToken = itString ? decodeJWT(itString) : undefined;\n const refreshToken = (await this.getKeyValueStorage().getItem(authKeys.refreshToken)) ??\n undefined;\n const clockDriftString = (await this.getKeyValueStorage().getItem(authKeys.clockDrift)) ?? '0';\n const clockDrift = Number.parseInt(clockDriftString);\n const signInDetails = await this.getKeyValueStorage().getItem(authKeys.signInDetails);\n const tokens = {\n accessToken,\n idToken,\n refreshToken,\n deviceMetadata: (await this.getDeviceMetadata()) ?? undefined,\n clockDrift,\n username: await this.getLastAuthUser(),\n };\n if (signInDetails) {\n tokens.signInDetails = JSON.parse(signInDetails);\n }\n return tokens;\n }\n catch (err) {\n return null;\n }\n }\n async storeTokens(tokens) {\n assert(tokens !== undefined, TokenProviderErrorCode.InvalidAuthTokens);\n await this.clearTokens();\n const lastAuthUser = tokens.username;\n await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(), lastAuthUser);\n const authKeys = await this.getAuthKeys();\n await this.getKeyValueStorage().setItem(authKeys.accessToken, tokens.accessToken.toString());\n if (tokens.idToken) {\n await this.getKeyValueStorage().setItem(authKeys.idToken, tokens.idToken.toString());\n }\n if (tokens.refreshToken) {\n await this.getKeyValueStorage().setItem(authKeys.refreshToken, tokens.refreshToken);\n }\n if (tokens.deviceMetadata) {\n if (tokens.deviceMetadata.deviceKey) {\n await this.getKeyValueStorage().setItem(authKeys.deviceKey, tokens.deviceMetadata.deviceKey);\n }\n if (tokens.deviceMetadata.deviceGroupKey) {\n await this.getKeyValueStorage().setItem(authKeys.deviceGroupKey, tokens.deviceMetadata.deviceGroupKey);\n }\n await this.getKeyValueStorage().setItem(authKeys.randomPasswordKey, tokens.deviceMetadata.randomPassword);\n }\n if (tokens.signInDetails) {\n await this.getKeyValueStorage().setItem(authKeys.signInDetails, JSON.stringify(tokens.signInDetails));\n }\n await this.getKeyValueStorage().setItem(authKeys.clockDrift, `${tokens.clockDrift}`);\n }\n async clearTokens() {\n const authKeys = await this.getAuthKeys();\n // Not calling clear because it can remove data that is not managed by AuthTokenStore\n await Promise.all([\n this.getKeyValueStorage().removeItem(authKeys.accessToken),\n this.getKeyValueStorage().removeItem(authKeys.idToken),\n this.getKeyValueStorage().removeItem(authKeys.clockDrift),\n this.getKeyValueStorage().removeItem(authKeys.refreshToken),\n this.getKeyValueStorage().removeItem(authKeys.signInDetails),\n this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),\n this.getKeyValueStorage().removeItem(authKeys.oauthMetadata),\n ]);\n }\n async getDeviceMetadata(username) {\n const authKeys = await this.getAuthKeys(username);\n const deviceKey = await this.getKeyValueStorage().getItem(authKeys.deviceKey);\n const deviceGroupKey = await this.getKeyValueStorage().getItem(authKeys.deviceGroupKey);\n const randomPassword = await this.getKeyValueStorage().getItem(authKeys.randomPasswordKey);\n return randomPassword && deviceGroupKey && deviceKey\n ? {\n deviceKey,\n deviceGroupKey,\n randomPassword,\n }\n : null;\n }\n async clearDeviceMetadata(username) {\n const authKeys = await this.getAuthKeys(username);\n await Promise.all([\n this.getKeyValueStorage().removeItem(authKeys.deviceKey),\n this.getKeyValueStorage().removeItem(authKeys.deviceGroupKey),\n this.getKeyValueStorage().removeItem(authKeys.randomPasswordKey),\n ]);\n }\n async getAuthKeys(username) {\n assertTokenProviderConfig(this.authConfig?.Cognito);\n const lastAuthUser = username ?? (await this.getLastAuthUser());\n return createKeysForAuthStorage(this.name, `${this.authConfig.Cognito.userPoolClientId}.${lastAuthUser}`);\n }\n getLastAuthUserKey() {\n assertTokenProviderConfig(this.authConfig?.Cognito);\n const identifier = this.authConfig.Cognito.userPoolClientId;\n return `${this.name}.${identifier}.LastAuthUser`;\n }\n async getLastAuthUser() {\n const lastAuthUser = (await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())) ??\n 'username';\n return lastAuthUser;\n }\n async setOAuthMetadata(metadata) {\n const { oauthMetadata: oauthMetadataKey } = await this.getAuthKeys();\n await this.getKeyValueStorage().setItem(oauthMetadataKey, JSON.stringify(metadata));\n }\n async getOAuthMetadata() {\n const { oauthMetadata: oauthMetadataKey } = await this.getAuthKeys();\n const oauthMetadata = await this.getKeyValueStorage().getItem(oauthMetadataKey);\n return oauthMetadata && JSON.parse(oauthMetadata);\n }\n}\nconst createKeysForAuthStorage = (provider, identifier) => {\n return getAuthStorageKeys(AuthTokenStorageKeys)(`${provider}`, identifier);\n};\nfunction getAuthStorageKeys(authKeys) {\n const keys = Object.values({ ...authKeys });\n return (prefix, identifier) => keys.reduce((acc, authKey) => ({\n ...acc,\n [authKey]: `${prefix}.${identifier}.${authKey}`,\n }), {});\n}\n\nexport { DefaultTokenStore, createKeysForAuthStorage, getAuthStorageKeys };\n","import { decodeJWT, AmplifyError } from '@aws-amplify/core/internals/utils';\nimport { tokenOrchestrator } from './tokenProvider.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nasync function cacheCognitoTokens(AuthenticationResult) {\n if (AuthenticationResult.AccessToken) {\n const accessToken = decodeJWT(AuthenticationResult.AccessToken);\n const accessTokenIssuedAtInMillis = (accessToken.payload.iat || 0) * 1000;\n const currentTime = new Date().getTime();\n const clockDrift = accessTokenIssuedAtInMillis > 0\n ? accessTokenIssuedAtInMillis - currentTime\n : 0;\n let idToken;\n let refreshToken;\n let deviceMetadata;\n if (AuthenticationResult.RefreshToken) {\n refreshToken = AuthenticationResult.RefreshToken;\n }\n if (AuthenticationResult.IdToken) {\n idToken = decodeJWT(AuthenticationResult.IdToken);\n }\n if (AuthenticationResult?.NewDeviceMetadata) {\n deviceMetadata = AuthenticationResult.NewDeviceMetadata;\n }\n const tokens = {\n accessToken,\n idToken,\n refreshToken,\n clockDrift,\n deviceMetadata,\n username: AuthenticationResult.username,\n };\n if (AuthenticationResult?.signInDetails) {\n tokens.signInDetails = AuthenticationResult.signInDetails;\n }\n await tokenOrchestrator.setTokens({\n tokens,\n });\n }\n else {\n // This would be a service error\n throw new AmplifyError({\n message: 'Invalid tokens',\n name: 'InvalidTokens',\n recoverySuggestion: 'Check Cognito UserPool settings',\n });\n }\n}\n\nexport { cacheCognitoTokens };\n","import { deDupeAsyncFunction, assertTokenProviderConfig, decodeJWT } from '@aws-amplify/core/internals/utils';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { assertAuthTokensWithRefreshToken } from './types.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { createInitiateAuthClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createInitiateAuthClient.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getUserContextData } from './userContextData.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst refreshAuthTokensFunction = async ({ tokens, authConfig, username, }) => {\n assertTokenProviderConfig(authConfig?.Cognito);\n const { userPoolId, userPoolClientId, userPoolEndpoint } = authConfig.Cognito;\n const region = getRegionFromUserPoolId(userPoolId);\n assertAuthTokensWithRefreshToken(tokens);\n const refreshTokenString = tokens.refreshToken;\n const AuthParameters = {\n REFRESH_TOKEN: refreshTokenString,\n };\n if (tokens.deviceMetadata?.deviceKey) {\n AuthParameters.DEVICE_KEY = tokens.deviceMetadata.deviceKey;\n }\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const initiateAuth = createInitiateAuthClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const { AuthenticationResult } = await initiateAuth({ region }, {\n ClientId: userPoolClientId,\n AuthFlow: 'REFRESH_TOKEN_AUTH',\n AuthParameters,\n UserContextData,\n });\n const accessToken = decodeJWT(AuthenticationResult?.AccessToken ?? '');\n const idToken = AuthenticationResult?.IdToken\n ? decodeJWT(AuthenticationResult.IdToken)\n : undefined;\n const { iat } = accessToken.payload;\n // This should never happen. If it does, it's a bug from the service.\n if (!iat) {\n throw new AuthError({\n name: 'iatNotFoundException',\n message: 'iat not found in access token',\n });\n }\n const clockDrift = iat * 1000 - new Date().getTime();\n return {\n accessToken,\n idToken,\n clockDrift,\n refreshToken: refreshTokenString,\n username,\n };\n};\nconst refreshAuthTokens = deDupeAsyncFunction(refreshAuthTokensFunction);\nconst refreshAuthTokensWithoutDedupe = refreshAuthTokensFunction;\n\nexport { refreshAuthTokens, refreshAuthTokensWithoutDedupe };\n","import { Hub } from '@aws-amplify/core';\nimport { isBrowser, assertTokenProviderConfig, isTokenExpired, AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { oAuthStore } from '../utils/oauth/oAuthStore.mjs';\nimport { addInflightPromise } from '../utils/oauth/inflightPromise.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nclass TokenOrchestrator {\n constructor() {\n this.waitForInflightOAuth = isBrowser()\n ? async () => {\n if (!(await oAuthStore.loadOAuthInFlight())) {\n return;\n }\n if (this.inflightPromise) {\n return this.inflightPromise;\n }\n // when there is valid oauth config and there is an inflight oauth flow, try\n // to block async calls that require fetching tokens before the oauth flow completes\n // e.g. getCurrentUser, fetchAuthSession etc.\n this.inflightPromise = new Promise((resolve, _reject) => {\n addInflightPromise(resolve);\n });\n return this.inflightPromise;\n }\n : async () => {\n // no-op for non-browser environments\n };\n }\n setAuthConfig(authConfig) {\n oAuthStore.setAuthConfig(authConfig.Cognito);\n this.authConfig = authConfig;\n }\n setTokenRefresher(tokenRefresher) {\n this.tokenRefresher = tokenRefresher;\n }\n setAuthTokenStore(tokenStore) {\n this.tokenStore = tokenStore;\n }\n getTokenStore() {\n if (!this.tokenStore) {\n throw new AuthError({\n name: 'EmptyTokenStoreException',\n message: 'TokenStore not set',\n });\n }\n return this.tokenStore;\n }\n getTokenRefresher() {\n if (!this.tokenRefresher) {\n throw new AuthError({\n name: 'EmptyTokenRefresherException',\n message: 'TokenRefresher not set',\n });\n }\n return this.tokenRefresher;\n }\n async getTokens(options) {\n let tokens;\n try {\n assertTokenProviderConfig(this.authConfig?.Cognito);\n }\n catch (_err) {\n // Token provider not configured\n return null;\n }\n await this.waitForInflightOAuth();\n this.inflightPromise = undefined;\n tokens = await this.getTokenStore().loadTokens();\n const username = await this.getTokenStore().getLastAuthUser();\n if (tokens === null) {\n return null;\n }\n const idTokenExpired = !!tokens?.idToken &&\n isTokenExpired({\n expiresAt: (tokens.idToken?.payload?.exp ?? 0) * 1000,\n clockDrift: tokens.clockDrift ?? 0,\n });\n const accessTokenExpired = isTokenExpired({\n expiresAt: (tokens.accessToken?.payload?.exp ?? 0) * 1000,\n clockDrift: tokens.clockDrift ?? 0,\n });\n if (options?.forceRefresh || idTokenExpired || accessTokenExpired) {\n tokens = await this.refreshTokens({\n tokens,\n username,\n });\n if (tokens === null) {\n return null;\n }\n }\n return {\n accessToken: tokens?.accessToken,\n idToken: tokens?.idToken,\n signInDetails: tokens?.signInDetails,\n };\n }\n async refreshTokens({ tokens, username, }) {\n try {\n const { signInDetails } = tokens;\n const newTokens = await this.getTokenRefresher()({\n tokens,\n authConfig: this.authConfig,\n username,\n });\n newTokens.signInDetails = signInDetails;\n await this.setTokens({ tokens: newTokens });\n Hub.dispatch('auth', { event: 'tokenRefresh' }, 'Auth', AMPLIFY_SYMBOL);\n return newTokens;\n }\n catch (err) {\n return this.handleErrors(err);\n }\n }\n handleErrors(err) {\n assertServiceError(err);\n if (err.message !== 'Network error') {\n // TODO(v6): Check errors on client\n this.clearTokens();\n }\n Hub.dispatch('auth', {\n event: 'tokenRefresh_failure',\n data: { error: err },\n }, 'Auth', AMPLIFY_SYMBOL);\n if (err.name.startsWith('NotAuthorizedException')) {\n return null;\n }\n throw err;\n }\n async setTokens({ tokens }) {\n return this.getTokenStore().storeTokens(tokens);\n }\n async clearTokens() {\n return this.getTokenStore().clearTokens();\n }\n getDeviceMetadata(username) {\n return this.getTokenStore().getDeviceMetadata(username);\n }\n clearDeviceMetadata(username) {\n return this.getTokenStore().clearDeviceMetadata(username);\n }\n setOAuthMetadata(metadata) {\n return this.getTokenStore().setOAuthMetadata(metadata);\n }\n getOAuthMetadata() {\n return this.getTokenStore().getOAuthMetadata();\n }\n}\n\nexport { TokenOrchestrator };\n","import { defaultStorage } from '@aws-amplify/core';\nimport { refreshAuthTokens } from '../utils/refreshAuthTokens.mjs';\nimport { DefaultTokenStore } from './TokenStore.mjs';\nimport { TokenOrchestrator } from './TokenOrchestrator.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nclass CognitoUserPoolsTokenProvider {\n constructor() {\n this.authTokenStore = new DefaultTokenStore();\n this.authTokenStore.setKeyValueStorage(defaultStorage);\n this.tokenOrchestrator = new TokenOrchestrator();\n this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore);\n this.tokenOrchestrator.setTokenRefresher(refreshAuthTokens);\n }\n getTokens({ forceRefresh } = { forceRefresh: false }) {\n return this.tokenOrchestrator.getTokens({ forceRefresh });\n }\n setKeyValueStorage(keyValueStorage) {\n this.authTokenStore.setKeyValueStorage(keyValueStorage);\n }\n setAuthConfig(authConfig) {\n this.authTokenStore.setAuthConfig(authConfig);\n this.tokenOrchestrator.setAuthConfig(authConfig);\n }\n}\n\nexport { CognitoUserPoolsTokenProvider };\n","import { CognitoUserPoolsTokenProvider } from './CognitoUserPoolsTokenProvider.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * The default provider for the JWT access token and ID token issued from the configured Cognito user pool. It manages\n * the refresh and storage of the tokens. It stores the tokens in `window.localStorage` if available, and falls back to\n * in-memory storage if not.\n */\nconst cognitoUserPoolsTokenProvider = new CognitoUserPoolsTokenProvider();\nconst { tokenOrchestrator } = cognitoUserPoolsTokenProvider;\n\nexport { cognitoUserPoolsTokenProvider, tokenOrchestrator };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Transforms a user attributes object into an array of AttributeType objects.\n * @param attributes user attributes to be mapped to AttributeType objects.\n * @returns an array of AttributeType objects.\n */\nfunction toAttributeType(attributes) {\n return Object.entries(attributes).map(([key, value]) => ({\n Name: key,\n Value: value,\n }));\n}\n/**\n * Transforms an array of AttributeType objects into a user attributes object.\n *\n * @param attributes - an array of AttributeType objects.\n * @returns AuthUserAttributes object.\n */\nfunction toAuthUserAttribute(attributes) {\n const userAttributes = {};\n attributes?.forEach(attribute => {\n if (attribute.Name)\n userAttributes[attribute.Name] = attribute.Value;\n });\n return userAttributes;\n}\n\nexport { toAttributeType, toAuthUserAttribute };\n","import { Hub } from '@aws-amplify/core';\nimport { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';\nimport { getCurrentUser } from '../apis/getCurrentUser.mjs';\nimport { USER_UNAUTHENTICATED_EXCEPTION, UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION } from '../../../errors/constants.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst ERROR_MESSAGE = 'Unable to get user session following successful sign-in.';\nconst dispatchSignedInHubEvent = async () => {\n try {\n Hub.dispatch('auth', {\n event: 'signedIn',\n data: await getCurrentUser(),\n }, 'Auth', AMPLIFY_SYMBOL);\n }\n catch (error) {\n if (error.name === USER_UNAUTHENTICATED_EXCEPTION) {\n throw new AuthError({\n name: UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION,\n message: ERROR_MESSAGE,\n recoverySuggestion: 'This most likely is due to auth tokens not being persisted. If you are using cookie store, please ensure cookies can be correctly set from your server.',\n });\n }\n throw error;\n }\n};\n\nexport { ERROR_MESSAGE, dispatchSignedInHubEvent };\n","import { invalidPreferredRedirectUrlException, invalidOriginException, invalidRedirectException } from '../../../../errors/constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/** @internal */\nfunction getRedirectUrl(redirects, preferredRedirectUrl) {\n if (preferredRedirectUrl) {\n const redirectUrl = redirects?.find(redirect => redirect === preferredRedirectUrl);\n if (!redirectUrl) {\n throw invalidPreferredRedirectUrlException;\n }\n return redirectUrl;\n }\n else {\n const redirectUrlFromTheSameOrigin = redirects?.find(isSameOriginAndPathName) ??\n redirects?.find(isTheSameDomain);\n const redirectUrlFromDifferentOrigin = redirects?.find(isHttps) ?? redirects?.find(isHttp);\n if (redirectUrlFromTheSameOrigin) {\n return redirectUrlFromTheSameOrigin;\n }\n else if (redirectUrlFromDifferentOrigin) {\n throw invalidOriginException;\n }\n throw invalidRedirectException;\n }\n}\n// origin + pathname => https://example.com/app\nconst isSameOriginAndPathName = (redirect) => redirect.startsWith(\n// eslint-disable-next-line no-constant-binary-expression\nString(window.location.origin + window.location.pathname ?? '/'));\n// domain => outlook.live.com, github.com\nconst isTheSameDomain = (redirect) => redirect.includes(String(window.location.hostname));\nconst isHttp = (redirect) => redirect.startsWith('http://');\nconst isHttps = (redirect) => redirect.startsWith('https://');\n\nexport { getRedirectUrl };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst inflightPromises = [];\nconst addInflightPromise = (resolver) => {\n inflightPromises.push(resolver);\n};\nconst resolveAndClearInflightPromises = () => {\n while (inflightPromises.length) {\n inflightPromises.pop()?.();\n }\n};\n\nexport { addInflightPromise, resolveAndClearInflightPromises };\n","import { defaultStorage } from '@aws-amplify/core';\nimport { DefaultOAuthStore } from '../signInWithRedirectStore.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst oAuthStore = new DefaultOAuthStore(defaultStorage);\n\nexport { oAuthStore };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar AssociateSoftwareTokenException;\n(function (AssociateSoftwareTokenException) {\n AssociateSoftwareTokenException[\"ConcurrentModificationException\"] = \"ConcurrentModificationException\";\n AssociateSoftwareTokenException[\"ForbiddenException\"] = \"ForbiddenException\";\n AssociateSoftwareTokenException[\"InternalErrorException\"] = \"InternalErrorException\";\n AssociateSoftwareTokenException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n AssociateSoftwareTokenException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n AssociateSoftwareTokenException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n AssociateSoftwareTokenException[\"SoftwareTokenMFANotFoundException\"] = \"SoftwareTokenMFANotFoundException\";\n})(AssociateSoftwareTokenException || (AssociateSoftwareTokenException = {}));\nvar ChangePasswordException;\n(function (ChangePasswordException) {\n ChangePasswordException[\"ForbiddenException\"] = \"ForbiddenException\";\n ChangePasswordException[\"InternalErrorException\"] = \"InternalErrorException\";\n ChangePasswordException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n ChangePasswordException[\"InvalidPasswordException\"] = \"InvalidPasswordException\";\n ChangePasswordException[\"LimitExceededException\"] = \"LimitExceededException\";\n ChangePasswordException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n ChangePasswordException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n ChangePasswordException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n ChangePasswordException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n ChangePasswordException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n ChangePasswordException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ChangePasswordException || (ChangePasswordException = {}));\nvar ConfirmDeviceException;\n(function (ConfirmDeviceException) {\n ConfirmDeviceException[\"ForbiddenException\"] = \"ForbiddenException\";\n ConfirmDeviceException[\"InternalErrorException\"] = \"InternalErrorException\";\n ConfirmDeviceException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n ConfirmDeviceException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n ConfirmDeviceException[\"InvalidPasswordException\"] = \"InvalidPasswordException\";\n ConfirmDeviceException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n ConfirmDeviceException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n ConfirmDeviceException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n ConfirmDeviceException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n ConfirmDeviceException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n ConfirmDeviceException[\"UsernameExistsException\"] = \"UsernameExistsException\";\n ConfirmDeviceException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n ConfirmDeviceException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ConfirmDeviceException || (ConfirmDeviceException = {}));\nvar ConfirmForgotPasswordException;\n(function (ConfirmForgotPasswordException) {\n ConfirmForgotPasswordException[\"CodeMismatchException\"] = \"CodeMismatchException\";\n ConfirmForgotPasswordException[\"ExpiredCodeException\"] = \"ExpiredCodeException\";\n ConfirmForgotPasswordException[\"ForbiddenException\"] = \"ForbiddenException\";\n ConfirmForgotPasswordException[\"InternalErrorException\"] = \"InternalErrorException\";\n ConfirmForgotPasswordException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n ConfirmForgotPasswordException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n ConfirmForgotPasswordException[\"InvalidPasswordException\"] = \"InvalidPasswordException\";\n ConfirmForgotPasswordException[\"LimitExceededException\"] = \"LimitExceededException\";\n ConfirmForgotPasswordException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n ConfirmForgotPasswordException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n ConfirmForgotPasswordException[\"TooManyFailedAttemptsException\"] = \"TooManyFailedAttemptsException\";\n ConfirmForgotPasswordException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n ConfirmForgotPasswordException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n ConfirmForgotPasswordException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n ConfirmForgotPasswordException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n ConfirmForgotPasswordException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ConfirmForgotPasswordException || (ConfirmForgotPasswordException = {}));\nvar ConfirmSignUpException;\n(function (ConfirmSignUpException) {\n ConfirmSignUpException[\"AliasExistsException\"] = \"AliasExistsException\";\n ConfirmSignUpException[\"CodeMismatchException\"] = \"CodeMismatchException\";\n ConfirmSignUpException[\"ExpiredCodeException\"] = \"ExpiredCodeException\";\n ConfirmSignUpException[\"ForbiddenException\"] = \"ForbiddenException\";\n ConfirmSignUpException[\"InternalErrorException\"] = \"InternalErrorException\";\n ConfirmSignUpException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n ConfirmSignUpException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n ConfirmSignUpException[\"LimitExceededException\"] = \"LimitExceededException\";\n ConfirmSignUpException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n ConfirmSignUpException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n ConfirmSignUpException[\"TooManyFailedAttemptsException\"] = \"TooManyFailedAttemptsException\";\n ConfirmSignUpException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n ConfirmSignUpException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n ConfirmSignUpException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n ConfirmSignUpException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ConfirmSignUpException || (ConfirmSignUpException = {}));\nvar DeleteUserAttributesException;\n(function (DeleteUserAttributesException) {\n DeleteUserAttributesException[\"ForbiddenException\"] = \"ForbiddenException\";\n DeleteUserAttributesException[\"InternalErrorException\"] = \"InternalErrorException\";\n DeleteUserAttributesException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n DeleteUserAttributesException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n DeleteUserAttributesException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n DeleteUserAttributesException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n DeleteUserAttributesException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n DeleteUserAttributesException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n DeleteUserAttributesException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(DeleteUserAttributesException || (DeleteUserAttributesException = {}));\nvar DeleteUserException;\n(function (DeleteUserException) {\n DeleteUserException[\"ForbiddenException\"] = \"ForbiddenException\";\n DeleteUserException[\"InternalErrorException\"] = \"InternalErrorException\";\n DeleteUserException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n DeleteUserException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n DeleteUserException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n DeleteUserException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n DeleteUserException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n DeleteUserException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n DeleteUserException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(DeleteUserException || (DeleteUserException = {}));\nvar ForgetDeviceException;\n(function (ForgetDeviceException) {\n ForgetDeviceException[\"ForbiddenException\"] = \"ForbiddenException\";\n ForgetDeviceException[\"InternalErrorException\"] = \"InternalErrorException\";\n ForgetDeviceException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n ForgetDeviceException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n ForgetDeviceException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n ForgetDeviceException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n ForgetDeviceException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n ForgetDeviceException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n ForgetDeviceException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n ForgetDeviceException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ForgetDeviceException || (ForgetDeviceException = {}));\nvar ForgotPasswordException;\n(function (ForgotPasswordException) {\n ForgotPasswordException[\"CodeDeliveryFailureException\"] = \"CodeDeliveryFailureException\";\n ForgotPasswordException[\"ForbiddenException\"] = \"ForbiddenException\";\n ForgotPasswordException[\"InternalErrorException\"] = \"InternalErrorException\";\n ForgotPasswordException[\"InvalidEmailRoleAccessPolicyException\"] = \"InvalidEmailRoleAccessPolicyException\";\n ForgotPasswordException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n ForgotPasswordException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n ForgotPasswordException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n ForgotPasswordException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n ForgotPasswordException[\"LimitExceededException\"] = \"LimitExceededException\";\n ForgotPasswordException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n ForgotPasswordException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n ForgotPasswordException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n ForgotPasswordException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n ForgotPasswordException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n ForgotPasswordException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ForgotPasswordException || (ForgotPasswordException = {}));\nvar GetUserException;\n(function (GetUserException) {\n GetUserException[\"ForbiddenException\"] = \"ForbiddenException\";\n GetUserException[\"InternalErrorException\"] = \"InternalErrorException\";\n GetUserException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n GetUserException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n GetUserException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n GetUserException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n GetUserException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n GetUserException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n GetUserException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(GetUserException || (GetUserException = {}));\nvar GetIdException;\n(function (GetIdException) {\n GetIdException[\"ExternalServiceException\"] = \"ExternalServiceException\";\n GetIdException[\"InternalErrorException\"] = \"InternalErrorException\";\n GetIdException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n GetIdException[\"LimitExceededException\"] = \"LimitExceededException\";\n GetIdException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n GetIdException[\"ResourceConflictException\"] = \"ResourceConflictException\";\n GetIdException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n GetIdException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n})(GetIdException || (GetIdException = {}));\nvar GetCredentialsForIdentityException;\n(function (GetCredentialsForIdentityException) {\n GetCredentialsForIdentityException[\"ExternalServiceException\"] = \"ExternalServiceException\";\n GetCredentialsForIdentityException[\"InternalErrorException\"] = \"InternalErrorException\";\n GetCredentialsForIdentityException[\"InvalidIdentityPoolConfigurationException\"] = \"InvalidIdentityPoolConfigurationException\";\n GetCredentialsForIdentityException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n GetCredentialsForIdentityException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n GetCredentialsForIdentityException[\"ResourceConflictException\"] = \"ResourceConflictException\";\n GetCredentialsForIdentityException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n GetCredentialsForIdentityException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n})(GetCredentialsForIdentityException || (GetCredentialsForIdentityException = {}));\nvar GetUserAttributeVerificationException;\n(function (GetUserAttributeVerificationException) {\n GetUserAttributeVerificationException[\"CodeDeliveryFailureException\"] = \"CodeDeliveryFailureException\";\n GetUserAttributeVerificationException[\"ForbiddenException\"] = \"ForbiddenException\";\n GetUserAttributeVerificationException[\"InternalErrorException\"] = \"InternalErrorException\";\n GetUserAttributeVerificationException[\"InvalidEmailRoleAccessPolicyException\"] = \"InvalidEmailRoleAccessPolicyException\";\n GetUserAttributeVerificationException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n GetUserAttributeVerificationException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n GetUserAttributeVerificationException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n GetUserAttributeVerificationException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n GetUserAttributeVerificationException[\"LimitExceededException\"] = \"LimitExceededException\";\n GetUserAttributeVerificationException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n GetUserAttributeVerificationException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n GetUserAttributeVerificationException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n GetUserAttributeVerificationException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n GetUserAttributeVerificationException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n GetUserAttributeVerificationException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n GetUserAttributeVerificationException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n GetUserAttributeVerificationException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(GetUserAttributeVerificationException || (GetUserAttributeVerificationException = {}));\nvar GlobalSignOutException;\n(function (GlobalSignOutException) {\n GlobalSignOutException[\"ForbiddenException\"] = \"ForbiddenException\";\n GlobalSignOutException[\"InternalErrorException\"] = \"InternalErrorException\";\n GlobalSignOutException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n GlobalSignOutException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n GlobalSignOutException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n GlobalSignOutException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n GlobalSignOutException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n GlobalSignOutException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n})(GlobalSignOutException || (GlobalSignOutException = {}));\nvar InitiateAuthException;\n(function (InitiateAuthException) {\n InitiateAuthException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n InitiateAuthException[\"ForbiddenException\"] = \"ForbiddenException\";\n InitiateAuthException[\"InternalErrorException\"] = \"InternalErrorException\";\n InitiateAuthException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n InitiateAuthException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n InitiateAuthException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n InitiateAuthException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n InitiateAuthException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n InitiateAuthException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n InitiateAuthException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n InitiateAuthException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n InitiateAuthException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n InitiateAuthException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n InitiateAuthException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n InitiateAuthException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(InitiateAuthException || (InitiateAuthException = {}));\nvar ResendConfirmationException;\n(function (ResendConfirmationException) {\n ResendConfirmationException[\"CodeDeliveryFailureException\"] = \"CodeDeliveryFailureException\";\n ResendConfirmationException[\"ForbiddenException\"] = \"ForbiddenException\";\n ResendConfirmationException[\"InternalErrorException\"] = \"InternalErrorException\";\n ResendConfirmationException[\"InvalidEmailRoleAccessPolicyException\"] = \"InvalidEmailRoleAccessPolicyException\";\n ResendConfirmationException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n ResendConfirmationException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n ResendConfirmationException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n ResendConfirmationException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n ResendConfirmationException[\"LimitExceededException\"] = \"LimitExceededException\";\n ResendConfirmationException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n ResendConfirmationException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n ResendConfirmationException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n ResendConfirmationException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n ResendConfirmationException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n ResendConfirmationException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ResendConfirmationException || (ResendConfirmationException = {}));\nvar RespondToAuthChallengeException;\n(function (RespondToAuthChallengeException) {\n RespondToAuthChallengeException[\"AliasExistsException\"] = \"AliasExistsException\";\n RespondToAuthChallengeException[\"CodeMismatchException\"] = \"CodeMismatchException\";\n RespondToAuthChallengeException[\"ExpiredCodeException\"] = \"ExpiredCodeException\";\n RespondToAuthChallengeException[\"ForbiddenException\"] = \"ForbiddenException\";\n RespondToAuthChallengeException[\"InternalErrorException\"] = \"InternalErrorException\";\n RespondToAuthChallengeException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n RespondToAuthChallengeException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n RespondToAuthChallengeException[\"InvalidPasswordException\"] = \"InvalidPasswordException\";\n RespondToAuthChallengeException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n RespondToAuthChallengeException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n RespondToAuthChallengeException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n RespondToAuthChallengeException[\"MFAMethodNotFoundException\"] = \"MFAMethodNotFoundException\";\n RespondToAuthChallengeException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n RespondToAuthChallengeException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n RespondToAuthChallengeException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n RespondToAuthChallengeException[\"SoftwareTokenMFANotFoundException\"] = \"SoftwareTokenMFANotFoundException\";\n RespondToAuthChallengeException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n RespondToAuthChallengeException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n RespondToAuthChallengeException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n RespondToAuthChallengeException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n RespondToAuthChallengeException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(RespondToAuthChallengeException || (RespondToAuthChallengeException = {}));\nvar SetUserMFAPreferenceException;\n(function (SetUserMFAPreferenceException) {\n SetUserMFAPreferenceException[\"ForbiddenException\"] = \"ForbiddenException\";\n SetUserMFAPreferenceException[\"InternalErrorException\"] = \"InternalErrorException\";\n SetUserMFAPreferenceException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n SetUserMFAPreferenceException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n SetUserMFAPreferenceException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n SetUserMFAPreferenceException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n SetUserMFAPreferenceException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n SetUserMFAPreferenceException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(SetUserMFAPreferenceException || (SetUserMFAPreferenceException = {}));\nvar SignUpException;\n(function (SignUpException) {\n SignUpException[\"CodeDeliveryFailureException\"] = \"CodeDeliveryFailureException\";\n SignUpException[\"InternalErrorException\"] = \"InternalErrorException\";\n SignUpException[\"InvalidEmailRoleAccessPolicyException\"] = \"InvalidEmailRoleAccessPolicyException\";\n SignUpException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n SignUpException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n SignUpException[\"InvalidPasswordException\"] = \"InvalidPasswordException\";\n SignUpException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n SignUpException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n SignUpException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n SignUpException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n SignUpException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n SignUpException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n SignUpException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n SignUpException[\"UsernameExistsException\"] = \"UsernameExistsException\";\n})(SignUpException || (SignUpException = {}));\nvar UpdateUserAttributesException;\n(function (UpdateUserAttributesException) {\n UpdateUserAttributesException[\"AliasExistsException\"] = \"AliasExistsException\";\n UpdateUserAttributesException[\"CodeDeliveryFailureException\"] = \"CodeDeliveryFailureException\";\n UpdateUserAttributesException[\"CodeMismatchException\"] = \"CodeMismatchException\";\n UpdateUserAttributesException[\"ExpiredCodeException\"] = \"ExpiredCodeException\";\n UpdateUserAttributesException[\"ForbiddenException\"] = \"ForbiddenException\";\n UpdateUserAttributesException[\"InternalErrorException\"] = \"InternalErrorException\";\n UpdateUserAttributesException[\"InvalidEmailRoleAccessPolicyException\"] = \"InvalidEmailRoleAccessPolicyException\";\n UpdateUserAttributesException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n UpdateUserAttributesException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n UpdateUserAttributesException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n UpdateUserAttributesException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n UpdateUserAttributesException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n UpdateUserAttributesException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n UpdateUserAttributesException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n UpdateUserAttributesException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n UpdateUserAttributesException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n UpdateUserAttributesException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n UpdateUserAttributesException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n UpdateUserAttributesException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(UpdateUserAttributesException || (UpdateUserAttributesException = {}));\nvar VerifySoftwareTokenException;\n(function (VerifySoftwareTokenException) {\n VerifySoftwareTokenException[\"CodeMismatchException\"] = \"CodeMismatchException\";\n VerifySoftwareTokenException[\"EnableSoftwareTokenMFAException\"] = \"EnableSoftwareTokenMFAException\";\n VerifySoftwareTokenException[\"ForbiddenException\"] = \"ForbiddenException\";\n VerifySoftwareTokenException[\"InternalErrorException\"] = \"InternalErrorException\";\n VerifySoftwareTokenException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n VerifySoftwareTokenException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n VerifySoftwareTokenException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n VerifySoftwareTokenException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n VerifySoftwareTokenException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n VerifySoftwareTokenException[\"SoftwareTokenMFANotFoundException\"] = \"SoftwareTokenMFANotFoundException\";\n VerifySoftwareTokenException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n VerifySoftwareTokenException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n VerifySoftwareTokenException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(VerifySoftwareTokenException || (VerifySoftwareTokenException = {}));\nvar VerifyUserAttributeException;\n(function (VerifyUserAttributeException) {\n VerifyUserAttributeException[\"AliasExistsException\"] = \"AliasExistsException\";\n VerifyUserAttributeException[\"CodeMismatchException\"] = \"CodeMismatchException\";\n VerifyUserAttributeException[\"ExpiredCodeException\"] = \"ExpiredCodeException\";\n VerifyUserAttributeException[\"ForbiddenException\"] = \"ForbiddenException\";\n VerifyUserAttributeException[\"InternalErrorException\"] = \"InternalErrorException\";\n VerifyUserAttributeException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n VerifyUserAttributeException[\"LimitExceededException\"] = \"LimitExceededException\";\n VerifyUserAttributeException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n VerifyUserAttributeException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n VerifyUserAttributeException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n VerifyUserAttributeException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n VerifyUserAttributeException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n VerifyUserAttributeException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(VerifyUserAttributeException || (VerifyUserAttributeException = {}));\nvar UpdateDeviceStatusException;\n(function (UpdateDeviceStatusException) {\n UpdateDeviceStatusException[\"ForbiddenException\"] = \"ForbiddenException\";\n UpdateDeviceStatusException[\"InternalErrorException\"] = \"InternalErrorException\";\n UpdateDeviceStatusException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n UpdateDeviceStatusException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n UpdateDeviceStatusException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n UpdateDeviceStatusException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n UpdateDeviceStatusException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n UpdateDeviceStatusException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n UpdateDeviceStatusException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n UpdateDeviceStatusException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(UpdateDeviceStatusException || (UpdateDeviceStatusException = {}));\nvar ListDevicesException;\n(function (ListDevicesException) {\n ListDevicesException[\"ForbiddenException\"] = \"ForbiddenException\";\n ListDevicesException[\"InternalErrorException\"] = \"InternalErrorException\";\n ListDevicesException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n ListDevicesException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n ListDevicesException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n ListDevicesException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n ListDevicesException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n ListDevicesException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n ListDevicesException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n ListDevicesException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ListDevicesException || (ListDevicesException = {}));\nconst SETUP_TOTP_EXCEPTION = 'SetUpTOTPException';\n\nexport { AssociateSoftwareTokenException, ChangePasswordException, ConfirmDeviceException, ConfirmForgotPasswordException, ConfirmSignUpException, DeleteUserAttributesException, DeleteUserException, ForgetDeviceException, ForgotPasswordException, GetCredentialsForIdentityException, GetIdException, GetUserAttributeVerificationException, GetUserException, GlobalSignOutException, InitiateAuthException, ListDevicesException, ResendConfirmationException, RespondToAuthChallengeException, SETUP_TOTP_EXCEPTION, SetUserMFAPreferenceException, SignUpException, UpdateDeviceStatusException, UpdateUserAttributesException, VerifySoftwareTokenException, VerifyUserAttributeException };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createRespondToAuthChallengeClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('RespondToAuthChallenge'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createRespondToAuthChallengeClient };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createVerifySoftwareTokenClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('VerifySoftwareToken'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createVerifySoftwareTokenClient };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createAssociateSoftwareTokenClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('AssociateSoftwareToken'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createAssociateSoftwareTokenClient };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createConfirmDeviceClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('ConfirmDevice'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createConfirmDeviceClient };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst textEncoder = {\n convert(input) {\n return new TextEncoder().encode(input);\n },\n};\n\nexport { textEncoder };\n","/* eslint-disable */\n// @ts-nocheck -> BigInteger is already a vended utility\n// A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/\n//\n// All public methods have been removed except the following:\n// new BigInteger(a, b) (only radix 2, 4, 8, 16 and 32 supported)\n// toString (only radix 2, 4, 8, 16 and 32 supported)\n// negate\n// abs\n// compareTo\n// bitLength\n// mod\n// equals\n// add\n// subtract\n// multiply\n// divide\n// modPow\n/*\n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n// (public) Constructor\nfunction BigInteger(a, b) {\n if (a != null)\n this.fromString(a, b);\n}\n// return new, unset BigInteger\nfunction nbi() {\n return new BigInteger(null, null);\n}\n// Bits per digit\nlet dbits;\n// JavaScript engine analysis\nconst canary = 0xdeadbeefcafe;\nconst j_lm = (canary & 0xffffff) === 0xefcafe;\n// am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\nfunction am1(i, x, w, j, c, n) {\n while (--n >= 0) {\n const v = x * this[i++] + w[j] + c;\n c = Math.floor(v / 0x4000000);\n w[j++] = v & 0x3ffffff;\n }\n return c;\n}\n// am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\nfunction am2(i, x, w, j, c, n) {\n const xl = x & 0x7fff;\n const xh = x >> 15;\n while (--n >= 0) {\n let l = this[i] & 0x7fff;\n const h = this[i++] >> 15;\n const m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n return c;\n}\n// Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\nfunction am3(i, x, w, j, c, n) {\n const xl = x & 0x3fff;\n const xh = x >> 14;\n while (--n >= 0) {\n let l = this[i] & 0x3fff;\n const h = this[i++] >> 14;\n const m = xh * l + h * xl;\n l = xl * l + ((m & 0x3fff) << 14) + w[j] + c;\n c = (l >> 28) + (m >> 14) + xh * h;\n w[j++] = l & 0xfffffff;\n }\n return c;\n}\nconst inBrowser = typeof navigator !== 'undefined';\nif (inBrowser && j_lm && navigator.appName === 'Microsoft Internet Explorer') {\n BigInteger.prototype.am = am2;\n dbits = 30;\n}\nelse if (inBrowser && j_lm && navigator.appName !== 'Netscape') {\n BigInteger.prototype.am = am1;\n dbits = 26;\n}\nelse {\n // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n}\nBigInteger.prototype.DB = dbits;\nBigInteger.prototype.DM = (1 << dbits) - 1;\nBigInteger.prototype.DV = 1 << dbits;\nconst BI_FP = 52;\nBigInteger.prototype.FV = Math.pow(2, BI_FP);\nBigInteger.prototype.F1 = BI_FP - dbits;\nBigInteger.prototype.F2 = 2 * dbits - BI_FP;\n// Digit conversions\nconst BI_RM = '0123456789abcdefghijklmnopqrstuvwxyz';\nconst BI_RC = [];\nlet rr, vv;\nrr = '0'.charCodeAt(0);\nfor (vv = 0; vv <= 9; ++vv)\n BI_RC[rr++] = vv;\nrr = 'a'.charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv)\n BI_RC[rr++] = vv;\nrr = 'A'.charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv)\n BI_RC[rr++] = vv;\nfunction int2char(n) {\n return BI_RM.charAt(n);\n}\nfunction intAt(s, i) {\n const c = BI_RC[s.charCodeAt(i)];\n return c == null ? -1 : c;\n}\n// (protected) copy this to r\nfunction bnpCopyTo(r) {\n for (let i = this.t - 1; i >= 0; --i)\n r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n}\n// (protected) set from integer value x, -DV <= x < DV\nfunction bnpFromInt(x) {\n this.t = 1;\n this.s = x < 0 ? -1 : 0;\n if (x > 0)\n this[0] = x;\n else if (x < -1)\n this[0] = x + this.DV;\n else\n this.t = 0;\n}\n// return bigint initialized to value\nfunction nbv(i) {\n const r = nbi();\n r.fromInt(i);\n return r;\n}\n// (protected) set from string and radix\nfunction bnpFromString(s, b) {\n let k;\n if (b === 16)\n k = 4;\n else if (b === 8)\n k = 3;\n else if (b === 2)\n k = 1;\n else if (b === 32)\n k = 5;\n else if (b === 4)\n k = 2;\n else\n throw new Error('Only radix 2, 4, 8, 16, 32 are supported');\n this.t = 0;\n this.s = 0;\n let i = s.length;\n let mi = false;\n let sh = 0;\n while (--i >= 0) {\n const x = intAt(s, i);\n if (x < 0) {\n if (s.charAt(i) === '-')\n mi = true;\n continue;\n }\n mi = false;\n if (sh === 0)\n this[this.t++] = x;\n else if (sh + k > this.DB) {\n this[this.t - 1] |= (x & ((1 << (this.DB - sh)) - 1)) << sh;\n this[this.t++] = x >> (this.DB - sh);\n }\n else\n this[this.t - 1] |= x << sh;\n sh += k;\n if (sh >= this.DB)\n sh -= this.DB;\n }\n this.clamp();\n if (mi)\n BigInteger.ZERO.subTo(this, this);\n}\n// (protected) clamp off excess high words\nfunction bnpClamp() {\n const c = this.s & this.DM;\n while (this.t > 0 && this[this.t - 1] == c)\n --this.t;\n}\n// (public) return string representation in given radix\nfunction bnToString(b) {\n if (this.s < 0)\n return '-' + this.negate().toString(b);\n let k;\n if (b == 16)\n k = 4;\n else if (b === 8)\n k = 3;\n else if (b === 2)\n k = 1;\n else if (b === 32)\n k = 5;\n else if (b === 4)\n k = 2;\n else\n throw new Error('Only radix 2, 4, 8, 16, 32 are supported');\n const km = (1 << k) - 1;\n let d;\n let m = false;\n let r = '';\n let i = this.t;\n let p = this.DB - ((i * this.DB) % k);\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n }\n else {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0)\n m = true;\n if (m)\n r += int2char(d);\n }\n }\n return m ? r : '0';\n}\n// (public) -this\nfunction bnNegate() {\n const r = nbi();\n BigInteger.ZERO.subTo(this, r);\n return r;\n}\n// (public) |this|\nfunction bnAbs() {\n return this.s < 0 ? this.negate() : this;\n}\n// (public) return + if this > a, - if this < a, 0 if equal\nfunction bnCompareTo(a) {\n let r = this.s - a.s;\n if (r != 0)\n return r;\n let i = this.t;\n r = i - a.t;\n if (r != 0)\n return this.s < 0 ? -r : r;\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0)\n return r;\n return 0;\n}\n// returns bit length of the integer x\nfunction nbits(x) {\n let r = 1;\n let t;\n if ((t = x >>> 16) !== 0) {\n x = t;\n r += 16;\n }\n if ((t = x >> 8) !== 0) {\n x = t;\n r += 8;\n }\n if ((t = x >> 4) !== 0) {\n x = t;\n r += 4;\n }\n if ((t = x >> 2) !== 0) {\n x = t;\n r += 2;\n }\n if ((t = x >> 1) !== 0) {\n x = t;\n r += 1;\n }\n return r;\n}\n// (public) return the number of bits in \"this\"\nfunction bnBitLength() {\n if (this.t <= 0)\n return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}\n// (protected) r = this << n*DB\nfunction bnpDLShiftTo(n, r) {\n let i;\n for (i = this.t - 1; i >= 0; --i)\n r[i + n] = this[i];\n for (i = n - 1; i >= 0; --i)\n r[i] = 0;\n r.t = this.t + n;\n r.s = this.s;\n}\n// (protected) r = this >> n*DB\nfunction bnpDRShiftTo(n, r) {\n for (let i = n; i < this.t; ++i)\n r[i - n] = this[i];\n r.t = Math.max(this.t - n, 0);\n r.s = this.s;\n}\n// (protected) r = this << n\nfunction bnpLShiftTo(n, r) {\n const bs = n % this.DB;\n const cbs = this.DB - bs;\n const bm = (1 << cbs) - 1;\n const ds = Math.floor(n / this.DB);\n let c = (this.s << bs) & this.DM;\n let i;\n for (i = this.t - 1; i >= 0; --i) {\n r[i + ds + 1] = (this[i] >> cbs) | c;\n c = (this[i] & bm) << bs;\n }\n for (i = ds - 1; i >= 0; --i)\n r[i] = 0;\n r[ds] = c;\n r.t = this.t + ds + 1;\n r.s = this.s;\n r.clamp();\n}\n// (protected) r = this >> n\nfunction bnpRShiftTo(n, r) {\n r.s = this.s;\n const ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n const bs = n % this.DB;\n const cbs = this.DB - bs;\n const bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (let i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0)\n r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}\n// (protected) r = this - a\nfunction bnpSubTo(a, r) {\n let i = 0;\n let c = 0;\n const m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] - a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c -= a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while (i < a.t) {\n c -= a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c < -1)\n r[i++] = this.DV + c;\n else if (c > 0)\n r[i++] = c;\n r.t = i;\n r.clamp();\n}\n// (protected) r = this * a, r != this,a (HAC 14.12)\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyTo(a, r) {\n const x = this.abs();\n const y = a.abs();\n let i = x.t;\n r.t = i + y.t;\n while (--i >= 0)\n r[i] = 0;\n for (i = 0; i < y.t; ++i)\n r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n r.s = 0;\n r.clamp();\n if (this.s !== a.s)\n BigInteger.ZERO.subTo(r, r);\n}\n// (protected) r = this^2, r != this (HAC 14.16)\nfunction bnpSquareTo(r) {\n const x = this.abs();\n let i = (r.t = 2 * x.t);\n while (--i >= 0)\n r[i] = 0;\n for (i = 0; i < x.t - 1; ++i) {\n const c = x.am(i, x[i], r, 2 * i, 0, 1);\n if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >=\n x.DV) {\n r[i + x.t] -= x.DV;\n r[i + x.t + 1] = 1;\n }\n }\n if (r.t > 0)\n r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);\n r.s = 0;\n r.clamp();\n}\n// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m. q or r may be null.\nfunction bnpDivRemTo(m, q, r) {\n const pm = m.abs();\n if (pm.t <= 0)\n return;\n const pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null)\n q.fromInt(0);\n if (r != null)\n this.copyTo(r);\n return;\n }\n if (r === null)\n r = nbi();\n const y = nbi();\n const ts = this.s;\n const ms = m.s;\n const nsh = this.DB - nbits(pm[pm.t - 1]);\n // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n }\n else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n const ys = y.t;\n const y0 = y[ys - 1];\n if (y0 === 0)\n return;\n const yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n const d1 = this.FV / yt;\n const d2 = (1 << this.F1) / yt;\n const e = 1 << this.F2;\n let i = r.t;\n let j = i - ys;\n const t = q === null ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y);\n // \"negative\" y so we can replace sub with am later\n while (y.t < ys)\n y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n let qd = r[--i] === y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd)\n r.subTo(t, r);\n }\n }\n if (q !== null) {\n r.drShiftTo(ys, q);\n if (ts !== ms)\n BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0)\n r.rShiftTo(nsh, r);\n // Denormalize remainder\n if (ts < 0)\n BigInteger.ZERO.subTo(r, r);\n}\n// (public) this mod a\nfunction bnMod(a) {\n const r = nbi();\n this.abs().divRemTo(a, null, r);\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0)\n a.subTo(r, r);\n return r;\n}\n// (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n// justification:\n// xy == 1 (mod m)\n// xy = 1+km\n// xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply \"overflows\" differently from C/C++, so care is needed here.\nfunction bnpInvDigit() {\n if (this.t < 1)\n return 0;\n const x = this[0];\n if ((x & 1) === 0)\n return 0;\n let y = x & 3;\n // y == 1/x mod 2^2\n y = (y * (2 - (x & 0xf) * y)) & 0xf;\n // y == 1/x mod 2^4\n y = (y * (2 - (x & 0xff) * y)) & 0xff;\n // y == 1/x mod 2^8\n y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff;\n // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = (y * (2 - ((x * y) % this.DV))) % this.DV;\n // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return y > 0 ? this.DV - y : -y;\n}\nfunction bnEquals(a) {\n return this.compareTo(a) === 0;\n}\n// (protected) r = this + a\nfunction bnpAddTo(a, r) {\n let i = 0;\n let c = 0;\n const m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0)\n r[i++] = c;\n else if (c < -1)\n r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}\n// (public) this + a\nfunction bnAdd(a) {\n const r = nbi();\n this.addTo(a, r);\n return r;\n}\n// (public) this - a\nfunction bnSubtract(a) {\n const r = nbi();\n this.subTo(a, r);\n return r;\n}\n// (public) this * a\nfunction bnMultiply(a) {\n const r = nbi();\n this.multiplyTo(a, r);\n return r;\n}\n// (public) this / a\nfunction bnDivide(a) {\n const r = nbi();\n this.divRemTo(a, r, null);\n return r;\n}\n// Montgomery reduction\nfunction Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp & 0x7fff;\n this.mph = this.mp >> 15;\n this.um = (1 << (m.DB - 15)) - 1;\n this.mt2 = 2 * m.t;\n}\n// xR mod m\nfunction montConvert(x) {\n const r = nbi();\n x.abs().dlShiftTo(this.m.t, r);\n r.divRemTo(this.m, null, r);\n if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0)\n this.m.subTo(r, r);\n return r;\n}\n// x/R mod m\nfunction montRevert(x) {\n const r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n}\n// x = x/R mod m (HAC 14.32)\nfunction montReduce(x) {\n while (x.t <= this.mt2)\n // pad x so am has enough room later\n x[x.t++] = 0;\n for (let i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n let j = x[i] & 0x7fff;\n const u0 = (j * this.mpl +\n (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) &\n x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0)\n x.subTo(this.m, x);\n}\n// r = \"x^2/R mod m\"; x != r\nfunction montSqrTo(x, r) {\n x.squareTo(r);\n this.reduce(r);\n}\n// r = \"xy/R mod m\"; x,y != r\nfunction montMulTo(x, y, r) {\n x.multiplyTo(y, r);\n this.reduce(r);\n}\nMontgomery.prototype.convert = montConvert;\nMontgomery.prototype.revert = montRevert;\nMontgomery.prototype.reduce = montReduce;\nMontgomery.prototype.mulTo = montMulTo;\nMontgomery.prototype.sqrTo = montSqrTo;\n// (public) this^e % m (HAC 14.85)\nfunction bnModPow(e, m, callback) {\n let i = e.bitLength();\n let k;\n let r = nbv(1);\n const z = new Montgomery(m);\n if (i <= 0)\n return r;\n else if (i < 18)\n k = 1;\n else if (i < 48)\n k = 3;\n else if (i < 144)\n k = 4;\n else if (i < 768)\n k = 5;\n else\n k = 6;\n // precomputation\n const g = [];\n let n = 3;\n const k1 = k - 1;\n const km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n const g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n let j = e.t - 1;\n let w;\n let is1 = true;\n let r2 = nbi();\n let t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1)\n w = (e[j] >> (i - k1)) & km;\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\n if (j > 0)\n w |= e[j - 1] >> (this.DB + i - k1);\n }\n n = k;\n while ((w & 1) === 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0)\n z.sqrTo(r, r2);\n else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n while (j >= 0 && (e[j] & (1 << i)) === 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n const result = z.revert(r);\n callback(null, result);\n return result;\n}\n// protected\nBigInteger.prototype.copyTo = bnpCopyTo;\nBigInteger.prototype.fromInt = bnpFromInt;\nBigInteger.prototype.fromString = bnpFromString;\nBigInteger.prototype.clamp = bnpClamp;\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\nBigInteger.prototype.subTo = bnpSubTo;\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\nBigInteger.prototype.squareTo = bnpSquareTo;\nBigInteger.prototype.divRemTo = bnpDivRemTo;\nBigInteger.prototype.invDigit = bnpInvDigit;\nBigInteger.prototype.addTo = bnpAddTo;\n// public\nBigInteger.prototype.toString = bnToString;\nBigInteger.prototype.negate = bnNegate;\nBigInteger.prototype.abs = bnAbs;\nBigInteger.prototype.compareTo = bnCompareTo;\nBigInteger.prototype.bitLength = bnBitLength;\nBigInteger.prototype.mod = bnMod;\nBigInteger.prototype.equals = bnEquals;\nBigInteger.prototype.add = bnAdd;\nBigInteger.prototype.subtract = bnSubtract;\nBigInteger.prototype.multiply = bnMultiply;\nBigInteger.prototype.divide = bnDivide;\nBigInteger.prototype.modPow = bnModPow;\n// \"constants\"\nBigInteger.ZERO = nbv(0);\nBigInteger.ONE = nbv(1);\n\nexport { BigInteger as default };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * @internal\n */\nconst calculateS = async ({ a, g, k, x, B, N, U, }) => {\n return new Promise((resolve, reject) => {\n g.modPow(x, N, (outerErr, outerResult) => {\n if (outerErr) {\n reject(outerErr);\n return;\n }\n B.subtract(k.multiply(outerResult)).modPow(a.add(U.multiply(x)), N, (innerErr, innerResult) => {\n if (innerErr) {\n reject(innerErr);\n return;\n }\n resolve(innerResult.mod(N));\n });\n });\n });\n};\n\nexport { calculateS };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst INIT_N = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1' +\n '29024E088A67CC74020BBEA63B139B22514A08798E3404DD' +\n 'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245' +\n 'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' +\n 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D' +\n 'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F' +\n '83655D23DCA3AD961C62F356208552BB9ED529077096966D' +\n '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' +\n 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9' +\n 'DE2BCBF6955817183995497CEA956AE515D2261898FA0510' +\n '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64' +\n 'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7' +\n 'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B' +\n 'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C' +\n 'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31' +\n '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF';\nconst SHORT_TO_HEX = {};\nconst HEX_TO_SHORT = {};\nfor (let i = 0; i < 256; i++) {\n let encodedByte = i.toString(16).toLowerCase();\n if (encodedByte.length === 1) {\n encodedByte = `0${encodedByte}`;\n }\n SHORT_TO_HEX[i] = encodedByte;\n HEX_TO_SHORT[encodedByte] = i;\n}\n\nexport { HEX_TO_SHORT, INIT_N, SHORT_TO_HEX };\n","import { HEX_TO_SHORT } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Converts a hexadecimal encoded string to a Uint8Array of bytes.\n *\n * @param encoded The hexadecimal encoded string\n */\nconst getBytesFromHex = (encoded) => {\n if (encoded.length % 2 !== 0) {\n throw new Error('Hex encoded strings must have an even number length');\n }\n const out = new Uint8Array(encoded.length / 2);\n for (let i = 0; i < encoded.length; i += 2) {\n const encodedByte = encoded.slice(i, i + 2).toLowerCase();\n if (encodedByte in HEX_TO_SHORT) {\n out[i / 2] = HEX_TO_SHORT[encodedByte];\n }\n else {\n throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);\n }\n }\n return out;\n};\n\nexport { getBytesFromHex };\n","import { SHORT_TO_HEX } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Converts a Uint8Array of binary data to a hexadecimal encoded string.\n *\n * @param bytes The binary data to encode\n */\nconst getHexFromBytes = (bytes) => {\n let out = '';\n for (let i = 0; i < bytes.byteLength; i++) {\n out += SHORT_TO_HEX[bytes[i]];\n }\n return out;\n};\n\nexport { getHexFromBytes };\n","import { Sha256 } from '@aws-crypto/sha256-js';\nimport { getHexFromBytes } from './getHexFromBytes.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Calculate a hash from a `SourceData`\n * @param {SourceData} data Value to hash.\n * @returns {string} Hex-encoded hash.\n * @private\n */\nconst getHashFromData = (data) => {\n const sha256 = new Sha256();\n sha256.update(data);\n const hashedData = sha256.digestSync();\n const hashHexFromUint8 = getHexFromBytes(hashedData);\n return new Array(64 - hashHexFromUint8.length).join('0') + hashHexFromUint8;\n};\n\nexport { getHashFromData };\n","import { getBytesFromHex } from './getBytesFromHex.mjs';\nimport { getHashFromData } from './getHashFromData.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Calculate a hash from a hex string\n * @param {string} hexStr Value to hash.\n * @returns {string} Hex-encoded hash.\n * @private\n */\nconst getHashFromHex = (hexStr) => getHashFromData(getBytesFromHex(hexStr));\n\nexport { getHashFromHex };\n","import BigInteger from './BigInteger/BigInteger.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Tests if a hex string has it most significant bit set (case-insensitive regex)\n */\nconst HEX_MSB_REGEX = /^[89a-f]/i;\n/**\n * Returns an unambiguous, even-length hex string of the two's complement encoding of an integer.\n *\n * It is compatible with the hex encoding of Java's BigInteger's toByteArray(), wich returns a\n * byte array containing the two's-complement representation of a BigInteger. The array contains\n * the minimum number of bytes required to represent the BigInteger, including at least one sign bit.\n *\n * Examples showing how ambiguity is avoided by left padding with:\n * \t\"00\" (for positive values where the most-significant-bit is set)\n * \"FF\" (for negative values where the most-significant-bit is set)\n *\n * padHex(bigInteger.fromInt(-236)) === \"FF14\"\n * padHex(bigInteger.fromInt(20)) === \"14\"\n *\n * padHex(bigInteger.fromInt(-200)) === \"FF38\"\n * padHex(bigInteger.fromInt(56)) === \"38\"\n *\n * padHex(bigInteger.fromInt(-20)) === \"EC\"\n * padHex(bigInteger.fromInt(236)) === \"00EC\"\n *\n * padHex(bigInteger.fromInt(-56)) === \"C8\"\n * padHex(bigInteger.fromInt(200)) === \"00C8\"\n *\n * @param {AuthBigInteger} bigInt Number to encode.\n * @returns {String} even-length hex string of the two's complement encoding.\n */\nconst getPaddedHex = (bigInt) => {\n if (!(bigInt instanceof BigInteger)) {\n throw new Error('Not a BigInteger');\n }\n const isNegative = bigInt.compareTo(BigInteger.ZERO) < 0;\n /* Get a hex string for abs(bigInt) */\n let hexStr = bigInt.abs().toString(16);\n /* Pad hex to even length if needed */\n hexStr = hexStr.length % 2 !== 0 ? `0${hexStr}` : hexStr;\n /* Prepend \"00\" if the most significant bit is set */\n hexStr = HEX_MSB_REGEX.test(hexStr) ? `00${hexStr}` : hexStr;\n if (isNegative) {\n /* Flip the bits of the representation */\n const invertedNibbles = hexStr\n .split('')\n .map((x) => {\n const invertedNibble = ~parseInt(x, 16) & 0xf;\n return '0123456789ABCDEF'.charAt(invertedNibble);\n })\n .join('');\n /* After flipping the bits, add one to get the 2's complement representation */\n const flippedBitsBI = new BigInteger(invertedNibbles, 16).add(BigInteger.ONE);\n hexStr = flippedBitsBI.toString(16);\n /*\n For hex strings starting with 'FF8', 'FF' can be dropped, e.g. 0xFFFF80=0xFF80=0x80=-128\n\n Any sequence of '1' bits on the left can always be substituted with a single '1' bit\n without changing the represented value.\n\n This only happens in the case when the input is 80...00\n */\n if (hexStr.toUpperCase().startsWith('FF8')) {\n hexStr = hexStr.substring(2);\n }\n }\n return hexStr;\n};\n\nexport { getPaddedHex };\n","import BigInteger from '../BigInteger/BigInteger.mjs';\nimport { getHashFromHex } from '../getHashFromHex.mjs';\nimport { getPaddedHex } from '../getPaddedHex.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * @internal\n */\nconst calculateU = ({ A, B, }) => {\n const U = new BigInteger(getHashFromHex(getPaddedHex(A) + getPaddedHex(B)), 16);\n if (U.equals(BigInteger.ZERO)) {\n throw new Error('U cannot be zero.');\n }\n return U;\n};\n\nexport { calculateU };\n","import { Sha256 } from '@aws-crypto/sha256-js';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Standard HKDF algorithm.\n *\n * @param {Uint8Array} ikm Input key material.\n * @param {Uint8Array} salt Salt value.\n * @param {Uint8Array} info Context and application specific info.\n *\n * @returns {Uint8Array} Strong key material.\n *\n * @internal\n */\nconst getHkdfKey = (ikm, salt, info) => {\n const awsCryptoHash = new Sha256(salt);\n awsCryptoHash.update(ikm);\n const resultFromAWSCryptoPrk = awsCryptoHash.digestSync();\n const awsCryptoHashHmac = new Sha256(resultFromAWSCryptoPrk);\n awsCryptoHashHmac.update(info);\n const resultFromAWSCryptoHmac = awsCryptoHashHmac.digestSync();\n const hashHexFromAWSCrypto = resultFromAWSCryptoHmac;\n return hashHexFromAWSCrypto.slice(0, 16);\n};\n\nexport { getHkdfKey };\n","import { WordArray } from '@aws-amplify/core/internals/utils';\nimport { getBytesFromHex } from './getBytesFromHex.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns a Uint8Array with a sequence of random nBytes\n *\n * @param {number} nBytes\n * @returns {Uint8Array} fixed-length sequence of random bytes\n */\nconst getRandomBytes = (nBytes) => {\n const str = new WordArray().random(nBytes).toString();\n return getBytesFromHex(str);\n};\n\nexport { getRandomBytes };\n","import { base64Encoder } from '@aws-amplify/core/internals/utils';\nimport { getRandomBytes } from './getRandomBytes.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Helper function to generate a random string\n * @returns {string} a random value.\n *\n * @internal\n */\nconst getRandomString = () => base64Encoder.convert(getRandomBytes(40));\n\nexport { getRandomString };\n","import { AuthError } from '../../../../../errors/AuthError.mjs';\nimport { textEncoder } from '../../textEncoder/index.mjs';\nimport BigInteger from '../BigInteger/BigInteger.mjs';\nimport { calculateS } from '../calculate/calculateS.mjs';\nimport { calculateU } from '../calculate/calculateU.mjs';\nimport { getBytesFromHex } from '../getBytesFromHex.mjs';\nimport { getHashFromData } from '../getHashFromData.mjs';\nimport { getHashFromHex } from '../getHashFromHex.mjs';\nimport { getHexFromBytes } from '../getHexFromBytes.mjs';\nimport { getHkdfKey } from '../getHkdfKey.mjs';\nimport { getPaddedHex } from '../getPaddedHex.mjs';\nimport { getRandomBytes } from '../getRandomBytes.mjs';\nimport { getRandomString } from '../getRandomString.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/** @class */\nclass AuthenticationHelper {\n constructor({ userPoolName, a, g, A, N, }) {\n this.encoder = textEncoder;\n this.userPoolName = userPoolName;\n this.a = a;\n this.g = g;\n this.A = A;\n this.N = N;\n this.k = new BigInteger(getHashFromHex(`${getPaddedHex(N)}${getPaddedHex(g)}`), 16);\n }\n /**\n * @returns {string} Generated random value included in password hash.\n */\n getRandomPassword() {\n if (!this.randomPassword) {\n throw new AuthError({\n name: 'EmptyBigIntegerRandomPassword',\n message: 'random password is empty',\n });\n }\n return this.randomPassword;\n }\n /**\n * @returns {string} Generated random value included in devices hash.\n */\n getSaltToHashDevices() {\n if (!this.saltToHashDevices) {\n throw new AuthError({\n name: 'EmptyBigIntegersaltToHashDevices',\n message: 'saltToHashDevices is empty',\n });\n }\n return this.saltToHashDevices;\n }\n /**\n * @returns {string} Value used to verify devices.\n */\n getVerifierDevices() {\n if (!this.verifierDevices) {\n throw new AuthError({\n name: 'EmptyBigIntegerVerifierDevices',\n message: 'verifyDevices is empty',\n });\n }\n return this.verifierDevices;\n }\n /**\n * Generate salts and compute verifier.\n *\n * @param {string} deviceGroupKey Devices to generate verifier for.\n * @param {string} username User to generate verifier for.\n *\n * @returns {Promise}\n */\n async generateHashDevice(deviceGroupKey, username) {\n this.randomPassword = getRandomString();\n const combinedString = `${deviceGroupKey}${username}:${this.randomPassword}`;\n const hashedString = getHashFromData(combinedString);\n const hexRandom = getHexFromBytes(getRandomBytes(16));\n // The random hex will be unambiguously represented as a postive integer\n this.saltToHashDevices = getPaddedHex(new BigInteger(hexRandom, 16));\n return new Promise((resolve, reject) => {\n this.g.modPow(new BigInteger(getHashFromHex(this.saltToHashDevices + hashedString), 16), this.N, (err, result) => {\n if (err) {\n reject(err);\n return;\n }\n this.verifierDevices = getPaddedHex(result);\n resolve();\n });\n });\n }\n /**\n * Calculates the final HKDF key based on computed S value, computed U value and the key\n *\n * @param {String} username Username.\n * @param {String} password Password.\n * @param {AuthBigInteger} B Server B value.\n * @param {AuthBigInteger} salt Generated salt.\n */\n async getPasswordAuthenticationKey({ username, password, serverBValue, salt, }) {\n if (serverBValue.mod(this.N).equals(BigInteger.ZERO)) {\n throw new Error('B cannot be zero.');\n }\n const U = calculateU({\n A: this.A,\n B: serverBValue,\n });\n const usernamePassword = `${this.userPoolName}${username}:${password}`;\n const usernamePasswordHash = getHashFromData(usernamePassword);\n const x = new BigInteger(getHashFromHex(getPaddedHex(salt) + usernamePasswordHash), 16);\n const S = await calculateS({\n a: this.a,\n g: this.g,\n k: this.k,\n x,\n B: serverBValue,\n N: this.N,\n U,\n });\n const context = this.encoder.convert('Caldera Derived Key');\n const spacer = this.encoder.convert(String.fromCharCode(1));\n const info = new Uint8Array(context.byteLength + spacer.byteLength);\n info.set(context, 0);\n info.set(spacer, context.byteLength);\n const hkdfKey = getHkdfKey(getBytesFromHex(getPaddedHex(S)), getBytesFromHex(getPaddedHex(U)), info);\n return hkdfKey;\n }\n}\n\nexport { AuthenticationHelper as default };\n","import BigInteger from '../BigInteger/BigInteger.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * @internal\n */\nconst calculateA = async ({ a, g, N, }) => {\n return new Promise((resolve, reject) => {\n g.modPow(a, N, (err, A) => {\n if (err) {\n reject(err);\n return;\n }\n if (A.mod(N).equals(BigInteger.ZERO)) {\n reject(new Error('Illegal parameter. A mod N cannot be 0.'));\n return;\n }\n resolve(A);\n });\n });\n};\n\nexport { calculateA };\n","import AuthenticationHelper from './AuthenticationHelper/AuthenticationHelper.mjs';\nimport BigInteger from './BigInteger/BigInteger.mjs';\nimport { calculateA } from './calculate/calculateA.mjs';\nimport { INIT_N } from './constants.mjs';\nimport '@aws-crypto/sha256-js';\nimport { getHexFromBytes } from './getHexFromBytes.mjs';\nimport { getRandomBytes } from './getRandomBytes.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns a new {@link AuthenticationHelper} instance with randomly generated BigInteger seed\n *\n * @param userPoolName Cognito user pool name.\n * @returns An {@link AuthenticationHelper} instance.\n *\n * @internal\n */\nconst getAuthenticationHelper = async (userPoolName) => {\n const N = new BigInteger(INIT_N, 16);\n const g = new BigInteger('2', 16);\n const a = generateRandomBigInteger();\n const A = await calculateA({ a, g, N });\n return new AuthenticationHelper({ userPoolName, a, g, A, N });\n};\n/**\n * Generates a random BigInteger.\n *\n * @returns {BigInteger} a random value.\n */\nconst generateRandomBigInteger = () => {\n // This will be interpreted as a postive 128-bit integer\n const hexRandom = getHexFromBytes(getRandomBytes(128));\n // There is no need to do randomBigInt.mod(this.N - 1) as N (3072-bit) is > 128 bytes (1024-bit)\n return new BigInteger(hexRandom, 16);\n};\n\nexport { getAuthenticationHelper };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst MONTH_NAMES = [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec',\n];\nconst WEEK_NAMES = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\nconst getNowString = () => {\n const now = new Date();\n const weekDay = WEEK_NAMES[now.getUTCDay()];\n const month = MONTH_NAMES[now.getUTCMonth()];\n const day = now.getUTCDate();\n let hours = now.getUTCHours();\n if (hours < 10) {\n hours = `0${hours}`;\n }\n let minutes = now.getUTCMinutes();\n if (minutes < 10) {\n minutes = `0${minutes}`;\n }\n let seconds = now.getUTCSeconds();\n if (seconds < 10) {\n seconds = `0${seconds}`;\n }\n const year = now.getUTCFullYear();\n // ddd MMM D HH:mm:ss UTC YYYY\n const dateNow = `${weekDay} ${month} ${day} ${hours}:${minutes}:${seconds} UTC ${year}`;\n return dateNow;\n};\n\nexport { getNowString };\n","import { Sha256 } from '@aws-crypto/sha256-js';\nimport { base64Encoder, base64Decoder } from '@aws-amplify/core/internals/utils';\nimport { textEncoder } from '../textEncoder/index.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst getSignatureString = ({ userPoolName, username, challengeParameters, dateNow, hkdf, }) => {\n const bufUPIDaToB = textEncoder.convert(userPoolName);\n const bufUNaToB = textEncoder.convert(username);\n const bufSBaToB = urlB64ToUint8Array(challengeParameters.SECRET_BLOCK);\n const bufDNaToB = textEncoder.convert(dateNow);\n const bufConcat = new Uint8Array(bufUPIDaToB.byteLength +\n bufUNaToB.byteLength +\n bufSBaToB.byteLength +\n bufDNaToB.byteLength);\n bufConcat.set(bufUPIDaToB, 0);\n bufConcat.set(bufUNaToB, bufUPIDaToB.byteLength);\n bufConcat.set(bufSBaToB, bufUPIDaToB.byteLength + bufUNaToB.byteLength);\n bufConcat.set(bufDNaToB, bufUPIDaToB.byteLength + bufUNaToB.byteLength + bufSBaToB.byteLength);\n const awsCryptoHash = new Sha256(hkdf);\n awsCryptoHash.update(bufConcat);\n const resultFromAWSCrypto = awsCryptoHash.digestSync();\n const signatureString = base64Encoder.convert(resultFromAWSCrypto);\n return signatureString;\n};\nconst urlB64ToUint8Array = (base64String) => {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/');\n const rawData = base64Decoder.convert(base64);\n const outputArray = new Uint8Array(rawData.length);\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n};\n\nexport { getSignatureString };\n","import { Amplify } from '@aws-amplify/core';\nimport { AuthAction, assertTokenProviderConfig, AmplifyUrl, base64Encoder, getDeviceName } from '@aws-amplify/core/internals/utils';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { InitiateAuthException } from '../types/errors.mjs';\nimport { AuthErrorCodes } from '../../../common/AuthErrorStrings.mjs';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { USER_ALREADY_AUTHENTICATED_EXCEPTION } from '../../../errors/constants.mjs';\nimport { getCurrentUser } from '../apis/getCurrentUser.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { createInitiateAuthClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createInitiateAuthClient.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createRespondToAuthChallengeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.mjs';\nimport { createVerifySoftwareTokenClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createVerifySoftwareTokenClient.mjs';\nimport { createAssociateSoftwareTokenClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createAssociateSoftwareTokenClient.mjs';\nimport { createConfirmDeviceClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmDeviceClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { signInStore } from './signInStore.mjs';\nimport { assertDeviceMetadata } from './types.mjs';\nimport { getAuthenticationHelper } from './srp/getAuthenticationHelper.mjs';\nimport { getBytesFromHex } from './srp/getBytesFromHex.mjs';\nimport { getNowString } from './srp/getNowString.mjs';\nimport { getSignatureString } from './srp/getSignatureString.mjs';\nimport BigInteger from './srp/BigInteger/BigInteger.mjs';\nimport { getUserContextData } from './userContextData.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst USER_ATTRIBUTES = 'userAttributes.';\nasync function handleCustomChallenge({ challengeResponse, clientMetadata, session, username, config, tokenOrchestrator, }) {\n const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n const challengeResponses = {\n USERNAME: username,\n ANSWER: challengeResponse,\n };\n const deviceMetadata = await tokenOrchestrator?.getDeviceMetadata(username);\n if (deviceMetadata && deviceMetadata.deviceKey) {\n challengeResponses.DEVICE_KEY = deviceMetadata.deviceKey;\n }\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const jsonReq = {\n ChallengeName: 'CUSTOM_CHALLENGE',\n ChallengeResponses: challengeResponses,\n Session: session,\n ClientMetadata: clientMetadata,\n ClientId: userPoolClientId,\n UserContextData,\n };\n const respondToAuthChallenge = createRespondToAuthChallengeClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const response = await respondToAuthChallenge({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n }, jsonReq);\n if (response.ChallengeName === 'DEVICE_SRP_AUTH') {\n return handleDeviceSRPAuth({\n username,\n config,\n clientMetadata,\n session: response.Session,\n tokenOrchestrator,\n });\n }\n return response;\n}\nasync function handleMFASetupChallenge({ challengeResponse, username, clientMetadata, session, deviceName, config, }) {\n const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n const challengeResponses = {\n USERNAME: username,\n };\n const verifySoftwareToken = createVerifySoftwareTokenClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const { Session } = await verifySoftwareToken({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n }, {\n UserCode: challengeResponse,\n Session: session,\n FriendlyDeviceName: deviceName,\n });\n signInStore.dispatch({\n type: 'SET_SIGN_IN_SESSION',\n value: Session,\n });\n const jsonReq = {\n ChallengeName: 'MFA_SETUP',\n ChallengeResponses: challengeResponses,\n Session,\n ClientMetadata: clientMetadata,\n ClientId: userPoolClientId,\n };\n const respondToAuthChallenge = createRespondToAuthChallengeClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n return respondToAuthChallenge({ region: getRegionFromUserPoolId(userPoolId) }, jsonReq);\n}\nasync function handleSelectMFATypeChallenge({ challengeResponse, username, clientMetadata, session, config, }) {\n const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n assertValidationError(challengeResponse === 'TOTP' || challengeResponse === 'SMS', AuthValidationErrorCode.IncorrectMFAMethod);\n const challengeResponses = {\n USERNAME: username,\n ANSWER: mapMfaType(challengeResponse),\n };\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const jsonReq = {\n ChallengeName: 'SELECT_MFA_TYPE',\n ChallengeResponses: challengeResponses,\n Session: session,\n ClientMetadata: clientMetadata,\n ClientId: userPoolClientId,\n UserContextData,\n };\n const respondToAuthChallenge = createRespondToAuthChallengeClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n return respondToAuthChallenge({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n }, jsonReq);\n}\nasync function handleSMSMFAChallenge({ challengeResponse, clientMetadata, session, username, config, }) {\n const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n const challengeResponses = {\n USERNAME: username,\n SMS_MFA_CODE: challengeResponse,\n };\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const jsonReq = {\n ChallengeName: 'SMS_MFA',\n ChallengeResponses: challengeResponses,\n Session: session,\n ClientMetadata: clientMetadata,\n ClientId: userPoolClientId,\n UserContextData,\n };\n const respondToAuthChallenge = createRespondToAuthChallengeClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n return respondToAuthChallenge({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n }, jsonReq);\n}\nasync function handleSoftwareTokenMFAChallenge({ challengeResponse, clientMetadata, session, username, config, }) {\n const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n const challengeResponses = {\n USERNAME: username,\n SOFTWARE_TOKEN_MFA_CODE: challengeResponse,\n };\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const jsonReq = {\n ChallengeName: 'SOFTWARE_TOKEN_MFA',\n ChallengeResponses: challengeResponses,\n Session: session,\n ClientMetadata: clientMetadata,\n ClientId: userPoolClientId,\n UserContextData,\n };\n const respondToAuthChallenge = createRespondToAuthChallengeClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n return respondToAuthChallenge({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n }, jsonReq);\n}\nasync function handleCompleteNewPasswordChallenge({ challengeResponse, clientMetadata, session, username, requiredAttributes, config, }) {\n const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n const challengeResponses = {\n ...createAttributes(requiredAttributes),\n NEW_PASSWORD: challengeResponse,\n USERNAME: username,\n };\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const jsonReq = {\n ChallengeName: 'NEW_PASSWORD_REQUIRED',\n ChallengeResponses: challengeResponses,\n ClientMetadata: clientMetadata,\n Session: session,\n ClientId: userPoolClientId,\n UserContextData,\n };\n const respondToAuthChallenge = createRespondToAuthChallengeClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n return respondToAuthChallenge({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n }, jsonReq);\n}\nasync function handleUserPasswordAuthFlow(username, password, clientMetadata, config, tokenOrchestrator) {\n const { userPoolClientId, userPoolId, userPoolEndpoint } = config;\n const authParameters = {\n USERNAME: username,\n PASSWORD: password,\n };\n const deviceMetadata = await tokenOrchestrator.getDeviceMetadata(username);\n if (deviceMetadata && deviceMetadata.deviceKey) {\n authParameters.DEVICE_KEY = deviceMetadata.deviceKey;\n }\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const jsonReq = {\n AuthFlow: 'USER_PASSWORD_AUTH',\n AuthParameters: authParameters,\n ClientMetadata: clientMetadata,\n ClientId: userPoolClientId,\n UserContextData,\n };\n const initiateAuth = createInitiateAuthClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const response = await initiateAuth({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.SignIn),\n }, jsonReq);\n const activeUsername = response.ChallengeParameters?.USERNAME ??\n response.ChallengeParameters?.USER_ID_FOR_SRP ??\n username;\n setActiveSignInUsername(activeUsername);\n if (response.ChallengeName === 'DEVICE_SRP_AUTH')\n return handleDeviceSRPAuth({\n username: activeUsername,\n config,\n clientMetadata,\n session: response.Session,\n tokenOrchestrator,\n });\n return response;\n}\nasync function handleUserSRPAuthFlow(username, password, clientMetadata, config, tokenOrchestrator) {\n const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n const userPoolName = userPoolId?.split('_')[1] || '';\n const authenticationHelper = await getAuthenticationHelper(userPoolName);\n const authParameters = {\n USERNAME: username,\n SRP_A: authenticationHelper.A.toString(16),\n };\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const jsonReq = {\n AuthFlow: 'USER_SRP_AUTH',\n AuthParameters: authParameters,\n ClientMetadata: clientMetadata,\n ClientId: userPoolClientId,\n UserContextData,\n };\n const initiateAuth = createInitiateAuthClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const resp = await initiateAuth({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.SignIn),\n }, jsonReq);\n const { ChallengeParameters: challengeParameters, Session: session } = resp;\n const activeUsername = challengeParameters?.USERNAME ?? username;\n setActiveSignInUsername(activeUsername);\n return retryOnResourceNotFoundException(handlePasswordVerifierChallenge, [\n password,\n challengeParameters,\n clientMetadata,\n session,\n authenticationHelper,\n config,\n tokenOrchestrator,\n ], activeUsername, tokenOrchestrator);\n}\nasync function handleCustomAuthFlowWithoutSRP(username, clientMetadata, config, tokenOrchestrator) {\n const { userPoolClientId, userPoolId, userPoolEndpoint } = config;\n const authParameters = {\n USERNAME: username,\n };\n const deviceMetadata = await tokenOrchestrator.getDeviceMetadata(username);\n if (deviceMetadata && deviceMetadata.deviceKey) {\n authParameters.DEVICE_KEY = deviceMetadata.deviceKey;\n }\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const jsonReq = {\n AuthFlow: 'CUSTOM_AUTH',\n AuthParameters: authParameters,\n ClientMetadata: clientMetadata,\n ClientId: userPoolClientId,\n UserContextData,\n };\n const initiateAuth = createInitiateAuthClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const response = await initiateAuth({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.SignIn),\n }, jsonReq);\n const activeUsername = response.ChallengeParameters?.USERNAME ?? username;\n setActiveSignInUsername(activeUsername);\n if (response.ChallengeName === 'DEVICE_SRP_AUTH')\n return handleDeviceSRPAuth({\n username: activeUsername,\n config,\n clientMetadata,\n session: response.Session,\n tokenOrchestrator,\n });\n return response;\n}\nasync function handleCustomSRPAuthFlow(username, password, clientMetadata, config, tokenOrchestrator) {\n assertTokenProviderConfig(config);\n const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n const userPoolName = userPoolId?.split('_')[1] || '';\n const authenticationHelper = await getAuthenticationHelper(userPoolName);\n const authParameters = {\n USERNAME: username,\n SRP_A: authenticationHelper.A.toString(16),\n CHALLENGE_NAME: 'SRP_A',\n };\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const jsonReq = {\n AuthFlow: 'CUSTOM_AUTH',\n AuthParameters: authParameters,\n ClientMetadata: clientMetadata,\n ClientId: userPoolClientId,\n UserContextData,\n };\n const initiateAuth = createInitiateAuthClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const { ChallengeParameters: challengeParameters, Session: session } = await initiateAuth({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.SignIn),\n }, jsonReq);\n const activeUsername = challengeParameters?.USERNAME ?? username;\n setActiveSignInUsername(activeUsername);\n return retryOnResourceNotFoundException(handlePasswordVerifierChallenge, [\n password,\n challengeParameters,\n clientMetadata,\n session,\n authenticationHelper,\n config,\n tokenOrchestrator,\n ], activeUsername, tokenOrchestrator);\n}\nasync function handleDeviceSRPAuth({ username, config, clientMetadata, session, tokenOrchestrator, }) {\n const { userPoolId, userPoolEndpoint } = config;\n const clientId = config.userPoolClientId;\n const deviceMetadata = await tokenOrchestrator?.getDeviceMetadata(username);\n assertDeviceMetadata(deviceMetadata);\n const authenticationHelper = await getAuthenticationHelper(deviceMetadata.deviceGroupKey);\n const challengeResponses = {\n USERNAME: username,\n SRP_A: authenticationHelper.A.toString(16),\n DEVICE_KEY: deviceMetadata.deviceKey,\n };\n const jsonReqResponseChallenge = {\n ChallengeName: 'DEVICE_SRP_AUTH',\n ClientId: clientId,\n ChallengeResponses: challengeResponses,\n ClientMetadata: clientMetadata,\n Session: session,\n };\n const respondToAuthChallenge = createRespondToAuthChallengeClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const { ChallengeParameters: respondedChallengeParameters, Session } = await respondToAuthChallenge({ region: getRegionFromUserPoolId(userPoolId) }, jsonReqResponseChallenge);\n return handleDevicePasswordVerifier(username, respondedChallengeParameters, clientMetadata, Session, authenticationHelper, config, tokenOrchestrator);\n}\nasync function handleDevicePasswordVerifier(username, challengeParameters, clientMetadata, session, authenticationHelper, { userPoolId, userPoolClientId, userPoolEndpoint }, tokenOrchestrator) {\n const deviceMetadata = await tokenOrchestrator?.getDeviceMetadata(username);\n assertDeviceMetadata(deviceMetadata);\n const serverBValue = new BigInteger(challengeParameters?.SRP_B, 16);\n const salt = new BigInteger(challengeParameters?.SALT, 16);\n const { deviceKey } = deviceMetadata;\n const { deviceGroupKey } = deviceMetadata;\n const hkdf = await authenticationHelper.getPasswordAuthenticationKey({\n username: deviceMetadata.deviceKey,\n password: deviceMetadata.randomPassword,\n serverBValue,\n salt,\n });\n const dateNow = getNowString();\n const challengeResponses = {\n USERNAME: challengeParameters?.USERNAME ?? username,\n PASSWORD_CLAIM_SECRET_BLOCK: challengeParameters?.SECRET_BLOCK,\n TIMESTAMP: dateNow,\n PASSWORD_CLAIM_SIGNATURE: getSignatureString({\n username: deviceKey,\n userPoolName: deviceGroupKey,\n challengeParameters,\n dateNow,\n hkdf,\n }),\n DEVICE_KEY: deviceKey,\n };\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const jsonReqResponseChallenge = {\n ChallengeName: 'DEVICE_PASSWORD_VERIFIER',\n ClientId: userPoolClientId,\n ChallengeResponses: challengeResponses,\n Session: session,\n ClientMetadata: clientMetadata,\n UserContextData,\n };\n const respondToAuthChallenge = createRespondToAuthChallengeClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n return respondToAuthChallenge({ region: getRegionFromUserPoolId(userPoolId) }, jsonReqResponseChallenge);\n}\nasync function handlePasswordVerifierChallenge(password, challengeParameters, clientMetadata, session, authenticationHelper, config, tokenOrchestrator) {\n const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n const userPoolName = userPoolId?.split('_')[1] || '';\n const serverBValue = new BigInteger(challengeParameters?.SRP_B, 16);\n const salt = new BigInteger(challengeParameters?.SALT, 16);\n const username = challengeParameters?.USER_ID_FOR_SRP;\n if (!username)\n throw new AuthError({\n name: 'EmptyUserIdForSRPException',\n message: 'USER_ID_FOR_SRP was not found in challengeParameters',\n });\n const hkdf = await authenticationHelper.getPasswordAuthenticationKey({\n username,\n password,\n serverBValue,\n salt,\n });\n const dateNow = getNowString();\n const challengeResponses = {\n USERNAME: username,\n PASSWORD_CLAIM_SECRET_BLOCK: challengeParameters?.SECRET_BLOCK,\n TIMESTAMP: dateNow,\n PASSWORD_CLAIM_SIGNATURE: getSignatureString({\n username,\n userPoolName,\n challengeParameters,\n dateNow,\n hkdf,\n }),\n };\n const deviceMetadata = await tokenOrchestrator.getDeviceMetadata(username);\n if (deviceMetadata && deviceMetadata.deviceKey) {\n challengeResponses.DEVICE_KEY = deviceMetadata.deviceKey;\n }\n const UserContextData = getUserContextData({\n username,\n userPoolId,\n userPoolClientId,\n });\n const jsonReqResponseChallenge = {\n ChallengeName: 'PASSWORD_VERIFIER',\n ChallengeResponses: challengeResponses,\n ClientMetadata: clientMetadata,\n Session: session,\n ClientId: userPoolClientId,\n UserContextData,\n };\n const respondToAuthChallenge = createRespondToAuthChallengeClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const response = await respondToAuthChallenge({ region: getRegionFromUserPoolId(userPoolId) }, jsonReqResponseChallenge);\n if (response.ChallengeName === 'DEVICE_SRP_AUTH')\n return handleDeviceSRPAuth({\n username,\n config,\n clientMetadata,\n session: response.Session,\n tokenOrchestrator,\n });\n return response;\n}\nasync function getSignInResult(params) {\n const { challengeName, challengeParameters } = params;\n const authConfig = Amplify.getConfig().Auth?.Cognito;\n assertTokenProviderConfig(authConfig);\n switch (challengeName) {\n case 'CUSTOM_CHALLENGE':\n return {\n isSignedIn: false,\n nextStep: {\n signInStep: 'CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE',\n additionalInfo: challengeParameters,\n },\n };\n case 'MFA_SETUP': {\n const { signInSession, username } = signInStore.getState();\n if (!isMFATypeEnabled(challengeParameters, 'TOTP'))\n throw new AuthError({\n name: AuthErrorCodes.SignInException,\n message: `Cannot initiate MFA setup from available types: ${getMFATypes(parseMFATypes(challengeParameters.MFAS_CAN_SETUP))}`,\n });\n const associateSoftwareToken = createAssociateSoftwareTokenClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: authConfig.userPoolEndpoint,\n }),\n });\n const { Session, SecretCode: secretCode } = await associateSoftwareToken({ region: getRegionFromUserPoolId(authConfig.userPoolId) }, {\n Session: signInSession,\n });\n signInStore.dispatch({\n type: 'SET_SIGN_IN_SESSION',\n value: Session,\n });\n return {\n isSignedIn: false,\n nextStep: {\n signInStep: 'CONTINUE_SIGN_IN_WITH_TOTP_SETUP',\n totpSetupDetails: getTOTPSetupDetails(secretCode, username),\n },\n };\n }\n case 'NEW_PASSWORD_REQUIRED':\n return {\n isSignedIn: false,\n nextStep: {\n signInStep: 'CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED',\n missingAttributes: parseAttributes(challengeParameters.requiredAttributes),\n },\n };\n case 'SELECT_MFA_TYPE':\n return {\n isSignedIn: false,\n nextStep: {\n signInStep: 'CONTINUE_SIGN_IN_WITH_MFA_SELECTION',\n allowedMFATypes: getMFATypes(parseMFATypes(challengeParameters.MFAS_CAN_CHOOSE)),\n },\n };\n case 'SMS_MFA':\n return {\n isSignedIn: false,\n nextStep: {\n signInStep: 'CONFIRM_SIGN_IN_WITH_SMS_CODE',\n codeDeliveryDetails: {\n deliveryMedium: challengeParameters.CODE_DELIVERY_DELIVERY_MEDIUM,\n destination: challengeParameters.CODE_DELIVERY_DESTINATION,\n },\n },\n };\n case 'SOFTWARE_TOKEN_MFA':\n return {\n isSignedIn: false,\n nextStep: {\n signInStep: 'CONFIRM_SIGN_IN_WITH_TOTP_CODE',\n },\n };\n }\n // TODO: remove this error message for production apps\n throw new AuthError({\n name: AuthErrorCodes.SignInException,\n message: 'An error occurred during the sign in process. ' +\n `${challengeName} challengeName returned by the underlying service was not addressed.`,\n });\n}\nfunction getTOTPSetupDetails(secretCode, username) {\n return {\n sharedSecret: secretCode,\n getSetupUri: (appName, accountName) => {\n const totpUri = `otpauth://totp/${appName}:${accountName ?? username}?secret=${secretCode}&issuer=${appName}`;\n return new AmplifyUrl(totpUri);\n },\n };\n}\nfunction getSignInResultFromError(errorName) {\n if (errorName === InitiateAuthException.PasswordResetRequiredException) {\n return {\n isSignedIn: false,\n nextStep: { signInStep: 'RESET_PASSWORD' },\n };\n }\n else if (errorName === InitiateAuthException.UserNotConfirmedException) {\n return {\n isSignedIn: false,\n nextStep: { signInStep: 'CONFIRM_SIGN_UP' },\n };\n }\n}\nfunction parseAttributes(attributes) {\n if (!attributes)\n return [];\n const parsedAttributes = JSON.parse(attributes).map(att => att.includes(USER_ATTRIBUTES) ? att.replace(USER_ATTRIBUTES, '') : att);\n return parsedAttributes;\n}\nfunction createAttributes(attributes) {\n if (!attributes)\n return {};\n const newAttributes = {};\n Object.entries(attributes).forEach(([key, value]) => {\n if (value)\n newAttributes[`${USER_ATTRIBUTES}${key}`] = value;\n });\n return newAttributes;\n}\nasync function handleChallengeName(username, challengeName, session, challengeResponse, config, tokenOrchestrator, clientMetadata, options) {\n const userAttributes = options?.userAttributes;\n const deviceName = options?.friendlyDeviceName;\n switch (challengeName) {\n case 'SMS_MFA':\n return handleSMSMFAChallenge({\n challengeResponse,\n clientMetadata,\n session,\n username,\n config,\n });\n case 'SELECT_MFA_TYPE':\n return handleSelectMFATypeChallenge({\n challengeResponse,\n clientMetadata,\n session,\n username,\n config,\n });\n case 'MFA_SETUP':\n return handleMFASetupChallenge({\n challengeResponse,\n clientMetadata,\n session,\n username,\n deviceName,\n config,\n });\n case 'NEW_PASSWORD_REQUIRED':\n return handleCompleteNewPasswordChallenge({\n challengeResponse,\n clientMetadata,\n session,\n username,\n requiredAttributes: userAttributes,\n config,\n });\n case 'CUSTOM_CHALLENGE':\n return retryOnResourceNotFoundException(handleCustomChallenge, [\n {\n challengeResponse,\n clientMetadata,\n session,\n username,\n config,\n tokenOrchestrator,\n },\n ], username, tokenOrchestrator);\n case 'SOFTWARE_TOKEN_MFA':\n return handleSoftwareTokenMFAChallenge({\n challengeResponse,\n clientMetadata,\n session,\n username,\n config,\n });\n }\n // TODO: remove this error message for production apps\n throw new AuthError({\n name: AuthErrorCodes.SignInException,\n message: `An error occurred during the sign in process. \n\t\t${challengeName} challengeName returned by the underlying service was not addressed.`,\n });\n}\nfunction mapMfaType(mfa) {\n let mfaType = 'SMS_MFA';\n if (mfa === 'TOTP')\n mfaType = 'SOFTWARE_TOKEN_MFA';\n return mfaType;\n}\nfunction getMFAType(type) {\n if (type === 'SMS_MFA')\n return 'SMS';\n if (type === 'SOFTWARE_TOKEN_MFA')\n return 'TOTP';\n // TODO: log warning for unknown MFA type\n}\nfunction getMFATypes(types) {\n if (!types)\n return undefined;\n return types.map(getMFAType).filter(Boolean);\n}\nfunction parseMFATypes(mfa) {\n if (!mfa)\n return [];\n return JSON.parse(mfa);\n}\nfunction isMFATypeEnabled(challengeParams, mfaType) {\n const { MFAS_CAN_SETUP } = challengeParams;\n const mfaTypes = getMFATypes(parseMFATypes(MFAS_CAN_SETUP));\n if (!mfaTypes)\n return false;\n return mfaTypes.includes(mfaType);\n}\nasync function assertUserNotAuthenticated() {\n let authUser;\n try {\n authUser = await getCurrentUser();\n }\n catch (error) { }\n if (authUser && authUser.userId && authUser.username) {\n throw new AuthError({\n name: USER_ALREADY_AUTHENTICATED_EXCEPTION,\n message: 'There is already a signed in user.',\n recoverySuggestion: 'Call signOut before calling signIn again.',\n });\n }\n}\n/**\n * This function is used to kick off the device management flow.\n *\n * If an error is thrown while generating a hash device or calling the `ConfirmDevice`\n * client, then this API will ignore the error and return undefined. Otherwise the authentication\n * flow will not complete and the user won't be able to be signed in.\n *\n * @returns DeviceMetadata | undefined\n */\nasync function getNewDeviceMetadata({ userPoolId, userPoolEndpoint, newDeviceMetadata, accessToken, }) {\n if (!newDeviceMetadata)\n return undefined;\n const userPoolName = userPoolId.split('_')[1] || '';\n const authenticationHelper = await getAuthenticationHelper(userPoolName);\n const deviceKey = newDeviceMetadata?.DeviceKey;\n const deviceGroupKey = newDeviceMetadata?.DeviceGroupKey;\n try {\n await authenticationHelper.generateHashDevice(deviceGroupKey ?? '', deviceKey ?? '');\n }\n catch (errGenHash) {\n // TODO: log error here\n return undefined;\n }\n const deviceSecretVerifierConfig = {\n Salt: base64Encoder.convert(getBytesFromHex(authenticationHelper.getSaltToHashDevices())),\n PasswordVerifier: base64Encoder.convert(getBytesFromHex(authenticationHelper.getVerifierDevices())),\n };\n const randomPassword = authenticationHelper.getRandomPassword();\n try {\n const confirmDevice = createConfirmDeviceClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n await confirmDevice({ region: getRegionFromUserPoolId(userPoolId) }, {\n AccessToken: accessToken,\n DeviceName: await getDeviceName(),\n DeviceKey: newDeviceMetadata?.DeviceKey,\n DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n });\n return {\n deviceKey,\n deviceGroupKey,\n randomPassword,\n };\n }\n catch (error) {\n // TODO: log error here\n return undefined;\n }\n}\n/**\n * It will retry the function if the error is a `ResourceNotFoundException` and\n * will clean the device keys stored in the storage mechanism.\n *\n */\nasync function retryOnResourceNotFoundException(func, args, username, tokenOrchestrator) {\n try {\n return await func(...args);\n }\n catch (error) {\n if (error instanceof AuthError &&\n error.name === 'ResourceNotFoundException' &&\n error.message.includes('Device does not exist.')) {\n await tokenOrchestrator.clearDeviceMetadata(username);\n return func(...args);\n }\n throw error;\n }\n}\nfunction setActiveSignInUsername(username) {\n const { dispatch } = signInStore;\n dispatch({ type: 'SET_USERNAME', value: username });\n}\nfunction getActiveSignInUsername(username) {\n const state = signInStore.getState();\n return state.username ?? username;\n}\n\nexport { assertUserNotAuthenticated, createAttributes, getActiveSignInUsername, getMFAType, getMFATypes, getNewDeviceMetadata, getSignInResult, getSignInResultFromError, getTOTPSetupDetails, handleChallengeName, handleCompleteNewPasswordChallenge, handleCustomAuthFlowWithoutSRP, handleCustomChallenge, handleCustomSRPAuthFlow, handleMFASetupChallenge, handlePasswordVerifierChallenge, handleSMSMFAChallenge, handleSelectMFATypeChallenge, handleSoftwareTokenMFAChallenge, handleUserPasswordAuthFlow, handleUserSRPAuthFlow, isMFATypeEnabled, mapMfaType, parseAttributes, parseMFATypes, retryOnResourceNotFoundException, setActiveSignInUsername };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst signInReducer = (state, action) => {\n switch (action.type) {\n case 'SET_SIGN_IN_SESSION':\n return {\n ...state,\n signInSession: action.value,\n };\n case 'SET_SIGN_IN_STATE':\n return {\n ...action.value,\n };\n case 'SET_CHALLENGE_NAME':\n return {\n ...state,\n challengeName: action.value,\n };\n case 'SET_USERNAME':\n return {\n ...state,\n username: action.value,\n };\n case 'SET_INITIAL_STATE':\n return defaultState();\n default:\n return state;\n }\n};\nfunction defaultState() {\n return {\n username: undefined,\n challengeName: undefined,\n signInSession: undefined,\n };\n}\nconst createStore = reducer => {\n let currentState = reducer(defaultState(), { type: 'SET_INITIAL_STATE' });\n return {\n getState: () => currentState,\n dispatch: action => {\n currentState = reducer(currentState, action);\n },\n };\n};\nconst signInStore = createStore(signInReducer);\nfunction setActiveSignInState(state) {\n signInStore.dispatch({\n type: 'SET_SIGN_IN_STATE',\n value: state,\n });\n}\nfunction cleanActiveSignInState() {\n signInStore.dispatch({ type: 'SET_INITIAL_STATE' });\n}\n\nexport { cleanActiveSignInState, setActiveSignInState, signInStore };\n","import { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { getAuthStorageKeys } from '../tokenProvider/TokenStore.mjs';\nimport { OAuthStorageKeys } from './types.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst V5_HOSTED_UI_KEY = 'amplify-signin-with-hostedUI';\nconst name = 'CognitoIdentityServiceProvider';\nclass DefaultOAuthStore {\n constructor(keyValueStorage) {\n this.keyValueStorage = keyValueStorage;\n }\n async clearOAuthInflightData() {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n await Promise.all([\n this.keyValueStorage.removeItem(authKeys.inflightOAuth),\n this.keyValueStorage.removeItem(authKeys.oauthPKCE),\n this.keyValueStorage.removeItem(authKeys.oauthState),\n ]);\n }\n async clearOAuthData() {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n await this.clearOAuthInflightData();\n await this.keyValueStorage.removeItem(V5_HOSTED_UI_KEY); // remove in case a customer migrated an App from v5 to v6\n return this.keyValueStorage.removeItem(authKeys.oauthSignIn);\n }\n loadOAuthState() {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n return this.keyValueStorage.getItem(authKeys.oauthState);\n }\n storeOAuthState(state) {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n return this.keyValueStorage.setItem(authKeys.oauthState, state);\n }\n loadPKCE() {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n return this.keyValueStorage.getItem(authKeys.oauthPKCE);\n }\n storePKCE(pkce) {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n return this.keyValueStorage.setItem(authKeys.oauthPKCE, pkce);\n }\n setAuthConfig(authConfigParam) {\n this.cognitoConfig = authConfigParam;\n }\n async loadOAuthInFlight() {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n return ((await this.keyValueStorage.getItem(authKeys.inflightOAuth)) === 'true');\n }\n async storeOAuthInFlight(inflight) {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n await this.keyValueStorage.setItem(authKeys.inflightOAuth, `${inflight}`);\n }\n async loadOAuthSignIn() {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n const isLegacyHostedUISignIn = await this.keyValueStorage.getItem(V5_HOSTED_UI_KEY);\n const [isOAuthSignIn, preferPrivateSession] = (await this.keyValueStorage.getItem(authKeys.oauthSignIn))?.split(',') ??\n [];\n return {\n isOAuthSignIn: isOAuthSignIn === 'true' || isLegacyHostedUISignIn === 'true',\n preferPrivateSession: preferPrivateSession === 'true',\n };\n }\n async storeOAuthSignIn(oauthSignIn, preferPrivateSession = false) {\n assertTokenProviderConfig(this.cognitoConfig);\n const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n await this.keyValueStorage.setItem(authKeys.oauthSignIn, `${oauthSignIn},${preferPrivateSession}`);\n }\n}\nconst createKeysForAuthStorage = (provider, identifier) => {\n return getAuthStorageKeys(OAuthStorageKeys)(provider, identifier);\n};\n\nexport { DefaultOAuthStore };\n","import { HubInternal } from '@aws-amplify/core/internals/utils';\nimport { signIn } from '../apis/signIn.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { setAutoSignIn, resetAutoSignIn } from '../apis/autoSignIn.mjs';\nimport { AUTO_SIGN_IN_EXCEPTION } from '../../../errors/constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst MAX_AUTOSIGNIN_POLLING_MS = 3 * 60 * 1000;\nfunction handleCodeAutoSignIn(signInInput) {\n const stopHubListener = HubInternal.listen('auth-internal', async ({ payload }) => {\n switch (payload.event) {\n case 'confirmSignUp': {\n const response = payload.data;\n if (response?.isSignUpComplete) {\n HubInternal.dispatch('auth-internal', {\n event: 'autoSignIn',\n });\n setAutoSignIn(autoSignInWithCode(signInInput));\n stopHubListener();\n }\n }\n }\n });\n // This will stop the listener if confirmSignUp is not resolved.\n const timeOutId = setTimeout(() => {\n stopHubListener();\n setAutoSignInStarted(false);\n clearTimeout(timeOutId);\n resetAutoSignIn();\n }, MAX_AUTOSIGNIN_POLLING_MS);\n}\nfunction debounce(fun, delay) {\n let timer;\n return (args) => {\n if (!timer) {\n fun(...args);\n }\n clearTimeout(timer);\n timer = setTimeout(() => {\n timer = undefined;\n }, delay);\n };\n}\nfunction handleAutoSignInWithLink(signInInput, resolve, reject) {\n const start = Date.now();\n const autoSignInPollingIntervalId = setInterval(async () => {\n const elapsedTime = Date.now() - start;\n const maxTime = MAX_AUTOSIGNIN_POLLING_MS;\n if (elapsedTime > maxTime) {\n clearInterval(autoSignInPollingIntervalId);\n setAutoSignInStarted(false);\n reject(new AuthError({\n name: AUTO_SIGN_IN_EXCEPTION,\n message: 'The account was not confirmed on time.',\n recoverySuggestion: 'Try to verify your account by clicking the link sent your email or phone and then login manually.',\n }));\n resetAutoSignIn();\n }\n else {\n try {\n const signInOutput = await signIn(signInInput);\n if (signInOutput.nextStep.signInStep !== 'CONFIRM_SIGN_UP') {\n resolve(signInOutput);\n clearInterval(autoSignInPollingIntervalId);\n setAutoSignInStarted(false);\n resetAutoSignIn();\n }\n }\n catch (error) {\n clearInterval(autoSignInPollingIntervalId);\n setAutoSignInStarted(false);\n reject(error);\n resetAutoSignIn();\n }\n }\n }, 5000);\n}\nconst debouncedAutoSignInWithLink = debounce(handleAutoSignInWithLink, 300);\nconst debouncedAutoSignWithCodeOrUserConfirmed = debounce(handleAutoSignInWithCodeOrUserConfirmed, 300);\nlet autoSignInStarted = false;\nlet usernameUsedForAutoSignIn;\nfunction setUsernameUsedForAutoSignIn(username) {\n usernameUsedForAutoSignIn = username;\n}\nfunction isAutoSignInUserUsingConfirmSignUp(username) {\n return usernameUsedForAutoSignIn === username;\n}\nfunction isAutoSignInStarted() {\n return autoSignInStarted;\n}\nfunction setAutoSignInStarted(value) {\n if (value === false) {\n setUsernameUsedForAutoSignIn(undefined);\n }\n autoSignInStarted = value;\n}\nfunction isSignUpComplete(output) {\n return !!output.UserConfirmed;\n}\nfunction autoSignInWhenUserIsConfirmedWithLink(signInInput) {\n return async () => {\n return new Promise((resolve, reject) => {\n debouncedAutoSignInWithLink([signInInput, resolve, reject]);\n });\n };\n}\nasync function handleAutoSignInWithCodeOrUserConfirmed(signInInput, resolve, reject) {\n try {\n const output = await signIn(signInInput);\n resolve(output);\n resetAutoSignIn();\n }\n catch (error) {\n reject(error);\n resetAutoSignIn();\n }\n}\nfunction autoSignInWithCode(signInInput) {\n return async () => {\n return new Promise((resolve, reject) => {\n debouncedAutoSignWithCodeOrUserConfirmed([signInInput, resolve, reject]);\n });\n };\n}\nconst autoSignInUserConfirmed = autoSignInWithCode;\n\nexport { autoSignInUserConfirmed, autoSignInWhenUserIsConfirmedWithLink, handleCodeAutoSignIn, isAutoSignInStarted, isAutoSignInUserUsingConfirmSignUp, isSignUpComplete, setAutoSignInStarted, setUsernameUsedForAutoSignIn };\n","import { AuthError } from '../../../errors/AuthError.mjs';\nimport { TOKEN_REFRESH_EXCEPTION, USER_UNAUTHENTICATED_EXCEPTION, DEVICE_METADATA_NOT_FOUND_EXCEPTION } from '../../../errors/constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction isTypeUserPoolConfig(authConfig) {\n if (authConfig &&\n authConfig.Cognito.userPoolId &&\n authConfig.Cognito.userPoolClientId) {\n return true;\n }\n return false;\n}\nfunction assertAuthTokens(tokens) {\n if (!tokens || !tokens.accessToken) {\n throw new AuthError({\n name: USER_UNAUTHENTICATED_EXCEPTION,\n message: 'User needs to be authenticated to call this API.',\n recoverySuggestion: 'Sign in before calling this API again.',\n });\n }\n}\nfunction assertIdTokenInAuthTokens(tokens) {\n if (!tokens || !tokens.idToken) {\n throw new AuthError({\n name: USER_UNAUTHENTICATED_EXCEPTION,\n message: 'User needs to be authenticated to call this API.',\n recoverySuggestion: 'Sign in before calling this API again.',\n });\n }\n}\nconst oAuthTokenRefreshException = new AuthError({\n name: TOKEN_REFRESH_EXCEPTION,\n message: `Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. \n\tPlease change your oauth configuration to use 'code grant' flow.`,\n recoverySuggestion: `Please logout and change your Amplify configuration to use \"code grant\" flow. \n\tE.g { responseType: 'code' }`,\n});\nconst tokenRefreshException = new AuthError({\n name: USER_UNAUTHENTICATED_EXCEPTION,\n message: 'User needs to be authenticated to call this API.',\n recoverySuggestion: 'Sign in before calling this API again.',\n});\nfunction assertAuthTokensWithRefreshToken(tokens) {\n if (isAuthenticatedWithImplicitOauthFlow(tokens)) {\n throw oAuthTokenRefreshException;\n }\n if (!isAuthenticatedWithRefreshToken(tokens)) {\n throw tokenRefreshException;\n }\n}\nfunction assertDeviceMetadata(deviceMetadata) {\n if (!deviceMetadata ||\n !deviceMetadata.deviceKey ||\n !deviceMetadata.deviceGroupKey ||\n !deviceMetadata.randomPassword) {\n throw new AuthError({\n name: DEVICE_METADATA_NOT_FOUND_EXCEPTION,\n message: 'Either deviceKey, deviceGroupKey or secretPassword were not found during the sign-in process.',\n recoverySuggestion: 'Make sure to not clear storage after calling the signIn API.',\n });\n }\n}\nconst OAuthStorageKeys = {\n inflightOAuth: 'inflightOAuth',\n oauthSignIn: 'oauthSignIn',\n oauthPKCE: 'oauthPKCE',\n oauthState: 'oauthState',\n};\nfunction isAuthenticated(tokens) {\n return tokens?.accessToken || tokens?.idToken;\n}\nfunction isAuthenticatedWithRefreshToken(tokens) {\n return isAuthenticated(tokens) && tokens?.refreshToken;\n}\nfunction isAuthenticatedWithImplicitOauthFlow(tokens) {\n return isAuthenticated(tokens) && !tokens?.refreshToken;\n}\n\nexport { OAuthStorageKeys, assertAuthTokens, assertAuthTokensWithRefreshToken, assertDeviceMetadata, assertIdTokenInAuthTokens, isTypeUserPoolConfig, oAuthTokenRefreshException, tokenRefreshException };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction getUserContextData({ username, userPoolId, userPoolClientId, }) {\n if (typeof window === 'undefined') {\n return undefined;\n }\n const amazonCognitoAdvancedSecurityData = window\n .AmazonCognitoAdvancedSecurityData;\n if (typeof amazonCognitoAdvancedSecurityData === 'undefined') {\n return undefined;\n }\n const advancedSecurityData = amazonCognitoAdvancedSecurityData.getData(username, userPoolId, userPoolClientId);\n if (advancedSecurityData) {\n const userContextData = {\n EncodedData: advancedSecurityData,\n };\n return userContextData;\n }\n return {};\n}\n\nexport { getUserContextData };\n","import { getAmplifyUserAgent, Category } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst getAuthUserAgentValue = (action, customUserAgentDetails) => getAmplifyUserAgent({\n category: Category.Auth,\n action,\n ...customUserAgentDetails,\n});\n\nexport { getAuthUserAgentValue };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst openAuthSession = async (url) => {\n if (!window?.location) {\n return;\n }\n // enforce HTTPS\n window.location.href = url.replace('http://', 'https://');\n};\n\nexport { openAuthSession };\n"],"names":["validationErrorMap","AuthErrorStrings","AuthErrorCodes","AuthError","params","USER_UNAUTHENTICATED_EXCEPTION","USER_ALREADY_AUTHENTICATED_EXCEPTION","DEVICE_METADATA_NOT_FOUND_EXCEPTION","AUTO_SIGN_IN_EXCEPTION","INVALID_REDIRECT_EXCEPTION","INVALID_APP_SCHEME_EXCEPTION","INVALID_PREFERRED_REDIRECT_EXCEPTION","invalidRedirectException","invalidAppSchemeException","invalidPreferredRedirectUrlException","INVALID_ORIGIN_EXCEPTION","invalidOriginException","OAUTH_SIGNOUT_EXCEPTION","TOKEN_REFRESH_EXCEPTION","UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION","AuthValidationErrorCode","assertServiceError","error","assertValidationError","assertion","name","message","recoverySuggestion","COGNITO_IDP_SERVICE_NAME","DEFAULT_SERVICE_CLIENT_API_CONFIG","createInitiateAuthClient","config","disableCacheMiddlewareFactory","next","_","request","cognitoUserPoolTransferHandler","createUserPoolDeserializer","response","createUserPoolSerializer","operation","input","endpoint","headers","getSharedHeaders","body","buildHttpRpcRequest","url","getRegionFromUserPoolId","userPoolId","region","getRegionFromIdentityPoolId","identityPoolId","initialAutoSignIn","autoSignIn","setAutoSignIn","callback","resetAutoSignIn","createConfirmForgotPasswordClient","composeServiceApi","confirmResetPassword","authConfig","Amplify","userPoolClientId","userPoolEndpoint","username","newPassword","code","metadata","UserContextData","createCognitoUserPoolEndpointResolver","getAuthUserAgentValue","confirmSignIn","challengeResponse","options","challengeName","signInSession","signInDetails","clientMetaData","Session","handledChallengeName","AuthenticationResult","handledChallengeParameters","result","createConfirmSignUpClient","confirmSignUp","confirmationCode","clientMetadata","resolve","reject","signUpOut","stopListener","Hub","payload","createVerifyUserAttributeClient","confirmUserAttribute","userAttributeKey","tokens","fetchAuthSession","createGetUserClient","fetchUserAttributes","amplify","getUser","UserAttributes","getCurrentUser","sub","authUser","getSignInDetailsFromTokens","createResendConfirmationCodeClient","resendSignUpCode","resendConfirmationCode","CodeDeliveryDetails","DeliveryMedium","AttributeName","Destination","createForgotPasswordClient","resetPassword","codeDeliveryDetails","createGetUserAttributeVerificationCodeClient","sendUserAttributeVerificationCode","getUserAttributeVerificationCode","signInWithCustomAuth","password","retriedChallengeName","retiredChallengeParameters","activeUsername","dispatchSignedInHubEvent","signInWithCustomSRPAuth","signInWithSRP","signInWithUserPassword","retiredChallengeName","retriedChallengeParameters","signIn","authFlowType","logger","ConsoleLogger","type","log","authErrorMessages","NoUserPoolError","createOAuthError","AuthErrorTypes","flowCancelledMessage","validationFailedMessage","validationRecoverySuggestion","validateState","state","savedState","oAuthStore","validatedState","completeOAuthFlow","currentUrl","userAgentValue","clientId","redirectUri","responseType","domain","preferPrivateSession","urlParams","errorMessage","handleCodeFlow","handleImplicitFlow","oAuthTokenEndpoint","codeVerifier","oAuthTokenBody","k","v","access_token","refreshToken","id_token","token_type","expires_in","completeFlow","error_description","pairings","accum","isCustomState","urlSafeDecode","getCustomState","clearHistory","handleFailure","attemptCompleteOAuthFlow","loginWith","redirectSignIn","getRedirectUrl","err","isBrowser","cognitoHostedUIIdentityProviderMap","CODE_VERIFIER_CHARSET","generateCodeVerifier","length","randomBytes","value","codeChallenge","byte","generateCodeChallenge","awsCryptoHash","removePaddingChar","base64Encoder","base64Encoded","generateState","generateRandomString","listenForOAuthFlowCancellation","store","handleCancelOAuthFlow","event","signInWithRedirect","provider","oauthSignIn","oauthConfig","customState","scopes","randomState","urlSafeEncode","method","toCodeChallenge","queryString","oAuthUrl","openAuthSession","completeOAuthSignOut","clearCredentials","oAuthSignOutRedirect","redirectUrl","redirectSignOut","signoutUri","oAuthLogoutEndpoint","handleOAuthSignOut","cognitoConfig","tokenOrchestrator","isOAuthSignIn","oauthMetadata","createRevokeTokenClient","createGlobalSignOutClient","signOut","globalSignOut","clientSignOut","hasOAuthConfig","authTokens","isSessionRevocable","token","createSignUpClient","signUp","signUpVerificationMethod","validationData","signInServiceOptions","signInInput","clientOutput","UserSub","IdentityIdStorageKeys","DefaultIdentityIdStore","authConfigParam","createKeysForAuthStorage","keyValueStorage","storedIdentityId","identity","identifier","formLoginsMap","idToken","issuer","res","domainName","cognitoIdentityIdProvider","identityIdStore","identityId","logins","generatedIdentityId","generateIdentityId","idResult","getId","CREDENTIALS_TTL","CognitoAWSCredentialsAndIdentityIdProvider","getCredentialsOptions","isAuthenticated","forceRefresh","tokenHasChanged","clientResult","getCredentialsForIdentity","identityIdRes","cognitoCredentialsProvider","cognitoUserPoolEndpointResolver","getDnsSuffix","endpointOverride","AuthTokenStorageKeys","TokenProviderErrorCode","tokenValidationErrorMap","assert","createAssertionFunction","DefaultTokenStore","authKeys","accessTokenString","accessToken","itString","clockDriftString","clockDrift","lastAuthUser","deviceKey","deviceGroupKey","randomPassword","oauthMetadataKey","getAuthStorageKeys","keys","prefix","acc","authKey","cacheCognitoTokens","accessTokenIssuedAtInMillis","currentTime","deviceMetadata","refreshAuthTokensFunction","refreshTokenString","AuthParameters","initiateAuth","iat","refreshAuthTokens","deDupeAsyncFunction","refreshAuthTokensWithoutDedupe","TokenOrchestrator","_reject","tokenRefresher","tokenStore","idTokenExpired","accessTokenExpired","newTokens","CognitoUserPoolsTokenProvider","cognitoUserPoolsTokenProvider","toAttributeType","attributes","key","toAuthUserAttribute","userAttributes","attribute","ERROR_MESSAGE","redirects","preferredRedirectUrl","redirect","redirectUrlFromTheSameOrigin","isSameOriginAndPathName","isTheSameDomain","redirectUrlFromDifferentOrigin","isHttps","isHttp","inflightPromises","addInflightPromise","resolver","resolveAndClearInflightPromises","AssociateSoftwareTokenException","ChangePasswordException","ConfirmDeviceException","ConfirmForgotPasswordException","ConfirmSignUpException","DeleteUserAttributesException","DeleteUserException","ForgetDeviceException","ForgotPasswordException","GetUserException","GetIdException","GetCredentialsForIdentityException","GetUserAttributeVerificationException","GlobalSignOutException","InitiateAuthException","ResendConfirmationException","RespondToAuthChallengeException","SetUserMFAPreferenceException","SignUpException","UpdateUserAttributesException","VerifySoftwareTokenException","VerifyUserAttributeException","UpdateDeviceStatusException","ListDevicesException","SETUP_TOTP_EXCEPTION","createRespondToAuthChallengeClient","createVerifySoftwareTokenClient","createAssociateSoftwareTokenClient","createConfirmDeviceClient","textEncoder","BigInteger","a","b","nbi","dbits","j_lm","am1","i","x","w","j","c","n","am2","xl","xh","l","h","m","am3","inBrowser","BI_FP","BI_RM","BI_RC","rr","vv","int2char","intAt","s","bnpCopyTo","r","bnpFromInt","nbv","bnpFromString","mi","sh","bnpClamp","bnToString","km","d","p","bnNegate","bnAbs","bnCompareTo","nbits","t","bnBitLength","bnpDLShiftTo","bnpDRShiftTo","bnpLShiftTo","bs","cbs","bm","ds","bnpRShiftTo","bnpSubTo","bnpMultiplyTo","y","bnpSquareTo","bnpDivRemTo","q","pm","pt","ts","ms","nsh","ys","y0","yt","d1","d2","e","qd","bnMod","bnpInvDigit","bnEquals","bnpAddTo","bnAdd","bnSubtract","bnMultiply","bnDivide","Montgomery","montConvert","montRevert","montReduce","u0","montSqrTo","montMulTo","bnModPow","z","g","k1","g2","is1","r2","calculateS","B","N","U","outerErr","outerResult","innerErr","innerResult","INIT_N","SHORT_TO_HEX","HEX_TO_SHORT","encodedByte","getBytesFromHex","encoded","out","getHexFromBytes","bytes","getHashFromData","data","sha256","hashedData","hashHexFromUint8","getHashFromHex","hexStr","HEX_MSB_REGEX","getPaddedHex","bigInt","isNegative","invertedNibbles","invertedNibble","calculateU","A","getHkdfKey","ikm","salt","info","resultFromAWSCryptoPrk","awsCryptoHashHmac","getRandomBytes","nBytes","str","WordArray","getRandomString","AuthenticationHelper","userPoolName","combinedString","hashedString","hexRandom","serverBValue","usernamePassword","usernamePasswordHash","S","context","spacer","calculateA","getAuthenticationHelper","generateRandomBigInteger","MONTH_NAMES","WEEK_NAMES","getNowString","now","weekDay","month","day","hours","minutes","seconds","year","getSignatureString","challengeParameters","dateNow","hkdf","bufUPIDaToB","bufUNaToB","bufSBaToB","urlB64ToUint8Array","bufDNaToB","bufConcat","resultFromAWSCrypto","base64String","padding","base64","rawData","base64Decoder","outputArray","USER_ATTRIBUTES","handleCustomChallenge","session","challengeResponses","jsonReq","handleDeviceSRPAuth","handleMFASetupChallenge","deviceName","verifySoftwareToken","signInStore","handleSelectMFATypeChallenge","mapMfaType","handleSMSMFAChallenge","handleSoftwareTokenMFAChallenge","handleCompleteNewPasswordChallenge","requiredAttributes","createAttributes","handleUserPasswordAuthFlow","authParameters","setActiveSignInUsername","handleUserSRPAuthFlow","authenticationHelper","resp","retryOnResourceNotFoundException","handlePasswordVerifierChallenge","handleCustomAuthFlowWithoutSRP","handleCustomSRPAuthFlow","jsonReqResponseChallenge","respondToAuthChallenge","respondedChallengeParameters","handleDevicePasswordVerifier","getSignInResult","isMFATypeEnabled","getMFATypes","parseMFATypes","associateSoftwareToken","secretCode","getTOTPSetupDetails","parseAttributes","appName","accountName","totpUri","getSignInResultFromError","errorName","att","newAttributes","handleChallengeName","mfa","mfaType","getMFAType","types","challengeParams","MFAS_CAN_SETUP","mfaTypes","assertUserNotAuthenticated","getNewDeviceMetadata","newDeviceMetadata","deviceSecretVerifierConfig","getDeviceName","func","args","dispatch","getActiveSignInUsername","signInReducer","action","defaultState","reducer","currentState","setActiveSignInState","cleanActiveSignInState","V5_HOSTED_UI_KEY","DefaultOAuthStore","pkce","inflight","isLegacyHostedUISignIn","MAX_AUTOSIGNIN_POLLING_MS","handleCodeAutoSignIn","stopHubListener","autoSignInWithCode","timeOutId","setAutoSignInStarted","debounce","fun","delay","timer","handleAutoSignInWithLink","start","autoSignInPollingIntervalId","signInOutput","debouncedAutoSignInWithLink","debouncedAutoSignWithCodeOrUserConfirmed","handleAutoSignInWithCodeOrUserConfirmed","autoSignInStarted","usernameUsedForAutoSignIn","setUsernameUsedForAutoSignIn","isAutoSignInUserUsingConfirmSignUp","isAutoSignInStarted","isSignUpComplete","output","autoSignInWhenUserIsConfirmedWithLink","autoSignInUserConfirmed","isTypeUserPoolConfig","assertAuthTokens","assertIdTokenInAuthTokens","oAuthTokenRefreshException","tokenRefreshException","assertAuthTokensWithRefreshToken","isAuthenticatedWithImplicitOauthFlow","isAuthenticatedWithRefreshToken","assertDeviceMetadata","OAuthStorageKeys","getUserContextData","amazonCognitoAdvancedSecurityData","advancedSecurityData","customUserAgentDetails"],"sourceRoot":""}