@braze/web-sdk 6.12.1 → 6.13.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 +240 -3
- package/package.json +1 -1
- package/shared-lib/event-types.js +18 -18
- package/shared-lib/indexed-db-adapter.js +58 -58
- package/shared-lib/logger.js +7 -7
- package/shared-lib/supported-options.js +25 -24
- package/src/ConversationalChat/automatically-manage-chat.js +5 -0
- package/src/ConversationalChat/chat-message-factory.js +25 -0
- package/src/ConversationalChat/chat-message.js +33 -0
- package/src/ConversationalChat/constants.js +1 -0
- package/src/ConversationalChat/conversational-chat-provider-factory.js +26 -0
- package/src/ConversationalChat/conversational-chat-provider.js +372 -0
- package/src/ConversationalChat/display/chat-widget-manager.js +113 -0
- package/src/ConversationalChat/display/chat-widget-to-html.js +58 -0
- package/src/ConversationalChat/get-chat-messages.js +7 -0
- package/src/ConversationalChat/index.js +12 -0
- package/src/ConversationalChat/is-chat-conversation-ended.js +7 -0
- package/src/ConversationalChat/is-chat-turn-errored.js +7 -0
- package/src/ConversationalChat/is-chat-turn-in-progress.js +7 -0
- package/src/ConversationalChat/register-chat-action-handler.js +10 -0
- package/src/ConversationalChat/reset-chat-conversation.js +5 -0
- package/src/ConversationalChat/retrieve-chat-config.js +7 -0
- package/src/ConversationalChat/send-chat-message.js +17 -0
- package/src/ConversationalChat/subscribe-to-chat-action.js +5 -0
- package/src/ConversationalChat/subscribe-to-chat-conversation-updated.js +5 -0
- package/src/ConversationalChat/subscribe-to-chat-message-received.js +5 -0
- package/src/ConversationalChat/trigger-chat-action.js +11 -0
- package/src/ConversationalChat/types.js +1 -0
- package/src/Core/add-sdk-metadata.js +5 -5
- package/src/Core/change-user.js +6 -6
- package/src/Core/disable-sdk.js +6 -6
- package/src/Core/enable-sdk.js +3 -3
- package/src/Core/get-device-id.js +2 -2
- package/src/Core/handle-braze-action.js +20 -13
- package/src/Core/is-disabled.js +1 -1
- package/src/Core/is-initialized.js +1 -1
- package/src/Core/log-custom-event.js +9 -9
- package/src/Core/log-ecommerce-event.js +4 -4
- package/src/Core/log-purchase.js +14 -14
- package/src/Core/open-session.js +8 -8
- package/src/Core/set-sdk-authentication-signature.js +3 -3
- package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
- package/src/Core/wipe-data.js +1 -1
- package/src/DUST/dust-config-store.js +35 -35
- package/src/DUST/dust-message-dedup.js +3 -3
- package/src/DUST/dust-provider-factory.js +10 -10
- package/src/DUST/dust-provider.js +234 -234
- package/src/DUST/subscribe-to-dust.js +7 -7
- package/src/FeatureFlags/feature-flag-factory.js +2 -2
- package/src/FeatureFlags/feature-flag.js +4 -4
- package/src/FeatureFlags/feature-flags-provider-factory.js +11 -11
- package/src/FeatureFlags/feature-flags-provider.js +38 -38
- package/src/FeatureFlags/get-all-feature-flags.js +3 -3
- package/src/FeatureFlags/get-feature-flag.js +3 -3
- package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
- package/src/FeatureFlags/refresh-feature-flags.js +5 -5
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +3 -3
- package/src/InAppMessage/defer-in-app-message.js +1 -1
- package/src/InAppMessage/display/html-message-display-utils.js +4 -4
- package/src/InAppMessage/display/html-message-to-html.js +13 -13
- package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
- package/src/InAppMessage/display/modal-utils.js +7 -7
- package/src/InAppMessage/in-app-message-factory.js +6 -6
- package/src/InAppMessage/in-app-message-manager.js +92 -92
- package/src/InAppMessage/log-in-app-message-button-click.js +9 -9
- package/src/InAppMessage/log-in-app-message-click.js +7 -7
- package/src/InAppMessage/log-in-app-message-html-click.js +6 -6
- package/src/InAppMessage/log-in-app-message-impression.js +3 -3
- package/src/InAppMessage/models/full-screen-message.js +39 -39
- package/src/InAppMessage/models/html-message.js +20 -20
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +102 -102
- package/src/InAppMessage/models/modal-message.js +38 -38
- package/src/InAppMessage/models/slide-up-message.js +34 -34
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
- package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +3 -3
- package/src/InAppMessage/ui/show-in-app-message.js +23 -23
- 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 +15 -15
- package/src/Push/push-manager.js +13 -13
- package/src/Push/register-push.js +2 -2
- package/src/Push/request-push-permission.js +2 -2
- package/src/Push/unregister-push-token-on-server.js +3 -3
- package/src/Push/unregister-push.js +3 -3
- package/src/Push/utils/push-utils.js +15 -15
- package/src/User/user-manager.js +9 -9
- package/src/User/user.js +50 -50
- package/src/common/constants.js +1 -1
- package/src/common/content-cards-display.js +22 -22
- package/src/common/event-logger.js +3 -3
- package/src/index.js +2 -9
- package/src/l10n/l10n-manager-factory.js +4 -4
- package/src/l10n/l10n-manager.js +6 -6
- package/src/managers/auth-manager.js +28 -28
- package/src/managers/braze-action-manager.js +14 -0
- package/src/managers/braze-instance.js +159 -151
- package/src/managers/device-manager.js +26 -26
- package/src/managers/network-manager.js +120 -120
- package/src/managers/server-config-manager.js +95 -86
- package/src/managers/session-manager.js +25 -25
- package/src/managers/storage-manager-factory.js +12 -12
- package/src/managers/storage-manager.js +129 -124
- package/src/managers/subscription-manager.js +8 -8
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +5 -5
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +8 -8
- package/src/models/push-token.js +6 -6
- package/src/models/request-result.js +2 -2
- package/src/models/server-config.js +27 -27
- package/src/request-controller.js +117 -117
- package/src/standard-index.js +9 -0
- package/src/triggers/models/custom-event-data.js +4 -4
- package/src/triggers/models/custom-event-property-data.js +5 -5
- package/src/triggers/models/filter-set.js +5 -5
- package/src/triggers/models/filter.js +31 -31
- package/src/triggers/models/in-app-message-click-data.js +9 -9
- package/src/triggers/models/purchase-data.js +1 -1
- package/src/triggers/models/purchase-property-data.js +5 -5
- package/src/triggers/models/push-click-data.js +4 -4
- package/src/triggers/models/trigger-condition.js +35 -35
- package/src/triggers/models/trigger-events.js +3 -3
- package/src/triggers/models/trigger.js +36 -36
- package/src/triggers/triggers-provider-factory.js +5 -5
- package/src/triggers/triggers-provider.js +128 -128
- package/src/types.js +2 -2
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/chat-widget-css.js +11 -0
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/base-device-parser.js +7 -7
- package/src/util/braze-actions.js +5 -5
- package/src/util/browser-detector.js +41 -41
- package/src/util/client-hints-parser.js +10 -10
- package/src/util/component-utils.js +1 -1
- package/src/util/date-utils.js +2 -2
- package/src/util/device-constants.js +5 -5
- package/src/util/dom-utils.js +8 -8
- package/src/util/ecommerce-event-validation.js +13 -13
- package/src/util/html-display-utils.js +6 -6
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +82 -44
- package/src/util/request-header-utils.js +26 -24
- package/src/util/user-agent-parser.js +21 -21
- package/src/util/validation-utils.js +29 -21
- package/src/util/window-utils.js +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
IamDismissType as
|
|
3
|
-
IamSerializationKeys as
|
|
4
|
-
IamServerTypes as
|
|
2
|
+
IamDismissType as cr,
|
|
3
|
+
IamSerializationKeys as jr,
|
|
4
|
+
IamServerTypes as Ot,
|
|
5
5
|
} from "../constants.js";
|
|
6
6
|
import InAppMessage from "./in-app-message.js";
|
|
7
7
|
export default class HtmlMessage extends InAppMessage {
|
|
@@ -15,7 +15,7 @@ export default class HtmlMessage extends InAppMessage {
|
|
|
15
15
|
void 0,
|
|
16
16
|
void 0,
|
|
17
17
|
void 0,
|
|
18
|
-
(t = t ||
|
|
18
|
+
(t = t || cr.MANUAL),
|
|
19
19
|
d,
|
|
20
20
|
void 0,
|
|
21
21
|
void 0,
|
|
@@ -47,30 +47,30 @@ export default class HtmlMessage extends InAppMessage {
|
|
|
47
47
|
return !1;
|
|
48
48
|
}
|
|
49
49
|
Yt(i) {
|
|
50
|
-
if (this.
|
|
50
|
+
if (this.Bo === Ot.ME) {
|
|
51
51
|
if (this.rd) return !1;
|
|
52
52
|
this.rd = !0;
|
|
53
53
|
}
|
|
54
54
|
return this.ti.A(i), !0;
|
|
55
55
|
}
|
|
56
56
|
qt() {
|
|
57
|
-
const i = super.qt(
|
|
58
|
-
return (i[
|
|
57
|
+
const i = super.qt(Ot.ME);
|
|
58
|
+
return (i[jr.wE] = this.messageFields), i;
|
|
59
59
|
}
|
|
60
|
-
static
|
|
60
|
+
static Ea(i) {
|
|
61
61
|
return new HtmlMessage(
|
|
62
|
-
i[
|
|
63
|
-
i[
|
|
64
|
-
i[
|
|
65
|
-
i[
|
|
66
|
-
i[
|
|
67
|
-
i[
|
|
68
|
-
i[
|
|
69
|
-
i[
|
|
70
|
-
i[
|
|
71
|
-
i[
|
|
72
|
-
i[
|
|
73
|
-
i[
|
|
62
|
+
i[jr.UE],
|
|
63
|
+
i[jr.Is],
|
|
64
|
+
i[jr.PE],
|
|
65
|
+
i[jr.rE],
|
|
66
|
+
i[jr.mE],
|
|
67
|
+
i[jr.lE],
|
|
68
|
+
i[jr.YE],
|
|
69
|
+
i[jr.XE],
|
|
70
|
+
i[jr.fE],
|
|
71
|
+
i[jr.CSS],
|
|
72
|
+
i[jr.wE],
|
|
73
|
+
i[jr.jE],
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -15,7 +15,7 @@ export default class InAppMessageButton {
|
|
|
15
15
|
(this.borderColor = r || this.backgroundColor),
|
|
16
16
|
(this.clickAction = h || ce.NONE),
|
|
17
17
|
(this.uri = e),
|
|
18
|
-
null == n && (n = InAppMessageButton.
|
|
18
|
+
null == n && (n = InAppMessageButton.fa),
|
|
19
19
|
(this.id = n),
|
|
20
20
|
(this.rd = !1),
|
|
21
21
|
(this.ti = new f());
|
|
@@ -44,4 +44,4 @@ export default class InAppMessageButton {
|
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
InAppMessageButton.
|
|
47
|
+
InAppMessageButton.fa = -1;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import r, { OPTIONS as U } from "../../managers/braze-instance.js";
|
|
2
|
-
import
|
|
2
|
+
import eo from "../../util/browser-detector.js";
|
|
3
3
|
import {
|
|
4
|
-
clickElement as
|
|
5
|
-
supportsPassive as
|
|
4
|
+
clickElement as Et,
|
|
5
|
+
supportsPassive as Ht,
|
|
6
6
|
} from "../../util/dom-utils.js";
|
|
7
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 Pt } from "../utils/in-app-message-utils.js";
|
|
10
10
|
import {
|
|
11
|
-
IamStrings as
|
|
11
|
+
IamStrings as pr,
|
|
12
12
|
IamColors as ss,
|
|
13
13
|
IamClickAction as ce,
|
|
14
|
-
IAM_SHOW_CLASS as
|
|
15
|
-
IAM_HIDE_CLASS as
|
|
14
|
+
IAM_SHOW_CLASS as Lt,
|
|
15
|
+
IAM_HIDE_CLASS as $t,
|
|
16
16
|
IamSlideFrom as fe,
|
|
17
|
-
IamDismissType as
|
|
18
|
-
IamOpenTarget as
|
|
17
|
+
IamDismissType as cr,
|
|
18
|
+
IamOpenTarget as bt,
|
|
19
19
|
IamImageStyle as ue,
|
|
20
20
|
IamOrientation as be,
|
|
21
21
|
IamTextAlignment as pe,
|
|
22
22
|
IamCropType as de,
|
|
23
|
-
IamServerTypes as
|
|
24
|
-
IamTiming as
|
|
25
|
-
IamSerializationKeys as
|
|
23
|
+
IamServerTypes as Ot,
|
|
24
|
+
IamTiming as qt,
|
|
25
|
+
IamSerializationKeys as jr,
|
|
26
26
|
} from "../constants.js";
|
|
27
27
|
export default class InAppMessage {
|
|
28
28
|
constructor(
|
|
@@ -99,8 +99,8 @@ export default class InAppMessage {
|
|
|
99
99
|
(this.triggerId = e),
|
|
100
100
|
(this.clickAction = n || ce.NONE),
|
|
101
101
|
(this.uri = r),
|
|
102
|
-
(this.openTarget = o ||
|
|
103
|
-
(this.dismissType = l ||
|
|
102
|
+
(this.openTarget = o || bt.NONE),
|
|
103
|
+
(this.dismissType = l || cr.AUTO_DISMISS),
|
|
104
104
|
(this.icon = a),
|
|
105
105
|
(this.imageUrl = m),
|
|
106
106
|
(this.imageStyle = c || ue.TOP),
|
|
@@ -126,31 +126,31 @@ export default class InAppMessage {
|
|
|
126
126
|
(this.messageExtras = C),
|
|
127
127
|
(this.language = D),
|
|
128
128
|
(this.altImageText = z),
|
|
129
|
-
(this.
|
|
129
|
+
(this.Hh = !1),
|
|
130
130
|
(this.hs = !1),
|
|
131
131
|
(this.rd = !1),
|
|
132
|
-
(this.
|
|
133
|
-
(this.
|
|
134
|
-
(this.
|
|
132
|
+
(this.zh = !1),
|
|
133
|
+
(this.Kh = !1),
|
|
134
|
+
(this._o = null),
|
|
135
135
|
(this.$o = null),
|
|
136
136
|
(this.ti = new f()),
|
|
137
|
-
(this.
|
|
138
|
-
(this.
|
|
137
|
+
(this.Qh = new f()),
|
|
138
|
+
(this.Ao = 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.Qh.Ut(t);
|
|
145
145
|
}
|
|
146
146
|
removeSubscription(t) {
|
|
147
|
-
this.ti.removeSubscription(t), this.
|
|
147
|
+
this.ti.removeSubscription(t), this.Qh.removeSubscription(t);
|
|
148
148
|
}
|
|
149
149
|
removeAllSubscriptions() {
|
|
150
|
-
this.ti.removeAllSubscriptions(), this.
|
|
150
|
+
this.ti.removeAllSubscriptions(), this.Qh.removeAllSubscriptions();
|
|
151
151
|
}
|
|
152
152
|
closeMessage() {
|
|
153
|
-
this.tl(this.
|
|
153
|
+
this.tl(this._o);
|
|
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
|
+
Eo() {
|
|
162
162
|
return null != this.htmlId && this.htmlId.length > 4;
|
|
163
163
|
}
|
|
164
|
-
|
|
165
|
-
return this.
|
|
164
|
+
Oo() {
|
|
165
|
+
return this.Eo() && null != this.css && this.css.length > 0;
|
|
166
166
|
}
|
|
167
|
-
|
|
168
|
-
if (this.
|
|
167
|
+
ko() {
|
|
168
|
+
if (this.Eo() && this.Oo()) return this.htmlId + "-css";
|
|
169
169
|
}
|
|
170
170
|
js() {
|
|
171
171
|
return !this.hs && ((this.hs = !0), !0);
|
|
@@ -177,26 +177,26 @@ export default class InAppMessage {
|
|
|
177
177
|
return !this.rd && ((this.rd = !0), this.ti.A(), !0);
|
|
178
178
|
}
|
|
179
179
|
Ft() {
|
|
180
|
-
return !this.
|
|
180
|
+
return !this.zh && ((this.zh = !0), this.Qh.A(), !0);
|
|
181
181
|
}
|
|
182
182
|
hide(t) {
|
|
183
183
|
if (t && t.parentNode) {
|
|
184
184
|
let s = t.closest(".ab-iam-root");
|
|
185
185
|
if ((null == s && (s = t), this.zo() && null != s.parentNode)) {
|
|
186
186
|
const t = s.parentNode.classList;
|
|
187
|
-
t && t.contains(
|
|
188
|
-
document.body.removeEventListener("touchmove", InAppMessage.
|
|
187
|
+
t && t.contains(pr.TE) && t.remove(pr.TE),
|
|
188
|
+
document.body.removeEventListener("touchmove", InAppMessage.Vh);
|
|
189
189
|
}
|
|
190
|
-
s.className = s.className.replace(
|
|
190
|
+
s.className = s.className.replace(Lt, $t);
|
|
191
191
|
}
|
|
192
192
|
return this.animateOut || !1;
|
|
193
193
|
}
|
|
194
194
|
tl(t, s) {
|
|
195
195
|
if (null == t) return;
|
|
196
|
-
if (this.
|
|
196
|
+
if (this.Kh) return;
|
|
197
197
|
let i;
|
|
198
|
-
(this.
|
|
199
|
-
(this.
|
|
198
|
+
(this.Kh = !0),
|
|
199
|
+
(this._o = null),
|
|
200
200
|
(i =
|
|
201
201
|
-1 === t.className.indexOf("ab-in-app-message")
|
|
202
202
|
? t.getElementsByClassName("ab-in-app-message")[0]
|
|
@@ -211,131 +211,131 @@ export default class InAppMessage {
|
|
|
211
211
|
let s = t.closest(".ab-iam-root");
|
|
212
212
|
null == s && (s = t), s.parentNode && s.parentNode.removeChild(s);
|
|
213
213
|
}
|
|
214
|
-
const i = this.
|
|
214
|
+
const i = this.ko();
|
|
215
215
|
if (null != i) {
|
|
216
216
|
const t = document.getElementById(i);
|
|
217
217
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
218
218
|
}
|
|
219
|
-
null != e && "Safari" ===
|
|
219
|
+
null != e && "Safari" === eo.browser && (e.scrollTop = n),
|
|
220
220
|
s ? s() : this.Ft();
|
|
221
221
|
};
|
|
222
|
-
h ? setTimeout(r,
|
|
222
|
+
h ? setTimeout(r, qt.gr) : r(), this.$o && this.$o.focus();
|
|
223
223
|
}
|
|
224
|
-
|
|
224
|
+
Ho() {
|
|
225
225
|
return document.createTextNode(this.message || "");
|
|
226
226
|
}
|
|
227
|
-
|
|
227
|
+
Do(t) {
|
|
228
228
|
t.setAttribute("alt", this.altImageText || "");
|
|
229
229
|
}
|
|
230
|
-
static
|
|
230
|
+
static Vh(t) {
|
|
231
231
|
if (t.targetTouches && t.targetTouches.length > 1) return;
|
|
232
232
|
const s = t.target;
|
|
233
233
|
(s &&
|
|
234
234
|
s.classList &&
|
|
235
235
|
s.classList.contains("ab-message-text") &&
|
|
236
236
|
s.scrollHeight > s.clientHeight) ||
|
|
237
|
-
(document.querySelector(`.${
|
|
237
|
+
(document.querySelector(`.${pr.TE}`) &&
|
|
238
238
|
t.cancelable &&
|
|
239
239
|
t.preventDefault());
|
|
240
240
|
}
|
|
241
|
-
|
|
242
|
-
this.
|
|
241
|
+
Wh(t) {
|
|
242
|
+
this.Kh = !1;
|
|
243
243
|
const s = t.parentNode;
|
|
244
244
|
this.zo() &&
|
|
245
245
|
null != s &&
|
|
246
246
|
this.orientation !== be.LANDSCAPE &&
|
|
247
|
-
(null != s.classList && s.classList.add(
|
|
247
|
+
(null != s.classList && s.classList.add(pr.TE),
|
|
248
248
|
document.body.addEventListener(
|
|
249
249
|
"touchmove",
|
|
250
|
-
InAppMessage.
|
|
251
|
-
!!
|
|
250
|
+
InAppMessage.Vh,
|
|
251
|
+
!!Ht() && { passive: !1 },
|
|
252
252
|
)),
|
|
253
|
-
(t.className += " " +
|
|
253
|
+
(t.className += " " + Lt);
|
|
254
254
|
}
|
|
255
|
-
static
|
|
255
|
+
static Xh(t) {
|
|
256
256
|
if (
|
|
257
|
-
t.keyCode === le.
|
|
258
|
-
!r.er(U.
|
|
257
|
+
t.keyCode === le.Yh &&
|
|
258
|
+
!r.er(U.Zh) &&
|
|
259
259
|
document.querySelectorAll(".ab-modal-interactions").length > 0
|
|
260
260
|
) {
|
|
261
261
|
const t = document.getElementsByClassName("ab-html-message");
|
|
262
262
|
let s = !1;
|
|
263
263
|
for (const i of t) {
|
|
264
264
|
let t = null;
|
|
265
|
-
|
|
265
|
+
Pt(i) &&
|
|
266
266
|
i.contentWindow &&
|
|
267
267
|
(t = i.contentWindow.document.getElementsByClassName(
|
|
268
268
|
"ab-programmatic-close-button",
|
|
269
269
|
)[0]),
|
|
270
|
-
null != t && (
|
|
270
|
+
null != t && (Et(t), (s = !0));
|
|
271
271
|
}
|
|
272
272
|
if (!s) {
|
|
273
273
|
const t = document.querySelectorAll(
|
|
274
274
|
".ab-modal-interactions > .ab-close-button",
|
|
275
275
|
)[0];
|
|
276
|
-
null != t &&
|
|
276
|
+
null != t && Et(t);
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
|
-
|
|
281
|
-
this.
|
|
282
|
-
r.er(U.
|
|
283
|
-
(document.addEventListener("keydown", InAppMessage.
|
|
284
|
-
r.
|
|
285
|
-
document.removeEventListener("keydown", InAppMessage.
|
|
280
|
+
_h() {
|
|
281
|
+
this.Hh ||
|
|
282
|
+
r.er(U.Zh) ||
|
|
283
|
+
(document.addEventListener("keydown", InAppMessage.Xh, !1),
|
|
284
|
+
r.On(() => {
|
|
285
|
+
document.removeEventListener("keydown", InAppMessage.Xh);
|
|
286
286
|
}),
|
|
287
|
-
(this.
|
|
287
|
+
(this.Hh = !0));
|
|
288
288
|
}
|
|
289
289
|
qt(t) {
|
|
290
290
|
const s = {};
|
|
291
291
|
return t
|
|
292
|
-
? ((s[
|
|
293
|
-
(s[
|
|
294
|
-
(s[
|
|
295
|
-
(s[
|
|
296
|
-
(s[
|
|
297
|
-
(s[
|
|
298
|
-
(s[
|
|
299
|
-
(s[
|
|
300
|
-
(s[
|
|
301
|
-
(s[
|
|
302
|
-
(s[
|
|
303
|
-
(s[
|
|
304
|
-
(s[
|
|
305
|
-
(s[
|
|
306
|
-
(s[
|
|
307
|
-
(s[
|
|
308
|
-
(s[
|
|
309
|
-
(s[
|
|
310
|
-
(s[
|
|
311
|
-
(s[
|
|
312
|
-
(s[
|
|
313
|
-
(s[
|
|
314
|
-
(s[
|
|
315
|
-
(s[
|
|
316
|
-
(s[
|
|
317
|
-
(s[
|
|
318
|
-
(s[
|
|
319
|
-
(s[
|
|
320
|
-
(s[
|
|
321
|
-
(s[
|
|
322
|
-
(s[
|
|
323
|
-
(s[
|
|
324
|
-
(s[
|
|
292
|
+
? ((s[jr.UE] = this.message),
|
|
293
|
+
(s[jr.cE] = this.messageAlignment),
|
|
294
|
+
(s[jr.nE] = this.slideFrom),
|
|
295
|
+
(s[jr.Is] = this.extras),
|
|
296
|
+
(s[jr.PE] = this.triggerId),
|
|
297
|
+
(s[jr.iE] = this.clickAction),
|
|
298
|
+
(s[jr.URI] = this.uri),
|
|
299
|
+
(s[jr.pE] = this.openTarget),
|
|
300
|
+
(s[jr.rE] = this.dismissType),
|
|
301
|
+
(s[jr.mE] = this.duration),
|
|
302
|
+
(s[jr.GE] = this.icon),
|
|
303
|
+
(s[jr.Bs] = this.imageUrl),
|
|
304
|
+
(s[jr.xE] = this.imageStyle),
|
|
305
|
+
(s[jr.HE] = this.iconColor),
|
|
306
|
+
(s[jr.FE] = this.iconBackgroundColor),
|
|
307
|
+
(s[jr.BE] = this.backgroundColor),
|
|
308
|
+
(s[jr.bE] = this.textColor),
|
|
309
|
+
(s[jr.gE] = this.closeButtonColor),
|
|
310
|
+
(s[jr.lE] = this.animateIn),
|
|
311
|
+
(s[jr.YE] = this.animateOut),
|
|
312
|
+
(s[jr.hE] = this.header),
|
|
313
|
+
(s[jr.KE] = this.headerAlignment),
|
|
314
|
+
(s[jr.WE] = this.headerTextColor),
|
|
315
|
+
(s[jr.XE] = this.frameColor),
|
|
316
|
+
(s[jr.yE] = this.buttons),
|
|
317
|
+
(s[jr.dE] = this.cropType),
|
|
318
|
+
(s[jr.uE] = this.orientation),
|
|
319
|
+
(s[jr.fE] = this.htmlId),
|
|
320
|
+
(s[jr.CSS] = this.css),
|
|
321
|
+
(s[jr.xs] = t),
|
|
322
|
+
(s[jr.jE] = this.messageExtras),
|
|
323
|
+
(s[jr.LANGUAGE] = this.language),
|
|
324
|
+
(s[jr.Ns] = this.altImageText),
|
|
325
325
|
s)
|
|
326
326
|
: s;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
(InAppMessage.
|
|
329
|
+
(InAppMessage.sl = ss),
|
|
330
330
|
(InAppMessage.SlideFrom = fe),
|
|
331
331
|
(InAppMessage.ClickAction = ce),
|
|
332
|
-
(InAppMessage.DismissType =
|
|
333
|
-
(InAppMessage.OpenTarget =
|
|
332
|
+
(InAppMessage.DismissType = cr),
|
|
333
|
+
(InAppMessage.OpenTarget = bt),
|
|
334
334
|
(InAppMessage.ImageStyle = ue),
|
|
335
335
|
(InAppMessage.Orientation = be),
|
|
336
336
|
(InAppMessage.TextAlignment = pe),
|
|
337
337
|
(InAppMessage.CropType = de),
|
|
338
|
-
(InAppMessage.
|
|
339
|
-
(InAppMessage.gr =
|
|
340
|
-
(InAppMessage.sE =
|
|
341
|
-
(InAppMessage.bs =
|
|
338
|
+
(InAppMessage.il = Ot),
|
|
339
|
+
(InAppMessage.gr = qt.gr),
|
|
340
|
+
(InAppMessage.sE = qt.sE),
|
|
341
|
+
(InAppMessage.bs = jr);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IamCropType as de,
|
|
3
|
-
IamDismissType as
|
|
4
|
-
IamSerializationKeys as
|
|
5
|
-
IamServerTypes as
|
|
3
|
+
IamDismissType as cr,
|
|
4
|
+
IamSerializationKeys as jr,
|
|
5
|
+
IamServerTypes as Ot,
|
|
6
6
|
IamTextAlignment as pe,
|
|
7
7
|
} from "../constants.js";
|
|
8
|
-
import { buttonsFromSerializedInAppMessage as
|
|
8
|
+
import { buttonsFromSerializedInAppMessage as gr } from "../in-app-message-factory.js";
|
|
9
9
|
import InAppMessage from "./in-app-message.js";
|
|
10
10
|
export default class ModalMessage extends InAppMessage {
|
|
11
11
|
constructor(
|
|
@@ -49,7 +49,7 @@ export default class ModalMessage extends InAppMessage {
|
|
|
49
49
|
o,
|
|
50
50
|
i,
|
|
51
51
|
a,
|
|
52
|
-
(p = p ||
|
|
52
|
+
(p = p || cr.MANUAL),
|
|
53
53
|
m,
|
|
54
54
|
n,
|
|
55
55
|
c,
|
|
@@ -74,43 +74,43 @@ export default class ModalMessage extends InAppMessage {
|
|
|
74
74
|
B,
|
|
75
75
|
C,
|
|
76
76
|
),
|
|
77
|
-
(this.
|
|
77
|
+
(this.Ao = pe.CENTER);
|
|
78
78
|
}
|
|
79
79
|
qt() {
|
|
80
|
-
return super.qt(
|
|
80
|
+
return super.qt(Ot.tE);
|
|
81
81
|
}
|
|
82
|
-
static
|
|
82
|
+
static Ea(r) {
|
|
83
83
|
return new ModalMessage(
|
|
84
|
-
r[
|
|
85
|
-
r[
|
|
86
|
-
r[
|
|
87
|
-
r[
|
|
88
|
-
r[
|
|
89
|
-
r[
|
|
90
|
-
r[
|
|
91
|
-
r[
|
|
92
|
-
r[
|
|
93
|
-
r[
|
|
94
|
-
r[
|
|
95
|
-
r[
|
|
96
|
-
r[
|
|
97
|
-
r[
|
|
98
|
-
r[
|
|
99
|
-
r[
|
|
100
|
-
r[
|
|
101
|
-
r[
|
|
102
|
-
r[
|
|
103
|
-
r[
|
|
104
|
-
r[
|
|
105
|
-
r[
|
|
106
|
-
r[
|
|
107
|
-
|
|
108
|
-
r[
|
|
109
|
-
r[
|
|
110
|
-
r[
|
|
111
|
-
r[
|
|
112
|
-
r[
|
|
113
|
-
r[
|
|
84
|
+
r[jr.UE],
|
|
85
|
+
r[jr.cE],
|
|
86
|
+
r[jr.Is],
|
|
87
|
+
r[jr.PE],
|
|
88
|
+
r[jr.iE],
|
|
89
|
+
r[jr.URI],
|
|
90
|
+
r[jr.pE],
|
|
91
|
+
r[jr.rE],
|
|
92
|
+
r[jr.mE],
|
|
93
|
+
r[jr.GE],
|
|
94
|
+
r[jr.Bs],
|
|
95
|
+
r[jr.xE],
|
|
96
|
+
r[jr.HE],
|
|
97
|
+
r[jr.FE],
|
|
98
|
+
r[jr.BE],
|
|
99
|
+
r[jr.bE],
|
|
100
|
+
r[jr.gE],
|
|
101
|
+
r[jr.lE],
|
|
102
|
+
r[jr.YE],
|
|
103
|
+
r[jr.hE],
|
|
104
|
+
r[jr.KE],
|
|
105
|
+
r[jr.WE],
|
|
106
|
+
r[jr.XE],
|
|
107
|
+
gr(r[jr.yE]),
|
|
108
|
+
r[jr.dE],
|
|
109
|
+
r[jr.fE],
|
|
110
|
+
r[jr.CSS],
|
|
111
|
+
r[jr.jE],
|
|
112
|
+
r[jr.LANGUAGE],
|
|
113
|
+
r[jr.Ns],
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import InAppMessage from "./in-app-message.js";
|
|
2
|
-
import { DOMUtils as
|
|
2
|
+
import { DOMUtils as Gt } from "../../util/dom-utils.js";
|
|
3
3
|
import {
|
|
4
4
|
IamColors as ss,
|
|
5
|
-
IamSerializationKeys as
|
|
6
|
-
IamServerTypes as
|
|
5
|
+
IamSerializationKeys as jr,
|
|
6
|
+
IamServerTypes as Ot,
|
|
7
7
|
IamSlideFrom as fe,
|
|
8
8
|
IamTextAlignment as pe,
|
|
9
9
|
} from "../constants.js";
|
|
@@ -70,52 +70,52 @@ export default class SlideUpMessage extends InAppMessage {
|
|
|
70
70
|
b,
|
|
71
71
|
z,
|
|
72
72
|
),
|
|
73
|
-
(this.
|
|
73
|
+
(this.Ao = pe.START);
|
|
74
74
|
}
|
|
75
75
|
zo() {
|
|
76
76
|
return !1;
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
Ho() {
|
|
79
79
|
const t = document.createElement("span");
|
|
80
80
|
return t.appendChild(document.createTextNode(this.message || "")), t;
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
Wh(t) {
|
|
83
83
|
const s = t.getElementsByClassName("ab-in-app-message")[0];
|
|
84
|
-
|
|
84
|
+
Gt.td(s, !0, !0) ||
|
|
85
85
|
(this.slideFrom === fe.TOP
|
|
86
86
|
? (s.style.top = "0px")
|
|
87
87
|
: (s.style.bottom = "0px")),
|
|
88
|
-
super.
|
|
88
|
+
super.Wh(t);
|
|
89
89
|
}
|
|
90
90
|
qt() {
|
|
91
|
-
return super.qt(
|
|
91
|
+
return super.qt(Ot.RE);
|
|
92
92
|
}
|
|
93
|
-
static
|
|
93
|
+
static Ea(t) {
|
|
94
94
|
return new SlideUpMessage(
|
|
95
|
-
t[
|
|
96
|
-
t[
|
|
97
|
-
t[
|
|
98
|
-
t[
|
|
99
|
-
t[
|
|
100
|
-
t[
|
|
101
|
-
t[
|
|
102
|
-
t[
|
|
103
|
-
t[
|
|
104
|
-
t[
|
|
105
|
-
t[
|
|
106
|
-
t[
|
|
107
|
-
t[
|
|
108
|
-
t[
|
|
109
|
-
t[
|
|
110
|
-
t[
|
|
111
|
-
t[
|
|
112
|
-
t[
|
|
113
|
-
t[
|
|
114
|
-
t[
|
|
115
|
-
t[
|
|
116
|
-
t[
|
|
117
|
-
t[
|
|
118
|
-
t[
|
|
95
|
+
t[jr.UE],
|
|
96
|
+
t[jr.cE],
|
|
97
|
+
t[jr.nE],
|
|
98
|
+
t[jr.Is],
|
|
99
|
+
t[jr.PE],
|
|
100
|
+
t[jr.iE],
|
|
101
|
+
t[jr.URI],
|
|
102
|
+
t[jr.pE],
|
|
103
|
+
t[jr.rE],
|
|
104
|
+
t[jr.mE],
|
|
105
|
+
t[jr.GE],
|
|
106
|
+
t[jr.Bs],
|
|
107
|
+
t[jr.HE],
|
|
108
|
+
t[jr.FE],
|
|
109
|
+
t[jr.BE],
|
|
110
|
+
t[jr.bE],
|
|
111
|
+
t[jr.gE],
|
|
112
|
+
t[jr.lE],
|
|
113
|
+
t[jr.YE],
|
|
114
|
+
t[jr.fE],
|
|
115
|
+
t[jr.CSS],
|
|
116
|
+
t[jr.jE],
|
|
117
|
+
t[jr.LANGUAGE],
|
|
118
|
+
t[jr.Ns],
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
@@ -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.Ra = s),
|
|
5
|
+
(this.Sa = i),
|
|
6
|
+
(this._a = h),
|
|
7
|
+
(this.qa = l),
|
|
8
8
|
(this.triggerId = t),
|
|
9
|
-
(this.
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
12
|
-
(this.
|
|
9
|
+
(this.Ra = s),
|
|
10
|
+
(this.Sa = i),
|
|
11
|
+
(this._a = h),
|
|
12
|
+
(this.qa = l);
|
|
13
13
|
}
|
|
14
14
|
static fromJson(t, s, i, h, l) {
|
|
15
15
|
return null == t || null == t.trigger_id
|
|
@@ -7,9 +7,9 @@ export function automaticallyShowInAppMessages() {
|
|
|
7
7
|
if (!r.rr()) return;
|
|
8
8
|
rs();
|
|
9
9
|
const s = se.ra();
|
|
10
|
-
if (null == s.
|
|
10
|
+
if (null == s.oa()) {
|
|
11
11
|
const r = subscribeToInAppMessage((s) => showInAppMessage(s));
|
|
12
|
-
s.
|
|
12
|
+
s.la(r);
|
|
13
13
|
}
|
|
14
|
-
return s.
|
|
14
|
+
return s.oa();
|
|
15
15
|
}
|