@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
ba: "invalid_api_key",
|
|
3
|
+
Aa: "blacklisted",
|
|
4
|
+
za: "no_device_identifier",
|
|
5
|
+
qa: "invalid_json_response",
|
|
6
|
+
ga: "empty_response",
|
|
7
7
|
__: "sdk_auth_error"
|
|
8
8
|
};
|
|
@@ -6,17 +6,23 @@ import {
|
|
|
6
6
|
export default class ue {
|
|
7
7
|
constructor(t, i, s, r, e) {
|
|
8
8
|
(this.userId = t),
|
|
9
|
+
(this.type = i),
|
|
10
|
+
(this.time = s),
|
|
11
|
+
(this.sessionId = r),
|
|
12
|
+
(this.data = e),
|
|
13
|
+
(this.userId = t),
|
|
9
14
|
(this.type = i),
|
|
10
15
|
(this.time = Jt(s)),
|
|
11
16
|
(this.sessionId = r),
|
|
12
17
|
(this.data = e);
|
|
13
18
|
}
|
|
14
|
-
|
|
19
|
+
Xi() {
|
|
15
20
|
const t = {
|
|
16
21
|
name: this.type,
|
|
17
22
|
time: h(this.time),
|
|
18
23
|
data: this.data || {},
|
|
19
|
-
session_id: this.sessionId
|
|
24
|
+
session_id: this.sessionId,
|
|
25
|
+
user_id: void 0
|
|
20
26
|
};
|
|
21
27
|
return null != this.userId && (t.user_id = this.userId), t;
|
|
22
28
|
}
|
|
@@ -32,10 +38,10 @@ export default class ue {
|
|
|
32
38
|
static fromJson(t) {
|
|
33
39
|
return new ue(t.user_id, t.name, t.time, t.session_id, t.data);
|
|
34
40
|
}
|
|
35
|
-
static
|
|
41
|
+
static Qa(t) {
|
|
36
42
|
return null != t && Ct(t) && null != t.t && "" !== t.t;
|
|
37
43
|
}
|
|
38
|
-
static
|
|
44
|
+
static zn(t) {
|
|
39
45
|
return new ue(t.u, t.t, t.ts, t.s, t.d);
|
|
40
46
|
}
|
|
41
47
|
}
|
package/src/models/device.js
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
export default class ge {
|
|
1
|
+
export default class xt {
|
|
3
2
|
constructor(s) {
|
|
4
|
-
this.id = s;
|
|
3
|
+
(this.id = s), (this.id = s);
|
|
5
4
|
}
|
|
6
|
-
|
|
5
|
+
Xi() {
|
|
7
6
|
const s = {};
|
|
8
7
|
return (
|
|
9
|
-
null != this
|
|
10
|
-
|
|
11
|
-
null != this
|
|
12
|
-
|
|
13
|
-
null != this
|
|
14
|
-
|
|
15
|
-
null != this
|
|
16
|
-
(s.resolution = this[DeviceProperties.RESOLUTION]),
|
|
17
|
-
null != this[DeviceProperties.LANGUAGE] &&
|
|
18
|
-
(s.locale = this[DeviceProperties.LANGUAGE]),
|
|
19
|
-
null != this[DeviceProperties.TIME_ZONE] &&
|
|
20
|
-
(s.time_zone = this[DeviceProperties.TIME_ZONE]),
|
|
21
|
-
null != this[DeviceProperties.USER_AGENT] &&
|
|
22
|
-
(s.user_agent = this[DeviceProperties.USER_AGENT]),
|
|
8
|
+
null != this.browser && (s.browser = this.browser),
|
|
9
|
+
null != this.Yo && (s.browser_version = this.Yo),
|
|
10
|
+
null != this.os && (s.os_version = this.os),
|
|
11
|
+
null != this.resolution && (s.resolution = this.resolution),
|
|
12
|
+
null != this.language && (s.locale = this.language),
|
|
13
|
+
null != this.timeZone && (s.time_zone = this.timeZone),
|
|
14
|
+
null != this.userAgent && (s.user_agent = this.userAgent),
|
|
23
15
|
s
|
|
24
16
|
);
|
|
25
17
|
}
|
package/src/models/identifier.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
2
2
|
export default class _t {
|
|
3
|
-
constructor(t,
|
|
4
|
-
|
|
5
|
-
(
|
|
6
|
-
|
|
3
|
+
constructor(t, i, s) {
|
|
4
|
+
(this.iu = t),
|
|
5
|
+
null == t && (t = r.Z.Y()),
|
|
6
|
+
!s || isNaN(s) ? (this.vl = new Date().valueOf()) : (this.vl = s),
|
|
7
7
|
(this.iu = t),
|
|
8
|
-
(this.
|
|
9
|
-
(this.
|
|
10
|
-
(this.Bh = e);
|
|
8
|
+
(this.Nl = new Date().valueOf()),
|
|
9
|
+
(this.Gl = i);
|
|
11
10
|
}
|
|
12
11
|
ss() {
|
|
13
|
-
return { g: this.iu, e: this.
|
|
12
|
+
return { g: this.iu, e: this.Gl, c: this.vl, l: this.Nl };
|
|
14
13
|
}
|
|
15
|
-
static
|
|
14
|
+
static zn(t) {
|
|
16
15
|
if (null == t || null == t.g) return null;
|
|
17
|
-
const
|
|
18
|
-
return (
|
|
16
|
+
const i = new _t(t.g, t.e, t.c);
|
|
17
|
+
return (i.Nl = t.l), i;
|
|
19
18
|
}
|
|
20
19
|
}
|
package/src/models/push-token.js
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import { rehydrateDateAfterJsonization as w } from "../util/date-utils.js";
|
|
2
2
|
export default class ti {
|
|
3
|
-
constructor(t, i,
|
|
4
|
-
(this.endpoint = t
|
|
5
|
-
(this.
|
|
6
|
-
(this.publicKey =
|
|
7
|
-
(this.
|
|
8
|
-
(this.al =
|
|
3
|
+
constructor(t, i, s, l, h) {
|
|
4
|
+
(this.endpoint = t),
|
|
5
|
+
(this.Tn = i),
|
|
6
|
+
(this.publicKey = s),
|
|
7
|
+
(this.Vl = l),
|
|
8
|
+
(this.al = h),
|
|
9
|
+
(this.endpoint = t || null),
|
|
10
|
+
(this.Tn = i || null),
|
|
11
|
+
(this.publicKey = s || null),
|
|
12
|
+
(this.Vl = l || null),
|
|
13
|
+
(this.al = h || null);
|
|
9
14
|
}
|
|
10
15
|
ss() {
|
|
11
16
|
return {
|
|
12
17
|
e: this.endpoint,
|
|
13
|
-
c: this.
|
|
18
|
+
c: this.Tn,
|
|
14
19
|
p: this.publicKey,
|
|
15
|
-
u: this.
|
|
20
|
+
u: this.Vl,
|
|
16
21
|
v: this.al
|
|
17
22
|
};
|
|
18
23
|
}
|
|
19
|
-
static
|
|
24
|
+
static zn(t) {
|
|
20
25
|
return new ti(t.e, w(t.c), t.p, t.u, t.v);
|
|
21
26
|
}
|
|
22
27
|
}
|
|
@@ -1,32 +1,48 @@
|
|
|
1
1
|
export default class Kt {
|
|
2
|
-
constructor(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
constructor(
|
|
3
|
+
t = 0,
|
|
4
|
+
i = [],
|
|
5
|
+
s = [],
|
|
6
|
+
h = [],
|
|
7
|
+
e = null,
|
|
8
|
+
l = null,
|
|
9
|
+
r = { enabled: !1 },
|
|
10
|
+
a = { enabled: !1, refresh_rate_limit: -1 }
|
|
11
|
+
) {
|
|
12
|
+
(this.ol = t),
|
|
13
|
+
(this.cl = i),
|
|
14
|
+
(this.gl = s),
|
|
15
|
+
(this.fl = h),
|
|
16
|
+
(this.bl = e),
|
|
17
|
+
(this.al = l),
|
|
18
|
+
(this.ml = r),
|
|
19
|
+
(this.mi = a),
|
|
20
|
+
(this.ol = t),
|
|
21
|
+
(this.cl = i),
|
|
22
|
+
(this.gl = s),
|
|
23
|
+
(this.fl = h),
|
|
24
|
+
(this.bl = e),
|
|
25
|
+
(this.al = l),
|
|
26
|
+
(this.ml = r),
|
|
27
|
+
(this.mi = a);
|
|
12
28
|
}
|
|
13
29
|
ss() {
|
|
14
30
|
return {
|
|
15
|
-
s: "4.8.
|
|
16
|
-
l: this.
|
|
31
|
+
s: "4.8.1",
|
|
32
|
+
l: this.ol,
|
|
17
33
|
e: this.cl,
|
|
18
34
|
a: this.gl,
|
|
19
35
|
p: this.fl,
|
|
20
36
|
m: this.bl,
|
|
21
37
|
v: this.al,
|
|
22
|
-
c: this.
|
|
38
|
+
c: this.ml,
|
|
23
39
|
f: this.mi
|
|
24
40
|
};
|
|
25
41
|
}
|
|
26
|
-
static
|
|
27
|
-
let
|
|
42
|
+
static zn(t) {
|
|
43
|
+
let i = t.l;
|
|
28
44
|
return (
|
|
29
|
-
"4.8.
|
|
45
|
+
"4.8.1" !== t.s && (i = 0), new Kt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f)
|
|
30
46
|
);
|
|
31
47
|
}
|
|
32
48
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -10,154 +10,154 @@ import yt from "./Push/utils/push-utils.js";
|
|
|
10
10
|
import T from "./util/request-header-utils.js";
|
|
11
11
|
export default class Rt {
|
|
12
12
|
constructor(t, s, i, e, n, l, h, o, r, u) {
|
|
13
|
-
(this
|
|
14
|
-
(this.
|
|
15
|
-
(this.
|
|
16
|
-
(this.
|
|
17
|
-
(this.
|
|
18
|
-
(this.
|
|
19
|
-
(this.
|
|
20
|
-
(this.
|
|
21
|
-
(this.
|
|
22
|
-
(this.
|
|
23
|
-
(this
|
|
24
|
-
(this.
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
27
|
-
(this.
|
|
13
|
+
(this.$l = t),
|
|
14
|
+
(this.Fl = s),
|
|
15
|
+
(this.Ll = 0),
|
|
16
|
+
(this.Pl = h.Wa()),
|
|
17
|
+
(this.Jl = null),
|
|
18
|
+
(this.Bl = i),
|
|
19
|
+
(this.Ql = e),
|
|
20
|
+
(this.Xl = n),
|
|
21
|
+
(this.Zl = l),
|
|
22
|
+
(this.yh = h),
|
|
23
|
+
(this.$h = r),
|
|
24
|
+
(this.qh = u),
|
|
25
|
+
(this.Ph = o),
|
|
26
|
+
(this.Jh = new E()),
|
|
27
|
+
(this.Kh = 50);
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
return !t && !s && this.
|
|
29
|
+
Wh(t, s) {
|
|
30
|
+
return !t && !s && this.$h.xh() >= this.Kh;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
let s = this.
|
|
32
|
+
Bh(t) {
|
|
33
|
+
let s = this.Bl.El();
|
|
34
34
|
if (t.length > 0) {
|
|
35
|
-
const i = this.
|
|
35
|
+
const i = this.Xl.getUserId();
|
|
36
36
|
for (const e of t) {
|
|
37
37
|
const t = (!e.userId && !i) || e.userId === i;
|
|
38
|
-
e.type === r.q.
|
|
38
|
+
e.type === r.q.Wl && t && (s = !0);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
return s;
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
null == e && (e = !0), e && this.
|
|
45
|
-
const u = this.
|
|
46
|
-
a = this.
|
|
43
|
+
Gh(t, s, e, n, l, h, o) {
|
|
44
|
+
null == e && (e = !0), e && this.Hh();
|
|
45
|
+
const u = this.yh.Ja(),
|
|
46
|
+
a = this.yh.Ha();
|
|
47
47
|
let c = !1;
|
|
48
48
|
const m = (t, s) => {
|
|
49
49
|
let o = !1;
|
|
50
|
-
T.Xs(this.
|
|
50
|
+
T.Xs(this.yh, T.Qs.Sa, new Date().valueOf()),
|
|
51
51
|
C.Ys({
|
|
52
|
-
url: this.
|
|
52
|
+
url: this.Fl + "/data/",
|
|
53
53
|
data: t,
|
|
54
54
|
headers: s,
|
|
55
55
|
O: e => {
|
|
56
56
|
null != t.respond_with &&
|
|
57
57
|
t.respond_with.triggers &&
|
|
58
|
-
(this.
|
|
59
|
-
this.
|
|
60
|
-
? (this.
|
|
61
|
-
this.
|
|
58
|
+
(this.Ll = Math.max(this.Ll - 1, 0)),
|
|
59
|
+
this.qh.ti(t, e, s)
|
|
60
|
+
? (this.$h.si(),
|
|
61
|
+
this.Zl.ul(e),
|
|
62
62
|
(null != t.respond_with &&
|
|
63
|
-
t.respond_with.user_id != this.
|
|
64
|
-
(null != t.device && this.
|
|
63
|
+
t.respond_with.user_id != this.Xl.getUserId()) ||
|
|
64
|
+
(null != t.device && this.yh.D(i.k.la, t.device),
|
|
65
65
|
null != t.sdk_metadata &&
|
|
66
|
-
(this.
|
|
67
|
-
this.
|
|
68
|
-
this.
|
|
66
|
+
(this.yh.D(i.k.ua, t.sdk_metadata),
|
|
67
|
+
this.yh.D(i.k.ma, this.Bl.pa())),
|
|
68
|
+
this.Ph(e),
|
|
69
69
|
"function" == typeof n && n()))
|
|
70
70
|
: e.auth_error && (o = !0);
|
|
71
71
|
},
|
|
72
72
|
error: () => {
|
|
73
73
|
null != t.respond_with &&
|
|
74
74
|
t.respond_with.triggers &&
|
|
75
|
-
(this.
|
|
76
|
-
this.
|
|
75
|
+
(this.Ll = Math.max(this.Ll - 1, 0)),
|
|
76
|
+
this.qh.Ra(t.events, t.attributes),
|
|
77
77
|
"function" == typeof l && l();
|
|
78
78
|
},
|
|
79
79
|
ei: t => {
|
|
80
80
|
if (("function" == typeof h && h(t), e && !c)) {
|
|
81
|
-
if (t && !o) this.
|
|
81
|
+
if (t && !o) this.Qh();
|
|
82
82
|
else {
|
|
83
|
-
let t = this.
|
|
84
|
-
(null == t || t < 1e3 * this.
|
|
85
|
-
this.
|
|
83
|
+
let t = this.Jl;
|
|
84
|
+
(null == t || t < 1e3 * this.Pl) && (t = 1e3 * this.Pl),
|
|
85
|
+
this.Qh(Math.min(3e5, D(1e3 * this.Pl, 3 * t)));
|
|
86
86
|
}
|
|
87
87
|
c = !0;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
},
|
|
92
|
-
d = this.
|
|
92
|
+
d = this.Bh(u),
|
|
93
93
|
f = s || d;
|
|
94
|
-
if (this
|
|
94
|
+
if (this.Wh(o, d))
|
|
95
95
|
return void r.j.info(
|
|
96
96
|
"Declining to flush data due to 50 consecutive authentication failures"
|
|
97
97
|
);
|
|
98
|
-
if (e && !this.
|
|
99
|
-
return this.
|
|
100
|
-
const g = this.
|
|
101
|
-
f && this.
|
|
98
|
+
if (e && !this.qh.Ba(u, a, t, f))
|
|
99
|
+
return this.Qh(), void ("function" == typeof h && h(!0));
|
|
100
|
+
const g = this.qh.Da(t, f, u, a);
|
|
101
|
+
f && this.Ll++;
|
|
102
102
|
let p = !1;
|
|
103
103
|
if (g)
|
|
104
104
|
for (const t of g)
|
|
105
|
-
this.
|
|
106
|
-
this.
|
|
107
|
-
? this.
|
|
108
|
-
: d && (r.j.info("Invoking new session subscriptions"), this.
|
|
105
|
+
this.qh.Vs(t.requestData, () => m(t.requestData, t.headers)), (p = !0);
|
|
106
|
+
this.$h.Zn() && e && !p
|
|
107
|
+
? this.Qh()
|
|
108
|
+
: d && (r.j.info("Invoking new session subscriptions"), this.Jh.Et());
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
return this.
|
|
110
|
+
Vh() {
|
|
111
|
+
return this.Ll > 0;
|
|
112
112
|
}
|
|
113
|
-
|
|
114
|
-
this.
|
|
115
|
-
(null == t && (t = 1e3 * this.
|
|
116
|
-
this.
|
|
117
|
-
(this.
|
|
113
|
+
Qh(t) {
|
|
114
|
+
this.Xh ||
|
|
115
|
+
(null == t && (t = 1e3 * this.Pl),
|
|
116
|
+
this.Hh(),
|
|
117
|
+
(this.Yh = setTimeout(() => {
|
|
118
118
|
if (document.hidden) {
|
|
119
119
|
const t = "visibilitychange",
|
|
120
120
|
s = () => {
|
|
121
121
|
document.hidden ||
|
|
122
|
-
(document.removeEventListener(t, s, !1), this.
|
|
122
|
+
(document.removeEventListener(t, s, !1), this.Gh());
|
|
123
123
|
};
|
|
124
124
|
document.addEventListener(t, s, !1);
|
|
125
|
-
} else this.
|
|
125
|
+
} else this.Gh();
|
|
126
126
|
}, t)),
|
|
127
|
-
(this.
|
|
127
|
+
(this.Jl = t));
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
null != this.
|
|
129
|
+
Hh() {
|
|
130
|
+
null != this.Yh && (clearTimeout(this.Yh), (this.Yh = null));
|
|
131
131
|
}
|
|
132
132
|
initialize() {
|
|
133
|
-
(this.
|
|
133
|
+
(this.Xh = !1), this.Qh();
|
|
134
134
|
}
|
|
135
135
|
destroy() {
|
|
136
|
-
this.
|
|
137
|
-
this.
|
|
138
|
-
this.
|
|
139
|
-
(this.
|
|
140
|
-
this.
|
|
141
|
-
(this.
|
|
136
|
+
this.Jh.removeAllSubscriptions(),
|
|
137
|
+
this.$h.jh(),
|
|
138
|
+
this.Hh(),
|
|
139
|
+
(this.Xh = !0),
|
|
140
|
+
this.Gh(null, null, !1),
|
|
141
|
+
(this.Yh = null);
|
|
142
142
|
}
|
|
143
143
|
pr(t) {
|
|
144
|
-
return this.
|
|
144
|
+
return this.Jh.lt(t);
|
|
145
145
|
}
|
|
146
146
|
openSession() {
|
|
147
|
-
const t = this.
|
|
148
|
-
t && (this.
|
|
149
|
-
this.
|
|
150
|
-
this.
|
|
147
|
+
const t = this.Bl.pa() !== this.Bl.bo();
|
|
148
|
+
t && (this.yh.Pa(i.eu.Xo), this.yh.Pa(i.eu.su)),
|
|
149
|
+
this.Gh(null, !1, null, null, null),
|
|
150
|
+
this.Hn(),
|
|
151
151
|
t &&
|
|
152
152
|
import("./Push/push-manager-factory.js").then(t => {
|
|
153
|
-
if (this.
|
|
153
|
+
if (this.Xh) return;
|
|
154
154
|
const s = t.default.m();
|
|
155
155
|
if (
|
|
156
156
|
null != s &&
|
|
157
157
|
(yt.isPushPermissionGranted() || yt.isPushBlocked())
|
|
158
158
|
) {
|
|
159
159
|
const t = () => {
|
|
160
|
-
s.
|
|
160
|
+
s.dn()
|
|
161
161
|
? r.j.info(
|
|
162
162
|
"Push token maintenance is disabled, not refreshing token for backend."
|
|
163
163
|
)
|
|
@@ -167,7 +167,7 @@ export default class Rt {
|
|
|
167
167
|
i && t();
|
|
168
168
|
},
|
|
169
169
|
n = () => {
|
|
170
|
-
const s = this.
|
|
170
|
+
const s = this.yh.v(i.k.Nn);
|
|
171
171
|
(null == s || s) && t();
|
|
172
172
|
},
|
|
173
173
|
l = r.zt.Ft;
|
|
@@ -176,29 +176,29 @@ export default class Rt {
|
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
changeUser(t, s, e) {
|
|
179
|
-
const n = this.
|
|
179
|
+
const n = this.Xl.getUserId();
|
|
180
180
|
if (n !== t) {
|
|
181
|
-
this.
|
|
182
|
-
null != n && this.
|
|
183
|
-
this.
|
|
184
|
-
e ? this.
|
|
181
|
+
this.Bl.kl(),
|
|
182
|
+
null != n && this.Gh(null, !1, null, null, null),
|
|
183
|
+
this.Xl.ru(t),
|
|
184
|
+
e ? this.$h.setSdkAuthenticationSignature(e) : this.$h.fh();
|
|
185
185
|
for (let t = 0; t < s.length; t++) s[t].changeUser(null == n);
|
|
186
|
-
null != n && this.
|
|
187
|
-
this.
|
|
186
|
+
null != n && this.yh.ri(i.k.L),
|
|
187
|
+
this.yh.ri(i.k.la),
|
|
188
188
|
this.openSession(),
|
|
189
189
|
r.j.info('Changed user to "' + t + '".');
|
|
190
190
|
} else {
|
|
191
191
|
let s = "Doing nothing.";
|
|
192
192
|
e &&
|
|
193
|
-
this.gh
|
|
194
|
-
(this.
|
|
193
|
+
this.$h.gh() !== e &&
|
|
194
|
+
(this.$h.setSdkAuthenticationSignature(e),
|
|
195
195
|
(s = "Updated SDK authentication signature")),
|
|
196
196
|
r.j.info(`Current user is already ${t}. ${s}`);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
requestImmediateDataFlush(t) {
|
|
200
|
-
this.
|
|
201
|
-
this.
|
|
200
|
+
this.Hh(), this.Bl.bo();
|
|
201
|
+
this.Gh(
|
|
202
202
|
null,
|
|
203
203
|
null,
|
|
204
204
|
null,
|
|
@@ -213,21 +213,21 @@ export default class Rt {
|
|
|
213
213
|
);
|
|
214
214
|
}
|
|
215
215
|
requestFeedRefresh() {
|
|
216
|
-
this.
|
|
216
|
+
this.Bl.bo(), this.Gh(!0);
|
|
217
217
|
}
|
|
218
218
|
$r(t, s) {
|
|
219
|
-
this.
|
|
219
|
+
this.Bl.bo(),
|
|
220
220
|
r.j.info("Requesting explicit trigger refresh."),
|
|
221
|
-
this.
|
|
221
|
+
this.Gh(null, !0, null, t, s);
|
|
222
222
|
}
|
|
223
223
|
Cn(t, i) {
|
|
224
|
-
const e = r.q.
|
|
224
|
+
const e = r.q.Zh,
|
|
225
225
|
n = { a: t, l: i },
|
|
226
226
|
l = s.N(e, n);
|
|
227
227
|
return l && r.j.info(`Logged alias ${t} with label ${i}`), l;
|
|
228
228
|
}
|
|
229
229
|
En(i, e, n) {
|
|
230
|
-
if (this.
|
|
230
|
+
if (this.Zl.hu(e))
|
|
231
231
|
return (
|
|
232
232
|
r.j.info(`Custom Attribute "${e}" is blocklisted, ignoring.`), new t()
|
|
233
233
|
);
|
|
@@ -244,7 +244,7 @@ export default class Rt {
|
|
|
244
244
|
null != n && (o.altitude = n),
|
|
245
245
|
null != l && (o.ll_accuracy = l),
|
|
246
246
|
null != h && (o.alt_accuracy = h);
|
|
247
|
-
const u = s.N(r.q.
|
|
247
|
+
const u = s.N(r.q.au, o, t);
|
|
248
248
|
return (
|
|
249
249
|
u &&
|
|
250
250
|
r.j.info(
|
|
@@ -254,41 +254,41 @@ export default class Rt {
|
|
|
254
254
|
);
|
|
255
255
|
}
|
|
256
256
|
vr(t, s) {
|
|
257
|
-
const i = this.
|
|
258
|
-
return new ue(this.
|
|
257
|
+
const i = this.Bl.bo();
|
|
258
|
+
return new ue(this.Xl.getUserId(), r.q.du, t, i, { cid: s });
|
|
259
259
|
}
|
|
260
|
-
|
|
260
|
+
Hn() {
|
|
261
261
|
const t = r.zt.Ft;
|
|
262
|
-
new r.xt(t, r.j).setItem(t.Jt.
|
|
263
|
-
baseUrl: this.
|
|
264
|
-
data: { api_key: this
|
|
265
|
-
userId: this.
|
|
266
|
-
sdkAuthEnabled: this.
|
|
262
|
+
new r.xt(t, r.j).setItem(t.Jt.Sa, 1, {
|
|
263
|
+
baseUrl: this.Fl,
|
|
264
|
+
data: { api_key: this.$l, device_id: this.Ql.te().id },
|
|
265
|
+
userId: this.Xl.getUserId(),
|
|
266
|
+
sdkAuthEnabled: this.$h.Zn()
|
|
267
267
|
});
|
|
268
268
|
}
|
|
269
269
|
Fr(t) {
|
|
270
270
|
for (const s of t)
|
|
271
|
-
if (s.api_key === this
|
|
271
|
+
if (s.api_key === this.$l) this.qh.Ra(s.events, s.attributes);
|
|
272
272
|
else {
|
|
273
273
|
const t = r.zt.Ft;
|
|
274
274
|
new r.xt(t, r.j).setItem(t.Jt.yr, r.Z.Y(), s);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
On(i, e, n) {
|
|
278
|
-
if (this.
|
|
278
|
+
if (this.Zl.hu(i))
|
|
279
279
|
return (
|
|
280
280
|
r.j.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new t()
|
|
281
281
|
);
|
|
282
282
|
let l, h;
|
|
283
283
|
return (
|
|
284
284
|
null === e && null === n
|
|
285
|
-
? ((l = r.q.
|
|
286
|
-
: ((l = r.q.
|
|
285
|
+
? ((l = r.q.fu), (h = { key: i }))
|
|
286
|
+
: ((l = r.q.gu), (h = { key: i, latitude: e, longitude: n })),
|
|
287
287
|
s.N(l, h)
|
|
288
288
|
);
|
|
289
289
|
}
|
|
290
290
|
Gn(t, i) {
|
|
291
291
|
const e = { group_id: t, status: i };
|
|
292
|
-
return s.N(r.q.
|
|
292
|
+
return s.N(r.q.pu, e);
|
|
293
293
|
}
|
|
294
294
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export default class
|
|
1
|
+
export default class Qt {
|
|
2
2
|
constructor(t) {
|
|
3
|
-
this.
|
|
3
|
+
this.wu = t;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
return null == this.
|
|
5
|
+
xu(t) {
|
|
6
|
+
return null == this.wu || this.wu === t[0];
|
|
7
7
|
}
|
|
8
8
|
static fromJson(t) {
|
|
9
|
-
return new
|
|
9
|
+
return new Qt(t ? t.event_name : null);
|
|
10
10
|
}
|
|
11
11
|
ss() {
|
|
12
|
-
return this.
|
|
12
|
+
return this.wu;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class
|
|
1
|
+
import Yt from "./filter-set.js";
|
|
2
|
+
export default class Zt {
|
|
3
3
|
constructor(t, s) {
|
|
4
|
-
(this.
|
|
4
|
+
(this.wu = t), (this.ju = s);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
if (null == this.
|
|
6
|
+
xu(t) {
|
|
7
|
+
if (null == this.wu || null == this.ju) return !1;
|
|
8
8
|
const s = t[0],
|
|
9
9
|
r = t[1];
|
|
10
|
-
return s === this.
|
|
10
|
+
return s === this.wu && this.ju.xu(r);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
|
-
return new
|
|
13
|
+
return new Zt(
|
|
14
14
|
t ? t.event_name : null,
|
|
15
|
-
t ?
|
|
15
|
+
t ? Yt.fromJson(t.property_filters) : null
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
ss() {
|
|
19
|
-
return { e: this.
|
|
19
|
+
return { e: this.wu, pf: this.ju.ss() };
|
|
20
20
|
}
|
|
21
21
|
}
|