@braze/web-sdk 5.2.0 → 5.3.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 +54 -5
- package/package.json +1 -1
- package/shared-lib/event-types.js +14 -14
- package/shared-lib/indexed-db-adapter.js +51 -51
- package/shared-lib/logger.js +7 -7
- package/shared-lib/supported-options.js +7 -7
- package/src/ContentCards/content-cards-provider.js +107 -135
- 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 +2 -2
- package/src/ContentCards/ui/show-content-cards.js +1 -1
- package/src/FeatureFlags/feature-flag.js +41 -30
- package/src/FeatureFlags/feature-flags-provider.js +88 -84
- package/src/FeatureFlags/get-all-feature-flags.js +2 -2
- package/src/FeatureFlags/get-feature-flag.js +2 -2
- package/src/FeatureFlags/log-feature-flag-impression.js +3 -3
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
- package/src/Feed/feed-provider.js +24 -24
- 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 +9 -9
- package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
- package/src/InAppMessage/display/modal-utils.js +5 -5
- package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- package/src/InAppMessage/in-app-message-manager.js +78 -75
- package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
- package/src/InAppMessage/log-in-app-message-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-impression.js +1 -1
- package/src/InAppMessage/models/full-screen-message.js +12 -12
- package/src/InAppMessage/models/html-message.js +9 -9
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +84 -82
- package/src/InAppMessage/models/modal-message.js +12 -12
- package/src/InAppMessage/models/slide-up-message.js +17 -17
- 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 +17 -17
- package/src/Push/push-manager-factory.js +6 -6
- package/src/Push/push-manager.js +1 -1
- package/src/Push/utils/push-utils.js +1 -1
- package/src/User/user.js +12 -12
- package/src/common/base-provider.js +1 -1
- package/src/common/constants.js +0 -2
- package/src/common/event-logger.js +2 -2
- package/src/common/feed-display.js +1 -1
- package/src/managers/auth-manager.js +3 -3
- package/src/managers/braze-instance.js +73 -73
- package/src/managers/device-manager.js +15 -15
- package/src/managers/network-manager.js +190 -145
- package/src/managers/server-config-manager.js +43 -47
- package/src/managers/session-manager.js +21 -21
- package/src/managers/storage-manager-factory.js +1 -1
- package/src/managers/storage-manager.js +107 -107
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +6 -6
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +8 -8
- package/src/models/server-config.js +25 -25
- package/src/request-controller.js +115 -108
- package/src/triggers/models/custom-event-data.js +2 -2
- package/src/triggers/models/custom-event-property-data.js +4 -4
- package/src/triggers/models/filter-set.js +3 -3
- package/src/triggers/models/filter.js +55 -55
- package/src/triggers/models/in-app-message-click-data.js +8 -8
- package/src/triggers/models/purchase-data.js +2 -2
- 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 +40 -40
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +31 -31
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +40 -40
- package/src/ui/js/attach-css.js +2 -2
- package/src/util/base-device-parser.js +7 -7
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +23 -23
- package/src/util/client-hints-parser.js +4 -4
- package/src/util/dom-utils.js +6 -6
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +36 -37
- package/src/util/user-agent-parser.js +7 -7
- package/src/util/window-utils.js +1 -1
|
@@ -17,12 +17,12 @@ export default class gr extends y {
|
|
|
17
17
|
(this.tg = t),
|
|
18
18
|
(this.Jt = i),
|
|
19
19
|
(this.u = s),
|
|
20
|
-
(this.
|
|
20
|
+
(this.zi = e),
|
|
21
21
|
(this.ig = r),
|
|
22
22
|
(this.tg = t),
|
|
23
23
|
(this.Jt = i),
|
|
24
24
|
(this.u = s),
|
|
25
|
-
(this.
|
|
25
|
+
(this.zi = e),
|
|
26
26
|
(this.ig = r),
|
|
27
27
|
(this.sg = []),
|
|
28
28
|
(this.eg = []),
|
|
@@ -36,12 +36,12 @@ export default class gr extends y {
|
|
|
36
36
|
}
|
|
37
37
|
fg() {
|
|
38
38
|
if (this.u) {
|
|
39
|
-
(this.hg = this.u.j(o.C.
|
|
40
|
-
(this.ng = this.u.j(o.C.
|
|
41
|
-
(this.og = this.u.j(o.C.
|
|
39
|
+
(this.hg = this.u.j(o.C.iE) || this.hg),
|
|
40
|
+
(this.ng = this.u.j(o.C.EE) || this.ng),
|
|
41
|
+
(this.og = this.u.j(o.C.aE) || this.og);
|
|
42
42
|
for (let t = 0; t < this.triggers.length; t++) {
|
|
43
43
|
const i = this.triggers[t];
|
|
44
|
-
i.id && null != this.og[i.id] && i.
|
|
44
|
+
i.id && null != this.og[i.id] && i.ad(this.og[i.id]);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -70,19 +70,19 @@ export default class gr extends y {
|
|
|
70
70
|
h = [];
|
|
71
71
|
for (let e = 0; e < t.length; e++) {
|
|
72
72
|
const n = t[e],
|
|
73
|
-
o = r.
|
|
73
|
+
o = r.ud(n.Gr || 0);
|
|
74
74
|
if (o > 0) {
|
|
75
75
|
let t, e;
|
|
76
76
|
h.push(n),
|
|
77
77
|
null != n.ug && (t = n.ug),
|
|
78
|
-
null != n.dg && ue.
|
|
78
|
+
null != n.dg && ue.RE(n.dg) && (e = ue.qn(n.dg));
|
|
79
79
|
const l = [];
|
|
80
80
|
if (n.pg && j(n.pg))
|
|
81
81
|
for (let t = 0; t < n.pg.length; t++) {
|
|
82
82
|
const i = s[n.pg[t]];
|
|
83
83
|
null != i && l.push(i);
|
|
84
84
|
}
|
|
85
|
-
this.eg.push(window.setTimeout(i(r, n.
|
|
85
|
+
this.eg.push(window.setTimeout(i(r, n.Gr || 0, t, e, l), o));
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
this.ng[r.id].length > h.length &&
|
|
@@ -91,7 +91,7 @@ export default class gr extends y {
|
|
|
91
91
|
0 === this.ng[r.id].length && delete this.ng[r.id]);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
e && this.u && this.u.k(o.C.
|
|
94
|
+
e && this.u && this.u.k(o.C.EE, this.ng);
|
|
95
95
|
}
|
|
96
96
|
mg() {
|
|
97
97
|
if (!this.u) return;
|
|
@@ -105,10 +105,10 @@ export default class gr extends y {
|
|
|
105
105
|
if (!this.u) return;
|
|
106
106
|
(this.u.j(o.C.oE) || 0) > this.lg ? this.ag() : this.fg();
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
Ns(t) {
|
|
109
109
|
let i = !1;
|
|
110
110
|
if (null != t && t.triggers) {
|
|
111
|
-
this.ig.
|
|
111
|
+
this.ig.Lr(), this.fg();
|
|
112
112
|
const s = {},
|
|
113
113
|
e = {};
|
|
114
114
|
this.triggers = [];
|
|
@@ -117,18 +117,18 @@ export default class gr extends y {
|
|
|
117
117
|
if (h) {
|
|
118
118
|
h.id &&
|
|
119
119
|
null != this.og[h.id] &&
|
|
120
|
-
(h.
|
|
120
|
+
(h.ad(this.og[h.id]), (s[h.id] = this.og[h.id])),
|
|
121
121
|
h.id && null != this.ng[h.id] && (e[h.id] = this.ng[h.id]);
|
|
122
|
-
for (let t = 0; t < h.
|
|
123
|
-
if (h.
|
|
122
|
+
for (let t = 0; t < h.sd.length; t++)
|
|
123
|
+
if (h.sd[t].sc(tt.kt, null)) {
|
|
124
124
|
i = !0;
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
127
|
this.triggers.push(h);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
ii(this.og, s) || ((this.og = s), this.u && this.u.k(o.C.
|
|
131
|
-
ii(this.ng, e) || ((this.ng = e), this.u && this.u.k(o.C.
|
|
130
|
+
ii(this.og, s) || ((this.og = s), this.u && this.u.k(o.C.aE, this.og)),
|
|
131
|
+
ii(this.ng, e) || ((this.ng = e), this.u && this.u.k(o.C.EE, this.ng)),
|
|
132
132
|
this.mg(),
|
|
133
133
|
i &&
|
|
134
134
|
(r.info("Trigger with test condition found, firing test."),
|
|
@@ -145,12 +145,12 @@ export default class gr extends y {
|
|
|
145
145
|
const n = (e) => {
|
|
146
146
|
this.fg();
|
|
147
147
|
const h = new Date().valueOf();
|
|
148
|
-
t.
|
|
149
|
-
(!1 === navigator.onLine && t.type === mt.
|
|
148
|
+
t.dd(i) ||
|
|
149
|
+
(!1 === navigator.onLine && t.type === mt._r.Br && e.imageUrl
|
|
150
150
|
? r.info(
|
|
151
151
|
`Not showing ${t.type} trigger action ${t.id} due to offline state.`,
|
|
152
152
|
)
|
|
153
|
-
: t.
|
|
153
|
+
: t.nd(h) && this.wg(t, h, s)
|
|
154
154
|
? 0 === this.Jt.ic()
|
|
155
155
|
? r.info(
|
|
156
156
|
`Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`,
|
|
@@ -164,14 +164,14 @@ export default class gr extends y {
|
|
|
164
164
|
this.fg();
|
|
165
165
|
const n = h.pop();
|
|
166
166
|
if (null != n)
|
|
167
|
-
if ((this.Tg(n, i, s, e, h), n.
|
|
167
|
+
if ((this.Tg(n, i, s, e, h), n.dd(i))) {
|
|
168
168
|
let t = `Server aborted in-app message display, but the timeout on fallback trigger ${n.id} has already elapsed.`;
|
|
169
169
|
h.length > 0 && (t += " Continuing to fall back."), r.info(t), o();
|
|
170
170
|
} else {
|
|
171
171
|
r.info(
|
|
172
172
|
`Server aborted in-app message display. Falling back to lower priority ${n.type} trigger action ${t.id}.`,
|
|
173
173
|
);
|
|
174
|
-
const o = 1e3 * n.
|
|
174
|
+
const o = 1e3 * n.ed - (new Date().valueOf() - i);
|
|
175
175
|
o > 0
|
|
176
176
|
? this.eg.push(
|
|
177
177
|
window.setTimeout(() => {
|
|
@@ -183,21 +183,21 @@ export default class gr extends y {
|
|
|
183
183
|
};
|
|
184
184
|
let l, a, g;
|
|
185
185
|
switch (t.type) {
|
|
186
|
-
case mt.
|
|
186
|
+
case mt._r.Br:
|
|
187
187
|
if (((l = pt(t.data)), null == l)) {
|
|
188
188
|
r.error(
|
|
189
189
|
`Could not parse trigger data for trigger ${t.id}, ignoring.`,
|
|
190
190
|
);
|
|
191
191
|
break;
|
|
192
192
|
}
|
|
193
|
-
if (((a = this.ig.
|
|
193
|
+
if (((a = this.ig.Li(l)), a)) {
|
|
194
194
|
r.error(a), o();
|
|
195
195
|
break;
|
|
196
196
|
}
|
|
197
197
|
n(l);
|
|
198
198
|
break;
|
|
199
|
-
case mt.
|
|
200
|
-
if (((g = wt.fromJson(t.data, n, o, i, t.
|
|
199
|
+
case mt._r.md:
|
|
200
|
+
if (((g = wt.fromJson(t.data, n, o, i, t.Nr || 0)), null == g)) {
|
|
201
201
|
r.error(
|
|
202
202
|
`Could not parse trigger data for trigger ${t.id}, ignoring.`,
|
|
203
203
|
);
|
|
@@ -211,7 +211,7 @@ export default class gr extends y {
|
|
|
211
211
|
}
|
|
212
212
|
fe(t, i = null, s) {
|
|
213
213
|
if (!J(tt, t, "Cannot fire trigger action.", "TriggerEvents")) return;
|
|
214
|
-
if (this.
|
|
214
|
+
if (this.zi && this.zi.Nu())
|
|
215
215
|
return (
|
|
216
216
|
r.info(
|
|
217
217
|
"Trigger sync is currently in progress, awaiting sync completion before firing trigger event.",
|
|
@@ -226,15 +226,15 @@ export default class gr extends y {
|
|
|
226
226
|
const l = [];
|
|
227
227
|
for (let s = 0; s < this.triggers.length; s++) {
|
|
228
228
|
const r = this.triggers[s],
|
|
229
|
-
h = e + 1e3 * r.
|
|
229
|
+
h = e + 1e3 * r.ed;
|
|
230
230
|
if (
|
|
231
|
-
r.
|
|
231
|
+
r.nd(h) &&
|
|
232
232
|
(null == r.startTime || r.startTime.valueOf() <= e) &&
|
|
233
233
|
(null == r.endTime || r.endTime.valueOf() >= e)
|
|
234
234
|
) {
|
|
235
235
|
let s = !1;
|
|
236
|
-
for (let e = 0; e < r.
|
|
237
|
-
if (r.
|
|
236
|
+
for (let e = 0; e < r.sd.length; e++)
|
|
237
|
+
if (r.sd[e].sc(t, i)) {
|
|
238
238
|
s = !0;
|
|
239
239
|
break;
|
|
240
240
|
}
|
|
@@ -258,20 +258,20 @@ export default class gr extends y {
|
|
|
258
258
|
`Firing ${a.type} trigger action ${a.id} from trigger event ${t}.`,
|
|
259
259
|
),
|
|
260
260
|
this.Tg(a, e, t, s, l),
|
|
261
|
-
0 === a.
|
|
261
|
+
0 === a.ed
|
|
262
262
|
? this.cg(a, e, t, s, l)
|
|
263
263
|
: this.eg.push(
|
|
264
264
|
window.setTimeout(() => {
|
|
265
265
|
this.cg(a, e, t, s, l);
|
|
266
|
-
}, 1e3 * a.
|
|
266
|
+
}, 1e3 * a.ed),
|
|
267
267
|
));
|
|
268
268
|
}
|
|
269
269
|
changeUser(t = !1) {
|
|
270
|
-
if (((this.triggers = []), this.u && this.u.
|
|
270
|
+
if (((this.triggers = []), this.u && this.u.ti(o.C.rE), !t)) {
|
|
271
271
|
(this.sg = []), (this.hg = null), (this.og = {}), (this.ng = {});
|
|
272
272
|
for (let t = 0; t < this.eg.length; t++) clearTimeout(this.eg[t]);
|
|
273
273
|
(this.eg = []),
|
|
274
|
-
this.u && (this.u.
|
|
274
|
+
this.u && (this.u.ti(o.C.iE), this.u.ti(o.C.aE), this.u.ti(o.C.EE));
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
clearData() {
|
|
@@ -288,25 +288,25 @@ export default class gr extends y {
|
|
|
288
288
|
),
|
|
289
289
|
!0
|
|
290
290
|
);
|
|
291
|
-
let e = t.
|
|
291
|
+
let e = t.hd;
|
|
292
292
|
return null == e && (e = this.tg), i - this.hg >= 1e3 * e;
|
|
293
293
|
}
|
|
294
294
|
Tg(t, i, s, e, r) {
|
|
295
295
|
this.fg(), t.id && (this.ng[t.id] = this.ng[t.id] || []);
|
|
296
296
|
const h = {};
|
|
297
297
|
let n;
|
|
298
|
-
(h.
|
|
298
|
+
(h.Gr = i), (h.ug = s), null != e && (n = e.Y()), (h.dg = n);
|
|
299
299
|
const l = [];
|
|
300
300
|
for (const t of r) t.id && l.push(t.id);
|
|
301
301
|
(h.pg = l),
|
|
302
302
|
t.id && this.ng[t.id].push(h),
|
|
303
|
-
this.u && this.u.k(o.C.
|
|
303
|
+
this.u && this.u.k(o.C.EE, this.ng);
|
|
304
304
|
}
|
|
305
305
|
yg(t, i) {
|
|
306
306
|
this.fg(),
|
|
307
|
-
t.
|
|
307
|
+
t.ad(i),
|
|
308
308
|
(this.hg = i),
|
|
309
309
|
t.id && (this.og[t.id] = i),
|
|
310
|
-
this.u && (this.u.k(o.C.
|
|
310
|
+
this.u && (this.u.k(o.C.iE, i), this.u.k(o.C.aE, this.og));
|
|
311
311
|
}
|
|
312
312
|
}
|
package/src/ui/js/attach-css.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import e, { OPTIONS as L } from "../../managers/braze-instance.js";
|
|
2
2
|
export function attachCSS(n, t, o) {
|
|
3
3
|
const c = n || document.querySelector("head"),
|
|
4
|
-
s = `ab-${t}-css-definitions-${"5.
|
|
4
|
+
s = `ab-${t}-css-definitions-${"5.3.0".replace(/\./g, "-")}`;
|
|
5
5
|
if (!c) return;
|
|
6
6
|
const a = c.ownerDocument || document;
|
|
7
7
|
if (null == a.getElementById(s)) {
|
|
8
8
|
const n = a.createElement("style");
|
|
9
9
|
(n.innerHTML = o || ""), (n.id = s);
|
|
10
|
-
const t = e.nn(L.
|
|
10
|
+
const t = e.nn(L.bo);
|
|
11
11
|
null != t && n.setAttribute("nonce", t), c.appendChild(n);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { isArray as j } from "./code-utils.js";
|
|
2
2
|
export default class ge {
|
|
3
3
|
constructor() {}
|
|
4
|
-
tf() {}
|
|
5
4
|
ef() {}
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
rf() {}
|
|
6
|
+
Ta(t) {}
|
|
7
|
+
static sf(t, e) {
|
|
8
8
|
if (t && e)
|
|
9
|
-
if (((t = t.toLowerCase()), j(e.
|
|
10
|
-
for (let r = 0; r < e.
|
|
11
|
-
if (-1 !== t.indexOf(e.
|
|
12
|
-
} else if (-1 !== t.indexOf(e.
|
|
9
|
+
if (((t = t.toLowerCase()), j(e.ff))) {
|
|
10
|
+
for (let r = 0; r < e.ff.length; r++)
|
|
11
|
+
if (-1 !== t.indexOf(e.ff[r].toLowerCase())) return e.identity;
|
|
12
|
+
} else if (-1 !== t.indexOf(e.ff.toLowerCase())) return e.identity;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -25,14 +25,14 @@ export const BRAZE_ACTIONS = {
|
|
|
25
25
|
properties: { type: "type", oo: "steps", eo: "args" },
|
|
26
26
|
};
|
|
27
27
|
export const INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES = {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
Qi: "unknownBrazeAction",
|
|
29
|
+
Wi: "noPushPrompt",
|
|
30
30
|
};
|
|
31
31
|
export const ineligibleBrazeActionURLErrorMessage = (t, o) => {
|
|
32
32
|
switch (t) {
|
|
33
|
-
case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.
|
|
33
|
+
case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Qi:
|
|
34
34
|
return `${o} contains an unknown braze action type and will not be displayed.`;
|
|
35
|
-
case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.
|
|
35
|
+
case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Wi:
|
|
36
36
|
return `${o} contains a push prompt braze action, but is not eligible for a push prompt. Ignoring.`;
|
|
37
37
|
default:
|
|
38
38
|
return "";
|
|
@@ -6,10 +6,10 @@ class ui {
|
|
|
6
6
|
const t = navigator.userAgentData ? ai : oi;
|
|
7
7
|
(this.Sg = new t()),
|
|
8
8
|
(this.userAgent = navigator.userAgent),
|
|
9
|
-
(this.browser = this.Sg.
|
|
10
|
-
(this.version = this.Sg.
|
|
9
|
+
(this.browser = this.Sg.ef()),
|
|
10
|
+
(this.version = this.Sg.rf()),
|
|
11
11
|
(this.OS = null),
|
|
12
|
-
this.
|
|
12
|
+
this.Ta().then((t) => (this.OS = t));
|
|
13
13
|
const i = navigator;
|
|
14
14
|
(this.language = (
|
|
15
15
|
i.userLanguage ||
|
|
@@ -18,18 +18,18 @@ class ui {
|
|
|
18
18
|
i.systemLanguage ||
|
|
19
19
|
""
|
|
20
20
|
).toLowerCase()),
|
|
21
|
-
(this.
|
|
21
|
+
(this.Zo = ui.vg(this.userAgent));
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
IE() {
|
|
24
24
|
return this.browser === gi.Bg;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
Oa() {
|
|
27
27
|
return this.OS || null;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
Ta() {
|
|
30
30
|
return this.OS
|
|
31
31
|
? Promise.resolve(this.OS)
|
|
32
|
-
: this.Sg.
|
|
32
|
+
: this.Sg.Ta(ui.kg).then((t) => ((this.OS = t), t));
|
|
33
33
|
}
|
|
34
34
|
static vg(t) {
|
|
35
35
|
t = t.toLowerCase();
|
|
@@ -57,29 +57,29 @@ class ui {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
ui.kg = [
|
|
60
|
-
{ string: navigator.platform,
|
|
61
|
-
{ string: navigator.platform,
|
|
62
|
-
{ string: navigator.platform,
|
|
63
|
-
{ string: navigator.platform,
|
|
64
|
-
{ string: navigator.platform,
|
|
65
|
-
{ string: navigator.platform,
|
|
66
|
-
{ string: navigator.platform,
|
|
67
|
-
{ string: navigator.platform,
|
|
68
|
-
{ string: navigator.platform,
|
|
60
|
+
{ string: navigator.platform, ff: "Win", identity: Y.Og },
|
|
61
|
+
{ string: navigator.platform, ff: "Mac", identity: Y.Pg },
|
|
62
|
+
{ string: navigator.platform, ff: "BlackBerry", identity: "BlackBerry" },
|
|
63
|
+
{ string: navigator.platform, ff: "FreeBSD", identity: "FreeBSD" },
|
|
64
|
+
{ string: navigator.platform, ff: "OpenBSD", identity: "OpenBSD" },
|
|
65
|
+
{ string: navigator.platform, ff: "Nintendo", identity: "Nintendo" },
|
|
66
|
+
{ string: navigator.platform, ff: "SunOS", identity: "SunOS" },
|
|
67
|
+
{ string: navigator.platform, ff: "PlayStation", identity: "PlayStation" },
|
|
68
|
+
{ string: navigator.platform, ff: "X11", identity: "X11" },
|
|
69
69
|
{
|
|
70
70
|
string: navigator.userAgent,
|
|
71
|
-
|
|
71
|
+
ff: ["iPhone", "iPad", "iPod"],
|
|
72
72
|
identity: Y.io,
|
|
73
73
|
},
|
|
74
|
-
{ string: navigator.platform,
|
|
75
|
-
{ string: navigator.userAgent,
|
|
74
|
+
{ string: navigator.platform, ff: "Pike v", identity: Y.io },
|
|
75
|
+
{ string: navigator.userAgent, ff: ["Web0S"], identity: "WebOS" },
|
|
76
76
|
{
|
|
77
77
|
string: navigator.platform,
|
|
78
|
-
|
|
78
|
+
ff: ["Linux armv7l", "Android"],
|
|
79
79
|
identity: Y.xg,
|
|
80
80
|
},
|
|
81
|
-
{ string: navigator.userAgent,
|
|
82
|
-
{ string: navigator.platform,
|
|
81
|
+
{ string: navigator.userAgent, ff: ["Android"], identity: Y.xg },
|
|
82
|
+
{ string: navigator.platform, ff: "Linux", identity: "Linux" },
|
|
83
83
|
];
|
|
84
84
|
const X = new ui();
|
|
85
85
|
export { X as default, ui as BrowserDetector };
|
|
@@ -15,17 +15,17 @@ export default class ai extends ge {
|
|
|
15
15
|
}
|
|
16
16
|
this.OS = null;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
ef() {
|
|
19
19
|
return this.browser;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
rf() {
|
|
22
22
|
return this.version;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
Ta(t) {
|
|
25
25
|
if (this.OS) return Promise.resolve(this.OS);
|
|
26
26
|
const s = (s) => {
|
|
27
27
|
for (let r = 0; r < t.length; r++) {
|
|
28
|
-
const i = ai.
|
|
28
|
+
const i = ai.sf(s, t[r]);
|
|
29
29
|
if (i) return (this.OS = i), this.OS;
|
|
30
30
|
}
|
|
31
31
|
return s;
|
package/src/util/dom-utils.js
CHANGED
|
@@ -18,8 +18,8 @@ export function _isInView(t, n = !1, e = !1, s = !1) {
|
|
|
18
18
|
!s)
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
|
-
export const DOMUtils = { dc: null,
|
|
22
|
-
export const DIRECTIONS = {
|
|
21
|
+
export const DOMUtils = { dc: null, po: _isInView };
|
|
22
|
+
export const DIRECTIONS = { Re: "up", Se: "down", U: "left", V: "right" };
|
|
23
23
|
export function supportsPassive() {
|
|
24
24
|
if (null == DOMUtils.dc) {
|
|
25
25
|
DOMUtils.dc = !1;
|
|
@@ -41,10 +41,10 @@ export function addPassiveEventListener(t, n, e = () => {}) {
|
|
|
41
41
|
t.addEventListener(n, e, !!supportsPassive() && { passive: !0 });
|
|
42
42
|
}
|
|
43
43
|
export function topIsInView(t) {
|
|
44
|
-
return DOMUtils.
|
|
44
|
+
return DOMUtils.po(t, !0, !1, !1);
|
|
45
45
|
}
|
|
46
46
|
export function bottomIsInView(t) {
|
|
47
|
-
return DOMUtils.
|
|
47
|
+
return DOMUtils.po(t, !1, !0, !1);
|
|
48
48
|
}
|
|
49
49
|
export function clickElement(t) {
|
|
50
50
|
if (t.onclick) {
|
|
@@ -69,9 +69,9 @@ export function detectSwipe(t, n, e) {
|
|
|
69
69
|
(i = null))
|
|
70
70
|
: Math.abs(u) >= 25 &&
|
|
71
71
|
(((u > 0 &&
|
|
72
|
-
n === DIRECTIONS.
|
|
72
|
+
n === DIRECTIONS.Re &&
|
|
73
73
|
t.scrollTop === t.scrollHeight - t.offsetHeight) ||
|
|
74
|
-
(u < 0 && n === DIRECTIONS.
|
|
74
|
+
(u < 0 && n === DIRECTIONS.Se && 0 === t.scrollTop)) &&
|
|
75
75
|
e(o),
|
|
76
76
|
(s = null),
|
|
77
77
|
(i = null));
|
package/src/util/net.js
CHANGED
|
@@ -2,7 +2,7 @@ import { logger as r } from "../../shared-lib/index.js";
|
|
|
2
2
|
import qt from "../models/backend-errors.js";
|
|
3
3
|
import { getErrorMessage as si } from "./error-utils.js";
|
|
4
4
|
const C = {
|
|
5
|
-
|
|
5
|
+
Gs: (t) => {
|
|
6
6
|
let e, o;
|
|
7
7
|
try {
|
|
8
8
|
const n = () => {
|
|
@@ -13,7 +13,7 @@ const C = {
|
|
|
13
13
|
e = new XMLHttpRequest();
|
|
14
14
|
const i = () => {
|
|
15
15
|
"function" == typeof t.error && t.error(e.status),
|
|
16
|
-
"function" == typeof t.
|
|
16
|
+
"function" == typeof t.Ws && t.Ws(!1);
|
|
17
17
|
};
|
|
18
18
|
(e.onload = () => {
|
|
19
19
|
let o = !1;
|
|
@@ -28,14 +28,14 @@ const C = {
|
|
|
28
28
|
(r = e.getAllResponseHeaders());
|
|
29
29
|
} catch (o) {
|
|
30
30
|
const n = {
|
|
31
|
-
error: "" === e.responseText ? qt.
|
|
31
|
+
error: "" === e.responseText ? qt.Zh : qt.Ra,
|
|
32
32
|
response: e.responseText,
|
|
33
33
|
};
|
|
34
34
|
(0, t.L)(n, r);
|
|
35
35
|
}
|
|
36
36
|
o && t.L(o, r);
|
|
37
37
|
}
|
|
38
|
-
"function" == typeof t.
|
|
38
|
+
"function" == typeof t.Ws && t.Ws(!0);
|
|
39
39
|
} else i();
|
|
40
40
|
}),
|
|
41
41
|
(e.onerror = () => {
|
|
@@ -1,48 +1,47 @@
|
|
|
1
1
|
import { REQUEST_ATTEMPT_DEFAULT as Ae } from "../common/constants.js";
|
|
2
2
|
import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const s = S.mc(e);
|
|
3
|
+
const D = {
|
|
4
|
+
Ps: {
|
|
5
|
+
$a: "data",
|
|
6
|
+
Bs: "content_cards/sync",
|
|
7
|
+
bi: "feature_flags/sync",
|
|
8
|
+
Mr: "template",
|
|
9
|
+
},
|
|
10
|
+
qu: (t) => (null == t ? void 0 : t.j(o.C.lE)),
|
|
11
|
+
sm: (t) => (null == t ? void 0 : t.j(o.C.SE)),
|
|
12
|
+
nm: (t, e) => {
|
|
13
|
+
null == t || t.k(o.C.lE, e);
|
|
14
|
+
},
|
|
15
|
+
um: (t, e) => {
|
|
16
|
+
null == t || t.k(o.C.SE, e);
|
|
17
|
+
},
|
|
18
|
+
Pa: (t, e) => {
|
|
19
|
+
if (!t || !e) return -1;
|
|
20
|
+
const s = D.qu(t);
|
|
22
21
|
if (null == s) return -1;
|
|
23
|
-
const n = s[
|
|
22
|
+
const n = s[e];
|
|
24
23
|
return null == n || isNaN(n) ? -1 : n;
|
|
25
24
|
},
|
|
26
|
-
|
|
25
|
+
Ua: (t, e) => {
|
|
27
26
|
let s = Ae;
|
|
28
|
-
if (!
|
|
29
|
-
const n =
|
|
30
|
-
return null == n ? s : ((s = n[
|
|
27
|
+
if (!t || !e) return s;
|
|
28
|
+
const n = D.sm(t);
|
|
29
|
+
return null == n ? s : ((s = n[e]), null == s || isNaN(s) ? Ae : s);
|
|
31
30
|
},
|
|
32
|
-
|
|
33
|
-
if (!
|
|
34
|
-
let n =
|
|
35
|
-
null == n && (n = {}), (n[
|
|
31
|
+
_s: (t, e, s) => {
|
|
32
|
+
if (!t || !e) return;
|
|
33
|
+
let n = D.qu(t);
|
|
34
|
+
null == n && (n = {}), (n[e] = s), D.nm(t, n);
|
|
36
35
|
},
|
|
37
|
-
|
|
38
|
-
if (!
|
|
39
|
-
let n =
|
|
40
|
-
null == n && (n = {}), (n[
|
|
36
|
+
Qs: (t, e, s) => {
|
|
37
|
+
if (!t || !e) return;
|
|
38
|
+
let n = D.sm(t);
|
|
39
|
+
null == n && (n = {}), (n[e] = s), D.um(t, n);
|
|
41
40
|
},
|
|
42
|
-
|
|
43
|
-
if (!
|
|
44
|
-
const s =
|
|
45
|
-
|
|
41
|
+
Ys: (t, e) => {
|
|
42
|
+
if (!t || !e) return;
|
|
43
|
+
const s = D.Ua(t, e);
|
|
44
|
+
D.Qs(t, e, s + 1);
|
|
46
45
|
},
|
|
47
46
|
};
|
|
48
|
-
export default
|
|
47
|
+
export default D;
|
|
@@ -2,18 +2,18 @@ import ge from "./base-device-parser.js";
|
|
|
2
2
|
import { Browsers as gi, OperatingSystems as Y } from "./device-constants.js";
|
|
3
3
|
export default class oi extends ge {
|
|
4
4
|
constructor() {
|
|
5
|
-
super(), (this.
|
|
6
|
-
}
|
|
7
|
-
tf() {
|
|
8
|
-
return this.nd[0] || "Unknown Browser";
|
|
5
|
+
super(), (this.fd = oi.hc(navigator.userAgent || ""));
|
|
9
6
|
}
|
|
10
7
|
ef() {
|
|
11
|
-
return this.
|
|
8
|
+
return this.fd[0] || "Unknown Browser";
|
|
9
|
+
}
|
|
10
|
+
rf() {
|
|
11
|
+
return this.fd[1] || "Unknown Version";
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
Ta(r) {
|
|
14
14
|
for (let n = 0; n < r.length; n++) {
|
|
15
15
|
const e = r[n].string;
|
|
16
|
-
let i = oi.
|
|
16
|
+
let i = oi.sf(e, r[n]);
|
|
17
17
|
if (i)
|
|
18
18
|
return (
|
|
19
19
|
i === Y.Pg && navigator.maxTouchPoints > 1 && (i = Y.io),
|