@braze/web-sdk 6.0.0 → 6.1.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 (147) hide show
  1. package/index.d.ts +103 -33
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +22 -22
  5. package/shared-lib/guid.js +3 -3
  6. package/shared-lib/indexed-db-adapter.js +19 -19
  7. package/shared-lib/logger.js +18 -18
  8. package/shared-lib/supported-options.js +15 -15
  9. package/src/Banner/banner-factory.js +2 -1
  10. package/src/Banner/banner-provider-factory.js +7 -7
  11. package/src/Banner/banner-provider.js +92 -98
  12. package/src/Banner/banner.js +21 -18
  13. package/src/Banner/display/banner-to-html.js +9 -9
  14. package/src/Banner/display/destroy-banner-html.js +2 -2
  15. package/src/Banner/display/detect-banner-impressions.js +2 -2
  16. package/src/Banner/get-all-banners.js +5 -5
  17. package/src/Banner/get-banner.js +7 -7
  18. package/src/Banner/log-banner-click.js +7 -7
  19. package/src/Banner/log-banner-impressions.js +9 -9
  20. package/src/Banner/request-banners-refresh.js +16 -20
  21. package/src/Banner/subscribe-to-banners-updates.js +7 -7
  22. package/src/Banner/ui/insert-banner.js +6 -6
  23. package/src/Card/card-manager-factory.js +7 -7
  24. package/src/Card/card-manager.js +35 -35
  25. package/src/Card/display/card-display.js +11 -11
  26. package/src/Card/log-card-dismissal.js +4 -4
  27. package/src/Card/log-content-card-click.js +4 -4
  28. package/src/Card/log-content-card-impressions.js +6 -6
  29. package/src/Card/models/captioned-image.js +21 -21
  30. package/src/Card/models/card.js +68 -68
  31. package/src/Card/models/classic-card.js +21 -21
  32. package/src/Card/models/control-card.js +11 -11
  33. package/src/Card/models/image-only.js +18 -18
  34. package/src/Card/util/card-factory.js +35 -35
  35. package/src/ContentCards/content-cards-provider-factory.js +13 -13
  36. package/src/ContentCards/content-cards-provider.js +136 -136
  37. package/src/ContentCards/get-cached-content-cards.js +2 -2
  38. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  39. package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
  40. package/src/ContentCards/ui/show-content-cards.js +7 -7
  41. package/src/Core/add-sdk-metadata.js +3 -3
  42. package/src/Core/change-user.js +7 -7
  43. package/src/Core/destroy.js +2 -2
  44. package/src/Core/disable-sdk.js +8 -8
  45. package/src/Core/enable-sdk.js +6 -6
  46. package/src/Core/get-device-id.js +4 -4
  47. package/src/Core/handle-braze-action.js +5 -5
  48. package/src/Core/is-disabled.js +1 -1
  49. package/src/Core/log-custom-event.js +10 -10
  50. package/src/Core/log-purchase.js +13 -13
  51. package/src/Core/open-session.js +10 -10
  52. package/src/Core/set-logger.js +2 -2
  53. package/src/Core/set-sdk-authentication-signature.js +2 -2
  54. package/src/Core/toggle-logging.js +2 -2
  55. package/src/Core/wipe-data.js +7 -7
  56. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  57. package/src/FeatureFlags/feature-flag.js +20 -71
  58. package/src/FeatureFlags/feature-flags-provider-factory.js +12 -12
  59. package/src/FeatureFlags/feature-flags-provider.js +87 -87
  60. package/src/FeatureFlags/get-all-feature-flags.js +4 -4
  61. package/src/FeatureFlags/get-feature-flag.js +4 -4
  62. package/src/FeatureFlags/log-feature-flag-impression.js +9 -9
  63. package/src/FeatureFlags/refresh-feature-flags.js +2 -2
  64. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -4
  65. package/src/InAppMessage/defer-in-app-message.js +4 -4
  66. package/src/InAppMessage/display/html-message-to-html.js +10 -10
  67. package/src/InAppMessage/display/in-app-message-to-html.js +28 -28
  68. package/src/InAppMessage/display/modal-utils.js +7 -7
  69. package/src/InAppMessage/in-app-message-factory.js +15 -15
  70. package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
  71. package/src/InAppMessage/in-app-message-manager.js +100 -100
  72. package/src/InAppMessage/log-in-app-message-button-click.js +9 -9
  73. package/src/InAppMessage/log-in-app-message-click.js +6 -6
  74. package/src/InAppMessage/log-in-app-message-html-click.js +9 -9
  75. package/src/InAppMessage/log-in-app-message-impression.js +4 -4
  76. package/src/InAppMessage/models/control-message.js +4 -4
  77. package/src/InAppMessage/models/full-screen-message.js +35 -35
  78. package/src/InAppMessage/models/html-message.js +21 -21
  79. package/src/InAppMessage/models/in-app-message-button.js +5 -5
  80. package/src/InAppMessage/models/in-app-message.js +75 -75
  81. package/src/InAppMessage/models/modal-message.js +34 -34
  82. package/src/InAppMessage/models/slide-up-message.js +31 -31
  83. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  84. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  85. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  86. package/src/InAppMessage/ui/show-in-app-message.js +19 -19
  87. package/src/Push/push-manager-factory.js +9 -9
  88. package/src/Push/push-manager.js +118 -118
  89. package/src/Push/utils/push-utils.js +9 -9
  90. package/src/User/user-manager.js +20 -20
  91. package/src/User/user.js +44 -45
  92. package/src/common/base-provider.js +1 -1
  93. package/src/common/content-cards-display.js +18 -18
  94. package/src/common/event-logger.js +10 -10
  95. package/src/common/properties-base.js +56 -0
  96. package/src/l10n/l10n-manager-factory.js +7 -7
  97. package/src/l10n/l10n-manager.js +4 -4
  98. package/src/managers/auth-manager.js +32 -32
  99. package/src/managers/braze-instance.js +143 -143
  100. package/src/managers/device-manager.js +22 -22
  101. package/src/managers/network-manager.js +172 -168
  102. package/src/managers/server-config-manager.js +73 -73
  103. package/src/managers/session-manager.js +40 -40
  104. package/src/managers/storage-manager-factory.js +6 -6
  105. package/src/managers/storage-manager.js +97 -97
  106. package/src/managers/subscription-manager.js +12 -12
  107. package/src/managers/utils.js +1 -1
  108. package/src/models/backend-errors.js +5 -5
  109. package/src/models/braze-event.js +5 -5
  110. package/src/models/device.js +2 -2
  111. package/src/models/identifier.js +12 -12
  112. package/src/models/push-token.js +13 -13
  113. package/src/models/request-result.js +4 -4
  114. package/src/models/server-config.js +31 -31
  115. package/src/request-controller.js +159 -159
  116. package/src/triggers/models/custom-event-data.js +1 -1
  117. package/src/triggers/models/custom-event-property-data.js +2 -2
  118. package/src/triggers/models/filter-set.js +6 -6
  119. package/src/triggers/models/filter.js +26 -26
  120. package/src/triggers/models/in-app-message-click-data.js +1 -1
  121. package/src/triggers/models/purchase-data.js +1 -1
  122. package/src/triggers/models/purchase-property-data.js +2 -2
  123. package/src/triggers/models/push-click-data.js +1 -1
  124. package/src/triggers/models/trigger-condition.js +37 -37
  125. package/src/triggers/models/trigger-events.js +3 -3
  126. package/src/triggers/models/trigger.js +16 -16
  127. package/src/triggers/triggers-provider-factory.js +12 -12
  128. package/src/triggers/triggers-provider.js +61 -61
  129. package/src/ui/js/attach-css.js +1 -1
  130. package/src/ui/js/load-font-awesome.js +1 -1
  131. package/src/util/base-device-parser.js +1 -1
  132. package/src/util/braze-actions.js +6 -6
  133. package/src/util/browser-detector.js +20 -13
  134. package/src/util/client-hints-parser.js +6 -6
  135. package/src/util/code-utils.js +2 -2
  136. package/src/util/component-utils.js +1 -1
  137. package/src/util/deprecation-utils.js +2 -2
  138. package/src/util/device-constants.js +4 -4
  139. package/src/util/dom-utils.js +9 -9
  140. package/src/util/html-display-utils.js +7 -7
  141. package/src/util/key-codes.js +1 -1
  142. package/src/util/net.js +12 -12
  143. package/src/util/request-header-utils.js +22 -22
  144. package/src/util/string-utils.js +2 -2
  145. package/src/util/user-agent-parser.js +16 -16
  146. package/src/util/validation-utils.js +12 -12
  147. package/src/util/window-utils.js +2 -2
