@braze/web-sdk 5.8.0 → 5.8.1
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 +1 -1
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +22 -22
- package/shared-lib/guid.js +1 -1
- package/shared-lib/indexed-db-adapter.js +18 -18
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +16 -16
- package/src/Banner/banner-provider.js +79 -79
- package/src/Banner/banner.js +9 -9
- package/src/Banner/display/banner-to-html.js +2 -2
- package/src/Banner/get-all-banners.js +2 -2
- package/src/Banner/get-banner.js +2 -2
- package/src/Banner/log-banner-click.js +2 -2
- package/src/Banner/log-banner-impressions.js +4 -4
- package/src/Banner/request-banners-refresh.js +1 -1
- package/src/Banner/subscribe-to-banners-updates.js +5 -5
- package/src/Card/card-manager.js +35 -35
- package/src/Card/display/card-display.js +8 -8
- package/src/Card/log-card-click.js +1 -1
- package/src/Card/log-card-dismissal.js +1 -1
- package/src/Card/log-card-impressions.js +1 -1
- package/src/Card/models/captioned-image.js +21 -21
- package/src/Card/models/card.js +92 -92
- package/src/Card/models/classic-card.js +21 -21
- package/src/Card/models/control-card.js +11 -11
- package/src/Card/models/image-only.js +19 -19
- package/src/Card/util/card-factory.js +39 -39
- package/src/ContentCards/content-cards-provider.js +142 -142
- 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 +6 -6
- package/src/Core/enable-sdk.js +5 -5
- package/src/Core/get-device-id.js +2 -2
- package/src/Core/handle-braze-action.js +2 -2
- package/src/Core/is-disabled.js +2 -2
- package/src/Core/is-initialized.js +1 -1
- package/src/Core/log-custom-event.js +5 -5
- package/src/Core/log-purchase.js +4 -4
- package/src/Core/open-session.js +5 -5
- package/src/Core/wipe-data.js +2 -2
- package/src/FeatureFlags/feature-flag-factory.js +10 -10
- package/src/FeatureFlags/feature-flag.js +15 -15
- package/src/FeatureFlags/feature-flags-provider.js +61 -61
- 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 +4 -4
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
- package/src/Feed/feed-provider.js +41 -41
- package/src/Feed/get-cached-feed.js +1 -1
- package/src/Feed/log-feed-displayed.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/defer-in-app-message.js +1 -1
- package/src/InAppMessage/display/html-message-to-html.js +6 -6
- package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
- package/src/InAppMessage/display/modal-utils.js +4 -4
- package/src/InAppMessage/in-app-message-factory.js +7 -7
- package/src/InAppMessage/in-app-message-manager.js +89 -89
- package/src/InAppMessage/log-in-app-message-button-click.js +6 -6
- package/src/InAppMessage/log-in-app-message-click.js +5 -5
- package/src/InAppMessage/log-in-app-message-html-click.js +7 -7
- package/src/InAppMessage/log-in-app-message-impression.js +2 -2
- package/src/InAppMessage/models/control-message.js +5 -5
- package/src/InAppMessage/models/full-screen-message.js +34 -34
- package/src/InAppMessage/models/html-message.js +20 -20
- package/src/InAppMessage/models/in-app-message-button.js +8 -8
- package/src/InAppMessage/models/in-app-message.js +80 -80
- package/src/InAppMessage/models/modal-message.js +33 -33
- 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 +1 -1
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
- package/src/InAppMessage/ui/show-in-app-message.js +12 -12
- package/src/Push/push-manager-factory.js +1 -1
- package/src/Push/push-manager.js +94 -94
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +17 -17
- package/src/User/user.js +38 -38
- package/src/common/base-feed.js +1 -1
- package/src/common/base-provider.js +1 -1
- package/src/common/event-logger.js +5 -5
- package/src/common/feed-display.js +6 -6
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/auth-manager.js +31 -31
- package/src/managers/braze-instance.js +125 -125
- package/src/managers/device-manager.js +24 -24
- package/src/managers/network-manager.js +149 -149
- package/src/managers/server-config-manager.js +84 -84
- package/src/managers/session-manager.js +27 -27
- package/src/managers/storage-manager-factory.js +12 -12
- package/src/managers/storage-manager.js +83 -83
- package/src/managers/subscription-manager.js +10 -10
- package/src/managers/utils.js +4 -4
- 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/identifier.js +3 -3
- package/src/models/push-token.js +8 -8
- package/src/models/request-result.js +3 -3
- package/src/models/server-config.js +31 -31
- package/src/request-controller.js +148 -148
- package/src/triggers/models/custom-event-data.js +1 -1
- package/src/triggers/models/custom-event-property-data.js +2 -2
- package/src/triggers/models/filter-set.js +4 -4
- package/src/triggers/models/filter.js +2 -2
- 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 +2 -2
- package/src/triggers/models/push-click-data.js +1 -1
- package/src/triggers/models/trigger-condition.js +32 -32
- package/src/triggers/models/trigger-events.js +2 -2
- package/src/triggers/models/trigger.js +11 -11
- package/src/triggers/triggers-provider-factory.js +2 -2
- package/src/triggers/triggers-provider.js +72 -72
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/base-device-parser.js +1 -1
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +5 -5
- package/src/util/client-hints-parser.js +1 -1
- package/src/util/component-utils.js +1 -1
- package/src/util/dom-utils.js +4 -4
- package/src/util/html-display-utils.js +6 -6
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +6 -6
- package/src/util/request-header-utils.js +21 -21
- package/src/util/user-agent-parser.js +1 -1
- package/src/util/window-utils.js +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Type definitions for @braze/web-sdk v5.8.
|
|
2
|
+
* Type definitions for @braze/web-sdk v5.8.1
|
|
3
3
|
* Project: https://github.com/braze-inc/braze-web-sdk
|
|
4
4
|
* (c) Braze, Inc. 2025 - http://braze.com
|
|
5
5
|
* License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
|
package/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
const d = {
|
|
2
2
|
CustomEvent: "ce",
|
|
3
3
|
Pr: "p",
|
|
4
|
-
|
|
4
|
+
fc: "pc",
|
|
5
5
|
Ac: "ca",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
Cu: "i",
|
|
7
|
+
bu: "ie",
|
|
8
|
+
ss: "cci",
|
|
9
|
+
os: "ccic",
|
|
10
|
+
Mt: "ccc",
|
|
11
|
+
Wt: "ccd",
|
|
12
|
+
Bl: "ss",
|
|
13
13
|
Dl: "se",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
Li: "si",
|
|
15
|
+
Qi: "sc",
|
|
16
|
+
Vi: "sbc",
|
|
17
17
|
Mc: "sfe",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
Eo: "iec",
|
|
19
|
+
mc: "lr",
|
|
20
|
+
dc: "uae",
|
|
21
|
+
ns: "ci",
|
|
22
|
+
Ot: "cc",
|
|
23
23
|
wc: "lcaa",
|
|
24
24
|
bc: "lcar",
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
Gn: "inc",
|
|
26
|
+
Rn: "add",
|
|
27
|
+
On: "rem",
|
|
28
|
+
$n: "set",
|
|
29
|
+
Bn: "ncam",
|
|
30
30
|
kc: "sgu",
|
|
31
31
|
yr: "ffi",
|
|
32
32
|
ro: "bi",
|
|
33
|
-
|
|
33
|
+
ct: "bc",
|
|
34
34
|
},
|
|
35
35
|
dr = { Fr: "feed_displayed", Sc: "content_cards_displayed" };
|
|
36
36
|
export { d as EventTypes, dr as InternalEventTypes };
|
package/shared-lib/guid.js
CHANGED
|
@@ -64,11 +64,11 @@ export default class tt {
|
|
|
64
64
|
"...",
|
|
65
65
|
);
|
|
66
66
|
const n = null === (e = t.target) || void 0 === e ? void 0 : e.result;
|
|
67
|
-
for (const t in i.database.
|
|
67
|
+
for (const t in i.database.Ms) {
|
|
68
68
|
const e = t;
|
|
69
|
-
i.database.
|
|
70
|
-
!n.objectStoreNames.contains(i.database.
|
|
71
|
-
n.createObjectStore(i.database.
|
|
69
|
+
i.database.Ms.hasOwnProperty(t) &&
|
|
70
|
+
!n.objectStoreNames.contains(i.database.Ms[e]) &&
|
|
71
|
+
n.createObjectStore(i.database.Ms[e]);
|
|
72
72
|
}
|
|
73
73
|
}),
|
|
74
74
|
(o.onsuccess = (n) => {
|
|
@@ -216,7 +216,7 @@ export default class tt {
|
|
|
216
216
|
});
|
|
217
217
|
}, n);
|
|
218
218
|
}
|
|
219
|
-
|
|
219
|
+
ge(t, e) {
|
|
220
220
|
if (!this.isSupported()) return !1;
|
|
221
221
|
const n = this;
|
|
222
222
|
return this.Bd((o) => {
|
|
@@ -249,7 +249,7 @@ export default class tt {
|
|
|
249
249
|
};
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
|
|
252
|
+
Ns(t, e) {
|
|
253
253
|
if (!this.isSupported()) return !1;
|
|
254
254
|
const n = this;
|
|
255
255
|
return this.Bd((o) => {
|
|
@@ -304,11 +304,11 @@ export default class tt {
|
|
|
304
304
|
clearData() {
|
|
305
305
|
if (!this.isSupported()) return !1;
|
|
306
306
|
const t = [];
|
|
307
|
-
for (const e in this.database.
|
|
307
|
+
for (const e in this.database.Ms) {
|
|
308
308
|
const n = e;
|
|
309
|
-
this.database.
|
|
310
|
-
this.database.
|
|
311
|
-
t.push(this.database.
|
|
309
|
+
this.database.Ms.hasOwnProperty(e) &&
|
|
310
|
+
this.database.Ms[n] !== this.database.Ms.pe &&
|
|
311
|
+
t.push(this.database.Ms[n]);
|
|
312
312
|
}
|
|
313
313
|
const e = this;
|
|
314
314
|
return this.Bd(function (n) {
|
|
@@ -333,20 +333,20 @@ export default class tt {
|
|
|
333
333
|
});
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
|
-
tt.
|
|
337
|
-
|
|
336
|
+
tt.Ls = {
|
|
337
|
+
Fs: {
|
|
338
338
|
Sd: "AppboyServiceWorkerAsyncStorage",
|
|
339
339
|
VERSION: 6,
|
|
340
|
-
|
|
341
|
-
|
|
340
|
+
Ms: {
|
|
341
|
+
Nu: "data",
|
|
342
342
|
jr: "pushClicks",
|
|
343
343
|
cu: "pushSubscribed",
|
|
344
344
|
Cd: "fallbackDevice",
|
|
345
|
-
|
|
346
|
-
|
|
345
|
+
Js: "cardUpdates",
|
|
346
|
+
pe: "optOut",
|
|
347
347
|
kr: "pendingData",
|
|
348
|
-
|
|
348
|
+
qh: "sdkAuthenticationSignature",
|
|
349
349
|
},
|
|
350
|
-
|
|
350
|
+
be: 1,
|
|
351
351
|
},
|
|
352
352
|
};
|
package/shared-lib/logger.js
CHANGED
|
@@ -24,13 +24,13 @@ const N = {
|
|
|
24
24
|
},
|
|
25
25
|
warn: function (n) {
|
|
26
26
|
if (N.zg) {
|
|
27
|
-
const o = "Braze SDK Warning: " + n + " (v5.8.
|
|
27
|
+
const o = "Braze SDK Warning: " + n + " (v5.8.1)";
|
|
28
28
|
null != N.vd ? N.vd(o) : console.warn(o);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
error: function (n) {
|
|
32
32
|
if (N.zg) {
|
|
33
|
-
const o = "Braze SDK Error: " + n + " (v5.8.
|
|
33
|
+
const o = "Braze SDK Error: " + n + " (v5.8.1)";
|
|
34
34
|
null != N.vd ? N.vd(o) : console.error(o);
|
|
35
35
|
}
|
|
36
36
|
},
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
Yo: "allowCrawlerActivity",
|
|
3
|
+
Zo: "baseUrl",
|
|
4
|
+
Wh: "noCookies",
|
|
5
|
+
Vh: "devicePropertyAllowlist",
|
|
6
6
|
Da: "disablePushTokenMaintenance",
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
Kh: "enableLogging",
|
|
8
|
+
$h: "enableSdkAuthentication",
|
|
9
9
|
Ca: "manageServiceWorkerExternally",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
Yh: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
11
|
+
Xh: "sessionTimeoutInSeconds",
|
|
12
|
+
Zh: "appVersion",
|
|
13
|
+
Qh: "appVersionNumber",
|
|
14
14
|
_a: "serviceWorkerLocation",
|
|
15
15
|
Ba: "safariWebsitePushId",
|
|
16
|
-
|
|
16
|
+
Xn: "localization",
|
|
17
17
|
er: "contentSecurityNonce",
|
|
18
18
|
re: "allowUserSuppliedJavascript",
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
No: "inAppMessageZIndex",
|
|
20
|
+
Ko: "openInAppMessagesInNewTab",
|
|
21
21
|
en: "openNewsFeedCardsInNewTab",
|
|
22
22
|
mh: "requireExplicitInAppMessageDismissal",
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
Ea: "doNotLoadFontAwesome",
|
|
24
|
+
Ia: "deviceId",
|
|
25
25
|
Aa: "serviceWorkerScope",
|
|
26
|
-
|
|
26
|
+
Na: "sdkFlavor",
|
|
27
27
|
tn: "openCardsInNewTab",
|
|
28
28
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { STORAGE_KEYS as
|
|
1
|
+
import t from "../common/base-provider.js";
|
|
2
|
+
import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
|
|
3
3
|
import {
|
|
4
4
|
newBannerFromJson as n,
|
|
5
5
|
newBannerFromSerializedValue as o,
|
|
@@ -11,16 +11,16 @@ import u from "../managers/subscription-manager.js";
|
|
|
11
11
|
import r from "../managers/braze-instance.js";
|
|
12
12
|
import c from "../common/event-logger.js";
|
|
13
13
|
import { EventTypes as d } from "../../shared-lib/event-types.js";
|
|
14
|
-
export default class e extends
|
|
15
|
-
constructor(
|
|
14
|
+
export default class e extends t {
|
|
15
|
+
constructor(t, s, i, e) {
|
|
16
16
|
super(),
|
|
17
|
-
(this.B =
|
|
18
|
-
(this.S =
|
|
17
|
+
(this.B = t),
|
|
18
|
+
(this.S = s),
|
|
19
19
|
(this.C = i),
|
|
20
20
|
(this.T = e),
|
|
21
21
|
(this.banners = {}),
|
|
22
|
-
(this.B =
|
|
23
|
-
(this.S =
|
|
22
|
+
(this.B = t),
|
|
23
|
+
(this.S = s),
|
|
24
24
|
(this.C = i),
|
|
25
25
|
(this.T = e),
|
|
26
26
|
(this.R = 10),
|
|
@@ -31,20 +31,20 @@ export default class e extends s {
|
|
|
31
31
|
(this.k = null),
|
|
32
32
|
(this.D = null);
|
|
33
33
|
}
|
|
34
|
-
U(
|
|
35
|
-
if (this.L() && null !=
|
|
34
|
+
U(t) {
|
|
35
|
+
if (this.L() && null != t && t.banners) {
|
|
36
36
|
this.banners = {};
|
|
37
|
-
const
|
|
38
|
-
for (const
|
|
39
|
-
const i = t
|
|
37
|
+
const s = t.banners;
|
|
38
|
+
for (const t in s) {
|
|
39
|
+
const i = s[t];
|
|
40
40
|
let e = null;
|
|
41
41
|
null != i && null != i.banner && (e = n(i.banner)),
|
|
42
|
-
e && (this.banners[
|
|
42
|
+
e && (this.banners[t] = e);
|
|
43
43
|
}
|
|
44
44
|
this.M(), this.F.X(this.banners);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
$(
|
|
47
|
+
$(t, s, i, e = !0) {
|
|
48
48
|
var n;
|
|
49
49
|
const r = () => {
|
|
50
50
|
"function" == typeof i && i();
|
|
@@ -54,7 +54,7 @@ export default class e extends s {
|
|
|
54
54
|
null === (n = this.B) ||
|
|
55
55
|
void 0 === n ||
|
|
56
56
|
n.A(() => {
|
|
57
|
-
this.$(
|
|
57
|
+
this.$(t, s, i);
|
|
58
58
|
})
|
|
59
59
|
);
|
|
60
60
|
const o = this.S;
|
|
@@ -62,7 +62,7 @@ export default class e extends s {
|
|
|
62
62
|
e && this.G();
|
|
63
63
|
const u = o.H({}, !0),
|
|
64
64
|
c = [];
|
|
65
|
-
for (const
|
|
65
|
+
for (const s of t) c.push({ id: s });
|
|
66
66
|
u.placements = c;
|
|
67
67
|
const d = o.J(u, h.O.K);
|
|
68
68
|
let m = !1;
|
|
@@ -78,27 +78,27 @@ export default class e extends s {
|
|
|
78
78
|
url: `${n.Z()}/banners/sync`,
|
|
79
79
|
headers: d,
|
|
80
80
|
data: u,
|
|
81
|
-
|
|
82
|
-
if (!n.
|
|
83
|
-
n.
|
|
81
|
+
tt: (t) => {
|
|
82
|
+
if (!n.st(u, t, d)) return (m = !0), void r();
|
|
83
|
+
n.it(), this.U(t), (m = !1), "function" == typeof s && s();
|
|
84
84
|
},
|
|
85
|
-
error: (
|
|
86
|
-
n.
|
|
85
|
+
error: (t) => {
|
|
86
|
+
n.et(t, "retrieving banners"), (m = !0), r();
|
|
87
87
|
},
|
|
88
|
-
|
|
88
|
+
nt: (e, r) => {
|
|
89
89
|
let o;
|
|
90
|
-
if (((this.D =
|
|
91
|
-
let
|
|
92
|
-
(null ==
|
|
93
|
-
(o = Math.min(3e5, a(1e3 * this.R, 3 *
|
|
90
|
+
if (((this.D = t), m)) {
|
|
91
|
+
let t = this.I;
|
|
92
|
+
(null == t || t < 1e3 * this.R) && (t = 1e3 * this.R),
|
|
93
|
+
(o = Math.min(3e5, a(1e3 * this.R, 3 * t)));
|
|
94
94
|
}
|
|
95
|
-
n.
|
|
95
|
+
n.rt(
|
|
96
96
|
r,
|
|
97
97
|
() => {
|
|
98
|
-
this.$(
|
|
98
|
+
this.$(t, s, i, !1);
|
|
99
99
|
},
|
|
100
100
|
h.O.K,
|
|
101
|
-
(
|
|
101
|
+
(t) => this.ot(t),
|
|
102
102
|
() => this.G(),
|
|
103
103
|
o,
|
|
104
104
|
);
|
|
@@ -109,93 +109,93 @@ export default class e extends s {
|
|
|
109
109
|
i,
|
|
110
110
|
);
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
ht() {
|
|
113
113
|
return this.D;
|
|
114
114
|
}
|
|
115
|
-
|
|
116
|
-
const i = { id:
|
|
117
|
-
|
|
118
|
-
return c.
|
|
115
|
+
lt(t, s) {
|
|
116
|
+
const i = { id: t.id };
|
|
117
|
+
s && (i.bid = s);
|
|
118
|
+
return c.ut(d.ct, i).tt;
|
|
119
119
|
}
|
|
120
120
|
G() {
|
|
121
121
|
null != this.q && (clearTimeout(this.q), (this.q = null));
|
|
122
122
|
}
|
|
123
|
-
|
|
124
|
-
this.G(), (this.q =
|
|
123
|
+
ot(t) {
|
|
124
|
+
this.G(), (this.q = t);
|
|
125
125
|
}
|
|
126
|
-
|
|
127
|
-
let
|
|
128
|
-
this.C && (
|
|
126
|
+
dt() {
|
|
127
|
+
let t = {};
|
|
128
|
+
this.C && (t = this.C.ft(s.gt.vt));
|
|
129
129
|
const i = {};
|
|
130
|
-
for (const
|
|
130
|
+
for (const s in t) {
|
|
131
131
|
let e = null;
|
|
132
|
-
null != s
|
|
132
|
+
null != t[s] && (e = o(t[s])), e && (i[e.placementId] = e);
|
|
133
133
|
}
|
|
134
134
|
return i;
|
|
135
135
|
}
|
|
136
136
|
M() {
|
|
137
|
-
var
|
|
137
|
+
var t;
|
|
138
138
|
if (!this.C) return;
|
|
139
139
|
const i = {};
|
|
140
|
-
for (const
|
|
140
|
+
for (const s in this.banners) {
|
|
141
141
|
const e =
|
|
142
|
-
(null === (
|
|
142
|
+
(null === (t = this.banners[s]) || void 0 === t ? void 0 : t.bt()) ||
|
|
143
143
|
null;
|
|
144
|
-
i[
|
|
144
|
+
i[s] = e;
|
|
145
145
|
}
|
|
146
|
-
this.C.
|
|
146
|
+
this.C.Bt(s.gt.vt, i), this.jt();
|
|
147
147
|
}
|
|
148
|
-
|
|
149
|
-
var
|
|
150
|
-
null === (
|
|
151
|
-
void 0 ===
|
|
152
|
-
|
|
148
|
+
jt() {
|
|
149
|
+
var t, i;
|
|
150
|
+
null === (t = this.C) ||
|
|
151
|
+
void 0 === t ||
|
|
152
|
+
t.Bt(s.gt.yt, null === (i = this.T) || void 0 === i ? void 0 : i.St());
|
|
153
153
|
}
|
|
154
|
-
|
|
155
|
-
var
|
|
154
|
+
wt() {
|
|
155
|
+
var t;
|
|
156
156
|
return (
|
|
157
|
-
(null === (
|
|
157
|
+
(null === (t = this.C) || void 0 === t ? void 0 : t.ft(s.gt.yt)) || null
|
|
158
158
|
);
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
Ct() {
|
|
161
161
|
return this.k;
|
|
162
162
|
}
|
|
163
|
-
|
|
164
|
-
this.k =
|
|
163
|
+
Tt(t) {
|
|
164
|
+
this.k = t;
|
|
165
165
|
}
|
|
166
|
-
|
|
167
|
-
var
|
|
168
|
-
const
|
|
169
|
-
i = this.
|
|
170
|
-
return null != i &&
|
|
166
|
+
Rt() {
|
|
167
|
+
var t;
|
|
168
|
+
const s = null === (t = this.T) || void 0 === t ? void 0 : t.St(),
|
|
169
|
+
i = this.wt();
|
|
170
|
+
return null != i && s === i;
|
|
171
171
|
}
|
|
172
|
-
|
|
173
|
-
var
|
|
174
|
-
const
|
|
175
|
-
i = this.
|
|
176
|
-
return null == i ||
|
|
172
|
+
It() {
|
|
173
|
+
var t;
|
|
174
|
+
const s = null === (t = this.T) || void 0 === t ? void 0 : t.St(),
|
|
175
|
+
i = this.wt();
|
|
176
|
+
return null == i || s === i;
|
|
177
177
|
}
|
|
178
|
-
|
|
179
|
-
return this.F.
|
|
178
|
+
qt(t) {
|
|
179
|
+
return this.F.Ft(t);
|
|
180
180
|
}
|
|
181
|
-
|
|
182
|
-
var
|
|
181
|
+
Nt() {
|
|
182
|
+
var t;
|
|
183
183
|
return (
|
|
184
|
-
(null === (
|
|
184
|
+
(null === (t = this.C) || void 0 === t ? void 0 : t.ft(s.gt.kt)) || {}
|
|
185
185
|
);
|
|
186
186
|
}
|
|
187
|
-
|
|
188
|
-
this.C && this.C.
|
|
187
|
+
xt(t) {
|
|
188
|
+
this.C && this.C.Bt(s.gt.kt, t);
|
|
189
189
|
}
|
|
190
190
|
changeUser() {
|
|
191
|
-
this.
|
|
191
|
+
this.zt();
|
|
192
192
|
}
|
|
193
193
|
L() {
|
|
194
|
-
return !!this.B && (!!this.B.
|
|
194
|
+
return !!this.B && (!!this.B.Dt() || (0 !== this.B.Et() && this.zt(), !1));
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
zt() {
|
|
197
197
|
(this.banners = {}),
|
|
198
|
-
this.C && (this.C.
|
|
198
|
+
this.C && (this.C.Ut(s.gt.vt), this.C.Ut(s.gt.kt)),
|
|
199
199
|
this.F.X({});
|
|
200
200
|
}
|
|
201
201
|
}
|
package/src/Banner/banner.js
CHANGED
|
@@ -3,28 +3,28 @@ export default class Banner {
|
|
|
3
3
|
(this.id = t),
|
|
4
4
|
(this.placementId = i),
|
|
5
5
|
(this.html = s),
|
|
6
|
-
(this.
|
|
6
|
+
(this.At = h),
|
|
7
7
|
(this.isControl = r),
|
|
8
|
-
(this.
|
|
8
|
+
(this.Gt = e),
|
|
9
9
|
(this.id = t),
|
|
10
10
|
(this.placementId = i),
|
|
11
11
|
(this.html = s),
|
|
12
|
-
(this.
|
|
12
|
+
(this.At = h),
|
|
13
13
|
(this.isControl = r),
|
|
14
|
-
(this.
|
|
15
|
-
(this.
|
|
14
|
+
(this.Gt = e),
|
|
15
|
+
(this.Ht = !1);
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
Jt() {
|
|
18
18
|
return this.isControl;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
bt() {
|
|
21
21
|
return {
|
|
22
22
|
id: this.id,
|
|
23
23
|
o: this.placementId,
|
|
24
24
|
html: this.html,
|
|
25
|
-
t: this.
|
|
25
|
+
t: this.At,
|
|
26
26
|
i: this.isControl,
|
|
27
|
-
u: this.
|
|
27
|
+
u: this.Gt,
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -19,7 +19,7 @@ export function controlBannerToHtml(t) {
|
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
export function bannerToHtml(t, n) {
|
|
22
|
-
if (t.
|
|
22
|
+
if (t.Jt()) return controlBannerToHtml(t);
|
|
23
23
|
const o = document.createElement("iframe");
|
|
24
24
|
return (
|
|
25
25
|
(o.id = t.id),
|
|
@@ -37,7 +37,7 @@ export function bannerToHtml(t, n) {
|
|
|
37
37
|
{},
|
|
38
38
|
b(o, () => {
|
|
39
39
|
import("../../Feed/ui/show-feed.js").then((t) => {
|
|
40
|
-
r.
|
|
40
|
+
r._t() ? t.showFeed() : N.error(p);
|
|
41
41
|
});
|
|
42
42
|
}),
|
|
43
43
|
),
|
package/src/Banner/get-banner.js
CHANGED
|
@@ -4,7 +4,7 @@ import i from "./banner-provider-factory.js";
|
|
|
4
4
|
export function getBannerIfNotExpired(n, r) {
|
|
5
5
|
const e = n[r];
|
|
6
6
|
if (!e) return null;
|
|
7
|
-
const t = e.
|
|
7
|
+
const t = e.Gt,
|
|
8
8
|
o = new Date().valueOf();
|
|
9
9
|
return -1 !== t && 1e3 * t < o
|
|
10
10
|
? (N.info(`Banner with ID: ${e.id} and placement ID: ${r} has expired.`),
|
|
@@ -15,5 +15,5 @@ export function getBanner(n) {
|
|
|
15
15
|
if (!r.rr()) return;
|
|
16
16
|
const e = i.m();
|
|
17
17
|
if (!e.L()) return null;
|
|
18
|
-
return getBannerIfNotExpired(e.
|
|
18
|
+
return getBannerIfNotExpired(e.dt(), n);
|
|
19
19
|
}
|
|
@@ -10,11 +10,11 @@ export function logBannerClick(n, o) {
|
|
|
10
10
|
N.error("Banner argument to logBannerClick must be an Banner object."), !1
|
|
11
11
|
);
|
|
12
12
|
const e = i.m(),
|
|
13
|
-
t = e.
|
|
13
|
+
t = e.dt();
|
|
14
14
|
return 0 === y(t).length
|
|
15
15
|
? (N.info("Not logging banner click. No banners exist."), !1)
|
|
16
16
|
: t[n.placementId]
|
|
17
|
-
? e.
|
|
17
|
+
? e.lt(n, o)
|
|
18
18
|
: (N.info(
|
|
19
19
|
`Not logging banner click for ID ${n.placementId}. The placement ID did not correspond to any banner.`,
|
|
20
20
|
),
|
|
@@ -7,10 +7,10 @@ export function logBannerImpressions(o) {
|
|
|
7
7
|
if (!r.rr()) return;
|
|
8
8
|
if (!o || o.length <= 0) return !1;
|
|
9
9
|
const n = i.m(),
|
|
10
|
-
s = n.
|
|
10
|
+
s = n.dt();
|
|
11
11
|
if (0 === y(s).length)
|
|
12
12
|
return N.info("Not logging banners impression. No banners exist."), !1;
|
|
13
|
-
const e = n.
|
|
13
|
+
const e = n.Nt(),
|
|
14
14
|
t = [];
|
|
15
15
|
for (const r of o) {
|
|
16
16
|
const o = s[r];
|
|
@@ -25,7 +25,7 @@ export function logBannerImpressions(o) {
|
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
if (0 === t.length) return !1;
|
|
28
|
-
n.
|
|
28
|
+
n.xt(e);
|
|
29
29
|
const a = { ids: t };
|
|
30
|
-
return c.
|
|
30
|
+
return c.ut(d.ro, a).tt;
|
|
31
31
|
}
|
|
@@ -15,7 +15,7 @@ export function requestBannersRefresh(e, n, t) {
|
|
|
15
15
|
"Banners are disabled. Use the 'allowUserSuppliedJavascript' option for braze.initialize to enable these messages.",
|
|
16
16
|
);
|
|
17
17
|
const o = i.m();
|
|
18
|
-
if (i.m().
|
|
18
|
+
if (i.m().Rt())
|
|
19
19
|
return void N.warn(
|
|
20
20
|
"Banners can be refreshed only once per session per user.",
|
|
21
21
|
);
|
|
@@ -5,20 +5,20 @@ export function subscribeToBannersUpdates(n) {
|
|
|
5
5
|
var o;
|
|
6
6
|
if (!r.rr()) return;
|
|
7
7
|
const t = i.m();
|
|
8
|
-
if (t.
|
|
8
|
+
if (t.It()) {
|
|
9
9
|
const r = getAllBanners();
|
|
10
10
|
r && "function" == typeof n && n(r);
|
|
11
11
|
}
|
|
12
|
-
const s = t.
|
|
13
|
-
if (!t.
|
|
12
|
+
const s = t.qt(n);
|
|
13
|
+
if (!t.Ct()) {
|
|
14
14
|
const n =
|
|
15
15
|
null === (o = r.nn()) || void 0 === o
|
|
16
16
|
? void 0
|
|
17
17
|
: o.rn(() => {
|
|
18
|
-
const n = t.
|
|
18
|
+
const n = t.ht();
|
|
19
19
|
n && n.length > 0 && t.$(n);
|
|
20
20
|
});
|
|
21
|
-
n && t.
|
|
21
|
+
n && t.Tt(n);
|
|
22
22
|
}
|
|
23
23
|
return s;
|
|
24
24
|
}
|