@braze/web-sdk 5.8.0 → 5.9.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 (140) hide show
  1. package/index.d.ts +14 -9
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +25 -25
  5. package/shared-lib/guid.js +3 -3
  6. package/shared-lib/indexed-db-adapter.js +18 -18
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +16 -16
  9. package/src/Banner/banner-provider.js +90 -87
  10. package/src/Banner/banner.js +9 -9
  11. package/src/Banner/display/banner-to-html.js +32 -27
  12. package/src/Banner/get-all-banners.js +11 -5
  13. package/src/Banner/get-banner.js +7 -4
  14. package/src/Banner/log-banner-click.js +4 -4
  15. package/src/Banner/log-banner-impressions.js +6 -6
  16. package/src/Banner/request-banners-refresh.js +6 -3
  17. package/src/Banner/subscribe-to-banners-updates.js +7 -7
  18. package/src/Banner/ui/insert-banner.js +2 -2
  19. package/src/Card/card-manager.js +39 -39
  20. package/src/Card/display/card-display.js +11 -11
  21. package/src/Card/log-card-click.js +2 -2
  22. package/src/Card/log-card-dismissal.js +2 -2
  23. package/src/Card/log-card-impressions.js +3 -3
  24. package/src/Card/models/captioned-image.js +21 -21
  25. package/src/Card/models/card.js +96 -96
  26. package/src/Card/models/classic-card.js +21 -21
  27. package/src/Card/models/control-card.js +11 -11
  28. package/src/Card/models/image-only.js +19 -19
  29. package/src/Card/util/card-factory.js +43 -43
  30. package/src/ContentCards/content-cards-provider.js +156 -154
  31. package/src/ContentCards/get-cached-content-cards.js +1 -1
  32. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  33. package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
  34. package/src/ContentCards/ui/show-content-cards.js +3 -3
  35. package/src/Core/change-user.js +1 -1
  36. package/src/Core/disable-sdk.js +8 -8
  37. package/src/Core/enable-sdk.js +6 -6
  38. package/src/Core/get-device-id.js +2 -2
  39. package/src/Core/handle-braze-action.js +2 -2
  40. package/src/Core/is-disabled.js +2 -2
  41. package/src/Core/is-initialized.js +1 -1
  42. package/src/Core/log-custom-event.js +5 -5
  43. package/src/Core/log-purchase.js +4 -4
  44. package/src/Core/open-session.js +8 -8
  45. package/src/Core/request-immediate-data-flush.js +1 -1
  46. package/src/Core/wipe-data.js +7 -5
  47. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  48. package/src/FeatureFlags/feature-flag.js +15 -15
  49. package/src/FeatureFlags/feature-flags-provider.js +69 -63
  50. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  51. package/src/FeatureFlags/get-feature-flag.js +2 -2
  52. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  53. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  54. package/src/Feed/feed-provider-factory.js +1 -1
  55. package/src/Feed/feed-provider.js +44 -44
  56. package/src/Feed/get-cached-feed.js +1 -1
  57. package/src/Feed/log-feed-displayed.js +1 -1
  58. package/src/Feed/request-feed-refresh.js +1 -1
  59. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  60. package/src/Feed/ui/show-feed.js +1 -1
  61. package/src/InAppMessage/defer-in-app-message.js +1 -1
  62. package/src/InAppMessage/display/html-message-to-html.js +10 -10
  63. package/src/InAppMessage/display/in-app-message-to-html.js +25 -25
  64. package/src/InAppMessage/display/modal-utils.js +8 -8
  65. package/src/InAppMessage/in-app-message-factory.js +7 -7
  66. package/src/InAppMessage/in-app-message-manager.js +92 -92
  67. package/src/InAppMessage/log-in-app-message-button-click.js +7 -7
  68. package/src/InAppMessage/log-in-app-message-click.js +5 -5
  69. package/src/InAppMessage/log-in-app-message-html-click.js +7 -7
  70. package/src/InAppMessage/log-in-app-message-impression.js +2 -2
  71. package/src/InAppMessage/models/control-message.js +5 -5
  72. package/src/InAppMessage/models/full-screen-message.js +34 -34
  73. package/src/InAppMessage/models/html-message.js +20 -20
  74. package/src/InAppMessage/models/in-app-message-button.js +8 -8
  75. package/src/InAppMessage/models/in-app-message.js +82 -82
  76. package/src/InAppMessage/models/modal-message.js +33 -33
  77. package/src/InAppMessage/models/slide-up-message.js +29 -29
  78. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  79. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  80. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  81. package/src/InAppMessage/ui/show-in-app-message.js +18 -18
  82. package/src/Push/push-manager-factory.js +1 -1
  83. package/src/Push/push-manager.js +94 -94
  84. package/src/Push/request-push-permission.js +1 -1
  85. package/src/Push/utils/push-utils.js +4 -4
  86. package/src/User/user-manager.js +20 -20
  87. package/src/User/user.js +38 -38
  88. package/src/common/base-feed.js +1 -1
  89. package/src/common/base-provider.js +1 -1
  90. package/src/common/constants.js +2 -0
  91. package/src/common/event-logger.js +7 -7
  92. package/src/common/feed-display.js +8 -8
  93. package/src/l10n/l10n-manager-factory.js +1 -1
  94. package/src/l10n/l10n-manager.js +1 -1
  95. package/src/managers/auth-manager.js +14 -14
  96. package/src/managers/braze-instance.js +134 -133
  97. package/src/managers/device-manager.js +25 -25
  98. package/src/managers/network-manager.js +167 -161
  99. package/src/managers/server-config-manager.js +104 -92
  100. package/src/managers/session-manager.js +29 -29
  101. package/src/managers/storage-manager-factory.js +12 -12
  102. package/src/managers/storage-manager.js +86 -86
  103. package/src/managers/subscription-manager.js +11 -11
  104. package/src/managers/utils.js +4 -4
  105. package/src/models/backend-errors.js +5 -5
  106. package/src/models/braze-event.js +9 -9
  107. package/src/models/device.js +2 -2
  108. package/src/models/identifier.js +4 -4
  109. package/src/models/push-token.js +8 -8
  110. package/src/models/request-result.js +4 -4
  111. package/src/models/server-config.js +37 -37
  112. package/src/request-controller.js +159 -158
  113. package/src/triggers/models/custom-event-data.js +2 -2
  114. package/src/triggers/models/custom-event-property-data.js +4 -4
  115. package/src/triggers/models/filter-set.js +6 -6
  116. package/src/triggers/models/filter.js +7 -7
  117. package/src/triggers/models/in-app-message-click-data.js +2 -2
  118. package/src/triggers/models/purchase-data.js +2 -2
  119. package/src/triggers/models/purchase-property-data.js +4 -4
  120. package/src/triggers/models/push-click-data.js +2 -2
  121. package/src/triggers/models/trigger-condition.js +36 -36
  122. package/src/triggers/models/trigger-events.js +3 -3
  123. package/src/triggers/models/trigger.js +14 -14
  124. package/src/triggers/triggers-provider-factory.js +3 -3
  125. package/src/triggers/triggers-provider.js +72 -72
  126. package/src/ui/js/attach-css.js +1 -1
  127. package/src/ui/js/load-font-awesome.js +1 -1
  128. package/src/util/base-device-parser.js +1 -1
  129. package/src/util/braze-actions.js +4 -4
  130. package/src/util/browser-detector.js +5 -5
  131. package/src/util/client-hints-parser.js +1 -1
  132. package/src/util/component-utils.js +2 -2
  133. package/src/util/dom-utils.js +4 -4
  134. package/src/util/html-display-utils.js +14 -14
  135. package/src/util/key-codes.js +1 -1
  136. package/src/util/net.js +7 -7
  137. package/src/util/request-header-utils.js +21 -21
  138. package/src/util/user-agent-parser.js +1 -1
  139. package/src/util/validation-utils.js +2 -2
  140. package/src/util/window-utils.js +2 -2
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Type definitions for @braze/web-sdk v5.8.0
2
+ * Type definitions for @braze/web-sdk v5.9.0
3
3
  * Project: https://github.com/braze-inc/braze-web-sdk
