@braze/web-sdk 4.8.0 → 4.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 +6 -3
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +11 -11
- package/shared-lib/indexed-db-adapter.js +67 -67
- package/shared-lib/logger.js +7 -7
- package/src/Card/card-manager.js +1 -1
- package/src/ContentCards/ui/show-content-cards.js +1 -1
- package/src/Core/disable-sdk.js +5 -4
- package/src/Core/enable-sdk.js +1 -1
- package/src/Core/is-disabled.js +1 -1
- package/src/FeatureFlags/feature-flags-provider.js +12 -12
- package/src/Feed/ui/show-feed.js +1 -1
- package/src/InAppMessage/in-app-message-manager.js +40 -34
- 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 +1 -1
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +13 -13
- package/src/InAppMessage/models/slide-up-message.js +2 -2
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/ui/show-in-app-message.js +2 -2
- package/src/Push/push-manager.js +82 -81
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +4 -4
- package/src/User/user.js +5 -5
- package/src/common/feed-display.js +82 -72
- package/src/l10n/l10n-manager-factory.js +7 -7
- package/src/managers/auth-manager.js +18 -15
- package/src/managers/braze-instance.js +125 -109
- package/src/managers/device-manager.js +40 -35
- package/src/managers/network-manager.js +90 -81
- package/src/managers/server-config-manager.js +36 -34
- package/src/managers/session-manager.js +44 -37
- package/src/managers/storage-manager-factory.js +23 -16
- package/src/managers/storage-manager.js +251 -239
- package/src/managers/subscription-manager.js +10 -7
- package/src/managers/types.js +1 -0
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +10 -4
- package/src/models/device.js +10 -18
- package/src/models/identifier.js +10 -11
- package/src/models/push-token.js +14 -9
- package/src/models/request-result.js +2 -2
- package/src/models/server-config.js +32 -16
- package/src/models/types.js +1 -0
- package/src/request-controller.js +109 -109
- package/src/triggers/models/custom-event-data.js +6 -6
- package/src/triggers/models/custom-event-property-data.js +9 -9
- package/src/triggers/models/filter-set.js +9 -9
- package/src/triggers/models/filter.js +60 -60
- package/src/triggers/models/in-app-message-click-data.js +9 -9
- package/src/triggers/models/purchase-data.js +3 -3
- package/src/triggers/models/purchase-property-data.js +7 -7
- package/src/triggers/models/push-click-data.js +6 -6
- package/src/triggers/models/trigger-condition.js +46 -46
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +27 -27
- package/src/triggers/triggers-provider.js +126 -126
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/base-device-parser.js +2 -2
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +18 -18
- package/src/util/client-hints-parser.js +6 -6
- package/src/util/device-constants.js +6 -6
- package/src/util/dom-utils.js +5 -5
- package/src/util/error-utils.js +2 -0
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +9 -9
- package/src/util/user-agent-parser.js +21 -21
- 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 v4.8.
|
|
2
|
+
* Type definitions for @braze/web-sdk v4.8.1
|
|
3
3
|
* Project: https://github.com/braze-inc/braze-web-sdk
|
|
4
4
|
* (c) Braze, Inc. 2023 - http://braze.com
|
|
5
5
|
* License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
|
|
@@ -390,6 +390,9 @@
|
|
|
390
390
|
extras?: Record<string, string>,
|
|
391
391
|
pinned?: boolean
|
|
392
392
|
);
|
|
393
|
+
|
|
394
|
+
/** Whether this card is a ControlCard. */
|
|
395
|
+
isControl: true;
|
|
393
396
|
}
|
|
394
397
|
|
|
395
398
|
export class ContentCards {
|
|
@@ -476,7 +479,7 @@
|
|
|
476
479
|
extras: Record<string, string>;
|
|
477
480
|
|
|
478
481
|
/** Whether this message is a ControlMessage. */
|
|
479
|
-
isControl:
|
|
482
|
+
isControl: true;
|
|
480
483
|
}
|
|
481
484
|
|
|
482
485
|
|
|
@@ -598,7 +601,7 @@
|
|
|
598
601
|
css?: string;
|
|
599
602
|
|
|
600
603
|
/** Whether this message is a ControlMessage. */
|
|
601
|
-
isControl:
|
|
604
|
+
isControl: false;
|
|
602
605
|
|
|
603
606
|
/**
|
|
604
607
|
* Call this method if you wish to programmatically remove the message from the DOM. This method will only
|
package/package.json
CHANGED
|
@@ -4,5 +4,5 @@ import Ie from "./guid.js";
|
|
|
4
4
|
import Be from "./indexed-db-adapter.js";
|
|
5
5
|
import Ae from "./logger.js";
|
|
6
6
|
import Ge from "./supported-options.js";
|
|
7
|
-
const r = {
|
|
7
|
+
const r = { xn: je, q: ve, Cr: De, Z: Ie, xt: Be, zt: Be.ep, j: Ae, xo: Ge };
|
|
8
8
|
export default r;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
const ve = {
|
|
2
2
|
CustomEvent: "ce",
|
|
3
3
|
Pr: "p",
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
du: "pc",
|
|
5
|
+
dc: "ca",
|
|
6
|
+
ka: "i",
|
|
7
7
|
Is: "ie",
|
|
8
8
|
P: "cci",
|
|
9
9
|
T: "ccic",
|
|
10
10
|
$: "ccc",
|
|
11
11
|
H: "ccd",
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
Wl: "ss",
|
|
13
|
+
xl: "se",
|
|
14
14
|
_i: "si",
|
|
15
15
|
Ii: "sc",
|
|
16
16
|
Mi: "sbc",
|
|
17
17
|
Ze: "sfe",
|
|
18
18
|
ro: "iec",
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
au: "lr",
|
|
20
|
+
Zh: "uae",
|
|
21
21
|
R: "ci",
|
|
22
22
|
B: "cc",
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
gu: "lcaa",
|
|
24
|
+
fu: "lcar",
|
|
25
25
|
Rn: "inc",
|
|
26
26
|
Bn: "add",
|
|
27
27
|
Ln: "rem",
|
|
28
28
|
Fn: "set",
|
|
29
29
|
$n: "ncam",
|
|
30
|
-
|
|
30
|
+
pu: "sgu"
|
|
31
31
|
},
|
|
32
|
-
De = { Ar: "feed_displayed",
|
|
32
|
+
De = { Ar: "feed_displayed", Cc: "content_cards_displayed" };
|
|
33
33
|
export { ve as EventTypes, De as InternalEventTypes };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export default class Be {
|
|
2
2
|
constructor(t, e) {
|
|
3
|
-
(this.
|
|
4
|
-
(this.
|
|
5
|
-
(this.
|
|
3
|
+
(this.nd = "undefined" == typeof window ? self : window),
|
|
4
|
+
(this.od = t),
|
|
5
|
+
(this.sd = e);
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
if ("indexedDB" in this.
|
|
7
|
+
dd() {
|
|
8
|
+
if ("indexedDB" in this.nd) return this.nd.indexedDB;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
ud() {
|
|
11
11
|
try {
|
|
12
|
-
if (null == this.
|
|
12
|
+
if (null == this.dd()) return !1;
|
|
13
13
|
{
|
|
14
|
-
const t = this.
|
|
14
|
+
const t = this.dd().open("Braze IndexedDB Support Test");
|
|
15
15
|
if (
|
|
16
16
|
((t.onupgradeneeded = () => t.result.close()),
|
|
17
17
|
(t.onsuccess = () => t.result.close()),
|
|
@@ -20,7 +20,7 @@ export default class Be {
|
|
|
20
20
|
const t = window.chrome || window.browser || window.msBrowser;
|
|
21
21
|
if (t && t.runtime && t.runtime.id)
|
|
22
22
|
return (
|
|
23
|
-
this.
|
|
23
|
+
this.sd.info(
|
|
24
24
|
"Not using IndexedDB for storage because we are running inside an extension"
|
|
25
25
|
),
|
|
26
26
|
!1
|
|
@@ -30,45 +30,45 @@ export default class Be {
|
|
|
30
30
|
}
|
|
31
31
|
} catch (t) {
|
|
32
32
|
return (
|
|
33
|
-
this.
|
|
33
|
+
this.sd.info(
|
|
34
34
|
"Not using IndexedDB for storage due to following error: " + t
|
|
35
35
|
),
|
|
36
36
|
!1
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
const n = this.
|
|
40
|
+
fd(t, e) {
|
|
41
|
+
const n = this.dd().open(this.od.ad, this.od.VERSION);
|
|
42
42
|
if (null == n) return "function" == typeof e && e(), !1;
|
|
43
43
|
const o = this;
|
|
44
44
|
return (
|
|
45
45
|
(n.onupgradeneeded = t => {
|
|
46
|
-
o.
|
|
47
|
-
"Upgrading indexedDB " + o.
|
|
46
|
+
o.sd.info(
|
|
47
|
+
"Upgrading indexedDB " + o.od.ad + " to v" + o.od.VERSION + "..."
|
|
48
48
|
);
|
|
49
49
|
const e = t.target.result;
|
|
50
|
-
for (const t in o.
|
|
51
|
-
o.
|
|
52
|
-
!e.objectStoreNames.contains(o.
|
|
53
|
-
e.createObjectStore(o.
|
|
50
|
+
for (const t in o.od.Jt)
|
|
51
|
+
o.od.Jt.hasOwnProperty(t) &&
|
|
52
|
+
!e.objectStoreNames.contains(o.od.Jt[t]) &&
|
|
53
|
+
e.createObjectStore(o.od.Jt[t]);
|
|
54
54
|
}),
|
|
55
55
|
(n.onsuccess = n => {
|
|
56
56
|
const i = n.target.result;
|
|
57
57
|
(i.onversionchange = () => {
|
|
58
58
|
i.close(),
|
|
59
59
|
"function" == typeof e && e(),
|
|
60
|
-
o.
|
|
60
|
+
o.sd.error(
|
|
61
61
|
"Needed to close the database unexpectedly because of an upgrade in another tab"
|
|
62
62
|
);
|
|
63
63
|
}),
|
|
64
64
|
t(i);
|
|
65
65
|
}),
|
|
66
66
|
(n.onerror = t => (
|
|
67
|
-
o.
|
|
67
|
+
o.sd.info(
|
|
68
68
|
"Could not open indexedDB " +
|
|
69
|
-
o.
|
|
69
|
+
o.od.ad +
|
|
70
70
|
" v" +
|
|
71
|
-
o.
|
|
71
|
+
o.od.VERSION +
|
|
72
72
|
": " +
|
|
73
73
|
t.target.errorCode
|
|
74
74
|
),
|
|
@@ -79,18 +79,18 @@ export default class Be {
|
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
setItem(t, e, n, o, i) {
|
|
82
|
-
if (!this.
|
|
82
|
+
if (!this.ud()) return "function" == typeof i && i(), !1;
|
|
83
83
|
const r = this;
|
|
84
|
-
return this.
|
|
84
|
+
return this.fd(s => {
|
|
85
85
|
if (!s.objectStoreNames.contains(t))
|
|
86
86
|
return (
|
|
87
|
-
r.
|
|
87
|
+
r.sd.error(
|
|
88
88
|
"Could not store object " +
|
|
89
89
|
e +
|
|
90
90
|
" in " +
|
|
91
91
|
t +
|
|
92
92
|
" on indexedDB " +
|
|
93
|
-
r.
|
|
93
|
+
r.od.ad +
|
|
94
94
|
" - " +
|
|
95
95
|
t +
|
|
96
96
|
" is not a valid objectStore"
|
|
@@ -102,13 +102,13 @@ export default class Be {
|
|
|
102
102
|
d.oncomplete = () => s.close();
|
|
103
103
|
const u = d.objectStore(t).put(n, e);
|
|
104
104
|
(u.onerror = () => {
|
|
105
|
-
r.
|
|
105
|
+
r.sd.error(
|
|
106
106
|
"Could not store object " +
|
|
107
107
|
e +
|
|
108
108
|
" in " +
|
|
109
109
|
t +
|
|
110
110
|
" on indexedDB " +
|
|
111
|
-
r.
|
|
111
|
+
r.od.ad
|
|
112
112
|
),
|
|
113
113
|
"function" == typeof i && i();
|
|
114
114
|
}),
|
|
@@ -118,18 +118,18 @@ export default class Be {
|
|
|
118
118
|
}, i);
|
|
119
119
|
}
|
|
120
120
|
getItem(t, e, n) {
|
|
121
|
-
if (!this.
|
|
121
|
+
if (!this.ud()) return !1;
|
|
122
122
|
const o = this;
|
|
123
|
-
return this.
|
|
123
|
+
return this.fd(i => {
|
|
124
124
|
if (!i.objectStoreNames.contains(t))
|
|
125
125
|
return (
|
|
126
|
-
o.
|
|
126
|
+
o.sd.error(
|
|
127
127
|
"Could not retrieve object " +
|
|
128
128
|
e +
|
|
129
129
|
" in " +
|
|
130
130
|
t +
|
|
131
131
|
" on indexedDB " +
|
|
132
|
-
o.
|
|
132
|
+
o.od.ad +
|
|
133
133
|
" - " +
|
|
134
134
|
t +
|
|
135
135
|
" is not a valid objectStore"
|
|
@@ -140,13 +140,13 @@ export default class Be {
|
|
|
140
140
|
r.oncomplete = () => i.close();
|
|
141
141
|
const s = r.objectStore(t).get(e);
|
|
142
142
|
(s.onerror = () => {
|
|
143
|
-
o.
|
|
143
|
+
o.sd.error(
|
|
144
144
|
"Could not retrieve object " +
|
|
145
145
|
e +
|
|
146
146
|
" in " +
|
|
147
147
|
t +
|
|
148
148
|
" on indexedDB " +
|
|
149
|
-
o.
|
|
149
|
+
o.od.ad
|
|
150
150
|
);
|
|
151
151
|
}),
|
|
152
152
|
(s.onsuccess = t => {
|
|
@@ -156,16 +156,16 @@ export default class Be {
|
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
hr(t, e, n) {
|
|
159
|
-
if (!this.
|
|
159
|
+
if (!this.ud()) return "function" == typeof n && n(), !1;
|
|
160
160
|
const o = this;
|
|
161
|
-
return this.
|
|
161
|
+
return this.fd(i => {
|
|
162
162
|
if (!i.objectStoreNames.contains(t))
|
|
163
163
|
return (
|
|
164
|
-
o.
|
|
164
|
+
o.sd.error(
|
|
165
165
|
"Could not retrieve last record from " +
|
|
166
166
|
t +
|
|
167
167
|
" on indexedDB " +
|
|
168
|
-
o.
|
|
168
|
+
o.od.ad +
|
|
169
169
|
" - " +
|
|
170
170
|
t +
|
|
171
171
|
" is not a valid objectStore"
|
|
@@ -177,8 +177,8 @@ export default class Be {
|
|
|
177
177
|
r.oncomplete = () => i.close();
|
|
178
178
|
const s = r.objectStore(t).openCursor(null, "prev");
|
|
179
179
|
(s.onerror = () => {
|
|
180
|
-
o.
|
|
181
|
-
"Could not open cursor for " + t + " on indexedDB " + o.
|
|
180
|
+
o.sd.error(
|
|
181
|
+
"Could not open cursor for " + t + " on indexedDB " + o.od.ad
|
|
182
182
|
),
|
|
183
183
|
"function" == typeof n && n();
|
|
184
184
|
}),
|
|
@@ -191,18 +191,18 @@ export default class Be {
|
|
|
191
191
|
}, n);
|
|
192
192
|
}
|
|
193
193
|
br(t, e) {
|
|
194
|
-
if (!this.
|
|
194
|
+
if (!this.ud()) return !1;
|
|
195
195
|
const n = this;
|
|
196
|
-
return this.
|
|
196
|
+
return this.fd(o => {
|
|
197
197
|
if (!o.objectStoreNames.contains(t))
|
|
198
198
|
return (
|
|
199
|
-
n.
|
|
199
|
+
n.sd.error(
|
|
200
200
|
"Could not delete record " +
|
|
201
201
|
e +
|
|
202
202
|
" from " +
|
|
203
203
|
t +
|
|
204
204
|
" on indexedDB " +
|
|
205
|
-
n.
|
|
205
|
+
n.od.ad +
|
|
206
206
|
" - " +
|
|
207
207
|
t +
|
|
208
208
|
" is not a valid objectStore"
|
|
@@ -212,28 +212,28 @@ export default class Be {
|
|
|
212
212
|
const i = o.transaction([t], "readwrite");
|
|
213
213
|
i.oncomplete = () => o.close();
|
|
214
214
|
i.objectStore(t).delete(e).onerror = () => {
|
|
215
|
-
n.
|
|
215
|
+
n.sd.error(
|
|
216
216
|
"Could not delete record " +
|
|
217
217
|
e +
|
|
218
218
|
" from " +
|
|
219
219
|
t +
|
|
220
220
|
" on indexedDB " +
|
|
221
|
-
n.
|
|
221
|
+
n.od.ad
|
|
222
222
|
);
|
|
223
223
|
};
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
Mt(t, e) {
|
|
227
|
-
if (!this.
|
|
227
|
+
if (!this.ud()) return !1;
|
|
228
228
|
const n = this;
|
|
229
|
-
return this.
|
|
229
|
+
return this.fd(o => {
|
|
230
230
|
if (!o.objectStoreNames.contains(t))
|
|
231
231
|
return (
|
|
232
|
-
n.
|
|
232
|
+
n.sd.error(
|
|
233
233
|
"Could not retrieve objects from " +
|
|
234
234
|
t +
|
|
235
235
|
" on indexedDB " +
|
|
236
|
-
n.
|
|
236
|
+
n.od.ad +
|
|
237
237
|
" - " +
|
|
238
238
|
t +
|
|
239
239
|
" is not a valid objectStore"
|
|
@@ -247,15 +247,15 @@ export default class Be {
|
|
|
247
247
|
d = [];
|
|
248
248
|
(s.onerror = () => {
|
|
249
249
|
d.length > 0
|
|
250
|
-
? (n.
|
|
250
|
+
? (n.sd.info(
|
|
251
251
|
"Cursor closed midway through for " +
|
|
252
252
|
t +
|
|
253
253
|
" on indexedDB " +
|
|
254
|
-
n.
|
|
254
|
+
n.od.ad
|
|
255
255
|
),
|
|
256
256
|
e(d))
|
|
257
|
-
: n.
|
|
258
|
-
"Could not open cursor for " + t + " on indexedDB " + n.
|
|
257
|
+
: n.sd.error(
|
|
258
|
+
"Could not open cursor for " + t + " on indexedDB " + n.od.ad
|
|
259
259
|
);
|
|
260
260
|
}),
|
|
261
261
|
(s.onsuccess = t => {
|
|
@@ -272,43 +272,43 @@ export default class Be {
|
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
274
|
clearData() {
|
|
275
|
-
if (!this.
|
|
275
|
+
if (!this.ud()) return !1;
|
|
276
276
|
const t = [];
|
|
277
|
-
for (const e in this.
|
|
278
|
-
this.
|
|
279
|
-
this.
|
|
280
|
-
t.push(this.
|
|
277
|
+
for (const e in this.od.Jt)
|
|
278
|
+
this.od.Jt.hasOwnProperty(e) &&
|
|
279
|
+
this.od.Jt[e] !== this.od.Jt.oe &&
|
|
280
|
+
t.push(this.od.Jt[e]);
|
|
281
281
|
const e = this;
|
|
282
|
-
return this.
|
|
282
|
+
return this.fd(function(n) {
|
|
283
283
|
const o = n.transaction(t, "readwrite");
|
|
284
284
|
o.oncomplete = () => n.close();
|
|
285
285
|
for (let n = 0; n < t.length; n++) {
|
|
286
286
|
const i = t[n];
|
|
287
287
|
o.objectStore(i).clear().onerror = function() {
|
|
288
|
-
e.
|
|
289
|
-
"Could not clear " + this.source.name + " on indexedDB " + e.
|
|
288
|
+
e.sd.error(
|
|
289
|
+
"Could not clear " + this.source.name + " on indexedDB " + e.od.ad
|
|
290
290
|
);
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
293
|
o.onerror = function() {
|
|
294
|
-
e.
|
|
294
|
+
e.sd.error("Could not clear object stores on indexedDB " + e.od.ad);
|
|
295
295
|
};
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
Be.ep = {
|
|
300
300
|
Ft: {
|
|
301
|
-
|
|
301
|
+
ad: "AppboyServiceWorkerAsyncStorage",
|
|
302
302
|
VERSION: 6,
|
|
303
303
|
Jt: {
|
|
304
|
-
|
|
304
|
+
Sa: "data",
|
|
305
305
|
kr: "pushClicks",
|
|
306
306
|
cu: "pushSubscribed",
|
|
307
|
-
|
|
307
|
+
hd: "fallbackDevice",
|
|
308
308
|
qt: "cardUpdates",
|
|
309
309
|
oe: "optOut",
|
|
310
310
|
yr: "pendingData",
|
|
311
|
-
|
|
311
|
+
kh: "sdkAuthenticationSignature"
|
|
312
312
|
},
|
|
313
313
|
se: 1
|
|
314
314
|
}
|
package/shared-lib/logger.js
CHANGED
|
@@ -3,11 +3,11 @@ const Ae = {
|
|
|
3
3
|
(void 0 === n && void 0 !== Ae.zg) || (Ae.zg = !!n), Ae.Eg || (Ae.Eg = !0);
|
|
4
4
|
},
|
|
5
5
|
destroy: function() {
|
|
6
|
-
(Ae.Eg = !1), (Ae.zg = void 0), (Ae.
|
|
6
|
+
(Ae.Eg = !1), (Ae.zg = void 0), (Ae.sd = void 0);
|
|
7
7
|
},
|
|
8
8
|
setLogger: function(n) {
|
|
9
9
|
"function" == typeof n
|
|
10
|
-
? (Ae.init(), (Ae.
|
|
10
|
+
? (Ae.init(), (Ae.sd = n))
|
|
11
11
|
: Ae.info("Ignoring setLogger call since logger is not a function");
|
|
12
12
|
},
|
|
13
13
|
toggleLogging: function() {
|
|
@@ -19,19 +19,19 @@ const Ae = {
|
|
|
19
19
|
info: function(n) {
|
|
20
20
|
if (Ae.zg) {
|
|
21
21
|
const o = "Braze: " + n;
|
|
22
|
-
null != Ae.
|
|
22
|
+
null != Ae.sd ? Ae.sd(o) : console.log(o);
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
warn: function(n) {
|
|
26
26
|
if (Ae.zg) {
|
|
27
|
-
const o = "Braze SDK Warning: " + n + " (v4.8.
|
|
28
|
-
null != Ae.
|
|
27
|
+
const o = "Braze SDK Warning: " + n + " (v4.8.1)";
|
|
28
|
+
null != Ae.sd ? Ae.sd(o) : console.warn(o);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
error: function(n) {
|
|
32
32
|
if (Ae.zg) {
|
|
33
|
-
const o = "Braze SDK Error: " + n + " (v4.8.
|
|
34
|
-
null != Ae.
|
|
33
|
+
const o = "Braze SDK Error: " + n + " (v4.8.1)";
|
|
34
|
+
null != Ae.sd ? Ae.sd(o) : console.error(o);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
};
|
package/src/Card/card-manager.js
CHANGED
|
@@ -21,7 +21,7 @@ export function showContentCards(n, t) {
|
|
|
21
21
|
const a = e.nn(L.tn) || e.nn(L.en) || !1,
|
|
22
22
|
i = g.er().As(!1);
|
|
23
23
|
"function" == typeof t && B(i, t(i.cards.slice()), i.lastUpdated, null, a);
|
|
24
|
-
const s = I(i, a),
|
|
24
|
+
const s = I(i, a, o),
|
|
25
25
|
l = g.er(),
|
|
26
26
|
f = l.Vt();
|
|
27
27
|
(null == i.lastUpdated ||
|
package/src/Core/disable-sdk.js
CHANGED
|
@@ -4,8 +4,9 @@ import O, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
|
|
|
4
4
|
export function disableSDK() {
|
|
5
5
|
const n = e.cr();
|
|
6
6
|
n && n.requestImmediateDataFlush();
|
|
7
|
-
const o = new O.ee(null, !0)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const o = new O.ee(null, !0),
|
|
8
|
+
s = "This-cookie-will-expire-in-" + o.re();
|
|
9
|
+
o.store(i.ne, s);
|
|
10
|
+
const a = r.zt.Ft;
|
|
11
|
+
new r.xt(a, r.j).setItem(a.Jt.oe, a.se, !0), e.destroy(!1), e.ae(!0);
|
|
11
12
|
}
|
package/src/Core/enable-sdk.js
CHANGED
|
@@ -2,7 +2,7 @@ import e from "../managers/braze-instance.js";
|
|
|
2
2
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
3
3
|
import O, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
|
|
4
4
|
export function enableSDK() {
|
|
5
|
-
new O.ee(null, !0).remove(i.
|
|
5
|
+
new O.ee(null, !0).remove(i.ne);
|
|
6
6
|
const a = r.zt.Ft;
|
|
7
7
|
new r.xt(a, r.j).br(a.Jt.oe, a.se), e.destroy(!1), e.ae(!1);
|
|
8
8
|
}
|
package/src/Core/is-disabled.js
CHANGED
|
@@ -22,11 +22,11 @@ export default class er extends y {
|
|
|
22
22
|
(this.gt = s),
|
|
23
23
|
(this.u = i),
|
|
24
24
|
(this.gi = null),
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
27
|
-
(this.
|
|
25
|
+
(this.wi = new E()),
|
|
26
|
+
(this.yi = 10),
|
|
27
|
+
(this.Fi = null),
|
|
28
28
|
(this.ji = null),
|
|
29
|
-
e.jt(this.
|
|
29
|
+
e.jt(this.wi);
|
|
30
30
|
}
|
|
31
31
|
Ts(t) {
|
|
32
32
|
if ((!this.wt || this.wt.bi()) && null != t && t.feature_flags) {
|
|
@@ -35,7 +35,7 @@ export default class er extends y {
|
|
|
35
35
|
const t = st(s);
|
|
36
36
|
t && this.mi.push(t);
|
|
37
37
|
}
|
|
38
|
-
(this.pi = new Date().getTime()), this.vi(), this.
|
|
38
|
+
(this.pi = new Date().getTime()), this.vi(), this.wi.Et(this.mi);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
Ti() {
|
|
@@ -49,7 +49,7 @@ export default class er extends y {
|
|
|
49
49
|
return s;
|
|
50
50
|
}
|
|
51
51
|
hi(t) {
|
|
52
|
-
return this.
|
|
52
|
+
return this.wi.lt(t);
|
|
53
53
|
}
|
|
54
54
|
refreshFeatureFlags(t, s, i = !1, e = !0) {
|
|
55
55
|
if (!this.Ri(i))
|
|
@@ -84,9 +84,9 @@ export default class er extends y {
|
|
|
84
84
|
},
|
|
85
85
|
ei: () => {
|
|
86
86
|
if (e && o && !this.ji) {
|
|
87
|
-
let e = this.
|
|
88
|
-
(null == e || e < 1e3 * this.
|
|
89
|
-
this.zi(Math.min(3e5, D(1e3 * this.
|
|
87
|
+
let e = this.Fi;
|
|
88
|
+
(null == e || e < 1e3 * this.yi) && (e = 1e3 * this.yi),
|
|
89
|
+
this.zi(Math.min(3e5, D(1e3 * this.yi, 3 * e)), t, s, i);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}))
|
|
@@ -96,17 +96,17 @@ export default class er extends y {
|
|
|
96
96
|
qi() {
|
|
97
97
|
null != this.ji && (clearTimeout(this.ji), (this.ji = null));
|
|
98
98
|
}
|
|
99
|
-
zi(t = 1e3 * this.
|
|
99
|
+
zi(t = 1e3 * this.yi, s, i, e) {
|
|
100
100
|
this.qi(),
|
|
101
101
|
(this.ji = window.setTimeout(() => {
|
|
102
102
|
this.refreshFeatureFlags(s, i, e);
|
|
103
103
|
}, t)),
|
|
104
|
-
(this.
|
|
104
|
+
(this.Fi = t);
|
|
105
105
|
}
|
|
106
106
|
Ri(t) {
|
|
107
107
|
if (!this.wt) return !1;
|
|
108
108
|
if (!t) {
|
|
109
|
-
const t =
|
|
109
|
+
const t = this.wt.Si();
|
|
110
110
|
let s = !1;
|
|
111
111
|
if (!isNaN(t)) {
|
|
112
112
|
if (-1 === t) return r.j.info("Feature flag refreshes not allowed"), !1;
|
package/src/Feed/ui/show-feed.js
CHANGED
|
@@ -40,7 +40,7 @@ export function showFeed(t, n, o) {
|
|
|
40
40
|
B(f, s(f.cards, o), f.lastUpdated, null, i),
|
|
41
41
|
(a = !0))
|
|
42
42
|
: (f = new Feed(s(n, o), new Date()));
|
|
43
|
-
const u = I(f, i);
|
|
43
|
+
const u = I(f, i, l);
|
|
44
44
|
if (a) {
|
|
45
45
|
(null == f.lastUpdated ||
|
|
46
46
|
new Date().valueOf() - f.lastUpdated.valueOf() > Feed.mr) &&
|