@braze/web-sdk 6.6.0 → 6.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/index.d.ts +253 -5
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +21 -20
  4. package/shared-lib/guid.js +3 -3
  5. package/shared-lib/indexed-db-adapter.js +70 -70
  6. package/shared-lib/logger.js +7 -7
  7. package/shared-lib/supported-options.js +26 -26
  8. package/src/Banner/banner-factory.js +11 -1
  9. package/src/Banner/banner-provider.js +244 -120
  10. package/src/Banner/banner.js +14 -12
  11. package/src/Banner/display/banner-to-html.js +23 -16
  12. package/src/Banner/display/detect-banner-impressions.js +13 -13
  13. package/src/Banner/get-all-banners.js +5 -5
  14. package/src/Banner/get-banner.js +4 -4
  15. package/src/Banner/log-banner-click.js +4 -4
  16. package/src/Banner/log-banner-dismissal.js +23 -0
  17. package/src/Banner/log-banner-impressions.js +7 -7
  18. package/src/Banner/request-banners-refresh.js +12 -16
  19. package/src/Banner/subscribe-to-banners-updates.js +6 -6
  20. package/src/Banner/ui/insert-banner.js +12 -12
  21. package/src/Card/card-manager-factory.js +5 -5
  22. package/src/Card/card-manager.js +33 -33
  23. package/src/Card/constants.js +1 -1
  24. package/src/Card/display/card-display.js +11 -11
  25. package/src/Card/log-card-dismissal.js +3 -3
  26. package/src/Card/log-content-card-click.js +3 -3
  27. package/src/Card/log-content-card-impressions.js +6 -6
  28. package/src/Card/models/captioned-image.js +21 -21
  29. package/src/Card/models/card.js +73 -73
  30. package/src/Card/models/classic-card.js +21 -21
  31. package/src/Card/models/control-card.js +11 -11
  32. package/src/Card/models/image-only.js +18 -18
  33. package/src/Card/util/card-factory.js +41 -41
  34. package/src/ContentCards/content-cards-provider-factory.js +12 -12
  35. package/src/ContentCards/content-cards-provider.js +151 -151
  36. package/src/ContentCards/content-cards.js +5 -5
  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 +10 -10
  41. package/src/Core/add-sdk-metadata.js +2 -2
  42. package/src/Core/change-user.js +6 -6
  43. package/src/Core/disable-sdk.js +9 -9
  44. package/src/Core/enable-sdk.js +5 -5
  45. package/src/Core/get-user.js +1 -1
  46. package/src/Core/handle-braze-action.js +3 -3
  47. package/src/Core/is-disabled.js +2 -2
  48. package/src/Core/log-custom-event.js +8 -8
  49. package/src/Core/log-purchase.js +5 -5
  50. package/src/Core/open-session.js +7 -7
  51. package/src/Core/set-sdk-authentication-signature.js +3 -3
  52. package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
  53. package/src/Core/wipe-data.js +6 -6
  54. package/src/DUST/dust-provider-factory.js +11 -11
  55. package/src/DUST/dust-provider.js +255 -255
  56. package/src/DUST/dust-shared-worker-impl.js +100 -100
  57. package/src/DUST/dust-worker-bridge.js +27 -27
  58. package/src/DUST/subscribe-to-dust.js +9 -9
  59. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  60. package/src/FeatureFlags/feature-flag.js +9 -9
  61. package/src/FeatureFlags/feature-flags-provider.js +86 -86
  62. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  63. package/src/FeatureFlags/get-feature-flag.js +2 -2
  64. package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
  65. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  66. package/src/InAppMessage/constants.js +83 -2
  67. package/src/InAppMessage/display/html-message-display-utils.js +15 -15
  68. package/src/InAppMessage/display/html-message-to-html.js +36 -37
  69. package/src/InAppMessage/display/in-app-message-to-html.js +44 -44
  70. package/src/InAppMessage/display/modal-utils.js +10 -14
  71. package/src/InAppMessage/in-app-message-factory.js +16 -20
  72. package/src/InAppMessage/in-app-message-manager.js +115 -116
  73. package/src/InAppMessage/log-in-app-message-button-click.js +8 -8
  74. package/src/InAppMessage/log-in-app-message-click.js +7 -7
  75. package/src/InAppMessage/log-in-app-message-html-click.js +8 -8
  76. package/src/InAppMessage/log-in-app-message-impression.js +5 -5
  77. package/src/InAppMessage/models/control-message.js +4 -4
  78. package/src/InAppMessage/models/full-screen-message.js +56 -49
  79. package/src/InAppMessage/models/html-message.js +31 -27
  80. package/src/InAppMessage/models/in-app-message-button.js +12 -12
  81. package/src/InAppMessage/models/in-app-message.js +202 -256
  82. package/src/InAppMessage/models/modal-message.js +55 -49
  83. package/src/InAppMessage/models/slide-up-message.js +57 -51
  84. package/src/InAppMessage/models/templated-in-app-message.js +10 -10
  85. package/src/InAppMessage/shared-types.js +1 -0
  86. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  87. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
  88. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +3 -3
  89. package/src/InAppMessage/ui/show-in-app-message.js +43 -41
  90. package/src/Push/is-push-blocked.js +2 -2
  91. package/src/Push/is-push-permission-granted.js +2 -2
  92. package/src/Push/is-push-supported.js +2 -2
  93. package/src/Push/push-manager-factory.js +9 -9
  94. package/src/Push/push-manager.js +15 -15
  95. package/src/Push/utils/push-utils.js +15 -15
  96. package/src/User/user-manager.js +14 -14
  97. package/src/User/user.js +60 -59
  98. package/src/common/base-provider.js +1 -1
  99. package/src/common/constants.js +2 -1
  100. package/src/common/content-cards-display.js +38 -38
  101. package/src/common/event-logger.js +8 -8
  102. package/src/l10n/l10n-manager-factory.js +9 -9
  103. package/src/l10n/l10n-manager.js +2 -2
  104. package/src/managers/auth-manager.js +31 -31
  105. package/src/managers/braze-instance.js +197 -186
  106. package/src/managers/constants.js +1 -0
  107. package/src/managers/device-manager.js +25 -25
  108. package/src/managers/network-manager.js +155 -155
  109. package/src/managers/server-config-manager.js +106 -93
  110. package/src/managers/session-manager.js +37 -33
  111. package/src/managers/storage-manager-factory.js +33 -28
  112. package/src/managers/storage-manager.js +192 -170
  113. package/src/managers/subscription-manager.js +13 -13
  114. package/src/managers/utils.js +1 -1
  115. package/src/models/backend-errors.js +5 -5
  116. package/src/models/braze-event.js +13 -13
  117. package/src/models/device.js +3 -3
  118. package/src/models/identifier.js +12 -12
  119. package/src/models/push-token.js +9 -9
  120. package/src/models/request-result.js +4 -4
  121. package/src/models/server-config.js +29 -38
  122. package/src/request-controller.js +160 -164
  123. package/src/triggers/models/custom-event-data.js +7 -7
  124. package/src/triggers/models/custom-event-property-data.js +10 -10
  125. package/src/triggers/models/filter-set.js +12 -12
  126. package/src/triggers/models/filter.js +66 -66
  127. package/src/triggers/models/in-app-message-click-data.js +13 -13
  128. package/src/triggers/models/purchase-data.js +4 -4
  129. package/src/triggers/models/purchase-property-data.js +10 -10
  130. package/src/triggers/models/push-click-data.js +8 -8
  131. package/src/triggers/models/trigger-condition.js +58 -58
  132. package/src/triggers/models/trigger-events.js +3 -3
  133. package/src/triggers/models/trigger.js +44 -44
  134. package/src/triggers/triggers-provider-factory.js +5 -5
  135. package/src/triggers/triggers-provider.js +70 -70
  136. package/src/ui/js/attach-css.js +3 -3
  137. package/src/ui/js/feed-css.js +2 -2
  138. package/src/ui/js/iam-css.js +2 -2
  139. package/src/ui/js/load-font-awesome.js +2 -2
  140. package/src/util/base-device-parser.js +9 -9
  141. package/src/util/braze-actions.js +3 -3
  142. package/src/util/browser-detector.js +37 -37
  143. package/src/util/client-hints-parser.js +9 -9
  144. package/src/util/component-utils.js +3 -3
  145. package/src/util/dom-utils.js +2 -2
  146. package/src/util/html-display-utils.js +11 -11
  147. package/src/util/key-codes.js +1 -1
  148. package/src/util/net.js +8 -8
  149. package/src/util/request-header-utils.js +25 -25
  150. package/src/util/user-agent-parser.js +20 -20
  151. package/src/util/validation-utils.js +21 -21
  152. package/src/util/window-utils.js +3 -3
