@braze/web-sdk 5.3.2 → 5.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.
- package/index.d.ts +20 -4
- package/package.json +1 -1
- package/shared-lib/event-types.js +12 -12
- package/shared-lib/indexed-db-adapter.js +14 -14
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +10 -9
- package/src/Card/card-manager.js +46 -42
- package/src/Card/display/card-display.js +59 -58
- package/src/Card/models/card.js +61 -55
- package/src/Card/models/classic-card.js +1 -1
- package/src/Card/models/control-card.js +1 -1
- package/src/Card/models/image-only.js +1 -1
- package/src/Card/util/card-factory.js +20 -20
- package/src/ContentCards/content-cards-provider.js +140 -140
- package/src/ContentCards/get-cached-content-cards.js +1 -1
- package/src/ContentCards/request-content-cards-refresh.js +1 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
- package/src/ContentCards/ui/show-content-cards.js +3 -3
- package/src/Core/disable-sdk.js +2 -2
- package/src/Core/enable-sdk.js +2 -2
- package/src/Core/index.js +1 -0
- package/src/Core/is-initialized.js +4 -0
- package/src/Core/log-custom-event.js +14 -14
- package/src/Core/log-purchase.js +8 -8
- package/src/Core/open-session.js +4 -4
- package/src/Core/wipe-data.js +2 -2
- package/src/FeatureFlags/feature-flag-factory.js +5 -5
- package/src/FeatureFlags/feature-flag.js +1 -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 +12 -12
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
- package/src/Feed/feed-provider.js +29 -29
- package/src/Feed/get-cached-feed.js +1 -1
- package/src/Feed/request-feed-refresh.js +1 -1
- package/src/Feed/subscribe-to-feed-updates.js +1 -1
- package/src/Feed/ui/show-feed.js +1 -1
- package/src/InAppMessage/display/in-app-message-to-html.js +64 -62
- package/src/InAppMessage/in-app-message-manager.js +63 -63
- 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 +2 -2
- package/src/InAppMessage/log-in-app-message-impression.js +1 -1
- package/src/InAppMessage/models/full-screen-message.js +10 -10
- package/src/InAppMessage/models/html-message.js +13 -13
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +59 -59
- package/src/InAppMessage/models/modal-message.js +9 -9
- package/src/InAppMessage/models/slide-up-message.js +11 -11
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/ui/show-in-app-message.js +42 -40
- package/src/Push/push-manager-factory.js +5 -4
- package/src/Push/push-manager.js +77 -89
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +8 -8
- package/src/User/user.js +29 -29
- package/src/common/base-provider.js +1 -1
- package/src/common/event-logger.js +11 -11
- package/src/common/feed-display.js +18 -17
- package/src/l10n/l10n-manager-factory.js +7 -7
- package/src/l10n/l10n-manager.js +15 -5
- package/src/managers/auth-manager.js +9 -9
- package/src/managers/braze-instance.js +89 -87
- package/src/managers/device-manager.js +17 -17
- package/src/managers/network-manager.js +130 -130
- package/src/managers/server-config-manager.js +24 -24
- package/src/managers/session-manager.js +12 -12
- package/src/managers/storage-manager-factory.js +1 -1
- package/src/managers/storage-manager.js +31 -31
- package/src/managers/subscription-manager.js +2 -2
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +4 -4
- package/src/models/device.js +2 -2
- package/src/models/request-result.js +1 -1
- package/src/models/server-config.js +5 -5
- package/src/request-controller.js +130 -130
- package/src/triggers/models/filter.js +9 -9
- package/src/triggers/models/in-app-message-click-data.js +8 -8
- package/src/triggers/models/push-click-data.js +3 -3
- package/src/triggers/models/trigger-condition.js +27 -27
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +7 -7
- package/src/triggers/triggers-provider.js +29 -29
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +1 -1
- package/src/ui/js/iam-css.js +1 -1
- package/src/util/base-device-parser.js +7 -7
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +21 -21
- package/src/util/client-hints-parser.js +3 -3
- package/src/util/component-utils.js +13 -12
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +17 -17
- package/src/util/user-agent-parser.js +3 -3
- package/src/util/window-utils.js +1 -1
|
@@ -114,10 +114,10 @@ export default class InAppMessage {
|
|
|
114
114
|
(this.qe = InAppMessage.TextAlignment.CENTER);
|
|
115
115
|
}
|
|
116
116
|
subscribeToClickedEvent(t) {
|
|
117
|
-
return this.Et.
|
|
117
|
+
return this.Et.Nt(t);
|
|
118
118
|
}
|
|
119
119
|
subscribeToDismissedEvent(t) {
|
|
120
|
-
return this.rh.
|
|
120
|
+
return this.rh.Nt(t);
|
|
121
121
|
}
|
|
122
122
|
removeSubscription(t) {
|
|
123
123
|
this.Et.removeSubscription(t), this.rh.removeSubscription(t);
|
|
@@ -146,14 +146,14 @@ export default class InAppMessage {
|
|
|
146
146
|
K() {
|
|
147
147
|
return !this.Th && ((this.Th = !0), !0);
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
Wr() {
|
|
150
150
|
return this.Th;
|
|
151
151
|
}
|
|
152
152
|
p(t) {
|
|
153
|
-
return !this.vo && ((this.vo = !0), this.Et.
|
|
153
|
+
return !this.vo && ((this.vo = !0), this.Et.Rt(), !0);
|
|
154
154
|
}
|
|
155
155
|
N() {
|
|
156
|
-
return !this.oh && ((this.oh = !0), this.rh.
|
|
156
|
+
return !this.oh && ((this.oh = !0), this.rh.Rt(), !0);
|
|
157
157
|
}
|
|
158
158
|
hide(t) {
|
|
159
159
|
if (t && t.parentNode) {
|
|
@@ -264,37 +264,37 @@ export default class InAppMessage {
|
|
|
264
264
|
Y(t) {
|
|
265
265
|
const s = {};
|
|
266
266
|
return t
|
|
267
|
-
? ((s[InAppMessage.tt.
|
|
268
|
-
(s[InAppMessage.tt.
|
|
267
|
+
? ((s[InAppMessage.tt.Yr] = this.message),
|
|
268
|
+
(s[InAppMessage.tt.Zr] = this.messageAlignment),
|
|
269
269
|
(s[InAppMessage.tt.Rh] = this.slideFrom),
|
|
270
270
|
(s[InAppMessage.tt.bt] = this.extras),
|
|
271
|
-
(s[InAppMessage.tt.
|
|
272
|
-
(s[InAppMessage.tt.
|
|
271
|
+
(s[InAppMessage.tt.ea] = this.triggerId),
|
|
272
|
+
(s[InAppMessage.tt.ra] = this.clickAction),
|
|
273
273
|
(s[InAppMessage.tt.URI] = this.uri),
|
|
274
|
-
(s[InAppMessage.tt.
|
|
275
|
-
(s[InAppMessage.tt.
|
|
276
|
-
(s[InAppMessage.tt.
|
|
277
|
-
(s[InAppMessage.tt.
|
|
274
|
+
(s[InAppMessage.tt.sa] = this.openTarget),
|
|
275
|
+
(s[InAppMessage.tt.ta] = this.dismissType),
|
|
276
|
+
(s[InAppMessage.tt.ia] = this.duration),
|
|
277
|
+
(s[InAppMessage.tt.aa] = this.icon),
|
|
278
278
|
(s[InAppMessage.tt.ot] = this.imageUrl),
|
|
279
|
-
(s[InAppMessage.tt.
|
|
280
|
-
(s[InAppMessage.tt.
|
|
281
|
-
(s[InAppMessage.tt.
|
|
282
|
-
(s[InAppMessage.tt.
|
|
283
|
-
(s[InAppMessage.tt.
|
|
284
|
-
(s[InAppMessage.tt.
|
|
285
|
-
(s[InAppMessage.tt.
|
|
286
|
-
(s[InAppMessage.tt.
|
|
287
|
-
(s[InAppMessage.tt.
|
|
288
|
-
(s[InAppMessage.tt.
|
|
289
|
-
(s[InAppMessage.tt.
|
|
290
|
-
(s[InAppMessage.tt.
|
|
291
|
-
(s[InAppMessage.tt.
|
|
292
|
-
(s[InAppMessage.tt.
|
|
293
|
-
(s[InAppMessage.tt.
|
|
294
|
-
(s[InAppMessage.tt.
|
|
279
|
+
(s[InAppMessage.tt.oa] = this.imageStyle),
|
|
280
|
+
(s[InAppMessage.tt.pa] = this.iconColor),
|
|
281
|
+
(s[InAppMessage.tt.ma] = this.iconBackgroundColor),
|
|
282
|
+
(s[InAppMessage.tt.na] = this.backgroundColor),
|
|
283
|
+
(s[InAppMessage.tt.ua] = this.textColor),
|
|
284
|
+
(s[InAppMessage.tt.ca] = this.closeButtonColor),
|
|
285
|
+
(s[InAppMessage.tt.fa] = this.animateIn),
|
|
286
|
+
(s[InAppMessage.tt.da] = this.animateOut),
|
|
287
|
+
(s[InAppMessage.tt.la] = this.header),
|
|
288
|
+
(s[InAppMessage.tt.ga] = this.headerAlignment),
|
|
289
|
+
(s[InAppMessage.tt.ja] = this.headerTextColor),
|
|
290
|
+
(s[InAppMessage.tt.xa] = this.frameColor),
|
|
291
|
+
(s[InAppMessage.tt.za] = this.buttons),
|
|
292
|
+
(s[InAppMessage.tt.ha] = this.cropType),
|
|
293
|
+
(s[InAppMessage.tt.va] = this.orientation),
|
|
294
|
+
(s[InAppMessage.tt.wa] = this.htmlId),
|
|
295
295
|
(s[InAppMessage.tt.CSS] = this.css),
|
|
296
296
|
(s[InAppMessage.tt.Z] = t),
|
|
297
|
-
(s[InAppMessage.tt.
|
|
297
|
+
(s[InAppMessage.tt.ya] = this.messageExtras),
|
|
298
298
|
s)
|
|
299
299
|
: s;
|
|
300
300
|
}
|
|
@@ -340,11 +340,11 @@ export default class InAppMessage {
|
|
|
340
340
|
FIT_CENTER: "FIT_CENTER",
|
|
341
341
|
}),
|
|
342
342
|
(InAppMessage.Be = {
|
|
343
|
-
|
|
344
|
-
|
|
343
|
+
Qr: "SLIDEUP",
|
|
344
|
+
Lr: "MODAL",
|
|
345
345
|
Ue: "MODAL_STYLED",
|
|
346
|
-
|
|
347
|
-
|
|
346
|
+
Hr: "FULL",
|
|
347
|
+
Kr: "WEB_HTML",
|
|
348
348
|
Me: "HTML",
|
|
349
349
|
Ve: "HTML_FULL",
|
|
350
350
|
}),
|
|
@@ -354,36 +354,36 @@ export default class InAppMessage {
|
|
|
354
354
|
(InAppMessage.Ih = "ab-hide"),
|
|
355
355
|
(InAppMessage.lh = "ab-pause-scrolling"),
|
|
356
356
|
(InAppMessage.tt = {
|
|
357
|
-
|
|
358
|
-
|
|
357
|
+
Yr: "m",
|
|
358
|
+
Zr: "ma",
|
|
359
359
|
Rh: "sf",
|
|
360
360
|
bt: "e",
|
|
361
|
-
|
|
362
|
-
|
|
361
|
+
ea: "ti",
|
|
362
|
+
ra: "ca",
|
|
363
363
|
URI: "u",
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
364
|
+
sa: "oa",
|
|
365
|
+
ta: "dt",
|
|
366
|
+
ia: "d",
|
|
367
|
+
aa: "i",
|
|
368
368
|
ot: "iu",
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
369
|
+
oa: "is",
|
|
370
|
+
pa: "ic",
|
|
371
|
+
ma: "ibc",
|
|
372
|
+
na: "bc",
|
|
373
|
+
ua: "tc",
|
|
374
|
+
ca: "cbc",
|
|
375
|
+
fa: "ai",
|
|
376
|
+
da: "ao",
|
|
377
|
+
la: "h",
|
|
378
|
+
ga: "ha",
|
|
379
|
+
ja: "htc",
|
|
380
|
+
xa: "fc",
|
|
381
|
+
za: "b",
|
|
382
|
+
ha: "ct",
|
|
383
|
+
va: "o",
|
|
384
|
+
wa: "hi",
|
|
385
385
|
CSS: "css",
|
|
386
386
|
Z: "type",
|
|
387
387
|
uo: "messageFields",
|
|
388
|
-
|
|
388
|
+
ya: "me",
|
|
389
389
|
});
|
|
@@ -68,21 +68,19 @@ export default class ModalMessage extends InAppMessage {
|
|
|
68
68
|
Y() {
|
|
69
69
|
return super.Y(ModalMessage.it);
|
|
70
70
|
}
|
|
71
|
-
static
|
|
71
|
+
static Jr(e) {
|
|
72
72
|
return new ModalMessage(
|
|
73
|
-
e[InAppMessage.tt.Vr],
|
|
74
|
-
e[InAppMessage.tt.Wr],
|
|
75
|
-
e[InAppMessage.tt.bt],
|
|
76
73
|
e[InAppMessage.tt.Yr],
|
|
77
74
|
e[InAppMessage.tt.Zr],
|
|
78
|
-
e[InAppMessage.tt.
|
|
75
|
+
e[InAppMessage.tt.bt],
|
|
79
76
|
e[InAppMessage.tt.ea],
|
|
80
77
|
e[InAppMessage.tt.ra],
|
|
78
|
+
e[InAppMessage.tt.URI],
|
|
81
79
|
e[InAppMessage.tt.sa],
|
|
82
80
|
e[InAppMessage.tt.ta],
|
|
83
|
-
e[InAppMessage.tt.ot],
|
|
84
81
|
e[InAppMessage.tt.ia],
|
|
85
82
|
e[InAppMessage.tt.aa],
|
|
83
|
+
e[InAppMessage.tt.ot],
|
|
86
84
|
e[InAppMessage.tt.oa],
|
|
87
85
|
e[InAppMessage.tt.pa],
|
|
88
86
|
e[InAppMessage.tt.ma],
|
|
@@ -93,12 +91,14 @@ export default class ModalMessage extends InAppMessage {
|
|
|
93
91
|
e[InAppMessage.tt.da],
|
|
94
92
|
e[InAppMessage.tt.la],
|
|
95
93
|
e[InAppMessage.tt.ga],
|
|
96
|
-
|
|
94
|
+
e[InAppMessage.tt.ja],
|
|
97
95
|
e[InAppMessage.tt.xa],
|
|
96
|
+
pe(e[InAppMessage.tt.za]),
|
|
98
97
|
e[InAppMessage.tt.ha],
|
|
98
|
+
e[InAppMessage.tt.wa],
|
|
99
99
|
e[InAppMessage.tt.CSS],
|
|
100
|
-
e[InAppMessage.tt.
|
|
100
|
+
e[InAppMessage.tt.ya],
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
ModalMessage.it = InAppMessage.Be.
|
|
104
|
+
ModalMessage.it = InAppMessage.Be.Lr;
|
|
@@ -79,31 +79,31 @@ export default class SlideUpMessage extends InAppMessage {
|
|
|
79
79
|
Y() {
|
|
80
80
|
return super.Y(SlideUpMessage.it);
|
|
81
81
|
}
|
|
82
|
-
static
|
|
82
|
+
static Jr(e) {
|
|
83
83
|
return new SlideUpMessage(
|
|
84
|
-
e[InAppMessage.tt.Vr],
|
|
85
|
-
e[InAppMessage.tt.Wr],
|
|
86
|
-
e[InAppMessage.tt.Rh],
|
|
87
|
-
e[InAppMessage.tt.bt],
|
|
88
84
|
e[InAppMessage.tt.Yr],
|
|
89
85
|
e[InAppMessage.tt.Zr],
|
|
90
|
-
e[InAppMessage.tt.
|
|
86
|
+
e[InAppMessage.tt.Rh],
|
|
87
|
+
e[InAppMessage.tt.bt],
|
|
91
88
|
e[InAppMessage.tt.ea],
|
|
92
89
|
e[InAppMessage.tt.ra],
|
|
90
|
+
e[InAppMessage.tt.URI],
|
|
93
91
|
e[InAppMessage.tt.sa],
|
|
94
92
|
e[InAppMessage.tt.ta],
|
|
95
|
-
e[InAppMessage.tt.
|
|
93
|
+
e[InAppMessage.tt.ia],
|
|
96
94
|
e[InAppMessage.tt.aa],
|
|
97
|
-
e[InAppMessage.tt.
|
|
95
|
+
e[InAppMessage.tt.ot],
|
|
98
96
|
e[InAppMessage.tt.pa],
|
|
99
97
|
e[InAppMessage.tt.ma],
|
|
100
98
|
e[InAppMessage.tt.na],
|
|
101
99
|
e[InAppMessage.tt.ua],
|
|
102
100
|
e[InAppMessage.tt.ca],
|
|
103
|
-
e[InAppMessage.tt.
|
|
101
|
+
e[InAppMessage.tt.fa],
|
|
102
|
+
e[InAppMessage.tt.da],
|
|
103
|
+
e[InAppMessage.tt.wa],
|
|
104
104
|
e[InAppMessage.tt.CSS],
|
|
105
|
-
e[InAppMessage.tt.
|
|
105
|
+
e[InAppMessage.tt.ya],
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
SlideUpMessage.it = InAppMessage.Be.
|
|
109
|
+
SlideUpMessage.it = InAppMessage.Be.Qr;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export default class wt {
|
|
2
2
|
constructor(t, s, i, h, l) {
|
|
3
3
|
(this.triggerId = t),
|
|
4
|
-
(this.
|
|
5
|
-
(this.
|
|
6
|
-
(this.
|
|
7
|
-
(this.
|
|
4
|
+
(this.Gr = s),
|
|
5
|
+
(this.Br = i),
|
|
6
|
+
(this.Nr = h),
|
|
7
|
+
(this.Or = l),
|
|
8
8
|
(this.triggerId = t),
|
|
9
|
-
(this.
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
12
|
-
(this.
|
|
9
|
+
(this.Gr = s),
|
|
10
|
+
(this.Br = i),
|
|
11
|
+
(this.Nr = h),
|
|
12
|
+
(this.Or = l);
|
|
13
13
|
}
|
|
14
14
|
static fromJson(t, s, i, h, l) {
|
|
15
15
|
return null == t || null == t.trigger_id
|
|
@@ -17,7 +17,8 @@ import { logger as r } from "../../../shared-lib/index.js";
|
|
|
17
17
|
import { toRgba as ie } from "../../util/color-utils.js";
|
|
18
18
|
import { BRAZE_MUST_BE_INITIALIZED_ERROR as _ } from "../../common/constants.js";
|
|
19
19
|
import { isIFrame as It } from "../utils/in-app-message-utils.js";
|
|
20
|
-
|
|
20
|
+
import ue from "../../l10n/l10n-manager-factory.js";
|
|
21
|
+
export function showInAppMessage(t, o, s) {
|
|
21
22
|
if (!e.X()) return;
|
|
22
23
|
if ((ss(), null == t)) return !1;
|
|
23
24
|
if (t instanceof ControlMessage)
|
|
@@ -39,8 +40,8 @@ export function showInAppMessage(t, s, o) {
|
|
|
39
40
|
),
|
|
40
41
|
!1
|
|
41
42
|
);
|
|
42
|
-
if ((null ==
|
|
43
|
-
if (
|
|
43
|
+
if ((null == o && (o = document.body), t.$e())) {
|
|
44
|
+
if (o.querySelectorAll(".ab-modal-interactions").length > 0)
|
|
44
45
|
return (
|
|
45
46
|
r.info(
|
|
46
47
|
`Cannot show in-app message ${t.message} because another message is being shown.`,
|
|
@@ -56,14 +57,14 @@ export function showInAppMessage(t, s, o) {
|
|
|
56
57
|
(e === fe.LANDSCAPE &&
|
|
57
58
|
t.orientation === InAppMessage.Orientation.PORTRAIT)
|
|
58
59
|
) {
|
|
59
|
-
const
|
|
60
|
-
|
|
60
|
+
const o = e === fe.PORTRAIT ? "portrait" : "landscape",
|
|
61
|
+
s =
|
|
61
62
|
t.orientation === InAppMessage.Orientation.PORTRAIT
|
|
62
63
|
? "portrait"
|
|
63
64
|
: "landscape";
|
|
64
65
|
return (
|
|
65
66
|
r.info(
|
|
66
|
-
`Not showing ${
|
|
67
|
+
`Not showing ${s} in-app message ${t.message} because the screen is currently ${o}`,
|
|
67
68
|
),
|
|
68
69
|
!1
|
|
69
70
|
);
|
|
@@ -72,11 +73,11 @@ export function showInAppMessage(t, s, o) {
|
|
|
72
73
|
if (!e.tr()) {
|
|
73
74
|
let e = !1;
|
|
74
75
|
if (t.buttons && t.buttons.length > 0) {
|
|
75
|
-
const
|
|
76
|
-
for (let t = 0; t <
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
e = R(
|
|
76
|
+
const o = t.buttons;
|
|
77
|
+
for (let t = 0; t < o.length; t++)
|
|
78
|
+
if (o[t].clickAction === InAppMessage.ClickAction.URI) {
|
|
79
|
+
const s = o[t].uri;
|
|
80
|
+
e = R(s);
|
|
80
81
|
}
|
|
81
82
|
} else t.clickAction === InAppMessage.ClickAction.URI && (e = R(t.uri));
|
|
82
83
|
if (e)
|
|
@@ -94,14 +95,14 @@ export function showInAppMessage(t, s, o) {
|
|
|
94
95
|
n.setAttribute("role", "complementary"),
|
|
95
96
|
t.Ce() && (n.id = t.htmlId),
|
|
96
97
|
e.nn(L.jo) && (n.style.zIndex = (e.nn(L.jo) + 1).toString()),
|
|
97
|
-
|
|
98
|
+
o.appendChild(n),
|
|
98
99
|
t.ve())
|
|
99
100
|
) {
|
|
100
|
-
const
|
|
101
|
-
(
|
|
102
|
-
(
|
|
103
|
-
null != e.nn(L.bo) &&
|
|
104
|
-
document.getElementsByTagName("head")[0].appendChild(
|
|
101
|
+
const o = document.createElement("style");
|
|
102
|
+
(o.innerHTML = t.css),
|
|
103
|
+
(o.id = t.we()),
|
|
104
|
+
null != e.nn(L.bo) && o.setAttribute("nonce", e.nn(L.bo)),
|
|
105
|
+
document.getElementsByTagName("head")[0].appendChild(o);
|
|
105
106
|
}
|
|
106
107
|
const a = t instanceof SlideUpMessage,
|
|
107
108
|
l = ce(
|
|
@@ -111,57 +112,57 @@ export function showInAppMessage(t, s, o) {
|
|
|
111
112
|
e.so() ? t.showFeed() : r.error(_);
|
|
112
113
|
});
|
|
113
114
|
},
|
|
114
|
-
(
|
|
115
|
+
(o) => {
|
|
115
116
|
if (t.$e() && t.do()) {
|
|
116
|
-
const
|
|
117
|
+
const s = document.createElement("div");
|
|
117
118
|
if (
|
|
118
|
-
((
|
|
119
|
-
t.ve() || (
|
|
120
|
-
e.nn(L.jo) && (
|
|
121
|
-
n.appendChild(
|
|
119
|
+
((s.className = "ab-page-blocker"),
|
|
120
|
+
t.ve() || (s.style.backgroundColor = ie(t.frameColor)),
|
|
121
|
+
e.nn(L.jo) && (s.style.zIndex = e.nn(L.jo).toString()),
|
|
122
|
+
n.appendChild(s),
|
|
122
123
|
!e.nn(L.Lh))
|
|
123
124
|
) {
|
|
124
125
|
const e = new Date().valueOf();
|
|
125
|
-
|
|
126
|
+
s.onclick = (s) => {
|
|
126
127
|
new Date().valueOf() - e > InAppMessage.fh &&
|
|
127
|
-
(t.Cr(
|
|
128
|
+
(t.Cr(o), s.stopPropagation());
|
|
128
129
|
};
|
|
129
130
|
}
|
|
130
|
-
n.appendChild(
|
|
131
|
+
n.appendChild(o), o.focus(), t.Oh(n);
|
|
131
132
|
} else if (a) {
|
|
132
133
|
const e = document.querySelectorAll(".ab-slideup");
|
|
133
|
-
let
|
|
134
|
+
let s = null;
|
|
134
135
|
for (let t = e.length - 1; t >= 0; t--)
|
|
135
|
-
if (e[t] !==
|
|
136
|
-
|
|
136
|
+
if (e[t] !== o) {
|
|
137
|
+
s = e[t];
|
|
137
138
|
break;
|
|
138
139
|
}
|
|
139
140
|
if (t.slideFrom === InAppMessage.SlideFrom.TOP) {
|
|
140
141
|
let e = 0;
|
|
141
|
-
null !=
|
|
142
|
-
(
|
|
142
|
+
null != s && (e = s.offsetTop + s.offsetHeight),
|
|
143
|
+
(o.style.top = Math.max(e, 0) + "px");
|
|
143
144
|
} else {
|
|
144
145
|
let e = 0;
|
|
145
|
-
null !=
|
|
146
|
+
null != s &&
|
|
146
147
|
(e =
|
|
147
148
|
(window.innerHeight || document.documentElement.clientHeight) -
|
|
148
|
-
|
|
149
|
-
(
|
|
149
|
+
s.offsetTop),
|
|
150
|
+
(o.style.bottom = Math.max(e, 0) + "px");
|
|
150
151
|
}
|
|
151
152
|
} else if (i && !e.nn(L.Lh)) {
|
|
152
153
|
const e = t;
|
|
153
|
-
It(
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
It(o) &&
|
|
155
|
+
o.contentWindow &&
|
|
156
|
+
o.contentWindow.addEventListener("keydown", function (t) {
|
|
156
157
|
t.keyCode === mt.mh && e.closeMessage();
|
|
157
158
|
});
|
|
158
159
|
}
|
|
159
160
|
logInAppMessageImpression(t),
|
|
160
161
|
t.dismissType === InAppMessage.DismissType.AUTO_DISMISS &&
|
|
161
162
|
setTimeout(() => {
|
|
162
|
-
n.contains(
|
|
163
|
+
n.contains(o) && t.Cr(o);
|
|
163
164
|
}, t.duration),
|
|
164
|
-
"function" == typeof
|
|
165
|
+
"function" == typeof s && s();
|
|
165
166
|
},
|
|
166
167
|
(e) => {
|
|
167
168
|
r.info(e);
|
|
@@ -169,7 +170,8 @@ export function showInAppMessage(t, s, o) {
|
|
|
169
170
|
e.nn(L.ho),
|
|
170
171
|
e.nn(L.jo),
|
|
171
172
|
e.nn(L.bo),
|
|
172
|
-
|
|
173
|
+
o,
|
|
174
|
+
ue.m().wo(),
|
|
173
175
|
);
|
|
174
176
|
return (i || a) && (n.appendChild(l), t.Oh(n)), !0;
|
|
175
177
|
}
|