@azure/msal-browser 3.25.0 → 3.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/app/IPublicClientApplication.d.ts +2 -1
  2. package/dist/app/IPublicClientApplication.d.ts.map +1 -1
  3. package/dist/app/IPublicClientApplication.mjs +1 -1
  4. package/dist/app/IPublicClientApplication.mjs.map +1 -1
  5. package/dist/app/PublicClientApplication.d.ts +3 -1
  6. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  7. package/dist/app/PublicClientApplication.mjs +4 -3
  8. package/dist/app/PublicClientApplication.mjs.map +1 -1
  9. package/dist/app/PublicClientNext.d.ts +2 -1
  10. package/dist/app/PublicClientNext.d.ts.map +1 -1
  11. package/dist/app/PublicClientNext.mjs +3 -3
  12. package/dist/app/PublicClientNext.mjs.map +1 -1
  13. package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
  14. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  15. package/dist/cache/AccountManager.mjs +1 -1
  16. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  17. package/dist/cache/BrowserCacheManager.mjs +1 -1
  18. package/dist/cache/BrowserStorage.mjs +1 -1
  19. package/dist/cache/DatabaseStorage.mjs +1 -1
  20. package/dist/cache/MemoryStorage.mjs +1 -1
  21. package/dist/cache/TokenCache.mjs +1 -1
  22. package/dist/config/Configuration.mjs +1 -1
  23. package/dist/controllers/ControllerFactory.mjs +1 -1
  24. package/dist/controllers/IController.d.ts +2 -4
  25. package/dist/controllers/IController.d.ts.map +1 -1
  26. package/dist/controllers/NestedAppAuthController.d.ts +3 -6
  27. package/dist/controllers/NestedAppAuthController.d.ts.map +1 -1
  28. package/dist/controllers/NestedAppAuthController.mjs +26 -18
  29. package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
  30. package/dist/controllers/StandardController.d.ts +7 -5
  31. package/dist/controllers/StandardController.d.ts.map +1 -1
  32. package/dist/controllers/StandardController.mjs +78 -14
  33. package/dist/controllers/StandardController.mjs.map +1 -1
  34. package/dist/controllers/UnknownOperatingContextController.d.ts +2 -4
  35. package/dist/controllers/UnknownOperatingContextController.d.ts.map +1 -1
  36. package/dist/controllers/UnknownOperatingContextController.mjs +10 -11
  37. package/dist/controllers/UnknownOperatingContextController.mjs.map +1 -1
  38. package/dist/crypto/BrowserCrypto.mjs +1 -1
  39. package/dist/crypto/CryptoOps.mjs +1 -1
  40. package/dist/crypto/PkceGenerator.mjs +1 -1
  41. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  42. package/dist/encode/Base64Decode.mjs +1 -1
  43. package/dist/encode/Base64Encode.mjs +1 -1
  44. package/dist/error/BrowserAuthError.mjs +1 -1
  45. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  46. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  47. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  48. package/dist/error/NativeAuthError.mjs +1 -1
  49. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  50. package/dist/error/NestedAppAuthError.mjs +1 -1
  51. package/dist/event/EventHandler.d.ts +6 -18
  52. package/dist/event/EventHandler.d.ts.map +1 -1
  53. package/dist/event/EventHandler.mjs +23 -87
  54. package/dist/event/EventHandler.mjs.map +1 -1
  55. package/dist/event/EventMessage.mjs +1 -1
  56. package/dist/event/EventType.mjs +1 -1
  57. package/dist/index.d.ts +1 -0
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.mjs +2 -1
  60. package/dist/index.mjs.map +1 -1
  61. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  62. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  63. package/dist/interaction_client/NativeInteractionClient.mjs +1 -1
  64. package/dist/interaction_client/PopupClient.mjs +1 -1
  65. package/dist/interaction_client/RedirectClient.mjs +1 -1
  66. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  67. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  68. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  69. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  70. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  71. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  72. package/dist/interaction_handler/RedirectHandler.mjs +1 -1
  73. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  74. package/dist/naa/BridgeError.mjs +1 -1
  75. package/dist/naa/BridgeProxy.mjs +1 -1
  76. package/dist/naa/BridgeStatusCode.mjs +1 -1
  77. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  78. package/dist/navigation/NavigationClient.mjs +1 -1
  79. package/dist/network/FetchClient.mjs +1 -1
  80. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  81. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  82. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  83. package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
  84. package/dist/packageMetadata.d.ts +1 -1
  85. package/dist/packageMetadata.mjs +2 -2
  86. package/dist/request/RequestHelpers.mjs +1 -1
  87. package/dist/response/ResponseHandler.mjs +1 -1
  88. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  89. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  90. package/dist/utils/BrowserConstants.mjs +1 -1
  91. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  92. package/dist/utils/BrowserUtils.mjs +1 -1
  93. package/lib/msal-browser.cjs +199 -188
  94. package/lib/msal-browser.cjs.map +1 -1
  95. package/lib/msal-browser.js +199 -188
  96. package/lib/msal-browser.js.map +1 -1
  97. package/lib/msal-browser.min.js +61 -61
  98. package/lib/types/app/IPublicClientApplication.d.ts +2 -1
  99. package/lib/types/app/IPublicClientApplication.d.ts.map +1 -1
  100. package/lib/types/app/PublicClientApplication.d.ts +3 -1
  101. package/lib/types/app/PublicClientApplication.d.ts.map +1 -1
  102. package/lib/types/app/PublicClientNext.d.ts +2 -1
  103. package/lib/types/app/PublicClientNext.d.ts.map +1 -1
  104. package/lib/types/controllers/IController.d.ts +2 -4
  105. package/lib/types/controllers/IController.d.ts.map +1 -1
  106. package/lib/types/controllers/NestedAppAuthController.d.ts +3 -6
  107. package/lib/types/controllers/NestedAppAuthController.d.ts.map +1 -1
  108. package/lib/types/controllers/StandardController.d.ts +7 -5
  109. package/lib/types/controllers/StandardController.d.ts.map +1 -1
  110. package/lib/types/controllers/UnknownOperatingContextController.d.ts +2 -4
  111. package/lib/types/controllers/UnknownOperatingContextController.d.ts.map +1 -1
  112. package/lib/types/event/EventHandler.d.ts +6 -18
  113. package/lib/types/event/EventHandler.d.ts.map +1 -1
  114. package/lib/types/index.d.ts +1 -0
  115. package/lib/types/index.d.ts.map +1 -1
  116. package/lib/types/packageMetadata.d.ts +1 -1
  117. package/package.json +1 -1
  118. package/src/app/IPublicClientApplication.ts +5 -1
  119. package/src/app/PublicClientApplication.ts +7 -2
  120. package/src/app/PublicClientNext.ts +6 -2
  121. package/src/controllers/IController.ts +5 -5
  122. package/src/controllers/NestedAppAuthController.ts +32 -23
  123. package/src/controllers/StandardController.ts +105 -13
  124. package/src/controllers/UnknownOperatingContextController.ts +12 -14
  125. package/src/event/EventHandler.ts +42 -117
  126. package/src/index.ts +1 -0
  127. package/src/packageMetadata.ts +1 -1
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-browser v3.25.0 2024-10-03 */
1
+ /*! @azure/msal-browser v3.26.1 2024-10-08 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /*! @azure/msal-common v14.15.0 2024-10-03 */
5
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
8
8
  * Licensed under the MIT License.
