@azure/msal-browser 3.0.2 → 3.2.0

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 (280) hide show
  1. package/dist/app/IPublicClientApplication.d.ts +2 -0
  2. package/dist/app/IPublicClientApplication.d.ts.map +1 -1
  3. package/dist/app/IPublicClientApplication.mjs +22 -18
  4. package/dist/app/IPublicClientApplication.mjs.map +1 -1
  5. package/dist/app/PublicClientApplication.d.ts +20 -6
  6. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  7. package/dist/app/PublicClientApplication.mjs +24 -7
  8. package/dist/app/PublicClientApplication.mjs.map +1 -1
  9. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +3 -4
  10. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -1
  11. package/dist/broker/nativeBroker/NativeMessageHandler.mjs +17 -16
  12. package/dist/broker/nativeBroker/NativeMessageHandler.mjs.map +1 -1
  13. package/dist/broker/nativeBroker/NativeStatusCodes.d.ts +8 -0
  14. package/dist/broker/nativeBroker/NativeStatusCodes.d.ts.map +1 -0
  15. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +16 -0
  16. package/dist/broker/nativeBroker/NativeStatusCodes.mjs.map +1 -0
  17. package/dist/cache/AsyncMemoryStorage.mjs +4 -3
  18. package/dist/cache/AsyncMemoryStorage.mjs.map +1 -1
  19. package/dist/cache/BrowserCacheManager.d.ts +10 -3
  20. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  21. package/dist/cache/BrowserCacheManager.mjs +58 -29
  22. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  23. package/dist/cache/BrowserStorage.d.ts.map +1 -1
  24. package/dist/cache/BrowserStorage.mjs +7 -9
  25. package/dist/cache/BrowserStorage.mjs.map +1 -1
  26. package/dist/cache/CryptoKeyStore.mjs +1 -1
  27. package/dist/cache/CryptoKeyStore.mjs.map +1 -1
  28. package/dist/cache/DatabaseStorage.d.ts.map +1 -1
  29. package/dist/cache/DatabaseStorage.mjs +9 -8
  30. package/dist/cache/DatabaseStorage.mjs.map +1 -1
  31. package/dist/cache/MemoryStorage.mjs +1 -1
  32. package/dist/cache/MemoryStorage.mjs.map +1 -1
  33. package/dist/cache/TokenCache.d.ts.map +1 -1
  34. package/dist/cache/TokenCache.mjs +30 -30
  35. package/dist/cache/TokenCache.mjs.map +1 -1
  36. package/dist/config/Configuration.d.ts +1 -0
  37. package/dist/config/Configuration.d.ts.map +1 -1
  38. package/dist/config/Configuration.mjs +12 -16
  39. package/dist/config/Configuration.mjs.map +1 -1
  40. package/dist/controllers/ControllerFactory.mjs +1 -1
  41. package/dist/controllers/ControllerFactory.mjs.map +1 -1
  42. package/dist/controllers/IController.d.ts +5 -28
  43. package/dist/controllers/IController.d.ts.map +1 -1
  44. package/dist/controllers/StandardController.d.ts +17 -31
  45. package/dist/controllers/StandardController.d.ts.map +1 -1
  46. package/dist/controllers/StandardController.mjs +78 -83
  47. package/dist/controllers/StandardController.mjs.map +1 -1
  48. package/dist/crypto/BrowserCrypto.d.ts +44 -49
  49. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  50. package/dist/crypto/BrowserCrypto.mjs +78 -77
  51. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  52. package/dist/crypto/CryptoOps.d.ts +1 -10
  53. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  54. package/dist/crypto/CryptoOps.mjs +23 -34
  55. package/dist/crypto/CryptoOps.mjs.map +1 -1
  56. package/dist/crypto/PkceGenerator.d.ts +6 -22
  57. package/dist/crypto/PkceGenerator.d.ts.map +1 -1
  58. package/dist/crypto/PkceGenerator.mjs +48 -49
  59. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  60. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  61. package/dist/crypto/SignedHttpRequest.mjs.map +1 -1
  62. package/dist/encode/Base64Decode.d.ts +6 -19
  63. package/dist/encode/Base64Decode.d.ts.map +1 -1
  64. package/dist/encode/Base64Decode.mjs +31 -68
  65. package/dist/encode/Base64Decode.mjs.map +1 -1
  66. package/dist/encode/Base64Encode.d.ts +15 -27
  67. package/dist/encode/Base64Encode.d.ts.map +1 -1
  68. package/dist/encode/Base64Encode.mjs +36 -75
  69. package/dist/encode/Base64Encode.mjs.map +1 -1
  70. package/dist/error/BrowserAuthError.d.ts +63 -195
  71. package/dist/error/BrowserAuthError.d.ts.map +1 -1
  72. package/dist/error/BrowserAuthError.mjs +159 -381
  73. package/dist/error/BrowserAuthError.mjs.map +1 -1
  74. package/dist/error/BrowserAuthErrorCodes.d.ts +46 -0
  75. package/dist/error/BrowserAuthErrorCodes.d.ts.map +1 -0
  76. package/dist/error/BrowserAuthErrorCodes.mjs +54 -0
  77. package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -0
  78. package/dist/error/BrowserConfigurationAuthError.d.ts +9 -46
  79. package/dist/error/BrowserConfigurationAuthError.d.ts.map +1 -1
  80. package/dist/error/BrowserConfigurationAuthError.mjs +20 -73
  81. package/dist/error/BrowserConfigurationAuthError.mjs.map +1 -1
  82. package/dist/error/BrowserConfigurationAuthErrorCodes.d.ts +4 -0
  83. package/dist/error/BrowserConfigurationAuthErrorCodes.d.ts.map +1 -0
  84. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +12 -0
  85. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs.map +1 -0
  86. package/dist/error/NativeAuthError.d.ts +17 -45
  87. package/dist/error/NativeAuthError.d.ts.map +1 -1
  88. package/dist/error/NativeAuthError.mjs +49 -79
  89. package/dist/error/NativeAuthError.mjs.map +1 -1
  90. package/dist/error/NativeAuthErrorCodes.d.ts +3 -0
  91. package/dist/error/NativeAuthErrorCodes.d.ts.map +1 -0
  92. package/dist/error/NativeAuthErrorCodes.mjs +11 -0
  93. package/dist/error/NativeAuthErrorCodes.mjs.map +1 -0
  94. package/dist/event/EventHandler.d.ts.map +1 -1
  95. package/dist/event/EventHandler.mjs +3 -2
  96. package/dist/event/EventHandler.mjs.map +1 -1
  97. package/dist/event/EventMessage.mjs +1 -1
  98. package/dist/event/EventMessage.mjs.map +1 -1
  99. package/dist/event/EventType.mjs +1 -1
  100. package/dist/event/EventType.mjs.map +1 -1
  101. package/dist/index.d.ts +6 -6
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.mjs +8 -4
  104. package/dist/index.mjs.map +1 -1
  105. package/dist/interaction_client/BaseInteractionClient.d.ts +2 -1
  106. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  107. package/dist/interaction_client/BaseInteractionClient.mjs +7 -8
  108. package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
  109. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  110. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs.map +1 -1
  111. package/dist/interaction_client/NativeInteractionClient.d.ts +4 -10
  112. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
  113. package/dist/interaction_client/NativeInteractionClient.mjs +32 -38
  114. package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
  115. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  116. package/dist/interaction_client/PopupClient.mjs +16 -15
  117. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  118. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  119. package/dist/interaction_client/RedirectClient.mjs +7 -6
  120. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  121. package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  122. package/dist/interaction_client/SilentAuthCodeClient.mjs +9 -11
  123. package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
  124. package/dist/interaction_client/SilentCacheClient.d.ts +4 -2
  125. package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
  126. package/dist/interaction_client/SilentCacheClient.mjs +19 -25
  127. package/dist/interaction_client/SilentCacheClient.mjs.map +1 -1
  128. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
  129. package/dist/interaction_client/SilentIframeClient.mjs +20 -47
  130. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  131. package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  132. package/dist/interaction_client/SilentRefreshClient.mjs +11 -20
  133. package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
  134. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  135. package/dist/interaction_client/StandardInteractionClient.mjs +18 -38
  136. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  137. package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
  138. package/dist/interaction_handler/InteractionHandler.mjs +13 -16
  139. package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
  140. package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
  141. package/dist/interaction_handler/RedirectHandler.mjs +12 -11
  142. package/dist/interaction_handler/RedirectHandler.mjs.map +1 -1
  143. package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
  144. package/dist/interaction_handler/SilentHandler.mjs +11 -11
  145. package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
  146. package/dist/navigation/NavigationClient.mjs +1 -1
  147. package/dist/navigation/NavigationClient.mjs.map +1 -1
  148. package/dist/network/FetchClient.d.ts.map +1 -1
  149. package/dist/network/FetchClient.mjs +9 -8
  150. package/dist/network/FetchClient.mjs.map +1 -1
  151. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  152. package/dist/operatingcontext/BaseOperatingContext.mjs.map +1 -1
  153. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  154. package/dist/operatingcontext/StandardOperatingContext.mjs.map +1 -1
  155. package/dist/operatingcontext/TeamsAppOperatingContext.mjs +1 -1
  156. package/dist/operatingcontext/TeamsAppOperatingContext.mjs.map +1 -1
  157. package/dist/packageMetadata.d.ts +1 -1
  158. package/dist/packageMetadata.mjs +2 -2
  159. package/dist/packageMetadata.mjs.map +1 -1
  160. package/dist/request/ClearCacheRequest.d.ts +11 -0
  161. package/dist/request/ClearCacheRequest.d.ts.map +1 -0
  162. package/dist/telemetry/BrowserPerformanceClient.d.ts +2 -4
  163. package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
  164. package/dist/telemetry/BrowserPerformanceClient.mjs +2 -6
  165. package/dist/telemetry/BrowserPerformanceClient.mjs.map +1 -1
  166. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  167. package/dist/telemetry/BrowserPerformanceMeasurement.mjs.map +1 -1
  168. package/dist/utils/BrowserConstants.mjs +1 -1
  169. package/dist/utils/BrowserConstants.mjs.map +1 -1
  170. package/dist/utils/BrowserProtocolUtils.d.ts.map +1 -1
  171. package/dist/utils/BrowserProtocolUtils.mjs +4 -4
  172. package/dist/utils/BrowserProtocolUtils.mjs.map +1 -1
  173. package/dist/utils/BrowserStringUtils.mjs +1 -1
  174. package/dist/utils/BrowserStringUtils.mjs.map +1 -1
  175. package/dist/utils/BrowserUtils.d.ts +0 -9
  176. package/dist/utils/BrowserUtils.d.ts.map +1 -1
  177. package/dist/utils/BrowserUtils.mjs +8 -33
  178. package/dist/utils/BrowserUtils.mjs.map +1 -1
  179. package/lib/msal-browser.cjs +8729 -9566
  180. package/lib/msal-browser.cjs.map +1 -1
  181. package/lib/msal-browser.js +8729 -9566
  182. package/lib/msal-browser.js.map +1 -1
  183. package/lib/msal-browser.min.js +68 -62
  184. package/package.json +7 -5
  185. package/src/app/IPublicClientApplication.ts +236 -0
  186. package/src/app/PublicClientApplication.ts +417 -0
  187. package/src/broker/nativeBroker/NativeMessageHandler.ts +416 -0
  188. package/src/broker/nativeBroker/NativeRequest.ts +52 -0
  189. package/src/broker/nativeBroker/NativeResponse.ts +56 -0
  190. package/src/broker/nativeBroker/NativeStatusCodes.ts +13 -0
  191. package/src/cache/AsyncMemoryStorage.ts +158 -0
  192. package/src/cache/BrowserCacheManager.ts +2009 -0
  193. package/src/cache/BrowserStorage.ts +52 -0
  194. package/src/cache/CryptoKeyStore.ts +63 -0
  195. package/src/cache/DatabaseStorage.ts +287 -0
  196. package/src/cache/IAsyncMemoryStorage.ts +36 -0
  197. package/src/cache/ITokenCache.ts +21 -0
  198. package/src/cache/IWindowStorage.ts +36 -0
  199. package/src/cache/MemoryStorage.ts +42 -0
  200. package/src/cache/TokenCache.ts +484 -0
  201. package/src/config/Configuration.ts +383 -0
  202. package/src/controllers/ControllerFactory.ts +55 -0
  203. package/src/controllers/IController.ts +134 -0
  204. package/src/controllers/StandardController.ts +2170 -0
  205. package/src/crypto/BrowserCrypto.ts +151 -0
  206. package/src/crypto/CryptoOps.ts +235 -0
  207. package/src/crypto/PkceGenerator.ts +115 -0
  208. package/src/crypto/SignedHttpRequest.ts +76 -0
  209. package/src/encode/Base64Decode.ts +46 -0
  210. package/src/encode/Base64Encode.ts +52 -0
  211. package/src/error/BrowserAuthError.ts +352 -0
  212. package/src/error/BrowserAuthErrorCodes.ts +57 -0
  213. package/src/error/BrowserConfigurationAuthError.ts +64 -0
  214. package/src/error/BrowserConfigurationAuthErrorCodes.ts +9 -0
  215. package/src/error/NativeAuthError.ts +113 -0
  216. package/src/error/NativeAuthErrorCodes.ts +7 -0
  217. package/src/event/EventHandler.ts +177 -0
  218. package/src/event/EventMessage.ts +125 -0
  219. package/src/event/EventType.ts +33 -0
  220. package/src/index.ts +157 -0
  221. package/src/interaction_client/BaseInteractionClient.ts +307 -0
  222. package/src/interaction_client/HybridSpaAuthorizationCodeClient.ts +16 -0
  223. package/src/interaction_client/NativeInteractionClient.ts +925 -0
  224. package/src/interaction_client/PopupClient.ts +926 -0
  225. package/src/interaction_client/RedirectClient.ts +616 -0
  226. package/src/interaction_client/SilentAuthCodeClient.ts +165 -0
  227. package/src/interaction_client/SilentCacheClient.ts +125 -0
  228. package/src/interaction_client/SilentIframeClient.ts +301 -0
  229. package/src/interaction_client/SilentRefreshClient.ts +118 -0
  230. package/src/interaction_client/StandardInteractionClient.ts +450 -0
  231. package/src/interaction_handler/InteractionHandler.ts +251 -0
  232. package/src/interaction_handler/RedirectHandler.ts +229 -0
  233. package/src/interaction_handler/SilentHandler.ts +269 -0
  234. package/src/navigation/INavigationClient.ts +23 -0
  235. package/src/navigation/NavigationClient.ts +55 -0
  236. package/src/navigation/NavigationOptions.ts +18 -0
  237. package/src/network/FetchClient.ts +130 -0
  238. package/src/operatingcontext/BaseOperatingContext.ts +82 -0
  239. package/src/operatingcontext/StandardOperatingContext.ts +49 -0
  240. package/src/operatingcontext/TeamsAppOperatingContext.ts +48 -0
  241. package/src/packageMetadata.ts +3 -0
  242. package/src/request/AuthorizationCodeRequest.ts +19 -0
  243. package/src/request/AuthorizationUrlRequest.ts +17 -0
  244. package/src/request/ClearCacheRequest.ts +16 -0
  245. package/src/request/EndSessionPopupRequest.ts +26 -0
  246. package/src/request/EndSessionRequest.ts +23 -0
  247. package/src/request/PopupRequest.ts +51 -0
  248. package/src/request/PopupWindowAttributes.ts +22 -0
  249. package/src/request/RedirectRequest.ts +51 -0
  250. package/src/request/SilentRequest.ts +49 -0
  251. package/src/request/SsoSilentRequest.ts +44 -0
  252. package/src/response/AuthenticationResult.ts +13 -0
  253. package/src/telemetry/BrowserPerformanceClient.ts +226 -0
  254. package/src/telemetry/BrowserPerformanceMeasurement.ts +144 -0
  255. package/src/utils/BrowserConstants.ts +241 -0
  256. package/src/utils/BrowserProtocolUtils.ts +58 -0
  257. package/src/utils/BrowserStringUtils.ts +143 -0
  258. package/src/utils/BrowserUtils.ts +156 -0
  259. package/dist/crypto/GuidGenerator.d.ts +0 -13
  260. package/dist/crypto/GuidGenerator.d.ts.map +0 -1
  261. package/dist/crypto/GuidGenerator.mjs +0 -104
  262. package/dist/crypto/GuidGenerator.mjs.map +0 -1
  263. package/dist/crypto/ISubtleCrypto.d.ts +0 -10
  264. package/dist/crypto/ISubtleCrypto.d.ts.map +0 -1
  265. package/dist/crypto/ModernBrowserCrypto.d.ts +0 -10
  266. package/dist/crypto/ModernBrowserCrypto.d.ts.map +0 -1
  267. package/dist/crypto/ModernBrowserCrypto.mjs +0 -31
  268. package/dist/crypto/ModernBrowserCrypto.mjs.map +0 -1
  269. package/dist/internals.d.ts +0 -23
  270. package/dist/internals.d.ts.map +0 -1
  271. package/dist/internals.mjs +0 -28
  272. package/dist/internals.mjs.map +0 -1
  273. package/dist/network/XhrClient.d.ts +0 -41
  274. package/dist/network/XhrClient.d.ts.map +0 -1
  275. package/dist/network/XhrClient.mjs +0 -125
  276. package/dist/network/XhrClient.mjs.map +0 -1
  277. package/dist/utils/MathUtils.d.ts +0 -12
  278. package/dist/utils/MathUtils.d.ts.map +0 -1
  279. package/dist/utils/MathUtils.mjs +0 -26
  280. package/dist/utils/MathUtils.mjs.map +0 -1
