@braze/web-sdk 5.7.0 → 5.8.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 +4 -4
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +8 -8
- package/shared-lib/indexed-db-adapter.js +7 -7
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +17 -17
- package/src/Banner/get-all-banners.js +2 -3
- package/src/Banner/get-banner.js +11 -11
- package/src/Banner/request-banners-refresh.js +20 -12
- package/src/Banner/subscribe-to-banners-updates.js +14 -13
- package/src/Banner/ui/insert-banner.js +11 -9
- package/src/Card/log-card-impressions.js +2 -2
- package/src/ContentCards/content-cards-provider-factory.js +1 -1
- package/src/ContentCards/content-cards.js +3 -3
- package/src/ContentCards/ui/show-content-cards.js +5 -5
- package/src/Core/add-sdk-metadata.js +2 -2
- package/src/Core/change-user.js +3 -3
- package/src/Core/disable-sdk.js +5 -5
- package/src/Core/enable-sdk.js +3 -3
- package/src/Core/get-device-id.js +2 -2
- package/src/Core/get-user.js +1 -1
- package/src/Core/is-disabled.js +1 -1
- package/src/Core/open-session.js +6 -6
- package/src/Core/wipe-data.js +1 -1
- package/src/FeatureFlags/feature-flag-factory.js +4 -4
- package/src/FeatureFlags/feature-flag.js +17 -17
- package/src/FeatureFlags/feature-flags-provider.js +37 -37
- package/src/FeatureFlags/get-all-feature-flags.js +6 -7
- package/src/FeatureFlags/get-feature-flag.js +5 -6
- package/src/FeatureFlags/log-feature-flag-impression.js +3 -3
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
- package/src/Feed/feed.js +2 -2
- package/src/Feed/ui/show-feed.js +4 -4
- 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 +18 -18
- package/src/InAppMessage/display/modal-utils.js +4 -4
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- package/src/InAppMessage/in-app-message-manager-factory.js +1 -1
- package/src/InAppMessage/in-app-message-manager.js +49 -49
- package/src/InAppMessage/log-in-app-message-button-click.js +1 -1
- package/src/InAppMessage/log-in-app-message-click.js +1 -1
- package/src/InAppMessage/log-in-app-message-impression.js +1 -1
- package/src/InAppMessage/models/control-message.js +1 -1
- package/src/InAppMessage/models/full-screen-message.js +3 -3
- package/src/InAppMessage/models/html-message.js +5 -5
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +32 -32
- package/src/InAppMessage/models/modal-message.js +3 -3
- package/src/InAppMessage/models/slide-up-message.js +6 -6
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/ui/show-in-app-message.js +18 -18
- package/src/Push/push-manager-factory.js +8 -8
- package/src/Push/push-manager.js +83 -83
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +6 -6
- package/src/User/user.js +18 -18
- package/src/common/base-feed.js +3 -3
- package/src/common/event-logger.js +1 -1
- package/src/common/feed-display.js +8 -8
- package/src/l10n/l10n-manager-factory.js +2 -2
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/braze-instance.js +107 -107
- package/src/managers/device-manager.js +18 -18
- package/src/managers/network-manager.js +117 -117
- package/src/managers/server-config-manager.js +61 -61
- package/src/managers/session-manager.js +25 -25
- package/src/managers/storage-manager-factory.js +8 -8
- package/src/managers/storage-manager.js +57 -57
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +2 -2
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +10 -10
- package/src/models/push-token.js +7 -7
- package/src/models/server-config.js +30 -30
- package/src/request-controller.js +93 -93
- package/src/triggers/models/filter-set.js +4 -4
- package/src/triggers/models/filter.js +1 -1
- package/src/triggers/models/trigger-condition.js +29 -29
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +9 -9
- package/src/triggers/triggers-provider-factory.js +2 -2
- package/src/triggers/triggers-provider.js +15 -15
- package/src/ui/js/attach-css.js +3 -3
- package/src/ui/js/load-font-awesome.js +2 -2
- package/src/util/base-device-parser.js +3 -3
- 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 +6 -6
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +13 -13
- package/src/util/user-agent-parser.js +1 -1
- package/src/util/validation-utils.js +4 -4
- package/src/util/window-utils.js +1 -1
|
@@ -16,60 +16,60 @@ export default class Wt {
|
|
|
16
16
|
(this.C = s),
|
|
17
17
|
(this.As = t),
|
|
18
18
|
(this.B = i),
|
|
19
|
-
(this.
|
|
19
|
+
(this.jl = 1e3),
|
|
20
20
|
(null == e || isNaN(e)) && (e = 1800),
|
|
21
|
-
e < this.
|
|
21
|
+
e < this.jl / 1e3 &&
|
|
22
22
|
(N.info(
|
|
23
23
|
"Specified session timeout of " +
|
|
24
24
|
e +
|
|
25
25
|
"s is too small, using the minimum session timeout of " +
|
|
26
|
-
this.
|
|
26
|
+
this.jl / 1e3 +
|
|
27
27
|
"s instead.",
|
|
28
28
|
),
|
|
29
|
-
(e = this.
|
|
29
|
+
(e = this.jl / 1e3)),
|
|
30
30
|
(this.Sl = e);
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
return new ve(this.As.getUserId(), d.
|
|
32
|
+
xl(s, t) {
|
|
33
|
+
return new ve(this.As.getUserId(), d.Dl, s, t.eu, { d: L(s - t.Gl) });
|
|
34
34
|
}
|
|
35
35
|
Ss() {
|
|
36
|
-
const s = this.C.tu(t.iu.
|
|
36
|
+
const s = this.C.tu(t.iu.Nl);
|
|
37
37
|
return null == s ? null : s.eu;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
zl() {
|
|
40
40
|
const s = new Date().valueOf(),
|
|
41
|
-
i = this.B.
|
|
41
|
+
i = this.B.Ll();
|
|
42
42
|
if (null == i) return !1;
|
|
43
|
-
const e = this.C.vs(t.gs.
|
|
43
|
+
const e = this.C.vs(t.gs.Hl),
|
|
44
44
|
n = null == e || s - e > 1e3 * i;
|
|
45
|
-
return n && this.C.Bs(t.gs.
|
|
45
|
+
return n && this.C.Bs(t.gs.Hl, s), n;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
return null == t || null == t.
|
|
47
|
+
Wl(s, t) {
|
|
48
|
+
return null == t || null == t.kl || (!(s - t.Gl < this.jl) && t.kl < s);
|
|
49
49
|
}
|
|
50
50
|
Eo() {
|
|
51
51
|
const s = new Date().valueOf(),
|
|
52
52
|
i = s + 1e3 * this.Sl,
|
|
53
|
-
e = this.C.tu(t.iu.
|
|
54
|
-
if (this.
|
|
53
|
+
e = this.C.tu(t.iu.Nl);
|
|
54
|
+
if (this.Wl(s, e)) {
|
|
55
55
|
let n = "Generating session start event with time " + s;
|
|
56
56
|
if (null != e) {
|
|
57
|
-
let s = e.
|
|
58
|
-
s - e.
|
|
59
|
-
this.C.
|
|
57
|
+
let s = e.ql;
|
|
58
|
+
s - e.Gl < this.jl && (s = e.Gl + this.jl),
|
|
59
|
+
this.C.Al(this.xl(s, e)),
|
|
60
60
|
(n += " (old session ended " + s + ")");
|
|
61
61
|
}
|
|
62
62
|
(n += ". Will expire " + i.valueOf()), N.info(n);
|
|
63
63
|
const o = new _t(G.Rt(), i);
|
|
64
|
-
this.C.
|
|
65
|
-
this.C.uu(t.iu.
|
|
66
|
-
return null == this.C.vs(t.gs.
|
|
64
|
+
this.C.Al(new ve(this.As.getUserId(), d.Il, s, o.eu)),
|
|
65
|
+
this.C.uu(t.iu.Nl, o);
|
|
66
|
+
return null == this.C.vs(t.gs.Hl) && this.C.Bs(t.gs.Hl, s), o.eu;
|
|
67
67
|
}
|
|
68
|
-
if (null != e) return (e.
|
|
68
|
+
if (null != e) return (e.ql = s), (e.kl = i), this.C.uu(t.iu.Nl, e), e.eu;
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
const s = this.C.tu(t.iu.
|
|
70
|
+
Jl() {
|
|
71
|
+
const s = this.C.tu(t.iu.Nl);
|
|
72
72
|
null != s &&
|
|
73
|
-
(this.C.
|
|
73
|
+
(this.C.Kl(t.iu.Nl), this.C.Al(this.xl(new Date().valueOf(), s)));
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import ne, { STORAGE_KEYS as t } from "./storage-manager.js";
|
|
2
2
|
import { logger as N } from "../../shared-lib/index.js";
|
|
3
3
|
const Bt = {
|
|
4
|
-
|
|
4
|
+
Ka: function (e, o = !1) {
|
|
5
5
|
let r = !1;
|
|
6
6
|
try {
|
|
7
7
|
if (localStorage && localStorage.getItem)
|
|
8
8
|
try {
|
|
9
|
-
localStorage.setItem(t.gs.
|
|
10
|
-
localStorage.getItem(t.gs.
|
|
11
|
-
(localStorage.removeItem(t.gs.
|
|
9
|
+
localStorage.setItem(t.gs.oc, "true"),
|
|
10
|
+
localStorage.getItem(t.gs.oc) &&
|
|
11
|
+
(localStorage.removeItem(t.gs.oc), (r = !0));
|
|
12
12
|
} catch (e) {
|
|
13
13
|
if (
|
|
14
14
|
!(
|
|
@@ -24,12 +24,12 @@ const Bt = {
|
|
|
24
24
|
} catch (e) {
|
|
25
25
|
N.info("Local Storage not supported!");
|
|
26
26
|
}
|
|
27
|
-
const a = Bt.
|
|
28
|
-
n = new ne.
|
|
27
|
+
const a = Bt.ac(),
|
|
28
|
+
n = new ne.nc(e, a && !o, r);
|
|
29
29
|
let c;
|
|
30
|
-
return (c = r ? new ne.
|
|
30
|
+
return (c = r ? new ne.cc(e) : new ne.lc()), new ne(n, c);
|
|
31
31
|
},
|
|
32
|
-
|
|
32
|
+
ac: function () {
|
|
33
33
|
return (
|
|
34
34
|
navigator.cookieEnabled ||
|
|
35
35
|
("cookie" in document &&
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ve from "../models/braze-event.js";
|
|
2
2
|
import _t from "../models/identifier.js";
|
|
3
3
|
import {
|
|
4
|
-
isArray as
|
|
4
|
+
isArray as z,
|
|
5
5
|
keys as y,
|
|
6
6
|
validateValueIsFromEnum as ta,
|
|
7
7
|
values as Rt,
|
|
@@ -13,30 +13,30 @@ import { getErrorMessage as si } from "../util/error-utils.js";
|
|
|
13
13
|
export const STORAGE_KEYS = {
|
|
14
14
|
iu: {
|
|
15
15
|
su: "ab.storage.userId",
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
Xh: "ab.storage.deviceId",
|
|
17
|
+
Nl: "ab.storage.sessionId",
|
|
18
18
|
},
|
|
19
19
|
gs: {
|
|
20
|
-
|
|
20
|
+
oc: "ab.test",
|
|
21
21
|
tE: "ab.storage.events",
|
|
22
22
|
eE: "ab.storage.attributes",
|
|
23
23
|
sE: "ab.storage.attributes.anonymous_user",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
ec: "ab.storage.device",
|
|
25
|
+
gu: "ab.storage.sdk_metadata",
|
|
26
|
+
bu: "ab.storage.session_id_for_cached_metadata",
|
|
27
|
+
Fn: "ab.storage.pushToken",
|
|
28
28
|
Hi: "ab.storage.newsFeed",
|
|
29
29
|
Ji: "ab.storage.lastNewsFeedRefresh",
|
|
30
30
|
Ct: "ab.storage.cardImpressions",
|
|
31
|
-
|
|
31
|
+
bl: "ab.storage.serverConfig",
|
|
32
32
|
rE: "ab.storage.triggers",
|
|
33
33
|
oE: "ab.storage.triggers.ts",
|
|
34
|
-
|
|
34
|
+
Hl: "ab.storage.messagingSessionStart",
|
|
35
35
|
di: "ab.storage.cc",
|
|
36
36
|
bi: "ab.storage.ccLastFullSync",
|
|
37
37
|
vi: "ab.storage.ccLastCardUpdated",
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
Gu: "ab.storage.globalRateLimitCurrentTokenCount",
|
|
39
|
+
Yu: "ab.storage.dynamicRateLimitCurrentTokenCount",
|
|
40
40
|
ot: "ab.storage.ccClicks",
|
|
41
41
|
vt: "ab.storage.ccImpressions",
|
|
42
42
|
gt: "ab.storage.ccDismissals",
|
|
@@ -46,28 +46,28 @@ export const STORAGE_KEYS = {
|
|
|
46
46
|
qh: "ab.storage.signature",
|
|
47
47
|
EE: "ab.storage.brazeSyncRetryCount",
|
|
48
48
|
yi: "ab.storage.sdkVersion",
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
$e: "ab.storage.ff",
|
|
50
|
+
Be: "ab.storage.ffImpressions",
|
|
51
|
+
Le: "ab.storage.ffLastRefreshAt",
|
|
52
|
+
He: "ab.storage.ff.sessionId",
|
|
53
53
|
lE: "ab.storage.lastReqToEndpoint",
|
|
54
54
|
SE: "ab.storage.requestAttempts",
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
Zr: "ab.storage.deferredIam",
|
|
56
|
+
Pu: "ab.storage.lastSdkReq",
|
|
57
57
|
_E: "ab.storage.alias",
|
|
58
58
|
ps: "ab.storage.banners",
|
|
59
59
|
ks: "ab.storage.banners.impressions",
|
|
60
60
|
ys: "ab.storage.banners.sessionId",
|
|
61
61
|
},
|
|
62
|
-
|
|
62
|
+
ie: "ab.optOut",
|
|
63
63
|
};
|
|
64
64
|
export default class ne {
|
|
65
65
|
constructor(t, e) {
|
|
66
66
|
(this.uE = t), (this.cE = e), (this.uE = t), (this.cE = e);
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
Ga(t) {
|
|
69
69
|
const e = y(STORAGE_KEYS.iu),
|
|
70
|
-
s = new ne.
|
|
70
|
+
s = new ne.se(t);
|
|
71
71
|
for (const t of e) s.remove(STORAGE_KEYS.iu[t]);
|
|
72
72
|
}
|
|
73
73
|
uu(t, e) {
|
|
@@ -76,7 +76,7 @@ export default class ne {
|
|
|
76
76
|
}
|
|
77
77
|
TE(t) {
|
|
78
78
|
const e = this.tu(t);
|
|
79
|
-
null != e && ((e.
|
|
79
|
+
null != e && ((e.ql = new Date().valueOf()), this.uu(t, e));
|
|
80
80
|
}
|
|
81
81
|
tu(t) {
|
|
82
82
|
const e = this.uE.gr(t),
|
|
@@ -90,17 +90,17 @@ export default class ne {
|
|
|
90
90
|
return e;
|
|
91
91
|
})(e);
|
|
92
92
|
let r;
|
|
93
|
-
if (s) (r = _t.
|
|
93
|
+
if (s) (r = _t.Bn(s) || null), r && this.uu(t, r);
|
|
94
94
|
else {
|
|
95
95
|
const s = _t.hE(e);
|
|
96
|
-
(r = _t.
|
|
96
|
+
(r = _t.Bn(s) || null), s !== e && r && this.uu(t, r);
|
|
97
97
|
}
|
|
98
98
|
return r;
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
Kl(t) {
|
|
101
101
|
this.uE.remove(t);
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
$a() {
|
|
104
104
|
const t = y(STORAGE_KEYS.iu);
|
|
105
105
|
let e;
|
|
106
106
|
for (const s of t)
|
|
@@ -110,13 +110,13 @@ export default class ne {
|
|
|
110
110
|
Go(t) {
|
|
111
111
|
let e;
|
|
112
112
|
if (null == t || 0 === t.length) return !1;
|
|
113
|
-
e =
|
|
113
|
+
e = z(t) ? t : [t];
|
|
114
114
|
let s = this.cE.gr(STORAGE_KEYS.gs.tE);
|
|
115
|
-
(null != s &&
|
|
115
|
+
(null != s && z(s)) || (s = []);
|
|
116
116
|
for (let t = 0; t < e.length; t++) s.push(e[t].bs());
|
|
117
117
|
return this.cE.store(STORAGE_KEYS.gs.tE, s);
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
Al(t) {
|
|
120
120
|
return null != t && this.Go([t]);
|
|
121
121
|
}
|
|
122
122
|
AE() {
|
|
@@ -125,9 +125,9 @@ export default class ne {
|
|
|
125
125
|
const e = [];
|
|
126
126
|
let s = !1,
|
|
127
127
|
r = null;
|
|
128
|
-
if (
|
|
128
|
+
if (z(t))
|
|
129
129
|
for (let s = 0; s < t.length; s++)
|
|
130
|
-
ve.RE(t[s]) ? e.push(ve.
|
|
130
|
+
ve.RE(t[s]) ? e.push(ve.Bn(t[s])) : (r = s);
|
|
131
131
|
else s = !0;
|
|
132
132
|
if (s || null != r) {
|
|
133
133
|
let o = "Stored events could not be deserialized as Events";
|
|
@@ -140,7 +140,7 @@ export default class ne {
|
|
|
140
140
|
typeof t +
|
|
141
141
|
": " +
|
|
142
142
|
JSON.stringify(t)),
|
|
143
|
-
e.push(new ve(null, d.
|
|
143
|
+
e.push(new ve(null, d.Du, new Date().valueOf(), null, { e: o }));
|
|
144
144
|
}
|
|
145
145
|
return e;
|
|
146
146
|
}
|
|
@@ -189,15 +189,15 @@ export default class ne {
|
|
|
189
189
|
gE(t) {
|
|
190
190
|
return t || STORAGE_KEYS.gs.sE;
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
Bu(t) {
|
|
193
193
|
let e = this.cE.gr(STORAGE_KEYS.gs.eE);
|
|
194
194
|
null == e && (e = {});
|
|
195
|
-
const s = this.gE(t[User.
|
|
195
|
+
const s = this.gE(t[User.pu]),
|
|
196
196
|
r = e[s];
|
|
197
197
|
for (const o in t)
|
|
198
|
-
o !== User.
|
|
198
|
+
o !== User.pu &&
|
|
199
199
|
(null == e[s] || (r && null == r[o])) &&
|
|
200
|
-
this.mu(t[User.
|
|
200
|
+
this.mu(t[User.pu], o, t[o]);
|
|
201
201
|
}
|
|
202
202
|
mu(t, e, s) {
|
|
203
203
|
let r = this.cE.gr(STORAGE_KEYS.gs.eE);
|
|
@@ -205,7 +205,7 @@ export default class ne {
|
|
|
205
205
|
const o = this.gE(t);
|
|
206
206
|
let n = r[o];
|
|
207
207
|
if (
|
|
208
|
-
(null == n && ((n = {}), null != t && (n[User.
|
|
208
|
+
(null == n && ((n = {}), null != t && (n[User.pu] = t)), e === User.lu)
|
|
209
209
|
) {
|
|
210
210
|
null == n[e] && (n[e] = {});
|
|
211
211
|
for (const t in s) n[e][t] = s[t];
|
|
@@ -227,29 +227,29 @@ export default class ne {
|
|
|
227
227
|
null != r &&
|
|
228
228
|
((e[s] = void 0),
|
|
229
229
|
this.cE.store(STORAGE_KEYS.gs.eE, e),
|
|
230
|
-
(r[User.
|
|
231
|
-
this.
|
|
230
|
+
(r[User.pu] = t),
|
|
231
|
+
this.Bu(r));
|
|
232
232
|
}
|
|
233
|
-
const s = this.tu(STORAGE_KEYS.iu.
|
|
233
|
+
const s = this.tu(STORAGE_KEYS.iu.Nl);
|
|
234
234
|
let r = null;
|
|
235
235
|
null != s && (r = s.eu);
|
|
236
236
|
const o = this.AE();
|
|
237
237
|
if (null != o)
|
|
238
238
|
for (let e = 0; e < o.length; e++) {
|
|
239
239
|
const s = o[e];
|
|
240
|
-
null == s.userId && s.sessionId == r && (s.userId = t), this.
|
|
240
|
+
null == s.userId && s.sessionId == r && (s.userId = t), this.Al(s);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
IE() {
|
|
244
244
|
return this.cE.dE;
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
(ne.
|
|
247
|
+
(ne.cc = class {
|
|
248
248
|
constructor(t) {
|
|
249
|
-
(this.
|
|
249
|
+
(this.cn = t), (this.cn = t), (this.dE = ro.fE() ? 3 : 10);
|
|
250
250
|
}
|
|
251
251
|
bE(t) {
|
|
252
|
-
return t + "." + this.
|
|
252
|
+
return t + "." + this.cn;
|
|
253
253
|
}
|
|
254
254
|
store(t, e) {
|
|
255
255
|
const s = { v: e };
|
|
@@ -276,7 +276,7 @@ export default class ne {
|
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
}),
|
|
279
|
-
(ne.
|
|
279
|
+
(ne.lc = class {
|
|
280
280
|
constructor() {
|
|
281
281
|
(this.KE = {}), (this.mE = 5242880), (this.dE = 3);
|
|
282
282
|
}
|
|
@@ -318,17 +318,17 @@ export default class ne {
|
|
|
318
318
|
this.KE[t] = null;
|
|
319
319
|
}
|
|
320
320
|
}),
|
|
321
|
-
(ne.
|
|
321
|
+
(ne.se = class {
|
|
322
322
|
constructor(t, e) {
|
|
323
|
-
(this.
|
|
323
|
+
(this.cn = t),
|
|
324
324
|
(this.NE = e),
|
|
325
|
-
(this.
|
|
325
|
+
(this.cn = t),
|
|
326
326
|
(this.GE = this.DE()),
|
|
327
327
|
(this.CE = 576e3),
|
|
328
328
|
(this.NE = !!e);
|
|
329
329
|
}
|
|
330
330
|
bE(t) {
|
|
331
|
-
return null != this.
|
|
331
|
+
return null != this.cn ? t + "." + this.cn : t;
|
|
332
332
|
}
|
|
333
333
|
DE() {
|
|
334
334
|
let t = 0,
|
|
@@ -345,7 +345,7 @@ export default class ne {
|
|
|
345
345
|
e
|
|
346
346
|
);
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
ae() {
|
|
349
349
|
const t = new Date();
|
|
350
350
|
return t.setTime(t.getTime() + 60 * this.CE * 1e3), t.getFullYear();
|
|
351
351
|
}
|
|
@@ -363,7 +363,7 @@ export default class ne {
|
|
|
363
363
|
}
|
|
364
364
|
if (o) {
|
|
365
365
|
const t = r.split("=")[0];
|
|
366
|
-
-1 === t.indexOf("." + this.
|
|
366
|
+
-1 === t.indexOf("." + this.cn) && this.pE(t);
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
}
|
|
@@ -419,13 +419,13 @@ export default class ne {
|
|
|
419
419
|
(document.cookie = s), (document.cookie = s + ";path=/");
|
|
420
420
|
}
|
|
421
421
|
}),
|
|
422
|
-
(ne.
|
|
422
|
+
(ne.nc = class {
|
|
423
423
|
constructor(t, e, s) {
|
|
424
|
-
(this.
|
|
424
|
+
(this.cn = t),
|
|
425
425
|
(this.vE = []),
|
|
426
|
-
e && this.vE.push(new ne.
|
|
427
|
-
s && this.vE.push(new ne.
|
|
428
|
-
this.vE.push(new ne.
|
|
426
|
+
e && this.vE.push(new ne.se(t)),
|
|
427
|
+
s && this.vE.push(new ne.cc(t)),
|
|
428
|
+
this.vE.push(new ne.lc());
|
|
429
429
|
}
|
|
430
430
|
store(t, e) {
|
|
431
431
|
let s = !0;
|
|
@@ -440,7 +440,7 @@ export default class ne {
|
|
|
440
440
|
return null;
|
|
441
441
|
}
|
|
442
442
|
remove(t) {
|
|
443
|
-
new ne.
|
|
443
|
+
new ne.se(this.cn).remove(t);
|
|
444
444
|
for (let e = 0; e < this.vE.length; e++) this.vE[e].remove(t);
|
|
445
445
|
}
|
|
446
446
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
Tu: "invalid_api_key",
|
|
3
|
+
yu: "blacklisted",
|
|
4
|
+
Nu: "no_device_identifier",
|
|
5
|
+
ku: "invalid_json_response",
|
|
6
|
+
Au: "empty_response",
|
|
7
7
|
__: "sdk_auth_error",
|
|
8
8
|
};
|
|
@@ -18,7 +18,7 @@ export default class ve {
|
|
|
18
18
|
(this.sessionId = r),
|
|
19
19
|
(this.data = e);
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
Kr() {
|
|
22
22
|
var t;
|
|
23
23
|
const s = {
|
|
24
24
|
name: this.type,
|
|
@@ -49,7 +49,7 @@ export default class ve {
|
|
|
49
49
|
static RE(t) {
|
|
50
50
|
return null != t && yt(t) && null != t.t && "" !== t.t;
|
|
51
51
|
}
|
|
52
|
-
static
|
|
52
|
+
static Bn(t) {
|
|
53
53
|
return new ve(t.u, t.t, t.ts, t.s, t.d);
|
|
54
54
|
}
|
|
55
55
|
}
|
package/src/models/device.js
CHANGED
|
@@ -2,11 +2,11 @@ export default class Gt {
|
|
|
2
2
|
constructor(s) {
|
|
3
3
|
(this.id = s), (this.id = s);
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
Kr() {
|
|
6
6
|
const s = {};
|
|
7
7
|
return (
|
|
8
8
|
null != this.browser && (s.browser = this.browser),
|
|
9
|
-
null != this.
|
|
9
|
+
null != this.Qa && (s.browser_version = this.Qa),
|
|
10
10
|
null != this.os && (s.os_version = this.os),
|
|
11
11
|
null != this.resolution && (s.resolution = this.resolution),
|
|
12
12
|
null != this.language && (s.locale = this.language),
|
package/src/models/identifier.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Guid as G, logger as N } from "../../shared-lib/index.js";
|
|
2
|
-
import { isArray as
|
|
2
|
+
import { isArray as z } from "../util/code-utils.js";
|
|
3
3
|
import { getErrorMessage as si } from "../util/error-utils.js";
|
|
4
4
|
export default class _t {
|
|
5
5
|
constructor(t, e, i) {
|
|
6
6
|
(this.eu = t),
|
|
7
7
|
null == t && (t = G.Rt()),
|
|
8
|
-
!i || isNaN(i) ? (this.
|
|
8
|
+
!i || isNaN(i) ? (this.Gl = new Date().valueOf()) : (this.Gl = i),
|
|
9
9
|
(this.eu = t),
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
10
|
+
(this.ql = new Date().valueOf()),
|
|
11
|
+
(this.kl = e);
|
|
12
12
|
}
|
|
13
13
|
bs() {
|
|
14
|
-
return `g:${encodeURIComponent(this.eu)}|e:${this.
|
|
15
|
-
this.
|
|
14
|
+
return `g:${encodeURIComponent(this.eu)}|e:${this.kl}|c:${this.Gl}|l:${
|
|
15
|
+
this.ql
|
|
16
16
|
}`;
|
|
17
17
|
}
|
|
18
18
|
static hE(t) {
|
|
@@ -26,19 +26,19 @@ export default class _t {
|
|
|
26
26
|
(t = t.replace(i, `g:${n}`))
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
|
-
static
|
|
29
|
+
static Bn(t) {
|
|
30
30
|
let e;
|
|
31
31
|
if ("string" == typeof t)
|
|
32
32
|
try {
|
|
33
33
|
const i = t.split("|");
|
|
34
|
-
if (!
|
|
34
|
+
if (!z(i) || 4 !== i.length) return null;
|
|
35
35
|
const r = (t) => t.split(":")[1],
|
|
36
36
|
n = (t) => {
|
|
37
37
|
const e = parseInt(r(t));
|
|
38
38
|
if (!isNaN(e)) return e;
|
|
39
39
|
};
|
|
40
40
|
(e = new _t(decodeURIComponent(r(i[0])), n(i[1]), n(i[2]))),
|
|
41
|
-
(e.
|
|
41
|
+
(e.ql = n(i[3]));
|
|
42
42
|
} catch (e) {
|
|
43
43
|
N.info(
|
|
44
44
|
`Unable to parse cookie string ${t}, failed with error: ${si(e)}`,
|
|
@@ -46,7 +46,7 @@ export default class _t {
|
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
48
|
if (null == t || null == t.g) return null;
|
|
49
|
-
(e = new _t(t.g, t.e, t.c)), (e.
|
|
49
|
+
(e = new _t(t.g, t.e, t.c)), (e.ql = t.l);
|
|
50
50
|
}
|
|
51
51
|
return e;
|
|
52
52
|
}
|
package/src/models/push-token.js
CHANGED
|
@@ -2,26 +2,26 @@ import { rehydrateDateAfterJsonization as V } from "../util/date-utils.js";
|
|
|
2
2
|
export default class ti {
|
|
3
3
|
constructor(t, i, s, l, h) {
|
|
4
4
|
(this.endpoint = t),
|
|
5
|
-
(this.
|
|
5
|
+
(this.On = i),
|
|
6
6
|
(this.publicKey = s),
|
|
7
7
|
(this.Vl = l),
|
|
8
|
-
(this.
|
|
8
|
+
(this.Cl = h),
|
|
9
9
|
(this.endpoint = t || null),
|
|
10
|
-
(this.
|
|
10
|
+
(this.On = i || null),
|
|
11
11
|
(this.publicKey = s || null),
|
|
12
12
|
(this.Vl = l || null),
|
|
13
|
-
(this.
|
|
13
|
+
(this.Cl = h || null);
|
|
14
14
|
}
|
|
15
15
|
bs() {
|
|
16
16
|
return {
|
|
17
17
|
e: this.endpoint,
|
|
18
|
-
c: this.
|
|
18
|
+
c: this.On,
|
|
19
19
|
p: this.publicKey,
|
|
20
20
|
u: this.Vl,
|
|
21
|
-
v: this.
|
|
21
|
+
v: this.Cl,
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
static
|
|
24
|
+
static Bn(t) {
|
|
25
25
|
return new ti(t.e, V(t.c), t.p, t.u, t.v);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -15,46 +15,46 @@ export default class Jt {
|
|
|
15
15
|
n = { enabled: !0, capacity: Zt, refill_rate: hi, endpoint_overrides: {} },
|
|
16
16
|
o = { enabled: !1, max_placements: 0 },
|
|
17
17
|
) {
|
|
18
|
-
(this.
|
|
19
|
-
(this.
|
|
20
|
-
(this.
|
|
21
|
-
(this.
|
|
22
|
-
(this.
|
|
23
|
-
(this.
|
|
24
|
-
(this.
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
18
|
+
(this.fl = t),
|
|
19
|
+
(this.vl = i),
|
|
20
|
+
(this.wl = s),
|
|
21
|
+
(this.yl = h),
|
|
22
|
+
(this.Bl = e),
|
|
23
|
+
(this.Cl = l),
|
|
24
|
+
(this.El = r),
|
|
25
|
+
(this.we = a),
|
|
26
|
+
(this.Rl = n),
|
|
27
27
|
(this.banners = o),
|
|
28
|
-
(this.
|
|
29
|
-
(this.
|
|
30
|
-
(this.
|
|
31
|
-
(this.
|
|
32
|
-
(this.
|
|
33
|
-
(this.
|
|
34
|
-
(this.
|
|
35
|
-
(this.
|
|
36
|
-
(this.
|
|
28
|
+
(this.fl = t),
|
|
29
|
+
(this.vl = i),
|
|
30
|
+
(this.wl = s),
|
|
31
|
+
(this.yl = h),
|
|
32
|
+
(this.Bl = e),
|
|
33
|
+
(this.Cl = l),
|
|
34
|
+
(this.El = r),
|
|
35
|
+
(this.we = a),
|
|
36
|
+
(this.Rl = n),
|
|
37
37
|
(this.banners = o);
|
|
38
38
|
}
|
|
39
39
|
bs() {
|
|
40
40
|
return {
|
|
41
|
-
s: "5.
|
|
42
|
-
l: this.
|
|
43
|
-
e: this.
|
|
44
|
-
a: this.
|
|
45
|
-
p: this.
|
|
46
|
-
m: this.
|
|
47
|
-
v: this.
|
|
48
|
-
c: this.
|
|
49
|
-
f: this.
|
|
50
|
-
grl: this.
|
|
41
|
+
s: "5.8.0",
|
|
42
|
+
l: this.fl,
|
|
43
|
+
e: this.vl,
|
|
44
|
+
a: this.wl,
|
|
45
|
+
p: this.yl,
|
|
46
|
+
m: this.Bl,
|
|
47
|
+
v: this.Cl,
|
|
48
|
+
c: this.El,
|
|
49
|
+
f: this.we,
|
|
50
|
+
grl: this.Rl,
|
|
51
51
|
b: this.banners,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
static
|
|
54
|
+
static Bn(t) {
|
|
55
55
|
let i = t.l;
|
|
56
56
|
return (
|
|
57
|
-
"5.
|
|
57
|
+
"5.8.0" !== t.s && (i = 0),
|
|
58
58
|
new Jt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b)
|
|
59
59
|
);
|
|
60
60
|
}
|