@braze/web-sdk 6.3.1 → 6.5.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 (159) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +38 -5
  3. package/package.json +1 -1
  4. package/shared-lib/encoding-utils.js +3 -3
  5. package/shared-lib/event-types.js +30 -30
  6. package/shared-lib/guid.js +1 -1
  7. package/shared-lib/indexed-db-adapter.js +60 -60
  8. package/shared-lib/logger.js +7 -7
  9. package/shared-lib/supported-options.js +24 -23
  10. package/src/Banner/banner-provider.js +95 -81
  11. package/src/Banner/banner.js +9 -9
  12. package/src/Banner/constants.js +4 -0
  13. package/src/Banner/display/banner-to-html.js +3 -3
  14. package/src/Banner/display/destroy-banner-html.js +3 -3
  15. package/src/Banner/display/detect-banner-impressions.js +16 -16
  16. package/src/Banner/get-all-banners.js +4 -4
  17. package/src/Banner/get-banner.js +5 -4
  18. package/src/Banner/index.js +2 -0
  19. package/src/Banner/log-banner-click.js +2 -2
  20. package/src/Banner/log-banner-impressions.js +6 -6
  21. package/src/Banner/request-banners-refresh.js +18 -20
  22. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  23. package/src/Banner/ui/insert-banner.js +17 -14
  24. package/src/Card/card-manager-factory.js +6 -6
  25. package/src/Card/card-manager.js +28 -28
  26. package/src/Card/constants.js +1 -0
  27. package/src/Card/display/card-display.js +7 -7
  28. package/src/Card/log-card-dismissal.js +3 -3
  29. package/src/Card/log-content-card-click.js +3 -3
  30. package/src/Card/log-content-card-impressions.js +6 -6
  31. package/src/Card/models/captioned-image.js +3 -3
  32. package/src/Card/models/card.js +9 -9
  33. package/src/Card/models/classic-card.js +3 -3
  34. package/src/Card/models/control-card.js +3 -3
  35. package/src/Card/models/image-only.js +3 -3
  36. package/src/ContentCards/content-cards-provider-factory.js +6 -2
  37. package/src/ContentCards/content-cards-provider.js +101 -87
  38. package/src/ContentCards/content-cards.js +4 -4
  39. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  40. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  41. package/src/ContentCards/ui/show-content-cards.js +5 -5
  42. package/src/Core/add-sdk-metadata.js +2 -2
  43. package/src/Core/change-user.js +1 -1
  44. package/src/Core/disable-sdk.js +5 -5
  45. package/src/Core/enable-sdk.js +3 -3
  46. package/src/Core/get-device-id.js +2 -2
  47. package/src/Core/get-user.js +1 -1
  48. package/src/Core/handle-braze-action.js +3 -3
  49. package/src/Core/is-disabled.js +1 -1
  50. package/src/Core/log-custom-event.js +7 -7
  51. package/src/Core/log-purchase.js +4 -4
  52. package/src/Core/open-session.js +6 -6
  53. package/src/Core/wipe-data.js +3 -3
  54. package/src/DUST/dust-connection-core.js +23 -0
  55. package/src/DUST/dust-provider-factory.js +22 -0
  56. package/src/DUST/dust-provider.js +520 -0
  57. package/src/DUST/dust-shared-worker-code.js +2 -0
  58. package/src/DUST/dust-shared-worker-impl.js +240 -0
  59. package/src/DUST/dust-worker-bridge.js +136 -0
  60. package/src/DUST/index.js +13 -0
  61. package/src/DUST/subscribe-to-dust.js +24 -0
  62. package/src/DUST/types.js +1 -0
  63. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  64. package/src/FeatureFlags/feature-flag.js +6 -6
  65. package/src/FeatureFlags/feature-flags-provider-factory.js +9 -9
  66. package/src/FeatureFlags/feature-flags-provider.js +98 -84
  67. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  68. package/src/FeatureFlags/get-feature-flag.js +3 -3
  69. package/src/FeatureFlags/log-feature-flag-impression.js +7 -7
  70. package/src/FeatureFlags/refresh-feature-flags.js +5 -5
  71. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -4
  72. package/src/InAppMessage/constants.js +4 -0
  73. package/src/InAppMessage/defer-in-app-message.js +2 -2
  74. package/src/InAppMessage/display/get-animation-effect.js +1 -1
  75. package/src/InAppMessage/display/html-message-to-html.js +6 -6
  76. package/src/InAppMessage/display/in-app-message-to-html.js +34 -34
  77. package/src/InAppMessage/display/modal-utils.js +14 -14
  78. package/src/InAppMessage/get-deferred-in-app-message.js +2 -2
  79. package/src/InAppMessage/in-app-message-factory.js +4 -4
  80. package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
  81. package/src/InAppMessage/in-app-message-manager.js +98 -98
  82. package/src/InAppMessage/log-in-app-message-button-click.js +12 -12
  83. package/src/InAppMessage/log-in-app-message-click.js +11 -11
  84. package/src/InAppMessage/log-in-app-message-html-click.js +9 -9
  85. package/src/InAppMessage/log-in-app-message-impression.js +8 -8
  86. package/src/InAppMessage/models/control-message.js +5 -5
  87. package/src/InAppMessage/models/full-screen-message.js +21 -21
  88. package/src/InAppMessage/models/html-message.js +18 -18
  89. package/src/InAppMessage/models/in-app-message-button.js +7 -7
  90. package/src/InAppMessage/models/in-app-message.js +145 -145
  91. package/src/InAppMessage/models/modal-message.js +21 -21
  92. package/src/InAppMessage/models/slide-up-message.js +27 -27
  93. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  94. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  95. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
  96. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +18 -0
  97. package/src/InAppMessage/ui/show-in-app-message.js +36 -36
  98. package/src/Push/is-push-blocked.js +2 -2
  99. package/src/Push/is-push-permission-granted.js +2 -2
  100. package/src/Push/is-push-supported.js +2 -2
  101. package/src/Push/push-manager-factory.js +15 -15
  102. package/src/Push/push-manager.js +97 -97
  103. package/src/Push/request-push-permission.js +1 -1
  104. package/src/Push/unregister-push.js +1 -1
  105. package/src/Push/utils/push-utils.js +17 -17
  106. package/src/User/user-manager.js +24 -24
  107. package/src/User/user.js +55 -55
  108. package/src/common/constants.js +8 -10
  109. package/src/common/content-cards-display.js +40 -40
  110. package/src/common/event-logger.js +8 -8
  111. package/src/common/properties-base.js +16 -16
  112. package/src/l10n/l10n-manager-factory.js +11 -11
  113. package/src/l10n/l10n-manager.js +2 -2
  114. package/src/managers/auth-manager.js +30 -30
  115. package/src/managers/braze-instance.js +170 -162
  116. package/src/managers/device-manager.js +24 -24
  117. package/src/managers/network-manager.js +149 -149
  118. package/src/managers/server-config-manager.js +140 -95
  119. package/src/managers/session-manager.js +39 -39
  120. package/src/managers/storage-manager-factory.js +10 -10
  121. package/src/managers/storage-manager.js +145 -141
  122. package/src/managers/subscription-manager.js +11 -11
  123. package/src/managers/utils.js +1 -1
  124. package/src/models/backend-errors.js +5 -5
  125. package/src/models/braze-event.js +11 -11
  126. package/src/models/device.js +3 -3
  127. package/src/models/identifier.js +16 -16
  128. package/src/models/push-token.js +13 -13
  129. package/src/models/request-result.js +3 -3
  130. package/src/models/server-config.js +45 -37
  131. package/src/request-controller.js +163 -158
  132. package/src/triggers/models/custom-event-data.js +5 -5
  133. package/src/triggers/models/custom-event-property-data.js +6 -6
  134. package/src/triggers/models/filter-set.js +10 -10
  135. package/src/triggers/models/filter.js +27 -27
  136. package/src/triggers/models/in-app-message-click-data.js +13 -13
  137. package/src/triggers/models/purchase-data.js +2 -2
  138. package/src/triggers/models/purchase-property-data.js +6 -6
  139. package/src/triggers/models/push-click-data.js +6 -6
  140. package/src/triggers/models/trigger-condition.js +47 -47
  141. package/src/triggers/models/trigger-events.js +3 -3
  142. package/src/triggers/models/trigger.js +36 -36
  143. package/src/triggers/triggers-provider-factory.js +5 -5
  144. package/src/triggers/triggers-provider.js +63 -63
  145. package/src/ui/js/attach-css.js +3 -3
  146. package/src/ui/js/load-font-awesome.js +2 -2
  147. package/src/util/base-device-parser.js +9 -9
  148. package/src/util/braze-actions.js +5 -5
  149. package/src/util/browser-detector.js +37 -37
  150. package/src/util/client-hints-parser.js +11 -11
  151. package/src/util/component-utils.js +5 -5
  152. package/src/util/dom-utils.js +13 -13
  153. package/src/util/html-display-utils.js +7 -7
  154. package/src/util/key-codes.js +1 -1
  155. package/src/util/net.js +5 -5
  156. package/src/util/request-header-utils.js +27 -27
  157. package/src/util/user-agent-parser.js +21 -21
  158. package/src/util/validation-utils.js +17 -17
  159. package/src/util/window-utils.js +3 -3
