@braze/web-sdk 4.9.0 → 5.0.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 +2204 -2230
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +1 -1
- package/shared-lib/event-types.js +9 -9
- package/shared-lib/indexed-db-adapter.js +13 -13
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +8 -8
- package/src/Card/models/captioned-image.js +19 -19
- package/src/Card/models/card.js +95 -94
- package/src/Card/models/classic-card.js +19 -19
- package/src/Card/models/control-card.js +9 -9
- package/src/Card/models/image-only.js +21 -22
- package/src/Card/models/index.js +0 -1
- package/src/Card/util/card-factory.js +39 -39
- package/src/ContentCards/content-cards-provider.js +114 -114
- package/src/ContentCards/get-cached-content-cards.js +1 -1
- package/src/ContentCards/index.js +0 -1
- package/src/ContentCards/request-content-cards-refresh.js +1 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
- package/src/ContentCards/ui/hide-content-cards.js +2 -2
- package/src/ContentCards/ui/show-content-cards.js +14 -14
- package/src/Core/add-sdk-metadata.js +2 -2
- package/src/Core/change-user.js +2 -2
- package/src/Core/disable-sdk.js +4 -4
- package/src/Core/enable-sdk.js +4 -4
- package/src/Core/get-device-id.js +9 -7
- package/src/Core/handle-braze-action.js +14 -14
- package/src/Core/is-disabled.js +2 -2
- package/src/Core/open-session.js +5 -5
- package/src/Core/set-sdk-authentication-signature.js +2 -2
- package/src/Core/wipe-data.js +4 -4
- package/src/FeatureFlags/feature-flag-factory.js +10 -10
- package/src/FeatureFlags/feature-flag.js +7 -7
- package/src/FeatureFlags/feature-flags-provider.js +50 -50
- package/src/FeatureFlags/get-all-feature-flags.js +1 -1
- package/src/FeatureFlags/get-feature-flag.js +3 -5
- package/src/Feed/feed-provider-factory.js +8 -8
- package/src/Feed/feed-provider.js +15 -15
- package/src/Feed/get-cached-feed.js +2 -2
- package/src/Feed/request-feed-refresh.js +2 -2
- package/src/Feed/subscribe-to-feed-updates.js +2 -2
- package/src/Feed/ui/hide-feed.js +2 -2
- package/src/Feed/ui/show-feed.js +13 -13
- package/src/InAppMessage/display/html-message-to-html.js +11 -12
- package/src/InAppMessage/display/in-app-message-to-html.js +15 -15
- package/src/InAppMessage/display/modal-utils.js +8 -8
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- package/src/InAppMessage/in-app-message-manager.js +38 -38
- package/src/InAppMessage/models/full-screen-message.js +31 -31
- package/src/InAppMessage/models/html-message.js +16 -16
- package/src/InAppMessage/models/in-app-message-button.js +5 -5
- package/src/InAppMessage/models/in-app-message.js +46 -46
- package/src/InAppMessage/models/modal-message.js +30 -30
- package/src/InAppMessage/models/slide-up-message.js +26 -26
- package/src/InAppMessage/ui/show-in-app-message.js +9 -9
- 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.js +31 -31
- package/src/Push/utils/push-utils.js +9 -9
- package/src/User/user-manager.js +8 -8
- package/src/User/user.js +38 -37
- package/src/common/base-feed.js +15 -14
- package/src/common/base-provider.js +1 -1
- package/src/common/event-logger.js +2 -2
- package/src/common/feed-display.js +32 -32
- package/src/l10n/l10n-manager-factory.js +9 -9
- package/src/managers/auth-manager.js +6 -6
- package/src/managers/braze-instance.js +84 -92
- package/src/managers/device-manager.js +9 -9
- package/src/managers/network-manager.js +72 -69
- package/src/managers/server-config-manager.js +13 -13
- package/src/managers/session-manager.js +9 -9
- package/src/managers/storage-manager-factory.js +11 -11
- package/src/managers/storage-manager.js +110 -110
- package/src/managers/subscription-manager.js +3 -3
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +7 -7
- package/src/models/identifier.js +1 -1
- package/src/models/push-token.js +1 -1
- package/src/models/server-config.js +6 -6
- package/src/request-controller.js +129 -125
- package/src/triggers/models/custom-event-data.js +1 -1
- package/src/triggers/models/custom-event-property-data.js +6 -6
- package/src/triggers/models/filter-set.js +8 -8
- package/src/triggers/models/filter.js +31 -31
- package/src/triggers/models/in-app-message-click-data.js +1 -1
- package/src/triggers/models/purchase-data.js +1 -1
- package/src/triggers/models/purchase-property-data.js +4 -4
- package/src/triggers/models/push-click-data.js +3 -3
- package/src/triggers/models/trigger-condition.js +30 -30
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +32 -32
- package/src/triggers/triggers-provider.js +55 -55
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +5 -5
- package/src/ui/js/iam-css.js +4 -4
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +11 -11
- package/src/util/client-hints-parser.js +5 -5
- package/src/util/component-utils.js +2 -2
- package/src/util/date-utils.js +2 -2
- package/src/util/device-constants.js +4 -5
- package/src/util/dom-utils.js +5 -5
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +17 -17
- package/src/util/user-agent-parser.js +11 -16
- package/src/util/validation-utils.js +9 -9
- package/src/Card/models/banner.js +0 -31
- package/src/ContentCards/log-content-cards-displayed.js +0 -5
package/src/User/user.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isArray as p,
|
|
3
|
-
isDate as
|
|
4
|
-
isObject as
|
|
5
|
-
validateValueIsFromEnum as
|
|
3
|
+
isDate as yt,
|
|
4
|
+
isObject as Nt,
|
|
5
|
+
validateValueIsFromEnum as G,
|
|
6
6
|
} from "../util/code-utils.js";
|
|
7
7
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
8
8
|
import {
|
|
@@ -12,42 +12,43 @@ import {
|
|
|
12
12
|
validateCustomProperties as rt,
|
|
13
13
|
validateCustomString as ot,
|
|
14
14
|
validatePropertyType as Ut,
|
|
15
|
-
validateStandardString as
|
|
15
|
+
validateStandardString as H,
|
|
16
16
|
} from "../util/validation-utils.js";
|
|
17
17
|
import { SET_CUSTOM_USER_ATTRIBUTE_STRING as Ft } from "../common/constants.js";
|
|
18
18
|
import { toValidBackendTimeString as $t } from "../util/date-utils.js";
|
|
19
19
|
export default class User {
|
|
20
20
|
constructor(t, e) {
|
|
21
|
-
(this.
|
|
21
|
+
(this.wt = t), (this.ki = e), (this.wt = t), (this.ki = e);
|
|
22
22
|
}
|
|
23
23
|
getUserId(t) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
),
|
|
28
|
-
|
|
24
|
+
const e = this.wt.getUserId();
|
|
25
|
+
if ("function" != typeof t) return e;
|
|
26
|
+
r.j.warn(
|
|
27
|
+
"The callback for getUserId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getUser().getUserId()`)",
|
|
28
|
+
),
|
|
29
|
+
t(e);
|
|
29
30
|
}
|
|
30
31
|
addAlias(t, e) {
|
|
31
|
-
return !
|
|
32
|
+
return !H(t, "add alias", "the alias", !1) || t.length <= 0
|
|
32
33
|
? (r.j.error("addAlias requires a non-empty alias"), !1)
|
|
33
|
-
: !
|
|
34
|
+
: !H(e, "add alias", "the label", !1) || e.length <= 0
|
|
34
35
|
? (r.j.error("addAlias requires a non-empty label"), !1)
|
|
35
36
|
: this.ki.$n(t, e).O;
|
|
36
37
|
}
|
|
37
38
|
setFirstName(t) {
|
|
38
39
|
return (
|
|
39
|
-
!!
|
|
40
|
-
this.
|
|
40
|
+
!!H(t, "set first name", "the firstName", !0) &&
|
|
41
|
+
this.wt.nu("first_name", t)
|
|
41
42
|
);
|
|
42
43
|
}
|
|
43
44
|
setLastName(t) {
|
|
44
45
|
return (
|
|
45
|
-
!!
|
|
46
|
+
!!H(t, "set last name", "the lastName", !0) && this.wt.nu("last_name", t)
|
|
46
47
|
);
|
|
47
48
|
}
|
|
48
49
|
setEmail(t) {
|
|
49
50
|
return null === t || Ct(t)
|
|
50
|
-
? this.
|
|
51
|
+
? this.wt.nu("email", t)
|
|
51
52
|
: (r.j.error(
|
|
52
53
|
`Cannot set email address - "${t}" did not pass RFC-5322 validation.`,
|
|
53
54
|
),
|
|
@@ -58,18 +59,18 @@ export default class User {
|
|
|
58
59
|
"string" == typeof t && (t = t.toLowerCase()),
|
|
59
60
|
!(
|
|
60
61
|
null !== t &&
|
|
61
|
-
!
|
|
62
|
+
!G(
|
|
62
63
|
User.Genders,
|
|
63
64
|
t,
|
|
64
65
|
`Gender "${t}" is not a valid gender.`,
|
|
65
66
|
"User.Genders",
|
|
66
67
|
)
|
|
67
|
-
) && this.
|
|
68
|
+
) && this.wt.nu("gender", t)
|
|
68
69
|
);
|
|
69
70
|
}
|
|
70
71
|
setDateOfBirth(t, e, s) {
|
|
71
72
|
return null === t && null === e && null === s
|
|
72
|
-
? this.
|
|
73
|
+
? this.wt.nu("dob", null)
|
|
73
74
|
: ((t = null != t ? parseInt(t.toString()) : null),
|
|
74
75
|
(e = null != e ? parseInt(e.toString()) : null),
|
|
75
76
|
(s = null != s ? parseInt(s.toString()) : null),
|
|
@@ -87,46 +88,46 @@ export default class User {
|
|
|
87
88
|
"Cannot set date of birth - parameters should comprise a valid date e.g. setDateOfBirth(1776, 7, 4);",
|
|
88
89
|
),
|
|
89
90
|
!1)
|
|
90
|
-
: this.
|
|
91
|
+
: this.wt.nu("dob", `${t}-${e}-${s}`));
|
|
91
92
|
}
|
|
92
93
|
setCountry(t) {
|
|
93
|
-
return !!
|
|
94
|
+
return !!H(t, "set country", "the country", !0) && this.wt.nu("country", t);
|
|
94
95
|
}
|
|
95
96
|
setHomeCity(t) {
|
|
96
97
|
return (
|
|
97
|
-
!!
|
|
98
|
+
!!H(t, "set home city", "the homeCity", !0) && this.wt.nu("home_city", t)
|
|
98
99
|
);
|
|
99
100
|
}
|
|
100
101
|
setLanguage(t) {
|
|
101
102
|
return (
|
|
102
|
-
!!
|
|
103
|
+
!!H(t, "set language", "the language", !0) && this.wt.nu("language", t)
|
|
103
104
|
);
|
|
104
105
|
}
|
|
105
106
|
setEmailNotificationSubscriptionType(t) {
|
|
106
107
|
return (
|
|
107
|
-
!!
|
|
108
|
+
!!G(
|
|
108
109
|
User.NotificationSubscriptionTypes,
|
|
109
110
|
t,
|
|
110
111
|
`Email notification setting "${t}" is not a valid subscription type.`,
|
|
111
112
|
"User.NotificationSubscriptionTypes",
|
|
112
|
-
) && this.
|
|
113
|
+
) && this.wt.nu("email_subscribe", t)
|
|
113
114
|
);
|
|
114
115
|
}
|
|
115
116
|
setPushNotificationSubscriptionType(t) {
|
|
116
117
|
return (
|
|
117
|
-
!!
|
|
118
|
+
!!G(
|
|
118
119
|
User.NotificationSubscriptionTypes,
|
|
119
120
|
t,
|
|
120
121
|
`Push notification setting "${t}" is not a valid subscription type.`,
|
|
121
122
|
"User.NotificationSubscriptionTypes",
|
|
122
|
-
) && this.
|
|
123
|
+
) && this.wt.nu("push_subscribe", t)
|
|
123
124
|
);
|
|
124
125
|
}
|
|
125
126
|
setPhoneNumber(t) {
|
|
126
127
|
return (
|
|
127
|
-
!!
|
|
128
|
+
!!H(t, "set phone number", "the phoneNumber", !0) &&
|
|
128
129
|
(null === t || t.match(User.Ln)
|
|
129
|
-
? this.
|
|
130
|
+
? this.wt.nu("phone", t)
|
|
130
131
|
: (r.j.error(
|
|
131
132
|
`Cannot set phone number - "${t}" did not pass validation.`,
|
|
132
133
|
),
|
|
@@ -163,7 +164,7 @@ export default class User {
|
|
|
163
164
|
"Cannot set last-known location - accuracy and altitudeAccuracy may not be negative.",
|
|
164
165
|
),
|
|
165
166
|
!1)
|
|
166
|
-
: this.ki.setLastKnownLocation(this.
|
|
167
|
+
: this.ki.setLastKnownLocation(this.wt.getUserId(), t, e, i, s, n).O);
|
|
167
168
|
}
|
|
168
169
|
setCustomUserAttribute(t, e, s) {
|
|
169
170
|
if (!At(t)) return !1;
|
|
@@ -182,13 +183,13 @@ export default class User {
|
|
|
182
183
|
if (!s && !n && 0 !== e.length) return !1;
|
|
183
184
|
if (s || 0 === e.length) return this.ki.Gn(r.q.Hn, t, e).O;
|
|
184
185
|
for (const t of e) if (!i(t)) return !1;
|
|
185
|
-
} else if (
|
|
186
|
+
} else if (Nt(e)) {
|
|
186
187
|
if (!i(e)) return !1;
|
|
187
188
|
if (s) return this.ki.Gn(r.q.Kn, t, e).O;
|
|
188
189
|
} else {
|
|
189
190
|
if (!(void 0 !== e && Ut(e))) return !1;
|
|
190
191
|
if (
|
|
191
|
-
(
|
|
192
|
+
(yt(e) && (e = $t(e)),
|
|
192
193
|
"string" == typeof e &&
|
|
193
194
|
!ot(
|
|
194
195
|
e,
|
|
@@ -198,7 +199,7 @@ export default class User {
|
|
|
198
199
|
)
|
|
199
200
|
return !1;
|
|
200
201
|
}
|
|
201
|
-
return this.
|
|
202
|
+
return this.wt.setCustomUserAttribute(t, e);
|
|
202
203
|
}
|
|
203
204
|
addToCustomAttributeArray(t, e) {
|
|
204
205
|
return (
|
|
@@ -249,7 +250,7 @@ export default class User {
|
|
|
249
250
|
);
|
|
250
251
|
}
|
|
251
252
|
addToSubscriptionGroup(t) {
|
|
252
|
-
return !
|
|
253
|
+
return !H(
|
|
253
254
|
t,
|
|
254
255
|
"add user to subscription group",
|
|
255
256
|
"subscription group ID",
|
|
@@ -262,7 +263,7 @@ export default class User {
|
|
|
262
263
|
: this.ki.au(t, User.du.SUBSCRIBED).O;
|
|
263
264
|
}
|
|
264
265
|
removeFromSubscriptionGroup(t) {
|
|
265
|
-
return !
|
|
266
|
+
return !H(
|
|
266
267
|
t,
|
|
267
268
|
"remove user from subscription group",
|
|
268
269
|
"subscription group ID",
|
|
@@ -275,10 +276,10 @@ export default class User {
|
|
|
275
276
|
: this.ki.au(t, User.du.UNSUBSCRIBED).O;
|
|
276
277
|
}
|
|
277
278
|
_n(t, e, r, s, i) {
|
|
278
|
-
this.
|
|
279
|
+
this.wt._n(t, e, r, s, i), this.ki.pu();
|
|
279
280
|
}
|
|
280
281
|
Nn(t) {
|
|
281
|
-
this.
|
|
282
|
+
this.wt.Nn(t);
|
|
282
283
|
}
|
|
283
284
|
}
|
|
284
285
|
(User.Genders = {
|
package/src/common/base-feed.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
+
import r from "../../shared-lib/braze-shared-lib.js";
|
|
1
2
|
import { ControlCard } from "../Card/index.js";
|
|
2
3
|
export const FEED_ANIMATION_DURATION = 500;
|
|
3
4
|
export default class x {
|
|
4
|
-
constructor(
|
|
5
|
-
(this.cards =
|
|
6
|
-
(this.lastUpdated =
|
|
7
|
-
(this.cards =
|
|
8
|
-
(this.lastUpdated =
|
|
5
|
+
constructor(s, e) {
|
|
6
|
+
(this.cards = s),
|
|
7
|
+
(this.lastUpdated = e),
|
|
8
|
+
(this.cards = s),
|
|
9
|
+
(this.lastUpdated = e);
|
|
9
10
|
}
|
|
10
11
|
getUnreadCardCount() {
|
|
11
|
-
let
|
|
12
|
-
for (const
|
|
13
|
-
return
|
|
12
|
+
let s = 0;
|
|
13
|
+
for (const e of this.cards) e.viewed || e instanceof ControlCard || s++;
|
|
14
|
+
return s;
|
|
14
15
|
}
|
|
15
16
|
ur() {
|
|
16
|
-
|
|
17
|
+
r.j.error("Must be implemented in a subclass");
|
|
17
18
|
}
|
|
18
|
-
logCardImpressions(
|
|
19
|
-
|
|
19
|
+
logCardImpressions(s) {
|
|
20
|
+
r.j.error("Must be implemented in a subclass");
|
|
20
21
|
}
|
|
21
|
-
logCardClick(
|
|
22
|
-
|
|
22
|
+
logCardClick(s) {
|
|
23
|
+
r.j.error("Must be implemented in a subclass");
|
|
23
24
|
}
|
|
24
25
|
sr() {
|
|
25
|
-
|
|
26
|
+
r.j.error("Must be implemented in a subclass");
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
(x.mr = 6e4), (x.Oh = 500), (x.uo = 1e4);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
2
2
|
import e from "../managers/braze-instance.js";
|
|
3
|
-
import
|
|
3
|
+
import ue from "../models/braze-event.js";
|
|
4
4
|
import t from "../models/request-result.js";
|
|
5
5
|
const s = {
|
|
6
6
|
N: (o, n, s) => {
|
|
@@ -16,7 +16,7 @@ const s = {
|
|
|
16
16
|
);
|
|
17
17
|
const m = l.co();
|
|
18
18
|
a.ve.push(
|
|
19
|
-
new
|
|
19
|
+
new ue(
|
|
20
20
|
s || (null === (i = e.ir()) || void 0 === i ? void 0 : i.getUserId()),
|
|
21
21
|
o,
|
|
22
22
|
new Date().valueOf(),
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import x from "./base-feed.js";
|
|
2
2
|
import {
|
|
3
|
-
bottomHadImpression as
|
|
4
|
-
getCardId as
|
|
5
|
-
impressOnBottom as
|
|
6
|
-
impressOnTop as
|
|
7
|
-
markCardAsRead as
|
|
8
|
-
topHadImpression as
|
|
3
|
+
bottomHadImpression as be,
|
|
4
|
+
getCardId as ye,
|
|
5
|
+
impressOnBottom as Fe,
|
|
6
|
+
impressOnTop as Te,
|
|
7
|
+
markCardAsRead as xe,
|
|
8
|
+
topHadImpression as Ee,
|
|
9
9
|
} from "../Card/display/card-display.js";
|
|
10
|
-
import { bottomIsInView as
|
|
10
|
+
import { bottomIsInView as he, topIsInView as Se } from "../util/dom-utils.js";
|
|
11
11
|
import { Card, ControlCard } from "../Card/index.js";
|
|
12
|
-
import { cardToHtml as
|
|
12
|
+
import { cardToHtml as _e } from "../Card/display/card-display.js";
|
|
13
13
|
import { isArray as p } from "../util/code-utils.js";
|
|
14
|
-
import { KeyCodes as
|
|
15
|
-
import
|
|
14
|
+
import { KeyCodes as at } from "../util/key-codes.js";
|
|
15
|
+
import je from "../l10n/l10n-manager-factory.js";
|
|
16
16
|
import { removeSubscription } from "../Core/remove-subscription.js";
|
|
17
17
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
18
|
-
import { BRAZE_ACTION_URI_REGEX as
|
|
18
|
+
import { BRAZE_ACTION_URI_REGEX as W } from "../util/validation-utils.js";
|
|
19
19
|
import {
|
|
20
|
-
INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as
|
|
21
|
-
ineligibleBrazeActionURLErrorMessage as
|
|
22
|
-
getDecodedBrazeAction as
|
|
23
|
-
containsUnknownBrazeAction as
|
|
20
|
+
INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as dt,
|
|
21
|
+
ineligibleBrazeActionURLErrorMessage as ft,
|
|
22
|
+
getDecodedBrazeAction as O,
|
|
23
|
+
containsUnknownBrazeAction as gt,
|
|
24
24
|
} from "../util/braze-actions.js";
|
|
25
25
|
export const LAST_REQUESTED_REFRESH_DATA_ATTRIBUTE =
|
|
26
26
|
"data-last-requested-refresh";
|
|
@@ -60,7 +60,7 @@ export function generateFeedBody(e, t) {
|
|
|
60
60
|
for (const n of e.cards) {
|
|
61
61
|
const i = n instanceof ControlCard;
|
|
62
62
|
!i || e.ur()
|
|
63
|
-
? (o.appendChild(
|
|
63
|
+
? (o.appendChild(_e(n, logCardClick, t)), (s = s || !i))
|
|
64
64
|
: r.j.error(
|
|
65
65
|
"Received a control card for a legacy news feed. Control cards are only supported with content cards.",
|
|
66
66
|
);
|
|
@@ -68,7 +68,7 @@ export function generateFeedBody(e, t) {
|
|
|
68
68
|
if (!s) {
|
|
69
69
|
const e = document.createElement("div");
|
|
70
70
|
(e.className = "ab-no-cards-message"),
|
|
71
|
-
(e.innerHTML =
|
|
71
|
+
(e.innerHTML = je.m().get("NO_CARDS_MESSAGE") || ""),
|
|
72
72
|
e.setAttribute("role", "article"),
|
|
73
73
|
o.appendChild(e);
|
|
74
74
|
}
|
|
@@ -81,20 +81,20 @@ export function detectFeedImpressions(e, t) {
|
|
|
81
81
|
s = t.querySelectorAll(".ab-card");
|
|
82
82
|
e.yo || (e.yo = {});
|
|
83
83
|
for (let t = 0; t < s.length; t++) {
|
|
84
|
-
const n =
|
|
85
|
-
r =
|
|
86
|
-
i =
|
|
84
|
+
const n = ye(s[t]),
|
|
85
|
+
r = Se(s[t]),
|
|
86
|
+
i = he(s[t]);
|
|
87
87
|
if (e.yo[n]) {
|
|
88
|
-
r || i ||
|
|
88
|
+
r || i || xe(s[t]);
|
|
89
89
|
continue;
|
|
90
90
|
}
|
|
91
|
-
let a =
|
|
92
|
-
d =
|
|
91
|
+
let a = Ee(s[t]),
|
|
92
|
+
d = be(s[t]);
|
|
93
93
|
const l = a,
|
|
94
94
|
c = d;
|
|
95
95
|
if (
|
|
96
|
-
(!a && r && ((a = !0),
|
|
97
|
-
!d && i && ((d = !0),
|
|
96
|
+
(!a && r && ((a = !0), Te(s[t])),
|
|
97
|
+
!d && i && ((d = !0), Fe(s[t])),
|
|
98
98
|
a && d)
|
|
99
99
|
) {
|
|
100
100
|
if (l && c) continue;
|
|
@@ -123,7 +123,7 @@ export function refreshFeed(e, t) {
|
|
|
123
123
|
const o = t.querySelectorAll(".ab-initial-spinner")[0];
|
|
124
124
|
if (null != o) {
|
|
125
125
|
const e = document.createElement("span");
|
|
126
|
-
(e.innerHTML =
|
|
126
|
+
(e.innerHTML = je.m().get("FEED_TIMEOUT_MESSAGE") || ""),
|
|
127
127
|
null != o.parentNode &&
|
|
128
128
|
(o.parentNode.appendChild(e), o.parentNode.removeChild(o));
|
|
129
129
|
}
|
|
@@ -152,7 +152,7 @@ export function feedToHtml(e, t, o) {
|
|
|
152
152
|
destroyFeedHtml(s), e.stopPropagation();
|
|
153
153
|
};
|
|
154
154
|
i.addEventListener("keydown", (e) => {
|
|
155
|
-
(e.keyCode !==
|
|
155
|
+
(e.keyCode !== at.Fo && e.keyCode !== at.To) || a(e);
|
|
156
156
|
}),
|
|
157
157
|
(i.onclick = a);
|
|
158
158
|
const d = document.createElement("i");
|
|
@@ -165,7 +165,7 @@ export function feedToHtml(e, t, o) {
|
|
|
165
165
|
refreshFeed(e, s), t.stopPropagation();
|
|
166
166
|
};
|
|
167
167
|
d.addEventListener("keydown", (e) => {
|
|
168
|
-
(e.keyCode !==
|
|
168
|
+
(e.keyCode !== at.Fo && e.keyCode !== at.To) || l(e);
|
|
169
169
|
}),
|
|
170
170
|
(d.onclick = l),
|
|
171
171
|
n.appendChild(d),
|
|
@@ -184,10 +184,10 @@ export function updateFeedCards(e, t, o, s, n) {
|
|
|
184
184
|
const i = [];
|
|
185
185
|
for (const e of t)
|
|
186
186
|
if (e instanceof Card) {
|
|
187
|
-
if (e.url &&
|
|
188
|
-
const t =
|
|
189
|
-
if (
|
|
190
|
-
r.j.error(dt
|
|
187
|
+
if (e.url && W.test(e.url)) {
|
|
188
|
+
const t = O(e.url);
|
|
189
|
+
if (gt(t)) {
|
|
190
|
+
r.j.error(ft(dt._r, "Content Card"));
|
|
191
191
|
continue;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import e, { OPTIONS as L } from "../managers/braze-instance.js";
|
|
2
|
-
import
|
|
2
|
+
import Q from "../util/browser-detector.js";
|
|
3
3
|
import nr from "./l10n-manager.js";
|
|
4
|
-
const
|
|
4
|
+
const je = {
|
|
5
5
|
t: !1,
|
|
6
6
|
i: null,
|
|
7
7
|
m: () => {
|
|
8
|
-
if ((
|
|
9
|
-
let r =
|
|
8
|
+
if ((je.o(), !je.i)) {
|
|
9
|
+
let r = Q.language,
|
|
10
10
|
t = !1;
|
|
11
|
-
e.nn(L.Ba) && ((r = e.nn(L.Ba)), (t = !0)), (
|
|
11
|
+
e.nn(L.Ba) && ((r = e.nn(L.Ba)), (t = !0)), (je.i = new nr(r, t));
|
|
12
12
|
}
|
|
13
|
-
return
|
|
13
|
+
return je.i;
|
|
14
14
|
},
|
|
15
15
|
o: () => {
|
|
16
|
-
|
|
16
|
+
je.t || (e.g(je), (je.t = !0));
|
|
17
17
|
},
|
|
18
18
|
destroy: () => {
|
|
19
|
-
(
|
|
19
|
+
(je.i = null), (je.t = !1);
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
|
-
export default
|
|
22
|
+
export default je;
|
|
@@ -22,19 +22,19 @@ export default class kt {
|
|
|
22
22
|
setSdkAuthenticationSignature(t) {
|
|
23
23
|
const s = this.jh();
|
|
24
24
|
this.u.D(i.k.xh, t);
|
|
25
|
-
const e = r.
|
|
26
|
-
new r.
|
|
25
|
+
const e = r.ts.Zt;
|
|
26
|
+
new r.es(e, r.j).setItem(e.rs.qh, this.fh, t), s !== t && this.ti();
|
|
27
27
|
}
|
|
28
28
|
yh() {
|
|
29
29
|
this.u.ni(i.k.xh);
|
|
30
|
-
const t = r.
|
|
31
|
-
new r.
|
|
30
|
+
const t = r.ts.Zt;
|
|
31
|
+
new r.es(t, r.j).oe(t.rs.qh, this.fh);
|
|
32
32
|
}
|
|
33
33
|
subscribeToSdkAuthenticationFailures(t) {
|
|
34
|
-
return this.ph.
|
|
34
|
+
return this.ph.It(t);
|
|
35
35
|
}
|
|
36
36
|
Bh(t) {
|
|
37
|
-
this.ph.
|
|
37
|
+
this.ph.Dt(t);
|
|
38
38
|
}
|
|
39
39
|
Gh() {
|
|
40
40
|
this.Fh.removeAllSubscriptions();
|