@braze/web-sdk 4.10.0 → 5.0.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 +19 -106
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +1 -1
- package/shared-lib/indexed-db-adapter.js +12 -12
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +7 -8
- package/src/Card/models/captioned-image.js +19 -19
- package/src/Card/models/card.js +95 -94
- package/src/Card/models/classic-card.js +19 -19
- package/src/Card/models/control-card.js +9 -9
- package/src/Card/models/image-only.js +21 -22
- package/src/Card/models/index.js +0 -1
- package/src/Card/util/card-factory.js +39 -39
- package/src/ContentCards/content-cards-provider.js +114 -114
- package/src/ContentCards/get-cached-content-cards.js +1 -1
- package/src/ContentCards/index.js +0 -1
- package/src/ContentCards/request-content-cards-refresh.js +1 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
- package/src/ContentCards/ui/hide-content-cards.js +2 -2
- package/src/ContentCards/ui/show-content-cards.js +14 -14
- package/src/Core/add-sdk-metadata.js +2 -2
- package/src/Core/change-user.js +2 -2
- package/src/Core/disable-sdk.js +4 -4
- package/src/Core/enable-sdk.js +4 -4
- package/src/Core/handle-braze-action.js +14 -14
- package/src/Core/is-disabled.js +2 -2
- package/src/Core/open-session.js +5 -5
- package/src/Core/set-sdk-authentication-signature.js +2 -2
- package/src/Core/wipe-data.js +4 -4
- package/src/FeatureFlags/feature-flag-factory.js +10 -10
- package/src/FeatureFlags/feature-flag.js +7 -7
- package/src/FeatureFlags/feature-flags-provider.js +50 -50
- package/src/FeatureFlags/get-all-feature-flags.js +1 -1
- package/src/FeatureFlags/get-feature-flag.js +3 -5
- package/src/Feed/feed-provider-factory.js +8 -8
- package/src/Feed/feed-provider.js +15 -15
- package/src/Feed/get-cached-feed.js +2 -2
- package/src/Feed/request-feed-refresh.js +2 -2
- package/src/Feed/subscribe-to-feed-updates.js +2 -2
- package/src/Feed/ui/hide-feed.js +2 -2
- package/src/Feed/ui/show-feed.js +13 -13
- package/src/InAppMessage/display/html-message-to-html.js +11 -12
- package/src/InAppMessage/display/in-app-message-to-html.js +15 -15
- package/src/InAppMessage/display/modal-utils.js +8 -8
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- package/src/InAppMessage/in-app-message-manager.js +38 -38
- package/src/InAppMessage/models/full-screen-message.js +31 -31
- package/src/InAppMessage/models/html-message.js +16 -16
- package/src/InAppMessage/models/in-app-message-button.js +5 -5
- package/src/InAppMessage/models/in-app-message.js +46 -46
- package/src/InAppMessage/models/modal-message.js +30 -30
- package/src/InAppMessage/models/slide-up-message.js +26 -26
- package/src/InAppMessage/ui/show-in-app-message.js +9 -9
- 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.js +31 -31
- package/src/Push/utils/push-utils.js +9 -9
- package/src/User/user-manager.js +8 -8
- package/src/User/user.js +29 -29
- package/src/common/base-feed.js +15 -14
- package/src/common/base-provider.js +1 -1
- package/src/common/event-logger.js +2 -2
- package/src/common/feed-display.js +32 -32
- package/src/l10n/l10n-manager-factory.js +9 -9
- package/src/managers/auth-manager.js +6 -6
- package/src/managers/braze-instance.js +96 -106
- package/src/managers/device-manager.js +17 -17
- package/src/managers/network-manager.js +27 -27
- package/src/managers/server-config-manager.js +13 -13
- package/src/managers/session-manager.js +8 -8
- package/src/managers/storage-manager-factory.js +7 -7
- package/src/managers/storage-manager.js +104 -104
- package/src/managers/subscription-manager.js +2 -2
- package/src/models/braze-event.js +5 -5
- package/src/models/device.js +1 -1
- package/src/models/identifier.js +1 -1
- package/src/models/push-token.js +1 -1
- package/src/models/server-config.js +6 -6
- package/src/request-controller.js +52 -52
- package/src/triggers/models/custom-event-data.js +1 -1
- package/src/triggers/models/custom-event-property-data.js +6 -6
- package/src/triggers/models/filter-set.js +8 -8
- package/src/triggers/models/filter.js +25 -25
- package/src/triggers/models/in-app-message-click-data.js +1 -1
- package/src/triggers/models/purchase-data.js +1 -1
- package/src/triggers/models/purchase-property-data.js +4 -4
- package/src/triggers/models/push-click-data.js +3 -3
- package/src/triggers/models/trigger-condition.js +14 -14
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +11 -11
- package/src/triggers/triggers-provider.js +38 -38
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +5 -5
- package/src/ui/js/iam-css.js +4 -4
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/base-device-parser.js +1 -1
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +14 -14
- package/src/util/client-hints-parser.js +2 -2
- package/src/util/component-utils.js +2 -2
- package/src/util/device-constants.js +4 -5
- package/src/util/dom-utils.js +5 -5
- package/src/util/request-header-utils.js +4 -4
- package/src/util/user-agent-parser.js +10 -15
- package/src/Card/models/banner.js +0 -31
- package/src/ContentCards/log-content-cards-displayed.js +0 -5
package/src/models/identifier.js
CHANGED
package/src/models/push-token.js
CHANGED
|
@@ -16,7 +16,7 @@ export default class Kt {
|
|
|
16
16
|
(this.bl = e),
|
|
17
17
|
(this.al = l),
|
|
18
18
|
(this.ml = r),
|
|
19
|
-
(this.
|
|
19
|
+
(this.gi = a),
|
|
20
20
|
(this.ol = t),
|
|
21
21
|
(this.cl = i),
|
|
22
22
|
(this.gl = s),
|
|
@@ -24,11 +24,11 @@ export default class Kt {
|
|
|
24
24
|
(this.bl = e),
|
|
25
25
|
(this.al = l),
|
|
26
26
|
(this.ml = r),
|
|
27
|
-
(this.
|
|
27
|
+
(this.gi = a);
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
tt() {
|
|
30
30
|
return {
|
|
31
|
-
s: "
|
|
31
|
+
s: "5.0.0",
|
|
32
32
|
l: this.ol,
|
|
33
33
|
e: this.cl,
|
|
34
34
|
a: this.gl,
|
|
@@ -36,13 +36,13 @@ export default class Kt {
|
|
|
36
36
|
m: this.bl,
|
|
37
37
|
v: this.al,
|
|
38
38
|
c: this.ml,
|
|
39
|
-
f: this.
|
|
39
|
+
f: this.gi,
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
static Yn(t) {
|
|
43
43
|
let i = t.l;
|
|
44
44
|
return (
|
|
45
|
-
"
|
|
45
|
+
"5.0.0" !== t.s && (i = 0), new Kt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f)
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import C from "./util/net.js";
|
|
2
|
-
import
|
|
2
|
+
import ue from "./models/braze-event.js";
|
|
3
3
|
import s from "./common/event-logger.js";
|
|
4
4
|
import { randomInclusive as D } from "./util/math.js";
|
|
5
5
|
import t from "./models/request-result.js";
|
|
6
6
|
import r from "../shared-lib/braze-shared-lib.js";
|
|
7
7
|
import { STORAGE_KEYS as i } from "./managers/storage-manager.js";
|
|
8
8
|
import E from "./managers/subscription-manager.js";
|
|
9
|
-
import
|
|
9
|
+
import vt from "./Push/utils/push-utils.js";
|
|
10
10
|
import T from "./util/request-header-utils.js";
|
|
11
11
|
export default class Lt {
|
|
12
12
|
constructor(t, i, s, e, h, o, n, r, u, l) {
|
|
@@ -14,24 +14,24 @@ export default class Lt {
|
|
|
14
14
|
(this.baseUrl = i),
|
|
15
15
|
(this._e = s),
|
|
16
16
|
(this.fn = e),
|
|
17
|
-
(this.
|
|
18
|
-
(this.
|
|
17
|
+
(this.wt = h),
|
|
18
|
+
(this.yt = o),
|
|
19
19
|
(this.u = n),
|
|
20
20
|
(this.fu = r),
|
|
21
|
-
(this.
|
|
22
|
-
(this
|
|
21
|
+
(this.Mo = u),
|
|
22
|
+
(this.$t = l),
|
|
23
23
|
(this.cn = t),
|
|
24
24
|
(this.baseUrl = i),
|
|
25
25
|
(this.gu = 0),
|
|
26
|
-
(this.
|
|
26
|
+
(this.RE = n.AE() || 0),
|
|
27
27
|
(this.vu = null),
|
|
28
28
|
(this._e = s),
|
|
29
29
|
(this.fn = e),
|
|
30
|
-
(this.
|
|
31
|
-
(this.
|
|
30
|
+
(this.wt = h),
|
|
31
|
+
(this.yt = o),
|
|
32
32
|
(this.u = n),
|
|
33
|
-
(this.
|
|
34
|
-
(this
|
|
33
|
+
(this.Mo = u),
|
|
34
|
+
(this.$t = l),
|
|
35
35
|
(this.fu = r),
|
|
36
36
|
(this.wu = new E()),
|
|
37
37
|
(this.ku = null),
|
|
@@ -39,12 +39,12 @@ export default class Lt {
|
|
|
39
39
|
(this.ju = !1);
|
|
40
40
|
}
|
|
41
41
|
Su(t, i) {
|
|
42
|
-
return !t && !i && this.
|
|
42
|
+
return !t && !i && this.Mo.Jh() >= this.yu;
|
|
43
43
|
}
|
|
44
44
|
$u(t) {
|
|
45
45
|
let i = this._e.El();
|
|
46
46
|
if (t.length > 0) {
|
|
47
|
-
const s = this.
|
|
47
|
+
const s = this.wt.getUserId();
|
|
48
48
|
for (const e of t) {
|
|
49
49
|
const t = (!e.userId && !s) || e.userId === s;
|
|
50
50
|
e.type === r.q.Wl && t && (i = !0);
|
|
@@ -54,8 +54,8 @@ export default class Lt {
|
|
|
54
54
|
}
|
|
55
55
|
qu(t = !1, s = !1, e = !0, h, o, n, u = !1, l = !1) {
|
|
56
56
|
e && this.Au();
|
|
57
|
-
const a = this.u.
|
|
58
|
-
c = this.u.
|
|
57
|
+
const a = this.u.uE(),
|
|
58
|
+
c = this.u.hE();
|
|
59
59
|
let d = !1;
|
|
60
60
|
const f = (t, s) => {
|
|
61
61
|
let r = !1;
|
|
@@ -68,12 +68,12 @@ export default class Lt {
|
|
|
68
68
|
null != t.respond_with &&
|
|
69
69
|
t.respond_with.triggers &&
|
|
70
70
|
(this.gu = Math.max(this.gu - 1, 0)),
|
|
71
|
-
this.
|
|
72
|
-
? (this.
|
|
73
|
-
this.
|
|
71
|
+
this.$t.Zs(t, e, s)
|
|
72
|
+
? (this.Mo.ti(),
|
|
73
|
+
this.yt.ul(e),
|
|
74
74
|
(null != t.respond_with &&
|
|
75
|
-
t.respond_with.user_id != this.
|
|
76
|
-
(null != t.device && this.u.D(i.k.
|
|
75
|
+
t.respond_with.user_id != this.wt.getUserId()) ||
|
|
76
|
+
(null != t.device && this.u.D(i.k.Ca, t.device),
|
|
77
77
|
null != t.sdk_metadata &&
|
|
78
78
|
(this.u.D(i.k.Kh, t.sdk_metadata),
|
|
79
79
|
this.u.D(i.k.Wh, this._e.Yh())),
|
|
@@ -86,7 +86,7 @@ export default class Lt {
|
|
|
86
86
|
null != t.respond_with &&
|
|
87
87
|
t.respond_with.triggers &&
|
|
88
88
|
(this.gu = Math.max(this.gu - 1, 0)),
|
|
89
|
-
this.
|
|
89
|
+
this.$t.Qh(t.events, t.attributes),
|
|
90
90
|
"function" == typeof o && o();
|
|
91
91
|
},
|
|
92
92
|
ei: (t) => {
|
|
@@ -95,8 +95,8 @@ export default class Lt {
|
|
|
95
95
|
else {
|
|
96
96
|
T.hi(this.u, T.Os.Na);
|
|
97
97
|
let t = this.vu;
|
|
98
|
-
(null == t || t < 1e3 * this.
|
|
99
|
-
this.Cu(Math.min(3e5, D(1e3 * this.
|
|
98
|
+
(null == t || t < 1e3 * this.RE) && (t = 1e3 * this.RE),
|
|
99
|
+
this.Cu(Math.min(3e5, D(1e3 * this.RE, 3 * t)));
|
|
100
100
|
}
|
|
101
101
|
d = !0;
|
|
102
102
|
}
|
|
@@ -109,22 +109,22 @@ export default class Lt {
|
|
|
109
109
|
return void r.j.info(
|
|
110
110
|
"Declining to flush data due to 50 consecutive authentication failures",
|
|
111
111
|
);
|
|
112
|
-
if (e && !this.
|
|
112
|
+
if (e && !this.$t.Pa(a, c, t, g))
|
|
113
113
|
return this.Cu(), void ("function" == typeof n && n(!0));
|
|
114
|
-
const v = this
|
|
114
|
+
const v = this.$t.$a(t, g, a, c, l);
|
|
115
115
|
g && this.gu++;
|
|
116
116
|
let p = !1;
|
|
117
117
|
if (v)
|
|
118
118
|
for (const t of v)
|
|
119
|
-
this.
|
|
120
|
-
this.
|
|
119
|
+
this.$t.Qs(t.requestData, () => f(t.requestData, t.headers)), (p = !0);
|
|
120
|
+
this.Mo.wh() && e && !p
|
|
121
121
|
? this.Cu()
|
|
122
|
-
: m && (r.j.info("Invoking new session subscriptions"), this.wu.
|
|
122
|
+
: m && (r.j.info("Invoking new session subscriptions"), this.wu.Dt());
|
|
123
123
|
}
|
|
124
124
|
Du() {
|
|
125
125
|
return this.gu > 0;
|
|
126
126
|
}
|
|
127
|
-
Cu(t = 1e3 * this.
|
|
127
|
+
Cu(t = 1e3 * this.RE) {
|
|
128
128
|
this.ju ||
|
|
129
129
|
(this.Au(),
|
|
130
130
|
(this.ku = window.setTimeout(() => {
|
|
@@ -147,18 +147,18 @@ export default class Lt {
|
|
|
147
147
|
}
|
|
148
148
|
destroy() {
|
|
149
149
|
this.wu.removeAllSubscriptions(),
|
|
150
|
-
this.
|
|
150
|
+
this.Mo.Gh(),
|
|
151
151
|
this.Au(),
|
|
152
152
|
(this.ju = !0),
|
|
153
153
|
this.qu(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
|
|
154
154
|
(this.ku = null);
|
|
155
155
|
}
|
|
156
156
|
pr(t) {
|
|
157
|
-
return this.wu.
|
|
157
|
+
return this.wu.It(t);
|
|
158
158
|
}
|
|
159
159
|
openSession() {
|
|
160
160
|
const t = this._e.Yh() !== this._e.co();
|
|
161
|
-
t && (this.u.
|
|
161
|
+
t && (this.u._E(i.eu.Xo), this.u._E(i.eu.su)),
|
|
162
162
|
this.qu(void 0, !1, void 0, void 0, void 0),
|
|
163
163
|
this.pu(),
|
|
164
164
|
t &&
|
|
@@ -167,7 +167,7 @@ export default class Lt {
|
|
|
167
167
|
const s = t.default.m();
|
|
168
168
|
if (
|
|
169
169
|
null != s &&
|
|
170
|
-
(
|
|
170
|
+
(vt.isPushPermissionGranted() || vt.isPushBlocked())
|
|
171
171
|
) {
|
|
172
172
|
const t = () => {
|
|
173
173
|
s.Sn()
|
|
@@ -183,32 +183,32 @@ export default class Lt {
|
|
|
183
183
|
const s = this.u.v(i.k.Bn);
|
|
184
184
|
(null == s || s) && t();
|
|
185
185
|
},
|
|
186
|
-
o = r.
|
|
187
|
-
new r.
|
|
186
|
+
o = r.ts.Zt;
|
|
187
|
+
new r.es(o, r.j).hr(o.rs.cu, e, h);
|
|
188
188
|
}
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
191
|
Fu() {
|
|
192
|
-
this.u.ni(i.k.Ri), this.u.ni(i.k.
|
|
192
|
+
this.u.ni(i.k.Ri), this.u.ni(i.k.gs), this.u.ni(i.k.rn);
|
|
193
193
|
}
|
|
194
194
|
changeUser(t, s, e) {
|
|
195
|
-
const h = this.
|
|
195
|
+
const h = this.wt.getUserId();
|
|
196
196
|
if (h !== t) {
|
|
197
197
|
this._e.kl(),
|
|
198
198
|
this.Fu(),
|
|
199
199
|
null != h && this.qu(void 0, !1, void 0, void 0, void 0),
|
|
200
|
-
this.
|
|
201
|
-
e ? this.
|
|
200
|
+
this.wt.ru(t),
|
|
201
|
+
e ? this.Mo.setSdkAuthenticationSignature(e) : this.Mo.yh();
|
|
202
202
|
for (let t = 0; t < s.length; t++) s[t].changeUser(null == h);
|
|
203
203
|
null != h && this.u.ni(i.k.L),
|
|
204
|
-
this.u.ni(i.k.
|
|
204
|
+
this.u.ni(i.k.Ca),
|
|
205
205
|
this.openSession(),
|
|
206
206
|
r.j.info('Changed user to "' + t + '".');
|
|
207
207
|
} else {
|
|
208
208
|
let i = "Doing nothing.";
|
|
209
209
|
e &&
|
|
210
|
-
this.
|
|
211
|
-
(this.
|
|
210
|
+
this.Mo.jh() !== e &&
|
|
211
|
+
(this.Mo.setSdkAuthenticationSignature(e),
|
|
212
212
|
(i = "Updated SDK authentication signature")),
|
|
213
213
|
r.j.info(`Current user is already ${t}. ${i}`);
|
|
214
214
|
}
|
|
@@ -244,7 +244,7 @@ export default class Lt {
|
|
|
244
244
|
return o && r.j.info(`Logged alias ${t} with label ${i}`), o;
|
|
245
245
|
}
|
|
246
246
|
Gn(i, e, h) {
|
|
247
|
-
if (this.
|
|
247
|
+
if (this.yt.hu(e))
|
|
248
248
|
return (
|
|
249
249
|
r.j.info(`Custom Attribute "${e}" is blocklisted, ignoring.`), new t()
|
|
250
250
|
);
|
|
@@ -272,27 +272,27 @@ export default class Lt {
|
|
|
272
272
|
}
|
|
273
273
|
vr(t, i) {
|
|
274
274
|
const s = this._e.co();
|
|
275
|
-
return new
|
|
275
|
+
return new ue(this.wt.getUserId(), r.q.Mu, t, s, { cid: i });
|
|
276
276
|
}
|
|
277
277
|
pu() {
|
|
278
|
-
const t = r.
|
|
279
|
-
new r.
|
|
278
|
+
const t = r.ts.Zt;
|
|
279
|
+
new r.es(t, r.j).setItem(t.rs.Na, 1, {
|
|
280
280
|
baseUrl: this.baseUrl,
|
|
281
281
|
data: { api_key: this.cn, device_id: this.fn.ce().id },
|
|
282
|
-
userId: this.
|
|
283
|
-
sdkAuthEnabled: this.
|
|
282
|
+
userId: this.wt.getUserId(),
|
|
283
|
+
sdkAuthEnabled: this.Mo.wh(),
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
286
|
yr(t) {
|
|
287
287
|
for (const i of t)
|
|
288
|
-
if (i.api_key === this.cn) this.
|
|
288
|
+
if (i.api_key === this.cn) this.$t.Qh(i.events, i.attributes);
|
|
289
289
|
else {
|
|
290
|
-
const t = r.
|
|
291
|
-
new r.
|
|
290
|
+
const t = r.ts.Zt;
|
|
291
|
+
new r.es(t, r.j).setItem(t.rs.wr, r.Z.Y(), i);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
Zn(i, e, h) {
|
|
295
|
-
if (this.
|
|
295
|
+
if (this.yt.hu(i))
|
|
296
296
|
return (
|
|
297
297
|
r.j.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new t()
|
|
298
298
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class
|
|
1
|
+
import Wt from "./filter-set.js";
|
|
2
|
+
export default class Yt {
|
|
3
3
|
constructor(t, s) {
|
|
4
4
|
(this.yl = t), (this.Jl = s), (this.yl = t), (this.Jl = s);
|
|
5
5
|
}
|
|
@@ -10,12 +10,12 @@ export default class Zt {
|
|
|
10
10
|
return s === this.yl && this.Jl.Bl(i);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
|
-
return new
|
|
13
|
+
return new Yt(
|
|
14
14
|
t ? t.event_name : null,
|
|
15
|
-
t ?
|
|
15
|
+
t ? Wt.fromJson(t.property_filters) : null,
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
return { e: this.yl, pf: this.Jl ? this.Jl.
|
|
18
|
+
tt() {
|
|
19
|
+
return { e: this.yl, pf: this.Jl ? this.Jl.tt() : null };
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Zt from "./filter.js";
|
|
2
2
|
import { isArray as p } from "../../util/code-utils.js";
|
|
3
|
-
export default class
|
|
3
|
+
export default class Wt {
|
|
4
4
|
constructor(t) {
|
|
5
5
|
(this.filters = t), (this.filters = t);
|
|
6
6
|
}
|
|
@@ -27,17 +27,17 @@ export default class Yt {
|
|
|
27
27
|
for (let e = 0; e < t.length; e++) {
|
|
28
28
|
const o = [],
|
|
29
29
|
s = t[e];
|
|
30
|
-
for (let t = 0; t < s.length; t++) o.push(
|
|
30
|
+
for (let t = 0; t < s.length; t++) o.push(Zt.fromJson(s[t]));
|
|
31
31
|
r.push(o);
|
|
32
32
|
}
|
|
33
|
-
return new
|
|
33
|
+
return new Wt(r);
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
tt() {
|
|
36
36
|
const t = [];
|
|
37
37
|
for (let r = 0; r < this.filters.length; r++) {
|
|
38
38
|
const e = this.filters[r],
|
|
39
39
|
o = [];
|
|
40
|
-
for (let t = 0; t < e.length; t++) o.push(e[t].
|
|
40
|
+
for (let t = 0; t < e.length; t++) o.push(e[t].tt());
|
|
41
41
|
t.push(o);
|
|
42
42
|
}
|
|
43
43
|
return t;
|
|
@@ -47,9 +47,9 @@ export default class Yt {
|
|
|
47
47
|
for (let e = 0; e < t.length; e++) {
|
|
48
48
|
const o = [],
|
|
49
49
|
s = t[e];
|
|
50
|
-
for (let t = 0; t < s.length; t++) o.push(
|
|
50
|
+
for (let t = 0; t < s.length; t++) o.push(Zt.Yn(s[t]));
|
|
51
51
|
r.push(o);
|
|
52
52
|
}
|
|
53
|
-
return new
|
|
53
|
+
return new Wt(r);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
secondsAgo as ts,
|
|
6
6
|
secondsInTheFuture as es,
|
|
7
7
|
} from "../../util/date-utils.js";
|
|
8
|
-
export default class
|
|
8
|
+
export default class Zt {
|
|
9
9
|
constructor(t, s, e, i) {
|
|
10
10
|
(this.Tl = t),
|
|
11
11
|
(this.Al = s),
|
|
@@ -15,48 +15,48 @@ export default class sr {
|
|
|
15
15
|
(this.Al = s),
|
|
16
16
|
(this.comparator = e),
|
|
17
17
|
(this._l = i),
|
|
18
|
-
this.Al ===
|
|
19
|
-
this.comparator !==
|
|
20
|
-
this.comparator !==
|
|
21
|
-
this.comparator !==
|
|
22
|
-
this.comparator !==
|
|
18
|
+
this.Al === Zt.Rl.Ml &&
|
|
19
|
+
this.comparator !== Zt.Il.Ll &&
|
|
20
|
+
this.comparator !== Zt.Il.Ol &&
|
|
21
|
+
this.comparator !== Zt.Il.Ul &&
|
|
22
|
+
this.comparator !== Zt.Il.Ql &&
|
|
23
23
|
(this._l = l(this._l));
|
|
24
24
|
}
|
|
25
25
|
Bl(t) {
|
|
26
26
|
let s = null;
|
|
27
27
|
switch ((null != t && (s = t[this.Tl]), this.comparator)) {
|
|
28
|
-
case
|
|
28
|
+
case Zt.Il.Xl:
|
|
29
29
|
return null != s && s.valueOf() === this._l.valueOf();
|
|
30
|
-
case
|
|
30
|
+
case Zt.Il.Fl:
|
|
31
31
|
return null == s || s.valueOf() !== this._l.valueOf();
|
|
32
|
-
case
|
|
32
|
+
case Zt.Il.Kl:
|
|
33
33
|
return null != s && typeof s == typeof this._l && s > this._l;
|
|
34
|
-
case
|
|
35
|
-
return this.Al ===
|
|
34
|
+
case Zt.Il.Ll:
|
|
35
|
+
return this.Al === Zt.Rl.Ml
|
|
36
36
|
? null != s && yt(s) && ts(s) <= this._l.valueOf()
|
|
37
37
|
: null != s && typeof s == typeof this._l && s >= this._l;
|
|
38
|
-
case
|
|
38
|
+
case Zt.Il.Pl:
|
|
39
39
|
return null != s && typeof s == typeof this._l && s < this._l;
|
|
40
|
-
case
|
|
41
|
-
return this.Al ===
|
|
40
|
+
case Zt.Il.Ol:
|
|
41
|
+
return this.Al === Zt.Rl.Ml
|
|
42
42
|
? null != s && yt(s) && ts(s) >= this._l.valueOf()
|
|
43
43
|
: null != s && typeof s == typeof this._l && s <= this._l;
|
|
44
|
-
case
|
|
44
|
+
case Zt.Il.Yl:
|
|
45
45
|
return (
|
|
46
46
|
null != s &&
|
|
47
47
|
"string" == typeof s &&
|
|
48
48
|
typeof s == typeof this._l &&
|
|
49
49
|
null != s.match(this._l)
|
|
50
50
|
);
|
|
51
|
-
case
|
|
51
|
+
case Zt.Il.Zl:
|
|
52
52
|
return null != s;
|
|
53
|
-
case
|
|
53
|
+
case Zt.Il.$l:
|
|
54
54
|
return null == s;
|
|
55
|
-
case
|
|
55
|
+
case Zt.Il.Ul:
|
|
56
56
|
return null != s && yt(s) && es(s) < this._l;
|
|
57
|
-
case
|
|
57
|
+
case Zt.Il.Ql:
|
|
58
58
|
return null != s && yt(s) && es(s) > this._l;
|
|
59
|
-
case
|
|
59
|
+
case Zt.Il.Eu:
|
|
60
60
|
return (
|
|
61
61
|
null == s ||
|
|
62
62
|
typeof s != typeof this._l ||
|
|
@@ -67,14 +67,14 @@ export default class sr {
|
|
|
67
67
|
return !1;
|
|
68
68
|
}
|
|
69
69
|
static fromJson(t) {
|
|
70
|
-
return new
|
|
70
|
+
return new Zt(
|
|
71
71
|
t.property_key,
|
|
72
72
|
t.property_type,
|
|
73
73
|
t.comparator,
|
|
74
74
|
t.property_value,
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
tt() {
|
|
78
78
|
let t = this._l;
|
|
79
79
|
return (
|
|
80
80
|
yt(this._l) && (t = h(t.valueOf())),
|
|
@@ -82,11 +82,11 @@ export default class sr {
|
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
static Yn(t) {
|
|
85
|
-
return new
|
|
85
|
+
return new Zt(t.k, t.t, t.c, t.v);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
(
|
|
89
|
-
(
|
|
88
|
+
(Zt.Rl = { _u: "boolean", Hu: "number", Iu: "string", Ml: "date" }),
|
|
89
|
+
(Zt.Il = {
|
|
90
90
|
Xl: 1,
|
|
91
91
|
Fl: 2,
|
|
92
92
|
Kl: 3,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Wt from "./filter-set.js";
|
|
2
2
|
export default class is {
|
|
3
3
|
constructor(t, s) {
|
|
4
4
|
(this.productId = t), (this.Jl = s), (this.productId = t), (this.Jl = s);
|
|
@@ -12,10 +12,10 @@ export default class is {
|
|
|
12
12
|
static fromJson(t) {
|
|
13
13
|
return new is(
|
|
14
14
|
t ? t.product_id : null,
|
|
15
|
-
t ?
|
|
15
|
+
t ? Wt.fromJson(t.property_filters) : null,
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
return { id: this.productId, pf: this.Jl ? this.Jl.
|
|
18
|
+
tt() {
|
|
19
|
+
return { id: this.productId, pf: this.Jl ? this.Jl.tt() : null };
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ri from "./trigger-condition.js";
|
|
2
|
-
export default class
|
|
2
|
+
export default class sr {
|
|
3
3
|
constructor(t) {
|
|
4
4
|
(this.xu = t), (this.xu = t);
|
|
5
5
|
}
|
|
@@ -7,9 +7,9 @@ export default class lr {
|
|
|
7
7
|
return null == this.xu || ri.Bu(t[0], this.xu);
|
|
8
8
|
}
|
|
9
9
|
static fromJson(t) {
|
|
10
|
-
return new
|
|
10
|
+
return new sr(t ? t.campaign_id : null);
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
tt() {
|
|
13
13
|
return this.xu;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import Qt from "./custom-event-data.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import Yt from "./custom-event-property-data.js";
|
|
3
|
+
import Wt from "./filter-set.js";
|
|
4
4
|
import si from "./in-app-message-click-data.js";
|
|
5
5
|
import rs from "./purchase-data.js";
|
|
6
6
|
import is from "./purchase-property-data.js";
|
|
7
|
-
import
|
|
7
|
+
import sr from "./push-click-data.js";
|
|
8
8
|
import tt from "./trigger-events.js";
|
|
9
9
|
import r from "../../../shared-lib/braze-shared-lib.js";
|
|
10
10
|
import { getErrorMessage as ei } from "../../util/error-utils.js";
|
|
@@ -31,7 +31,7 @@ export default class ri {
|
|
|
31
31
|
let r = null;
|
|
32
32
|
switch (t) {
|
|
33
33
|
case ri.Wr.OPEN:
|
|
34
|
-
case ri.Wr.
|
|
34
|
+
case ri.Wr.vt:
|
|
35
35
|
break;
|
|
36
36
|
case ri.Wr.Rr:
|
|
37
37
|
r = rs.fromJson(e.data);
|
|
@@ -40,43 +40,43 @@ export default class ri {
|
|
|
40
40
|
r = is.fromJson(e.data);
|
|
41
41
|
break;
|
|
42
42
|
case ri.Wr.zr:
|
|
43
|
-
r =
|
|
43
|
+
r = sr.fromJson(e.data);
|
|
44
44
|
break;
|
|
45
45
|
case ri.Wr.$e:
|
|
46
46
|
r = Qt.fromJson(e.data);
|
|
47
47
|
break;
|
|
48
48
|
case ri.Wr.ac:
|
|
49
|
-
r =
|
|
49
|
+
r = Yt.fromJson(e.data);
|
|
50
50
|
break;
|
|
51
51
|
case ri.Wr.ro:
|
|
52
52
|
r = si.fromJson(e.data);
|
|
53
53
|
}
|
|
54
54
|
return new ri(t, r);
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
return { t: this.type, d: this.data ? this.data.
|
|
56
|
+
tt() {
|
|
57
|
+
return { t: this.type, d: this.data ? this.data.tt() : null };
|
|
58
58
|
}
|
|
59
59
|
static Yn(e) {
|
|
60
60
|
let t,
|
|
61
61
|
r = null;
|
|
62
62
|
switch (e.t) {
|
|
63
63
|
case ri.Wr.OPEN:
|
|
64
|
-
case ri.Wr.
|
|
64
|
+
case ri.Wr.vt:
|
|
65
65
|
break;
|
|
66
66
|
case ri.Wr.Rr:
|
|
67
67
|
r = new rs(e.d);
|
|
68
68
|
break;
|
|
69
69
|
case ri.Wr.sc:
|
|
70
|
-
(t = e.d || {}), (r = new is(t.id,
|
|
70
|
+
(t = e.d || {}), (r = new is(t.id, Wt.Yn(t.pf || [])));
|
|
71
71
|
break;
|
|
72
72
|
case ri.Wr.zr:
|
|
73
|
-
r = new
|
|
73
|
+
r = new sr(e.d);
|
|
74
74
|
break;
|
|
75
75
|
case ri.Wr.$e:
|
|
76
76
|
r = new Qt(e.d);
|
|
77
77
|
break;
|
|
78
78
|
case ri.Wr.ac:
|
|
79
|
-
(t = e.d || {}), (r = new
|
|
79
|
+
(t = e.d || {}), (r = new Yt(t.e, Wt.Yn(t.pf || [])));
|
|
80
80
|
break;
|
|
81
81
|
case ri.Wr.ro:
|
|
82
82
|
r = new si(e.d);
|
|
@@ -92,7 +92,7 @@ export default class ri {
|
|
|
92
92
|
$e: "custom_event",
|
|
93
93
|
ac: "custom_event_property",
|
|
94
94
|
ro: "iam_click",
|
|
95
|
-
|
|
95
|
+
vt: "test",
|
|
96
96
|
}),
|
|
97
97
|
(ri.rc = {}),
|
|
98
98
|
(ri.rc[ri.Wr.OPEN] = tt.OPEN),
|
|
@@ -102,4 +102,4 @@ export default class ri {
|
|
|
102
102
|
(ri.rc[ri.Wr.$e] = tt.$e),
|
|
103
103
|
(ri.rc[ri.Wr.ac] = tt.$e),
|
|
104
104
|
(ri.rc[ri.Wr.ro] = tt.ro),
|
|
105
|
-
(ri.rc[ri.Wr.
|
|
105
|
+
(ri.rc[ri.Wr.vt] = tt.vt);
|