@braze/web-sdk 4.4.0 → 4.5.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 +15 -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 +7 -7
- package/shared-lib/indexed-db-adapter.js +1 -1
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +13 -13
- package/src/Card/models/card.js +1 -0
- package/src/Card/models/control-card.js +3 -2
- package/src/InAppMessage/log-in-app-message-click.js +4 -1
- package/src/InAppMessage/models/control-message.js +1 -1
- package/src/InAppMessage/models/in-app-message.js +8 -4
- package/src/Push/push-manager.js +54 -54
- package/src/Push/utils/push-utils.js +3 -3
- package/src/User/user-manager.js +4 -4
- package/src/User/user.js +8 -8
- package/src/managers/auth-manager.js +4 -4
- package/src/managers/braze-instance.js +81 -81
- package/src/managers/device-manager.js +7 -7
- package/src/managers/network-manager.js +39 -39
- package/src/managers/server-config-manager.js +4 -4
- package/src/managers/session-manager.js +1 -1
- package/src/managers/storage-manager-factory.js +1 -1
- package/src/managers/storage-manager.js +40 -40
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +1 -1
- package/src/models/identifier.js +1 -1
- package/src/models/push-token.js +3 -3
- package/src/models/server-config.js +3 -3
- package/src/request-controller.js +64 -64
- package/src/triggers/models/custom-event-data.js +1 -1
- package/src/triggers/models/custom-event-property-data.js +5 -5
- package/src/triggers/models/filter-set.js +4 -4
- package/src/triggers/models/filter.js +57 -57
- 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 +5 -5
- package/src/triggers/models/push-click-data.js +1 -1
- package/src/triggers/models/trigger-condition.js +4 -4
- package/src/triggers/models/trigger.js +16 -16
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +14 -14
- 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/browser-detector.js +5 -5
- package/src/util/client-hints-parser.js +1 -1
- package/src/util/net.js +3 -3
- package/src/util/user-agent-parser.js +1 -1
- package/src/util/window-utils.js +1 -1
|
@@ -7,57 +7,57 @@ import {
|
|
|
7
7
|
} from "../../util/date-utils.js";
|
|
8
8
|
export default class Gt {
|
|
9
9
|
constructor(t, s, e, i) {
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
10
|
+
(this.Xl = t),
|
|
11
|
+
(this.Vl = s),
|
|
12
12
|
(this.comparator = e),
|
|
13
|
-
(this.
|
|
14
|
-
this.
|
|
15
|
-
this.comparator !== Gt.Ah
|
|
16
|
-
this.comparator !== Gt.
|
|
17
|
-
this.comparator !== Gt.
|
|
18
|
-
this.comparator !== Gt.
|
|
19
|
-
(this.
|
|
13
|
+
(this.Yl = i),
|
|
14
|
+
this.Vl === Gt.Th.Zl &&
|
|
15
|
+
this.comparator !== Gt._h.Ah &&
|
|
16
|
+
this.comparator !== Gt._h.yh &&
|
|
17
|
+
this.comparator !== Gt._h.Mh &&
|
|
18
|
+
this.comparator !== Gt._h.Rh &&
|
|
19
|
+
(this.Yl = h(this.Yl));
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
Hl(t) {
|
|
22
22
|
let s = null;
|
|
23
|
-
switch ((null != t && (s = t[this.
|
|
24
|
-
case Gt.
|
|
25
|
-
return null != s && s.valueOf() === this.
|
|
26
|
-
case Gt.
|
|
27
|
-
return null == s || s.valueOf() !== this.
|
|
28
|
-
case Gt.
|
|
29
|
-
return typeof s == typeof this.
|
|
30
|
-
case Gt.Ah
|
|
31
|
-
return this.
|
|
32
|
-
? null != s && yt(s) && Ht(s) <= this.
|
|
33
|
-
: typeof s == typeof this.
|
|
34
|
-
case Gt.
|
|
35
|
-
return typeof s == typeof this.
|
|
36
|
-
case Gt.
|
|
37
|
-
return this.
|
|
38
|
-
? null != s && yt(s) && Ht(s) >= this.
|
|
39
|
-
: typeof s == typeof this.
|
|
40
|
-
case Gt.
|
|
23
|
+
switch ((null != t && (s = t[this.Xl]), this.comparator)) {
|
|
24
|
+
case Gt._h.Hh:
|
|
25
|
+
return null != s && s.valueOf() === this.Yl.valueOf();
|
|
26
|
+
case Gt._h.Lh:
|
|
27
|
+
return null == s || s.valueOf() !== this.Yl.valueOf();
|
|
28
|
+
case Gt._h.Ih:
|
|
29
|
+
return typeof s == typeof this.Yl && s > this.Yl;
|
|
30
|
+
case Gt._h.Ah:
|
|
31
|
+
return this.Vl === Gt.Th.Zl
|
|
32
|
+
? null != s && yt(s) && Ht(s) <= this.Yl
|
|
33
|
+
: typeof s == typeof this.Yl && s >= this.Yl;
|
|
34
|
+
case Gt._h.Oh:
|
|
35
|
+
return typeof s == typeof this.Yl && s < this.Yl;
|
|
36
|
+
case Gt._h.yh:
|
|
37
|
+
return this.Vl === Gt.Th.Zl
|
|
38
|
+
? null != s && yt(s) && Ht(s) >= this.Yl
|
|
39
|
+
: typeof s == typeof this.Yl && s <= this.Yl;
|
|
40
|
+
case Gt._h.Uh:
|
|
41
41
|
return (
|
|
42
42
|
null != s &&
|
|
43
43
|
"string" == typeof s &&
|
|
44
|
-
typeof s == typeof this.
|
|
45
|
-
null != s.match(this.
|
|
44
|
+
typeof s == typeof this.Yl &&
|
|
45
|
+
null != s.match(this.Yl)
|
|
46
46
|
);
|
|
47
|
-
case Gt.
|
|
47
|
+
case Gt._h.Qh:
|
|
48
48
|
return null != s;
|
|
49
|
-
case Gt.
|
|
49
|
+
case Gt._h.Xh:
|
|
50
50
|
return null == s;
|
|
51
|
-
case Gt.
|
|
52
|
-
return null != s && yt(s) && Ut(s) < this.
|
|
53
|
-
case Gt.
|
|
54
|
-
return null != s && yt(s) && Ut(s) > this.
|
|
55
|
-
case Gt.
|
|
51
|
+
case Gt._h.Mh:
|
|
52
|
+
return null != s && yt(s) && Ut(s) < this.Yl;
|
|
53
|
+
case Gt._h.Rh:
|
|
54
|
+
return null != s && yt(s) && Ut(s) > this.Yl;
|
|
55
|
+
case Gt._h.Bh:
|
|
56
56
|
return (
|
|
57
57
|
null == s ||
|
|
58
|
-
typeof s != typeof this.
|
|
58
|
+
typeof s != typeof this.Yl ||
|
|
59
59
|
"string" != typeof s ||
|
|
60
|
-
null == s.match(this.
|
|
60
|
+
null == s.match(this.Yl)
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
return !1;
|
|
@@ -71,28 +71,28 @@ export default class Gt {
|
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
ss() {
|
|
74
|
-
let t = this.
|
|
74
|
+
let t = this.Yl;
|
|
75
75
|
return (
|
|
76
|
-
yt(this.
|
|
77
|
-
{ k: this.
|
|
76
|
+
yt(this.Yl) && (t = l(t.valueOf())),
|
|
77
|
+
{ k: this.Xl, t: this.Vl, c: this.comparator, v: t }
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
|
-
static
|
|
80
|
+
static Sn(t) {
|
|
81
81
|
return new Gt(t.k, t.t, t.c, t.v);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
(Gt.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
(Gt._h = {
|
|
85
|
+
Hh: 1,
|
|
86
|
+
Lh: 2,
|
|
87
|
+
Ih: 3,
|
|
88
|
+
Ah: 4,
|
|
89
|
+
Oh: 5,
|
|
90
|
+
yh: 6,
|
|
91
|
+
Uh: 10,
|
|
92
|
+
Qh: 11,
|
|
93
|
+
Xh: 12,
|
|
94
|
+
Mh: 15,
|
|
95
|
+
Rh: 16,
|
|
96
|
+
Bh: 17
|
|
97
97
|
}),
|
|
98
|
-
(Gt.
|
|
98
|
+
(Gt.Th = { Fh: "boolean", kh: "number", Jh: "string", Zl: "date" });
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import kt from "./filter-set.js";
|
|
2
2
|
export default class Xt {
|
|
3
3
|
constructor(t, s) {
|
|
4
|
-
(this.productId = t), (this.
|
|
4
|
+
(this.productId = t), (this.Ql = s);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
if (null == this.productId || null == this.
|
|
6
|
+
Hl(t) {
|
|
7
|
+
if (null == this.productId || null == this.Ql) return !1;
|
|
8
8
|
const s = t[0],
|
|
9
9
|
i = t[1];
|
|
10
|
-
return s === this.productId && this.Hl
|
|
10
|
+
return s === this.productId && this.Ql.Hl(i);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
13
|
return new Xt(
|
|
@@ -16,6 +16,6 @@ export default class Xt {
|
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
ss() {
|
|
19
|
-
return { id: this.productId, pf: this.
|
|
19
|
+
return { id: this.productId, pf: this.Ql.ss() };
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -12,7 +12,7 @@ export default class Kt {
|
|
|
12
12
|
(this.type = e), (this.data = t);
|
|
13
13
|
}
|
|
14
14
|
ec(e, t) {
|
|
15
|
-
return Kt.tc[this.type] === e && (null == this.data || this.data.
|
|
15
|
+
return Kt.tc[this.type] === e && (null == this.data || this.data.Hl(t));
|
|
16
16
|
}
|
|
17
17
|
static du(e, t) {
|
|
18
18
|
let a = null;
|
|
@@ -58,7 +58,7 @@ export default class Kt {
|
|
|
58
58
|
ss() {
|
|
59
59
|
return { t: this.type, d: this.data ? this.data.ss() : null };
|
|
60
60
|
}
|
|
61
|
-
static
|
|
61
|
+
static Sn(e) {
|
|
62
62
|
let t, r;
|
|
63
63
|
switch (e.t) {
|
|
64
64
|
case Kt.rc.OPEN:
|
|
@@ -68,7 +68,7 @@ export default class Kt {
|
|
|
68
68
|
t = new Wt(e.d);
|
|
69
69
|
break;
|
|
70
70
|
case Kt.rc.ac:
|
|
71
|
-
(r = e.d || {}), (t = new Xt(r.id, kt.
|
|
71
|
+
(r = e.d || {}), (t = new Xt(r.id, kt.Sn(r.pf || [])));
|
|
72
72
|
break;
|
|
73
73
|
case Kt.rc.vr:
|
|
74
74
|
t = new Yt(e.d);
|
|
@@ -77,7 +77,7 @@ export default class Kt {
|
|
|
77
77
|
t = new xt(e.d);
|
|
78
78
|
break;
|
|
79
79
|
case Kt.rc.sc:
|
|
80
|
-
(r = e.d || {}), (t = new Dt(r.e, kt.
|
|
80
|
+
(r = e.d || {}), (t = new Dt(r.e, kt.Sn(r.pf || [])));
|
|
81
81
|
break;
|
|
82
82
|
case Kt.rc.Ar:
|
|
83
83
|
t = new Qt(e.d);
|
|
@@ -19,24 +19,24 @@ export default class mt {
|
|
|
19
19
|
null == a && (a = 1e3 * (this.$h + 30)),
|
|
20
20
|
(this.$i = a),
|
|
21
21
|
(this.data = o),
|
|
22
|
-
null == h && (h = mt.
|
|
23
|
-
(this.
|
|
24
|
-
(this.
|
|
25
|
-
(this.
|
|
22
|
+
null == h && (h = mt.Vh),
|
|
23
|
+
(this.qh = h),
|
|
24
|
+
(this.Kh = u),
|
|
25
|
+
(this.Wh = d || null);
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
Yh(t) {
|
|
28
28
|
return (
|
|
29
|
-
null == this.
|
|
29
|
+
null == this.Wh || (this.qh !== mt.Vh && t - this.Wh >= 1e3 * this.qh)
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
Yh(t) {
|
|
33
|
-
this.Kh = t;
|
|
34
|
-
}
|
|
35
32
|
Zh(t) {
|
|
33
|
+
this.Wh = t;
|
|
34
|
+
}
|
|
35
|
+
gu(t) {
|
|
36
36
|
const i = t + 1e3 * this.$h;
|
|
37
37
|
return Math.max(i - new Date().valueOf(), 0);
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
pu(t) {
|
|
40
40
|
const i = new Date().valueOf() - t,
|
|
41
41
|
s = null == t || isNaN(i) || null == this.$i || i < this.$i;
|
|
42
42
|
return (
|
|
@@ -82,15 +82,15 @@ export default class mt {
|
|
|
82
82
|
t: this.type,
|
|
83
83
|
da: this.data,
|
|
84
84
|
d: this.$h,
|
|
85
|
-
r: this.
|
|
85
|
+
r: this.qh,
|
|
86
86
|
tm: this.$i,
|
|
87
|
-
ss: this.
|
|
88
|
-
ld: this.
|
|
87
|
+
ss: this.Kh,
|
|
88
|
+
ld: this.Wh
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
static
|
|
91
|
+
static Sn(t) {
|
|
92
92
|
const i = [];
|
|
93
|
-
for (let s = 0; s < t.c.length; s++) i.push(Kt.
|
|
93
|
+
for (let s = 0; s < t.c.length; s++) i.push(Kt.Sn(t.c[s]));
|
|
94
94
|
return new mt(
|
|
95
95
|
t.i,
|
|
96
96
|
i,
|
|
@@ -107,4 +107,4 @@ export default class mt {
|
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
(mt.
|
|
110
|
+
(mt.Vh = -1), (mt._i = { Ti: "inapp", Tu: "templated_iam" });
|
|
@@ -7,7 +7,7 @@ export const TriggersProviderFactory = {
|
|
|
7
7
|
er: () => (TriggersProviderFactory.init(), TriggersProviderFactory.provider),
|
|
8
8
|
rg: () => {
|
|
9
9
|
if (!TriggersProviderFactory.provider) {
|
|
10
|
-
const r = e.nn(T.
|
|
10
|
+
const r = e.nn(T.Ao);
|
|
11
11
|
(TriggersProviderFactory.provider = new gr(
|
|
12
12
|
null != r ? r : 30,
|
|
13
13
|
pe.m().Ve(),
|
|
@@ -34,14 +34,14 @@ export default class gr extends y {
|
|
|
34
34
|
(this.ng = this.h.I(o.q.Ga) || this.ng);
|
|
35
35
|
for (let t = 0; t < this.cg.length; t++) {
|
|
36
36
|
const i = this.cg[t];
|
|
37
|
-
null != this.ng[i.id] && i.
|
|
37
|
+
null != this.ng[i.id] && i.Zh(this.ng[i.id]);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
ag() {
|
|
41
41
|
this.fg = this.h.I(o.q.Da) || 0;
|
|
42
42
|
const t = this.h.I(o.q.Ya) || [],
|
|
43
43
|
i = [];
|
|
44
|
-
for (let s = 0; s < t.length; s++) i.push(mt.
|
|
44
|
+
for (let s = 0; s < t.length; s++) i.push(mt.Sn(t[s]));
|
|
45
45
|
(this.cg = i), this.gg();
|
|
46
46
|
}
|
|
47
47
|
lg() {
|
|
@@ -61,12 +61,12 @@ export default class gr extends y {
|
|
|
61
61
|
h = [];
|
|
62
62
|
for (let e = 0; e < t.length; e++) {
|
|
63
63
|
const o = t[e],
|
|
64
|
-
n = r.
|
|
64
|
+
n = r.gu(o.Si);
|
|
65
65
|
if (n > 0) {
|
|
66
66
|
let t, e;
|
|
67
67
|
h.push(o),
|
|
68
68
|
null != o.dg && (t = o.dg),
|
|
69
|
-
null != o.mg && ue.Fa(o.mg) && (e = ue.
|
|
69
|
+
null != o.mg && ue.Fa(o.mg) && (e = ue.Sn(o.mg));
|
|
70
70
|
const a = [];
|
|
71
71
|
if (p(o.pg))
|
|
72
72
|
for (let t = 0; t < o.pg.length; t++) {
|
|
@@ -104,7 +104,7 @@ export default class gr extends y {
|
|
|
104
104
|
for (let r = 0; r < t.triggers.length; r++) {
|
|
105
105
|
const h = mt.fromJson(t.triggers[r]);
|
|
106
106
|
null != this.ng[h.id] &&
|
|
107
|
-
(h.
|
|
107
|
+
(h.Zh(this.ng[h.id]), (s[h.id] = this.ng[h.id])),
|
|
108
108
|
null != this.og[h.id] && (e[h.id] = this.og[h.id]);
|
|
109
109
|
for (let t = 0; t < h.Ph.length; t++)
|
|
110
110
|
if (h.Ph[t].ec(V.ks, null)) {
|
|
@@ -129,13 +129,13 @@ export default class gr extends y {
|
|
|
129
129
|
const o = e => {
|
|
130
130
|
this.gg();
|
|
131
131
|
const h = new Date().valueOf();
|
|
132
|
-
if (!t.
|
|
132
|
+
if (!t.pu(i))
|
|
133
133
|
return !1 === navigator.onLine && t.type === mt._i.Ti && e.imageUrl
|
|
134
134
|
? (r.D.info(
|
|
135
135
|
`Not showing ${t.type} trigger action ${t.id} due to offline state.`
|
|
136
136
|
),
|
|
137
137
|
void this.ig.ni(t.id, InAppMessage.li.nh))
|
|
138
|
-
: void (t.
|
|
138
|
+
: void (t.Yh(h) && this.yg(t, h, s)
|
|
139
139
|
? 0 === this.yt.bu()
|
|
140
140
|
? r.D.info(
|
|
141
141
|
`Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`
|
|
@@ -144,7 +144,7 @@ export default class gr extends y {
|
|
|
144
144
|
: r.D.info(
|
|
145
145
|
`Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`
|
|
146
146
|
));
|
|
147
|
-
t.type === mt._i.
|
|
147
|
+
t.type === mt._i.Tu
|
|
148
148
|
? this.ig.ni(t.id, InAppMessage.li.zi)
|
|
149
149
|
: this.ig.ni(t.id, InAppMessage.li.rh);
|
|
150
150
|
},
|
|
@@ -152,7 +152,7 @@ export default class gr extends y {
|
|
|
152
152
|
this.gg();
|
|
153
153
|
const o = h.pop();
|
|
154
154
|
if (null != o)
|
|
155
|
-
if ((this.wg(o, i, s, e, h), o.
|
|
155
|
+
if ((this.wg(o, i, s, e, h), o.pu(i))) {
|
|
156
156
|
let t = `Server aborted in-app message display, but the timeout on fallback trigger ${o.id} has already elapsed.`;
|
|
157
157
|
h.length > 0 && (t += " Continuing to fall back."),
|
|
158
158
|
r.D.info(t),
|
|
@@ -189,7 +189,7 @@ export default class gr extends y {
|
|
|
189
189
|
}
|
|
190
190
|
o(h);
|
|
191
191
|
break;
|
|
192
|
-
case mt._i.
|
|
192
|
+
case mt._i.Tu:
|
|
193
193
|
const l = wt.fromJson(t.data, o, n, i, t.$i);
|
|
194
194
|
if (null == l) {
|
|
195
195
|
r.D.error(
|
|
@@ -209,7 +209,7 @@ export default class gr extends y {
|
|
|
209
209
|
}
|
|
210
210
|
je(t, i, s) {
|
|
211
211
|
if (!F(V, t, "Cannot fire trigger action.", "TriggerEvents")) return;
|
|
212
|
-
if (this.si.
|
|
212
|
+
if (this.si.Ml())
|
|
213
213
|
return (
|
|
214
214
|
r.D.info(
|
|
215
215
|
"Trigger sync is currently in progress, awaiting sync completion before firing trigger event."
|
|
@@ -226,7 +226,7 @@ export default class gr extends y {
|
|
|
226
226
|
const r = this.cg[s],
|
|
227
227
|
h = e + 1e3 * r.$h;
|
|
228
228
|
if (
|
|
229
|
-
r.
|
|
229
|
+
r.Yh(h) &&
|
|
230
230
|
(null == r.startTime || r.startTime <= e) &&
|
|
231
231
|
(null == r.endTime || r.endTime >= e)
|
|
232
232
|
) {
|
|
@@ -284,7 +284,7 @@ export default class gr extends y {
|
|
|
284
284
|
),
|
|
285
285
|
!0
|
|
286
286
|
);
|
|
287
|
-
let e = t.
|
|
287
|
+
let e = t.Kh;
|
|
288
288
|
return null == e && (e = this.tg), i - this.hg >= 1e3 * e;
|
|
289
289
|
}
|
|
290
290
|
wg(t, i, s, e, r) {
|
|
@@ -298,7 +298,7 @@ export default class gr extends y {
|
|
|
298
298
|
}
|
|
299
299
|
vg(t, i) {
|
|
300
300
|
this.gg(),
|
|
301
|
-
t.
|
|
301
|
+
t.Zh(i),
|
|
302
302
|
(this.hg = i),
|
|
303
303
|
this.h.B(o.q.Na, i),
|
|
304
304
|
(this.ng[t.id] = i),
|
package/src/ui/js/attach-css.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e, { OPTIONS as T } 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-${"4.
|
|
4
|
+
s = `ab-${t}-css-definitions-${"4.5.0".replace(/\./g, "-")}`,
|
|
5
5
|
a = c.ownerDocument || document;
|
|
6
6
|
if (null == a.getElementById(s)) {
|
|
7
7
|
const n = a.createElement("style");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e, { OPTIONS as T } from "../../managers/braze-instance.js";
|
|
2
2
|
export function loadFontAwesome() {
|
|
3
|
-
if (e.nn(T.
|
|
3
|
+
if (e.nn(T.Oo)) return;
|
|
4
4
|
const t = "https://use.fontawesome.com/7f85a56ba4.css";
|
|
5
5
|
if (
|
|
6
6
|
!(null !== document.querySelector('link[rel=stylesheet][href="' + t + '"]'))
|
|
@@ -8,7 +8,7 @@ class si {
|
|
|
8
8
|
(this.userAgent = navigator.userAgent),
|
|
9
9
|
(this.browser = this.Sg.tf()),
|
|
10
10
|
(this.version = this.Sg.ef()),
|
|
11
|
-
this.
|
|
11
|
+
this.Zo().then(t => (this.OS = t)),
|
|
12
12
|
(this.language = (
|
|
13
13
|
navigator.userLanguage ||
|
|
14
14
|
navigator.language ||
|
|
@@ -16,7 +16,7 @@ class si {
|
|
|
16
16
|
navigator.systemLanguage ||
|
|
17
17
|
""
|
|
18
18
|
).toLowerCase()),
|
|
19
|
-
(this.
|
|
19
|
+
(this.Wo = si.Bg(this.userAgent));
|
|
20
20
|
}
|
|
21
21
|
Og() {
|
|
22
22
|
return this.browser !== ri.Pg || this.version > 8;
|
|
@@ -24,13 +24,13 @@ class si {
|
|
|
24
24
|
Ja() {
|
|
25
25
|
return this.browser === ri.kg;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
Xo() {
|
|
28
28
|
return this.OS || null;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
Zo() {
|
|
31
31
|
return this.OS
|
|
32
32
|
? Promise.resolve(this.OS)
|
|
33
|
-
: this.Sg.
|
|
33
|
+
: this.Sg.Zo(si.xg).then(t => ((this.OS = t), t));
|
|
34
34
|
}
|
|
35
35
|
static Bg(t) {
|
|
36
36
|
t = t.toLowerCase();
|
package/src/util/net.js
CHANGED
|
@@ -13,7 +13,7 @@ const b = {
|
|
|
13
13
|
) {
|
|
14
14
|
const r = () => {
|
|
15
15
|
"function" == typeof t.error && t.error(e.status),
|
|
16
|
-
"function" == typeof t.
|
|
16
|
+
"function" == typeof t.Pl && t.Pl(!1);
|
|
17
17
|
};
|
|
18
18
|
(e.onload = () => {
|
|
19
19
|
let o = !1;
|
|
@@ -28,14 +28,14 @@ const b = {
|
|
|
28
28
|
(r = e.getAllResponseHeaders());
|
|
29
29
|
} catch (o) {
|
|
30
30
|
const n = {
|
|
31
|
-
error: "" === e.responseText ? qt.
|
|
31
|
+
error: "" === e.responseText ? qt.fa : qt.ma,
|
|
32
32
|
response: e.responseText
|
|
33
33
|
};
|
|
34
34
|
t.S(n, r);
|
|
35
35
|
}
|
|
36
36
|
o && t.S(o, r);
|
|
37
37
|
}
|
|
38
|
-
"function" == typeof t.
|
|
38
|
+
"function" == typeof t.Pl && t.Pl(!0);
|
|
39
39
|
} else r();
|
|
40
40
|
}),
|
|
41
41
|
(e.onerror = () => {
|
package/src/util/window-utils.js
CHANGED