@@ -311,7 +311,7 @@ const JsonWebTokenTypes = {
311
311
  // Token renewal offset default in seconds
312
312
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
313
313
 
314
- /*! @azure/msal-common v14.15.0 2024-10-03 */
314
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
315
315
  /*
316
316
  * Copyright (c) Microsoft Corporation. All rights reserved.
317
317
  * Licensed under the MIT License.
@@ -328,7 +328,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
328
328
  unexpectedError: unexpectedError
329
329
  });
330
330
 
331
- /*! @azure/msal-common v14.15.0 2024-10-03 */
331
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
332
332
 
333
333
  /*
334
334
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -377,7 +377,7 @@ function createAuthError(code, additionalMessage) {
377
377
  : AuthErrorMessages[code]);
378
378
  }
379
379
 
380
- /*! @azure/msal-common v14.15.0 2024-10-03 */
380
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
381
381
  /*
382
382
  * Copyright (c) Microsoft Corporation. All rights reserved.
383
383
  * Licensed under the MIT License.
@@ -475,7 +475,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
475
475
  userTimeoutReached: userTimeoutReached
476
476
  });
477
477
 
478
- /*! @azure/msal-common v14.15.0 2024-10-03 */
478
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
479
479
 
480
480
  /*
481
481
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -727,7 +727,7 @@ function createClientAuthError(errorCode, additionalMessage) {
727
727
  return new ClientAuthError(errorCode, additionalMessage);
728
728
  }
729
729
 
730
- /*! @azure/msal-common v14.15.0 2024-10-03 */
730
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
731
731
 
732
732
  /*
733
733
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -766,7 +766,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
766
766
  },
767
767
  };
768
768
 
769
- /*! @azure/msal-common v14.15.0 2024-10-03 */
769
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
770
770
 
771
771
  /*
772
772
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -957,12 +957,12 @@ class Logger {
957
957
  }
958
958
  }
959
959
 
960
- /*! @azure/msal-common v14.15.0 2024-10-03 */
960
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
961
961
  /* eslint-disable header/header */
962
962
  const name$1 = "@azure/msal-common";
963
963
  const version$1 = "14.15.0";
964
964
 
965
- /*! @azure/msal-common v14.15.0 2024-10-03 */
965
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
966
966
  /*
967
967
  * Copyright (c) Microsoft Corporation. All rights reserved.
968
968
  * Licensed under the MIT License.
@@ -982,7 +982,7 @@ const AzureCloudInstance = {
982
982
  AzureUsGovernment: "https://login.microsoftonline.us",
983
983
  };
984
984
 
985
- /*! @azure/msal-common v14.15.0 2024-10-03 */
985
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
986
986
 
987
987
  /*
988
988
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1043,7 +1043,7 @@ function checkMaxAge(authTime, maxAge) {
1043
1043
  }
1044
1044
  }
1045
1045
 
1046
- /*! @azure/msal-common v14.15.0 2024-10-03 */
1046
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
1047
1047
  /*
1048
1048
  * Copyright (c) Microsoft Corporation. All rights reserved.
1049
1049
  * Licensed under the MIT License.
@@ -1080,7 +1080,7 @@ function wasClockTurnedBack(cachedAt) {
1080
1080
  return cachedAtSec > nowSeconds();
1081
1081
  }
1082
1082
 
1083
- /*! @azure/msal-common v14.15.0 2024-10-03 */
1083
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
1084
1084
 
1085
1085
  /*
1086
1086
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1407,7 +1407,7 @@ function isAuthorityMetadataExpired(metadata) {
1407
1407
  return metadata.expiresAt <= nowSeconds();
1408
1408
  }
1409
1409
 
1410
- /*! @azure/msal-common v14.15.0 2024-10-03 */
1410
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
1411
1411
  /*
1412
1412
  * Copyright (c) Microsoft Corporation. All rights reserved.
1413
1413
  * Licensed under the MIT License.
@@ -1461,7 +1461,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
1461
1461
  urlParseError: urlParseError
1462
1462
  });
1463
1463
 
1464
- /*! @azure/msal-common v14.15.0 2024-10-03 */
1464
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
1465
1465
 
1466
1466
  /*
1467
1467
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1599,7 +1599,7 @@ function createClientConfigurationError(errorCode) {
1599
1599
  return new ClientConfigurationError(errorCode);
1600
1600
  }
1601
1601
 
1602
- /*! @azure/msal-common v14.15.0 2024-10-03 */
1602
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
1603
1603
  /*
1604
1604
  * Copyright (c) Microsoft Corporation. All rights reserved.
1605
1605
  * Licensed under the MIT License.
@@ -1696,7 +1696,7 @@ class StringUtils {
1696
1696
  }
1697
1697
  }
1698
1698
 
1699
- /*! @azure/msal-common v14.15.0 2024-10-03 */
1699
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
1700
1700
 
1701
1701
  /*
1702
1702
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1896,7 +1896,7 @@ class ScopeSet {
1896
1896
  }
1897
1897
  }
1898
1898
 
1899
- /*! @azure/msal-common v14.15.0 2024-10-03 */
1899
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
1900
1900
 
1901
1901
  /*
1902
1902
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1936,7 +1936,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
1936
1936
  };
1937
1937
  }
1938
1938
 
1939
- /*! @azure/msal-common v14.15.0 2024-10-03 */
1939
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
1940
1940
  /*
1941
1941
  * Copyright (c) Microsoft Corporation. All rights reserved.
1942
1942
  * Licensed under the MIT License.
@@ -2015,7 +2015,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
2015
2015
  return updatedAccountInfo;
2016
2016
  }
2017
2017
 
2018
- /*! @azure/msal-common v14.15.0 2024-10-03 */
2018
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
2019
2019
  /*
2020
2020
  * Copyright (c) Microsoft Corporation. All rights reserved.
2021
2021
  * Licensed under the MIT License.
@@ -2030,7 +2030,7 @@ const AuthorityType = {
2030
2030
  Ciam: 3,
2031
2031
  };
2032
2032
 
2033
- /*! @azure/msal-common v14.15.0 2024-10-03 */
2033
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
2034
2034
  /*
2035
2035
  * Copyright (c) Microsoft Corporation. All rights reserved.
2036
2036
  * Licensed under the MIT License.
@@ -2052,7 +2052,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
2052
2052
  return null;
2053
2053
  }
2054
2054
 
2055
- /*! @azure/msal-common v14.15.0 2024-10-03 */
2055
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
2056
2056
  /*
2057
2057
  * Copyright (c) Microsoft Corporation. All rights reserved.
2058
2058
  * Licensed under the MIT License.
@@ -2065,7 +2065,7 @@ const ProtocolMode = {
2065
2065
  OIDC: "OIDC",
2066
2066
  };
2067
2067
 
2068
- /*! @azure/msal-common v14.15.0 2024-10-03 */
2068
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
2069
2069
 
2070
2070
  /*
2071
2071
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2308,7 +2308,7 @@ class AccountEntity {
2308
2308
  }
2309
2309
  }
2310
2310
 
2311
- /*! @azure/msal-common v14.15.0 2024-10-03 */
2311
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
2312
2312
 
2313
2313
  /*
2314
2314
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2355,7 +2355,7 @@ function getDeserializedResponse(responseString) {
2355
2355
  return null;
2356
2356
  }
2357
2357
 
2358
- /*! @azure/msal-common v14.15.0 2024-10-03 */
2358
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
2359
2359
 
2360
2360
  /*
2361
2361
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2519,7 +2519,7 @@ class UrlString {
2519
2519
  }
2520
2520
  }
2521
2521
 
2522
- /*! @azure/msal-common v14.15.0 2024-10-03 */
2522
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
2523
2523
 
2524
2524
  /*
2525
2525
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2659,7 +2659,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2659
2659
  return null;
2660
2660
  }
2661
2661
 
2662
- /*! @azure/msal-common v14.15.0 2024-10-03 */
2662
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
2663
2663
  /*
2664
2664
  * Copyright (c) Microsoft Corporation. All rights reserved.
2665
2665
  * Licensed under the MIT License.
@@ -2667,7 +2667,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2667
2667
  const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
2668
2668
  const cacheUnknownErrorCode = "cache_error_unknown";
2669
2669
 
2670
- /*! @azure/msal-common v14.15.0 2024-10-03 */
2670
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
2671
2671
 
2672
2672
  /*
2673
2673
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2694,7 +2694,7 @@ class CacheError extends Error {
2694
2694
  }
2695
2695
  }
2696
2696
 
2697
- /*! @azure/msal-common v14.15.0 2024-10-03 */
2697
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
2698
2698
 
2699
2699
  /*
2700
2700
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3946,7 +3946,7 @@ class DefaultStorageClass extends CacheManager {
3946
3946
  }
3947
3947
  }
3948
3948
 
3949
- /*! @azure/msal-common v14.15.0 2024-10-03 */
3949
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
3950
3950
 
3951
3951
  /*
3952
3952
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4045,7 +4045,7 @@ function isOidcProtocolMode(config) {
4045
4045
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
4046
4046
  }
4047
4047
 
4048
- /*! @azure/msal-common v14.15.0 2024-10-03 */
4048
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
4049
4049
 
4050
4050
  /*
4051
4051
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4064,7 +4064,7 @@ class ServerError extends AuthError {
4064
4064
  }
4065
4065
  }
4066
4066
 
4067
- /*! @azure/msal-common v14.15.0 2024-10-03 */
4067
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
4068
4068
 
4069
4069
  /*
4070
4070
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4162,7 +4162,7 @@ class ThrottlingUtils {
4162
4162
  }
4163
4163
  }
4164
4164
 
4165
- /*! @azure/msal-common v14.15.0 2024-10-03 */
4165
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
4166
4166
 
4167
4167
  /*
4168
4168
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4199,7 +4199,7 @@ class NetworkManager {
4199
4199
  }
4200
4200
  }
4201
4201
 
4202
- /*! @azure/msal-common v14.15.0 2024-10-03 */
4202
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
4203
4203
  /*
4204
4204
  * Copyright (c) Microsoft Corporation. All rights reserved.
4205
4205
  * Licensed under the MIT License.
@@ -4209,7 +4209,7 @@ const CcsCredentialType = {
4209
4209
  UPN: "UPN",
4210
4210
  };
4211
4211
 
4212
- /*! @azure/msal-common v14.15.0 2024-10-03 */
4212
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
4213
4213
  /*
4214
4214
  * Copyright (c) Microsoft Corporation. All rights reserved.
4215
4215
  * Licensed under the MIT License.
@@ -4257,7 +4257,7 @@ const LOGIN_HINT = "login_hint";
4257
4257
  const DOMAIN_HINT = "domain_hint";
4258
4258
  const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
4259
4259
 
4260
- /*! @azure/msal-common v14.15.0 2024-10-03 */
4260
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
4261
4261
 
4262
4262
  /*
4263
4263
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4324,7 +4324,7 @@ class RequestValidator {
4324
4324
  }
4325
4325
  }
4326
4326
 
4327
- /*! @azure/msal-common v14.15.0 2024-10-03 */
4327
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
4328
4328
 
4329
4329
  /*
4330
4330
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4709,7 +4709,7 @@ class RequestParameterBuilder {
4709
4709
  }
4710
4710
  }
4711
4711
 
4712
- /*! @azure/msal-common v14.15.0 2024-10-03 */
4712
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
4713
4713
  /*
4714
4714
  * Copyright (c) Microsoft Corporation. All rights reserved.
4715
4715
  * Licensed under the MIT License.
@@ -4721,7 +4721,7 @@ function isOpenIdConfigResponse(response) {
4721
4721
  response.hasOwnProperty("jwks_uri"));
4722
4722
  }
4723
4723
 
4724
- /*! @azure/msal-common v14.15.0 2024-10-03 */
4724
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
4725
4725
  /*
4726
4726
  * Copyright (c) Microsoft Corporation. All rights reserved.
4727
4727
  * Licensed under the MIT License.
@@ -4731,7 +4731,7 @@ function isCloudInstanceDiscoveryResponse(response) {
4731
4731
  response.hasOwnProperty("metadata"));
4732
4732
  }
4733
4733
 
4734
- /*! @azure/msal-common v14.15.0 2024-10-03 */
4734
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
4735
4735
  /*
4736
4736
  * Copyright (c) Microsoft Corporation. All rights reserved.
4737
4737
  * Licensed under the MIT License.
@@ -4741,7 +4741,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
4741
4741
  response.hasOwnProperty("error_description"));
4742
4742
  }
4743
4743
 
4744
- /*! @azure/msal-common v14.15.0 2024-10-03 */
4744
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
4745
4745
  /*
4746
4746
  * Copyright (c) Microsoft Corporation. All rights reserved.
4747
4747
  * Licensed under the MIT License.
@@ -5223,7 +5223,7 @@ const IntFields = new Set([
5223
5223
  "multiMatchedRT",
5224
5224
  ]);
5225
5225
 
5226
- /*! @azure/msal-common v14.15.0 2024-10-03 */
5226
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
5227
5227
  /*
5228
5228
  * Copyright (c) Microsoft Corporation. All rights reserved.
5229
5229
  * Licensed under the MIT License.
@@ -5319,7 +5319,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
5319
5319
  };
5320
5320
  };
5321
5321
 
5322
- /*! @azure/msal-common v14.15.0 2024-10-03 */
5322
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
5323
5323
 
5324
5324
  /*
5325
5325
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5428,7 +5428,7 @@ RegionDiscovery.IMDS_OPTIONS = {
5428
5428
  },
5429
5429
  };
5430
5430
 
5431
- /*! @azure/msal-common v14.15.0 2024-10-03 */
5431
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
5432
5432
 
5433
5433
  /*
5434
5434
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6267,7 +6267,7 @@ function buildStaticAuthorityOptions(authOptions) {
6267
6267
  };
6268
6268
  }
6269
6269
 
6270
- /*! @azure/msal-common v14.15.0 2024-10-03 */
6270
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
6271
6271
 
6272
6272
  /*
6273
6273
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6298,7 +6298,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
6298
6298
  }
6299
6299
  }
6300
6300
 
6301
- /*! @azure/msal-common v14.15.0 2024-10-03 */
6301
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
6302
6302
 
6303
6303
  /*
6304
6304
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6401,7 +6401,7 @@ class BaseClient {
6401
6401
  }
6402
6402
  }
6403
6403
 
6404
- /*! @azure/msal-common v14.15.0 2024-10-03 */
6404
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
6405
6405
  /*
6406
6406
  * Copyright (c) Microsoft Corporation. All rights reserved.
6407
6407
  * Licensed under the MIT License.
@@ -6427,7 +6427,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
6427
6427
  refreshTokenExpired: refreshTokenExpired
6428
6428
  });
6429
6429
 
6430
- /*! @azure/msal-common v14.15.0 2024-10-03 */
6430
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
6431
6431
 
6432
6432
  /*
6433
6433
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6515,7 +6515,7 @@ function createInteractionRequiredAuthError(errorCode) {
6515
6515
  return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
6516
6516
  }
6517
6517
 
6518
- /*! @azure/msal-common v14.15.0 2024-10-03 */
6518
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
6519
6519
 
6520
6520
  /*
6521
6521
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6587,7 +6587,7 @@ class ProtocolUtils {
6587
6587
  }
6588
6588
  }
6589
6589
 
6590
- /*! @azure/msal-common v14.15.0 2024-10-03 */
6590
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
6591
6591
 
6592
6592
  /*
6593
6593
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6671,7 +6671,7 @@ class PopTokenGenerator {
6671
6671
  }
6672
6672
  }
6673
6673
 
6674
- /*! @azure/msal-common v14.15.0 2024-10-03 */
6674
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
6675
6675
  /*
6676
6676
  * Copyright (c) Microsoft Corporation. All rights reserved.
6677
6677
  * Licensed under the MIT License.
@@ -6698,7 +6698,7 @@ class PopTokenGenerator {
6698
6698
  }
6699
6699
  }
6700
6700
 
6701
- /*! @azure/msal-common v14.15.0 2024-10-03 */
6701
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
6702
6702
 
6703
6703
  /*
6704
6704
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7075,7 +7075,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
7075
7075
  return baseAccount;
7076
7076
  }
7077
7077
 
7078
- /*! @azure/msal-common v14.15.0 2024-10-03 */
7078
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
7079
7079
  /*
7080
7080
  * Copyright (c) Microsoft Corporation. All rights reserved.
7081
7081
  * Licensed under the MIT License.
@@ -7093,7 +7093,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
7093
7093
  }
7094
7094
  }
7095
7095
 
7096
- /*! @azure/msal-common v14.15.0 2024-10-03 */
7096
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
7097
7097
 
7098
7098
  /*
7099
7099
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7524,7 +7524,7 @@ class AuthorizationCodeClient extends BaseClient {
7524
7524
  }
7525
7525
  }
7526
7526
 
7527
- /*! @azure/msal-common v14.15.0 2024-10-03 */
7527
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
7528
7528
 
7529
7529
  /*
7530
7530
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7738,7 +7738,7 @@ class RefreshTokenClient extends BaseClient {
7738
7738
  }
7739
7739
  }
7740
7740
 
7741
- /*! @azure/msal-common v14.15.0 2024-10-03 */
7741
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
7742
7742
 
7743
7743
  /*
7744
7744
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7874,7 +7874,7 @@ class SilentFlowClient extends BaseClient {
7874
7874
  }
7875
7875
  }
7876
7876
 
7877
- /*! @azure/msal-common v14.15.0 2024-10-03 */
7877
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
7878
7878
 
7879
7879
  /*
7880
7880
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7889,7 +7889,7 @@ const StubbedNetworkModule = {
7889
7889
  },
7890
7890
  };
7891
7891
 
7892
- /*! @azure/msal-common v14.15.0 2024-10-03 */
7892
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
7893
7893
 
7894
7894
  /*
7895
7895
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7947,7 +7947,7 @@ class AuthenticationHeaderParser {
7947
7947
  }
7948
7948
  }
7949
7949
 
7950
- /*! @azure/msal-common v14.15.0 2024-10-03 */
7950
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
7951
7951
 
7952
7952
  /*
7953
7953
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8210,7 +8210,7 @@ class ServerTelemetryManager {
8210
8210
  }
8211
8211
  }
8212
8212
 
8213
- /*! @azure/msal-common v14.15.0 2024-10-03 */
8213
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
8214
8214
  /*
8215
8215
  * Copyright (c) Microsoft Corporation. All rights reserved.
8216
8216
  * Licensed under the MIT License.
@@ -8218,7 +8218,7 @@ class ServerTelemetryManager {
8218
8218
  const missingKidError = "missing_kid_error";
8219
8219
  const missingAlgError = "missing_alg_error";
8220
8220
 
8221
- /*! @azure/msal-common v14.15.0 2024-10-03 */
8221
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
8222
8222
 
8223
8223
  /*
8224
8224
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8243,7 +8243,7 @@ function createJoseHeaderError(code) {
8243
8243
  return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
8244
8244
  }
8245
8245
 
8246
- /*! @azure/msal-common v14.15.0 2024-10-03 */
8246
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
8247
8247
 
8248
8248
  /*
8249
8249
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8283,7 +8283,7 @@ class JoseHeader {
8283
8283
  }
8284
8284
  }
8285
8285
 
8286
- /*! @azure/msal-common v14.15.0 2024-10-03 */
8286
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
8287
8287
 
8288
8288
  /*
8289
8289
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8362,7 +8362,7 @@ class StubPerformanceClient {
8362
8362
  }
8363
8363
  }
8364
8364
 
8365
- /*! @azure/msal-common v14.15.0 2024-10-03 */
8365
+ /*! @azure/msal-common v14.15.0 2024-10-08 */
8366
8366
 
8367
8367
  /*
8368
8368
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10234,7 +10234,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
10234
10234
 
10235
10235
  /* eslint-disable header/header */
10236
10236
  const name = "@azure/msal-browser";
10237
- const version = "3.25.0";
10237
+ const version = "3.26.1";
10238
10238
 
10239
10239
  /*
10240
10240
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -12705,24 +12705,26 @@ const EventType = {
12705
12705
  * Licensed under the MIT License.
12706
12706
  */
12707
12707
  class EventHandler {
12708
- constructor(logger, browserCrypto) {
12708
+ constructor(logger) {
12709
12709
  this.eventCallbacks = new Map();
12710
- this.logger = logger;
12711
- this.browserCrypto = browserCrypto;
12712
- this.listeningToStorageEvents = false;
12713
- this.handleAccountCacheChange =
12714
- this.handleAccountCacheChange.bind(this);
12710
+ this.logger = logger || new Logger({});
12715
12711
  }
12716
12712
  /**
12717
12713
  * Adds event callbacks to array
12718
- * @param callback
12714
+ * @param callback - callback to be invoked when an event is raised
12715
+ * @param eventTypes - list of events that this callback will be invoked for, if not provided callback will be invoked for all events
12716
+ * @param callbackId - Identifier for the callback, used to locate and remove the callback when no longer required
12719
12717
  */
12720
- addEventCallback(callback) {
12718
+ addEventCallback(callback, eventTypes, callbackId) {
12721
12719
  if (typeof window !== "undefined") {
12722
- const callbackId = createNewGuid();
12723
- this.eventCallbacks.set(callbackId, callback);
12724
- this.logger.verbose(`Event callback registered with id: ${callbackId}`);
12725
- return callbackId;
12720
+ const id = callbackId || createGuid();
12721
+ if (this.eventCallbacks.has(id)) {
12722
+ this.logger.error(`Event callback with id: ${id} is already registered. Please provide a unique id or remove the existing callback and try again.`);
12723
+ return null;
12724
+ }
12725
+ this.eventCallbacks.set(id, [callback, eventTypes || []]);
12726
+ this.logger.verbose(`Event callback registered with id: ${id}`);
12727
+ return id;
12726
12728
  }
12727
12729
  return null;
12728
12730
  }
@@ -12734,38 +12736,6 @@ class EventHandler {
12734
12736
  this.eventCallbacks.delete(callbackId);
12735
12737
  this.logger.verbose(`Event callback ${callbackId} removed.`);
12736
12738
  }
12737
- /**
12738
- * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
12739
- */
12740
- enableAccountStorageEvents() {
12741
- if (typeof window === "undefined") {
12742
- return;
12743
- }
12744
- if (!this.listeningToStorageEvents) {
12745
- this.logger.verbose("Adding account storage listener.");
12746
- this.listeningToStorageEvents = true;
12747
- window.addEventListener("storage", this.handleAccountCacheChange);
12748
- }
12749
- else {
12750
- this.logger.verbose("Account storage listener already registered.");
12751
- }
12752
- }
12753
- /**
12754
- * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
12755
- */
12756
- disableAccountStorageEvents() {
12757
- if (typeof window === "undefined") {
12758
- return;
12759
- }
12760
- if (this.listeningToStorageEvents) {
12761
- this.logger.verbose("Removing account storage listener.");
12762
- window.removeEventListener("storage", this.handleAccountCacheChange);
12763
- this.listeningToStorageEvents = false;
12764
- }
12765
- else {
12766
- this.logger.verbose("No account storage listener registered.");
12767
- }
12768
- }
12769
12739
  /**
12770
12740
  * Emits events by calling callback with event message
12771
12741
  * @param eventType
@@ -12782,48 +12752,15 @@ class EventHandler {
12782
12752
  error: error || null,
12783
12753
  timestamp: Date.now(),
12784
12754
  };
12785
- this.logger.info(`Emitting event: ${eventType}`);
12786
- this.eventCallbacks.forEach((callback, callbackId) => {
12787
- this.logger.verbose(`Emitting event to callback ${callbackId}: ${eventType}`);
12788
- callback.apply(null, [message]);
12755
+ this.eventCallbacks.forEach(([callback, eventTypes], callbackId) => {
12756
+ if (eventTypes.length === 0 ||
12757
+ eventTypes.includes(eventType)) {
12758
+ this.logger.verbose(`Emitting event to callback ${callbackId}: ${eventType}`);
12759
+ callback.apply(null, [message]);
12760
+ }
12789
12761
  });
12790
12762
  }
12791
12763
  }
12792
- /**
12793
- * Emit account added/removed events when cached accounts are changed in a different tab or frame
12794
- */
12795
- handleAccountCacheChange(e) {
12796
- try {
12797
- // Handle active account filter change
12798
- if (e.key?.includes(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS)) {
12799
- // This event has no payload, it only signals cross-tab app instances that the results of calling getActiveAccount() will have changed
12800
- this.emitEvent(EventType.ACTIVE_ACCOUNT_CHANGED);
12801
- }
12802
- // Handle account object change
12803
- const cacheValue = e.newValue || e.oldValue;
12804
- if (!cacheValue) {
12805
- return;
12806
- }
12807
- const parsedValue = JSON.parse(cacheValue);
12808
- if (typeof parsedValue !== "object" ||
12809
- !AccountEntity.isAccountEntity(parsedValue)) {
12810
- return;
12811
- }
12812
- const accountEntity = CacheManager.toObject(new AccountEntity(), parsedValue);
12813
- const accountInfo = accountEntity.getAccountInfo();
12814
- if (!e.oldValue && e.newValue) {
12815
- this.logger.info("Account was added to cache in a different window");
12816
- this.emitEvent(EventType.ACCOUNT_ADDED, undefined, accountInfo);
12817
- }
12818
- else if (!e.newValue && e.oldValue) {
12819
- this.logger.info("Account was removed from cache in a different window");
12820
- this.emitEvent(EventType.ACCOUNT_REMOVED, undefined, accountInfo);
12821
- }
12822
- }
12823
- catch (e) {
12824
- return;
12825
- }
12826
- }
12827
12764
  }
12828
12765
 
12829
12766
  /*
@@ -15985,7 +15922,7 @@ class StandardController {
15985
15922
  this.browserCrypto = this.isBrowserEnvironment
15986
15923
  ? new CryptoOps(this.logger, this.performanceClient)
15987
15924
  : DEFAULT_CRYPTO_IMPLEMENTATION;
15988
- this.eventHandler = new EventHandler(this.logger, this.browserCrypto);
15925
+ this.eventHandler = new EventHandler(this.logger);
15989
15926
  // Initialize the browser storage class.
15990
15927
  this.browserStorage = this.isBrowserEnvironment
15991
15928
  ? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, buildStaticAuthorityOptions(this.config.auth), this.performanceClient)
@@ -16008,6 +15945,10 @@ class StandardController {
16008
15945
  // Register listener functions
16009
15946
  this.trackPageVisibilityWithMeasurement =
16010
15947
  this.trackPageVisibilityWithMeasurement.bind(this);
15948
+ // account storage events
15949
+ this.listeningToStorageEvents = false;
15950
+ this.handleAccountCacheChange =
15951
+ this.handleAccountCacheChange.bind(this);
16011
15952
  }
16012
15953
  static async createController(operatingContext, request) {
16013
15954
  const controller = new StandardController(operatingContext);
@@ -16031,6 +15972,12 @@ class StandardController {
16031
15972
  this.logger.info("initialize has already been called, exiting early.");
16032
15973
  return;
16033
15974
  }
15975
+ if (!this.isBrowserEnvironment) {
15976
+ this.logger.info("in non-browser environment, exiting early.");
15977
+ this.initialized = true;
15978
+ this.eventHandler.emitEvent(EventType.INITIALIZE_END);
15979
+ return;
15980
+ }
16034
15981
  const initCorrelationId = request?.correlationId || this.getRequestCorrelationId();
16035
15982
  const allowNativeBroker = this.config.system.allowNativeBroker;
16036
15983
  const initMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.InitializeClientApplication, initCorrelationId);
@@ -16680,6 +16627,10 @@ class StandardController {
16680
16627
  * @param logoutRequest
16681
16628
  */
16682
16629
  async clearCache(logoutRequest) {
16630
+ if (!this.isBrowserEnvironment) {
16631
+ this.logger.info("in non-browser environment, returning early.");
16632
+ return;
16633
+ }
16683
16634
  const correlationId = this.getRequestCorrelationId(logoutRequest);
16684
16635
  const cacheClient = this.createSilentCacheClient(correlationId);
16685
16636
  return cacheClient.logout(logoutRequest);
@@ -16865,8 +16816,8 @@ class StandardController {
16865
16816
  * Adds event callbacks to array
16866
16817
  * @param callback
16867
16818
  */
16868
- addEventCallback(callback) {
16869
- return this.eventHandler.addEventCallback(callback);
16819
+ addEventCallback(callback, eventTypes) {
16820
+ return this.eventHandler.addEventCallback(callback, eventTypes);
16870
16821
  }
16871
16822
  /**
16872
16823
  * Removes callback with provided id from callback array
@@ -16882,6 +16833,7 @@ class StandardController {
16882
16833
  * @returns {string}
16883
16834
  */
16884
16835
  addPerformanceCallback(callback) {
16836
+ blockNonBrowserEnvironment();
16885
16837
  return this.performanceClient.addPerformanceCallback(callback);
16886
16838
  }
16887
16839
  /**
@@ -16897,13 +16849,68 @@ class StandardController {
16897
16849
  * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
16898
16850
  */
16899
16851
  enableAccountStorageEvents() {
16900
- this.eventHandler.enableAccountStorageEvents();
16852
+ if (typeof window === "undefined") {
16853
+ return;
16854
+ }
16855
+ if (!this.listeningToStorageEvents) {
16856
+ this.logger.verbose("Adding account storage listener.");
16857
+ this.listeningToStorageEvents = true;
16858
+ window.addEventListener("storage", this.handleAccountCacheChange);
16859
+ }
16860
+ else {
16861
+ this.logger.verbose("Account storage listener already registered.");
16862
+ }
16901
16863
  }
16902
16864
  /**
16903
16865
  * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
16904
16866
  */
16905
16867
  disableAccountStorageEvents() {
16906
- this.eventHandler.disableAccountStorageEvents();
16868
+ if (typeof window === "undefined") {
16869
+ return;
16870
+ }
16871
+ if (this.listeningToStorageEvents) {
16872
+ this.logger.verbose("Removing account storage listener.");
16873
+ window.removeEventListener("storage", this.handleAccountCacheChange);
16874
+ this.listeningToStorageEvents = false;
16875
+ }
16876
+ else {
16877
+ this.logger.verbose("No account storage listener registered.");
16878
+ }
16879
+ }
16880
+ /**
16881
+ * Emit account added/removed events when cached accounts are changed in a different tab or frame
16882
+ */
16883
+ handleAccountCacheChange(e) {
16884
+ try {
16885
+ // Handle active account filter change
16886
+ if (e.key?.includes(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS)) {
16887
+ // This event has no payload, it only signals cross-tab app instances that the results of calling getActiveAccount() will have changed
16888
+ this.eventHandler.emitEvent(EventType.ACTIVE_ACCOUNT_CHANGED);
16889
+ }
16890
+ // Handle account object change
16891
+ const cacheValue = e.newValue || e.oldValue;
16892
+ if (!cacheValue) {
16893
+ return;
16894
+ }
16895
+ const parsedValue = JSON.parse(cacheValue);
16896
+ if (typeof parsedValue !== "object" ||
16897
+ !AccountEntity.isAccountEntity(parsedValue)) {
16898
+ return;
16899
+ }
16900
+ const accountEntity = CacheManager.toObject(new AccountEntity(), parsedValue);
16901
+ const accountInfo = accountEntity.getAccountInfo();
16902
+ if (!e.oldValue && e.newValue) {
16903
+ this.logger.info("Account was added to cache in a different window");
16904
+ this.eventHandler.emitEvent(EventType.ACCOUNT_ADDED, undefined, accountInfo);
16905
+ }
16906
+ else if (!e.newValue && e.oldValue) {
16907
+ this.logger.info("Account was removed from cache in a different window");
16908
+ this.eventHandler.emitEvent(EventType.ACCOUNT_REMOVED, undefined, accountInfo);
16909
+ }
16910
+ }
16911
+ catch (e) {
16912
+ return;
16913
+ }
16907
16914
  }
16908
16915
  /**
16909
16916
  * Gets the token cache for the application.
@@ -16958,12 +16965,6 @@ class StandardController {
16958
16965
  isBrowserEnv() {
16959
16966
  return this.isBrowserEnvironment;
16960
16967
  }
16961
- /**
16962
- * Returns the event handler
16963
- */
16964
- getEventHandler() {
16965
- return this.eventHandler;
16966
- }
16967
16968
  /**
16968
16969
  * Generates a correlation id for a request if none is provided.
16969
16970
  *
@@ -17489,7 +17490,7 @@ class NestedAppAuthController {
17489
17490
  this.browserStorage = this.operatingContext.isBrowserEnvironment()
17490
17491
  ? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, buildStaticAuthorityOptions(this.config.auth))
17491
17492
  : DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);
17492
- this.eventHandler = new EventHandler(this.logger, this.browserCrypto);
17493
+ this.eventHandler = new EventHandler(this.logger);
17493
17494
  this.nestedAppAuthAdapter = new NestedAppAuthAdapter(this.config.auth.clientId, this.config.auth.clientCapabilities, this.browserCrypto, this.logger);
17494
17495
  // Set the active account if available
17495
17496
  const accountContext = this.bridgeProxy.getAccountContext();
@@ -17498,13 +17499,6 @@ class NestedAppAuthController {
17498
17499
  setActiveAccount(cachedAccount, this.browserStorage);
17499
17500
  }
17500
17501
  }
17501
- /**
17502
- * Returns the event handler instance
17503
- * @returns EventHandler
17504
- */
17505
- getEventHandler() {
17506
- return this.eventHandler;
17507
- }
17508
17502
  /**
17509
17503
  * Factory function to create a new instance of NestedAppAuthController
17510
17504
  * @param operatingContext
@@ -17550,7 +17544,9 @@ class NestedAppAuthController {
17550
17544
  const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(validRequest);
17551
17545
  const reqTimestamp = nowSeconds();
17552
17546
  const response = await this.bridgeProxy.getTokenInteractive(naaRequest);
17553
- const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);
17547
+ const result = {
17548
+ ...this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp),
17549
+ };
17554
17550
  // cache the tokens in the response
17555
17551
  await this.hydrateCache(result, request);
17556
17552
  this.browserStorage.setActiveAccount(result.account);
@@ -17634,7 +17630,22 @@ class NestedAppAuthController {
17634
17630
  atsMeasurement?.add({
17635
17631
  nestedAppAuthRequest: true,
17636
17632
  });
17637
- const result = await this.acquireTokenFromCacheInternal(request);
17633
+ // if the request has claims, we cannot look up in the cache
17634
+ if (request.claims) {
17635
+ this.logger.verbose("Claims are present in the request, skipping cache lookup");
17636
+ return null;
17637
+ }
17638
+ // respect cache lookup policy
17639
+ let result = null;
17640
+ switch (request.cacheLookupPolicy) {
17641
+ case CacheLookupPolicy.Default:
17642
+ case CacheLookupPolicy.AccessToken:
17643
+ case CacheLookupPolicy.AccessTokenAndRefreshToken:
17644
+ result = await this.acquireTokenFromCacheInternal(request);
17645
+ break;
17646
+ default:
17647
+ return null;
17648
+ }
17638
17649
  if (result) {
17639
17650
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, result);
17640
17651
  atsMeasurement?.add({
@@ -17687,13 +17698,10 @@ class NestedAppAuthController {
17687
17698
  if (!cachedAccessToken) {
17688
17699
  this.logger.verbose("No cached access token found");
17689
17700
  return Promise.resolve(null);
17690
- // If access token has expired, remove the token from cache and return null
17691
17701
  }
17692
17702
  else if (wasClockTurnedBack(cachedAccessToken.cachedAt) ||
17693
17703
  isTokenExpired(cachedAccessToken.expiresOn, this.config.system.tokenRenewalOffsetSeconds)) {
17694
- this.logger.verbose("Cached access token has expired, deleting all related tokens from cache");
17695
- const accountEntity = AccountEntity.createFromAccountInfo(currentAccount);
17696
- await this.browserStorage.removeAccountContext(accountEntity);
17704
+ this.logger.verbose("Cached access token has expired");
17697
17705
  return Promise.resolve(null);
17698
17706
  }
17699
17707
  const cachedIdToken = this.browserStorage.getIdToken(currentAccount, tokenKeys, currentAccount.tenantId, this.performanceClient, authRequest.correlationId);
@@ -17760,9 +17768,10 @@ class NestedAppAuthController {
17760
17768
  /**
17761
17769
  * Adds event callbacks to array
17762
17770
  * @param callback
17771
+ * @param eventTypes
17763
17772
  */
17764
- addEventCallback(callback) {
17765
- return this.eventHandler.addEventCallback(callback);
17773
+ addEventCallback(callback, eventTypes) {
17774
+ return this.eventHandler.addEventCallback(callback, eventTypes);
17766
17775
  }
17767
17776
  /**
17768
17777
  * Removes callback with provided id from callback array
@@ -18061,9 +18070,10 @@ class PublicClientApplication {
18061
18070
  /**
18062
18071
  * Adds event callbacks to array
18063
18072
  * @param callback
18073
+ * @param eventTypes
18064
18074
  */
18065
- addEventCallback(callback) {
18066
- return this.controller.addEventCallback(callback);
18075
+ addEventCallback(callback, eventTypes) {
18076
+ return this.controller.addEventCallback(callback, eventTypes);
18067
18077
  }
18068
18078
  /**
18069
18079
  * Removes callback with provided id from callback array
@@ -18363,14 +18373,10 @@ class UnknownOperatingContextController {
18363
18373
  this.browserStorage = this.isBrowserEnvironment
18364
18374
  ? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, undefined, this.performanceClient)
18365
18375
  : DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);
18366
- this.eventHandler = new EventHandler(this.logger, this.browserCrypto);
18367
18376
  }
18368
18377
  getBrowserStorage() {
18369
18378
  return this.browserStorage;
18370
18379
  }
18371
- getEventHandler() {
18372
- return this.eventHandler;
18373
- }
18374
18380
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
18375
18381
  getAccount(accountFilter) {
18376
18382
  return null;
@@ -18440,12 +18446,16 @@ class UnknownOperatingContextController {
18440
18446
  blockNonBrowserEnvironment();
18441
18447
  return {};
18442
18448
  }
18443
- addEventCallback(callback) {
18444
- return this.eventHandler.addEventCallback(callback);
18445
- }
18446
- removeEventCallback(callbackId) {
18447
- this.eventHandler.removeEventCallback(callbackId);
18449
+ addEventCallback(
18450
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
18451
+ callback,
18452
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
18453
+ eventTypes) {
18454
+ return null;
18448
18455
  }
18456
+ removeEventCallback(
18457
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
18458
+ callbackId) { }
18449
18459
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
18450
18460
  addPerformanceCallback(callback) {
18451
18461
  blockAPICallsBeforeInitialize(this.initialized);
@@ -18746,8 +18756,8 @@ class PublicClientNext {
18746
18756
  * Adds event callbacks to array
18747
18757
  * @param callback
18748
18758
  */
18749
- addEventCallback(callback) {
18750
- return this.controller.addEventCallback(callback);
18759
+ addEventCallback(callback, eventTypes) {
18760
+ return this.controller.addEventCallback(callback, eventTypes);
18751
18761
  }
18752
18762
  /**
18753
18763
  * Removes callback with provided id from callback array
@@ -19484,6 +19494,7 @@ exports.ClientConfigurationError = ClientConfigurationError;
19484
19494
  exports.ClientConfigurationErrorCodes = ClientConfigurationErrorCodes;
19485
19495
  exports.ClientConfigurationErrorMessage = ClientConfigurationErrorMessage;
19486
19496
  exports.DEFAULT_IFRAME_TIMEOUT_MS = DEFAULT_IFRAME_TIMEOUT_MS;
19497
+ exports.EventHandler = EventHandler;
19487
19498
  exports.EventMessageUtils = EventMessageUtils;
19488
19499
  exports.EventType = EventType;
19489
19500
  exports.InteractionRequiredAuthError = InteractionRequiredAuthError;