@braze/web-sdk 6.11.0 → 6.12.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 +36 -5
- package/package.json +1 -1
- package/shared-lib/event-types.js +4 -4
- package/shared-lib/indexed-db-adapter.js +51 -51
- package/shared-lib/logger.js +7 -7
- package/shared-lib/supported-options.js +9 -9
- package/src/DUST/dust-config-store.js +89 -0
- package/src/DUST/dust-connection-core.js +7 -21
- package/src/DUST/dust-message-dedup.js +33 -0
- package/src/DUST/dust-provider.js +367 -397
- package/src/DUST/dust-tab-identity.js +30 -0
- package/src/DUST/index.js +7 -9
- package/src/DUST/subscribe-to-dust.js +5 -5
- package/src/FeatureFlags/feature-flag-factory.js +4 -4
- package/src/FeatureFlags/feature-flag.js +5 -5
- package/src/FeatureFlags/feature-flags-provider-factory.js +8 -1
- package/src/FeatureFlags/feature-flags-provider.js +74 -74
- package/src/FeatureFlags/get-all-feature-flags.js +2 -2
- package/src/FeatureFlags/get-feature-flag.js +2 -2
- package/src/FeatureFlags/log-feature-flag-impression.js +3 -3
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
- package/src/InAppMessage/defer-in-app-message.js +2 -2
- package/src/InAppMessage/display/get-animation-effect.js +1 -1
- package/src/InAppMessage/display/html-message-display-utils.js +4 -4
- package/src/InAppMessage/display/html-message-to-html.js +10 -10
- package/src/InAppMessage/display/in-app-message-to-html.js +42 -42
- package/src/InAppMessage/display/modal-utils.js +14 -14
- package/src/InAppMessage/get-deferred-in-app-message.js +2 -2
- package/src/InAppMessage/in-app-message-factory.js +6 -6
- package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
- package/src/InAppMessage/in-app-message-manager.js +73 -73
- 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 +2 -2
- package/src/InAppMessage/log-in-app-message-impression.js +2 -2
- package/src/InAppMessage/models/full-screen-message.js +9 -9
- package/src/InAppMessage/models/html-message.js +4 -4
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +52 -52
- package/src/InAppMessage/models/modal-message.js +7 -7
- package/src/InAppMessage/models/slide-up-message.js +11 -11
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
- package/src/InAppMessage/ui/show-in-app-message.js +36 -36
- package/src/Push/is-push-blocked.js +2 -2
- package/src/Push/is-push-permission-granted.js +2 -2
- package/src/Push/is-push-supported.js +2 -2
- package/src/Push/push-manager-factory.js +6 -6
- package/src/Push/push-manager.js +14 -14
- package/src/Push/unregister-push-token-on-server.js +3 -3
- package/src/Push/utils/push-utils.js +10 -10
- package/src/User/user.js +19 -19
- package/src/common/content-cards-display.js +21 -21
- package/src/common/event-logger.js +2 -2
- package/src/l10n/l10n-manager-factory.js +7 -7
- package/src/l10n/l10n-manager.js +5 -5
- package/src/managers/auth-manager.js +1 -1
- package/src/managers/braze-instance.js +41 -41
- package/src/managers/device-manager.js +22 -22
- package/src/managers/network-manager.js +108 -108
- package/src/managers/server-config-manager.js +83 -83
- package/src/managers/session-manager.js +6 -6
- package/src/managers/storage-manager-factory.js +4 -4
- package/src/managers/storage-manager.js +127 -125
- package/src/managers/subscription-manager.js +1 -1
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +7 -7
- package/src/models/device.js +3 -3
- package/src/models/identifier.js +3 -3
- package/src/models/push-token.js +3 -3
- package/src/models/server-config.js +31 -31
- package/src/request-controller.js +39 -39
- package/src/triggers/models/filter.js +58 -58
- package/src/triggers/models/in-app-message-click-data.js +4 -4
- package/src/triggers/models/push-click-data.js +2 -2
- package/src/triggers/models/trigger-condition.js +35 -35
- package/src/triggers/models/trigger.js +37 -37
- package/src/triggers/triggers-provider-factory.js +3 -3
- package/src/triggers/triggers-provider.js +50 -50
- package/src/types.js +2 -2
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +2 -2
- package/src/ui/js/iam-css.js +2 -2
- package/src/util/base-device-parser.js +2 -2
- package/src/util/braze-actions.js +2 -2
- package/src/util/browser-detector.js +15 -15
- package/src/util/client-hints-parser.js +5 -5
- package/src/util/component-utils.js +4 -4
- package/src/util/dom-utils.js +5 -5
- package/src/util/ecommerce-event-validation.js +77 -48
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +20 -20
- package/src/util/string-utils.js +5 -0
- package/src/util/user-agent-parser.js +18 -18
- package/src/util/validation-utils.js +4 -4
- package/src/util/window-utils.js +2 -2
- package/src/DUST/dust-shared-worker-code.js +0 -2
- package/src/DUST/dust-shared-worker-impl.js +0 -234
- package/src/DUST/dust-worker-bridge.js +0 -151
package/src/models/push-token.js
CHANGED
|
@@ -5,12 +5,12 @@ export default class ui {
|
|
|
5
5
|
(this.Uu = i),
|
|
6
6
|
(this.publicKey = s),
|
|
7
7
|
(this.sc = l),
|
|
8
|
-
(this.
|
|
8
|
+
(this.ld = h),
|
|
9
9
|
(this.endpoint = t || null),
|
|
10
10
|
(this.Uu = i || null),
|
|
11
11
|
(this.publicKey = s || null),
|
|
12
12
|
(this.sc = l || null),
|
|
13
|
-
(this.
|
|
13
|
+
(this.ld = h || null);
|
|
14
14
|
}
|
|
15
15
|
qt() {
|
|
16
16
|
return {
|
|
@@ -18,7 +18,7 @@ export default class ui {
|
|
|
18
18
|
c: this.Uu,
|
|
19
19
|
p: this.publicKey,
|
|
20
20
|
u: this.sc,
|
|
21
|
-
v: this.
|
|
21
|
+
v: this.ld,
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
static _u(t) {
|
|
@@ -1,8 +1,8 @@
|
|
|
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 _i,
|
|
3
|
+
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as bi,
|
|
4
4
|
} from "../common/constants.js";
|
|
5
|
-
export default class
|
|
5
|
+
export default class vi {
|
|
6
6
|
constructor(
|
|
7
7
|
t = 0,
|
|
8
8
|
i = [],
|
|
@@ -12,52 +12,52 @@ export default class di {
|
|
|
12
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: _i, refill_rate: bi, endpoint_overrides: {} },
|
|
16
16
|
o = null,
|
|
17
17
|
u = null,
|
|
18
18
|
c = null,
|
|
19
19
|
d = null,
|
|
20
20
|
m = null,
|
|
21
21
|
) {
|
|
22
|
-
(this.
|
|
23
|
-
(this.
|
|
24
|
-
(this.
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
27
|
-
(this.
|
|
28
|
-
(this.
|
|
29
|
-
(this.
|
|
30
|
-
(this.
|
|
22
|
+
(this.ed = t),
|
|
23
|
+
(this.vd = i),
|
|
24
|
+
(this.md = s),
|
|
25
|
+
(this.gd = h),
|
|
26
|
+
(this.fd = l),
|
|
27
|
+
(this.ld = e),
|
|
28
|
+
(this.ud = r),
|
|
29
|
+
(this.Rr = n),
|
|
30
|
+
(this.nd = a),
|
|
31
31
|
(this.banners = o),
|
|
32
32
|
(this.dust = u),
|
|
33
|
-
(this.
|
|
34
|
-
(this.
|
|
35
|
-
(this.
|
|
33
|
+
(this.Cd = c),
|
|
34
|
+
(this.wd = d),
|
|
35
|
+
(this.ad = m);
|
|
36
36
|
}
|
|
37
37
|
qt() {
|
|
38
38
|
return {
|
|
39
|
-
s: "6.
|
|
40
|
-
l: this.
|
|
41
|
-
e: this.
|
|
42
|
-
a: this.
|
|
43
|
-
p: this.
|
|
44
|
-
m: this.
|
|
45
|
-
v: this.
|
|
46
|
-
c: this.
|
|
47
|
-
f: this.
|
|
48
|
-
grl: this.
|
|
39
|
+
s: "6.12.0",
|
|
40
|
+
l: this.ed,
|
|
41
|
+
e: this.vd,
|
|
42
|
+
a: this.md,
|
|
43
|
+
p: this.gd,
|
|
44
|
+
m: this.fd,
|
|
45
|
+
v: this.ld,
|
|
46
|
+
c: this.ud,
|
|
47
|
+
f: this.Rr,
|
|
48
|
+
grl: this.nd,
|
|
49
49
|
b: this.banners,
|
|
50
50
|
d: this.dust,
|
|
51
|
-
rb: this.
|
|
52
|
-
mst: this.
|
|
53
|
-
ch: this.
|
|
51
|
+
rb: this.Cd,
|
|
52
|
+
mst: this.wd,
|
|
53
|
+
ch: this.ad,
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
static _u(t) {
|
|
57
57
|
let i = t.l;
|
|
58
58
|
return (
|
|
59
|
-
"6.
|
|
60
|
-
new
|
|
59
|
+
"6.12.0" !== t.s && (i = 0),
|
|
60
|
+
new vi(
|
|
61
61
|
i,
|
|
62
62
|
t.e,
|
|
63
63
|
t.a,
|
|
@@ -8,13 +8,13 @@ import v from "./common/event-logger.js";
|
|
|
8
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
|
-
import
|
|
11
|
+
import ve from "./models/braze-event.js";
|
|
12
12
|
import L from "./models/request-result.js";
|
|
13
|
-
import
|
|
13
|
+
import Dt from "./Push/utils/push-utils.js";
|
|
14
14
|
import { randomInclusive as a } from "./util/math.js";
|
|
15
15
|
import l from "./util/net.js";
|
|
16
16
|
import h from "./util/request-header-utils.js";
|
|
17
|
-
export default class
|
|
17
|
+
export default class Zt {
|
|
18
18
|
constructor(t, i, s, e, h, o, n, r, l, u) {
|
|
19
19
|
(this.eu = t),
|
|
20
20
|
(this.baseUrl = i),
|
|
@@ -29,7 +29,7 @@ export default class Kt {
|
|
|
29
29
|
(this.eu = t),
|
|
30
30
|
(this.baseUrl = i),
|
|
31
31
|
(this.nc = 0),
|
|
32
|
-
(this.
|
|
32
|
+
(this.fS = n.bS() || 0),
|
|
33
33
|
(this.lc = null),
|
|
34
34
|
(this.C = s),
|
|
35
35
|
(this.tu = e),
|
|
@@ -61,12 +61,12 @@ export default class Kt {
|
|
|
61
61
|
}
|
|
62
62
|
bc(t = !1, i = !0, e, o, n, r = !1, u = !1, c = "sdk") {
|
|
63
63
|
i && this.wc();
|
|
64
|
-
const d = this.j.
|
|
65
|
-
m = this.j.
|
|
64
|
+
const d = this.j.gS(),
|
|
65
|
+
m = this.j.IS();
|
|
66
66
|
let f = !1;
|
|
67
67
|
const g = (t, r, u = -1) => {
|
|
68
68
|
const c = new Date().valueOf();
|
|
69
|
-
h.nt(this.j, h.it.
|
|
69
|
+
h.nt(this.j, h.it.Cn, c),
|
|
70
70
|
-1 !== u && r.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
|
|
71
71
|
let d = !1;
|
|
72
72
|
l.ot({
|
|
@@ -79,15 +79,15 @@ export default class Kt {
|
|
|
79
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.sd(i),
|
|
83
83
|
(null != t.respond_with &&
|
|
84
84
|
t.respond_with.user_id != this.Ss.getUserId()) ||
|
|
85
|
-
(null != t.device && this.j.Pt(s.It.
|
|
85
|
+
(null != t.device && this.j.Pt(s.It.Aa, t.device),
|
|
86
86
|
null != t.sdk_metadata &&
|
|
87
|
-
(this.j.Pt(s.It.
|
|
88
|
-
this.j.Pt(s.It.
|
|
87
|
+
(this.j.Pt(s.It.Ka, t.sdk_metadata),
|
|
88
|
+
this.j.Pt(s.It.Pa, this.C.$t())),
|
|
89
89
|
this.hc(i),
|
|
90
|
-
h.
|
|
90
|
+
h.ql(this.j, h.it.Cn, 1),
|
|
91
91
|
"function" == typeof e && e()))
|
|
92
92
|
: i.auth_error && (d = !0);
|
|
93
93
|
},
|
|
@@ -96,12 +96,12 @@ export default class Kt {
|
|
|
96
96
|
null != t.respond_with &&
|
|
97
97
|
t.respond_with.triggers &&
|
|
98
98
|
(this.nc = Math.max(this.nc - 1, 0)),
|
|
99
|
-
this.B.
|
|
99
|
+
this.B.Ua(t.events, t.attributes),
|
|
100
100
|
"function" == typeof o && o();
|
|
101
101
|
},
|
|
102
102
|
ft: (t, s) => {
|
|
103
103
|
"function" == typeof n && n(!d);
|
|
104
|
-
const e = this.B
|
|
104
|
+
const e = this.B.Bl(s);
|
|
105
105
|
let o = 0;
|
|
106
106
|
if (e)
|
|
107
107
|
switch (e.type) {
|
|
@@ -113,7 +113,7 @@ export default class Kt {
|
|
|
113
113
|
}
|
|
114
114
|
if (i && !f) {
|
|
115
115
|
if (d) {
|
|
116
|
-
h.
|
|
116
|
+
h.Sl(this.j, h.it.Cn);
|
|
117
117
|
const t = this.h.vt(),
|
|
118
118
|
i = this.h.gt(),
|
|
119
119
|
s = this.h.bt();
|
|
@@ -121,7 +121,7 @@ export default class Kt {
|
|
|
121
121
|
(null == e || e < t) && (e = t);
|
|
122
122
|
const n = Math.min(s, a(t, e * i)) + o;
|
|
123
123
|
this.kc(n);
|
|
124
|
-
} else this.kc(Math.max(1e3 * this.
|
|
124
|
+
} else this.kc(Math.max(1e3 * this.fS, o));
|
|
125
125
|
f = !0;
|
|
126
126
|
}
|
|
127
127
|
},
|
|
@@ -133,9 +133,9 @@ export default class Kt {
|
|
|
133
133
|
return void b.info(
|
|
134
134
|
"Declining to flush data due to 50 consecutive authentication failures",
|
|
135
135
|
);
|
|
136
|
-
if (i && !this.B.
|
|
136
|
+
if (i && !this.B.Za(d, m, v))
|
|
137
137
|
return this.kc(), void ("function" == typeof n && n(!0));
|
|
138
|
-
const w = this.B.
|
|
138
|
+
const w = this.B.dl(v, d, m, u, c);
|
|
139
139
|
v && this.nc++;
|
|
140
140
|
let k = !1;
|
|
141
141
|
if (w)
|
|
@@ -143,7 +143,7 @@ export default class Kt {
|
|
|
143
143
|
this.B.et(
|
|
144
144
|
t.requestData,
|
|
145
145
|
(i) => g(t.requestData, t.headers, i),
|
|
146
|
-
h.it.
|
|
146
|
+
h.it.Cn,
|
|
147
147
|
o,
|
|
148
148
|
),
|
|
149
149
|
(k = !0);
|
|
@@ -157,7 +157,7 @@ export default class Kt {
|
|
|
157
157
|
yc() {
|
|
158
158
|
return this.nc > 0;
|
|
159
159
|
}
|
|
160
|
-
kc(t = 1e3 * this.
|
|
160
|
+
kc(t = 1e3 * this.fS) {
|
|
161
161
|
this.mc ||
|
|
162
162
|
(this.wc(),
|
|
163
163
|
(this.cc = window.setTimeout(() => {
|
|
@@ -193,18 +193,18 @@ export default class Kt {
|
|
|
193
193
|
}
|
|
194
194
|
openSession() {
|
|
195
195
|
const t = this.C.$t() !== this.C.el();
|
|
196
|
-
t && (this.j.
|
|
196
|
+
t && (this.j.hS(s.Ou.Wh), this.j.hS(s.Ou.Cu)),
|
|
197
197
|
this.bc(!1, void 0, () => {
|
|
198
|
-
t && (this.j.Vt(s.It.
|
|
198
|
+
t && (this.j.Vt(s.It.Zr), this.j.Vt(s.It.At));
|
|
199
199
|
}),
|
|
200
|
-
this.
|
|
200
|
+
this.Ea(),
|
|
201
201
|
t &&
|
|
202
202
|
import("./Push/push-manager-factory.js").then((t) => {
|
|
203
203
|
if (this.mc) return;
|
|
204
204
|
const i = t.default.ra();
|
|
205
205
|
if (
|
|
206
206
|
null != i &&
|
|
207
|
-
(
|
|
207
|
+
(Dt.isPushPermissionGranted() || Dt.isPushBlocked())
|
|
208
208
|
) {
|
|
209
209
|
const t = () => {
|
|
210
210
|
i.lu()
|
|
@@ -226,13 +226,13 @@ export default class Kt {
|
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
jc() {
|
|
229
|
-
this.j.Vt(s.It.
|
|
229
|
+
this.j.Vt(s.It.Vr), this.j.Vt(s.It.bi), this.j.Vt(s.It.la);
|
|
230
230
|
}
|
|
231
231
|
Sc() {
|
|
232
|
-
this.j.Vt(s.It.
|
|
233
|
-
this.j.Vt(s.It.
|
|
234
|
-
this.j.Vt(s.It.
|
|
235
|
-
this.j.Vt(s.It.
|
|
232
|
+
this.j.Vt(s.It.wl),
|
|
233
|
+
this.j.Vt(s.It.lS),
|
|
234
|
+
this.j.Vt(s.It.zl),
|
|
235
|
+
this.j.Vt(s.It.Xl);
|
|
236
236
|
}
|
|
237
237
|
changeUser(t, i, e) {
|
|
238
238
|
const h = this.Ss.getUserId();
|
|
@@ -245,9 +245,9 @@ export default class Kt {
|
|
|
245
245
|
e ? this.Gh.setSdkAuthenticationSignature(e) : this.Gh.jh();
|
|
246
246
|
for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
|
|
247
247
|
this.B.fo(),
|
|
248
|
-
null != h && this.j.Vt(s.It.
|
|
249
|
-
this.j.Vt(s.It.
|
|
250
|
-
this.j.Vt(s.It.
|
|
248
|
+
null != h && this.j.Vt(s.It.rS),
|
|
249
|
+
this.j.Vt(s.It.Aa),
|
|
250
|
+
this.j.Vt(s.It.uS),
|
|
251
251
|
this.Sc(),
|
|
252
252
|
this.openSession(),
|
|
253
253
|
b.info('Changed user to "' + t + '".');
|
|
@@ -283,7 +283,7 @@ export default class Kt {
|
|
|
283
283
|
h = { a: t, l: i },
|
|
284
284
|
o = v.Dt(e, h);
|
|
285
285
|
return (
|
|
286
|
-
o && (b.info(`Logged alias ${t} with label ${i}`), this.j.Pt(s.It.
|
|
286
|
+
o && (b.info(`Logged alias ${t} with label ${i}`), this.j.Pt(s.It.uS, h)),
|
|
287
287
|
o
|
|
288
288
|
);
|
|
289
289
|
}
|
|
@@ -314,14 +314,14 @@ export default class Kt {
|
|
|
314
314
|
}
|
|
315
315
|
Fr(t, i) {
|
|
316
316
|
const s = this.C.el();
|
|
317
|
-
return new
|
|
317
|
+
return new ve(this.Ss.getUserId(), p.$c, t, s, { cid: i });
|
|
318
318
|
}
|
|
319
319
|
qc(t, i) {
|
|
320
320
|
return new et(t, i);
|
|
321
321
|
}
|
|
322
|
-
|
|
322
|
+
Ea() {
|
|
323
323
|
const t = et._s.Xs;
|
|
324
|
-
this.qc(t, b).setItem(t.Ws.
|
|
324
|
+
this.qc(t, b).setItem(t.Ws.Cn, 1, {
|
|
325
325
|
baseUrl: this.baseUrl,
|
|
326
326
|
data: { api_key: this.eu, device_id: this.tu.ve().id },
|
|
327
327
|
userId: this.Ss.getUserId(),
|
|
@@ -330,13 +330,13 @@ export default class Kt {
|
|
|
330
330
|
}
|
|
331
331
|
Dr(t) {
|
|
332
332
|
for (const i of t)
|
|
333
|
-
if (i.api_key === this.eu) this.B.
|
|
333
|
+
if (i.api_key === this.eu) this.B.Ua(i.events, i.attributes);
|
|
334
334
|
else {
|
|
335
335
|
const t = et._s.Xs;
|
|
336
336
|
new et(t, b).setItem(t.Ws.Br, V.de(), i);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
|
|
339
|
+
ya(t, i, s) {
|
|
340
340
|
if (this.h.zu(t))
|
|
341
341
|
return (
|
|
342
342
|
b.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new L()
|
|
@@ -349,7 +349,7 @@ export default class Kt {
|
|
|
349
349
|
v.Dt(e, h)
|
|
350
350
|
);
|
|
351
351
|
}
|
|
352
|
-
|
|
352
|
+
va(t, i) {
|
|
353
353
|
const s = { group_id: t, status: i };
|
|
354
354
|
return v.Dt(p.Tc, s);
|
|
355
355
|
}
|
|
@@ -7,61 +7,61 @@ import {
|
|
|
7
7
|
} from "../../util/date-utils.js";
|
|
8
8
|
export default class hr {
|
|
9
9
|
constructor(t, s, e, i) {
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
10
|
+
(this.zE = t),
|
|
11
|
+
(this.kE = s),
|
|
12
12
|
(this.comparator = e),
|
|
13
|
-
(this.
|
|
14
|
-
(this.
|
|
15
|
-
(this.
|
|
13
|
+
(this.vE = i),
|
|
14
|
+
(this.zE = t),
|
|
15
|
+
(this.kE = s),
|
|
16
16
|
(this.comparator = e),
|
|
17
|
-
(this.
|
|
18
|
-
this.
|
|
19
|
-
this.comparator !== hr.
|
|
20
|
-
this.comparator !== hr.
|
|
21
|
-
this.comparator !== hr.
|
|
22
|
-
this.comparator !== hr.
|
|
23
|
-
(this.
|
|
17
|
+
(this.vE = i),
|
|
18
|
+
this.kE === hr.VE.JE &&
|
|
19
|
+
this.comparator !== hr.ZE.qE &&
|
|
20
|
+
this.comparator !== hr.ZE.$E &&
|
|
21
|
+
this.comparator !== hr.ZE.tT &&
|
|
22
|
+
this.comparator !== hr.ZE.sT &&
|
|
23
|
+
(this.vE = Y(this.vE));
|
|
24
24
|
}
|
|
25
25
|
zc(t) {
|
|
26
26
|
let s = null;
|
|
27
|
-
switch ((null != t && (s = t[this.
|
|
28
|
-
case hr.
|
|
29
|
-
return null != s && s.valueOf() === this.
|
|
30
|
-
case hr.
|
|
31
|
-
return null == s || s.valueOf() !== this.
|
|
32
|
-
case hr.
|
|
33
|
-
return null != s && typeof s == typeof this.
|
|
34
|
-
case hr.
|
|
35
|
-
return this.
|
|
36
|
-
? null != s && Nt(s) && hs(s) <= this.
|
|
37
|
-
: null != s && typeof s == typeof this.
|
|
38
|
-
case hr.
|
|
39
|
-
return null != s && typeof s == typeof this.
|
|
40
|
-
case hr.
|
|
41
|
-
return this.
|
|
42
|
-
? null != s && Nt(s) && hs(s) >= this.
|
|
43
|
-
: null != s && typeof s == typeof this.
|
|
44
|
-
case hr.hT
|
|
27
|
+
switch ((null != t && (s = t[this.zE]), this.comparator)) {
|
|
28
|
+
case hr.ZE.eT:
|
|
29
|
+
return null != s && s.valueOf() === this.vE.valueOf();
|
|
30
|
+
case hr.ZE.iT:
|
|
31
|
+
return null == s || s.valueOf() !== this.vE.valueOf();
|
|
32
|
+
case hr.ZE.lT:
|
|
33
|
+
return null != s && typeof s == typeof this.vE && s > this.vE;
|
|
34
|
+
case hr.ZE.qE:
|
|
35
|
+
return this.kE === hr.VE.JE
|
|
36
|
+
? null != s && Nt(s) && hs(s) <= this.vE.valueOf()
|
|
37
|
+
: null != s && typeof s == typeof this.vE && s >= this.vE;
|
|
38
|
+
case hr.ZE.rT:
|
|
39
|
+
return null != s && typeof s == typeof this.vE && s < this.vE;
|
|
40
|
+
case hr.ZE.$E:
|
|
41
|
+
return this.kE === hr.VE.JE
|
|
42
|
+
? null != s && Nt(s) && hs(s) >= this.vE.valueOf()
|
|
43
|
+
: null != s && typeof s == typeof this.vE && s <= this.vE;
|
|
44
|
+
case hr.ZE.hT:
|
|
45
45
|
return (
|
|
46
46
|
null != s &&
|
|
47
47
|
"string" == typeof s &&
|
|
48
|
-
typeof s == typeof this.
|
|
49
|
-
null != s.match(this.
|
|
48
|
+
typeof s == typeof this.vE &&
|
|
49
|
+
null != s.match(this.vE)
|
|
50
50
|
);
|
|
51
|
-
case hr.
|
|
51
|
+
case hr.ZE.nT:
|
|
52
52
|
return null != s;
|
|
53
|
-
case hr.
|
|
53
|
+
case hr.ZE.uT:
|
|
54
54
|
return null == s;
|
|
55
|
-
case hr.
|
|
56
|
-
return null != s && Nt(s) && us(s) < this.
|
|
57
|
-
case hr.
|
|
58
|
-
return null != s && Nt(s) && us(s) > this.
|
|
59
|
-
case hr.
|
|
55
|
+
case hr.ZE.tT:
|
|
56
|
+
return null != s && Nt(s) && us(s) < this.vE;
|
|
57
|
+
case hr.ZE.sT:
|
|
58
|
+
return null != s && Nt(s) && us(s) > this.vE;
|
|
59
|
+
case hr.ZE.oT:
|
|
60
60
|
return (
|
|
61
61
|
null == s ||
|
|
62
|
-
typeof s != typeof this.
|
|
62
|
+
typeof s != typeof this.vE ||
|
|
63
63
|
"string" != typeof s ||
|
|
64
|
-
null == s.match(this.
|
|
64
|
+
null == s.match(this.vE)
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
return !1;
|
|
@@ -75,28 +75,28 @@ export default class hr {
|
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
qt() {
|
|
78
|
-
let t = this.
|
|
78
|
+
let t = this.vE;
|
|
79
79
|
return (
|
|
80
|
-
Nt(this.
|
|
81
|
-
{ k: this.
|
|
80
|
+
Nt(this.vE) && (t = X(t.valueOf())),
|
|
81
|
+
{ k: this.zE, t: this.kE, c: this.comparator, v: t }
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
static _u(t) {
|
|
85
85
|
return new hr(t.k, t.t, t.c, t.v);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
(hr.
|
|
89
|
-
(hr.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
88
|
+
(hr.VE = { ET: "boolean", aT: "number", TT: "string", JE: "date" }),
|
|
89
|
+
(hr.ZE = {
|
|
90
|
+
eT: 1,
|
|
91
|
+
iT: 2,
|
|
92
|
+
lT: 3,
|
|
93
|
+
qE: 4,
|
|
94
|
+
rT: 5,
|
|
95
|
+
$E: 6,
|
|
96
|
+
hT: 10,
|
|
97
|
+
nT: 11,
|
|
98
|
+
uT: 12,
|
|
99
|
+
tT: 15,
|
|
100
|
+
sT: 16,
|
|
101
|
+
oT: 17,
|
|
102
102
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class
|
|
1
|
+
import ji from "./trigger-condition.js";
|
|
2
|
+
export default class ki {
|
|
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 = ji.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 bi {
|
|
|
17
17
|
return i && r;
|
|
18
18
|
}
|
|
19
19
|
static fromJson(t) {
|
|
20
|
-
return new
|
|
20
|
+
return new ki(t ? t.id : null, t ? t.buttons : null);
|
|
21
21
|
}
|
|
22
22
|
qt() {
|
|
23
23
|
return this.if;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ji from "./trigger-condition.js";
|
|
2
2
|
export default class wr {
|
|
3
3
|
constructor(t) {
|
|
4
4
|
(this.if = t), (this.if = t);
|
|
5
5
|
}
|
|
6
6
|
zc(t) {
|
|
7
|
-
return null == this.if ||
|
|
7
|
+
return null == this.if || ji.sf(t[0], this.if);
|
|
8
8
|
}
|
|
9
9
|
static fromJson(t) {
|
|
10
10
|
return new wr(t ? t.campaign_id : null);
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import es from "./custom-event-data.js";
|
|
2
2
|
import ns from "./custom-event-property-data.js";
|
|
3
3
|
import ls from "./filter-set.js";
|
|
4
|
-
import
|
|
4
|
+
import ki from "./in-app-message-click-data.js";
|
|
5
5
|
import os from "./purchase-data.js";
|
|
6
6
|
import fs from "./purchase-property-data.js";
|
|
7
7
|
import wr from "./push-click-data.js";
|
|
8
8
|
import ot from "./trigger-events.js";
|
|
9
9
|
import { logger as b } from "../../../shared-lib/index.js";
|
|
10
|
-
import { getErrorMessage as
|
|
11
|
-
export default class
|
|
10
|
+
import { getErrorMessage as ci } from "../../util/error-utils.js";
|
|
11
|
+
export default class ji {
|
|
12
12
|
constructor(e, t) {
|
|
13
13
|
(this.type = e), (this.data = t), (this.type = e), (this.data = t);
|
|
14
14
|
}
|
|
15
15
|
_c(e, t) {
|
|
16
|
-
return
|
|
16
|
+
return ji.Ec[this.type] === e && (null == this.data || this.data.zc(t));
|
|
17
17
|
}
|
|
18
18
|
static sf(e, t) {
|
|
19
19
|
let r = null;
|
|
20
20
|
try {
|
|
21
21
|
r = window.atob(e);
|
|
22
22
|
} catch (t) {
|
|
23
|
-
return b.info("Failed to unencode analytics id " + e + ": " +
|
|
23
|
+
return b.info("Failed to unencode analytics id " + e + ": " + ci(t)), !1;
|
|
24
24
|
}
|
|
25
25
|
return t === r.split("_")[0];
|
|
26
26
|
}
|
|
@@ -28,28 +28,28 @@ export default class pi {
|
|
|
28
28
|
const t = e.type;
|
|
29
29
|
let r = null;
|
|
30
30
|
switch (t) {
|
|
31
|
-
case
|
|
32
|
-
case
|
|
31
|
+
case ji.Yo.OPEN:
|
|
32
|
+
case ji.Yo.Os:
|
|
33
33
|
break;
|
|
34
|
-
case
|
|
34
|
+
case ji.Yo.qr:
|
|
35
35
|
r = os.fromJson(e.data);
|
|
36
36
|
break;
|
|
37
|
-
case
|
|
37
|
+
case ji.Yo.Pc:
|
|
38
38
|
r = fs.fromJson(e.data);
|
|
39
39
|
break;
|
|
40
|
-
case
|
|
40
|
+
case ji.Yo.Sr:
|
|
41
41
|
r = wr.fromJson(e.data);
|
|
42
42
|
break;
|
|
43
|
-
case
|
|
43
|
+
case ji.Yo.he:
|
|
44
44
|
r = es.fromJson(e.data);
|
|
45
45
|
break;
|
|
46
|
-
case
|
|
46
|
+
case ji.Yo.Rc:
|
|
47
47
|
r = ns.fromJson(e.data);
|
|
48
48
|
break;
|
|
49
|
-
case
|
|
50
|
-
r =
|
|
49
|
+
case ji.Yo.rm:
|
|
50
|
+
r = ki.fromJson(e.data);
|
|
51
51
|
}
|
|
52
|
-
return new
|
|
52
|
+
return new ji(t, r);
|
|
53
53
|
}
|
|
54
54
|
qt() {
|
|
55
55
|
return { t: this.type, d: this.data ? this.data.qt() : null };
|
|
@@ -58,31 +58,31 @@ export default class pi {
|
|
|
58
58
|
let t,
|
|
59
59
|
r = null;
|
|
60
60
|
switch (e.t) {
|
|
61
|
-
case
|
|
62
|
-
case
|
|
61
|
+
case ji.Yo.OPEN:
|
|
62
|
+
case ji.Yo.Os:
|
|
63
63
|
break;
|
|
64
|
-
case
|
|
64
|
+
case ji.Yo.qr:
|
|
65
65
|
r = new os(e.d);
|
|
66
66
|
break;
|
|
67
|
-
case
|
|
67
|
+
case ji.Yo.Pc:
|
|
68
68
|
(t = e.d || {}), (r = new fs(t.id, ls._u(t.pf || [])));
|
|
69
69
|
break;
|
|
70
|
-
case
|
|
70
|
+
case ji.Yo.Sr:
|
|
71
71
|
r = new wr(e.d);
|
|
72
72
|
break;
|
|
73
|
-
case
|
|
73
|
+
case ji.Yo.he:
|
|
74
74
|
r = new es(e.d);
|
|
75
75
|
break;
|
|
76
|
-
case
|
|
76
|
+
case ji.Yo.Rc:
|
|
77
77
|
(t = e.d || {}), (r = new ns(t.e, ls._u(t.pf || [])));
|
|
78
78
|
break;
|
|
79
|
-
case
|
|
80
|
-
r = new
|
|
79
|
+
case ji.Yo.rm:
|
|
80
|
+
r = new ki(e.d);
|
|
81
81
|
}
|
|
82
|
-
return new
|
|
82
|
+
return new ji(e.t, r);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
(
|
|
85
|
+
(ji.Yo = {
|
|
86
86
|
OPEN: "open",
|
|
87
87
|
qr: "purchase",
|
|
88
88
|
Pc: "purchase_property",
|
|
@@ -92,12 +92,12 @@ export default class pi {
|
|
|
92
92
|
rm: "iam_click",
|
|
93
93
|
Os: "test",
|
|
94
94
|
}),
|
|
95
|
-
(
|
|
96
|
-
(
|
|
97
|
-
(
|
|
98
|
-
(
|
|
99
|
-
(
|
|
100
|
-
(
|
|
101
|
-
(
|
|
102
|
-
(
|
|
103
|
-
(
|
|
95
|
+
(ji.Ec = {}),
|
|
96
|
+
(ji.Ec[ji.Yo.OPEN] = ot.OPEN),
|
|
97
|
+
(ji.Ec[ji.Yo.qr] = ot.qr),
|
|
98
|
+
(ji.Ec[ji.Yo.Pc] = ot.qr),
|
|
99
|
+
(ji.Ec[ji.Yo.Sr] = ot.Sr),
|
|
100
|
+
(ji.Ec[ji.Yo.he] = ot.he),
|
|
101
|
+
(ji.Ec[ji.Yo.Rc] = ot.he),
|
|
102
|
+
(ji.Ec[ji.Yo.rm] = ot.rm),
|
|
103
|
+
(ji.Ec[ji.Yo.Os] = ot.Os);
|