@braze/web-sdk 6.9.0 → 6.10.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 +17 -5
- package/package.json +1 -1
- package/shared-lib/event-types.js +2 -2
- package/shared-lib/indexed-db-adapter.js +30 -30
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +1 -1
- package/src/Core/index.js +1 -0
- package/src/Core/logout.js +22 -0
- package/src/Push/push-manager.js +1 -1
- package/src/Push/unregister-push-token-on-server.js +35 -0
- package/src/Push/unregister-push.js +2 -1
- package/src/l10n/l10n-manager-factory.js +2 -2
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/braze-instance.js +2 -2
- package/src/managers/device-manager.js +4 -4
- package/src/managers/network-manager.js +69 -69
- package/src/managers/server-config-manager.js +70 -70
- package/src/managers/session-manager.js +2 -2
- package/src/managers/storage-manager.js +10 -10
- package/src/models/backend-errors.js +5 -5
- package/src/models/push-token.js +3 -3
- package/src/models/server-config.js +24 -24
- package/src/request-controller.js +15 -15
- package/src/triggers/models/push-click-data.js +2 -2
- package/src/triggers/models/trigger-condition.js +3 -3
- package/src/triggers/models/trigger.js +21 -21
- package/src/triggers/triggers-provider.js +14 -14
- package/src/types.js +1 -1
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/browser-detector.js +1 -1
- package/src/util/ecommerce-event-validation.js +1 -1
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +33 -32
|
@@ -48,12 +48,12 @@ export default class Vt {
|
|
|
48
48
|
Z(t, e = !1, i = !1) {
|
|
49
49
|
const r = this.eu.ve(!i),
|
|
50
50
|
n = r.ta(),
|
|
51
|
-
o = this.j.St(s.It.
|
|
51
|
+
o = this.j.St(s.It.Ha);
|
|
52
52
|
oi(o, n) || (t.device = n),
|
|
53
53
|
(t.api_key = this.tu),
|
|
54
54
|
(t.time = X(new Date().valueOf(), !0));
|
|
55
|
-
const a = this.j.St(s.It.
|
|
56
|
-
h = this.j.St(s.It.
|
|
55
|
+
const a = this.j.St(s.It.Pa) || [],
|
|
56
|
+
h = this.j.St(s.It.Ua) || "";
|
|
57
57
|
this.$a.length > 0 &&
|
|
58
58
|
(!oi(a, this.$a) || h !== this.C.$t()) &&
|
|
59
59
|
(t.sdk_metadata = this.$a),
|
|
@@ -91,7 +91,7 @@ export default class Vt {
|
|
|
91
91
|
(e +=
|
|
92
92
|
' Please use the "enableSdkAuthentication" initialization option to enable authentication.'),
|
|
93
93
|
b.error(`SDK Authentication failed ${e}`),
|
|
94
|
-
this.
|
|
94
|
+
this.Wa(t.events || [], t.attributes || []),
|
|
95
95
|
this.Gh.Ch(r),
|
|
96
96
|
!1
|
|
97
97
|
);
|
|
@@ -100,28 +100,28 @@ export default class Vt {
|
|
|
100
100
|
let i,
|
|
101
101
|
s = r;
|
|
102
102
|
switch (s) {
|
|
103
|
-
case Ne.
|
|
103
|
+
case Ne.Ya:
|
|
104
104
|
return (
|
|
105
105
|
(i = "Received successful response with empty body."),
|
|
106
|
-
v.Dt(p.
|
|
106
|
+
v.Dt(p.Qa, { e: i }),
|
|
107
107
|
b.info(i),
|
|
108
108
|
!1
|
|
109
109
|
);
|
|
110
|
-
case Ne.
|
|
110
|
+
case Ne.Va:
|
|
111
111
|
return (
|
|
112
112
|
(i = "Received successful response with invalid JSON"),
|
|
113
|
-
v.Dt(p.
|
|
113
|
+
v.Dt(p.Qa, { e: i + ": " + e.response }),
|
|
114
114
|
b.info(i),
|
|
115
115
|
!1
|
|
116
116
|
);
|
|
117
|
-
case Ne.
|
|
117
|
+
case Ne.Za:
|
|
118
118
|
s = `The API key "${t.api_key}" is invalid for the baseUrl ${this.Yh}`;
|
|
119
119
|
break;
|
|
120
|
-
case Ne.
|
|
120
|
+
case Ne.dl:
|
|
121
121
|
s =
|
|
122
122
|
"Sorry, we are not currently accepting your requests. If you think this is in error, please contact us.";
|
|
123
123
|
break;
|
|
124
|
-
case Ne.
|
|
124
|
+
case Ne.fl:
|
|
125
125
|
s =
|
|
126
126
|
"No device identifier. Please contact Braze Technical Support for assistance.";
|
|
127
127
|
}
|
|
@@ -129,10 +129,10 @@ export default class Vt {
|
|
|
129
129
|
}
|
|
130
130
|
return !1;
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
ml(t, e, i) {
|
|
133
133
|
return !!((t && 0 !== t.length) || (e && 0 !== e.length) || i);
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
vl(t, e, i, s = !1) {
|
|
136
136
|
const r = [],
|
|
137
137
|
n = (t) => t || "",
|
|
138
138
|
o = n(this.Ss.getUserId());
|
|
@@ -164,16 +164,16 @@ export default class Vt {
|
|
|
164
164
|
e && (this.Gh.Fh() && n(e.user_id) !== o ? u.push(e) : t.push(e));
|
|
165
165
|
t.length > 0 && (a.attributes = t);
|
|
166
166
|
}
|
|
167
|
-
if ((this.
|
|
167
|
+
if ((this.Wa(l, u), (a = this.Z(a, !1, s)), d)) {
|
|
168
168
|
d = this.Z(d, !1, s);
|
|
169
169
|
const t = { requestData: d, headers: this.tt(d, h.it.pn) };
|
|
170
170
|
r.push(t);
|
|
171
171
|
}
|
|
172
|
-
if (a && !this.
|
|
172
|
+
if (a && !this.ml(a.events, a.attributes, t)) return d ? r : null;
|
|
173
173
|
const f = { requestData: a, headers: this.tt(a, h.it.pn) };
|
|
174
174
|
return r.push(f), r;
|
|
175
175
|
}
|
|
176
|
-
|
|
176
|
+
Wa(t, e) {
|
|
177
177
|
if (t) {
|
|
178
178
|
const e = [];
|
|
179
179
|
for (const i of t) {
|
|
@@ -182,14 +182,14 @@ export default class Vt {
|
|
|
182
182
|
}
|
|
183
183
|
this.j.ol(e);
|
|
184
184
|
}
|
|
185
|
-
if (e) for (const t of e) this.j.
|
|
185
|
+
if (e) for (const t of e) this.j.Rl(t);
|
|
186
186
|
}
|
|
187
187
|
dt(t, e) {
|
|
188
188
|
let i = "HTTP error ";
|
|
189
189
|
null != t && (i += t + " "), (i += e), b.error(i);
|
|
190
190
|
}
|
|
191
|
-
|
|
192
|
-
return v.Dt(p.
|
|
191
|
+
gl(t) {
|
|
192
|
+
return v.Dt(p.bl, { n: t });
|
|
193
193
|
}
|
|
194
194
|
Zo(t, e) {
|
|
195
195
|
const i = {};
|
|
@@ -201,10 +201,10 @@ export default class Vt {
|
|
|
201
201
|
}
|
|
202
202
|
return (i.config = { config_time: this.h.Qt() }), { respond_with: i };
|
|
203
203
|
}
|
|
204
|
-
|
|
204
|
+
ql(t) {
|
|
205
205
|
const e = new Date().valueOf();
|
|
206
206
|
let i = Ke.toString();
|
|
207
|
-
const s = h.
|
|
207
|
+
const s = h.Al(this.j, t);
|
|
208
208
|
if (-1 !== s) {
|
|
209
209
|
i = (e - s).toString();
|
|
210
210
|
}
|
|
@@ -212,9 +212,9 @@ export default class Vt {
|
|
|
212
212
|
}
|
|
213
213
|
tt(t, e, i = "sdk") {
|
|
214
214
|
const s = [["X-Braze-Api-Key", this.tu]],
|
|
215
|
-
r = this.
|
|
215
|
+
r = this.ql(e);
|
|
216
216
|
s.push(["X-Braze-Last-Req-Ms-Ago", r]);
|
|
217
|
-
const n = h.
|
|
217
|
+
const n = h.Dl(this.j, e).toString();
|
|
218
218
|
s.push(["X-Braze-Req-Attempt", n]);
|
|
219
219
|
let o = !1;
|
|
220
220
|
if (
|
|
@@ -224,8 +224,8 @@ export default class Vt {
|
|
|
224
224
|
e === h.it.Mi)
|
|
225
225
|
) {
|
|
226
226
|
s.push(["X-Braze-ContentCardsRequest", "true"]);
|
|
227
|
-
let t = h.
|
|
228
|
-
(t && "client" !== i) || ((t = 1), h.
|
|
227
|
+
let t = h.Dl(this.j, h.it.Mi);
|
|
228
|
+
(t && "client" !== i) || ((t = 1), h.Tl(this.j, h.it.Mi, t));
|
|
229
229
|
const e = Math.max(0, t - 1);
|
|
230
230
|
s.push(["BRAZE-SYNC-RETRY-COUNT", e.toString()]), (o = !0);
|
|
231
231
|
}
|
|
@@ -241,7 +241,7 @@ export default class Vt {
|
|
|
241
241
|
}
|
|
242
242
|
return s;
|
|
243
243
|
}
|
|
244
|
-
|
|
244
|
+
kl(t, e, i, s) {
|
|
245
245
|
if (this.La[s]) return;
|
|
246
246
|
const r = window.setTimeout(() => {
|
|
247
247
|
b.info(`Retrying rate limited ${this.Xa(s)}SDK request.`),
|
|
@@ -257,32 +257,32 @@ export default class Vt {
|
|
|
257
257
|
this.La = {};
|
|
258
258
|
}
|
|
259
259
|
et(t, e, i, r) {
|
|
260
|
-
if (!this.
|
|
260
|
+
if (!this.yl(i))
|
|
261
261
|
return (
|
|
262
262
|
b.info(`${this.Xa(i)}SDK request being rate limited.`),
|
|
263
263
|
void ("function" == typeof r && r())
|
|
264
264
|
);
|
|
265
|
-
const n = this.
|
|
266
|
-
if (!n.
|
|
265
|
+
const n = this.wl();
|
|
266
|
+
if (!n.Nl)
|
|
267
267
|
return (
|
|
268
|
-
this.
|
|
268
|
+
this.kl(n.Bl, t, e, i),
|
|
269
269
|
void b.info(
|
|
270
270
|
`${this.Xa(
|
|
271
271
|
i,
|
|
272
272
|
)}SDK request being rate limited. Request will be retried in ${Math.trunc(
|
|
273
|
-
n.
|
|
273
|
+
n.Bl / 1e3,
|
|
274
274
|
)} seconds.`,
|
|
275
275
|
)
|
|
276
276
|
);
|
|
277
|
-
this.j.Pt(s.It.
|
|
277
|
+
this.j.Pt(s.It.Sl, new Date().valueOf());
|
|
278
278
|
const o = t.device;
|
|
279
279
|
o && o.os_version instanceof Promise
|
|
280
280
|
? o.os_version.then((i) => {
|
|
281
|
-
(t.device.os_version = i), e(n.
|
|
281
|
+
(t.device.os_version = i), e(n.Cl);
|
|
282
282
|
})
|
|
283
|
-
: e(n.
|
|
283
|
+
: e(n.Cl);
|
|
284
284
|
}
|
|
285
|
-
|
|
285
|
+
zl(t) {
|
|
286
286
|
const e = t ? Oe(t) : null;
|
|
287
287
|
if (!e || !e["retry-after"]) return null;
|
|
288
288
|
const i = e["retry-after"];
|
|
@@ -293,21 +293,21 @@ export default class Vt {
|
|
|
293
293
|
{
|
|
294
294
|
const t =
|
|
295
295
|
"Received unexpected value for retry-after header in /sync response";
|
|
296
|
-
v.Dt(p.
|
|
296
|
+
v.Dt(p.Qa, { e: t + ": " + i });
|
|
297
297
|
}
|
|
298
298
|
return null;
|
|
299
299
|
}
|
|
300
300
|
yt(t, e, i, s, r, n) {
|
|
301
|
-
if (h.
|
|
301
|
+
if (h.Dl(this.j, i) >= Pe) return;
|
|
302
302
|
let o;
|
|
303
303
|
n = n || 0;
|
|
304
|
-
const a = this.
|
|
304
|
+
const a = this.zl(t);
|
|
305
305
|
r();
|
|
306
306
|
const u = (t) => {
|
|
307
307
|
const r = window.setTimeout(() => {
|
|
308
308
|
e();
|
|
309
309
|
}, t);
|
|
310
|
-
s(r), h.
|
|
310
|
+
s(r), h.jl(this.j, i);
|
|
311
311
|
};
|
|
312
312
|
if (a && !isNaN(a.value)) {
|
|
313
313
|
switch (a.type) {
|
|
@@ -320,44 +320,44 @@ export default class Vt {
|
|
|
320
320
|
u(o);
|
|
321
321
|
} else n ? u(n) : h.Ji(this.j, i);
|
|
322
322
|
}
|
|
323
|
-
|
|
323
|
+
Ml(t) {
|
|
324
324
|
var e;
|
|
325
|
-
null === (e = this.j) || void 0 === e || e.Pt(s.It.
|
|
325
|
+
null === (e = this.j) || void 0 === e || e.Pt(s.It.Xl, t);
|
|
326
326
|
}
|
|
327
|
-
|
|
328
|
-
let i = this
|
|
329
|
-
null == i && (i = {}), (i[t] = e), this.j.Pt(s.It.
|
|
327
|
+
$l(t, e) {
|
|
328
|
+
let i = this.Ll();
|
|
329
|
+
null == i && (i = {}), (i[t] = e), this.j.Pt(s.It.El, i);
|
|
330
330
|
}
|
|
331
|
-
|
|
331
|
+
Fl() {
|
|
332
332
|
var t;
|
|
333
|
-
return null === (t = this.j) || void 0 === t ? void 0 : t.St(s.It.
|
|
333
|
+
return null === (t = this.j) || void 0 === t ? void 0 : t.St(s.It.Xl);
|
|
334
334
|
}
|
|
335
|
-
|
|
335
|
+
Ll() {
|
|
336
336
|
var t;
|
|
337
|
-
return null === (t = this.j) || void 0 === t ? void 0 : t.St(s.It.
|
|
337
|
+
return null === (t = this.j) || void 0 === t ? void 0 : t.St(s.It.El);
|
|
338
338
|
}
|
|
339
|
-
|
|
339
|
+
Il(t, e, i, s, r = "") {
|
|
340
340
|
let n;
|
|
341
341
|
if (r) {
|
|
342
|
-
const t = this
|
|
342
|
+
const t = this.Ll();
|
|
343
343
|
n = null == t || isNaN(t[r]) ? e : t[r];
|
|
344
|
-
} else (n = this.
|
|
344
|
+
} else (n = this.Fl()), (null == n || isNaN(n)) && (n = e);
|
|
345
345
|
const o = (t - s) / 1e3;
|
|
346
346
|
return (n = Math.min(n + o / i, e)), n;
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
Kl(t, e) {
|
|
349
349
|
return Math.max(0, (1 - t) * e * 1e3);
|
|
350
350
|
}
|
|
351
|
-
|
|
351
|
+
Pl(t, e = "") {
|
|
352
352
|
var i, r, n, o, a;
|
|
353
|
-
const u = {
|
|
353
|
+
const u = { Nl: !0, Cl: -1, Bl: 0 };
|
|
354
354
|
if ((null == t && (t = !0), !t && !e)) return u;
|
|
355
355
|
let l,
|
|
356
356
|
c,
|
|
357
357
|
d = null;
|
|
358
|
-
if (t) d = null === (i = this.j) || void 0 === i ? void 0 : i.St(s.It.
|
|
358
|
+
if (t) d = null === (i = this.j) || void 0 === i ? void 0 : i.St(s.It.Sl);
|
|
359
359
|
else {
|
|
360
|
-
const t = h.
|
|
360
|
+
const t = h.Ul(this.j);
|
|
361
361
|
if (null == t || null == t[e]) return u;
|
|
362
362
|
d = t[e];
|
|
363
363
|
}
|
|
@@ -365,30 +365,30 @@ export default class Vt {
|
|
|
365
365
|
if (
|
|
366
366
|
(t
|
|
367
367
|
? ((l =
|
|
368
|
-
(null === (r = this.h) || void 0 === r ? void 0 : r.
|
|
369
|
-
(c = (null === (n = this.h) || void 0 === n ? void 0 : n.
|
|
368
|
+
(null === (r = this.h) || void 0 === r ? void 0 : r.xl()) || -1),
|
|
369
|
+
(c = (null === (n = this.h) || void 0 === n ? void 0 : n.Hl()) || -1))
|
|
370
370
|
: ((l =
|
|
371
|
-
(null === (o = this.h) || void 0 === o ? void 0 : o.
|
|
371
|
+
(null === (o = this.h) || void 0 === o ? void 0 : o.Ol(e)) || -1),
|
|
372
372
|
(c =
|
|
373
|
-
(null === (a = this.h) || void 0 === a ? void 0 : a.
|
|
373
|
+
(null === (a = this.h) || void 0 === a ? void 0 : a.Gl(e)) || -1)),
|
|
374
374
|
-1 === l || -1 === c)
|
|
375
375
|
)
|
|
376
376
|
return u;
|
|
377
377
|
const f = new Date().valueOf();
|
|
378
|
-
let m = this.
|
|
378
|
+
let m = this.Il(f, l, c, d, e);
|
|
379
379
|
return m < 1
|
|
380
|
-
? ((u.
|
|
380
|
+
? ((u.Nl = !1), (u.Bl = this.Kl(m, c)), u)
|
|
381
381
|
: ((m = Math.trunc(m) - 1),
|
|
382
|
-
(u.
|
|
383
|
-
t ? this.
|
|
382
|
+
(u.Cl = m),
|
|
383
|
+
t ? this.Ml(m) : this.$l(e, m),
|
|
384
384
|
u);
|
|
385
385
|
}
|
|
386
|
-
|
|
387
|
-
return this.
|
|
386
|
+
wl() {
|
|
387
|
+
return this.Pl(!0);
|
|
388
388
|
}
|
|
389
|
-
|
|
390
|
-
const e = this.
|
|
391
|
-
return !(e && !e.
|
|
389
|
+
yl(t) {
|
|
390
|
+
const e = this.Pl(!1, t);
|
|
391
|
+
return !(e && !e.Nl);
|
|
392
392
|
}
|
|
393
393
|
ct() {
|
|
394
394
|
this.Gh.ct();
|
|
@@ -13,31 +13,31 @@ export default class Yt {
|
|
|
13
13
|
constructor(t) {
|
|
14
14
|
(this.j = t),
|
|
15
15
|
(this.j = t),
|
|
16
|
-
(this.Gl = new f()),
|
|
17
16
|
(this._l = new f()),
|
|
18
17
|
(this.Vl = new f()),
|
|
19
18
|
(this.Jl = new f()),
|
|
20
19
|
(this.Ql = new f()),
|
|
21
20
|
(this.Wl = new f()),
|
|
22
|
-
(this.Yl =
|
|
23
|
-
(this.Zl = null)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
(this.Yl = new f()),
|
|
22
|
+
(this.Zl = null),
|
|
23
|
+
(this.ed = null);
|
|
24
|
+
}
|
|
25
|
+
sd() {
|
|
26
|
+
if (null == this.ed) {
|
|
27
|
+
const t = this.j.St(s.It.nd);
|
|
28
|
+
this.ed = null != t ? di._u(t) : new di();
|
|
29
29
|
}
|
|
30
|
-
return this.
|
|
30
|
+
return this.ed;
|
|
31
31
|
}
|
|
32
32
|
Qt() {
|
|
33
|
-
return this.
|
|
33
|
+
return this.sd().ld;
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
ud(t) {
|
|
36
36
|
var i, e, n, l, r, o;
|
|
37
37
|
if (null != t && null != t.config) {
|
|
38
38
|
const u = t.config;
|
|
39
|
-
if (u.time > this.
|
|
40
|
-
const t = (t) => (null == t ? this.
|
|
39
|
+
if (u.time > this.sd().ld) {
|
|
40
|
+
const t = (t) => (null == t ? this.sd().ad : t),
|
|
41
41
|
a = new di(
|
|
42
42
|
u.time,
|
|
43
43
|
u.events_blacklist,
|
|
@@ -55,9 +55,9 @@ export default class Yt {
|
|
|
55
55
|
u.conversational_chat,
|
|
56
56
|
);
|
|
57
57
|
let h = !1;
|
|
58
|
-
null != a.
|
|
58
|
+
null != a.hd && this.ju() !== a.hd && (h = !0);
|
|
59
59
|
let d = !1;
|
|
60
|
-
null != a.
|
|
60
|
+
null != a.dd.enabled && this.Pi() !== a.dd.enabled && (d = !0);
|
|
61
61
|
let c = !1;
|
|
62
62
|
null != a.Xr.enabled && this.lo() !== a.Xr.enabled && (c = !0);
|
|
63
63
|
let v = !1;
|
|
@@ -72,105 +72,105 @@ export default class Yt {
|
|
|
72
72
|
(null === (l = a.dust) || void 0 === l ? void 0 : l.enabled) &&
|
|
73
73
|
(m = !0);
|
|
74
74
|
let g = !1;
|
|
75
|
-
null != (null === (r = a.
|
|
76
|
-
this.
|
|
77
|
-
(null === (o = a.
|
|
75
|
+
null != (null === (r = a.vd) || void 0 === r ? void 0 : r.enabled) &&
|
|
76
|
+
this.md() !==
|
|
77
|
+
(null === (o = a.vd) || void 0 === o ? void 0 : o.enabled) &&
|
|
78
78
|
(g = !0),
|
|
79
|
-
(this.
|
|
80
|
-
this.j.Pt(s.It.
|
|
81
|
-
h && this.
|
|
82
|
-
d && this.
|
|
83
|
-
c && this.
|
|
84
|
-
v && this.
|
|
85
|
-
m && this.
|
|
86
|
-
g && this.
|
|
79
|
+
(this.ed = a),
|
|
80
|
+
this.j.Pt(s.It.nd, a.qt()),
|
|
81
|
+
h && this._l.A(),
|
|
82
|
+
d && this.Vl.A(),
|
|
83
|
+
c && this.Jl.A(),
|
|
84
|
+
v && this.Ql.A(),
|
|
85
|
+
m && this.Wl.A(),
|
|
86
|
+
g && this.Yl.A();
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
xu(t) {
|
|
91
|
-
const i = this.
|
|
92
|
-
return this.
|
|
91
|
+
const i = this._l.Ut(t);
|
|
92
|
+
return this.Zl && this._l.removeSubscription(this.Zl), (this.Zl = i), i;
|
|
93
93
|
}
|
|
94
94
|
$i(t) {
|
|
95
|
-
return this._l.Ut(t);
|
|
96
|
-
}
|
|
97
|
-
bo(t) {
|
|
98
95
|
return this.Vl.Ut(t);
|
|
99
96
|
}
|
|
100
|
-
|
|
97
|
+
bo(t) {
|
|
101
98
|
return this.Jl.Ut(t);
|
|
102
99
|
}
|
|
103
|
-
|
|
100
|
+
V(t) {
|
|
104
101
|
return this.Ql.Ut(t);
|
|
105
102
|
}
|
|
106
|
-
|
|
103
|
+
Tr(t) {
|
|
107
104
|
return this.Wl.Ut(t);
|
|
108
105
|
}
|
|
106
|
+
gd(t) {
|
|
107
|
+
return this.Yl.Ut(t);
|
|
108
|
+
}
|
|
109
109
|
$e(t) {
|
|
110
|
-
return -1 !== this.
|
|
110
|
+
return -1 !== this.sd().bd.indexOf(t);
|
|
111
111
|
}
|
|
112
112
|
qu(t) {
|
|
113
|
-
return -1 !== this.
|
|
113
|
+
return -1 !== this.sd().fd.indexOf(t);
|
|
114
114
|
}
|
|
115
115
|
$r(t) {
|
|
116
|
-
return -1 !== this.
|
|
116
|
+
return -1 !== this.sd().pd.indexOf(t);
|
|
117
117
|
}
|
|
118
|
-
|
|
119
|
-
return this.
|
|
118
|
+
Rd() {
|
|
119
|
+
return this.sd().Cd;
|
|
120
120
|
}
|
|
121
121
|
ju() {
|
|
122
|
-
return this.
|
|
122
|
+
return this.sd().hd;
|
|
123
123
|
}
|
|
124
124
|
Pi() {
|
|
125
|
-
return this.
|
|
125
|
+
return this.sd().dd.enabled || !1;
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
const t = this.
|
|
127
|
+
Ed() {
|
|
128
|
+
const t = this.sd().ad;
|
|
129
129
|
return !(!t || null == t.enabled) && t.enabled;
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
if (!this.
|
|
133
|
-
const t = this.
|
|
131
|
+
xl() {
|
|
132
|
+
if (!this.Ed()) return -1;
|
|
133
|
+
const t = this.sd().ad;
|
|
134
134
|
return null == t.capacity || t.capacity < 10 ? -1 : t.capacity;
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
if (!this.
|
|
138
|
-
const t = this.
|
|
136
|
+
Hl() {
|
|
137
|
+
if (!this.Ed()) return -1;
|
|
138
|
+
const t = this.sd().ad;
|
|
139
139
|
return null == t.refill_rate || t.refill_rate <= 0 ? -1 : t.refill_rate;
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
const i = this.
|
|
141
|
+
wd(t) {
|
|
142
|
+
const i = this.sd().ad.endpoint_overrides;
|
|
143
143
|
return null == i ? null : i[t];
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
const i = this.
|
|
145
|
+
Ol(t) {
|
|
146
|
+
const i = this.wd(t);
|
|
147
147
|
return null == i || isNaN(i.capacity) || i.capacity <= 0 ? -1 : i.capacity;
|
|
148
148
|
}
|
|
149
|
-
|
|
150
|
-
const i = this.
|
|
149
|
+
Gl(t) {
|
|
150
|
+
const i = this.wd(t);
|
|
151
151
|
return null == i || isNaN(i.refill_rate) || i.refill_rate <= 0
|
|
152
152
|
? -1
|
|
153
153
|
: i.refill_rate;
|
|
154
154
|
}
|
|
155
155
|
lo() {
|
|
156
|
-
return this.
|
|
157
|
-
? (v.Dt(p.
|
|
158
|
-
: this.
|
|
156
|
+
return this.sd().Xr.enabled && null == this.Ro()
|
|
157
|
+
? (v.Dt(p.Qa, { e: "Missing feature flag refresh_rate_limit." }), !1)
|
|
158
|
+
: this.sd().Xr.enabled || !1;
|
|
159
159
|
}
|
|
160
160
|
Ro() {
|
|
161
|
-
return this.
|
|
161
|
+
return this.sd().Xr.refresh_rate_limit;
|
|
162
162
|
}
|
|
163
163
|
Ot() {
|
|
164
164
|
var t;
|
|
165
165
|
return (
|
|
166
|
-
(null === (t = this.
|
|
166
|
+
(null === (t = this.sd().banners) || void 0 === t ? void 0 : t.enabled) ||
|
|
167
167
|
null
|
|
168
168
|
);
|
|
169
169
|
}
|
|
170
170
|
re() {
|
|
171
171
|
var t;
|
|
172
172
|
return (
|
|
173
|
-
(null === (t = this.
|
|
173
|
+
(null === (t = this.sd().banners) || void 0 === t
|
|
174
174
|
? void 0
|
|
175
175
|
: t.max_placements) || 0
|
|
176
176
|
);
|
|
@@ -178,7 +178,7 @@ export default class Yt {
|
|
|
178
178
|
Gt() {
|
|
179
179
|
var t;
|
|
180
180
|
const i =
|
|
181
|
-
null === (t = this.
|
|
181
|
+
null === (t = this.sd().banners) || void 0 === t
|
|
182
182
|
? void 0
|
|
183
183
|
: t.dismissals_cache_size;
|
|
184
184
|
return null != i && "number" == typeof i && i > 0 ? i : u;
|
|
@@ -186,19 +186,19 @@ export default class Yt {
|
|
|
186
186
|
fn() {
|
|
187
187
|
var t;
|
|
188
188
|
return (
|
|
189
|
-
(null === (t = this.
|
|
189
|
+
(null === (t = this.sd().dust) || void 0 === t ? void 0 : t.enabled) || !1
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
md() {
|
|
193
193
|
var t;
|
|
194
194
|
return (
|
|
195
|
-
(null === (t = this.
|
|
195
|
+
(null === (t = this.sd().vd) || void 0 === t ? void 0 : t.enabled) || !1
|
|
196
196
|
);
|
|
197
197
|
}
|
|
198
198
|
vt() {
|
|
199
199
|
var t;
|
|
200
200
|
const i =
|
|
201
|
-
null === (t = this.
|
|
201
|
+
null === (t = this.sd().Bd) || void 0 === t
|
|
202
202
|
? void 0
|
|
203
203
|
: t.min_sleep_duration_ms;
|
|
204
204
|
return null != i ? i : d;
|
|
@@ -206,18 +206,18 @@ export default class Yt {
|
|
|
206
206
|
gt() {
|
|
207
207
|
var t;
|
|
208
208
|
const i =
|
|
209
|
-
null === (t = this.
|
|
209
|
+
null === (t = this.sd().Bd) || void 0 === t ? void 0 : t.scale_factor;
|
|
210
210
|
return null != i ? i : m;
|
|
211
211
|
}
|
|
212
212
|
bt() {
|
|
213
213
|
var t;
|
|
214
214
|
const i =
|
|
215
|
-
null === (t = this.
|
|
215
|
+
null === (t = this.sd().Bd) || void 0 === t
|
|
216
216
|
? void 0
|
|
217
217
|
: t.max_sleep_duration_ms;
|
|
218
218
|
return null != i ? i : c;
|
|
219
219
|
}
|
|
220
|
-
|
|
221
|
-
return this.
|
|
220
|
+
Td() {
|
|
221
|
+
return this.sd().yd;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
@@ -17,7 +17,7 @@ export default class Xt {
|
|
|
17
17
|
(this.j = s),
|
|
18
18
|
(this.Ss = t),
|
|
19
19
|
(this.h = i);
|
|
20
|
-
const n = this.h.
|
|
20
|
+
const n = this.h.Td();
|
|
21
21
|
(this.im = n ? 1e3 * n : ts),
|
|
22
22
|
(null == e || isNaN(e)) && (e = 1800),
|
|
23
23
|
e < this.im / 1e3 &&
|
|
@@ -42,7 +42,7 @@ export default class Xt {
|
|
|
42
42
|
}
|
|
43
43
|
am() {
|
|
44
44
|
const t = new Date().valueOf(),
|
|
45
|
-
i = this.h.
|
|
45
|
+
i = this.h.Rd();
|
|
46
46
|
if (null == i) return !1;
|
|
47
47
|
const e = this.j.St(s.It.dm),
|
|
48
48
|
n = null == e || t - e > 1e3 * i;
|
|
@@ -21,20 +21,20 @@ export const STORAGE_KEYS = {
|
|
|
21
21
|
ZE: "ab.storage.events",
|
|
22
22
|
$E: "ab.storage.attributes",
|
|
23
23
|
tS: "ab.storage.attributes.anonymous_user",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
Ha: "ab.storage.device",
|
|
25
|
+
Pa: "ab.storage.sdk_metadata",
|
|
26
|
+
Ua: "ab.storage.session_id_for_cached_metadata",
|
|
27
27
|
Uu: "ab.storage.pushToken",
|
|
28
28
|
eS: "ab.storage.cardImpressions",
|
|
29
|
-
|
|
29
|
+
nd: "ab.storage.serverConfig",
|
|
30
30
|
sS: "ab.storage.triggers",
|
|
31
31
|
rS: "ab.storage.triggers.ts",
|
|
32
32
|
dm: "ab.storage.messagingSessionStart",
|
|
33
33
|
bi: "ab.storage.cc",
|
|
34
34
|
ji: "ab.storage.ccLastFullSync",
|
|
35
35
|
yi: "ab.storage.ccLastCardUpdated",
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
Xl: "ab.storage.globalRateLimitCurrentTokenCount",
|
|
37
|
+
El: "ab.storage.dynamicRateLimitCurrentTokenCount",
|
|
38
38
|
Zt: "ab.storage.ccClicks",
|
|
39
39
|
ps: "ab.storage.ccImpressions",
|
|
40
40
|
fs: "ab.storage.ccDismissals",
|
|
@@ -51,7 +51,7 @@ export const STORAGE_KEYS = {
|
|
|
51
51
|
ES: "ab.storage.lastReqToEndpoint",
|
|
52
52
|
SS: "ab.storage.requestAttempts",
|
|
53
53
|
pa: "ab.storage.deferredIam",
|
|
54
|
-
|
|
54
|
+
Sl: "ab.storage.lastSdkReq",
|
|
55
55
|
lS: "ab.storage.alias",
|
|
56
56
|
Tt: "ab.storage.banners",
|
|
57
57
|
At: "ab.storage.banners.impressions",
|
|
@@ -144,7 +144,7 @@ export default class ne {
|
|
|
144
144
|
typeof t +
|
|
145
145
|
": " +
|
|
146
146
|
JSON.stringify(t)),
|
|
147
|
-
e.push(new Ie(null, p.
|
|
147
|
+
e.push(new Ie(null, p.Qa, new Date().valueOf(), null, { e: o }));
|
|
148
148
|
}
|
|
149
149
|
return e;
|
|
150
150
|
}
|
|
@@ -193,7 +193,7 @@ export default class ne {
|
|
|
193
193
|
gS(t) {
|
|
194
194
|
return t || STORAGE_KEYS.It.tS;
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
Rl(t) {
|
|
197
197
|
let e = this.uS.wr(STORAGE_KEYS.It.$E);
|
|
198
198
|
null == e && (e = {});
|
|
199
199
|
const s = this.gS(t[User.Sa]),
|
|
@@ -232,7 +232,7 @@ export default class ne {
|
|
|
232
232
|
((e[s] = void 0),
|
|
233
233
|
this.uS.store(STORAGE_KEYS.It.$E, e),
|
|
234
234
|
(r[User.Sa] = t),
|
|
235
|
-
this.
|
|
235
|
+
this.Rl(r));
|
|
236
236
|
}
|
|
237
237
|
const s = this.$u(STORAGE_KEYS.Ou.um);
|
|
238
238
|
let r = null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
Za: "invalid_api_key",
|
|
3
|
+
dl: "blacklisted",
|
|
4
|
+
fl: "no_device_identifier",
|
|
5
|
+
Va: "invalid_json_response",
|
|
6
|
+
Ya: "empty_response",
|
|
7
7
|
__: "sdk_auth_error",
|
|
8
8
|
};
|