4
4
  * (c) Braze, Inc. 2025 - http://braze.com
5
5
  * License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
@@ -58,7 +58,8 @@ export class DeviceProperties {
58
58
 
59
59
  /**
60
60
  * Abstract base for news feed and Content Cards cards. Use subclasses `ClassicCard`, `CaptionedImage`,
61
- * `ImageOnly`, and `ControlCard`.
61
+ * `ImageOnly`, and `ControlCard`. For example, you can check `if (card instanceof ClassicCard)` to
62
+ * determine if the card is of the type `ClassicCard`.
62
63
  */
63
64
  export class Card {
64
65
  /**
@@ -517,7 +518,8 @@ type CropType =
517
518
 
518
519
  /**
519
520
  * Abstract base for in-app messages. Use subclasses `SlideUpMessage`,
520
- * `ModalMessage`, `FullScreenMessage`, and `HtmlMessage`.
521
+ * `ModalMessage`, `FullScreenMessage`, and `HtmlMessage`. For example, you can check `if (message instanceof FullScreenMessage)` to
522
+ * determine if the message is of the type `FullScreenMessage`.
521
523
  */
522
524
  export class InAppMessage {
523
525
  static SlideFrom: {
@@ -1446,7 +1448,7 @@ export class User {
1446
1448
  /**
1447
1449
  * Sets the LINE user ID for the user.
1448
1450
  *
1449
- * @param lineId - Must be a non-empty string no greater than 33 characters in length.
1451
+ * @param lineId - Must be a non-empty string no greater than 33 characters in length.
1450
1452
  * Accepts an explicit null value to null out attribute.
1451
1453
  *
1452
1454
  * @returns Whether the update was successfully enqueued.
@@ -2162,7 +2164,7 @@ export function openSession(): void;
2162
2164
  * - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
2163
2165
  *
2164
2166
  * ```
2165
- * self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.8/service-worker.js');
2167
+ * self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.9/service-worker.js');
2166
2168
  * ```
2167
2169
  *
2168
2170
  * For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
@@ -2402,8 +2404,8 @@ export function handleBrazeAction(
2402
2404
  * Gets a feature flag by its ID.
2403
2405
  *
2404
2406
  * @param id - The ID of the feature flag.
2405
- * @returns - An object of type `FeatureFlag`, if feature flag with given ID exists. The method returns null if feature flag does not exist,
2406
- * or if feature flags are disabled. Returns undefined if the SDK has not been initialized.
2407
+ * @returns - An object of type `FeatureFlag`, if feature flag with given ID is enabled or explicitly disabled via experiment or canvas.
2408
+ * The method returns `null` if feature flag is not rolled out to the user or does not exist, or returns `undefined` if the SDK has not been initialized.
2407
2409
  */
2408
2410
  export function getFeatureFlag(id: string): FeatureFlag | null | undefined;
2409
2411
 
@@ -2475,7 +2477,10 @@ export function getBanner(placementId: string): Banner | null | undefined;
2475
2477
  * @param banner - The `Banner` to insert onto the page.
2476
2478
  * @param parentNode - The HTML element to render the banner into.
2477
2479
  */
2478
- export function insertBanner(banner: Banner | null | undefined, parentNode: HTMLElement): void;
2480
+ export function insertBanner(
2481
+ banner: Banner | null | undefined,
2482
+ parentNode: HTMLElement,
2483
+ ): void;
2479
2484
 
2480
2485
  /**
2481
2486
  * Logs that the user clicked the given banner. This should generally be called through the Braze JavaScript bridge
@@ -2630,7 +2635,7 @@ export type InitializationOptions = {
2630
2635
  * lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
2631
2636
  * option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
2632
2637
  * `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
2633
- * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.8/service-worker.js');` or by including the content
2638
+ * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.9/service-worker.js');` or by including the content
2634
2639
  * of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
2635
2640
  */
2636
2641
  manageServiceWorkerExternally?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "5.8.0",
3
+ "version": "5.9.0",
4
4
  "description": "Braze SDK for web sites and other JS platforms.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  const ei = {
2
- Cn: function (t) {
2
+ qn: function (t) {
3
3
  const r = (t + "=".repeat((4 - (t.length % 4)) % 4))
4
4
  .replace(/\-/g, "+")
5
5
  .replace(/_/g, "/"),
@@ -1,36 +1,36 @@
1
1
  const d = {
2
2
  CustomEvent: "ce",
3
3
  Pr: "p",
4
- gc: "pc",
4
+ bc: "pc",
5
5
  Ac: "ca",
6
- zu: "i",
7
- Du: "ie",
8
- xt: "cci",
9
- $t: "ccic",
10
- lt: "ccc",
11
- dt: "ccd",
12
- Il: "ss",
6
+ Su: "i",
7
+ qu: "ie",
8
+ ts: "cci",
9
+ rs: "ccic",
10
+ Mt: "ccc",
11
+ Wt: "ccd",
12
+ Fl: "ss",
13
13
  Dl: "se",
14
- Ir: "si",
15
- Mr: "sc",
16
- Tr: "sbc",
14
+ Ki: "si",
15
+ Li: "sc",
16
+ Qi: "sbc",
17
17
  Mc: "sfe",
18
- qo: "iec",
19
- fc: "lr",
20
- mc: "uae",
21
- yt: "ci",
22
- ut: "cc",
23
- wc: "lcaa",
24
- bc: "lcar",
25
- Jn: "inc",
26
- Mn: "add",
27
- Yn: "rem",
28
- Hn: "set",
29
- Kn: "ncam",
30
- kc: "sgu",
18
+ Do: "iec",
19
+ vc: "lr",
20
+ fc: "uae",
21
+ ss: "ci",
22
+ Ot: "cc",
23
+ yc: "lcaa",
24
+ kc: "lcar",
25
+ Hn: "inc",
26
+ On: "add",
27
+ Gn: "rem",
28
+ $n: "set",
29
+ Bn: "ncam",
30
+ jc: "sgu",
31
31
  yr: "ffi",
32
32
  ro: "bi",
33
- ds: "bc",
33
+ ct: "bc",
34
34
  },
35
35
  dr = { Fr: "feed_displayed", Sc: "content_cards_displayed" };
36
36
  export { d as EventTypes, dr as InternalEventTypes };
@@ -1,5 +1,5 @@
1
- const G = {
2
- Rt: function () {
1
+ const K = {
2
+ ce: function () {
3
3
  const t = (t = !1) => {
4
4
  const n = (Math.random().toString(16) + "000000000").substr(2, 8);
5
5
  return t ? "-" + n.substr(0, 4) + "-" + n.substr(4, 4) : n;
@@ -7,4 +7,4 @@ const G = {
7
7
  return t() + t(!0) + t(!0) + t();
8
8
  },
9
9
  };
10
- export default G;
10
+ export default K;
@@ -1,4 +1,4 @@
1
- export default class tt {
1
+ export default class st {
2
2
  constructor(t, e) {
3
3
  (this.database = t),
4
4
  (this.vd = e),
@@ -64,11 +64,11 @@ export default class tt {
64
64
  "...",
65
65
  );
66
66
  const n = null === (e = t.target) || void 0 === e ? void 0 : e.result;
67
- for (const t in i.database.Ks) {
67
+ for (const t in i.database.Ms) {
68
68
  const e = t;
69
- i.database.Ks.hasOwnProperty(t) &&
70
- !n.objectStoreNames.contains(i.database.Ks[e]) &&
71
- n.createObjectStore(i.database.Ks[e]);
69
+ i.database.Ms.hasOwnProperty(t) &&
70
+ !n.objectStoreNames.contains(i.database.Ms[e]) &&
71
+ n.createObjectStore(i.database.Ms[e]);
72
72
  }
73
73
  }),
74
74
  (o.onsuccess = (n) => {
@@ -216,7 +216,7 @@ export default class tt {
216
216
  });
217
217
  }, n);
218
218
  }
219
- me(t, e) {
219
+ ge(t, e) {
220
220
  if (!this.isSupported()) return !1;
221
221
  const n = this;
222
222
  return this.Bd((o) => {
@@ -249,7 +249,7 @@ export default class tt {
249
249
  };
250
250
  });
251
251
  }
252
- Gs(t, e) {
252
+ Ns(t, e) {
253
253
  if (!this.isSupported()) return !1;
254
254
  const n = this;
255
255
  return this.Bd((o) => {
@@ -304,11 +304,11 @@ export default class tt {
304
304
  clearData() {
305
305
  if (!this.isSupported()) return !1;
306
306
  const t = [];
307
- for (const e in this.database.Ks) {
307
+ for (const e in this.database.Ms) {
308
308
  const n = e;
309
- this.database.Ks.hasOwnProperty(e) &&
310
- this.database.Ks[n] !== this.database.Ks.oe &&
311
- t.push(this.database.Ks[n]);
309
+ this.database.Ms.hasOwnProperty(e) &&
310
+ this.database.Ms[n] !== this.database.Ms.pe &&
311
+ t.push(this.database.Ms[n]);
312
312
  }
313
313
  const e = this;
314
314
  return this.Bd(function (n) {
@@ -333,20 +333,20 @@ export default class tt {
333
333
  });
334
334
  }
335
335
  }
336
- tt._s = {
337
- Xs: {
336
+ st.Ls = {
337
+ Fs: {
338
338
  Sd: "AppboyServiceWorkerAsyncStorage",
339
339
  VERSION: 6,
340
- Ks: {
341
- Su: "data",
340
+ Ms: {
341
+ Nu: "data",
342
342
  jr: "pushClicks",
343
343
  cu: "pushSubscribed",
344
344
  Cd: "fallbackDevice",
345
- Hs: "cardUpdates",
346
- oe: "optOut",
345
+ Js: "cardUpdates",
346
+ pe: "optOut",
347
347
  kr: "pendingData",
348
348
  yh: "sdkAuthenticationSignature",
349
349
  },
350
- te: 1,
350
+ be: 1,
351
351
  },
352
352
  };
@@ -24,13 +24,13 @@ const N = {
24
24
  },
25
25
  warn: function (n) {
26
26
  if (N.zg) {
27
- const o = "Braze SDK Warning: " + n + " (v5.8.0)";
27
+ const o = "Braze SDK Warning: " + n + " (v5.9.0)";
28
28
  null != N.vd ? N.vd(o) : console.warn(o);
29
29
  }
30
30
  },
31
31
  error: function (n) {
32
32
  if (N.zg) {
33
- const o = "Braze SDK Error: " + n + " (v5.8.0)";
33
+ const o = "Braze SDK Error: " + n + " (v5.9.0)";
34
34
  null != N.vd ? N.vd(o) : console.error(o);
35
35
  }
36
36
  },
@@ -1,28 +1,28 @@
1
1
  export default {
2
- Wo: "allowCrawlerActivity",
3
- Vo: "baseUrl",
4
- Ko: "noCookies",
5
- Yo: "devicePropertyAllowlist",
2
+ Yo: "allowCrawlerActivity",
3
+ Zo: "baseUrl",
4
+ Wh: "noCookies",
5
+ Vh: "devicePropertyAllowlist",
6
6
  Da: "disablePushTokenMaintenance",
7
- Xo: "enableLogging",
8
- Zo: "enableSdkAuthentication",
7
+ $h: "enableLogging",
8
+ Yh: "enableSdkAuthentication",
9
9
  Ca: "manageServiceWorkerExternally",
10
- Qo: "minimumIntervalBetweenTriggerActionsInSeconds",
11
- Wh: "sessionTimeoutInSeconds",
12
- Vh: "appVersion",
13
- $h: "appVersionNumber",
10
+ Xh: "minimumIntervalBetweenTriggerActionsInSeconds",
11
+ Zh: "sessionTimeoutInSeconds",
12
+ Qh: "appVersion",
13
+ Ea: "appVersionNumber",
14
14
  _a: "serviceWorkerLocation",
15
15
  Ba: "safariWebsitePushId",
16
- Ea: "localization",
16
+ Zn: "localization",
17
17
  er: "contentSecurityNonce",
18
18
  re: "allowUserSuppliedJavascript",
19
- To: "inAppMessageZIndex",
20
- Fo: "openInAppMessagesInNewTab",
19
+ Go: "inAppMessageZIndex",
20
+ Ko: "openInAppMessagesInNewTab",
21
21
  en: "openNewsFeedCardsInNewTab",
22
22
  mh: "requireExplicitInAppMessageDismissal",
23
- Yh: "doNotLoadFontAwesome",
24
- Xh: "deviceId",
23
+ Ia: "doNotLoadFontAwesome",
24
+ Na: "deviceId",
25
25
  Aa: "serviceWorkerScope",
26
- Zh: "sdkFlavor",
26
+ Oa: "sdkFlavor",
27
27
  tn: "openCardsInNewTab",
28
28
  };
@@ -1,5 +1,5 @@
1
- import s from "../common/base-provider.js";
2
- import { STORAGE_KEYS as t } from "../managers/storage-manager.js";
1
+ import t from "../common/base-provider.js";
2
+ import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
3
3
  import {
4
4
  newBannerFromJson as n,
5
5
  newBannerFromSerializedValue as o,
@@ -11,40 +11,40 @@ import u from "../managers/subscription-manager.js";
11
11
  import r from "../managers/braze-instance.js";
12
12
  import c from "../common/event-logger.js";
13
13
  import { EventTypes as d } from "../../shared-lib/event-types.js";
14
- export default class e extends s {
15
- constructor(s, t, i, e) {
14
+ export default class e extends t {
15
+ constructor(t, s, i, e) {
16
16
  super(),
17
- (this.B = s),
18
- (this.S = t),
17
+ (this.B = t),
18
+ (this.S = s),
19
19
  (this.C = i),
20
20
  (this.T = e),
21
21
  (this.banners = {}),
22
- (this.B = s),
23
- (this.S = t),
22
+ (this.B = t),
23
+ (this.S = s),
24
24
  (this.C = i),
25
25
  (this.T = e),
26
26
  (this.R = 10),
27
27
  (this.I = null),
28
28
  (this.q = null),
29
- (this.F = new u()),
30
- r.N(this.F),
31
- (this.k = null),
32
- (this.D = null);
29
+ (this.D = new u()),
30
+ r.F(this.D),
31
+ (this.N = null),
32
+ (this.k = null);
33
33
  }
34
- U(s) {
35
- if (this.L() && null != s && s.banners) {
34
+ U(t) {
35
+ if (this.L() && null != t && t.banners) {
36
36
  this.banners = {};
37
- const t = s.banners;
38
- for (const s in t) {
39
- const i = t[s];
37
+ const s = t.banners;
38
+ for (const t in s) {
39
+ const i = s[t];
40
40
  let e = null;
41
41
  null != i && null != i.banner && (e = n(i.banner)),
42
- e && (this.banners[s] = e);
42
+ e && (this.banners[t] = e);
43
43
  }
44
- this.M(), this.F.X(this.banners);
44
+ this.M(), this.D.X(this.banners);
45
45
  }
46
46
  }
47
- $(s, t, i, e = !0) {
47
+ $(t, s, i, e = !0) {
48
48
  var n;
49
49
  const r = () => {
50
50
  "function" == typeof i && i();
@@ -54,7 +54,7 @@ export default class e extends s {
54
54
  null === (n = this.B) ||
55
55
  void 0 === n ||
56
56
  n.A(() => {
57
- this.$(s, t, i);
57
+ this.$(t, s, i);
58
58
  })
59
59
  );
60
60
  const o = this.S;
@@ -62,7 +62,7 @@ export default class e extends s {
62
62
  e && this.G();
63
63
  const u = o.H({}, !0),
64
64
  c = [];
65
- for (const t of s) c.push({ id: t });
65
+ for (const s of t) c.push({ id: s });
66
66
  u.placements = c;
67
67
  const d = o.J(u, h.O.K);
68
68
  let m = !1;
@@ -78,27 +78,27 @@ export default class e extends s {
78
78
  url: `${n.Z()}/banners/sync`,
79
79
  headers: d,
80
80
  data: u,
81
- ss: (s) => {
82
- if (!n.ts(u, s, d)) return (m = !0), void r();
83
- n.es(), this.U(s), (m = !1), "function" == typeof t && t();
81
+ tt: (t) => {
82
+ if (!n.st(u, t, d)) return (m = !0), void r();
83
+ n.it(), this.U(t), (m = !1), "function" == typeof s && s();
84
84
  },
85
- error: (s) => {
86
- n.ns(s, "retrieving banners"), (m = !0), r();
85
+ error: (t) => {
86
+ n.et(t, "retrieving banners"), (m = !0), r();
87
87
  },
88
- rs: (e, r) => {
88
+ nt: (e, r) => {
89
89
  let o;
90
- if (((this.D = s), m)) {
91
- let s = this.I;
92
- (null == s || s < 1e3 * this.R) && (s = 1e3 * this.R),
93
- (o = Math.min(3e5, a(1e3 * this.R, 3 * s)));
90
+ if (((this.k = t), m)) {
91
+ let t = this.I;
92
+ (null == t || t < 1e3 * this.R) && (t = 1e3 * this.R),
93
+ (o = Math.min(3e5, a(1e3 * this.R, 3 * t)));
94
94
  }
95
- n.os(
95
+ n.rt(
96
96
  r,
97
97
  () => {
98
- this.$(s, t, i, !1);
98
+ this.$(t, s, i, !1);
99
99
  },
100
100
  h.O.K,
101
- (s) => this.hs(s),
101
+ (t) => this.ot(t),
102
102
  () => this.G(),
103
103
  o,
104
104
  );
@@ -109,93 +109,96 @@ export default class e extends s {
109
109
  i,
110
110
  );
111
111
  }
112
- ls() {
113
- return this.D;
112
+ ht() {
113
+ return this.k;
114
114
  }
115
- us(s, t) {
116
- const i = { id: s.id };
117
- t && (i.bid = t);
118
- return c.cs(d.ds, i).ss;
115
+ lt(t, s) {
116
+ const i = { id: t.id };
117
+ s && (i.bid = s);
118
+ return c.ut(d.ct, i).tt;
119
119
  }
120
120
  G() {
121
121
  null != this.q && (clearTimeout(this.q), (this.q = null));
122
122
  }
123
- hs(s) {
124
- this.G(), (this.q = s);
123
+ ot(t) {
124
+ this.G(), (this.q = t);
125
125
  }
126
- fs() {
127
- let s = {};
128
- this.C && (s = this.C.vs(t.gs.ps));
126
+ dt() {
127
+ let t = {};
128
+ this.C && (t = this.C.ft(s.gt.vt));
129
129
  const i = {};
130
- for (const t in s) {
130
+ for (const s in t) {
131
131
  let e = null;
132
- null != s[t] && (e = o(s[t])), e && (i[e.placementId] = e);
132
+ null != t[s] && (e = o(t[s])), e && (i[e.placementId] = e);
133
133
  }
134
134
  return i;
135
135
  }
136
136
  M() {
137
- var s;
137
+ var t;
138
138
  if (!this.C) return;
139
139
  const i = {};
140
- for (const t in this.banners) {
140
+ for (const s in this.banners) {
141
141
  const e =
142
- (null === (s = this.banners[t]) || void 0 === s ? void 0 : s.bs()) ||
142
+ (null === (t = this.banners[s]) || void 0 === t ? void 0 : t.bt()) ||
143
143
  null;
144
- i[t] = e;
144
+ i[s] = e;
145
145
  }
146
- this.C.Bs(t.gs.ps, i), this.js();
146
+ this.C.Bt(s.gt.vt, i), this.jt();
147
147
  }
148
- js() {
149
- var s, i;
150
- null === (s = this.C) ||
151
- void 0 === s ||
152
- s.Bs(t.gs.ys, null === (i = this.T) || void 0 === i ? void 0 : i.Ss());
148
+ jt() {
149
+ var t, i;
150
+ null === (t = this.C) ||
151
+ void 0 === t ||
152
+ t.Bt(s.gt.yt, null === (i = this.T) || void 0 === i ? void 0 : i.St());
153
153
  }
154
- ws() {
155
- var s;
154
+ wt() {
155
+ var t;
156
156
  return (
157
- (null === (s = this.C) || void 0 === s ? void 0 : s.vs(t.gs.ys)) || null
157
+ (null === (t = this.C) || void 0 === t ? void 0 : t.ft(s.gt.yt)) || null
158
158
  );
159
159
  }
160
- Cs() {
161
- return this.k;
160
+ Ct() {
161
+ return this.N;
162
162
  }
163
- Ts(s) {
164
- this.k = s;
163
+ Tt(t) {
164
+ this.N = t;
165
165
  }
166
- Rs() {
167
- var s;
168
- const t = null === (s = this.T) || void 0 === s ? void 0 : s.Ss(),
169
- i = this.ws();
170
- return null != i && t === i;
166
+ Rt() {
167
+ var t;
168
+ const s = null === (t = this.T) || void 0 === t ? void 0 : t.St(),
169
+ i = this.wt();
170
+ return null != i && s === i;
171
171
  }
172
- Is() {
173
- var s;
174
- const t = null === (s = this.T) || void 0 === s ? void 0 : s.Ss(),
175
- i = this.ws();
176
- return null == i || t === i;
172
+ It() {
173
+ var t;
174
+ const s = null === (t = this.T) || void 0 === t ? void 0 : t.St(),
175
+ i = this.wt();
176
+ return null == i || s === i;
177
177
  }
178
- qs(s) {
179
- return this.F.Fs(s);
178
+ qt(t) {
179
+ return this.D.Dt(t);
180
180
  }
181
- Ns() {
182
- var s;
181
+ Ft() {
182
+ var t;
183
183
  return (
184
- (null === (s = this.C) || void 0 === s ? void 0 : s.vs(t.gs.ks)) || {}
184
+ (null === (t = this.C) || void 0 === t ? void 0 : t.ft(s.gt.Nt)) || {}
185
185
  );
186
186
  }
187
- xs(s) {
188
- this.C && this.C.Bs(t.gs.ks, s);
187
+ kt(t) {
188
+ this.C && this.C.Bt(s.gt.Nt, t);
189
189
  }
190
190
  changeUser() {
191
- this.zs();
191
+ this.xt(), this.G();
192
+ }
193
+ clearData() {
194
+ this.G();
192
195
  }
193
196
  L() {
194
- return !!this.B && (!!this.B.Ds() || (0 !== this.B.Us() && this.zs(), !1));
197
+ return !!this.B && (!!this.B.zt() || (0 !== this.B.Et() && this.xt(), !1));
195
198
  }
196
- zs() {
199
+ xt() {
197
200
  (this.banners = {}),
198
- this.C && (this.C.Es(t.gs.ps), this.C.Es(t.gs.ks)),
199
- this.F.X({});
201
+ this.C && (this.C.Ut(s.gt.vt), this.C.Ut(s.gt.Nt)),
202
+ this.D.X({});
200
203
  }
201
204
  }
@@ -3,28 +3,28 @@ export default class Banner {
3
3
  (this.id = t),
4
4
  (this.placementId = i),
5
5
  (this.html = s),
6
- (this.tt = h),
6
+ (this.At = h),
7
7
  (this.isControl = r),
8
- (this.it = e),
8
+ (this.Gt = e),
9
9
  (this.id = t),
10
10
  (this.placementId = i),
11
11
  (this.html = s),
12
- (this.tt = h),
12
+ (this.At = h),
13
13
  (this.isControl = r),
14
- (this.it = e),
15
- (this.st = !1);
14
+ (this.Gt = e),
15
+ (this.Ht = !1);
16
16
  }
17
- ht() {
17
+ Jt() {
18
18
  return this.isControl;
19
19
  }
20
- bs() {
20
+ bt() {
21
21
  return {
22
22
  id: this.id,
23
23
  o: this.placementId,
24
24
  html: this.html,
25
- t: this.tt,
25
+ t: this.At,
26
26
  i: this.isControl,
27
- u: this.it,
27
+ u: this.Gt,
28
28
  };
29
29
  }
30
30
  }