@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,11 +1,11 @@
|
|
|
1
1
|
import ro from "../../util/browser-detector.js";
|
|
2
2
|
import { logInAppMessageHtmlClick } from "../index.js";
|
|
3
3
|
import { OperatingSystems as so } from "../../util/device-constants.js";
|
|
4
|
-
import { buildHtmlClickHandler as
|
|
4
|
+
import { buildHtmlClickHandler as bt } from "./html-message-display-utils.js";
|
|
5
5
|
import { attachHtmlToIframeWithNonce as N } from "../../util/html-display-utils.js";
|
|
6
6
|
import { buildBrazeBridge as E } from "../../util/html-display-utils.js";
|
|
7
|
-
import { IamServerTypes as
|
|
8
|
-
export default function
|
|
7
|
+
import { IamServerTypes as gt } from "../constants.js";
|
|
8
|
+
export default function jt(t, o, s, e, n) {
|
|
9
9
|
const i = document.createElement("iframe");
|
|
10
10
|
i.setAttribute("title", "Modal Message"),
|
|
11
11
|
e && (i.style.zIndex = (e + 1).toString());
|
|
@@ -19,7 +19,7 @@ export default function ft(t, o, s, e, n) {
|
|
|
19
19
|
if (t.Mo()) {
|
|
20
20
|
const o = document.createElement("style");
|
|
21
21
|
(o.innerHTML = t.css || ""),
|
|
22
|
-
(o.id = t.
|
|
22
|
+
(o.id = t.Co() || ""),
|
|
23
23
|
null != n && o.setAttribute("nonce", n),
|
|
24
24
|
a.appendChild(o);
|
|
25
25
|
}
|
|
@@ -42,15 +42,15 @@ export default function ft(t, o, s, e, n) {
|
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
);
|
|
45
|
-
if (((e.appboyBridge = r), (e.brazeBridge = r), t.
|
|
45
|
+
if (((e.appboyBridge = r), (e.brazeBridge = r), t.Oo !== gt.CE)) {
|
|
46
46
|
const o = e.document.getElementsByTagName("a");
|
|
47
|
-
for (let e = 0; e < o.length; e++) o[e].onclick =
|
|
47
|
+
for (let e = 0; e < o.length; e++) o[e].onclick = bt(t, i, o[e], s);
|
|
48
48
|
const n = e.document.getElementsByTagName("button");
|
|
49
|
-
for (let o = 0; o < n.length; o++) n[o].onclick =
|
|
49
|
+
for (let o = 0; o < n.length; o++) n[o].onclick = bt(t, i, n[o], s);
|
|
50
50
|
}
|
|
51
51
|
const c = e.document.body;
|
|
52
52
|
if (null != c) {
|
|
53
|
-
t.
|
|
53
|
+
t.ko() && (c.id = t.htmlId || "");
|
|
54
54
|
const o = document.createElement("hidden");
|
|
55
55
|
(o.onclick = r.closeMessage),
|
|
56
56
|
(o.className = "ab-programmatic-close-button"),
|
|
@@ -66,8 +66,8 @@ export default function ft(t, o, s, e, n) {
|
|
|
66
66
|
) {
|
|
67
67
|
const o = document.createElement("div");
|
|
68
68
|
return (
|
|
69
|
-
(o.className = "ab-ios-scroll-wrapper"), o.appendChild(i), (t.
|
|
69
|
+
(o.className = "ab-ios-scroll-wrapper"), o.appendChild(i), (t.Bo = o), o
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
|
-
return (t.
|
|
72
|
+
return (t.Bo = i), i;
|
|
73
73
|
}
|
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addPassiveEventListener as F,
|
|
3
|
-
buildSvg as
|
|
3
|
+
buildSvg as oe,
|
|
4
4
|
detectSwipe as O,
|
|
5
5
|
DIRECTIONS as P,
|
|
6
6
|
} from "../../util/dom-utils.js";
|
|
7
7
|
import { createCloseButton as T } from "../../util/component-utils.js";
|
|
8
|
-
import { isTransparent as
|
|
8
|
+
import { isTransparent as te, toRgba as ae } from "../../util/color-utils.js";
|
|
9
9
|
import FullScreenMessage from "../models/full-screen-message.js";
|
|
10
10
|
import HtmlMessage from "../models/html-message.js";
|
|
11
11
|
import ModalMessage from "../models/modal-message.js";
|
|
12
12
|
import SlideUpMessage from "../models/slide-up-message.js";
|
|
13
13
|
import { logInAppMessageClick } from "../log-in-app-message-click.js";
|
|
14
14
|
import { _handleBrazeAction as Q } from "../../Core/handle-braze-action.js";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import { KeyCodes as
|
|
15
|
+
import jt from "./html-message-to-html.js";
|
|
16
|
+
import ie from "./modal-utils.js";
|
|
17
|
+
import { Guid as V } from "../../../shared-lib/index.js";
|
|
18
|
+
import { KeyCodes as le } from "../../util/key-codes.js";
|
|
19
19
|
import {
|
|
20
|
-
IamClickAction as
|
|
21
|
-
IamCropType as
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
IamTextAlignment as Fe,
|
|
20
|
+
IamClickAction as ce,
|
|
21
|
+
IamCropType as de,
|
|
22
|
+
IamImageStyle as ue,
|
|
23
|
+
IamOpenTarget as dt,
|
|
24
|
+
IamOrientation as be,
|
|
25
|
+
IamSlideFrom as fe,
|
|
26
|
+
IamTextAlignment as pe,
|
|
28
27
|
} from "../constants.js";
|
|
29
|
-
export default function
|
|
28
|
+
export default function ge(e, o, t, a, n, i, s = document.body, m = "ltr") {
|
|
30
29
|
if (((e.$o = document.activeElement), e instanceof HtmlMessage))
|
|
31
|
-
return
|
|
30
|
+
return jt(e, o, a, n, i);
|
|
32
31
|
const l = (function (e, o, t, a, n, i = document.body, s = "ltr") {
|
|
33
32
|
let m = null;
|
|
34
33
|
const l = document.createElement("div");
|
|
@@ -39,55 +38,58 @@ export default function Ge(e, o, t, a, n, i, s = document.body, m = "ltr") {
|
|
|
39
38
|
((l.className += " ab-modal-interactions"),
|
|
40
39
|
l.setAttribute("tabindex", "-1")),
|
|
41
40
|
e.Mo() ||
|
|
42
|
-
((l.style.color =
|
|
43
|
-
(l.style.backgroundColor =
|
|
44
|
-
|
|
41
|
+
((l.style.color = ae(e.textColor)),
|
|
42
|
+
(l.style.backgroundColor = ae(e.backgroundColor)),
|
|
43
|
+
te(e.backgroundColor) && (l.className += " ab-no-shadow"));
|
|
45
44
|
const c = () => {
|
|
46
45
|
-1 !== l.className.indexOf("ab-start-hidden") &&
|
|
47
46
|
((l.className = l.className.replace("ab-start-hidden", "")),
|
|
48
47
|
document.querySelectorAll(".ab-iam-img-loading").length > 0
|
|
49
48
|
? t(
|
|
50
49
|
`Cannot show in-app message ${e.message} because another message is being shown.`,
|
|
51
|
-
qe.tE,
|
|
52
50
|
)
|
|
53
51
|
: o(l));
|
|
54
52
|
},
|
|
55
53
|
r = (o = !0) => {
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
let a = document.querySelectorAll(".ab-iam-root");
|
|
55
|
+
if (
|
|
56
|
+
((a && 0 !== a.length) || (a = i.querySelectorAll(".ab-iam-root")),
|
|
57
|
+
a && a.length > 0)
|
|
58
|
+
)
|
|
59
|
+
if (
|
|
60
|
+
(a[0].classList.remove("ab-iam-img-loading"),
|
|
61
61
|
m && (clearTimeout(m), (m = null)),
|
|
62
|
-
o
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
o)
|
|
63
|
+
)
|
|
64
|
+
c();
|
|
65
|
+
else {
|
|
66
|
+
const o = `Cannot show in-app message ${e.message} because the image failed to load.`;
|
|
67
|
+
t(o);
|
|
68
|
+
}
|
|
67
69
|
};
|
|
68
70
|
if (
|
|
69
|
-
(e.imageStyle ===
|
|
70
|
-
e.orientation ===
|
|
71
|
+
(e.imageStyle === ue.GRAPHIC && (l.className += " graphic"),
|
|
72
|
+
e.orientation === be.LANDSCAPE && (l.className += " landscape"),
|
|
71
73
|
null != e.buttons && 0 === e.buttons.length)
|
|
72
74
|
) {
|
|
73
|
-
e.clickAction !==
|
|
75
|
+
e.clickAction !== ce.NONE && (l.className += " ab-clickable");
|
|
74
76
|
const o = (o) => (
|
|
75
77
|
e.tl(l, () => {
|
|
76
78
|
logInAppMessageClick(e),
|
|
77
|
-
e.clickAction ===
|
|
78
|
-
Q(e.uri || "", a || e.openTarget ===
|
|
79
|
+
e.clickAction === ce.URI &&
|
|
80
|
+
Q(e.uri || "", a || e.openTarget === dt.BLANK, o);
|
|
79
81
|
}),
|
|
80
82
|
o.stopPropagation(),
|
|
81
83
|
!1
|
|
82
84
|
);
|
|
83
85
|
(l.onclick = o),
|
|
84
86
|
l.addEventListener("keydown", (e) => {
|
|
85
|
-
if (e.keyCode ===
|
|
87
|
+
if (e.keyCode === le.Lo || e.keyCode === le.To) return o(e);
|
|
86
88
|
});
|
|
87
89
|
}
|
|
88
90
|
const d = T(
|
|
89
91
|
"Close Message",
|
|
90
|
-
e.Mo() ? void 0 :
|
|
92
|
+
e.Mo() ? void 0 : ae(e.closeButtonColor),
|
|
91
93
|
() => {
|
|
92
94
|
e.tl(l);
|
|
93
95
|
},
|
|
@@ -98,18 +100,18 @@ export default function Ge(e, o, t, a, n, i, s = document.body, m = "ltr") {
|
|
|
98
100
|
(u.className = "ab-message-text"),
|
|
99
101
|
(u.dir = s),
|
|
100
102
|
u.setAttribute("role", "article");
|
|
101
|
-
const
|
|
102
|
-
u.className += " " +
|
|
103
|
-
let
|
|
104
|
-
const
|
|
105
|
-
if (((
|
|
103
|
+
const b = (e.messageAlignment || e.qo).toLowerCase();
|
|
104
|
+
u.className += " " + b + "-aligned";
|
|
105
|
+
let f = !1;
|
|
106
|
+
const p = document.createElement("div");
|
|
107
|
+
if (((p.className = "ab-image-area"), e.imageUrl)) {
|
|
106
108
|
const o = document.createElement("img");
|
|
107
109
|
if (
|
|
108
110
|
(o.setAttribute("src", e.imageUrl),
|
|
109
|
-
e.
|
|
111
|
+
e.Ao(o),
|
|
110
112
|
0 === document.querySelectorAll(".ab-iam-img-loading").length)
|
|
111
113
|
) {
|
|
112
|
-
|
|
114
|
+
f = !0;
|
|
113
115
|
const e = document.querySelectorAll(".ab-iam-root");
|
|
114
116
|
e && e.length > 0 && e[0].classList.add("ab-iam-img-loading"),
|
|
115
117
|
(m = window.setTimeout(() => {
|
|
@@ -122,57 +124,57 @@ export default function Ge(e, o, t, a, n, i, s = document.body, m = "ltr") {
|
|
|
122
124
|
r(!1);
|
|
123
125
|
});
|
|
124
126
|
}
|
|
125
|
-
if (e.cropType ===
|
|
127
|
+
if (e.cropType === de.CENTER_CROP) {
|
|
126
128
|
const e = document.createElement("div");
|
|
127
129
|
(e.className = "ab-center-cropped-img"),
|
|
128
130
|
e.appendChild(o),
|
|
129
|
-
|
|
130
|
-
} else
|
|
131
|
-
l.appendChild(
|
|
131
|
+
p.appendChild(e);
|
|
132
|
+
} else p.appendChild(o);
|
|
133
|
+
l.appendChild(p), (u.className += " ab-with-image");
|
|
132
134
|
} else if (e.icon) {
|
|
133
|
-
|
|
135
|
+
p.className += " ab-icon-area";
|
|
134
136
|
const o = document.createElement("span");
|
|
135
137
|
(o.className = "ab-icon"),
|
|
136
138
|
e.Mo() ||
|
|
137
|
-
((o.style.backgroundColor =
|
|
138
|
-
(o.style.color =
|
|
139
|
+
((o.style.backgroundColor = ae(e.iconBackgroundColor)),
|
|
140
|
+
(o.style.color = ae(e.iconColor)));
|
|
139
141
|
const t = document.createElement("i");
|
|
140
142
|
(t.className = "fa"),
|
|
141
143
|
t.appendChild(document.createTextNode(e.icon)),
|
|
142
144
|
t.setAttribute("aria-hidden", "true"),
|
|
143
145
|
o.appendChild(t),
|
|
144
|
-
|
|
145
|
-
l.appendChild(
|
|
146
|
+
p.appendChild(o),
|
|
147
|
+
l.appendChild(p),
|
|
146
148
|
(u.className += " ab-with-icon");
|
|
147
149
|
}
|
|
148
150
|
if ((F(u, "touchstart"), e.header && e.header.length > 0)) {
|
|
149
151
|
const o = document.createElement("h1");
|
|
150
|
-
(o.className = "ab-message-header"), (e.
|
|
151
|
-
const t = (e.headerAlignment ||
|
|
152
|
+
(o.className = "ab-message-header"), (e.Do = V.de()), (o.id = e.Do);
|
|
153
|
+
const t = (e.headerAlignment || pe.CENTER).toLowerCase();
|
|
152
154
|
(o.className += " " + t + "-aligned"),
|
|
153
|
-
e.Mo() || (o.style.color =
|
|
155
|
+
e.Mo() || (o.style.color = ae(e.headerTextColor)),
|
|
154
156
|
o.appendChild(document.createTextNode(e.header)),
|
|
155
157
|
u.appendChild(o);
|
|
156
158
|
}
|
|
157
|
-
const
|
|
158
|
-
return u.appendChild(
|
|
159
|
+
const g = e.Eo();
|
|
160
|
+
return u.appendChild(g), l.appendChild(u), f || c(), (e.Bo = l), l;
|
|
159
161
|
})(e, o, t, a, n, s, m);
|
|
160
162
|
if (e instanceof FullScreenMessage || e instanceof ModalMessage) {
|
|
161
163
|
const o = e instanceof FullScreenMessage ? "ab-fullscreen" : "ab-modal";
|
|
162
164
|
(l.className += ` ${o} ab-centered`),
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
ie.Go(e, l, a),
|
|
166
|
+
ie.Ho(l),
|
|
167
|
+
ie.Io(e.Do, l);
|
|
166
168
|
} else if (e instanceof SlideUpMessage) {
|
|
167
169
|
(l.className += " ab-slideup"),
|
|
168
170
|
l.setAttribute("tabindex", "0"),
|
|
169
171
|
l.setAttribute("role", "alert");
|
|
170
172
|
const o = l.getElementsByClassName("ab-close-button")[0];
|
|
171
173
|
if (null != o) {
|
|
172
|
-
const t =
|
|
174
|
+
const t = oe(
|
|
173
175
|
"0 0 11.38 19.44",
|
|
174
176
|
"M11.38 9.72l-9.33 9.72L0 17.3l7.27-7.58L0 2.14 2.05 0l9.33 9.72z",
|
|
175
|
-
e.Mo() ? void 0 :
|
|
177
|
+
e.Mo() ? void 0 : ae(e.closeButtonColor),
|
|
176
178
|
);
|
|
177
179
|
t.setAttribute("class", `ab-chevron ${m}`), o.appendChild(t);
|
|
178
180
|
}
|
|
@@ -185,9 +187,9 @@ export default function Ge(e, o, t, a, n, i, s = document.body, m = "ltr") {
|
|
|
185
187
|
(l.className += " ab-swiped-right"),
|
|
186
188
|
null != o && null != o.onclick && o.onclick(e);
|
|
187
189
|
}),
|
|
188
|
-
e.slideFrom ===
|
|
189
|
-
? ((t = P.
|
|
190
|
-
: ((t = P.
|
|
190
|
+
e.slideFrom === fe.TOP
|
|
191
|
+
? ((t = P.Jo), (a = " ab-swiped-up"))
|
|
192
|
+
: ((t = P.Ko), (a = " ab-swiped-down")),
|
|
191
193
|
O(l, t, (e) => {
|
|
192
194
|
(l.className += a), null != o && null != o.onclick && o.onclick(e);
|
|
193
195
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { _handleBrazeAction as Q } from "../../Core/handle-braze-action.js";
|
|
2
2
|
import { logInAppMessageButtonClick } from "../log-in-app-message-button-click.js";
|
|
3
|
-
import { toRgba as
|
|
3
|
+
import { toRgba as ae } from "../../util/color-utils.js";
|
|
4
4
|
import { addPassiveEventListener as F } from "../../util/dom-utils.js";
|
|
5
|
-
import { KeyCodes as
|
|
6
|
-
import { IamClickAction as
|
|
7
|
-
const
|
|
8
|
-
|
|
5
|
+
import { KeyCodes as le } from "../../util/key-codes.js";
|
|
6
|
+
import { IamClickAction as ce, IamOpenTarget as dt } from "../constants.js";
|
|
7
|
+
const ie = {
|
|
8
|
+
Ho: (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 xe = {
|
|
|
14
14
|
s = o[o.length - 1];
|
|
15
15
|
t.addEventListener("keydown", (o) => {
|
|
16
16
|
const a = document.activeElement;
|
|
17
|
-
o.keyCode ===
|
|
17
|
+
o.keyCode === le.No &&
|
|
18
18
|
(o.shiftKey || (a !== s && a !== t)
|
|
19
19
|
? !o.shiftKey ||
|
|
20
20
|
(a !== e && a !== t) ||
|
|
@@ -23,14 +23,14 @@ const xe = {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
Io: (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
|
-
|
|
33
|
+
Go: (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);
|
|
@@ -39,8 +39,8 @@ const xe = {
|
|
|
39
39
|
const l = (s) => (a) => (
|
|
40
40
|
t.tl(o, () => {
|
|
41
41
|
logInAppMessageButtonClick(s, t),
|
|
42
|
-
s.clickAction ===
|
|
43
|
-
Q(s.uri || "", e || t.openTarget ===
|
|
42
|
+
s.clickAction === ce.URI &&
|
|
43
|
+
Q(s.uri || "", e || t.openTarget === dt.BLANK, a);
|
|
44
44
|
}),
|
|
45
45
|
a.stopPropagation(),
|
|
46
46
|
!1
|
|
@@ -55,13 +55,13 @@ const xe = {
|
|
|
55
55
|
"" === e.text && (n = " "),
|
|
56
56
|
a.appendChild(document.createTextNode(n)),
|
|
57
57
|
t.Mo() ||
|
|
58
|
-
((a.style.backgroundColor =
|
|
59
|
-
(a.style.color =
|
|
60
|
-
(a.style.borderColor =
|
|
58
|
+
((a.style.backgroundColor = ae(e.backgroundColor)),
|
|
59
|
+
(a.style.color = ae(e.textColor)),
|
|
60
|
+
(a.style.borderColor = ae(e.borderColor))),
|
|
61
61
|
(a.onclick = l(e)),
|
|
62
62
|
s.appendChild(a);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
};
|
|
67
|
-
export default
|
|
67
|
+
export default ie;
|
|
@@ -1,5 +1,5 @@
|
|
|
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 getDeferredInAppMessage() {
|
|
4
|
-
if (r.rr()) return
|
|
4
|
+
if (r.rr()) return se.ra().sa();
|
|
5
5
|
}
|
|
@@ -5,7 +5,7 @@ import InAppMessageButton from "./models/in-app-message-button.js";
|
|
|
5
5
|
import ModalMessage from "./models/modal-message.js";
|
|
6
6
|
import SlideUpMessage from "./models/slide-up-message.js";
|
|
7
7
|
import { logger as b } from "../../shared-lib/index.js";
|
|
8
|
-
import { IamServerTypes as
|
|
8
|
+
import { IamServerTypes as gt } from "./constants.js";
|
|
9
9
|
export function newInAppMessageFromJson(e) {
|
|
10
10
|
if (!e) return null;
|
|
11
11
|
if (e.is_control) return ControlMessage.fromJson(e);
|
|
@@ -49,7 +49,7 @@ export function newInAppMessageFromJson(e) {
|
|
|
49
49
|
D = e.language,
|
|
50
50
|
E = e.image_alt;
|
|
51
51
|
let G;
|
|
52
|
-
if (o ===
|
|
52
|
+
if (o === gt.tE || o === gt.eE)
|
|
53
53
|
G = new ModalMessage(
|
|
54
54
|
s,
|
|
55
55
|
n,
|
|
@@ -82,7 +82,7 @@ export function newInAppMessageFromJson(e) {
|
|
|
82
82
|
D,
|
|
83
83
|
E,
|
|
84
84
|
);
|
|
85
|
-
else if (o ===
|
|
85
|
+
else if (o === gt.oE)
|
|
86
86
|
G = new FullScreenMessage(
|
|
87
87
|
s,
|
|
88
88
|
n,
|
|
@@ -116,7 +116,7 @@ export function newInAppMessageFromJson(e) {
|
|
|
116
116
|
D,
|
|
117
117
|
E,
|
|
118
118
|
);
|
|
119
|
-
else if (o ===
|
|
119
|
+
else if (o === gt.RE)
|
|
120
120
|
G = new SlideUpMessage(
|
|
121
121
|
s,
|
|
122
122
|
n,
|
|
@@ -144,7 +144,7 @@ export function newInAppMessageFromJson(e) {
|
|
|
144
144
|
E,
|
|
145
145
|
);
|
|
146
146
|
else {
|
|
147
|
-
if (o !==
|
|
147
|
+
if (o !== gt.ME && o !== gt.CE && o !== gt.DE)
|
|
148
148
|
return void b.error("Ignoring message with unknown type " + o);
|
|
149
149
|
{
|
|
150
150
|
const o = e.message_fields;
|
|
@@ -152,7 +152,7 @@ export function newInAppMessageFromJson(e) {
|
|
|
152
152
|
(G.trusted = e.trusted || !1);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
return (G.
|
|
155
|
+
return (G.Oo = o), G;
|
|
156
156
|
}
|
|
157
157
|
export function buttonsFromSerializedInAppMessage(e) {
|
|
158
158
|
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
|
|
3
|
+
const se = {
|
|
4
4
|
na: null,
|
|
5
5
|
i: !1,
|
|
6
6
|
ra: () => (
|
|
7
|
-
|
|
7
|
+
se.t(), se.na || (se.na = new ea(r.m(), r.u(), r.p(), r.ir())), se.na
|
|
8
8
|
),
|
|
9
9
|
t: () => {
|
|
10
|
-
|
|
10
|
+
se.i || (r.g(se), (se.i = !0));
|
|
11
11
|
},
|
|
12
12
|
destroy: () => {
|
|
13
|
-
(
|
|
13
|
+
(se.na = null), (se.i = !1);
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
|
-
export default
|
|
16
|
+
export default se;
|