@@ -5,67 +5,68 @@ 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
7
  import v from "../common/event-logger.js";
8
- import { newInAppMessageFromJson as ut } from "./in-app-message-factory.js";
8
+ import { newInAppMessageFromJson as pt } from "./in-app-message-factory.js";
9
9
  import { randomInclusive as a } from "../util/math.js";
10
- import H from "../models/request-result.js";
11
- import { logger as E, EventTypes as f } from "../../shared-lib/index.js";
12
- import m from "../managers/subscription-manager.js";
13
- import pt from "../triggers/models/trigger.js";
10
+ import L from "../models/request-result.js";
11
+ import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
12
+ import f from "../managers/subscription-manager.js";
13
+ import gt from "../triggers/models/trigger.js";
14
14
  import { BRAZE_ACTION_URI_REGEX as to } from "../util/validation-utils.js";
15
15
  import {
16
- containsPushPrimerBrazeAction as ft,
17
- containsUnknownBrazeAction as gt,
16
+ containsPushPrimerBrazeAction as jt,
17
+ containsUnknownBrazeAction as vt,
18
18
  getDecodedBrazeAction as eo,
19
- ineligibleBrazeActionURLErrorMessage as dt,
20
- INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as jt,
19
+ ineligibleBrazeActionURLErrorMessage as yt,
20
+ INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as bt,
21
21
  } from "../util/braze-actions.js";