@@ -2,28 +2,28 @@ import Card from "./card.js";
2
2
  export default class ImageOnly extends Card {
3
3
  constructor(s, t, i, h, l, r, e, n, o, u, a, c, d) {
4
4
  super(s, t, null, i, null, h, l, r, null, e, n, o, u, a, c, d),
5
- (this.ae = "ab-image-only"),
6
- (this.oe = !1),
5
+ (this.Xt = "ab-image-only"),
6
+ (this.Yt = !1),
7
7
  (this.test = !1);
8
8
  }
9
- bt() {
9
+ dt() {
10
10
  const s = {};
11
11
  return (
12
- (s[Card.hs.ss] = Card.rs.Ii),
13
- (s[Card.hs.os] = this.id),
14
- (s[Card.hs.cs] = this.viewed),
15
- (s[Card.hs.ds] = this.imageUrl),
16
- (s[Card.hs.us] = this.updated),
17
- (s[Card.hs.ls] = this.expiresAt),
18
- (s[Card.hs.URL] = this.url),
19
- (s[Card.hs.xs] = this.aspectRatio),
20
- (s[Card.hs.bs] = this.extras),
21
- (s[Card.hs.gs] = this.pinned),
22
- (s[Card.hs.js] = this.dismissible),
23
- (s[Card.hs.zs] = this.clicked),
24
- (s[Card.hs.ks] = this.language),
25
- (s[Card.hs.qs] = this.altImageText),
26
- (s[Card.hs.vs] = this.test),
12
+ (s[Card.ss.ts] = Card.es.Ii),
13
+ (s[Card.ss.rs] = this.id),
14
+ (s[Card.ss.os] = this.viewed),
15
+ (s[Card.ss.ns] = this.imageUrl),
16
+ (s[Card.ss.ps] = this.updated),
17
+ (s[Card.ss.us] = this.expiresAt),
18
+ (s[Card.ss.URL] = this.url),
19
+ (s[Card.ss.fs] = this.aspectRatio),
20
+ (s[Card.ss.xs] = this.extras),
21
+ (s[Card.ss.bs] = this.pinned),
22
+ (s[Card.ss.gs] = this.dismissible),
23
+ (s[Card.ss.js] = this.clicked),
24
+ (s[Card.ss.zs] = this.language),
25
+ (s[Card.ss.ks] = this.altImageText),
26
+ (s[Card.ss.qs] = this.test),
27
27
  s
28
28
  );
29
29
  }
@@ -7,35 +7,35 @@ import {
7
7
  } from "../index.js";
8
8
  import {
9
9
  dateFromUnixTimestamp as V,
10
- rehydrateDateAfterJsonization as Q,
10
+ rehydrateDateAfterJsonization as Y,
11
11
  } from "../../util/date-utils.js";
12
- import { logger as N } from "../../../shared-lib/index.js";
12
+ import { logger as E } from "../../../shared-lib/index.js";
13
13
  export function newCard(e, n, r, t, i, o, l, u, d, a, f, s, w, m, p, C, c, x) {
14
14
  let j;
15
- if (n === Card.rs.oi || n === Card.rs.ai)
15
+ if (n === Card.es.oi || n === Card.es.ai)
16
16
  j = new ClassicCard(e, r, t, i, o, l, u, d, a, f, s, w, m, p, c, x);
17
- else if (n === Card.rs.es)
17
+ else if (n === Card.es.hs)
18
18
  j = new CaptionedImage(e, r, t, i, o, l, u, d, a, f, s, w, m, p, c, x);
19
- else if (n === Card.rs.Ii)
19
+ else if (n === Card.es.Ii)
20
20
  j = new ImageOnly(e, r, i, l, u, d, f, s, w, m, p, c, x);
21
21
  else {
22
- if (n !== Card.rs.Ni)
23
- return N.error("Ignoring card with unknown type " + n), null;
22
+ if (n !== Card.es.Ni)
23
+ return E.error("Ignoring card with unknown type " + n), null;
24
24
  j = new ControlCard(e, r, l, u, s, w);
25
25
  }
26
26
  return C && (j.test = C), j;
27
27
  }
28
28
  export function newCardFromContentCardsJson(e) {
29
29
  if (e[Card.ui.Ei]) return null;
30
- const n = e[Card.ui.os],
31
- r = e[Card.ui.ss],
32
- t = e[Card.ui.cs],
33
- i = e[Card.ui.ns],
34
- o = e[Card.ui.ds],
35
- l = e[Card.ui.ps],
36
- u = V(e[Card.ui.us]);
30
+ const n = e[Card.ui.rs],
31
+ r = e[Card.ui.ts],
32
+ t = e[Card.ui.os],
33
+ i = e[Card.ui.cs],
34
+ o = e[Card.ui.ns],
35
+ l = e[Card.ui.ds],
36
+ u = V(e[Card.ui.ps]);
37
37
  let d;
38
- d = e[Card.ui.ls] === Card.Ti ? null : V(e[Card.ui.ls]);
38
+ d = e[Card.ui.us] === Card.Ti ? null : V(e[Card.ui.us]);
39
39
  return newCard(
40
40
  n,
41
41
  r,
@@ -46,38 +46,38 @@ export function newCardFromContentCardsJson(e) {
46
46
  u,
47
47
  d,
48
48
  e[Card.ui.URL],
49
+ e[Card.ui.ls],
49
50
  e[Card.ui.fs],
50
51
  e[Card.ui.xs],
51
52
  e[Card.ui.bs],
52
53
  e[Card.ui.gs],
53
54
  e[Card.ui.js],
55
+ e[Card.ui.qs] || !1,
54
56
  e[Card.ui.zs],
55
- e[Card.ui.vs] || !1,
56
57
  e[Card.ui.ks],
57
- e[Card.ui.qs],
58
58
  );
59
59
  }
60
60
  export function newCardFromSerializedValue(e) {
61
61
  return (
62
62
  newCard(
63
- e[Card.hs.os],
64
- e[Card.hs.ss],
65
- e[Card.hs.cs],
66
- e[Card.hs.ns],
67
- e[Card.hs.ds],
68
- e[Card.hs.ps],
69
- Q(e[Card.hs.us]),
70
- Q(e[Card.hs.ls]),
71
- e[Card.hs.URL],
72
- e[Card.hs.fs],
73
- e[Card.hs.xs],
74
- e[Card.hs.bs],
75
- e[Card.hs.gs],
76
- e[Card.hs.js],
77
- e[Card.hs.zs],
78
- e[Card.hs.vs] || !1,
79
- e[Card.hs.ks],
80
- e[Card.hs.qs],
63
+ e[Card.ss.rs],
64
+ e[Card.ss.ts],
65
+ e[Card.ss.os],
66
+ e[Card.ss.cs],
67
+ e[Card.ss.ns],
68
+ e[Card.ss.ds],
69
+ Y(e[Card.ss.ps]),
70
+ Y(e[Card.ss.us]),
71
+ e[Card.ss.URL],
72
+ e[Card.ss.ls],
73
+ e[Card.ss.fs],
74
+ e[Card.ss.xs],
75
+ e[Card.ss.bs],
76
+ e[Card.ss.gs],
77
+ e[Card.ss.js],
78
+ e[Card.ss.qs] || !1,
79
+ e[Card.ss.zs],
80
+ e[Card.ss.ks],
81
81
  ) || void 0
82
82
  );
83
83
  }
@@ -1,20 +1,20 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import Y from "./content-cards-provider.js";
3
- const Z = {
4
- l: !1,
2
+ import Z from "./content-cards-provider.js";
3
+ const rr = {
4
+ i: !1,
5
5
  provider: null,
6
- m: () => (
7
- Z.p(),
8
- Z.provider ||
9
- ((Z.provider = new Y(r.ir(), r.j(), r.v(), r.tr(), r.g())),
10
- r._(Z.provider)),
11
- Z.provider
6
+ o: () => (
7
+ rr.t(),
8
+ rr.provider ||
9
+ ((rr.provider = new Z(r.ir(), r.p(), r.l(), r.tr(), r.m())),
10
+ r.v(rr.provider)),
11
+ rr.provider
12
12
  ),
13
- p: () => {
14
- Z.l || (r.h(Z), (Z.l = !0));
13
+ t: () => {
14
+ rr.i || (r.g(rr), (rr.i = !0));
15
15
  },
16
16
  destroy: () => {
17
- (Z.provider = null), (Z.l = !1);
17
+ (rr.provider = null), (rr.i = !1);
18
18
  },
19
19
  };
20
- export default Z;
20
+ export default rr;
@@ -1,4 +1,4 @@
1
- import l from "../util/net.js";
1
+ import a from "../util/net.js";
2
2
  import t from "../common/base-provider.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import ContentCards from "./content-cards.js";
@@ -11,62 +11,62 @@ import {
11
11
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
12
12
  import u from "../managers/subscription-manager.js";
13
13
  import h from "../util/request-header-utils.js";
14
- import { randomInclusive as a } from "../util/math.js";
15
- import { logger as N, IndexedDBAdapter as et } from "../../shared-lib/index.js";
16
- export default class Y extends t {
14
+ import { randomInclusive as l } from "../util/math.js";
15
+ import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
16
+ export default class Z extends t {
17
17
  constructor(t, s, i, e, h) {
18
18
  super(),
19
19
  (this.Cs = t),
20
- (this.C = s),
21
- (this.B = i),
22
- (this.ws = e),
23
- (this.S = h),
20
+ (this.j = s),
21
+ (this.h = i),
22
+ (this.vs = e),
23
+ (this.B = h),
24
24
  (this.Cs = t),
25
- (this.C = s),
26
- (this.B = i),
27
- (this.ws = e),
28
- (this.S = h),
29
- (this.ys = new u()),
30
- r.F(this.ys),
25
+ (this.j = s),
26
+ (this.h = i),
27
+ (this.vs = e),
28
+ (this.B = h),
29
+ (this.ws = new u()),
30
+ r.q(this.ws),
31
+ (this.ys = 0),
31
32
  (this.Ss = 0),
32
- (this.Ts = 0),
33
33
  (this.cards = []),
34
- this.Rs();
35
- const n = et.Ds.Us;
36
- new et(n, N).As(n.Ls.Fs, (t) => {
37
- this.Ns(t);
34
+ this.Ts();
35
+ const n = et.Us.Rs;
36
+ new et(n, E).Ds(n.Fs.As, (t) => {
37
+ this.Ls(t);
38
38
  }),
39
+ (this.Ns = null),
40
+ (this.D = null),
39
41
  (this.Js = null),
40
- (this.N = null),
41
42
  (this.Ms = null),
42
- (this.$s = null),
43
- (this.Bs = 10);
43
+ (this.$s = 10);
44
44
  }
45
- Es() {
46
- return this.Js;
45
+ Bs() {
46
+ return this.Ns;
47
47
  }
48
- Ps(t) {
49
- this.Js = t;
48
+ Es(t) {
49
+ this.Ns = t;
50
50
  }
51
- Ct() {
52
- return this.N;
51
+ jt() {
52
+ return this.D;
53
53
  }
54
- Tt(t) {
55
- this.N = t;
54
+ yt(t) {
55
+ this.D = t;
56
56
  }
57
- Rs() {
58
- if (!this.C) return;
59
- const t = this.C.ft(s.gt.Xs) || [],
57
+ Ts() {
58
+ if (!this.j) return;
59
+ const t = this.j.lt(s.ct.Ps) || [],
60
60
  i = [];
61
61
  for (let s = 0; s < t.length; s++) {
62
62
  const e = it(t[s]);
63
63
  null != e && i.push(e);
64
64
  }
65
- (this.cards = this._s(this.Gs(i, !1))),
66
- (this.Ss = this.C.ft(s.gt.Hs) || this.Ss),
67
- (this.Ts = this.C.ft(s.gt.Is) || this.Ts);
65
+ (this.cards = this.Xs(this._s(i, !1))),
66
+ (this.ys = this.j.lt(s.ct.Gs) || this.ys),
67
+ (this.Ss = this.j.lt(s.ct.Hs) || this.Ss);
68
68
  }
69
- Ks(t, i = !1, e = 0, h = 0) {
69
+ Is(t, i = !1, e = 0, h = 0) {
70
70
  let r;
71
71
  if (i) {
72
72
  r = [];
@@ -95,28 +95,28 @@ export default class Y extends t {
95
95
  }
96
96
  }
97
97
  }
98
- (this.cards = this._s(this.Gs(r, i))),
99
- this.Os(),
100
- (this.Ss = e),
101
- (this.Ts = h),
102
- this.C && (this.C.Bt(s.gt.Hs, this.Ss), this.C.Bt(s.gt.Is, this.Ts));
98
+ (this.cards = this.Xs(this._s(r, i))),
99
+ this.Ks(),
100
+ (this.ys = e),
101
+ (this.Ss = h),
102
+ this.j && (this.j.ft(s.ct.Gs, this.ys), this.j.ft(s.ct.Hs, this.Ss));
103
103
  }
104
- U(t) {
105
- if (this.Qs() && null != t && t.cards) {
106
- this.C && this.C.Bt(s.gt.Vs, r.Ws());
104
+ N(t) {
105
+ if (this.Os() && null != t && t.cards) {
106
+ this.j && this.j.ft(s.ct.Qs, r.Vs());
107
107
  const i = t.full_sync;
108
- i || this.Rs(),
109
- this.Ks(t.cards, i, t.last_full_sync_at, t.last_card_updated_at),
110
- this.ys.X(this.Ys(!0));
108
+ i || this.Ts(),
109
+ this.Is(t.cards, i, t.last_full_sync_at, t.last_card_updated_at),
110
+ this.ws.L(this.Ws(!0));
111
111
  }
112
112
  }
113
- Zs(t) {
114
- this.fi(), (this.Ms = t);
113
+ Ys(t) {
114
+ this.Zs(), (this.Js = t);
115
115
  }
116
- Ns(t) {
116
+ Ls(t) {
117
117
  var s;
118
- if (!this.Qs()) return;
119
- this.Rs();
118
+ if (!this.Os()) return;
119
+ this.Ts();
120
120
  const i = this.cards.slice();
121
121
  let e = null;
122
122
  e = null === (s = this.Cs) || void 0 === s ? void 0 : s.getUserId();
@@ -141,16 +141,16 @@ export default class Y extends t {
141
141
  }
142
142
  }
143
143
  }
144
- (this.cards = this._s(this.Gs(i, !1))), this.Os(), this.ys.X(this.Ys(!0));
144
+ (this.cards = this.Xs(this._s(i, !1))), this.Ks(), this.ws.L(this.Ws(!0));
145
145
  }
146
- Gs(t, i) {
146
+ _s(t, i) {
147
147
  let e = {},
148
148
  h = {},
149
149
  r = {};
150
- this.C &&
151
- ((e = this.C.ft(s.gt.Kt) || {}),
152
- (h = this.C.ft(s.gt.Xt) || {}),
153
- (r = this.C.ft(s.gt.Qt) || {}));
150
+ this.j &&
151
+ ((e = this.j.lt(s.ct.Et) || {}),
152
+ (h = this.j.lt(s.ct.Pt) || {}),
153
+ (r = this.j.lt(s.ct.Lt) || {}));
154
154
  const n = {},
155
155
  o = {},
156
156
  l = {};
@@ -163,21 +163,21 @@ export default class Y extends t {
163
163
  }
164
164
  return (
165
165
  i &&
166
- this.C &&
167
- (this.C.Bt(s.gt.Kt, n), this.C.Bt(s.gt.Xt, o), this.C.Bt(s.gt.Qt, l)),
166
+ this.j &&
167
+ (this.j.ft(s.ct.Et, n), this.j.ft(s.ct.Pt, o), this.j.ft(s.ct.Lt, l)),
168
168
  t
169
169
  );
170
170
  }
171
- _s(t) {
171
+ Xs(t) {
172
172
  const i = [],
173
173
  e = new Date();
174
174
  let h = {};
175
- this.C && (h = this.C.ft(s.gt.Qt) || {});
175
+ this.j && (h = this.j.lt(s.ct.Lt) || {});
176
176
  let r = !1;
177
177
  for (let s = 0; s < t.length; s++) {
178
178
  const n = t[s].url;
179
- if (!this.ws && n && tt(n)) {
180
- N.error(
179
+ if (!this.vs && n && tt(n)) {
180
+ E.error(
181
181
  `Card with url ${n} will not be displayed because Javascript URLs are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable this card.`,
182
182
  );
183
183
  continue;
@@ -191,85 +191,85 @@ export default class Y extends t {
191
191
  i && (h[i] = !0), (r = !0);
192
192
  }
193
193
  }
194
- return r && this.C && this.C.Bt(s.gt.Qt, h), i;
194
+ return r && this.j && this.j.ft(s.ct.Lt, h), i;
195
195
  }
196
- Os() {
196
+ Ks() {
197
197
  var t;
198
198
  const i = [];
199
- for (let t = 0; t < this.cards.length; t++) i.push(this.cards[t].bt());
200
- null === (t = this.C) || void 0 === t || t.Bt(s.gt.Xs, i);
199
+ for (let t = 0; t < this.cards.length; t++) i.push(this.cards[t].dt());
200
+ null === (t = this.j) || void 0 === t || t.ft(s.ct.Ps, i);
201
201
  }
202
- fi() {
203
- this.Ms && (clearTimeout(this.Ms), (this.Ms = null));
202
+ Zs() {
203
+ this.Js && (clearTimeout(this.Js), (this.Js = null));
204
204
  }
205
- Ci(t, i, e = !1) {
205
+ fi(t, i, e = !1) {
206
206
  var n;
207
- const o = this.S,
208
- u = this.C;
207
+ const o = this.B,
208
+ u = this.j;
209
209
  if (!o || !u) return void ("function" == typeof i && i());
210
- if ((e && (h.bi(u, h.O.vi), this.fi()), !this.Qs()))
210
+ if ((e && (h.Ci(u, h.H.bi), this.Zs()), !this.Os()))
211
211
  return void (
212
- null === (n = this.B) ||
212
+ null === (n = this.h) ||
213
213
  void 0 === n ||
214
- n.wi(() => {
215
- this.Ci(t, i, !0);
214
+ n.vi(() => {
215
+ this.fi(t, i, !0);
216
216
  })
217
217
  );
218
- const c = o.H({}, !0);
219
- u.ft(s.gt.Vs) !== r.Ws() && this.gi(),
220
- (c.last_full_sync_at = this.Ss),
221
- (c.last_card_updated_at = this.Ts);
222
- const f = o.J(c, h.O.vi, e);
218
+ const c = o.$({}, !0);
219
+ u.lt(s.ct.Qs) !== r.Vs() && this.wi(),
220
+ (c.last_full_sync_at = this.ys),
221
+ (c.last_card_updated_at = this.Ss);
222
+ const f = o.A(c, h.H.bi, e);
223
223
  let d = !1;
224
- o.V(
224
+ o.J(
225
225
  c,
226
226
  (s = -1) => {
227
- if (this.C) {
227
+ if (this.j) {
228
228
  const t = new Date().valueOf();
229
- h.W(this.C, h.O.vi, t);
229
+ h.K(this.j, h.H.bi, t);
230
230
  }
231
231
  -1 !== s && f.push(["X-Braze-Req-Tokens-Remaining", s.toString()]),
232
- l.Y({
233
- url: `${o.Z()}/content_cards/sync`,
232
+ a.O({
233
+ url: `${o.V()}/content_cards/sync`,
234
234
  data: c,
235
235
  headers: f,
236
- tt: (s) => {
237
- if (!o.st(c, s, f))
236
+ W: (s) => {
237
+ if (!o.Y(c, s, f))
238
238
  return (d = !0), void ("function" == typeof i && i());
239
- o.it(), this.U(s), (d = !1), "function" == typeof t && t();
239
+ o.Z(), this.N(s), (d = !1), "function" == typeof t && t();
240
240
  },
241
241
  error: (t) => {
242
- o.et(t, "retrieving content cards"),
242
+ o._(t, "retrieving content cards"),
243
243
  (d = !0),
244
244
  "function" == typeof i && i();
245
245
  },
246
- nt: (s, e) => {
246
+ tt: (s, e) => {
247
247
  let r;
248
248
  if (d) {
249
- let t = this.$s;
250
- (null == t || t < 1e3 * this.Bs) && (t = 1e3 * this.Bs),
251
- (r = Math.min(3e5, a(1e3 * this.Bs, 3 * t)));
249
+ let t = this.Ms;
250
+ (null == t || t < 1e3 * this.$s) && (t = 1e3 * this.$s),
251
+ (r = Math.min(3e5, l(1e3 * this.$s, 3 * t)));
252
252
  }
253
- o.rt(
253
+ o.st(
254
254
  e,
255
255
  () => {
256
- this.Ci(t, i, !1);
256
+ this.fi(t, i, !1);
257
257
  },
258
- h.O.vi,
259
- (t) => this.Zs(t),
260
- () => this.fi(),
258
+ h.H.bi,
259
+ (t) => this.Ys(t),
260
+ () => this.Zs(),
261
261
  r,
262
262
  );
263
263
  },
264
264
  });
265
265
  },
266
- h.O.vi,
266
+ h.H.bi,
267
267
  i,
268
268
  );
269
269
  }
270
- Ys(t) {
271
- t || this.Rs();
272
- const i = this._s(this.cards);
270
+ Ws(t) {
271
+ t || this.Ts();
272
+ const i = this.Xs(this.cards);
273
273
  i.sort((t, s) =>
274
274
  t.pinned && !s.pinned
275
275
  ? -1
@@ -281,52 +281,52 @@ export default class Y extends t {
281
281
  ? 1
282
282
  : 0,
283
283
  );
284
- let e = Math.max(this.Ts || 0, this.Ss || 0);
284
+ let e = Math.max(this.Ss || 0, this.ys || 0);
285
285
  return (
286
286
  0 === e && (e = void 0),
287
- this.C && this.C.ft(s.gt.Is) === this.Ts && void 0 === e && (e = this.Ts),
287
+ this.j && this.j.lt(s.ct.Hs) === this.Ss && void 0 === e && (e = this.Ss),
288
288
  new ContentCards(i, V(e))
289
289
  );
290
290
  }
291
- qt(t) {
292
- return this.ys.Dt(t);
291
+ St(t) {
292
+ return this.ws.wt(t);
293
293
  }
294
- gi() {
295
- (this.Ss = 0),
296
- (this.Ts = 0),
297
- this.C && (this.C.Ut(s.gt.Hs), this.C.Ut(s.gt.Is));
294
+ wi() {
295
+ (this.ys = 0),
296
+ (this.Ss = 0),
297
+ this.j && (this.j.Nt(s.ct.Gs), this.j.Nt(s.ct.Hs));
298
298
  }
299
299
  changeUser(t) {
300
300
  t ||
301
301
  ((this.cards = []),
302
- this.ys.X(new ContentCards(this.cards.slice(), null)),
303
- this.C &&
304
- (this.C.Ut(s.gt.Xs),
305
- this.C.Ut(s.gt.Kt),
306
- this.C.Ut(s.gt.Xt),
307
- this.C.Ut(s.gt.Qt))),
308
- this.fi(),
309
- this.gi();
302
+ this.ws.L(new ContentCards(this.cards.slice(), null)),
303
+ this.j &&
304
+ (this.j.Nt(s.ct.Ps),
305
+ this.j.Nt(s.ct.Et),
306
+ this.j.Nt(s.ct.Pt),
307
+ this.j.Nt(s.ct.Lt))),
308
+ this.Zs(),
309
+ this.wi();
310
310
  }
311
311
  clearData(t) {
312
- (this.Ss = 0),
313
- (this.Ts = 0),
312
+ (this.ys = 0),
313
+ (this.Ss = 0),
314
314
  (this.cards = []),
315
- this.ys.X(new ContentCards(this.cards.slice(), null)),
315
+ this.ws.L(new ContentCards(this.cards.slice(), null)),
316
316
  t &&
317
- this.C &&
318
- (this.C.Ut(s.gt.Xs),
319
- this.C.Ut(s.gt.Kt),
320
- this.C.Ut(s.gt.Xt),
321
- this.C.Ut(s.gt.Qt),
322
- this.C.Ut(s.gt.Hs),
323
- this.C.Ut(s.gt.Is)),
324
- this.fi();
317
+ this.j &&
318
+ (this.j.Nt(s.ct.Ps),
319
+ this.j.Nt(s.ct.Et),
320
+ this.j.Nt(s.ct.Pt),
321
+ this.j.Nt(s.ct.Lt),
322
+ this.j.Nt(s.ct.Gs),
323
+ this.j.Nt(s.ct.Hs)),
324
+ this.Zs();
325
325
  }
326
- Qs() {
327
- return !!this.B && (!!this.B.ji() || (0 !== this.B.Et() && this.yi(), !1));
326
+ Os() {
327
+ return !!this.h && (!!this.h.gi() || (0 !== this.h.Ft() && this.ji(), !1));
328
328
  }
329
- yi() {
330
- this.ys.X(new ContentCards([], new Date())), this.C && this.C.Ut(s.gt.Xs);
329
+ ji() {
330
+ this.ws.L(new ContentCards([], new Date())), this.j && this.j.Nt(s.ct.Ps);
331
331
  }
332
332
  }
@@ -1,5 +1,5 @@
1
- import Z from "./content-cards-provider-factory.js";
1
+ import rr from "./content-cards-provider-factory.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  export function getCachedContentCards() {
4
- if (r.rr()) return Z.m().Ys(!1);
4
+ if (r.rr()) return rr.o().Ws(!1);
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import Z from "./content-cards-provider-factory.js";
2
+ import rr from "./content-cards-provider-factory.js";
3
3
  export function requestContentCardsRefresh(e, t) {
4
- if (r.rr()) return Z.m().Ci(e, t, !0);
4
+ if (r.rr()) return rr.o().fi(e, t, !0);
5
5
  }
@@ -1,16 +1,16 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import Z from "./content-cards-provider-factory.js";
2
+ import rr from "./content-cards-provider-factory.js";
3
3
  export function subscribeToContentCardsUpdates(o) {
4
4
  if (!r.rr()) return;
5
- const t = Z.m(),
6
- n = t.qt(o);
7
- if (!t.Ct()) {
5
+ const t = rr.o(),
6
+ n = t.St(o);
7
+ if (!t.jt()) {
8
8
  const o = r.nn();
9
9
  if (o) {
10
10
  const r = o.rn(() => {
11
- t.Ci(void 0, void 0, !0);
11
+ t.fi(void 0, void 0, !0);
12
12
  });
13
- r && t.Tt(r);
13
+ r && t.yt(r);
14
14
  }
15
15
  }
16
16
  return n;