@braze/web-sdk 6.10.2 → 6.12.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.
- package/index.d.ts +61 -6
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +3 -3
- package/shared-lib/event-types.js +12 -12
- package/shared-lib/indexed-db-adapter.js +52 -52
- package/shared-lib/logger.js +7 -7
- package/shared-lib/supported-options.js +10 -10
- package/src/Core/logout.js +2 -2
- package/src/DUST/dust-config-store.js +89 -0
- package/src/DUST/dust-connection-core.js +7 -21
- package/src/DUST/dust-message-dedup.js +33 -0
- package/src/DUST/dust-provider.js +367 -397
- package/src/DUST/dust-tab-identity.js +30 -0
- package/src/DUST/index.js +7 -9
- package/src/DUST/subscribe-to-dust.js +5 -5
- package/src/FeatureFlags/feature-flag-factory.js +4 -4
- package/src/FeatureFlags/feature-flag.js +5 -5
- package/src/FeatureFlags/feature-flags-provider-factory.js +8 -1
- package/src/FeatureFlags/feature-flags-provider.js +74 -74
- package/src/FeatureFlags/get-all-feature-flags.js +2 -2
- package/src/FeatureFlags/get-feature-flag.js +2 -2
- package/src/FeatureFlags/log-feature-flag-impression.js +3 -3
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
- package/src/InAppMessage/constants.js +39 -47
- package/src/InAppMessage/defer-in-app-message.js +2 -2
- package/src/InAppMessage/display/get-animation-effect.js +1 -1
- package/src/InAppMessage/display/html-message-display-utils.js +4 -4
- package/src/InAppMessage/display/html-message-to-html.js +10 -10
- package/src/InAppMessage/display/in-app-message-to-html.js +68 -66
- package/src/InAppMessage/display/modal-utils.js +14 -14
- package/src/InAppMessage/get-deferred-in-app-message.js +2 -2
- package/src/InAppMessage/in-app-message-factory.js +6 -6
- package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
- package/src/InAppMessage/in-app-message-manager.js +101 -80
- package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
- package/src/InAppMessage/log-in-app-message-click.js +2 -2
- package/src/InAppMessage/log-in-app-message-html-click.js +4 -4
- package/src/InAppMessage/log-in-app-message-impression.js +3 -3
- package/src/InAppMessage/models/full-screen-message.js +25 -25
- package/src/InAppMessage/models/html-message.js +14 -14
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +100 -98
- package/src/InAppMessage/models/modal-message.js +23 -23
- package/src/InAppMessage/models/slide-up-message.js +29 -29
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +2 -2
- package/src/InAppMessage/ui/show-in-app-message.js +42 -40
- package/src/Push/index.js +1 -0
- package/src/Push/is-push-blocked.js +2 -2
- package/src/Push/is-push-permission-granted.js +2 -2
- package/src/Push/is-push-supported.js +2 -2
- package/src/Push/push-manager-factory.js +6 -6
- package/src/Push/push-manager.js +228 -185
- package/src/Push/register-push.js +9 -0
- package/src/Push/unregister-push-token-on-server.js +4 -4
- package/src/Push/utils/push-utils.js +16 -16
- package/src/User/user-manager.js +19 -19
- package/src/User/user.js +36 -36
- package/src/common/constants.js +1 -1
- package/src/common/content-cards-display.js +21 -21
- package/src/common/event-logger.js +2 -2
- package/src/l10n/l10n-manager-factory.js +7 -7
- package/src/l10n/l10n-manager.js +5 -5
- package/src/managers/auth-manager.js +1 -1
- package/src/managers/braze-instance.js +70 -66
- package/src/managers/device-manager.js +12 -12
- package/src/managers/network-manager.js +118 -118
- package/src/managers/server-config-manager.js +84 -84
- package/src/managers/session-manager.js +10 -10
- package/src/managers/storage-manager-factory.js +4 -4
- package/src/managers/storage-manager.js +138 -136
- package/src/managers/subscription-manager.js +1 -1
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +7 -7
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +6 -6
- package/src/models/push-token.js +6 -6
- package/src/models/server-config.js +31 -31
- package/src/request-controller.js +91 -91
- package/src/triggers/models/filter.js +58 -58
- package/src/triggers/models/in-app-message-click-data.js +4 -4
- package/src/triggers/models/push-click-data.js +2 -2
- package/src/triggers/models/trigger-condition.js +35 -35
- package/src/triggers/models/trigger.js +37 -37
- package/src/triggers/triggers-provider-factory.js +3 -3
- package/src/triggers/triggers-provider.js +61 -53
- package/src/types.js +1 -1
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +2 -2
- package/src/ui/js/iam-css.js +2 -2
- package/src/util/base-device-parser.js +1 -1
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +13 -13
- package/src/util/client-hints-parser.js +4 -4
- package/src/util/component-utils.js +4 -4
- package/src/util/dom-utils.js +5 -5
- package/src/util/ecommerce-event-validation.js +77 -48
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +20 -20
- package/src/util/string-utils.js +5 -0
- package/src/util/user-agent-parser.js +15 -15
- package/src/util/validation-utils.js +9 -9
- package/src/util/window-utils.js +2 -2
- package/src/DUST/dust-shared-worker-code.js +0 -2
- package/src/DUST/dust-shared-worker-impl.js +0 -234
- package/src/DUST/dust-worker-bridge.js +0 -151
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import r, { OPTIONS as U } from "../../managers/braze-instance.js";
|
|
2
2
|
import ro from "../../util/browser-detector.js";
|
|
3
3
|
import {
|
|
4
|
-
clickElement as
|
|
5
|
-
supportsPassive as
|
|
4
|
+
clickElement as wt,
|
|
5
|
+
supportsPassive as St,
|
|
6
6
|
} from "../../util/dom-utils.js";
|
|
7
|
-
import { KeyCodes as
|
|
7
|
+
import { KeyCodes as le } from "../../util/key-codes.js";
|
|
8
8
|
import f from "../../managers/subscription-manager.js";
|
|
9
|
-
import { isIFrame as
|
|
9
|
+
import { isIFrame as xt } from "../utils/in-app-message-utils.js";
|
|
10
10
|
import {
|
|
11
11
|
IamStrings as mr,
|
|
12
12
|
IamColors as ss,
|
|
13
|
-
IamClickAction as
|
|
14
|
-
IAM_SHOW_CLASS as
|
|
15
|
-
IAM_HIDE_CLASS as
|
|
16
|
-
|
|
17
|
-
IamSlideFrom as Ee,
|
|
13
|
+
IamClickAction as ce,
|
|
14
|
+
IAM_SHOW_CLASS as Et,
|
|
15
|
+
IAM_HIDE_CLASS as Ht,
|
|
16
|
+
IamSlideFrom as fe,
|
|
18
17
|
IamDismissType as pr,
|
|
19
|
-
IamOpenTarget as
|
|
20
|
-
IamImageStyle as
|
|
21
|
-
IamOrientation as
|
|
22
|
-
IamTextAlignment as
|
|
23
|
-
IamCropType as
|
|
24
|
-
IamServerTypes as
|
|
25
|
-
IamTiming as
|
|
18
|
+
IamOpenTarget as dt,
|
|
19
|
+
IamImageStyle as ue,
|
|
20
|
+
IamOrientation as be,
|
|
21
|
+
IamTextAlignment as pe,
|
|
22
|
+
IamCropType as de,
|
|
23
|
+
IamServerTypes as gt,
|
|
24
|
+
IamTiming as kt,
|
|
26
25
|
IamSerializationKeys as cr,
|
|
27
26
|
} from "../constants.js";
|
|
28
27
|
export default class InAppMessage {
|
|
@@ -93,18 +92,18 @@ export default class InAppMessage {
|
|
|
93
92
|
(this.language = D),
|
|
94
93
|
(this.altImageText = z),
|
|
95
94
|
(this.message = t),
|
|
96
|
-
(this.messageAlignment = s ||
|
|
95
|
+
(this.messageAlignment = s || pe.CENTER),
|
|
97
96
|
(this.duration = u || 5e3),
|
|
98
|
-
(this.slideFrom = i ||
|
|
97
|
+
(this.slideFrom = i || fe.BOTTOM),
|
|
99
98
|
(this.extras = h || {}),
|
|
100
99
|
(this.triggerId = e),
|
|
101
|
-
(this.clickAction = n ||
|
|
100
|
+
(this.clickAction = n || ce.NONE),
|
|
102
101
|
(this.uri = r),
|
|
103
|
-
(this.openTarget = o ||
|
|
102
|
+
(this.openTarget = o || dt.NONE),
|
|
104
103
|
(this.dismissType = l || pr.AUTO_DISMISS),
|
|
105
104
|
(this.icon = a),
|
|
106
105
|
(this.imageUrl = m),
|
|
107
|
-
(this.imageStyle = c ||
|
|
106
|
+
(this.imageStyle = c || ue.TOP),
|
|
108
107
|
(this.iconColor = d || ss.AE),
|
|
109
108
|
(this.iconBackgroundColor = p || ss._E),
|
|
110
109
|
(this.backgroundColor = b || ss.AE),
|
|
@@ -115,11 +114,11 @@ export default class InAppMessage {
|
|
|
115
114
|
(this.animateOut = j),
|
|
116
115
|
null == this.animateOut && (this.animateOut = !0),
|
|
117
116
|
(this.header = k),
|
|
118
|
-
(this.headerAlignment = w ||
|
|
117
|
+
(this.headerAlignment = w || pe.CENTER),
|
|
119
118
|
(this.headerTextColor = y || ss.IE),
|
|
120
|
-
(this.frameColor = S || ss.
|
|
119
|
+
(this.frameColor = S || ss.LE),
|
|
121
120
|
(this.buttons = T || []),
|
|
122
|
-
(this.cropType = x ||
|
|
121
|
+
(this.cropType = x || de.FIT_CENTER),
|
|
123
122
|
(this.orientation = E),
|
|
124
123
|
(this.htmlId = H),
|
|
125
124
|
(this.css = M),
|
|
@@ -131,26 +130,27 @@ export default class InAppMessage {
|
|
|
131
130
|
(this.hs = !1),
|
|
132
131
|
(this.rd = !1),
|
|
133
132
|
(this.sh = !1),
|
|
134
|
-
(this.
|
|
133
|
+
(this.ih = !1),
|
|
134
|
+
(this.Bo = null),
|
|
135
135
|
(this.$o = null),
|
|
136
136
|
(this.ti = new f()),
|
|
137
|
-
(this.
|
|
138
|
-
(this.
|
|
137
|
+
(this.hh = new f()),
|
|
138
|
+
(this.qo = pe.CENTER);
|
|
139
139
|
}
|
|
140
140
|
subscribeToClickedEvent(t) {
|
|
141
141
|
return this.ti.Ut(t);
|
|
142
142
|
}
|
|
143
143
|
subscribeToDismissedEvent(t) {
|
|
144
|
-
return this.
|
|
144
|
+
return this.hh.Ut(t);
|
|
145
145
|
}
|
|
146
146
|
removeSubscription(t) {
|
|
147
|
-
this.ti.removeSubscription(t), this.
|
|
147
|
+
this.ti.removeSubscription(t), this.hh.removeSubscription(t);
|
|
148
148
|
}
|
|
149
149
|
removeAllSubscriptions() {
|
|
150
|
-
this.ti.removeAllSubscriptions(), this.
|
|
150
|
+
this.ti.removeAllSubscriptions(), this.hh.removeAllSubscriptions();
|
|
151
151
|
}
|
|
152
152
|
closeMessage() {
|
|
153
|
-
this.tl(this.
|
|
153
|
+
this.tl(this.Bo);
|
|
154
154
|
}
|
|
155
155
|
zo() {
|
|
156
156
|
return !0;
|
|
@@ -158,14 +158,14 @@ export default class InAppMessage {
|
|
|
158
158
|
od() {
|
|
159
159
|
return this.zo();
|
|
160
160
|
}
|
|
161
|
-
|
|
161
|
+
ko() {
|
|
162
162
|
return null != this.htmlId && this.htmlId.length > 4;
|
|
163
163
|
}
|
|
164
164
|
Mo() {
|
|
165
|
-
return this.
|
|
165
|
+
return this.ko() && null != this.css && this.css.length > 0;
|
|
166
166
|
}
|
|
167
|
-
|
|
168
|
-
if (this.
|
|
167
|
+
Co() {
|
|
168
|
+
if (this.ko() && this.Mo()) return this.htmlId + "-css";
|
|
169
169
|
}
|
|
170
170
|
js() {
|
|
171
171
|
return !this.hs && ((this.hs = !0), !0);
|
|
@@ -177,7 +177,7 @@ export default class InAppMessage {
|
|
|
177
177
|
return !this.rd && ((this.rd = !0), this.ti.A(), !0);
|
|
178
178
|
}
|
|
179
179
|
Ft() {
|
|
180
|
-
return !this.sh && ((this.sh = !0), this.
|
|
180
|
+
return !this.sh && ((this.sh = !0), this.hh.A(), !0);
|
|
181
181
|
}
|
|
182
182
|
hide(t) {
|
|
183
183
|
if (t && t.parentNode) {
|
|
@@ -185,16 +185,18 @@ export default class InAppMessage {
|
|
|
185
185
|
if ((null == s && (s = t), this.zo() && null != s.parentNode)) {
|
|
186
186
|
const t = s.parentNode.classList;
|
|
187
187
|
t && t.contains(mr.TE) && t.remove(mr.TE),
|
|
188
|
-
document.body.removeEventListener("touchmove", InAppMessage.
|
|
188
|
+
document.body.removeEventListener("touchmove", InAppMessage.eh);
|
|
189
189
|
}
|
|
190
|
-
s.className = s.className.replace(
|
|
190
|
+
s.className = s.className.replace(Et, Ht);
|
|
191
191
|
}
|
|
192
192
|
return this.animateOut || !1;
|
|
193
193
|
}
|
|
194
194
|
tl(t, s) {
|
|
195
195
|
if (null == t) return;
|
|
196
|
+
if (this.ih) return;
|
|
196
197
|
let i;
|
|
197
|
-
(this.
|
|
198
|
+
(this.ih = !0),
|
|
199
|
+
(this.Bo = null),
|
|
198
200
|
(i =
|
|
199
201
|
-1 === t.className.indexOf("ab-in-app-message")
|
|
200
202
|
? t.getElementsByClassName("ab-in-app-message")[0]
|
|
@@ -209,7 +211,7 @@ export default class InAppMessage {
|
|
|
209
211
|
let s = t.closest(".ab-iam-root");
|
|
210
212
|
null == s && (s = t), s.parentNode && s.parentNode.removeChild(s);
|
|
211
213
|
}
|
|
212
|
-
const i = this.
|
|
214
|
+
const i = this.Co();
|
|
213
215
|
if (null != i) {
|
|
214
216
|
const t = document.getElementById(i);
|
|
215
217
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
@@ -217,15 +219,15 @@ export default class InAppMessage {
|
|
|
217
219
|
null != e && "Safari" === ro.browser && (e.scrollTop = n),
|
|
218
220
|
s ? s() : this.Ft();
|
|
219
221
|
};
|
|
220
|
-
h ? setTimeout(r,
|
|
222
|
+
h ? setTimeout(r, kt.gr) : r(), this.$o && this.$o.focus();
|
|
221
223
|
}
|
|
222
|
-
|
|
224
|
+
Eo() {
|
|
223
225
|
return document.createTextNode(this.message || "");
|
|
224
226
|
}
|
|
225
|
-
|
|
227
|
+
Ao(t) {
|
|
226
228
|
t.setAttribute("alt", this.altImageText || "");
|
|
227
229
|
}
|
|
228
|
-
static
|
|
230
|
+
static eh(t) {
|
|
229
231
|
if (t.targetTouches && t.targetTouches.length > 1) return;
|
|
230
232
|
const s = t.target;
|
|
231
233
|
(s &&
|
|
@@ -236,104 +238,104 @@ export default class InAppMessage {
|
|
|
236
238
|
t.cancelable &&
|
|
237
239
|
t.preventDefault());
|
|
238
240
|
}
|
|
239
|
-
|
|
241
|
+
nh(t) {
|
|
242
|
+
this.ih = !1;
|
|
240
243
|
const s = t.parentNode;
|
|
241
244
|
this.zo() &&
|
|
242
245
|
null != s &&
|
|
243
|
-
this.orientation !==
|
|
246
|
+
this.orientation !== be.LANDSCAPE &&
|
|
244
247
|
(null != s.classList && s.classList.add(mr.TE),
|
|
245
248
|
document.body.addEventListener(
|
|
246
249
|
"touchmove",
|
|
247
|
-
InAppMessage.
|
|
248
|
-
!!
|
|
250
|
+
InAppMessage.eh,
|
|
251
|
+
!!St() && { passive: !1 },
|
|
249
252
|
)),
|
|
250
|
-
(t.className += " " +
|
|
253
|
+
(t.className += " " + Et);
|
|
251
254
|
}
|
|
252
|
-
static
|
|
255
|
+
static rh(t) {
|
|
253
256
|
if (
|
|
254
|
-
t.keyCode ===
|
|
255
|
-
!r.er(U.
|
|
257
|
+
t.keyCode === le.oh &&
|
|
258
|
+
!r.er(U.lh) &&
|
|
256
259
|
document.querySelectorAll(".ab-modal-interactions").length > 0
|
|
257
260
|
) {
|
|
258
261
|
const t = document.getElementsByClassName("ab-html-message");
|
|
259
262
|
let s = !1;
|
|
260
263
|
for (const i of t) {
|
|
261
264
|
let t = null;
|
|
262
|
-
|
|
265
|
+
xt(i) &&
|
|
263
266
|
i.contentWindow &&
|
|
264
267
|
(t = i.contentWindow.document.getElementsByClassName(
|
|
265
268
|
"ab-programmatic-close-button",
|
|
266
269
|
)[0]),
|
|
267
|
-
null != t && (
|
|
270
|
+
null != t && (wt(t), (s = !0));
|
|
268
271
|
}
|
|
269
272
|
if (!s) {
|
|
270
273
|
const t = document.querySelectorAll(
|
|
271
274
|
".ab-modal-interactions > .ab-close-button",
|
|
272
275
|
)[0];
|
|
273
|
-
null != t &&
|
|
276
|
+
null != t && wt(t);
|
|
274
277
|
}
|
|
275
278
|
}
|
|
276
279
|
}
|
|
277
|
-
|
|
280
|
+
uh() {
|
|
278
281
|
this.th ||
|
|
279
|
-
r.er(U.
|
|
280
|
-
(document.addEventListener("keydown", InAppMessage.
|
|
281
|
-
r.
|
|
282
|
-
document.removeEventListener("keydown", InAppMessage.
|
|
282
|
+
r.er(U.lh) ||
|
|
283
|
+
(document.addEventListener("keydown", InAppMessage.rh, !1),
|
|
284
|
+
r.ah(() => {
|
|
285
|
+
document.removeEventListener("keydown", InAppMessage.rh);
|
|
283
286
|
}),
|
|
284
287
|
(this.th = !0));
|
|
285
288
|
}
|
|
286
289
|
qt(t) {
|
|
287
290
|
const s = {};
|
|
288
291
|
return t
|
|
289
|
-
? ((s[cr.
|
|
290
|
-
(s[cr.
|
|
291
|
-
(s[cr.
|
|
292
|
+
? ((s[cr.UE] = this.message),
|
|
293
|
+
(s[cr.cE] = this.messageAlignment),
|
|
294
|
+
(s[cr.nE] = this.slideFrom),
|
|
292
295
|
(s[cr.Is] = this.extras),
|
|
293
|
-
(s[cr.
|
|
294
|
-
(s[cr.
|
|
296
|
+
(s[cr.PE] = this.triggerId),
|
|
297
|
+
(s[cr.iE] = this.clickAction),
|
|
295
298
|
(s[cr.URI] = this.uri),
|
|
296
|
-
(s[cr.
|
|
297
|
-
(s[cr.
|
|
298
|
-
(s[cr.
|
|
299
|
-
(s[cr.
|
|
299
|
+
(s[cr.pE] = this.openTarget),
|
|
300
|
+
(s[cr.rE] = this.dismissType),
|
|
301
|
+
(s[cr.mE] = this.duration),
|
|
302
|
+
(s[cr.GE] = this.icon),
|
|
300
303
|
(s[cr.Bs] = this.imageUrl),
|
|
301
|
-
(s[cr.
|
|
302
|
-
(s[cr.
|
|
303
|
-
(s[cr.
|
|
304
|
-
(s[cr.
|
|
305
|
-
(s[cr.
|
|
306
|
-
(s[cr.
|
|
307
|
-
(s[cr.
|
|
308
|
-
(s[cr.
|
|
309
|
-
(s[cr.
|
|
310
|
-
(s[cr.
|
|
311
|
-
(s[cr.
|
|
312
|
-
(s[cr.
|
|
313
|
-
(s[cr.
|
|
314
|
-
(s[cr.
|
|
315
|
-
(s[cr.
|
|
316
|
-
(s[cr.
|
|
304
|
+
(s[cr.xE] = this.imageStyle),
|
|
305
|
+
(s[cr.HE] = this.iconColor),
|
|
306
|
+
(s[cr.FE] = this.iconBackgroundColor),
|
|
307
|
+
(s[cr.BE] = this.backgroundColor),
|
|
308
|
+
(s[cr.bE] = this.textColor),
|
|
309
|
+
(s[cr.gE] = this.closeButtonColor),
|
|
310
|
+
(s[cr.lE] = this.animateIn),
|
|
311
|
+
(s[cr.YE] = this.animateOut),
|
|
312
|
+
(s[cr.hE] = this.header),
|
|
313
|
+
(s[cr.KE] = this.headerAlignment),
|
|
314
|
+
(s[cr.WE] = this.headerTextColor),
|
|
315
|
+
(s[cr.XE] = this.frameColor),
|
|
316
|
+
(s[cr.yE] = this.buttons),
|
|
317
|
+
(s[cr.dE] = this.cropType),
|
|
318
|
+
(s[cr.uE] = this.orientation),
|
|
319
|
+
(s[cr.fE] = this.htmlId),
|
|
317
320
|
(s[cr.CSS] = this.css),
|
|
318
321
|
(s[cr.xs] = t),
|
|
319
|
-
(s[cr.
|
|
322
|
+
(s[cr.jE] = this.messageExtras),
|
|
320
323
|
(s[cr.LANGUAGE] = this.language),
|
|
321
324
|
(s[cr.Ns] = this.altImageText),
|
|
322
325
|
s)
|
|
323
326
|
: s;
|
|
324
327
|
}
|
|
325
328
|
}
|
|
326
|
-
(InAppMessage.
|
|
327
|
-
(InAppMessage.
|
|
328
|
-
(InAppMessage.
|
|
329
|
-
(InAppMessage.ClickAction = Le),
|
|
329
|
+
(InAppMessage.mh = ss),
|
|
330
|
+
(InAppMessage.SlideFrom = fe),
|
|
331
|
+
(InAppMessage.ClickAction = ce),
|
|
330
332
|
(InAppMessage.DismissType = pr),
|
|
331
|
-
(InAppMessage.OpenTarget =
|
|
332
|
-
(InAppMessage.ImageStyle =
|
|
333
|
-
(InAppMessage.Orientation =
|
|
334
|
-
(InAppMessage.TextAlignment =
|
|
335
|
-
(InAppMessage.CropType =
|
|
336
|
-
(InAppMessage.dh =
|
|
337
|
-
(InAppMessage.gr =
|
|
338
|
-
(InAppMessage.
|
|
333
|
+
(InAppMessage.OpenTarget = dt),
|
|
334
|
+
(InAppMessage.ImageStyle = ue),
|
|
335
|
+
(InAppMessage.Orientation = be),
|
|
336
|
+
(InAppMessage.TextAlignment = pe),
|
|
337
|
+
(InAppMessage.CropType = de),
|
|
338
|
+
(InAppMessage.dh = gt),
|
|
339
|
+
(InAppMessage.gr = kt.gr),
|
|
340
|
+
(InAppMessage.sE = kt.sE),
|
|
339
341
|
(InAppMessage.bs = cr);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
IamCropType as
|
|
2
|
+
IamCropType as de,
|
|
3
3
|
IamDismissType as pr,
|
|
4
4
|
IamSerializationKeys as cr,
|
|
5
|
-
IamServerTypes as
|
|
6
|
-
IamTextAlignment as
|
|
5
|
+
IamServerTypes as gt,
|
|
6
|
+
IamTextAlignment as pe,
|
|
7
7
|
} from "../constants.js";
|
|
8
8
|
import { buttonsFromSerializedInAppMessage as ur } from "../in-app-message-factory.js";
|
|
9
9
|
import InAppMessage from "./in-app-message.js";
|
|
@@ -66,7 +66,7 @@ export default class ModalMessage extends InAppMessage {
|
|
|
66
66
|
w,
|
|
67
67
|
y,
|
|
68
68
|
S,
|
|
69
|
-
(b = b ||
|
|
69
|
+
(b = b || de.FIT_CENTER),
|
|
70
70
|
void 0,
|
|
71
71
|
k,
|
|
72
72
|
q,
|
|
@@ -74,41 +74,41 @@ export default class ModalMessage extends InAppMessage {
|
|
|
74
74
|
B,
|
|
75
75
|
C,
|
|
76
76
|
),
|
|
77
|
-
(this.
|
|
77
|
+
(this.qo = pe.CENTER);
|
|
78
78
|
}
|
|
79
79
|
qt() {
|
|
80
|
-
return super.qt(
|
|
80
|
+
return super.qt(gt.tE);
|
|
81
81
|
}
|
|
82
|
-
static
|
|
82
|
+
static ua(r) {
|
|
83
83
|
return new ModalMessage(
|
|
84
|
-
r[cr.
|
|
85
|
-
r[cr.
|
|
84
|
+
r[cr.UE],
|
|
85
|
+
r[cr.cE],
|
|
86
86
|
r[cr.Is],
|
|
87
|
-
r[cr.
|
|
88
|
-
r[cr.
|
|
87
|
+
r[cr.PE],
|
|
88
|
+
r[cr.iE],
|
|
89
89
|
r[cr.URI],
|
|
90
|
+
r[cr.pE],
|
|
91
|
+
r[cr.rE],
|
|
92
|
+
r[cr.mE],
|
|
93
|
+
r[cr.GE],
|
|
94
|
+
r[cr.Bs],
|
|
90
95
|
r[cr.xE],
|
|
96
|
+
r[cr.HE],
|
|
97
|
+
r[cr.FE],
|
|
91
98
|
r[cr.BE],
|
|
92
|
-
r[cr.lE],
|
|
93
99
|
r[cr.bE],
|
|
94
|
-
r[cr.Bs],
|
|
95
100
|
r[cr.gE],
|
|
101
|
+
r[cr.lE],
|
|
96
102
|
r[cr.YE],
|
|
103
|
+
r[cr.hE],
|
|
97
104
|
r[cr.KE],
|
|
105
|
+
r[cr.WE],
|
|
98
106
|
r[cr.XE],
|
|
107
|
+
ur(r[cr.yE]),
|
|
99
108
|
r[cr.dE],
|
|
100
|
-
r[cr.hE],
|
|
101
|
-
r[cr.yE],
|
|
102
|
-
r[cr.uE],
|
|
103
|
-
r[cr.WE],
|
|
104
109
|
r[cr.fE],
|
|
105
|
-
r[cr.jE],
|
|
106
|
-
r[cr.kE],
|
|
107
|
-
ur(r[cr.vE]),
|
|
108
|
-
r[cr.wE],
|
|
109
|
-
r[cr.VE],
|
|
110
110
|
r[cr.CSS],
|
|
111
|
-
r[cr.
|
|
111
|
+
r[cr.jE],
|
|
112
112
|
r[cr.LANGUAGE],
|
|
113
113
|
r[cr.Ns],
|
|
114
114
|
);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import InAppMessage from "./in-app-message.js";
|
|
2
|
-
import { DOMUtils as
|
|
2
|
+
import { DOMUtils as zt } from "../../util/dom-utils.js";
|
|
3
3
|
import {
|
|
4
4
|
IamColors as ss,
|
|
5
5
|
IamSerializationKeys as cr,
|
|
6
|
-
IamServerTypes as
|
|
7
|
-
IamSlideFrom as
|
|
8
|
-
IamTextAlignment as
|
|
6
|
+
IamServerTypes as gt,
|
|
7
|
+
IamSlideFrom as fe,
|
|
8
|
+
IamTextAlignment as pe,
|
|
9
9
|
} from "../constants.js";
|
|
10
10
|
export default class SlideUpMessage extends InAppMessage {
|
|
11
11
|
constructor(
|
|
@@ -34,11 +34,11 @@ export default class SlideUpMessage extends InAppMessage {
|
|
|
34
34
|
b,
|
|
35
35
|
z,
|
|
36
36
|
) {
|
|
37
|
-
(f = f || ss.
|
|
38
|
-
(v = v || ss.
|
|
37
|
+
(f = f || ss.OE),
|
|
38
|
+
(v = v || ss.SE),
|
|
39
39
|
super(
|
|
40
40
|
t,
|
|
41
|
-
(s = s ||
|
|
41
|
+
(s = s || pe.START),
|
|
42
42
|
e,
|
|
43
43
|
o,
|
|
44
44
|
i,
|
|
@@ -70,50 +70,50 @@ export default class SlideUpMessage extends InAppMessage {
|
|
|
70
70
|
b,
|
|
71
71
|
z,
|
|
72
72
|
),
|
|
73
|
-
(this.
|
|
73
|
+
(this.qo = pe.START);
|
|
74
74
|
}
|
|
75
75
|
zo() {
|
|
76
76
|
return !1;
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
Eo() {
|
|
79
79
|
const t = document.createElement("span");
|
|
80
80
|
return t.appendChild(document.createTextNode(this.message || "")), t;
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
nh(t) {
|
|
83
83
|
const s = t.getElementsByClassName("ab-in-app-message")[0];
|
|
84
|
-
|
|
85
|
-
(this.slideFrom ===
|
|
84
|
+
zt.td(s, !0, !0) ||
|
|
85
|
+
(this.slideFrom === fe.TOP
|
|
86
86
|
? (s.style.top = "0px")
|
|
87
87
|
: (s.style.bottom = "0px")),
|
|
88
|
-
super.
|
|
88
|
+
super.nh(t);
|
|
89
89
|
}
|
|
90
90
|
qt() {
|
|
91
|
-
return super.qt(
|
|
91
|
+
return super.qt(gt.RE);
|
|
92
92
|
}
|
|
93
|
-
static
|
|
93
|
+
static ua(t) {
|
|
94
94
|
return new SlideUpMessage(
|
|
95
|
+
t[cr.UE],
|
|
96
|
+
t[cr.cE],
|
|
97
|
+
t[cr.nE],
|
|
98
|
+
t[cr.Is],
|
|
99
|
+
t[cr.PE],
|
|
100
|
+
t[cr.iE],
|
|
101
|
+
t[cr.URI],
|
|
102
|
+
t[cr.pE],
|
|
95
103
|
t[cr.rE],
|
|
96
104
|
t[cr.mE],
|
|
97
105
|
t[cr.GE],
|
|
98
|
-
t[cr.
|
|
99
|
-
t[cr.FE],
|
|
106
|
+
t[cr.Bs],
|
|
100
107
|
t[cr.HE],
|
|
101
|
-
t[cr.
|
|
102
|
-
t[cr.xE],
|
|
108
|
+
t[cr.FE],
|
|
103
109
|
t[cr.BE],
|
|
104
|
-
t[cr.lE],
|
|
105
110
|
t[cr.bE],
|
|
106
|
-
t[cr.
|
|
111
|
+
t[cr.gE],
|
|
112
|
+
t[cr.lE],
|
|
107
113
|
t[cr.YE],
|
|
108
|
-
t[cr.
|
|
109
|
-
t[cr.XE],
|
|
110
|
-
t[cr.dE],
|
|
111
|
-
t[cr.hE],
|
|
112
|
-
t[cr.yE],
|
|
113
|
-
t[cr.uE],
|
|
114
|
-
t[cr.VE],
|
|
114
|
+
t[cr.fE],
|
|
115
115
|
t[cr.CSS],
|
|
116
|
-
t[cr.
|
|
116
|
+
t[cr.jE],
|
|
117
117
|
t[cr.LANGUAGE],
|
|
118
118
|
t[cr.Ns],
|
|
119
119
|
);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export default class Jt {
|
|
2
2
|
constructor(t, s, i, h, l) {
|
|
3
3
|
(this.triggerId = t),
|
|
4
|
-
(this.
|
|
5
|
-
(this.
|
|
6
|
-
(this.
|
|
7
|
-
(this.
|
|
4
|
+
(this.Zo = s),
|
|
5
|
+
(this.Vo = i),
|
|
6
|
+
(this.ta = h),
|
|
7
|
+
(this.ia = l),
|
|
8
8
|
(this.triggerId = t),
|
|
9
|
-
(this.
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
12
|
-
(this.
|
|
9
|
+
(this.Zo = s),
|
|
10
|
+
(this.Vo = i),
|
|
11
|
+
(this.ta = h),
|
|
12
|
+
(this.ia = l);
|
|
13
13
|
}
|
|
14
14
|
static fromJson(t, s, i, h, l) {
|
|
15
15
|
return null == t || null == t.trigger_id
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import r from "../managers/braze-instance.js";
|
|
2
|
-
import
|
|
2
|
+
import se from "./in-app-message-manager-factory.js";
|
|
3
3
|
export function subscribeToInAppMessage(n) {
|
|
4
4
|
if (r.rr())
|
|
5
5
|
return "function" != typeof n
|
|
6
6
|
? null
|
|
7
|
-
:
|
|
7
|
+
: se.ra().En(function (r) {
|
|
8
8
|
return n(r[0]), r.slice(1);
|
|
9
9
|
});
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import se from "../in-app-message-manager-factory.js";
|
|
2
2
|
import r from "../../managers/braze-instance.js";
|
|
3
3
|
import { setupInAppMessageUI as rs } from "../../ui/js/index.js";
|
|
4
4
|
import { showInAppMessage } from "./show-in-app-message.js";
|
|
@@ -6,7 +6,7 @@ import { subscribeToInAppMessage } from "../subscribe-to-in-app-message.js";
|
|
|
6
6
|
export function automaticallyShowInAppMessages() {
|
|
7
7
|
if (!r.rr()) return;
|
|
8
8
|
rs();
|
|
9
|
-
const s =
|
|
9
|
+
const s = se.ra();
|
|
10
10
|
if (null == s.Gn()) {
|
|
11
11
|
const r = subscribeToInAppMessage((s) => showInAppMessage(s));
|
|
12
12
|
s.Nn(r);
|