{"version":3,"sources":["node_modules/@azure/msal-browser/dist/error/BrowserConfigurationAuthErrorCodes.mjs","node_modules/@azure/msal-browser/dist/error/BrowserConfigurationAuthError.mjs","node_modules/@azure/msal-browser/dist/cache/BrowserStorage.mjs","node_modules/@azure/msal-browser/dist/utils/BrowserProtocolUtils.mjs","node_modules/@azure/msal-browser/dist/cache/BrowserCacheManager.mjs","node_modules/@azure/msal-browser/dist/utils/BrowserUtils.mjs","node_modules/@azure/msal-browser/dist/packageMetadata.mjs","node_modules/@azure/msal-browser/dist/interaction_client/BaseInteractionClient.mjs","node_modules/@azure/msal-browser/dist/crypto/PkceGenerator.mjs","node_modules/@azure/msal-browser/dist/interaction_client/StandardInteractionClient.mjs","node_modules/@azure/msal-browser/dist/error/NativeAuthErrorCodes.mjs","node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeStatusCodes.mjs","node_modules/@azure/msal-browser/dist/error/NativeAuthError.mjs","node_modules/@azure/msal-browser/dist/interaction_client/SilentCacheClient.mjs","node_modules/@azure/msal-browser/dist/interaction_client/NativeInteractionClient.mjs","node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeMessageHandler.mjs","node_modules/@azure/msal-browser/dist/interaction_handler/InteractionHandler.mjs","node_modules/@azure/msal-browser/dist/response/ResponseHandler.mjs","node_modules/@azure/msal-browser/dist/interaction_client/PopupClient.mjs","node_modules/@azure/msal-browser/dist/interaction_handler/RedirectHandler.mjs","node_modules/@azure/msal-browser/dist/interaction_client/RedirectClient.mjs","node_modules/@azure/msal-browser/dist/navigation/NavigationClient.mjs","node_modules/@azure/msal-browser/dist/network/FetchClient.mjs","node_modules/@azure/msal-browser/dist/config/Configuration.mjs","node_modules/@azure/msal-browser/dist/interaction_handler/SilentHandler.mjs","node_modules/@azure/msal-browser/dist/interaction_client/SilentIframeClient.mjs","node_modules/@azure/msal-browser/dist/interaction_client/SilentRefreshClient.mjs","node_modules/@azure/msal-browser/dist/cache/TokenCache.mjs","node_modules/@azure/msal-browser/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs","node_modules/@azure/msal-browser/dist/interaction_client/SilentAuthCodeClient.mjs","node_modules/@azure/msal-browser/dist/controllers/StandardController.mjs"],"sourcesContent":["/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nconst storageNotSupported = \"storage_not_supported\";\nconst stubbedPublicClientApplicationCalled = \"stubbed_public_client_application_called\";\nconst inMemRedirectUnavailable = \"in_mem_redirect_unavailable\";\n\nexport { inMemRedirectUnavailable, storageNotSupported, stubbedPublicClientApplicationCalled };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { AuthError } from '@azure/msal-common';\nimport { storageNotSupported, stubbedPublicClientApplicationCalled, inMemRedirectUnavailable } from './BrowserConfigurationAuthErrorCodes.mjs';\nimport * as BrowserConfigurationAuthErrorCodes from './BrowserConfigurationAuthErrorCodes.mjs';\nexport { BrowserConfigurationAuthErrorCodes };\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nconst BrowserConfigurationAuthErrorMessages = {\n [storageNotSupported]: \"Given storage configuration option was not supported.\",\n [stubbedPublicClientApplicationCalled]: \"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors\",\n [inMemRedirectUnavailable]: \"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true.\",\n};\n/**\n * BrowserAuthErrorMessage class containing string constants used by error codes and messages.\n * @deprecated Use BrowserAuthErrorCodes instead\n */\nconst BrowserConfigurationAuthErrorMessage = {\n storageNotSupportedError: {\n code: storageNotSupported,\n desc: BrowserConfigurationAuthErrorMessages[storageNotSupported],\n },\n stubPcaInstanceCalled: {\n code: stubbedPublicClientApplicationCalled,\n desc: BrowserConfigurationAuthErrorMessages[stubbedPublicClientApplicationCalled],\n },\n inMemRedirectUnavailable: {\n code: inMemRedirectUnavailable,\n desc: BrowserConfigurationAuthErrorMessages[inMemRedirectUnavailable],\n },\n};\n/**\n * Browser library error class thrown by the MSAL.js library for SPAs\n */\nclass BrowserConfigurationAuthError extends AuthError {\n constructor(errorCode, errorMessage) {\n super(errorCode, errorMessage);\n this.name = \"BrowserConfigurationAuthError\";\n Object.setPrototypeOf(this, BrowserConfigurationAuthError.prototype);\n }\n}\nfunction createBrowserConfigurationAuthError(errorCode) {\n return new BrowserConfigurationAuthError(errorCode, BrowserConfigurationAuthErrorMessages[errorCode]);\n}\n\nexport { BrowserConfigurationAuthError, BrowserConfigurationAuthErrorMessage, BrowserConfigurationAuthErrorMessages, createBrowserConfigurationAuthError };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { createBrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.mjs';\nimport { BrowserCacheLocation } from '../utils/BrowserConstants.mjs';\nimport { storageNotSupported } from '../error/BrowserConfigurationAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass BrowserStorage {\n constructor(cacheLocation) {\n this.validateWindowStorage(cacheLocation);\n this.windowStorage = window[cacheLocation];\n }\n validateWindowStorage(cacheLocation) {\n if ((cacheLocation !== BrowserCacheLocation.LocalStorage &&\n cacheLocation !== BrowserCacheLocation.SessionStorage) ||\n !window[cacheLocation]) {\n throw createBrowserConfigurationAuthError(storageNotSupported);\n }\n }\n getItem(key) {\n return this.windowStorage.getItem(key);\n }\n setItem(key, value) {\n this.windowStorage.setItem(key, value);\n }\n removeItem(key) {\n this.windowStorage.removeItem(key);\n }\n getKeys() {\n return Object.keys(this.windowStorage);\n }\n containsKey(key) {\n return this.windowStorage.hasOwnProperty(key);\n }\n}\n\nexport { BrowserStorage };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { ProtocolUtils, createClientAuthError, ClientAuthErrorCodes } from '@azure/msal-common';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * Extracts the BrowserStateObject from the state string.\n * @param browserCrypto\n * @param state\n */\nfunction extractBrowserRequestState(browserCrypto, state) {\n if (!state) {\n return null;\n }\n try {\n const requestStateObj = ProtocolUtils.parseRequestState(browserCrypto, state);\n return requestStateObj.libraryState.meta;\n }\n catch (e) {\n throw createClientAuthError(ClientAuthErrorCodes.invalidState);\n }\n}\n\nexport { extractBrowserRequestState };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { CacheManager, CredentialType, CacheHelpers, AccountEntity, createClientAuthError, ClientAuthErrorCodes, Constants, PersistentCacheKeys, PerformanceEvents, StringUtils, ProtocolUtils, AuthToken, CacheRecord, DEFAULT_CRYPTO_IMPLEMENTATION, CcsCredentialType } from '@azure/msal-common';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { BrowserCacheLocation, StaticCacheKeys, InMemoryCacheKeys, TemporaryCacheKeys } from '../utils/BrowserConstants.mjs';\nimport { BrowserStorage } from './BrowserStorage.mjs';\nimport { MemoryStorage } from './MemoryStorage.mjs';\nimport { extractBrowserRequestState } from '../utils/BrowserProtocolUtils.mjs';\nimport { base64Decode } from '../encode/Base64Decode.mjs';\nimport { base64Encode } from '../encode/Base64Encode.mjs';\nimport { noTokenRequestCacheError, unableToParseTokenRequestCacheError, noCachedAuthorityError, interactionInProgress } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * This class implements the cache storage interface for MSAL through browser local or session storage.\n * Cookies are only used if storeAuthStateInCookie is true, and are only used for\n * parameters such as state and nonce, generally.\n */\nclass BrowserCacheManager extends CacheManager {\n constructor(clientId, cacheConfig, cryptoImpl, logger, staticAuthorityOptions) {\n super(clientId, cryptoImpl, logger, staticAuthorityOptions);\n // Cookie life calculation (hours * minutes * seconds * ms)\n this.COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000;\n this.cacheConfig = cacheConfig;\n this.logger = logger;\n this.internalStorage = new MemoryStorage();\n this.browserStorage = this.setupBrowserStorage(this.cacheConfig.cacheLocation);\n this.temporaryCacheStorage = this.setupTemporaryCacheStorage(this.cacheConfig.temporaryCacheLocation, this.cacheConfig.cacheLocation);\n // Migrate cache entries from older versions of MSAL.\n if (cacheConfig.cacheMigrationEnabled) {\n this.migrateCacheEntries();\n this.createKeyMaps();\n }\n }\n /**\n * Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.\n * @param cacheLocation\n */\n setupBrowserStorage(cacheLocation) {\n switch (cacheLocation) {\n case BrowserCacheLocation.LocalStorage:\n case BrowserCacheLocation.SessionStorage:\n try {\n return new BrowserStorage(cacheLocation);\n }\n catch (e) {\n this.logger.verbose(e);\n break;\n }\n }\n this.cacheConfig.cacheLocation = BrowserCacheLocation.MemoryStorage;\n return new MemoryStorage();\n }\n /**\n * Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured temporaryCacheLocation.\n * @param temporaryCacheLocation\n * @param cacheLocation\n */\n setupTemporaryCacheStorage(temporaryCacheLocation, cacheLocation) {\n switch (cacheLocation) {\n case BrowserCacheLocation.LocalStorage:\n case BrowserCacheLocation.SessionStorage:\n try {\n // Temporary cache items will always be stored in session storage to mitigate problems caused by multiple tabs\n return new BrowserStorage(temporaryCacheLocation ||\n BrowserCacheLocation.SessionStorage);\n }\n catch (e) {\n this.logger.verbose(e);\n return this.internalStorage;\n }\n case BrowserCacheLocation.MemoryStorage:\n default:\n return this.internalStorage;\n }\n }\n /**\n * Migrate all old cache entries to new schema. No rollback supported.\n * @param storeAuthStateInCookie\n */\n migrateCacheEntries() {\n const idTokenKey = `${Constants.CACHE_PREFIX}.${PersistentCacheKeys.ID_TOKEN}`;\n const clientInfoKey = `${Constants.CACHE_PREFIX}.${PersistentCacheKeys.CLIENT_INFO}`;\n const errorKey = `${Constants.CACHE_PREFIX}.${PersistentCacheKeys.ERROR}`;\n const errorDescKey = `${Constants.CACHE_PREFIX}.${PersistentCacheKeys.ERROR_DESC}`;\n const idTokenValue = this.browserStorage.getItem(idTokenKey);\n const clientInfoValue = this.browserStorage.getItem(clientInfoKey);\n const errorValue = this.browserStorage.getItem(errorKey);\n const errorDescValue = this.browserStorage.getItem(errorDescKey);\n const values = [\n idTokenValue,\n clientInfoValue,\n errorValue,\n errorDescValue,\n ];\n const keysToMigrate = [\n PersistentCacheKeys.ID_TOKEN,\n PersistentCacheKeys.CLIENT_INFO,\n PersistentCacheKeys.ERROR,\n PersistentCacheKeys.ERROR_DESC,\n ];\n keysToMigrate.forEach((cacheKey, index) => this.migrateCacheEntry(cacheKey, values[index]));\n }\n /**\n * Utility function to help with migration.\n * @param newKey\n * @param value\n * @param storeAuthStateInCookie\n */\n migrateCacheEntry(newKey, value) {\n if (value) {\n this.setTemporaryCache(newKey, value, true);\n }\n }\n /**\n * Searches all cache entries for MSAL accounts and creates the account key map\n * This is used to migrate users from older versions of MSAL which did not create the map.\n * @returns\n */\n createKeyMaps() {\n this.logger.trace(\"BrowserCacheManager - createKeyMaps called.\");\n const accountKeys = this.getItem(StaticCacheKeys.ACCOUNT_KEYS);\n const tokenKeys = this.getItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`);\n if (accountKeys && tokenKeys) {\n this.logger.verbose(\"BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.\");\n // Key maps already exist, no need to iterate through cache\n return;\n }\n const allKeys = this.browserStorage.getKeys();\n allKeys.forEach((key) => {\n if (this.isCredentialKey(key)) {\n // Get item, parse, validate and write key to map\n const value = this.getItem(key);\n if (value) {\n const credObj = this.validateAndParseJson(value);\n if (credObj && credObj.hasOwnProperty(\"credentialType\")) {\n switch (credObj[\"credentialType\"]) {\n case CredentialType.ID_TOKEN:\n if (CacheHelpers.isIdTokenEntity(credObj)) {\n this.logger.trace(\"BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map\");\n this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${key} found, saving key to token key map`);\n const idTokenEntity = credObj;\n const newKey = this.updateCredentialCacheKey(key, idTokenEntity);\n this.addTokenKey(newKey, CredentialType.ID_TOKEN);\n return;\n }\n else {\n this.logger.trace(\"BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping.\");\n this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${key}`);\n }\n break;\n case CredentialType.ACCESS_TOKEN:\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:\n if (CacheHelpers.isAccessTokenEntity(credObj)) {\n this.logger.trace(\"BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map\");\n this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${key} found, saving key to token key map`);\n const accessTokenEntity = credObj;\n const newKey = this.updateCredentialCacheKey(key, accessTokenEntity);\n this.addTokenKey(newKey, CredentialType.ACCESS_TOKEN);\n return;\n }\n else {\n this.logger.trace(\"BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping.\");\n this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${key}`);\n }\n break;\n case CredentialType.REFRESH_TOKEN:\n if (CacheHelpers.isRefreshTokenEntity(credObj)) {\n this.logger.trace(\"BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map\");\n this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${key} found, saving key to token key map`);\n const refreshTokenEntity = credObj;\n const newKey = this.updateCredentialCacheKey(key, refreshTokenEntity);\n this.addTokenKey(newKey, CredentialType.REFRESH_TOKEN);\n return;\n }\n else {\n this.logger.trace(\"BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping.\");\n this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${key}`);\n }\n break;\n // If credentialType isn't one of our predefined ones, it may not be an MSAL cache value. Ignore.\n }\n }\n }\n }\n if (this.isAccountKey(key)) {\n const value = this.getItem(key);\n if (value) {\n const accountObj = this.validateAndParseJson(value);\n if (accountObj &&\n AccountEntity.isAccountEntity(accountObj)) {\n this.logger.trace(\"BrowserCacheManager:createKeyMaps - account found, saving key to account key map\");\n this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${key} found, saving key to account key map`);\n this.addAccountKeyToMap(key);\n }\n }\n }\n });\n }\n /**\n * Parses passed value as JSON object, JSON.parse() will throw an error.\n * @param input\n */\n validateAndParseJson(jsonValue) {\n try {\n const parsedJson = JSON.parse(jsonValue);\n /**\n * There are edge cases in which JSON.parse will successfully parse a non-valid JSON object\n * (e.g. JSON.parse will parse an escaped string into an unescaped string), so adding a type check\n * of the parsed value is necessary in order to be certain that the string represents a valid JSON object.\n *\n */\n return parsedJson && typeof parsedJson === \"object\"\n ? parsedJson\n : null;\n }\n catch (error) {\n return null;\n }\n }\n /**\n * fetches the entry from the browser storage based off the key\n * @param key\n */\n getItem(key) {\n return this.browserStorage.getItem(key);\n }\n /**\n * sets the entry in the browser storage\n * @param key\n * @param value\n */\n setItem(key, value) {\n this.browserStorage.setItem(key, value);\n }\n /**\n * fetch the account entity from the platform cache\n * @param accountKey\n */\n getAccount(accountKey, logger) {\n this.logger.trace(\"BrowserCacheManager.getAccount called\");\n const accountEntity = this.getCachedAccountEntity(accountKey);\n return this.updateOutdatedCachedAccount(accountKey, accountEntity, logger);\n }\n /**\n * Reads account from cache, deserializes it into an account entity and returns it.\n * If account is not found from the key, returns null and removes key from map.\n * @param accountKey\n * @returns\n */\n getCachedAccountEntity(accountKey) {\n const serializedAccount = this.getItem(accountKey);\n if (!serializedAccount) {\n this.removeAccountKeyFromMap(accountKey);\n return null;\n }\n const parsedAccount = this.validateAndParseJson(serializedAccount);\n if (!parsedAccount || !AccountEntity.isAccountEntity(parsedAccount)) {\n this.removeAccountKeyFromMap(accountKey);\n return null;\n }\n return CacheManager.toObject(new AccountEntity(), parsedAccount);\n }\n /**\n * set account entity in the platform cache\n * @param account\n */\n setAccount(account) {\n this.logger.trace(\"BrowserCacheManager.setAccount called\");\n const key = account.generateAccountKey();\n this.setItem(key, JSON.stringify(account));\n this.addAccountKeyToMap(key);\n }\n /**\n * Returns the array of account keys currently cached\n * @returns\n */\n getAccountKeys() {\n this.logger.trace(\"BrowserCacheManager.getAccountKeys called\");\n const accountKeys = this.getItem(StaticCacheKeys.ACCOUNT_KEYS);\n if (accountKeys) {\n return JSON.parse(accountKeys);\n }\n this.logger.verbose(\"BrowserCacheManager.getAccountKeys - No account keys found\");\n return [];\n }\n /**\n * Add a new account to the key map\n * @param key\n */\n addAccountKeyToMap(key) {\n this.logger.trace(\"BrowserCacheManager.addAccountKeyToMap called\");\n this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${key}`);\n const accountKeys = this.getAccountKeys();\n if (accountKeys.indexOf(key) === -1) {\n // Only add key if it does not already exist in the map\n accountKeys.push(key);\n this.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));\n this.logger.verbose(\"BrowserCacheManager.addAccountKeyToMap account key added\");\n }\n else {\n this.logger.verbose(\"BrowserCacheManager.addAccountKeyToMap account key already exists in map\");\n }\n }\n /**\n * Remove an account from the key map\n * @param key\n */\n removeAccountKeyFromMap(key) {\n this.logger.trace(\"BrowserCacheManager.removeAccountKeyFromMap called\");\n this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${key}`);\n const accountKeys = this.getAccountKeys();\n const removalIndex = accountKeys.indexOf(key);\n if (removalIndex > -1) {\n accountKeys.splice(removalIndex, 1);\n this.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));\n this.logger.trace(\"BrowserCacheManager.removeAccountKeyFromMap account key removed\");\n }\n else {\n this.logger.trace(\"BrowserCacheManager.removeAccountKeyFromMap key not found in existing map\");\n }\n }\n /**\n * Extends inherited removeAccount function to include removal of the account key from the map\n * @param key\n */\n async removeAccount(key) {\n void super.removeAccount(key);\n this.removeAccountKeyFromMap(key);\n }\n /**\n * Remove account entity from the platform cache if it's outdated\n * @param accountKey\n */\n removeOutdatedAccount(accountKey) {\n this.removeItem(accountKey);\n this.removeAccountKeyFromMap(accountKey);\n }\n /**\n * Removes given idToken from the cache and from the key map\n * @param key\n */\n removeIdToken(key) {\n super.removeIdToken(key);\n this.removeTokenKey(key, CredentialType.ID_TOKEN);\n }\n /**\n * Removes given accessToken from the cache and from the key map\n * @param key\n */\n async removeAccessToken(key) {\n void super.removeAccessToken(key);\n this.removeTokenKey(key, CredentialType.ACCESS_TOKEN);\n }\n /**\n * Removes given refreshToken from the cache and from the key map\n * @param key\n */\n removeRefreshToken(key) {\n super.removeRefreshToken(key);\n this.removeTokenKey(key, CredentialType.REFRESH_TOKEN);\n }\n /**\n * Gets the keys for the cached tokens associated with this clientId\n * @returns\n */\n getTokenKeys() {\n this.logger.trace(\"BrowserCacheManager.getTokenKeys called\");\n const item = this.getItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`);\n if (item) {\n const tokenKeys = this.validateAndParseJson(item);\n if (tokenKeys &&\n tokenKeys.hasOwnProperty(\"idToken\") &&\n tokenKeys.hasOwnProperty(\"accessToken\") &&\n tokenKeys.hasOwnProperty(\"refreshToken\")) {\n return tokenKeys;\n }\n else {\n this.logger.error(\"BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.\");\n }\n }\n else {\n this.logger.verbose(\"BrowserCacheManager.getTokenKeys - No token keys found\");\n }\n return {\n idToken: [],\n accessToken: [],\n refreshToken: [],\n };\n }\n /**\n * Adds the given key to the token key map\n * @param key\n * @param type\n */\n addTokenKey(key, type) {\n this.logger.trace(\"BrowserCacheManager addTokenKey called\");\n const tokenKeys = this.getTokenKeys();\n switch (type) {\n case CredentialType.ID_TOKEN:\n if (tokenKeys.idToken.indexOf(key) === -1) {\n this.logger.info(\"BrowserCacheManager: addTokenKey - idToken added to map\");\n tokenKeys.idToken.push(key);\n }\n break;\n case CredentialType.ACCESS_TOKEN:\n if (tokenKeys.accessToken.indexOf(key) === -1) {\n this.logger.info(\"BrowserCacheManager: addTokenKey - accessToken added to map\");\n tokenKeys.accessToken.push(key);\n }\n break;\n case CredentialType.REFRESH_TOKEN:\n if (tokenKeys.refreshToken.indexOf(key) === -1) {\n this.logger.info(\"BrowserCacheManager: addTokenKey - refreshToken added to map\");\n tokenKeys.refreshToken.push(key);\n }\n break;\n default:\n this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${type}`);\n throw createClientAuthError(ClientAuthErrorCodes.unexpectedCredentialType);\n }\n this.setItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`, JSON.stringify(tokenKeys));\n }\n /**\n * Removes the given key from the token key map\n * @param key\n * @param type\n */\n removeTokenKey(key, type) {\n this.logger.trace(\"BrowserCacheManager removeTokenKey called\");\n const tokenKeys = this.getTokenKeys();\n switch (type) {\n case CredentialType.ID_TOKEN:\n this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${key} from map`);\n const idRemoval = tokenKeys.idToken.indexOf(key);\n if (idRemoval > -1) {\n this.logger.info(\"BrowserCacheManager: removeTokenKey - idToken removed from map\");\n tokenKeys.idToken.splice(idRemoval, 1);\n }\n else {\n this.logger.info(\"BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.\");\n }\n break;\n case CredentialType.ACCESS_TOKEN:\n this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${key} from map`);\n const accessRemoval = tokenKeys.accessToken.indexOf(key);\n if (accessRemoval > -1) {\n this.logger.info(\"BrowserCacheManager: removeTokenKey - accessToken removed from map\");\n tokenKeys.accessToken.splice(accessRemoval, 1);\n }\n else {\n this.logger.info(\"BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.\");\n }\n break;\n case CredentialType.REFRESH_TOKEN:\n this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${key} from map`);\n const refreshRemoval = tokenKeys.refreshToken.indexOf(key);\n if (refreshRemoval > -1) {\n this.logger.info(\"BrowserCacheManager: removeTokenKey - refreshToken removed from map\");\n tokenKeys.refreshToken.splice(refreshRemoval, 1);\n }\n else {\n this.logger.info(\"BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.\");\n }\n break;\n default:\n this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${type}`);\n throw createClientAuthError(ClientAuthErrorCodes.unexpectedCredentialType);\n }\n this.setItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`, JSON.stringify(tokenKeys));\n }\n /**\n * generates idToken entity from a string\n * @param idTokenKey\n */\n getIdTokenCredential(idTokenKey) {\n const value = this.getItem(idTokenKey);\n if (!value) {\n this.logger.trace(\"BrowserCacheManager.getIdTokenCredential: called, no cache hit\");\n this.removeTokenKey(idTokenKey, CredentialType.ID_TOKEN);\n return null;\n }\n const parsedIdToken = this.validateAndParseJson(value);\n if (!parsedIdToken || !CacheHelpers.isIdTokenEntity(parsedIdToken)) {\n this.logger.trace(\"BrowserCacheManager.getIdTokenCredential: called, no cache hit\");\n this.removeTokenKey(idTokenKey, CredentialType.ID_TOKEN);\n return null;\n }\n this.logger.trace(\"BrowserCacheManager.getIdTokenCredential: cache hit\");\n return parsedIdToken;\n }\n /**\n * set IdToken credential to the platform cache\n * @param idToken\n */\n setIdTokenCredential(idToken) {\n this.logger.trace(\"BrowserCacheManager.setIdTokenCredential called\");\n const idTokenKey = CacheHelpers.generateCredentialKey(idToken);\n this.setItem(idTokenKey, JSON.stringify(idToken));\n this.addTokenKey(idTokenKey, CredentialType.ID_TOKEN);\n }\n /**\n * generates accessToken entity from a string\n * @param key\n */\n getAccessTokenCredential(accessTokenKey) {\n const value = this.getItem(accessTokenKey);\n if (!value) {\n this.logger.trace(\"BrowserCacheManager.getAccessTokenCredential: called, no cache hit\");\n this.removeTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);\n return null;\n }\n const parsedAccessToken = this.validateAndParseJson(value);\n if (!parsedAccessToken ||\n !CacheHelpers.isAccessTokenEntity(parsedAccessToken)) {\n this.logger.trace(\"BrowserCacheManager.getAccessTokenCredential: called, no cache hit\");\n this.removeTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);\n return null;\n }\n this.logger.trace(\"BrowserCacheManager.getAccessTokenCredential: cache hit\");\n return parsedAccessToken;\n }\n /**\n * set accessToken credential to the platform cache\n * @param accessToken\n */\n setAccessTokenCredential(accessToken) {\n this.logger.trace(\"BrowserCacheManager.setAccessTokenCredential called\");\n const accessTokenKey = CacheHelpers.generateCredentialKey(accessToken);\n this.setItem(accessTokenKey, JSON.stringify(accessToken));\n this.addTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);\n }\n /**\n * generates refreshToken entity from a string\n * @param refreshTokenKey\n */\n getRefreshTokenCredential(refreshTokenKey) {\n const value = this.getItem(refreshTokenKey);\n if (!value) {\n this.logger.trace(\"BrowserCacheManager.getRefreshTokenCredential: called, no cache hit\");\n this.removeTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);\n return null;\n }\n const parsedRefreshToken = this.validateAndParseJson(value);\n if (!parsedRefreshToken ||\n !CacheHelpers.isRefreshTokenEntity(parsedRefreshToken)) {\n this.logger.trace(\"BrowserCacheManager.getRefreshTokenCredential: called, no cache hit\");\n this.removeTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);\n return null;\n }\n this.logger.trace(\"BrowserCacheManager.getRefreshTokenCredential: cache hit\");\n return parsedRefreshToken;\n }\n /**\n * set refreshToken credential to the platform cache\n * @param refreshToken\n */\n setRefreshTokenCredential(refreshToken) {\n this.logger.trace(\"BrowserCacheManager.setRefreshTokenCredential called\");\n const refreshTokenKey = CacheHelpers.generateCredentialKey(refreshToken);\n this.setItem(refreshTokenKey, JSON.stringify(refreshToken));\n this.addTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);\n }\n /**\n * fetch appMetadata entity from the platform cache\n * @param appMetadataKey\n */\n getAppMetadata(appMetadataKey) {\n const value = this.getItem(appMetadataKey);\n if (!value) {\n this.logger.trace(\"BrowserCacheManager.getAppMetadata: called, no cache hit\");\n return null;\n }\n const parsedMetadata = this.validateAndParseJson(value);\n if (!parsedMetadata ||\n !CacheHelpers.isAppMetadataEntity(appMetadataKey, parsedMetadata)) {\n this.logger.trace(\"BrowserCacheManager.getAppMetadata: called, no cache hit\");\n return null;\n }\n this.logger.trace(\"BrowserCacheManager.getAppMetadata: cache hit\");\n return parsedMetadata;\n }\n /**\n * set appMetadata entity to the platform cache\n * @param appMetadata\n */\n setAppMetadata(appMetadata) {\n this.logger.trace(\"BrowserCacheManager.setAppMetadata called\");\n const appMetadataKey = CacheHelpers.generateAppMetadataKey(appMetadata);\n this.setItem(appMetadataKey, JSON.stringify(appMetadata));\n }\n /**\n * fetch server telemetry entity from the platform cache\n * @param serverTelemetryKey\n */\n getServerTelemetry(serverTelemetryKey) {\n const value = this.getItem(serverTelemetryKey);\n if (!value) {\n this.logger.trace(\"BrowserCacheManager.getServerTelemetry: called, no cache hit\");\n return null;\n }\n const parsedEntity = this.validateAndParseJson(value);\n if (!parsedEntity ||\n !CacheHelpers.isServerTelemetryEntity(serverTelemetryKey, parsedEntity)) {\n this.logger.trace(\"BrowserCacheManager.getServerTelemetry: called, no cache hit\");\n return null;\n }\n this.logger.trace(\"BrowserCacheManager.getServerTelemetry: cache hit\");\n return parsedEntity;\n }\n /**\n * set server telemetry entity to the platform cache\n * @param serverTelemetryKey\n * @param serverTelemetry\n */\n setServerTelemetry(serverTelemetryKey, serverTelemetry) {\n this.logger.trace(\"BrowserCacheManager.setServerTelemetry called\");\n this.setItem(serverTelemetryKey, JSON.stringify(serverTelemetry));\n }\n /**\n *\n */\n getAuthorityMetadata(key) {\n const value = this.internalStorage.getItem(key);\n if (!value) {\n this.logger.trace(\"BrowserCacheManager.getAuthorityMetadata: called, no cache hit\");\n return null;\n }\n const parsedMetadata = this.validateAndParseJson(value);\n if (parsedMetadata &&\n CacheHelpers.isAuthorityMetadataEntity(key, parsedMetadata)) {\n this.logger.trace(\"BrowserCacheManager.getAuthorityMetadata: cache hit\");\n return parsedMetadata;\n }\n return null;\n }\n /**\n *\n */\n getAuthorityMetadataKeys() {\n const allKeys = this.internalStorage.getKeys();\n return allKeys.filter((key) => {\n return this.isAuthorityMetadata(key);\n });\n }\n /**\n * Sets wrapper metadata in memory\n * @param wrapperSKU\n * @param wrapperVersion\n */\n setWrapperMetadata(wrapperSKU, wrapperVersion) {\n this.internalStorage.setItem(InMemoryCacheKeys.WRAPPER_SKU, wrapperSKU);\n this.internalStorage.setItem(InMemoryCacheKeys.WRAPPER_VER, wrapperVersion);\n }\n /**\n * Returns wrapper metadata from in-memory storage\n */\n getWrapperMetadata() {\n const sku = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_SKU) ||\n Constants.EMPTY_STRING;\n const version = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_VER) ||\n Constants.EMPTY_STRING;\n return [sku, version];\n }\n /**\n *\n * @param entity\n */\n setAuthorityMetadata(key, entity) {\n this.logger.trace(\"BrowserCacheManager.setAuthorityMetadata called\");\n this.internalStorage.setItem(key, JSON.stringify(entity));\n }\n /**\n * Gets the active account\n */\n getActiveAccount() {\n const activeAccountKeyFilters = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);\n const activeAccountValueFilters = this.getItem(activeAccountKeyFilters);\n if (!activeAccountValueFilters) {\n // if new active account cache type isn't found, it's an old version, so look for that instead\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema\");\n const activeAccountKeyLocal = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT);\n const activeAccountValueLocal = this.getItem(activeAccountKeyLocal);\n if (!activeAccountValueLocal) {\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: No active account found\");\n return null;\n }\n const activeAccount = this.getAccountInfoFilteredBy({\n localAccountId: activeAccountValueLocal,\n });\n if (activeAccount) {\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: Legacy active account cache schema found\");\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: Adding active account filters cache schema\");\n this.setActiveAccount(activeAccount);\n return activeAccount;\n }\n return null;\n }\n const activeAccountValueObj = this.validateAndParseJson(activeAccountValueFilters);\n if (activeAccountValueObj) {\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: Active account filters schema found\");\n return this.getAccountInfoFilteredBy({\n homeAccountId: activeAccountValueObj.homeAccountId,\n localAccountId: activeAccountValueObj.localAccountId,\n tenantId: activeAccountValueObj.tenantId,\n });\n }\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: No active account found\");\n return null;\n }\n /**\n * Sets the active account's localAccountId in cache\n * @param account\n */\n setActiveAccount(account) {\n const activeAccountKey = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);\n const activeAccountKeyLocal = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT);\n if (account) {\n this.logger.verbose(\"setActiveAccount: Active account set\");\n const activeAccountValue = {\n homeAccountId: account.homeAccountId,\n localAccountId: account.localAccountId,\n tenantId: account.tenantId,\n };\n this.browserStorage.setItem(activeAccountKey, JSON.stringify(activeAccountValue));\n this.browserStorage.setItem(activeAccountKeyLocal, account.localAccountId);\n }\n else {\n this.logger.verbose(\"setActiveAccount: No account passed, active account not set\");\n this.browserStorage.removeItem(activeAccountKey);\n this.browserStorage.removeItem(activeAccountKeyLocal);\n }\n }\n /**\n * fetch throttling entity from the platform cache\n * @param throttlingCacheKey\n */\n getThrottlingCache(throttlingCacheKey) {\n const value = this.getItem(throttlingCacheKey);\n if (!value) {\n this.logger.trace(\"BrowserCacheManager.getThrottlingCache: called, no cache hit\");\n return null;\n }\n const parsedThrottlingCache = this.validateAndParseJson(value);\n if (!parsedThrottlingCache ||\n !CacheHelpers.isThrottlingEntity(throttlingCacheKey, parsedThrottlingCache)) {\n this.logger.trace(\"BrowserCacheManager.getThrottlingCache: called, no cache hit\");\n return null;\n }\n this.logger.trace(\"BrowserCacheManager.getThrottlingCache: cache hit\");\n return parsedThrottlingCache;\n }\n /**\n * set throttling entity to the platform cache\n * @param throttlingCacheKey\n * @param throttlingCache\n */\n setThrottlingCache(throttlingCacheKey, throttlingCache) {\n this.logger.trace(\"BrowserCacheManager.setThrottlingCache called\");\n this.setItem(throttlingCacheKey, JSON.stringify(throttlingCache));\n }\n /**\n * Gets cache item with given key.\n * Will retrieve from cookies if storeAuthStateInCookie is set to true.\n * @param key\n */\n getTemporaryCache(cacheKey, generateKey) {\n const key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;\n if (this.cacheConfig.storeAuthStateInCookie) {\n const itemCookie = this.getItemCookie(key);\n if (itemCookie) {\n this.logger.trace(\"BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies\");\n return itemCookie;\n }\n }\n const value = this.temporaryCacheStorage.getItem(key);\n if (!value) {\n // If temp cache item not found in session/memory, check local storage for items set by old versions\n if (this.cacheConfig.cacheLocation ===\n BrowserCacheLocation.LocalStorage) {\n const item = this.browserStorage.getItem(key);\n if (item) {\n this.logger.trace(\"BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage\");\n return item;\n }\n }\n this.logger.trace(\"BrowserCacheManager.getTemporaryCache: No cache item found in local storage\");\n return null;\n }\n this.logger.trace(\"BrowserCacheManager.getTemporaryCache: Temporary cache item returned\");\n return value;\n }\n /**\n * Sets the cache item with the key and value given.\n * Stores in cookie if storeAuthStateInCookie is set to true.\n * This can cause cookie overflow if used incorrectly.\n * @param key\n * @param value\n */\n setTemporaryCache(cacheKey, value, generateKey) {\n const key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;\n this.temporaryCacheStorage.setItem(key, value);\n if (this.cacheConfig.storeAuthStateInCookie) {\n this.logger.trace(\"BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie\");\n this.setItemCookie(key, value);\n }\n }\n /**\n * Removes the cache item with the given key.\n * Will also clear the cookie item if storeAuthStateInCookie is set to true.\n * @param key\n */\n removeItem(key) {\n this.browserStorage.removeItem(key);\n this.temporaryCacheStorage.removeItem(key);\n if (this.cacheConfig.storeAuthStateInCookie) {\n this.logger.trace(\"BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie\");\n this.clearItemCookie(key);\n }\n }\n /**\n * Checks whether key is in cache.\n * @param key\n */\n containsKey(key) {\n return (this.browserStorage.containsKey(key) ||\n this.temporaryCacheStorage.containsKey(key));\n }\n /**\n * Gets all keys in window.\n */\n getKeys() {\n return [\n ...this.browserStorage.getKeys(),\n ...this.temporaryCacheStorage.getKeys(),\n ];\n }\n /**\n * Clears all cache entries created by MSAL.\n */\n async clear() {\n // Removes all accounts and their credentials\n await this.removeAllAccounts();\n this.removeAppMetadata();\n // Removes all remaining MSAL cache items\n this.getKeys().forEach((cacheKey) => {\n // Check if key contains msal prefix; For now, we are clearing all the cache items created by MSAL.js\n if ((this.browserStorage.containsKey(cacheKey) ||\n this.temporaryCacheStorage.containsKey(cacheKey)) &&\n (cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1 ||\n cacheKey.indexOf(this.clientId) !== -1)) {\n this.removeItem(cacheKey);\n }\n });\n this.internalStorage.clear();\n }\n /**\n * Clears all access tokes that have claims prior to saving the current one\n * @param performanceClient {IPerformanceClient}\n * @returns\n */\n async clearTokensAndKeysWithClaims(performanceClient) {\n performanceClient.addQueueMeasurement(PerformanceEvents.ClearTokensAndKeysWithClaims);\n const tokenKeys = this.getTokenKeys();\n const removedAccessTokens = [];\n tokenKeys.accessToken.forEach((key) => {\n // if the access token has claims in its key, remove the token key and the token\n const credential = this.getAccessTokenCredential(key);\n if (credential?.requestedClaimsHash &&\n key.includes(credential.requestedClaimsHash.toLowerCase())) {\n removedAccessTokens.push(this.removeAccessToken(key));\n }\n });\n await Promise.all(removedAccessTokens);\n // warn if any access tokens are removed\n if (removedAccessTokens.length > 0) {\n this.logger.warning(`${removedAccessTokens.length} access tokens with claims in the cache keys have been removed from the cache.`);\n }\n }\n /**\n * Add value to cookies\n * @param cookieName\n * @param cookieValue\n * @param expires\n */\n setItemCookie(cookieName, cookieValue, expires) {\n let cookieStr = `${encodeURIComponent(cookieName)}=${encodeURIComponent(cookieValue)};path=/;SameSite=Lax;`;\n if (expires) {\n const expireTime = this.getCookieExpirationTime(expires);\n cookieStr += `expires=${expireTime};`;\n }\n if (this.cacheConfig.secureCookies) {\n cookieStr += \"Secure;\";\n }\n document.cookie = cookieStr;\n }\n /**\n * Get one item by key from cookies\n * @param cookieName\n */\n getItemCookie(cookieName) {\n const name = `${encodeURIComponent(cookieName)}=`;\n const cookieList = document.cookie.split(\";\");\n for (let i = 0; i < cookieList.length; i++) {\n let cookie = cookieList[i];\n while (cookie.charAt(0) === \" \") {\n cookie = cookie.substring(1);\n }\n if (cookie.indexOf(name) === 0) {\n return decodeURIComponent(cookie.substring(name.length, cookie.length));\n }\n }\n return Constants.EMPTY_STRING;\n }\n /**\n * Clear all msal-related cookies currently set in the browser. Should only be used to clear temporary cache items.\n */\n clearMsalCookies() {\n const cookiePrefix = `${Constants.CACHE_PREFIX}.${this.clientId}`;\n const cookieList = document.cookie.split(\";\");\n cookieList.forEach((cookie) => {\n while (cookie.charAt(0) === \" \") {\n // eslint-disable-next-line no-param-reassign\n cookie = cookie.substring(1);\n }\n if (cookie.indexOf(cookiePrefix) === 0) {\n const cookieKey = cookie.split(\"=\")[0];\n this.clearItemCookie(cookieKey);\n }\n });\n }\n /**\n * Clear an item in the cookies by key\n * @param cookieName\n */\n clearItemCookie(cookieName) {\n this.setItemCookie(cookieName, Constants.EMPTY_STRING, -1);\n }\n /**\n * Get cookie expiration time\n * @param cookieLifeDays\n */\n getCookieExpirationTime(cookieLifeDays) {\n const today = new Date();\n const expr = new Date(today.getTime() + cookieLifeDays * this.COOKIE_LIFE_MULTIPLIER);\n return expr.toUTCString();\n }\n /**\n * Gets the cache object referenced by the browser\n */\n getCache() {\n return this.browserStorage;\n }\n /**\n * interface compat, we cannot overwrite browser cache; Functionality is supported by individual entities in browser\n */\n setCache() {\n // sets nothing\n }\n /**\n * Prepend msal. to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema)\n * @param key\n * @param addInstanceId\n */\n generateCacheKey(key) {\n const generatedKey = this.validateAndParseJson(key);\n if (!generatedKey) {\n if (StringUtils.startsWith(key, Constants.CACHE_PREFIX) ||\n StringUtils.startsWith(key, PersistentCacheKeys.ADAL_ID_TOKEN)) {\n return key;\n }\n return `${Constants.CACHE_PREFIX}.${this.clientId}.${key}`;\n }\n return JSON.stringify(key);\n }\n /**\n * Create authorityKey to cache authority\n * @param state\n */\n generateAuthorityKey(stateString) {\n const { libraryState: { id: stateId }, } = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString);\n return this.generateCacheKey(`${TemporaryCacheKeys.AUTHORITY}.${stateId}`);\n }\n /**\n * Create Nonce key to cache nonce\n * @param state\n */\n generateNonceKey(stateString) {\n const { libraryState: { id: stateId }, } = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString);\n return this.generateCacheKey(`${TemporaryCacheKeys.NONCE_IDTOKEN}.${stateId}`);\n }\n /**\n * Creates full cache key for the request state\n * @param stateString State string for the request\n */\n generateStateKey(stateString) {\n // Use the library state id to key temp storage for uniqueness for multiple concurrent requests\n const { libraryState: { id: stateId }, } = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString);\n return this.generateCacheKey(`${TemporaryCacheKeys.REQUEST_STATE}.${stateId}`);\n }\n /**\n * Gets the cached authority based on the cached state. Returns empty if no cached state found.\n */\n getCachedAuthority(cachedState) {\n const stateCacheKey = this.generateStateKey(cachedState);\n const state = this.getTemporaryCache(stateCacheKey);\n if (!state) {\n return null;\n }\n const authorityCacheKey = this.generateAuthorityKey(state);\n return this.getTemporaryCache(authorityCacheKey);\n }\n /**\n * Updates account, authority, and state in cache\n * @param serverAuthenticationRequest\n * @param account\n */\n updateCacheEntries(state, nonce, authorityInstance, loginHint, account) {\n this.logger.trace(\"BrowserCacheManager.updateCacheEntries called\");\n // Cache the request state\n const stateCacheKey = this.generateStateKey(state);\n this.setTemporaryCache(stateCacheKey, state, false);\n // Cache the nonce\n const nonceCacheKey = this.generateNonceKey(state);\n this.setTemporaryCache(nonceCacheKey, nonce, false);\n // Cache authorityKey\n const authorityCacheKey = this.generateAuthorityKey(state);\n this.setTemporaryCache(authorityCacheKey, authorityInstance, false);\n if (account) {\n const ccsCredential = {\n credential: account.homeAccountId,\n type: CcsCredentialType.HOME_ACCOUNT_ID,\n };\n this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);\n }\n else if (loginHint) {\n const ccsCredential = {\n credential: loginHint,\n type: CcsCredentialType.UPN,\n };\n this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);\n }\n }\n /**\n * Reset all temporary cache items\n * @param state\n */\n resetRequestCache(state) {\n this.logger.trace(\"BrowserCacheManager.resetRequestCache called\");\n // check state and remove associated cache items\n if (state) {\n this.getKeys().forEach((key) => {\n if (key.indexOf(state) !== -1) {\n this.removeItem(key);\n }\n });\n // delete generic interactive request parameters\n this.removeItem(this.generateStateKey(state));\n this.removeItem(this.generateNonceKey(state));\n this.removeItem(this.generateAuthorityKey(state));\n }\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.ORIGIN_URI));\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.URL_HASH));\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.CORRELATION_ID));\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.CCS_CREDENTIAL));\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));\n this.setInteractionInProgress(false);\n }\n /**\n * Removes temporary cache for the provided state\n * @param stateString\n */\n cleanRequestByState(stateString) {\n this.logger.trace(\"BrowserCacheManager.cleanRequestByState called\");\n // Interaction is completed - remove interaction status.\n if (stateString) {\n const stateKey = this.generateStateKey(stateString);\n const cachedState = this.temporaryCacheStorage.getItem(stateKey);\n this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${cachedState}`);\n this.resetRequestCache(cachedState || Constants.EMPTY_STRING);\n }\n this.clearMsalCookies();\n }\n /**\n * Looks in temporary cache for any state values with the provided interactionType and removes all temporary cache items for that state\n * Used in scenarios where temp cache needs to be cleaned but state is not known, such as clicking browser back button.\n * @param interactionType\n */\n cleanRequestByInteractionType(interactionType) {\n this.logger.trace(\"BrowserCacheManager.cleanRequestByInteractionType called\");\n // Loop through all keys to find state key\n this.getKeys().forEach((key) => {\n // If this key is not the state key, move on\n if (key.indexOf(TemporaryCacheKeys.REQUEST_STATE) === -1) {\n return;\n }\n // Retrieve state value, return if not a valid value\n const stateValue = this.temporaryCacheStorage.getItem(key);\n if (!stateValue) {\n return;\n }\n // Extract state and ensure it matches given InteractionType, then clean request cache\n const parsedState = extractBrowserRequestState(this.cryptoImpl, stateValue);\n if (parsedState &&\n parsedState.interactionType === interactionType) {\n this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${stateValue}`);\n this.resetRequestCache(stateValue);\n }\n });\n this.clearMsalCookies();\n this.setInteractionInProgress(false);\n }\n cacheCodeRequest(authCodeRequest) {\n this.logger.trace(\"BrowserCacheManager.cacheCodeRequest called\");\n const encodedValue = base64Encode(JSON.stringify(authCodeRequest));\n this.setTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, encodedValue, true);\n }\n /**\n * Gets the token exchange parameters from the cache. Throws an error if nothing is found.\n */\n getCachedRequest(state) {\n this.logger.trace(\"BrowserCacheManager.getCachedRequest called\");\n // Get token request from cache and parse as TokenExchangeParameters.\n const encodedTokenRequest = this.getTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, true);\n if (!encodedTokenRequest) {\n throw createBrowserAuthError(noTokenRequestCacheError);\n }\n let parsedRequest;\n try {\n parsedRequest = JSON.parse(base64Decode(encodedTokenRequest));\n }\n catch (e) {\n this.logger.errorPii(`Attempted to parse: ${encodedTokenRequest}`);\n this.logger.error(`Parsing cached token request threw with error: ${e}`);\n throw createBrowserAuthError(unableToParseTokenRequestCacheError);\n }\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));\n // Get cached authority and use if no authority is cached with request.\n if (!parsedRequest.authority) {\n const authorityCacheKey = this.generateAuthorityKey(state);\n const cachedAuthority = this.getTemporaryCache(authorityCacheKey);\n if (!cachedAuthority) {\n throw createBrowserAuthError(noCachedAuthorityError);\n }\n parsedRequest.authority = cachedAuthority;\n }\n return parsedRequest;\n }\n /**\n * Gets cached native request for redirect flows\n */\n getCachedNativeRequest() {\n this.logger.trace(\"BrowserCacheManager.getCachedNativeRequest called\");\n const cachedRequest = this.getTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, true);\n if (!cachedRequest) {\n this.logger.trace(\"BrowserCacheManager.getCachedNativeRequest: No cached native request found\");\n return null;\n }\n const parsedRequest = this.validateAndParseJson(cachedRequest);\n if (!parsedRequest) {\n this.logger.error(\"BrowserCacheManager.getCachedNativeRequest: Unable to parse native request\");\n return null;\n }\n return parsedRequest;\n }\n isInteractionInProgress(matchClientId) {\n const clientId = this.getInteractionInProgress();\n if (matchClientId) {\n return clientId === this.clientId;\n }\n else {\n return !!clientId;\n }\n }\n getInteractionInProgress() {\n const key = `${Constants.CACHE_PREFIX}.${TemporaryCacheKeys.INTERACTION_STATUS_KEY}`;\n return this.getTemporaryCache(key, false);\n }\n setInteractionInProgress(inProgress) {\n // Ensure we don't overwrite interaction in progress for a different clientId\n const key = `${Constants.CACHE_PREFIX}.${TemporaryCacheKeys.INTERACTION_STATUS_KEY}`;\n if (inProgress) {\n if (this.getInteractionInProgress()) {\n throw createBrowserAuthError(interactionInProgress);\n }\n else {\n // No interaction is in progress\n this.setTemporaryCache(key, this.clientId, false);\n }\n }\n else if (!inProgress &&\n this.getInteractionInProgress() === this.clientId) {\n this.removeItem(key);\n }\n }\n /**\n * Returns username retrieved from ADAL or MSAL v1 idToken\n * @deprecated\n */\n getLegacyLoginHint() {\n // Only check for adal/msal token if no SSO params are being used\n const adalIdTokenString = this.getTemporaryCache(PersistentCacheKeys.ADAL_ID_TOKEN);\n if (adalIdTokenString) {\n this.browserStorage.removeItem(PersistentCacheKeys.ADAL_ID_TOKEN);\n this.logger.verbose(\"Cached ADAL id token retrieved.\");\n }\n // Check for cached MSAL v1 id token\n const msalIdTokenString = this.getTemporaryCache(PersistentCacheKeys.ID_TOKEN, true);\n if (msalIdTokenString) {\n this.removeItem(this.generateCacheKey(PersistentCacheKeys.ID_TOKEN));\n this.logger.verbose(\"Cached MSAL.js v1 id token retrieved\");\n }\n const cachedIdTokenString = msalIdTokenString || adalIdTokenString;\n if (cachedIdTokenString) {\n const idTokenClaims = AuthToken.extractTokenClaims(cachedIdTokenString, base64Decode);\n if (idTokenClaims.preferred_username) {\n this.logger.verbose(\"No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint\");\n return idTokenClaims.preferred_username;\n }\n else if (idTokenClaims.upn) {\n this.logger.verbose(\"No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint\");\n return idTokenClaims.upn;\n }\n else {\n this.logger.verbose(\"No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.\");\n }\n }\n return null;\n }\n /**\n * Updates a credential's cache key if the current cache key is outdated\n */\n updateCredentialCacheKey(currentCacheKey, credential) {\n const updatedCacheKey = CacheHelpers.generateCredentialKey(credential);\n if (currentCacheKey !== updatedCacheKey) {\n const cacheItem = this.getItem(currentCacheKey);\n if (cacheItem) {\n this.removeItem(currentCacheKey);\n this.setItem(updatedCacheKey, cacheItem);\n this.logger.verbose(`Updated an outdated ${credential.credentialType} cache key`);\n return updatedCacheKey;\n }\n else {\n this.logger.error(`Attempted to update an outdated ${credential.credentialType} cache key but no item matching the outdated key was found in storage`);\n }\n }\n return currentCacheKey;\n }\n /**\n * Returns application id as redirect context during AcquireTokenRedirect flow.\n */\n getRedirectRequestContext() {\n return this.getTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, true);\n }\n /**\n * Sets application id as the redirect context during AcquireTokenRedirect flow.\n * @param value\n */\n setRedirectRequestContext(value) {\n this.setTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, value, true);\n }\n /**\n * Builds credential entities from AuthenticationResult object and saves the resulting credentials to the cache\n * @param result\n * @param request\n */\n async hydrateCache(result, request) {\n const idTokenEntity = CacheHelpers.createIdTokenEntity(result.account?.homeAccountId, result.account?.environment, result.idToken, this.clientId, result.tenantId);\n let claimsHash;\n if (request.claims) {\n claimsHash = await this.cryptoImpl.hashString(request.claims);\n }\n const accessTokenEntity = CacheHelpers.createAccessTokenEntity(result.account?.homeAccountId, result.account.environment, result.accessToken, this.clientId, result.tenantId, result.scopes.join(\" \"), result.expiresOn?.getTime() || 0, result.extExpiresOn?.getTime() || 0, base64Decode, undefined, // refreshOn\n result.tokenType, undefined, // userAssertionHash\n request.sshKid, request.claims, claimsHash);\n const cacheRecord = new CacheRecord(undefined, idTokenEntity, accessTokenEntity);\n return this.saveCacheRecord(cacheRecord);\n }\n}\nconst DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger) => {\n const cacheOptions = {\n cacheLocation: BrowserCacheLocation.MemoryStorage,\n temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,\n storeAuthStateInCookie: false,\n secureCookies: false,\n cacheMigrationEnabled: false,\n claimsBasedCachingEnabled: false,\n };\n return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger);\n};\n\nexport { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { UrlString } from '@azure/msal-common';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { BrowserConstants, InteractionType } from './BrowserConstants.mjs';\nimport { createNewGuid } from '../crypto/BrowserCrypto.mjs';\nimport { blockIframeReload, redirectInIframe, blockNestedPopups, nonBrowserEnvironment, uninitializedPublicClientApplication } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * Clears hash from window url.\n */\nfunction clearHash(contentWindow) {\n // Office.js sets history.replaceState to null\n contentWindow.location.hash = \"\";\n if (typeof contentWindow.history.replaceState === \"function\") {\n // Full removes \"#\" from url\n contentWindow.history.replaceState(null, \"\", `${contentWindow.location.origin}${contentWindow.location.pathname}${contentWindow.location.search}`);\n }\n}\n/**\n * Replaces current hash with hash from provided url\n */\nfunction replaceHash(url) {\n const urlParts = url.split(\"#\");\n urlParts.shift(); // Remove part before the hash\n window.location.hash = urlParts.length > 0 ? urlParts.join(\"#\") : \"\";\n}\n/**\n * Returns boolean of whether the current window is in an iframe or not.\n */\nfunction isInIframe() {\n return window.parent !== window;\n}\n/**\n * Returns boolean of whether or not the current window is a popup opened by msal\n */\nfunction isInPopup() {\n return (typeof window !== \"undefined\" &&\n !!window.opener &&\n window.opener !== window &&\n typeof window.name === \"string\" &&\n window.name.indexOf(`${BrowserConstants.POPUP_NAME_PREFIX}.`) === 0);\n}\n// #endregion\n/**\n * Returns current window URL as redirect uri\n */\nfunction getCurrentUri() {\n return window.location.href.split(\"?\")[0].split(\"#\")[0];\n}\n/**\n * Gets the homepage url for the current window location.\n */\nfunction getHomepage() {\n const currentUrl = new UrlString(window.location.href);\n const urlComponents = currentUrl.getUrlComponents();\n return `${urlComponents.Protocol}//${urlComponents.HostNameAndPort}/`;\n}\n/**\n * Throws error if we have completed an auth and are\n * attempting another auth request inside an iframe.\n */\nfunction blockReloadInHiddenIframes() {\n const isResponseHash = UrlString.hashContainsKnownProperties(window.location.hash);\n // return an error if called from the hidden iframe created by the msal js silent calls\n if (isResponseHash && isInIframe()) {\n throw createBrowserAuthError(blockIframeReload);\n }\n}\n/**\n * Block redirect operations in iframes unless explicitly allowed\n * @param interactionType Interaction type for the request\n * @param allowRedirectInIframe Config value to allow redirects when app is inside an iframe\n */\nfunction blockRedirectInIframe(interactionType, allowRedirectInIframe) {\n const isIframedApp = isInIframe();\n if (interactionType === InteractionType.Redirect &&\n isIframedApp &&\n !allowRedirectInIframe) {\n // If we are not in top frame, we shouldn't redirect. This is also handled by the service.\n throw createBrowserAuthError(redirectInIframe);\n }\n}\n/**\n * Block redirectUri loaded in popup from calling AcquireToken APIs\n */\nfunction blockAcquireTokenInPopups() {\n // Popups opened by msal popup APIs are given a name that starts with \"msal.\"\n if (isInPopup()) {\n throw createBrowserAuthError(blockNestedPopups);\n }\n}\n/**\n * Throws error if token requests are made in non-browser environment\n * @param isBrowserEnvironment Flag indicating if environment is a browser.\n */\nfunction blockNonBrowserEnvironment(isBrowserEnvironment) {\n if (!isBrowserEnvironment) {\n throw createBrowserAuthError(nonBrowserEnvironment);\n }\n}\n/**\n * Throws error if initialize hasn't been called\n * @param initialized\n */\nfunction blockAPICallsBeforeInitialize(initialized) {\n if (!initialized) {\n throw createBrowserAuthError(uninitializedPublicClientApplication);\n }\n}\n/**\n * Adds a preconnect link element to the header which begins DNS resolution and SSL connection in anticipation of the /token request\n * @param loginDomain Authority domain, including https protocol e.g. https://login.microsoftonline.com\n * @returns\n */\nfunction preconnect(authority) {\n const link = document.createElement(\"link\");\n link.rel = \"preconnect\";\n link.href = new URL(authority).origin;\n link.crossOrigin = \"anonymous\";\n document.head.appendChild(link);\n // The browser will close connection if not used within a few seconds, remove element from the header after 10s\n window.setTimeout(() => {\n try {\n document.head.removeChild(link);\n }\n catch { }\n }, 10000); // 10s Timeout\n}\n/**\n * Wrapper function that creates a UUID v7 from the current timestamp.\n * @returns {string}\n */\nfunction createGuid() {\n return createNewGuid();\n}\n\nexport { blockAPICallsBeforeInitialize, blockAcquireTokenInPopups, blockNonBrowserEnvironment, blockRedirectInIframe, blockReloadInHiddenIframes, clearHash, createGuid, getCurrentUri, getHomepage, isInIframe, isInPopup, preconnect, replaceHash };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\n/* eslint-disable header/header */\nconst name = \"@azure/msal-browser\";\nconst version = \"3.10.0\";\n\nexport { name, version };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { AccountEntity, PerformanceEvents, AuthenticationScheme, createClientConfigurationError, ClientConfigurationErrorCodes, StringUtils, UrlString, ServerTelemetryManager, Authority, invokeAsync, AuthorityFactory } from '@azure/msal-common';\nimport { version } from '../packageMetadata.mjs';\nimport { BrowserConstants } from '../utils/BrowserConstants.mjs';\nimport { getCurrentUri } from '../utils/BrowserUtils.mjs';\nimport { createNewGuid } from '../crypto/BrowserCrypto.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass BaseInteractionClient {\n constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) {\n this.config = config;\n this.browserStorage = storageImpl;\n this.browserCrypto = browserCrypto;\n this.networkClient = this.config.system.networkClient;\n this.eventHandler = eventHandler;\n this.navigationClient = navigationClient;\n this.nativeMessageHandler = nativeMessageHandler;\n this.correlationId = correlationId || createNewGuid();\n this.logger = logger.clone(BrowserConstants.MSAL_SKU, version, this.correlationId);\n this.performanceClient = performanceClient;\n }\n async clearCacheOnLogout(account) {\n if (account) {\n if (AccountEntity.accountInfoIsEqual(account, this.browserStorage.getActiveAccount(), false)) {\n this.logger.verbose(\"Setting active account to null\");\n this.browserStorage.setActiveAccount(null);\n }\n // Clear given account.\n try {\n await this.browserStorage.removeAccount(AccountEntity.generateAccountCacheKey(account));\n this.logger.verbose(\"Cleared cache items belonging to the account provided in the logout request.\");\n }\n catch (error) {\n this.logger.error(\"Account provided in logout request was not found. Local cache unchanged.\");\n }\n }\n else {\n try {\n this.logger.verbose(\"No account provided in logout request, clearing all cache items.\", this.correlationId);\n // Clear all accounts and tokens\n await this.browserStorage.clear();\n // Clear any stray keys from IndexedDB\n await this.browserCrypto.clearKeystore();\n }\n catch (e) {\n this.logger.error(\"Attempted to clear all MSAL cache items and failed. Local cache unchanged.\");\n }\n }\n }\n /**\n * Initializer function for all request APIs\n * @param request\n */\n async initializeBaseRequest(request) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeBaseRequest, this.correlationId);\n const authority = request.authority || this.config.auth.authority;\n const scopes = [...((request && request.scopes) || [])];\n const validatedRequest = {\n ...request,\n correlationId: this.correlationId,\n authority,\n scopes,\n };\n // Set authenticationScheme to BEARER if not explicitly set in the request\n if (!validatedRequest.authenticationScheme) {\n validatedRequest.authenticationScheme = AuthenticationScheme.BEARER;\n this.logger.verbose('Authentication Scheme wasn\\'t explicitly set in request, defaulting to \"Bearer\" request');\n }\n else {\n if (validatedRequest.authenticationScheme ===\n AuthenticationScheme.SSH) {\n if (!request.sshJwk) {\n throw createClientConfigurationError(ClientConfigurationErrorCodes.missingSshJwk);\n }\n if (!request.sshKid) {\n throw createClientConfigurationError(ClientConfigurationErrorCodes.missingSshKid);\n }\n }\n this.logger.verbose(`Authentication Scheme set to \"${validatedRequest.authenticationScheme}\" as configured in Auth request`);\n }\n // Set requested claims hash if claims-based caching is enabled and claims were requested\n if (this.config.cache.claimsBasedCachingEnabled &&\n request.claims &&\n // Checks for empty stringified object \"{}\" which doesn't qualify as requested claims\n !StringUtils.isEmptyObj(request.claims)) {\n validatedRequest.requestedClaimsHash =\n await this.browserCrypto.hashString(request.claims);\n }\n return validatedRequest;\n }\n /**\n *\n * Use to get the redirect uri configured in MSAL or null.\n * @param requestRedirectUri\n * @returns Redirect URL\n *\n */\n getRedirectUri(requestRedirectUri) {\n this.logger.verbose(\"getRedirectUri called\");\n const redirectUri = requestRedirectUri ||\n this.config.auth.redirectUri ||\n getCurrentUri();\n return UrlString.getAbsoluteUrl(redirectUri, getCurrentUri());\n }\n /**\n *\n * @param apiId\n * @param correlationId\n * @param forceRefresh\n */\n initializeServerTelemetryManager(apiId, forceRefresh) {\n this.logger.verbose(\"initializeServerTelemetryManager called\");\n const telemetryPayload = {\n clientId: this.config.auth.clientId,\n correlationId: this.correlationId,\n apiId: apiId,\n forceRefresh: forceRefresh || false,\n wrapperSKU: this.browserStorage.getWrapperMetadata()[0],\n wrapperVer: this.browserStorage.getWrapperMetadata()[1],\n };\n return new ServerTelemetryManager(telemetryPayload, this.browserStorage);\n }\n /**\n * Used to get a discovered version of the default authority.\n * @param requestAuthority\n * @param requestAzureCloudOptions\n * @param account\n */\n async getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions, account) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);\n const authorityOptions = {\n protocolMode: this.config.auth.protocolMode,\n OIDCOptions: this.config.auth.OIDCOptions,\n knownAuthorities: this.config.auth.knownAuthorities,\n cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,\n authorityMetadata: this.config.auth.authorityMetadata,\n skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,\n };\n // build authority string based on auth params, precedence - azureCloudInstance + tenant >> authority\n const userAuthority = requestAuthority\n ? requestAuthority\n : this.config.auth.authority;\n // fall back to the authority from config\n const builtAuthority = Authority.generateAuthority(userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);\n const discoveredAuthority = await invokeAsync(AuthorityFactory.createDiscoveredInstance, PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, this.logger, this.performanceClient, this.correlationId)(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger, this.correlationId, this.performanceClient);\n if (account && !discoveredAuthority.isAlias(account.environment)) {\n throw createClientConfigurationError(ClientConfigurationErrorCodes.authorityMismatch);\n }\n return discoveredAuthority;\n }\n}\n\nexport { BaseInteractionClient };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { PerformanceEvents, invoke, invokeAsync } from '@azure/msal-common';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { urlEncodeArr } from '../encode/Base64Encode.mjs';\nimport { getRandomValues, sha256Digest } from './BrowserCrypto.mjs';\nimport { pkceNotCreated } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n// Constant byte array length\nconst RANDOM_BYTE_ARR_LENGTH = 32;\n/**\n * This file defines APIs to generate PKCE codes and code verifiers.\n */\n/**\n * Generates PKCE Codes. See the RFC for more information: https://tools.ietf.org/html/rfc7636\n */\nasync function generatePkceCodes(performanceClient, logger, correlationId) {\n performanceClient.addQueueMeasurement(PerformanceEvents.GeneratePkceCodes, correlationId);\n const codeVerifier = invoke(generateCodeVerifier, PerformanceEvents.GenerateCodeVerifier, logger, performanceClient, correlationId)(performanceClient, logger, correlationId);\n const codeChallenge = await invokeAsync(generateCodeChallengeFromVerifier, PerformanceEvents.GenerateCodeChallengeFromVerifier, logger, performanceClient, correlationId)(codeVerifier, performanceClient, logger, correlationId);\n return {\n verifier: codeVerifier,\n challenge: codeChallenge,\n };\n}\n/**\n * Generates a random 32 byte buffer and returns the base64\n * encoded string to be used as a PKCE Code Verifier\n */\nfunction generateCodeVerifier(performanceClient, logger, correlationId) {\n try {\n // Generate random values as utf-8\n const buffer = new Uint8Array(RANDOM_BYTE_ARR_LENGTH);\n invoke(getRandomValues, PerformanceEvents.GetRandomValues, logger, performanceClient, correlationId)(buffer);\n // encode verifier as base64\n const pkceCodeVerifierB64 = urlEncodeArr(buffer);\n return pkceCodeVerifierB64;\n }\n catch (e) {\n throw createBrowserAuthError(pkceNotCreated);\n }\n}\n/**\n * Creates a base64 encoded PKCE Code Challenge string from the\n * hash created from the PKCE Code Verifier supplied\n */\nasync function generateCodeChallengeFromVerifier(pkceCodeVerifier, performanceClient, logger, correlationId) {\n performanceClient.addQueueMeasurement(PerformanceEvents.GenerateCodeChallengeFromVerifier, correlationId);\n try {\n // hashed verifier\n const pkceHashedCodeVerifier = await invokeAsync(sha256Digest, PerformanceEvents.Sha256Digest, logger, performanceClient, correlationId)(pkceCodeVerifier, performanceClient, correlationId);\n // encode hash as base64\n return urlEncodeArr(new Uint8Array(pkceHashedCodeVerifier));\n }\n catch (e) {\n throw createBrowserAuthError(pkceNotCreated);\n }\n}\n\nexport { generatePkceCodes };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { PerformanceEvents, invokeAsync, Constants, UrlString, AuthorizationCodeClient, ProtocolUtils } from '@azure/msal-common';\nimport { BaseInteractionClient } from './BaseInteractionClient.mjs';\nimport { BrowserConstants } from '../utils/BrowserConstants.mjs';\nimport { version } from '../packageMetadata.mjs';\nimport { getCurrentUri } from '../utils/BrowserUtils.mjs';\nimport { generatePkceCodes } from '../crypto/PkceGenerator.mjs';\nimport { createNewGuid } from '../crypto/BrowserCrypto.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * Defines the class structure and helper functions used by the \"standard\", non-brokered auth flows (popup, redirect, silent (RT), silent (iframe))\n */\nclass StandardInteractionClient extends BaseInteractionClient {\n /**\n * Generates an auth code request tied to the url request.\n * @param request\n */\n async initializeAuthorizationCodeRequest(request) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.correlationId);\n const generatedPkceParams = await invokeAsync(generatePkceCodes, PerformanceEvents.GeneratePkceCodes, this.logger, this.performanceClient, this.correlationId)(this.performanceClient, this.logger, this.correlationId);\n const authCodeRequest = {\n ...request,\n redirectUri: request.redirectUri,\n code: Constants.EMPTY_STRING,\n codeVerifier: generatedPkceParams.verifier,\n };\n request.codeChallenge = generatedPkceParams.challenge;\n request.codeChallengeMethod = Constants.S256_CODE_CHALLENGE_METHOD;\n return authCodeRequest;\n }\n /**\n * Initializer for the logout request.\n * @param logoutRequest\n */\n initializeLogoutRequest(logoutRequest) {\n this.logger.verbose(\"initializeLogoutRequest called\", logoutRequest?.correlationId);\n const validLogoutRequest = {\n correlationId: this.correlationId || createNewGuid(),\n ...logoutRequest,\n };\n /**\n * Set logout_hint to be login_hint from ID Token Claims if present\n * and logoutHint attribute wasn't manually set in logout request\n */\n if (logoutRequest) {\n // If logoutHint isn't set and an account was passed in, try to extract logoutHint from ID Token Claims\n if (!logoutRequest.logoutHint) {\n if (logoutRequest.account) {\n const logoutHint = this.getLogoutHintFromIdTokenClaims(logoutRequest.account);\n if (logoutHint) {\n this.logger.verbose(\"Setting logoutHint to login_hint ID Token Claim value for the account provided\");\n validLogoutRequest.logoutHint = logoutHint;\n }\n }\n else {\n this.logger.verbose(\"logoutHint was not set and account was not passed into logout request, logoutHint will not be set\");\n }\n }\n else {\n this.logger.verbose(\"logoutHint has already been set in logoutRequest\");\n }\n }\n else {\n this.logger.verbose(\"logoutHint will not be set since no logout request was configured\");\n }\n /*\n * Only set redirect uri if logout request isn't provided or the set uri isn't null.\n * Otherwise, use passed uri, config, or current page.\n */\n if (!logoutRequest || logoutRequest.postLogoutRedirectUri !== null) {\n if (logoutRequest && logoutRequest.postLogoutRedirectUri) {\n this.logger.verbose(\"Setting postLogoutRedirectUri to uri set on logout request\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri =\n UrlString.getAbsoluteUrl(logoutRequest.postLogoutRedirectUri, getCurrentUri());\n }\n else if (this.config.auth.postLogoutRedirectUri === null) {\n this.logger.verbose(\"postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect\", validLogoutRequest.correlationId);\n }\n else if (this.config.auth.postLogoutRedirectUri) {\n this.logger.verbose(\"Setting postLogoutRedirectUri to configured uri\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri =\n UrlString.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri, getCurrentUri());\n }\n else {\n this.logger.verbose(\"Setting postLogoutRedirectUri to current page\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri =\n UrlString.getAbsoluteUrl(getCurrentUri(), getCurrentUri());\n }\n }\n else {\n this.logger.verbose(\"postLogoutRedirectUri passed as null, not setting post logout redirect uri\", validLogoutRequest.correlationId);\n }\n return validLogoutRequest;\n }\n /**\n * Parses login_hint ID Token Claim out of AccountInfo object to be used as\n * logout_hint in end session request.\n * @param account\n */\n getLogoutHintFromIdTokenClaims(account) {\n const idTokenClaims = account.idTokenClaims;\n if (idTokenClaims) {\n if (idTokenClaims.login_hint) {\n return idTokenClaims.login_hint;\n }\n else {\n this.logger.verbose(\"The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request\");\n }\n }\n else {\n this.logger.verbose(\"The provided account does not contain ID Token Claims, logoutHint will not be added to logout request\");\n }\n return null;\n }\n /**\n * Creates an Authorization Code Client with the given authority, or the default authority.\n * @param serverTelemetryManager\n * @param authorityUrl\n */\n async createAuthCodeClient(serverTelemetryManager, authorityUrl, requestAzureCloudOptions, account) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.correlationId);\n // Create auth module.\n const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, authorityUrl, requestAzureCloudOptions, account);\n return new AuthorizationCodeClient(clientConfig, this.performanceClient);\n }\n /**\n * Creates a Client Configuration object with the given request authority, or the default authority.\n * @param serverTelemetryManager\n * @param requestAuthority\n * @param requestCorrelationId\n */\n async getClientConfiguration(serverTelemetryManager, requestAuthority, requestAzureCloudOptions, account) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);\n const discoveredAuthority = await invokeAsync(this.getDiscoveredAuthority.bind(this), PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, this.correlationId)(requestAuthority, requestAzureCloudOptions, account);\n const logger = this.config.system.loggerOptions;\n return {\n authOptions: {\n clientId: this.config.auth.clientId,\n authority: discoveredAuthority,\n clientCapabilities: this.config.auth.clientCapabilities,\n },\n systemOptions: {\n tokenRenewalOffsetSeconds: this.config.system.tokenRenewalOffsetSeconds,\n preventCorsPreflight: true,\n },\n loggerOptions: {\n loggerCallback: logger.loggerCallback,\n piiLoggingEnabled: logger.piiLoggingEnabled,\n logLevel: logger.logLevel,\n correlationId: this.correlationId,\n },\n cacheOptions: {\n claimsBasedCachingEnabled: this.config.cache.claimsBasedCachingEnabled,\n },\n cryptoInterface: this.browserCrypto,\n networkInterface: this.networkClient,\n storageInterface: this.browserStorage,\n serverTelemetryManager: serverTelemetryManager,\n libraryInfo: {\n sku: BrowserConstants.MSAL_SKU,\n version: version,\n cpu: Constants.EMPTY_STRING,\n os: Constants.EMPTY_STRING,\n },\n telemetry: this.config.telemetry,\n };\n }\n /**\n * Helper to initialize required request parameters for interactive APIs and ssoSilent()\n * @param request\n * @param interactionType\n */\n async initializeAuthorizationRequest(request, interactionType) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.correlationId);\n const redirectUri = this.getRedirectUri(request.redirectUri);\n const browserState = {\n interactionType: interactionType,\n };\n const state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || Constants.EMPTY_STRING, browserState);\n const baseRequest = await invokeAsync(this.initializeBaseRequest.bind(this), PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, this.correlationId)(request);\n const validatedRequest = {\n ...baseRequest,\n redirectUri: redirectUri,\n state: state,\n nonce: request.nonce || createNewGuid(),\n responseMode: this.config.auth.OIDCOptions\n .serverResponseType,\n };\n const account = request.account || this.browserStorage.getActiveAccount();\n if (account) {\n this.logger.verbose(\"Setting validated request account\", this.correlationId);\n this.logger.verbosePii(`Setting validated request account: ${account.homeAccountId}`, this.correlationId);\n validatedRequest.account = account;\n }\n // Check for ADAL/MSAL v1 SSO\n if (!validatedRequest.loginHint && !account) {\n const legacyLoginHint = this.browserStorage.getLegacyLoginHint();\n if (legacyLoginHint) {\n validatedRequest.loginHint = legacyLoginHint;\n }\n }\n return validatedRequest;\n }\n}\n\nexport { StandardInteractionClient };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nconst contentError = \"ContentError\";\nconst userSwitch = \"user_switch\";\n\nexport { contentError, userSwitch };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n// Status Codes that can be thrown by WAM\nconst USER_INTERACTION_REQUIRED = \"USER_INTERACTION_REQUIRED\";\nconst USER_CANCEL = \"USER_CANCEL\";\nconst NO_NETWORK = \"NO_NETWORK\";\nconst PERSISTENT_ERROR = \"PERSISTENT_ERROR\";\nconst DISABLED = \"DISABLED\";\nconst ACCOUNT_UNAVAILABLE = \"ACCOUNT_UNAVAILABLE\";\n\nexport { ACCOUNT_UNAVAILABLE, DISABLED, NO_NETWORK, PERSISTENT_ERROR, USER_CANCEL, USER_INTERACTION_REQUIRED };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { AuthError, InteractionRequiredAuthError, createInteractionRequiredAuthError, InteractionRequiredAuthErrorCodes } from '@azure/msal-common';\nimport { createBrowserAuthError } from './BrowserAuthError.mjs';\nimport { contentError, userSwitch } from './NativeAuthErrorCodes.mjs';\nimport { PERSISTENT_ERROR, DISABLED, NO_NETWORK, USER_CANCEL, USER_INTERACTION_REQUIRED, ACCOUNT_UNAVAILABLE } from '../broker/nativeBroker/NativeStatusCodes.mjs';\nimport { noNetworkConnectivity, userCancelled } from './BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nconst INVALID_METHOD_ERROR = -2147186943;\nconst NativeAuthErrorMessages = {\n [userSwitch]: \"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again.\",\n};\nclass NativeAuthError extends AuthError {\n constructor(errorCode, description, ext) {\n super(errorCode, description);\n Object.setPrototypeOf(this, NativeAuthError.prototype);\n this.name = \"NativeAuthError\";\n this.ext = ext;\n }\n}\n/**\n * These errors should result in a fallback to the 'standard' browser based auth flow.\n */\nfunction isFatalNativeAuthError(error) {\n if (error.ext &&\n error.ext.status &&\n (error.ext.status === PERSISTENT_ERROR ||\n error.ext.status === DISABLED)) {\n return true;\n }\n if (error.ext &&\n error.ext.error &&\n error.ext.error === INVALID_METHOD_ERROR) {\n return true;\n }\n switch (error.errorCode) {\n case contentError:\n return true;\n default:\n return false;\n }\n}\n/**\n * Create the appropriate error object based on the WAM status code.\n * @param code\n * @param description\n * @param ext\n * @returns\n */\nfunction createNativeAuthError(code, description, ext) {\n if (ext && ext.status) {\n switch (ext.status) {\n case ACCOUNT_UNAVAILABLE:\n return createInteractionRequiredAuthError(InteractionRequiredAuthErrorCodes.nativeAccountUnavailable);\n case USER_INTERACTION_REQUIRED:\n return new InteractionRequiredAuthError(code, description);\n case USER_CANCEL:\n return createBrowserAuthError(userCancelled);\n case NO_NETWORK:\n return createBrowserAuthError(noNetworkConnectivity);\n }\n }\n return new NativeAuthError(code, NativeAuthErrorMessages[code] || description, ext);\n}\n\nexport { NativeAuthError, NativeAuthErrorMessages, createNativeAuthError, isFatalNativeAuthError };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { StandardInteractionClient } from './StandardInteractionClient.mjs';\nimport { PerformanceEvents, invokeAsync, SilentFlowClient } from '@azure/msal-common';\nimport { ApiId } from '../utils/BrowserConstants.mjs';\nimport { BrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { cryptoKeyNotFound } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass SilentCacheClient extends StandardInteractionClient {\n /**\n * Returns unexpired tokens from the cache, if available\n * @param silentRequest\n */\n async acquireToken(silentRequest) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);\n // Telemetry manager only used to increment cacheHits here\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\n const silentAuthClient = await this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions, silentRequest.account);\n this.logger.verbose(\"Silent auth client created\");\n try {\n const response = await invokeAsync(silentAuthClient.acquireCachedToken.bind(silentAuthClient), PerformanceEvents.SilentFlowClientAcquireCachedToken, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest);\n const authResponse = response[0];\n this.performanceClient.addFields({\n fromCache: true,\n }, silentRequest.correlationId);\n return authResponse;\n }\n catch (error) {\n if (error instanceof BrowserAuthError &&\n error.errorCode === cryptoKeyNotFound) {\n this.logger.verbose(\"Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair.\");\n }\n throw error;\n }\n }\n /**\n * API to silenty clear the browser cache.\n * @param logoutRequest\n */\n logout(logoutRequest) {\n this.logger.verbose(\"logoutRedirect called\");\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\n return this.clearCacheOnLogout(validLogoutRequest?.account);\n }\n /**\n * Creates an Silent Flow Client with the given authority, or the default authority.\n * @param serverTelemetryManager\n * @param authorityUrl\n */\n async createSilentFlowClient(serverTelemetryManager, authorityUrl, azureCloudOptions, account) {\n // Create auth module.\n const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, authorityUrl, azureCloudOptions, account);\n return new SilentFlowClient(clientConfig, this.performanceClient);\n }\n async initializeSilentRequest(request, account) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeSilentRequest, this.correlationId);\n const baseRequest = await invokeAsync(this.initializeBaseRequest.bind(this), PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, this.correlationId)(request);\n return {\n ...request,\n ...baseRequest,\n account: account,\n forceRefresh: request.forceRefresh || false,\n };\n }\n}\n\nexport { SilentCacheClient };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { PerformanceEvents, TimeUtils, ScopeSet, createClientAuthError, ClientAuthErrorCodes, AuthToken, buildAccountToCache, AccountEntity, Constants, AuthorityType, AuthenticationScheme, PopTokenGenerator, updateAccountTenantProfileData, CacheHelpers, CacheRecord, createAuthError, AuthErrorCodes, UrlString, OIDC_DEFAULT_SCOPES, invokeAsync, AADServerParamKeys, PromptValue } from '@azure/msal-common';\nimport { BaseInteractionClient } from './BaseInteractionClient.mjs';\nimport { TemporaryCacheKeys, NativeConstants, NativeExtensionMethod, ApiId } from '../utils/BrowserConstants.mjs';\nimport { NativeAuthError, isFatalNativeAuthError, createNativeAuthError } from '../error/NativeAuthError.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { SilentCacheClient } from './SilentCacheClient.mjs';\nimport { base64Decode } from '../encode/Base64Decode.mjs';\nimport { userSwitch } from '../error/NativeAuthErrorCodes.mjs';\nimport { nativePromptNotSupported } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nconst BrokerServerParamKeys = {\n BROKER_CLIENT_ID: \"brk_client_id\",\n BROKER_REDIRECT_URI: \"brk_redirect_uri\",\n};\nclass NativeInteractionClient extends BaseInteractionClient {\n constructor(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId) {\n super(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);\n this.apiId = apiId;\n this.accountId = accountId;\n this.nativeMessageHandler = provider;\n this.nativeStorageManager = nativeStorageImpl;\n this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);\n }\n /**\n * Acquire token from native platform via browser extension\n * @param request\n */\n async acquireToken(request) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);\n this.logger.trace(\"NativeInteractionClient - acquireToken called.\");\n // start the perf measurement\n const nativeATMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);\n const reqTimestamp = TimeUtils.nowSeconds();\n // initialize native request\n const nativeRequest = await this.initializeNativeRequest(request);\n // check if the tokens can be retrieved from internal cache\n try {\n const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);\n nativeATMeasurement.end({\n success: true,\n isNativeBroker: false,\n fromCache: true,\n });\n return result;\n }\n catch (e) {\n // continue with a native call for any and all errors\n this.logger.info(\"MSAL internal Cache does not contain tokens, proceed to make a native call\");\n }\n // fall back to native calls\n const messageBody = {\n method: NativeExtensionMethod.GetToken,\n request: nativeRequest,\n };\n const response = await this.nativeMessageHandler.sendMessage(messageBody);\n const validatedResponse = this.validateNativeResponse(response);\n return this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)\n .then((result) => {\n nativeATMeasurement.end({\n success: true,\n isNativeBroker: true,\n requestId: result.requestId,\n });\n return result;\n })\n .catch((error) => {\n nativeATMeasurement.end({\n success: false,\n errorCode: error.errorCode,\n subErrorCode: error.subError,\n isNativeBroker: true,\n });\n throw error;\n });\n }\n /**\n * Creates silent flow request\n * @param request\n * @param cachedAccount\n * @returns CommonSilentFlowRequest\n */\n createSilentCacheRequest(request, cachedAccount) {\n return {\n authority: request.authority,\n correlationId: this.correlationId,\n scopes: ScopeSet.fromString(request.scope).asArray(),\n account: cachedAccount,\n forceRefresh: false,\n };\n }\n /**\n * Fetches the tokens from the cache if un-expired\n * @param nativeAccountId\n * @param request\n * @returns authenticationResult\n */\n async acquireTokensFromCache(nativeAccountId, request) {\n if (!nativeAccountId) {\n this.logger.warning(\"NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided\");\n throw createClientAuthError(ClientAuthErrorCodes.noAccountFound);\n }\n // fetch the account from browser cache\n const account = this.browserStorage.getBaseAccountInfo({\n nativeAccountId,\n });\n if (!account) {\n throw createClientAuthError(ClientAuthErrorCodes.noAccountFound);\n }\n // leverage silent flow for cached tokens retrieval\n try {\n const silentRequest = this.createSilentCacheRequest(request, account);\n const result = await this.silentCacheClient.acquireToken(silentRequest);\n const fullAccount = {\n ...account,\n idTokenClaims: result?.idTokenClaims,\n idToken: result?.idToken,\n };\n return {\n ...result,\n account: fullAccount,\n };\n }\n catch (e) {\n throw e;\n }\n }\n /**\n * Acquires a token from native platform then redirects to the redirectUri instead of returning the response\n * @param request\n */\n async acquireTokenRedirect(request) {\n this.logger.trace(\"NativeInteractionClient - acquireTokenRedirect called.\");\n const nativeRequest = await this.initializeNativeRequest(request);\n const messageBody = {\n method: NativeExtensionMethod.GetToken,\n request: nativeRequest,\n };\n try {\n const response = await this.nativeMessageHandler.sendMessage(messageBody);\n this.validateNativeResponse(response);\n }\n catch (e) {\n // Only throw fatal errors here to allow application to fallback to regular redirect. Otherwise proceed and the error will be thrown in handleRedirectPromise\n if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {\n throw e;\n }\n }\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);\n const navigationOptions = {\n apiId: ApiId.acquireTokenRedirect,\n timeout: this.config.system.redirectNavigationTimeout,\n noHistory: false,\n };\n const redirectUri = this.config.auth.navigateToLoginRequestUrl\n ? window.location.href\n : this.getRedirectUri(request.redirectUri);\n await this.navigationClient.navigateExternal(redirectUri, navigationOptions); // Need to treat this as external to ensure handleRedirectPromise is run again\n }\n /**\n * If the previous page called native platform for a token using redirect APIs, send the same request again and return the response\n * @param performanceClient {IPerformanceClient?}\n * @param correlationId {string?} correlation identifier\n */\n async handleRedirectPromise(performanceClient, correlationId) {\n this.logger.trace(\"NativeInteractionClient - handleRedirectPromise called.\");\n if (!this.browserStorage.isInteractionInProgress(true)) {\n this.logger.info(\"handleRedirectPromise called but there is no interaction in progress, returning null.\");\n return null;\n }\n // remove prompt from the request to prevent WAM from prompting twice\n const cachedRequest = this.browserStorage.getCachedNativeRequest();\n if (!cachedRequest) {\n this.logger.verbose(\"NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null.\");\n if (performanceClient && correlationId) {\n performanceClient?.addFields({ errorCode: \"no_cached_request\" }, correlationId);\n }\n return null;\n }\n const { prompt, ...request } = cachedRequest;\n if (prompt) {\n this.logger.verbose(\"NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window.\");\n }\n this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));\n const messageBody = {\n method: NativeExtensionMethod.GetToken,\n request: request,\n };\n const reqTimestamp = TimeUtils.nowSeconds();\n try {\n this.logger.verbose(\"NativeInteractionClient - handleRedirectPromise sending message to native broker.\");\n const response = await this.nativeMessageHandler.sendMessage(messageBody);\n this.validateNativeResponse(response);\n const result = this.handleNativeResponse(response, request, reqTimestamp);\n this.browserStorage.setInteractionInProgress(false);\n return await result;\n }\n catch (e) {\n this.browserStorage.setInteractionInProgress(false);\n throw e;\n }\n }\n /**\n * Logout from native platform via browser extension\n * @param request\n */\n logout() {\n this.logger.trace(\"NativeInteractionClient - logout called.\");\n return Promise.reject(\"Logout not implemented yet\");\n }\n /**\n * Transform response from native platform into AuthenticationResult object which will be returned to the end user\n * @param response\n * @param request\n * @param reqTimestamp\n */\n async handleNativeResponse(response, request, reqTimestamp) {\n this.logger.trace(\"NativeInteractionClient - handleNativeResponse called.\");\n // generate identifiers\n const idTokenClaims = AuthToken.extractTokenClaims(response.id_token, base64Decode);\n const homeAccountIdentifier = this.createHomeAccountIdentifier(response, idTokenClaims);\n const cachedhomeAccountId = this.browserStorage.getAccountInfoFilteredBy({\n nativeAccountId: request.accountId,\n })?.homeAccountId;\n if (homeAccountIdentifier !== cachedhomeAccountId &&\n response.account.id !== request.accountId) {\n // User switch in native broker prompt is not supported. All users must first sign in through web flow to ensure server state is in sync\n throw createNativeAuthError(userSwitch);\n }\n // Get the preferred_cache domain for the given authority\n const authority = await this.getDiscoveredAuthority(request.authority);\n const baseAccount = buildAccountToCache(this.browserStorage, authority, homeAccountIdentifier, idTokenClaims, base64Decode, response.client_info, undefined, // environment\n idTokenClaims.tid, undefined, // auth code payload\n response.account.id, this.logger);\n // generate authenticationResult\n const result = await this.generateAuthenticationResult(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);\n // cache accounts and tokens in the appropriate storage\n this.cacheAccount(baseAccount);\n this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, result.accessToken, result.tenantId, reqTimestamp);\n return result;\n }\n /**\n * creates an homeAccountIdentifier for the account\n * @param response\n * @param idTokenObj\n * @returns\n */\n createHomeAccountIdentifier(response, idTokenClaims) {\n // Save account in browser storage\n const homeAccountIdentifier = AccountEntity.generateHomeAccountId(response.client_info || Constants.EMPTY_STRING, AuthorityType.Default, this.logger, this.browserCrypto, idTokenClaims);\n return homeAccountIdentifier;\n }\n /**\n * Helper to generate scopes\n * @param response\n * @param request\n * @returns\n */\n generateScopes(response, request) {\n return response.scope\n ? ScopeSet.fromString(response.scope)\n : ScopeSet.fromString(request.scope);\n }\n /**\n * If PoP token is requesred, records the PoP token if returned from the WAM, else generates one in the browser\n * @param request\n * @param response\n */\n async generatePopAccessToken(response, request) {\n if (request.tokenType === AuthenticationScheme.POP) {\n /**\n * This code prioritizes SHR returned from the native layer. In case of error/SHR not calculated from WAM and the AT\n * is still received, SHR is calculated locally\n */\n // Check if native layer returned an SHR token\n if (response.shr) {\n this.logger.trace(\"handleNativeServerResponse: SHR is enabled in native layer\");\n return response.shr;\n }\n // Generate SHR in msal js if WAM does not compute it when POP is enabled\n const popTokenGenerator = new PopTokenGenerator(this.browserCrypto);\n const shrParameters = {\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n shrNonce: request.shrNonce,\n };\n /**\n * KeyID must be present in the native request from when the PoP key was generated in order for\n * PopTokenGenerator to query the full key for signing\n */\n if (!request.keyId) {\n throw createClientAuthError(ClientAuthErrorCodes.keyIdMissing);\n }\n return popTokenGenerator.signPopToken(response.access_token, request.keyId, shrParameters);\n }\n else {\n return response.access_token;\n }\n }\n /**\n * Generates authentication result\n * @param response\n * @param request\n * @param idTokenObj\n * @param accountEntity\n * @param authority\n * @param reqTimestamp\n * @returns\n */\n async generateAuthenticationResult(response, request, idTokenClaims, accountEntity, authority, reqTimestamp) {\n // Add Native Broker fields to Telemetry\n const mats = this.addTelemetryFromNativeResponse(response);\n // If scopes not returned in server response, use request scopes\n const responseScopes = response.scope\n ? ScopeSet.fromString(response.scope)\n : ScopeSet.fromString(request.scope);\n const accountProperties = response.account.properties || {};\n const uid = accountProperties[\"UID\"] ||\n idTokenClaims.oid ||\n idTokenClaims.sub ||\n Constants.EMPTY_STRING;\n const tid = accountProperties[\"TenantId\"] ||\n idTokenClaims.tid ||\n Constants.EMPTY_STRING;\n const accountInfo = updateAccountTenantProfileData(accountEntity.getAccountInfo(), undefined, // tenantProfile optional\n idTokenClaims, response.id_token);\n /**\n * In pairwise broker flows, this check prevents the broker's native account id\n * from being returned over the embedded app's account id.\n */\n if (accountInfo.nativeAccountId !== response.account.id) {\n accountInfo.nativeAccountId = response.account.id;\n }\n // generate PoP token as needed\n const responseAccessToken = await this.generatePopAccessToken(response, request);\n const tokenType = request.tokenType === AuthenticationScheme.POP\n ? AuthenticationScheme.POP\n : AuthenticationScheme.BEARER;\n const result = {\n authority: authority,\n uniqueId: uid,\n tenantId: tid,\n scopes: responseScopes.asArray(),\n account: accountInfo,\n idToken: response.id_token,\n idTokenClaims: idTokenClaims,\n accessToken: responseAccessToken,\n fromCache: mats ? this.isResponseFromCache(mats) : false,\n expiresOn: new Date(Number(reqTimestamp + response.expires_in) * 1000),\n tokenType: tokenType,\n correlationId: this.correlationId,\n state: response.state,\n fromNativeBroker: true,\n };\n return result;\n }\n /**\n * cache the account entity in browser storage\n * @param accountEntity\n */\n cacheAccount(accountEntity) {\n // Store the account info and hence `nativeAccountId` in browser cache\n this.browserStorage.setAccount(accountEntity);\n // Remove any existing cached tokens for this account in browser storage\n this.browserStorage.removeAccountContext(accountEntity).catch((e) => {\n this.logger.error(`Error occurred while removing account context from browser storage. ${e}`);\n });\n }\n /**\n * Stores the access_token and id_token in inmemory storage\n * @param response\n * @param request\n * @param homeAccountIdentifier\n * @param idTokenObj\n * @param responseAccessToken\n * @param tenantId\n * @param reqTimestamp\n */\n cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, responseAccessToken, tenantId, reqTimestamp) {\n const cachedIdToken = CacheHelpers.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || \"\", request.clientId, idTokenClaims.tid || \"\");\n // cache accessToken in inmemory storage\n const expiresIn = request.tokenType === AuthenticationScheme.POP\n ? Constants.SHR_NONCE_VALIDITY\n : (typeof response.expires_in === \"string\"\n ? parseInt(response.expires_in, 10)\n : response.expires_in) || 0;\n const tokenExpirationSeconds = reqTimestamp + expiresIn;\n const responseScopes = this.generateScopes(response, request);\n const cachedAccessToken = CacheHelpers.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, idTokenClaims.tid || tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, base64Decode);\n const nativeCacheRecord = new CacheRecord(undefined, cachedIdToken, cachedAccessToken);\n void this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, request.storeInCache);\n }\n addTelemetryFromNativeResponse(response) {\n const mats = this.getMATSFromResponse(response);\n if (!mats) {\n return null;\n }\n this.performanceClient.addFields({\n extensionId: this.nativeMessageHandler.getExtensionId(),\n extensionVersion: this.nativeMessageHandler.getExtensionVersion(),\n matsBrokerVersion: mats.broker_version,\n matsAccountJoinOnStart: mats.account_join_on_start,\n matsAccountJoinOnEnd: mats.account_join_on_end,\n matsDeviceJoin: mats.device_join,\n matsPromptBehavior: mats.prompt_behavior,\n matsApiErrorCode: mats.api_error_code,\n matsUiVisible: mats.ui_visible,\n matsSilentCode: mats.silent_code,\n matsSilentBiSubCode: mats.silent_bi_sub_code,\n matsSilentMessage: mats.silent_message,\n matsSilentStatus: mats.silent_status,\n matsHttpStatus: mats.http_status,\n matsHttpEventCount: mats.http_event_count,\n }, this.correlationId);\n return mats;\n }\n /**\n * Validates native platform response before processing\n * @param response\n */\n validateNativeResponse(response) {\n if (response.hasOwnProperty(\"access_token\") &&\n response.hasOwnProperty(\"id_token\") &&\n response.hasOwnProperty(\"client_info\") &&\n response.hasOwnProperty(\"account\") &&\n response.hasOwnProperty(\"scope\") &&\n response.hasOwnProperty(\"expires_in\")) {\n return response;\n }\n else {\n throw createAuthError(AuthErrorCodes.unexpectedError, \"Response missing expected properties.\");\n }\n }\n /**\n * Gets MATS telemetry from native response\n * @param response\n * @returns\n */\n getMATSFromResponse(response) {\n if (response.properties.MATS) {\n try {\n return JSON.parse(response.properties.MATS);\n }\n catch (e) {\n this.logger.error(\"NativeInteractionClient - Error parsing MATS telemetry, returning null instead\");\n }\n }\n return null;\n }\n /**\n * Returns whether or not response came from native cache\n * @param response\n * @returns\n */\n isResponseFromCache(mats) {\n if (typeof mats.is_cached === \"undefined\") {\n this.logger.verbose(\"NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false.\");\n return false;\n }\n return !!mats.is_cached;\n }\n /**\n * Translates developer provided request object into NativeRequest object\n * @param request\n */\n async initializeNativeRequest(request) {\n this.logger.trace(\"NativeInteractionClient - initializeNativeRequest called\");\n const authority = request.authority || this.config.auth.authority;\n if (request.account) {\n // validate authority\n await this.getDiscoveredAuthority(authority, request.azureCloudOptions, request.account);\n }\n const canonicalAuthority = new UrlString(authority);\n canonicalAuthority.validateAsUri();\n // scopes are expected to be received by the native broker as \"scope\" and will be added to the request below. Other properties that should be dropped from the request to the native broker can be included in the object destructuring here.\n const { scopes, ...remainingProperties } = request;\n const scopeSet = new ScopeSet(scopes || []);\n scopeSet.appendScopes(OIDC_DEFAULT_SCOPES);\n const getPrompt = () => {\n // If request is silent, prompt is always none\n switch (this.apiId) {\n case ApiId.ssoSilent:\n case ApiId.acquireTokenSilent_silentFlow:\n this.logger.trace(\"initializeNativeRequest: silent request sets prompt to none\");\n return PromptValue.NONE;\n }\n // Prompt not provided, request may proceed and native broker decides if it needs to prompt\n if (!request.prompt) {\n this.logger.trace(\"initializeNativeRequest: prompt was not provided\");\n return undefined;\n }\n // If request is interactive, check if prompt provided is allowed to go directly to native broker\n switch (request.prompt) {\n case PromptValue.NONE:\n case PromptValue.CONSENT:\n case PromptValue.LOGIN:\n this.logger.trace(\"initializeNativeRequest: prompt is compatible with native flow\");\n return request.prompt;\n default:\n this.logger.trace(`initializeNativeRequest: prompt = ${request.prompt} is not compatible with native flow`);\n throw createBrowserAuthError(nativePromptNotSupported);\n }\n };\n const validatedRequest = {\n ...remainingProperties,\n accountId: this.accountId,\n clientId: this.config.auth.clientId,\n authority: canonicalAuthority.urlString,\n scope: scopeSet.printScopes(),\n redirectUri: this.getRedirectUri(request.redirectUri),\n prompt: getPrompt(),\n correlationId: this.correlationId,\n tokenType: request.authenticationScheme,\n windowTitleSubstring: document.title,\n extraParameters: {\n ...request.extraQueryParameters,\n ...request.tokenQueryParameters,\n },\n extendedExpiryToken: false, // Make this configurable?\n };\n this.handleExtraBrokerParams(validatedRequest);\n validatedRequest.extraParameters =\n validatedRequest.extraParameters || {};\n validatedRequest.extraParameters.telemetry =\n NativeConstants.MATS_TELEMETRY;\n if (request.authenticationScheme === AuthenticationScheme.POP) {\n // add POP request type\n const shrParameters = {\n resourceRequestUri: request.resourceRequestUri,\n resourceRequestMethod: request.resourceRequestMethod,\n shrClaims: request.shrClaims,\n shrNonce: request.shrNonce,\n };\n const popTokenGenerator = new PopTokenGenerator(this.browserCrypto);\n const reqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PerformanceEvents.PopTokenGenerateCnf, this.logger, this.performanceClient, this.correlationId)(shrParameters, this.logger);\n // to reduce the URL length, it is recommended to send the hash of the req_cnf instead of the whole string\n validatedRequest.reqCnf = reqCnfData.reqCnfHash;\n validatedRequest.keyId = reqCnfData.kid;\n }\n return validatedRequest;\n }\n /**\n * Handles extra broker request parameters\n * @param request {NativeTokenRequest}\n * @private\n */\n handleExtraBrokerParams(request) {\n if (!request.extraParameters) {\n return;\n }\n if (request.extraParameters.hasOwnProperty(BrokerServerParamKeys.BROKER_CLIENT_ID) &&\n request.extraParameters.hasOwnProperty(BrokerServerParamKeys.BROKER_REDIRECT_URI) &&\n request.extraParameters.hasOwnProperty(AADServerParamKeys.CLIENT_ID)) {\n const child_client_id = request.extraParameters[AADServerParamKeys.CLIENT_ID];\n const child_redirect_uri = request.redirectUri;\n const brk_redirect_uri = request.extraParameters[BrokerServerParamKeys.BROKER_REDIRECT_URI];\n request.extraParameters = {\n child_client_id,\n child_redirect_uri,\n };\n request.redirectUri = brk_redirect_uri;\n }\n }\n}\n\nexport { NativeInteractionClient };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { NativeConstants, NativeExtensionMethod } from '../../utils/BrowserConstants.mjs';\nimport { PerformanceEvents, createAuthError, AuthErrorCodes, AuthenticationScheme } from '@azure/msal-common';\nimport { createNativeAuthError } from '../../error/NativeAuthError.mjs';\nimport { createBrowserAuthError } from '../../error/BrowserAuthError.mjs';\nimport { createNewGuid } from '../../crypto/BrowserCrypto.mjs';\nimport { nativeHandshakeTimeout, nativeExtensionNotInstalled } from '../../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass NativeMessageHandler {\n constructor(logger, handshakeTimeoutMs, performanceClient, extensionId) {\n this.logger = logger;\n this.handshakeTimeoutMs = handshakeTimeoutMs;\n this.extensionId = extensionId;\n this.resolvers = new Map(); // Used for non-handshake messages\n this.handshakeResolvers = new Map(); // Used for handshake messages\n this.messageChannel = new MessageChannel();\n this.windowListener = this.onWindowMessage.bind(this); // Window event callback doesn't have access to 'this' unless it's bound\n this.performanceClient = performanceClient;\n this.handshakeEvent = performanceClient.startMeasurement(PerformanceEvents.NativeMessageHandlerHandshake);\n }\n /**\n * Sends a given message to the extension and resolves with the extension response\n * @param body\n */\n async sendMessage(body) {\n this.logger.trace(\"NativeMessageHandler - sendMessage called.\");\n const req = {\n channel: NativeConstants.CHANNEL_ID,\n extensionId: this.extensionId,\n responseId: createNewGuid(),\n body: body,\n };\n this.logger.trace(\"NativeMessageHandler - Sending request to browser extension\");\n this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(req)}`);\n this.messageChannel.port1.postMessage(req);\n return new Promise((resolve, reject) => {\n this.resolvers.set(req.responseId, { resolve, reject });\n });\n }\n /**\n * Returns an instance of the MessageHandler that has successfully established a connection with an extension\n * @param {Logger} logger\n * @param {number} handshakeTimeoutMs\n * @param {IPerformanceClient} performanceClient\n * @param {ICrypto} crypto\n */\n static async createProvider(logger, handshakeTimeoutMs, performanceClient) {\n logger.trace(\"NativeMessageHandler - createProvider called.\");\n try {\n const preferredProvider = new NativeMessageHandler(logger, handshakeTimeoutMs, performanceClient, NativeConstants.PREFERRED_EXTENSION_ID);\n await preferredProvider.sendHandshakeRequest();\n return preferredProvider;\n }\n catch (e) {\n // If preferred extension fails for whatever reason, fallback to using any installed extension\n const backupProvider = new NativeMessageHandler(logger, handshakeTimeoutMs, performanceClient);\n await backupProvider.sendHandshakeRequest();\n return backupProvider;\n }\n }\n /**\n * Send handshake request helper.\n */\n async sendHandshakeRequest() {\n this.logger.trace(\"NativeMessageHandler - sendHandshakeRequest called.\");\n // Register this event listener before sending handshake\n window.addEventListener(\"message\", this.windowListener, false); // false is important, because content script message processing should work first\n const req = {\n channel: NativeConstants.CHANNEL_ID,\n extensionId: this.extensionId,\n responseId: createNewGuid(),\n body: {\n method: NativeExtensionMethod.HandshakeRequest,\n },\n };\n this.handshakeEvent.add({\n extensionId: this.extensionId,\n extensionHandshakeTimeoutMs: this.handshakeTimeoutMs,\n });\n this.messageChannel.port1.onmessage = (event) => {\n this.onChannelMessage(event);\n };\n window.postMessage(req, window.origin, [this.messageChannel.port2]);\n return new Promise((resolve, reject) => {\n this.handshakeResolvers.set(req.responseId, { resolve, reject });\n this.timeoutId = window.setTimeout(() => {\n /*\n * Throw an error if neither HandshakeResponse nor original Handshake request are received in a reasonable timeframe.\n * This typically suggests an event handler stopped propagation of the Handshake request but did not respond to it on the MessageChannel port\n */\n window.removeEventListener(\"message\", this.windowListener, false);\n this.messageChannel.port1.close();\n this.messageChannel.port2.close();\n this.handshakeEvent.end({\n extensionHandshakeTimedOut: true,\n success: false,\n });\n reject(createBrowserAuthError(nativeHandshakeTimeout));\n this.handshakeResolvers.delete(req.responseId);\n }, this.handshakeTimeoutMs); // Use a reasonable timeout in milliseconds here\n });\n }\n /**\n * Invoked when a message is posted to the window. If a handshake request is received it means the extension is not installed.\n * @param event\n */\n onWindowMessage(event) {\n this.logger.trace(\"NativeMessageHandler - onWindowMessage called\");\n // We only accept messages from ourselves\n if (event.source !== window) {\n return;\n }\n const request = event.data;\n if (!request.channel ||\n request.channel !== NativeConstants.CHANNEL_ID) {\n return;\n }\n if (request.extensionId && request.extensionId !== this.extensionId) {\n return;\n }\n if (request.body.method === NativeExtensionMethod.HandshakeRequest) {\n const handshakeResolver = this.handshakeResolvers.get(request.responseId);\n /*\n * Filter out responses with no matched resolvers sooner to keep channel ports open while waiting for\n * the proper response.\n */\n if (!handshakeResolver) {\n this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${request.responseId}`);\n return;\n }\n // If we receive this message back it means no extension intercepted the request, meaning no extension supporting handshake protocol is installed\n this.logger.verbose(request.extensionId\n ? `Extension with id: ${request.extensionId} not installed`\n : \"No extension installed\");\n clearTimeout(this.timeoutId);\n this.messageChannel.port1.close();\n this.messageChannel.port2.close();\n window.removeEventListener(\"message\", this.windowListener, false);\n this.handshakeEvent.end({\n success: false,\n extensionInstalled: false,\n });\n handshakeResolver.reject(createBrowserAuthError(nativeExtensionNotInstalled));\n }\n }\n /**\n * Invoked when a message is received from the extension on the MessageChannel port\n * @param event\n */\n onChannelMessage(event) {\n this.logger.trace(\"NativeMessageHandler - onChannelMessage called.\");\n const request = event.data;\n const resolver = this.resolvers.get(request.responseId);\n const handshakeResolver = this.handshakeResolvers.get(request.responseId);\n try {\n const method = request.body.method;\n if (method === NativeExtensionMethod.Response) {\n if (!resolver) {\n return;\n }\n const response = request.body.response;\n this.logger.trace(\"NativeMessageHandler - Received response from browser extension\");\n this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(response)}`);\n if (response.status !== \"Success\") {\n resolver.reject(createNativeAuthError(response.code, response.description, response.ext));\n }\n else if (response.result) {\n if (response.result[\"code\"] &&\n response.result[\"description\"]) {\n resolver.reject(createNativeAuthError(response.result[\"code\"], response.result[\"description\"], response.result[\"ext\"]));\n }\n else {\n resolver.resolve(response.result);\n }\n }\n else {\n throw createAuthError(AuthErrorCodes.unexpectedError, \"Event does not contain result.\");\n }\n this.resolvers.delete(request.responseId);\n }\n else if (method === NativeExtensionMethod.HandshakeResponse) {\n if (!handshakeResolver) {\n this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${request.responseId}`);\n return;\n }\n clearTimeout(this.timeoutId); // Clear setTimeout\n window.removeEventListener(\"message\", this.windowListener, false); // Remove 'No extension' listener\n this.extensionId = request.extensionId;\n this.extensionVersion = request.body.version;\n this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`);\n this.handshakeEvent.end({\n extensionInstalled: true,\n success: true,\n });\n handshakeResolver.resolve();\n this.handshakeResolvers.delete(request.responseId);\n }\n // Do nothing if method is not Response or HandshakeResponse\n }\n catch (err) {\n this.logger.error(\"Error parsing response from WAM Extension\");\n this.logger.errorPii(`Error parsing response from WAM Extension: ${err}`);\n this.logger.errorPii(`Unable to parse ${event}`);\n if (resolver) {\n resolver.reject(err);\n }\n else if (handshakeResolver) {\n handshakeResolver.reject(err);\n }\n }\n }\n /**\n * Returns the Id for the browser extension this handler is communicating with\n * @returns\n */\n getExtensionId() {\n return this.extensionId;\n }\n /**\n * Returns the version for the browser extension this handler is communicating with\n * @returns\n */\n getExtensionVersion() {\n return this.extensionVersion;\n }\n /**\n * Returns boolean indicating whether or not the request should attempt to use native broker\n * @param logger\n * @param config\n * @param nativeExtensionProvider\n * @param authenticationScheme\n */\n static isNativeAvailable(config, logger, nativeExtensionProvider, authenticationScheme) {\n logger.trace(\"isNativeAvailable called\");\n if (!config.system.allowNativeBroker) {\n logger.trace(\"isNativeAvailable: allowNativeBroker is not enabled, returning false\");\n // Developer disabled WAM\n return false;\n }\n if (!nativeExtensionProvider) {\n logger.trace(\"isNativeAvailable: WAM extension provider is not initialized, returning false\");\n // Extension is not available\n return false;\n }\n if (authenticationScheme) {\n switch (authenticationScheme) {\n case AuthenticationScheme.BEARER:\n case AuthenticationScheme.POP:\n logger.trace(\"isNativeAvailable: authenticationScheme is supported, returning true\");\n return true;\n default:\n logger.trace(\"isNativeAvailable: authenticationScheme is not supported, returning false\");\n return false;\n }\n }\n return true;\n }\n}\n\nexport { NativeMessageHandler };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { PerformanceEvents, ServerError, invokeAsync, CcsCredentialType } from '@azure/msal-common';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { userCancelled } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * Abstract class which defines operations for a browser interaction handling class.\n */\nclass InteractionHandler {\n constructor(authCodeModule, storageImpl, authCodeRequest, logger, performanceClient) {\n this.authModule = authCodeModule;\n this.browserStorage = storageImpl;\n this.authCodeRequest = authCodeRequest;\n this.logger = logger;\n this.performanceClient = performanceClient;\n }\n /**\n * Function to handle response parameters from hash.\n * @param locationHash\n */\n async handleCodeResponse(response, request) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.HandleCodeResponse, request.correlationId);\n let authCodeResponse;\n try {\n authCodeResponse = this.authModule.handleFragmentResponse(response, request.state);\n }\n catch (e) {\n if (e instanceof ServerError &&\n e.subError === userCancelled) {\n // Translate server error caused by user closing native prompt to corresponding first class MSAL error\n throw createBrowserAuthError(userCancelled);\n }\n else {\n throw e;\n }\n }\n return invokeAsync(this.handleCodeResponseFromServer.bind(this), PerformanceEvents.HandleCodeResponseFromServer, this.logger, this.performanceClient, request.correlationId)(authCodeResponse, request);\n }\n /**\n * Process auth code response from AAD\n * @param authCodeResponse\n * @param state\n * @param authority\n * @param networkModule\n * @returns\n */\n async handleCodeResponseFromServer(authCodeResponse, request, validateNonce = true) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.HandleCodeResponseFromServer, request.correlationId);\n this.logger.trace(\"InteractionHandler.handleCodeResponseFromServer called\");\n // Assign code to request\n this.authCodeRequest.code = authCodeResponse.code;\n // Check for new cloud instance\n if (authCodeResponse.cloud_instance_host_name) {\n await invokeAsync(this.authModule.updateAuthority.bind(this.authModule), PerformanceEvents.UpdateTokenEndpointAuthority, this.logger, this.performanceClient, request.correlationId)(authCodeResponse.cloud_instance_host_name, request.correlationId);\n }\n // Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)\n if (validateNonce) {\n // TODO: Assigning \"response nonce\" to \"request nonce\" is confusing. Refactor the function doing validation to accept request nonce directly\n authCodeResponse.nonce = request.nonce || undefined;\n }\n authCodeResponse.state = request.state;\n // Add CCS parameters if available\n if (authCodeResponse.client_info) {\n this.authCodeRequest.clientInfo = authCodeResponse.client_info;\n }\n else {\n const ccsCred = this.createCcsCredentials(request);\n if (ccsCred) {\n this.authCodeRequest.ccsCredential = ccsCred;\n }\n }\n // Acquire token with retrieved code.\n const tokenResponse = (await invokeAsync(this.authModule.acquireToken.bind(this.authModule), PerformanceEvents.AuthClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(this.authCodeRequest, authCodeResponse));\n return tokenResponse;\n }\n /**\n * Build ccs creds if available\n */\n createCcsCredentials(request) {\n if (request.account) {\n return {\n credential: request.account.homeAccountId,\n type: CcsCredentialType.HOME_ACCOUNT_ID,\n };\n }\n else if (request.loginHint) {\n return {\n credential: request.loginHint,\n type: CcsCredentialType.UPN,\n };\n }\n return null;\n }\n}\n\nexport { InteractionHandler };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { UrlUtils } from '@azure/msal-common';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { extractBrowserRequestState } from '../utils/BrowserProtocolUtils.mjs';\nimport { hashEmptyError, hashDoesNotContainKnownProperties, noStateInHash, unableToParseState, stateInteractionTypeMismatch } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nfunction deserializeResponse(responseString, responseLocation, logger) {\n // Deserialize hash fragment response parameters.\n const serverParams = UrlUtils.getDeserializedResponse(responseString);\n if (!serverParams) {\n if (!UrlUtils.stripLeadingHashOrQuery(responseString)) {\n // Hash or Query string is empty\n logger.error(`The request has returned to the redirectUri but a ${responseLocation} is not present. It's likely that the ${responseLocation} has been removed or the page has been redirected by code running on the redirectUri page.`);\n throw createBrowserAuthError(hashEmptyError);\n }\n else {\n logger.error(`A ${responseLocation} is present in the iframe but it does not contain known properties. It's likely that the ${responseLocation} has been replaced by code running on the redirectUri page.`);\n logger.errorPii(`The ${responseLocation} detected is: ${responseString}`);\n throw createBrowserAuthError(hashDoesNotContainKnownProperties);\n }\n }\n return serverParams;\n}\n/**\n * Returns the interaction type that the response object belongs to\n */\nfunction validateInteractionType(response, browserCrypto, interactionType) {\n if (!response.state) {\n throw createBrowserAuthError(noStateInHash);\n }\n const platformStateObj = extractBrowserRequestState(browserCrypto, response.state);\n if (!platformStateObj) {\n throw createBrowserAuthError(unableToParseState);\n }\n if (platformStateObj.interactionType !== interactionType) {\n throw createBrowserAuthError(stateInteractionTypeMismatch);\n }\n}\n\nexport { deserializeResponse, validateInteractionType };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { OIDC_DEFAULT_SCOPES, invokeAsync, PerformanceEvents, invoke, ThrottlingUtils, ProtocolUtils, AuthError, ProtocolMode, UrlString, ServerResponseType } from '@azure/msal-common';\nimport { StandardInteractionClient } from './StandardInteractionClient.mjs';\nimport { EventType } from '../event/EventType.mjs';\nimport { ApiId, InteractionType, BrowserConstants } from '../utils/BrowserConstants.mjs';\nimport { preconnect, getCurrentUri } from '../utils/BrowserUtils.mjs';\nimport { NativeInteractionClient } from './NativeInteractionClient.mjs';\nimport { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { InteractionHandler } from '../interaction_handler/InteractionHandler.mjs';\nimport { deserializeResponse } from '../response/ResponseHandler.mjs';\nimport { nativeConnectionNotEstablished, emptyNavigateUri, userCancelled, emptyWindowError, popupWindowError } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass PopupClient extends StandardInteractionClient {\n constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, nativeMessageHandler, correlationId) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\n // Properly sets this reference for the unload event.\n this.unloadWindow = this.unloadWindow.bind(this);\n this.nativeStorage = nativeStorageImpl;\n }\n /**\n * Acquires tokens by opening a popup window to the /authorize endpoint of the authority\n * @param request\n */\n acquireToken(request) {\n try {\n const popupName = this.generatePopupName(request.scopes || OIDC_DEFAULT_SCOPES, request.authority || this.config.auth.authority);\n const popupWindowAttributes = request.popupWindowAttributes || {};\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\n if (this.config.system.asyncPopups) {\n this.logger.verbose(\"asyncPopups set to true, acquiring token\");\n // Passes on popup position and dimensions if in request\n return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes);\n }\n else {\n // asyncPopups flag is set to false. Opens popup before acquiring token.\n this.logger.verbose(\"asyncPopup set to false, opening popup before acquiring token\");\n const popup = this.openSizedPopup(\"about:blank\", popupName, popupWindowAttributes);\n return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes, popup);\n }\n }\n catch (e) {\n return Promise.reject(e);\n }\n }\n /**\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\n * @param logoutRequest\n */\n logout(logoutRequest) {\n try {\n this.logger.verbose(\"logoutPopup called\");\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\n const popupName = this.generateLogoutPopupName(validLogoutRequest);\n const authority = logoutRequest && logoutRequest.authority;\n const mainWindowRedirectUri = logoutRequest && logoutRequest.mainWindowRedirectUri;\n const popupWindowAttributes = logoutRequest?.popupWindowAttributes || {};\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\n if (this.config.system.asyncPopups) {\n this.logger.verbose(\"asyncPopups set to true\");\n // Passes on popup position and dimensions if in request\n return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, undefined, mainWindowRedirectUri);\n }\n else {\n // asyncPopups flag is set to false. Opens popup before logging out.\n this.logger.verbose(\"asyncPopup set to false, opening popup\");\n const popup = this.openSizedPopup(\"about:blank\", popupName, popupWindowAttributes);\n return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, popup, mainWindowRedirectUri);\n }\n }\n catch (e) {\n // Since this function is synchronous we need to reject\n return Promise.reject(e);\n }\n }\n /**\n * Helper which obtains an access_token for your API via opening a popup window in the user's browser\n * @param validRequest\n * @param popupName\n * @param popup\n * @param popupWindowAttributes\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n async acquireTokenPopupAsync(request, popupName, popupWindowAttributes, popup) {\n this.logger.verbose(\"acquireTokenPopupAsync called\");\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenPopup);\n const validRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, this.correlationId)(request, InteractionType.Popup);\n preconnect(validRequest.authority);\n try {\n // Create auth code request and generate PKCE params\n const authCodeRequest = await invokeAsync(this.initializeAuthorizationCodeRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.logger, this.performanceClient, this.correlationId)(validRequest);\n // Initialize the client\n const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions, validRequest.account);\n const isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);\n // Start measurement for server calls with native brokering enabled\n let fetchNativeAccountIdMeasurement;\n if (isNativeBroker) {\n fetchNativeAccountIdMeasurement =\n this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);\n }\n // Create acquire token url.\n const navigateUrl = await authClient.getAuthCodeUrl({\n ...validRequest,\n nativeBroker: isNativeBroker,\n });\n // Create popup interaction handler.\n const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);\n // Show the UI once the url has been created. Get the window handle for the popup.\n const popupParameters = {\n popup,\n popupName,\n popupWindowAttributes,\n };\n const popupWindow = this.initiateAuthRequest(navigateUrl, popupParameters);\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, { popupWindow }, null);\n // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.\n const responseString = await this.monitorPopupForHash(popupWindow);\n const serverParams = invoke(deserializeResponse, PerformanceEvents.DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.serverResponseType, this.logger);\n // Remove throttle if it exists\n ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, authCodeRequest);\n if (serverParams.accountId) {\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\n // end measurement for server call with native brokering enabled\n if (fetchNativeAccountIdMeasurement) {\n fetchNativeAccountIdMeasurement.end({\n success: true,\n isNativeBroker: true,\n });\n }\n if (!this.nativeMessageHandler) {\n throw createBrowserAuthError(nativeConnectionNotEstablished);\n }\n const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, validRequest.correlationId);\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, validRequest.state);\n return await nativeInteractionClient.acquireToken({\n ...validRequest,\n state: userRequestState,\n prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently\n });\n }\n // Handle response from hash string.\n const result = await interactionHandler.handleCodeResponse(serverParams, validRequest);\n return result;\n }\n catch (e) {\n if (popup) {\n // Close the synchronous popup if an error is thrown before the window unload event is registered\n popup.close();\n }\n if (e instanceof AuthError) {\n e.setCorrelationId(this.correlationId);\n serverTelemetryManager.cacheFailedRequest(e);\n }\n throw e;\n }\n }\n /**\n *\n * @param validRequest\n * @param popupName\n * @param requestAuthority\n * @param popup\n * @param mainWindowRedirectUri\n * @param popupWindowAttributes\n */\n async logoutPopupAsync(validRequest, popupName, popupWindowAttributes, requestAuthority, popup, mainWindowRedirectUri) {\n this.logger.verbose(\"logoutPopupAsync called\");\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Popup, validRequest);\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logoutPopup);\n try {\n // Clear cache on logout\n await this.clearCacheOnLogout(validRequest.account);\n // Initialize the client\n const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, requestAuthority, undefined, // AzureCloudOptions\n validRequest.account || undefined);\n try {\n authClient.authority.endSessionEndpoint;\n }\n catch {\n if (validRequest.account?.homeAccountId &&\n validRequest.postLogoutRedirectUri &&\n authClient.authority.protocolMode === ProtocolMode.OIDC) {\n void this.browserStorage.removeAccount(validRequest.account?.homeAccountId);\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Popup, validRequest);\n if (mainWindowRedirectUri) {\n const navigationOptions = {\n apiId: ApiId.logoutPopup,\n timeout: this.config.system.redirectNavigationTimeout,\n noHistory: false,\n };\n const absoluteUrl = UrlString.getAbsoluteUrl(mainWindowRedirectUri, getCurrentUri());\n await this.navigationClient.navigateInternal(absoluteUrl, navigationOptions);\n }\n if (popup) {\n popup.close();\n }\n return;\n }\n }\n // Create logout string and navigate user window to logout.\n const logoutUri = authClient.getLogoutUri(validRequest);\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Popup, validRequest);\n // Open the popup window to requestUrl.\n const popupWindow = this.openPopup(logoutUri, {\n popupName,\n popupWindowAttributes,\n popup,\n });\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, { popupWindow }, null);\n await this.monitorPopupForHash(popupWindow).catch(() => {\n // Swallow any errors related to monitoring the window. Server logout is best effort\n });\n if (mainWindowRedirectUri) {\n const navigationOptions = {\n apiId: ApiId.logoutPopup,\n timeout: this.config.system.redirectNavigationTimeout,\n noHistory: false,\n };\n const absoluteUrl = UrlString.getAbsoluteUrl(mainWindowRedirectUri, getCurrentUri());\n this.logger.verbose(\"Redirecting main window to url specified in the request\");\n this.logger.verbosePii(`Redirecting main window to: ${absoluteUrl}`);\n await this.navigationClient.navigateInternal(absoluteUrl, navigationOptions);\n }\n else {\n this.logger.verbose(\"No main window navigation requested\");\n }\n }\n catch (e) {\n if (popup) {\n // Close the synchronous popup if an error is thrown before the window unload event is registered\n popup.close();\n }\n if (e instanceof AuthError) {\n e.setCorrelationId(this.correlationId);\n serverTelemetryManager.cacheFailedRequest(e);\n }\n this.browserStorage.setInteractionInProgress(false);\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Popup, null, e);\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\n throw e;\n }\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\n }\n /**\n * Opens a popup window with given request Url.\n * @param requestUrl\n */\n initiateAuthRequest(requestUrl, params) {\n // Check that request url is not empty.\n if (requestUrl) {\n this.logger.infoPii(`Navigate to: ${requestUrl}`);\n // Open the popup window to requestUrl.\n return this.openPopup(requestUrl, params);\n }\n else {\n // Throw error if request URL is empty.\n this.logger.error(\"Navigate url is empty\");\n throw createBrowserAuthError(emptyNavigateUri);\n }\n }\n /**\n * Monitors a window until it loads a url with the same origin.\n * @param popupWindow - window that is being monitored\n * @param timeout - timeout for processing hash once popup is redirected back to application\n */\n monitorPopupForHash(popupWindow) {\n return new Promise((resolve, reject) => {\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - polling started\");\n const intervalId = setInterval(() => {\n // Window is closed\n if (popupWindow.closed) {\n this.logger.error(\"PopupHandler.monitorPopupForHash - window closed\");\n clearInterval(intervalId);\n reject(createBrowserAuthError(userCancelled));\n return;\n }\n let href = \"\";\n try {\n /*\n * Will throw if cross origin,\n * which should be caught and ignored\n * since we need the interval to keep running while on STS UI.\n */\n href = popupWindow.location.href;\n }\n catch (e) { }\n // Don't process blank pages or cross domain\n if (!href || href === \"about:blank\") {\n return;\n }\n clearInterval(intervalId);\n let responseString = \"\";\n const responseType = this.config.auth.OIDCOptions.serverResponseType;\n if (popupWindow) {\n if (responseType === ServerResponseType.QUERY) {\n responseString = popupWindow.location.search;\n }\n else {\n responseString = popupWindow.location.hash;\n }\n }\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - popup window is on same origin as caller\");\n resolve(responseString);\n }, this.config.system.pollIntervalMilliseconds);\n }).finally(() => {\n this.cleanPopup(popupWindow);\n });\n }\n /**\n * @hidden\n *\n * Configures popup window for login.\n *\n * @param urlNavigate\n * @param title\n * @param popUpWidth\n * @param popUpHeight\n * @param popupWindowAttributes\n * @ignore\n * @hidden\n */\n openPopup(urlNavigate, popupParams) {\n try {\n let popupWindow;\n // Popup window passed in, setting url to navigate to\n if (popupParams.popup) {\n popupWindow = popupParams.popup;\n this.logger.verbosePii(`Navigating popup window to: ${urlNavigate}`);\n popupWindow.location.assign(urlNavigate);\n }\n else if (typeof popupParams.popup === \"undefined\") {\n // Popup will be undefined if it was not passed in\n this.logger.verbosePii(`Opening popup window to: ${urlNavigate}`);\n popupWindow = this.openSizedPopup(urlNavigate, popupParams.popupName, popupParams.popupWindowAttributes);\n }\n // Popup will be null if popups are blocked\n if (!popupWindow) {\n throw createBrowserAuthError(emptyWindowError);\n }\n if (popupWindow.focus) {\n popupWindow.focus();\n }\n this.currentWindow = popupWindow;\n window.addEventListener(\"beforeunload\", this.unloadWindow);\n return popupWindow;\n }\n catch (e) {\n this.logger.error(\"error opening popup \" + e.message);\n this.browserStorage.setInteractionInProgress(false);\n throw createBrowserAuthError(popupWindowError);\n }\n }\n /**\n * Helper function to set popup window dimensions and position\n * @param urlNavigate\n * @param popupName\n * @param popupWindowAttributes\n * @returns\n */\n openSizedPopup(urlNavigate, popupName, popupWindowAttributes) {\n /**\n * adding winLeft and winTop to account for dual monitor\n * using screenLeft and screenTop for IE8 and earlier\n */\n const winLeft = window.screenLeft ? window.screenLeft : window.screenX;\n const winTop = window.screenTop ? window.screenTop : window.screenY;\n /**\n * window.innerWidth displays browser window\"s height and width excluding toolbars\n * using document.documentElement.clientWidth for IE8 and earlier\n */\n const winWidth = window.innerWidth ||\n document.documentElement.clientWidth ||\n document.body.clientWidth;\n const winHeight = window.innerHeight ||\n document.documentElement.clientHeight ||\n document.body.clientHeight;\n let width = popupWindowAttributes.popupSize?.width;\n let height = popupWindowAttributes.popupSize?.height;\n let top = popupWindowAttributes.popupPosition?.top;\n let left = popupWindowAttributes.popupPosition?.left;\n if (!width || width < 0 || width > winWidth) {\n this.logger.verbose(\"Default popup window width used. Window width not configured or invalid.\");\n width = BrowserConstants.POPUP_WIDTH;\n }\n if (!height || height < 0 || height > winHeight) {\n this.logger.verbose(\"Default popup window height used. Window height not configured or invalid.\");\n height = BrowserConstants.POPUP_HEIGHT;\n }\n if (!top || top < 0 || top > winHeight) {\n this.logger.verbose(\"Default popup window top position used. Window top not configured or invalid.\");\n top = Math.max(0, winHeight / 2 - BrowserConstants.POPUP_HEIGHT / 2 + winTop);\n }\n if (!left || left < 0 || left > winWidth) {\n this.logger.verbose(\"Default popup window left position used. Window left not configured or invalid.\");\n left = Math.max(0, winWidth / 2 - BrowserConstants.POPUP_WIDTH / 2 + winLeft);\n }\n return window.open(urlNavigate, popupName, `width=${width}, height=${height}, top=${top}, left=${left}, scrollbars=yes`);\n }\n /**\n * Event callback to unload main window.\n */\n unloadWindow(e) {\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Popup);\n if (this.currentWindow) {\n this.currentWindow.close();\n }\n // Guarantees browser unload will happen, so no other errors will be thrown.\n e.preventDefault();\n }\n /**\n * Closes popup, removes any state vars created during popup calls.\n * @param popupWindow\n */\n cleanPopup(popupWindow) {\n if (popupWindow) {\n // Close window.\n popupWindow.close();\n }\n // Remove window unload function\n window.removeEventListener(\"beforeunload\", this.unloadWindow);\n // Interaction is completed - remove interaction status.\n this.browserStorage.setInteractionInProgress(false);\n }\n /**\n * Generates the name for the popup based on the client id and request\n * @param clientId\n * @param request\n */\n generatePopupName(scopes, authority) {\n return `${BrowserConstants.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${scopes.join(\"-\")}.${authority}.${this.correlationId}`;\n }\n /**\n * Generates the name for the popup based on the client id and request for logouts\n * @param clientId\n * @param request\n */\n generateLogoutPopupName(request) {\n const homeAccountId = request.account && request.account.homeAccountId;\n return `${BrowserConstants.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${homeAccountId}.${this.correlationId}`;\n }\n}\n\nexport { PopupClient };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { createClientAuthError, ClientAuthErrorCodes, ServerError, invokeAsync, PerformanceEvents } from '@azure/msal-common';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { TemporaryCacheKeys, ApiId } from '../utils/BrowserConstants.mjs';\nimport { emptyNavigateUri, userCancelled } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass RedirectHandler {\n constructor(authCodeModule, storageImpl, authCodeRequest, logger, performanceClient) {\n this.authModule = authCodeModule;\n this.browserStorage = storageImpl;\n this.authCodeRequest = authCodeRequest;\n this.logger = logger;\n this.performanceClient = performanceClient;\n }\n /**\n * Redirects window to given URL.\n * @param urlNavigate\n */\n async initiateAuthRequest(requestUrl, params) {\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest called\");\n // Navigate if valid URL\n if (requestUrl) {\n // Cache start page, returns to this page after redirectUri if navigateToLoginRequestUrl is true\n if (params.redirectStartPage) {\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page\");\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, params.redirectStartPage, true);\n }\n // Set interaction status in the library.\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, this.authCodeRequest.correlationId, true);\n this.browserStorage.cacheCodeRequest(this.authCodeRequest);\n this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${requestUrl}`);\n const navigationOptions = {\n apiId: ApiId.acquireTokenRedirect,\n timeout: params.redirectTimeout,\n noHistory: false,\n };\n // If onRedirectNavigate is implemented, invoke it and provide requestUrl\n if (typeof params.onRedirectNavigate === \"function\") {\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback\");\n const navigate = params.onRedirectNavigate(requestUrl);\n // Returning false from onRedirectNavigate will stop navigation\n if (navigate !== false) {\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating\");\n await params.navigationClient.navigateExternal(requestUrl, navigationOptions);\n return;\n }\n else {\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation\");\n return;\n }\n }\n else {\n // Navigate window to request URL\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: Navigating window to navigate url\");\n await params.navigationClient.navigateExternal(requestUrl, navigationOptions);\n return;\n }\n }\n else {\n // Throw error if request URL is empty.\n this.logger.info(\"RedirectHandler.initiateAuthRequest: Navigate url is empty\");\n throw createBrowserAuthError(emptyNavigateUri);\n }\n }\n /**\n * Handle authorization code response in the window.\n * @param hash\n */\n async handleCodeResponse(response, state) {\n this.logger.verbose(\"RedirectHandler.handleCodeResponse called\");\n // Interaction is completed - remove interaction status.\n this.browserStorage.setInteractionInProgress(false);\n // Handle code response.\n const stateKey = this.browserStorage.generateStateKey(state);\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\n if (!requestState) {\n throw createClientAuthError(ClientAuthErrorCodes.stateNotFound, \"Cached State\");\n }\n let authCodeResponse;\n try {\n authCodeResponse = this.authModule.handleFragmentResponse(response, requestState);\n }\n catch (e) {\n if (e instanceof ServerError &&\n e.subError === userCancelled) {\n // Translate server error caused by user closing native prompt to corresponding first class MSAL error\n throw createBrowserAuthError(userCancelled);\n }\n else {\n throw e;\n }\n }\n // Get cached items\n const nonceKey = this.browserStorage.generateNonceKey(requestState);\n const cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);\n // Assign code to request\n this.authCodeRequest.code = authCodeResponse.code;\n // Check for new cloud instance\n if (authCodeResponse.cloud_instance_host_name) {\n await invokeAsync(this.authModule.updateAuthority.bind(this.authModule), PerformanceEvents.UpdateTokenEndpointAuthority, this.logger, this.performanceClient, this.authCodeRequest.correlationId)(authCodeResponse.cloud_instance_host_name, this.authCodeRequest.correlationId);\n }\n authCodeResponse.nonce = cachedNonce || undefined;\n authCodeResponse.state = requestState;\n // Add CCS parameters if available\n if (authCodeResponse.client_info) {\n this.authCodeRequest.clientInfo = authCodeResponse.client_info;\n }\n else {\n const cachedCcsCred = this.checkCcsCredentials();\n if (cachedCcsCred) {\n this.authCodeRequest.ccsCredential = cachedCcsCred;\n }\n }\n // Acquire token with retrieved code.\n const tokenResponse = (await this.authModule.acquireToken(this.authCodeRequest, authCodeResponse));\n this.browserStorage.cleanRequestByState(state);\n return tokenResponse;\n }\n /**\n * Looks up ccs creds in the cache\n */\n checkCcsCredentials() {\n // Look up ccs credential in temp cache\n const cachedCcsCred = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, true);\n if (cachedCcsCred) {\n try {\n return JSON.parse(cachedCcsCred);\n }\n catch (e) {\n this.authModule.logger.error(\"Cache credential could not be parsed\");\n this.authModule.logger.errorPii(`Cache credential could not be parsed: ${cachedCcsCred}`);\n }\n }\n return null;\n }\n}\n\nexport { RedirectHandler };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { invokeAsync, PerformanceEvents, AuthError, Constants, UrlString, UrlUtils, ProtocolUtils, ThrottlingUtils, ProtocolMode, ServerResponseType } from '@azure/msal-common';\nimport { StandardInteractionClient } from './StandardInteractionClient.mjs';\nimport { InteractionType, ApiId, TemporaryCacheKeys } from '../utils/BrowserConstants.mjs';\nimport { RedirectHandler } from '../interaction_handler/RedirectHandler.mjs';\nimport { replaceHash, isInIframe, getHomepage, clearHash, getCurrentUri } from '../utils/BrowserUtils.mjs';\nimport { EventType } from '../event/EventType.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { NativeInteractionClient } from './NativeInteractionClient.mjs';\nimport { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.mjs';\nimport { validateInteractionType } from '../response/ResponseHandler.mjs';\nimport { noStateInHash, nativeConnectionNotEstablished, noCachedAuthorityError } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass RedirectClient extends StandardInteractionClient {\n constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, nativeMessageHandler, correlationId) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\n this.nativeStorage = nativeStorageImpl;\n }\n /**\n * Redirects the page to the /authorize endpoint of the IDP\n * @param request\n */\n async acquireToken(request) {\n const validRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, this.correlationId)(request, InteractionType.Redirect);\n this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || \"\", validRequest.account || null);\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);\n const handleBackButton = (event) => {\n // Clear temporary cache if the back button is clicked during the redirect flow.\n if (event.persisted) {\n this.logger.verbose(\"Page was restored from back/forward cache. Clearing temporary cache.\");\n this.browserStorage.cleanRequestByState(validRequest.state);\n this.eventHandler.emitEvent(EventType.RESTORE_FROM_BFCACHE, InteractionType.Redirect);\n }\n };\n try {\n // Create auth code request and generate PKCE params\n const authCodeRequest = await invokeAsync(this.initializeAuthorizationCodeRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.logger, this.performanceClient, this.correlationId)(validRequest);\n // Initialize the client\n const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions, validRequest.account);\n // Create redirect interaction handler.\n const interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);\n // Create acquire token url.\n const navigateUrl = await authClient.getAuthCodeUrl({\n ...validRequest,\n nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme),\n });\n const redirectStartPage = this.getRedirectStartPage(request.redirectStartPage);\n this.logger.verbosePii(`Redirect start page: ${redirectStartPage}`);\n // Clear temporary cache if the back button is clicked during the redirect flow.\n window.addEventListener(\"pageshow\", handleBackButton);\n // Show the UI once the url has been created. Response will come back in the hash, which will be handled in the handleRedirectCallback function.\n return await interactionHandler.initiateAuthRequest(navigateUrl, {\n navigationClient: this.navigationClient,\n redirectTimeout: this.config.system.redirectNavigationTimeout,\n redirectStartPage: redirectStartPage,\n onRedirectNavigate: request.onRedirectNavigate,\n });\n }\n catch (e) {\n if (e instanceof AuthError) {\n e.setCorrelationId(this.correlationId);\n serverTelemetryManager.cacheFailedRequest(e);\n }\n window.removeEventListener(\"pageshow\", handleBackButton);\n this.browserStorage.cleanRequestByState(validRequest.state);\n throw e;\n }\n }\n /**\n * Checks if navigateToLoginRequestUrl is set, and:\n * - if true, performs logic to cache and navigate\n * - if false, handles hash string and parses response\n * @param hash {string?} url hash\n * @param performanceClient {IPerformanceClient?}\n * @param correlationId {string?} correlation identifier\n */\n async handleRedirectPromise(hash, performanceClient, correlationId) {\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.handleRedirectPromise);\n try {\n if (!this.browserStorage.isInteractionInProgress(true)) {\n this.logger.info(\"handleRedirectPromise called but there is no interaction in progress, returning null.\");\n return null;\n }\n const [serverParams, responseString] = this.getRedirectResponse(hash || \"\");\n if (!serverParams) {\n // Not a recognized server response hash or hash not associated with a redirect request\n this.logger.info(\"handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache.\");\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\n if (performanceClient && correlationId) {\n performanceClient?.addFields({ errorCode: \"no_server_response\" }, correlationId);\n }\n return null;\n }\n // If navigateToLoginRequestUrl is true, get the url where the redirect request was initiated\n const loginRequestUrl = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, true) || Constants.EMPTY_STRING;\n const loginRequestUrlNormalized = UrlString.removeHashFromUrl(loginRequestUrl);\n const currentUrlNormalized = UrlString.removeHashFromUrl(window.location.href);\n if (loginRequestUrlNormalized === currentUrlNormalized &&\n this.config.auth.navigateToLoginRequestUrl) {\n // We are on the page we need to navigate to - handle hash\n this.logger.verbose(\"Current page is loginRequestUrl, handling response\");\n if (loginRequestUrl.indexOf(\"#\") > -1) {\n // Replace current hash with non-msal hash, if present\n replaceHash(loginRequestUrl);\n }\n const handleHashResult = await this.handleResponse(serverParams, serverTelemetryManager);\n return handleHashResult;\n }\n else if (!this.config.auth.navigateToLoginRequestUrl) {\n this.logger.verbose(\"NavigateToLoginRequestUrl set to false, handling response\");\n return await this.handleResponse(serverParams, serverTelemetryManager);\n }\n else if (!isInIframe() ||\n this.config.system.allowRedirectInIframe) {\n /*\n * Returned from authority using redirect - need to perform navigation before processing response\n * Cache the hash to be retrieved after the next redirect\n */\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.URL_HASH, responseString, true);\n const navigationOptions = {\n apiId: ApiId.handleRedirectPromise,\n timeout: this.config.system.redirectNavigationTimeout,\n noHistory: true,\n };\n /**\n * Default behavior is to redirect to the start page and not process the hash now.\n * The start page is expected to also call handleRedirectPromise which will process the hash in one of the checks above.\n */\n let processHashOnRedirect = true;\n if (!loginRequestUrl || loginRequestUrl === \"null\") {\n // Redirect to home page if login request url is null (real null or the string null)\n const homepage = getHomepage();\n // Cache the homepage under ORIGIN_URI to ensure cached hash is processed on homepage\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, homepage, true);\n this.logger.warning(\"Unable to get valid login request url from cache, redirecting to home page\");\n processHashOnRedirect =\n await this.navigationClient.navigateInternal(homepage, navigationOptions);\n }\n else {\n // Navigate to page that initiated the redirect request\n this.logger.verbose(`Navigating to loginRequestUrl: ${loginRequestUrl}`);\n processHashOnRedirect =\n await this.navigationClient.navigateInternal(loginRequestUrl, navigationOptions);\n }\n // If navigateInternal implementation returns false, handle the hash now\n if (!processHashOnRedirect) {\n return await this.handleResponse(serverParams, serverTelemetryManager);\n }\n }\n return null;\n }\n catch (e) {\n if (e instanceof AuthError) {\n e.setCorrelationId(this.correlationId);\n serverTelemetryManager.cacheFailedRequest(e);\n }\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\n throw e;\n }\n }\n /**\n * Gets the response hash for a redirect request\n * Returns null if interactionType in the state value is not \"redirect\" or the hash does not contain known properties\n * @param hash\n */\n getRedirectResponse(userProvidedResponse) {\n this.logger.verbose(\"getRedirectResponseHash called\");\n // Get current location hash from window or cache.\n let responseString = userProvidedResponse;\n if (!responseString) {\n if (this.config.auth.OIDCOptions.serverResponseType ===\n ServerResponseType.QUERY) {\n responseString = window.location.search;\n }\n else {\n responseString = window.location.hash;\n }\n }\n let response = UrlUtils.getDeserializedResponse(responseString);\n if (response) {\n try {\n validateInteractionType(response, this.browserCrypto, InteractionType.Redirect);\n }\n catch (e) {\n if (e instanceof AuthError) {\n this.logger.error(`Interaction type validation failed due to ${e.errorCode}: ${e.errorMessage}`);\n }\n return [null, \"\"];\n }\n clearHash(window);\n this.logger.verbose(\"Hash contains known properties, returning response hash\");\n return [response, responseString];\n }\n const cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);\n this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));\n if (cachedHash) {\n response = UrlUtils.getDeserializedResponse(cachedHash);\n if (response) {\n this.logger.verbose(\"Hash does not contain known properties, returning cached hash\");\n return [response, cachedHash];\n }\n }\n return [null, \"\"];\n }\n /**\n * Checks if hash exists and handles in window.\n * @param hash\n * @param state\n */\n async handleResponse(serverParams, serverTelemetryManager) {\n const state = serverParams.state;\n if (!state) {\n throw createBrowserAuthError(noStateInHash);\n }\n const cachedRequest = this.browserStorage.getCachedRequest(state);\n this.logger.verbose(\"handleResponse called, retrieved cached request\");\n if (serverParams.accountId) {\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\n if (!this.nativeMessageHandler) {\n throw createBrowserAuthError(nativeConnectionNotEstablished);\n }\n const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, cachedRequest.correlationId);\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);\n return nativeInteractionClient\n .acquireToken({\n ...cachedRequest,\n state: userRequestState,\n prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently\n })\n .finally(() => {\n this.browserStorage.cleanRequestByState(state);\n });\n }\n // Hash contains known properties - handle and return in callback\n const currentAuthority = this.browserStorage.getCachedAuthority(state);\n if (!currentAuthority) {\n throw createBrowserAuthError(noCachedAuthorityError);\n }\n const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, currentAuthority);\n ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, cachedRequest);\n const interactionHandler = new RedirectHandler(authClient, this.browserStorage, cachedRequest, this.logger, this.performanceClient);\n return interactionHandler.handleCodeResponse(serverParams, state);\n }\n /**\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\n * Default behaviour is to redirect the user to `window.location.href`.\n * @param logoutRequest\n */\n async logout(logoutRequest) {\n this.logger.verbose(\"logoutRedirect called\");\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logout);\n try {\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Redirect, logoutRequest);\n // Clear cache on logout\n await this.clearCacheOnLogout(validLogoutRequest.account);\n const navigationOptions = {\n apiId: ApiId.logout,\n timeout: this.config.system.redirectNavigationTimeout,\n noHistory: false,\n };\n const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, logoutRequest && logoutRequest.authority, undefined, // AzureCloudOptions\n (logoutRequest && logoutRequest.account) || undefined);\n if (authClient.authority.protocolMode === ProtocolMode.OIDC) {\n try {\n authClient.authority.endSessionEndpoint;\n }\n catch {\n if (validLogoutRequest.account?.homeAccountId) {\n void this.browserStorage.removeAccount(validLogoutRequest.account?.homeAccountId);\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Redirect, validLogoutRequest);\n return;\n }\n }\n }\n // Create logout string and navigate user window to logout.\n const logoutUri = authClient.getLogoutUri(validLogoutRequest);\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Redirect, validLogoutRequest);\n // Check if onRedirectNavigate is implemented, and invoke it if so\n if (logoutRequest &&\n typeof logoutRequest.onRedirectNavigate === \"function\") {\n const navigate = logoutRequest.onRedirectNavigate(logoutUri);\n if (navigate !== false) {\n this.logger.verbose(\"Logout onRedirectNavigate did not return false, navigating\");\n // Ensure interaction is in progress\n if (!this.browserStorage.getInteractionInProgress()) {\n this.browserStorage.setInteractionInProgress(true);\n }\n await this.navigationClient.navigateExternal(logoutUri, navigationOptions);\n return;\n }\n else {\n // Ensure interaction is not in progress\n this.browserStorage.setInteractionInProgress(false);\n this.logger.verbose(\"Logout onRedirectNavigate returned false, stopping navigation\");\n }\n }\n else {\n // Ensure interaction is in progress\n if (!this.browserStorage.getInteractionInProgress()) {\n this.browserStorage.setInteractionInProgress(true);\n }\n await this.navigationClient.navigateExternal(logoutUri, navigationOptions);\n return;\n }\n }\n catch (e) {\n if (e instanceof AuthError) {\n e.setCorrelationId(this.correlationId);\n serverTelemetryManager.cacheFailedRequest(e);\n }\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Redirect, null, e);\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\n throw e;\n }\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\n }\n /**\n * Use to get the redirectStartPage either from request or use current window\n * @param requestStartPage\n */\n getRedirectStartPage(requestStartPage) {\n const redirectStartPage = requestStartPage || window.location.href;\n return UrlString.getAbsoluteUrl(redirectStartPage, getCurrentUri());\n }\n}\n\nexport { RedirectClient };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass NavigationClient {\n /**\n * Navigates to other pages within the same web application\n * @param url\n * @param options\n */\n navigateInternal(url, options) {\n return NavigationClient.defaultNavigateWindow(url, options);\n }\n /**\n * Navigates to other pages outside the web application i.e. the Identity Provider\n * @param url\n * @param options\n */\n navigateExternal(url, options) {\n return NavigationClient.defaultNavigateWindow(url, options);\n }\n /**\n * Default navigation implementation invoked by the internal and external functions\n * @param url\n * @param options\n */\n static defaultNavigateWindow(url, options) {\n if (options.noHistory) {\n window.location.replace(url);\n }\n else {\n window.location.assign(url);\n }\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve(true);\n }, options.timeout);\n });\n }\n}\n\nexport { NavigationClient };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { Constants } from '@azure/msal-common';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { HTTP_REQUEST_TYPE } from '../utils/BrowserConstants.mjs';\nimport { getRequestFailed, noNetworkConnectivity, failedToParseResponse, postRequestFailed } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * This class implements the Fetch API for GET and POST requests. See more here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API\n */\nclass FetchClient {\n /**\n * Fetch Client for REST endpoints - Get request\n * @param url\n * @param headers\n * @param body\n */\n async sendGetRequestAsync(url, options) {\n let response;\n try {\n response = await fetch(url, {\n method: HTTP_REQUEST_TYPE.GET,\n headers: this.getFetchHeaders(options),\n });\n }\n catch (e) {\n if (window.navigator.onLine) {\n throw createBrowserAuthError(getRequestFailed);\n }\n else {\n throw createBrowserAuthError(noNetworkConnectivity);\n }\n }\n try {\n return {\n headers: this.getHeaderDict(response.headers),\n body: (await response.json()),\n status: response.status,\n };\n }\n catch (e) {\n throw createBrowserAuthError(failedToParseResponse);\n }\n }\n /**\n * Fetch Client for REST endpoints - Post request\n * @param url\n * @param headers\n * @param body\n */\n async sendPostRequestAsync(url, options) {\n const reqBody = (options && options.body) || Constants.EMPTY_STRING;\n let response;\n try {\n response = await fetch(url, {\n method: HTTP_REQUEST_TYPE.POST,\n headers: this.getFetchHeaders(options),\n body: reqBody,\n });\n }\n catch (e) {\n if (window.navigator.onLine) {\n throw createBrowserAuthError(postRequestFailed);\n }\n else {\n throw createBrowserAuthError(noNetworkConnectivity);\n }\n }\n try {\n return {\n headers: this.getHeaderDict(response.headers),\n body: (await response.json()),\n status: response.status,\n };\n }\n catch (e) {\n throw createBrowserAuthError(failedToParseResponse);\n }\n }\n /**\n * Get Fetch API Headers object from string map\n * @param inputHeaders\n */\n getFetchHeaders(options) {\n const headers = new Headers();\n if (!(options && options.headers)) {\n return headers;\n }\n const optionsHeaders = options.headers;\n Object.keys(optionsHeaders).forEach((key) => {\n headers.append(key, optionsHeaders[key]);\n });\n return headers;\n }\n getHeaderDict(headers) {\n const headerDict = {};\n headers.forEach((value, key) => {\n headerDict[key] = value;\n });\n return headerDict;\n }\n}\n\nexport { FetchClient };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { Constants, StubPerformanceClient, ProtocolMode, Logger, createClientConfigurationError, ClientConfigurationErrorCodes, ServerResponseType, AzureCloudInstance, LogLevel, DEFAULT_SYSTEM_OPTIONS, StubbedNetworkModule } from '@azure/msal-common';\nimport { BrowserCacheLocation, BrowserConstants } from '../utils/BrowserConstants.mjs';\nimport { NavigationClient } from '../navigation/NavigationClient.mjs';\nimport { FetchClient } from '../network/FetchClient.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n// Default timeout for popup windows and iframes in milliseconds\nconst DEFAULT_POPUP_TIMEOUT_MS = 60000;\nconst DEFAULT_IFRAME_TIMEOUT_MS = 10000;\nconst DEFAULT_REDIRECT_TIMEOUT_MS = 30000;\nconst DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS = 2000;\n/**\n * MSAL function that sets the default options when not explicitly configured from app developer\n *\n * @param auth\n * @param cache\n * @param system\n *\n * @returns Configuration object\n */\nfunction buildConfiguration({ auth: userInputAuth, cache: userInputCache, system: userInputSystem, telemetry: userInputTelemetry, }, isBrowserEnvironment) {\n // Default auth options for browser\n const DEFAULT_AUTH_OPTIONS = {\n clientId: Constants.EMPTY_STRING,\n authority: `${Constants.DEFAULT_AUTHORITY}`,\n knownAuthorities: [],\n cloudDiscoveryMetadata: Constants.EMPTY_STRING,\n authorityMetadata: Constants.EMPTY_STRING,\n redirectUri: Constants.EMPTY_STRING,\n postLogoutRedirectUri: Constants.EMPTY_STRING,\n navigateToLoginRequestUrl: true,\n clientCapabilities: [],\n protocolMode: ProtocolMode.AAD,\n OIDCOptions: {\n serverResponseType: ServerResponseType.FRAGMENT,\n defaultScopes: [\n Constants.OPENID_SCOPE,\n Constants.PROFILE_SCOPE,\n Constants.OFFLINE_ACCESS_SCOPE,\n ],\n },\n azureCloudOptions: {\n azureCloudInstance: AzureCloudInstance.None,\n tenant: Constants.EMPTY_STRING,\n },\n skipAuthorityMetadataCache: false,\n supportsNestedAppAuth: false,\n };\n // Default cache options for browser\n const DEFAULT_CACHE_OPTIONS = {\n cacheLocation: BrowserCacheLocation.SessionStorage,\n temporaryCacheLocation: BrowserCacheLocation.SessionStorage,\n storeAuthStateInCookie: false,\n secureCookies: false,\n // Default cache migration to true if cache location is localStorage since entries are preserved across tabs/windows. Migration has little to no benefit in sessionStorage and memoryStorage\n cacheMigrationEnabled: userInputCache &&\n userInputCache.cacheLocation === BrowserCacheLocation.LocalStorage\n ? true\n : false,\n claimsBasedCachingEnabled: false,\n };\n // Default logger options for browser\n const DEFAULT_LOGGER_OPTIONS = {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n loggerCallback: () => {\n // allow users to not set logger call back\n },\n logLevel: LogLevel.Info,\n piiLoggingEnabled: false,\n };\n // Default system options for browser\n const DEFAULT_BROWSER_SYSTEM_OPTIONS = {\n ...DEFAULT_SYSTEM_OPTIONS,\n loggerOptions: DEFAULT_LOGGER_OPTIONS,\n networkClient: isBrowserEnvironment\n ? new FetchClient()\n : StubbedNetworkModule,\n navigationClient: new NavigationClient(),\n loadFrameTimeout: 0,\n // If loadFrameTimeout is provided, use that as default.\n windowHashTimeout: userInputSystem?.loadFrameTimeout || DEFAULT_POPUP_TIMEOUT_MS,\n iframeHashTimeout: userInputSystem?.loadFrameTimeout || DEFAULT_IFRAME_TIMEOUT_MS,\n navigateFrameWait: 0,\n redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS,\n asyncPopups: false,\n allowRedirectInIframe: false,\n allowNativeBroker: false,\n nativeBrokerHandshakeTimeout: userInputSystem?.nativeBrokerHandshakeTimeout ||\n DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS,\n pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS,\n };\n const providedSystemOptions = {\n ...DEFAULT_BROWSER_SYSTEM_OPTIONS,\n ...userInputSystem,\n loggerOptions: userInputSystem?.loggerOptions || DEFAULT_LOGGER_OPTIONS,\n };\n const DEFAULT_TELEMETRY_OPTIONS = {\n application: {\n appName: Constants.EMPTY_STRING,\n appVersion: Constants.EMPTY_STRING,\n },\n client: new StubPerformanceClient(),\n };\n // Throw an error if user has set OIDCOptions without being in OIDC protocol mode\n if (userInputAuth?.protocolMode !== ProtocolMode.OIDC &&\n userInputAuth?.OIDCOptions) {\n const logger = new Logger(providedSystemOptions.loggerOptions);\n logger.warning(JSON.stringify(createClientConfigurationError(ClientConfigurationErrorCodes.cannotSetOIDCOptions)));\n }\n // Throw an error if user has set allowNativeBroker to true without being in AAD protocol mode\n if (userInputAuth?.protocolMode &&\n userInputAuth.protocolMode !== ProtocolMode.AAD &&\n providedSystemOptions?.allowNativeBroker) {\n throw createClientConfigurationError(ClientConfigurationErrorCodes.cannotAllowNativeBroker);\n }\n const overlayedConfig = {\n auth: {\n ...DEFAULT_AUTH_OPTIONS,\n ...userInputAuth,\n OIDCOptions: {\n ...DEFAULT_AUTH_OPTIONS.OIDCOptions,\n ...userInputAuth?.OIDCOptions,\n },\n },\n cache: { ...DEFAULT_CACHE_OPTIONS, ...userInputCache },\n system: providedSystemOptions,\n telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...userInputTelemetry },\n };\n return overlayedConfig;\n}\n\nexport { DEFAULT_IFRAME_TIMEOUT_MS, DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, DEFAULT_POPUP_TIMEOUT_MS, DEFAULT_REDIRECT_TIMEOUT_MS, buildConfiguration };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { PerformanceEvents, invokeAsync, invoke, ServerResponseType } from '@azure/msal-common';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { DEFAULT_IFRAME_TIMEOUT_MS } from '../config/Configuration.mjs';\nimport { emptyNavigateUri, monitorWindowTimeout } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * Creates a hidden iframe to given URL using user-requested scopes as an id.\n * @param urlNavigate\n * @param userRequestScopes\n */\nasync function initiateAuthRequest(requestUrl, performanceClient, logger, correlationId, navigateFrameWait) {\n performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerInitiateAuthRequest, correlationId);\n if (!requestUrl) {\n // Throw error if request URL is empty.\n logger.info(\"Navigate url is empty\");\n throw createBrowserAuthError(emptyNavigateUri);\n }\n if (navigateFrameWait) {\n return invokeAsync(loadFrame, PerformanceEvents.SilentHandlerLoadFrame, logger, performanceClient, correlationId)(requestUrl, navigateFrameWait, performanceClient, correlationId);\n }\n return invoke(loadFrameSync, PerformanceEvents.SilentHandlerLoadFrameSync, logger, performanceClient, correlationId)(requestUrl);\n}\n/**\n * Monitors an iframe content window until it loads a url with a known hash, or hits a specified timeout.\n * @param iframe\n * @param timeout\n */\nasync function monitorIframeForHash(iframe, timeout, pollIntervalMilliseconds, performanceClient, logger, correlationId, responseType) {\n performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerMonitorIframeForHash, correlationId);\n return new Promise((resolve, reject) => {\n if (timeout < DEFAULT_IFRAME_TIMEOUT_MS) {\n logger.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${timeout}ms) than the default (${DEFAULT_IFRAME_TIMEOUT_MS}ms). This may result in timeouts.`);\n }\n /*\n * Polling for iframes can be purely timing based,\n * since we don't need to account for interaction.\n */\n const timeoutId = window.setTimeout(() => {\n window.clearInterval(intervalId);\n reject(createBrowserAuthError(monitorWindowTimeout));\n }, timeout);\n const intervalId = window.setInterval(() => {\n let href = \"\";\n const contentWindow = iframe.contentWindow;\n try {\n /*\n * Will throw if cross origin,\n * which should be caught and ignored\n * since we need the interval to keep running while on STS UI.\n */\n href = contentWindow ? contentWindow.location.href : \"\";\n }\n catch (e) { }\n if (!href || href === \"about:blank\") {\n return;\n }\n let responseString = \"\";\n if (contentWindow) {\n if (responseType === ServerResponseType.QUERY) {\n responseString = contentWindow.location.search;\n }\n else {\n responseString = contentWindow.location.hash;\n }\n }\n window.clearTimeout(timeoutId);\n window.clearInterval(intervalId);\n resolve(responseString);\n }, pollIntervalMilliseconds);\n }).finally(() => {\n invoke(removeHiddenIframe, PerformanceEvents.RemoveHiddenIframe, logger, performanceClient, correlationId)(iframe);\n });\n}\n/**\n * @hidden\n * Loads iframe with authorization endpoint URL\n * @ignore\n * @deprecated\n */\nfunction loadFrame(urlNavigate, navigateFrameWait, performanceClient, correlationId) {\n performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerLoadFrame, correlationId);\n /*\n * This trick overcomes iframe navigation in IE\n * IE does not load the page consistently in iframe\n */\n return new Promise((resolve, reject) => {\n const frameHandle = createHiddenIframe();\n window.setTimeout(() => {\n if (!frameHandle) {\n reject(\"Unable to load iframe\");\n return;\n }\n frameHandle.src = urlNavigate;\n resolve(frameHandle);\n }, navigateFrameWait);\n });\n}\n/**\n * @hidden\n * Loads the iframe synchronously when the navigateTimeFrame is set to `0`\n * @param urlNavigate\n * @param frameName\n * @param logger\n */\nfunction loadFrameSync(urlNavigate) {\n const frameHandle = createHiddenIframe();\n frameHandle.src = urlNavigate;\n return frameHandle;\n}\n/**\n * @hidden\n * Creates a new hidden iframe or gets an existing one for silent token renewal.\n * @ignore\n */\nfunction createHiddenIframe() {\n const authFrame = document.createElement(\"iframe\");\n authFrame.style.visibility = \"hidden\";\n authFrame.style.position = \"absolute\";\n authFrame.style.width = authFrame.style.height = \"0\";\n authFrame.style.border = \"0\";\n authFrame.setAttribute(\"sandbox\", \"allow-scripts allow-same-origin allow-forms\");\n document.body.appendChild(authFrame);\n return authFrame;\n}\n/**\n * @hidden\n * Removes a hidden iframe from the page.\n * @ignore\n */\nfunction removeHiddenIframe(iframe) {\n if (document.body === iframe.parentNode) {\n document.body.removeChild(iframe);\n }\n}\n\nexport { initiateAuthRequest, monitorIframeForHash };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { PerformanceEvents, PromptValue, invokeAsync, AuthError, invoke, ProtocolUtils } from '@azure/msal-common';\nimport { StandardInteractionClient } from './StandardInteractionClient.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { InteractionType } from '../utils/BrowserConstants.mjs';\nimport { initiateAuthRequest, monitorIframeForHash } from '../interaction_handler/SilentHandler.mjs';\nimport { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.mjs';\nimport { NativeInteractionClient } from './NativeInteractionClient.mjs';\nimport { InteractionHandler } from '../interaction_handler/InteractionHandler.mjs';\nimport { preconnect } from '../utils/BrowserUtils.mjs';\nimport { deserializeResponse } from '../response/ResponseHandler.mjs';\nimport { silentLogoutUnsupported, nativeConnectionNotEstablished } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass SilentIframeClient extends StandardInteractionClient {\n constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, nativeStorageImpl, nativeMessageHandler, correlationId) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\n this.apiId = apiId;\n this.nativeStorage = nativeStorageImpl;\n }\n /**\n * Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none or prompt=no_session\n * @param request\n */\n async acquireToken(request) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);\n // Check that we have some SSO data\n if (!request.loginHint &&\n !request.sid &&\n (!request.account || !request.account.username)) {\n this.logger.warning(\"No user hint provided. The authorization server may need more information to complete this request.\");\n }\n // Check the prompt value\n const inputRequest = { ...request };\n if (inputRequest.prompt) {\n if (inputRequest.prompt !== PromptValue.NONE &&\n inputRequest.prompt !== PromptValue.NO_SESSION) {\n this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${inputRequest.prompt} with ${PromptValue.NONE}`);\n inputRequest.prompt = PromptValue.NONE;\n }\n }\n else {\n inputRequest.prompt = PromptValue.NONE;\n }\n // Create silent request\n const silentRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, request.correlationId)(inputRequest, InteractionType.Silent);\n preconnect(silentRequest.authority);\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\n try {\n // Initialize the client\n const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, request.correlationId)(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions, silentRequest.account);\n return await invokeAsync(this.silentTokenHelper.bind(this), PerformanceEvents.SilentIframeClientTokenHelper, this.logger, this.performanceClient, request.correlationId)(authClient, silentRequest);\n }\n catch (e) {\n if (e instanceof AuthError) {\n e.setCorrelationId(this.correlationId);\n serverTelemetryManager.cacheFailedRequest(e);\n }\n throw e;\n }\n }\n /**\n * Currently Unsupported\n */\n logout() {\n // Synchronous so we must reject\n return Promise.reject(createBrowserAuthError(silentLogoutUnsupported));\n }\n /**\n * Helper which acquires an authorization code silently using a hidden iframe from given url\n * using the scopes requested as part of the id, and exchanges the code for a set of OAuth tokens.\n * @param navigateUrl\n * @param userRequestScopes\n */\n async silentTokenHelper(authClient, silentRequest) {\n const correlationId = silentRequest.correlationId;\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientTokenHelper, correlationId);\n // Create auth code request and generate PKCE params\n const authCodeRequest = await invokeAsync(this.initializeAuthorizationCodeRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.logger, this.performanceClient, correlationId)(silentRequest);\n // Create authorize request url\n const navigateUrl = await invokeAsync(authClient.getAuthCodeUrl.bind(authClient), PerformanceEvents.GetAuthCodeUrl, this.logger, this.performanceClient, correlationId)({\n ...silentRequest,\n nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme),\n });\n // Create silent handler\n const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);\n // Get the frame handle for the silent request\n const msalFrame = await invokeAsync(initiateAuthRequest, PerformanceEvents.SilentHandlerInitiateAuthRequest, this.logger, this.performanceClient, correlationId)(navigateUrl, this.performanceClient, this.logger, correlationId, this.config.system.navigateFrameWait);\n const responseType = this.config.auth.OIDCOptions.serverResponseType;\n // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.\n const responseString = await invokeAsync(monitorIframeForHash, PerformanceEvents.SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(msalFrame, this.config.system.iframeHashTimeout, this.config.system.pollIntervalMilliseconds, this.performanceClient, this.logger, correlationId, responseType);\n const serverParams = invoke(deserializeResponse, PerformanceEvents.DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, responseType, this.logger);\n if (serverParams.accountId) {\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\n if (!this.nativeMessageHandler) {\n throw createBrowserAuthError(nativeConnectionNotEstablished);\n }\n const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.apiId, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.browserStorage, correlationId);\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, silentRequest.state);\n return invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), PerformanceEvents.NativeInteractionClientAcquireToken, this.logger, this.performanceClient, correlationId)({\n ...silentRequest,\n state: userRequestState,\n prompt: silentRequest.prompt || PromptValue.NONE,\n });\n }\n // Handle response from hash string\n return invokeAsync(interactionHandler.handleCodeResponse.bind(interactionHandler), PerformanceEvents.HandleCodeResponse, this.logger, this.performanceClient, correlationId)(serverParams, silentRequest);\n }\n}\n\nexport { SilentIframeClient };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { StandardInteractionClient } from './StandardInteractionClient.mjs';\nimport { PerformanceEvents, invokeAsync, RefreshTokenClient } from '@azure/msal-common';\nimport { ApiId } from '../utils/BrowserConstants.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { silentLogoutUnsupported } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass SilentRefreshClient extends StandardInteractionClient {\n /**\n * Exchanges the refresh token for new tokens\n * @param request\n */\n async acquireToken(request) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);\n const baseRequest = await invokeAsync(this.initializeBaseRequest.bind(this), PerformanceEvents.InitializeBaseRequest, this.logger, this.performanceClient, request.correlationId)(request);\n const silentRequest = {\n ...request,\n ...baseRequest,\n };\n if (request.redirectUri) {\n // Make sure any passed redirectUri is converted to an absolute URL - redirectUri is not a required parameter for refresh token redemption so only include if explicitly provided\n silentRequest.redirectUri = this.getRedirectUri(request.redirectUri);\n }\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\n const refreshTokenClient = await this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions, silentRequest.account);\n // Send request to renew token. Auth module will throw errors if token cannot be renewed.\n return invokeAsync(refreshTokenClient.acquireTokenByRefreshToken.bind(refreshTokenClient), PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, this.logger, this.performanceClient, request.correlationId)(silentRequest).catch((e) => {\n e.setCorrelationId(this.correlationId);\n serverTelemetryManager.cacheFailedRequest(e);\n throw e;\n });\n }\n /**\n * Currently Unsupported\n */\n logout() {\n // Synchronous so we must reject\n return Promise.reject(createBrowserAuthError(silentLogoutUnsupported));\n }\n /**\n * Creates a Refresh Client with the given authority, or the default authority.\n * @param serverTelemetryManager\n * @param authorityUrl\n */\n async createRefreshTokenClient(serverTelemetryManager, authorityUrl, azureCloudOptions, account) {\n // Create auth module.\n const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, authorityUrl, azureCloudOptions, account);\n return new RefreshTokenClient(clientConfig, this.performanceClient);\n }\n}\n\nexport { SilentRefreshClient };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { AuthToken, AccountEntity, CacheRecord, Authority, buildAccountToCache, CacheHelpers, ScopeSet, Constants } from '@azure/msal-common';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { base64Decode } from '../encode/Base64Decode.mjs';\nimport { createNewGuid } from '../crypto/BrowserCrypto.mjs';\nimport { unableToLoadToken } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * Token cache manager\n */\nclass TokenCache {\n constructor(configuration, storage, logger, cryptoObj) {\n this.isBrowserEnvironment = typeof window !== \"undefined\";\n this.config = configuration;\n this.storage = storage;\n this.logger = logger;\n this.cryptoObj = cryptoObj;\n }\n // Move getAllAccounts here and cache utility APIs\n /**\n * API to load tokens to msal-browser cache.\n * @param request\n * @param response\n * @param options\n * @returns `AuthenticationResult` for the response that was loaded.\n */\n loadExternalTokens(request, response, options) {\n this.logger.info(\"TokenCache - loadExternalTokens called\");\n if (!response.id_token) {\n throw createBrowserAuthError(unableToLoadToken);\n }\n const idTokenClaims = AuthToken.extractTokenClaims(response.id_token, base64Decode);\n let cacheRecord;\n let authority;\n let cacheRecordAccount;\n if (request.account) {\n cacheRecordAccount = AccountEntity.createFromAccountInfo(request.account);\n cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(response.id_token, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment));\n }\n else if (request.authority) {\n const authorityUrl = Authority.generateAuthority(request.authority, request.azureCloudOptions);\n const authorityOptions = {\n protocolMode: this.config.auth.protocolMode,\n knownAuthorities: this.config.auth.knownAuthorities,\n cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,\n authorityMetadata: this.config.auth.authorityMetadata,\n skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,\n };\n authority = new Authority(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions, this.logger, request.correlationId || createNewGuid());\n // \"clientInfo\" from options takes precedence over \"clientInfo\" in response\n if (options.clientInfo) {\n this.logger.trace(\"TokenCache - homeAccountId from options\");\n cacheRecordAccount = this.loadAccount(idTokenClaims, authority, options.clientInfo);\n cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(response.id_token, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort));\n }\n else if (response.client_info) {\n this.logger.trace(\"TokenCache - homeAccountId from response\");\n cacheRecordAccount = this.loadAccount(idTokenClaims, authority, response.client_info);\n cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(response.id_token, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort));\n }\n else {\n throw createBrowserAuthError(unableToLoadToken);\n }\n }\n else {\n throw createBrowserAuthError(unableToLoadToken);\n }\n return this.generateAuthenticationResult(request, idTokenClaims, cacheRecord, cacheRecordAccount, authority);\n }\n /**\n * Helper function to load account to msal-browser cache\n * @param idToken\n * @param environment\n * @param clientInfo\n * @param authorityType\n * @param requestHomeAccountId\n * @returns `AccountEntity`\n */\n loadAccount(idTokenClaims, authority, clientInfo, requestHomeAccountId) {\n if (this.isBrowserEnvironment) {\n this.logger.verbose(\"TokenCache - loading account\");\n let homeAccountId;\n if (requestHomeAccountId) {\n homeAccountId = requestHomeAccountId;\n }\n else if (authority.authorityType !== undefined && clientInfo) {\n homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authority.authorityType, this.logger, this.cryptoObj, idTokenClaims);\n }\n if (!homeAccountId) {\n throw createBrowserAuthError(unableToLoadToken);\n }\n const claimsTenantId = idTokenClaims.tid;\n const cachedAccount = buildAccountToCache(this.storage, authority, homeAccountId, idTokenClaims, base64Decode, clientInfo, authority.hostnameAndPort, claimsTenantId, undefined, // authCodePayload\n undefined, // nativeAccountId\n this.logger);\n this.storage.setAccount(cachedAccount);\n return cachedAccount;\n }\n else {\n throw createBrowserAuthError(unableToLoadToken);\n }\n }\n /**\n * Helper function to load id tokens to msal-browser cache\n * @param idToken\n * @param homeAccountId\n * @param environment\n * @param tenantId\n * @returns `IdTokenEntity`\n */\n loadIdToken(idToken, homeAccountId, environment, tenantId) {\n const idTokenEntity = CacheHelpers.createIdTokenEntity(homeAccountId, environment, idToken, this.config.auth.clientId, tenantId);\n if (this.isBrowserEnvironment) {\n this.logger.verbose(\"TokenCache - loading id token\");\n this.storage.setIdTokenCredential(idTokenEntity);\n return idTokenEntity;\n }\n else {\n throw createBrowserAuthError(unableToLoadToken);\n }\n }\n /**\n * Helper function to load access tokens to msal-browser cache\n * @param request\n * @param response\n * @param homeAccountId\n * @param environment\n * @param tenantId\n * @returns `AccessTokenEntity`\n */\n loadAccessToken(request, response, homeAccountId, environment, tenantId, options) {\n if (!response.access_token) {\n this.logger.verbose(\"TokenCache - No access token provided for caching\");\n return null;\n }\n if (!response.expires_in) {\n throw createBrowserAuthError(unableToLoadToken);\n }\n if (!options.extendedExpiresOn) {\n throw createBrowserAuthError(unableToLoadToken);\n }\n const scopes = new ScopeSet(request.scopes).printScopes();\n const expiresOn = options.expiresOn ||\n response.expires_in + new Date().getTime() / 1000;\n const extendedExpiresOn = options.extendedExpiresOn;\n const accessTokenEntity = CacheHelpers.createAccessTokenEntity(homeAccountId, environment, response.access_token, this.config.auth.clientId, tenantId, scopes, expiresOn, extendedExpiresOn, base64Decode);\n if (this.isBrowserEnvironment) {\n this.logger.verbose(\"TokenCache - loading access token\");\n this.storage.setAccessTokenCredential(accessTokenEntity);\n return accessTokenEntity;\n }\n else {\n throw createBrowserAuthError(unableToLoadToken);\n }\n }\n /**\n * Helper function to load refresh tokens to msal-browser cache\n * @param request\n * @param response\n * @param homeAccountId\n * @param environment\n * @returns `RefreshTokenEntity`\n */\n loadRefreshToken(request, response, homeAccountId, environment) {\n if (!response.refresh_token) {\n this.logger.verbose(\"TokenCache - No refresh token provided for caching\");\n return null;\n }\n const refreshTokenEntity = CacheHelpers.createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, this.config.auth.clientId);\n if (this.isBrowserEnvironment) {\n this.logger.verbose(\"TokenCache - loading refresh token\");\n this.storage.setRefreshTokenCredential(refreshTokenEntity);\n return refreshTokenEntity;\n }\n else {\n throw createBrowserAuthError(unableToLoadToken);\n }\n }\n /**\n * Helper function to generate an `AuthenticationResult` for the result.\n * @param request\n * @param idTokenObj\n * @param cacheRecord\n * @param authority\n * @returns `AuthenticationResult`\n */\n generateAuthenticationResult(request, idTokenClaims, cacheRecord, accountEntity, authority) {\n let accessToken = Constants.EMPTY_STRING;\n let responseScopes = [];\n let expiresOn = null;\n let extExpiresOn;\n if (cacheRecord?.accessToken) {\n accessToken = cacheRecord.accessToken.secret;\n responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();\n expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);\n extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);\n }\n const uid = idTokenClaims.oid || idTokenClaims.sub || Constants.EMPTY_STRING;\n const tid = idTokenClaims.tid || Constants.EMPTY_STRING;\n return {\n authority: authority\n ? authority.canonicalAuthority\n : Constants.EMPTY_STRING,\n uniqueId: uid,\n tenantId: tid,\n scopes: responseScopes,\n account: accountEntity.getAccountInfo(),\n idToken: cacheRecord.idToken?.secret || \"\",\n idTokenClaims: idTokenClaims || {},\n accessToken: accessToken,\n fromCache: true,\n expiresOn: expiresOn,\n correlationId: request.correlationId || Constants.EMPTY_STRING,\n requestId: Constants.EMPTY_STRING,\n extExpiresOn: extExpiresOn,\n familyId: Constants.EMPTY_STRING,\n tokenType: cacheRecord?.accessToken?.tokenType || Constants.EMPTY_STRING,\n state: Constants.EMPTY_STRING,\n cloudGraphHostName: accountEntity.cloudGraphHostName || Constants.EMPTY_STRING,\n msGraphHost: accountEntity.msGraphHost || Constants.EMPTY_STRING,\n code: undefined,\n fromNativeBroker: false,\n };\n }\n}\n\nexport { TokenCache };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { AuthorizationCodeClient } from '@azure/msal-common';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass HybridSpaAuthorizationCodeClient extends AuthorizationCodeClient {\n constructor(config) {\n super(config);\n this.includeRedirectUri = false;\n }\n}\n\nexport { HybridSpaAuthorizationCodeClient };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { invokeAsync, PerformanceEvents, AuthError } from '@azure/msal-common';\nimport { StandardInteractionClient } from './StandardInteractionClient.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { InteractionType } from '../utils/BrowserConstants.mjs';\nimport { HybridSpaAuthorizationCodeClient } from './HybridSpaAuthorizationCodeClient.mjs';\nimport { InteractionHandler } from '../interaction_handler/InteractionHandler.mjs';\nimport { authCodeRequired, silentLogoutUnsupported } from '../error/BrowserAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass SilentAuthCodeClient extends StandardInteractionClient {\n constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, nativeMessageHandler, correlationId) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\n this.apiId = apiId;\n }\n /**\n * Acquires a token silently by redeeming an authorization code against the /token endpoint\n * @param request\n */\n async acquireToken(request) {\n // Auth code payload is required\n if (!request.code) {\n throw createBrowserAuthError(authCodeRequired);\n }\n // Create silent request\n const silentRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, request.correlationId)(request, InteractionType.Silent);\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\n try {\n // Create auth code request (PKCE not needed)\n const authCodeRequest = {\n ...silentRequest,\n code: request.code,\n };\n // Initialize the client\n const clientConfig = await invokeAsync(this.getClientConfiguration.bind(this), PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.logger, this.performanceClient, request.correlationId)(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions, silentRequest.account);\n const authClient = new HybridSpaAuthorizationCodeClient(clientConfig);\n this.logger.verbose(\"Auth code client created\");\n // Create silent handler\n const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);\n // Handle auth code parameters from request\n return await invokeAsync(interactionHandler.handleCodeResponseFromServer.bind(interactionHandler), PerformanceEvents.HandleCodeResponseFromServer, this.logger, this.performanceClient, request.correlationId)({\n code: request.code,\n msgraph_host: request.msGraphHost,\n cloud_graph_host_name: request.cloudGraphHostName,\n cloud_instance_host_name: request.cloudInstanceHostName,\n }, silentRequest, false);\n }\n catch (e) {\n if (e instanceof AuthError) {\n e.setCorrelationId(this.correlationId);\n serverTelemetryManager.cacheFailedRequest(e);\n }\n throw e;\n }\n }\n /**\n * Currently Unsupported\n */\n logout() {\n // Synchronous so we must reject\n return Promise.reject(createBrowserAuthError(silentLogoutUnsupported));\n }\n}\n\nexport { SilentAuthCodeClient };\n\n","/*! @azure/msal-browser v3.10.0 2024-02-17 */\n'use strict';\nimport { CryptoOps } from '../crypto/CryptoOps.mjs';\nimport { DEFAULT_CRYPTO_IMPLEMENTATION, buildStaticAuthorityOptions, PerformanceEvents, invokeAsync, AuthError, InteractionRequiredAuthError, createClientAuthError, ClientAuthErrorCodes, AccountEntity, PromptValue, Constants, InteractionRequiredAuthErrorCodes } from '@azure/msal-common';\nimport { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from '../cache/BrowserCacheManager.mjs';\nimport { TemporaryCacheKeys, InteractionType, ApiId, CacheLookupPolicy, BrowserCacheLocation, DEFAULT_REQUEST, iFrameRenewalPolicies, BrowserConstants } from '../utils/BrowserConstants.mjs';\nimport { blockAPICallsBeforeInitialize, blockNonBrowserEnvironment, blockRedirectInIframe, blockReloadInHiddenIframes, blockAcquireTokenInPopups } from '../utils/BrowserUtils.mjs';\nimport { EventType } from '../event/EventType.mjs';\nimport { createBrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.mjs';\nimport { EventHandler } from '../event/EventHandler.mjs';\nimport { PopupClient } from '../interaction_client/PopupClient.mjs';\nimport { RedirectClient } from '../interaction_client/RedirectClient.mjs';\nimport { SilentIframeClient } from '../interaction_client/SilentIframeClient.mjs';\nimport { SilentRefreshClient } from '../interaction_client/SilentRefreshClient.mjs';\nimport { TokenCache } from '../cache/TokenCache.mjs';\nimport { NativeInteractionClient } from '../interaction_client/NativeInteractionClient.mjs';\nimport { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.mjs';\nimport { NativeAuthError, isFatalNativeAuthError } from '../error/NativeAuthError.mjs';\nimport { SilentCacheClient } from '../interaction_client/SilentCacheClient.mjs';\nimport { SilentAuthCodeClient } from '../interaction_client/SilentAuthCodeClient.mjs';\nimport { createBrowserAuthError } from '../error/BrowserAuthError.mjs';\nimport { createNewGuid } from '../crypto/BrowserCrypto.mjs';\nimport { spaCodeAndNativeAccountIdPresent, unableToAcquireTokenFromNativePlatform, authCodeOrNativeAccountIdRequired, nativeConnectionNotEstablished, noAccountError } from '../error/BrowserAuthErrorCodes.mjs';\nimport { inMemRedirectUnavailable } from '../error/BrowserConfigurationAuthErrorCodes.mjs';\n\n/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nclass StandardController {\n /**\n * @constructor\n * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object\n *\n * Important attributes in the Configuration object for auth are:\n * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview\n * - authority: the authority URL for your application.\n * - redirect_uri: the uri of your application registered in the portal.\n *\n * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.\n * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}\n * If your application supports Accounts in one organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).\n * If your application supports Accounts in any organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with organizations.\n * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace \"Enter_the_Tenant_Info_Here\" value with common.\n * To restrict support to Personal Microsoft accounts only, replace \"Enter_the_Tenant_Info_Here\" value with consumers.\n *\n * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/\n * Full B2C functionality will be available in this library in future versions.\n *\n * @param configuration Object for the MSAL PublicClientApplication instance\n */\n constructor(operatingContext) {\n this.atsAsyncMeasurement = undefined;\n this.operatingContext = operatingContext;\n this.isBrowserEnvironment =\n this.operatingContext.isBrowserEnvironment();\n // Set the configuration.\n this.config = operatingContext.getConfig();\n this.initialized = false;\n // Initialize logger\n this.logger = this.operatingContext.getLogger();\n // Initialize the network module class.\n this.networkClient = this.config.system.networkClient;\n // Initialize the navigation client class.\n this.navigationClient = this.config.system.navigationClient;\n // Initialize redirectResponse Map\n this.redirectResponse = new Map();\n // Initial hybrid spa map\n this.hybridAuthCodeResponses = new Map();\n // Initialize performance client\n this.performanceClient = this.config.telemetry.client;\n // Initialize the crypto class.\n this.browserCrypto = this.isBrowserEnvironment\n ? new CryptoOps(this.logger, this.performanceClient)\n : DEFAULT_CRYPTO_IMPLEMENTATION;\n this.eventHandler = new EventHandler(this.logger, this.browserCrypto);\n // Initialize the browser storage class.\n this.browserStorage = this.isBrowserEnvironment\n ? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, buildStaticAuthorityOptions(this.config.auth))\n : DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);\n // initialize in memory storage for native flows\n const nativeCacheOptions = {\n cacheLocation: BrowserCacheLocation.MemoryStorage,\n temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,\n storeAuthStateInCookie: false,\n secureCookies: false,\n cacheMigrationEnabled: false,\n claimsBasedCachingEnabled: false,\n };\n this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger);\n // Initialize the token cache\n this.tokenCache = new TokenCache(this.config, this.browserStorage, this.logger, this.browserCrypto);\n this.activeSilentTokenRequests = new Map();\n // Register listener functions\n this.trackPageVisibility = this.trackPageVisibility.bind(this);\n // Register listener functions\n this.trackPageVisibilityWithMeasurement =\n this.trackPageVisibilityWithMeasurement.bind(this);\n }\n static async createController(operatingContext) {\n const controller = new StandardController(operatingContext);\n await controller.initialize();\n return controller;\n }\n trackPageVisibility() {\n if (!this.atsAsyncMeasurement) {\n return;\n }\n this.logger.info(\"Perf: Visibility change detected\");\n this.atsAsyncMeasurement.increment({\n visibilityChangeCount: 1,\n });\n }\n /**\n * Initializer function to perform async startup tasks such as connecting to WAM extension\n */\n async initialize() {\n this.logger.trace(\"initialize called\");\n if (this.initialized) {\n this.logger.info(\"initialize has already been called, exiting early.\");\n return;\n }\n const allowNativeBroker = this.config.system.allowNativeBroker;\n const initMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.InitializeClientApplication);\n this.eventHandler.emitEvent(EventType.INITIALIZE_START);\n if (allowNativeBroker) {\n try {\n this.nativeExtensionProvider =\n await NativeMessageHandler.createProvider(this.logger, this.config.system.nativeBrokerHandshakeTimeout, this.performanceClient);\n }\n catch (e) {\n this.logger.verbose(e);\n }\n }\n if (!this.config.cache.claimsBasedCachingEnabled) {\n this.logger.verbose(\"Claims-based caching is disabled. Clearing the previous cache with claims\");\n await invokeAsync(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage), PerformanceEvents.ClearTokensAndKeysWithClaims, this.logger, this.performanceClient)(this.performanceClient);\n }\n this.initialized = true;\n this.eventHandler.emitEvent(EventType.INITIALIZE_END);\n initMeasurement.end({ allowNativeBroker, success: true });\n }\n // #region Redirect Flow\n /**\n * Event handler function which allows users to fire events after the PublicClientApplication object\n * has loaded during redirect flows. This should be invoked on all page loads involved in redirect\n * auth flows.\n * @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.\n * @returns Token response or null. If the return value is null, then no auth redirect was detected.\n */\n async handleRedirectPromise(hash) {\n this.logger.verbose(\"handleRedirectPromise called\");\n // Block token acquisition before initialize has been called\n blockAPICallsBeforeInitialize(this.initialized);\n const loggedInAccounts = this.getAllAccounts();\n if (this.isBrowserEnvironment) {\n /**\n * Store the promise on the PublicClientApplication instance if this is the first invocation of handleRedirectPromise,\n * otherwise return the promise from the first invocation. Prevents race conditions when handleRedirectPromise is called\n * several times concurrently.\n */\n const redirectResponseKey = hash || \"\";\n let response = this.redirectResponse.get(redirectResponseKey);\n if (typeof response === \"undefined\") {\n const request = this.browserStorage.getCachedNativeRequest();\n const useNative = request &&\n NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider) &&\n this.nativeExtensionProvider &&\n !hash;\n const correlationId = useNative\n ? request?.correlationId\n : this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, true) || \"\";\n const rootMeasurement = this.performanceClient.startMeasurement(\"acquireTokenRedirect\", correlationId);\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_START, InteractionType.Redirect);\n this.logger.verbose(\"handleRedirectPromise has been called for the first time, storing the promise\");\n let redirectResponse;\n if (useNative && this.nativeExtensionProvider) {\n this.logger.trace(\"handleRedirectPromise - acquiring token from native platform\");\n const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.handleRedirectPromise, this.performanceClient, this.nativeExtensionProvider, request.accountId, this.nativeInternalStorage, request.correlationId);\n redirectResponse = invokeAsync(nativeClient.handleRedirectPromise.bind(nativeClient), PerformanceEvents.HandleNativeRedirectPromiseMeasurement, this.logger, this.performanceClient, rootMeasurement.event.correlationId)(this.performanceClient, rootMeasurement.event.correlationId);\n }\n else {\n this.logger.trace(\"handleRedirectPromise - acquiring token from web flow\");\n const redirectClient = this.createRedirectClient(correlationId);\n redirectResponse = invokeAsync(redirectClient.handleRedirectPromise.bind(redirectClient), PerformanceEvents.HandleRedirectPromiseMeasurement, this.logger, this.performanceClient, rootMeasurement.event.correlationId)(hash, this.performanceClient, rootMeasurement.event.correlationId);\n }\n response = redirectResponse\n .then((result) => {\n if (result) {\n // Emit login event if number of accounts change\n const isLoggingIn = loggedInAccounts.length <\n this.getAllAccounts().length;\n if (isLoggingIn) {\n this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Redirect, result);\n this.logger.verbose(\"handleRedirectResponse returned result, login success\");\n }\n else {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Redirect, result);\n this.logger.verbose(\"handleRedirectResponse returned result, acquire token success\");\n }\n rootMeasurement.end({ success: true });\n }\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\n rootMeasurement.end({ success: false });\n return result;\n })\n .catch((e) => {\n const eventError = e;\n // Emit login event if there is an account\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, eventError);\n }\n else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, eventError);\n }\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\n if (eventError instanceof AuthError) {\n rootMeasurement.end({\n success: false,\n errorCode: eventError.errorCode,\n subErrorCode: eventError.subError,\n });\n }\n else {\n rootMeasurement.end({\n success: false,\n });\n }\n throw e;\n });\n this.redirectResponse.set(redirectResponseKey, response);\n }\n else {\n this.logger.verbose(\"handleRedirectPromise has been called previously, returning the result from the first call\");\n }\n return response;\n }\n this.logger.verbose(\"handleRedirectPromise returns null, not browser environment\");\n return null;\n }\n /**\n * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects\n * the page, so any code that follows this function will not execute.\n *\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\n *\n * @param request\n */\n async acquireTokenRedirect(request) {\n // Preflight request\n const correlationId = this.getRequestCorrelationId(request);\n this.logger.verbose(\"acquireTokenRedirect called\", correlationId);\n this.preflightBrowserEnvironmentCheck(InteractionType.Redirect);\n // If logged in, emit acquire token events\n const isLoggedIn = this.getAllAccounts().length > 0;\n if (isLoggedIn) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Redirect, request);\n }\n else {\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Redirect, request);\n }\n let result;\n if (this.nativeExtensionProvider && this.canUseNative(request)) {\n const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.nativeExtensionProvider, this.getNativeAccountId(request), this.nativeInternalStorage, correlationId);\n result = nativeClient\n .acquireTokenRedirect(request)\n .catch((e) => {\n if (e instanceof NativeAuthError &&\n isFatalNativeAuthError(e)) {\n this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\n const redirectClient = this.createRedirectClient(correlationId);\n return redirectClient.acquireToken(request);\n }\n else if (e instanceof InteractionRequiredAuthError) {\n this.logger.verbose(\"acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow\");\n const redirectClient = this.createRedirectClient(correlationId);\n return redirectClient.acquireToken(request);\n }\n this.getBrowserStorage().setInteractionInProgress(false);\n throw e;\n });\n }\n else {\n const redirectClient = this.createRedirectClient(correlationId);\n result = redirectClient.acquireToken(request);\n }\n return result.catch((e) => {\n // If logged in, emit acquire token events\n if (isLoggedIn) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, e);\n }\n else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, e);\n }\n throw e;\n });\n }\n // #endregion\n // #region Popup Flow\n /**\n * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser\n *\n * @param request\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n acquireTokenPopup(request) {\n const correlationId = this.getRequestCorrelationId(request);\n const atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, correlationId);\n try {\n this.logger.verbose(\"acquireTokenPopup called\", correlationId);\n this.preflightBrowserEnvironmentCheck(InteractionType.Popup);\n }\n catch (e) {\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n }\n // If logged in, emit acquire token events\n const loggedInAccounts = this.getAllAccounts();\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Popup, request);\n }\n else {\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Popup, request);\n }\n let result;\n if (this.canUseNative(request)) {\n result = this.acquireTokenNative({\n ...request,\n correlationId,\n }, ApiId.acquireTokenPopup)\n .then((response) => {\n this.getBrowserStorage().setInteractionInProgress(false);\n atPopupMeasurement.end({\n success: true,\n isNativeBroker: true,\n requestId: response.requestId,\n });\n return response;\n })\n .catch((e) => {\n if (e instanceof NativeAuthError &&\n isFatalNativeAuthError(e)) {\n this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\n const popupClient = this.createPopupClient(correlationId);\n return popupClient.acquireToken(request);\n }\n else if (e instanceof InteractionRequiredAuthError) {\n this.logger.verbose(\"acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow\");\n const popupClient = this.createPopupClient(correlationId);\n return popupClient.acquireToken(request);\n }\n this.getBrowserStorage().setInteractionInProgress(false);\n throw e;\n });\n }\n else {\n const popupClient = this.createPopupClient(correlationId);\n result = popupClient.acquireToken(request);\n }\n return result\n .then((result) => {\n /*\n * If logged in, emit acquire token events\n */\n const isLoggingIn = loggedInAccounts.length < this.getAllAccounts().length;\n if (isLoggingIn) {\n this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Popup, result);\n }\n else {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Popup, result);\n }\n atPopupMeasurement.add({\n accessTokenSize: result.accessToken.length,\n idTokenSize: result.idToken.length,\n });\n atPopupMeasurement.end({\n success: true,\n requestId: result.requestId,\n });\n return result;\n })\n .catch((e) => {\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Popup, null, e);\n }\n else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Popup, null, e);\n }\n atPopupMeasurement.end({\n errorCode: e.errorCode,\n subErrorCode: e.subError,\n success: false,\n });\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n });\n }\n trackPageVisibilityWithMeasurement() {\n const measurement = this.ssoSilentMeasurement ||\n this.acquireTokenByCodeAsyncMeasurement;\n if (!measurement) {\n return;\n }\n this.logger.info(\"Perf: Visibility change detected in \", measurement.event.name);\n measurement.increment({\n visibilityChangeCount: 1,\n });\n }\n // #endregion\n // #region Silent Flow\n /**\n * This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:\n * - Any browser using a form of Intelligent Tracking Prevention\n * - If there is not an established session with the service\n *\n * In these cases, the request must be done inside a popup or full frame redirect.\n *\n * For the cases where interaction is required, you cannot send a request with prompt=none.\n *\n * If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as\n * you session on the server still exists.\n * @param request {@link SsoSilentRequest}\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n async ssoSilent(request) {\n const correlationId = this.getRequestCorrelationId(request);\n const validRequest = {\n ...request,\n // will be PromptValue.NONE or PromptValue.NO_SESSION\n prompt: request.prompt,\n correlationId: correlationId,\n };\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\n this.ssoSilentMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SsoSilent, correlationId);\n this.ssoSilentMeasurement?.increment({\n visibilityChangeCount: 0,\n });\n document.addEventListener(\"visibilitychange\", this.trackPageVisibilityWithMeasurement);\n this.logger.verbose(\"ssoSilent called\", correlationId);\n this.eventHandler.emitEvent(EventType.SSO_SILENT_START, InteractionType.Silent, validRequest);\n let result;\n if (this.canUseNative(validRequest)) {\n result = this.acquireTokenNative(validRequest, ApiId.ssoSilent).catch((e) => {\n // If native token acquisition fails for availability reasons fallback to standard flow\n if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {\n this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\n const silentIframeClient = this.createSilentIframeClient(validRequest.correlationId);\n return silentIframeClient.acquireToken(validRequest);\n }\n throw e;\n });\n }\n else {\n const silentIframeClient = this.createSilentIframeClient(validRequest.correlationId);\n result = silentIframeClient.acquireToken(validRequest);\n }\n return result\n .then((response) => {\n this.eventHandler.emitEvent(EventType.SSO_SILENT_SUCCESS, InteractionType.Silent, response);\n this.ssoSilentMeasurement?.add({\n accessTokenSize: response.accessToken.length,\n idTokenSize: response.idToken.length,\n });\n this.ssoSilentMeasurement?.end({\n success: true,\n isNativeBroker: response.fromNativeBroker,\n requestId: response.requestId,\n });\n return response;\n })\n .catch((e) => {\n this.eventHandler.emitEvent(EventType.SSO_SILENT_FAILURE, InteractionType.Silent, null, e);\n this.ssoSilentMeasurement?.end({\n errorCode: e.errorCode,\n subErrorCode: e.subError,\n success: false,\n });\n throw e;\n })\n .finally(() => {\n document.removeEventListener(\"visibilitychange\", this.trackPageVisibilityWithMeasurement);\n });\n }\n /**\n * This function redeems an authorization code (passed as code) from the eSTS token endpoint.\n * This authorization code should be acquired server-side using a confidential client to acquire a spa_code.\n * This API is not indended for normal authorization code acquisition and redemption.\n *\n * Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.\n *\n * @param request {@link AuthorizationCodeRequest}\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n async acquireTokenByCode(request) {\n const correlationId = this.getRequestCorrelationId(request);\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\n this.logger.trace(\"acquireTokenByCode called\", correlationId);\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, InteractionType.Silent, request);\n const atbcMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCode, correlationId);\n try {\n if (request.code && request.nativeAccountId) {\n // Throw error in case server returns both spa_code and spa_accountid in exchange for auth code.\n throw createBrowserAuthError(spaCodeAndNativeAccountIdPresent);\n }\n else if (request.code) {\n const hybridAuthCode = request.code;\n let response = this.hybridAuthCodeResponses.get(hybridAuthCode);\n if (!response) {\n this.logger.verbose(\"Initiating new acquireTokenByCode request\", correlationId);\n response = this.acquireTokenByCodeAsync({\n ...request,\n correlationId,\n })\n .then((result) => {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, InteractionType.Silent, result);\n this.hybridAuthCodeResponses.delete(hybridAuthCode);\n atbcMeasurement.add({\n accessTokenSize: result.accessToken.length,\n idTokenSize: result.idToken.length,\n });\n atbcMeasurement.end({\n success: true,\n isNativeBroker: result.fromNativeBroker,\n requestId: result.requestId,\n });\n return result;\n })\n .catch((error) => {\n this.hybridAuthCodeResponses.delete(hybridAuthCode);\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, InteractionType.Silent, null, error);\n atbcMeasurement.end({\n errorCode: error.errorCode,\n subErrorCode: error.subError,\n success: false,\n });\n throw error;\n });\n this.hybridAuthCodeResponses.set(hybridAuthCode, response);\n }\n else {\n this.logger.verbose(\"Existing acquireTokenByCode request found\", correlationId);\n atbcMeasurement.discard();\n }\n return await response;\n }\n else if (request.nativeAccountId) {\n if (this.canUseNative(request, request.nativeAccountId)) {\n return await this.acquireTokenNative({\n ...request,\n correlationId,\n }, ApiId.acquireTokenByCode, request.nativeAccountId).catch((e) => {\n // If native token acquisition fails for availability reasons fallback to standard flow\n if (e instanceof NativeAuthError &&\n isFatalNativeAuthError(e)) {\n this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\n }\n throw e;\n });\n }\n else {\n throw createBrowserAuthError(unableToAcquireTokenFromNativePlatform);\n }\n }\n else {\n throw createBrowserAuthError(authCodeOrNativeAccountIdRequired);\n }\n }\n catch (e) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, InteractionType.Silent, null, e);\n atbcMeasurement.end({\n errorCode: (e instanceof AuthError && e.errorCode) || undefined,\n subErrorCode: (e instanceof AuthError && e.subError) || undefined,\n success: false,\n });\n throw e;\n }\n }\n /**\n * Creates a SilentAuthCodeClient to redeem an authorization code.\n * @param request\n * @returns Result of the operation to redeem the authorization code\n */\n async acquireTokenByCodeAsync(request) {\n this.logger.trace(\"acquireTokenByCodeAsync called\", request.correlationId);\n this.acquireTokenByCodeAsyncMeasurement =\n this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCodeAsync, request.correlationId);\n this.acquireTokenByCodeAsyncMeasurement?.increment({\n visibilityChangeCount: 0,\n });\n document.addEventListener(\"visibilitychange\", this.trackPageVisibilityWithMeasurement);\n const silentAuthCodeClient = this.createSilentAuthCodeClient(request.correlationId);\n const silentTokenResult = await silentAuthCodeClient\n .acquireToken(request)\n .then((response) => {\n this.acquireTokenByCodeAsyncMeasurement?.end({\n success: true,\n fromCache: response.fromCache,\n isNativeBroker: response.fromNativeBroker,\n requestId: response.requestId,\n });\n return response;\n })\n .catch((tokenRenewalError) => {\n this.acquireTokenByCodeAsyncMeasurement?.end({\n errorCode: tokenRenewalError.errorCode,\n subErrorCode: tokenRenewalError.subError,\n success: false,\n });\n throw tokenRenewalError;\n })\n .finally(() => {\n document.removeEventListener(\"visibilitychange\", this.trackPageVisibilityWithMeasurement);\n });\n return silentTokenResult;\n }\n /**\n * Attempt to acquire an access token from the cache\n * @param silentCacheClient SilentCacheClient\n * @param commonRequest CommonSilentFlowRequest\n * @param silentRequest SilentRequest\n * @returns A promise that, when resolved, returns the access token\n */\n async acquireTokenFromCache(silentCacheClient, commonRequest, cacheLookupPolicy) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenFromCache, commonRequest.correlationId);\n switch (cacheLookupPolicy) {\n case CacheLookupPolicy.Default:\n case CacheLookupPolicy.AccessToken:\n case CacheLookupPolicy.AccessTokenAndRefreshToken:\n return invokeAsync(silentCacheClient.acquireToken.bind(silentCacheClient), PerformanceEvents.SilentCacheClientAcquireToken, this.logger, this.performanceClient, commonRequest.correlationId)(commonRequest);\n default:\n throw createClientAuthError(ClientAuthErrorCodes.tokenRefreshRequired);\n }\n }\n /**\n * Attempt to acquire an access token via a refresh token\n * @param commonRequest CommonSilentFlowRequest\n * @param cacheLookupPolicy CacheLookupPolicy\n * @returns A promise that, when resolved, returns the access token\n */\n async acquireTokenByRefreshToken(commonRequest, cacheLookupPolicy) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenByRefreshToken, commonRequest.correlationId);\n switch (cacheLookupPolicy) {\n case CacheLookupPolicy.Default:\n case CacheLookupPolicy.AccessTokenAndRefreshToken:\n case CacheLookupPolicy.RefreshToken:\n case CacheLookupPolicy.RefreshTokenAndNetwork:\n const silentRefreshClient = this.createSilentRefreshClient(commonRequest.correlationId);\n return invokeAsync(silentRefreshClient.acquireToken.bind(silentRefreshClient), PerformanceEvents.SilentRefreshClientAcquireToken, this.logger, this.performanceClient, commonRequest.correlationId)(commonRequest);\n default:\n throw createClientAuthError(ClientAuthErrorCodes.tokenRefreshRequired);\n }\n }\n /**\n * Attempt to acquire an access token via an iframe\n * @param request CommonSilentFlowRequest\n * @returns A promise that, when resolved, returns the access token\n */\n async acquireTokenBySilentIframe(request) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenBySilentIframe, request.correlationId);\n const silentIframeClient = this.createSilentIframeClient(request.correlationId);\n return invokeAsync(silentIframeClient.acquireToken.bind(silentIframeClient), PerformanceEvents.SilentIframeClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(request);\n }\n // #endregion\n // #region Logout\n /**\n * Deprecated logout function. Use logoutRedirect or logoutPopup instead\n * @param logoutRequest\n * @deprecated\n */\n async logout(logoutRequest) {\n const correlationId = this.getRequestCorrelationId(logoutRequest);\n this.logger.warning(\"logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.\", correlationId);\n return this.logoutRedirect({\n correlationId,\n ...logoutRequest,\n });\n }\n /**\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\n * Default behaviour is to redirect the user to `window.location.href`.\n * @param logoutRequest\n */\n async logoutRedirect(logoutRequest) {\n const correlationId = this.getRequestCorrelationId(logoutRequest);\n this.preflightBrowserEnvironmentCheck(InteractionType.Redirect);\n const redirectClient = this.createRedirectClient(correlationId);\n return redirectClient.logout(logoutRequest);\n }\n /**\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\n * @param logoutRequest\n */\n logoutPopup(logoutRequest) {\n try {\n const correlationId = this.getRequestCorrelationId(logoutRequest);\n this.preflightBrowserEnvironmentCheck(InteractionType.Popup);\n const popupClient = this.createPopupClient(correlationId);\n return popupClient.logout(logoutRequest);\n }\n catch (e) {\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n }\n }\n /**\n * Creates a cache interaction client to clear broswer cache.\n * @param logoutRequest\n */\n async clearCache(logoutRequest) {\n const correlationId = this.getRequestCorrelationId(logoutRequest);\n const cacheClient = this.createSilentCacheClient(correlationId);\n return cacheClient.logout(logoutRequest);\n }\n // #endregion\n // #region Account APIs\n /**\n * Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.\n * @param accountFilter - (Optional) filter to narrow down the accounts returned\n * @returns Array of AccountInfo objects in cache\n */\n getAllAccounts(accountFilter) {\n this.logger.verbose(\"getAllAccounts called\");\n return this.isBrowserEnvironment\n ? this.browserStorage.getAllAccounts(accountFilter)\n : [];\n }\n /**\n * Returns the first account found in the cache that matches the account filter passed in.\n * @param accountFilter\n * @returns The first account found in the cache matching the provided filter or null if no account could be found.\n */\n getAccount(accountFilter) {\n this.logger.trace(\"getAccount called\");\n if (Object.keys(accountFilter).length === 0) {\n this.logger.warning(\"getAccount: No accountFilter provided\");\n return null;\n }\n const account = this.browserStorage.getAccountInfoFilteredBy(accountFilter);\n if (account) {\n this.logger.verbose(\"getAccount: Account matching provided filter found, returning\");\n return account;\n }\n else {\n this.logger.verbose(\"getAccount: No matching account found, returning null\");\n return null;\n }\n }\n /**\n * Returns the signed in account matching username.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found.\n * This API is provided for convenience but getAccountById should be used for best reliability\n * @param username\n * @returns The account object stored in MSAL\n */\n getAccountByUsername(username) {\n this.logger.trace(\"getAccountByUsername called\");\n if (!username) {\n this.logger.warning(\"getAccountByUsername: No username provided\");\n return null;\n }\n const account = this.browserStorage.getAccountInfoFilteredBy({\n username,\n });\n if (account) {\n this.logger.verbose(\"getAccountByUsername: Account matching username found, returning\");\n this.logger.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${username}`);\n return account;\n }\n else {\n this.logger.verbose(\"getAccountByUsername: No matching account found, returning null\");\n return null;\n }\n }\n /**\n * Returns the signed in account matching homeAccountId.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found\n * @param homeAccountId\n * @returns The account object stored in MSAL\n */\n getAccountByHomeId(homeAccountId) {\n this.logger.trace(\"getAccountByHomeId called\");\n if (!homeAccountId) {\n this.logger.warning(\"getAccountByHomeId: No homeAccountId provided\");\n return null;\n }\n const account = this.browserStorage.getAccountInfoFilteredBy({\n homeAccountId,\n });\n if (account) {\n this.logger.verbose(\"getAccountByHomeId: Account matching homeAccountId found, returning\");\n this.logger.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${homeAccountId}`);\n return account;\n }\n else {\n this.logger.verbose(\"getAccountByHomeId: No matching account found, returning null\");\n return null;\n }\n }\n /**\n * Returns the signed in account matching localAccountId.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found\n * @param localAccountId\n * @returns The account object stored in MSAL\n */\n getAccountByLocalId(localAccountId) {\n this.logger.trace(\"getAccountByLocalId called\");\n if (!localAccountId) {\n this.logger.warning(\"getAccountByLocalId: No localAccountId provided\");\n return null;\n }\n const account = this.browserStorage.getAccountInfoFilteredBy({\n localAccountId,\n });\n if (account) {\n this.logger.verbose(\"getAccountByLocalId: Account matching localAccountId found, returning\");\n this.logger.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${localAccountId}`);\n return account;\n }\n else {\n this.logger.verbose(\"getAccountByLocalId: No matching account found, returning null\");\n return null;\n }\n }\n /**\n * Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.\n * @param account\n */\n setActiveAccount(account) {\n this.browserStorage.setActiveAccount(account);\n }\n /**\n * Gets the currently active account\n */\n getActiveAccount() {\n return this.browserStorage.getActiveAccount();\n }\n // #endregion\n /**\n * Hydrates the cache with the tokens from an AuthenticationResult\n * @param result\n * @param request\n * @returns\n */\n async hydrateCache(result, request) {\n this.logger.verbose(\"hydrateCache called\");\n // Account gets saved to browser storage regardless of native or not\n const accountEntity = AccountEntity.createFromAccountInfo(result.account, result.cloudGraphHostName, result.msGraphHost);\n this.browserStorage.setAccount(accountEntity);\n if (result.fromNativeBroker) {\n this.logger.verbose(\"Response was from native broker, storing in-memory\");\n // Tokens from native broker are stored in-memory\n return this.nativeInternalStorage.hydrateCache(result, request);\n }\n else {\n return this.browserStorage.hydrateCache(result, request);\n }\n }\n // #region Helpers\n /**\n * Helper to validate app environment before making an auth request\n *\n * @protected\n * @param {InteractionType} interactionType What kind of interaction is being used\n * @param {boolean} [isAppEmbedded=false] Whether to set interaction in progress temp cache flag\n */\n preflightBrowserEnvironmentCheck(interactionType, isAppEmbedded = false) {\n this.logger.verbose(\"preflightBrowserEnvironmentCheck started\");\n // Block request if not in browser environment\n blockNonBrowserEnvironment(this.isBrowserEnvironment);\n // Block redirects if in an iframe\n blockRedirectInIframe(interactionType, this.config.system.allowRedirectInIframe);\n // Block auth requests inside a hidden iframe\n blockReloadInHiddenIframes();\n // Block redirectUri opened in a popup from calling MSAL APIs\n blockAcquireTokenInPopups();\n // Block token acquisition before initialize has been called\n blockAPICallsBeforeInitialize(this.initialized);\n // Block redirects if memory storage is enabled but storeAuthStateInCookie is not\n if (interactionType === InteractionType.Redirect &&\n this.config.cache.cacheLocation ===\n BrowserCacheLocation.MemoryStorage &&\n !this.config.cache.storeAuthStateInCookie) {\n throw createBrowserConfigurationAuthError(inMemRedirectUnavailable);\n }\n if (interactionType === InteractionType.Redirect ||\n interactionType === InteractionType.Popup) {\n this.preflightInteractiveRequest(!isAppEmbedded);\n }\n }\n /**\n * Preflight check for interactive requests\n *\n * @protected\n * @param {boolean} setInteractionInProgress Whether to set interaction in progress temp cache flag\n */\n preflightInteractiveRequest(setInteractionInProgress) {\n this.logger.verbose(\"preflightInteractiveRequest called, validating app environment\");\n // block the reload if it occurred inside a hidden iframe\n blockReloadInHiddenIframes();\n // Set interaction in progress temporary cache or throw if alread set.\n if (setInteractionInProgress) {\n this.getBrowserStorage().setInteractionInProgress(true);\n }\n }\n /**\n * Acquire a token from native device (e.g. WAM)\n * @param request\n */\n async acquireTokenNative(request, apiId, accountId) {\n this.logger.trace(\"acquireTokenNative called\");\n if (!this.nativeExtensionProvider) {\n throw createBrowserAuthError(nativeConnectionNotEstablished);\n }\n const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, apiId, this.performanceClient, this.nativeExtensionProvider, accountId || this.getNativeAccountId(request), this.nativeInternalStorage, request.correlationId);\n return nativeClient.acquireToken(request);\n }\n /**\n * Returns boolean indicating if this request can use the native broker\n * @param request\n */\n canUseNative(request, accountId) {\n this.logger.trace(\"canUseNative called\");\n if (!NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme)) {\n this.logger.trace(\"canUseNative: isNativeAvailable returned false, returning false\");\n return false;\n }\n if (request.prompt) {\n switch (request.prompt) {\n case PromptValue.NONE:\n case PromptValue.CONSENT:\n case PromptValue.LOGIN:\n this.logger.trace(\"canUseNative: prompt is compatible with native flow\");\n break;\n default:\n this.logger.trace(`canUseNative: prompt = ${request.prompt} is not compatible with native flow, returning false`);\n return false;\n }\n }\n if (!accountId && !this.getNativeAccountId(request)) {\n this.logger.trace(\"canUseNative: nativeAccountId is not available, returning false\");\n return false;\n }\n return true;\n }\n /**\n * Get the native accountId from the account\n * @param request\n * @returns\n */\n getNativeAccountId(request) {\n const account = request.account ||\n this.getAccount({\n loginHint: request.loginHint,\n sid: request.sid,\n }) ||\n this.getActiveAccount();\n return (account && account.nativeAccountId) || \"\";\n }\n /**\n * Returns new instance of the Popup Interaction Client\n * @param correlationId\n */\n createPopupClient(correlationId) {\n return new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);\n }\n /**\n * Returns new instance of the Redirect Interaction Client\n * @param correlationId\n */\n createRedirectClient(correlationId) {\n return new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);\n }\n /**\n * Returns new instance of the Silent Iframe Interaction Client\n * @param correlationId\n */\n createSilentIframeClient(correlationId) {\n return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);\n }\n /**\n * Returns new instance of the Silent Cache Interaction Client\n */\n createSilentCacheClient(correlationId) {\n return new SilentCacheClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);\n }\n /**\n * Returns new instance of the Silent Refresh Interaction Client\n */\n createSilentRefreshClient(correlationId) {\n return new SilentRefreshClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);\n }\n /**\n * Returns new instance of the Silent AuthCode Interaction Client\n */\n createSilentAuthCodeClient(correlationId) {\n return new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, this.performanceClient, this.nativeExtensionProvider, correlationId);\n }\n /**\n * Adds event callbacks to array\n * @param callback\n */\n addEventCallback(callback) {\n return this.eventHandler.addEventCallback(callback);\n }\n /**\n * Removes callback with provided id from callback array\n * @param callbackId\n */\n removeEventCallback(callbackId) {\n this.eventHandler.removeEventCallback(callbackId);\n }\n /**\n * Registers a callback to receive performance events.\n *\n * @param {PerformanceCallbackFunction} callback\n * @returns {string}\n */\n addPerformanceCallback(callback) {\n return this.performanceClient.addPerformanceCallback(callback);\n }\n /**\n * Removes a callback registered with addPerformanceCallback.\n *\n * @param {string} callbackId\n * @returns {boolean}\n */\n removePerformanceCallback(callbackId) {\n return this.performanceClient.removePerformanceCallback(callbackId);\n }\n /**\n * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\n */\n enableAccountStorageEvents() {\n this.eventHandler.enableAccountStorageEvents();\n }\n /**\n * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\n */\n disableAccountStorageEvents() {\n this.eventHandler.disableAccountStorageEvents();\n }\n /**\n * Gets the token cache for the application.\n */\n getTokenCache() {\n return this.tokenCache;\n }\n /**\n * Returns the logger instance\n */\n getLogger() {\n return this.logger;\n }\n /**\n * Replaces the default logger set in configurations with new Logger with new configurations\n * @param logger Logger instance\n */\n setLogger(logger) {\n this.logger = logger;\n }\n /**\n * Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.\n * @param sku\n * @param version\n */\n initializeWrapperLibrary(sku, version) {\n // Validate the SKU passed in is one we expect\n this.browserStorage.setWrapperMetadata(sku, version);\n }\n /**\n * Sets navigation client\n * @param navigationClient\n */\n setNavigationClient(navigationClient) {\n this.navigationClient = navigationClient;\n }\n /**\n * Returns the configuration object\n */\n getConfiguration() {\n return this.config;\n }\n /**\n * Returns the performance client\n */\n getPerformanceClient() {\n return this.performanceClient;\n }\n /**\n * Returns the browser storage\n */\n getBrowserStorage() {\n return this.browserStorage;\n }\n /**\n * Returns the browser env indicator\n */\n isBrowserEnv() {\n return this.isBrowserEnvironment;\n }\n /**\n * Returns the event handler\n */\n getEventHandler() {\n return this.eventHandler;\n }\n /**\n * Generates a correlation id for a request if none is provided.\n *\n * @protected\n * @param {?Partial} [request]\n * @returns {string}\n */\n getRequestCorrelationId(request) {\n if (request?.correlationId) {\n return request.correlationId;\n }\n if (this.isBrowserEnvironment) {\n return createNewGuid();\n }\n /*\n * Included for fallback for non-browser environments,\n * and to ensure this method always returns a string.\n */\n return Constants.EMPTY_STRING;\n }\n // #endregion\n /**\n * Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so\n * any code that follows this function will not execute.\n *\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\n *\n * @param request\n */\n async loginRedirect(request) {\n const correlationId = this.getRequestCorrelationId(request);\n this.logger.verbose(\"loginRedirect called\", correlationId);\n return this.acquireTokenRedirect({\n correlationId,\n ...(request || DEFAULT_REQUEST),\n });\n }\n /**\n * Use when initiating the login process via opening a popup window in the user's browser\n *\n * @param request\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n loginPopup(request) {\n const correlationId = this.getRequestCorrelationId(request);\n this.logger.verbose(\"loginPopup called\", correlationId);\n return this.acquireTokenPopup({\n correlationId,\n ...(request || DEFAULT_REQUEST),\n });\n }\n /**\n * Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.\n *\n * @param {@link (SilentRequest:type)}\n * @returns {Promise.} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} object\n */\n async acquireTokenSilent(request) {\n const correlationId = this.getRequestCorrelationId(request);\n const atsMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilent, correlationId);\n atsMeasurement.add({\n cacheLookupPolicy: request.cacheLookupPolicy,\n });\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\n this.logger.verbose(\"acquireTokenSilent called\", correlationId);\n const account = request.account || this.getActiveAccount();\n if (!account) {\n throw createBrowserAuthError(noAccountError);\n }\n const thumbprint = {\n clientId: this.config.auth.clientId,\n authority: request.authority || Constants.EMPTY_STRING,\n scopes: request.scopes,\n homeAccountIdentifier: account.homeAccountId,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid,\n shrOptions: request.shrOptions,\n };\n const silentRequestKey = JSON.stringify(thumbprint);\n const cachedResponse = this.activeSilentTokenRequests.get(silentRequestKey);\n if (typeof cachedResponse === \"undefined\") {\n this.logger.verbose(\"acquireTokenSilent called for the first time, storing active request\", correlationId);\n const response = invokeAsync(this.acquireTokenSilentAsync.bind(this), PerformanceEvents.AcquireTokenSilentAsync, this.logger, this.performanceClient, correlationId)({\n ...request,\n correlationId,\n }, account)\n .then((result) => {\n this.activeSilentTokenRequests.delete(silentRequestKey);\n atsMeasurement.add({\n accessTokenSize: result.accessToken.length,\n idTokenSize: result.idToken.length,\n });\n atsMeasurement.end({\n success: true,\n fromCache: result.fromCache,\n isNativeBroker: result.fromNativeBroker,\n cacheLookupPolicy: request.cacheLookupPolicy,\n requestId: result.requestId,\n });\n return result;\n })\n .catch((error) => {\n this.activeSilentTokenRequests.delete(silentRequestKey);\n atsMeasurement.end({\n errorCode: error.errorCode,\n subErrorCode: error.subError,\n success: false,\n });\n throw error;\n });\n this.activeSilentTokenRequests.set(silentRequestKey, response);\n return {\n ...(await response),\n state: request.state,\n };\n }\n else {\n this.logger.verbose(\"acquireTokenSilent has been called previously, returning the result from the first call\", correlationId);\n // Discard measurements for memoized calls, as they are usually only a couple of ms and will artificially deflate metrics\n atsMeasurement.discard();\n return {\n ...(await cachedResponse),\n state: request.state,\n };\n }\n }\n /**\n * Silently acquire an access token for a given set of scopes. Will use cached token if available, otherwise will attempt to acquire a new token from the network via refresh token.\n * @param {@link (SilentRequest:type)}\n * @param {@link (AccountInfo:type)}\n * @returns {Promise.} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse}\n */\n async acquireTokenSilentAsync(request, account) {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, request);\n this.atsAsyncMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);\n this.atsAsyncMeasurement?.increment({\n visibilityChangeCount: 0,\n });\n document.addEventListener(\"visibilitychange\", this.trackPageVisibility);\n let result;\n if (NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme) &&\n account.nativeAccountId) {\n this.logger.verbose(\"acquireTokenSilent - attempting to acquire token from native platform\");\n const silentRequest = {\n ...request,\n account,\n };\n result = this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow).catch(async (e) => {\n // If native token acquisition fails for availability reasons fallback to web flow\n if (e instanceof NativeAuthError && isFatalNativeAuthError(e)) {\n this.logger.verbose(\"acquireTokenSilent - native platform unavailable, falling back to web flow\");\n this.nativeExtensionProvider = undefined; // Prevent future requests from continuing to attempt\n // Cache will not contain tokens, given that previous WAM requests succeeded. Skip cache and RT renewal and go straight to iframe renewal\n const silentIframeClient = this.createSilentIframeClient(request.correlationId);\n return silentIframeClient.acquireToken(request);\n }\n throw e;\n });\n }\n else {\n this.logger.verbose(\"acquireTokenSilent - attempting to acquire token from web flow\");\n const silentCacheClient = this.createSilentCacheClient(request.correlationId);\n const silentRequest = await invokeAsync(silentCacheClient.initializeSilentRequest.bind(silentCacheClient), PerformanceEvents.InitializeSilentRequest, this.logger, this.performanceClient, request.correlationId)(request, account);\n const cacheLookupPolicy = request.cacheLookupPolicy || CacheLookupPolicy.Default;\n result = invokeAsync(this.acquireTokenFromCache.bind(this), PerformanceEvents.AcquireTokenFromCache, this.logger, this.performanceClient, silentRequest.correlationId)(silentCacheClient, silentRequest, cacheLookupPolicy).catch((cacheError) => {\n if (request.cacheLookupPolicy ===\n CacheLookupPolicy.AccessToken) {\n throw cacheError;\n }\n // block the reload if it occurred inside a hidden iframe\n blockReloadInHiddenIframes();\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_NETWORK_START, InteractionType.Silent, silentRequest);\n return invokeAsync(this.acquireTokenByRefreshToken.bind(this), PerformanceEvents.AcquireTokenByRefreshToken, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest, cacheLookupPolicy).catch((refreshTokenError) => {\n const shouldTryToResolveSilently = checkIfRefreshTokenErrorCanBeResolvedSilently(refreshTokenError, silentRequest, cacheLookupPolicy);\n if (shouldTryToResolveSilently) {\n this.logger.verbose(\"Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.\", silentRequest.correlationId);\n return invokeAsync(this.acquireTokenBySilentIframe.bind(this), PerformanceEvents.AcquireTokenBySilentIframe, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest);\n }\n else {\n // Error cannot be silently resolved or iframe renewal is not allowed, interaction required\n throw refreshTokenError;\n }\n });\n });\n }\n return result\n .then((response) => {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, response);\n this.atsAsyncMeasurement?.end({\n success: true,\n fromCache: response.fromCache,\n isNativeBroker: response.fromNativeBroker,\n requestId: response.requestId,\n });\n return response;\n })\n .catch((tokenRenewalError) => {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, tokenRenewalError);\n this.atsAsyncMeasurement?.end({\n errorCode: tokenRenewalError.errorCode,\n subErrorCode: tokenRenewalError.subError,\n success: false,\n });\n throw tokenRenewalError;\n })\n .finally(() => {\n document.removeEventListener(\"visibilitychange\", this.trackPageVisibility);\n });\n }\n}\n/**\n * Determines whether an error thrown by the refresh token endpoint can be resolved without interaction\n * @param refreshTokenError\n * @param silentRequest\n * @param cacheLookupPolicy\n * @returns\n */\nfunction checkIfRefreshTokenErrorCanBeResolvedSilently(refreshTokenError, silentRequest, cacheLookupPolicy) {\n const noInteractionRequired = !(refreshTokenError instanceof InteractionRequiredAuthError &&\n // For refresh token errors, bad_token does not always require interaction (silently resolvable)\n refreshTokenError.subError !==\n InteractionRequiredAuthErrorCodes.badToken);\n // Errors that result when the refresh token needs to be replaced\n const refreshTokenRefreshRequired = refreshTokenError.errorCode === BrowserConstants.INVALID_GRANT_ERROR ||\n refreshTokenError.errorCode ===\n ClientAuthErrorCodes.tokenRefreshRequired;\n // Errors that may be resolved before falling back to interaction (through iframe renewal)\n const isSilentlyResolvable = (noInteractionRequired && refreshTokenRefreshRequired) ||\n refreshTokenError.errorCode ===\n InteractionRequiredAuthErrorCodes.noTokensFound ||\n refreshTokenError.errorCode ===\n InteractionRequiredAuthErrorCodes.refreshTokenExpired;\n // Only these policies allow for an iframe renewal attempt\n const tryIframeRenewal = iFrameRenewalPolicies.includes(cacheLookupPolicy);\n return isSilentlyResolvable && tryIframeRenewal;\n}\n\nexport { StandardController };\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAM,sBAAsB;AAC5B,IAAM,uCAAuC;AAC7C,IAAM,2BAA2B;;;ACGjC,IAAM,wCAAwC;AAAA,EAC1C,CAAC,mBAAmB,GAAG;AAAA,EACvB,CAAC,oCAAoC,GAAG;AAAA,EACxC,CAAC,wBAAwB,GAAG;AAChC;AAKA,IAAM,uCAAuC;AAAA,EACzC,0BAA0B;AAAA,IACtB,MAAM;AAAA,IACN,MAAM,sCAAsC,mBAAmB;AAAA,EACnE;AAAA,EACA,uBAAuB;AAAA,IACnB,MAAM;AAAA,IACN,MAAM,sCAAsC,oCAAoC;AAAA,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