22
- import vt from "../Push/utils/push-utils.js";
22
+ import It 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
+ import { IamClickAction as $e, IamServerTypes as dt } from "./constants.js";
26
27
  export default class ea {
27
28
  constructor(t, e, s, i) {
28
- (this.j = t),
29
- (this.C = e),
30
- (this.B = s),
31
- (this.vs = i),
32
- (this.j = t),
33
- (this.C = e),
34
- (this.B = s),
35
- (this.vs = i),
36
- (this.vn = new m()),
37
- r.q(this.vn),
38
- (this.yn = 1e3),
39
- (this.bn = 6e4),
40
- (this.In = null),
41
- (this.Mn = null),
42
- (this.An = null);
29
+ (this.B = t),
30
+ (this.j = e),
31
+ (this.C = s),
32
+ (this.Ss = i),
33
+ (this.B = t),
34
+ (this.j = e),
35
+ (this.C = s),
36
+ (this.Ss = i),
37
+ (this.In = new f()),
38
+ r.S(this.In),
39
+ (this.An = 1e3),
40
+ (this.Dn = 6e4),
41
+ (this.Bn = null),
42
+ (this._n = null),
43
+ (this.qn = null);
43
44
  }
44
- Tn() {
45
- return this.vn;
45
+ Pn() {
46
+ return this.In;
46
47
  }
47
- kn(t) {
48
- return this.vn.Rt(t);
48
+ En(t) {
49
+ return this.In.Kt(t);
49
50
  }
50
- Dn() {
51
- return this.In;
51
+ Gn() {
52
+ return this.Bn;
52
53
  }
53
- wn(t) {
54
- this.In = t;
54
+ Nn(t) {
55
+ this.Bn = t;
55
56
  }
56
- lt(t, e, s, i) {
57
- const r = new H();
57
+ wt(t, e, s, i) {
58
+ const r = new L();
58
59
  let n;
59
- if (e === f.zn || t instanceof ControlMessage) {
60
- if (!t.Wt())
60
+ if (e === p.Fn || t instanceof ControlMessage) {
61
+ if (!t.gs())
61
62
  return (
62
63
  E.info(
63
64
  "This in-app message has already received an impression. Ignoring analytics event.",
64
65
  ),
65
66
  r
66
67
  );
67
- } else if (e === f.Sn || (t instanceof HtmlMessage && e === f.Bn)) {
68
- if (!t.$t(i))
68
+ } else if (e === p.On || (t instanceof HtmlMessage && e === p.Xn)) {
69
+ if (!t.ss(i))
69
70
  return (
70
71
  E.info(
71
72
  "This in-app message has already received a click. Ignoring analytics event.",
@@ -77,144 +78,142 @@ export default class ea {
77
78
  (n =
78
79
  t instanceof ControlMessage
79
80
  ? { trigger_ids: [t.triggerId] }
80
- : this.Rn(t)),
81
+ : this.Hn(t)),
81
82
  null == n
82
83
  ? r
83
84
  : (t.messageExtras && (n.message_extras = t.messageExtras),
84
85
  null != s && (n.bid = s),
85
- v.lt(e, n))
86
+ v.wt(e, n))
86
87
  );
87
88
  }
88
- _n(t, e) {
89
- const s = new H();
90
- if (!t.$t())
89
+ Jn(t, e) {
90
+ const s = new L();
91
+ if (!t.ss())
91
92
  return (
92
93
  E.info(
93
94
  "This in-app message button has already received a click. Ignoring analytics event.",
94
95
  ),
95
96
  s
96
97
  );
97
- const i = this.Rn(e);
98
+ const i = this.Hn(e);
98
99
  return null == i
99
100
  ? s
100
- : t.id === InAppMessageButton.qn
101
+ : t.id === InAppMessageButton.Kn
101
102
  ? (E.info(
102
103
  "This in-app message button does not have a tracking id. Not logging event to Braze servers.",
103
104
  ),
104
105
  s)
105
- : (null != t.id && (i.bid = t.id), v.lt(f.Bn, i));
106
+ : (null != t.id && (i.bid = t.id), v.wt(p.Xn, i));
106
107
  }
107
- xn(t) {
108
+ Ln(t) {
108
109
  const e = t.messageFields;
109
110
  return (null != e && e.is_push_primer) || !1;
110
111
  }
111
- Pn(t) {
112
+ Qn(t) {
112
113
  if (!(t instanceof InAppMessage)) return;
113
114
  const e = (t) => {
114
115
  if (!t) return;
115
116
  const e = eo(t);
116
- if (gt(e)) return dt(jt.En, "In-App Message");
117
- if (ft(e)) {
118
- const t = vt.Gn();
119
- if (!t.Nn) return vt.$n(t.reason, "In-App Message");
117
+ if (vt(e)) return yt(bt.Un, "In-App Message");
118
+ if (jt(e)) {
119
+ const t = It.Vn();
120
+ if (!t.Wn) return It.Yn(t.reason, "In-App Message");
120
121
  }
121
122
  };
122
- if (this.xn(t)) {
123
- const t = vt.Gn();
124
- if (!t.Nn) return vt.$n(t.reason, "In-App Message");
123
+ if (this.Ln(t)) {
124
+ const t = It.Vn();
125
+ if (!t.Wn) return It.Yn(t.reason, "In-App Message");
125
126
  }
126
127
  const s = t.buttons || [];
127
128
  let i;
128
129
  for (const t of s)
129
130
  if (
130
- t.clickAction === InAppMessage.ClickAction.URI &&
131
+ t.clickAction === $e.URI &&
131
132
  t.uri &&
132
133
  to.test(t.uri) &&
133
134
  ((i = e(t.uri)), i)
134
135
  )
135
136
  return i;
136
- return t.clickAction === InAppMessage.ClickAction.URI &&
137
- t.uri &&
138
- to.test(t.uri)
137
+ return t.clickAction === $e.URI && t.uri && to.test(t.uri)
139
138
  ? e(t.uri)
140
139
  : void 0;
141
140
  }
142
- Cn(t, e) {
143
- e !== this.An && this.Fn(), (this.Mn = t), (this.An = e);
141
+ Zn(t, e) {
142
+ e !== this.qn && this._o(), (this._n = t), (this.qn = e);
144
143
  }
145
- Fn() {
146
- null != this.Mn &&
147
- (clearTimeout(this.Mn), (this.Mn = null), (this.An = null));
144
+ _o() {
145
+ null != this._n &&
146
+ (clearTimeout(this._n), (this._n = null), (this.qn = null));
148
147
  }
149
- On(t, e, s, i) {
150
- const r = this.j;
148
+ Xo(t, e, s, i) {
149
+ const r = this.B;
151
150
  if (!r) return;
152
- this.An && t.triggerId !== this.An && (this.Fn(), h.fi(this.B, h.H.Xn));
153
- const n = r.Hn(!1),
154
- o = r.$(n);
151
+ this.qn && t.triggerId !== this.qn && (this._o(), h.Li(this.C, h.it.Yo));
152
+ const n = r.Zo(!1),
153
+ o = r.Z(n);
155
154
  (o.template = { trigger_id: t.triggerId, trigger_event_type: e }),
156
- null != s && (o.template.data = s.Jn());
157
- const u = r.A(o, h.H.Xn);
158
- r.J(
155
+ null != s && (o.template.data = s.ta());
156
+ const u = r.tt(o, h.it.Yo);
157
+ r.et(
159
158
  o,
160
159
  (r = -1) => {
161
- const n = this.j;
160
+ const n = this.B;
162
161
  if (!n) return;
163
162
  const m = new Date().valueOf();
164
- h.K(this.B, h.H.Xn, m),
163
+ h.nt(this.C, h.it.Yo, m),
165
164
  -1 !== r && u.push(["X-Braze-Req-Tokens-Remaining", r.toString()]);
166
165
  let c,
167
166
  p,
168
167
  f = !1;
169
- l.O({
170
- url: `${n.V()}/template/`,
168
+ l.ot({
169
+ url: `${n.ht()}/template/`,
171
170
  data: o,
172
171
  headers: u,
173
- W: (e) => {
174
- if (!n.Y(o, e, u))
175
- return void ("function" == typeof t.Kn && t.Kn());
176
- if ((n.Z(), null == e || null == e.templated_message)) return;
172
+ lt: (e) => {
173
+ if (!n.ut(o, e, u))
174
+ return void ("function" == typeof t.ia && t.ia());
175
+ if ((n.ct(), null == e || null == e.templated_message)) return;
177
176
  const s = e.templated_message;
178
- if (s.type !== pt.Qn.Ln) return;
179
- const i = ut(s.data);
177
+ if (s.type !== gt.la.oa) return;
178
+ const i = pt(s.data);
180
179
  if (null == i) return;
181
- const r = this.Pn(i);
180
+ const r = this.Qn(i);
182
181
  if (r)
183
- return E.error(r), void ("function" == typeof t.Kn && t.Kn());
184
- "function" == typeof t.Un && t.Un(i);
182
+ return E.error(r), void ("function" == typeof t.ia && t.ia());
183
+ "function" == typeof t.ua && t.ua(i);
185
184
  },
186
185
  error: (e) => {
187
186
  (f = !0),
188
187
  (c = e),
189
188
  (p = `getting user personalization for message ${t.triggerId}.`);
190
189
  },
191
- tt: (r, o) => {
192
- if (new Date().valueOf() - t.Vn < t.Wn) {
190
+ ft: (r, o) => {
191
+ if (new Date().valueOf() - t.ma < t.ca) {
193
192
  let r = 0;
194
193
  if (f) {
195
- const e = Math.min(t.Wn, this.bn),
196
- s = this.yn;
194
+ const e = Math.min(t.ca, this.Dn),
195
+ s = this.An;
197
196
  null == i && (i = s), (r = Math.min(e, a(s, 3 * i)));
198
197
  }
199
- n.et(
198
+ n.yt(
200
199
  o,
201
200
  () => {
202
- this.On(t, e, s, r);
201
+ this.Xo(t, e, s, r);
203
202
  },
204
- h.H.Xn,
205
- (e) => this.Cn(e, t.triggerId),
206
- () => this.Fn(),
203
+ h.it.Yo,
204
+ (e) => this.Zn(e, t.triggerId),
205
+ () => this._o(),
207
206
  r,
208
207
  );
209
208
  }
210
- f && n._(c, p);
209
+ f && n.dt(c, p);
211
210
  },
212
211
  });
213
212
  },
214
- h.H.Xn,
213
+ h.it.Yo,
215
214
  );
216
215
  }
217
- Rn(t) {
216
+ Hn(t) {
218
217
  if (null == t.triggerId)
219
218
  return (
220
219
  E.info(
@@ -227,38 +226,38 @@ export default class ea {
227
226
  }
228
227
  jn(t) {
229
228
  return (
230
- !!this.B &&
229
+ !!this.C &&
231
230
  !(
232
231
  !(t && t instanceof InAppMessage && t.constructor !== InAppMessage) ||
233
232
  t instanceof ControlMessage
234
233
  ) &&
235
- this.B.bt(s.ft.Yn, t.gt())
234
+ this.C.It(s.Tt.pa, t.qt())
236
235
  );
237
236
  }
238
237
  sa() {
239
- if (!this.B) return null;
240
- const t = this.B.dt(s.ft.Yn);
238
+ if (!this.C) return null;
239
+ const t = this.C.Rt(s.Tt.pa);
241
240
  if (!t) return null;
242
241
  let e;
243
242
  switch (t.type) {
244
- case InAppMessage.Eo.Zn:
245
- e = FullScreenMessage.Zo(t);
243
+ case dt.cE:
244
+ e = FullScreenMessage.ha(t);
246
245
  break;
247
- case InAppMessage.Eo.ta:
248
- case InAppMessage.Eo.Bo:
249
- case InAppMessage.Eo.Yo:
250
- e = HtmlMessage.Zo(t);
246
+ case dt.iE:
247
+ case dt.PE:
248
+ case dt.nE:
249
+ e = HtmlMessage.ha(t);
251
250
  break;
252
- case InAppMessage.Eo.ia:
253
- case InAppMessage.Eo.Xo:
254
- e = ModalMessage.Zo(t);
251
+ case dt.aE:
252
+ case dt.UE:
253
+ e = ModalMessage.ha(t);
255
254
  break;
256
- case InAppMessage.Eo.oa:
257
- e = SlideUpMessage.Zo(t);
255
+ case dt.sE:
256
+ e = SlideUpMessage.ha(t);
258
257
  }
259
- return e && this.la(), e;
258
+ return e && this.fa(), e;
260
259
  }
261
- la() {
262
- this.B && this.B.zt(s.ft.Yn);
260
+ fa() {
261
+ this.C && this.C.Qt(s.Tt.pa);
263
262
  }
264
263
  }
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import { IamStrings as sr } from "./constants.js";
2
+ import { IamStrings as mr } 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
5
  import je from "./in-app-message-manager-factory.js";
@@ -11,17 +11,17 @@ export function logInAppMessageButtonClick(t, o) {
11
11
  if (!r.rr()) return !1;
12
12
  if (!(t instanceof InAppMessageButton))
13
13
  return E.error("button must be an InAppMessageButton object"), !1;
14
- if (!(o instanceof InAppMessage)) return E.error(sr.sS), !1;
15
- const s = je.ra()._n(t, o);
16
- if (s.W)
17
- for (let r = 0; r < s.Ee.length; r++)
18
- rt.o().he(
14
+ if (!(o instanceof InAppMessage)) return E.error(mr.EE), !1;
15
+ const s = je.ra().Jn(t, o);
16
+ if (s.lt)
17
+ for (let r = 0; r < s.Ce.length; r++)
18
+ rt.o().Ee(
19
19
  ot.rm,
20
20
  [
21
21
  o.triggerId,
22
22
  null === (e = t.id) || void 0 === e ? void 0 : e.toString(),
23
23
  ],
24
- s.Ee[r],
24
+ s.Ce[r],
25
25
  );
26
- return s.W;
26
+ return s.lt;
27
27
  }
@@ -2,18 +2,18 @@ import r from "../managers/braze-instance.js";
2
2
  import InAppMessage from "./models/in-app-message.js";
3
3
  import je from "./in-app-message-manager-factory.js";
4
4
  import { logInAppMessageImpression } from "./log-in-app-message-impression.js";
5
- import { IamStrings as sr } from "./constants.js";
6
- import { logger as E, EventTypes as f } from "../../shared-lib/index.js";
5
+ import { IamStrings as mr } from "./constants.js";
6
+ import { logger as E, EventTypes as p } 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
9
  export function logInAppMessageClick(s) {
10
10
  if (!r.rr()) return !1;
11
- if (!(s instanceof InAppMessage)) return E.error(sr.sS), !1;
12
- const e = je.ra().lt(s, f.Sn);
11
+ if (!(s instanceof InAppMessage)) return E.error(mr.EE), !1;
12
+ const e = je.ra().wt(s, p.On);
13
13
  if (e) {
14
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]);
15
+ for (let r = 0; r < e.Ce.length; r++)
16
+ rt.o().Ee(ot.rm, [s.triggerId], e.Ce[r]);
17
17
  }
18
- return e.W;
18
+ return e.lt;
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
3
  import je from "./in-app-message-manager-factory.js";
4
- import { logger as E, EventTypes as f } from "../../shared-lib/index.js";
4
+ import { logger as E, EventTypes as p } 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 = f.Sn;
17
- null != t && (o = f.Bn);
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;
16
+ let o = p.On;
17
+ null != t && (o = p.Xn);
18
+ const m = je.ra().wt(e, o, t, s);
19
+ if (m.lt)
20
+ for (let r = 0; r < m.Ce.length; r++)
21
+ rt.o().Ee(ot.rm, [e.triggerId, t], m.Ce[r]);
22
+ return m.lt;
23
23
  }
@@ -2,12 +2,12 @@ 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
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";
5
+ import { IamStrings as mr } from "./constants.js";
6
+ import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
7
7
  export function logInAppMessageImpression(s) {
8
8
  if (!r.rr()) return !1;
9
9
  if (!(s instanceof InAppMessage || s instanceof ControlMessage))
10
- return E.error(sr.sS), !1;
11
- const o = s instanceof ControlMessage ? f.om : f.zn;
12
- return je.ra().lt(s, o).W;
10
+ return E.error(mr.EE), !1;
11
+ const o = s instanceof ControlMessage ? p.om : p.Fn;
12
+ return je.ra().wt(s, o).lt;
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.Gt = !1);
9
+ (this.Zt = !1);
10
10
  }
11
11
  static fromJson(s) {
12
12
  return new ControlMessage(s.trigger_id, s.message_extras);
13
13
  }
14
- Wt() {
15
- return !this.Gt && ((this.Gt = !0), !0);
14
+ gs() {
15
+ return !this.Zt && ((this.Zt = !0), !0);
16
16
  }
17
17
  sm() {
18
- return this.Gt;
18
+ return this.Zt;
19
19
  }
20
20
  }
@@ -1,24 +1,32 @@
1
- import { buttonsFromSerializedInAppMessage as ye } from "../in-app-message-factory.js";
1
+ import {
2
+ IamCropType as Le,
3
+ IamDismissType as pr,
4
+ IamOrientation as Ae,
5
+ IamSerializationKeys as cr,
6
+ IamServerTypes as dt,
7
+ IamTextAlignment as Ee,
8
+ } from "../constants.js";
9
+ import { buttonsFromSerializedInAppMessage as ur } from "../in-app-message-factory.js";
2
10
  import InAppMessage from "./in-app-message.js";
3
11
  export default class FullScreenMessage extends InAppMessage {
4
12
  constructor(
5
- e,
6
13
  r,
7
14
  s,
15
+ e,
8
16
  t,
17
+ o,
9
18
  i,
10
19
  a,
11
- o,
12
20
  p,
13
21
  m,
14
22
  n,
15
- u,
16
23
  c,
17
24
  f,
25
+ u,
18
26
  d,
19
27
  l,
20
- g,
21
28
  j,
29
+ g,
22
30
  x,
23
31
  z,
24
32
  h,
@@ -34,27 +42,27 @@ export default class FullScreenMessage extends InAppMessage {
34
42
  C,
35
43
  D,
36
44
  ) {
37
- (p = p || InAppMessage.DismissType.MANUAL),
38
- (k = k || InAppMessage.Orientation.PORTRAIT),
45
+ (p = p || pr.MANUAL),
46
+ (k = k || Ae.PORTRAIT),
39
47
  super(
40
- e,
41
48
  r,
42
- void 0,
43
49
  s,
50
+ void 0,
51
+ e,
44
52
  t,
53
+ o,
45
54
  i,
46
55
  a,
47
- o,
48
56
  p,
49
57
  m,
50
58
  n,
51
- u,
52
59
  c,
53
60
  f,
61
+ u,
54
62
  d,
55
63
  l,
56
- g,
57
64
  j,
65
+ g,
58
66
  x,
59
67
  z,
60
68
  h,
@@ -62,7 +70,7 @@ export default class FullScreenMessage extends InAppMessage {
62
70
  w,
63
71
  y,
64
72
  S,
65
- (b = b || InAppMessage.CropType.CENTER_CROP),
73
+ (b = b || Le.CENTER_CROP),
66
74
  k,
67
75
  q,
68
76
  A,
@@ -70,45 +78,44 @@ export default class FullScreenMessage extends InAppMessage {
70
78
  C,
71
79
  D,
72
80
  ),
73
- (this.Io = InAppMessage.TextAlignment.CENTER);
81
+ (this.Go = Ee.CENTER);
74
82
  }
75
- gt() {
76
- return super.gt(FullScreenMessage.es);
83
+ qt() {
84
+ return super.qt(dt.cE);
77
85
  }
78
- static Zo(e) {
86
+ static ha(r) {
79
87
  return new FullScreenMessage(
80
- e[InAppMessage.ss.pa],
81
- e[InAppMessage.ss.ma],
82
- e[InAppMessage.ss.xs],
83
- e[InAppMessage.ss.ua],
84
- e[InAppMessage.ss.ca],
85
- e[InAppMessage.ss.URI],
86
- e[InAppMessage.ss.fa],
87
- e[InAppMessage.ss.da],
88
- e[InAppMessage.ss.ga],
89
- e[InAppMessage.ss.ja],
90
- e[InAppMessage.ss.ns],
91
- e[InAppMessage.ss.xa],
92
- e[InAppMessage.ss.za],
93
- e[InAppMessage.ss.ha],
94
- e[InAppMessage.ss.va],
95
- e[InAppMessage.ss.wa],
96
- e[InAppMessage.ss.ya],
97
- e[InAppMessage.ss.Sa],
98
- e[InAppMessage.ss.ba],
99
- e[InAppMessage.ss.ka],
100
- e[InAppMessage.ss.qa],
101
- e[InAppMessage.ss.Aa],
102
- e[InAppMessage.ss.Ba],
103
- ye(e[InAppMessage.ss.Ca]),
104
- e[InAppMessage.ss.Da],
105
- e[InAppMessage.ss.Ea],
106
- e[InAppMessage.ss.Fa],
107
- e[InAppMessage.ss.CSS],
108
- e[InAppMessage.ss.Ga],
109
- e[InAppMessage.ss.LANGUAGE],
110
- e[InAppMessage.ss.ks],
88
+ r[cr.rE],
89
+ r[cr.mE],
90
+ r[cr.Fs],
91
+ r[cr.FE],
92
+ r[cr.HE],
93
+ r[cr.URI],
94
+ r[cr.xE],
95
+ r[cr.BE],
96
+ r[cr.lE],
97
+ r[cr.bE],
98
+ r[cr.ys],
99
+ r[cr.gE],
100
+ r[cr.YE],
101
+ r[cr.KE],
102
+ r[cr.XE],
103
+ r[cr.dE],
104
+ r[cr.hE],
105
+ r[cr.yE],
106
+ r[cr.uE],
107
+ r[cr.WE],
108
+ r[cr.fE],
109
+ r[cr.jE],
110
+ r[cr.kE],
111
+ ur(r[cr.vE]),
112
+ r[cr.wE],
113
+ r[cr.zE],
114
+ r[cr.VE],
115
+ r[cr.CSS],
116
+ r[cr.JE],
117
+ r[cr.LANGUAGE],
118
+ r[cr.Ks],
111
119
  );
112
120
  }
113
121
  }
114
- FullScreenMessage.es = InAppMessage.Eo.Zn;