@@ -1,11 +1,11 @@
1
1
  import InAppMessage from "../models/in-app-message.js";
2
2
  import { _handleBrazeAction as O } from "../../Core/handle-braze-action.js";
3
3
  import { logInAppMessageButtonClick } from "../log-in-app-message-button-click.js";
4
- import { toRgba as ae } from "../../util/color-utils.js";
5
- import { addPassiveEventListener as J } from "../../util/dom-utils.js";
6
- import { KeyCodes as ie } from "../../util/key-codes.js";
7
- const ne = {
8
- wo: (t) => {
4
+ import { toRgba as ke } from "../../util/color-utils.js";
5
+ import { addPassiveEventListener as S } from "../../util/dom-utils.js";
6
+ import { KeyCodes as Ce } from "../../util/key-codes.js";
7
+ const xe = {
8
+ Qo: (t) => {
9
9
  const o = t.querySelectorAll(".ab-close-button, .ab-message-button");
10
10
  let e;
11
11
  for (let t = 0; t < o.length; t++) (e = o[t]), (e.tabIndex = 0);
@@ -14,7 +14,7 @@ const ne = {
14
14
  s = o[o.length - 1];
15
15
  t.addEventListener("keydown", (o) => {
16
16
  const a = document.activeElement;
17
- o.keyCode === ie.yo &&
17
+ o.keyCode === Ce.Wo &&
18
18
  (o.shiftKey || (a !== s && a !== t)
19
19
  ? !o.shiftKey ||
20
20
  (a !== e && a !== t) ||
@@ -23,14 +23,14 @@ const ne = {
23
23
  });
24
24
  }
25
25
  },
26
- vo: (t, o) => {
26
+ So: (t, o) => {
27
27
  o.setAttribute("role", "dialog"),
28
28
  o.setAttribute("aria-modal", "true"),
29
29
  t
30
30
  ? o.setAttribute("aria-labelledby", t)
31
31
  : o.setAttribute("aria-label", "Modal Message");
32
32
  },
33
- jo: (t, o, e) => {
33
+ Po: (t, o, e) => {
34
34
  if (t.buttons && t.buttons.length > 0) {
35
35
  const s = document.createElement("div");
36
36
  (s.className = "ab-message-buttons"), o.appendChild(s);
@@ -54,18 +54,18 @@ const ne = {
54
54
  a = document.createElement("button");
55
55
  (a.className = "ab-message-button"),
56
56
  a.setAttribute("type", "button"),
57
- J(a, "touchstart");
57
+ S(a, "touchstart");
58
58
  let n = e.text;
59
59
  "" === e.text && (n = " "),
60
60
  a.appendChild(document.createTextNode(n)),
61
- t.Oe() ||
62
- ((a.style.backgroundColor = ae(e.backgroundColor)),
63
- (a.style.color = ae(e.textColor)),
64
- (a.style.borderColor = ae(e.borderColor))),
61
+ t.Mo() ||
62
+ ((a.style.backgroundColor = ke(e.backgroundColor)),
63
+ (a.style.color = ke(e.textColor)),
64
+ (a.style.borderColor = ke(e.borderColor))),
65
65
  (a.onclick = l(e)),
66
66
  s.appendChild(a);
67
67
  }
68
68
  }
69
69
  },
70
70
  };
71
- export default ne;
71
+ export default xe;
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import se from "./in-app-message-manager-factory.js";
2
+ import je from "./in-app-message-manager-factory.js";
3
3
  export function getDeferredInAppMessage() {
4
- if (r.rr()) return se.ea().zr();
4
+ if (r.rr()) return je.ra().sa();
5
5
  }
@@ -49,7 +49,7 @@ export function newInAppMessageFromJson(e) {
49
49
  C = e.language,
50
50
  D = e.image_alt;
51
51
  let G;
52
- if (o === ModalMessage.es || o === InAppMessage.Ke.Io)
52
+ if (o === ModalMessage.es || o === InAppMessage.Eo.Xo)
53
53
  G = new ModalMessage(
54
54
  s,
55
55
  n,
@@ -146,8 +146,8 @@ export function newInAppMessageFromJson(e) {
146
146
  else {
147
147
  if (
148
148
  o !== HtmlMessage.es &&
149
- o !== InAppMessage.Ke.Je &&
150
- o !== InAppMessage.Ke.Ao
149
+ o !== InAppMessage.Eo.Bo &&
150
+ o !== InAppMessage.Eo.Yo
151
151
  )
152
152
  return void E.error("Ignoring message with unknown type " + o);
153
153
  {
@@ -156,7 +156,7 @@ export function newInAppMessageFromJson(e) {
156
156
  (G.trusted = e.trusted || !1);
157
157
  }
158
158
  }
159
- return (G.He = o), G;
159
+ return (G.ko = o), G;
160
160
  }
161
161
  export function buttonsFromSerializedInAppMessage(e) {
162
162
  const o = [];
@@ -1,16 +1,16 @@
1
1
  import ea from "./in-app-message-manager.js";
2
2
  import r from "../managers/braze-instance.js";
3
- const se = {
4
- aa: null,
3
+ const je = {
4
+ na: null,
5
5
  i: !1,
6
- ea: () => (
7
- se.t(), se.aa || (se.aa = new ea(r.m(), r.u(), r.p(), r.ir())), se.aa
6
+ ra: () => (
7
+ je.t(), je.na || (je.na = new ea(r.m(), r.u(), r.p(), r.ir())), je.na
8
8
  ),
9
9
  t: () => {
10
- se.i || (r.g(se), (se.i = !0));
10
+ je.i || (r.g(je), (je.i = !0));
11
11
  },
12
12
  destroy: () => {
13
- (se.aa = null), (se.i = !1);
13
+ (je.na = null), (je.i = !1);
14
14
  },
15
15
  };
16
- export default se;
16
+ export default je;
@@ -1,70 +1,70 @@
1
- import a from "../util/net.js";
1
+ import l from "../util/net.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  import ControlMessage from "./models/control-message.js";
4
4
  import HtmlMessage from "./models/html-message.js";
5
5
  import InAppMessage from "./models/in-app-message.js";
6
6
  import InAppMessageButton from "./models/in-app-message-button.js";
7
- import c from "../common/event-logger.js";
7
+ import v from "../common/event-logger.js";
8
8
  import { newInAppMessageFromJson as ut } from "./in-app-message-factory.js";
9
- import { randomInclusive as l } from "../util/math.js";
9
+ import { randomInclusive as a } from "../util/math.js";
10
10
  import H from "../models/request-result.js";
11
- import { logger as E, EventTypes as m } from "../../shared-lib/index.js";
12
- import u from "../managers/subscription-manager.js";
11
+ import { logger as E, EventTypes as f } from "../../shared-lib/index.js";
12
+ import m from "../managers/subscription-manager.js";
13
13
  import pt from "../triggers/models/trigger.js";
14
14
  import { BRAZE_ACTION_URI_REGEX as to } from "../util/validation-utils.js";
15
15
  import {
16
16
  containsPushPrimerBrazeAction as ft,
17
- containsUnknownBrazeAction as dt,
17
+ containsUnknownBrazeAction as gt,
18
18
  getDecodedBrazeAction as eo,
19
- ineligibleBrazeActionURLErrorMessage as jt,
20
- INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as vt,
19
+ ineligibleBrazeActionURLErrorMessage as dt,
20
+ INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as jt,
21
21
  } from "../util/braze-actions.js";
22
- import yt from "../Push/utils/push-utils.js";
22
+ import vt from "../Push/utils/push-utils.js";
23
23
  import h from "../util/request-header-utils.js";
24
24
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
25
25
  import { FullScreenMessage, ModalMessage, SlideUpMessage } from "./index.js";
26
26
  export default class ea {
27
27
  constructor(t, e, s, i) {
28
- (this.B = t),
28
+ (this.j = t),
29
29
  (this.C = e),
30
- (this.j = s),
31
- (this.Cs = i),
32
- (this.B = t),
30
+ (this.B = s),
31
+ (this.vs = i),
32
+ (this.j = t),
33
33
  (this.C = e),
34
- (this.j = s),
35
- (this.Cs = i),
36
- (this.yi = new u()),
37
- r.q(this.yi),
38
- (this.Mi = 1e3),
39
- (this.ki = 6e4),
40
- (this.zi = null),
41
- (this.Bi = null),
42
- (this.Ri = null);
34
+ (this.B = s),
35
+ (this.vs = i),
36
+ (this.jn = new m()),
37
+ r.q(this.jn),
38
+ (this.vn = 1e3),
39
+ (this.yn = 6e4),
40
+ (this.bn = null),
41
+ (this.In = null),
42
+ (this.Mn = null);
43
43
  }
44
- _i() {
45
- return this.yi;
44
+ An() {
45
+ return this.jn;
46
46
  }
47
- qi(t) {
48
- return this.yi.wt(t);
47
+ Tn(t) {
48
+ return this.jn.Rt(t);
49
49
  }
50
- xi() {
51
- return this.zi;
50
+ kn() {
51
+ return this.bn;
52
52
  }
53
- Pi(t) {
54
- this.zi = t;
53
+ Dn(t) {
54
+ this.bn = t;
55
55
  }
56
- rt(t, e, s, i) {
56
+ lt(t, e, s, i) {
57
57
  const r = new H();
58
58
  let n;
59
- if (e === m.Gi || t instanceof ControlMessage) {
60
- if (!t.Qt())
59
+ if (e === f.wn || t instanceof ControlMessage) {
60
+ if (!t.Wt())
61
61
  return (
62
62
  E.info(
63
63
  "This in-app message has already received an impression. Ignoring analytics event.",
64
64
  ),
65
65
  r
66
66
  );
67
- } else if (e === m.$i || (t instanceof HtmlMessage && e === m.Fi)) {
67
+ } else if (e === f.zn || (t instanceof HtmlMessage && e === f.Sn)) {
68
68
  if (!t.$t(i))
69
69
  return (
70
70
  E.info(
@@ -77,15 +77,15 @@ export default class ea {
77
77
  (n =
78
78
  t instanceof ControlMessage
79
79
  ? { trigger_ids: [t.triggerId] }
80
- : this.Oi(t)),
80
+ : this.Bn(t)),
81
81
  null == n
82
82
  ? r
83
83
  : (t.messageExtras && (n.message_extras = t.messageExtras),
84
84
  null != s && (n.bid = s),
85
- c.rt(e, n))
85
+ v.lt(e, n))
86
86
  );
87
87
  }
88
- Xi(t, e) {
88
+ Rn(t, e) {
89
89
  const s = new H();
90
90
  if (!t.$t())
91
91
  return (
@@ -94,34 +94,34 @@ export default class ea {
94
94
  ),
95
95
  s
96
96
  );
97
- const i = this.Oi(e);
97
+ const i = this.Bn(e);
98
98
  return null == i
99
99
  ? s
100
- : t.id === InAppMessageButton.Hi
100
+ : t.id === InAppMessageButton._n
101
101
  ? (E.info(
102
102
  "This in-app message button does not have a tracking id. Not logging event to Braze servers.",
103
103
  ),
104
104
  s)
105
- : (null != t.id && (i.bid = t.id), c.rt(m.Fi, i));
105
+ : (null != t.id && (i.bid = t.id), v.lt(f.Sn, i));
106
106
  }
107
- Ji(t) {
107
+ qn(t) {
108
108
  const e = t.messageFields;
109
109
  return (null != e && e.is_push_primer) || !1;
110
110
  }
111
- Ki(t) {
111
+ xn(t) {
112
112
  if (!(t instanceof InAppMessage)) return;
113
113
  const e = (t) => {
114
114
  if (!t) return;
115
115
  const e = eo(t);
116
- if (dt(e)) return jt(vt.Li, "In-App Message");
116
+ if (gt(e)) return dt(jt.Pn, "In-App Message");
117
117
  if (ft(e)) {
118
- const t = yt.Qi();
119
- if (!t.Ui) return yt.Vi(t.reason, "In-App Message");
118
+ const t = vt.En();
119
+ if (!t.Gn) return vt.Nn(t.reason, "In-App Message");
120
120
  }
121
121
  };
122
- if (this.Ji(t)) {
123
- const t = yt.Qi();
124
- if (!t.Ui) return yt.Vi(t.reason, "In-App Message");
122
+ if (this.qn(t)) {
123
+ const t = vt.En();
124
+ if (!t.Gn) return vt.Nn(t.reason, "In-App Message");
125
125
  }
126
126
  const s = t.buttons || [];
127
127
  let i;
@@ -139,49 +139,49 @@ export default class ea {
139
139
  ? e(t.uri)
140
140
  : void 0;
141
141
  }
142
- Wi(t, e) {
143
- e !== this.Ri && this.Yi(), (this.Bi = t), (this.Ri = e);
142
+ $n(t, e) {
143
+ e !== this.Mn && this.Cn(), (this.In = t), (this.Mn = e);
144
144
  }
145
- Yi() {
146
- null != this.Bi &&
147
- (clearTimeout(this.Bi), (this.Bi = null), (this.Ri = null));
145
+ Cn() {
146
+ null != this.In &&
147
+ (clearTimeout(this.In), (this.In = null), (this.Mn = null));
148
148
  }
149
- Zi(t, e, s, i) {
150
- const r = this.B;
149
+ Fn(t, e, s, i) {
150
+ const r = this.j;
151
151
  if (!r) return;
152
- this.Ri && t.triggerId !== this.Ri && (this.Yi(), h.Ci(this.j, h.H.Ir));
153
- const n = r.Mr(!1),
152
+ this.Mn && t.triggerId !== this.Mn && (this.Cn(), h.fi(this.B, h.H.On));
153
+ const n = r.Xn(!1),
154
154
  o = r.$(n);
155
155
  (o.template = { trigger_id: t.triggerId, trigger_event_type: e }),
156
- null != s && (o.template.data = s.Ar());
157
- const u = r.A(o, h.H.Ir);
156
+ null != s && (o.template.data = s.Hn());
157
+ const u = r.A(o, h.H.On);
158
158
  r.J(
159
159
  o,
160
160
  (r = -1) => {
161
- const n = this.B;
161
+ const n = this.j;
162
162
  if (!n) return;
163
163
  const m = new Date().valueOf();
164
- h.K(this.j, h.H.Ir, m),
164
+ h.K(this.B, h.H.On, m),
165
165
  -1 !== r && u.push(["X-Braze-Req-Tokens-Remaining", r.toString()]);
166
166
  let c,
167
167
  p,
168
168
  f = !1;
169
- a.O({
169
+ l.O({
170
170
  url: `${n.V()}/template/`,
171
171
  data: o,
172
172
  headers: u,
173
173
  W: (e) => {
174
174
  if (!n.Y(o, e, u))
175
- return void ("function" == typeof t.Tr && t.Tr());
175
+ return void ("function" == typeof t.Jn && t.Jn());
176
176
  if ((n.Z(), null == e || null == e.templated_message)) return;
177
177
  const s = e.templated_message;
178
- if (s.type !== pt._r.Br) return;
178
+ if (s.type !== pt.Ln.Kn) return;
179
179
  const i = ut(s.data);
180
180
  if (null == i) return;
181
- const r = this.Ki(i);
181
+ const r = this.xn(i);
182
182
  if (r)
183
- return E.error(r), void ("function" == typeof t.Tr && t.Tr());
184
- "function" == typeof t.qr && t.qr(i);
183
+ return E.error(r), void ("function" == typeof t.Jn && t.Jn());
184
+ "function" == typeof t.Qn && t.Qn(i);
185
185
  },
186
186
  error: (e) => {
187
187
  (f = !0),
@@ -189,21 +189,21 @@ export default class ea {
189
189
  (p = `getting user personalization for message ${t.triggerId}.`);
190
190
  },
191
191
  tt: (r, o) => {
192
- if (new Date().valueOf() - t.Er < t.Gr) {
192
+ if (new Date().valueOf() - t.Un < t.Vn) {
193
193
  let r = 0;
194
194
  if (f) {
195
- const e = Math.min(t.Gr, this.ki),
196
- s = this.Mi;
197
- null == i && (i = s), (r = Math.min(e, l(s, 3 * i)));
195
+ const e = Math.min(t.Vn, this.yn),
196
+ s = this.vn;
197
+ null == i && (i = s), (r = Math.min(e, a(s, 3 * i)));
198
198
  }
199
- n.st(
199
+ n.et(
200
200
  o,
201
201
  () => {
202
- this.Zi(t, e, s, r);
202
+ this.Fn(t, e, s, r);
203
203
  },
204
- h.H.Ir,
205
- (e) => this.Wi(e, t.triggerId),
206
- () => this.Yi(),
204
+ h.H.On,
205
+ (e) => this.$n(e, t.triggerId),
206
+ () => this.Cn(),
207
207
  r,
208
208
  );
209
209
  }
@@ -211,10 +211,10 @@ export default class ea {
211
211
  },
212
212
  });
213
213
  },
214
- h.H.Ir,
214
+ h.H.On,
215
215
  );
216
216
  }
217
- Oi(t) {
217
+ Bn(t) {
218
218
  if (null == t.triggerId)
219
219
  return (
220
220
  E.info(
@@ -225,40 +225,40 @@ export default class ea {
225
225
  const e = {};
226
226
  return null != t.triggerId && (e.trigger_ids = [t.triggerId]), e;
227
227
  }
228
- Ee(t) {
228
+ fn(t) {
229
229
  return (
230
- !!this.j &&
230
+ !!this.B &&
231
231
  !(
232
232
  !(t && t instanceof InAppMessage && t.constructor !== InAppMessage) ||
233
233
  t instanceof ControlMessage
234
234
  ) &&
235
- this.j.ft(s.ct.Nr, t.dt())
235
+ this.B.bt(s.ft.Wn, t.gt())
236
236
  );
237
237
  }
238
- zr() {
239
- if (!this.j) return null;
240
- const t = this.j.lt(s.ct.Nr);
238
+ sa() {
239
+ if (!this.B) return null;
240
+ const t = this.B.dt(s.ft.Wn);
241
241
  if (!t) return null;
242
242
  let e;
243
243
  switch (t.type) {
244
- case InAppMessage.Ke.Or:
245
- e = FullScreenMessage.Xr(t);
244
+ case InAppMessage.Eo.Yn:
245
+ e = FullScreenMessage.Zn(t);
246
246
  break;
247
- case InAppMessage.Ke.Hr:
248
- case InAppMessage.Ke.Je:
249
- case InAppMessage.Ke.Ao:
250
- e = HtmlMessage.Xr(t);
247
+ case InAppMessage.Eo.Zo:
248
+ case InAppMessage.Eo.Bo:
249
+ case InAppMessage.Eo.Yo:
250
+ e = HtmlMessage.Zn(t);
251
251
  break;
252
- case InAppMessage.Ke.Jr:
253
- case InAppMessage.Ke.Io:
254
- e = ModalMessage.Xr(t);
252
+ case InAppMessage.Eo.ta:
253
+ case InAppMessage.Eo.Xo:
254
+ e = ModalMessage.Zn(t);
255
255
  break;
256
- case InAppMessage.Ke.Kr:
257
- e = SlideUpMessage.Xr(t);
256
+ case InAppMessage.Eo.ia:
257
+ e = SlideUpMessage.Zn(t);
258
258
  }
259
- return e && this.Lr(), e;
259
+ return e && this.oa(), e;
260
260
  }
261
- Lr() {
262
- this.j && this.j.Nt(s.ct.Nr);
261
+ oa() {
262
+ this.B && this.B.zt(s.ft.Wn);
263
263
  }
264
264
  }
@@ -1,27 +1,27 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import { MUST_BE_IN_APP_MESSAGE_WARNING as sr } from "../common/constants.js";
2
+ import { IamStrings as sr } from "./constants.js";
3
3
  import InAppMessage from "./models/in-app-message.js";
4
4
  import InAppMessageButton from "./models/in-app-message-button.js";
5
- import se from "./in-app-message-manager-factory.js";
5
+ import je from "./in-app-message-manager-factory.js";
6
6
  import { logger as E } from "../../shared-lib/index.js";
7
7
  import ot from "../triggers/models/trigger-events.js";
8
8
  import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
9
- export function logInAppMessageButtonClick(o, t) {
9
+ export function logInAppMessageButtonClick(t, o) {
10
10
  var e;
11
11
  if (!r.rr()) return !1;
12
- if (!(o instanceof InAppMessageButton))
12
+ if (!(t instanceof InAppMessageButton))
13
13
  return E.error("button must be an InAppMessageButton object"), !1;
14
- if (!(t instanceof InAppMessage)) return E.error(sr), !1;
15
- const s = se.ea().Xi(o, t);
14
+ if (!(o instanceof InAppMessage)) return E.error(sr.sS), !1;
15
+ const s = je.ra().Rn(t, o);
16
16
  if (s.W)
17
- for (let r = 0; r < s.ue.length; r++)
18
- rt.o().ve(
19
- ot.Qr,
17
+ for (let r = 0; r < s.Ee.length; r++)
18
+ rt.o().he(
19
+ ot.rm,
20
20
  [
21
- t.triggerId,
22
- null === (e = o.id) || void 0 === e ? void 0 : e.toString(),
21
+ o.triggerId,
22
+ null === (e = t.id) || void 0 === e ? void 0 : e.toString(),
23
23
  ],
24
- s.ue[r],
24
+ s.Ee[r],
25
25
  );
26
26
  return s.W;
27
27
  }
@@ -1,19 +1,19 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import InAppMessage from "./models/in-app-message.js";
3
- import se from "./in-app-message-manager-factory.js";
3
+ import je from "./in-app-message-manager-factory.js";
4
4
  import { logInAppMessageImpression } from "./log-in-app-message-impression.js";
5
- import { MUST_BE_IN_APP_MESSAGE_WARNING as sr } from "../common/constants.js";
6
- import { logger as E, EventTypes as m } from "../../shared-lib/index.js";
5
+ import { IamStrings as sr } from "./constants.js";
6
+ import { logger as E, EventTypes as f } from "../../shared-lib/index.js";
7
7
  import ot from "../triggers/models/trigger-events.js";
8
8
  import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
9
- export function logInAppMessageClick(o) {
9
+ export function logInAppMessageClick(s) {
10
10
  if (!r.rr()) return !1;
11
- if (!(o instanceof InAppMessage)) return E.error(sr), !1;
12
- const s = se.ea().rt(o, m.$i);
13
- if (s) {
14
- o.Ur() || logInAppMessageImpression(o);
15
- for (let r = 0; r < s.ue.length; r++)
16
- rt.o().ve(ot.Qr, [o.triggerId], s.ue[r]);
11
+ if (!(s instanceof InAppMessage)) return E.error(sr.sS), !1;
12
+ const e = je.ra().lt(s, f.zn);
13
+ if (e) {
14
+ s.sm() || logInAppMessageImpression(s);
15
+ for (let r = 0; r < e.Ee.length; r++)
16
+ rt.o().he(ot.rm, [s.triggerId], e.Ee[r]);
17
17
  }
18
- return s.W;
18
+ return e.W;
19
19
  }
@@ -1,7 +1,7 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import HtmlMessage from "./models/html-message.js";
3
- import se from "./in-app-message-manager-factory.js";
4
- import { logger as E, EventTypes as m } from "../../shared-lib/index.js";
3
+ import je from "./in-app-message-manager-factory.js";
4
+ import { logger as E, EventTypes as f } from "../../shared-lib/index.js";
5
5
  import ot from "../triggers/models/trigger-events.js";
6
6
  import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
7
7
  export function logInAppMessageHtmlClick(e, t, s) {
@@ -13,11 +13,11 @@ export function logInAppMessageHtmlClick(e, t, s) {
13
13
  ),
14
14
  !1
15
15
  );
16
- let o = m.$i;
17
- null != t && (o = m.Fi);
18
- const i = se.ea().rt(e, o, t, s);
19
- if (i.W)
20
- for (let r = 0; r < i.ue.length; r++)
21
- rt.o().ve(ot.Qr, [e.triggerId, t], i.ue[r]);
22
- return i.W;
16
+ let o = f.zn;
17
+ null != t && (o = f.Sn);
18
+ const m = je.ra().lt(e, o, t, s);
19
+ if (m.W)
20
+ for (let r = 0; r < m.Ee.length; r++)
21
+ rt.o().he(ot.rm, [e.triggerId, t], m.Ee[r]);
22
+ return m.W;
23
23
  }
@@ -1,13 +1,13 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import ControlMessage from "./models/control-message.js";
3
3
  import InAppMessage from "./models/in-app-message.js";
4
- import se from "./in-app-message-manager-factory.js";
5
- import { MUST_BE_IN_APP_MESSAGE_WARNING as sr } from "../common/constants.js";
6
- import { logger as E, EventTypes as m } from "../../shared-lib/index.js";
7
- export function logInAppMessageImpression(o) {
4
+ import je from "./in-app-message-manager-factory.js";
5
+ import { IamStrings as sr } from "./constants.js";
6
+ import { logger as E, EventTypes as f } from "../../shared-lib/index.js";
7
+ export function logInAppMessageImpression(s) {
8
8
  if (!r.rr()) return !1;
9
- if (!(o instanceof InAppMessage || o instanceof ControlMessage))
10
- return E.error(sr), !1;
11
- const s = o instanceof ControlMessage ? m.zo : m.Gi;
12
- return se.ea().rt(o, s).W;
9
+ if (!(s instanceof InAppMessage || s instanceof ControlMessage))
10
+ return E.error(sr.sS), !1;
11
+ const o = s instanceof ControlMessage ? f.om : f.wn;
12
+ return je.ra().lt(s, o).W;
13
13
  }
@@ -6,15 +6,15 @@ export default class ControlMessage {
6
6
  (this.messageExtras = t),
7
7
  (this.extras = {}),
8
8
  (this.isControl = !0),
9
- (this.kt = !1);
9
+ (this.Gt = !1);
10
10
  }
11
11
  static fromJson(s) {
12
12
  return new ControlMessage(s.trigger_id, s.message_extras);
13
13
  }
14
- Qt() {
15
- return !this.kt && ((this.kt = !0), !0);
14
+ Wt() {
15
+ return !this.Gt && ((this.Gt = !0), !0);
16
16
  }
17
- Ur() {
18
- return this.kt;
17
+ sm() {
18
+ return this.Gt;
19
19
  }
20
20
  }