@@ -1,7 +1,7 @@
1
- /*! @azure/msal-browser v3.0.2 2023-08-18 */
1
+ /*! @azure/msal-browser v3.2.0 2023-10-05 */
2
2
  'use strict';
3
- import { Constants } from '@azure/msal-common';
4
- import { BrowserStringUtils } from '../utils/BrowserStringUtils.mjs';
3
+ import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
4
+ import { invalidBase64String } from '../error/BrowserAuthErrorCodes.mjs';
5
5
 
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9,73 +9,36 @@ import { BrowserStringUtils } from '../utils/BrowserStringUtils.mjs';
9
9
  */
10
10
  /**
11
11
  * Class which exposes APIs to decode base64 strings to plaintext. See here for implementation details:
12
- * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
12
+ * https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem
13
13
  */
14
- class Base64Decode {
15
- /**
16
- * Returns a URL-safe plaintext decoded string from b64 encoded input.
17
- * @param input
18
- */
19
- decode(input) {
20
- let encodedString = input.replace(/-/g, "+").replace(/_/g, "/");
21
- switch (encodedString.length % 4) {
22
- case 0:
23
- break;
24
- case 2:
25
- encodedString += "==";
26
- break;
27
- case 3:
28
- encodedString += "=";
29
- break;
30
- default:
31
- throw new Error("Invalid base64 string");
32
- }
33
- const inputUtf8Arr = this.base64DecToArr(encodedString);
34
- return BrowserStringUtils.utf8ArrToString(inputUtf8Arr);
35
- }
36
- /**
37
- * Decodes base64 into Uint8Array
38
- * @param base64String
39
- * @param nBlockSize
40
- */
41
- base64DecToArr(base64String, nBlockSize) {
42
- const sB64Enc = base64String.replace(/[^A-Za-z0-9\+\/]/g, Constants.EMPTY_STRING);
43
- const nInLen = sB64Enc.length;
44
- const nOutLen = nBlockSize
45
- ? Math.ceil(((nInLen * 3 + 1) >>> 2) / nBlockSize) * nBlockSize
46
- : (nInLen * 3 + 1) >>> 2;
47
- const aBytes = new Uint8Array(nOutLen);
48
- for (let nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) {
49
- nMod4 = nInIdx & 3;
50
- nUint24 |=
51
- this.b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << (18 - 6 * nMod4);
52
- if (nMod4 === 3 || nInLen - nInIdx === 1) {
53
- for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) {
54
- aBytes[nOutIdx] = (nUint24 >>> ((16 >>> nMod3) & 24)) & 255;
55
- }
56
- nUint24 = 0;
57
- }
58
- }
59
- return aBytes;
60
- }
61
- /**
62
- * Base64 string to array decoding helper
63
- * @param charNum
64
- */
65
- b64ToUint6(charNum) {
66
- return charNum > 64 && charNum < 91
67
- ? charNum - 65
68
- : charNum > 96 && charNum < 123
69
- ? charNum - 71
70
- : charNum > 47 && charNum < 58
71
- ? charNum + 4
72
- : charNum === 43
73
- ? 62
74
- : charNum === 47
75
- ? 63
76
- : 0;
14
+ /**
15
+ * Returns a URL-safe plaintext decoded string from b64 encoded input.
16
+ * @param input
17
+ */
18
+ function base64Decode(input) {
19
+ return new TextDecoder().decode(base64DecToArr(input));
20
+ }
21
+ /**
22
+ * Decodes base64 into Uint8Array
23
+ * @param base64String
24
+ */
25
+ function base64DecToArr(base64String) {
26
+ let encodedString = base64String.replace(/-/g, "+").replace(/_/g, "/");
27
+ switch (encodedString.length % 4) {
28
+ case 0:
29
+ break;
30
+ case 2:
31
+ encodedString += "==";
32
+ break;
33
+ case 3:
34
+ encodedString += "=";
35
+ break;
36
+ default:
37
+ throw createBrowserAuthError(invalidBase64String);
77
38
  }
39
+ const binString = atob(encodedString);
40
+ return Uint8Array.from(binString, (m) => m.codePointAt(0) || 0);
78
41
  }
79
42
 
80
- export { Base64Decode };
43
+ export { base64Decode };
81
44
  //# sourceMappingURL=Base64Decode.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Base64Decode.mjs","sources":["../../src/encode/Base64Decode.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAKH;;;AAGG;MACU,YAAY,CAAA;AACrB;;;AAGG;AACH,IAAA,MAAM,CAAC,KAAa,EAAA;AAChB,QAAA,IAAI,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAChE,QAAA,QAAQ,aAAa,CAAC,MAAM,GAAG,CAAC;AAC5B,YAAA,KAAK,CAAC;gBACF,MAAM;AACV,YAAA,KAAK,CAAC;gBACF,aAAa,IAAI,IAAI,CAAC;gBACtB,MAAM;AACV,YAAA,KAAK,CAAC;gBACF,aAAa,IAAI,GAAG,CAAC;gBACrB,MAAM;AACV,YAAA;AACI,gBAAA,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;AAChD,SAAA;QAED,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;AACxD,QAAA,OAAO,kBAAkB,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;KAC3D;AAED;;;;AAIG;IACK,cAAc,CAClB,YAAoB,EACpB,UAAmB,EAAA;AAEnB,QA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,QAAA,OAAO,OAAO,GAAG,EAAE,IAAI,OAAO,GAAG,EAAE;cAC7B,OAAO,GAAG,EAAE;AACd,cAAE,OAAO,GAAG,EAAE,IAAI,OAAO,GAAG,GAAG;kBAC7B,OAAO,GAAG,EAAE;AACd,kBAAE,OAAO,GAAG,EAAE,IAAI,OAAO,GAAG,EAAE;sBAC5B,OAAO,GAAG,CAAC;sBACX,OAAO,KAAK,EAAE;AAChB,0BAAE,EAAE;0BACF,OAAO,KAAK,EAAE;AAChB,8BAAE,EAAE;8BACF,CAAC,CAAC;KACX;AACJ;;;;"}
1
+ {"version":3,"file":"Base64Decode.mjs","sources":["../../src/encode/Base64Decode.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAUA;;;AAGG;;;AAKA;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,31 +2,19 @@
2
2
  * Class which exposes APIs to encode plaintext to base64 encoded string. See here for implementation details:
3
3
  * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
4
4
  */
5
- export declare class Base64Encode {
6
- /**
7
- * Returns URL Safe b64 encoded string from a plaintext string.
8
- * @param input
9
- */
10
- urlEncode(input: string): string;
11
- /**
12
- * Returns URL Safe b64 encoded string from an int8Array.
13
- * @param inputArr
14
- */
15
- urlEncodeArr(inputArr: Uint8Array): string;
16
- /**
17
- * Returns b64 encoded string from plaintext string.
18
- * @param input
19
- */
20
- encode(input: string): string;
21
- /**
22
- * Base64 encode byte array
23
- * @param aBytes
24
- */
25
- private base64EncArr;
26
- /**
27
- * Base64 string to array encoding helper
28
- * @param nUint6
29
- */
30
- private uint6ToB64;
31
- }
5
+ /**
6
+ * Returns URL Safe b64 encoded string from a plaintext string.
7
+ * @param input
8
+ */
9
+ export declare function urlEncode(input: string): string;
10
+ /**
11
+ * Returns URL Safe b64 encoded string from an int8Array.
12
+ * @param inputArr
13
+ */
14
+ export declare function urlEncodeArr(inputArr: Uint8Array): string;
15
+ /**
16
+ * Returns b64 encoded string from plaintext string.
17
+ * @param input
18
+ */
19
+ export declare function base64Encode(input: string): string;
32
20
  //# sourceMappingURL=Base64Encode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Base64Encode.d.ts","sourceRoot":"","sources":["../../src/encode/Base64Encode.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,qBAAa,YAAY;IACrB;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAShC;;;OAGG;IACH,YAAY,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM;IAO1C;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK7B;;;OAGG;IACH,OAAO,CAAC,YAAY;IAgCpB;;;OAGG;IACH,OAAO,CAAC,UAAU;CAarB"}
1
+ {"version":3,"file":"Base64Encode.d.ts","sourceRoot":"","sources":["../../src/encode/Base64Encode.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAEH;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,CAKzD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD"}
@@ -1,8 +1,5 @@
1
- /*! @azure/msal-browser v3.0.2 2023-08-18 */
1
+ /*! @azure/msal-browser v3.2.0 2023-10-05 */
2
2
  'use strict';
3
- import { Constants } from '@azure/msal-common';
4
- import { BrowserStringUtils } from '../utils/BrowserStringUtils.mjs';
5
-
6
3
  /*
7
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
8
5
  * Licensed under the MIT License.
@@ -11,77 +8,41 @@ import { BrowserStringUtils } from '../utils/BrowserStringUtils.mjs';
11
8
  * Class which exposes APIs to encode plaintext to base64 encoded string. See here for implementation details:
12
9
  * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
13
10
  */
14
- class Base64Encode {
15
- /**
16
- * Returns URL Safe b64 encoded string from a plaintext string.
17
- * @param input
18
- */
19
- urlEncode(input) {
20
- return encodeURIComponent(this.encode(input)
21
- .replace(/=/g, Constants.EMPTY_STRING)
22
- .replace(/\+/g, "-")
23
- .replace(/\//g, "_"));
24
- }
25
- /**
26
- * Returns URL Safe b64 encoded string from an int8Array.
27
- * @param inputArr
28
- */
29
- urlEncodeArr(inputArr) {
30
- return this.base64EncArr(inputArr)
31
- .replace(/=/g, Constants.EMPTY_STRING)
32
- .replace(/\+/g, "-")
33
- .replace(/\//g, "_");
34
- }
35
- /**
36
- * Returns b64 encoded string from plaintext string.
37
- * @param input
38
- */
39
- encode(input) {
40
- const inputUtf8Arr = BrowserStringUtils.stringToUtf8Arr(input);
41
- return this.base64EncArr(inputUtf8Arr);
42
- }
43
- /**
44
- * Base64 encode byte array
45
- * @param aBytes
46
- */
47
- base64EncArr(aBytes) {
48
- const eqLen = (3 - (aBytes.length % 3)) % 3;
49
- let sB64Enc = Constants.EMPTY_STRING;
50
- for (let nMod3, nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) {
51
- nMod3 = nIdx % 3;
52
- /* Uncomment the following line in order to split the output in lines 76-character long: */
53
- /*
54
- *if (nIdx > 0 && (nIdx * 4 / 3) % 76 === 0) { sB64Enc += "\r\n"; }
55
- */
56
- nUint24 |= aBytes[nIdx] << ((16 >>> nMod3) & 24);
57
- if (nMod3 === 2 || aBytes.length - nIdx === 1) {
58
- sB64Enc += String.fromCharCode(this.uint6ToB64((nUint24 >>> 18) & 63), this.uint6ToB64((nUint24 >>> 12) & 63), this.uint6ToB64((nUint24 >>> 6) & 63), this.uint6ToB64(nUint24 & 63));
59
- nUint24 = 0;
60
- }
61
- }
62
- return eqLen === 0
63
- ? sB64Enc
64
- : sB64Enc.substring(0, sB64Enc.length - eqLen) +
65
- (eqLen === 1 ? "=" : "==");
66
- }
67
- /**
68
- * Base64 string to array encoding helper
69
- * @param nUint6
70
- */
71
- uint6ToB64(nUint6) {
72
- return nUint6 < 26
73
- ? nUint6 + 65
74
- : nUint6 < 52
75
- ? nUint6 + 71
76
- : nUint6 < 62
77
- ? nUint6 - 4
78
- : nUint6 === 62
79
- ? 43
80
- : nUint6 === 63
81
- ? 47
82
- : 65;
83
- }
11
+ /**
12
+ * Returns URL Safe b64 encoded string from a plaintext string.
13
+ * @param input
14
+ */
15
+ function urlEncode(input) {
16
+ return encodeURIComponent(base64Encode(input)
17
+ .replace(/=/g, "")
18
+ .replace(/\+/g, "-")
19
+ .replace(/\//g, "_"));
20
+ }
21
+ /**
22
+ * Returns URL Safe b64 encoded string from an int8Array.
23
+ * @param inputArr
24
+ */
25
+ function urlEncodeArr(inputArr) {
26
+ return base64EncArr(inputArr)
27
+ .replace(/=/g, "")
28
+ .replace(/\+/g, "-")
29
+ .replace(/\//g, "_");
30
+ }
31
+ /**
32
+ * Returns b64 encoded string from plaintext string.
33
+ * @param input
34
+ */
35
+ function base64Encode(input) {
36
+ return base64EncArr(new TextEncoder().encode(input));
37
+ }
38
+ /**
39
+ * Base64 encode byte array
40
+ * @param aBytes
41
+ */
42
+ function base64EncArr(aBytes) {
43
+ const binString = Array.from(aBytes, (x) => String.fromCodePoint(x)).join("");
44
+ return btoa(binString);
84
45
  }
85
46
 
86
- export { Base64Encode };
47
+ export { base64Encode, urlEncode, urlEncodeArr };
87
48
  //# sourceMappingURL=Base64Encode.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Base64Encode.mjs","sources":["../../src/encode/Base64Encode.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAKH;;;AAGG;MACU,YAAY,CAAA;AACrB;;;AAGG;AACH,IAAA,SAAS,CAAC,KAAa,EAAA;AAC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AAGG,CAAA;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,64 @@
1
1
  import { AuthError } from "@azure/msal-common";
2
+ import * as BrowserAuthErrorCodes from "./BrowserAuthErrorCodes";
3
+ export { BrowserAuthErrorCodes };
2
4
  /**
3
5
  * BrowserAuthErrorMessage class containing string constants used by error codes and messages.
4
6
  */
7
+ export declare const BrowserAuthErrorMessages: {
8
+ pkce_not_created: string;
9
+ crypto_nonexistent: string;
10
+ empty_navigate_uri: string;
11
+ hash_empty_error: string;
12
+ no_state_in_hash: string;
13
+ hash_does_not_contain_known_properties: string;
14
+ unable_to_parse_state: string;
15
+ state_interaction_type_mismatch: string;
16
+ interaction_in_progress: string;
17
+ popup_window_error: string;
18
+ empty_window_error: string;
19
+ user_cancelled: string;
20
+ monitor_popup_timeout: string;
21
+ monitor_window_timeout: string;
22
+ redirect_in_iframe: string;
23
+ block_iframe_reload: string;
24
+ block_nested_popups: string;
25
+ iframe_closed_prematurely: string;
26
+ silent_logout_unsupported: string;
27
+ no_account_error: string;
28
+ silent_prompt_value_error: string;
29
+ no_token_request_cache_error: string;
30
+ unable_to_parse_token_request_cache_error: string;
31
+ no_cached_authority_error: string;
32
+ auth_request_not_set_error: string;
33
+ invalid_cache_type: string;
34
+ non_browser_environment: string;
35
+ database_not_open: string;
36
+ no_network_connectivity: string;
37
+ post_request_failed: string;
38
+ get_request_failed: string;
39
+ failed_to_parse_response: string;
40
+ unable_to_load_token: string;
41
+ crypto_key_not_found: string;
42
+ auth_code_required: string;
43
+ auth_code_or_nativeAccountId_required: string;
44
+ spa_code_and_nativeAccountId_present: string;
45
+ database_unavailable: string;
46
+ unable_to_acquire_token_from_native_platform: string;
47
+ native_handshake_timeout: string;
48
+ native_extension_not_installed: string;
49
+ native_connection_not_established: string;
50
+ uninitialized_public_client_application: string;
51
+ native_prompt_not_supported: string;
52
+ invalid_base64_string: string;
53
+ };
54
+ /**
55
+ * BrowserAuthErrorMessage class containing string constants used by error codes and messages.
56
+ * @deprecated Use exported BrowserAuthErrorCodes instead.
57
+ * In your app you can do :
58
+ * ```
59
+ * import { BrowserAuthErrorCodes } from "@azure/msal-browser";
60
+ * ```
61
+ */
5
62
  export declare const BrowserAuthErrorMessage: {
6
63
  pkceNotGenerated: {
7
64
  code: string;
@@ -11,10 +68,6 @@ export declare const BrowserAuthErrorMessage: {
11
68
  code: string;
12
69
  desc: string;
13
70
  };
14
- httpMethodNotImplementedError: {
15
- code: string;
16
- desc: string;
17
- };
18
71
  emptyNavigateUriError: {
19
72
  code: string;
20
73
  desc: string;
@@ -183,201 +236,16 @@ export declare const BrowserAuthErrorMessage: {
183
236
  code: string;
184
237
  desc: string;
185
238
  };
239
+ invalidBase64StringError: {
240
+ code: string;
241
+ desc: string;
242
+ };
186
243
  };
187
244
  /**
188
245
  * Browser library error class thrown by the MSAL.js library for SPAs
189
246
  */
190
247
  export declare class BrowserAuthError extends AuthError {
191
- constructor(errorCode: string, errorMessage?: string);
192
- /**
193
- * Creates an error thrown when PKCE is not implemented.
194
- * @param errDetail
195
- */
196
- static createPkceNotGeneratedError(errDetail: string): BrowserAuthError;
197
- /**
198
- * Creates an error thrown when the crypto object is unavailable.
199
- * @param errDetail
200
- */
201
- static createCryptoNotAvailableError(errDetail: string): BrowserAuthError;
202
- /**
203
- * Creates an error thrown when an HTTP method hasn't been implemented by the browser class.
204
- * @param method
205
- */
206
- static createHttpMethodNotImplementedError(method: string): BrowserAuthError;
207
- /**
208
- * Creates an error thrown when the navigation URI is empty.
209
- */
210
- static createEmptyNavigationUriError(): BrowserAuthError;
211
- /**
212
- * Creates an error thrown when the hash string value is unexpectedly empty.
213
- * @param hashValue
214
- */
215
- static createEmptyHashError(): BrowserAuthError;
216
- /**
217
- * Creates an error thrown when the hash string value is unexpectedly empty.
218
- */
219
- static createHashDoesNotContainStateError(): BrowserAuthError;
220
- /**
221
- * Creates an error thrown when the hash string value does not contain known properties
222
- */
223
- static createHashDoesNotContainKnownPropertiesError(): BrowserAuthError;
224
- /**
225
- * Creates an error thrown when the hash string value is unexpectedly empty.
226
- */
227
- static createUnableToParseStateError(): BrowserAuthError;
228
- /**
229
- * Creates an error thrown when the state value in the hash does not match the interaction type of the API attempting to consume it.
230
- */
231
- static createStateInteractionTypeMismatchError(): BrowserAuthError;
232
- /**
233
- * Creates an error thrown when a browser interaction (redirect or popup) is in progress.
234
- */
235
- static createInteractionInProgressError(): BrowserAuthError;
236
- /**
237
- * Creates an error thrown when the popup window could not be opened.
238
- * @param errDetail
239
- */
240
- static createPopupWindowError(errDetail?: string): BrowserAuthError;
241
- /**
242
- * Creates an error thrown when window.open returns an empty window object.
243
- * @param errDetail
244
- */
245
- static createEmptyWindowCreatedError(): BrowserAuthError;
246
- /**
247
- * Creates an error thrown when the user closes a popup.
248
- */
249
- static createUserCancelledError(): BrowserAuthError;
250
- /**
251
- * Creates an error thrown when monitorPopupFromHash times out for a given popup.
252
- */
253
- static createMonitorPopupTimeoutError(): BrowserAuthError;
254
- /**
255
- * Creates an error thrown when monitorIframeFromHash times out for a given iframe.
256
- */
257
- static createMonitorIframeTimeoutError(): BrowserAuthError;
258
- /**
259
- * Creates an error thrown when navigateWindow is called inside an iframe or brokered applications.
260
- * @param windowParentCheck
261
- */
262
- static createRedirectInIframeError(windowParentCheck: boolean): BrowserAuthError;
263
- /**
264
- * Creates an error thrown when an auth reload is done inside an iframe.
265
- */
266
- static createBlockReloadInHiddenIframeError(): BrowserAuthError;
267
- /**
268
- * Creates an error thrown when a popup attempts to call an acquireToken API
269
- * @returns
270
- */
271
- static createBlockAcquireTokenInPopupsError(): BrowserAuthError;
272
- /**
273
- * Creates an error thrown when an iframe is found to be closed before the timeout is reached.
274
- */
275
- static createIframeClosedPrematurelyError(): BrowserAuthError;
276
- /**
277
- * Creates an error thrown when the logout API is called on any of the silent interaction clients
278
- */
279
- static createSilentLogoutUnsupportedError(): BrowserAuthError;
280
- /**
281
- * Creates an error thrown when the account object is not provided in the acquireTokenSilent API.
282
- */
283
- static createNoAccountError(): BrowserAuthError;
284
- /**
285
- * Creates an error thrown when a given prompt value is invalid for silent requests.
286
- */
287
- static createSilentPromptValueError(givenPrompt: string): BrowserAuthError;
288
- /**
289
- * Creates an error thrown when the cached token request could not be retrieved from the cache
290
- */
291
- static createUnableToParseTokenRequestCacheError(): BrowserAuthError;
292
- /**
293
- * Creates an error thrown when the token request could not be retrieved from the cache
294
- */
295
- static createNoTokenRequestCacheError(): BrowserAuthError;
296
- /**
297
- * Creates an error thrown when handleCodeResponse is called before initiateAuthRequest (InteractionHandler)
298
- */
299
- static createAuthRequestNotSetError(): BrowserAuthError;
300
- /**
301
- * Creates an error thrown when the authority could not be retrieved from the cache
302
- */
303
- static createNoCachedAuthorityError(): BrowserAuthError;
304
- /**
305
- * Creates an error thrown if cache type is invalid.
306
- */
307
- static createInvalidCacheTypeError(): BrowserAuthError;
308
- /**
309
- * Create an error thrown when login and token requests are made from a non-browser environment
310
- */
311
- static createNonBrowserEnvironmentError(): BrowserAuthError;
312
- /**
313
- * Create an error thrown when indexDB database is not open
314
- */
315
- static createDatabaseNotOpenError(): BrowserAuthError;
316
- /**
317
- * Create an error thrown when token fetch fails due to no internet
318
- */
319
- static createNoNetworkConnectivityError(): BrowserAuthError;
320
- /**
321
- * Create an error thrown when token fetch fails due to reasons other than internet connectivity
322
- */
323
- static createPostRequestFailedError(errorDesc: string, endpoint: string): BrowserAuthError;
324
- /**
325
- * Create an error thrown when get request fails due to reasons other than internet connectivity
326
- */
327
- static createGetRequestFailedError(errorDesc: string, endpoint: string): BrowserAuthError;
328
- /**
329
- * Create an error thrown when network client fails to parse network response
330
- */
331
- static createFailedToParseNetworkResponseError(endpoint: string): BrowserAuthError;
332
- /**
333
- * Create an error thrown when the necessary information is not available to sideload tokens
334
- */
335
- static createUnableToLoadTokenError(errorDetail: string): BrowserAuthError;
336
- /**
337
- * Create an error thrown when the queried cryptographic key is not found in IndexedDB
338
- */
339
- static createSigningKeyNotFoundInStorageError(keyId: string): BrowserAuthError;
340
- /**
341
- * Create an error when an authorization code is required but not provided
342
- */
343
- static createAuthCodeRequiredError(): BrowserAuthError;
344
- /**
345
- * Create an error when an authorization code or native account ID is required but not provided
346
- */
347
- static createAuthCodeOrNativeAccountIdRequiredError(): BrowserAuthError;
348
- /**
349
- * Create an error when both authorization code and native account ID are provided
350
- */
351
- static createSpaCodeAndNativeAccountIdPresentError(): BrowserAuthError;
352
- /**
353
- * Create an error when IndexedDB is unavailable
354
- */
355
- static createDatabaseUnavailableError(): BrowserAuthError;
356
- /**
357
- * Create an error when native token acquisition is not possible
358
- */
359
- static createUnableToAcquireTokenFromNativePlatformError(): BrowserAuthError;
360
- /**
361
- * Create an error thrown when Handshake with browser extension times out
362
- */
363
- static createNativeHandshakeTimeoutError(): BrowserAuthError;
364
- /**
365
- * Create an error thrown when browser extension is not installed
366
- */
367
- static createNativeExtensionNotInstalledError(): BrowserAuthError;
368
- /**
369
- * Create an error when native connection has not been established
370
- * @returns
371
- */
372
- static createNativeConnectionNotEstablishedError(): BrowserAuthError;
373
- /**
374
- * Create an error thrown when the initialize function hasn't been called
375
- */
376
- static createUninitializedPublicClientApplication(): BrowserAuthError;
377
- /**
378
- * Create an error thrown when requesting a token directly from the native platform with an unsupported prompt parameter e.g. select_account, login or create
379
- * These requests must go through eSTS to ensure eSTS is aware of the new account
380
- */
381
- static createNativePromptParameterNotSupportedError(): BrowserAuthError;
248
+ constructor(errorCode: string);
382
249
  }
250
+ export declare function createBrowserAuthError(errorCode: string): BrowserAuthError;
383
251
  //# sourceMappingURL=BrowserAuthError.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BrowserAuthError.d.ts","sourceRoot":"","sources":["../../src/error/BrowserAuthError.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAe,MAAM,oBAAoB,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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