@braze/web-sdk 6.7.1 → 6.9.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 +165 -38
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +2 -2
- package/shared-lib/event-types.js +16 -16
- package/shared-lib/indexed-db-adapter.js +65 -65
- package/shared-lib/logger.js +18 -18
- package/shared-lib/supported-options.js +1 -1
- package/src/Banner/banner-provider.js +67 -59
- package/src/Banner/banner.js +40 -19
- package/src/Banner/dismiss-banner.js +4 -0
- package/src/Banner/display/banner-to-html.js +10 -10
- package/src/Banner/display/destroy-banner-html.js +2 -2
- package/src/Banner/get-all-banners.js +6 -6
- package/src/Banner/get-banner.js +6 -6
- package/src/Banner/index.js +1 -0
- package/src/Banner/log-banner-click.js +7 -7
- package/src/Banner/log-banner-dismissal.js +7 -7
- package/src/Banner/log-banner-impressions.js +27 -18
- package/src/Banner/request-banners-refresh.js +8 -8
- package/src/Banner/subscribe-to-banners-updates.js +5 -5
- package/src/Banner/ui/insert-banner.js +8 -8
- package/src/Card/card-manager.js +31 -31
- package/src/Card/log-card-dismissal.js +2 -2
- package/src/Card/log-content-card-click.js +2 -2
- package/src/Card/log-content-card-impressions.js +4 -4
- package/src/Card/models/captioned-image.js +15 -15
- package/src/Card/models/card.js +89 -89
- package/src/Card/models/classic-card.js +16 -16
- package/src/Card/models/control-card.js +7 -7
- package/src/Card/models/image-only.js +13 -13
- package/src/Card/util/card-factory.js +32 -32
- package/src/ContentCards/content-cards-provider-factory.js +13 -11
- package/src/ContentCards/content-cards-provider.js +105 -105
- package/src/ContentCards/get-cached-content-cards.js +2 -2
- package/src/ContentCards/request-content-cards-refresh.js +2 -2
- package/src/ContentCards/subscribe-to-content-cards-updates.js +10 -10
- package/src/ContentCards/ui/show-content-cards.js +7 -7
- package/src/Core/add-sdk-metadata.js +2 -2
- package/src/Core/change-user.js +5 -5
- package/src/Core/destroy.js +2 -2
- package/src/Core/disable-sdk.js +4 -4
- package/src/Core/enable-sdk.js +4 -4
- package/src/Core/get-device-id.js +2 -2
- package/src/Core/handle-braze-action.js +5 -5
- package/src/Core/index.js +1 -0
- package/src/Core/log-custom-event.js +5 -5
- package/src/Core/log-ecommerce-event.js +29 -0
- package/src/Core/log-purchase.js +23 -198
- package/src/Core/open-session.js +10 -10
- package/src/Core/set-logger.js +2 -2
- package/src/Core/set-sdk-authentication-signature.js +1 -1
- package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
- package/src/Core/toggle-logging.js +2 -2
- package/src/Core/wipe-data.js +6 -6
- package/src/DUST/dust-connection-core.js +1 -0
- package/src/DUST/dust-provider-factory.js +10 -10
- package/src/DUST/dust-provider.js +258 -226
- package/src/DUST/dust-shared-worker-code.js +1 -1
- package/src/DUST/dust-shared-worker-impl.js +97 -103
- package/src/DUST/dust-worker-bridge.js +55 -40
- package/src/DUST/subscribe-to-dust.js +7 -7
- package/src/FeatureFlags/feature-flag-factory.js +8 -8
- package/src/FeatureFlags/feature-flag.js +3 -3
- package/src/FeatureFlags/feature-flags-provider.js +21 -21
- package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
- package/src/InAppMessage/constants.js +3 -3
- package/src/InAppMessage/defer-in-app-message.js +3 -3
- package/src/InAppMessage/display/html-message-to-html.js +4 -4
- package/src/InAppMessage/display/in-app-message-to-html.js +32 -32
- package/src/InAppMessage/display/modal-utils.js +2 -2
- package/src/InAppMessage/in-app-message-factory.js +36 -36
- package/src/InAppMessage/in-app-message-manager.js +35 -35
- package/src/InAppMessage/log-in-app-message-button-click.js +3 -3
- 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 +3 -3
- package/src/InAppMessage/models/control-message.js +4 -4
- package/src/InAppMessage/models/full-screen-message.js +9 -9
- package/src/InAppMessage/models/html-message.js +2 -2
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +34 -34
- package/src/InAppMessage/models/modal-message.js +7 -7
- package/src/InAppMessage/models/slide-up-message.js +8 -8
- package/src/InAppMessage/ui/show-in-app-message.js +20 -20
- package/src/Push/push-manager.js +44 -44
- package/src/User/user-manager.js +19 -19
- package/src/User/user.js +17 -17
- package/src/common/base-provider.js +1 -1
- package/src/common/constants.js +1 -0
- package/src/common/content-cards-display.js +6 -6
- package/src/common/event-logger.js +3 -3
- package/src/common/properties-base.js +3 -3
- package/src/l10n/l10n-manager.js +2 -2
- package/src/managers/auth-manager.js +11 -11
- package/src/managers/braze-instance.js +59 -59
- package/src/managers/device-manager.js +9 -9
- package/src/managers/network-manager.js +65 -63
- package/src/managers/server-config-manager.js +110 -93
- package/src/managers/session-manager.js +20 -20
- package/src/managers/storage-manager-factory.js +9 -9
- package/src/managers/storage-manager.js +137 -137
- package/src/managers/subscription-manager.js +2 -2
- package/src/managers/utils.js +1 -1
- package/src/models/braze-event.js +2 -2
- package/src/models/identifier.js +5 -5
- package/src/models/push-token.js +8 -8
- package/src/models/request-result.js +1 -1
- package/src/models/server-config.js +46 -28
- package/src/request-controller.js +124 -124
- package/src/triggers/models/custom-event-data.js +4 -4
- package/src/triggers/models/custom-event-property-data.js +5 -5
- package/src/triggers/models/filter-set.js +2 -2
- package/src/triggers/models/filter.js +1 -1
- package/src/triggers/models/in-app-message-click-data.js +5 -5
- package/src/triggers/models/purchase-data.js +1 -1
- package/src/triggers/models/purchase-property-data.js +2 -2
- package/src/triggers/models/push-click-data.js +5 -5
- package/src/triggers/models/trigger-condition.js +45 -45
- package/src/triggers/models/trigger-events.js +3 -3
- package/src/triggers/models/trigger.js +30 -30
- package/src/triggers/triggers-provider.js +63 -63
- package/src/types.js +5 -1
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/braze-actions.js +6 -6
- package/src/util/browser-detector.js +13 -13
- package/src/util/client-hints-parser.js +5 -5
- package/src/util/code-utils.js +2 -2
- package/src/util/deprecation-utils.js +2 -2
- package/src/util/dom-utils.js +8 -8
- package/src/util/ecommerce-event-validation.js +343 -0
- package/src/util/html-display-utils.js +11 -11
- package/src/util/iso-4217-currency-codes.js +176 -0
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +10 -10
- package/src/util/string-utils.js +2 -2
- package/src/util/user-agent-parser.js +15 -15
- package/src/util/validation-utils.js +14 -14
|
@@ -1,60 +1,78 @@
|
|
|
1
1
|
import {
|
|
2
|
-
GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as
|
|
3
|
-
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as
|
|
2
|
+
GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as mi,
|
|
3
|
+
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as fi,
|
|
4
4
|
} from "../common/constants.js";
|
|
5
|
-
export default class
|
|
5
|
+
export default class di {
|
|
6
6
|
constructor(
|
|
7
7
|
t = 0,
|
|
8
8
|
i = [],
|
|
9
9
|
s = [],
|
|
10
10
|
h = [],
|
|
11
|
-
e = null,
|
|
12
11
|
l = null,
|
|
12
|
+
e = null,
|
|
13
13
|
r = { enabled: !1 },
|
|
14
14
|
n = { enabled: !1, refresh_rate_limit: void 0 },
|
|
15
|
-
a = { enabled: !0, capacity:
|
|
15
|
+
a = { enabled: !0, capacity: mi, refill_rate: fi, endpoint_overrides: {} },
|
|
16
16
|
o = null,
|
|
17
17
|
u = null,
|
|
18
18
|
c = null,
|
|
19
19
|
d = null,
|
|
20
|
+
m = null,
|
|
20
21
|
) {
|
|
21
|
-
(this.
|
|
22
|
-
(this.
|
|
23
|
-
(this.
|
|
24
|
-
(this.
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
27
|
-
(this.
|
|
22
|
+
(this.nd = t),
|
|
23
|
+
(this.gd = i),
|
|
24
|
+
(this.bd = s),
|
|
25
|
+
(this.fd = h),
|
|
26
|
+
(this.Rd = l),
|
|
27
|
+
(this.ad = e),
|
|
28
|
+
(this.hd = r),
|
|
28
29
|
(this.Xr = n),
|
|
29
|
-
(this.
|
|
30
|
+
(this.ud = a),
|
|
30
31
|
(this.banners = o),
|
|
31
32
|
(this.dust = u),
|
|
32
|
-
(this.
|
|
33
|
-
(this.
|
|
33
|
+
(this.wd = c),
|
|
34
|
+
(this.Td = d),
|
|
35
|
+
(this.dd = m);
|
|
34
36
|
}
|
|
35
37
|
qt() {
|
|
36
38
|
return {
|
|
37
|
-
s: "6.
|
|
38
|
-
l: this.
|
|
39
|
-
e: this.
|
|
40
|
-
a: this.
|
|
41
|
-
p: this.
|
|
42
|
-
m: this.
|
|
43
|
-
v: this.
|
|
44
|
-
c: this.
|
|
39
|
+
s: "6.9.0",
|
|
40
|
+
l: this.nd,
|
|
41
|
+
e: this.gd,
|
|
42
|
+
a: this.bd,
|
|
43
|
+
p: this.fd,
|
|
44
|
+
m: this.Rd,
|
|
45
|
+
v: this.ad,
|
|
46
|
+
c: this.hd,
|
|
45
47
|
f: this.Xr,
|
|
46
|
-
grl: this.
|
|
48
|
+
grl: this.ud,
|
|
47
49
|
b: this.banners,
|
|
48
50
|
d: this.dust,
|
|
49
|
-
rb: this.
|
|
50
|
-
mst: this.
|
|
51
|
+
rb: this.wd,
|
|
52
|
+
mst: this.Td,
|
|
53
|
+
ch: this.dd,
|
|
51
54
|
};
|
|
52
55
|
}
|
|
53
56
|
static _u(t) {
|
|
54
57
|
let i = t.l;
|
|
55
58
|
return (
|
|
56
|
-
"6.
|
|
57
|
-
new
|
|
59
|
+
"6.9.0" !== t.s && (i = 0),
|
|
60
|
+
new di(
|
|
61
|
+
i,
|
|
62
|
+
t.e,
|
|
63
|
+
t.a,
|
|
64
|
+
t.p,
|
|
65
|
+
t.m,
|
|
66
|
+
t.v,
|
|
67
|
+
t.c,
|
|
68
|
+
t.f,
|
|
69
|
+
t.grl,
|
|
70
|
+
t.b,
|
|
71
|
+
t.d,
|
|
72
|
+
t.rb,
|
|
73
|
+
t.mst,
|
|
74
|
+
t.ch,
|
|
75
|
+
)
|
|
58
76
|
);
|
|
59
77
|
}
|
|
60
78
|
}
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
EventTypes as p,
|
|
3
3
|
Guid as V,
|
|
4
4
|
IndexedDBAdapter as et,
|
|
5
|
-
logger as
|
|
5
|
+
logger as b,
|
|
6
6
|
} from "../shared-lib/index.js";
|
|
7
7
|
import v from "./common/event-logger.js";
|
|
8
|
-
import { removeAllVisibleInAppMessages as
|
|
8
|
+
import { removeAllVisibleInAppMessages as gi } from "./InAppMessage/ui/remove-all-visible-in-app-messages.js";
|
|
9
9
|
import { STORAGE_KEYS as s } from "./managers/storage-manager.js";
|
|
10
10
|
import f from "./managers/subscription-manager.js";
|
|
11
11
|
import Ie from "./models/braze-event.js";
|
|
@@ -18,38 +18,38 @@ export default class Kt {
|
|
|
18
18
|
constructor(t, i, s, e, h, n, o, r, l, u) {
|
|
19
19
|
(this.tu = t),
|
|
20
20
|
(this.baseUrl = i),
|
|
21
|
-
(this.
|
|
21
|
+
(this.C = s),
|
|
22
22
|
(this.eu = e),
|
|
23
23
|
(this.Ss = h),
|
|
24
24
|
(this.h = n),
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
25
|
+
(this.j = o),
|
|
26
|
+
(this.hc = r),
|
|
27
27
|
(this.Gh = l),
|
|
28
28
|
(this.B = u),
|
|
29
29
|
(this.tu = t),
|
|
30
30
|
(this.baseUrl = i),
|
|
31
|
-
(this.
|
|
32
|
-
(this.
|
|
33
|
-
(this.
|
|
34
|
-
(this.
|
|
31
|
+
(this.nc = 0),
|
|
32
|
+
(this.IS = o.dS() || 0),
|
|
33
|
+
(this.lc = null),
|
|
34
|
+
(this.C = s),
|
|
35
35
|
(this.eu = e),
|
|
36
36
|
(this.Ss = h),
|
|
37
37
|
(this.h = n),
|
|
38
|
-
(this.
|
|
38
|
+
(this.j = o),
|
|
39
39
|
(this.Gh = l),
|
|
40
40
|
(this.B = u),
|
|
41
|
-
(this.
|
|
42
|
-
(this.
|
|
43
|
-
(this.
|
|
44
|
-
(this.
|
|
45
|
-
(this
|
|
46
|
-
(this.
|
|
41
|
+
(this.hc = r),
|
|
42
|
+
(this.uc = new f()),
|
|
43
|
+
(this.cc = null),
|
|
44
|
+
(this.dc = 50),
|
|
45
|
+
(this.mc = !1),
|
|
46
|
+
(this.fc = !1);
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
return !t && !i && this.Gh.Ih() >= this.
|
|
48
|
+
gc(t, i) {
|
|
49
|
+
return !t && !i && this.Gh.Ih() >= this.dc;
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
let i = this.
|
|
51
|
+
vc(t) {
|
|
52
|
+
let i = this.C.am();
|
|
53
53
|
if (t.length > 0) {
|
|
54
54
|
const s = this.Ss.getUserId();
|
|
55
55
|
for (const e of t) {
|
|
@@ -59,14 +59,14 @@ export default class Kt {
|
|
|
59
59
|
}
|
|
60
60
|
return i;
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
i && this.
|
|
64
|
-
const c = this.
|
|
65
|
-
d = this.
|
|
62
|
+
bc(t = !1, i = !0, e, n, o, r = !1, u = !1) {
|
|
63
|
+
i && this.wc();
|
|
64
|
+
const c = this.j.hS(),
|
|
65
|
+
d = this.j.RS();
|
|
66
66
|
let m = !1;
|
|
67
67
|
const f = (t, r, u = -1) => {
|
|
68
68
|
const c = new Date().valueOf();
|
|
69
|
-
h.nt(this.
|
|
69
|
+
h.nt(this.j, h.it.pn, c),
|
|
70
70
|
-1 !== u && r.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
|
|
71
71
|
let d = !1;
|
|
72
72
|
l.ot({
|
|
@@ -76,18 +76,18 @@ export default class Kt {
|
|
|
76
76
|
lt: (i) => {
|
|
77
77
|
null != t.respond_with &&
|
|
78
78
|
t.respond_with.triggers &&
|
|
79
|
-
(this.
|
|
79
|
+
(this.nc = Math.max(this.nc - 1, 0)),
|
|
80
80
|
this.B.ut(t, i, r)
|
|
81
81
|
? (this.Gh.ct(),
|
|
82
|
-
this.h.
|
|
82
|
+
this.h.ld(i),
|
|
83
83
|
(null != t.respond_with &&
|
|
84
84
|
t.respond_with.user_id != this.Ss.getUserId()) ||
|
|
85
|
-
(null != t.device && this.
|
|
85
|
+
(null != t.device && this.j.Pt(s.It.Ba, t.device),
|
|
86
86
|
null != t.sdk_metadata &&
|
|
87
|
-
(this.
|
|
88
|
-
this.
|
|
89
|
-
this.
|
|
90
|
-
h.Dl(this.
|
|
87
|
+
(this.j.Pt(s.It.Ka, t.sdk_metadata),
|
|
88
|
+
this.j.Pt(s.It.Pa, this.C.$t())),
|
|
89
|
+
this.hc(i),
|
|
90
|
+
h.Dl(this.j, h.it.pn, 1),
|
|
91
91
|
"function" == typeof e && e()))
|
|
92
92
|
: i.auth_error && (d = !0);
|
|
93
93
|
},
|
|
@@ -95,13 +95,13 @@ export default class Kt {
|
|
|
95
95
|
(d = !0),
|
|
96
96
|
null != t.respond_with &&
|
|
97
97
|
t.respond_with.triggers &&
|
|
98
|
-
(this.
|
|
98
|
+
(this.nc = Math.max(this.nc - 1, 0)),
|
|
99
99
|
this.B.Ua(t.events, t.attributes),
|
|
100
100
|
"function" == typeof n && n();
|
|
101
101
|
},
|
|
102
102
|
ft: (t, s) => {
|
|
103
103
|
"function" == typeof o && o(!d);
|
|
104
|
-
const e = this.B.
|
|
104
|
+
const e = this.B.Cl(s);
|
|
105
105
|
let n = 0;
|
|
106
106
|
if (e)
|
|
107
107
|
switch (e.type) {
|
|
@@ -113,31 +113,31 @@ export default class Kt {
|
|
|
113
113
|
}
|
|
114
114
|
if (i && !m) {
|
|
115
115
|
if (d) {
|
|
116
|
-
h.zl(this.
|
|
116
|
+
h.zl(this.j, h.it.pn);
|
|
117
117
|
const t = this.h.vt(),
|
|
118
118
|
i = this.h.gt(),
|
|
119
119
|
s = this.h.bt();
|
|
120
|
-
let e = this.
|
|
120
|
+
let e = this.lc;
|
|
121
121
|
(null == e || e < t) && (e = t);
|
|
122
122
|
const o = Math.min(s, a(t, e * i)) + n;
|
|
123
|
-
this.
|
|
124
|
-
} else this.
|
|
123
|
+
this.kc(o);
|
|
124
|
+
} else this.kc(Math.max(1e3 * this.IS, n));
|
|
125
125
|
m = !0;
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
128
|
});
|
|
129
129
|
},
|
|
130
|
-
g = this.
|
|
130
|
+
g = this.vc(c),
|
|
131
131
|
p = t || g;
|
|
132
|
-
if (this.
|
|
133
|
-
return void
|
|
132
|
+
if (this.gc(r, g))
|
|
133
|
+
return void b.info(
|
|
134
134
|
"Declining to flush data due to 50 consecutive authentication failures",
|
|
135
135
|
);
|
|
136
136
|
if (i && !this.B.fl(c, d, p))
|
|
137
|
-
return this.
|
|
137
|
+
return this.kc(), void ("function" == typeof o && o(!0));
|
|
138
138
|
const v = this.B.ml(p, c, d, u);
|
|
139
|
-
p && this.
|
|
140
|
-
let
|
|
139
|
+
p && this.nc++;
|
|
140
|
+
let w = !1;
|
|
141
141
|
if (v)
|
|
142
142
|
for (const t of v)
|
|
143
143
|
this.B.et(
|
|
@@ -146,60 +146,60 @@ export default class Kt {
|
|
|
146
146
|
h.it.pn,
|
|
147
147
|
n,
|
|
148
148
|
),
|
|
149
|
-
(
|
|
150
|
-
this.Gh.Fh() && i && !
|
|
151
|
-
? this.
|
|
149
|
+
(w = !0);
|
|
150
|
+
this.Gh.Fh() && i && !w
|
|
151
|
+
? this.kc()
|
|
152
152
|
: g &&
|
|
153
|
-
(
|
|
154
|
-
this.
|
|
155
|
-
(this.
|
|
153
|
+
(b.info("Invoking new session subscriptions"),
|
|
154
|
+
this.uc.A(),
|
|
155
|
+
(this.fc = !0));
|
|
156
156
|
}
|
|
157
|
-
|
|
158
|
-
return this.
|
|
157
|
+
yc() {
|
|
158
|
+
return this.nc > 0;
|
|
159
159
|
}
|
|
160
|
-
|
|
161
|
-
this
|
|
162
|
-
(this.
|
|
163
|
-
(this.
|
|
160
|
+
kc(t = 1e3 * this.IS) {
|
|
161
|
+
this.mc ||
|
|
162
|
+
(this.wc(),
|
|
163
|
+
(this.cc = window.setTimeout(() => {
|
|
164
164
|
if (document.hidden) {
|
|
165
165
|
const t = "visibilitychange",
|
|
166
166
|
i = () => {
|
|
167
167
|
document.hidden ||
|
|
168
|
-
(document.removeEventListener(t, i, !1), this.
|
|
168
|
+
(document.removeEventListener(t, i, !1), this.bc());
|
|
169
169
|
};
|
|
170
170
|
document.addEventListener(t, i, !1);
|
|
171
|
-
} else this.
|
|
171
|
+
} else this.bc();
|
|
172
172
|
}, t)),
|
|
173
|
-
(this.
|
|
173
|
+
(this.lc = t));
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
null != this.
|
|
175
|
+
wc() {
|
|
176
|
+
null != this.cc && (clearTimeout(this.cc), (this.cc = null));
|
|
177
177
|
}
|
|
178
178
|
initialize() {
|
|
179
|
-
(this
|
|
179
|
+
(this.mc = !1), this.kc();
|
|
180
180
|
}
|
|
181
181
|
destroy() {
|
|
182
|
-
this.
|
|
182
|
+
this.uc.removeAllSubscriptions(),
|
|
183
183
|
this.Gh.xh(),
|
|
184
|
-
this.
|
|
185
|
-
(this
|
|
186
|
-
this.
|
|
187
|
-
(this.
|
|
188
|
-
(this.
|
|
184
|
+
this.wc(),
|
|
185
|
+
(this.mc = !0),
|
|
186
|
+
this.bc(void 0, !1, void 0, void 0, void 0, void 0, !0),
|
|
187
|
+
(this.cc = null),
|
|
188
|
+
(this.fc = !1);
|
|
189
189
|
}
|
|
190
190
|
rn(t) {
|
|
191
|
-
return this.
|
|
191
|
+
return this.fc ? (t(), null) : this.uc.Ut(t);
|
|
192
192
|
}
|
|
193
193
|
openSession() {
|
|
194
|
-
const t = this.
|
|
195
|
-
t && (this.
|
|
196
|
-
this.
|
|
197
|
-
t && (this.
|
|
194
|
+
const t = this.C.$t() !== this.C.el();
|
|
195
|
+
t && (this.j.cS(s.Ou.Wh), this.j.cS(s.Ou.Cu)),
|
|
196
|
+
this.bc(!1, void 0, () => {
|
|
197
|
+
t && (this.j.Vt(s.It.jo), this.j.Vt(s.It.At));
|
|
198
198
|
}),
|
|
199
199
|
this.Ea(),
|
|
200
200
|
t &&
|
|
201
201
|
import("./Push/push-manager-factory.js").then((t) => {
|
|
202
|
-
if (this
|
|
202
|
+
if (this.mc) return;
|
|
203
203
|
const i = t.default.ra();
|
|
204
204
|
if (
|
|
205
205
|
null != i &&
|
|
@@ -207,7 +207,7 @@ export default class Kt {
|
|
|
207
207
|
) {
|
|
208
208
|
const t = () => {
|
|
209
209
|
i.du()
|
|
210
|
-
?
|
|
210
|
+
? b.info(
|
|
211
211
|
"Push token maintenance is disabled, not refreshing token for backend.",
|
|
212
212
|
)
|
|
213
213
|
: i.subscribe();
|
|
@@ -216,86 +216,86 @@ export default class Kt {
|
|
|
216
216
|
s && t();
|
|
217
217
|
},
|
|
218
218
|
h = () => {
|
|
219
|
-
const i = this.
|
|
219
|
+
const i = this.j.St(s.It.Uu);
|
|
220
220
|
(null == i || i) && t();
|
|
221
221
|
},
|
|
222
|
-
n = et.
|
|
223
|
-
new et(n,
|
|
222
|
+
n = et._s.Xs;
|
|
223
|
+
new et(n, b).kr(n.Ws.Fu, e, h);
|
|
224
224
|
}
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
|
-
|
|
228
|
-
this.
|
|
227
|
+
jc() {
|
|
228
|
+
this.j.Vt(s.It.Fo), this.j.Vt(s.It.bi), this.j.Vt(s.It.pa);
|
|
229
229
|
}
|
|
230
|
-
|
|
231
|
-
this.
|
|
232
|
-
this.
|
|
233
|
-
this.
|
|
234
|
-
this.
|
|
230
|
+
Sc() {
|
|
231
|
+
this.j.Vt(s.It.Bl),
|
|
232
|
+
this.j.Vt(s.It.ES),
|
|
233
|
+
this.j.Vt(s.It.Ml),
|
|
234
|
+
this.j.Vt(s.It.Ll);
|
|
235
235
|
}
|
|
236
236
|
changeUser(t, i, e) {
|
|
237
237
|
const h = this.Ss.getUserId();
|
|
238
238
|
if (h !== t) {
|
|
239
|
-
this.
|
|
240
|
-
this.
|
|
241
|
-
|
|
242
|
-
null != h && this.
|
|
239
|
+
this.C.Sm(),
|
|
240
|
+
this.jc(),
|
|
241
|
+
gi(),
|
|
242
|
+
null != h && this.bc(void 0, !1, void 0, void 0, void 0),
|
|
243
243
|
this.Ss.Ju(t),
|
|
244
244
|
e ? this.Gh.setSdkAuthenticationSignature(e) : this.Gh.jh();
|
|
245
245
|
for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
|
|
246
246
|
this.B.fo(),
|
|
247
|
-
null != h && this.
|
|
248
|
-
this.
|
|
249
|
-
this.
|
|
250
|
-
this.
|
|
247
|
+
null != h && this.j.Vt(s.It.eS),
|
|
248
|
+
this.j.Vt(s.It.Ba),
|
|
249
|
+
this.j.Vt(s.It.lS),
|
|
250
|
+
this.Sc(),
|
|
251
251
|
this.openSession(),
|
|
252
|
-
|
|
252
|
+
b.info('Changed user to "' + t + '".');
|
|
253
253
|
} else {
|
|
254
254
|
let i = "Doing nothing.";
|
|
255
255
|
e &&
|
|
256
256
|
this.Gh.kh() !== e &&
|
|
257
257
|
(this.Gh.setSdkAuthenticationSignature(e),
|
|
258
258
|
(i = "Updated SDK authentication signature")),
|
|
259
|
-
|
|
259
|
+
b.info(`Current user is already ${t}. ${i}`);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
requestImmediateDataFlush(t) {
|
|
263
|
-
this.
|
|
264
|
-
this.
|
|
263
|
+
this.wc(), this.C.el();
|
|
264
|
+
this.bc(
|
|
265
265
|
void 0,
|
|
266
266
|
void 0,
|
|
267
267
|
void 0,
|
|
268
268
|
() => {
|
|
269
|
-
|
|
269
|
+
b.error("Failed to flush data, request will be retried automatically.");
|
|
270
270
|
},
|
|
271
271
|
t,
|
|
272
272
|
!0,
|
|
273
273
|
);
|
|
274
274
|
}
|
|
275
|
-
|
|
276
|
-
this.
|
|
277
|
-
|
|
278
|
-
this.
|
|
275
|
+
Ar(t, i) {
|
|
276
|
+
this.C.el(),
|
|
277
|
+
b.info("Requesting explicit trigger refresh."),
|
|
278
|
+
this.bc(!0, void 0, t, i);
|
|
279
279
|
}
|
|
280
280
|
Gu(t, i) {
|
|
281
|
-
const e = p.
|
|
281
|
+
const e = p.Ac,
|
|
282
282
|
h = { a: t, l: i },
|
|
283
|
-
n = v.
|
|
283
|
+
n = v.Dt(e, h);
|
|
284
284
|
return (
|
|
285
|
-
n && (
|
|
285
|
+
n && (b.info(`Logged alias ${t} with label ${i}`), this.j.Pt(s.It.lS, h)),
|
|
286
286
|
n
|
|
287
287
|
);
|
|
288
288
|
}
|
|
289
289
|
Mu(t, i, s) {
|
|
290
290
|
if (this.h.qu(i))
|
|
291
291
|
return (
|
|
292
|
-
|
|
292
|
+
b.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new L()
|
|
293
293
|
);
|
|
294
294
|
const e = { key: i, value: s },
|
|
295
|
-
h = v.
|
|
295
|
+
h = v.Dt(t, e);
|
|
296
296
|
if (h) {
|
|
297
297
|
const t = "object" == typeof s ? JSON.stringify(s, null, 2) : s;
|
|
298
|
-
|
|
298
|
+
b.info(`Logged custom attribute: ${i} with value: ${t}`);
|
|
299
299
|
}
|
|
300
300
|
return h;
|
|
301
301
|
}
|
|
@@ -304,52 +304,52 @@ export default class Kt {
|
|
|
304
304
|
null != e && (o.altitude = e),
|
|
305
305
|
null != h && (o.ll_accuracy = h),
|
|
306
306
|
null != n && (o.alt_accuracy = n);
|
|
307
|
-
const r = v.
|
|
307
|
+
const r = v.Dt(p.Dc, o, t || void 0);
|
|
308
308
|
return (
|
|
309
309
|
r &&
|
|
310
|
-
|
|
310
|
+
b.info(`Set user last known location as ${JSON.stringify(o, null, 2)}`),
|
|
311
311
|
r
|
|
312
312
|
);
|
|
313
313
|
}
|
|
314
|
-
|
|
315
|
-
const s = this.
|
|
316
|
-
return new Ie(this.Ss.getUserId(), p
|
|
314
|
+
Fr(t, i) {
|
|
315
|
+
const s = this.C.el();
|
|
316
|
+
return new Ie(this.Ss.getUserId(), p.$c, t, s, { cid: i });
|
|
317
317
|
}
|
|
318
|
-
|
|
318
|
+
qc(t, i) {
|
|
319
319
|
return new et(t, i);
|
|
320
320
|
}
|
|
321
321
|
Ea() {
|
|
322
|
-
const t = et.
|
|
323
|
-
this.
|
|
322
|
+
const t = et._s.Xs;
|
|
323
|
+
this.qc(t, b).setItem(t.Ws.pn, 1, {
|
|
324
324
|
baseUrl: this.baseUrl,
|
|
325
325
|
data: { api_key: this.tu, device_id: this.eu.ve().id },
|
|
326
326
|
userId: this.Ss.getUserId(),
|
|
327
327
|
sdkAuthEnabled: this.Gh.Fh(),
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
Dr(t) {
|
|
331
331
|
for (const i of t)
|
|
332
332
|
if (i.api_key === this.tu) this.B.Ua(i.events, i.attributes);
|
|
333
333
|
else {
|
|
334
|
-
const t = et.
|
|
335
|
-
new et(t,
|
|
334
|
+
const t = et._s.Xs;
|
|
335
|
+
new et(t, b).setItem(t.Ws.Br, V.de(), i);
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
Na(t, i, s) {
|
|
339
339
|
if (this.h.qu(t))
|
|
340
340
|
return (
|
|
341
|
-
|
|
341
|
+
b.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new L()
|
|
342
342
|
);
|
|
343
343
|
let e, h;
|
|
344
344
|
return (
|
|
345
345
|
null === i && null === s
|
|
346
|
-
? ((e = p.
|
|
347
|
-
: ((e = p.
|
|
348
|
-
v.
|
|
346
|
+
? ((e = p.Cc), (h = { key: t }))
|
|
347
|
+
: ((e = p.Mc), (h = { key: t, latitude: i, longitude: s })),
|
|
348
|
+
v.Dt(e, h)
|
|
349
349
|
);
|
|
350
350
|
}
|
|
351
351
|
va(t, i) {
|
|
352
352
|
const s = { group_id: t, status: i };
|
|
353
|
-
return v.
|
|
353
|
+
return v.Dt(p.Tc, s);
|
|
354
354
|
}
|
|
355
355
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export default class es {
|
|
2
2
|
constructor(t) {
|
|
3
|
-
(this.
|
|
3
|
+
(this.xc = t), (this.xc = t);
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
return null == this.
|
|
5
|
+
zc(t) {
|
|
6
|
+
return null == this.xc || this.xc === t[0];
|
|
7
7
|
}
|
|
8
8
|
static fromJson(t) {
|
|
9
9
|
return new es(t ? t.event_name : null);
|
|
10
10
|
}
|
|
11
11
|
qt() {
|
|
12
|
-
return this.
|
|
12
|
+
return this.xc;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import ls from "./filter-set.js";
|
|
2
2
|
export default class ns {
|
|
3
3
|
constructor(t, s) {
|
|
4
|
-
(this.
|
|
4
|
+
(this.xc = t), (this.tf = s), (this.xc = t), (this.tf = s);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
if (null == this.
|
|
6
|
+
zc(t) {
|
|
7
|
+
if (null == this.xc || null == this.tf) return !1;
|
|
8
8
|
const s = t[0],
|
|
9
9
|
i = t[1];
|
|
10
|
-
return s === this.
|
|
10
|
+
return s === this.xc && this.tf.zc(i);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
13
|
return new ns(
|
|
@@ -16,6 +16,6 @@ export default class ns {
|
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
qt() {
|
|
19
|
-
return { e: this.
|
|
19
|
+
return { e: this.xc, pf: this.tf ? this.tf.qt() : null };
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -4,13 +4,13 @@ export default class ls {
|
|
|
4
4
|
constructor(t) {
|
|
5
5
|
(this.filters = t), (this.filters = t);
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
zc(t) {
|
|
8
8
|
let r = !0;
|
|
9
9
|
for (let e = 0; e < this.filters.length; e++) {
|
|
10
10
|
const o = this.filters[e];
|
|
11
11
|
let s = !1;
|
|
12
12
|
for (let r = 0; r < o.length; r++)
|
|
13
|
-
if (o[r].
|
|
13
|
+
if (o[r].zc(t)) {
|
|
14
14
|
s = !0;
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class
|
|
1
|
+
import pi from "./trigger-condition.js";
|
|
2
|
+
export default class bi {
|
|
3
3
|
constructor(t, i) {
|
|
4
4
|
(this.if = t), (this.rf = i), (this.if = t), (this.rf = i);
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
zc(t) {
|
|
7
7
|
if (null == this.if) return !1;
|
|
8
|
-
const i =
|
|
8
|
+
const i = pi.sf(t[0], this.if);
|
|
9
9
|
if (!i) return !1;
|
|
10
10
|
let r = null == this.rf || 0 === this.rf.length;
|
|
11
11
|
if (null != this.rf)
|
|
@@ -17,7 +17,7 @@ export default class pi {
|
|
|
17
17
|
return i && r;
|
|
18
18
|
}
|
|
19
19
|
static fromJson(t) {
|
|
20
|
-
return new
|
|
20
|
+
return new bi(t ? t.id : null, t ? t.buttons : null);
|
|
21
21
|
}
|
|
22
22
|
qt() {
|
|
23
23
|
return this.if;
|