@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
|
@@ -15,56 +15,56 @@ import vt from "./Push/utils/push-utils.js";
|
|
|
15
15
|
import h from "./util/request-header-utils.js";
|
|
16
16
|
export default class Lt {
|
|
17
17
|
constructor(t, i, s, e, h, o, n, r, l, a) {
|
|
18
|
-
(this.
|
|
18
|
+
(this.cn = t),
|
|
19
19
|
(this.baseUrl = i),
|
|
20
20
|
(this.T = s),
|
|
21
|
-
(this.
|
|
21
|
+
(this.fn = e),
|
|
22
22
|
(this.As = h),
|
|
23
23
|
(this.B = o),
|
|
24
24
|
(this.C = n),
|
|
25
25
|
(this.$l = r),
|
|
26
|
-
(this.
|
|
26
|
+
(this.Na = l),
|
|
27
27
|
(this.S = a),
|
|
28
|
-
(this.
|
|
28
|
+
(this.cn = t),
|
|
29
29
|
(this.baseUrl = i),
|
|
30
|
-
(this.
|
|
30
|
+
(this.Ml = 0),
|
|
31
31
|
(this.dE = n.IE() || 0),
|
|
32
|
-
(this.
|
|
32
|
+
(this.Pl = null),
|
|
33
33
|
(this.T = s),
|
|
34
|
-
(this.
|
|
34
|
+
(this.fn = e),
|
|
35
35
|
(this.As = h),
|
|
36
36
|
(this.B = o),
|
|
37
37
|
(this.C = n),
|
|
38
|
-
(this.
|
|
38
|
+
(this.Na = l),
|
|
39
39
|
(this.S = a),
|
|
40
40
|
(this.$l = r),
|
|
41
|
-
(this.
|
|
42
|
-
(this.
|
|
43
|
-
(this.
|
|
44
|
-
(this.
|
|
41
|
+
(this.Ol = new u()),
|
|
42
|
+
(this.Ul = null),
|
|
43
|
+
(this._l = 50),
|
|
44
|
+
(this.Xl = !1);
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
return !t && !i && this.
|
|
46
|
+
Ql(t, i) {
|
|
47
|
+
return !t && !i && this.Na.Kh() >= this._l;
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
let i = this.T.
|
|
49
|
+
Yl(t) {
|
|
50
|
+
let i = this.T.zl();
|
|
51
51
|
if (t.length > 0) {
|
|
52
52
|
const s = this.As.getUserId();
|
|
53
53
|
for (const e of t) {
|
|
54
54
|
const t = (!e.userId && !s) || e.userId === s;
|
|
55
|
-
e.type === d.
|
|
55
|
+
e.type === d.Il && t && (i = !0);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
return i;
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
e && this.
|
|
60
|
+
Zl(i = !1, s = !1, e = !0, o, n, r, u = !1, c = !1) {
|
|
61
|
+
e && this.sc();
|
|
62
62
|
const d = this.C.AE(),
|
|
63
63
|
m = this.C.OE();
|
|
64
64
|
let f = !1;
|
|
65
65
|
const g = (i, s, u = -1) => {
|
|
66
66
|
const c = new Date().valueOf();
|
|
67
|
-
h.W(this.C, h.O.
|
|
67
|
+
h.W(this.C, h.O.Su, c),
|
|
68
68
|
-1 !== u && s.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
|
|
69
69
|
let d = !1;
|
|
70
70
|
l.Y({
|
|
@@ -74,18 +74,18 @@ export default class Lt {
|
|
|
74
74
|
ss: (e) => {
|
|
75
75
|
null != i.respond_with &&
|
|
76
76
|
i.respond_with.triggers &&
|
|
77
|
-
(this.
|
|
77
|
+
(this.Ml = Math.max(this.Ml - 1, 0)),
|
|
78
78
|
this.S.ts(i, e, s)
|
|
79
|
-
? (this.
|
|
80
|
-
this.B.
|
|
79
|
+
? (this.Na.es(),
|
|
80
|
+
this.B.dl(e),
|
|
81
81
|
(null != i.respond_with &&
|
|
82
82
|
i.respond_with.user_id != this.As.getUserId()) ||
|
|
83
|
-
(null != i.device && this.C.Bs(t.gs
|
|
83
|
+
(null != i.device && this.C.Bs(t.gs.ec, i.device),
|
|
84
84
|
null != i.sdk_metadata &&
|
|
85
|
-
(this.C.Bs(t.gs.
|
|
86
|
-
this.C.Bs(t.gs.
|
|
85
|
+
(this.C.Bs(t.gs.gu, i.sdk_metadata),
|
|
86
|
+
this.C.Bs(t.gs.bu, this.T.Ss())),
|
|
87
87
|
this.$l(e),
|
|
88
|
-
h
|
|
88
|
+
h.$u(this.C, h.O.Su, 1),
|
|
89
89
|
"function" == typeof o && o()))
|
|
90
90
|
: e.auth_error && (d = !0);
|
|
91
91
|
},
|
|
@@ -93,13 +93,13 @@ export default class Lt {
|
|
|
93
93
|
(d = !0),
|
|
94
94
|
null != i.respond_with &&
|
|
95
95
|
i.respond_with.triggers &&
|
|
96
|
-
(this.
|
|
97
|
-
this.S.
|
|
96
|
+
(this.Ml = Math.max(this.Ml - 1, 0)),
|
|
97
|
+
this.S.qu(i.events, i.attributes),
|
|
98
98
|
"function" == typeof n && n();
|
|
99
99
|
},
|
|
100
100
|
rs: (t, i) => {
|
|
101
101
|
"function" == typeof r && r(!d);
|
|
102
|
-
const s = this.S.
|
|
102
|
+
const s = this.S.xu(i);
|
|
103
103
|
let o = 0;
|
|
104
104
|
if (s)
|
|
105
105
|
switch (s.type) {
|
|
@@ -111,93 +111,93 @@ export default class Lt {
|
|
|
111
111
|
}
|
|
112
112
|
if (e && !f) {
|
|
113
113
|
if (d) {
|
|
114
|
-
h.
|
|
115
|
-
let t = this.
|
|
114
|
+
h.Hu(this.C, h.O.Su);
|
|
115
|
+
let t = this.Pl;
|
|
116
116
|
(null == t || t < 1e3 * this.dE) && (t = 1e3 * this.dE);
|
|
117
117
|
const i = Math.min(3e5, a(1e3 * this.dE, 3 * t)) + o;
|
|
118
|
-
this.
|
|
119
|
-
} else this.
|
|
118
|
+
this.hc(i);
|
|
119
|
+
} else this.hc(Math.max(1e3 * this.dE, o));
|
|
120
120
|
f = !0;
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
});
|
|
124
124
|
},
|
|
125
|
-
p = this.
|
|
125
|
+
p = this.Yl(d),
|
|
126
126
|
v = s || p;
|
|
127
|
-
if (this.
|
|
127
|
+
if (this.Ql(u, p))
|
|
128
128
|
return void N.info(
|
|
129
129
|
"Declining to flush data due to 50 consecutive authentication failures",
|
|
130
130
|
);
|
|
131
|
-
if (e && !this.S.
|
|
132
|
-
return this.
|
|
133
|
-
const b = this.S.
|
|
134
|
-
v && this.
|
|
131
|
+
if (e && !this.S.wu(d, m, i, v))
|
|
132
|
+
return this.hc(), void ("function" == typeof r && r(!0));
|
|
133
|
+
const b = this.S.Cu(i, v, d, m, c);
|
|
134
|
+
v && this.Ml++;
|
|
135
135
|
let w = !1;
|
|
136
136
|
if (b)
|
|
137
137
|
for (const t of b)
|
|
138
138
|
this.S.V(
|
|
139
139
|
t.requestData,
|
|
140
140
|
(i) => g(t.requestData, t.headers, i),
|
|
141
|
-
h.O.
|
|
141
|
+
h.O.Su,
|
|
142
142
|
n,
|
|
143
143
|
),
|
|
144
144
|
(w = !0);
|
|
145
|
-
this.
|
|
146
|
-
? this.
|
|
147
|
-
: p && (N.info("Invoking new session subscriptions"), this.
|
|
145
|
+
this.Na.jh() && e && !w
|
|
146
|
+
? this.hc()
|
|
147
|
+
: p && (N.info("Invoking new session subscriptions"), this.Ol.X());
|
|
148
148
|
}
|
|
149
|
-
|
|
150
|
-
return this.
|
|
149
|
+
uc() {
|
|
150
|
+
return this.Ml > 0;
|
|
151
151
|
}
|
|
152
|
-
|
|
153
|
-
this.
|
|
154
|
-
(this.
|
|
155
|
-
(this.
|
|
152
|
+
hc(t = 1e3 * this.dE) {
|
|
153
|
+
this.Xl ||
|
|
154
|
+
(this.sc(),
|
|
155
|
+
(this.Ul = window.setTimeout(() => {
|
|
156
156
|
if (document.hidden) {
|
|
157
157
|
const t = "visibilitychange",
|
|
158
158
|
i = () => {
|
|
159
159
|
document.hidden ||
|
|
160
|
-
(document.removeEventListener(t, i, !1), this.
|
|
160
|
+
(document.removeEventListener(t, i, !1), this.Zl());
|
|
161
161
|
};
|
|
162
162
|
document.addEventListener(t, i, !1);
|
|
163
|
-
} else this.
|
|
163
|
+
} else this.Zl();
|
|
164
164
|
}, t)),
|
|
165
|
-
(this.
|
|
165
|
+
(this.Pl = t));
|
|
166
166
|
}
|
|
167
|
-
|
|
168
|
-
null != this.
|
|
167
|
+
sc() {
|
|
168
|
+
null != this.Ul && (clearTimeout(this.Ul), (this.Ul = null));
|
|
169
169
|
}
|
|
170
170
|
initialize() {
|
|
171
|
-
(this.
|
|
171
|
+
(this.Xl = !1), this.hc();
|
|
172
172
|
}
|
|
173
173
|
destroy() {
|
|
174
|
-
this.
|
|
175
|
-
this.
|
|
176
|
-
this.
|
|
177
|
-
(this.
|
|
178
|
-
this.
|
|
179
|
-
(this.
|
|
174
|
+
this.Ol.removeAllSubscriptions(),
|
|
175
|
+
this.Na.Hh(),
|
|
176
|
+
this.sc(),
|
|
177
|
+
(this.Xl = !0),
|
|
178
|
+
this.Zl(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
|
|
179
|
+
(this.Ul = null);
|
|
180
180
|
}
|
|
181
181
|
rn(t) {
|
|
182
|
-
return this.
|
|
182
|
+
return this.Ol.Fs(t);
|
|
183
183
|
}
|
|
184
184
|
openSession() {
|
|
185
185
|
const i = this.T.Ss() !== this.T.Eo();
|
|
186
|
-
i && (this.C.TE(t.iu
|
|
187
|
-
this.
|
|
188
|
-
this.C.Es(t.gs
|
|
186
|
+
i && (this.C.TE(t.iu.Xh), this.C.TE(t.iu.su)),
|
|
187
|
+
this.Zl(void 0, !1, void 0, () => {
|
|
188
|
+
this.C.Es(t.gs.Be);
|
|
189
189
|
}),
|
|
190
|
-
this.
|
|
190
|
+
this.du(),
|
|
191
191
|
i &&
|
|
192
192
|
import("./Push/push-manager-factory.js").then((i) => {
|
|
193
|
-
if (this.
|
|
193
|
+
if (this.Xl) return;
|
|
194
194
|
const s = i.default.ea();
|
|
195
195
|
if (
|
|
196
196
|
null != s &&
|
|
197
197
|
(vt.isPushPermissionGranted() || vt.isPushBlocked())
|
|
198
198
|
) {
|
|
199
199
|
const i = () => {
|
|
200
|
-
s.
|
|
200
|
+
s.Sn()
|
|
201
201
|
? N.info(
|
|
202
202
|
"Push token maintenance is disabled, not refreshing token for backend.",
|
|
203
203
|
)
|
|
@@ -207,43 +207,43 @@ export default class Lt {
|
|
|
207
207
|
s && i();
|
|
208
208
|
},
|
|
209
209
|
h = () => {
|
|
210
|
-
const s = this.C.vs(t.gs.
|
|
210
|
+
const s = this.C.vs(t.gs.Fn);
|
|
211
211
|
(null == s || s) && i();
|
|
212
212
|
},
|
|
213
213
|
o = tt._s.Xs;
|
|
214
|
-
new tt(o, N).
|
|
214
|
+
new tt(o, N).cr(o.Ks.cu, e, h);
|
|
215
215
|
}
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
218
|
dc() {
|
|
219
|
-
this.C.Es(t.gs
|
|
219
|
+
this.C.Es(t.gs.$e), this.C.Es(t.gs.di), this.C.Es(t.gs.Zr);
|
|
220
220
|
}
|
|
221
221
|
changeUser(i, s, e) {
|
|
222
222
|
const h = this.As.getUserId();
|
|
223
223
|
if (h !== i) {
|
|
224
|
-
this.T.
|
|
224
|
+
this.T.Jl(),
|
|
225
225
|
this.dc(),
|
|
226
|
-
null != h && this.
|
|
226
|
+
null != h && this.Zl(void 0, !1, void 0, void 0, void 0),
|
|
227
227
|
this.As.ou(i),
|
|
228
|
-
e ? this.
|
|
228
|
+
e ? this.Na.setSdkAuthenticationSignature(e) : this.Na.Bh();
|
|
229
229
|
for (let t = 0; t < s.length; t++) s[t].changeUser(null == h);
|
|
230
230
|
null != h && this.C.Es(t.gs.Ct),
|
|
231
|
-
this.C.Es(t.gs
|
|
231
|
+
this.C.Es(t.gs.ec),
|
|
232
232
|
this.C.Es(t.gs._E),
|
|
233
233
|
this.openSession(),
|
|
234
234
|
N.info('Changed user to "' + i + '".');
|
|
235
235
|
} else {
|
|
236
236
|
let t = "Doing nothing.";
|
|
237
237
|
e &&
|
|
238
|
-
this.
|
|
239
|
-
(this.
|
|
238
|
+
this.Na.xh() !== e &&
|
|
239
|
+
(this.Na.setSdkAuthenticationSignature(e),
|
|
240
240
|
(t = "Updated SDK authentication signature")),
|
|
241
241
|
N.info(`Current user is already ${i}. ${t}`);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
requestImmediateDataFlush(t) {
|
|
245
|
-
this.
|
|
246
|
-
this.
|
|
245
|
+
this.sc(), this.T.Eo();
|
|
246
|
+
this.Zl(
|
|
247
247
|
void 0,
|
|
248
248
|
void 0,
|
|
249
249
|
void 0,
|
|
@@ -256,12 +256,12 @@ export default class Lt {
|
|
|
256
256
|
);
|
|
257
257
|
}
|
|
258
258
|
requestFeedRefresh() {
|
|
259
|
-
this.T.Eo(), this.
|
|
259
|
+
this.T.Eo(), this.Zl(!0);
|
|
260
260
|
}
|
|
261
|
-
|
|
261
|
+
br(t, i) {
|
|
262
262
|
this.T.Eo(),
|
|
263
263
|
N.info("Requesting explicit trigger refresh."),
|
|
264
|
-
this.
|
|
264
|
+
this.Zl(void 0, !0, void 0, t, i);
|
|
265
265
|
}
|
|
266
266
|
Ln(i, s) {
|
|
267
267
|
const e = d.mc,
|
|
@@ -297,31 +297,31 @@ export default class Lt {
|
|
|
297
297
|
r
|
|
298
298
|
);
|
|
299
299
|
}
|
|
300
|
-
|
|
300
|
+
lr(t, i) {
|
|
301
301
|
const s = this.T.Eo();
|
|
302
302
|
return new ve(this.As.getUserId(), d.gc, t, s, { cid: i });
|
|
303
303
|
}
|
|
304
304
|
vc(t, i) {
|
|
305
305
|
return new tt(t, i);
|
|
306
306
|
}
|
|
307
|
-
|
|
307
|
+
du() {
|
|
308
308
|
const t = tt._s.Xs;
|
|
309
|
-
this.vc(t, N).setItem(t.Ks.
|
|
309
|
+
this.vc(t, N).setItem(t.Ks.Su, 1, {
|
|
310
310
|
baseUrl: this.baseUrl,
|
|
311
|
-
data: { api_key: this.
|
|
311
|
+
data: { api_key: this.cn, device_id: this.fn.de().id },
|
|
312
312
|
userId: this.As.getUserId(),
|
|
313
|
-
sdkAuthEnabled: this.
|
|
313
|
+
sdkAuthEnabled: this.Na.jh(),
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
|
-
|
|
316
|
+
vr(t) {
|
|
317
317
|
for (const i of t)
|
|
318
|
-
if (i.api_key === this.
|
|
318
|
+
if (i.api_key === this.cn) this.S.qu(i.events, i.attributes);
|
|
319
319
|
else {
|
|
320
320
|
const t = tt._s.Xs;
|
|
321
|
-
new tt(t, N).setItem(t.Ks
|
|
321
|
+
new tt(t, N).setItem(t.Ks.kr, G.Rt(), i);
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
|
|
324
|
+
Qn(t, i, s) {
|
|
325
325
|
if (this.B.hu(t))
|
|
326
326
|
return (
|
|
327
327
|
N.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new E()
|
|
@@ -334,7 +334,7 @@ export default class Lt {
|
|
|
334
334
|
c.cs(e, h)
|
|
335
335
|
);
|
|
336
336
|
}
|
|
337
|
-
|
|
337
|
+
Xn(t, i) {
|
|
338
338
|
const s = { group_id: t, status: i };
|
|
339
339
|
return c.cs(d.kc, s);
|
|
340
340
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fr from "./filter.js";
|
|
2
|
-
import { isArray as
|
|
2
|
+
import { isArray as z } from "../../util/code-utils.js";
|
|
3
3
|
export default class is {
|
|
4
4
|
constructor(t) {
|
|
5
5
|
(this.filters = t), (this.filters = t);
|
|
@@ -22,7 +22,7 @@ export default class is {
|
|
|
22
22
|
return r;
|
|
23
23
|
}
|
|
24
24
|
static fromJson(t) {
|
|
25
|
-
if (null == t || !
|
|
25
|
+
if (null == t || !z(t)) return null;
|
|
26
26
|
const r = [];
|
|
27
27
|
for (let e = 0; e < t.length; e++) {
|
|
28
28
|
const o = [],
|
|
@@ -42,12 +42,12 @@ export default class is {
|
|
|
42
42
|
}
|
|
43
43
|
return t;
|
|
44
44
|
}
|
|
45
|
-
static
|
|
45
|
+
static Bn(t) {
|
|
46
46
|
const r = [];
|
|
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(fr.
|
|
50
|
+
for (let t = 0; t < s.length; t++) o.push(fr.Bn(s[t]));
|
|
51
51
|
r.push(o);
|
|
52
52
|
}
|
|
53
53
|
return new is(r);
|
|
@@ -28,25 +28,25 @@ export default class ri {
|
|
|
28
28
|
const t = e.type;
|
|
29
29
|
let r = null;
|
|
30
30
|
switch (t) {
|
|
31
|
-
case ri.
|
|
32
|
-
case ri.
|
|
31
|
+
case ri.Ur.OPEN:
|
|
32
|
+
case ri.Ur.Xt:
|
|
33
33
|
break;
|
|
34
|
-
case ri.
|
|
34
|
+
case ri.Ur.Rr:
|
|
35
35
|
r = ns.fromJson(e.data);
|
|
36
36
|
break;
|
|
37
|
-
case ri.
|
|
37
|
+
case ri.Ur.jc:
|
|
38
38
|
r = hs.fromJson(e.data);
|
|
39
39
|
break;
|
|
40
|
-
case ri.
|
|
40
|
+
case ri.Ur.hr:
|
|
41
41
|
r = ur.fromJson(e.data);
|
|
42
42
|
break;
|
|
43
|
-
case ri.
|
|
43
|
+
case ri.Ur.ve:
|
|
44
44
|
r = ts.fromJson(e.data);
|
|
45
45
|
break;
|
|
46
|
-
case ri.
|
|
46
|
+
case ri.Ur.Cc:
|
|
47
47
|
r = rs.fromJson(e.data);
|
|
48
48
|
break;
|
|
49
|
-
case ri.
|
|
49
|
+
case ri.Ur.Bo:
|
|
50
50
|
r = ni.fromJson(e.data);
|
|
51
51
|
}
|
|
52
52
|
return new ri(t, r);
|
|
@@ -54,50 +54,50 @@ export default class ri {
|
|
|
54
54
|
bs() {
|
|
55
55
|
return { t: this.type, d: this.data ? this.data.bs() : null };
|
|
56
56
|
}
|
|
57
|
-
static
|
|
57
|
+
static Bn(e) {
|
|
58
58
|
let t,
|
|
59
59
|
r = null;
|
|
60
60
|
switch (e.t) {
|
|
61
|
-
case ri.
|
|
62
|
-
case ri.
|
|
61
|
+
case ri.Ur.OPEN:
|
|
62
|
+
case ri.Ur.Xt:
|
|
63
63
|
break;
|
|
64
|
-
case ri.
|
|
64
|
+
case ri.Ur.Rr:
|
|
65
65
|
r = new ns(e.d);
|
|
66
66
|
break;
|
|
67
|
-
case ri.
|
|
68
|
-
(t = e.d || {}), (r = new hs(t.id, is.
|
|
67
|
+
case ri.Ur.jc:
|
|
68
|
+
(t = e.d || {}), (r = new hs(t.id, is.Bn(t.pf || [])));
|
|
69
69
|
break;
|
|
70
|
-
case ri.
|
|
70
|
+
case ri.Ur.hr:
|
|
71
71
|
r = new ur(e.d);
|
|
72
72
|
break;
|
|
73
|
-
case ri.
|
|
73
|
+
case ri.Ur.ve:
|
|
74
74
|
r = new ts(e.d);
|
|
75
75
|
break;
|
|
76
|
-
case ri.
|
|
77
|
-
(t = e.d || {}), (r = new rs(t.e, is.
|
|
76
|
+
case ri.Ur.Cc:
|
|
77
|
+
(t = e.d || {}), (r = new rs(t.e, is.Bn(t.pf || [])));
|
|
78
78
|
break;
|
|
79
|
-
case ri.
|
|
79
|
+
case ri.Ur.Bo:
|
|
80
80
|
r = new ni(e.d);
|
|
81
81
|
}
|
|
82
82
|
return new ri(e.t, r);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
(ri.
|
|
85
|
+
(ri.Ur = {
|
|
86
86
|
OPEN: "open",
|
|
87
87
|
Rr: "purchase",
|
|
88
88
|
jc: "purchase_property",
|
|
89
|
-
|
|
89
|
+
hr: "push_click",
|
|
90
90
|
ve: "custom_event",
|
|
91
91
|
Cc: "custom_event_property",
|
|
92
92
|
Bo: "iam_click",
|
|
93
93
|
Xt: "test",
|
|
94
94
|
}),
|
|
95
95
|
(ri.Ec = {}),
|
|
96
|
-
(ri.Ec[ri.
|
|
97
|
-
(ri.Ec[ri.
|
|
98
|
-
(ri.Ec[ri.
|
|
99
|
-
(ri.Ec[ri.
|
|
100
|
-
(ri.Ec[ri.
|
|
101
|
-
(ri.Ec[ri.
|
|
102
|
-
(ri.Ec[ri.
|
|
103
|
-
(ri.Ec[ri.
|
|
96
|
+
(ri.Ec[ri.Ur.OPEN] = et.OPEN),
|
|
97
|
+
(ri.Ec[ri.Ur.Rr] = et.Rr),
|
|
98
|
+
(ri.Ec[ri.Ur.jc] = et.Rr),
|
|
99
|
+
(ri.Ec[ri.Ur.hr] = et.hr),
|
|
100
|
+
(ri.Ec[ri.Ur.ve] = et.ve),
|
|
101
|
+
(ri.Ec[ri.Ur.Cc] = et.ve),
|
|
102
|
+
(ri.Ec[ri.Ur.Bo] = et.Bo),
|
|
103
|
+
(ri.Ec[ri.Ur.Xt] = et.Xt);
|
|
@@ -16,7 +16,7 @@ export default class pt {
|
|
|
16
16
|
(this.data = l),
|
|
17
17
|
(this.ed = o),
|
|
18
18
|
(this.rd = n),
|
|
19
|
-
(this.
|
|
19
|
+
(this.Yr = a),
|
|
20
20
|
(this.hd = u),
|
|
21
21
|
(this.od = d),
|
|
22
22
|
(this.id = t),
|
|
@@ -29,7 +29,7 @@ export default class pt {
|
|
|
29
29
|
(this.type = h),
|
|
30
30
|
(this.ed = o || 0),
|
|
31
31
|
null == a && (a = 1e3 * (this.ed + 30)),
|
|
32
|
-
(this.
|
|
32
|
+
(this.Yr = a),
|
|
33
33
|
(this.data = l),
|
|
34
34
|
null != n && (this.rd = n),
|
|
35
35
|
(this.hd = u),
|
|
@@ -49,11 +49,11 @@ export default class pt {
|
|
|
49
49
|
}
|
|
50
50
|
dd(t) {
|
|
51
51
|
const i = new Date().valueOf() - t,
|
|
52
|
-
s = null == t || isNaN(i) || null == this.
|
|
52
|
+
s = null == t || isNaN(i) || null == this.Yr || i < this.Yr;
|
|
53
53
|
return (
|
|
54
54
|
s ||
|
|
55
55
|
N.info(
|
|
56
|
-
`Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.
|
|
56
|
+
`Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.Yr}ms.`,
|
|
57
57
|
),
|
|
58
58
|
!s
|
|
59
59
|
);
|
|
@@ -73,7 +73,7 @@ export default class pt {
|
|
|
73
73
|
u = t.data,
|
|
74
74
|
d = t.min_seconds_since_last_trigger;
|
|
75
75
|
return ta(
|
|
76
|
-
pt.
|
|
76
|
+
pt.Ur,
|
|
77
77
|
l,
|
|
78
78
|
"Could not construct Trigger from server data",
|
|
79
79
|
"Trigger.Types",
|
|
@@ -94,15 +94,15 @@ export default class pt {
|
|
|
94
94
|
da: this.data,
|
|
95
95
|
d: this.ed,
|
|
96
96
|
r: this.rd,
|
|
97
|
-
tm: this.
|
|
97
|
+
tm: this.Yr,
|
|
98
98
|
ss: this.hd,
|
|
99
99
|
ld: this.od,
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
static
|
|
102
|
+
static Bn(t) {
|
|
103
103
|
const i = [],
|
|
104
104
|
s = t.c || [];
|
|
105
|
-
for (let t = 0; t < s.length; t++) i.push(ri.
|
|
105
|
+
for (let t = 0; t < s.length; t++) i.push(ri.Bn(s[t]));
|
|
106
106
|
return new pt(
|
|
107
107
|
t.i,
|
|
108
108
|
i,
|
|
@@ -119,4 +119,4 @@ export default class pt {
|
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
(pt.
|
|
122
|
+
(pt.Ur = { Qr: "inapp", md: "templated_iam" }), (pt.td = -1);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import se from "../InAppMessage/in-app-message-manager-factory.js";
|
|
2
|
-
import r, { OPTIONS as
|
|
2
|
+
import r, { OPTIONS as w } from "../managers/braze-instance.js";
|
|
3
3
|
import gr from "./triggers-provider.js";
|
|
4
4
|
export const TriggersProviderFactory = {
|
|
5
5
|
l: !1,
|
|
@@ -11,7 +11,7 @@ export const TriggersProviderFactory = {
|
|
|
11
11
|
),
|
|
12
12
|
rg: () => {
|
|
13
13
|
if (!TriggersProviderFactory.provider) {
|
|
14
|
-
const i = r.
|
|
14
|
+
const i = r.ee(w.Qo);
|
|
15
15
|
(TriggersProviderFactory.provider = new gr(
|
|
16
16
|
null != i ? i : 30,
|
|
17
17
|
se.ea().Vi(),
|